SUMO - Simulation of Urban MObility
GNEStoppingPlace.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A abstract class to define common parameters of lane area in which vehicles can halt (GNE version)
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEStoppingPlace_h
21 #define GNEStoppingPlace_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEAdditional.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 
40 class PositionVector;
41 class GNENet;
42 
43 // ===========================================================================
44 // class definitions
45 // ===========================================================================
51 public:
63  GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, SumoXMLTag tag, GUIIcon icon, GNELane* lane, double startPos, double endPos, const std::string& name, bool friendlyPosition);
64 
67 
73  virtual void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const = 0;
74 
76  double getAbsoluteStartPosition() const;
77 
79  double getAbsoluteEndPosition() const;
80 
83 
86 
90  void moveGeometry(const Position& newPosition);
91 
96  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
97 
99  virtual void updateGeometry() = 0;
100 
102  Position getPositionInView() const;
104 
109  const std::string& getParentName() const;
110 
115  virtual void drawGL(const GUIVisualizationSettings& s) const = 0;
117 
120  /* @brief method for getting the Attribute of an XML key
121  * @param[in] key The attribute key
122  * @return string with the value associated to key
123  */
124  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
125 
126  /* @brief method for setting the attribute and letting the object perform additional changes
127  * @param[in] key The attribute key
128  * @param[in] value The new value
129  * @param[in] undoList The undoList on which to register changes
130  */
131  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
132 
133  /* @brief method for checking if the key and their conrrespond attribute are valids
134  * @param[in] key The attribute key
135  * @param[in] value The value asociated to key key
136  * @return true if the value is valid, false in other case
137  */
138  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
140 
141 protected:
144 
147 
149  std::string myName;
150 
153 
156 
159 
160 private:
162  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
163 
165  void setPosition(const Position& pos);
166 };
167 
168 
169 #endif
bool areStoppingPlacesPositionsFixed() const
check if Position of stoppingPlace are fixed
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(...)
void setPosition(const Position &pos)
Invalidate set new position in the view.
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:43
GNEStoppingPlace(const std::string &id, GNEViewNet *viewNet, SumoXMLTag tag, GUIIcon icon, GNELane *lane, double startPos, double endPos, const std::string &name, bool friendlyPosition)
Constructor.
double getAbsoluteStartPosition() const
get absolute start Position
Stores the information about how to visualize structures.
void moveGeometry(const Position &newPosition)
change the position of the element geometry without saving in undoList
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:92
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
bool myFriendlyPosition
Flag for friendly position.
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 ...
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
~GNEStoppingPlace()
Destructor.
std::string myName
name of stoppingPlace
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:62
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
The popup menu of a globject.
void setStoppingPlaceGeometry()
set geometry common to all stopping places
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in allGNEAttributeCarrier.
const std::string & getParentName() const
Returns the name of the parent object (if any)
double getAbsoluteEndPosition() const
get absolute end Position
Position mySignPos
The position of the sign.
virtual void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const =0
writte additional element into a xml file
Position getPositionInView() const
Returns position of additional in view.
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
method for checking if the key and their conrrespond attribute are valids