Loading...
Searching...
No Matches
BALL::VIEW::AddBallAndStickModel Class Reference
Visualisation » Model Processors

`#include <BALL/VIEW/MODELS/ballAndStickModel.h>`

Inheritance diagram for BALL::VIEW::AddBallAndStickModel:

## Public Member Functions

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)
float | getBallRadius () const
void | setStickRadius (const float radius)
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)
Public Member Functions inherited from BALL::VIEW::AtomBondModelBaseProcessor
| AtomBondModelBaseProcessor ()
| AtomBondModelBaseProcessor (const AtomBondModelBaseProcessor &baseProcessor)
virtual | ~AtomBondModelBaseProcessor ()
void | set (const AtomBondModelBaseProcessor &processor)
const AtomBondModelBaseProcessor & | operator= (const AtomBondModelBaseProcessor &processor)
virtual void | clearComposites ()
Public Member Functions inherited from BALL::VIEW::ModelProcessor
| ModelProcessor ()
| ModelProcessor (const ModelProcessor &model_processor)
virtual | ~ModelProcessor ()
virtual bool | isValid () const
GeometricObjectList & | getGeometricObjects ()
| Return the list with the created geometric objects.
const GeometricObjectList & | getGeometricObjects () const
| Return the list with the created geometric objects.
void | setDrawingPrecision (Index precision)
Index | getDrawingPrecision () const
void | setSurfaceDrawingPrecision (float precision)
float | getSurfaceDrawingPrecision () const
Public Member Functions inherited from BALL::UnaryProcessor< Composite >
| UnaryProcessor ()
| UnaryProcessor (const UnaryProcessor &)
virtual | ~UnaryProcessor ()
virtual bool | start ()
virtual bool | finish ()
Public Member Functions inherited from BALL::PropertyManager
BALL_INLINE | PropertyManager ()
| Default constructor.
BALL_INLINE | PropertyManager (const PropertyManager &property_manager)
| Copy constructor.
virtual | ~PropertyManager ()
| Destructor.
virtual void | destroy ()
| Clears all properties.
void | set (const PropertyManager &property_manager)
const PropertyManager & | operator= (const PropertyManager &property_manager)
void | get (PropertyManager &property_manager) const
void | swap (PropertyManager &property_manager)
BitVector & | getBitVector ()
const BitVector & | getBitVector () const
| operator BitVector & ()
void | setProperty (Property property)
void | clearProperty (Property property)
void | toggleProperty (Property property)
Size | countProperties () const
const NamedProperty & | getNamedProperty (Position index) const
NamedProperty & | getNamedProperty (Position index)
void | setProperty (const NamedProperty &property)
void | setProperty (const std::string &name)
void | setProperty (const std::string &name, bool value)
void | setProperty (const std::string &name, int value)
void | setProperty (const std::string &name, unsigned int value)
void | setProperty (const std::string &name, float value)
void | setProperty (const std::string &name, double value)
void | setProperty (const std::string &name, const std::string &value)
void | setProperty (const std::string &name, const PersistentObject &value)
const NamedProperty & | getProperty (const std::string &name) const
NamedPropertyIterator | beginNamedProperty ()
NamedPropertyIterator | endNamedProperty ()
void | clearProperty (const std::string &name)
Size | countNamedProperties () const
bool | hasProperty (Property property) const
| Query for an unnamed property.
bool | hasProperty (const std::string &name) const
| Query for a named property.
bool | operator== (const PropertyManager &pm) const
bool | operator!= (const PropertyManager &pm) const
| Inequality operator.
void | write (PersistenceManager &pm) const
| Persistent stream writing.
bool | read (PersistenceManager &pm)
| Persistent stream reading.
bool | isValid () const
void | dump (std::ostream &s=std::cout, Size depth=0) const

## debuggers and diagnostics

virtual void | dump (std::ostream &s=std::cout, Size depth=0) const
virtual bool | createGeometricObjects ()
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)
void | collectRingBonds_ ()
Vector3 | getSP2Plane_ (const Atom &atom, const Bond &bond, const Vector3 &dir) const

## Additional Inherited Members

Public Types inherited from BALL::UnaryFunctor< ArgumentType, ResultType >
typedef ResultType | result_type
typedef ArgumentType | argument_type
typedef ArgumentType & | argument_reference
typedef const ArgumentType & | const_argument_reference
typedef ArgumentType * | argument_pointer
typedef const ArgumentType * | const_argument_pointer
void | insertAtom_ (const Atom *atom)
void | clearUsedAtoms_ ()
std::list< const Atom * > & | getAtomList_ ()
HashSet< const Atom * > & | getAtomSet_ ()
void | buildBondModels_ ()
vector< vector< Atom * > > | rings_
HashSet< const Atom * > | ring_atoms_
Protected Attributes inherited from BALL::VIEW::ModelProcessor
GeometricObjectList | geometric_objects_
Index | drawing_precision_
float | surface_drawing_precision_

## 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.

Definition at line 35 of file ballAndStickModel.h.

## Constructor & Destructor Documentation

## AddBallAndStickModel() [1/2]

BALL::VIEW::AddBallAndStickModel::AddBallAndStickModel | ( |  | ) |

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

## AddBallAndStickModel() [2/2]

BALL::VIEW::AddBallAndStickModel::AddBallAndStickModel | ( | const AddBallAndStickModel & | add_ball_and_stick_model | ) |

Copy constructor.

## ~AddBallAndStickModel()

virtual BALL::VIEW::AddBallAndStickModel::~AddBallAndStickModel | ( |  | ) |

virtual

Destructor.

## Member Function Documentation

## clear()

virtual void BALL::VIEW::AddBallAndStickModel::clear | ( |  | ) |

virtual

Explicit default initialization. Reset the state of this AddBallAndStickModel to:

- set the appearance to ball and stick model
- set the ball radius to 0.4
- set the stick radius to 0.2 Calls AtomBondModelBaseProcessor::clear.

Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.

## collectRingBonds_()

void BALL::VIEW::AddBallAndStickModel::collectRingBonds_ | ( |  | ) |

protected

## createGeometricObjects()

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.

## dashedBondsEnabled()

bool BALL::VIEW::AddBallAndStickModel::dashedBondsEnabled | ( |  | ) | const

inline

Definition at line 162 of file ballAndStickModel.h.

## dump()

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.

Parameters

  s | output stream where to output the state
  depth | the dumping depth

Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.

## enableBallAndStickModel()

void BALL::VIEW::AddBallAndStickModel::enableBallAndStickModel | ( |  | ) |

Enable the creation of the ball and stick model.

## enableDashedBonds()

void BALL::VIEW::AddBallAndStickModel::enableDashedBonds | ( | bool | state | ) |

inline

Definition at line 166 of file ballAndStickModel.h.

## enableStickModel()

void BALL::VIEW::AddBallAndStickModel::enableStickModel | ( |  | ) |

Enable the creation of the stick model.

## getBallRadius()

float BALL::VIEW::AddBallAndStickModel::getBallRadius | ( |  | ) | const

Inspection of the radius of the ball-component.

## getSP2Plane_()

Vector3 BALL::VIEW::AddBallAndStickModel::getSP2Plane_ | ( | const Atom & | atom,
|  | const Bond & | bond,
|  | const Vector3 & | dir ) const

protected

## getStickRadius()

float BALL::VIEW::AddBallAndStickModel::getStickRadius | ( |  | ) | const

Inspection of the radius of the stick-component.

## isBallAndStickModel()

bool BALL::VIEW::AddBallAndStickModel::isBallAndStickModel | ( |  | ) | const

Test if create ball and stick model.

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

## isStickModel()

bool BALL::VIEW::AddBallAndStickModel::isStickModel | ( |  | ) | const

Test if create a stick model.

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

## operator()()

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_().

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 BALL::VIEW::AtomBondModelBaseProcessor.

## operator=()

const AddBallAndStickModel & BALL::VIEW::AddBallAndStickModel::operator= | ( | const AddBallAndStickModel & | processor | ) |

Assignment operator. Calls set().

## renderDashedBond_()

void BALL::VIEW::AddBallAndStickModel::renderDashedBond_ | ( | const Bond & | bond,
|  | Vector3 | n )

inline protected

Exceptions

  BALL::Exception::DivisionByZero |

## renderMultipleBond_()

void BALL::VIEW::AddBallAndStickModel::renderMultipleBond_ | ( | const Bond & | bond,
|  | Vector3 | normal,
|  | Vector3 | dir )

inline protected

## renderStandardBond_()

void BALL::VIEW::AddBallAndStickModel::renderStandardBond_ | ( | const Bond & | bond | ) |

inline protected

## set()

void BALL::VIEW::AddBallAndStickModel::set | ( | const AddBallAndStickModel & | add_ball_and_stick_model | ) |

Assignment. Calls AtomBondModelBaseProcessor::set.

## setBallRadius()

void BALL::VIEW::AddBallAndStickModel::setBallRadius | ( | const float | radius | ) |

Change the radius of the ball-component.

Parameters

  radius | the new radius of the ball-component: (radius > 0)

Exceptions

  BALL::Exception::OutOfRange | thrown if radius <= 0

## setStickRadius()

void BALL::VIEW::AddBallAndStickModel::setStickRadius | ( | const float | radius | ) |

Change the radius of the stick-component.

Parameters

  radius | the new radius of the stick-component: (radius > 0)

Exceptions

  BALL::Exception::OutOfRange | thrown if radius <= 0

## visualiseBond_()

void BALL::VIEW::AddBallAndStickModel::visualiseBond_ | ( | const Bond & | bond | ) |

protected virtual

Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.

## visualiseRings_()

virtual void BALL::VIEW::AddBallAndStickModel::visualiseRings_ | ( |  | ) |

protected virtual

Reimplemented from BALL::VIEW::AtomBondModelBaseProcessor.