SUMO - Simulation of Urban MObility
GNEBusStop.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 class for visualizing busStop geometry (adapted from GUILaneWrapper)
18 /****************************************************************************/
19 #ifndef GNEBusStop_h
20 #define GNEBusStop_h
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <string>
33 #include <vector>
37 #include "GNEAttributeCarrier.h"
38 #include "GNEStoppingPlace.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
44 
49 class GNEBusStop : public GNEStoppingPlace {
50 
51 public:
62  GNEBusStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double startPos, double endPos, const std::string& name, const std::vector<std::string>& lines, bool friendlyPosition);
63 
65  ~GNEBusStop();
66 
70  void writeAdditional(OutputDevice& device) const;
71 
73  const std::vector<std::string>& getLines() const;
74 
78  void updateGeometry();
80 
83 
87  void drawGL(const GUIVisualizationSettings& s) const;
89 
92  /* @brief method for getting the Attribute of an XML key
93  * @param[in] key The attribute key
94  * @return string with the value associated to key
95  */
96  std::string getAttribute(SumoXMLAttr key) const;
97 
98  /* @brief method for setting the attribute and letting the object perform additional changes
99  * @param[in] key The attribute key
100  * @param[in] value The new value
101  * @param[in] undoList The undoList on which to register changes
102  */
103  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
104 
105  /* @brief method for checking if the key and their correspond attribute are valids
106  * @param[in] key The attribute key
107  * @param[in] value The value asociated to key key
108  * @return true if the value is valid, false in other case
109  */
110  bool isValid(SumoXMLAttr key, const std::string& value);
112 
113 protected:
115  std::vector<std::string> myLines;
116 
117 private:
119  void setAttribute(SumoXMLAttr key, const std::string& value);
120 
122  GNEBusStop(const GNEBusStop&);
123 
126 };
127 
128 
129 #endif
Stores the information about how to visualize structures.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
Definition: GNEBusStop.cpp:100
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
Definition: GNEBusStop.cpp:268
A lane area vehicles can halt at (netedit-version)
Definition: GNEBusStop.h:49
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNEBusStop.h:115
~GNEBusStop()
Destructor.
Definition: GNEBusStop.cpp:68
const std::vector< std::string > & getLines() const
get string vector with the lines of the busStop
Definition: GNEBusStop.cpp:120
GNEBusStop & operator=(const GNEBusStop &)
Invalidated assignment operator.
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
Definition: GNEBusStop.cpp:243
void updateGeometry()
update pre-computed geometry information
Definition: GNEBusStop.cpp:72
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double startPos, double endPos, const std::string &name, const std::vector< std::string > &lines, bool friendlyPosition)
Constructor.
Definition: GNEBusStop.cpp:62
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEBusStop.cpp:290
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEBusStop.cpp:126
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70