Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/additional/GNEParkingAreaReroute.h
194139 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2026 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 GNEParkingAreaReroute.h
15
/// @author Jakob Erdmann
16
/// @date May 2018
17
///
18
//
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEAdditional.h"
24
#include "GNEAdditionalListed.h"
25
26
// ===========================================================================
27
// class declarations
28
// ===========================================================================
29
30
class GNEEdge;
31
class GNERerouterInterval;
32
class GNERerouterIntervalDialog;
33
class GNEParkingArea;
34
35
// ===========================================================================
36
// class definitions
37
// ===========================================================================
38
39
class GNEParkingAreaReroute : public GNEAdditional, public GNEAdditionalListed {
40
41
public:
42
/// @brief constructor
43
GNEParkingAreaReroute(GNENet* net);
44
45
/// @brief constructor
46
GNEParkingAreaReroute(GNEAdditional* rerouterIntervalParent, GNEAdditional* newParkingArea,
47
const double probability, const bool visible);
48
49
/// @brief destructor
50
~GNEParkingAreaReroute();
51
52
/// @brief methods to retrieve the elements linked to this parkingAreaReroute
53
/// @{
54
55
/// @brief get GNEMoveElement associated with this parkingAreaReroute
56
GNEMoveElement* getMoveElement() const override;
57
58
/// @brief get parameters associated with this parkingAreaReroute
59
Parameterised* getParameters() override;
60
61
/// @brief get parameters associated with this parkingAreaReroute (constant)
62
const Parameterised* getParameters() const override;
63
64
/// @}
65
66
/// @name members and functions relative to write additionals into XML
67
/// @{
68
69
/**@brief write additional element into a xml file
70
* @param[in] device device in which write parameters of additional element
71
*/
72
void writeAdditional(OutputDevice& device) const override;
73
74
/// @brief check if current additional is valid to be written into XML (must be reimplemented in all detector children)
75
bool isAdditionalValid() const override;
76
77
/// @brief return a string with the current additional problem (must be reimplemented in all detector children)
78
std::string getAdditionalProblem() const override;
79
80
/// @brief fix additional problem (must be reimplemented in all detector children)
81
void fixAdditionalProblem() override;
82
83
/// @}
84
85
/// @name Function related with contour drawing
86
/// @{
87
88
/// @brief check if draw move contour (red)
89
bool checkDrawMoveContour() const override;
90
91
/// @}
92
93
/// @name Functions related with geometry of element
94
/// @{
95
96
/// @brief update pre-computed geometry information
97
void updateGeometry() override;
98
99
/// @brief Returns position of additional in view
100
Position getPositionInView() const override;
101
102
/// @brief update centering boundary (implies change in RTREE)
103
void updateCenteringBoundary(const bool updateGrid) override;
104
105
/// @brief split geometry
106
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
107
108
/// @}
109
110
/// @name inherited from GUIGlObject
111
/// @{
112
113
/**@brief Returns the name of the parent object
114
* @return This object's parent id
115
*/
116
std::string getParentName() const override;
117
118
/**@brief Draws the object
119
* @param[in] s The settings for the current view (may influence drawing)
120
* @see GUIGlObject::drawGL
121
*/
122
void drawGL(const GUIVisualizationSettings& s) const override;
123
124
/// @}
125
126
/// @name inherited from GNEAttributeCarrier
127
/// @{
128
129
/* @brief method for getting the Attribute of an XML key
130
* @param[in] key The attribute key
131
* @return string with the value associated to key
132
*/
133
std::string getAttribute(SumoXMLAttr key) const override;
134
135
/* @brief method for getting the Attribute of an XML key in double format
136
* @param[in] key The attribute key
137
* @return double with the value associated to key
138
*/
139
double getAttributeDouble(SumoXMLAttr key) const override;
140
141
/* @brief method for getting the Attribute of an XML key in position format
142
* @param[in] key The attribute key
143
* @return position with the value associated to key
144
*/
145
Position getAttributePosition(SumoXMLAttr key) const override;
146
147
/* @brief method for getting the Attribute of an XML key in positionVector format
148
* @param[in] key The attribute key
149
* @return positionVector with the value associated to key
150
*/
151
PositionVector getAttributePositionVector(SumoXMLAttr key) const override;
152
153
/* @brief method for setting the attribute and letting the object perform additional changes
154
* @param[in] key The attribute key
155
* @param[in] value The new value
156
* @param[in] undoList The undoList on which to register changes
157
*/
158
void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
159
160
/* @brief method for checking if the key and their correspond attribute are valids
161
* @param[in] key The attribute key
162
* @param[in] value The value associated to key key
163
* @return true if the value is valid, false in other case
164
*/
165
bool isValid(SumoXMLAttr key, const std::string& value) override;
166
167
/// @brief get PopPup ID (Used in AC Hierarchy)
168
std::string getPopUpID() const override;
169
170
/// @brief get Hierarchy Name (Used in AC Hierarchy)
171
std::string getHierarchyName() const override;
172
173
/// @}
174
175
protected:
176
/// @brief probability with which a vehicle will use the given edge as destination
177
double myProbability = 0;
178
179
/// @brief enable or disable visibility of Parking Area Reroute
180
bool myVisible = false;
181
182
private:
183
/// @brief set attribute after validation
184
void setAttribute(SumoXMLAttr key, const std::string& value) override;
185
186
/// @brief Invalidated copy constructor.
187
GNEParkingAreaReroute(const GNEParkingAreaReroute&) = delete;
188
189
/// @brief Invalidated assignment operator.
190
GNEParkingAreaReroute& operator=(const GNEParkingAreaReroute&) = delete;
191
};
192
193