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-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// 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
59 void updateGeometry();
60
63
65
70
72 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
73
75
78
81
84
92
94 void updateCenteringBoundary(const bool updateGrid);
95
100 void drawGL(const GUIVisualizationSettings& s) const;
101
103 void deleteGLObject();
104
106 void updateGLObject();
108
111 /* @brief method for getting the Attribute of an XML key
112 * @param[in] key The attribute key
113 * @return string with the value associated to key
114 */
115 std::string getAttribute(SumoXMLAttr key) const;
116
117 /* @brief method for setting the attribute and letting the object perform additional changes
118 * @param[in] key The attribute key
119 * @param[in] value The new value
120 * @param[in] undoList The undoList on which to register changes
121 */
122 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
123
124 /* @brief method for checking if the key and their correspond attribute are valids
125 * @param[in] key The attribute key
126 * @param[in] value The value associated to key key
127 * @return true if the value is valid, false in other case
128 */
129 bool isValid(SumoXMLAttr key, const std::string& value);
130
131 /* @brief method for check if the value for certain attribute is set
132 * @param[in] key The attribute key
133 */
134 bool isAttributeEnabled(SumoXMLAttr key) const;
135
137
140
141protected:
144
147
149 mutable double myExaggeration;
150
151private:
153 void setAttribute(SumoXMLAttr key, const std::string& value);
154
156 void setMoveShape(const GNEMoveResult& moveResult);
157
159 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
160
163
166};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
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.
GNEMoveOperation * getMoveOperation()
get move operation
std::string getAttribute(SumoXMLAttr key) const
GNEWalkingArea(const GNEWalkingArea &)=delete
Invalidated copy constructor.
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
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.
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.
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 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:175