Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

BinToColor Class Reference

#include <BinToColor.h>

Inheritance diagram for BinToColor:

Inheritance graph
[legend]
Collaboration diagram for BinToColor:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class for the value to the color transformation.

It is needed, for example, for the drawing of color plots when the color of a point depends on its value.

Author:
Stephane Bonneaud <gandalf@slac.stanford.edu>

Definition at line 29 of file BinToColor.h.

Public Member Functions

 BinToColor (const BinToColor &bin_to_color)
 The copy constructor.
virtual BinToColorclone () const =0
 Creates a copy of itself.
virtual void doubleToColor (double value, Color &color) const =0
 This function does the actual calculation that transforms the given value into a color using the current Range.
const std::vector< double > & getControlPoints () const
 Returns a list of control points.
const RangegetRange () const
 Get the Range.
virtual bool hasControlPoints () const
 Returns true if class has control points by which the value to color transform can be varied.
const std::stringname () const
 Returns the name of the value to color transform.
void setControlPoints (const std::vector< double > &points)
 Set the value of the control points.
void setRange (const Range &r)
 Sets the range of the values passed.
virtual ~BinToColor ()
 The destructor.

Protected Member Functions

 BinToColor (const std::string &)
 Another constructor.
 BinToColor (const char *name)
 The constructor.

Protected Attributes

std::vector< double > m_control_points
 A set of control points that might be used for the value to color transform.
std::string m_name
 The name of this value transform.
Range m_range
 The range of the values given to this object.


Constructor & Destructor Documentation

BinToColor::BinToColor const char *  name  )  [protected]
 

The constructor.

Definition at line 15 of file BinToColor.cxx.

BinToColor::BinToColor const std::string  )  [protected]
 

Another constructor.

Definition at line 21 of file BinToColor.cxx.

BinToColor::BinToColor const BinToColor bin_to_color  ) 
 

The copy constructor.

Definition at line 26 of file BinToColor.cxx.

BinToColor::~BinToColor  )  [virtual]
 

The destructor.

Definition at line 32 of file BinToColor.cxx.


Member Function Documentation

virtual BinToColor* BinToColor::clone  )  const [pure virtual]
 

Creates a copy of itself.

Implemented in BinTo3ColorScale, BinToColorScale, BinToColorScale, BinToColorScaleMovingBrkPt, BinToFullColorScale, BinToGreyScale, BinToKamaeScale, BinToMovingBrkPt, and BinToUsrDefinedScale.

virtual void BinToColor::doubleToColor double  value,
Color color
const [pure virtual]
 

This function does the actual calculation that transforms the given value into a color using the current Range.

Implemented in BinTo3ColorScale, BinToColorScale, BinToColorScale, BinToColorScaleMovingBrkPt, BinToFullColorScale, BinToGreyScale, BinToKamaeScale, BinToMovingBrkPt, and BinToUsrDefinedScale.

Referenced by AxisRepColor::drawColorScale().

const std::vector< double > & BinToColor::getControlPoints  )  const
 

Returns a list of control points.

If a derived class has control points to vary the transform of value to color returns the list of control points. Otherwise, the returned list is empty.

Definition at line 62 of file BinToColor.cxx.

References m_control_points.

Referenced by BinToColorXML::createElement().

const Range & BinToColor::getRange  )  const
 

Get the Range.

Definition at line 48 of file BinToColor.cxx.

References m_range.

Referenced by ContourPointRep::createContours(), and AxisRepColor::drawColorScale().

bool BinToColor::hasControlPoints  )  const [virtual]
 

Returns true if class has control points by which the value to color transform can be varied.

The implementation in this base class returns false.

Reimplemented in BinToColorScaleMovingBrkPt, BinToMovingBrkPt, and BinToUsrDefinedScale.

Definition at line 55 of file BinToColor.cxx.

Referenced by BinToColorXML::createElement().

const std::string & BinToColor::name  )  const
 

Returns the name of the value to color transform.

Definition at line 38 of file BinToColor.cxx.

References m_name.

Referenced by BinToColorXML::createElement().

void BinToColor::setControlPoints const std::vector< double > &  points  ) 
 

Set the value of the control points.

Interpretation of control points is left to derived classes.

Definition at line 69 of file BinToColor.cxx.

References m_control_points.

void BinToColor::setRange const Range r  ) 
 

Sets the range of the values passed.

Definition at line 43 of file BinToColor.cxx.

References m_range.

Referenced by ContourPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), and ColorBoxPointRep::drawProjectedValues().


Member Data Documentation

std::vector< double > BinToColor::m_control_points [protected]
 

A set of control points that might be used for the value to color transform.

Note:
This vector is declared in the base class so that the implementation of getControlPoints in this base class can return an empty vector, otherwise some compilers would flag an error for not returning anything.

Definition at line 42 of file BinToColor.h.

Referenced by BinToColorScaleMovingBrkPt::BinToColorScaleMovingBrkPt(), BinToMovingBrkPt::BinToMovingBrkPt(), BinToUsrDefinedScale::BinToUsrDefinedScale(), BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), BinToColorScaleMovingBrkPt::doubleToColor(), getControlPoints(), and setControlPoints().

std::string BinToColor::m_name [protected]
 

The name of this value transform.

Definition at line 49 of file BinToColor.h.

Referenced by name().

Range BinToColor::m_range [protected]
 

The range of the values given to this object.

It is needed in the algorithms used to calculate the color returned.

Definition at line 46 of file BinToColor.h.

Referenced by BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), BinToKamaeScale::doubleToColor(), BinToGreyScale::doubleToColor(), BinToFullColorScale::doubleToColor(), BinToColorScaleMovingBrkPt::doubleToColor(), BinToColorScale::doubleToColor(), BinTo3ColorScale::doubleToColor(), getRange(), and setRange().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3