Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEParkingSpace.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 ParkingSpace geometry (adapted from GUILaneWrapper)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
30class GNEParkingArea;
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
41
52 GNEParkingSpace(GNEAdditional* parkingAreaParent, const Position& pos,
53 const double width, const double length, const double angle,
54 const double slope, const std::string& name,
55 const Parameterised::Map& parameters);
56
59
62
64 GNEMoveElement* getMoveElement() const override;
65
67 Parameterised* getParameters() override;
68
70 const Parameterised* getParameters() const override;
71
73
76
80 void writeAdditional(OutputDevice& device) const;
81
83 bool isAdditionalValid() const;
84
86 std::string getAdditionalProblem() const;
87
90
92
95
97 bool checkDrawMoveContour() const override;
98
100
103
105 void updateGeometry() override;
106
109
111 void updateCenteringBoundary(const bool updateGrid);
112
114 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
115
117
120
123 std::string getParentName() const;
124
129 void drawGL(const GUIVisualizationSettings& s) const;
130
132
135
136 /* @brief method for getting the Attribute of an XML key
137 * @param[in] key The attribute key
138 * @return string with the value associated to key
139 */
140 std::string getAttribute(SumoXMLAttr key) const override;
141
142 /* @brief method for getting the Attribute of an XML key in double format
143 * @param[in] key The attribute key
144 * @return double with the value associated to key
145 */
146 double getAttributeDouble(SumoXMLAttr key) const override;
147
148 /* @brief method for getting the Attribute of an XML key in position format
149 * @param[in] key The attribute key
150 * @return position with the value associated to key
151 */
152 Position getAttributePosition(SumoXMLAttr key) const override;
153
154 /* @brief method for getting the Attribute of an XML key in positionVector format
155 * @param[in] key The attribute key
156 * @return positionVector with the value associated to key
157 */
159
160 /* @brief method for setting the attribute and letting the object perform additional changes
161 * @param[in] key The attribute key
162 * @param[in] value The new value
163 * @param[in] undoList The undoList on which to register changes
164 */
165 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
166
167 /* @brief method for checking if the key and their correspond attribute are valids
168 * @param[in] key The attribute key
169 * @param[in] value The value associated to key key
170 * @return true if the value is valid, false in other case
171 */
172 bool isValid(SumoXMLAttr key, const std::string& value) override;
173
175 std::string getPopUpID() const override;
176
178 std::string getHierarchyName() const override;
179
181
182protected:
185
187 double myWidth = 0;
188
190 double myLength = 0;
191
194
196 double myAngle = 0;
197
199 double mySlope = 0;
200
201private:
204 const double width, const bool movingGeometryPoints) const;
205
208 const double width, const double exaggeration, const bool movingGeometryPoints) const;
209
211 void setAttribute(SumoXMLAttr key, const std::string& value) override;
212
215
218};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Position myPosOverView
position over view
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this space
void calculateSpaceContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const double exaggeration, const bool movingGeometryPoints) const
calculate space contour
void drawSpace(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double width, const bool movingGeometryPoints) const
draw space
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
double myWidth
width
std::string getAttribute(SumoXMLAttr key) const override
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
double mySlope
Slope of Parking Space.
~GNEParkingSpace()
Destructor.
std::string getParentName() const
Returns the name of the parent object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
Position getAttributePosition(SumoXMLAttr key) const override
Position getPositionInView() const
Returns position of additional in view.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Parameterised * getParameters() override
get parameters associated with this space
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
bool checkDrawMoveContour() const override
check if draw move contour (red)
GNEParkingSpace & operator=(const GNEParkingSpace &)=delete
Invalidated assignment operator.
double myLength
length
GNEMoveElementViewResizable * myMoveElementViewResizable
move element view resizable
double myAngle
Angle of Parking Space.
GNEParkingSpace(const GNEParkingSpace &)=delete
Invalidated copy constructor.
void updateGeometry() override
update pre-computed geometry information
double getAttributeDouble(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
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.