Eclipse SUMO - Simulation of Urban MObility
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-2024 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 #include "GNEStoppingPlace.h"
23 
24 
25 // ===========================================================================
26 // class definitions
27 // ===========================================================================
28 
34 
35 public:
37  GNEParkingArea(GNENet* net);
38 
56  GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos,
57  const std::string& departPos, const std::string& name, const std::vector<std::string>& badges,
58  const bool friendlyPosition, const int roadSideCapacity,
59  const bool onRoad, const double width, const double length, const double angle, const bool lefthand,
60  const Parameterised::Map& parameters);
61 
64 
68  void writeAdditional(OutputDevice& device) const;
69 
72 
74  void updateGeometry();
75 
77 
80 
85  void drawGL(const GUIVisualizationSettings& s) const;
86 
88 
91 
92  /* @brief method for getting the Attribute of an XML key
93  * @param[in] key The attribute key
94  * @return string with the value associated to key
95  */
96  std::string getAttribute(SumoXMLAttr key) const;
97 
98  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
99  * @param[in] key The attribute key
100  * @return double with the value associated to key
101  */
102  double getAttributeDouble(SumoXMLAttr key) const;
103 
104  /* @brief method for setting the attribute and letting the object perform additional changes
105  * @param[in] key The attribute key
106  * @param[in] value The new value
107  * @param[in] undoList The undoList on which to register changes
108  */
109  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
110 
111  /* @brief method for checking if the key and their correspond attribute are valids
112  * @param[in] key The attribute key
113  * @param[in] value The value associated to key key
114  * @return true if the value is valid, false in other case
115  */
116  bool isValid(SumoXMLAttr key, const std::string& value);
117 
119 
120 protected:
127 
129  GNELotSpaceDefinition(double x, double y, double z, double rotation, double width, double length);
130 
133 
135  const double rotation;
136 
138  const double width;
139 
141  const double length;
142  };
143 
145  std::string myDepartPos;
146 
149 
151  bool myOnRoad;
152 
154  double myWidth;
155 
157  double myLength;
158 
160  double myAngle;
161 
164 
166  std::vector<std::string> myAcceptedBadges;
167 
169  std::vector<GNELotSpaceDefinition> myLotSpaceDefinitions;
170 
171 private:
173  void setAttribute(SumoXMLAttr key, const std::string& value);
174 
176  GNEParkingArea(const GNEParkingArea&) = delete;
177 
180 };
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
A lane area vehicles can park at (netedit-version)
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
std::string getAttribute(SumoXMLAttr key) const
~GNEParkingArea()
Destructor.
double myAngle
Angle of Parking Area.
double myWidth
width of Parking Area
GNEParkingArea & operator=(const GNEParkingArea &)=delete
Invalidated assignment operator.
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.
double getAttributeDouble(SumoXMLAttr key) const
std::string myDepartPos
departPos
bool myOnRoad
Whether vehicles stay on the road.
std::vector< GNELotSpaceDefinition > myLotSpaceDefinitions
vector with GNELotSpaceDefinition
GNEParkingArea(GNENet *net)
default constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
void updateGeometry()
update pre-computed geometry information
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
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.
Definition: OutputDevice.h:61
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
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.