cee::vis::ScalarMapperContinuous Class Reference

Maps scalar values to texture coordinates/colors using a continuous/gradient style color map. More...

Public Member Functions

 ScalarMapperContinuous ()
 Constructs an empty object. More...
 
double rangeMinimum () const
 Returns the minimum range value. More...
 
double rangeMaximum () const
 Returns the maximum range value. More...
 
void setRange (double min, double max)
 Sets the range min and max values. More...
 
void setColors (const std::vector< Color3f > &colorArray)
 Sets the scalar mapper level colors from an array of colors. More...
 
void setColors (ColorTableFactory::ColorTable colorTable)
 Sets the scalar mapper level colors from a color table. More...
 
void setColorsAtValues (const std::vector< double > &values, const std::vector< Color3f > &colorAtValues)
 Sets the colors at the given values and interpolate a continuous color table based on this. More...
 
virtual Vec2f mapToTextureCoordinate (double scalarValue) const
 Maps scalar value to texture coordinate. More...
 
virtual Color3f mapToColor (double scalarValue) const
 Maps scalar value to color. More...
 
virtual bool updateTexture (Image *image) const
 Updates texture image. More...
 
virtual double normalizedValue (double domainValue) const
 Maps domain value (range_min -> range_max) into a normalized value (0 -> 1) More...
 
virtual double domainValue (double normalizedPosition) const
 Maps normalized value (0 -> 1) into a domain value (range_min -> range_max) More...
 
virtual unsigned int version () const
 Returns the version of the scalar mapper. Version is increased whenever the mapper is changed. More...
 
- Public Member Functions inherited from cee::vis::ScalarMapperContinuousDomain
virtual std::vector< double > tickValuesHint () const
 Returns a suggestion for which tick marks to use. The base class returns an empty array. More...
 
Color4f undefinedColor () const
 Returns the current undefined color. More...
 
void setUndefinedColor (const Color4f &color)
 Sets the color to use for undefined values (cee::UNDEFINED_DOUBLE) More...
 
bool aboveRangeColor (Color4f *color) const
 Returns true if an above range color is specified, and the color is set in the color parameter. More...
 
void setAboveRangeColor (const Color4f &color)
 Sets the color to use for values that are above the range of the mapper. More...
 
void clearAboveRangeColor ()
 Removes the currently specified above range color, going back to the default behavior with any value above the current max range gets the max range color. More...
 
bool belowRangeColor (Color4f *color) const
 Returns true if an below range color is specified, and the color is set in the color parameter. More...
 
void setBelowRangeColor (const Color4f &color)
 Sets the color to use for values that are below the range of the mapper. More...
 
void clearBelowRangeColor ()
 Removes the currently specified below range color, going back to the default behavior with any value below the current max range gets the min range color. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::vis::ScalarMapperContinuous:
cee::vis::ScalarMapperContinuousDomain cee::vis::ScalarMapper cee::RefCountedObject

Detailed Description

Maps scalar values to texture coordinates/colors using a continuous/gradient style color map.

A scalar mapper producing a continuous gradient between the specified colors. Colors can be set with one of the ColorTableFactory presets, or specified manually by providing an array of colors The scalar mapper will interpolate between the specified colors to create a continuous gradient.

Constructor & Destructor Documentation

cee::vis::ScalarMapperContinuous::ScalarMapperContinuous ( )

Constructs an empty object.

Member Function Documentation

double cee::vis::ScalarMapperContinuous::domainValue ( double  normalizedPosition) const
virtual

Maps normalized value (0 -> 1) into a domain value (range_min -> range_max)

Implements cee::vis::ScalarMapperContinuousDomain.

cee::Color3f cee::vis::ScalarMapperContinuous::mapToColor ( double  scalarValue) const
virtual

Maps scalar value to color.

Implements cee::vis::ScalarMapper.

cee::Vec2f cee::vis::ScalarMapperContinuous::mapToTextureCoordinate ( double  scalarValue) const
virtual

Maps scalar value to texture coordinate.

Implements cee::vis::ScalarMapper.

double cee::vis::ScalarMapperContinuous::normalizedValue ( double  domainValue) const
virtual

Maps domain value (range_min -> range_max) into a normalized value (0 -> 1)

Implements cee::vis::ScalarMapperContinuousDomain.

double cee::vis::ScalarMapperContinuous::rangeMaximum ( ) const

Returns the maximum range value.

double cee::vis::ScalarMapperContinuous::rangeMinimum ( ) const

Returns the minimum range value.

void cee::vis::ScalarMapperContinuous::setColors ( const std::vector< Color3f > &  colorArray)

Sets the scalar mapper level colors from an array of colors.

void cee::vis::ScalarMapperContinuous::setColors ( ColorTableFactory::ColorTable  colorTable)

Sets the scalar mapper level colors from a color table.

void cee::vis::ScalarMapperContinuous::setColorsAtValues ( const std::vector< double > &  values,
const std::vector< Color3f > &  colorAtValues 
)

Sets the colors at the given values and interpolate a continuous color table based on this.

Assumptions:

  • values and colorAtValues must have the same length.
  • values must be sorted min->max.
  • value[i] < value[i + 1]

Note: The range of the mapper will be set to values[0] -> values[values.size() - 1]

void cee::vis::ScalarMapperContinuous::setRange ( double  min,
double  max 
)

Sets the range min and max values.

bool cee::vis::ScalarMapperContinuous::updateTexture ( Image image) const
virtual

Updates texture image.

Implements cee::vis::ScalarMapper.

unsigned int cee::vis::ScalarMapperContinuous::version ( ) const
virtual

Returns the version of the scalar mapper. Version is increased whenever the mapper is changed.

Implements cee::vis::ScalarMapperContinuousDomain.