SUMO - Simulation of Urban MObility
GNEStoppingPlace.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 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:
61  GNEStoppingPlace(const std::string& id, GNEViewNet* viewNet, SumoXMLTag tag, GNELane* lane, SUMOReal startPos, SUMOReal endPos, bool blocked = false);
62 
65 
67  virtual void updateGeometry() = 0;
68 
71 
77  void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList* undoList);
78 
83  virtual void writeAdditional(OutputDevice& device, const std::string& currentDirectory) = 0;
84 
86  GNELane* getLane() const;
87 
90  void removeLaneReference();
91 
93  void changeLane(GNELane* newLane);
94 
96  SUMOReal getStartPosition() const;
97 
99  SUMOReal getEndPosition() const;
100 
105  void setStartPosition(SUMOReal startPos);
106 
111  void setEndPosition(SUMOReal endPos);
112 
117  const std::string& getParentName() const;
118 
123  virtual void drawGL(const GUIVisualizationSettings& s) const = 0;
125 
128  /* @brief method for getting the Attribute of an XML key
129  * @param[in] key The attribute key
130  * @return string with the value associated to key
131  */
132  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
133 
134  /* @brief method for setting the attribute and letting the object perform additional changes
135  * @param[in] key The attribute key
136  * @param[in] value The new value
137  * @param[in] undoList The undoList on which to register changes
138  */
139  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
140 
141  /* @brief method for checking if the key and their conrrespond attribute are valids
142  * @param[in] key The attribute key
143  * @param[in] value The value asociated to key key
144  * @return true if the value is valid, false in other case
145  */
146  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
148 
149 protected:
152 
155 
158 
161 
164 
167 
170 
173 
174 private:
176  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
177 
179  void setPosition(const Position& pos);
180 };
181 
182 
183 #endif
SumoXMLTag
Numbers representing SUMO-XML - element names.
SUMOReal getStartPosition() const
Returns the Start position of the stoppingPlace.
void setStartPosition(SUMOReal startPos)
Set a new Start position in StoppingPlace.
void setPosition(const Position &pos)
Invalidate set new position in the view.
Stores the information about how to visualize structures.
void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList *undoList)
change the position of the StoppingPlace geometry
RGBColor myTextColorSelected
Text color selected (Default blue)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:86
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
SUMOReal myEndPos
The end position this stopping place is located at.
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
virtual std::string getAttribute(SumoXMLAttr key) const =0
RGBColor mySignColor
sign color (Default yellow)
A list of positions.
GNELane * myLane
The lane this stopping place belongs.
RGBColor myTextColor
Text color (Default cyan)
SUMOReal myStartPos
The start position this stopping place is located at.
~GNEStoppingPlace()
Destructor.
GNELane * getLane() const
Returns pointer to Lane of stopping place.
void setEndPosition(SUMOReal endPos)
Set a new End position in StoppingPlace.
GNEStoppingPlace(const std::string &id, GNEViewNet *viewNet, SumoXMLTag tag, GNELane *lane, SUMOReal startPos, SUMOReal endPos, bool blocked=false)
Constructor.
virtual void writeAdditional(OutputDevice &device, const std::string &currentDirectory)=0
writte additional element into a xml file
void changeLane(GNELane *newLane)
change lane of stopping place
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
virtual void updateGeometry()=0
update pre-computed geometry information
The popup menu of a globject.
void removeLaneReference()
Remove reference to Lane of stopping place.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
const std::string & getParentName() const
Returns the name of the parent object (if any)
Position mySignPos
The position of the sign.
Position getPositionInView() const
Returns position of StoppingPlace in view.
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
SUMOReal getEndPosition() const
Returns the End position of the stoppingPlace.
virtual void drawGL(const GUIVisualizationSettings &s) const =0
Draws the object.
RGBColor mySignColorSelected
sign selected color (Default blue)