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

VIEW::AtomDistanceColorProcessor Class Reference
[Model Processors]

AtomDistanceColorProcessor class. More...

#include <standardColorProcessor.h>

Inheritance diagram for VIEW::AtomDistanceColorProcessor:

VIEW::ColorProcessor UnaryProcessor< GeometricObject * > UnaryFunctor< GeometricObject *, Processor::Result > List of all members.

Public Member Functions

 AtomDistanceColorProcessor () throw ()
 Default Constructor.
 AtomDistanceColorProcessor (const AtomDistanceColorProcessor &color_Processor) throw ()
 Construct with copying the colors and the distance.
void setDistance (float distance) throw ()
 Change the max distance.
float getDistance () const throw ()
 Inspection of the max distance.
void setNullDistanceColor (const ColorRGBA &color) throw ()
 Change the null distance color.
const ColorRGBAgetNullDistanceColor () const throw ()
 Non-mutable inspection of the null distance color.
void setMaxDistanceColor (const ColorRGBA &color) throw ()
 Change the max distance color.
const ColorRGBAgetMaxDistanceColor () const throw ()
 Non-mutable inspection of the max distance color.
void calculateDistances () throw ()
 Calculate the distances.
virtual void addAtom (const Atom &atom)
 Calculate the distance color of the given Atom by interpolating the null and max distance color according to the previously calculated distance color (see calculateDistances()) of the given atom.
virtual bool finish () throw ()
 finish method
virtual void getColor (const Composite &composite, ColorRGBA &color_to_be_set)
 Calculate a color for a Composite.
bool showSelected ()
void setShowSelected (bool state)
virtual Processor::Result operator() (GeometricObject *&object) throw ()
 Collect all atoms from the geometric objects.

Detailed Description

AtomDistanceColorProcessor class.

AtomDistanceColorProcessor can be choosen in the class DisplayProperties to color the atoms in multiple AtomContainer according to their distance. There are two colors for the distance of Atom objects. A color for the null distance and a color for the max distance. If a distance of an Atom object to another atom object (stored in different atom containers) lies between the null and the max distance, the resulting color will be interpolated according to the distance.


Constructor & Destructor Documentation

VIEW::AtomDistanceColorProcessor::AtomDistanceColorProcessor  )  throw ()
 

Default Constructor.

Initialize to:

  • distance set to 10
  • null distance color set to red ("FF0000FF").
  • max distance color set to blue ("00FF00FF").
    See also:
    ColorRGBA


Member Function Documentation

virtual void VIEW::AtomDistanceColorProcessor::addAtom const Atom atom  )  [virtual]
 

Calculate the distance color of the given Atom by interpolating the null and max distance color according to the previously calculated distance color (see calculateDistances()) of the given atom.

Access to the calculated color with the method ColorProcessor::getColor.

Parameters:
atom the Atom whose distance color should be computed

void VIEW::AtomDistanceColorProcessor::calculateDistances  )  throw ()
 

Calculate the distances.

If this method is called the distances of all previously inserted Atom objects to each other are calculated. Only Atom objects are used for the distance calculation that have not the same root. All other atom objects will keep the max distance as set with the method setDistance(). Use this method after all atom containers have applied this processor.

virtual void VIEW::AtomDistanceColorProcessor::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 from VIEW::ColorProcessor.

float VIEW::AtomDistanceColorProcessor::getDistance  )  const throw ()
 

Inspection of the max distance.

const ColorRGBA& VIEW::AtomDistanceColorProcessor::getMaxDistanceColor  )  const throw ()
 

Non-mutable inspection of the max distance color.

See also:
setMaxDistanceColor

ColorRGBA

const ColorRGBA& VIEW::AtomDistanceColorProcessor::getNullDistanceColor  )  const throw ()
 

Non-mutable inspection of the null distance color.

void VIEW::AtomDistanceColorProcessor::setDistance float  distance  )  throw ()
 

Change the max distance.

Every new Atom object is inserted into the AtomDistanceColorProcessor with this max distance. If the method calculateDistances() is called the distances of the inserted atoms are calculated.

Parameters:
distance the new max distance

void VIEW::AtomDistanceColorProcessor::setMaxDistanceColor const ColorRGBA color  )  throw ()
 

Change the max distance color.

If the calculated distance between two Atom objects becomes the max distance or greater this color will be used to color these two atoms. Otherwise the color will be interpolated between this color and the null distance color according to the calculated distance.

Parameters:
color the new max distance color
See also:
getMaxDistanceColor

setNullDistanceColor

ColorRGBA

void VIEW::AtomDistanceColorProcessor::setNullDistanceColor const ColorRGBA color  )  throw ()
 

Change the null distance color.

If the calculated distance between two Atom objects becomes 0, this color will be used to color these two atoms. Otherwise the color will be interpolated between this color and the max distance color according to the calculated distance.

Parameters:
color the new null distance color
See also:
getNullDistanceColor

setMaxDistanceColor

ColorRGBA