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 74616 : 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 :
495 :
496 : /// @brief struct for dotted contour settings
497 : struct GUIVisualizationDottedContourSettings {
498 :
499 : /// @brief width of dotted contour segments
500 : static const double segmentWidth;
501 :
502 : /// @brief width of small dotted contour segments
503 : static const double segmentWidthSmall;
504 :
505 : /// @brief width of large dotted contour segments
506 : static const double segmentWidthLarge;
507 :
508 : /// @brief length of dotted contour segments
509 : static const double segmentLength;
510 :
511 : /// @brief first color of dotted inspected contour
512 : static const RGBColor firstInspectedColor;
513 :
514 : /// @brief second color of dotted inspectedcontour
515 : static const RGBColor secondInspectedColor;
516 :
517 : /// @brief first color of dotted front contour
518 : static const RGBColor firstFrontColor;
519 :
520 : /// @brief second color of dotted front contour
521 : static const RGBColor secondFrontColor;
522 : };
523 :
524 :
525 : /// @brief struct for width settings
526 : struct GUIVisualizationWidthSettings {
527 :
528 : /// @brief constructor
529 : GUIVisualizationWidthSettings();
530 :
531 : /// @brief equality comparator
532 : bool operator==(const GUIVisualizationWidthSettings& other);
533 :
534 : /// @brief inequality comparator
535 : bool operator!=(const GUIVisualizationWidthSettings& other);
536 :
537 : /// @brief width for trips
538 : double tripWidth;
539 :
540 : /// @brief width for person trips
541 : double personTripWidth;
542 :
543 : /// @brief width for walks
544 : double walkWidth;
545 :
546 : /// @brief width for rides
547 : double rideWidth;
548 :
549 : /// @brief width for rides
550 : double transportWidth;
551 :
552 : /// @brief width for rides
553 : double transhipWidth;
554 :
555 : /// @brief width for routes
556 : static const double routeWidth;
557 :
558 : /// @brief width for embeddedroutes
559 : static const double embeddedRouteWidth;
560 : };
561 :
562 :
563 : /// @brief struct for detail settings
564 : struct GUIVisualizationDetailSettings {
565 :
566 : /// @brief draw connections in demand mode
567 : static const double tmp;
568 : };
569 :
570 :
571 : /**
572 : * @class GUIVisualizationSettings
573 : * @brief Stores the information about how to visualize structures
574 : */
575 : class GUIVisualizationSettings {
576 :
577 : public:
578 :
579 : enum class Detail : int {
580 : Level0 = 0,
581 : CircleResolution32 = 0, // circle resolution = 32
582 : DrawPolygonTesselation = 0, // draw polygons tesselated
583 : LaneDetails = 0, // offset, icons, indicators...
584 : Text = 0, // draw text (E2, routes...)
585 : VehiclePoly = 0, // draw vehicles as polygons
586 : JunctionElementDetails = 0, // draw junction elements with high detail (crossings, connections..)
587 : LockedIcons = 0, // draw lock icons
588 :
589 : Level1 = 1,
590 : CircleResolution16 = 1, // circle resolution = 16
591 : VehicleBox = 1, // vehicles as boxes
592 : AdditionalDetails = 1, // stoppingPlace signs, EntryExit arrows...
593 : GeometryPoint = 1, // draw geometry points
594 : JunctionElement = 1, // crossings, walking area, connections and internal lanes
595 : DottedContoursResampled = 1, // resample dotted contours
596 : PreciseSelection = 1, // precise selection using boundaries
597 :
598 : Level2 = 2,
599 : CircleResolution8 = 2, // circle resolution = 8
600 : DrawPolygonSquare = 2, // draw polygons as squares
601 : VehicleTriangle = 2, // draw vehicles as triangles
602 : Additionals = 2, // draw additional elements
603 : DottedContours = 2, // draw dotted contours
604 : GeometryBoxLines = 2, // draw lines instead boxes in GUIGeometry::drawGeometry
605 :
606 : Level3 = 3,
607 : CircleResolution4 = 3, // draw circle resolution as squares
608 : TLSIcon = 3, // draw TLS icons
609 :
610 : Level4 = 4,
611 : GeometryBoxSimpleLine = 4, // draw lines with width = 1 instead boxes in GUIGeometry::drawGeometry
612 : };
613 :
614 : /// @brief constructor
615 : GUIVisualizationSettings(const std::string& _name, bool _netedit = false);
616 :
617 : /// @brief check if draw junction
618 : bool checkDrawJunction(const Boundary &b, const bool selected) const;
619 :
620 : /// @brief check if draw additionals
621 : bool checkDrawAdditional(Detail d, const bool selected) const;
622 :
623 : /// @brief check if draw polygon
624 : bool checkDrawPoly(const Boundary &b, const bool selected) const;
625 :
626 : /// @brief check if draw POI
627 : bool checkDrawPOI(const double w, const double h, const Detail d, const bool selected) const;
628 :
629 : /// @brief check if draw vehicle
630 : bool checkDrawVehicle(Detail d, const bool selected) const;
631 :
632 : /// @brief check if draw person
633 : bool checkDrawPerson(Detail d, const bool selected) const;
634 :
635 : /// @brief check if draw container
636 : bool checkDrawContainer(Detail d, const bool selected) const;
637 :
638 : /// @brief copy all content from another GUIVisualizationSettings (note: DON'T USE in DrawGL functions!)
639 : void copy(const GUIVisualizationSettings& s);
640 :
641 : /// @brief init default settings
642 : void initNeteditDefaults();
643 : void initSumoGuiDefaults();
644 :
645 : /** @brief Writes the settings into an output device
646 : * @param[in] dev The device to write the settings into
647 : */
648 : void save(OutputDevice& dev) const;
649 :
650 : /** @brief Returns the number of the active lane (edge) coloring schme
651 : * @return number of the active scheme
652 : */
653 : int getLaneEdgeMode() const;
654 :
655 : /** @brief Returns the number of the active lane (edge) scaling schme
656 : * @return number of the active scheme
657 : */
658 : int getLaneEdgeScaleMode() const;
659 :
660 : /** @brief Returns the current lane (edge) coloring schme
661 : * @return current scheme
662 : */
663 : GUIColorScheme& getLaneEdgeScheme();
664 :
665 : /** @brief Returns the current lane (edge) scaling schme
666 : * @return current scheme
667 : */
668 : GUIScaleScheme& getLaneEdgeScaleScheme();
669 :
670 : /// @brief Comparison operator
671 : bool operator==(const GUIVisualizationSettings& vs2);
672 :
673 : /// @brief map from LinkState to color constants
674 : static const RGBColor& getLinkColor(const LinkState& ls, bool realistic = false);
675 :
676 : /// @brief return an angle that is suitable for reading text aligned with the given angle (degrees)
677 : double getTextAngle(double objectAngle) const;
678 :
679 : /// @brief return wether the text was flipped for reading at the given angle
680 : bool flippedTextAngle(double objectAngle) const;
681 :
682 : /// @brief check if draw element depending of boundarySize
683 : bool checkBoundarySizeDrawing(const double w, const double h) const;
684 :
685 : /// @brief return the detail level
686 : Detail getDetailLevel(const double exaggeration) const;
687 :
688 : /// @brief check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxageration
689 : bool drawDetail(const double detail, const double exaggeration) const;
690 :
691 : /// @brief check if moving geometry point can be draw
692 : bool drawMovingGeometryPoint(const double exaggeration, const double radius) const;
693 :
694 : /// @brief The name of this setting
695 : std::string name;
696 :
697 : /// @brief Whether the settings are for Netedit
698 : bool netedit;
699 :
700 : /// @brief The current view rotation angle
701 : double angle;
702 :
703 : /// @brief Information whether dithering shall be enabled
704 : bool dither;
705 :
706 : /// @brief Information whether frames-per-second should be drawn
707 : bool fps;
708 :
709 : /// @brief drawl all objects according to their z data
710 : bool trueZ;
711 :
712 : /// @name Background visualization settings
713 : /// @{
714 :
715 : /// @brief The background color to use
716 : RGBColor backgroundColor;
717 :
718 : /// @brief Information whether a grid shall be shown
719 : bool showGrid;
720 :
721 : /// @brief Information about the grid spacings
722 : double gridXSize, gridYSize;
723 : /// @}
724 :
725 : /// @name lane visualization settings
726 : /// @{
727 :
728 : /// @brief The mesoscopic edge colorer
729 : GUIColorer edgeColorer;
730 :
731 : /// @brief The mesoscopic edge scaler
732 : GUIScaler edgeScaler;
733 :
734 : /// @brief this should be set at the same time as MSGlobals::gUseMesoSim
735 : static bool UseMesoSim;
736 :
737 : /// @brief The lane colorer
738 : GUIColorer laneColorer;
739 :
740 : /// @brief The lane scaler
741 : GUIScaler laneScaler;
742 :
743 : /// @brief Information whether lane borders shall be drawn
744 : bool laneShowBorders;
745 :
746 : /// @brief Information whether bicycle lane marking shall be drawn
747 : bool showBikeMarkings;
748 :
749 : /// @brief Information whether link textures (arrows) shall be drawn
750 : bool showLinkDecals;
751 :
752 : /// @brief Information whether link rules (colored bars) shall be drawn with a realistic color scheme
753 : bool realisticLinkRules;
754 :
755 : /// @brief Information whether link rules (colored bars) shall be drawn
756 : bool showLinkRules;
757 :
758 : /// @brief Information whether rails shall be drawn
759 : bool showRails;
760 :
761 : // Setting bundles for optional drawing names with size and color
762 : GUIVisualizationTextSettings edgeName, internalEdgeName, cwaEdgeName, streetName, edgeValue, edgeScaleValue;
763 :
764 : /// @brief flag to show or hide connectors
765 : bool hideConnectors;
766 :
767 : /// @brief The lane exaggeration (upscale thickness)
768 : double laneWidthExaggeration;
769 :
770 : /// @brief The minimum visual lane width for drawing
771 : double laneMinSize;
772 :
773 : /// @brief Whether to show direction indicators for lanes
774 : bool showLaneDirection;
775 :
776 : /// @brief Whether to show sublane boundaries
777 : bool showSublanes;
778 :
779 : /// @brief Whether to improve visualisation of superposed (rail) edges
780 : bool spreadSuperposed;
781 :
782 : /// @brief disable hide by zoom
783 : bool disableHideByZoom;
784 :
785 : /// @brief key for coloring by edge parameter
786 : std::string edgeParam, laneParam;
787 : /// @brief key for coloring by vehicle parameter
788 : std::string vehicleParam;
789 : /// @brief key for scaling by vehicle parameter
790 : std::string vehicleScaleParam;
791 : /// @brief key for rendering vehicle textual parameter
792 : std::string vehicleTextParam;
793 :
794 : /// @brief key for coloring by edgeData
795 : std::string edgeData;
796 : /// @brief id for coloring by live edgeData
797 : std::string edgeDataID;
798 : /// @brief key for scaling by edgeData
799 : std::string edgeDataScaling;
800 :
801 : /// @brief checks and thresholds for rainbow coloring
802 : GUIVisualizationRainbowSettings edgeValueRainBow;
803 : /// @}
804 :
805 : /// @name vehicle visualization settings
806 : /// @{
807 :
808 : /// @brief The vehicle colorer
809 : GUIColorer vehicleColorer;
810 :
811 : /// @brief The size scaling settings for vehicles
812 : GUIScaler vehicleScaler;
813 :
814 : /// @brief The quality of vehicle drawing
815 : int vehicleQuality;
816 :
817 : /// @brief Information whether vehicle blinkers shall be drawn
818 : bool showBlinker;
819 :
820 : /// @brief Information whether the lane change preference shall be drawn
821 : bool drawLaneChangePreference;
822 :
823 : /// @brief Information whether the minimum gap shall be drawn
824 : bool drawMinGap;
825 :
826 : /// @brief Information whether the brake gap shall be drawn
827 : bool drawBrakeGap;
828 :
829 : /// @brief Information whether the communication range shall be drawn
830 : bool showBTRange;
831 :
832 : /// @brief Information whether the route index should be shown
833 : bool showRouteIndex;
834 :
835 : /// @brief Whether vehicle length shall be scaled with length/geometry factor
836 : bool scaleLength;
837 :
838 : /// @brief Whether to draw reversed vehicles in their reversed state
839 : bool drawReversed;
840 :
841 : /// @brief Set whether parking related information should be shown
842 : bool showParkingInfo;
843 :
844 : /// @brief Set whether the charging search related information should be shown
845 : bool showChargingInfo;
846 :
847 : // Setting bundles for controling the size of the drawn vehicles
848 : GUIVisualizationSizeSettings vehicleSize;
849 :
850 : // Setting bundles for optional drawing vehicle names or color value
851 : GUIVisualizationTextSettings vehicleName, vehicleValue, vehicleScaleValue, vehicleText;
852 :
853 : /// @}
854 :
855 :
856 : /// @name person visualization settings
857 : /// @{
858 :
859 : /// @brief The person colorer
860 : GUIColorer personColorer;
861 :
862 : /// @brief The quality of person drawing
863 : int personQuality;
864 :
865 : // Setting bundles for controling the size of the drawn persons
866 : GUIVisualizationSizeSettings personSize;
867 :
868 : // Setting bundles for optional drawing person names
869 : GUIVisualizationTextSettings personName, personValue;
870 :
871 : /// @brief Flag for visualizing the pedestrian network generated for JuPedSim
872 : bool showPedestrianNetwork;
873 :
874 : /// @brief The color of the pedestrian network generated for JuPedSim
875 : RGBColor pedestrianNetworkColor;
876 : /// @}
877 :
878 :
879 : /// @name container visualization settings
880 : /// @{
881 :
882 : /// @brief The container colorer
883 : GUIColorer containerColorer;
884 :
885 : /// @brief The quality of container drawing
886 : int containerQuality;
887 :
888 : // Setting bundles for controling the size of the drawn containers
889 : GUIVisualizationSizeSettings containerSize;
890 :
891 : // Setting bundles for optional drawing container names
892 : GUIVisualizationTextSettings containerName;
893 : /// @}
894 :
895 :
896 : /// @name junction visualization settings
897 : /// @{
898 :
899 : /// @brief The junction colorer
900 : GUIColorer junctionColorer;
901 :
902 : // Setting bundles for optional drawing junction names and indices
903 : GUIVisualizationTextSettings drawLinkTLIndex, drawLinkJunctionIndex, junctionID, junctionName, internalJunctionName, tlsPhaseIndex, tlsPhaseName;
904 :
905 : /// @brief Information whether lane-to-lane arrows shall be drawn
906 : bool showLane2Lane;
907 : /// @brief whether the shape of the junction should be drawn
908 : bool drawJunctionShape;
909 : /// @brief whether crosings and walkingareas shall be drawn
910 : bool drawCrossingsAndWalkingareas;
911 : // Setting bundles for controling the size of the drawn junction
912 : GUIVisualizationSizeSettings junctionSize;
913 :
914 : GUIVisualizationRainbowSettings junctionValueRainBow;
915 : /// @}
916 :
917 :
918 : /// @name Additional structures visualization settings
919 : /// @{
920 :
921 : /// @brief The additional structures visualization scheme
922 : // @todo decouple addExageration for POIs, Polygons, Triggers etc
923 : int addMode;
924 : // Setting bundles for controling the size of additional items
925 : GUIVisualizationSizeSettings addSize;
926 : // Setting bundles for optional drawing additional names
927 : GUIVisualizationTextSettings addName;
928 : // Setting bundles for optional drawing additional full names
929 : GUIVisualizationTextSettings addFullName;
930 : /// @}
931 :
932 :
933 : /// @name shapes visualization settings
934 : /// @{
935 :
936 : /// @brief The POI colorer
937 : GUIColorer poiColorer;
938 :
939 : // Setting bundles for controling the size of the drawn POIs
940 : GUIVisualizationSizeSettings poiSize;
941 :
942 : /// @brief The detail level for drawing POIs
943 : int poiDetail;
944 :
945 : // Setting bundles for optional drawing poi names
946 : GUIVisualizationTextSettings poiName;
947 :
948 : // Setting bundles for optional drawing poi types
949 : GUIVisualizationTextSettings poiType;
950 :
951 : // Setting bundles for optional drawing poi text
952 : GUIVisualizationTextSettings poiText;
953 :
954 : /// @brief key for rendering poi textual parameter
955 : std::string poiTextParam;
956 :
957 : /// @brief The polygon colorer
958 : GUIColorer polyColorer;
959 :
960 : // Setting bundles for controling the size of the drawn polygons
961 : GUIVisualizationSizeSettings polySize;
962 :
963 : // Setting bundles for optional drawing polygon names
964 : GUIVisualizationTextSettings polyName;
965 :
966 : // Setting bundles for optional drawing polygon types
967 : GUIVisualizationTextSettings polyType;
968 : /// @}
969 :
970 :
971 : /// @name data mode visualization settings
972 : /// @{
973 : /// @brief the edgeRelation / tazRelation colorer
974 : GUIColorer dataColorer;
975 : GUIVisualizationTextSettings dataValue;
976 :
977 : /// @brief The tazRelation exaggeration (upscale thickness)
978 : double tazRelWidthExaggeration;
979 :
980 : /// @brief The edgeRelation exaggeration (upscale thickness)
981 : double edgeRelWidthExaggeration;
982 :
983 : /// @brief key for coloring by edgeRelation / tazRelation attribute
984 : std::string relDataAttr;
985 :
986 : /// @brief value below which edgeData and edgeRelation data value should not be rendered
987 : GUIVisualizationRainbowSettings dataValueRainBow;
988 : /// @}
989 :
990 :
991 : /// @name 3D visualization settings
992 : /// @{
993 : /// @brief whether the TLS link markers should be drawn
994 : bool show3DTLSLinkMarkers;
995 :
996 : /// @brief whether the semi-transparent domes around 3D TL models should be drawn
997 : bool show3DTLSDomes;
998 :
999 : /// @brief whether 3D TLS models should be generated automatically
1000 : bool generate3DTLSModels;
1001 :
1002 : /// @brief whether to draw the head up display items
1003 : bool show3DHeadUpDisplay;
1004 :
1005 : /// @brief 3D material light components
1006 : RGBColor ambient3DLight;
1007 : RGBColor diffuse3DLight;
1008 :
1009 : /// @brief sky background color
1010 : RGBColor skyColor;
1011 :
1012 : /// @}
1013 :
1014 :
1015 : /// @brief Information whether the size legend shall be drawn
1016 : bool showSizeLegend;
1017 :
1018 : /// @brief Information whether the edge color legend shall be drawn
1019 : bool showColorLegend;
1020 :
1021 : /// @brief Information whether the vehicle color legend shall be drawn
1022 : bool showVehicleColorLegend;
1023 :
1024 : /// @brief information about a lane's width (temporary, used for a single view)
1025 : double scale;
1026 :
1027 : /// @brief whether the application is in gaming mode or not
1028 : bool gaming;
1029 :
1030 : /// @brief enable or disable draw boundaries
1031 : bool drawBoundaries;
1032 :
1033 : /// @brief the current selection scaling in netedit (set in SelectorFrame)
1034 : double selectorFrameScale;
1035 :
1036 : /// @brief whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
1037 : bool drawForViewObjectsHandler;
1038 :
1039 : /// @brief whether drawing is performed for the purpose of selecting objects using a rectangle
1040 : bool drawForRectangleSelection;
1041 :
1042 : /// @brief flag to force draw for rectangle selection (see drawForRectangleSelection)
1043 : bool forceDrawForRectangleSelection;
1044 :
1045 : /// @brief flag for disable dotted contours in netedit
1046 : bool disableDottedContours;
1047 :
1048 : // Setting bundles for optional drawing geometry point indices
1049 : GUIVisualizationTextSettings geometryIndices;
1050 :
1051 : /// @brief whether secondary lane shape shall be drawn
1052 : bool secondaryShape;
1053 :
1054 : /**@brief whether drawing is performed in left-hand networks
1055 : * @note used to avoid calls to OptionsCont::getOptions() in every drawgl(...) function, and
1056 : * updated in every doPaintGL(int mode, const Boundary& bound) call
1057 : */
1058 : bool lefthand;
1059 :
1060 : /**@brief whether drawing is performed in left-hand networks
1061 : * @note used to avoid calls to OptionsCont::getOptions() in every drawgl(...) function, and
1062 : * updated in every doPaintGL(int mode, const Boundary& bound) call
1063 : */
1064 : bool disableLaneIcons;
1065 :
1066 : /// @brief scheme names
1067 : static const std::string SCHEME_NAME_EDGE_PARAM_NUMERICAL;
1068 : static const std::string SCHEME_NAME_LANE_PARAM_NUMERICAL;
1069 : static const std::string SCHEME_NAME_PARAM_NUMERICAL;
1070 : static const std::string SCHEME_NAME_EDGEDATA_NUMERICAL;
1071 : static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL;
1072 : static const std::string SCHEME_NAME_SELECTION;
1073 : static const std::string SCHEME_NAME_TYPE;
1074 : static const std::string SCHEME_NAME_PERMISSION_CODE;
1075 : static const std::string SCHEME_NAME_EDGEDATA_LIVE;
1076 :
1077 : static const double MISSING_DATA;
1078 : static RGBColor COL_MISSING_DATA;
1079 :
1080 : static std::map<std::string, std::vector<RGBColor> > RAINBOW_SCHEMES;
1081 :
1082 : /// @brief color settings
1083 : GUIVisualizationColorSettings colorSettings;
1084 :
1085 : /// @brief candidate color settings
1086 : GUIVisualizationCandidateColorSettings candidateColorSettings;
1087 :
1088 : /// @brief netedit size settings
1089 : GUIVisualizationNeteditSizeSettings neteditSizeSettings;
1090 :
1091 : /// @brief connection settings
1092 : GUIVisualizationConnectionSettings connectionSettings;
1093 :
1094 : /// @brief Additional settings
1095 : GUIVisualizationAdditionalSettings additionalSettings;
1096 :
1097 : /// @brief Detector settings
1098 : GUIVisualizationDetectorSettings detectorSettings;
1099 :
1100 : /// @brief StoppingPlace settings
1101 : GUIVisualizationStoppingPlaceSettings stoppingPlaceSettings;
1102 :
1103 : /// @brief dotted contour settings
1104 : GUIVisualizationDottedContourSettings dottedContourSettings;
1105 :
1106 : /// @brief width settings
1107 : GUIVisualizationWidthSettings widthSettings;
1108 :
1109 : /// @brief detail settings
1110 : GUIVisualizationDetailSettings detailSettings;
1111 :
1112 : /// @brief alt key pressed (only used for draw polygons under other elements in SUMO-GUI, store is not needed)
1113 : bool altKeyPressed = false;
1114 :
1115 : /// @brief constant for boundary size drawing (20 for slow computers, 10 for quick computers)
1116 : double BoundarySizeDrawing = 15;
1117 :
1118 : private:
1119 : /// @brief set copy constructor private
1120 : GUIVisualizationSettings(const GUIVisualizationSettings&) = default;
1121 :
1122 : /// @brief set assignment operator private
1123 148848 : GUIVisualizationSettings& operator=(const GUIVisualizationSettings&) = default;
1124 : };
|