Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNEApplicationWindowHelper.h
169666 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 GNEApplicationWindowHelper.h
15
/// @author Pablo Alvarez Lopez
16
/// @date mar 2020
17
///
18
// Functions from main window of netedit
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/dialogs/file/GNEFileDialog.h>
24
#include <utils/common/SUMOTime.h>
25
#include <utils/foxtools/MFXSynchQue.h>
26
#include <utils/foxtools/MFXRecentNetworks.h>
27
#include <utils/foxtools/MFXThreadEvent.h>
28
#include <utils/foxtools/MFXInterThreadEventClient.h>
29
#include <utils/geom/Position.h>
30
#include <utils/gui/div/GUIMessageWindow.h>
31
#include <utils/gui/windows/GUIMainWindow.h>
32
#include <utils/shapes/ShapeHandler.h>
33
#include <utils/options/OptionsCont.h>
34
#include <utils/tests/InternalTestStep.h>
35
36
#include "GNEViewNetHelper.h"
37
38
39
// ===========================================================================
40
// class declarations
41
// ===========================================================================
42
43
class GNEApplicationWindow;
44
class GNENet;
45
class GNENetgenerateDialog;
46
class GNEPythonTool;
47
class GNEPythonToolDialog;
48
class GNERunNetgenerateDialog;
49
class GNERunPythonToolDialog;
50
class GNEViewNet;
51
class MFXMenuCheckIcon;
52
53
// ===========================================================================
54
// class definition
55
// ===========================================================================
56
57
struct GNEApplicationWindowHelper {
58
59
/// @brief struct for griped toolbars
60
struct ToolbarsGrip {
61
62
/// @brief constructor
63
ToolbarsGrip(GNEApplicationWindow* applicationWindow);
64
65
/// @brief build menu toolbar grips
66
void buildMenuToolbarsGrip();
67
68
/// @brief build toolbars grips
69
void buildViewParentToolbarsGrips();
70
71
/// @brief build toolbars grips
72
void destroyParentToolbarsGrips();
73
74
/// @brief The application menu bar (for file, edit, processing...)
75
FXMenuBar* menu = nullptr;
76
77
/// @brief The application menu bar for supermodes (network, demand and data)
78
FXMenuBar* superModes = nullptr;
79
80
/// @brief The application menu bar for save elements
81
FXMenuBar* saveElements = nullptr;
82
83
/// @brief The application menu bar for time switch
84
FXMenuBar* timeSwitch = nullptr;
85
86
/// @brief The application menu bar for navigation (zoom, coloring...)
87
FXMenuBar* navigation = nullptr;
88
89
/// @brief The application menu bar (for select, inspect...)
90
FXMenuBar* modes = nullptr;
91
92
/// @brief The application menu bar for mode options (show connections, select edges...)
93
FXMenuBar* intervalBar = nullptr;
94
95
private:
96
/// @brief pointer to current GNEApplicationWindow
97
GNEApplicationWindow* myApplicationWindow;
98
99
/// @brief menu bar drag (for file, edit, processing...)
100
FXToolBarShell* myPythonToolBarShellMenu = nullptr;
101
102
/// @brief menu bar drag for super modes (network, demand and data)
103
FXToolBarShell* myPythonToolBarShellSuperModes = nullptr;
104
105
/// @brief menu bar drag for save elements
106
FXToolBarShell* myPythonToolBarShellSaveElements = nullptr;
107
108
/// @brief menu bar drag for time switch
109
FXToolBarShell* myPythonToolBarShellTimeFormat = nullptr;
110
111
/// @brief menu bar drag for navigation (Zoom, coloring...)
112
FXToolBarShell* myPythonToolBarShellNavigation = nullptr;
113
114
/// @brief menu bar drag for modes (select, inspect, delete...)
115
FXToolBarShell* myPythonToolBarShellModes = nullptr;
116
117
/// @brief menu bar drag for interval bar
118
FXToolBarShell* myPythonToolBarShellIntervalBar = nullptr;
119
120
/// @brief Invalidated copy constructor.
121
ToolbarsGrip(const ToolbarsGrip&) = delete;
122
123
/// @brief Invalidated assignment operator.
124
ToolbarsGrip& operator=(const ToolbarsGrip&) = delete;
125
};
126
127
/// @brief struct for menu bar file
128
struct MenuBarFile {
129
130
/// @brief constructor
131
MenuBarFile(GNEApplicationWindow* applicationWindow);
132
133
/// @brief build recent network
134
void buildRecentNetworkFiles(FXMenuPane* fileMenu, FXMenuPane* fileMenuRecentNetworkFiles);
135
136
/// @brief build recent config
137
void buildRecentConfigFiles(FXMenuPane* fileMenu, FXMenuPane* fileMenuRecentConfigFiles);
138
139
/// @brief List of recent networks
140
MFXRecentNetworks myRecentNetworks;
141
142
/// @brief List of recent configs
143
MFXRecentNetworks myRecentConfigs;
144
145
private:
146
/// @brief pointer to current GNEApplicationWindow
147
GNEApplicationWindow* myApplicationWindow;
148
149
/// @brief Invalidated copy constructor.
150
MenuBarFile(const MenuBarFile&) = delete;
151
152
/// @brief Invalidated assignment operator.
153
MenuBarFile& operator=(const MenuBarFile&) = delete;
154
};
155
156
/// @brief struct for File menu commands
157
struct FileMenuCommands {
158
159
/// @brief constructor
160
FileMenuCommands(GNEApplicationWindow* applicationWindow);
161
162
/// @brief build menu commands
163
void buildFileMenuCommands(FXMenuPane* fileMenu, FXMenuPane* fileMenuNEEDITConfig, FXMenuPane* fileMenuSumoConfig,
164
FXMenuPane* fileMenuTLS, FXMenuPane* fileMenuEdgeTypes, FXMenuPane* fileMenuAdditionals,
165
FXMenuPane* fileMenuDemandElements, FXMenuPane* fileMenuDataElements,
166
FXMenuPane* fileMenuMeanDataElements);
167
168
/// @brief enable menu cascades
169
void enableMenuCascades();
170
171
/// @brief disable menu cascades
172
void disableMenuCascades();
173
174
/// @brief set default view
175
void setDefaultView();
176
177
/// @brief set JuPedSim view
178
void setJuPedSimView();
179
180
/// @brief checkBox for allow undo-redo loading
181
FXMenuCheck* menuCheckAllowUndoRedoLoading = nullptr;
182
183
private:
184
/// @brief build netedit config section
185
void buildNeteditConfigSection(FXMenuPane* menuPane);
186
187
/// @brief build SUMO Config section
188
void buildSumoConfigSection(FXMenuPane* menuPane);
189
190
/// @brief build traffic light section
191
void buildTrafficLightSection(FXMenuPane* menuPane);
192
193
/// @brief build edge type section
194
void buildEdgeTypeSection(FXMenuPane* menuPane);
195
196
/// @brief build additional section
197
void buildAdditionalSection(FXMenuPane* menuPane);
198
199
/// @brief build demand section
200
void buildDemandSection(FXMenuPane* menuPane);
201
202
/// @brief build data section
203
void buildDataSection(FXMenuPane* menuPane);
204
205
/// @brief build meanData section
206
void buildMeanDataSection(FXMenuPane* menuPane);
207
208
/// @brief pointer to current GNEApplicationWindow
209
GNEApplicationWindow* myApplicationWindow = nullptr;
210
211
/// @brief FXMenuCascade for neteditConfig
212
FXMenuCascade* myNeteditConfigMenuCascade = nullptr;
213
214
/// @brief FXMenuCascade for SumoConfig
215
FXMenuCascade* mySumoConfigMenuCascade = nullptr;
216
217
/// @brief FXMenuCascade for TLS
218
FXMenuCascade* myTLSMenuCascade = nullptr;
219
220
/// @brief FXMenuCascade for edgeTypes
221
FXMenuCascade* myEdgeTypesMenuCascade = nullptr;
222
223
/// @brief FXMenuCascade for additional
224
FXMenuCascade* myAdditionalMenuCascade = nullptr;
225
226
/// @brief FXMenuCascade for demand
227
FXMenuCascade* myDemandMenuCascade = nullptr;
228
229
/// @brief FXMenuCascade for data
230
FXMenuCascade* myDataMenuCascade = nullptr;
231
232
/// @brief FXMenuCascade for mean data
233
FXMenuCascade* myMeanDataMenuCascade = nullptr;
234
235
/// @brief Invalidated copy constructor.
236
FileMenuCommands(const FileMenuCommands&) = delete;
237
238
/// @brief Invalidated assignment operator.
239
FileMenuCommands& operator=(const FileMenuCommands&) = delete;
240
};
241
242
/// @brief struct for modes menu commands
243
struct ModesMenuCommands {
244
245
/// @brief struct for common menu commands
246
struct CommonMenuCommands {
247
248
/// @brief constructor
249
CommonMenuCommands(const ModesMenuCommands* modesMenuCommandsParent);
250
251
/// @brief build menu commands
252
void buildCommonMenuCommands(FXMenuPane* modesMenu);
253
254
/// @brief menu command for delete mode
255
FXMenuCommand* deleteMode = nullptr;
256
257
/// @brief menu command for inspect mode
258
FXMenuCommand* inspectMode = nullptr;
259
260
/// @brief menu command for select mode
261
FXMenuCommand* selectMode = nullptr;
262
263
private:
264
/// @brief reference to ModesMenuCommands
265
const ModesMenuCommands* myModesMenuCommandsParent;
266
267
/// @brief Invalidated copy constructor.
268
CommonMenuCommands(const CommonMenuCommands&) = delete;
269
270
/// @brief Invalidated assignment operator.
271
CommonMenuCommands& operator=(const CommonMenuCommands&) = delete;
272
};
273
274
/// @brief struct for network menu commands
275
struct NetworkMenuCommands {
276
277
/// @brief constructor
278
NetworkMenuCommands(const ModesMenuCommands* modesMenuCommandsParent);
279
280
/// @brief build menu commands
281
void buildNetworkMenuCommands(FXMenuPane* modesMenu);
282
283
/// @brief show all menu commands
284
void showNetworkMenuCommands();
285
286
/// @brief hide all menu commands
287
void hideNetworkMenuCommands();
288
289
/// @brief menu command for create edge
290
FXMenuCommand* createEdgeMode = nullptr;
291
292
/// @brief menu command for move mode (network)
293
FXMenuCommand* moveMode = nullptr;
294
295
/// @brief menu command for connect mode
296
FXMenuCommand* connectMode = nullptr;
297
298
/// @brief menu command for prohibition mode
299
FXMenuCommand* prohibitionMode = nullptr;
300
301
/// @brief menu command for TLS Mode
302
FXMenuCommand* TLSMode = nullptr;
303
304
/// @brief menu command for additional mode
305
FXMenuCommand* additionalMode = nullptr;
306
307
/// @brief menu command for crossing mode
308
FXMenuCommand* crossingMode = nullptr;
309
310
/// @brief menu command for TAZ mode
311
FXMenuCommand* TAZMode = nullptr;
312
313
/// @brief menu command for shape mode
314
FXMenuCommand* shapeMode = nullptr;
315
316
/// @brief menu command for wire mode
317
FXMenuCommand* wireMode = nullptr;
318
319
/// @brief menu command for decal mode
320
FXMenuCommand* decalMode = nullptr;
321
322
private:
323
/// @brief reference to ModesMenuCommands
324
const ModesMenuCommands* myModesMenuCommandsParent;
325
326
/// @brief Invalidated copy constructor.
327
NetworkMenuCommands(const NetworkMenuCommands&) = delete;
328
329
/// @brief Invalidated assignment operator.
330
NetworkMenuCommands& operator=(const NetworkMenuCommands&) = delete;
331
};
332
333
/// @brief struct for Demand menu commands
334
struct DemandMenuCommands {
335
336
/// @brief constructor
337
DemandMenuCommands(const ModesMenuCommands* modesMenuCommandsParent);
338
339
/// @brief build menu commands
340
void buildDemandMenuCommands(FXMenuPane* modesMenu);
341
342
/// @brief show all menu commands
343
void showDemandMenuCommands();
344
345
/// @brief hide all menu commands
346
void hideDemandMenuCommands();
347
348
/// @brief menu command for move mode (demand)
349
FXMenuCommand* moveMode = nullptr;
350
351
/// @brief menu command for route mode
352
FXMenuCommand* routeMode = nullptr;
353
354
/// @brief menu command for route distribution mode
355
FXMenuCommand* routeDistributionMode = nullptr;
356
357
/// @brief menu command for vehicle mode
358
FXMenuCommand* vehicleMode = nullptr;
359
360
/// @brief menu command for type mode
361
FXMenuCommand* typeMode = nullptr;
362
363
/// @brief menu command for type distribution mode
364
FXMenuCommand* typeDistributionMode = nullptr;
365
366
/// @brief menu command for stop mode
367
FXMenuCommand* stopMode = nullptr;
368
369
/// @brief menu command for person mode
370
FXMenuCommand* personMode = nullptr;
371
372
/// @brief menu command for person plan mode
373
FXMenuCommand* personPlanMode = nullptr;
374
375
/// @brief menu command for container mode
376
FXMenuCommand* containerMode = nullptr;
377
378
/// @brief menu command for container plan mode
379
FXMenuCommand* containerPlanMode = nullptr;
380
381
private:
382
/// @brief reference to ModesMenuCommands
383
const ModesMenuCommands* myModesMenuCommandsParent;
384
385
/// @brief Invalidated copy constructor.
386
DemandMenuCommands(const DemandMenuCommands&) = delete;
387
388
/// @brief Invalidated assignment operator.
389
DemandMenuCommands& operator=(const DemandMenuCommands&) = delete;
390
};
391
392
/// @brief struct for Data menu commands
393
struct DataMenuCommands {
394
395
/// @brief constructor
396
DataMenuCommands(const ModesMenuCommands* modesMenuCommandsParent);
397
398
/// @brief build menu commands
399
void buildDataMenuCommands(FXMenuPane* modesMenu);
400
401
/// @brief show all menu commands
402
void showDataMenuCommands();
403
404
/// @brief hide all menu commands
405
void hideDataMenuCommands();
406
407
/// @brief menu command for edge mode
408
FXMenuCommand* edgeData = nullptr;
409
410
/// @brief menu command for edge rel mode
411
FXMenuCommand* edgeRelData = nullptr;
412
413
/// @brief menu command for TAZ rel mode
414
FXMenuCommand* TAZRelData = nullptr;
415
416
/// @brief menu command for mean data
417
FXMenuCommand* meanData = nullptr;
418
419
private:
420
/// @brief reference to ModesMenuCommands
421
const ModesMenuCommands* myModesMenuCommandsParent;
422
423
/// @brief Invalidated copy constructor.
424
DataMenuCommands(const DataMenuCommands&) = delete;
425
426
/// @brief Invalidated assignment operator.
427
DataMenuCommands& operator=(const DataMenuCommands&) = delete;
428
};
429
430
/// @brief constructor
431
ModesMenuCommands(GNEApplicationWindow* applicationWindow);
432
433
/// @brief build modes menu commands
434
void buildModesMenuCommands(FXMenuPane* modesMenu);
435
436
/// @brief set default view
437
void setDefaultView(Supermode supermode);
438
439
/// @brief set JuPedSim view
440
void setJuPedSimView(Supermode supermode);
441
442
/// @brief Common Menu Commands
443
CommonMenuCommands commonMenuCommands;
444
445
/// @brief Network Menu Commands
446
NetworkMenuCommands networkMenuCommands;
447
448
/// @brief Demand Menu Commands
449
DemandMenuCommands demandMenuCommands;
450
451
/// @brief Data Menu Commands
452
DataMenuCommands dataMenuCommands;
453
454
private:
455
/// @brief pointer to current GNEApplicationWindow
456
GNEApplicationWindow* myApplicationWindow;
457
458
/// @brief Invalidated copy constructor.
459
ModesMenuCommands(const ModesMenuCommands&) = delete;
460
461
/// @brief Invalidated assignment operator.
462
ModesMenuCommands& operator=(const ModesMenuCommands&) = delete;
463
};
464
465
/// @brief struct for edit menu commands
466
struct EditMenuCommands {
467
468
/// @brief struct used to group all variables related to view options in supermode Network
469
struct NetworkViewOptions {
470
471
/// @brief default constructor
472
NetworkViewOptions(GNEApplicationWindow* applicationWindow);
473
474
/// @brief build menu checks
475
void buildNetworkViewOptionsMenuChecks(FXMenuPane* editMenu);
476
477
/// @brief hide all options menu checks
478
void hideNetworkViewOptionsMenuChecks();
479
480
/// @brief update shortcuts (alt+X)
481
void updateShortcuts();
482
483
/// @brief menu check to show grid button
484
MFXMenuCheckIcon* menuCheckToggleGrid = nullptr;
485
486
/// @brief menu check to toggle draw junction shape
487
MFXMenuCheckIcon* menuCheckToggleDrawJunctionShape = nullptr;
488
489
/// @brief menu check to draw vehicles in begin position or spread in lane
490
MFXMenuCheckIcon* menuCheckDrawSpreadVehicles = nullptr;
491
492
/// @brief menu check to show Demand Elements
493
MFXMenuCheckIcon* menuCheckShowDemandElements = nullptr;
494
495
/// @brief menu check to select only edges
496
MFXMenuCheckIcon* menuCheckSelectEdges = nullptr;
497
498
/// @brief menu check to show connections
499
MFXMenuCheckIcon* menuCheckShowConnections = nullptr;
500
501
/// @brief menu check to hide connections in connect mode
502
MFXMenuCheckIcon* menuCheckHideConnections = nullptr;
503
504
/// @brief menu check to show additional sub-elements
505
MFXMenuCheckIcon* menuCheckShowAdditionalSubElements = nullptr;
506
507
/// @brief menu check to show TAZ elements
508
MFXMenuCheckIcon* menuCheckShowTAZElements = nullptr;
509
510
/// @brief menu check to extend to edge nodes
511
MFXMenuCheckIcon* menuCheckExtendSelection = nullptr;
512
513
/// @brief menu check to set change all phases
514
MFXMenuCheckIcon* menuCheckChangeAllPhases = nullptr;
515
516
/// @brief menu check to we should warn about merging junctions
517
MFXMenuCheckIcon* menuCheckMergeAutomatically = nullptr;
518
519
/// @brief menu check to show connection as bubble in "Move" mode.
520
MFXMenuCheckIcon* menuCheckShowJunctionBubble = nullptr;
521
522
/// @brief menu check to apply movement to elevation
523
MFXMenuCheckIcon* menuCheckMoveElevation = nullptr;
524
525
/// @brief menu check to the endpoint for a created edge should be set as the new source
526
MFXMenuCheckIcon* menuCheckChainEdges = nullptr;
527
528
/// @brief check checkable to create auto create opposite edge
529
MFXMenuCheckIcon* menuCheckAutoOppositeEdge = nullptr;
530
531
/// @brief separator
532
FXMenuSeparator* separator = nullptr;
533
534
private:
535
/// @brief pointer to current GNEApplicationWindow
536
GNEApplicationWindow* myApplicationWindow;
537
538
/// @brief Invalidated copy constructor.
539
NetworkViewOptions(const NetworkViewOptions&) = delete;
540
541
/// @brief Invalidated assignment operator.
542
NetworkViewOptions& operator=(const NetworkViewOptions&) = delete;
543
};
544
545
/// @brief struct used to group all variables related to view options in supermode Demand
546
struct DemandViewOptions {
547
548
/// @brief default constructor
549
DemandViewOptions(GNEApplicationWindow* applicationWindow);
550
551
/// @brief build menu checks
552
void buildDemandViewOptionsMenuChecks(FXMenuPane* editMenu);
553
554
/// @brief hide all options menu checks
555
void hideDemandViewOptionsMenuChecks();
556
557
/// @brief update shortcuts (alt+X)
558
void updateShortcuts();
559
560
/// @brief menu check to show grid button
561
MFXMenuCheckIcon* menuCheckToggleGrid = nullptr;
562
563
/// @brief menu check to toggle draw junction shape
564
MFXMenuCheckIcon* menuCheckToggleDrawJunctionShape = nullptr;
565
566
/// @brief menu check to draw vehicles in begin position or spread in lane
567
MFXMenuCheckIcon* menuCheckDrawSpreadVehicles = nullptr;
568
569
/// @brief menu check for hide shapes (Polygons and POIs)
570
MFXMenuCheckIcon* menuCheckHideShapes = nullptr;
571
572
/// @brief menu check for show all trips plans
573
MFXMenuCheckIcon* menuCheckShowAllTrips = nullptr;
574
575
/// @brief menu check for hide non inspected demand elements
576
MFXMenuCheckIcon* menuCheckHideNonInspectedDemandElements = nullptr;
577
578
/// @brief menu check for show overlapped routes
579
MFXMenuCheckIcon* menuCheckShowOverlappedRoutes = nullptr;
580
581
/// @brief menu check for show all person plans
582
MFXMenuCheckIcon* menuCheckShowAllPersonPlans = nullptr;
583
584
/// @brief menu check for lock Person
585
MFXMenuCheckIcon* menuCheckLockPerson = nullptr;
586
587
/// @brief menu check for show all container plans
588
MFXMenuCheckIcon* menuCheckShowAllContainerPlans = nullptr;
589
590
/// @brief menu check for lock Container
591
MFXMenuCheckIcon* menuCheckLockContainer = nullptr;
592
593
/// @brief separator
594
FXMenuSeparator* separator = nullptr;
595
596
private:
597
/// @brief pointer to current GNEApplicationWindow
598
GNEApplicationWindow* myApplicationWindow;
599
600
/// @brief Invalidated copy constructor.
601
DemandViewOptions(const DemandViewOptions&) = delete;
602
603
/// @brief Invalidated assignment operator.
604
DemandViewOptions& operator=(const DemandViewOptions&) = delete;
605
};
606
607
/// @brief struct used to group all variables related to view options in supermode Data
608
struct DataViewOptions {
609
610
/// @brief default constructor
611
DataViewOptions(GNEApplicationWindow* applicationWindow);
612
613
/// @brief build menu checks
614
void buildDataViewOptionsMenuChecks(FXMenuPane* editMenu);
615
616
/// @brief hide all options menu checks
617
void hideDataViewOptionsMenuChecks();
618
619
/// @brief update shortcuts (alt+X)
620
void updateShortcuts();
621
622
/// @brief menu check to toggle draw junction shape
623
MFXMenuCheckIcon* menuCheckToggleDrawJunctionShape = nullptr;
624
625
/// @brief menu check to show Additionals
626
MFXMenuCheckIcon* menuCheckShowAdditionals = nullptr;
627
628
/// @brief menu check to show Shapes
629
MFXMenuCheckIcon* menuCheckShowShapes = nullptr;
630
631
/// @brief menu check to show Demand Elements
632
MFXMenuCheckIcon* menuCheckShowDemandElements = nullptr;
633
634
/// @brief menu check to toggle TAZRel drawing mode
635
MFXMenuCheckIcon* menuCheckToggleTAZRelDrawing = nullptr;
636
637
/// @brief menu check to toggle TAZ draw fill
638
MFXMenuCheckIcon* menuCheckToggleTAZDrawFill = nullptr;
639
640
/// @brief menu check to toggle TAZRel only from
641
MFXMenuCheckIcon* menuCheckToggleTAZRelOnlyFrom = nullptr;
642
643
/// @brief menu check to toggle TAZRel only to
644
MFXMenuCheckIcon* menuCheckToggleTAZRelOnlyTo = nullptr;
645
646
/// @brief separator
647
FXMenuSeparator* separator = nullptr;
648
649
private:
650
/// @brief pointer to current GNEApplicationWindow
651
GNEApplicationWindow* myApplicationWindow;
652
653
/// @brief Invalidated copy constructor.
654
DataViewOptions(const DataViewOptions&) = delete;
655
656
/// @brief Invalidated assignment operator.
657
DataViewOptions& operator=(const DataViewOptions&) = delete;
658
};
659
660
/// @brief constructor
661
EditMenuCommands(GNEApplicationWindow* applicationWindow);
662
663
/// @brief build undo-redo menu commands
664
void buildUndoRedoMenuCommands(FXMenuPane* editMenu);
665
666
/// @brief build view menu commands
667
void buildViewMenuCommands(FXMenuPane* editMenu);
668
669
/// @brief build front element commands
670
void buildFrontElementMenuCommand(FXMenuPane* editMenu);
671
672
/// @brief build open sumo menu commands
673
void buildOpenSUMOMenuCommands(FXMenuPane* editMenu);
674
675
/// @brief FXMenuCommand for undo last change
676
FXMenuCommand* undoLastChange = nullptr;
677
678
/// @brief FXMenuCommand for redo last change
679
FXMenuCommand* redoLastChange = nullptr;
680
681
/// @brief FXMenuCommand for open undolist dialog
682
FXMenuCommand* openUndolistDialog = nullptr;
683
684
/// @brief checkBox for allow undo-redo
685
FXMenuCheck* menuCheckAllowUndoRedo = nullptr;
686
687
/// @brief network view options
688
NetworkViewOptions networkViewOptions;
689
690
/// @brief demand view options
691
DemandViewOptions demandViewOptions;
692
693
/// @brief data view options
694
DataViewOptions dataViewOptions;
695
696
/// @brief FXMenuCommand for edit view scheme
697
FXMenuCommand* editViewScheme = nullptr;
698
699
/// @brief FXMenuCommand for edit view port
700
FXMenuCommand* editViewPort = nullptr;
701
702
/// @brief FXMenuCommand for clear Front element
703
FXMenuCommand* clearFrontElement = nullptr;
704
705
/// @brief menu check for load additionals in SUMO GUI
706
FXMenuCheck* loadAdditionalsInSUMOGUI = nullptr;
707
708
/// @brief menu check for load demand in SUMO GUI
709
FXMenuCheck* loadDemandInSUMOGUI = nullptr;
710
711
/// @brief FXMenuCommand for open in SUMO GUI
712
FXMenuCommand* openInSUMOGUI = nullptr;
713
714
private:
715
/// @brief pointer to current GNEApplicationWindow
716
GNEApplicationWindow* myApplicationWindow;
717
718
/// @brief Invalidated copy constructor.
719
EditMenuCommands(const EditMenuCommands&) = delete;
720
721
/// @brief Invalidated assignment operator.
722
EditMenuCommands& operator=(const EditMenuCommands&) = delete;
723
};
724
725
/// @brief struct for processing menu commands
726
struct LockMenuCommands {
727
728
/// @brief constructor
729
LockMenuCommands(GNEApplicationWindow* applicationWindow);
730
731
/// @brief build menu commands
732
void buildLockMenuCommands(FXMenuPane* editMenu);
733
734
/// @brief remove hotkeys
735
void removeHotkeys();
736
737
/// @brief show network processing menu commands
738
void showNetworkLockMenuCommands();
739
740
/// @brief show network processing menu commands
741
void hideNetworkLockMenuCommands();
742
743
/// @brief show demand processing menu commands
744
void showDemandLockMenuCommands();
745
746
/// @brief show demand processing menu commands
747
void hideDemandLockMenuCommands();
748
749
/// @brief show data processing menu commands
750
void showDataLockMenuCommands();
751
752
/// @brief show data processing menu commands
753
void hideDataLockMenuCommands();
754
755
/// @brief lock all
756
void lockAll();
757
758
/// @brief unlock all
759
void unlockAll();
760
761
/// @brief lock or unlock object based in a tag property
762
void editLocking(const GNEAttributeCarrier* AC, const FXbool value);
763
764
/// @name Processing FXMenuCommands for Network mode
765
/// @{
766
/// @brief menu check to lock junction
767
MFXMenuCheckIcon* menuCheckLockJunctions = nullptr;
768
769
/// @brief menu check to lock edges
770
MFXMenuCheckIcon* menuCheckLockEdges = nullptr;
771
772
/// @brief menu check to lock lanes
773
MFXMenuCheckIcon* menuCheckLockLanes = nullptr;
774
775
/// @brief menu check to lock connections
776
MFXMenuCheckIcon* menuCheckLockConnections = nullptr;
777
778
/// @brief menu check to lock crossings
779
MFXMenuCheckIcon* menuCheckLockCrossings = nullptr;
780
781
/// @brief menu check to lock walkingAreas
782
MFXMenuCheckIcon* menuCheckLockWalkingAreas = nullptr;
783
784
/// @brief menu check to lock additionals
785
MFXMenuCheckIcon* menuCheckLockAdditionals = nullptr;
786
787
/// @brief menu check to lock TAZs
788
MFXMenuCheckIcon* menuCheckLockTAZs = nullptr;
789
790
/// @brief menu check to lock Wires
791
MFXMenuCheckIcon* menuCheckLockWires = nullptr;
792
793
/// @brief menu check to lock polygons
794
MFXMenuCheckIcon* menuCheckLockPolygons = nullptr;
795
796
/// @brief menu check to lock POIs
797
MFXMenuCheckIcon* menuCheckLockPOIs = nullptr;
798
799
/// @brief menu check to lock jps walkableareas
800
MFXMenuCheckIcon* menuCheckLockJpsWalkableAreas = nullptr;
801
802
/// @brief menu check to lock jps obstacles
803
MFXMenuCheckIcon* menuCheckLockJpsObstacles = nullptr;
804
805
/// @}
806
807
/// @name Processing FXMenuCommands for Demand mode
808
/// @{
809
/// @brief menu check to lock routes
810
MFXMenuCheckIcon* menuCheckLockRoutes = nullptr;
811
812
/// @brief menu check to lock vehicles
813
MFXMenuCheckIcon* menuCheckLockVehicles = nullptr;
814
815
/// @brief menu check to lock persons
816
MFXMenuCheckIcon* menuCheckLockPersons = nullptr;
817
818
/// @brief menu check to lock personTrips
819
MFXMenuCheckIcon* menuCheckLockPersonTrips = nullptr;
820
821
/// @brief menu check to lock walks
822
MFXMenuCheckIcon* menuCheckLockWalks = nullptr;
823
824
/// @brief menu check to lock rides
825
MFXMenuCheckIcon* menuCheckLockRides = nullptr;
826
827
/// @brief menu check to lock containers
828
MFXMenuCheckIcon* menuCheckLockContainers = nullptr;
829
830
/// @brief menu check to lock transports
831
MFXMenuCheckIcon* menuCheckLockTransports = nullptr;
832
833
/// @brief menu check to lock tranships
834
MFXMenuCheckIcon* menuCheckLockTranships = nullptr;
835
836
/// @brief menu check to lock stops
837
MFXMenuCheckIcon* menuCheckLockStops = nullptr;
838
839
/// @}
840
841
/// @name Processing FXMenuCommands for Data mode
842
/// @{
843
/// @brief menu check to lock edge datas
844
MFXMenuCheckIcon* menuCheckLockEdgeDatas = nullptr;
845
846
/// @brief menu check to lock edgeRelDatas
847
MFXMenuCheckIcon* menuCheckLockEdgeRelDatas = nullptr;
848
849
/// @brief menu check to lock edgeTAZRels
850
MFXMenuCheckIcon* menuCheckLockEdgeTAZRels = nullptr;
851
852
/// @}
853
854
/// @brief menu check for lock selected elements
855
MFXMenuCheckIcon* menuCheckLockSelectedElements = nullptr;
856
857
protected:
858
/// @brief Parse hot key from string
859
FXHotKey parseHotKey(const FXwchar character);
860
861
private:
862
/// @brief pointer to current GNEApplicationWindow
863
GNEApplicationWindow* myApplicationWindow;
864
865
/// @brief Invalidated copy constructor.
866
LockMenuCommands(const LockMenuCommands&) = delete;
867
868
/// @brief Invalidated assignment operator.
869
LockMenuCommands& operator=(const LockMenuCommands&) = delete;
870
};
871
872
/// @brief struct for processing menu commands
873
struct ProcessingMenuCommands {
874
875
/// @brief constructor
876
ProcessingMenuCommands(GNEApplicationWindow* applicationWindow);
877
878
/// @brief build menu commands
879
void buildProcessingMenuCommands(FXMenuPane* processingMenu);
880
881
/// @brief show network processing menu commands
882
void showNetworkProcessingMenuCommands();
883
884
/// @brief show network processing menu commands
885
void hideNetworkProcessingMenuCommands();
886
887
/// @brief show demand processing menu commands
888
void showDemandProcessingMenuCommands();
889
890
/// @brief show demand processing menu commands
891
void hideDemandProcessingMenuCommands();
892
893
/// @brief show data processing menu commands
894
void showDataProcessingMenuCommands();
895
896
/// @brief show data processing menu commands
897
void hideDataProcessingMenuCommands();
898
899
/// @brief show separator
900
void showSeparator();
901
902
/// @brief hide separator
903
void hideSeparator();
904
905
/// @name Processing FXMenuCommands for Network mode
906
/// @{
907
/// @brief FXMenuCommand for compute network
908
FXMenuCommand* computeNetwork = nullptr;
909
910
/// @brief FXMenuCommand for compute network with volatile options
911
FXMenuCommand* computeNetworkVolatile = nullptr;
912
913
/// @brief FXMenuCommand for clean junctions without edges
914
FXMenuCommand* cleanJunctions = nullptr;
915
916
/// @brief FXMenuCommand for join selected junctions
917
FXMenuCommand* joinJunctions = nullptr;
918
919
/// @brief FXMenuCommand for clear invalid crossings
920
FXMenuCommand* clearInvalidCrossings = nullptr;
921
922
/// @brief checkBox for recomputing when changing data mode
923
MFXMenuCheckIcon* menuCheckRecomputeDataMode = nullptr;
924
925
/// @}
926
927
/// @name Processing FXMenuCommands for Demand mode
928
/// @{
929
/// @brief FXMenuCommand for compute demand elements
930
FXMenuCommand* computeDemand = nullptr;
931
932
/// @brief FXMenuCommand for clean routes without vehicles
933
FXMenuCommand* cleanRoutes = nullptr;
934
935
/// @brief FXMenuCommand for join routes
936
FXMenuCommand* joinRoutes = nullptr;
937
938
/// @brief FXMenuCommand for adjust person plans
939
FXMenuCommand* adjustPersonPlans = nullptr;
940
941
/// @brief FXMenuCommand for clear invalid demand elements
942
FXMenuCommand* clearInvalidDemandElements = nullptr;
943
/// @}
944
945
/// @name Processing FXMenuCommands for Data mode
946
/// @{
947
948
/// @}
949
950
/// @brief FXMenuCommand for open option menus
951
FXMenuCommand* optionMenus = nullptr;
952
953
private:
954
/// @brief pointer to current GNEApplicationWindow
955
GNEApplicationWindow* myApplicationWindow;
956
957
/// @brief separator for optionsMenu
958
FXMenuSeparator* myOptionsSeparator = nullptr;
959
960
/// @brief separator for checkBox
961
FXMenuSeparator* mySeparatorCheckBox = nullptr;
962
963
/// @brief Invalidated copy constructor.
964
ProcessingMenuCommands(const ProcessingMenuCommands&) = delete;
965
966
/// @brief Invalidated assignment operator.
967
ProcessingMenuCommands& operator=(const ProcessingMenuCommands&) = delete;
968
};
969
970
/// @brief struct for locate menu commands
971
struct LocateMenuCommands {
972
973
/// @brief constructor
974
LocateMenuCommands(GNEApplicationWindow* applicationWindow);
975
976
/// @brief build menu commands
977
void buildLocateMenuCommands(FXMenuPane* locateMenu);
978
979
private:
980
/// @brief pointer to current GNEApplicationWindow
981
GNEApplicationWindow* myApplicationWindow;
982
983
/// @brief Invalidated copy constructor.
984
LocateMenuCommands(const LocateMenuCommands&) = delete;
985
986
/// @brief Invalidated assignment operator.
987
LocateMenuCommands& operator=(const LocateMenuCommands&) = delete;
988
};
989
990
/// @brief struct for locate menu commands
991
struct ToolsMenuCommands {
992
993
/// @brief constructor
994
ToolsMenuCommands(GNEApplicationWindow* applicationWindow);
995
996
/// @brief destructor
997
~ToolsMenuCommands();
998
999
/// @brief build tools (and menu commands)
1000
void buildTools(FXMenuPane* toolsMenu, const std::map<std::string, FXMenuPane*>& menuPaneToolMaps);
1001
1002
/// @brief show tool
1003
long showTool(FXObject* menuCommand);
1004
1005
/// @brief run tool dialog
1006
long runToolDialog(FXObject* menuCommand) const;
1007
1008
/// @brief run postprocessing
1009
long postProcessing(FXObject* menuCommand) const;
1010
1011
private:
1012
/// @brief map with python tools
1013
std::vector<GNEPythonTool*> myPythonTools;
1014
1015
/// @brief python tool dialog
1016
GNEPythonToolDialog* myPythonToolDialog = nullptr;
1017
1018
/// @brief pointer to current GNEApplicationWindow
1019
GNEApplicationWindow* myApplicationWindow;
1020
1021
/// @brief Invalidated copy constructor.
1022
ToolsMenuCommands(const ToolsMenuCommands&) = delete;
1023
1024
/// @brief Invalidated assignment operator.
1025
ToolsMenuCommands& operator=(const ToolsMenuCommands&) = delete;
1026
};
1027
1028
/// @brief struct for windows menu commands
1029
struct WindowsMenuCommands {
1030
1031
/// @brief constructor
1032
WindowsMenuCommands(GNEApplicationWindow* applicationWindow);
1033
1034
/// @brief build menu commands
1035
void buildWindowsMenuCommands(FXMenuPane* windowsMenu, FXStatusBar* statusbar, GUIMessageWindow* messageWindow);
1036
1037
private:
1038
/// @brief pointer to current GNEApplicationWindow
1039
GNEApplicationWindow* myApplicationWindow;
1040
1041
/// @brief Invalidated copy constructor.
1042
WindowsMenuCommands(const WindowsMenuCommands&) = delete;
1043
1044
/// @brief Invalidated assignment operator.
1045
WindowsMenuCommands& operator=(const WindowsMenuCommands&) = delete;
1046
};
1047
1048
/// @brief struct for help menu commands
1049
struct HelpMenuCommands {
1050
1051
/// @brief constructor
1052
HelpMenuCommands(GNEApplicationWindow* applicationWindow);
1053
1054
/// @brief build menu commands
1055
void buildHelpMenuCommands(FXMenuPane* helpMenu);
1056
1057
private:
1058
/// @brief pointer to current GNEApplicationWindow
1059
GNEApplicationWindow* myApplicationWindow;
1060
1061
/// @brief Invalidated copy constructor.
1062
HelpMenuCommands(const HelpMenuCommands&) = delete;
1063
1064
/// @brief Invalidated assignment operator.
1065
HelpMenuCommands& operator=(const HelpMenuCommands&) = delete;
1066
};
1067
1068
/// @brief struct for supermode commands
1069
struct SupermodeCommands {
1070
1071
/// @brief constructor
1072
SupermodeCommands(GNEApplicationWindow* applicationWindow);
1073
1074
/// @brief build menu commands
1075
void buildSupermodeCommands(FXMenuPane* editMenu);
1076
1077
/// @brief show all menu commands
1078
void showSupermodeCommands();
1079
1080
/// @brief set default view
1081
void setDefaultView();
1082
1083
/// @brief set JuPedSim view
1084
void setJuPedSimView();
1085
1086
/// @brief FXMenuCommand for network supermode
1087
FXMenuCommand* networkMode = nullptr;
1088
1089
/// @brief FXMenuCommand for demand supermode
1090
FXMenuCommand* demandMode = nullptr;
1091
1092
/// @brief FXMenuCommand for data supermode
1093
FXMenuCommand* dataMode = nullptr;
1094
1095
private:
1096
/// @brief pointer to current GNEApplicationWindow
1097
GNEApplicationWindow* myApplicationWindow;
1098
1099
/// @brief Invalidated copy constructor.
1100
SupermodeCommands(const SupermodeCommands&) = delete;
1101
1102
/// @brief Invalidated assignment operator.
1103
SupermodeCommands& operator=(const SupermodeCommands&) = delete;
1104
};
1105
1106
/// @brief SUMO config handler
1107
class GNESumoConfigHandler {
1108
1109
public:
1110
/// @brief Constructor
1111
GNESumoConfigHandler(OptionsCont& sumoOptions, const std::string& file);
1112
1113
/// @brief load SUMO config
1114
bool loadSumoConfig();
1115
1116
private:
1117
/// @brief sumo options
1118
OptionsCont& mySumoOptions;
1119
1120
/// @brief SUMO config file
1121
const std::string myFile;
1122
1123
/// @brief Invalidated copy constructor.
1124
GNESumoConfigHandler(const GNESumoConfigHandler&) = delete;
1125
1126
/// @brief Invalidated assignment operator.
1127
GNESumoConfigHandler& operator=(const GNESumoConfigHandler&) = delete;
1128
};
1129
1130
/// @brief netedit config handler
1131
class GNENeteditConfigHandler {
1132
1133
public:
1134
/// @brief Constructor
1135
GNENeteditConfigHandler(const std::string& file);
1136
1137
/// @brief load netedit config
1138
bool loadNeteditConfig();
1139
1140
private:
1141
/// @brief netedit config file
1142
const std::string myFile;
1143
1144
/// @brief Invalidated copy constructor.
1145
GNENeteditConfigHandler(const GNENeteditConfigHandler&) = delete;
1146
1147
/// @brief Invalidated assignment operator.
1148
GNENeteditConfigHandler& operator=(const GNENeteditConfigHandler&) = delete;
1149
};
1150
1151
/// @brief toggle edit options Network menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
1152
static bool toggleEditOptionsNetwork(GNEViewNet* viewNet, const MFXCheckableButton* menuCheck,
1153
FXObject* obj, FXSelector sel);
1154
1155
/// @brief toggle edit options Demand menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
1156
static bool toggleEditOptionsDemand(GNEViewNet* viewNet, const MFXCheckableButton* menuCheck,
1157
FXObject* obj, FXSelector sel);
1158
1159
/// @brief toggle edit options Data menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
1160
static bool toggleEditOptionsData(GNEViewNet* viewNet, const MFXCheckableButton* menuCheck,
1161
FXObject* obj, FXSelector sel);
1162
1163
/// @brief check if a string ends with another string
1164
static bool stringEndsWith(const std::string& str, const std::string& suffix);
1165
1166
private:
1167
/// @brief Invalidated copy constructor.
1168
GNEApplicationWindowHelper(const GNEApplicationWindowHelper&) = delete;
1169
1170
/// @brief Invalidated assignment operator.
1171
GNEApplicationWindowHelper& operator=(const GNEApplicationWindowHelper&) = delete;
1172
};
1173
1174