23 #include <tulip/Observable.h> 24 #include <tulip/Color.h> 75 ColorScale(
const std::vector<Color> &colors,
const bool gradient =
true);
84 ColorScale(
const std::map<float, Color> &colorMap,
const bool gradient =
true);
107 return colorMap.size();
122 virtual void setColorScale(
const std::vector<Color> colors,
const bool gradient =
true);
132 virtual void setColorAtPos(
const float pos,
const Color &color);
142 virtual Color getColorAtPos(
const float pos)
const;
149 return !colorMap.empty();
167 void setColorMap(
const std::map<float, Color>& colorMap);
188 void setColorMapTransparency(
unsigned char transparency);
195 return (gradient == cs.gradient) && (colorMap == cs.colorMap);
202 bool operator==(
const std::vector<Color> &colors)
const;
210 bool hasRegularStops()
const;
213 std::map<float, Color> colorMap;
unsigned int getStopsCount()
Gets the number of stops points into the color scale.
void clear()
Clears the color scale.
This class represents a color scale to perform color mapping. The color scale can be either a gradien...
void setGradient(const bool g)
specify whether the color scale must be considered as a gradient
bool isGradient() const
Returns true if the color scale is a gradient.
bool colorScaleInitialized() const
Returns true is the color scale was initialized.
The Observable class is the base of Tulip's observation system.
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...
bool operator==(const ColorScale &cs) const
Tests color scale equality with another one.