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. More... | |
bool | contains (const std::string &name) const |
Returns the information whether a setting with the given name is stored. More... | |
GUIVisualizationSettings & | get (const std::string &name) |
Returns the named scheme. More... | |
GUIVisualizationSettings & | getDefault () |
Returns the default scheme. More... | |
const std::vector< std::string > & | getNames () const |
Returns a list of stored settings names. More... | |
int | getNumInitialSettings () const |
Returns the number of initial settings. More... | |
GUICompleteSchemeStorage () | |
Constructor. More... | |
void | init (FXApp *app) |
Initialises the storage with some default settings. More... | |
void | remove (const std::string &name) |
Removes the setting with the given name. More... | |
void | saveViewport (const SUMOReal x, const SUMOReal y, const SUMOReal z) |
Makes the given viewport the default. More... | |
void | setDefault (const std::string &name) |
Makes the scheme with the given name the default. More... | |
void | setViewport (GUISUMOAbstractView *view) |
Sets the default viewport. More... | |
void | writeSettings (FXApp *app) |
Writes the current scheme into the registry. More... | |
~GUICompleteSchemeStorage () | |
Destructor. More... | |
Protected Attributes | |
std::string | myDefaultSettingName |
Name of the default setting. More... | |
Position | myLookAt |
Position | myLookFrom |
The default viewport. More... | |
int | myNumInitialSettings |
The number of settings which were present at startup. More... | |
std::map< std::string, GUIVisualizationSettings > | mySettings |
A map of settings referenced by their names. More... | |
std::vector< std::string > | mySortedSchemeNames |
List of known setting names. More... | |
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(), GNEViewNet::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(), GUIViewTraffic::setColorScheme(), and GNEViewNet::setColorScheme().
GUIVisualizationSettings & GUICompleteSchemeStorage::getDefault | ( | ) |
Returns the default scheme.
Definition at line 80 of file GUICompleteSchemeStorage.cpp.
References myDefaultSettingName, and mySettings.
Referenced by GUISUMOAbstractView::GUISUMOAbstractView(), GUIApplicationWindow::onCmdGaming(), and GUIDanielPerspectiveChanger::onMouseMove().
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().
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::containerQuality, GUIVisualizationSettings::hideConnectors, GUIVisualizationSettings::laneShowBorders, GUIVisualizationSizeSettings::minSize, myDefaultSettingName, myLookFrom, myNumInitialSettings, mySortedSchemeNames, GUIVisualizationSettings::name, GUIVisualizationSettings::personQuality, Position::set(), GUIVisualizationSettings::showLinkDecals, GUIVisualizationSettings::showRails, toString(), GUIVisualizationSettings::vehicleQuality, and GUIVisualizationSettings::vehicleSize.
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 | z | ||
) |
Makes the given viewport the default.
[in] | x | The x-offset |
[in] | y | The y-offset |
[in] | z | The camera height |
Definition at line 212 of file GUICompleteSchemeStorage.cpp.
References myLookFrom, and Position::set().
Referenced by GUIApplicationWindow::loadConfigOrNet(), GNEApplicationWindow::loadConfigOrNet(), 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 218 of file GUICompleteSchemeStorage.cpp.
References myLookFrom, GUISUMOAbstractView::recenterView(), GUISUMOAbstractView::setViewportFromTo(), Position::x(), Position::y(), and Position::z().
Referenced by GUISUMOAbstractView::GUISUMOAbstractView(), and GNEApplicationWindow::handleEvent_NetworkLoaded().
void GUICompleteSchemeStorage::writeSettings | ( | FXApp * | app | ) |
Writes the current scheme into the registry.
[in] | app | The application |
Definition at line 189 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.
|
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().