Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEParkingArea.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 ParkingArea geometry (adapted from GUILaneWrapper)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEStoppingPlace.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
30
31public:
34
53 GNEParkingArea(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, const double startPos, const double endPos,
54 const std::string& departPos, const std::string& name, const std::vector<std::string>& badges, const bool friendlyPosition,
55 const int roadSideCapacity, const bool onRoad, const double width, const double length, const double angle, const bool lefthand,
56 const Parameterised::Map& parameters);
57
60
64 void writeAdditional(OutputDevice& device) const;
65
68
70 void updateGeometry() override;
71
73
76
81 void drawGL(const GUIVisualizationSettings& s) const;
82
84
87
88 /* @brief method for getting the Attribute of an XML key
89 * @param[in] key The attribute key
90 * @return string with the value associated to key
91 */
92 std::string getAttribute(SumoXMLAttr key) const override;
93
94 /* @brief method for getting the Attribute of an XML key in double format
95 * @param[in] key The attribute key
96 * @return double with the value associated to key
97 */
98 double getAttributeDouble(SumoXMLAttr key) const override;
99
100 /* @brief method for setting the attribute and letting the object perform additional changes
101 * @param[in] key The attribute key
102 * @param[in] value The new value
103 * @param[in] undoList The undoList on which to register changes
104 */
105 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
106
107 /* @brief method for checking if the key and their correspond attribute are valids
108 * @param[in] key The attribute key
109 * @param[in] value The value associated to key key
110 * @return true if the value is valid, false in other case
111 */
112 bool isValid(SumoXMLAttr key, const std::string& value) override;
113
115
116protected:
123
125 GNELotSpaceDefinition(double x, double y, double z, double rotation, double width, double length);
126
129
131 const double rotation;
132
134 const double width;
135
137 const double length;
138 };
139
141 std::string myDepartPos;
142
145
147 bool myOnRoad = false;
148
150 double myWidth = 0;
151
153 double myLength = 0;
154
156 bool myLefthand = false;
157
159 std::vector<std::string> myAcceptedBadges;
160
162 std::vector<GNELotSpaceDefinition> myLotSpaceDefinitions;
163
164private:
166 void setAttribute(SumoXMLAttr key, const std::string& value) override;
167
170
173};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
double myLength
Length of Parking Area (by default (endPos - startPos) / roadsideCapacity.
bool myLefthand
lefthand
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
~GNEParkingArea()
Destructor.
double getAttributeDouble(SumoXMLAttr key) const override
double myWidth
width of Parking Area
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEParkingArea(const GNEParkingArea &)=delete
Invalidated copy constructor.
std::vector< std::string > myAcceptedBadges
The list of badges that allow accessing the parkingArea.
std::string myDepartPos
departPos
GNEParkingArea & operator=(const GNEParkingArea &)=delete
Invalidated assignment operator.
bool myOnRoad
Whether vehicles stay on the road.
std::vector< GNELotSpaceDefinition > myLotSpaceDefinitions
vector with GNELotSpaceDefinition
std::string getAttribute(SumoXMLAttr key) const override
bool isValid(SumoXMLAttr key, const std::string &value) override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateGeometry() override
update pre-computed geometry information
int myRoadSideCapacity
roadside capacity of Parking Area
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
Representation of a single lot space in Netedit.
const double rotation
The rotation.
const Position position
The position of the vehicle when parking in this space.