Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEFixNetworkElements.h
Go to the documentation of this file.
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/****************************************************************************/
18// Dialog used to fix network elements during saving
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
37 FXDECLARE(GNEFixNetworkElements)
38
39public:
42
45
47 FXuint openDialog(const std::vector<GNENetworkElement*>& invalidNetworkElements);
48
50 void runInternalTest(const InternalTestStep::DialogTest* modalArguments);
51
54
56 long onCmdSelectOption(FXObject* obj, FXSelector, void*);
57
59 long onCmdAccept(FXObject*, FXSelector, void*);
60
62 long onCmdCancel(FXObject*, FXSelector, void*);
63
65
66protected:
68 FOX_CONSTRUCTOR(GNEFixNetworkElements)
69
70
72
73 public:
75 FixOptions(FXVerticalFrame* frameParent, const std::string& title, GNEViewNet* viewNet);
76
78 void setInvalidElements(const std::vector<GNENetworkElement*>& invalidElements);
79
81 virtual void fixElements(bool& abortSaving) = 0;
82
83 protected:
85 bool saveContents() const;
86
88 FXVerticalFrame* myLeftFrame = nullptr;
89
91 FXVerticalFrame* myRightFrame = nullptr;
92
95
97 std::vector<GNENetworkElement*> myInvalidElements;
98
99 private:
101 virtual void enableOptions() = 0;
102
104 virtual void disableOptions() = 0;
105
107 FXTable* myTable = nullptr;
108
110 FixOptions(const FixOptions&) = delete;
111
113 FixOptions& operator=(const FixOptions&) = delete;
114 };
115
117 class FixEdgeOptions : public FixOptions {
118
119 public:
121 FixEdgeOptions(GNEFixNetworkElements* fixNetworkElementsParent, GNEViewNet* viewNet);
122
124 void selectOption(FXObject* option);
125
127 void fixElements(bool& abortSaving);
128
130 FXRadioButton* removeInvalidEdges;
131
133 FXRadioButton* saveInvalidEdges;
134
137
138 private:
140 void enableOptions();
141
143 void disableOptions();
144
147
150 };
151
154
155 public:
157 FixCrossingOptions(GNEFixNetworkElements* fixNetworkElementsParent, GNEViewNet* viewNet);
158
160 void selectOption(FXObject* option);
161
163 void fixElements(bool& abortSaving);
164
167
169 FXRadioButton* saveInvalidCrossings;
170
173
174 private:
176 void enableOptions();
177
179 void disableOptions();
180
183
186 };
187
189 FXVerticalFrame* myLeftFrame = nullptr;
190
192 FXVerticalFrame* myRightFrame = nullptr;
193
196
199
200private:
203
206};
groupbox for all radio buttons related with fix crossing options
FXRadioButton * saveInvalidCrossings
Option "save invalid crossings".
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidCrossings
Option "remove invalid elements".
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidCrossings
Option "Select invalid crossings and cancel".
FixCrossingOptions & operator=(const FixCrossingOptions &)=delete
Invalidated assignment operator.
FixCrossingOptions(const FixCrossingOptions &)=delete
Invalidated copy constructor.
groupbox for all radio buttons related with fix edges options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidEdgesAndCancel
Option "Select invalid edges and cancel".
void fixElements(bool &abortSaving)
fix elements
FixEdgeOptions(const FixEdgeOptions &)=delete
Invalidated copy constructor.
FXRadioButton * saveInvalidEdges
Option "Save invalid edges".
FXRadioButton * removeInvalidEdges
Option "Remove invalid edges".
FixEdgeOptions & operator=(const FixEdgeOptions &)=delete
Invalidated assignment operator.
FixOptions & operator=(const FixOptions &)=delete
Invalidated assignment operator.
virtual void disableOptions()=0
disable options
GNEViewNet * myViewNet
pointer to viewNet
FixOptions(const FixOptions &)=delete
Invalidated copy constructor.
virtual void fixElements(bool &abortSaving)=0
fix elements
std::vector< GNENetworkElement * > myInvalidElements
vector with the invalid network elements
virtual void enableOptions()=0
enable options
GNEFixNetworkElements & operator=(const GNEFixNetworkElements &)=delete
Invalidated assignment operator.
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
FixEdgeOptions * myFixEdgeOptions
fix edge options
FixCrossingOptions * myFixCrossingOptions
fix crossing options
FXVerticalFrame * myRightFrame
vertical right frame
GNEFixNetworkElements(const GNEFixNetworkElements &)=delete
Invalidated copy constructor.
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
event when user select a option
FXVerticalFrame * myLeftFrame
vertical left frame
FXuint openDialog(const std::vector< GNENetworkElement * > &invalidNetworkElements)
open fix network elements dialog
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
void runInternalTest(const InternalTestStep::DialogTest *modalArguments)
run internal test
dialog arguments (used for certain functions that opens modal dialogs)
MFXGroupBoxModule (based on FXGroupBox)
every row value