class ScalarMapperContinuous : public ScalarMapperContinuousDomain

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.

Public Functions


Constructs an empty object.

double rangeMinimum() const

Returns the minimum range value.

double rangeMaximum() const

Returns the maximum range value.

void setRange(double min, double max)

Sets the range min and max values.

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

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

void setColors(ColorTableFactory::ColorTable colorTable)

Sets the scalar mapper level colors from a color table.

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.


  • 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]

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.