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. More...
 
bool contains (const std::string &name) const
 Returns the information whether a setting with the given name is stored. More...
 
GUIVisualizationSettingsget (const std::string &name)
 Returns the named scheme. More...
 
GUIVisualizationSettingsgetDefault ()
 Returns the default scheme. More...
 
const std::vector< std::string > & getNames () const
 Returns a list of stored settings names. More...
 
unsigned 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 zoom)
 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...
 
unsigned 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...
 

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(), GUIDialog_ViewSettings::onCmdColorChange(), 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 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.

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 214 of file GUICompleteSchemeStorage.cpp.

References myLookAt, myLookFrom, GUISUMOAbstractView::recenterView(), GUISUMOAbstractView::setViewport(), and Position::z().

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().

Position GUICompleteSchemeStorage::myLookAt
protected

Definition at line 148 of file GUICompleteSchemeStorage.h.

Referenced by setViewport().

Position GUICompleteSchemeStorage::myLookFrom
protected

The default viewport.

Definition at line 148 of file GUICompleteSchemeStorage.h.

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

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().


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