Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
16 // Storage for available visualization settings
17 /****************************************************************************/
18 #ifndef GUICompleteSchemeStorage_h
19 #define GUICompleteSchemeStorage_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <vector>
29 #include <algorithm>
30 #include <map>
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
42 public:
45 
46 
49 
50 
54  void add(const GUIVisualizationSettings& scheme);
55 
56 
61  GUIVisualizationSettings& get(const std::string& name);
62 
63 
68 
69 
74  bool contains(const std::string& name) const;
75 
76 
80  void remove(const std::string& name);
81 
82 
86  void setDefault(const std::string& name);
87 
88 
92  const std::vector<std::string>& getNames() const;
93 
94 
98  int getNumInitialSettings() const;
99 
100 
104  void init(FXApp* app, bool netedit = false);
105 
106 
110  void writeSettings(FXApp* app);
111 
112 
118  void saveViewport(const double x, const double y, const double z, const double rot);
119 
120 
124  void setViewport(GUISUMOAbstractView* view);
125 
126 
127 protected:
129  std::map<std::string, GUIVisualizationSettings> mySettings;
130 
132  std::vector<std::string> mySortedSchemeNames;
133 
135  std::string myDefaultSettingName;
136 
139 
142  double myRotation;
143 
144 
145 };
146 
148 
149 
150 #endif
151 
152 /****************************************************************************/
153 
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, const double rot)
Makes the given viewport the default.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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.