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