Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A class for visualizing busStop geometry (adapted from GUILaneWrapper)
15 /****************************************************************************/
16 #ifndef GNEBusStop_h
17 #define GNEBusStop_h
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 
23 #include "GNEStoppingPlace.h"
24 
25 
26 // ===========================================================================
27 // class definitions
28 // ===========================================================================
29 
34 class GNEBusStop : public GNEStoppingPlace {
35 
36 public:
48  GNEBusStop(const std::string& id, GNELane* lane, GNEViewNet* viewNet, const double startPos, const double endPos, const int parametersSet,
49  const std::string& name, const std::vector<std::string>& lines, int personCapacity, bool friendlyPosition, bool blockMovement);
50 
52  ~GNEBusStop();
53 
57  void updateGeometry();
58 
62 
65 
69  void drawGL(const GUIVisualizationSettings& s) const;
71 
74  /* @brief method for getting the Attribute of an XML key
75  * @param[in] key The attribute key
76  * @return string with the value associated to key
77  */
78  std::string getAttribute(SumoXMLAttr key) const;
79 
80  /* @brief method for setting the attribute and letting the object perform additional changes
81  * @param[in] key The attribute key
82  * @param[in] value The new value
83  * @param[in] undoList The undoList on which to register changes
84  */
85  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
86 
87  /* @brief method for checking if the key and their correspond attribute are valids
88  * @param[in] key The attribute key
89  * @param[in] value The value asociated to key key
90  * @return true if the value is valid, false in other case
91  */
92  bool isValid(SumoXMLAttr key, const std::string& value);
93 
95 
96 protected:
98  std::vector<std::string> myLines;
99 
102 
103 private:
105  void setAttribute(SumoXMLAttr key, const std::string& value);
106 
108  GNEBusStop(const GNEBusStop&) = delete;
109 
111  GNEBusStop& operator=(const GNEBusStop&) = delete;
112 };
113 
114 
115 #endif
GNEBusStop::GNEBusStop
GNEBusStop(const std::string &id, GNELane *lane, GNEViewNet *viewNet, const double startPos, const double endPos, const int parametersSet, const std::string &name, const std::vector< std::string > &lines, int personCapacity, bool friendlyPosition, bool blockMovement)
Constructor.
Definition: GNEBusStop.cpp:41
GNEBusStop::setAttribute
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:267
GNEViewNet
Definition: GNEViewNet.h:42
GNEBusStop::~GNEBusStop
~GNEBusStop()
Destructor.
Definition: GNEBusStop.cpp:49
GNEStoppingPlace
Definition: GNEStoppingPlace.h:39
GNEBusStop::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEBusStop.cpp:300
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEBusStop::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEBusStop.cpp:104
GNEBusStop::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEBusStop.cpp:98
GNEBusStop
A lane area vehicles can halt at (netedit-version)
Definition: GNEBusStop.h:34
GNEBusStop::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEBusStop.cpp:53
GNEBusStop::operator=
GNEBusStop & operator=(const GNEBusStop &)=delete
Invalidated assignment operator.
GNEBusStop::myLines
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition: GNEBusStop.h:98
GNEStoppingPlace.h
GNEBusStop::GNEBusStop
GNEBusStop(const GNEBusStop &)=delete
Invalidated copy constructor.
GNEBusStop::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEBusStop.cpp:228
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GNEBusStop::myPersonCapacity
int myPersonCapacity
maximum number of persons that can wait at this stop
Definition: GNEBusStop.h:101