SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUICompleteSchemeStorage Class Reference

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.
GUIVisualizationSettingsget (const std::string &name)
 Returns the named scheme.
GUIVisualizationSettingsgetDefault ()
 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.
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.
SUMOReal myX
 The default viewport.
SUMOReal myY
SUMOReal myZoom

Detailed Description

Storage for available visualization settings.

Definition at line 48 of file GUICompleteSchemeStorage.h.


Constructor & Destructor Documentation

GUICompleteSchemeStorage::GUICompleteSchemeStorage ( )

Constructor.

Definition at line 56 of file GUICompleteSchemeStorage.cpp.

GUICompleteSchemeStorage::~GUICompleteSchemeStorage ( )

Destructor.

Definition at line 59 of file GUICompleteSchemeStorage.cpp.


Member Function Documentation

void GUICompleteSchemeStorage::add ( const GUIVisualizationSettings scheme)

Adds a visualization scheme.

Parameters:
[in]schemeThe 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.

Parameters:
[in]nameThe name of regarded scheme
Returns:
Whether the named scheme is known

Definition at line 86 of file GUICompleteSchemeStorage.cpp.

References mySettings.

Referenced by GUISettingsHandler::myStartElement(), remove(), GUIViewTraffic::setColorScheme(), and setDefault().

GUIVisualizationSettings & GUICompleteSchemeStorage::get ( const std::string &  name)

Returns the named scheme.

Parameters:
[in]nameThe name of the visualization scheme to return
Returns:
The named visualization scheme

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.

Returns:
The default visualization 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.

Returns:
The names of known schemes

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
void GUICompleteSchemeStorage::remove ( const std::string &  name)

Removes the setting with the given name.

Parameters:
[in]nameThe 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.

Parameters:
[in]xThe x-offset
[in]yThe y-offset
[in]zoomThe zoom

Definition at line 217 of file GUICompleteSchemeStorage.cpp.

References myX, myY, and myZoom.

Referenced by GUIApplicationWindow::load(), and GUISUMOAbstractView::~GUISUMOAbstractView().

void GUICompleteSchemeStorage::setDefault ( const std::string &  name)

Makes the scheme with the given name the default.

Parameters:
[in]nameThe 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.

Parameters:
[in]parentthe view for which the viewport has to be set

Definition at line 225 of file GUICompleteSchemeStorage.cpp.

References myX, myY, myZoom, GUISUMOAbstractView::recenterView(), and GUISUMOAbstractView::setViewport().

Referenced by GUISUMOAbstractView::GUISUMOAbstractView().

void GUICompleteSchemeStorage::writeSettings ( FXApp *  app)

Field Documentation

std::string GUICompleteSchemeStorage::myDefaultSettingName
protected

Name of the default setting.

Definition at line 142 of file GUICompleteSchemeStorage.h.

Referenced by getDefault(), init(), and setDefault().

unsigned int GUICompleteSchemeStorage::myNumInitialSettings
protected

The number of settings which were present at startup.

Definition at line 145 of file GUICompleteSchemeStorage.h.

Referenced by getNumInitialSettings(), init(), and writeSettings().

std::map<std::string, GUIVisualizationSettings> GUICompleteSchemeStorage::mySettings
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().

std::vector<std::string> GUICompleteSchemeStorage::mySortedSchemeNames
protected

List of known setting names.

Definition at line 139 of file GUICompleteSchemeStorage.h.

Referenced by add(), getNames(), init(), and remove().

SUMOReal GUICompleteSchemeStorage::myX
protected

The default viewport.

Definition at line 148 of file GUICompleteSchemeStorage.h.

Referenced by init(), saveViewport(), and setViewport().

SUMOReal GUICompleteSchemeStorage::myY
protected

Definition at line 148 of file GUICompleteSchemeStorage.h.

Referenced by init(), saveViewport(), and setViewport().

SUMOReal GUICompleteSchemeStorage::myZoom
protected

Definition at line 148 of file GUICompleteSchemeStorage.h.

Referenced by init(), saveViewport(), and setViewport().


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