SUMO - Simulation of Urban MObility
GNEBusStop.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // A class for visualizing busStop geometry (adapted from GUILaneWrapper)
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 GNEBusStop_h
21 #define GNEBusStop_h
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <vector>
38 #include "GNEAttributeCarrier.h"
39 #include "GNEStoppingPlace.h"
40 
41 // ===========================================================================
42 // class declarations
43 // ===========================================================================
44 
46 class PositionVector;
47 class GNELane;
48 class GNENet;
49 
50 // ===========================================================================
51 // class definitions
52 // ===========================================================================
53 
58 class GNEBusStop : public GNEStoppingPlace {
59 public:
70  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);
71 
73  ~GNEBusStop();
74 
79  void writeAdditional(OutputDevice& device, bool volatileOptionsEnabled) const;
80 
82  const std::vector<std::string>& getLines() const;
83 
87  void updateGeometry();
89 
92 
96  void drawGL(const GUIVisualizationSettings& s) const;
98 
101  /* @brief method for getting the Attribute of an XML key
102  * @param[in] key The attribute key
103  * @return string with the value associated to key
104  */
105  std::string getAttribute(SumoXMLAttr key) const;
106 
107  /* @brief method for setting the attribute and letting the object perform additional changes
108  * @param[in] key The attribute key
109  * @param[in] value The new value
110  * @param[in] undoList The undoList on which to register changes
111  */
112  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
113 
114  /* @brief method for checking if the key and their correspond attribute are valids
115  * @param[in] key The attribute key
116  * @param[in] value The value asociated to key key
117  * @return true if the value is valid, false in other case
118  */
119  bool isValid(SumoXMLAttr key, const std::string& value);
121 
122 protected:
124  std::vector<std::string> myLines;
125 
126 private:
128  void setAttribute(SumoXMLAttr key, const std::string& value);
129 
131  GNEBusStop(const GNEBusStop&);
132 
135 };
136 
137 
138 #endif
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in allGNEAttributeCarrier.
Definition: GNEBusStop.cpp:277
Stores the information about how to visualize structures.
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
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
const std::vector< std::string > & getLines() const
get string vector with the lines of the busStop
Definition: GNEBusStop.cpp:137
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEBusStop.cpp:143
A list of positions.
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:302
void writeAdditional(OutputDevice &device, bool volatileOptionsEnabled) const
writte additional element into a xml file
Definition: GNEBusStop.cpp:104
A lane area vehicles can halt at (netedit-version)
Definition: GNEBusStop.h:58
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNEBusStop.h:124
~GNEBusStop()
Destructor.
Definition: GNEBusStop.cpp:72
GNEBusStop & operator=(const GNEBusStop &)
Invalidated assignment operator.
void updateGeometry()
update pre-computed geometry information
Definition: GNEBusStop.cpp:76
The popup menu of a globject.
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:64
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEBusStop.cpp:325
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71