class ScalarMapperContinuousPiecewise : public ScalarMapperContinuousDomain

Maps scalar values to texture coordinates/colors using a continuous/gradient style color map with multiple segments of independent gradients.

This scalar mapper is configured much in the same way as the ScalarMapperFilledContours, but here you are allowed to specify a bottom and top color for each level/segment.

Public Functions


Constructs an empty object.

double rangeMinimum() const

Returns the minimum range value.

double rangeMaximum() const

Returns the maximum range value.

void setup(const std::vector<Color3f> &colorsFromToArray, const std::vector<double> &tickValuesArray)

Sets the scalar mapper from the given tick values array and colors from/to.

The tickValuesArray will contain the values separating each segment of the scalar mapper. The first value in tickValuesArray will be the min value of the scalar mapper, the last value will be the max value of the scalar mapper.

The colorsFromToArray contains bottom and top colors for each of the segments. colorsFromToArray[0] is the bottom of the first segment, colorsFromToArray[1] is the top of the first segment.

The colorsFromToArray.size must be 2*(tickValuesArray.size - 1)

virtual Vec2f mapToTextureCoordinate(double scalarValue) const

Maps scalar value to texture coordinate.

virtual Color3f mapToColor(double scalarValue) const

Maps scalar value to color.

virtual bool updateTexture(Image *image) const

Updates texture image.

virtual double normalizedValue(double domainValue) const

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

virtual double domainValue(double normalizedPosition) const

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

virtual unsigned int version() const

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