osgSim::ColorRange Class Reference

`#include <ColorRange>`

Inheritance diagram for osgSim::ColorRange:

## Public Member Functions

| ColorRange (float min, float max)
| ColorRange (float min, float max, const std::vector< osg::Vec4 > &colors)
void | setColors (const std::vector< osg::Vec4 > &colors)
const std::vector< osg::Vec4 > & | getColors () const
osg::Vec4 | getColor (float scalar) const
Public Member Functions inherited from osgSim::ScalarsToColors
| ScalarsToColors (float scalarMin, float scalarMax)
virtual | ~ScalarsToColors ()
float | getMin () const
float | getMax () const
Public Member Functions inherited from osg::Referenced
| Referenced ()
| Referenced (bool threadSafeRefUnref)
| Referenced (const Referenced &)
Referenced & | operator= (const Referenced &)
virtual void | setThreadSafeRefUnref (bool)
bool | getThreadSafeRefUnref () const
OpenThreads::Mutex * | getRefMutex () const
int | ref () const
int | unref () const
int | unref_nodelete () const
int | referenceCount () const
ObserverSet * | getObserverSet () const
ObserverSet * | getOrCreateObserverSet () const
void | addObserver (Observer *observer) const
void | removeObserver (Observer *observer) const

## Additional Inherited Members

Static Public Member Functions inherited from osg::Referenced
static OpenThreads::Mutex * | getGlobalReferencedMutex ()
static void | setDeleteHandler (DeleteHandler *handler)
static DeleteHandler * | getDeleteHandler ()
Protected Member Functions inherited from osg::Referenced
virtual | ~Referenced ()
void | signalObserversAndDelete (bool signalDelete, bool doDelete) const
void | deleteUsingDeleteHandler () const
Protected Attributes inherited from osg::Referenced
OpenThreads::AtomicPtr | _observerSet
OpenThreads::Atomic | _refCount

## Detailed Description

ColorRange is a ScalarsToColors object to define a color spectrum for a scalar range. An optional vector of colors may be passed in at construction time. The range of colors will be mapped to the scalar range, and interpolation between the colors will be performed as necessary. By default, the color range will run Red-Yellow-Green-Cyan-Blue.

## Constructor & Destructor Documentation

## ColorRange() [1/2]

osgSim::ColorRange::ColorRange | ( | float | min,
|  | float | max )

Constructor for a ColorRange with a default list of colors set to Red-Yellow-Green-Blue-Cyan

Parameters

  min | minimum scalar value
  max | maximum scalar value

## ColorRange() [2/2]

osgSim::ColorRange::ColorRange | ( | float | min,
|  | float | max,
|  | const std::vector< osg::Vec4 > & | colors )

Constructor for a ColorRange

Parameters

  min | minimum scalar value
  max | maximum scalar value
  colors | optional range of colors,

## Member Function Documentation

## getColor()

osg::Vec4 osgSim::ColorRange::getColor | ( | float | scalar | ) | const

virtual

Get the color for a given scalar value.

Reimplemented from osgSim::ScalarsToColors.

## getColors()

const std::vector< osg::Vec4 > & osgSim::ColorRange::getColors | ( |  | ) | const

inline

Get the range of colors

## setColors()

void osgSim::ColorRange::setColors | ( | const std::vector< osg::Vec4 > & | colors | ) |

Set the range of colors.

The documentation for this class was generated from the following file:

- ColorRange