21 #ifndef GUIColorScheme_h
22 #define GUIColorScheme_h
51 const std::string& colName =
"",
const bool isFixed =
false)
65 std::vector<std::string>::iterator nameIt =
myNames.begin();
66 std::vector<RGBColor>::iterator colIt =
myColors.begin();
67 for (; nameIt !=
myNames.end(); ++nameIt, ++colIt) {
68 if (*nameIt == name) {
77 std::vector<RGBColor>::iterator colIt =
myColors.begin();
78 std::vector<SUMOReal>::iterator threshIt =
myThresholds.begin();
79 std::vector<std::string>::iterator nameIt =
myNames.begin();
81 while (threshIt !=
myThresholds.end() && (*threshIt) < threshold) {
110 std::vector<RGBColor>::const_iterator colIt =
myColors.begin() + 1;
111 std::vector<SUMOReal>::const_iterator threshIt =
myThresholds.begin() + 1;
112 while (threshIt !=
myThresholds.end() && (*threshIt) <= value) {
166 dev <<
" <colorScheme name=\"" <<
myName;
171 std::vector<RGBColor>::const_iterator colIt =
myColors.begin();
172 std::vector<SUMOReal>::const_iterator threshIt =
myThresholds.begin();
173 std::vector<std::string>::const_iterator nameIt =
myNames.begin();
175 dev <<
" <entry color=\"" << (*colIt);
177 dev <<
"\" threshold=\"" << (*threshIt);
179 if ((*nameIt) !=
"") {
180 dev <<
"\" name=\"" << (*nameIt);
187 dev <<
" </colorScheme>\n";
bool allowsNegativeValues() const
bool myAllowNegativeValues
bool isInterpolated() const
const RGBColor getColor(const SUMOReal value) const
std::vector< std::string > myNames
std::vector< RGBColor > myColors
void setInterpolated(const bool interpolate, SUMOReal interpolationStart=0.f)
void removeColor(const size_t pos)
static RGBColor interpolate(const RGBColor &minColor, const RGBColor &maxColor, SUMOReal weight)
Interpolates between two colors.
void setThreshold(const size_t pos, const SUMOReal threshold)
const std::vector< SUMOReal > & getThresholds() const
const std::string & getName() const
bool setColor(const std::string &name, const RGBColor &color)
std::vector< SUMOReal > myThresholds
void setAllowsNegativeValues(bool value)
bool operator==(const GUIColorScheme &c) const
const std::vector< RGBColor > & getColors() const
unsigned int addColor(const RGBColor &color, const SUMOReal threshold, const std::string &name="")
const std::vector< std::string > & getNames() const
void setColor(const size_t pos, const RGBColor &color)
Static storage of an output device and its base (abstract) implementation.
GUIColorScheme(const std::string &name, const RGBColor &baseColor, const std::string &colName="", const bool isFixed=false)
Constructor.
void save(OutputDevice &dev) const