Eclipse 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. | |
void | clearDecals () |
Clear the default decals. | |
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. | |
const std::vector< GUISUMOAbstractView::Decal > & | getDecals () |
Returns the default decals. | |
GUIVisualizationSettings & | getDefault () |
Returns the default scheme. | |
const std::vector< std::string > & | getNames () const |
Returns a list of stored settings names. | |
int | getNumInitialSettings () const |
Returns the number of initial settings. | |
GUICompleteSchemeStorage () | |
Constructor. | |
void | init (FXApp *app, bool netedit=false) |
Initialises the storage with some default settings. | |
void | remove (const std::string name) |
Removes the setting with the given name. | |
void | saveDecals (const std::vector< GUISUMOAbstractView::Decal > &decals) |
Makes the given decals the default. | |
void | saveViewport (const double x, const double y, const double z, const double rot) |
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::vector< GUISUMOAbstractView::Decal > | myDecals |
The default decals. | |
std::string | myDefaultSettingName |
Name of the default setting. | |
Position | myLookAt |
Position | myLookFrom |
The default viewport. | |
int | myNumInitialSettings |
The number of settings which were present at startup. | |
double | myRotation |
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 38 of file GUICompleteSchemeStorage.h.
GUICompleteSchemeStorage::GUICompleteSchemeStorage | ( | ) |
Constructor.
Definition at line 43 of file GUICompleteSchemeStorage.cpp.
GUICompleteSchemeStorage::~GUICompleteSchemeStorage | ( | ) |
void GUICompleteSchemeStorage::add | ( | const GUIVisualizationSettings & | scheme | ) |
Adds a visualization scheme.
[in] | scheme | The visualization scheme to add |
Definition at line 55 of file GUICompleteSchemeStorage.cpp.
References GUIVisualizationSettings::copy(), mySettings, mySortedSchemeNames, and GUIVisualizationSettings::name.
Referenced by init(), GUISettingsHandler::myEndElement(), GUIDialog_ViewSettings::onCmdColorChange(), and GUIDialog_ViewSettings::onCmdSaveSetting().
|
inline |
Clear the default decals.
Definition at line 134 of file GUICompleteSchemeStorage.h.
References myDecals.
Referenced by GUIApplicationWindow::handleEvent_SimulationLoaded().
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 79 of file GUICompleteSchemeStorage.cpp.
References mySettings.
Referenced by GUISettingsHandler::myStartElement(), GUIDialog_ViewSettings::onCmdColorChange(), remove(), GNEViewNet::setColorScheme(), 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 67 of file GUICompleteSchemeStorage.cpp.
References mySettings.
Referenced by GUIDialog_ViewSettings::loadSettings(), GUISettingsHandler::myStartElement(), GUIDialog_ViewSettings::onCmdColorChange(), GUIDialog_ViewSettings::onCmdNameChange(), GUIDialog_ViewSettings::onCmdSaveSetting(), GNEViewNet::setColorScheme(), and GUIViewTraffic::setColorScheme().
|
inline |
Returns the default decals.
Definition at line 128 of file GUICompleteSchemeStorage.h.
References myDecals.
Referenced by GUISUMOAbstractView::GUISUMOAbstractView().
GUIVisualizationSettings & GUICompleteSchemeStorage::getDefault | ( | ) |
Returns the default scheme.
Definition at line 73 of file GUICompleteSchemeStorage.cpp.
References myDefaultSettingName, and mySettings.
Referenced by GUISUMOAbstractView::GUISUMOAbstractView(), GUIDanielPerspectiveChanger::onKeyPress(), and GUIDanielPerspectiveChanger::onMouseMove().
const std::vector< std::string > & GUICompleteSchemeStorage::getNames | ( | ) | const |
Returns a list of stored settings names.
Definition at line 105 of file GUICompleteSchemeStorage.cpp.
References mySortedSchemeNames.
Referenced by GUIDialog_ViewSettings::buildHeader(), GUIViewTraffic::buildViewToolBars(), GNEViewNet::buildViewToolBars(), and writeSettings().
int GUICompleteSchemeStorage::getNumInitialSettings | ( | ) | const |
Returns the number of initial settings.
Definition at line 111 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, |
bool | netedit = false |
||
) |
Initialises the storage with some default settings.
[in] | app | The application |
Definition at line 117 of file GUICompleteSchemeStorage.cpp.
References add(), GUISettingsHandler::addSettings(), GUIVisualizationSettings::backgroundColor, GUIVisualizationSizeSettings::constantSize, GUIVisualizationSettings::containerColorer, GUIVisualizationSettings::containerQuality, GUIVisualizationSettings::edgeColorer, gSchemeStorage, GUIVisualizationSettings::hideConnectors, GUIVisualizationSettings::junctionColorer, GUIVisualizationSettings::junctionSize, GUIVisualizationSettings::laneColorer, GUIVisualizationSettings::laneShowBorders, GUIVisualizationSizeSettings::minSize, myDefaultSettingName, myLookFrom, myNumInitialSettings, mySortedSchemeNames, GUIVisualizationSettings::personColorer, GUIVisualizationSettings::personQuality, GUIVisualizationSettings::poiColorer, GUIVisualizationSettings::polyColorer, GUIVisualizationSettings::SCHEME_NAME_SELECTION, GUIVisualizationSettings::SCHEME_NAME_TYPE, Position::set(), GUIPropertySchemeStorage< T >::setSchemeByName(), GUIVisualizationSettings::showLaneDirection, GUIVisualizationSettings::showLinkDecals, GUIVisualizationSettings::showRails, GUIVisualizationSettings::showSublanes, GUIVisualizationSettings::spreadSuperposed, toString(), GUIVisualizationSettings::vehicleColorer, 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 85 of file GUICompleteSchemeStorage.cpp.
References contains(), mySettings, and mySortedSchemeNames.
Referenced by GUIDialog_ViewSettings::onCmdDeleteSetting(), and GUIDialog_ViewSettings::onCmdSaveSetting().
void GUICompleteSchemeStorage::saveDecals | ( | const std::vector< GUISUMOAbstractView::Decal > & | decals | ) |
Makes the given decals the default.
Definition at line 232 of file GUICompleteSchemeStorage.cpp.
References myDecals.
Referenced by GUISUMOAbstractView::~GUISUMOAbstractView().
void GUICompleteSchemeStorage::saveViewport | ( | const double | x, |
const double | y, | ||
const double | z, | ||
const double | rot | ||
) |
Makes the given viewport the default.
[in] | x | The x-offset |
[in] | y | The y-offset |
[in] | z | The camera height |
Definition at line 226 of file GUICompleteSchemeStorage.cpp.
References myLookFrom, myRotation, and Position::set().
Referenced by GNEApplicationWindow::createNewNetwork(), GUIApplicationWindow::loadConfigOrNet(), GNEApplicationWindow::loadConfiguration(), GNEApplicationWindow::loadNetwork(), GNEApplicationWindow::loadOSM(), GNEApplicationWindow::onCmdReloadNetwork(), GNEApplicationWindow::onCmdSmartReload(), 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 96 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 240 of file GUICompleteSchemeStorage.cpp.
References myLookFrom, myRotation, GUISUMOAbstractView::recenterView(), GUISUMOAbstractView::setViewportFromToRot(), Position::x(), Position::y(), 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 203 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 |
The default decals.
Definition at line 156 of file GUICompleteSchemeStorage.h.
Referenced by clearDecals(), getDecals(), and saveDecals().
|
protected |
Name of the default setting.
Definition at line 146 of file GUICompleteSchemeStorage.h.
Referenced by getDefault(), init(), and setDefault().
|
protected |
Definition at line 152 of file GUICompleteSchemeStorage.h.
|
protected |
The default viewport.
Definition at line 152 of file GUICompleteSchemeStorage.h.
Referenced by init(), saveViewport(), and setViewport().
|
protected |
The number of settings which were present at startup.
Definition at line 149 of file GUICompleteSchemeStorage.h.
Referenced by getNumInitialSettings(), init(), and writeSettings().
|
protected |
Definition at line 153 of file GUICompleteSchemeStorage.h.
Referenced by saveViewport(), and setViewport().
|
protected |
A map of settings referenced by their names.
Definition at line 140 of file GUICompleteSchemeStorage.h.
Referenced by add(), contains(), get(), getDefault(), remove(), writeSettings(), and ~GUICompleteSchemeStorage().
|
protected |
List of known setting names.
Definition at line 143 of file GUICompleteSchemeStorage.h.
Referenced by add(), getNames(), init(), and remove().