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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A class for visualizing ParkingArea geometry (adapted from GUILaneWrapper)
15 /****************************************************************************/
16 #ifndef GNEParkingArea_h
17 #define GNEParkingArea_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 
23 #include "GNEStoppingPlace.h"
24 
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
29 
35 
36 public:
51  GNEParkingArea(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet,
52  const std::string& name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string& length,
53  double angle, bool blockMovement);
54 
57 
61  void updateGeometry();
62 
65 
67  void splitEdgeGeometry(const double splitPosition, const GNENetElement* originalElement, const GNENetElement* newElement, GNEUndoList* undoList);
69 
72 
76  void drawGL(const GUIVisualizationSettings& s) const;
78 
81  /* @brief method for getting the Attribute of an XML key
82  * @param[in] key The attribute key
83  * @return string with the value associated to key
84  */
85  std::string getAttribute(SumoXMLAttr key) const;
86 
87  /* @brief method for setting the attribute and letting the object perform additional changes
88  * @param[in] key The attribute key
89  * @param[in] value The new value
90  * @param[in] undoList The undoList on which to register changes
91  */
92  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
93 
94  /* @brief method for checking if the key and their correspond attribute are valids
95  * @param[in] key The attribute key
96  * @param[in] value The value asociated to key key
97  * @return true if the value is valid, false in other case
98  */
99  bool isValid(SumoXMLAttr key, const std::string& value);
100 
102 
103 protected:
106 
108  bool myOnRoad;
109 
111  double myWidth;
112 
114  std::string myLength;
115 
117  double myAngle;
118 
119 private:
121  void setAttribute(SumoXMLAttr key, const std::string& value);
122 
124  GNEParkingArea(const GNEParkingArea&) = delete;
125 
128 };
129 
130 
131 #endif
GNEParkingArea::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEParkingArea.cpp:258
GNEParkingArea::myWidth
double myWidth
width of Parking Area
Definition: GNEParkingArea.h:111
GNEParkingArea::operator=
GNEParkingArea & operator=(const GNEParkingArea &)=delete
Invalidated assignment operator.
GNEParkingArea::myAngle
double myAngle
Angle of Parking Area.
Definition: GNEParkingArea.h:117
GNEParkingArea::~GNEParkingArea
~GNEParkingArea()
Destructor.
Definition: GNEParkingArea.cpp:51
GNEParkingArea::GNEParkingArea
GNEParkingArea(const GNEParkingArea &)=delete
Invalidated copy constructor.
GNEViewNet
Definition: GNEViewNet.h:42
GNEParkingArea::splitEdgeGeometry
void splitEdgeGeometry(const double splitPosition, const GNENetElement *originalElement, const GNENetElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNEParkingArea.cpp:105
GNEParkingArea
A lane area vehicles can park at (netedit-version)
Definition: GNEParkingArea.h:34
GNEParkingArea::myRoadSideCapacity
int myRoadSideCapacity
roadside capacity of Parking Area
Definition: GNEParkingArea.h:105
GNEParkingArea::myOnRoad
bool myOnRoad
Whether vehicles stay on the road.
Definition: GNEParkingArea.h:108
GNEParkingArea::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEParkingArea.cpp:294
GNEStoppingPlace
Definition: GNEStoppingPlace.h:39
GNEParkingArea::myLength
std::string myLength
Length of Parking Area (by default (endPos - startPos) / roadsideCapacity.
Definition: GNEParkingArea.h:114
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNENetElement
Definition: GNENetElement.h:43
GNEParkingArea::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEParkingArea.cpp:111
GNEParkingArea::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEParkingArea.cpp:90
GNEParkingArea::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEParkingArea.cpp:55
GNEStoppingPlace.h
GNEParkingArea::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEParkingArea.cpp:213
GNEParkingArea::GNEParkingArea
GNEParkingArea(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const double startPos, const double endPos, const int parametersSet, const std::string &name, bool friendlyPosition, int roadSideCapacity, bool onRoad, double width, const std::string &length, double angle, bool blockMovement)
Constructor.
Definition: GNEParkingArea.cpp:40
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45