SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIVisualizationSettings.h
Go to the documentation of this file.
1 /****************************************************************************/
9 // Stores the information about how to visualize structures
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 #ifndef GUIVisualizationSettings_h
23 #define GUIVisualizationSettings_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
35 #include <string>
36 #include <vector>
37 #include <map>
38 #include <utils/common/RGBColor.h>
39 #include <utils/common/ToString.h>
40 #include "GUIColorer.h"
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
46 class BaseSchemeInfoSource;
47 class OutputDevice;
49 
50 
51 // ===========================================================================
52 // class definitions
53 // ===========================================================================
54 
55 // cannot declare this as inner class because it needs to be used in forward
56 // declaration (@todo fix inclusion order by removing references to guisim!)
58  GUIVisualizationTextSettings(bool _show, float _size, RGBColor _color) :
59  show(_show), size(_size), color(_color) {}
60 
61  bool show;
62  float size;
64 
66  return show == other.show &&
67  size == other.size &&
68  color == other.color;
69  }
71  return !((*this) == other);
72  }
73 
74  std::string print(const std::string& name) const {
75  return name + "_show=\"" + toString(show) + "\" " +
76  name + "_size=\"" + toString(size) + "\" " +
77  name + "_color=\"" + toString(color) + "\" ";
78  }
79 };
80 
81 
83  GUIVisualizationSizeSettings(float _minSize, float _exaggeration = 1.0, bool _constantSize = false) :
84  minSize(_minSize), exaggeration(_exaggeration), constantSize(_constantSize) {}
85 
87  float minSize;
89  float exaggeration;
90  // @brief whether the object shall be drawn with constant size regardless of zoom
92 
94  return constantSize == other.constantSize &&
95  minSize == other.minSize &&
96  exaggeration == other.exaggeration;
97  }
99  return !((*this) == other);
100  }
101 
102  std::string print(const std::string& name) const {
103  return name + "_minSize=\"" + toString(minSize) + "\" " +
104  name + "_exaggeration=\"" + toString(exaggeration) + "\" " +
105  name + "_constantSize=\"" + toString(constantSize) + "\" ";
106  }
107 
110 };
111 
112 
118 public:
119 
122 
124  std::string name;
125 
129  bool dither;
130 
132 
133 
137  bool showGrid;
141 
142 
144 
145 
146 #ifdef HAVE_INTERNAL
147  GUIColorer edgeColorer;
150  GUIScaler edgeScaler;
151 
153  static bool UseMesoSim;
154 #endif
164  bool showRails;
165  // Setting bundles for optional drawing names with size and color
167 
172 
173 
175 
176 
189  // Setting bundles for controling the size of the drawn vehicles
191  // Setting bundles for optional drawing vehicle names
194 
195 
197 
198 
203  // Setting bundles for controling the size of the drawn persons
205  // Setting bundles for optional drawing person names
208 
209 
211 
212 
219  // Setting bundles for optional drawing junction names
226 
227 
229 
230 
232  // @todo decouple addExageration for POIs, Polygons, Triggers etc
233  int addMode;
234  // Setting bundles for controling the size of additional items
236  // Setting bundles for optional drawing additional names
239 
240 
242 
243 
244  // Setting bundles for controling the size of the drawn POIs
246  // Setting bundles for optional drawing poi names
248 
249  // Setting bundles for controling the size of the drawn polygons
251  // Setting bundles for optional drawing polygon names
254 
257 
260 
262  bool gaming;
263 
265  int editMode;
266 
269 
272 
276  void save(OutputDevice& dev) const;
277 
281  size_t getLaneEdgeMode() const;
282 
286  size_t getLaneEdgeScaleMode() const;
287 
292 
297 
299  bool operator==(const GUIVisualizationSettings& vs2);
300 };
301 
302 
303 #endif
304 
305 /****************************************************************************/
306 
GUIVisualizationTextSettings junctionName
bool showSizeLegend
Information whether the size legend shall be drawn.
GUIVisualizationTextSettings streetName
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
size_t getLaneEdgeMode() const
Returns the number of the active lane (edge) coloring schme.
bool showBlinker
Information whether vehicle blinkers shall be drawn.
GUIVisualizationTextSettings addName
std::string print(const std::string &name) const
GUIVisualizationTextSettings personName
bool drawLinkTLIndex
Information whether a link&#39;s tls index shall be drawn.
GUIVisualizationTextSettings poiName
GUIColorScheme & getLaneEdgeScheme()
Returns the current lane (edge) coloring schme.
bool gaming
whether the application is in gaming mode or not
bool operator!=(const GUIVisualizationTextSettings &other)
GUIVisualizationTextSettings(bool _show, float _size, RGBColor _color)
bool showBTRange
Information whether the communication range shall be drawn.
bool operator==(const GUIVisualizationTextSettings &other)
GUIColorer laneColorer
The lane colorer.
bool operator==(const GUIVisualizationSizeSettings &other)
Stores the information about how to visualize structures.
bool drawLaneChangePreference
Information whether the lane change preference shall be drawn.
bool showRails
Information whether rails shall be drawn.
GUIVisualizationTextSettings vehicleName
bool operator==(const GUIVisualizationSettings &vs2)
Comparison operator.
int editMode
the current NETEDIT mode (temporary)
GUIVisualizationTextSettings cwaEdgeName
bool laneShowBorders
Information whether lane borders shall be drawn.
GUIVisualizationSizeSettings(float _minSize, float _exaggeration=1.0, bool _constantSize=false)
bool dither
Information whether dithering shall be enabled.
SUMOReal scale
information about a lane&#39;s width (temporary, used for a single view)
GUIVisualizationSizeSettings polySize
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings edgeName
GUIVisualizationSizeSettings addSize
SUMOReal selectionScale
the current selection scaling in NETEDIT (temporary)
std::string name
The name of this setting.
GUIVisualizationTextSettings internalEdgeName
bool drawMinGap
Information whether the minimum gap shall be drawn.
int addMode
The additional structures visualization scheme.
std::string print(const std::string &name) const
GUIColorer personColorer
The person colorer.
GUIVisualizationTextSettings internalJunctionName
float minSize
The minimum size to draw this object.
GUIColorer junctionColorer
The junction colorer.
SUMOReal gridXSize
Information about the grid spacings.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
GUIScaleScheme & getLaneEdgeScaleScheme()
Returns the current lane (edge) scaling schme.
RGBColor backgroundColor
The background color to use.
bool antialiase
Information whether antialiase shall be enabled.
GUIVisualizationSizeSettings poiSize
float exaggeration
The size exaggeration (upscale)
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
bool drawLinkJunctionIndex
Information whether a link&#39;s junction index shall be drawn.
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
bool showGrid
Information whether a grid shall be shown.
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
bool operator!=(const GUIVisualizationSizeSettings &other)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:218
void save(OutputDevice &dev) const
Writes the settings into an output device.
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
int vehicleQuality
The quality of vehicle drawing.
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
GUIScaler laneScaler
The lane scaler.
size_t getLaneEdgeScaleMode() const
Returns the number of the active lane (edge) scaling schme.
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
GUIVisualizationTextSettings polyName