SUMO - Simulation of Urban MObility
GNEStoppingPlace.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 abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
16 /****************************************************************************/
17 #ifndef GNEStoppingPlace_h
18 #define GNEStoppingPlace_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include "GNEAdditional.h"
27 
28 
29 // ===========================================================================
30 // class definitions
31 // ===========================================================================
37 
38 public:
51  GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, GUIGlObjectType type, SumoXMLTag tag, GNELane* lane, const std::string& startPos, const std::string& endPos, const std::string& name, bool friendlyPosition, bool blockMovement);
52 
55 
57  GNELane* getLane() const;
58 
60  double getStartPosition() const;
61 
63  double getEndPosition() const;
64 
67 
70 
74  void moveGeometry(const Position& oldPos, const Position& offset);
75 
80  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
81 
83  virtual void updateGeometry(bool updateGrid) = 0;
84 
88 
93  std::string getParentName() const;
94 
99  virtual void drawGL(const GUIVisualizationSettings& s) const = 0;
101 
104  /* @brief method for getting the Attribute of an XML key
105  * @param[in] key The attribute key
106  * @return string with the value associated to key
107  */
108  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
109 
110  /* @brief method for setting the attribute and letting the object perform additional changes
111  * @param[in] key The attribute key
112  * @param[in] value The new value
113  * @param[in] undoList The undoList on which to register changes
114  */
115  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
116 
117  /* @brief method for checking if the key and their conrrespond attribute are valids
118  * @param[in] key The attribute key
119  * @param[in] value The value asociated to key key
120  * @return true if the value is valid, false in other case
121  */
122  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
123 
125  std::string getPopUpID() const;
126 
128  std::string getHierarchyName() const;
130 
131 protected:
134 
136  std::string myStartPosition;
137 
139  std::string myEndPosition;
140 
143 
146 
148  void setStoppingPlaceGeometry(double movingToSide);
149 
151  static const double myCircleWidth;
152 
154  static const double myCircleWidthSquared;
155 
157  static const double myCircleInWidth;
158 
160  static const double myCircleInText;
161 
162 private:
164  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
165 
167  void setPosition(const Position& pos) = delete;
168 };
169 
170 
171 #endif
SumoXMLTag
Numbers representing SUMO-XML - element names.
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
bool areStoppingPlacesPositionsFixed() const
check if Position of stoppingPlace are fixed
GUIGlObjectType
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Stores the information about how to visualize structures.
static const double myCircleWidthSquared
squared circle width resolution for all stopping places
static const double myCircleInWidth
inner circle width resolution for all stopping places
Position getPositionInView() const
Returns position of additional in view.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:47
bool myFriendlyPosition
Flag for friendly position.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
std::string myStartPosition
The relative start position this stopping place is located at (optional, if empty takes 0) ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static const double myCircleInText
text inner circle width resolution for all stopping places
std::string getParentName() const
Returns the name of the parent object (if any)
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
method for setting the attribute and letting the object perform additional changes ...
GNELane * getLane() const
get Lane
double getEndPosition() const
get end Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNELane * myLane
The lane in which this lane is placed.
GNEStoppingPlace(const std::string &id, GNEViewNet *viewNet, GUIGlObjectType type, SumoXMLTag tag, GNELane *lane, const std::string &startPos, const std::string &endPos, const std::string &name, bool friendlyPosition, bool blockMovement)
Constructor.
~GNEStoppingPlace()
Destructor.
static const double myCircleWidth
circle width resolution for all stopping places
double getStartPosition() const
get start Position
void setStoppingPlaceGeometry(double movingToSide)
set geometry common to all stopping places
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:53
virtual void updateGeometry(bool updateGrid)=0
update pre-computed geometry information
std::string myEndPosition
The position this stopping place is located at (optional, if empty takes the lane lenght) ...
Position mySignPos
The position of the sign.
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
void setPosition(const Position &pos)=delete
Invalidate set new position in the view.