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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // A abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
18 /****************************************************************************/
19 #ifndef GNEStoppingPlace_h
20 #define GNEStoppingPlace_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEAdditional.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
43 
44 public:
56  GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, SumoXMLTag tag, GUIIcon icon, GNELane* lane, double startPos, double endPos, const std::string& name, bool friendlyPosition);
57 
60 
64  virtual void writeAdditional(OutputDevice& device) const = 0;
65 
67  GNELane* getLane() const;
68 
70  double getAbsoluteStartPosition() const;
71 
73  double getAbsoluteEndPosition() const;
74 
77 
80 
84  void moveGeometry(const Position& oldPos, const Position& offset);
85 
90  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
91 
93  virtual void updateGeometry() = 0;
94 
98 
103  const std::string& getParentName() const;
104 
109  virtual void drawGL(const GUIVisualizationSettings& s) const = 0;
111 
114  /* @brief method for getting the Attribute of an XML key
115  * @param[in] key The attribute key
116  * @return string with the value associated to key
117  */
118  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
119 
120  /* @brief method for setting the attribute and letting the object perform additional changes
121  * @param[in] key The attribute key
122  * @param[in] value The new value
123  * @param[in] undoList The undoList on which to register changes
124  */
125  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
126 
127  /* @brief method for checking if the key and their conrrespond attribute are valids
128  * @param[in] key The attribute key
129  * @param[in] value The value asociated to key key
130  * @return true if the value is valid, false in other case
131  */
132  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
134 
135 protected:
138 
141 
144 
146  std::string myName;
147 
150 
153 
156 
157 private:
159  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
160 
162  void setPosition(const Position& pos) = delete;
163 };
164 
165 
166 #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
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:42
GNEStoppingPlace(const std::string &id, GNEViewNet *viewNet, SumoXMLTag tag, GUIIcon icon, GNELane *lane, double startPos, double endPos, const std::string &name, bool friendlyPosition)
Constructor.
Stores the information about how to visualize structures.
Position getPositionInView() const
Returns position of additional in view.
double getAbsoluteEndPosition() const
get absolute end Position
virtual void writeAdditional(OutputDevice &device) const =0
writte additional element into a xml file
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
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
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in all GNEAttributeCarriers.
GNELane * myLane
The lane in which this lane is placed.
const std::string & getParentName() const
Returns the name of the parent object (if any)
~GNEStoppingPlace()
Destructor.
std::string myName
name of stoppingPlace
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
double myEndPosRelative
The relative [0,1] end position this stopping place is located at.
double myStartPosRelative
The relative [0,1] start position this stopping place is located at.
virtual void updateGeometry()=0
update pre-computed geometry information
void setStoppingPlaceGeometry()
set geometry common to all stopping places
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
Position mySignPos
The position of the sign.
double getAbsoluteStartPosition() const
get absolute start Position
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.