Eclipse SUMO - Simulation of Urban MObility
GUIPostDrawing.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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#include <config.h>
21#include <algorithm>
22
23#include "GUIPostDrawing.h"
24
25
27
28
29void
31 // reset recompute boundaries
33 // udate AC geometries
34 for (const auto& GLObject : myGLObjectsToUpdate) {
35 GLObject->updateGLObject();
36 }
37 myGLObjectsToUpdate.clear();
38 // reset mouse Pos
40 // clear containers
44 // reset marked elements
45 markedNode = nullptr;
46 markedEdge = nullptr;
47 markedLane = nullptr;
48 markedTAZ = nullptr;
49 markedRoute = nullptr;
50}
51
52
53void
55 if (GLObject) {
56 myGLObjectsToUpdate.push_back(GLObject);
57 }
58}
59
60
61void
63 myElementsUnderCursor.push_back(GLObject);
64}
65
66
67bool
69 return std::find(myElementsUnderCursor.begin(), myElementsUnderCursor.end(), GLObject) != myElementsUnderCursor.end();
70}
71
72
73const std::vector<const GUIGlObject*>&
76}
77
78/****************************************************************************/
@ GLO_NETWORK
The network - empty.
void markGLObjectToUpdate(GUIGlObject *GLObject)
mark GLObject to update (usually the geometry)
const GUIGlObject * markedLane
marked lane (used in create edge mode, for splitting)
std::vector< const GUIGlObject * > myElementsUnderCursor
elements under cursor
void executePostDrawingTasks()
execute post drawing tasks
GUIPostDrawing()
constructor
std::vector< const GUIGlObject * > elementsMarkedToRemove
elements marked for drawing remove contour (used in NETEDIT)
const std::vector< const GUIGlObject * > & getElementUnderCursor() const
get all elements under cursor
std::vector< GUIGlObject * > myGLObjectsToUpdate
GLObjects to update.
bool isElementUnderCursor(const GUIGlObject *GLObject) const
check if element is under cursor
void addElementUnderCursor(const GUIGlObject *GLObject)
add element into list of elements under cursor
const GUIGlObject * markedRoute
marked Route (used in create vehicle mode)
const GUIGlObject * markedTAZ
marked TAZ (used in create TAZRel mode)
GUIGlObjectType recomputeBoundaries
recompute boundaries
const GUIGlObject * markedNode
marked Node (used in create edge mode)
const GUIGlObject * markedEdge
marked edge (used in create edge mode, for splitting)
Position mousePos
mouse position before rendering elements
std::vector< const GUIGlObject * > elementsMarkedToSelect
elements marked for drawing selet contour(used in NETEDIT)
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:298