Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/additional/GNEContainerStop.h
169684 views
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
/****************************************************************************/
14
/// @file GNEContainerStop.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jun 2016
17
///
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
29
class GNEContainerStop : public GNEStoppingPlace {
30
31
public:
32
/// @brief default constructor
33
GNEContainerStop(GNENet* net);
34
35
/**@brief Constructor
36
* @param[in] id containerStop ID
37
* @param[in] net pointer to GNENet of this additional element belongs
38
* @param[in] filename file in which this element is stored
39
* @param[in] lane Lane of this StoppingPlace belongs
40
* @param[in] startPos Start position of the StoppingPlace
41
* @param[in] endPos End position of the StoppingPlace
42
* @param[in] name Name of busStop
43
* @param[in] lines lines of the busStop
44
* @param[in] containerCapacity larger numbers of containers trying to enter will create an upstream jam on the sidewalk.
45
* @param[in] parkingLength parking length
46
* @param[in] color containerStop color
47
* @param[in] friendlyPos enable or disable friendly position
48
* @param[in] angle container stop angle
49
* @param[in] parameters generic parameters
50
*/
51
GNEContainerStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,
52
const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,
53
const int containerCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,
54
const double angle, const Parameterised::Map& parameters);
55
56
/// @brief Destructor
57
~GNEContainerStop();
58
59
/**@brief write additional element into a xml file
60
* @param[in] device device in which write parameters of additional element
61
*/
62
void writeAdditional(OutputDevice& device) const;
63
64
/// @name Functions related with geometry of element
65
/// @{
66
67
/// @brief update pre-computed geometry information
68
void updateGeometry();
69
70
/// @}
71
72
/// @name inherited from GUIGlObject
73
/// @{
74
/**@brief Draws the object
75
* @param[in] s The settings for the current view (may influence drawing)
76
* @see GUIGlObject::drawGL
77
*/
78
void drawGL(const GUIVisualizationSettings& s) const;
79
80
/// @}
81
82
/// @name inherited from GNEAttributeCarrier
83
/// @{
84
85
/* @brief method for getting the Attribute of an XML key
86
* @param[in] key The attribute key
87
* @return string with the value associated to key
88
*/
89
std::string getAttribute(SumoXMLAttr key) const;
90
91
/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
92
* @param[in] key The attribute key
93
* @return double with the value associated to key
94
*/
95
double getAttributeDouble(SumoXMLAttr key) const;
96
97
/* @brief method for setting the attribute and letting the object perform additional changes
98
* @param[in] key The attribute key
99
* @param[in] value The new value
100
* @param[in] undoList The undoList on which to register changes
101
*/
102
void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
103
104
/* @brief method for checking if the key and their correspond attribute are valids
105
* @param[in] key The attribute key
106
* @param[in] value The value associated to key key
107
* @return true if the value is valid, false in other case
108
*/
109
bool isValid(SumoXMLAttr key, const std::string& value);
110
111
/// @}
112
113
protected:
114
/// @brief The list of lines that are assigned to this stop
115
std::vector<std::string> myLines;
116
117
/// @brief maximum number of container that can wait at this stop
118
int myContainerCapacity;
119
120
/// @brief custom space for vehicles that park at this stop
121
double myParkingLength;
122
123
private:
124
/// @brief set attribute after validation
125
void setAttribute(SumoXMLAttr key, const std::string& value);
126
127
/// @brief Invalidated copy constructor.
128
GNEContainerStop(const GNEContainerStop&) = delete;
129
130
/// @brief Invalidated assignment operator.
131
GNEContainerStop& operator=(const GNEContainerStop&) = delete;
132
};
133
134