Eclipse SUMO - Simulation of Urban MObility
GUIVisualizationSettings.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 /****************************************************************************/
17 // Stores the information about how to visualize structures
18 /****************************************************************************/
19 #ifndef GUIVisualizationSettings_h
20 #define GUIVisualizationSettings_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 #include <string>
29 #include <vector>
30 #include <map>
31 #include <utils/common/RGBColor.h>
32 #include <utils/common/ToString.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class BaseSchemeInfoSource;
40 class OutputDevice;
42 class GUIGlObject;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
48 
49 // cannot declare this as inner class because it needs to be used in forward
50 // declaration (@todo fix inclusion order by removing references to guisim!)
52 
54  GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor = RGBColor(128, 0, 0, 0), bool _constSize = true);
55 
57  bool operator==(const GUIVisualizationTextSettings& other);
58 
60  bool operator!=(const GUIVisualizationTextSettings& other);
61 
63  void print(OutputDevice& dev, const std::string& name) const;
64 
66  double scaledSize(double scale, double constFactor = 0.1) const;
67 
69  bool show;
70 
72  double size;
73 
76 
79 
81  bool constSize;
82 };
83 
84 
87 
89  GUIVisualizationSizeSettings(double _minSize, double _exaggeration = 1.0, bool _constantSize = false, bool _constantSizeSelected = false);
90 
92  double getExaggeration(const GUIVisualizationSettings& s, const GUIGlObject* o, double factor = 20) const;
93 
95  bool operator==(const GUIVisualizationSizeSettings& other);
96 
98  bool operator!=(const GUIVisualizationSizeSettings& other);
99 
101  void print(OutputDevice& dev, const std::string& name) const;
102 
104  double minSize;
105 
107  double exaggeration;
108 
111 
114 };
115 
116 
119 
122 
124  bool operator==(const GUIVisualizationColorSettings& other);
125 
127  bool operator!=(const GUIVisualizationColorSettings& other);
128 
131 
134 
137 
140 
143 
146 
149 
152 
155 
158 
161 
164 
166  static const RGBColor crossing;
167 
170 
172  static const RGBColor crossingInvalid;
173 
175  static const RGBColor busStop;
176 
178  static const RGBColor busStop_sign;
179 
181  static const RGBColor containerStop;
182 
185 
187  static const RGBColor chargingStation;
188 
191 
194 
196  static const RGBColor parkingArea;
197 
199  static const RGBColor parkingAreaSign;
200 
202  static const RGBColor parkingSpace;
203 
206 
208  static const RGBColor E1;
209 
211  static const RGBColor E1Instant;
212 
214  static const RGBColor E2;
215 
217  static const RGBColor E3Entry;
218 
220  static const RGBColor E3Exit;
221 
223  static const RGBColor calibrator;
224 
226  static const RGBColor routeProbe;
227 
229  static const RGBColor vaporizer;
230 
232  static const RGBColor stops;
233 
235  static const RGBColor vehicleTrips;
236 
238  static const RGBColor personStops;
239 
241  static const RGBColor personTrip;
242 
244  static const RGBColor walk;
245 
247  static const RGBColor ride;
248 };
249 
250 
253 
255  static const float dottedContour;
256 
258  static const double dottedContourSegmentLenght;
259 
261  static const double route;
262 
264  static const double trip;
265 
267  static const double personTrip;
268 
270  static const double walk;
271 
273  static const double ride;
274 };
275 
276 
279 
281  static const double connectionsDemandMode;
282 
284  static const double laneTextures;
285 
287  static const double lockIcon;
288 
290  static const double additionalTextures;
291 
293  static const double geometryPointsDetails;
294 
296  static const double geometryPointsText;
297 
299  static const double stoppingPlaceDetails;
300 
302  static const double stoppingPlaceText;
303 
305  static const double detectorDetails;
306 
308  static const double detectorText;
309 
311  static const double calibratorText;
312 
314  static const double stopsDetails;
315 
317  static const double stopsText;
318 
320  static const double vehicleTriangles;
321 
323  static const double vehicleBoxes;
324 
326  static const double vehicleShapes;
327 
329  static const double personTriangles;
330 
332  static const double personCircles;
333 
335  static const double personShapes;
336 
338  static const double personExaggeration;
339 };
340 
341 
347 
348 public:
350  GUIVisualizationSettings(bool _netedit = false);
351 
353  void initNeteditDefaults();
354  void initSumoGuiDefaults();
355 
359  void save(OutputDevice& dev) const;
360 
364  int getLaneEdgeMode() const;
365 
369  int getLaneEdgeScaleMode() const;
370 
374  GUIColorScheme& getLaneEdgeScheme();
375 
379  GUIScaleScheme& getLaneEdgeScaleScheme();
380 
382  bool operator==(const GUIVisualizationSettings& vs2);
383 
385  static const RGBColor& getLinkColor(const LinkState& ls);
386 
388  double getTextAngle(double objectAngle) const;
389 
391  bool drawDetail(const double detail, const double exaggeration) const;
392 
394  int getCircleResolution() const;
395 
397  std::string name;
398 
400  bool netedit;
401 
403  double angle;
404 
406  bool dither;
407 
409  bool fps;
410 
413 
416 
418  bool showGrid;
419 
421  double gridXSize, gridYSize;
423 
424 
427 
430 
433 
435  static bool UseMesoSim;
436 
439 
442 
445 
448 
451 
454 
456  bool showRails;
457 
458  // Setting bundles for optional drawing names with size and color
459  GUIVisualizationTextSettings edgeName, internalEdgeName, cwaEdgeName, streetName, edgeValue;
460 
463 
466 
468  double laneMinSize;
469 
472 
475 
478 
480  std::string edgeParam, laneParam;
481 
483  std::string edgeData;
485 
488 
491 
494 
497 
500 
503 
506 
509 
510  // Setting bundles for controling the size of the drawn vehicles
512 
513  // Setting bundles for optional drawing vehicle names or color value
515 
517 
518 
521 
524 
527 
528  // Setting bundles for controling the size of the drawn persons
530 
531  // Setting bundles for optional drawing person names
534 
535 
538 
541 
544 
545  // Setting bundles for controling the size of the drawn containers
547 
548  // Setting bundles for optional drawing container names
551 
552 
555 
558 
559  // Setting bundles for optional drawing junction names and indices
560  GUIVisualizationTextSettings drawLinkTLIndex, drawLinkJunctionIndex, junctionName, internalJunctionName, tlsPhaseIndex;
561 
568  // Setting bundles for controling the size of the drawn junction
571 
572 
575 
577  // @todo decouple addExageration for POIs, Polygons, Triggers etc
578  int addMode;
579  // Setting bundles for controling the size of additional items
581  // Setting bundles for optional drawing additional names
583  // Setting bundles for optional drawing additional full names
586 
587 
590 
593 
594  // Setting bundles for controling the size of the drawn POIs
596 
597  // Setting bundles for optional drawing poi names
599 
600  // Setting bundles for optional drawing poi types
602 
605 
606  // Setting bundles for controling the size of the drawn polygons
608 
609  // Setting bundles for optional drawing polygon names
611 
612  // Setting bundles for optional drawing polygon types
615 
618 
621 
623  double scale;
624 
626  bool gaming;
627 
630 
633 
636 
639 
641  static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL;
642  static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL;
643  static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL;
644  static const std::string SCHEME_NAME_SELECTION;
645  static const std::string SCHEME_NAME_TYPE;
646  static const std::string SCHEME_NAME_PERMISSION_CODE;
647 
650 
653 
656 };
657 
658 
659 #endif
660 
661 /****************************************************************************/
662 
GUIVisualizationSizeSettings junctionSize
static const double personCircles
details for draw person as circles
bool drawBrakeGap
Information whether the brake gap shall be drawn.
static const RGBColor walk
color for walks
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
static const std::string SCHEME_NAME_TYPE
static const RGBColor crossing
color for crossings
bool showSizeLegend
Information whether the size legend shall be drawn.
static const RGBColor childConnections
color for child connections between parents and child elements
double scale
information about a lane&#39;s width (temporary, used for a single view)
static const RGBColor personStops
color for personStops
GUIVisualizationTextSettings poiType
GUIVisualizationTextSettings streetName
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
static const double personShapes
details for draw person as person shapes
bool showBlinker
Information whether vehicle blinkers shall be drawn.
static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL
GUIVisualizationTextSettings addName
GUIVisualizationTextSettings personValue
RGBColor selectedVehicleColor
vehicle selection color
static const double personExaggeration
Exaggeration for persons (only used in NETEDIT)
GUIVisualizationTextSettings poiName
RGBColor selectedLaneColor
lane selection color
bool gaming
whether the application is in gaming mode or not
bool operator!=(const GUIVisualizationTextSettings &other)
inequality comparator
bool showBTRange
Information whether the communication range shall be drawn.
double exaggeration
The size exaggeration (upscale)
bool operator==(const GUIVisualizationTextSettings &other)
equality comparator
GUIColorer laneColorer
The lane colorer.
GUIColorer containerColorer
The container colorer.
Stores the information about how to visualize structures.
static const RGBColor chargingStation
color for chargingStations
static const RGBColor containerStop_sign
color for containerStop signs
RGBColor bgColor
background text color
GUIColorer edgeColorer
The mesoscopic edge colorer.
static const double stoppingPlaceText
details for stopping place texts
bool drawLaneChangePreference
Information whether the lane change preference shall be drawn.
bool showRails
Information whether rails shall be drawn.
static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL
scheme names
bool constantSizeSelected
whether only selected objects shall be drawn with constant
static const RGBColor E1Instant
color for E1 Instant detectors
bool showLaneDirection
Whether to show direction indicators for lanes.
bool laneShowBorders
Information whether lane borders shall be drawn.
static const double ride
width for rides
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL
bool netedit
Whether the settings are for Netedit.
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
static const double stopsDetails
details for stops
bool dither
Information whether dithering shall be enabled.
static const RGBColor routeProbe
color for route probes
static const double vehicleShapes
details for draw person as shapes
static const RGBColor vaporizer
color for vaporizers
GUIVisualizationSizeSettings polySize
GUIColorer vehicleColorer
The vehicle colorer.
static const double personTrip
width for person trips
GUIVisualizationSizeSettings addSize
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
GUIColorer poiColorer
The POI colorer.
GUIVisualizationTextSettings vehicleValue
static const double additionalTextures
details for additional textures
RGBColor selectedConnectionColor
connection selection color
GUIVisualizationWidthSettings widthSettings
width settings
static const RGBColor containerStop
color for containerStops
std::string name
The name of this setting.
static const double connectionsDemandMode
draw connections in demand mode
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
static const RGBColor E3Exit
color for Exits
double minSize
The minimum size to draw this object.
static const RGBColor crossingPriority
color for priority crossing
bool constSize
flag to avoid size changes
RGBColor selectionColor
basic selection color
RGBColor selectedProhibitionColor
prohibition selection color
double scaledSize(double scale, double constFactor=0.1) const
get scale size
bool drawMinGap
Information whether the minimum gap shall be drawn.
static const double route
width for routes
int addMode
The additional structures visualization scheme.
GUIVisualizationTextSettings polyType
bool showSublanes
Whether to show sublane boundaries.
GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor=RGBColor(128, 0, 0, 0), bool _constSize=true)
constructor
static const std::string SCHEME_NAME_PERMISSION_CODE
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
static const double laneTextures
details for lane textures
GUIColorer polyColorer
The polygon colorer.
static const double detectorDetails
details for detectors
GUIColorer personColorer
The person colorer.
bool showColorLegend
Information whether the colo legend shall be drawn.
bool fps
Information whether frames-per-second should be drawn.
GUIColorer junctionColorer
The junction colorer.
static const double personTriangles
details for draw person as triangles
double angle
The current view rotation angle.
double laneMinSize
The minimum visual lane width for drawing.
GUIScaler edgeScaler
The mesoscopic edge scaler.
static const double vehicleBoxes
details for draw person as boxes
static const RGBColor ride
color for rides
static const double geometryPointsDetails
details for Geometry Points
int containerQuality
The quality of container drawing.
RGBColor backgroundColor
The background color to use.
static const RGBColor stops
color for Stops
static const RGBColor parkingAreaSign
color for parkingArea sign
static const RGBColor E1
color for E1 detectors
GUIVisualizationDetailSettings detailSettings
detail settings
static const double vehicleTriangles
details for draw person as triangles
void print(OutputDevice &dev, const std::string &name) const
print values in output device
static const double walk
width for walks
static const RGBColor vehicleTrips
color for vehicle trips
GUIVisualizationSizeSettings poiSize
static const RGBColor E3Entry
color for Entrys
RGBColor selectedCrossingColor
crossings selection color
RGBColor selectedPersonColor
person selection color
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
double selectionScale
the current selection scaling in NETEDIT (temporary)
static const RGBColor personTrip
color for personStops
static const RGBColor parkingSpace
color for parkingArea sign
GUIVisualizationSizeSettings containerSize
static const double stopsText
details for stop texts
std::string edgeData
key for coloring by edgeData
GUIVisualizationTextSettings addFullName
static const RGBColor parkingArea
color for parkingAreas
static const double detectorText
details for detector texts
GUIVisualizationTextSettings tlsPhaseIndex
static const RGBColor crossingInvalid
color for invalid crossing
static const double lockIcon
lock icons
static const RGBColor calibrator
color for Calibrators
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
bool showGrid
Information whether a grid shall be shown.
static const RGBColor chargingStation_sign
color for chargingStation sign
static const float dottedContour
width of dotted contours (note: must be float)
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
static const double stoppingPlaceDetails
details for stopping places
static const double calibratorText
details for calibrator text
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
int vehicleQuality
The quality of vehicle drawing.
RGBColor selectedEdgeColor
edge selection color
static bool UseMesoSim
this should be set at the same time as MSGlobals::gUseMesoSim
static const RGBColor busStop
color for busStops
static const std::string SCHEME_NAME_SELECTION
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
bool forceDrawForSelecting
flag to force draw to selecting (see drawForSelecting)
static const double geometryPointsText
details for Geometry Points Texts
GUIScaler laneScaler
The lane scaler.
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
bool drawBoundaries
enable or disable draw boundaries
static const RGBColor parkingSpaceInnen
color for parkingArea innen
static const RGBColor E2
color for E2 detectors
static const RGBColor chargingStation_charge
color for chargingStation during charging
static const RGBColor busStop_sign
color for busStops signs
bool hideConnectors
flag to show or hidde connectors
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
static const double trip
width for trips
static const double dottedContourSegmentLenght
lenght of dotted contour segments
GUIVisualizationTextSettings polyName
GUIVisualizationTextSettings containerName