#include <GUIColorer.h>
Definition at line 52 of file GUIColorer.h.
Public Member Functions | |
| void | fill (FXComboBox &cb) |
| Fills the given combobox with the names of available colorings. | |
| const size_t | getActive () const |
| virtual SUMOReal | getColorValue (const T &i) const =0 |
| Sets the color using a value from the given instance of T. | |
| GUIColorScheme & | getScheme () |
| GUIColorScheme * | getSchemeByName (std::string name) |
| GUIColorer () | |
| Constructor. | |
| bool | operator== (const GUIColorer &c) const |
| void | save (OutputDevice &dev) const |
| void | setActive (size_t scheme) |
| virtual bool | setFunctionalColor (const T &i) const |
| Sets the color using a function call for the given instance of T. | |
| void | setGlColor (const T &i) const |
| Sets the color using a value from the given instance of T. | |
| virtual | ~GUIColorer () |
| Destructor. | |
Protected Attributes | |
| size_t | myActiveScheme |
| std::vector< GUIColorScheme > | mySchemes |
| GUIColorer< T >::GUIColorer | ( | ) | [inline] |
| virtual GUIColorer< T >::~GUIColorer | ( | ) | [inline, virtual] |
| void GUIColorer< T >::fill | ( | FXComboBox & | cb | ) | [inline] |
Fills the given combobox with the names of available colorings.
Definition at line 77 of file GUIColorer.h.
00077 { 00078 typename std::vector<GUIColorScheme>::iterator i; 00079 for (i=mySchemes.begin(); i!=mySchemes.end(); ++i) { 00080 cb.appendItem((*i).getName().c_str()); 00081 } 00082 cb.setCurrentItem((FXint)myActiveScheme); 00083 }
| const size_t GUIColorer< T >::getActive | ( | ) | const [inline] |
Definition at line 91 of file GUIColorer.h.
Referenced by GUIVisualizationSettings::getLaneEdgeMode(), GUIDialog_ViewSettings::onCmdColorChange(), GUIDialog_ViewSettings::onCmdNameChange(), and GUIVisualizationSettings::save().
00091 { 00092 return myActiveScheme; 00093 }
| virtual SUMOReal GUIColorer< T >::getColorValue | ( | const T & | i | ) | const [pure virtual] |
Sets the color using a value from the given instance of T.
Implemented in GUILaneWrapper::Colorer, and GUIVehicle::Colorer.
Referenced by GUIColorer< GUIVehicle >::setGlColor().
| GUIColorScheme& GUIColorer< T >::getScheme | ( | ) | [inline] |
Definition at line 95 of file GUIColorer.h.
Referenced by GUIVisualizationSettings::getLaneEdgeScheme(), GUIDialog_ViewSettings::onCmdColorChange(), and GUIDialog_ViewSettings::rebuildColorMatrices().
00095 { 00096 return mySchemes[myActiveScheme]; 00097 }
| GUIColorScheme* GUIColorer< T >::getSchemeByName | ( | std::string | name | ) | [inline] |
Definition at line 99 of file GUIColorer.h.
Referenced by GUISettingsHandler::myStartElement().
00099 { 00100 typename std::vector<GUIColorScheme>::iterator i; 00101 for (i=mySchemes.begin(); i!=mySchemes.end(); ++i) { 00102 if ((*i).getName() == name) { 00103 return &(*i); 00104 } 00105 } 00106 return 0; 00107 }
| bool GUIColorer< T >::operator== | ( | const GUIColorer< T > & | c | ) | const [inline] |
Definition at line 116 of file GUIColorer.h.
00116 { 00117 return myActiveScheme == c.myActiveScheme && mySchemes == c.mySchemes; 00118 }
| void GUIColorer< T >::save | ( | OutputDevice & | dev | ) | const [inline] |
Definition at line 109 of file GUIColorer.h.
Referenced by GUIVisualizationSettings::save().
00109 { 00110 typename std::vector<GUIColorScheme>::const_iterator i = mySchemes.begin(); 00111 for (; i!=mySchemes.end(); ++i) { 00112 i->save(dev); 00113 } 00114 }
| void GUIColorer< T >::setActive | ( | size_t | scheme | ) | [inline] |
Definition at line 85 of file GUIColorer.h.
Referenced by GUISettingsHandler::myStartElement(), and GUIDialog_ViewSettings::onCmdColorChange().
00085 { 00086 if (scheme < mySchemes.size()) { 00087 myActiveScheme = scheme; 00088 } 00089 }
| virtual bool GUIColorer< T >::setFunctionalColor | ( | const T & | i | ) | const [inline, virtual] |
Sets the color using a function call for the given instance of T.
Reimplemented in GUIVehicle::Colorer.
Definition at line 64 of file GUIColorer.h.
Referenced by GUIColorer< GUIVehicle >::setGlColor().
| void GUIColorer< T >::setGlColor | ( | const T & | i | ) | const [inline] |
Sets the color using a value from the given instance of T.
Definition at line 69 of file GUIColorer.h.
Referenced by GUIViewTraffic::drawRoute().
00069 { 00070 if (!setFunctionalColor(i)) { 00071 const RGBColor& c = mySchemes[myActiveScheme].getColor(getColorValue(i)); 00072 glColor3d(c.red(), c.green(), c.blue()); 00073 } 00074 }
size_t GUIColorer< T >::myActiveScheme [protected] |
Definition at line 121 of file GUIColorer.h.
Referenced by GUIColorer< GUIVehicle >::fill(), GUIColorer< GUIVehicle >::getActive(), GUIColorer< GUIVehicle >::getScheme(), GUIColorer< GUIVehicle >::operator==(), GUIColorer< GUIVehicle >::setActive(), and GUIColorer< GUIVehicle >::setGlColor().
std::vector<GUIColorScheme> GUIColorer< T >::mySchemes [protected] |
Definition at line 122 of file GUIColorer.h.
Referenced by GUIColorer< GUIVehicle >::fill(), GUIColorer< GUIVehicle >::getScheme(), GUIColorer< GUIVehicle >::getSchemeByName(), GUIColorer< GUIVehicle >::operator==(), GUIColorer< GUIVehicle >::save(), GUIColorer< GUIVehicle >::setActive(), and GUIColorer< GUIVehicle >::setGlColor().
1.5.6