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
35public:
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 Parameterised::Map& 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 associated 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
111protected:
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 };
134
136 std::string myDepartPos;
137
140
143
145 double myWidth;
146
148 double myLength;
149
151 double myAngle;
152
154 std::vector<GNELotSpaceDefinition> myLotSpaceDefinitions;
155
156private:
158 void setAttribute(SumoXMLAttr key, const std::string& value);
159
162
165};
166
167
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
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
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
GNEParkingArea & operator=(const GNEParkingArea &)=delete
Invalidated assignment operator.
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.