Eclipse SUMO - Simulation of Urban MObility
GUIPostDrawing.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2023 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 /****************************************************************************/
18 // Operations that must be applied after drawGL()
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
23 #include <vector>
25 
26 // ===========================================================================
27 // class declaration
28 // ===========================================================================
29 
30 class GNEJunction;
31 class GNEEdge;
32 class GNELane;
33 class GNERoute;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
38 
40 
41 public:
44 
47 
49  void markGLObjectToUpdate(GUIGlObject* GLObject);
50 
52  void addElementUnderCursor(const GUIGlObject* GLObject);
53 
55  bool isElementUnderCursor(const GUIGlObject* GLObject) const;
56 
58  const std::vector<const GUIGlObject*>& getElementUnderCursor() const;
59 
62 
65 
68 
71 
74 
76  const GNEEdge* markedEdge = nullptr;
77 
79  const GNELane* markedLane = nullptr;
80 
82  const GUIGlObject* markedTAZ = nullptr;
83 
85  const GNERoute* markedRoute = nullptr;
86 
89 
92 
93 protected:
95  std::vector<GUIGlObject*> myGLObjectsToUpdate;
96 
98  std::vector<const GUIGlObject*> myElementsUnderCursor;
99 
100 private:
102  GUIPostDrawing(const GUIPostDrawing&) = default;
103 
106 };
GUIGlObjectType
@ GLO_NETWORK
The network - empty.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
void markGLObjectToUpdate(GUIGlObject *GLObject)
mark GLObject to update (usually the geometry)
const GNERoute * markedRoute
marked route (used in create vehicle mode)
std::vector< const GUIGlObject * > myElementsUnderCursor
elements under cursor
void executePostDrawingTasks()
execute post drawing tasks
GUIPostDrawing()
constructor
const GUIGlObject * markedElementSelectContour
elements marked for drawing select contour (used in netedit)
const GNELane * markedLane
marked lane (used in create edge mode, for splitting)
const GUIGlObject * markedFirstGeometryPoint
marked first geometry point (used for moving/delete geometry points)
const std::vector< const GUIGlObject * > & getElementUnderCursor() const
get all elements under cursor
std::vector< GUIGlObject * > myGLObjectsToUpdate
GLObjects to update.
const GUIGlObject * markedSecondGeometryPoint
marked first geometry point (used for moving/delete geometry points)
bool isElementUnderCursor(const GUIGlObject *GLObject) const
check if element is under cursor
GUIPostDrawing & operator=(const GUIPostDrawing &)=default
set assignment operator private
const GUIGlObject * markedElementDeleteContour
elements marked for drawing delete contour (used in netedit)
void addElementUnderCursor(const GUIGlObject *GLObject)
add element into list of elements under cursor
const GUIGlObject * markedTAZ
marked TAZ (used in create TAZRel mode)
GUIPostDrawing(const GUIPostDrawing &)=default
set copy constructor private
const GUIGlObject * markedElementOverContour
elements marked for drawing over contour (used in netedit)
GUIGlObjectType recomputeBoundaries
recompute boundaries
const GNEEdge * markedEdge
marked edge (used in create edge mode, for splitting)
Position mousePos
mouse position before rendering elements
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:317