#include <BALL/VIEW/MODELS/ballAndStickModel.h>
Public Member Functions | |
virtual bool | createGeometricObjects () |
Constructors and Destructors | |
AddBallAndStickModel () | |
AddBallAndStickModel (const AddBallAndStickModel &add_ball_and_stick_model) | |
virtual | ~AddBallAndStickModel () |
virtual void | clear () |
Assignment | |
void | set (const AddBallAndStickModel &add_ball_and_stick_model) |
const AddBallAndStickModel & | operator= (const AddBallAndStickModel &processor) |
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) |
float | getBallRadius () const |
void | setStickRadius (const float radius) throw (Exception::OutOfRange) |
float | getStickRadius () const |
void | enableBallAndStickModel () |
void | enableStickModel () |
Processor specific methods | |
virtual Processor::Result | operator() (Composite &composite) |
Predicates | |
bool | isBallAndStickModel () const |
bool | isStickModel () const |
bool | dashedBondsEnabled () const |
void | enableDashedBonds (bool state) |
debuggers and diagnostics | |
virtual void | dump (std::ostream &s=std::cout, Size depth=0) const |
Protected Member Functions | |
void | visualiseBond_ (const Bond &bond) |
virtual void | visualiseRings_ () |
void | renderStandardBond_ (const Bond &bond) |
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 |
Private Attributes | |
float | ball_radius_ |
float | stick_radius_ |
float | special_radius_ |
bool | ball_and_stick_ |
bool | dashed_bonds_ |
vector< vector< Bond * > > | ring_bonds_ |
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.
Definition at line 35 of file ballAndStickModel.h.
BALL::VIEW::AddBallAndStickModel::AddBallAndStickModel | ( | ) |
Default Constructor. Set the appearance to:
BALL::VIEW::AddBallAndStickModel::AddBallAndStickModel | ( | const AddBallAndStickModel & | add_ball_and_stick_model | ) |
Copy constructor.
virtual BALL::VIEW::AddBallAndStickModel::~AddBallAndStickModel | ( | ) | [virtual] |
Destructor.
virtual void BALL::VIEW::AddBallAndStickModel::clear | ( | ) | [virtual] |
Explicit default initialization. Reset the state of this AddBallAndStickModel to:
Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.
void BALL::VIEW::AddBallAndStickModel::collectRingBonds_ | ( | ) | [protected] |
virtual bool BALL::VIEW::AddBallAndStickModel::createGeometricObjects | ( | ) | [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 BALL::VIEW::AtomBondModelBaseProcessor.
bool BALL::VIEW::AddBallAndStickModel::dashedBondsEnabled | ( | ) | const [inline] |
Definition at line 164 of file ballAndStickModel.h.
virtual void BALL::VIEW::AddBallAndStickModel::dump | ( | std::ostream & | s = std::cout , |
|
Size | depth = 0 | |||
) | const [virtual] |
Internal value dump. Dump the current state of this AddBallAndStickModel to the output ostream s with dumping depth depth. Calls AtomBondModelBaseProcessor::dump.
s | output stream where to output the state | |
depth | the dumping depth |
Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.
void BALL::VIEW::AddBallAndStickModel::enableBallAndStickModel | ( | ) |
Enable the creation of the ball and stick model.
void BALL::VIEW::AddBallAndStickModel::enableDashedBonds | ( | bool | state | ) | [inline] |
Definition at line 168 of file ballAndStickModel.h.
void BALL::VIEW::AddBallAndStickModel::enableStickModel | ( | ) |
Enable the creation of the stick model.
float BALL::VIEW::AddBallAndStickModel::getBallRadius | ( | ) | const |
Inspection of the radius of the ball-component.
Vector3 BALL::VIEW::AddBallAndStickModel::getSP2Plane_ | ( | const Atom & | atom, | |
const Bond & | bond, | |||
const Vector3 & | dir | |||
) | const [protected] |
float BALL::VIEW::AddBallAndStickModel::getStickRadius | ( | ) | const |
Inspection of the radius of the stick-component.
bool BALL::VIEW::AddBallAndStickModel::isBallAndStickModel | ( | ) | const |
Test if create ball and stick model.
bool BALL::VIEW::AddBallAndStickModel::isStickModel | ( | ) | const |
Test if create a stick model.
virtual Processor::Result BALL::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_().
composite | the Composite object that will be processed |
OutOfMemory | thrown if the memory allocation for a Sphere object failed |
Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.
const AddBallAndStickModel& BALL::VIEW::AddBallAndStickModel::operator= | ( | const AddBallAndStickModel & | processor | ) |
Assignment operator. Calls set().
void BALL::VIEW::AddBallAndStickModel::renderDashedBond_ | ( | const Bond & | bond, | |
Vector3 | n | |||
) | throw (Exception::DivisionByZero) [inline, protected] |
void BALL::VIEW::AddBallAndStickModel::renderMultipleBond_ | ( | const Bond & | bond, | |
Vector3 | normal, | |||
Vector3 | dir | |||
) | [inline, protected] |
void BALL::VIEW::AddBallAndStickModel::renderStandardBond_ | ( | const Bond & | bond | ) | [inline, protected] |
void BALL::VIEW::AddBallAndStickModel::set | ( | const AddBallAndStickModel & | add_ball_and_stick_model | ) |
Assignment. Calls AtomBondModelBaseProcessor::set.
void BALL::VIEW::AddBallAndStickModel::setBallRadius | ( | const float | radius | ) | throw (Exception::OutOfRange) |
Change the radius of the ball-component.
radius | the new radius of the ball-component: (radius > 0) |
OutOfRange | thrown if radius <= 0 |
void BALL::VIEW::AddBallAndStickModel::setStickRadius | ( | const float | radius | ) | throw (Exception::OutOfRange) |
Change the radius of the stick-component.
radius | the new radius of the stick-component: (radius > 0) |
OutOfRange | thrown if radius <= 0 |
void BALL::VIEW::AddBallAndStickModel::visualiseBond_ | ( | const Bond & | bond | ) | [protected, virtual] |
Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.
virtual void BALL::VIEW::AddBallAndStickModel::visualiseRings_ | ( | ) | [protected, virtual] |
Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.
Definition at line 212 of file ballAndStickModel.h.
Definition at line 208 of file ballAndStickModel.h.
Definition at line 213 of file ballAndStickModel.h.
vector<vector<Bond*> > BALL::VIEW::AddBallAndStickModel::ring_bonds_ [private] |
Definition at line 215 of file ballAndStickModel.h.
Definition at line 210 of file ballAndStickModel.h.
Definition at line 209 of file ballAndStickModel.h.