BALL::VIEW::Representation Class Reference
[Geometric primitives and their management]

#include <BALL/VIEW/KERNEL/representation.h>

Inheritance diagram for BALL::VIEW::Representation:
BALL::PropertyManager

List of all members.


Public Types

Enums
enum  Properties { PROPERTY__ALWAYS_FRONT = 0, PROPERTY__IS_COORDINATE_SYSTEM }
 

Properties.

More...

Public Member Functions

Constructors and Destuctor
 Representation ()
 Representation (ModelType model_type, DrawingPrecision drawing_precision, DrawingMode drawing_mode)
 Representation (const Representation &representation)
virtual ~Representation ()
Predicats and Accessors
const Representationoperator= (const Representation &rep)
void clear ()
 

Clears all properties.


void setHidden (bool state)
bool isHidden () const
void setDrawingPrecision (DrawingPrecision precision)
DrawingPrecision getDrawingPrecision () const
float getSurfaceDrawingPrecision () const
void setSurfaceDrawingPrecision (float precision)
void setDrawingMode (DrawingMode mode)
DrawingMode getDrawingMode () const
Size getTransparency () const
 

get transparency (0 - 255)


void setTransparency (Size value)
 

set transparency (0 - 255)


const GeometricObjectListgetGeometricObjects () const
GeometricObjectListgetGeometricObjects ()
void setGeometricObjects (GeometricObjectList &gol)
void insert (GeometricObject &object)
const List< const Composite * > & getComposites () const
void setComposites (const List< const Composite * > &composites)
void setComposite (const Composite *composite)
const ModelProcessorgetModelProcessor () const
ModelProcessorgetModelProcessor ()
void setModelProcessor (ModelProcessor *processor)
ColorProcessorgetColorProcessor ()
void setColorProcessor (ColorProcessor *processor)
void setModelType (ModelType type)
ModelType getModelType () const
String getName () const
void setName (const String &name)
String getCompositeName () const
 

Returns a human-readable, potentially abbreviated string describing the molecular entity this representation belongs to.


void setColoringMethod (ColoringMethod type)
ColoringMethod getColoringMethod () const
void enableModelUpdate (bool state)
void enableColoringUpdate (bool state)
bool modelUpdateEnabled () const
bool coloringUpdateEnabled () const
String getProperties () const
 

Get a descpription string (nr triangles and geometric objects, transparency, mode).


bool isValid () const
 

Check if drawing mode, transparency and drawing precision have reasonable values.


void update (bool rebuild)
void clearGeometricObjects ()
 

Clear and destroy all stored GeometricObject.


const PreciseTimegetModelBuildTime () const
bool needsUpdate () const
void setNeedsUpdate (bool state=true)
void dump (std::ostream &s=std::cout, Size depth=0) const
 

Dum to ostream for debugging.


String toString () const
 

Get a String containing all settings for Usage in project files.


void setModelInformation (const ModelInformation &mi)
 

Set a custom ModelInformation e.g. when new models were added external of the library.


const ModelInformationgetModelInformation () const
bool operator== (const Representation &object) const
bool operator< (const Representation &object) const
 

Needed for MSVC.



Protected Member Functions

void update_ ()
void collectRecursive_ (const Composite &c, HashMap< const Composite *, Position > &hashmap) const

Protected Attributes

DrawingMode drawing_mode_
DrawingPrecision drawing_precision_
float surface_drawing_precision_
ModelType model_type_
ColoringMethod coloring_method_
Size transparency_
ModelProcessormodel_processor_
ColorProcessorcolor_processor_
List< const Composite * > composites_
PreciseTime model_build_time_
bool needs_update_
bool rebuild_
bool changed_color_processor_
bool hidden_
GeometricObjectList geometric_objects_
bool model_update_enabled_
bool coloring_update_enabled_
String name_
const ModelInformationcustom_model_information_

Static Protected Attributes

static MolecularInformation information_
static ModelInformation model_information_

Friends

class UpdateRepresentationThread
class RepresentationManager

Detailed Description

Representation A Representation is a collection of geometric objects for a group of composites and a given model, for example a surface. An instance of Representation manages the memory for the geometric objects, the ColorProcessor and the ModelProcessor. So when a Representation is destroyed, so are its geometric objects and processors. It stores the drawing precision and mode.


Member Enumeration Documentation

Properties.

Enumerator:
PROPERTY__ALWAYS_FRONT 
PROPERTY__IS_COORDINATE_SYSTEM 

Constructor & Destructor Documentation

BALL::VIEW::Representation::Representation (  ) 

Default Constructor

BALL::VIEW::Representation::Representation ( ModelType  model_type,
DrawingPrecision  drawing_precision,
DrawingMode  drawing_mode 
)
BALL::VIEW::Representation::Representation ( const Representation representation  ) 

Copy constructor

virtual BALL::VIEW::Representation::~Representation (  )  [virtual]

Destructor


Member Function Documentation

void BALL::VIEW::Representation::clear (  )  [virtual]

Clears all properties.

Reimplemented from BALL::PropertyManager.

void BALL::VIEW::Representation::clearGeometricObjects (  ) 

Clear and destroy all stored GeometricObject.

void BALL::VIEW::Representation::collectRecursive_ ( const Composite c,
HashMap< const Composite *, Position > &  hashmap 
) const [protected]
bool BALL::VIEW::Representation::coloringUpdateEnabled (  )  const [inline]
void BALL::VIEW::Representation::dump ( std::ostream &  s = std::cout,
Size  depth = 0 
) const

Dum to ostream for debugging.

Reimplemented from BALL::PropertyManager.

void BALL::VIEW::Representation::enableColoringUpdate ( bool  state  )  [inline]
void BALL::VIEW::Representation::enableModelUpdate ( bool  state  ) 
ColoringMethod BALL::VIEW::Representation::getColoringMethod (  )  const
ColorProcessor* BALL::VIEW::Representation::getColorProcessor (  ) 
String BALL::VIEW::Representation::getCompositeName (  )  const

Returns a human-readable, potentially abbreviated string describing the molecular entity this representation belongs to.

const List<const Composite*>& BALL::VIEW::Representation::getComposites (  )  const [inline]
DrawingMode BALL::VIEW::Representation::getDrawingMode (  )  const
DrawingPrecision BALL::VIEW::Representation::getDrawingPrecision (  )  const
GeometricObjectList& BALL::VIEW::Representation::getGeometricObjects (  ) 
const GeometricObjectList& BALL::VIEW::Representation::getGeometricObjects (  )  const
const PreciseTime& BALL::VIEW::Representation::getModelBuildTime (  )  const

Get the time when the model was builded This is needed for updating the Representation, after the vector of atom attributes was modified.

See also:
Atom::getAttributesModificationTime
const ModelInformation& BALL::VIEW::Representation::getModelInformation (  )  const
ModelProcessor* BALL::VIEW::Representation::getModelProcessor (  ) 
const ModelProcessor* BALL::VIEW::Representation::getModelProcessor (  )  const
ModelType BALL::VIEW::Representation::getModelType (  )  const
String BALL::VIEW::Representation::getName (  )  const
String BALL::VIEW::Representation::getProperties (  )  const

Get a descpription string (nr triangles and geometric objects, transparency, mode).

float BALL::VIEW::Representation::getSurfaceDrawingPrecision (  )  const
Size BALL::VIEW::Representation::getTransparency (  )  const

get transparency (0 - 255)

void BALL::VIEW::Representation::insert ( GeometricObject object  ) 
bool BALL::VIEW::Representation::isHidden (  )  const
bool BALL::VIEW::Representation::isValid (  )  const

Check if drawing mode, transparency and drawing precision have reasonable values.

Reimplemented from BALL::PropertyManager.

bool BALL::VIEW::Representation::modelUpdateEnabled (  )  const [inline]
bool BALL::VIEW::Representation::needsUpdate (  )  const

Returns true, if Representation needs to be updated. Called by GeometricControl. Uses needs_update_.

bool BALL::VIEW::Representation::operator< ( const Representation object  )  const [inline]

Needed for MSVC.

const Representation& BALL::VIEW::Representation::operator= ( const Representation rep  ) 
bool BALL::VIEW::Representation::operator== ( const Representation object  )  const
void BALL::VIEW::Representation::setColoringMethod ( ColoringMethod  type  ) 
void BALL::VIEW::Representation::setColorProcessor ( ColorProcessor processor  ) 
void BALL::VIEW::Representation::setComposite ( const Composite composite  ) 
void BALL::VIEW::Representation::setComposites ( const List< const Composite * > &  composites  ) 
void BALL::VIEW::Representation::setDrawingMode ( DrawingMode  mode  ) 
void BALL::VIEW::Representation::setDrawingPrecision ( DrawingPrecision  precision  ) 
void BALL::VIEW::Representation::setGeometricObjects ( GeometricObjectList gol  )  [inline]
void BALL::VIEW::Representation::setHidden ( bool  state  ) 
void BALL::VIEW::Representation::setModelInformation ( const ModelInformation mi  ) 

Set a custom ModelInformation e.g. when new models were added external of the library.

void BALL::VIEW::Representation::setModelProcessor ( ModelProcessor processor  ) 
void BALL::VIEW::Representation::setModelType ( ModelType  type  ) 
void BALL::VIEW::Representation::setName ( const String name  ) 
void BALL::VIEW::Representation::setNeedsUpdate ( bool  state = true  ) 
void BALL::VIEW::Representation::setSurfaceDrawingPrecision ( float  precision  ) 
void BALL::VIEW::Representation::setTransparency ( Size  value  ) 

set transparency (0 - 255)

String BALL::VIEW::Representation::toString (  )  const

Get a String containing all settings for Usage in project files.

void BALL::VIEW::Representation::update ( bool  rebuild  ) 

Apply ModelProcessor (if rebuild) and ColorProcessor. The usage of these processors can be disabled, either by setting a NULL-pointer accordingly or call enableColoringUpdate(false) and enableModelUpdate(false).

void BALL::VIEW::Representation::update_ (  )  [protected]

Wrapper method for multithreading. Can be called by update() directly, or by the RepresentationManager' s UpdateRepresentationThread.


Friends And Related Function Documentation

friend class RepresentationManager [friend]
friend class UpdateRepresentationThread [friend]

Member Data Documentation