Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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
54 static GNEBusStop* buildBusStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
55 const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
56 const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
57 const double angle, const Parameterised::Map& parameters);
58
75 static GNEBusStop* buildTrainStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
76 const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
77 const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
78 const double angle, const Parameterised::Map& parameters);
79
82
86 void writeAdditional(OutputDevice& device) const;
87
90
92 void updateGeometry() override;
93
95
98
102 void drawGL(const GUIVisualizationSettings& s) const;
103
105
108
109 /* @brief method for getting the Attribute of an XML key
110 * @param[in] key The attribute key
111 * @return string with the value associated to key
112 */
113 std::string getAttribute(SumoXMLAttr key) const override;
114
115 /* @brief method for getting the Attribute of an XML key in double format
116 * @param[in] key The attribute key
117 * @return double with the value associated to key
118 */
119 double getAttributeDouble(SumoXMLAttr key) const override;
120
121 /* @brief method for setting the attribute and letting the object perform additional changes
122 * @param[in] key The attribute key
123 * @param[in] value The new value
124 * @param[in] undoList The undoList on which to register changes
125 */
126 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
127
128 /* @brief method for checking if the key and their correspond attribute are valids
129 * @param[in] key The attribute key
130 * @param[in] value The value associated to key key
131 * @return true if the value is valid, false in other case
132 */
133 bool isValid(SumoXMLAttr key, const std::string& value) override;
134
136
137protected:
139 std::vector<std::string> myLines;
140
143
145 double myParkingLength = 0;
146
147private:
149 void setAttribute(SumoXMLAttr key, const std::string& value) override;
150
152 GNEBusStop(SumoXMLTag tag, GNENet* net);
153
171 GNEBusStop(SumoXMLTag tag, const std::string& id, GNENet* net, const std::string& filename,
172 GNELane* lane, const double startPos, const double endPos, const std::string& name,
173 const std::vector<std::string>& lines, const int personCapacity, const double parkingLength,
174 const RGBColor& color, const bool friendlyPosition, const double angle,
175 const Parameterised::Map& parameters);
176
178 GNEBusStop(const GNEBusStop&) = delete;
179
181 GNEBusStop& operator=(const GNEBusStop&) = delete;
182};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
double getAttributeDouble(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
static GNEBusStop * buildTrainStop(GNENet *net)
default constructor
std::string getAttribute(SumoXMLAttr key) const override
GNEBusStop(const GNEBusStop &)=delete
Invalidated copy constructor.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
double myParkingLength
custom space for vehicles that park at this stop
Definition GNEBusStop.h:145
bool isValid(SumoXMLAttr key, const std::string &value) override
void updateGeometry() override
update pre-computed geometry information
std::vector< std::string > myLines
The list of lines that are assigned to this stop.
Definition GNEBusStop.h:139
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:142
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