Eclipse SUMO - Simulation of Urban MObility
GUIPropertyScheme< T > Class Template Reference

#include <GUIPropertyScheme.h>

Collaboration diagram for GUIPropertyScheme< T >:
[legend]

Public Member Functions

int addColor (const T &color, const double threshold, const std::string &name="")
 
bool allowsNegativeValues () const
 
void clear ()
 
const RGBColorgetBackgroundColor () const
 
getColor (const double value) const
 
const std::vector< T > & getColors () const
 
GUIIcon getIcon () const
 
const std::string & getName () const
 
const std::vector< std::string > & getNames () const
 
std::string getTagName (std::vector< double >) const
 
std::string getTagName (std::vector< RGBColor >) const
 
const std::vector< double > & getThresholds () const
 
const std::string & getTranslatedName () const
 
 GUIPropertyScheme (const std::string &name, const std::string &translatedName, const T &baseColor, const std::string &colName="", const bool isFixed=false, double baseValue=0, RGBColor bgColor=RGBColor::WHITE, GUIIcon icon=GUIIcon::EMPTY)
 Constructor. More...
 
 GUIPropertyScheme (const std::string &name, const T &baseColor, const std::string &colName="", const bool isFixed=false, double baseValue=0, RGBColor bgColor=RGBColor::WHITE, GUIIcon icon=GUIIcon::EMPTY)
 
double interpolate (const double &min, const double &max, double weight) const
 specializations for GUIScaleScheme More...
 
RGBColor interpolate (const RGBColor &min, const RGBColor &max, double weight) const
 specializations for GUIColorScheme More...
 
bool isFixed () const
 
bool isInterpolated () const
 
bool operator== (const GUIPropertyScheme &c) const
 
void removeColor (const int pos)
 
void save (OutputDevice &dev, const std::string &prefix="") const
 
void setAllowsNegativeValues (bool value)
 
void setColor (const int pos, const T &color)
 
bool setColor (const std::string &name, const T &color)
 
void setInterpolated (const bool interpolate, double interpolationStart=0.f)
 
void setThreshold (const int pos, const double threshold)
 

Private Attributes

bool myAllowNegativeValues
 
RGBColor myBgColor
 
std::vector< T > myColors
 
GUIIcon myIcon
 
bool myIsFixed
 
bool myIsInterpolated
 
std::string myName
 
std::vector< std::string > myNames
 
std::vector< double > myThresholds
 
std::string myTranslatedName
 

Detailed Description

template<class T>
class GUIPropertyScheme< T >

This class provides a mapping from real values to properties (mainly colors). Each color is stored along with a threshold value. Color values between thresholds are obtained by interpolation

Definition at line 43 of file GUIPropertyScheme.h.

Constructor & Destructor Documentation

◆ GUIPropertyScheme() [1/2]

template<class T >
GUIPropertyScheme< T >::GUIPropertyScheme ( const std::string &  name,
const std::string &  translatedName,
const T &  baseColor,
const std::string &  colName = "",
const bool  isFixed = false,
double  baseValue = 0,
RGBColor  bgColor = RGBColor::WHITE,
GUIIcon  icon = GUIIcon::EMPTY 
)
inline

Constructor.

Definition at line 46 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::addColor().

◆ GUIPropertyScheme() [2/2]

template<class T >
GUIPropertyScheme< T >::GUIPropertyScheme ( const std::string &  name,
const T &  baseColor,
const std::string &  colName = "",
const bool  isFixed = false,
double  baseValue = 0,
RGBColor  bgColor = RGBColor::WHITE,
GUIIcon  icon = GUIIcon::EMPTY 
)
inline

Definition at line 60 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::addColor().

Member Function Documentation

◆ addColor()

template<class T >
int GUIPropertyScheme< T >::addColor ( const T &  color,
const double  threshold,
const std::string &  name = "" 
)
inline

◆ allowsNegativeValues()

template<class T >
bool GUIPropertyScheme< T >::allowsNegativeValues ( ) const
inline

Definition at line 179 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myAllowNegativeValues.

Referenced by GUIDialog_ViewSettings::rebuildColorMatrix(), and GUIDialog_ViewSettings::rebuildScaleMatrix().

Here is the caller graph for this function:

◆ clear()

template<class T >
void GUIPropertyScheme< T >::clear ( )
inline

Definition at line 118 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myColors, GUIPropertyScheme< T >::myNames, and GUIPropertyScheme< T >::myThresholds.

Referenced by GNEViewNet::buildColorRainbow(), GUIViewTraffic::buildColorRainbow(), GUIOverheadWire::drawGL(), and GUISettingsHandler::myStartElement().

Here is the caller graph for this function:

◆ getBackgroundColor()

template<class T >
const RGBColor& GUIPropertyScheme< T >::getBackgroundColor ( ) const
inline

Definition at line 191 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myBgColor.

◆ getColor()

◆ getColors()

template<class T >
const std::vector<T>& GUIPropertyScheme< T >::getColors ( ) const
inline

Definition at line 159 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myColors.

Referenced by GUISUMOAbstractView::displayColorLegend(), GUIDialog_ViewSettings::rebuildColorMatrix(), and GUIDialog_ViewSettings::rebuildScaleMatrix().

Here is the caller graph for this function:

◆ getIcon()

template<class T >
GUIIcon GUIPropertyScheme< T >::getIcon ( ) const
inline

Definition at line 187 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myIcon.

◆ getName()

template<class T >
const std::string& GUIPropertyScheme< T >::getName ( ) const
inline

Definition at line 151 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myName.

Referenced by GNEViewNet::buildColorRainbow(), GUIViewTraffic::buildColorRainbow(), GUISUMOAbstractView::displayColorLegend(), GUIDialog_ViewSettings::onCmdColorChange(), GNEEdgeData::setColor(), and GNEEdgeRelData::setColor().

Here is the caller graph for this function:

◆ getNames()

template<class T >
const std::vector<std::string>& GUIPropertyScheme< T >::getNames ( ) const
inline

Definition at line 171 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myNames.

Referenced by GUISUMOAbstractView::displayColorLegend(), GUIDialog_ViewSettings::rebuildColorMatrix(), and GUIDialog_ViewSettings::rebuildScaleMatrix().

Here is the caller graph for this function:

◆ getTagName() [1/2]

template<class T >
std::string GUIPropertyScheme< T >::getTagName ( std::vector< double >  ) const
inline

Definition at line 250 of file GUIPropertyScheme.h.

References SUMO_TAG_SCALINGSCHEME, and toString().

◆ getTagName() [2/2]

template<class T >
std::string GUIPropertyScheme< T >::getTagName ( std::vector< RGBColor ) const
inline

Definition at line 240 of file GUIPropertyScheme.h.

References SUMO_TAG_COLORSCHEME, and toString().

Referenced by GUIPropertyScheme< T >::save().

Here is the caller graph for this function:

◆ getThresholds()

template<class T >
const std::vector<double>& GUIPropertyScheme< T >::getThresholds ( ) const
inline

Definition at line 163 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myThresholds.

Referenced by GUISUMOAbstractView::displayColorLegend(), GUIDialog_ViewSettings::rebuildColorMatrix(), and GUIDialog_ViewSettings::rebuildScaleMatrix().

Here is the caller graph for this function:

◆ getTranslatedName()

template<class T >
const std::string& GUIPropertyScheme< T >::getTranslatedName ( ) const
inline

Definition at line 155 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myTranslatedName.

◆ interpolate() [1/2]

template<class T >
double GUIPropertyScheme< T >::interpolate ( const double &  min,
const double &  max,
double  weight 
) const
inline

specializations for GUIScaleScheme

Definition at line 246 of file GUIPropertyScheme.h.

◆ interpolate() [2/2]

template<class T >
RGBColor GUIPropertyScheme< T >::interpolate ( const RGBColor min,
const RGBColor max,
double  weight 
) const
inline

specializations for GUIColorScheme

Definition at line 236 of file GUIPropertyScheme.h.

References RGBColor::interpolate().

Referenced by GUIPropertyScheme< T >::getColor(), and GUIPropertyScheme< T >::setInterpolated().

Here is the caller graph for this function:

◆ isFixed()

◆ isInterpolated()

template<class T >
bool GUIPropertyScheme< T >::isInterpolated ( ) const
inline

Definition at line 167 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myIsInterpolated.

Referenced by GUIDialog_ViewSettings::rebuildColorMatrix(), and GUIDialog_ViewSettings::rebuildScaleMatrix().

Here is the caller graph for this function:

◆ operator==()

template<class T >
bool GUIPropertyScheme< T >::operator== ( const GUIPropertyScheme< T > &  c) const
inline

◆ removeColor()

template<class T >
void GUIPropertyScheme< T >::removeColor ( const int  pos)
inline

Definition at line 111 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myColors, GUIPropertyScheme< T >::myNames, and GUIPropertyScheme< T >::myThresholds.

Referenced by GUIDialog_ViewSettings::updateColorRanges(), and GUIDialog_ViewSettings::updateScaleRanges().

Here is the caller graph for this function:

◆ save()

◆ setAllowsNegativeValues()

template<class T >
void GUIPropertyScheme< T >::setAllowsNegativeValues ( bool  value)
inline

Definition at line 183 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myAllowNegativeValues.

Referenced by GUIVisualizationSettings::initNeteditDefaults(), and GUIVisualizationSettings::initSumoGuiDefaults().

Here is the caller graph for this function:

◆ setColor() [1/2]

template<class T >
void GUIPropertyScheme< T >::setColor ( const int  pos,
const T &  color 
)
inline

Definition at line 78 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myColors.

Referenced by GUISettingsHandler::myStartElement(), GUIDialog_ViewSettings::updateColorRanges(), and GUIDialog_ViewSettings::updateScaleRanges().

Here is the caller graph for this function:

◆ setColor() [2/2]

template<class T >
bool GUIPropertyScheme< T >::setColor ( const std::string &  name,
const T &  color 
)
inline

◆ setInterpolated()

template<class T >
void GUIPropertyScheme< T >::setInterpolated ( const bool  interpolate,
double  interpolationStart = 0.f 
)
inline

Definition at line 144 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::interpolate(), GUIPropertyScheme< T >::myIsInterpolated, and GUIPropertyScheme< T >::myThresholds.

Referenced by GUISettingsHandler::myStartElement(), and GUIDialog_ViewSettings::onCmdColorChange().

Here is the caller graph for this function:

◆ setThreshold()

template<class T >
void GUIPropertyScheme< T >::setThreshold ( const int  pos,
const double  threshold 
)
inline

Definition at line 74 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myThresholds.

Referenced by GUIDialog_ViewSettings::updateColorRanges(), and GUIDialog_ViewSettings::updateScaleRanges().

Here is the caller graph for this function:

Field Documentation

◆ myAllowNegativeValues

template<class T >
bool GUIPropertyScheme< T >::myAllowNegativeValues
private

◆ myBgColor

template<class T >
RGBColor GUIPropertyScheme< T >::myBgColor
private

Definition at line 265 of file GUIPropertyScheme.h.

Referenced by GUIPropertyScheme< T >::getBackgroundColor().

◆ myColors

◆ myIcon

template<class T >
GUIIcon GUIPropertyScheme< T >::myIcon
private

Definition at line 264 of file GUIPropertyScheme.h.

Referenced by GUIPropertyScheme< T >::getIcon().

◆ myIsFixed

template<class T >
bool GUIPropertyScheme< T >::myIsFixed
private

◆ myIsInterpolated

◆ myName

template<class T >
std::string GUIPropertyScheme< T >::myName
private

◆ myNames

◆ myThresholds

◆ myTranslatedName

template<class T >
std::string GUIPropertyScheme< T >::myTranslatedName
private

Definition at line 257 of file GUIPropertyScheme.h.

Referenced by GUIPropertyScheme< T >::getTranslatedName().


The documentation for this class was generated from the following file: