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.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 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 
54  GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos, const std::string& departPos,
55  const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const double length,
56  double angle, const std::map<std::string, std::string>& parameters);
57 
60 
64  void writeAdditional(OutputDevice& device) const;
65 
69  void updateGeometry();
71 
74 
78  void drawGL(const GUIVisualizationSettings& s) const;
80 
83  /* @brief method for getting the Attribute of an XML key
84  * @param[in] key The attribute key
85  * @return string with the value associated to key
86  */
87  std::string getAttribute(SumoXMLAttr key) const;
88 
89  /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
90  * @param[in] key The attribute key
91  * @return double with the value associated to key
92  */
93  double getAttributeDouble(SumoXMLAttr key) const;
94 
95  /* @brief method for setting the attribute and letting the object perform additional changes
96  * @param[in] key The attribute key
97  * @param[in] value The new value
98  * @param[in] undoList The undoList on which to register changes
99  */
100  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
101 
102  /* @brief method for checking if the key and their correspond attribute are valids
103  * @param[in] key The attribute key
104  * @param[in] value The value asociated to key key
105  * @return true if the value is valid, false in other case
106  */
107  bool isValid(SumoXMLAttr key, const std::string& value);
108 
110 
111 protected:
118 
120  GNELotSpaceDefinition(double x, double y, double z, double rotation, double width, double length);
121 
124 
126  const double rotation;
127 
129  const double width;
130 
132  const double length;
133 
136  };
137 
139  std::string myDepartPos;
140 
143 
145  bool myOnRoad;
146 
148  double myWidth;
149 
151  double myLength;
152 
154  double myAngle;
155 
157  std::vector<GNELotSpaceDefinition> myLotSpaceDefinitions;
158 
159 private:
161  void setAttribute(SumoXMLAttr key, const std::string& value);
162 
164  GNEParkingArea(const GNEParkingArea&) = delete;
165 
168 };
169 
170 
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.
void writeAdditional(OutputDevice &device) const
writte 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.
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 conrrespond 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
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
Representation of a single lot space in Netedit.
GNELotSpaceDefinition & operator=(const GNELotSpaceDefinition &)=delete
Invalidated assignment operator.
const double rotation
The rotation.
const Position position
The position of the vehicle when parking in this space.