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.dev/sumo
3 // Copyright (C) 2001-2024 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 
119  void saveDecals(const std::vector<GUISUMOAbstractView::Decal>& decals);
120 
124  void setViewport(GUISUMOAbstractView* view);
125 
128  const std::vector<GUISUMOAbstractView::Decal>& getDecals() {
129  return myDecals;
130  }
131 
134  void clearDecals() {
135  myDecals.clear();
136  }
137 
138 protected:
140  std::map<std::string, GUIVisualizationSettings*> mySettings;
141 
143  std::vector<std::string> mySortedSchemeNames;
144 
146  std::string myDefaultSettingName;
147 
150 
153  double myRotation;
154 
156  std::vector<GUISUMOAbstractView::Decal> myDecals;
157 
158 };
159 
GUICompleteSchemeStorage gSchemeStorage
Storage for available visualization settings.
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.
GUIVisualizationSettings & get(const std::string &name)
Returns the named scheme.
void remove(const std::string name)
Removes the setting with the given name.
std::map< std::string, GUIVisualizationSettings * > mySettings
A map of settings referenced by their names.
GUIVisualizationSettings & getDefault()
Returns the default scheme.
std::vector< GUISUMOAbstractView::Decal > myDecals
The default decals.
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.
const std::vector< GUISUMOAbstractView::Decal > & getDecals()
Returns the default decals.
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 saveDecals(const std::vector< GUISUMOAbstractView::Decal > &decals)
Makes the given decals the default.
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:37