SUMO - Simulation of Urban MObility
GNEParkingSpace.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-2018 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 /****************************************************************************/
15 // A class for visualizing ParkingSpace geometry (adapted from GUILaneWrapper)
16 /****************************************************************************/
17 #ifndef GNEParkingSpace_h
18 #define GNEParkingSpace_h
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 
24 #include <config.h>
25 
26 #include <string>
27 #include <vector>
32 #include "GNEAdditional.h"
33 
34 // ===========================================================================
35 // class declarations
36 // ===========================================================================
37 class GNEParkingArea;
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
42 
48 
49 public:
61  GNEParkingSpace(GNEViewNet* viewNet, GNEAdditional* parkingAreaParent, double x, double y, double z, double width, double length, double angle, bool blockMovement);
62 
65 
68 
72  void moveGeometry(const Position& oldPos, const Position& offset);
73 
78  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
79 
81  void updateGeometry(bool updateGrid);
82 
86 
91  std::string getParentName() const;
92 
97  void drawGL(const GUIVisualizationSettings& s) const;
99 
102  /* @brief method for getting the Attribute of an XML key
103  * @param[in] key The attribute key
104  * @return string with the value associated to key
105  */
106  std::string getAttribute(SumoXMLAttr key) const;
107 
108  /* @brief method for setting the attribute and letting the object perform additional changes
109  * @param[in] key The attribute key
110  * @param[in] value The new value
111  * @param[in] undoList The undoList on which to register changes
112  */
113  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
114 
115  /* @brief method for checking if the key and their correspond attribute are valids
116  * @param[in] key The attribute key
117  * @param[in] value The value asociated to key key
118  * @return true if the value is valid, false in other case
119  */
120  bool isValid(SumoXMLAttr key, const std::string& value);
121 
123  std::string getPopUpID() const;
124 
126  std::string getHierarchyName() const;
128 
129 protected:
131  double myX;
132 
134  double myY;
135 
137  double myZ;
138 
140  double myWidth;
141 
143  double myLength;
144 
146  double myAngle;
147 
148 private:
150  void setAttribute(SumoXMLAttr key, const std::string& value);
151 
153  GNEParkingSpace(const GNEParkingSpace&) = delete;
154 
156  GNEParkingSpace& operator=(const GNEParkingSpace&) = delete;
157 };
158 
159 
160 #endif
std::string getAttribute(SumoXMLAttr key) const
vehicle space used by GNEParkingAreas
double myY
y position of Parking Space
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Stores the information about how to visualize structures.
double myLength
Lenght of Parking Space.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
double myX
x position of Parking Space
GNEParkingSpace & operator=(const GNEParkingSpace &)=delete
Invalidated assignment operator.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
A lane area vehicles can park at (netedit-version)
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
GNEParkingSpace(GNEViewNet *viewNet, GNEAdditional *parkingAreaParent, double x, double y, double z, double width, double length, double angle, bool blockMovement)
Constructor.
double myWidth
width of Parking Space
Position getPositionInView() const
Returns position of additional in view.
double myAngle
Angle of Parking Space.
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myZ
z position of Parking Space
std::string getParentName() const
Returns the name of the parent object (if any)
~GNEParkingSpace()
Destructor.