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-2023 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
55 GNEParkingArea(const std::string& id, GNELane* lane, GNENet* net, const double startPos, const double endPos,
56 const std::string& departPos, const std::string& name, const bool friendlyPosition, const int roadSideCapacity,
57 const bool onRoad, const double width, const double length, const double angle, const bool lefthand,
58 const Parameterised::Map& parameters);
59
62
66 void writeAdditional(OutputDevice& device) const;
67
70
72 void updateGeometry();
73
75
78
83 void drawGL(const GUIVisualizationSettings& s) const;
84
86
89
90 /* @brief method for getting the Attribute of an XML key
91 * @param[in] key The attribute key
92 * @return string with the value associated to key
93 */
94 std::string getAttribute(SumoXMLAttr key) const;
95
96 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
97 * @param[in] key The attribute key
98 * @return double with the value associated to key
99 */
100 double getAttributeDouble(SumoXMLAttr key) const;
101
102 /* @brief method for setting the attribute and letting the object perform additional changes
103 * @param[in] key The attribute key
104 * @param[in] value The new value
105 * @param[in] undoList The undoList on which to register changes
106 */
107 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
108
109 /* @brief method for checking if the key and their correspond attribute are valids
110 * @param[in] key The attribute key
111 * @param[in] value The value associated to key key
112 * @return true if the value is valid, false in other case
113 */
114 bool isValid(SumoXMLAttr key, const std::string& value);
115
117
118protected:
125
127 GNELotSpaceDefinition(double x, double y, double z, double rotation, double width, double length);
128
131
133 const double rotation;
134
136 const double width;
137
139 const double length;
140 };
141
143 std::string myDepartPos;
144
147
150
152 double myWidth;
153
155 double myLength;
156
158 double myAngle;
159
162
164 std::vector<GNELotSpaceDefinition> myLotSpaceDefinitions;
165
166private:
168 void setAttribute(SumoXMLAttr key, const std::string& value);
169
172
175};
176
177
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
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
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.
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.