SUMO - Simulation of Urban MObility
GUICompleteSchemeStorage.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Storage for available visualization settings
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GUICompleteSchemeStorage_h
22 #define GUICompleteSchemeStorage_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <string>
35 #include <vector>
36 #include <algorithm>
37 #include <map>
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
52 
53 
56 
57 
61  void add(const GUIVisualizationSettings& scheme);
62 
63 
68  GUIVisualizationSettings& get(const std::string& name);
69 
70 
75 
76 
81  bool contains(const std::string& name) const;
82 
83 
87  void remove(const std::string& name);
88 
89 
93  void setDefault(const std::string& name);
94 
95 
99  const std::vector<std::string>& getNames() const;
100 
101 
105  unsigned int getNumInitialSettings() const;
106 
107 
111  void init(FXApp* app);
112 
113 
117  void writeSettings(FXApp* app);
118 
119 
125  void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom);
126 
127 
131  void setViewport(GUISUMOAbstractView* view);
132 
133 
134 protected:
136  std::map<std::string, GUIVisualizationSettings> mySettings;
137 
139  std::vector<std::string> mySortedSchemeNames;
140 
142  std::string myDefaultSettingName;
143 
145  unsigned int myNumInitialSettings;
146 
149 
150 
151 };
152 
154 
155 
156 #endif
157 
158 /****************************************************************************/
159 
void setDefault(const std::string &name)
Makes the scheme with the given name the default.
Position myLookFrom
The default viewport.
GUICompleteSchemeStorage gSchemeStorage
unsigned int myNumInitialSettings
The number of settings which were present at startup.
Stores the information about how to visualize structures.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
unsigned int getNumInitialSettings() const
Returns the number of initial settings.
std::map< std::string, GUIVisualizationSettings > mySettings
A map of settings referenced by their names.
void saveViewport(const SUMOReal x, const SUMOReal y, const SUMOReal zoom)
Makes the given viewport the default.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
Storage for available visualization settings.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
std::vector< std::string > mySortedSchemeNames
List of known setting names.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
#define SUMOReal
Definition: config.h:214
void init(FXApp *app)
Initialises the storage with some default settings.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
std::string myDefaultSettingName
Name of the default setting.