Eclipse SUMO - Simulation of Urban MObility
GNEWalkingArea.h
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// 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// class definitions
36// ===========================================================================
44
45public:
50 GNEWalkingArea(GNEJunction* parentJunction, const std::string& ID);
51
54
58 void updateGeometry();
59
62
64
69
71 void removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList);
72
74
77
80
83
91
93 double getExaggeration(const GUIVisualizationSettings& s) const;
94
96 void updateCenteringBoundary(const bool updateGrid);
97
102 void drawGL(const GUIVisualizationSettings& s) const;
103
105 void deleteGLObject();
106
108 void updateGLObject();
110
113 /* @brief method for getting the Attribute of an XML key
114 * @param[in] key The attribute key
115 * @return string with the value associated to key
116 */
117 std::string getAttribute(SumoXMLAttr key) const;
118
119 /* @brief method for setting the attribute and letting the object perform additional changes
120 * @param[in] key The attribute key
121 * @param[in] value The new value
122 * @param[in] undoList The undoList on which to register changes
123 */
124 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
125
126 /* @brief method for checking if the key and their correspond attribute are valids
127 * @param[in] key The attribute key
128 * @param[in] value The value associated to key key
129 * @return true if the value is valid, false in other case
130 */
131 bool isValid(SumoXMLAttr key, const std::string& value);
132
133 /* @brief method for check if the value for certain attribute is set
134 * @param[in] key The attribute key
135 */
136 bool isAttributeEnabled(SumoXMLAttr key) const;
137
139
142
143protected:
146
149
151 mutable double myExaggeration;
152
153private:
155 void setAttribute(SumoXMLAttr key, const std::string& value);
156
158 void setMoveShape(const GNEMoveResult& moveResult);
159
161 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
162
165
168};
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.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
GNEJunction * myParentJunction
the parent junction of this crossing
TesselatedPolygon myTesselation
An object that stores the shape and its tesselation.
GNEWalkingArea(GNEJunction *parentJunction, const std::string &ID)
Constructor.
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
Definition: Parameterised.h:45
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:169