SUMO - Simulation of Urban MObility
GUICompleteSchemeStorage.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Storage for available visualization settings
19 /****************************************************************************/
20 #ifndef GUICompleteSchemeStorage_h
21 #define GUICompleteSchemeStorage_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <vector>
35 #include <algorithm>
36 #include <map>
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48 public:
51 
52 
55 
56 
60  void add(const GUIVisualizationSettings& scheme);
61 
62 
67  GUIVisualizationSettings& get(const std::string& name);
68 
69 
74 
75 
80  bool contains(const std::string& name) const;
81 
82 
86  void remove(const std::string& name);
87 
88 
92  void setDefault(const std::string& name);
93 
94 
98  const std::vector<std::string>& getNames() const;
99 
100 
104  int getNumInitialSettings() const;
105 
106 
110  void init(FXApp* app, bool netedit = false);
111 
112 
116  void writeSettings(FXApp* app);
117 
118 
124  void saveViewport(const double x, const double y, const double z);
125 
126 
130  void setViewport(GUISUMOAbstractView* view);
131 
132 
133 protected:
135  std::map<std::string, GUIVisualizationSettings> mySettings;
136 
138  std::vector<std::string> mySortedSchemeNames;
139 
141  std::string myDefaultSettingName;
142 
145 
148 
149 
150 };
151 
153 
154 
155 #endif
156 
157 /****************************************************************************/
158 
void init(FXApp *app, bool netedit=false)
Initialises the storage with some default settings.
int myNumInitialSettings
The number of settings which were present at startup.
void setDefault(const std::string &name)
Makes the scheme with the given name the default.
Position myLookFrom
The default viewport.
GUICompleteSchemeStorage gSchemeStorage
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
Stores the information about how to visualize structures.
void saveViewport(const double x, const double y, const double z)
Makes the given viewport the default.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
std::map< std::string, GUIVisualizationSettings > mySettings
A map of settings referenced by their names.
int getNumInitialSettings() const
Returns the number of initial settings.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
Storage for available visualization settings.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
std::vector< std::string > mySortedSchemeNames
List of known setting names.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
std::string myDefaultSettingName
Name of the default setting.