BinToColor Class Reference

#include <BinToColor.h>

Inheritance diagram for BinToColor:

Inheritance graph
BinTo3ColorScaleBinToBlackBinToColorMapBinToColorScaleMovingBrkPtBinToFullColorScaleBinToGammaBinToGreyScaleBinToKamaeScaleBinToLineStyleBinToMovingBrkPtBinToUsrDefinedScaleBinToBeachBinToBGRYBinToBluePastelBinToBlueRedBinToBlueWhiteBinToBWLinearBinToEosABinToEosBBinToGPinkBinToGRBWBinToGWExponBinToGWLinearBinToHardCandyBinToHazeBinToHueSatLight1BinToHueSatLight2BinToHueSatValue1BinToHueSatValue2BinToMacStyleBinToNatureBinToOceanBinToPastelsBinToPeppermintBinToPrismBinToPurpleRedBinToRainbowBinToRainbowIDLBinToRedPurpleBinToRedTempBinToStdGamma2BinToStern
[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>

Tao Xu <taox@stanford.edu>

Definition at line 30 of file BinToColor.h.


Public Member Functions

virtual bool acceptChangeColor () const
 Returns true if object can accept changing color,i.e.
 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.
Range getRange () const
 Get the Range of expected values.
virtual bool hasControlPoints () const
 Returns true if class has control points by which the value to color transform can be varied.
virtual bool isUserDefined () const
 Returns true if object can be user defined.
const std::string & name () const
 Returns the name of the value to color transform.
virtual 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.
double m_dv
 The distance of the expected values, i.e.
std::string m_name
 The name of this value transform.
double m_vmin
 The minimum value expected.

Constructor & Destructor Documentation

BinToColor ( const char *  name  )  [protected]

The constructor.

Definition at line 17 of file BinToColor.cxx.

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

Another constructor.

BinToColor ( const BinToColor bin_to_color  ) 

The copy constructor.

Definition at line 28 of file BinToColor.cxx.

References BinToColor::m_control_points.

~BinToColor (  )  [virtual]

The destructor.

Definition at line 36 of file BinToColor.cxx.


Member Function Documentation

bool acceptChangeColor (  )  const [virtual]

Returns true if object can accept changing color,i.e.

enable the "Change color" button in plot inspector tabbed panel within inspector. Reimplemented in BinToBlack and BinToGreyScale. The base class implementation returns false.

Reimplemented in BinToBlack, BinToGamma, BinToGreyScale, and BinToLineStyle.

Definition at line 94 of file BinToColor.cxx.

virtual BinToColor* clone (  )  const [pure virtual]

Creates a copy of itself.

Implemented in BinTo3ColorScale, BinToBeach, BinToBGRY, BinToBlack, BinToBluePastel, BinToBlueRed, BinToBlueWhite, BinToBWLinear, BinToColorMap, BinToColorScaleMovingBrkPt, BinToEosA, BinToEosB, BinToFullColorScale, BinToGamma, BinToGPink, BinToGRBW, BinToGreyScale, BinToGWExpon, BinToGWLinear, BinToHardCandy, BinToHaze, BinToHueSatLight1, BinToHueSatLight2, BinToHueSatValue1, BinToHueSatValue2, BinToKamaeScale, BinToLineStyle, BinToMacStyle, BinToMovingBrkPt, BinToNature, BinToOcean, BinToPastels, BinToPeppermint, BinToPrism, BinToPurpleRed, BinToRainbow, BinToRainbowIDL, BinToRedPurple, BinToRedTemp, BinToStdGamma2, BinToStern, and BinToUsrDefinedScale.

virtual void 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, BinToBlack, BinToColorMap, BinToColorScaleMovingBrkPt, BinToFullColorScale, BinToGamma, BinToGreyScale, BinToKamaeScale, BinToLineStyle, BinToMovingBrkPt, and BinToUsrDefinedScale.

Referenced by AxisRepColor::drawColorScale().

const std::vector< double > & 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 71 of file BinToColor.cxx.

References BinToColor::m_control_points.

Referenced by BinToColorXML::createElement().

Range getRange (  )  const

Get the Range of expected values.

Definition at line 55 of file BinToColor.cxx.

References BinToColor::m_dv, and BinToColor::m_vmin.

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

bool 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 BinToColorMap, BinToColorScaleMovingBrkPt, BinToGamma, BinToMovingBrkPt, and BinToUsrDefinedScale.

Definition at line 64 of file BinToColor.cxx.

Referenced by BinToColorXML::createElement().

bool isUserDefined (  )  const [virtual]

Returns true if object can be user defined.

Returns true if value to color transform can be user defined. That is, the control points for the transform are editable. This base class implementation returns false.

Reimplemented in BinToGamma, and BinToUsrDefinedScale.

Definition at line 85 of file BinToColor.cxx.

const std::string & name (  )  const

Returns the name of the value to color transform.

Reimplemented in BinToColorMap.

Definition at line 42 of file BinToColor.cxx.

References BinToColor::m_name.

Referenced by BinToColorXML::createElement(), ContourPointRep::drawProjectedValues(), and DisplayController::saveValueCtrlPts().

void setControlPoints ( const std::vector< double > &  points  )  [virtual]

Set the value of the control points.

Interpretation of control points is left to derived classes.

Reimplemented in BinToColorMap.

Definition at line 78 of file BinToColor.cxx.

References BinToColor::m_control_points.

void setRange ( const Range r  ) 

Sets the range of the values passed.

Definition at line 47 of file BinToColor.cxx.

References Range::length(), Range::low(), BinToColor::m_dv, and BinToColor::m_vmin.

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


Member Data Documentation

std::vector< double > 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 46 of file BinToColor.h.

Referenced by BinToColor::BinToColor(), BinToColorMap::BinToColorMap(), BinToColorScaleMovingBrkPt::BinToColorScaleMovingBrkPt(), BinToGamma::BinToGamma(), BinToMovingBrkPt::BinToMovingBrkPt(), BinToUsrDefinedScale::BinToUsrDefinedScale(), BinToColorMap::calcGamma(), BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), BinToGamma::doubleToColor(), BinToColorScaleMovingBrkPt::doubleToColor(), BinToColor::getControlPoints(), BinToColorMap::setControlPoints(), and BinToColor::setControlPoints().

double m_dv [protected]

The distance of the expected values, i.e.

maximum - minimum.

Definition at line 50 of file BinToColor.h.

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

std::string m_name [protected]

The name of this value transform.

Definition at line 36 of file BinToColor.h.

Referenced by BinToColor::name().

double m_vmin [protected]

The minimum value expected.

Definition at line 54 of file BinToColor.h.

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


The documentation for this class was generated from the following files:
Generated for HippoDraw Class Library by doxygen