SUMO - Simulation of Urban MObility
|
Storage for available visualization settings. More...
#include <GUICompleteSchemeStorage.h>
Public Member Functions | |
void | add (const GUIVisualizationSettings &scheme) |
Adds a visualization scheme. | |
bool | contains (const std::string &name) const |
Returns the information whether a setting with the given name is stored. | |
GUIVisualizationSettings & | get (const std::string &name) |
Returns the named scheme. | |
GUIVisualizationSettings & | getDefault () |
Returns the default scheme. | |
const std::vector< std::string > & | getNames () const |
Returns a list of stored settings names. | |
unsigned int | getNumInitialSettings () const |
Returns the number of initial settings. | |
GUICompleteSchemeStorage () | |
Constructor. | |
void | init (FXApp *app) |
Initialises the storage with some default settings. | |
void | remove (const std::string &name) |
Removes the setting with the given name. | |
void | saveViewport (const SUMOReal x, const SUMOReal y, const SUMOReal zoom) |
Makes the given viewport the default. | |
void | setDefault (const std::string &name) |
Makes the scheme with the given name the default. | |
void | setViewport (GUISUMOAbstractView *view) |
Sets the default viewport. | |
void | writeSettings (FXApp *app) |
Writes the current scheme into the registry. | |
~GUICompleteSchemeStorage () | |
Destructor. |
Protected Attributes | |
std::string | myDefaultSettingName |
Name of the default setting. | |
Position | myLookAt |
Position | myLookFrom |
The default viewport. | |
unsigned int | myNumInitialSettings |
The number of settings which were present at startup. | |
std::map< std::string, GUIVisualizationSettings > | mySettings |
A map of settings referenced by their names. | |
std::vector< std::string > | mySortedSchemeNames |
List of known setting names. |
Storage for available visualization settings.
Definition at line 48 of file GUICompleteSchemeStorage.h.
GUICompleteSchemeStorage::GUICompleteSchemeStorage | ( | ) |
Constructor.
Definition at line 56 of file GUICompleteSchemeStorage.cpp.
GUICompleteSchemeStorage::~GUICompleteSchemeStorage | ( | ) |
Destructor.
Definition at line 59 of file GUICompleteSchemeStorage.cpp.
void GUICompleteSchemeStorage::add | ( | const GUIVisualizationSettings & | scheme | ) |
Adds a visualization scheme.
[in] | scheme | The visualization scheme to add |
Definition at line 64 of file GUICompleteSchemeStorage.cpp.
References mySettings, mySortedSchemeNames, and GUIVisualizationSettings::name.
Referenced by GUISettingsHandler::addSettings(), init(), GUIDialog_ViewSettings::onCmdColorChange(), and GUIDialog_ViewSettings::onCmdSaveSetting().
bool GUICompleteSchemeStorage::contains | ( | const std::string & | name | ) | const |
Returns the information whether a setting with the given name is stored.
[in] | name | The name of regarded scheme |
Definition at line 86 of file GUICompleteSchemeStorage.cpp.
References mySettings.
Referenced by GUISettingsHandler::myStartElement(), GUIDialog_ViewSettings::onCmdColorChange(), remove(), GUIViewTraffic::setColorScheme(), and setDefault().
GUIVisualizationSettings & GUICompleteSchemeStorage::get | ( | const std::string & | name | ) |
Returns the named scheme.
[in] | name | The name of the visualization scheme to return |
Definition at line 74 of file GUICompleteSchemeStorage.cpp.
References mySettings.
Referenced by GUIDialog_ViewSettings::loadSettings(), GUISettingsHandler::myStartElement(), GUIDialog_ViewSettings::onCmdColorChange(), GUIDialog_ViewSettings::onCmdNameChange(), GUIDialog_ViewSettings::onCmdSaveSetting(), and GUIViewTraffic::setColorScheme().
GUIVisualizationSettings & GUICompleteSchemeStorage::getDefault | ( | ) |
Returns the default scheme.
Definition at line 80 of file GUICompleteSchemeStorage.cpp.
References myDefaultSettingName, and mySettings.
Referenced by GUISUMOAbstractView::GUISUMOAbstractView().
const std::vector< std::string > & GUICompleteSchemeStorage::getNames | ( | ) | const |
Returns a list of stored settings names.
Definition at line 111 of file GUICompleteSchemeStorage.cpp.
References mySortedSchemeNames.
Referenced by GUIViewTraffic::buildViewToolBars(), GUIDialog_ViewSettings::GUIDialog_ViewSettings(), and writeSettings().
unsigned int GUICompleteSchemeStorage::getNumInitialSettings | ( | ) | const |
Returns the number of initial settings.
Definition at line 117 of file GUICompleteSchemeStorage.cpp.
References myNumInitialSettings.
Referenced by GUIDialog_ViewSettings::onCmdColorChange(), GUIDialog_ViewSettings::onCmdDeleteSetting(), GUIDialog_ViewSettings::onCmdSaveSetting(), GUIDialog_ViewSettings::onUpdDeleteSetting(), GUIDialog_ViewSettings::onUpdExportSetting(), and GUIDialog_ViewSettings::onUpdSaveSetting().
void GUICompleteSchemeStorage::init | ( | FXApp * | app | ) |
Initialises the storage with some default settings.
[in] | app | The application |
Definition at line 123 of file GUICompleteSchemeStorage.cpp.
References add(), GUISettingsHandler::addSettings(), GUIVisualizationSettings::backgroundColor, GUIVisualizationSettings::hideConnectors, GUIVisualizationSettings::laneShowBorders, GUIVisualizationSettings::minVehicleSize, myDefaultSettingName, myLookFrom, myNumInitialSettings, mySortedSchemeNames, GUIVisualizationSettings::name, Position::set(), GUIVisualizationSettings::showLinkDecals, GUIVisualizationSettings::showRails, toString(), and GUIVisualizationSettings::vehicleQuality.
Referenced by main().
void GUICompleteSchemeStorage::remove | ( | const std::string & | name | ) |
Removes the setting with the given name.
[in] | name | The name of the scheme to remove |
Definition at line 92 of file GUICompleteSchemeStorage.cpp.
References contains(), mySettings, and mySortedSchemeNames.
Referenced by GUIDialog_ViewSettings::onCmdDeleteSetting(), and GUIDialog_ViewSettings::onCmdSaveSetting().
void GUICompleteSchemeStorage::saveViewport | ( | const SUMOReal | x, |
const SUMOReal | y, | ||
const SUMOReal | zoom | ||
) |
Makes the given viewport the default.
[in] | x | The x-offset |
[in] | y | The y-offset |
[in] | zoom | The zoom |
Definition at line 208 of file GUICompleteSchemeStorage.cpp.
References myLookFrom, and Position::set().
Referenced by GUIApplicationWindow::load(), and GUISUMOAbstractView::~GUISUMOAbstractView().
void GUICompleteSchemeStorage::setDefault | ( | const std::string & | name | ) |
Makes the scheme with the given name the default.
[in] | name | The name of the scheme to marks as default |
Definition at line 102 of file GUICompleteSchemeStorage.cpp.
References contains(), and myDefaultSettingName.
Referenced by GUISUMOAbstractView::~GUISUMOAbstractView().
void GUICompleteSchemeStorage::setViewport | ( | GUISUMOAbstractView * | view | ) |
Sets the default viewport.
[in] | parent | the view for which the viewport has to be set |
Definition at line 214 of file GUICompleteSchemeStorage.cpp.
References myLookAt, myLookFrom, GUISUMOAbstractView::recenterView(), GUISUMOAbstractView::setViewport(), and Position::z().
Referenced by GUISUMOAbstractView::GUISUMOAbstractView().
void GUICompleteSchemeStorage::writeSettings | ( | FXApp * | app | ) |
Writes the current scheme into the registry.
[in] | app | The application |
Definition at line 185 of file GUICompleteSchemeStorage.cpp.
References getNames(), OutputDevice_String::getString(), myNumInitialSettings, mySettings, GUIVisualizationSettings::name, GUIVisualizationSettings::save(), and toString().
Referenced by GUIDialog_ViewSettings::onCmdDeleteSetting(), and GUIDialog_ViewSettings::onCmdSaveSetting().
|
protected |
Name of the default setting.
Definition at line 142 of file GUICompleteSchemeStorage.h.
Referenced by getDefault(), init(), and setDefault().
|
protected |
Definition at line 148 of file GUICompleteSchemeStorage.h.
Referenced by setViewport().
|
protected |
The default viewport.
Definition at line 148 of file GUICompleteSchemeStorage.h.
Referenced by init(), saveViewport(), and setViewport().
|
protected |
The number of settings which were present at startup.
Definition at line 145 of file GUICompleteSchemeStorage.h.
Referenced by getNumInitialSettings(), init(), and writeSettings().
|
protected |
A map of settings referenced by their names.
Definition at line 136 of file GUICompleteSchemeStorage.h.
Referenced by add(), contains(), get(), getDefault(), remove(), and writeSettings().
|
protected |
List of known setting names.
Definition at line 139 of file GUICompleteSchemeStorage.h.
Referenced by add(), getNames(), init(), and remove().