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