Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2025 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 : /****************************************************************************/
14 : /// @file GUIVisualizationSettings.h
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @date Sept 2002
19 : ///
20 : // Stores the information about how to visualize structures
21 : /****************************************************************************/
22 : #pragma once
23 : #include <config.h>
24 :
25 : #include <string>
26 : #include <vector>
27 : #include <map>
28 : #include <utils/common/RGBColor.h>
29 : #include <utils/common/ToString.h>
30 :
31 : #include "GUIPropertySchemeStorage.h"
32 :
33 :
34 : // ===========================================================================
35 : // class declarations
36 : // ===========================================================================
37 : class BaseSchemeInfoSource;
38 : class OutputDevice;
39 : class GUIVisualizationSettings;
40 : class GUIGlObject;
41 :
42 :
43 : // ===========================================================================
44 : // class definitions
45 : // ===========================================================================
46 :
47 : // cannot declare this as inner class because it needs to be used in forward
48 : // declaration (@todo fix inclusion order by removing references to guisim!)
49 : struct GUIVisualizationTextSettings {
50 :
51 : /// @brief constructor
52 : GUIVisualizationTextSettings(bool _show, double _size, RGBColor _color, RGBColor _bgColor = RGBColor(128, 0, 0, 0), bool _constSize = true, bool _onlySelected = false);
53 :
54 : /// @brief equality comparator
55 : bool operator==(const GUIVisualizationTextSettings& other);
56 :
57 : /// @brief inequality comparator
58 : bool operator!=(const GUIVisualizationTextSettings& other);
59 :
60 : /// @brief print values in output device
61 : void print(OutputDevice& dev, const std::string& name) const;
62 :
63 : /// @brief get scale size
64 : double scaledSize(double scale, double constFactor = 0.1) const;
65 :
66 : /// @brief whether to show the text
67 : bool show(const GUIGlObject* o) const;
68 :
69 : /// @brief flag show
70 : bool showText;
71 :
72 : /// @brief text size
73 : double size;
74 :
75 : /// @brief text color
76 : RGBColor color;
77 :
78 : /// @brief background text color
79 : RGBColor bgColor;
80 :
81 : /// @brief flag to avoid size changes
82 : bool constSize;
83 :
84 : /// @brief whether only selected objects shall have text drawn
85 : bool onlySelected;
86 : };
87 :
88 :
89 105 : struct GUIVisualizationRainbowSettings {
90 :
91 : /// @brief constructor
92 : GUIVisualizationRainbowSettings(bool _hideMin, double _minThreshold, bool _hideMax, double _maxThreshold, bool _setNeutral,
93 : double _neutralThreshold, bool _fixRange, int _rainboScheme);
94 :
95 : /// @brief equality comparator
96 : bool operator==(const GUIVisualizationRainbowSettings& other);
97 :
98 : /// @brief inequality comparator
99 : bool operator!=(const GUIVisualizationRainbowSettings& other);
100 :
101 : /// @brief print values in output device
102 : void print(OutputDevice& dev, const std::string& name) const;
103 :
104 : /// @brief whether data below threshold should not be colored
105 : bool hideMin;
106 : /// @brief threshold below which value should not be colored
107 : double minThreshold;
108 : /// @brief whether data above threshold should not be colored
109 : bool hideMax;
110 : /// @brief threshold above which value should not be colored
111 : double maxThreshold;
112 : /// @brief whether the scale should be centered at a specific value
113 : bool setNeutral;
114 : /// @brief neutral point of scale
115 : double neutralThreshold;
116 : /// @brief whether the color scale should be fixed to the given min/max values
117 : bool fixRange;
118 : /// @brief index in the list of color schemes
119 : int rainbowScheme;
120 : /// @brief color steps for the rainbow;
121 : std::vector<RGBColor> colors;
122 : };
123 :
124 :
125 : /// @brief struct for size settings
126 : struct GUIVisualizationSizeSettings {
127 :
128 : /// @brief constructor
129 : GUIVisualizationSizeSettings(double _minSize, double _exaggeration = 1.0, bool _constantSize = false, bool _constantSizeSelected = false);
130 :
131 : /// @brief return the drawing size including exaggeration and constantSize values
132 : double getExaggeration(const GUIVisualizationSettings& s, const GUIGlObject* o, double factor = 20) const;
133 :
134 : /// @brief equality comparator
135 : bool operator==(const GUIVisualizationSizeSettings& other);
136 :
137 : /// @brief inequality comparator
138 : bool operator!=(const GUIVisualizationSizeSettings& other);
139 :
140 : /// @brief print values in output device
141 : void print(OutputDevice& dev, const std::string& name) const;
142 :
143 : /// @brief The minimum size to draw this object
144 : double minSize;
145 :
146 : /// @brief The size exaggeration (upscale)
147 : double exaggeration;
148 :
149 : /// @brief whether the object shall be drawn with constant size regardless of zoom
150 : bool constantSize;
151 :
152 : /// @brief whether only selected objects shall be drawn with constant
153 : bool constantSizeSelected;
154 : };
155 :
156 :
157 : /// @brief struct for color settings
158 : struct GUIVisualizationColorSettings {
159 :
160 : /// @brief constructor
161 : GUIVisualizationColorSettings();
162 :
163 : /// @brief equality comparator
164 : bool operator==(const GUIVisualizationColorSettings& other);
165 :
166 : /// @brief inequality comparator
167 : bool operator!=(const GUIVisualizationColorSettings& other);
168 :
169 : /// @brief basic selection color
170 : RGBColor selectionColor;
171 :
172 : /// @brief edge selection color
173 : RGBColor selectedEdgeColor;
174 :
175 : /// @brief lane selection color
176 : RGBColor selectedLaneColor;
177 :
178 : /// @brief connection selection color
179 : RGBColor selectedConnectionColor;
180 :
181 : /// @brief prohibition selection color
182 : RGBColor selectedProhibitionColor;
183 :
184 : /// @brief crossings selection color
185 : RGBColor selectedCrossingColor;
186 :
187 : /// @brief additional selection color (busStops, Detectors...)
188 : RGBColor selectedAdditionalColor;
189 :
190 : /// @brief route selection color (used for routes and vehicle stops)
191 : RGBColor selectedRouteColor;
192 :
193 : /// @brief vehicle selection color
194 : RGBColor selectedVehicleColor;
195 :
196 : /// @brief person selection color
197 : RGBColor selectedPersonColor;
198 :
199 : /// @brief person plan selection color (Rides, Walks, stopPersons...)
200 : RGBColor selectedPersonPlanColor;
201 :
202 : /// @brief container selection color
203 : RGBColor selectedContainerColor;
204 :
205 : /// @brief container plan selection color (Rides, Walks, containerStops...)
206 : RGBColor selectedContainerPlanColor;
207 :
208 : /// @brief edge data selection color
209 : RGBColor selectedEdgeDataColor;
210 :
211 : /// @brief color for busStops
212 : RGBColor busStopColor;
213 :
214 : /// @brief color for busStops signs
215 : RGBColor busStopColorSign;
216 :
217 : /// @brief color for trainStops
218 : RGBColor trainStopColor;
219 :
220 : /// @brief color for trainStops signs
221 : RGBColor trainStopColorSign;
222 :
223 : /// @brief color for containerStops
224 : RGBColor containerStopColor;
225 :
226 : /// @brief color for containerStop signs
227 : RGBColor containerStopColorSign;
228 :
229 : /// @brief color for chargingStations
230 : RGBColor chargingStationColor;
231 :
232 : /// @brief color for chargingStation sign
233 : RGBColor chargingStationColorSign;
234 :
235 : /// @brief color for chargingStation during charging
236 : RGBColor chargingStationColorCharge;
237 :
238 : /// @brief color for parkingAreas
239 : RGBColor parkingAreaColor;
240 :
241 : /// @brief color for parkingArea sign
242 : RGBColor parkingAreaColorSign;
243 :
244 : /// @brief color for parkingSpace contour
245 : RGBColor parkingSpaceColorContour;
246 :
247 : /// @brief color for parkingSpace innen
248 : RGBColor parkingSpaceColor;
249 :
250 : /// @brief color for Stops
251 : RGBColor stopColor;
252 :
253 : /// @brief color for Waypoints
254 : RGBColor waypointColor;
255 :
256 : /// @brief color for vehicle trips
257 : RGBColor vehicleTripColor;
258 :
259 : /// @brief color for stopPersons
260 : RGBColor stopPersonColor;
261 :
262 : /// @brief color for stopPersons
263 : RGBColor personTripColor;
264 :
265 : /// @brief color for walks
266 : RGBColor walkColor;
267 :
268 : /// @brief color for rides
269 : RGBColor rideColor;
270 :
271 : /// @brief color for containerStops
272 : RGBColor stopContainerColor;
273 :
274 : /// @brief color for transport
275 : RGBColor transportColor;
276 :
277 : /// @brief color for tranships
278 : RGBColor transhipColor;
279 :
280 : /// @brief color for highlighthing deadends
281 : static const RGBColor SUMO_color_DEADEND_SHOW;
282 :
283 : /// @brief color for child connections between parents and child elements
284 : static const RGBColor childConnectionColor;
285 :
286 : /// @brief color for edited shapes (Junctions, crossings and connections)
287 : static const RGBColor editShapeColor;
288 :
289 : /// @brief color for crossings
290 : static const RGBColor crossingColor;
291 :
292 : /// @brief color for priority crossing
293 : static const RGBColor crossingPriorityColor;
294 :
295 : /// @brief color for invalid crossing
296 : static const RGBColor crossingInvalidColor;
297 :
298 : };
299 :
300 :
301 : /// @brief struct for candidate color settings
302 : struct GUIVisualizationCandidateColorSettings {
303 :
304 : /// @brief color for possible candidate element
305 : static const RGBColor possible;
306 :
307 : /// @brief color for selected candidate source
308 : static const RGBColor source;
309 :
310 : /// @brief color for selected candidate target
311 : static const RGBColor target;
312 :
313 : /// @brief color for selected special candidate element (Usually selected using shift+click)
314 : static const RGBColor special;
315 :
316 : /// @brief color for selected conflict candidate element (Usually selected using ctrl+click)
317 : static const RGBColor conflict;
318 :
319 : /// @brief color for invalid elements
320 : static const RGBColor invalid;
321 : };
322 :
323 : /// @brief struct for connection settings
324 : struct GUIVisualizationNeteditSizeSettings {
325 :
326 : /// @brief junction bubble radius
327 : static const double junctionBubbleRadius;
328 :
329 : /// @brief moving junction geometry point radius
330 : static const double junctionGeometryPointRadius;
331 :
332 : /// @brief moving edge geometry point radius
333 : static const double edgeGeometryPointRadius;
334 :
335 : /// @brief moving lane geometry point radius
336 : static const double laneGeometryPointRadius;
337 :
338 : /// @brief moving connection geometry point radius
339 : static const double connectionGeometryPointRadius;
340 :
341 : /// @brief moving crossing geometry point radius
342 : static const double crossingGeometryPointRadius;
343 :
344 : /// @brief moving geometry point radius
345 : static const double polygonGeometryPointRadius;
346 :
347 : /// @brief polygon contour width
348 : static const double polygonContourWidth;
349 :
350 : /// @brief poly line width
351 : static const double polylineWidth;
352 :
353 : /// @brief moving additional geometry point radius
354 : static const double additionalGeometryPointRadius;
355 : };
356 :
357 : /// @brief struct for connection settings
358 : struct GUIVisualizationConnectionSettings {
359 :
360 : /// @brief connection width
361 : static const double connectionWidth;
362 : };
363 :
364 :
365 : /// @brief struct for additional settings
366 : struct GUIVisualizationAdditionalSettings {
367 :
368 : /// @brief color for rerouters
369 : static const RGBColor rerouterColor;
370 :
371 : /// @brief rerouter size
372 : static const double rerouterSize;
373 :
374 : /// @brief color for VSS
375 : static const RGBColor VSSColor;
376 :
377 : /// @brief VSS size
378 : static const double VSSSize;
379 :
380 : /// @brief color for Calibrators
381 : static const RGBColor calibratorColor;
382 :
383 : /// @brief Calibrator width
384 : static const double calibratorWidth;
385 :
386 : /// @brief Calibrator height
387 : static const double calibratorHeight;
388 :
389 : /// @brief color for route probes
390 : static const RGBColor routeProbeColor;
391 :
392 : /// @brief RouteProbe size
393 : static const double routeProbeSize;
394 :
395 : /// @brief color for vaporizers
396 : static const RGBColor vaporizerColor;
397 :
398 : /// @brief Vaporizer size
399 : static const double vaporizerSize;
400 :
401 : /// @brief stopEdges size
402 : static const double stopEdgeSize;
403 :
404 : /// @brief connection color
405 : static const RGBColor connectionColor;
406 :
407 : /// @brief connection color selected
408 : static const RGBColor connectionColorSelected;
409 :
410 : /// @brief tractionSubstation size
411 : static const double tractionSubstationSize;
412 :
413 : /// @brief overhead wire color top
414 : static const RGBColor overheadWireColorTop;
415 :
416 : /// @brief overhead wire color bot
417 : static const RGBColor overheadWireColorBot;
418 :
419 : /// @brief overhead wire color selected
420 : static const RGBColor overheadWireColorSelected;
421 :
422 : /// @brief arrow width
423 : static const double arrowWidth;
424 :
425 : /// @brief arrow length
426 : static const double arrowLength;
427 :
428 : /// @brief arrow offset
429 : static const double arrowOffset;
430 :
431 : /// @brief connection color between E1/junctions and TLS
432 : static const RGBColor TLSConnectionColor;
433 : };
434 :
435 :
436 : /// @brief struct for detector settings
437 : struct GUIVisualizationDetectorSettings {
438 :
439 : /// @brief color for E1 detectors
440 : static const RGBColor E1Color;
441 :
442 : /// @brief E1 detector widths
443 : static const double E1Width;
444 :
445 : /// @brief E1 Instant detector heights
446 : static const double E1Height;
447 :
448 : /// @brief color for E1 Instant detectors
449 : static const RGBColor E1InstantColor;
450 :
451 : /// @brief E1 Instant detector widths
452 : static const double E1InstantWidth;
453 :
454 : /// @brief E1 Instant detector heights
455 : static const double E1InstantHeight;
456 :
457 : /// @brief color for E2 detectors
458 : static const RGBColor E2Color;
459 :
460 : /// @brief E2 detector widths
461 : static const double E2Width;
462 :
463 : /// @brief E3 detector size
464 : static const double E3Size;
465 :
466 : /// @brief color for Entrys
467 : static const RGBColor E3EntryColor;
468 :
469 : /// @brief color for Exits
470 : static const RGBColor E3ExitColor;
471 :
472 : /// @brief E3 Entry/Exit detector width
473 : static const double E3EntryExitWidth;
474 :
475 : /// @brief E3 Entry/Exit detector height
476 : static const double E3EntryExitHeight;
477 : };
478 :
479 :
480 : /// @brief struct for stoppingPlace settings
481 : struct GUIVisualizationStoppingPlaceSettings {
482 : /// @brief busStop offset
483 : static const double stoppingPlaceSignOffset;
484 :
485 : /// @brief busStop width
486 : static const double busStopWidth;
487 :
488 : /// @brief trainStop width
489 : static const double trainStopWidth;
490 :
491 : /// @brief containerStop width
492 : static const double containerStopWidth;
493 :
494 : /// @brief chargingStation width
495 : static const double chargingStationWidth;
496 :
497 : /// @brief symbol external radius
498 : static const double symbolExternalRadius;
499 :
500 : /// @brief symbol internal radius
501 : static const double symbolInternalRadius;
502 :
503 : /// @brief symbol internal text size
504 : static const double symbolInternalTextSize;
505 : };
506 :
507 :
508 : /// @brief struct for dotted contour settings
509 : struct GUIVisualizationDottedContourSettings {
510 :
511 : /// @brief width of dotted contour segments
512 : static const double segmentWidth;
513 :
514 : /// @brief width of small dotted contour segments
515 : static const double segmentWidthSmall;
516 :
517 : /// @brief width of large dotted contour segments
518 : static const double segmentWidthLarge;
519 :
520 : /// @brief length of dotted contour segments
521 : static const double segmentLength;
522 :
523 : /// @brief first color of dotted inspected contour
524 : static const RGBColor firstInspectedColor;
525 :
526 : /// @brief second color of dotted inspectedcontour
527 : static const RGBColor secondInspectedColor;
528 :
529 : /// @brief first color of dotted front contour
530 : static const RGBColor firstFrontColor;
531 :
532 : /// @brief second color of dotted front contour
533 : static const RGBColor secondFrontColor;
534 : };
535 :
536 :
537 : /// @brief struct for width settings
538 : struct GUIVisualizationWidthSettings {
539 :
540 : /// @brief constructor
541 : GUIVisualizationWidthSettings();
542 :
543 : /// @brief equality comparator
544 : bool operator==(const GUIVisualizationWidthSettings& other);
545 :
546 : /// @brief inequality comparator
547 : bool operator!=(const GUIVisualizationWidthSettings& other);
548 :
549 : /// @brief width for trips
550 : double tripWidth;
551 :
552 : /// @brief width for person trips
553 : double personTripWidth;
554 :
555 : /// @brief width for walks
556 : double walkWidth;
557 :
558 : /// @brief width for rides
559 : double rideWidth;
560 :
561 : /// @brief width for rides
562 : double transportWidth;
563 :
564 : /// @brief width for rides
565 : double transhipWidth;
566 :
567 : /// @brief width for routes
568 : static const double routeWidth;
569 :
570 : /// @brief width for embeddedroutes
571 : static const double embeddedRouteWidth;
572 : };
573 :
574 :
575 : /// @brief struct for detail settings
576 : struct GUIVisualizationDetailSettings {
577 :
578 : /// @brief draw connections in demand mode
579 : static const double tmp;
580 : };
581 :
582 :
583 : /**
584 : * @class GUIVisualizationSettings
585 : * @brief Stores the information about how to visualize structures
586 : */
587 : class GUIVisualizationSettings {
588 :
589 : public:
590 :
591 : enum class Detail : int {
592 : Level0 = 0,
593 : CircleResolution32 = 0, // circle resolution = 32
594 : DrawPolygonTesselation = 0, // draw polygons tesselated
595 : LaneDetails = 0, // offset, icons, indicators...
596 : Text = 0, // draw text (E2, routes...)
597 : VehiclePoly = 0, // draw vehicles as polygons
598 : JunctionElementDetails = 0, // draw junction elements with high detail (crossings, connections..)
599 : LockedIcons = 0, // draw lock icons
600 :
601 : Level1 = 1,
602 : CircleResolution16 = 1, // circle resolution = 16
603 : VehicleBox = 1, // vehicles as boxes
604 : AdditionalDetails = 1, // stoppingPlace signs, EntryExit arrows...
605 : GeometryPoint = 1, // draw geometry points
606 : JunctionElement = 1, // crossings, walking area, connections and internal lanes
607 : DottedContoursResampled = 1, // resample dotted contours
608 : PreciseSelection = 1, // precise selection using boundaries
609 : DottedContours = 1, // draw dotted contours
610 :
611 : Level2 = 2,
612 : CircleResolution8 = 2, // circle resolution = 8
613 : DrawPolygonSquare = 2, // draw polygons as squares
614 : VehicleTriangle = 2, // draw vehicles as triangles
615 : Additionals = 2, // draw additional elements
616 : GeometryBoxLines = 2, // draw lines instead boxes in GUIGeometry::drawGeometry
617 :
618 : Level3 = 3,
619 : CircleResolution4 = 3, // draw circle resolution as squares
620 : TLSIcon = 3, // draw TLS icons
621 :
622 : Level4 = 4,
623 : GeometryBoxSimpleLine = 4, // draw lines with width = 1 instead boxes in GUIGeometry::drawGeometry
624 : };
625 :
626 : /// @brief constructor
627 : GUIVisualizationSettings(const std::string& _name, bool _netedit = false);
628 :
629 : /// @brief check if draw junction
630 : bool checkDrawJunction(const Boundary& b, const bool selected) const;
631 :
632 : /// @brief check if draw edge
633 : bool checkDrawEdge(const Boundary& b) const;
634 :
635 : /// @brief update ignore hide by zoom (call BEFORE drawing all elements).
636 : void updateIgnoreHideByZoom();
637 :
638 : /// @brief check if draw additionals
639 : bool checkDrawAdditional(Detail d, const bool selected) const;
640 :
641 : /// @brief check if draw polygon
642 : bool checkDrawPoly(const Boundary& b, const bool selected) const;
643 :
644 : /// @brief check if draw POI
645 : bool checkDrawPOI(const double w, const double h, const Detail d, const bool selected) const;
646 :
647 : /// @brief check if draw vehicle
648 : bool checkDrawVehicle(Detail d, const bool selected) const;
649 :
650 : /// @brief check if draw person
651 : bool checkDrawPerson(Detail d, const bool selected) const;
652 :
653 : /// @brief check if draw container
654 : bool checkDrawContainer(Detail d, const bool selected) const;
655 :
656 : /// @brief copy all content from another GUIVisualizationSettings (note: DON'T USE in DrawGL functions!)
657 : void copy(const GUIVisualizationSettings& s);
658 :
659 : /// @brief init default settings
660 : void initNeteditDefaults();
661 : void initSumoGuiDefaults();
662 :
663 : /** @brief Writes the settings into an output device
664 : * @param[in] dev The device to write the settings into
665 : */
666 : void save(OutputDevice& dev) const;
667 :
668 : /** @brief Returns the number of the active lane (edge) coloring scheme
669 : * @return number of the active scheme
670 : */
671 : int getLaneEdgeMode() const;
672 :
673 : /** @brief Returns the number of the active lane (edge) scaling scheme
674 : * @return number of the active scheme
675 : */
676 : int getLaneEdgeScaleMode() const;
677 :
678 : /** @brief Returns the current lane (edge) coloring scheme
679 : * @return current scheme
680 : */
681 : GUIColorScheme& getLaneEdgeScheme();
682 :
683 : /** @brief Returns the current lane (edge) scaling scheme
684 : * @return current scheme
685 : */
686 : GUIScaleScheme& getLaneEdgeScaleScheme();
687 :
688 : /// @brief Comparison operator
689 : bool operator==(const GUIVisualizationSettings& vs2);
690 :
691 : /// @brief map from LinkState to color constants
692 : static const RGBColor& getLinkColor(const LinkState& ls, bool realistic = false);
693 :
694 : /// @brief return an angle that is suitable for reading text aligned with the given angle (degrees)
695 : double getTextAngle(double objectAngle) const;
696 :
697 : /// @brief return wether the text was flipped for reading at the given angle
698 : bool flippedTextAngle(double objectAngle) const;
699 :
700 : /// @brief return the detail level
701 : Detail getDetailLevel(const double exaggeration) const;
702 :
703 : /// @brief check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exaggeration
704 : bool drawDetail(const double detail, const double exaggeration) const;
705 :
706 : /// @brief check if moving geometry point can be draw
707 : bool drawMovingGeometryPoint(const double exaggeration, const double radius) const;
708 :
709 : /// @brief The name of this setting
710 : std::string name;
711 :
712 : /// @brief Whether the settings are for Netedit
713 : bool netedit;
714 :
715 : /// @brief The current view rotation angle
716 : double angle;
717 :
718 : /// @brief Information whether dithering shall be enabled
719 : bool dither;
720 :
721 : /// @brief Information whether frames-per-second should be drawn
722 : bool fps;
723 :
724 : /// @brief drawl all objects according to their z data
725 : bool trueZ;
726 :
727 : /// @name Background visualization settings
728 : /// @{
729 :
730 : /// @brief The background color to use
731 : RGBColor backgroundColor;
732 :
733 : /// @brief Information whether a grid shall be shown
734 : bool showGrid;
735 :
736 : /// @brief Information about the grid spacings
737 : double gridXSize, gridYSize;
738 : /// @}
739 :
740 : /// @name lane visualization settings
741 : /// @{
742 :
743 : /// @brief The mesoscopic edge colorer
744 : GUIColorer edgeColorer;
745 :
746 : /// @brief The mesoscopic edge scaler
747 : GUIScaler edgeScaler;
748 :
749 : /// @brief this should be set at the same time as MSGlobals::gUseMesoSim
750 : static bool UseMesoSim;
751 :
752 : /// @brief The lane colorer
753 : GUIColorer laneColorer;
754 :
755 : /// @brief The lane scaler
756 : GUIScaler laneScaler;
757 :
758 : /// @brief Information whether lane borders shall be drawn
759 : bool laneShowBorders;
760 :
761 : /// @brief Information whether bicycle lane marking shall be drawn
762 : bool showBikeMarkings;
763 :
764 : /// @brief Information whether link textures (arrows) shall be drawn
765 : bool showLinkDecals;
766 :
767 : /// @brief Information whether link rules (colored bars) shall be drawn with a realistic color scheme
768 : bool realisticLinkRules;
769 :
770 : /// @brief Information whether link rules (colored bars) shall be drawn
771 : bool showLinkRules;
772 :
773 : /// @brief Information whether rails shall be drawn
774 : bool showRails;
775 :
776 : /// @brief Setting bundles for optional drawing names with size and color
777 : GUIVisualizationTextSettings edgeName, internalEdgeName, cwaEdgeName, streetName, edgeValue, edgeScaleValue;
778 :
779 : /// @brief flag to show or hide connectors
780 : bool hideConnectors;
781 :
782 : /// @brief The lane exaggeration (upscale thickness)
783 : double laneWidthExaggeration;
784 :
785 : /// @brief The minimum visual lane width for drawing
786 : double laneMinSize;
787 :
788 : /// @brief Whether to show direction indicators for lanes
789 : bool showLaneDirection;
790 :
791 : /// @brief Whether to show sublane boundaries
792 : bool showSublanes;
793 :
794 : /// @brief Whether to improve visualisation of superposed (rail) edges
795 : bool spreadSuperposed;
796 :
797 : /// @brief disable hide by zoom
798 : bool disableHideByZoom;
799 :
800 : /// @brief key for coloring by edge parameter
801 : std::string edgeParam, laneParam;
802 : /// @brief key for coloring by vehicle parameter
803 : std::string vehicleParam;
804 : /// @brief key for scaling by vehicle parameter
805 : std::string vehicleScaleParam;
806 : /// @brief key for rendering vehicle textual parameter
807 : std::string vehicleTextParam;
808 :
809 : /// @brief key for coloring by edgeData
810 : std::string edgeData;
811 : /// @brief id for coloring by live edgeData
812 : std::string edgeDataID;
813 : /// @brief key for scaling by edgeData
814 : std::string edgeDataScaling;
815 :
816 : /// @brief checks and thresholds for rainbow coloring
817 : GUIVisualizationRainbowSettings edgeValueRainBow;
818 : /// @}
819 :
820 : /// @name vehicle visualization settings
821 : /// @{
822 :
823 : /// @brief The vehicle colorer
824 : GUIColorer vehicleColorer;
825 :
826 : /// @brief The size scaling settings for vehicles
827 : GUIScaler vehicleScaler;
828 :
829 : /// @brief The quality of vehicle drawing
830 : int vehicleQuality;
831 :
832 : /// @brief Information whether vehicle blinkers shall be drawn
833 : bool showBlinker;
834 :
835 : /// @brief Information whether the lane change preference shall be drawn
836 : bool drawLaneChangePreference;
837 :
838 : /// @brief Information whether the minimum gap shall be drawn
839 : bool drawMinGap;
840 :
841 : /// @brief Information whether the brake gap shall be drawn
842 : bool drawBrakeGap;
843 :
844 : /// @brief Information whether the communication range shall be drawn
845 : bool showBTRange;
846 :
847 : /// @brief Information whether the route index should be shown
848 : bool showRouteIndex;
849 :
850 : /// @brief Whether vehicle length shall be scaled with length/geometry factor
851 : bool scaleLength;
852 :
853 : /// @brief Whether to draw reversed vehicles in their reversed state
854 : bool drawReversed;
855 :
856 : /// @brief Set whether parking related information should be shown
857 : bool showParkingInfo;
858 :
859 : /// @brief Set whether the charging search related information should be shown
860 : bool showChargingInfo;
861 :
862 : // Setting bundles for controling the size of the drawn vehicles
863 : GUIVisualizationSizeSettings vehicleSize;
864 :
865 : // Setting bundles for optional drawing vehicle names or color value
866 : GUIVisualizationTextSettings vehicleName, vehicleValue, vehicleScaleValue, vehicleText;
867 :
868 : GUIVisualizationRainbowSettings vehicleValueRainBow;
869 : /// @}
870 :
871 :
872 : /// @name person visualization settings
873 : /// @{
874 :
875 : /// @brief The person colorer
876 : GUIColorer personColorer;
877 :
878 : /// @brief The quality of person drawing
879 : int personQuality;
880 :
881 : // Setting bundles for controling the size of the drawn persons
882 : GUIVisualizationSizeSettings personSize;
883 :
884 : // Setting bundles for optional drawing person names
885 : GUIVisualizationTextSettings personName, personValue;
886 :
887 : /// @brief Flag for visualizing the pedestrian network generated for JuPedSim
888 : bool showPedestrianNetwork;
889 :
890 : /// @brief The color of the pedestrian network generated for JuPedSim
891 : RGBColor pedestrianNetworkColor;
892 : /// @}
893 :
894 :
895 : /// @name container visualization settings
896 : /// @{
897 :
898 : /// @brief The container colorer
899 : GUIColorer containerColorer;
900 :
901 : /// @brief The quality of container drawing
902 : int containerQuality;
903 :
904 : // Setting bundles for controling the size of the drawn containers
905 : GUIVisualizationSizeSettings containerSize;
906 :
907 : // Setting bundles for optional drawing container names
908 : GUIVisualizationTextSettings containerName;
909 : /// @}
910 :
911 :
912 : /// @name junction visualization settings
913 : /// @{
914 :
915 : /// @brief The junction colorer
916 : GUIColorer junctionColorer;
917 :
918 : // Setting bundles for optional drawing junction names and indices
919 : GUIVisualizationTextSettings drawLinkTLIndex, drawLinkJunctionIndex, junctionID, junctionName, internalJunctionName, tlsPhaseIndex, tlsPhaseName;
920 :
921 : /// @brief Information whether lane-to-lane arrows shall be drawn
922 : bool showLane2Lane;
923 : /// @brief whether the shape of the junction should be drawn
924 : bool drawJunctionShape;
925 : /// @brief whether crossings and walkingareas shall be drawn
926 : bool drawCrossingsAndWalkingareas;
927 : // Setting bundles for controling the size of the drawn junction
928 : GUIVisualizationSizeSettings junctionSize;
929 :
930 : GUIVisualizationRainbowSettings junctionValueRainBow;
931 : /// @}
932 :
933 :
934 : /// @name Additional structures visualization settings
935 : /// @{
936 :
937 : /// @brief The additional structures visualization scheme
938 : // @todo decouple addExaggeration for POIs, Polygons, Triggers etc
939 : int addMode;
940 : // Setting bundles for controling the size of additional items
941 : GUIVisualizationSizeSettings addSize;
942 : // Setting bundles for optional drawing additional names
943 : GUIVisualizationTextSettings addName;
944 : // Setting bundles for optional drawing additional full names
945 : GUIVisualizationTextSettings addFullName;
946 : /// @}
947 :
948 :
949 : /// @name shapes visualization settings
950 : /// @{
951 :
952 : /// @brief The POI colorer
953 : GUIColorer poiColorer;
954 :
955 : // Setting bundles for controling the size of the drawn POIs
956 : GUIVisualizationSizeSettings poiSize;
957 :
958 : /// @brief The detail level for drawing POIs
959 : int poiDetail;
960 :
961 : // Setting bundles for optional drawing poi names
962 : GUIVisualizationTextSettings poiName;
963 :
964 : // Setting bundles for optional drawing poi types
965 : GUIVisualizationTextSettings poiType;
966 :
967 : // Setting bundles for optional drawing poi text
968 : GUIVisualizationTextSettings poiText;
969 :
970 : /// @brief key for rendering poi textual parameter
971 : std::string poiTextParam;
972 :
973 : /// @brief whether the rendering layer of POIs should be overriden
974 : bool poiUseCustomLayer;
975 :
976 : /// @brief the custom layer for POIs
977 : double poiCustomLayer;
978 :
979 : /// @brief The polygon colorer
980 : GUIColorer polyColorer;
981 :
982 : // Setting bundles for controling the size of the drawn polygons
983 : GUIVisualizationSizeSettings polySize;
984 :
985 : // Setting bundles for optional drawing polygon names
986 : GUIVisualizationTextSettings polyName;
987 :
988 : // Setting bundles for optional drawing polygon types
989 : GUIVisualizationTextSettings polyType;
990 :
991 : /// @brief whether the rendering layer of polygons should be overriden
992 : bool polyUseCustomLayer;
993 :
994 : /// @brief the custom layer for polygons
995 : double polyCustomLayer;
996 : /// @}
997 :
998 :
999 : /// @name data mode visualization settings
1000 : /// @{
1001 : /// @brief the edgeRelation / tazRelation colorer
1002 : GUIColorer dataColorer;
1003 :
1004 : /// @brief The size scaling settings for data elements
1005 : GUIScaler dataScaler;
1006 :
1007 : GUIVisualizationTextSettings dataValue;
1008 :
1009 : /// @brief The tazRelation exaggeration (upscale thickness)
1010 : double tazRelWidthExaggeration;
1011 :
1012 : /// @brief The edgeRelation exaggeration (upscale thickness)
1013 : double edgeRelWidthExaggeration;
1014 :
1015 : /// @brief key for coloring by edgeRelation / tazRelation attribute
1016 : std::string relDataAttr;
1017 :
1018 : /// @brief key for scaling by edgeRelation / tazRelation attribute
1019 : std::string relDataScaleAttr;
1020 :
1021 : /// @brief value below which edgeData and edgeRelation data value should not be rendered
1022 : GUIVisualizationRainbowSettings dataValueRainBow;
1023 : /// @}
1024 :
1025 :
1026 : /// @name 3D visualization settings
1027 : /// @{
1028 : /// @brief whether the coloring schemes of vehicles should be ignored
1029 : bool ignoreColorSchemeFor3DVehicles;
1030 :
1031 : /// @brief whether the TLS link markers should be drawn
1032 : bool show3DTLSLinkMarkers;
1033 :
1034 : /// @brief whether the semi-transparent domes around 3D TL models should be drawn
1035 : bool show3DTLSDomes;
1036 :
1037 : /// @brief whether 3D TLS models should be generated automatically
1038 : bool generate3DTLSModels;
1039 :
1040 : /// @brief whether to draw the head up display items
1041 : bool show3DHeadUpDisplay;
1042 :
1043 : /// @brief 3D material light components
1044 : RGBColor ambient3DLight;
1045 : RGBColor diffuse3DLight;
1046 :
1047 : /// @brief sky background color
1048 : RGBColor skyColor;
1049 :
1050 : /// @}
1051 :
1052 :
1053 : /// @brief Information whether the size legend shall be drawn
1054 : bool showSizeLegend;
1055 :
1056 : /// @brief Information whether the edge color legend shall be drawn
1057 : bool showColorLegend;
1058 :
1059 : /// @brief Information whether the vehicle color legend shall be drawn
1060 : bool showVehicleColorLegend;
1061 :
1062 : /// @brief information about a lane's width (temporary, used for a single view)
1063 : double scale;
1064 :
1065 : /// @brief whether the application is in gaming mode or not
1066 : bool gaming;
1067 :
1068 : /// @brief enable or disable draw boundaries
1069 : bool drawBoundaries;
1070 :
1071 : /// @brief the current selection scaling in netedit (set in SelectorFrame)
1072 : double selectorFrameScale;
1073 :
1074 : /// @brief whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
1075 : bool drawForViewObjectsHandler;
1076 :
1077 : /// @brief whether drawing is performed for the purpose of selecting objects using a rectangle
1078 : bool drawForRectangleSelection;
1079 :
1080 : /// @brief flag to force draw for rectangle selection (see drawForRectangleSelection)
1081 : bool forceDrawForRectangleSelection;
1082 :
1083 : /// @brief flag for disable dotted contours in netedit
1084 : bool disableDottedContours;
1085 :
1086 : // Setting bundles for optional drawing geometry point indices
1087 : GUIVisualizationTextSettings geometryIndices;
1088 :
1089 : /// @brief whether secondary lane shape shall be drawn
1090 : bool secondaryShape;
1091 :
1092 : /**@brief whether drawing is performed in left-hand networks
1093 : * @note used to avoid calls to OptionsCont::getOptions() in every drawgl(...) function, and
1094 : * updated in every doPaintGL(int mode, const Boundary& bound) call
1095 : */
1096 : bool lefthand;
1097 :
1098 : /**@brief whether drawing is performed in left-hand networks
1099 : * @note used to avoid calls to OptionsCont::getOptions() in every drawgl(...) function, and
1100 : * updated in every doPaintGL(int mode, const Boundary& bound) call
1101 : */
1102 : bool disableLaneIcons;
1103 :
1104 : /// @brief scheme names
1105 : static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL;
1106 : static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL;
1107 : static const std::string SCHEME_NAME_PARAM_NUMERICAL;
1108 : static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL;
1109 : static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL;
1110 : static const std::string SCHEME_NAME_SELECTION;
1111 : static const std::string SCHEME_NAME_TYPE;
1112 : static const std::string SCHEME_NAME_PERMISSION_CODE;
1113 : static const std::string SCHEME_NAME_EDGEDATA_LIVE;
1114 :
1115 : static const double MISSING_DATA;
1116 : static RGBColor COL_MISSING_DATA;
1117 :
1118 : static std::map<std::string, std::vector<RGBColor> > RAINBOW_SCHEMES;
1119 :
1120 : /// @brief color settings
1121 : GUIVisualizationColorSettings colorSettings;
1122 :
1123 : /// @brief candidate color settings
1124 : GUIVisualizationCandidateColorSettings candidateColorSettings;
1125 :
1126 : /// @brief netedit size settings
1127 : GUIVisualizationNeteditSizeSettings neteditSizeSettings;
1128 :
1129 : /// @brief connection settings
1130 : GUIVisualizationConnectionSettings connectionSettings;
1131 :
1132 : /// @brief Additional settings
1133 : GUIVisualizationAdditionalSettings additionalSettings;
1134 :
1135 : /// @brief Detector settings
1136 : GUIVisualizationDetectorSettings detectorSettings;
1137 :
1138 : /// @brief StoppingPlace settings
1139 : GUIVisualizationStoppingPlaceSettings stoppingPlaceSettings;
1140 :
1141 : /// @brief dotted contour settings
1142 : GUIVisualizationDottedContourSettings dottedContourSettings;
1143 :
1144 : /// @brief width settings
1145 : GUIVisualizationWidthSettings widthSettings;
1146 :
1147 : /// @brief detail settings
1148 : GUIVisualizationDetailSettings detailSettings;
1149 :
1150 : /// @brief constant for boundary size drawing (20 for slow computers, 10 for quick computers)
1151 : double BoundarySizeDrawing = 15;
1152 :
1153 : protected:
1154 : /// @brief flag for ignore hide by zoom (used if we're drawing elements with constant size, their ID/name/etc. texts, etc.)
1155 : bool myIgnoreHideByZoom;
1156 :
1157 : private:
1158 : /// @brief set copy constructor private
1159 : GUIVisualizationSettings(const GUIVisualizationSettings&) = default;
1160 :
1161 : /// @brief set assignment operator private
1162 200125 : GUIVisualizationSettings& operator=(const GUIVisualizationSettings&) = default;
1163 : };
|