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