Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
GNEBusStop.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A class for visualizing busStop geometry (adapted from GUILaneWrapper)
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEStoppingPlace.h"
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
28
30
31public:
33 static GNEBusStop* buildBusStop(GNENet* net);
34
36 static GNEBusStop* buildTrainStop(GNENet* net);
37
53 static GNEBusStop* buildBusStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
54 const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
55 int personCapacity, double parkingLength, const RGBColor& color, bool friendlyPosition,
56 const Parameterised::Map& parameters);
57
73 static GNEBusStop* buildTrainStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
74 const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
75 int personCapacity, double parkingLength, const RGBColor& color, bool friendlyPosition,
76 const Parameterised::Map& parameters);
77
80
84 void writeAdditional(OutputDevice& device) const;
85
88
90 void updateGeometry();
91
93
96
100 void drawGL(const GUIVisualizationSettings& s) const;
101
103
106
107 /* @brief method for getting the Attribute of an XML key
108 * @param[in] key The attribute key
109 * @return string with the value associated to key
110 */
111 std::string getAttribute(SumoXMLAttr key) const;
112
113 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
114 * @param[in] key The attribute key
115 * @return double with the value associated to key
116 */
117 double getAttributeDouble(SumoXMLAttr key) const;
118
119 /* @brief method for setting the attribute and letting the object perform additional changes
120 * @param[in] key The attribute key
121 * @param[in] value The new value
122 * @param[in] undoList The undoList on which to register changes
123 */
124 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
125
126 /* @brief method for checking if the key and their correspond attribute are valids
127 * @param[in] key The attribute key
128 * @param[in] value The value associated to key key
129 * @return true if the value is valid, false in other case
130 */
131 bool isValid(SumoXMLAttr key, const std::string& value);
132
134
135protected:
137 std::vector<std::string> myLines;
138
141
143 double myParkingLength = 0;
144
145private:
147 void setAttribute(SumoXMLAttr key, const std::string& value);
148
150 GNEBusStop(SumoXMLTag tag, GNENet* net);
151
168 GNEBusStop(SumoXMLTag tag, const std::string& id, GNENet* net, const std::string& filename,
169 GNELane* lane, const double startPos, const double endPos, const std::string& name,
170 const std::vector<std::string>& lines, int personCapacity, double parkingLength,
171 const RGBColor& color, bool friendlyPosition, const Parameterised::Map& parameters);
172
174 GNEBusStop(const GNEBusStop&) = delete;
175
177 GNEBusStop& operator=(const GNEBusStop&) = delete;
178};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
static GNEBusStop * buildTrainStop(GNENet *net)
default constructor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
std::string getAttribute(SumoXMLAttr key) const
void updateGeometry()
update pre-computed geometry information
GNEBusStop(const GNEBusStop &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
double getAttributeDouble(SumoXMLAttr key) const
double myParkingLength
custom space for vehicles that park at this stop
Definition GNEBusStop.h:143
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition GNEBusStop.h:137
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEBusStop & operator=(const GNEBusStop &)=delete
Invalidated assignment operator.
~GNEBusStop()
Destructor.
static GNEBusStop * buildBusStop(GNENet *net)
default constructor
int myPersonCapacity
maximum number of persons that can wait at this stop
Definition GNEBusStop.h:140
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map