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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
19 // Storage for available visualization settings
20 /****************************************************************************/
21 #pragma once
22 #include <config.h>
23 
24 #include <string>
25 #include <vector>
26 #include <algorithm>
27 #include <map>
29 
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
39 public:
42 
43 
46 
47 
51  void add(const GUIVisualizationSettings& scheme);
52 
53 
58  GUIVisualizationSettings& get(const std::string& name);
59 
60 
65 
66 
71  bool contains(const std::string& name) const;
72 
73 
77  void remove(const std::string& name);
78 
79 
83  void setDefault(const std::string& name);
84 
85 
89  const std::vector<std::string>& getNames() const;
90 
91 
95  int getNumInitialSettings() const;
96 
97 
101  void init(FXApp* app, bool netedit = false);
102 
103 
107  void writeSettings(FXApp* app);
108 
109 
115  void saveViewport(const double x, const double y, const double z, const double rot);
116 
117 
121  void setViewport(GUISUMOAbstractView* view);
122 
123 
124 protected:
126  std::map<std::string, GUIVisualizationSettings> mySettings;
127 
129  std::vector<std::string> mySortedSchemeNames;
130 
132  std::string myDefaultSettingName;
133 
136 
139  double myRotation;
140 
141 
142 };
143 
GUICompleteSchemeStorage gSchemeStorage
Storage for available visualization settings.
bool contains(const std::string &name) const
Returns the information whether a setting with the given name is stored.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
std::map< std::string, GUIVisualizationSettings > mySettings
A map of settings referenced by their names.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
const std::vector< std::string > & getNames() const
Returns a list of stored settings names.
void add(const GUIVisualizationSettings &scheme)
Adds a visualization scheme.
int getNumInitialSettings() const
Returns the number of initial settings.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
std::vector< std::string > mySortedSchemeNames
List of known setting names.
std::string myDefaultSettingName
Name of the default setting.
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.
void remove(const std::string &name)
Removes the setting with the given name.
Position myLookFrom
The default viewport.
void writeSettings(FXApp *app)
Writes the current scheme into the registry.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
Stores the information about how to visualize structures.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36