Line data Source code
1 : /****************************************************************************/
2 : // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 : // Copyright (C) 2001-2026 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 GUISUMOAbstractView.h
15 : /// @author Daniel Krajzewicz
16 : /// @author Jakob Erdmann
17 : /// @author Michael Behrisch
18 : /// @author Andreas Gaubatz
19 : /// @date Sept 2002
20 : ///
21 : // The base class for a view
22 : /****************************************************************************/
23 : #pragma once
24 : #include <config.h>
25 :
26 : #include <string>
27 : #include <vector>
28 : #include <map>
29 : #include <utils/foxtools/fxheader.h>
30 : // fx3d includes windows.h so we need to guard against macro pollution
31 : #ifdef WIN32
32 : #define NOMINMAX
33 : #endif
34 : #include <fx3d.h>
35 : #ifdef WIN32
36 : #undef NOMINMAX
37 : #endif
38 :
39 : #include <utils/geom/Boundary.h>
40 : #include <utils/geom/Position.h>
41 : #include <utils/common/RGBColor.h>
42 : #include <utils/common/SUMOTime.h>
43 : #include <utils/gui/globjects/GUIGlObjectTypes.h>
44 : #include <foreign/rtree/SUMORTree.h>
45 :
46 :
47 : // ===========================================================================
48 : // class declarations
49 : // ===========================================================================
50 : class GUIGlChildWindow;
51 : class GUIVehicle;
52 : class GUIPerspectiveChanger;
53 : class GUIMainWindow;
54 : class GUIGLObjectPopupMenu;
55 : class GUIGlObject;
56 : class GUIDialog_EditViewport;
57 : class GUIDialog_ViewSettings;
58 : class GUIVisualizationSettings;
59 : class GUILane;
60 :
61 : /// @brief comparator for resolving clicks
62 : struct ComparatorClickPriority {
63 0 : bool operator()(const GUIGlObject* const a, const GUIGlObject* const b) const {
64 0 : if (a->getClickPriority() == b->getClickPriority()) {
65 : // sorty by GUIGlID as second criterion to simplify
66 : // duplicate removal
67 0 : return a->getGlID() > b->getGlID();
68 : } else {
69 0 : return a->getClickPriority() > b->getClickPriority();
70 : }
71 : }
72 : };
73 :
74 : // ===========================================================================
75 : // class definitions
76 : // ===========================================================================
77 : /**
78 : * @class GUISUMOAbstractView
79 : * This class is meant to be pure virtual later;
80 : * It shall be the main class to inherit views of the simulation (micro-
81 : * or macroscopic ones) from it.
82 : */
83 : class GUISUMOAbstractView : public FXGLCanvas {
84 0 : FXDECLARE(GUISUMOAbstractView)
85 :
86 : public:
87 : /// @brief constructor
88 : GUISUMOAbstractView(FXComposite* p, GUIMainWindow& app, GUIGlChildWindow* parent, const SUMORTree& grid, FXGLVisual* glVis, FXGLCanvas* share);
89 :
90 : /// @brief destructor
91 : virtual ~GUISUMOAbstractView();
92 :
93 : /// @brief recalculate boundaries
94 0 : virtual void recalculateBoundaries() { };
95 :
96 : /// @brief builds the view toolbars
97 0 : virtual void buildViewToolBars(GUIGlChildWindow*) { }
98 :
99 : /// @brief recenters the view
100 : virtual void recenterView();
101 :
102 : /** @brief centers to the chosen artifact
103 : * @param[in] id The id of the artifact to center to
104 : * @param[in] applyZoom Whether to zoom in
105 : * @param[in] zoomDist The distance in m to use for the zoom, values < 0 means: use the centeringBoundary
106 : * @note caller is responsible for calling update
107 : */
108 : virtual void centerTo(GUIGlID id, bool applyZoom, double zoomDist = 20);
109 :
110 : /** @brief centers to the chosen position
111 : * @param[in] pos Position to center view
112 : * @param[in] applyZoom Whether to zoom in
113 : * @param[in] zoomDist The distance in m to use for the zoom, values < 0 means: use the centeringBoundary
114 : * @note caller is responsible for calling update
115 : */
116 : virtual void centerTo(const Position& pos, bool applyZoom, double zoomDist = 20);
117 :
118 : /// @brief centers to the chosen artifact
119 : void centerTo(const Boundary& bound);
120 :
121 : /// @brief applies the given viewport settings
122 : virtual void setViewportFromToRot(const Position& lookFrom, const Position& lookAt, double rotation);
123 :
124 : /// @brief copy the viewport to the given view
125 : virtual void copyViewportTo(GUISUMOAbstractView* view);
126 :
127 : /// @brief meter-to-pixels conversion method
128 : double m2p(double meter) const;
129 :
130 : /// @brief pixels-to-meters conversion method
131 : double p2m(double pixel) const;
132 :
133 : /// @brief get main window
134 : GUIMainWindow* getMainWindow() const;
135 :
136 : /// @brief return windows cursor position
137 : Position getWindowCursorPosition() const;
138 :
139 : /// @brief Returns the gl-id of the object under the given coordinates
140 : void setWindowCursorPosition(FXint x, FXint y);
141 :
142 : /// @brief A reimplementation due to some internal reasons
143 : FXbool makeCurrent();
144 :
145 : /// @brief returns true, if the edit button was pressed
146 : bool isInEditMode();
147 :
148 : /// @brief get changer
149 : GUIPerspectiveChanger& getChanger() const;
150 :
151 : /// @brief get visible boundary
152 : Boundary getVisibleBoundary() const;
153 :
154 : /// @brief return whether this is a 3D view
155 : virtual bool is3DView() const;
156 :
157 : /// @brief zoom interface for 3D view
158 : virtual void zoom2Pos(Position& camera, Position& lookAt, double zoom);
159 :
160 : /// @brief mouse functions
161 : //@{
162 : virtual long onConfigure(FXObject*, FXSelector, void*);
163 : virtual long onPaint(FXObject*, FXSelector, void*);
164 : virtual long onLeftBtnPress(FXObject*, FXSelector, void*);
165 : virtual long onLeftBtnRelease(FXObject*, FXSelector, void*);
166 : virtual long onMiddleBtnPress(FXObject*, FXSelector, void*);
167 : virtual long onMiddleBtnRelease(FXObject*, FXSelector, void*);
168 : virtual long onRightBtnPress(FXObject*, FXSelector, void*);
169 : virtual long onRightBtnRelease(FXObject*, FXSelector, void*);
170 : virtual long onDoubleClicked(FXObject*, FXSelector, void*);
171 : virtual long onMouseWheel(FXObject*, FXSelector, void*);
172 : virtual long onMouseMove(FXObject*, FXSelector, void*);
173 : virtual long onMouseLeft(FXObject*, FXSelector, void*);
174 : //@}
175 :
176 : /// @brief keyboard functions
177 : //@{
178 : virtual long onKeyPress(FXObject* o, FXSelector sel, void* data);
179 : virtual long onKeyRelease(FXObject* o, FXSelector sel, void* data);
180 : //@}
181 :
182 : /// @brief interaction with the simulation
183 : virtual long onCmdCloseLane(FXObject*, FXSelector, void*);
184 : virtual long onCmdCloseEdge(FXObject*, FXSelector, void*);
185 : virtual long onCmdAddRerouter(FXObject*, FXSelector, void*);
186 :
187 : /// @brief highlight edges according to reachability
188 : virtual long onCmdShowReachability(FXObject*, FXSelector, void*);
189 :
190 : /// @brief hook to react on change in visualization settings
191 : virtual long onVisualizationChange(FXObject*, FXSelector, void*);
192 :
193 : /// @brief filter out duplicate and forbidden objects
194 : std::vector<GUIGlObject*> filterContextObjects(const std::vector<GUIGlObject*>& objects);
195 :
196 : /// @brief open object dialog at the cursor position
197 : virtual void openObjectDialogAtCursor(const FXEvent* ev);
198 :
199 : /// @brief open object dialog for the given object
200 : void openObjectDialog(const std::vector<GUIGlObject*>& objects, const bool filter = true);
201 :
202 : /// @brief A method that updates the tooltip
203 : void updateToolTip();
204 :
205 : /// @brief @name Dealing with snapshots
206 : ///@{
207 :
208 : /** @brief Sets the snapshot time to file map
209 : * @param[in] snaps The snapshots to take at certain times
210 : * @param[in] w The snapshot image width
211 : * @param[in] w The snapshot image height
212 : */
213 : void addSnapshot(SUMOTime time, const std::string& file, const int w = -1, const int h = -1);
214 :
215 : /** @brief Takes a snapshots and writes it into the given file
216 : *
217 : * The format to use is determined from the extension.
218 : * If compiled with ffmpeg and a video format is requested it will instantiate a video encoder.
219 : * @param[in] destFile The name of the file to write the snapshot into
220 : * @param[in] w The snapshot image width
221 : * @param[in] w The snapshot image height
222 : * @return The error message, if an error occurred; "" otherwise
223 : */
224 : std::string makeSnapshot(const std::string& destFile, const int w = -1, const int h = -1);
225 :
226 : /// @brief Adds a frame to a video snapshot which will be initialized if necessary
227 : virtual void saveFrame(const std::string& destFile, FXColor* buf);
228 :
229 : /// @brief Ends a video snapshot
230 0 : virtual void endSnapshot() {}
231 :
232 : /// @brief Checks whether it is time for a snapshot
233 : virtual void checkSnapshots();
234 :
235 : void waitForSnapshots(const SUMOTime snapshotTime);
236 :
237 : /// @brief get the current simulation time
238 : virtual SUMOTime getCurrentTimeStep() const;
239 :
240 : ///@}
241 :
242 : /// @brief get the viewport and create it on first access
243 : GUIDialog_EditViewport* getViewportEditor();
244 :
245 : /// @brief update the viewport chooser with the current view values
246 : virtual void updateViewportValues();
247 :
248 : /// @brief show viewport editor
249 : virtual void showViewportEditor();
250 :
251 : /// @brief show viewsscheme editor
252 : void showViewschemeEditor();
253 :
254 : /// @brief set color scheme
255 : virtual bool setColorScheme(const std::string&);
256 :
257 : /// @brief get visualization settings (read only)
258 : const GUIVisualizationSettings& getVisualisationSettings() const;
259 :
260 : /// @brief edit visualization settings (allow modify VisualizationSetings, use carefully)
261 : GUIVisualizationSettings* editVisualisationSettings() const;
262 :
263 : /// @brief recalibrate color scheme according to the current value range
264 0 : virtual void buildColorRainbow(const GUIVisualizationSettings& /*s*/, GUIColorScheme& /*scheme*/, int /*active*/, GUIGlObjectType /*objectType*/,
265 : const GUIVisualizationRainbowSettings& /*rs*/) {
266 0 : }
267 :
268 : /// @brief return list of loaded edgeData attributes
269 0 : virtual std::vector<std::string> getEdgeDataAttrs() const {
270 0 : return std::vector<std::string>();
271 : }
272 :
273 : /// @brief return list of loaded edgeData ids (being computed in the current simulation)
274 0 : virtual std::vector<std::string> getMeanDataIDs() const {
275 0 : return std::vector<std::string>();
276 : }
277 :
278 : /// @brief return list of available attributes for the given meanData id
279 0 : virtual std::vector<std::string> getMeanDataAttrs(const std::string& meanDataID) const {
280 : UNUSED_PARAMETER(meanDataID);
281 0 : return std::vector<std::string>();
282 : }
283 :
284 : /// @brief return list of loaded edgeRelation and tazRelation attributes
285 0 : virtual std::vector<std::string> getRelDataAttrs() const {
286 0 : return std::vector<std::string>();
287 : }
288 :
289 : /// @brief return list of available edge parameters
290 0 : virtual std::vector<std::string> getEdgeLaneParamKeys(bool /*edgeKeys*/) const {
291 0 : return std::vector<std::string>();
292 : }
293 :
294 : /// @brief return list of available vehicle parameters
295 0 : virtual std::vector<std::string> getVehicleParamKeys(bool /*vTypeKeys*/) const {
296 0 : return std::vector<std::string>();
297 : }
298 :
299 : /// @brief return list of available vehicle parameters
300 0 : virtual std::vector<std::string> getPOIParamKeys() const {
301 0 : return std::vector<std::string>();
302 : }
303 :
304 : /// @brief remove viewport
305 : void remove(GUIDialog_EditViewport*);
306 :
307 : /// @brief remove view settings
308 : void remove(GUIDialog_ViewSettings*);
309 :
310 : /// @brief get grid width
311 : // @todo: check why this is here
312 : double getGridWidth() const;
313 :
314 : /// @brief get grid height
315 : // @todo: check why this is here
316 : double getGridHeight() const;
317 :
318 : /// @brief star track
319 : virtual void startTrack(int /*id*/);
320 :
321 : /// @brief stop track
322 : virtual void stopTrack();
323 :
324 : /// @brief get tracked id
325 : virtual GUIGlID getTrackedID() const;
326 :
327 : /// @brief on gaming click
328 : virtual void onGamingClick(Position /*pos*/);
329 : virtual void onGamingRightClick(Position /*pos*/);
330 :
331 : /// @brief @name Additional visualisations
332 : ///@{
333 :
334 : /** @brief Adds an object to call its additional visualisation method
335 : * @param[in] which The object to add
336 : * @return Always true
337 : * @see GUIGlObject::drawGLAdditional
338 : */
339 : bool addAdditionalGLVisualisation(GUIGlObject* const which);
340 :
341 : /** @brief Removes an object from the list of objects that show additional things
342 : * @param[in] which The object to remove
343 : * @return True if the object was known, false otherwise
344 : * @see GUIGlObject::drawGLAdditional
345 : */
346 : bool removeAdditionalGLVisualisation(GUIGlObject* const which);
347 :
348 : /** @brief Check if an object is added in the additional GL visualitation
349 : * @param[in] which The object to check
350 : * @see GUIGlObject::drawGLAdditional
351 : */
352 : bool isAdditionalGLVisualisationEnabled(GUIGlObject* const which) const;
353 :
354 : ///@}
355 :
356 : /// @brief ge the current popup-menu
357 : GUIGLObjectPopupMenu* getPopup() const;
358 :
359 : /// @brief get position of current popup
360 : const Position& getPopupPosition() const;
361 :
362 : /// @brief destroys the popup
363 : void destroyPopup();
364 :
365 : /// @brief replace PopUp
366 : void replacePopup(GUIGLObjectPopupMenu* popUp);
367 :
368 : ///@struct Decal
369 : /// @brief A decal (an image) that can be shown
370 2372 : struct Decal {
371 :
372 : /// @brief Constructor
373 2345 : Decal() {};
374 :
375 : /// @brief The path to the file the image is located at
376 : std::string filename;
377 :
378 : /// @brief The center of the image in x-direction (net coordinates, in m)
379 : double centerX = 0;
380 :
381 : /// @brief The center of the image in y-direction (net coordinates, in m)
382 : double centerY = 0;
383 :
384 : /// @brief The center of the image in z-direction (net coordinates, in m)
385 : double centerZ = 0;
386 :
387 : /// @brief The width of the image (net coordinates in x-direction, in m)
388 : double width = 0;
389 :
390 : /// @brief The height of the image (net coordinates in y-direction, in m)
391 : double height = 0;
392 :
393 : /// @brief The altitude of the image (net coordinates in z-direction, in m)
394 : double altitude = 0;
395 :
396 : /// @brief The rotation of the image in the ground plane (in degrees)
397 : double rot = 0;
398 :
399 : /// @brief The tilt of the image to the ground plane (in degrees)
400 : double tilt = 0;
401 :
402 : /// @brief The roll of the image to the ground plane (in degrees)
403 : double roll = 0;
404 :
405 : /// @brief The layer of the image
406 : double layer = 0;
407 :
408 : /// @brief Whether this image was initialised (inserted as a texture)
409 : bool initialised = false;
410 :
411 : /// @brief Whether this image should be skipped in 2D-views
412 : bool skip2D = false;
413 :
414 : /// @brief Whether this image should be skipped in 2D-views
415 : bool screenRelative = false;
416 :
417 : /// @brief whether the decal shall be drawn in screen coordinates, rather than network coordinates
418 : int glID = -1;
419 :
420 : };
421 :
422 : /// @brief The list of decals to show
423 : std::vector<Decal>& getDecals();
424 :
425 : /// @brief The mutex to use before accessing the decals list in order to avoid thread conflicts
426 : FXMutex& getDecalsLockMutex();
427 :
428 : /// @brief queue a texture for deletion
429 : void queueTextureDelete(unsigned int textureId);
430 :
431 : /// @brief process pending texture deletions
432 : void processPendingTextureDeletes();
433 :
434 : /// @brief clear all decals
435 : void clearDecals();
436 :
437 : /// @brief get coloring schemes combo
438 : MFXComboBoxIcon* getColoringSchemesCombo();
439 :
440 : /// @brief Returns the cursor's x/y position within the network
441 : virtual Position getPositionInformation() const;
442 :
443 : /**@brief Returns a position that is mapped to the closest grid point if the grid is active
444 : * @brief note: formats are pos(x,y,0) por pos(0,0,z)
445 : */
446 : Position snapToActiveGrid(const Position& pos, bool snapXY = true) const;
447 :
448 : /// @brief Translate screen position to network position
449 : Position screenPos2NetPos(int x, int y) const;
450 :
451 : /// @brief add decals
452 : void addDecals(const std::vector<Decal>& decals);
453 :
454 : /// @brief Returns the delay of the parent application
455 : double getDelay() const;
456 :
457 : /// @brief Sets the delay of the parent application
458 : void setDelay(double delay);
459 :
460 : /// @brief Sets the breakpoints of the parent application
461 : void setBreakpoints(const std::vector<SUMOTime>& breakpoints);
462 :
463 : /// @brief retrieve breakpoints if provided by the application
464 0 : virtual const std::vector<SUMOTime> retrieveBreakpoints() const {
465 0 : return std::vector<SUMOTime>();
466 : }
467 :
468 : /// @brief retrieve FPS
469 : double getFPS() const;
470 :
471 : /// @brief get GUIGlChildWindow
472 : GUIGlChildWindow* getGUIGlChildWindow();
473 :
474 : /// @brief Draw (or not) the JuPedSim pedestrian network
475 : /// @param s The visualization settings
476 0 : virtual void drawPedestrianNetwork(const GUIVisualizationSettings& /*s*/) const { };
477 :
478 : /// @brief Change the color of the JuPedSim pedestrian network
479 : /// @param s The visualization settings
480 0 : virtual void changePedestrianNetworkColor(const GUIVisualizationSettings& /*s*/) const { };
481 :
482 : protected:
483 : /// @brief FOX needs this
484 0 : FOX_CONSTRUCTOR(GUISUMOAbstractView)
485 :
486 : /// @brief performs the painting of the simulation
487 : void paintGL();
488 :
489 : /// @brief update position information labels
490 : virtual void updatePositionInformationLabel() const;
491 :
492 : /// @brief paint GL
493 : virtual int doPaintGL(int /*mode*/, const Boundary& /*boundary*/);
494 :
495 : /// @brief doInit
496 : virtual void doInit();
497 :
498 : /// @brief paints a grid
499 : void paintGLGrid() const;
500 :
501 : /// @brief Draws a line with ticks, and the length information.
502 : void displayLegend();
503 :
504 : /// @brief Draws the configured legends
505 : void displayLegends();
506 :
507 : /// @brief Draws a legend for the given scheme
508 : void displayColorLegend(const GUIColorScheme& scheme, bool leftSide, const std::string& key);
509 :
510 : /// @brief Draws frames-per-second indicator
511 : void drawFPS();
512 :
513 : /// @brief returns the GUILane at cursor position (implementation depends on view)
514 : virtual GUILane* getLaneUnderCursor();
515 :
516 : /// @brief returns the id of object under cursor to show their tooltip
517 : virtual GUIGlID getToolTipID();
518 :
519 : /// @brief returns the id of the front object under the cursor using GL_SELECT
520 : GUIGlID getObjectUnderCursor(double sensitivity = SENSITIVITY);
521 :
522 : /// @brief returns the id of the objects under the cursor using GL_SELECT (including overlapped objects)
523 : std::vector<GUIGlID> getObjectsUnderCursor();
524 :
525 : /// @brief returns the GUIGlObject under the cursor using GL_SELECT (including overlapped objects)
526 : std::vector<GUIGlObject*> getGUIGlObjectsUnderCursor();
527 :
528 : /// @brief returns the GUIGlObject under the gripped cursor using GL_SELECT (including overlapped objects)
529 : std::vector<GUIGlObject*> getGUIGlObjectsUnderSnappedCursor();
530 :
531 : /// @brief returns the id of the object at position using GL_SELECT
532 : GUIGlID getObjectAtPosition(Position pos, double sensitivity = SENSITIVITY);
533 :
534 : /// @brief returns the ids of the object at position within the given (rectangular) radius using GL_SELECT
535 : std::vector<GUIGlID> getObjectsAtPosition(Position pos, double radius);
536 :
537 : /// @brief returns the GUIGlObjects at position within the given (rectangular) radius using GL_SELECT
538 : std::vector<GUIGlObject*> getGUIGlObjectsAtPosition(Position pos, double radius);
539 :
540 : /// @brief returns the ids of all objects in the given boundary
541 : std::vector<GUIGlID> getObjectsInBoundary(Boundary bound);
542 :
543 : /// @brief filter internal lanes in Objects under cursor
544 : std::vector<GUIGlObject*> filterInternalLanes(const std::vector<GUIGlObject*>& objects) const;
545 :
546 : /// @brief invokes the tooltip for the given object
547 : bool showToolTipFor(const GUIGlID idToolTip);
548 :
549 : /// @brief Draws the stored decals
550 : void drawDecals();
551 :
552 : /// @brief open popup dialog
553 : void openPopupDialog();
554 :
555 : /// @brief helper function for buildColorRainbow
556 : void buildMinMaxRainbow(const GUIVisualizationSettings& s, GUIColorScheme& scheme, const GUIVisualizationRainbowSettings& rs, double minValue, double maxValue, bool hasMissingData);
557 :
558 : /// @brief applies gl-transformations to fit the Boundary given by myChanger onto the canvas.
559 : /// If fixRatio is true, this boundary will be enlarged to prevent anisotropic stretching.
560 : /// (this should be set to false when doing selections)
561 : Boundary applyGLTransform(bool fixRatio = true);
562 :
563 : /// @brief check whether we can read image data or position with gdal
564 : FXImage* checkGDALImage(Decal& d);
565 :
566 : /// @brief The application
567 : GUIMainWindow* myApp;
568 :
569 : /// @brief The parent window
570 : GUIGlChildWindow* myGlChildWindowParent;
571 :
572 : /// @brief The visualization speed-up
573 : const SUMORTree* myGrid;
574 :
575 : /// @brief The perspective changer
576 : GUIPerspectiveChanger* myChanger = nullptr;
577 :
578 : /// @brief Panning flag
579 : bool myPanning = false;
580 :
581 : /// @brief Information whether too-tip informations shall be generated
582 : bool myInEditMode = false;
583 :
584 : /// @brief Offset to the mouse-hotspot from the mouse position
585 : int myMouseHotspotX, myMouseHotspotY;
586 :
587 : /// @brief The current popup-menu
588 : GUIGLObjectPopupMenu* myPopup = nullptr;
589 :
590 : /// @brief clicked poup position
591 : Position myClickedPopupPosition = Position::INVALID;
592 :
593 : /// @brief The current popup-menu position
594 : Position myPopupPosition = Position(0, 0);
595 :
596 : /// @brief vector with current objects dialog
597 : std::vector<GUIGlObject*> myCurrentObjectsDialog;
598 :
599 : /// @brief visualization settings
600 : GUIVisualizationSettings* myVisualizationSettings;
601 :
602 : /// @brief Internal information whether doInit() was called
603 : bool myAmInitialised = false;
604 :
605 : /// @brief viewport chooser
606 : GUIDialog_EditViewport* myGUIDialogEditViewport = nullptr;
607 :
608 : /// @brief Position of the cursor relative to the window
609 : FXint myWindowCursorPositionX, myWindowCursorPositionY;
610 :
611 : /// @brief Visualization changer
612 : GUIDialog_ViewSettings* myGUIDialogViewSettings = nullptr;
613 :
614 : /// @brief @name Optionally shown decals
615 : ///@{
616 :
617 : /// @brief The list of decals to show
618 : std::vector<Decal> myDecals;
619 :
620 : /// @brief The mutex to use before accessing the decals list in order to avoid thread conflicts
621 : FXMutex myDecalsLockMutex;
622 :
623 : /// @brief texture IDs pending deletion
624 : std::vector<unsigned int> myPendingTextureDeletes;
625 :
626 : /// @brief mutex for pending texture deletes
627 : FXMutex myTextureDeleteMutex;
628 :
629 : ///@}
630 :
631 : /// @brief Snapshots
632 : std::map<SUMOTime, std::vector<std::tuple<std::string, int, int> > > mySnapshots;
633 :
634 : /// @brief The mutex to use before accessing the decals list in order to avoid thread conflicts
635 : FXMutex mySnapshotsMutex;
636 :
637 : /// @brief the semaphore when waiting for snapshots to finish
638 : FXCondition mySnapshotCondition;
639 :
640 : /// @brief poly draw lock
641 : mutable FXMutex myPolyDrawLock;
642 :
643 : /// @brief List of objects for which GUIGlObject::drawGLAdditional is called
644 : std::map<GUIGlObject*, int> myAdditionallyDrawn;
645 :
646 : /// @brief counter for measuring rendering time
647 : long myFrameDrawTime = 0;
648 :
649 : // @brief sensitivity for "<>AtPosition(...) functions
650 : static const double SENSITIVITY;
651 :
652 : private:
653 : /// @brief struct used for sorting objects by layer
654 : struct LayerObject : public std::pair<double, std::pair<GUIGlObjectType, std::string> > {
655 :
656 : public:
657 : /// @brief constructor for shapes
658 : LayerObject(double layer, GUIGlObject* object);
659 :
660 : /// @brief constructor for non-shape elements
661 : LayerObject(GUIGlObject* object);
662 :
663 : /// @brief get GLObject
664 : GUIGlObject* getGLObject() const;
665 :
666 : private:
667 : /// @brief GLObject
668 : GUIGlObject* myGLObject;
669 : };
670 :
671 : };
|