Eclipse SUMO - Simulation of Urban MObility
GNEFixDemandElements.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-2024 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 demand elements during saving
19 /****************************************************************************/
20 #pragma once
21 #include <config.h>
22 
24 
25 // ===========================================================================
26 // class declarations
27 // ===========================================================================
28 class GNEDemandElement;
29 class GNEViewNet;
30 
31 // ===========================================================================
32 // class definitions
33 // ===========================================================================
34 
39 class GNEFixDemandElements : public FXDialogBox {
41  FXDECLARE(GNEFixDemandElements)
42 
43 public:
45  GNEFixDemandElements(GNEViewNet* viewNet, const std::vector<GNEDemandElement*>& invalidDemandElements);
46 
49 
53  long onCmdSelectOption(FXObject* obj, FXSelector, void*);
54 
56  long onCmdAccept(FXObject*, FXSelector, void*);
57 
59  long onCmdCancel(FXObject*, FXSelector, void*);
61 
62 protected:
64  FOX_CONSTRUCTOR(GNEFixDemandElements)
65 
66 
68 
69  public:
71  FixOptions(FXVerticalFrame* frameParent, const std::string& title, GNEViewNet* viewNet);
72 
74  void setInvalidElements(const std::vector<GNEDemandElement*>& invalidElements);
75 
77  virtual void fixElements(bool& abortSaving) = 0;
78 
79  protected:
81  bool saveContents() const;
82 
84  FXVerticalFrame* myLeftFrame = nullptr;
85 
87  FXVerticalFrame* myRightFrame = nullptr;
88 
91 
93  std::vector<GNEDemandElement*> myInvalidElements;
94 
95  private:
97  virtual void enableOptions() = 0;
98 
100  virtual void disableOptions() = 0;
101 
103  FXTable* myTable = nullptr;
104  };
105 
107  class FixRouteOptions : public FixOptions {
108 
109  public:
111  FixRouteOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet);
112 
114  void selectOption(FXObject* option);
115 
117  void fixElements(bool& abortSaving);
118 
120  FXRadioButton* removeInvalidRoutes;
121 
123  FXRadioButton* saveInvalidRoutes;
124 
127 
129  FXCheckButton* removeStopsOutOfRoute;
130 
131  private:
133  void enableOptions();
134 
136  void disableOptions();
137  };
138 
140  class FixVehicleOptions : public FixOptions {
141 
142  public:
144  FixVehicleOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet);
145 
147  void selectOption(FXObject* option);
148 
150  void fixElements(bool& abortSaving);
151 
153  FXRadioButton* removeInvalidVehicles;
154 
156  FXRadioButton* saveInvalidVehicles;
157 
160 
162  FXCheckButton* removeStopsOutOfVehicle;
163 
164  private:
166  void enableOptions();
167 
169  void disableOptions();
170  };
171 
174 
175  public:
177  FixStopPositionOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet);
178 
180  void selectOption(FXObject* option);
181 
183  void fixElements(bool& abortSaving);
184 
187 
189  FXRadioButton* fixPositionsAndSave;
190 
192  FXRadioButton* saveInvalid;
193 
196 
197  private:
199  void enableOptions();
200 
202  void disableOptions();
203  };
204 
207 
208  public:
210  FixPersonPlanOptions(GNEFixDemandElements* fixDemandElementsParent, GNEViewNet* viewNet);
211 
213  void selectOption(FXObject* option);
214 
216  void fixElements(bool& abortSaving);
217 
219  FXRadioButton* deletePersonPlan;
220 
222  FXRadioButton* saveInvalid;
223 
226 
227  private:
229  void enableOptions();
230 
232  void disableOptions();
233  };
234 
236  class Buttons : public FXHorizontalFrame {
237 
238  public:
240  Buttons(GNEFixDemandElements* fixDemandElementsParent);
241 
242  private:
244  FXButton* myAcceptButton = nullptr;
245 
247  FXButton* myCancelButton = nullptr;
248  };
249 
251  GNEViewNet* myViewNet = nullptr;
252 
254  FXVerticalFrame* myMainFrame = nullptr;
255 
257  FXVerticalFrame* myLeftFrame = nullptr;
258 
260  FXVerticalFrame* myRightFrame = nullptr;
261 
264 
267 
270 
273 
275  Buttons* myButtons = nullptr;
276 
277 private:
280 
283 };
horizontal frame for buttons
FXButton * myAcceptButton
accept button
FXButton * myCancelButton
cancel button
Buttons(GNEFixDemandElements *fixDemandElementsParent)
build Position Options
virtual void disableOptions()=0
disable options
GNEViewNet * myViewNet
pointer to viewNet
std::vector< GNEDemandElement * > myInvalidElements
vector with the invalid demand elements
virtual void enableOptions()=0
enable options
virtual void fixElements(bool &abortSaving)=0
fix elements
groupbox for all radio buttons related with fix person plan options
FXRadioButton * deletePersonPlan
Option "delete person plan".
FixPersonPlanOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
build Position Options
void disableOptions()
disable personPlan options
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidPersonPlansAndCancel
Option "Select invalid person plans and cancel".
void enableOptions()
enable personPlan options
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * saveInvalid
Option "Save invalid".
groupbox for all radio buttons related with fix route options
void selectOption(FXObject *option)
select option
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidRoutes
Option "Remove invalid routes".
FXRadioButton * saveInvalidRoutes
Option "Save invalid routes".
FXRadioButton * selectInvalidRoutesAndCancel
Option "Select invalid routes and cancel".
FXCheckButton * removeStopsOutOfRoute
Option "Remove stops out of route".
void disableOptions()
disable route options
FixRouteOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
constructor
groupbox for all radio buttons related with fix stop options
FXRadioButton * saveInvalid
Option "Save invalid".
void fixElements(bool &abortSaving)
fix elements
FixStopPositionOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
build Position Options
FXRadioButton * fixPositionsAndSave
Option "Fix Positions and save".
FXRadioButton * selectInvalidStopsAndCancel
Option "Select invalid stops and cancel".
void selectOption(FXObject *option)
select option
FXRadioButton * activateFriendlyPositionAndSave
Option "Activate friendlyPos and save".
groupbox for all radio buttons related with fix vehicle options
FXRadioButton * saveInvalidVehicles
Option "save invalid vehicles".
FXCheckButton * removeStopsOutOfVehicle
Option "Remove stops out of vehicle".
void selectOption(FXObject *option)
select option
FXRadioButton * selectInvalidVehiclesAndCancel
Option "Select invalid vehicles and cancel".
void fixElements(bool &abortSaving)
fix elements
FXRadioButton * removeInvalidVehicles
Option "remove invalid elements".
FixVehicleOptions(GNEFixDemandElements *fixDemandElementsParent, GNEViewNet *viewNet)
constructor
void disableOptions()
disable vehicle options
Dialog for edit rerouters.
FixStopPositionOptions * myFixStopPositionOptions
fix stop options
long onCmdSelectOption(FXObject *obj, FXSelector, void *)
Buttons * myButtons
buttons
FixRouteOptions * myFixRouteOptions
fix route options
GNEFixDemandElements & operator=(const GNEFixDemandElements &)=delete
Invalidated assignment operator.
FXVerticalFrame * myRightFrame
vertical right frame
FXVerticalFrame * myMainFrame
main frame
FixVehicleOptions * myFixVehicleOptions
fix vehicle options
GNEViewNet * myViewNet
view net
GNEFixDemandElements(GNEViewNet *viewNet, const std::vector< GNEDemandElement * > &invalidDemandElements)
FOX-declaration.
long onCmdCancel(FXObject *, FXSelector, void *)
event after press cancel button
FixPersonPlanOptions * myFixPersonPlanOptions
fix person plan options
GNEFixDemandElements(const GNEFixDemandElements &)=delete
Invalidated copy constructor.
long onCmdAccept(FXObject *, FXSelector, void *)
event after press accept button
FXVerticalFrame * myLeftFrame
vertical left frame
MFXGroupBoxModule (based on FXGroupBox)
every row value