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