23 #include <tulip/Observable.h> 24 #include <tulip/Color.h> 78 ColorScale(
const std::vector<Color> &colors,
const bool gradient =
true);
88 ColorScale(
const std::map<float, Color> &colorMap,
const bool gradient =
true);
111 return colorMap.size();
126 virtual void setColorScale(
const std::vector<Color> colors,
const bool gradient =
true);
136 virtual void setColorAtPos(
const float pos,
const Color &color);
148 virtual Color getColorAtPos(
const float pos)
const;
155 return !colorMap.empty();
174 void setColorMap(
const std::map<float, Color> &colorMap);
195 void setColorMapTransparency(
unsigned char transparency);
202 return (gradient == cs.gradient) && (colorMap == cs.colorMap);
209 bool operator==(
const std::vector<Color> &colors)
const;
218 bool hasRegularStops()
const;
221 std::map<float, Color> colorMap;
bool operator==(const ColorScale &cs) const
Tests color scale equality with another one.
unsigned int getStopsCount()
Gets the number of stops points into the color scale.
bool colorScaleInitialized() const
Returns true is the color scale was initialized.
bool isGradient() const
Returns true if the color scale is a gradient.
void clear()
Clears the color scale.
This class represents a color scale to perform color mapping. The color scale can be either a gradien...
std::map< float, Color > getColorMap() const
Returns a map corresponding to the color scale. The index of the map is the position for the correspo...
void setGradient(const bool g)
specify whether the color scale must be considered as a gradient
The Observable class is the base of Tulip's observation system.