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

BinToColorScaleMovingBrkPt Class Reference

#include <BinToColorScaleMovingBrkPt.h>

Inheritance diagram for BinToColorScaleMovingBrkPt:

Inheritance graph
[legend]
Collaboration diagram for BinToColorScaleMovingBrkPt:

Collaboration graph
[legend]
List of all members.

Detailed Description

The class derived from the BinToColor class.

This class implements the transformation of a value to a color like the classic rainbow, but has two control parameters to vary the transform. One parameter is the distance between the break points and the other is the position of the center between the break points.

Author:
Joy Rajiv <jrajiv@stanford.edu>
The member function doubleToColor() was taken from C code writen by
Author:
Paul Bourke <pdb@swin.edu.au>
Found on this web page http://astronomy.swin.edu.au/~pbourke/colour/colourramp/

Definition at line 36 of file BinToColorScaleMovingBrkPt.h.

Public Member Functions

 BinToColorScaleMovingBrkPt (const BinToColorScaleMovingBrkPt &)
 The copy constructor.
 BinToColorScaleMovingBrkPt (const std::vector< double > &sv, const std::string &model_name)
 Another constructor with control points specified.
 BinToColorScaleMovingBrkPt (const char *name)
 The constructor.
virtual BinToColorclone () const
 Creates a copy of itself.
virtual void doubleToColor (double value, Color &color) const
 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.
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.

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

BinToColorScaleMovingBrkPt::BinToColorScaleMovingBrkPt const char *  name  ) 
 

The constructor.

Definition at line 20 of file BinToColorScaleMovingBrkPt.cxx.

References BinToColor::m_control_points.

Referenced by clone().

BinToColorScaleMovingBrkPt::BinToColorScaleMovingBrkPt const std::vector< double > &  sv,
const std::string model_name
 

Another constructor with control points specified.

Definition at line 30 of file BinToColorScaleMovingBrkPt.cxx.

References BinToColor::m_control_points.

BinToColorScaleMovingBrkPt::BinToColorScaleMovingBrkPt const BinToColorScaleMovingBrkPt  ) 
 

The copy constructor.

Definition at line 41 of file BinToColorScaleMovingBrkPt.cxx.

References BinToColor::m_control_points.


Member Function Documentation

BinToColor * BinToColorScaleMovingBrkPt::clone  )  const [virtual]
 

Creates a copy of itself.

Implements BinToColor.

Definition at line 53 of file BinToColorScaleMovingBrkPt.cxx.

References BinToColorScaleMovingBrkPt().

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

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

Implements BinToColor.

Definition at line 61 of file BinToColorScaleMovingBrkPt.cxx.

References Range::length(), Range::low(), BinToColor::m_control_points, BinToColor::m_range, and Color::setColor().

const std::vector< double > & BinToColor::getControlPoints  )  const [inherited]
 

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 BinToColor::m_control_points.

Referenced by BinToColorXML::createElement().

const Range & BinToColor::getRange  )  const [inherited]
 

Get the Range.

Definition at line 48 of file BinToColor.cxx.

References BinToColor::m_range.

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

bool BinToColorScaleMovingBrkPt::hasControlPoints  )  const [virtual]
 

Returns true.

Returns true as this class has control points with which the value to color transform can be varied.

Reimplemented from BinToColor.

Definition at line 147 of file BinToColorScaleMovingBrkPt.cxx.

const std::string & BinToColor::name  )  const [inherited]
 

Returns the name of the value to color transform.

Definition at line 38 of file BinToColor.cxx.

References BinToColor::m_name.

Referenced by BinToColorXML::createElement().

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

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 BinToColor::m_control_points.

void BinToColor::setRange const Range r  )  [inherited]
 

Sets the range of the values passed.

Definition at line 43 of file BinToColor.cxx.

References BinToColor::m_range.

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


Member Data Documentation

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

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(), BinToMovingBrkPt::BinToMovingBrkPt(), BinToUsrDefinedScale::BinToUsrDefinedScale(), BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), doubleToColor(), BinToColor::getControlPoints(), and BinToColor::setControlPoints().

std::string BinToColor::m_name [protected, inherited]
 

The name of this value transform.

Definition at line 49 of file BinToColor.h.

Referenced by BinToColor::name().

Range BinToColor::m_range [protected, inherited]
 

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(), doubleToColor(), BinToColorScale::doubleToColor(), BinTo3ColorScale::doubleToColor(), BinToColor::getRange(), and BinToColor::setRange().


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