Class to manage colorscales More...
#include <TerrainViz/SbTVizColorScale.h>
Public Types | |
enum | ColorMode { TVIZ_SHADING = 0, TVIZ_CONTOURING } |
Public Member Functions | |
SbTVizColorScale () | |
SbTVizColorScale (const SbTVizColorScale &colorScale) | |
virtual | ~SbTVizColorScale () |
void | setColors (int numColors, const SbColor *colors) |
const SbColor * | getColors () const |
int | getNumColors () const |
void | setAltitudes (int numAltitudes, const float *altitudes) |
const float * | getAltitudes () const |
int | getNumAltitudes () const |
void | setExtremeColors (SbColor &lowerColor, SbColor &upperColor) |
void | getExtremeColors (SbColor &lowerColor, SbColor &upperColor) const |
void | getColor (float altitude, SbColor &color) const |
void | setColorMode (ColorMode colorMode) |
ColorMode | getColorMode () const |
This class manages a list of altitudes and a corresponding color list.
Colors are mapped onto the terrain using the altitude scale. For N colors, N+1 altitudes must be supplied. Extreme colors are mapped for data outside the given limits (high and low).
If no colors are supplied, white is used.
Two modes are available:
SbTVizRegularGridData, SoTViz, SoTVizRender
SbTVizColorScale::SbTVizColorScale | ( | ) |
Constructor.
SbTVizColorScale::SbTVizColorScale | ( | const SbTVizColorScale & | colorScale | ) |
Constructor by copy.
virtual SbTVizColorScale::~SbTVizColorScale | ( | ) | [virtual] |
Destructor.
const float* SbTVizColorScale::getAltitudes | ( | ) | const |
Returns the altitude array.
void SbTVizColorScale::getColor | ( | float | altitude, | |
SbColor & | color | |||
) | const |
Returns the color at the specified height.
ColorMode SbTVizColorScale::getColorMode | ( | ) | const |
Returns the color mode.
const SbColor* SbTVizColorScale::getColors | ( | ) | const |
Returns the color array.
Returns the lower and upper colors used for extreme values.
int SbTVizColorScale::getNumAltitudes | ( | ) | const |
Returns the altitude array length.
int SbTVizColorScale::getNumColors | ( | ) | const |
Returns the color array length.
void SbTVizColorScale::setAltitudes | ( | int | numAltitudes, | |
const float * | altitudes | |||
) |
Sets the altitude array.
This array should be one element longer than the colors array. The array must be sorted by increasing values.
void SbTVizColorScale::setColorMode | ( | ColorMode | colorMode | ) |
Sets the color mode.
void SbTVizColorScale::setColors | ( | int | numColors, | |
const SbColor * | colors | |||
) |
Sets the color array.
This array should be one element shorter than the altitudes array.
Sets the lower and upper colors used for the extreme low and high values.
The default upper extreme color is white, the default lower extreme color is black.