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-2025 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// ===========================================================================
29
31class PositionVector;
32class GNEJunction;
33class GNEEdge;
34
35// ===========================================================================
36// class definitions
37// ===========================================================================
38
40
41public:
46 GNEWalkingArea(GNEJunction* junction, const std::string& ID);
47
50
53
55 GNEMoveElement* getMoveElement() const override;
56
58 Parameterised* getParameters() override;
59
61 const Parameterised* getParameters() const override;
62
64
67
69 void updateGeometry() override;
70
73
75
78
80 bool checkDrawFromContour() const override;
81
83 bool checkDrawToContour() const override;
84
86 bool checkDrawRelatedContour() const override;
87
89 bool checkDrawOverContour() const override;
90
92 bool checkDrawDeleteContour() const override;
93
95 bool checkDrawDeleteContourSmall() const override;
96
98 bool checkDrawSelectContour() const override;
99
101 bool checkDrawMoveContour() const override;
102
104
107
110
118
121
123 void updateCenteringBoundary(const bool updateGrid);
124
129 void drawGL(const GUIVisualizationSettings& s) const;
130
132 void deleteGLObject();
133
135 void updateGLObject();
137
140 /* @brief method for getting the Attribute of an XML key
141 * @param[in] key The attribute key
142 * @return string with the value associated to key
143 */
144 std::string getAttribute(SumoXMLAttr key) const override;
145
146 /* @brief method for getting the Attribute of an XML key in double format
147 * @param[in] key The attribute key
148 * @return double with the value associated to key
149 */
150 double getAttributeDouble(SumoXMLAttr key) const override;
151
152 /* @brief method for getting the Attribute of an XML key in position format
153 * @param[in] key The attribute key
154 * @return position with the value associated to key
155 */
156 Position getAttributePosition(SumoXMLAttr key) const override;
157
158 /* @brief method for getting the Attribute of an XML key in Position format
159 * @param[in] key The attribute key
160 * @return position with the value associated to key
161 */
163
164 /* @brief method for setting the attribute and letting the object perform additional changes
165 * @param[in] key The attribute key
166 * @param[in] value The new value
167 * @param[in] undoList The undoList on which to register changes
168 */
169 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
170
171 /* @brief method for checking if the key and their correspond attribute are valids
172 * @param[in] key The attribute key
173 * @param[in] value The value associated to key key
174 * @return true if the value is valid, false in other case
175 */
176 bool isValid(SumoXMLAttr key, const std::string& value) override;
177
178 /* @brief method for check if the value for certain attribute is set
179 * @param[in] key The attribute key
180 */
181 bool isAttributeEnabled(SumoXMLAttr key) const;
182
184
185protected:
188
190 mutable double myExaggeration;
191
194
195private:
198 const PositionVector& shape, const double exaggeration) const;
199
201 bool drawInContourMode() const;
202
205
207 void setAttribute(SumoXMLAttr key, const std::string& value) override;
208
211
214};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this walkingArea
~GNEWalkingArea()
Destructor.
bool checkDrawToContour() const override
check if draw from contour (magenta)
bool isValid(SumoXMLAttr key, const std::string &value) override
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
double getAttributeDouble(SumoXMLAttr key) const override
void drawWalkingArea(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double exaggeration) const
draw walking area
GNEContour myInnenContour
variable used for draw innen contour
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
GNEWalkingArea(const GNEWalkingArea &)=delete
Invalidated copy constructor.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myExaggeration
exaggeration used in tesselation
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)
Position getAttributePosition(SumoXMLAttr key) const override
NBNode::WalkingArea & getNBWalkingArea() const
get referente to NBode::WalkingArea
void deleteGLObject()
delete element
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
bool checkDrawSelectContour() const override
check if draw select contour (blue)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::string getAttribute(SumoXMLAttr key) const override
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool checkDrawOverContour() const override
check if draw over contour (orange)
bool drawInContourMode() const
check if draw walking area in contour mode
void updateGeometry() override
update pre-computed geometry information
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
bool checkDrawFromContour() const override
check if draw from contour (green)
GNEWalkingArea & operator=(const GNEWalkingArea &)=delete
Invalidated assignment operator.
Parameterised * getParameters() override
get parameters associated with this walkingArea
bool isAttributeEnabled(SumoXMLAttr key) const
bool checkDrawMoveContour() const override
check if draw move contour (red)
The popup menu of a globject.
Stores the information about how to visualize structures.
An upper class for objects with additional parameters.
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