Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEWalkingArea.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-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/****************************************************************************/
18// A class for visualizing and editing WalkingAreas
19/****************************************************************************/
20#pragma once
21#include <config.h>
22#include "GNENetworkElement.h"
24#include <netbuild/NBNode.h>
25
26// ===========================================================================
27// class declarations
28// ===========================================================================
30class PositionVector;
31class GNEJunction;
32class GNEEdge;
33
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
45
46public:
51 GNEWalkingArea(GNEJunction* parentJunction, const std::string& ID);
52
55
58
60 void updateGeometry();
61
64
66
69
71 bool checkDrawFromContour() const;
72
74 bool checkDrawToContour() const;
75
77 bool checkDrawRelatedContour() const;
78
80 bool checkDrawOverContour() const;
81
83 bool checkDrawDeleteContour() const;
84
86 bool checkDrawSelectContour() const;
87
89 bool checkDrawMoveContour() const;
90
92
97
99 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
100
102
105
108
111
119
122
124 void updateCenteringBoundary(const bool updateGrid);
125
130 void drawGL(const GUIVisualizationSettings& s) const;
131
133 void deleteGLObject();
134
136 void updateGLObject();
138
141 /* @brief method for getting the Attribute of an XML key
142 * @param[in] key The attribute key
143 * @return string with the value associated to key
144 */
145 std::string getAttribute(SumoXMLAttr key) const;
146
147 /* @brief method for getting the Attribute of an XML key in Position format
148 * @param[in] key The attribute key
149 * @return position with the value associated to key
150 */
152
153 /* @brief method for setting the attribute and letting the object perform additional changes
154 * @param[in] key The attribute key
155 * @param[in] value The new value
156 * @param[in] undoList The undoList on which to register changes
157 */
158 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
159
160 /* @brief method for checking if the key and their correspond attribute are valids
161 * @param[in] key The attribute key
162 * @param[in] value The value associated to key key
163 * @return true if the value is valid, false in other case
164 */
165 bool isValid(SumoXMLAttr key, const std::string& value);
166
167 /* @brief method for check if the value for certain attribute is set
168 * @param[in] key The attribute key
169 */
170 bool isAttributeEnabled(SumoXMLAttr key) const;
171
173
176
177protected:
180
183
185 mutable double myExaggeration;
186
189
190private:
193 const PositionVector& shape, const double exaggeration) const;
194
196 bool drawInContourMode() const;
197
200
202 void setAttribute(SumoXMLAttr key, const std::string& value);
203
205 void setMoveShape(const GNEMoveResult& moveResult);
206
208 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
209
212
215};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
move operation
move result
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
~GNEWalkingArea()
Destructor.
bool checkDrawMoveContour() const
check if draw move contour (red)
GNEMoveOperation * getMoveOperation()
get move operation
std::string getAttribute(SumoXMLAttr key) const
void drawWalkingArea(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double exaggeration) const
draw walking area
bool checkDrawToContour() const
check if draw from contour (magenta)
GNEContour myInnenContour
variable used for draw innen contour
bool checkDrawOverContour() const
check if draw over contour (orange)
GNEWalkingArea(const GNEWalkingArea &)=delete
Invalidated copy constructor.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
bool checkDrawSelectContour() const
check if draw select contour (blue)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myExaggeration
exaggeration used in tesselation
bool checkDrawFromContour() const
check if draw from contour (green)
Position getPositionInView() const
Returns position of hierarchical element in view.
PositionVector getAttributePositionVector(SumoXMLAttr key) const
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
NBNode::WalkingArea & getNBWalkingArea() const
get referente to NBode::WalkingArea
void deleteGLObject()
delete element
bool isValid(SumoXMLAttr key, const std::string &value)
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
bool drawInContourMode() const
check if draw walking area in contour mode
GNEJunction * myParentJunction
the parent junction of this crossing
TesselatedPolygon myTesselation
An object that stores the shape and its tesselation.
void updateGLObject()
update GLObject (geometry, ID, etc.)
void drawTesselatedWalkingArea(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d) const
draw tesselated walking area
void updateGeometry()
update pre-computed geometry information
GNEWalkingArea & operator=(const GNEWalkingArea &)=delete
Invalidated assignment operator.
GNEJunction * getParentJunction() const
get parent Junction
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
bool isAttributeEnabled(SumoXMLAttr key) const
const Parameterised::Map & getACParametersMap() const
get parameters map
The popup menu of a globject.
Stores the information about how to visualize structures.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
A definition of a pedestrian walking area.
Definition NBNode.h:177