SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GUIPropertyScheme< T > Class Template Reference

#include <GUIPropertyScheme.h>

Public Member Functions

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

Private Attributes

bool myAllowNegativeValues
 
std::vector< T > myColors
 
bool myIsFixed
 
bool myIsInterpolated
 
std::string myName
 
std::vector< std::string > myNames
 
std::vector< SUMORealmyThresholds
 

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 52 of file GUIPropertyScheme.h.

Constructor & Destructor Documentation

template<class T >
GUIPropertyScheme< T >::GUIPropertyScheme ( const std::string &  name,
const T &  baseColor,
const std::string &  colName = "",
const bool  isFixed = false,
SUMOReal  baseValue = 0 
)
inline

Constructor.

Definition at line 55 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::addColor().

Member Function Documentation

template<class T >
bool GUIPropertyScheme< T >::allowsNegativeValues ( ) const
inline
template<class T >
void GUIPropertyScheme< T >::clear ( )
inline
template<class T >
const std::vector<T>& GUIPropertyScheme< T >::getColors ( ) const
inline
template<class T >
const std::string& GUIPropertyScheme< T >::getName ( ) const
inline

Definition at line 140 of file GUIPropertyScheme.h.

References GUIPropertyScheme< T >::myName.

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

Definition at line 210 of file GUIPropertyScheme.h.

References SUMO_TAG_COLORSCHEME, and toString().

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

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

Definition at line 220 of file GUIPropertyScheme.h.

References SUMO_TAG_SCALINGSCHEME, and toString().

template<class T >
const std::vector<SUMOReal>& GUIPropertyScheme< T >::getThresholds ( ) const
inline
template<class T >
RGBColor GUIPropertyScheme< T >::interpolate ( const RGBColor min,
const RGBColor max,
SUMOReal  weight 
) const
inline

specializations for GUIColorScheme

Definition at line 206 of file GUIPropertyScheme.h.

References RGBColor::interpolate().

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

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

specializations for GUIScaleScheme

Definition at line 216 of file GUIPropertyScheme.h.

References min.

template<class T >
bool GUIPropertyScheme< T >::isInterpolated ( ) const
inline
template<class T >
void GUIPropertyScheme< T >::setAllowsNegativeValues ( bool  value)
inline
template<class T >
void GUIPropertyScheme< T >::setColor ( const size_t  pos,
const T &  color 
)
inline
template<class T >
bool GUIPropertyScheme< T >::setColor ( const std::string &  name,
const T &  color 
)
inline
template<class T >
void GUIPropertyScheme< T >::setInterpolated ( const bool  interpolate,
SUMOReal  interpolationStart = 0.f 
)
inline
template<class T >
void GUIPropertyScheme< T >::setThreshold ( const size_t  pos,
const SUMOReal  threshold 
)
inline

Field Documentation

template<class T >
bool GUIPropertyScheme< T >::myAllowNegativeValues
private
template<class T >
bool GUIPropertyScheme< T >::myIsFixed
private
template<class T >
std::string GUIPropertyScheme< T >::myName
private

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