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