SUMO - Simulation of Urban MObility
GUICompleteSchemeStorage Class Reference

Storage for available visualization settings. More...

#include <GUICompleteSchemeStorage.h>

Collaboration diagram for GUICompleteSchemeStorage:
Collaboration graph

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...
 
int getNumInitialSettings () const
 Returns the number of initial settings. More...
 
 GUICompleteSchemeStorage ()
 Constructor. More...
 
void init (FXApp *app, bool netedit=false)
 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 double x, const double y, const double 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, GUIVisualizationSettingsmySettings
 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 47 of file GUICompleteSchemeStorage.h.

Constructor & Destructor Documentation

◆ GUICompleteSchemeStorage()

GUICompleteSchemeStorage::GUICompleteSchemeStorage ( )

Constructor.

Definition at line 51 of file GUICompleteSchemeStorage.cpp.

◆ ~GUICompleteSchemeStorage()

GUICompleteSchemeStorage::~GUICompleteSchemeStorage ( )

Destructor.

Definition at line 54 of file GUICompleteSchemeStorage.cpp.

Member Function Documentation

◆ add()

void GUICompleteSchemeStorage::add ( const GUIVisualizationSettings scheme)

Adds a visualization scheme.

Parameters
[in]schemeThe visualization scheme to add

Definition at line 59 of file GUICompleteSchemeStorage.cpp.

References mySettings, mySortedSchemeNames, and GUIVisualizationSettings::name.

Referenced by GUISettingsHandler::addSettings(), init(), GUIDialog_ViewSettings::onCmdColorChange(), and GUIDialog_ViewSettings::onCmdSaveSetting().

◆ contains()

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

References mySettings.

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

◆ get()

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

◆ getDefault()

GUIVisualizationSettings & GUICompleteSchemeStorage::getDefault ( )

◆ getNames()

const std::vector< std::string > & GUICompleteSchemeStorage::getNames ( ) const

Returns a list of stored settings names.

Returns
The names of known schemes

Definition at line 106 of file GUICompleteSchemeStorage.cpp.

References mySortedSchemeNames.

Referenced by GUIViewTraffic::buildViewToolBars(), GNEViewNet::buildViewToolBars(), GUIDialog_ViewSettings::GUIDialog_ViewSettings(), and writeSettings().

◆ getNumInitialSettings()

int GUICompleteSchemeStorage::getNumInitialSettings ( ) const

◆ init()

◆ remove()

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

References contains(), mySettings, and mySortedSchemeNames.

Referenced by GUIDialog_ViewSettings::onCmdDeleteSetting(), and GUIDialog_ViewSettings::onCmdSaveSetting().

◆ saveViewport()

void GUICompleteSchemeStorage::saveViewport ( const double  x,
const double  y,
const double  z 
)

Makes the given viewport the default.

Parameters
[in]xThe x-offset
[in]yThe y-offset
[in]zThe camera height

Definition at line 207 of file GUICompleteSchemeStorage.cpp.

References myLookFrom, and Position::set().

Referenced by GUIApplicationWindow::loadConfigOrNet(), GNEApplicationWindow::loadConfigOrNet(), and GUISUMOAbstractView::~GUISUMOAbstractView().

◆ setDefault()

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

References contains(), and myDefaultSettingName.

Referenced by GUISUMOAbstractView::~GUISUMOAbstractView().

◆ setViewport()

void GUICompleteSchemeStorage::setViewport ( GUISUMOAbstractView view)

Sets the default viewport.

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

Definition at line 213 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().

◆ writeSettings()

void GUICompleteSchemeStorage::writeSettings ( FXApp *  app)

Field Documentation

◆ myDefaultSettingName

std::string GUICompleteSchemeStorage::myDefaultSettingName
protected

Name of the default setting.

Definition at line 141 of file GUICompleteSchemeStorage.h.

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

◆ myLookAt

Position GUICompleteSchemeStorage::myLookAt
protected

Definition at line 147 of file GUICompleteSchemeStorage.h.

◆ myLookFrom

Position GUICompleteSchemeStorage::myLookFrom
protected

The default viewport.

Definition at line 147 of file GUICompleteSchemeStorage.h.

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

◆ myNumInitialSettings

int GUICompleteSchemeStorage::myNumInitialSettings
protected

The number of settings which were present at startup.

Definition at line 144 of file GUICompleteSchemeStorage.h.

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

◆ mySettings

std::map<std::string, GUIVisualizationSettings> GUICompleteSchemeStorage::mySettings
protected

A map of settings referenced by their names.

Definition at line 135 of file GUICompleteSchemeStorage.h.

Referenced by add(), contains(), get(), getDefault(), remove(), and writeSettings().

◆ mySortedSchemeNames

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

List of known setting names.

Definition at line 138 of file GUICompleteSchemeStorage.h.

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


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