Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUICompleteSchemeStorage Class Reference

Storage for available visualization settings. More...

#include <GUICompleteSchemeStorage.h>

Collaboration diagram for GUICompleteSchemeStorage:
[legend]

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.
 
GUIVisualizationSettingsget (const std::string &name)
 Returns the named scheme.
 
const std::vector< GUISUMOAbstractView::Decal > & getDecals ()
 Returns the default decals.
 
GUIVisualizationSettingsgetDefault ()
 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::DecalmyDecals
 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.
 

Detailed Description

Storage for available visualization settings.

Definition at line 38 of file GUICompleteSchemeStorage.h.

Constructor & Destructor Documentation

◆ GUICompleteSchemeStorage()

GUICompleteSchemeStorage::GUICompleteSchemeStorage ( )

Constructor.

Definition at line 43 of file GUICompleteSchemeStorage.cpp.

◆ ~GUICompleteSchemeStorage()

GUICompleteSchemeStorage::~GUICompleteSchemeStorage ( )

Destructor.

Definition at line 46 of file GUICompleteSchemeStorage.cpp.

References mySettings.

Member Function Documentation

◆ add()

void GUICompleteSchemeStorage::add ( const GUIVisualizationSettings scheme)

Adds a visualization scheme.

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

Here is the caller graph for this function:

◆ clearDecals()

void GUICompleteSchemeStorage::clearDecals ( )
inline

Clear the default decals.

Definition at line 134 of file GUICompleteSchemeStorage.h.

References myDecals.

Referenced by GUIApplicationWindow::handleEvent_SimulationLoaded().

Here is the caller graph for this function:

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

References mySettings.

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

Here is the caller graph for this function:

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

Here is the caller graph for this function:

◆ getDecals()

const std::vector< GUISUMOAbstractView::Decal > & GUICompleteSchemeStorage::getDecals ( )
inline

Returns the default decals.

Definition at line 128 of file GUICompleteSchemeStorage.h.

References myDecals.

Referenced by GUISUMOAbstractView::GUISUMOAbstractView().

Here is the caller graph for this function:

◆ getDefault()

GUIVisualizationSettings & GUICompleteSchemeStorage::getDefault ( )

Returns the default scheme.

Returns
The default visualization scheme

Definition at line 73 of file GUICompleteSchemeStorage.cpp.

References myDefaultSettingName, and mySettings.

Referenced by GUISUMOAbstractView::GUISUMOAbstractView(), GUIDanielPerspectiveChanger::onKeyPress(), and GUIDanielPerspectiveChanger::onMouseMove().

Here is the caller graph for this function:

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

References mySortedSchemeNames.

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

Here is the caller graph for this function:

◆ getNumInitialSettings()

int GUICompleteSchemeStorage::getNumInitialSettings ( ) const

Returns the number of initial settings.

Returns
The number of default schemes

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

Here is the caller graph for this function:

◆ init()

void GUICompleteSchemeStorage::init ( FXApp *  app,
bool  netedit = false 
)

Initialises the storage with some default settings.

Parameters
[in]appThe 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().

Here is the caller graph for this function:

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

References contains(), mySettings, and mySortedSchemeNames.

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

Here is the caller graph for this function:

◆ saveDecals()

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

Here is the caller graph for this function:

◆ saveViewport()

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

Makes the given viewport the default.

Parameters
[in]xThe x-offset
[in]yThe y-offset
[in]zThe 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().

Here is the caller graph for this function:

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

References contains(), and myDefaultSettingName.

Referenced by GUISUMOAbstractView::~GUISUMOAbstractView().

Here is the caller graph for this function:

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

References myLookFrom, myRotation, GUISUMOAbstractView::recenterView(), GUISUMOAbstractView::setViewportFromToRot(), Position::x(), Position::y(), and Position::z().

Referenced by GUISUMOAbstractView::GUISUMOAbstractView().

Here is the caller graph for this function:

◆ writeSettings()

void GUICompleteSchemeStorage::writeSettings ( FXApp *  app)

Writes the current scheme into the registry.

Parameters
[in]appThe 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().

Here is the caller graph for this function:

Field Documentation

◆ myDecals

std::vector<GUISUMOAbstractView::Decal> GUICompleteSchemeStorage::myDecals
protected

The default decals.

Definition at line 156 of file GUICompleteSchemeStorage.h.

Referenced by clearDecals(), getDecals(), and saveDecals().

◆ myDefaultSettingName

std::string GUICompleteSchemeStorage::myDefaultSettingName
protected

Name of the default setting.

Definition at line 146 of file GUICompleteSchemeStorage.h.

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

◆ myLookAt

Position GUICompleteSchemeStorage::myLookAt
protected

Definition at line 152 of file GUICompleteSchemeStorage.h.

◆ myLookFrom

Position GUICompleteSchemeStorage::myLookFrom
protected

The default viewport.

Definition at line 152 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 149 of file GUICompleteSchemeStorage.h.

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

◆ myRotation

double GUICompleteSchemeStorage::myRotation
protected

Definition at line 153 of file GUICompleteSchemeStorage.h.

Referenced by saveViewport(), and setViewport().

◆ mySettings

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

◆ mySortedSchemeNames

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

List of known setting names.

Definition at line 143 of file GUICompleteSchemeStorage.h.

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


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