Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/dialogs/fix/GNEFixNetworkElements.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 GNEFixNetworkElements.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jun 2022
17
///
18
// Dialog used to fix network elements during saving
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEFixElementsDialog.h"
24
25
// ===========================================================================
26
// class declarations
27
// ===========================================================================
28
29
class GNENetworkElement;
30
31
// ===========================================================================
32
// class definitions
33
// ===========================================================================
34
35
class GNEFixNetworkElements : public GNEFixElementsDialog<GNENetworkElement*> {
36
37
public:
38
/// @brief groupbox for all radio buttons related with fix edges options
39
class FixEdgeOptions : public GNEFixElementsDialog::FixOptions {
40
/// @brief FOX-declaration
41
FXDECLARE(FixEdgeOptions)
42
43
public:
44
/// @brief constructor
45
FixEdgeOptions(GNEFixNetworkElements* fixNetworkElementsParent);
46
47
/// @brief select internal test solution
48
void selectInternalTestSolution(const std::string& solution);
49
50
/// @brief apply selected fix option
51
bool applyFixOption();
52
53
/// @name FOX-callbacks
54
/// @{
55
56
/// @brief called when user select a option
57
long onCmdSelectOption(FXObject* obj, FXSelector, void*);
58
59
/// @}
60
61
protected:
62
/// @brief FOX needs this
63
FOX_CONSTRUCTOR(FixEdgeOptions)
64
65
/// @brief Option "Remove invalid edges"
66
FXRadioButton* myRemoveInvalidEdges = nullptr;
67
68
/// @brief Option "Save invalid edges"
69
FXRadioButton* mySaveInvalidEdges = nullptr;
70
71
/// @brief Option "Select invalid edges and cancel"
72
FXRadioButton* mySelectInvalidEdges = nullptr;
73
74
private:
75
/// @brief Invalidated copy constructor.
76
FixEdgeOptions(const FixEdgeOptions&) = delete;
77
78
/// @brief Invalidated assignment operator.
79
FixEdgeOptions& operator=(const FixEdgeOptions&) = delete;
80
};
81
82
/// @brief groupbox for all radio buttons related with fix crossing options
83
class FixCrossingOptions : public GNEFixElementsDialog::FixOptions {
84
/// @brief FOX-declaration
85
FXDECLARE(FixCrossingOptions)
86
87
public:
88
/// @brief constructor
89
FixCrossingOptions(GNEFixNetworkElements* fixNetworkElementsParent);
90
91
/// @brief select internal test solution
92
void selectInternalTestSolution(const std::string& solution);
93
94
/// @brief apply selected fix option
95
bool applyFixOption();
96
97
/// @name FOX-callbacks
98
/// @{
99
100
/// @brief called when user select a option
101
long onCmdSelectOption(FXObject* obj, FXSelector, void*);
102
103
/// @}
104
105
protected:
106
/// @brief FOX needs this
107
FOX_CONSTRUCTOR(FixCrossingOptions)
108
109
/// @brief Option "remove invalid elements"
110
FXRadioButton* myRemoveInvalidCrossings = nullptr;
111
112
/// @brief Option "save invalid crossings"
113
FXRadioButton* mySaveInvalidCrossings = nullptr;
114
115
/// @brief Option "Select invalid crossings and cancel"
116
FXRadioButton* mySelectInvalidCrossings = nullptr;
117
118
private:
119
/// @brief Invalidated copy constructor.
120
FixCrossingOptions(const FixCrossingOptions&) = delete;
121
122
/// @brief Invalidated assignment operator.
123
FixCrossingOptions& operator=(const FixCrossingOptions&) = delete;
124
};
125
126
/// @brief Constructor
127
GNEFixNetworkElements(GNEApplicationWindow* mainWindow,
128
const std::vector<GNENetworkElement*>& elements);
129
130
/// @brief destructor
131
~GNEFixNetworkElements();
132
133
/// @name FOX-callbacks
134
/// @{
135
136
/// @brief event when user select a option
137
long onCmdSelectOption(FXObject* obj, FXSelector, void*);
138
139
/// @}
140
141
protected:
142
/// @brief fix edge options
143
FixEdgeOptions* myFixEdgeOptions = nullptr;
144
145
/// @brief fix crossing options
146
FixCrossingOptions* myFixCrossingOptions = nullptr;
147
148
private:
149
/// @brief Invalidated copy constructor.
150
GNEFixNetworkElements(const GNEFixNetworkElements&) = delete;
151
152
/// @brief Invalidated assignment operator.
153
GNEFixNetworkElements& operator=(const GNEFixNetworkElements&) = delete;
154
};
155
156