BALL::VIEW::ColorProcessor Class Reference
[Model Processors]
#include <BALL/VIEW/MODELS/colorProcessor.h>
List of all members.
Detailed Description
Calculating colors for given GeometricObject instances. This class defines the interface and basic algorithms to colorize geometric objects, e.g. Sphere, Tube, TwoColoredTube, etc. Derived classes implement special ways to colorize, e.g. by charge or element. They have to overload the method getColor(Composite, ColorRGBA).
If no color can be calculated for a GeometricObject, e.g. if it has no Composite, the default color is set.
A bit tricky is the coloring of meshes. The goal was to give every triangle of a mesh a color according to its nearest Atom. To do so, a threedimensional HashGrid3 is used. It is computed, when the ColorProcessor first encounters a Mesh in the operator (). For this a pointer to the HashSet with the used Composite instances exists, which is set by the Representation.
Member Typedef Documentation
a single box in the threedimensional grid
a threedimensioal grid with the pointers to the atoms
Constructor & Destructor Documentation
BALL::VIEW::ColorProcessor::ColorProcessor |
( |
|
) |
|
BALL::VIEW::ColorProcessor::ColorProcessor |
( |
const ColorProcessor & |
color_calculator |
) |
|
virtual BALL::VIEW::ColorProcessor::~ColorProcessor |
( |
|
) |
[virtual] |
Member Function Documentation
virtual bool BALL::VIEW::ColorProcessor::canUseMeshShortcut_ |
( |
const Composite & |
|
) |
[inline, protected, virtual] |
virtual void BALL::VIEW::ColorProcessor::clear |
( |
|
) |
[virtual] |
Explicit default initialization. Reset the state of the default_color_ to red ( "FF0000FF"
). The grid is cleared and the pointer to the CompositeSet is set to NULL.
void BALL::VIEW::ColorProcessor::clearAtomGrid |
( |
|
) |
|
virtual void BALL::VIEW::ColorProcessor::colorMeshFromGrid_ |
( |
Mesh & |
mesh |
) |
[protected, virtual] |
virtual void BALL::VIEW::ColorProcessor::createAtomGrid |
( |
const Composite * |
from_mesh = 0 |
) |
[virtual] |
virtual void BALL::VIEW::ColorProcessor::dump |
( |
std::ostream & |
s = std::cout , |
|
|
Size |
depth = 0 | |
|
) |
| | const [virtual] |
Internal value dump. Dump the current state of this ColorProcessor to the output ostream s with dumping depth depth.
- Parameters:
-
| s | output stream where to output the state of this ColorProcessor |
| depth | the dumping depth |
float BALL::VIEW::ColorProcessor::getAdditionalGridDistance |
( |
|
) |
const [inline] |
AtomGrid& BALL::VIEW::ColorProcessor::getAtomGrid |
( |
|
) |
[inline] |
const Atom* BALL::VIEW::ColorProcessor::getClosestItem |
( |
const Vector3 & |
v |
) |
const |
virtual void BALL::VIEW::ColorProcessor::getColor |
( |
const Composite & |
composite, |
|
|
ColorRGBA & |
color_to_be_set | |
|
) |
| | [virtual] |
Calculate a color for a Composite. The given ColorRGBA instance is set to the calculated color. This method is called by the operator() method. Here it just sets the default color. You have to overload this operator in derived classes.
Reimplemented in BALL::VIEW::ElementColorProcessor, BALL::VIEW::ResidueNumberColorProcessor, BALL::VIEW::PositionColorProcessor, BALL::VIEW::ResidueNameColorProcessor, BALL::VIEW::AtomChargeColorProcessor, BALL::VIEW::AtomDistanceColorProcessor, BALL::VIEW::TemperatureFactorColorProcessor, BALL::VIEW::OccupancyColorProcessor, BALL::VIEW::ForceColorProcessor, BALL::VIEW::SecondaryStructureColorProcessor, and BALL::VIEW::ResidueTypeColorProcessor.
const List<const Composite*>* BALL::VIEW::ColorProcessor::getComposites |
( |
|
) |
[inline] |
Return a pointer to the Composites.
const ColorRGBA& BALL::VIEW::ColorProcessor::getDefaultColor |
( |
|
) |
const [inline] |
Non-mutable inspection of the default color.
Size BALL::VIEW::ColorProcessor::getTransparency |
( |
|
) |
const [inline] |
Assignment operator. Calls set.
void BALL::VIEW::ColorProcessor::set |
( |
const ColorProcessor & |
color_calculator |
) |
|
void BALL::VIEW::ColorProcessor::setAdditionalGridDistance |
( |
float |
distance |
) |
[inline] |
void BALL::VIEW::ColorProcessor::setComposites |
( |
const List< const Composite * > * |
composites |
) |
|
void BALL::VIEW::ColorProcessor::setDefaultColor |
( |
const ColorRGBA & |
color |
) |
|
Change the default color.
void BALL::VIEW::ColorProcessor::setMinGridSpacing |
( |
float |
spacing |
) |
[inline] |
void BALL::VIEW::ColorProcessor::setModelType |
( |
ModelType |
type |
) |
[inline] |
virtual void BALL::VIEW::ColorProcessor::setTransparency |
( |
Size |
value |
) |
[virtual] |
virtual bool BALL::VIEW::ColorProcessor::start |
( |
|
) |
[virtual] |
bool BALL::VIEW::ColorProcessor::updateAlwaysNeeded |
( |
|
) |
[inline] |
Some coloring processors need only to be applied to a Representation if the hierarchy of the Representations Composite is changed, or the Composites Names or Type (like SecondaryStructure::Type) is changed. As this is seldom the case, we can speedup the call to Representation::update() in most cases. This method defines if a ColoringMethod needs to be applied in all cases. The default value is false. Initialise the member update_always_needed_ to true in derived classes, if the derived ColorProcessor shall always be applied.
Member Data Documentation