Main Page | Modules | Namespace List | Class Hierarchy | Class List | Namespace Members | Class Members

VIEW::AddBallAndStickModel Class Reference
[Model Processors]

AddBallAndStickModel class. More...

#include <ballAndStickModel.h>

Inheritance diagram for VIEW::AddBallAndStickModel:

VIEW::AtomBondModelBaseProcessor VIEW::ModelProcessor UnaryProcessor< Composite > PropertyManager UnaryFunctor< Composite, Processor::Result > List of all members.

Public Member Functions

virtual bool createGeometricObjects () throw ()
 Method to create geometric objects.
Constructors and Destructors
 AddBallAndStickModel () throw ()
 Default Constructor.
 AddBallAndStickModel (const AddBallAndStickModel &add_ball_and_stick_model) throw ()
 Copy constructor.
virtual ~AddBallAndStickModel () throw ()
 Destructor.
virtual void clear () throw ()
 Explicit default initialization.
Assignment
void set (const AddBallAndStickModel &add_ball_and_stick_model) throw ()
 Assignment.
const AddBallAndStickModeloperator= (const AddBallAndStickModel &processor) throw ()
 Assignment operator.
Accessors: inspectors and mutators
This methods are used to specify the appearance of the model.

This processor can either be used for creating a ball and stick model or a stick model. For the ball-component (the graphical representation of the Atom object) and the stick-component (the graphical representation of the Bond object) different radi can be assigned.

void setBallRadius (const float radius) throw (Exception::OutOfRange)
 Change the radius of the ball-component.
float getBallRadius () const throw ()
 Inspection of the radius of the ball-component.
void setStickRadius (const float radius) throw (Exception::OutOfRange)
 Change the radius of the stick-component.
float getStickRadius () const throw ()
 Inspection of the radius of the stick-component.
void enableBallAndStickModel () throw ()
 Enable the creation of the ball and stick model.
void enableStickModel () throw ()
 Enable the creation of the stick model.
Processor specific methods
virtual Processor::Result operator() (Composite &composite)
 Operator () method.
Predicates
bool isBallAndStickModel () const throw ()
 Test if create ball and stick model.
bool isStickModel () const throw ()
 Test if create a stick model.
bool dashedBondsEnabled () const throw ()
void enableDashedBonds (bool state) throw ()
debuggers and diagnostics
virtual void dump (std::ostream &s=std::cout, Size depth=0) const throw ()
 Internal value dump.

Protected Member Functions

void visualiseBond_ (const Bond &bond) throw ()
virtual void visualiseRings_ () throw ()
void renderStandardBond_ (const Bond &bond) throw ()
void renderMultipleBond_ (const Bond &bond, Vector3 normal, Vector3 dir)
void renderDashedBond_ (const Bond &bond, Vector3 n) throw (Exception::DivisionByZero)
void collectRingBonds_ ()
Vector3 getSP2Plane_ (const Atom &atom, const Bond &bond, const Vector3 &dir) const

Detailed Description

AddBallAndStickModel class.

The class AddBallAndStickModel is a model processor that is responsible for creating either a ball and stick model or a stick model. In a ball and stick model the graphical representation of the Atom objects (Sphere objects) have a different radius than the representation of the Bond objects (Tube objects). Otherwise in the stick model the radi of the ball and the stick components are equal. For information about the processor concept see Processor in the BALL documentation.


Constructor & Destructor Documentation

VIEW::AddBallAndStickModel::AddBallAndStickModel  )  throw ()
 

Default Constructor.

Set the appearance to:

  • set the appearance to ball and stick model
  • set the ball radius to 0.4
  • set the stick radius to 0.2

VIEW::AddBallAndStickModel::AddBallAndStickModel const AddBallAndStickModel add_ball_and_stick_model  )  throw ()
 

Copy constructor.

virtual VIEW::AddBallAndStickModel::~AddBallAndStickModel  )  throw () [virtual]
 

Destructor.


Member Function Documentation

virtual void VIEW::AddBallAndStickModel::clear  )  throw () [virtual]
 

Explicit default initialization.

Reset the state of this AddBallAndStickModel to:

Reimplemented from VIEW::AtomBondModelBaseProcessor.

virtual bool VIEW::AddBallAndStickModel::createGeometricObjects  )  throw () [virtual]
 

Method to create geometric objects.

This method is called in Representation::update() after all operator() was called for all Composites. To be overloaded in derived classes

Reimplemented from VIEW::AtomBondModelBaseProcessor.

virtual void VIEW::AddBallAndStickModel::dump std::ostream &  s = std::cout,
Size  depth = 0
const throw () [virtual]
 

Internal value dump.

Dump the current state of this AddBallAndStickModel to the output ostream s with dumping depth depth. Calls AtomBondModelBaseProcessor::dump.

Parameters:
s output stream where to output the state
depth the dumping depth

Reimplemented from VIEW::AtomBondModelBaseProcessor.

void VIEW::AddBallAndStickModel::enableBallAndStickModel  )  throw ()
 

Enable the creation of the ball and stick model.

void VIEW::AddBallAndStickModel::enableStickModel  )  throw ()
 

Enable the creation of the stick model.

float VIEW::AddBallAndStickModel::getBallRadius  )  const throw ()
 

Inspection of the radius of the ball-component.

float VIEW::AddBallAndStickModel::getStickRadius  )  const throw ()
 

Inspection of the radius of the stick-component.

bool VIEW::AddBallAndStickModel::isBallAndStickModel  )  const throw ()
 

Test if create ball and stick model.

Returns:
bool true if a ball and stick model should be created, false if stick model

bool VIEW::AddBallAndStickModel::isStickModel  )  const throw ()
 

Test if create a stick model.

Returns:
bool true if a stick model should be created, false if ball and stick model

virtual Processor::Result VIEW::AddBallAndStickModel::operator() Composite composite  )  [virtual]
 

Operator () method.

This method iterates over each Composite object reachable in the Composite tree. If the composite is of kind Atom than a Sphere is created for that atom, and the atom is inserted with the method insertAtom_(). If the AddBallAndStickModel should create a ball and stick model the radius assigned to the sphere will be the ball radius (see method setBallRadius()); if a stick model should be created than the stick radius is assigned to the sphere (see method setStickRadius()). All atoms inserted with the method insertAtom_() will later used for creating the model of the reachable Bond objects. Those models will be created with the method buildBondModels_().

Parameters:
composite the Composite object that will be processed
Returns:
Processor::Result the result
Exceptions:
OutOfMemory thrown if the memory allocation for a Sphere object failed

Reimplemented from VIEW::AtomBondModelBaseProcessor.

const AddBallAndStickModel& VIEW::AddBallAndStickModel::operator= const AddBallAndStickModel processor  )  throw ()
 

Assignment operator.

Calls set().

void VIEW::AddBallAndStickModel::set const AddBallAndStickModel add_ball_and_stick_model  )  throw ()
 

Assignment.

Calls AtomBondModelBaseProcessor::set.

void VIEW::AddBallAndStickModel::setBallRadius const float  radius  )  throw (Exception::OutOfRange)
 

Change the radius of the ball-component.

Parameters:
radius the new radius of the ball-component: (radius > 0)
Exceptions:
OutOfRange thrown if radius <= 0

void VIEW::AddBallAndStickModel::setStickRadius const float  radius  )  throw (Exception::OutOfRange)
 

Change the radius of the stick-component.

Parameters:
radius the new radius of the stick-component: (radius > 0)
Exceptions:
OutOfRange thrown if radius <= 0