Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNEViewNetHelper.h
193735 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 GNEViewNetHelper.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Feb 2019
17
///
18
// A file used to reduce the size of GNEViewNet.h grouping structs and classes
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <unordered_set>
24
#include <netedit/elements/moving/GNEMoveElement.h>
25
#include <utils/foxtools/MFXButtonTooltip.h>
26
#include <utils/foxtools/MFXCheckableButton.h>
27
#include <utils/foxtools/MFXLCDLabel.h>
28
#include <utils/foxtools/MFXMenuButtonTooltip.h>
29
#include <utils/gui/div/GUIGlobalViewObjectsHandler.h>
30
#include <utils/gui/globjects/GUIGlObject.h>
31
#include <utils/gui/globjects/GUIGlObjectTypes.h>
32
#include <utils/xml/CommonXMLStructure.h>
33
34
// ===========================================================================
35
// enum
36
// ===========================================================================
37
38
/// @brie enum for supermodes
39
enum class Supermode {
40
/// @brief Network mode (Edges, junctions, etc..)
41
NETWORK,
42
///@brief Demand mode (Routes, Vehicles etc..)
43
DEMAND,
44
///@brief Data mode (edgeData, LaneData etc..)
45
DATA
46
};
47
48
/// @brie enum for network edit modes
49
enum class NetworkEditMode {
50
/// @brief empty Network mode
51
NETWORK_NONE,
52
///@brief mode for inspecting network elements
53
NETWORK_INSPECT,
54
///@brief mode for deleting network elements
55
NETWORK_DELETE,
56
///@brief mode for selecting network elements
57
NETWORK_SELECT,
58
///@brief mode for moving network elements
59
NETWORK_MOVE,
60
///@brief mode for creating new edges
61
NETWORK_CREATE_EDGE,
62
///@brief mode for connecting lanes
63
NETWORK_CONNECT,
64
///@brief mode for editing tls
65
NETWORK_TLS,
66
///@brief Mode for editing additionals
67
NETWORK_ADDITIONAL,
68
///@brief Mode for editing crossing
69
NETWORK_CROSSING,
70
///@brief Mode for editing TAZ
71
NETWORK_TAZ,
72
///@brief Mode for editing Polygons
73
NETWORK_SHAPE,
74
///@brief Mode for editing connection prohibitions
75
NETWORK_PROHIBITION,
76
///@brief Mode for editing wires
77
NETWORK_WIRE,
78
///@brief Mode for editing decals
79
NETWORK_DECAL
80
};
81
82
/// @brie enum for demand edit modes
83
enum class DemandEditMode {
84
/// @brief empty Demand mode
85
DEMAND_NONE,
86
///@brief mode for inspecting demand elements
87
DEMAND_INSPECT,
88
///@brief mode for deleting demand elements
89
DEMAND_DELETE,
90
///@brief mode for selecting demand elements
91
DEMAND_SELECT,
92
///@brief mode for moving demand elements
93
DEMAND_MOVE,
94
///@brief Mode for editing routes
95
DEMAND_ROUTE,
96
///@brief Mode for editing route distributions
97
DEMAND_ROUTEDISTRIBUTION,
98
///@brief Mode for editing vehicles
99
DEMAND_VEHICLE,
100
///@brief Mode for editing types
101
DEMAND_TYPE,
102
///@brief Mode for editing type distributions
103
DEMAND_TYPEDISTRIBUTION,
104
///@brief Mode for editing stops
105
DEMAND_STOP,
106
///@brief Mode for editing person
107
DEMAND_PERSON,
108
///@brief Mode for editing person plan
109
DEMAND_PERSONPLAN,
110
///@brief Mode for editing container
111
DEMAND_CONTAINER,
112
///@brief Mode for editing container plan
113
DEMAND_CONTAINERPLAN
114
};
115
116
/// @brief enum for data edit modes
117
enum class DataEditMode {
118
/// @brief empty Data mode
119
DATA_NONE,
120
/// @brief mode for inspecting data elements
121
DATA_INSPECT,
122
/// @brief mode for deleting data elements
123
DATA_DELETE,
124
/// @brief mode for selecting data elements
125
DATA_SELECT,
126
/// @brief mode for create edgeData elements
127
DATA_EDGEDATA,
128
/// @brief mode for create edgeRelData elements
129
DATA_EDGERELDATA,
130
/// @brief mode for create TAZRelData elements
131
DATA_TAZRELDATA,
132
/// @brief mode for create meanData elements
133
DATA_MEANDATA
134
};
135
136
// ===========================================================================
137
// class declarations
138
// ===========================================================================
139
140
class GNEAttributeCarrier;
141
class GNEFrame;
142
class GNENet;
143
class GNETagPropertiesDatabase;
144
class GNEUndoList;
145
class GNEViewNet;
146
class GNEViewParent;
147
// dialogs
148
class GNEVClassesDialog;
149
class GNEFixNetworkElements;
150
class GNEFixAdditionalElementsDialog;
151
class GNEFixDemandElementsDialog;
152
// network elements
153
class GNENetworkElement;
154
class GNEJunction;
155
class GNEEdge;
156
class GNELane;
157
class GNEConnection;
158
class GNECrossing;
159
class GNEWalkingArea;
160
class GNEInternalLane;
161
// additional elements
162
class GNEAdditional;
163
class GNEPoly;
164
class GNEPOI;
165
class GNETAZ;
166
// demand elements
167
class GNEDemandElement;
168
// data elements
169
class GNEDataSet;
170
class GNEGenericData;
171
class GNEEdgeData;
172
class GNEEdgeRelData;
173
class GNETAZRelData;
174
175
// ===========================================================================
176
// classes and structs definitions
177
// ===========================================================================
178
179
struct GNEViewNetHelper {
180
181
/// @brief lock manager
182
class LockManager {
183
184
public:
185
/// @brief constructor
186
LockManager(GNEViewNet* viewNet);
187
188
/// @brief destructor
189
~LockManager();
190
191
/// @brief check if given GLObject is locked for inspect, select, delete and move
192
bool isObjectLocked(GUIGlObjectType objectType, const bool selected) const;
193
194
/// @brief update flags
195
void updateFlags();
196
197
/// @brief update lock inspect menuBar
198
void updateLockMenuBar();
199
200
private:
201
/// @brief operation locked
202
class OperationLocked {
203
204
public:
205
/// @brief constructor
206
OperationLocked();
207
208
/// @brief parameter constructor
209
OperationLocked(Supermode supermode);
210
211
/// @brief destructor
212
~OperationLocked();
213
214
/// @brief get supermode
215
Supermode getSupermode() const;
216
217
/// @brief flag for lock/unlock
218
bool lock = false;
219
220
private:
221
/// @brief supermode associated with this operation locked
222
Supermode mySupermode;
223
};
224
225
/// @brief pointer to viewNet
226
GNEViewNet* myViewNet;
227
228
/// @brief map with locked elements
229
std::map<GUIGlObjectType, OperationLocked> myLockedElements;
230
231
/// @brief Invalidated copy constructor.
232
LockManager(const LockManager&) = delete;
233
234
/// @brief Invalidated assignment operator.
235
LockManager& operator=(const LockManager&) = delete;
236
};
237
238
/// @brief class used for group inspected elements
239
class InspectedElements {
240
241
public:
242
/// @brief constructor
243
InspectedElements();
244
245
/// @name inspect functions
246
/// @{
247
/// @brief inspect AC
248
void inspectAC(GNEAttributeCarrier* AC);
249
250
/// @brief inspect multiple ACs
251
void inspectACs(const std::vector<GNEAttributeCarrier*>& ACs);
252
253
/// @brief uninspect AC
254
void uninspectAC(GNEAttributeCarrier* AC);
255
256
/// @brief clear inspected AC
257
void clearInspectedElements();
258
259
/// @}
260
261
/// @name get functions
262
/// @{
263
/// @brief get first inspected AC (needed because the main container is a hash)
264
GNEAttributeCarrier* getFirstAC() const;
265
266
/// @brief get hash table with all inspected ACs
267
const std::unordered_set<GNEAttributeCarrier*>& getACs() const;
268
269
/// @}
270
271
/// @name check functions
272
/// @{
273
// @brief check if the given AC is inspected
274
bool isACInspected(GNEAttributeCarrier* AC) const;
275
276
// @brief check if the given constant AC is inspected
277
bool isACInspected(const GNEAttributeCarrier* AC) const;
278
279
/// @brief check if we're inspecting at least one element
280
bool isInspectingElements() const;
281
282
/// @brief check if we're inspecting exactly one element
283
bool isInspectingSingleElement() const;
284
285
/// @brief check if we're inspecting more than one elements
286
bool isInspectingMultipleElements() const;
287
288
/// @}
289
290
private:
291
/// @brief first inspected element (usually the clicked element)
292
GNEAttributeCarrier* myFirstInspectedAC = nullptr;
293
294
/// @brief hash table with all inspected ACs (we use a set to make deletion of massive elements more quickly)
295
std::unordered_set<GNEAttributeCarrier*> myInspectedACs;
296
297
/// @brief Invalidated copy constructor.
298
InspectedElements(const InspectedElements&) = delete;
299
300
/// @brief Invalidated assignment operator.
301
InspectedElements& operator=(const InspectedElements&) = delete;
302
};
303
304
/// @brief class used for group front elements
305
class MarkFrontElements {
306
307
/// @brief only GNEAttributeCarrier have access to mark/unmarkAC
308
friend class GNEAttributeCarrier;
309
310
public:
311
/// @brief constructor
312
MarkFrontElements();
313
314
/// @brief get hash table with all fronted ACs
315
const std::unordered_set<GNEAttributeCarrier*>& getACs() const;
316
317
/// @brief unmark all ACs
318
void unmarkAll();
319
320
protected:
321
/// @brief mark AC as drawing front
322
void markAC(GNEAttributeCarrier* AC);
323
324
/// @brief unmark AC for drawing front
325
void unmarkAC(GNEAttributeCarrier* AC);
326
327
private:
328
/// @brief hash table with all marked ACs (we use a set to make deletion of massive elements more quickly)
329
std::unordered_set<GNEAttributeCarrier*> myMarkedACs;
330
331
/// @brief Invalidated copy constructor.
332
MarkFrontElements(const MarkFrontElements&) = delete;
333
334
/// @brief Invalidated assignment operator.
335
MarkFrontElements& operator=(const MarkFrontElements&) = delete;
336
};
337
338
/// @brief class used to group all variables related with objects under cursor after a click over view
339
class ViewObjectsSelector {
340
341
public:
342
/// @brief constructor
343
ViewObjectsSelector(GNEViewNet* viewNet);
344
345
/// @brief update objects (using gViewObjectsHandler)
346
void updateObjects();
347
348
/// @brief update merging junctions
349
void updateMergingJunctions();
350
351
/// @brief fill the given SUMO base object with the current single objects
352
void fillSumoBaseObject(CommonXMLStructure::SumoBaseObject* baseObjet) const;
353
354
/// @brief filter all elements except the given GLO type
355
void filterAllExcept(GUIGlObjectType exception);
356
357
/// @brief filter by supermode
358
void filterBySuperMode();
359
360
/// @brief filter (remove) junctions
361
void filterJunctions();
362
363
/// @brief filter (remove) edges
364
void filterEdges();
365
366
/// @brief filter (remove) lanes
367
void filterLanes();
368
369
/// @brief filter (remove) connections
370
void filterConnections();
371
372
/// @brief filter (remove) crossings
373
void filterCrossings();
374
375
/// @brief filter (remove) walkingAreas
376
void filterWalkingAreas();
377
378
/// @brief filter (remove) polys and POIs
379
void filterShapes();
380
381
/// @brief filter (remove) additionals
382
void filterAdditionals(const bool includeStoppigPlaces, const bool includeTAZs);
383
384
/// @brief filter (remove) network elements
385
void filterNetworkElements();
386
387
/// @brief filter (remove) demand elements
388
void filterDemandElements(const bool includeRoutes);
389
390
/// @brief filter (remove) datga elements
391
void filterDataElements();
392
393
/// @brief filter locked elements (except the ignoreFilter)
394
void filterLockedElements(const std::vector<GUIGlObjectType> ignoreFilter = {});
395
396
/// @brief get front GUIGLObject or a pointer to nullptr
397
const GUIGlObject* getGUIGlObjectFront() const;
398
399
/// @brief get front attribute carrier or a pointer to nullptr
400
GNEAttributeCarrier* getAttributeCarrierFront() const;
401
402
/// @brief get front network element or a pointer to nullptr
403
GNENetworkElement* getNetworkElementFront() const;
404
405
/// @brief get front additional element or a pointer to nullptr
406
GNEAdditional* getAdditionalFront() const;
407
408
/// @brief get front demand element or a pointer to nullptr
409
GNEDemandElement* getDemandElementFront() const;
410
411
/// @brief get generic data element or a pointer to nullptr
412
GNEGenericData* getGenericDataElementFront() const;
413
414
/// @brief get front junction or a pointer to nullptr
415
GNEJunction* getJunctionFront() const;
416
417
/// @brief get front edge or a pointer to nullptr
418
GNEEdge* getEdgeFront() const;
419
420
/// @brief get front lane or a pointer to nullptr
421
GNELane* getLaneFront() const;
422
423
/// @brief get front lane or a pointer to nullptr checking if is locked
424
GNELane* getLaneFrontNonLocked() const;
425
426
/// @brief get lanes
427
const std::vector<GNELane*>& getLanes() const;
428
429
/// @brief get front crossing or a pointer to nullptr
430
GNECrossing* getCrossingFront() const;
431
432
/// @brief get front walkingArea or a pointer to nullptr
433
GNEWalkingArea* getWalkingAreaFront() const;
434
435
/// @brief get front connection or a pointer to nullptr
436
GNEConnection* getConnectionFront() const;
437
438
/// @brief get front internal lane or a pointer to nullptr
439
GNEInternalLane* getInternalLaneFront() const;
440
441
/// @brief get front TAZ or a pointer to nullptr
442
GNETAZ* getTAZFront() const;
443
444
/// @brief get front POI or a pointer to nullptr
445
GNEPOI* getPOIFront() const;
446
447
/// @brief get front Poly or a pointer to nullptr
448
GNEPoly* getPolyFront() const;
449
450
/// @brief get edge data element or a pointer to nullptr
451
GNEEdgeData* getEdgeDataElementFront() const;
452
453
/// @brief get edge rel data element or a pointer to nullptr
454
GNEEdgeRelData* getEdgeRelDataElementFront() const;
455
456
/// @brief get TAZ rel data element or a pointer to nullptr
457
GNETAZRelData* getTAZRelDataElementFront() const;
458
459
/// @brief get vector with GL objects
460
const std::vector<GUIGlObject*>& getGLObjects() const;
461
462
/// @brief get vector with ACs
463
const std::vector<GNEAttributeCarrier*>& getAttributeCarriers() const;
464
465
/// @brief get vector with junctions
466
const std::vector<GNEJunction*>& getJunctions() const;
467
468
/// @brief get vector with edges
469
const std::vector<GNEEdge*>& getEdges() const;
470
471
/// @brief get vector with TAZs
472
const std::vector<GNETAZ*>& getTAZs() const;
473
474
/// @brief get vector with additionals
475
const std::vector<GNEAdditional*>& getAdditionals() const;
476
477
/// @brief get vector with Demand Elements
478
const std::vector<GNEDemandElement*>& getDemandElements() const;
479
480
/// @brief get merging junctions
481
const std::vector<const GNEJunction*>& getMergingJunctions() const;
482
483
protected:
484
/// @brief objects container
485
class ViewObjectsContainer {
486
487
public:
488
/// @brief constructor
489
ViewObjectsContainer();
490
491
/// @brief clear elements
492
void clearElements();
493
494
/// @brief reseve memory for all elements
495
void reserve(int size);
496
497
/// @brief filter elements
498
void filterElements(const std::vector<const GUIGlObject*>& objects);
499
500
/// @brief vector with the GUIGlObjects
501
std::vector<GUIGlObject*> GUIGlObjects;
502
503
/// @brief vector with the attribute carriers
504
std::vector<GNEAttributeCarrier*> attributeCarriers;
505
506
/// @brief vector with the network elements
507
std::vector<GNENetworkElement*> networkElements;
508
509
/// @brief vector with the additional elements
510
std::vector<GNEAdditional*> additionals;
511
512
/// @brief vector with the demand elements
513
std::vector<GNEDemandElement*> demandElements;
514
515
/// @brief vector with the generic datas
516
std::vector<GNEGenericData*> genericDatas;
517
518
/// @brief vector with the junctions
519
std::vector<GNEJunction*> junctions;
520
521
/// @brief vector with the edges
522
std::vector<GNEEdge*> edges;
523
524
/// @brief vector with the lanes
525
std::vector<GNELane*> lanes;
526
527
/// @brief vector with the crossings
528
std::vector<GNECrossing*> crossings;
529
530
/// @brief vector with the walkingAreas
531
std::vector<GNEWalkingArea*> walkingAreas;
532
533
/// @brief vector with the connections
534
std::vector<GNEConnection*> connections;
535
536
/// @brief vector with the internal lanes
537
std::vector<GNEInternalLane*> internalLanes;
538
539
/// @brief vector with the TAZ elements
540
std::vector<GNETAZ*> TAZs;
541
542
/// @brief vector with the POIs
543
std::vector<GNEPOI*> POIs;
544
545
/// @brief vector with the polys
546
std::vector<GNEPoly*> polys;
547
548
/// @brief vector with the edge datas
549
std::vector<GNEEdgeData*> edgeDatas;
550
551
/// @brief vector with the edge relation datas
552
std::vector<GNEEdgeRelData*> edgeRelDatas;
553
554
/// @brief vector with the TAZ relation datas
555
std::vector<GNETAZRelData*> TAZRelDatas;
556
557
private:
558
/// @brief Invalidated copy constructor.
559
ViewObjectsContainer(const ViewObjectsContainer&) = delete;
560
561
/// @brief Invalidated assignment operator.
562
ViewObjectsContainer& operator=(const ViewObjectsContainer&) = delete;
563
};
564
565
/// @brief pointer to viewNet
566
const GNEViewNet* myViewNet;
567
568
/// @brief objects container with selected objects
569
ViewObjectsContainer myViewObjects;
570
571
/// @brief merging junctions
572
std::vector<const GNEJunction*> myMergingJunctions;
573
574
private:
575
/// @brief update network elements
576
void updateNetworkElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
577
578
/// @brief update additional elements
579
void updateAdditionalElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
580
581
/// @brief update shape elements
582
void updateShapeElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
583
584
/// @brief update TAZ elements
585
void updateTAZElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
586
587
/// @brief update demand elements
588
void updateDemandElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
589
590
/// @brief update generic data elements
591
void updateGenericDataElements(ViewObjectsContainer& container, const GUIGlObject* glObject);
592
593
/// @brief process GL objects
594
void processGUIGlObjects(const GUIViewObjectsHandler::GLObjectsSortedContainer& objectsContainer);
595
596
/// @brief default constructor
597
ViewObjectsSelector();
598
599
/// @brief Invalidated copy constructor.
600
ViewObjectsSelector(const ViewObjectsSelector&) = delete;
601
602
/// @brief Invalidated assignment operator.
603
ViewObjectsSelector& operator=(const ViewObjectsSelector&) = delete;
604
};
605
606
/// @brief class used to group all variables related with mouse buttons and key pressed after certain events
607
struct MouseButtonKeyPressed {
608
609
/// @brief constructor
610
MouseButtonKeyPressed();
611
612
/// @brief update status of MouseButtonKeyPressed during current event
613
void update(void* eventData);
614
615
/// @brief check if SHIFT is pressed during current event
616
bool shiftKeyPressed() const;
617
618
/// @brief check if CONTROL is pressed during current event
619
bool controlKeyPressed() const;
620
621
/// @brief check if ALT is pressed during current event
622
bool altKeyPressed() const;
623
624
/// @brief check if mouse left button is pressed during current event
625
bool mouseLeftButtonPressed() const;
626
627
/// @brief check if mouse right button is pressed during current event
628
bool mouseRightButtonPressed() const;
629
630
private:
631
/// @brief information of event (must be updated)
632
FXEvent* myEventInfo;
633
634
/// @brief Invalidated copy constructor.
635
MouseButtonKeyPressed(const MouseButtonKeyPressed&) = delete;
636
637
/// @brief Invalidated assignment operator.
638
MouseButtonKeyPressed& operator=(const MouseButtonKeyPressed&) = delete;
639
};
640
641
/// @brief struct used to group all variables related with save elements
642
struct SaveElements {
643
644
/// @brief default constructor
645
SaveElements(GNEViewNet* viewNet);
646
647
/// @brief destructor
648
~SaveElements();
649
650
/// @brief build save buttons
651
void buildSaveElementsButtons();
652
653
/// @brief enable or disable save individual files
654
void setSaveIndividualFiles(bool value);
655
656
private:
657
/// @brief pointer to net
658
GNEViewNet* myViewNet;
659
660
/// The locator menu
661
FXPopup* mySaveIndividualFilesPopup = nullptr;
662
663
/// @brief checkable button for save individual files
664
MFXMenuButtonTooltip* mySaveIndividualFiles = nullptr;
665
666
/// @brief checkable button for save netedit config
667
MFXButtonTooltip* mySaveNeteditConfig = nullptr;
668
669
/// @brief checkable button for save SUMO config
670
MFXButtonTooltip* mySaveSumoConfig = nullptr;
671
672
/// @brief checkable button for save network
673
MFXButtonTooltip* mySaveNetwork = nullptr;
674
675
/// @brief checkable button for save additional elements
676
MFXButtonTooltip* mySaveAdditionalElements = nullptr;
677
678
/// @brief checkable button for save demand elements
679
MFXButtonTooltip* mySaveDemandElements = nullptr;
680
681
/// @brief checkable button for save genericdata elements
682
MFXButtonTooltip* mySaveDataElements = nullptr;
683
684
/// @brief checkable button for save meanData elements
685
MFXButtonTooltip* mySaveMeanDataElements = nullptr;
686
687
/// @brief Invalidated copy constructor.
688
SaveElements(const SaveElements&) = delete;
689
690
/// @brief Invalidated assignment operator.
691
SaveElements& operator=(const SaveElements&) = delete;
692
};
693
694
/// @brief struct used to group all variables related with time format
695
struct TimeFormat {
696
697
/// @brief default constructor
698
TimeFormat(GNEViewNet* viewNet);
699
700
/// @brief build time format buttons
701
void buildTimeFormatButtons();
702
703
/// @brief switch time format
704
void switchTimeFormat();
705
706
/// @brief update button label
707
void updateButtonLabel();
708
709
private:
710
/// @brief pointer to net
711
GNEViewNet* myViewNet;
712
713
/// @brief checkable button for switch between timeSteps and HH:MM:SS
714
MFXButtonTooltip* mySwitchButton = nullptr;
715
716
/// @brief Invalidated copy constructor.
717
TimeFormat(const TimeFormat&) = delete;
718
719
/// @brief Invalidated assignment operator.
720
TimeFormat& operator=(const TimeFormat&) = delete;
721
};
722
723
/// @brief struct used to group all variables related with Supermodes
724
struct EditModes {
725
726
/// @brief constructor
727
EditModes(GNEViewNet* viewNet);
728
729
/// @brief destructor
730
~EditModes();
731
732
/// @brief build checkable buttons
733
void buildSuperModeButtons();
734
735
/// @brief set supermode
736
void setSupermode(Supermode supermode, const bool force);
737
738
/// @brief set Network edit mode
739
void setNetworkEditMode(NetworkEditMode networkMode, const bool force = false);
740
741
/// @brief set Demand edit mode
742
void setDemandEditMode(DemandEditMode demandMode, const bool force = false);
743
744
/// @brief set Data edit mode
745
void setDataEditMode(DataEditMode dataMode, const bool force = false);
746
747
/// @check if current supermode is Network
748
bool isCurrentSupermodeNetwork() const;
749
750
/// @check if current supermode is Demand
751
bool isCurrentSupermodeDemand() const;
752
753
/// @check if current supermode is Data
754
bool isCurrentSupermodeData() const;
755
756
/// @brief set view
757
void setView(FXSelector sel);
758
759
/// @brief check if default view is enabled
760
bool isDefaultView() const;
761
762
/// @brief check if default view is enabled
763
bool isJuPedSimView() const;
764
765
/// @brief the current supermode
766
Supermode currentSupermode;
767
768
/// @brief the current Network edit mode
769
NetworkEditMode networkEditMode;
770
771
/// @brief the current Demand edit mode
772
DemandEditMode demandEditMode;
773
774
/// @brief the current Data edit mode
775
DataEditMode dataEditMode;
776
777
/// @brief checkable button for supermode Network
778
MFXCheckableButton* networkButton = nullptr;
779
780
/// @brief checkable button for supermode Demand
781
MFXCheckableButton* demandButton = nullptr;
782
783
/// @brief checkable button for supermode Data
784
MFXCheckableButton* dataButton = nullptr;
785
786
private:
787
/// @brief pointer to net
788
GNEViewNet* myViewNet;
789
790
/// @brief The netedit views menu
791
FXPopup* myNeteditViewsPopup = nullptr;
792
793
/// @brief The netedit views button
794
MFXMenuButtonTooltip* myNeteditViewsButton = nullptr;
795
796
/// @brief The default view button
797
MFXButtonTooltip* myDefaultViewButton = nullptr;
798
799
/// @brief The jupedsim view button
800
MFXButtonTooltip* myJuPedSimViewButton = nullptr;
801
802
/// @brief Invalidated copy constructor.
803
EditModes(const EditModes&) = delete;
804
805
/// @brief Invalidated assignment operator.
806
EditModes& operator=(const EditModes&) = delete;
807
};
808
809
/// @brief struct used to group all variables related to view options in supermode Network
810
struct NetworkViewOptions {
811
812
/// @brief default constructor
813
NetworkViewOptions(GNEViewNet* viewNet);
814
815
/// @brief build menu checks
816
void buildNetworkViewOptionsMenuChecks();
817
818
/// @brief hide all options menu checks
819
void hideNetworkViewOptionsMenuChecks();
820
821
/// @brief get visible network menu commands
822
void getVisibleNetworkMenuCommands(std::vector<MFXCheckableButton*>& commands) const;
823
824
/// @brief check if vehicles must be drawn spread
825
bool drawSpreadVehicles() const;
826
827
/// @brief check if show demand elements checkbox is enabled
828
bool showDemandElements() const;
829
830
/// @brief check if select edges checkbox is enabled
831
bool selectEdges() const;
832
833
/// @brief check if select show connections checkbox is enabled
834
bool showConnections() const;
835
836
/// @brief check if show sub-additionals
837
bool showSubAdditionals() const;
838
839
/// @brief check if show TAZ Elements
840
bool showTAZElements() const;
841
842
/// @brief check if we're editing elevation
843
bool editingElevation() const;
844
845
/// @brief checkable button to show grid button
846
MFXCheckableButton* menuCheckToggleGrid = nullptr;
847
848
/// @brief checkable button to show junction shapes
849
MFXCheckableButton* menuCheckToggleDrawJunctionShape = nullptr;
850
851
/// @brief checkable button to draw vehicles in begin position or spread in lane
852
MFXCheckableButton* menuCheckDrawSpreadVehicles = nullptr;
853
854
/// @brief checkable button to show Demand Elements
855
MFXCheckableButton* menuCheckShowDemandElements = nullptr;
856
857
/// @brief checkable button to select only edges
858
MFXCheckableButton* menuCheckSelectEdges = nullptr;
859
860
/// @brief checkable button to show connections
861
MFXCheckableButton* menuCheckShowConnections = nullptr;
862
863
/// @brief checkable button to hide connections in connect mode
864
MFXCheckableButton* menuCheckHideConnections = nullptr;
865
866
/// @brief checkable button to show additional sub-elements
867
MFXCheckableButton* menuCheckShowAdditionalSubElements = nullptr;
868
869
/// @brief checkable button to show TAZ elements
870
MFXCheckableButton* menuCheckShowTAZElements = nullptr;
871
872
/// @brief checkable button to extend to edge nodes
873
MFXCheckableButton* menuCheckExtendSelection = nullptr;
874
875
/// @brief checkable button to set change all phases
876
MFXCheckableButton* menuCheckChangeAllPhases = nullptr;
877
878
/// @brief checkable button to we should't warn about merging junctions
879
MFXCheckableButton* menuCheckMergeAutomatically = nullptr;
880
881
/// @brief checkable button to show connection as bubble in "Move" mode.
882
MFXCheckableButton* menuCheckShowJunctionBubble = nullptr;
883
884
/// @brief checkable button to apply movement to elevation
885
MFXCheckableButton* menuCheckMoveElevation = nullptr;
886
887
/// @brief checkable button to the endpoint for a created edge should be set as the new source
888
MFXCheckableButton* menuCheckChainEdges = nullptr;
889
890
/// @brief check checkable to create auto create opposite edge
891
MFXCheckableButton* menuCheckAutoOppositeEdge = nullptr;
892
893
private:
894
/// @brief pointer to net
895
GNEViewNet* myViewNet;
896
897
/// @brief Invalidated copy constructor.
898
NetworkViewOptions(const NetworkViewOptions&) = delete;
899
900
/// @brief Invalidated assignment operator.
901
NetworkViewOptions& operator=(const NetworkViewOptions&) = delete;
902
};
903
904
/// @brief struct used to group all variables related to view options in supermode Demand
905
struct DemandViewOptions {
906
907
/// @brief default constructor
908
DemandViewOptions(GNEViewNet* viewNet);
909
910
/// @brief build menu checks
911
void buildDemandViewOptionsMenuChecks();
912
913
/// @brief hide all options menu checks
914
void hideDemandViewOptionsMenuChecks();
915
916
/// @brief get visible demand menu commands
917
void getVisibleDemandMenuCommands(std::vector<MFXCheckableButton*>& commands) const;
918
919
/// @brief check if vehicles must be drawn spread
920
bool drawSpreadVehicles() const;
921
922
/// @brief check if non inspected element has to be hidden
923
bool showNonInspectedDemandElements(const GNEDemandElement* demandElement) const;
924
925
/// @brief check if shapes has to be drawn
926
bool showShapes() const;
927
928
/// @brief check if trips has to be drawn
929
bool showAllTrips() const;
930
931
/// @brief check all person plans has to be show
932
bool showAllPersonPlans() const;
933
934
/// @brief lock person
935
void lockPerson(const GNEDemandElement* person);
936
937
/// @brief unlock person
938
void unlockPerson();
939
940
/// @brief get locked person
941
const GNEDemandElement* getLockedPerson() const;
942
943
/// @brief check all container plans has to be show
944
bool showAllContainerPlans() const;
945
946
/// @brief lock container
947
void lockContainer(const GNEDemandElement* container);
948
949
/// @brief unlock container
950
void unlockContainer();
951
952
/// @brief show overlapped routes
953
bool showOverlappedRoutes() const;
954
955
/// @brief get locked container
956
const GNEDemandElement* getLockedContainer() const;
957
958
/// @brief menu check to show grid button
959
MFXCheckableButton* menuCheckToggleGrid = nullptr;
960
961
/// @brief checkable button to show junction shapes
962
MFXCheckableButton* menuCheckToggleDrawJunctionShape = nullptr;
963
964
/// @brief menu check to draw vehicles in begin position or spread in lane
965
MFXCheckableButton* menuCheckDrawSpreadVehicles = nullptr;
966
967
/// @brief Hide shapes (Polygons and POIs)
968
MFXCheckableButton* menuCheckHideShapes = nullptr;
969
970
/// @brief show all trips
971
MFXCheckableButton* menuCheckShowAllTrips = nullptr;
972
973
/// @brief show all person plans
974
MFXCheckableButton* menuCheckShowAllPersonPlans = nullptr;
975
976
/// @brief Lock Person
977
MFXCheckableButton* menuCheckLockPerson = nullptr;
978
979
/// @brief show all container plans
980
MFXCheckableButton* menuCheckShowAllContainerPlans = nullptr;
981
982
/// @brief Lock Container
983
MFXCheckableButton* menuCheckLockContainer = nullptr;
984
985
/// @brief Hide non inspected demand elements
986
MFXCheckableButton* menuCheckHideNonInspectedDemandElements = nullptr;
987
988
/// @brief show overlapped routes
989
MFXCheckableButton* menuCheckShowOverlappedRoutes = nullptr;
990
991
private:
992
/// @brief pointer to net
993
GNEViewNet* myViewNet;
994
995
/// @brief pointer to locked person
996
const GNEDemandElement* myLockedPerson = nullptr;
997
998
/// @brief pointer to locked container
999
const GNEDemandElement* myLockedContainer = nullptr;
1000
1001
/// @brief Invalidated copy constructor.
1002
DemandViewOptions(const DemandViewOptions&) = delete;
1003
1004
/// @brief Invalidated assignment operator.
1005
DemandViewOptions& operator=(const DemandViewOptions&) = delete;
1006
};
1007
1008
/// @brief struct used to group all variables related to view options in supermode Data
1009
struct DataViewOptions {
1010
1011
/// @brief default constructor
1012
DataViewOptions(GNEViewNet* viewNet);
1013
1014
/// @brief build menu checks
1015
void buildDataViewOptionsMenuChecks();
1016
1017
/// @brief hide all options menu checks
1018
void hideDataViewOptionsMenuChecks();
1019
1020
/// @brief get visible demand menu commands
1021
void getVisibleDataMenuCommands(std::vector<MFXCheckableButton*>& commands) const;
1022
1023
/// @brief check if additionals has to be drawn
1024
bool showAdditionals() const;
1025
1026
/// @brief check if shapes has to be drawn
1027
bool showShapes() const;
1028
1029
/// @brief check if show demand elements checkbox is enabled
1030
bool showDemandElements() const;
1031
1032
/// @brief check if toggle TAZRel drawing checkbox is enabled
1033
bool TAZRelDrawing() const;
1034
1035
/// @brief check if toggle TAZ draw fill checkbox is enabled
1036
bool TAZDrawFill() const;
1037
1038
/// @brief check if toggle TAZRel only from checkbox is enabled
1039
bool TAZRelOnlyFrom() const;
1040
1041
/// @brief check if toggle TAZRel only to checkbox is enabled
1042
bool TAZRelOnlyTo() const;
1043
1044
/// @brief checkable button to show junction shapes
1045
MFXCheckableButton* menuCheckToggleDrawJunctionShape = nullptr;
1046
1047
/// @brief menu check to show Additionals
1048
MFXCheckableButton* menuCheckShowAdditionals = nullptr;
1049
1050
/// @brief menu check to show Shapes
1051
MFXCheckableButton* menuCheckShowShapes = nullptr;
1052
1053
/// @brief menu check to show Demand Elements
1054
MFXCheckableButton* menuCheckShowDemandElements = nullptr;
1055
1056
/// @brief menu check to toggle TAZ Rel drawing
1057
MFXCheckableButton* menuCheckToggleTAZRelDrawing = nullptr;
1058
1059
/// @brief menu check to toggle TAZ draw fill
1060
MFXCheckableButton* menuCheckToggleTAZDrawFill = nullptr;
1061
1062
/// @brief menu check to toggle TAZRel only from
1063
MFXCheckableButton* menuCheckToggleTAZRelOnlyFrom = nullptr;
1064
1065
/// @brief menu check to toggle TAZRel only to
1066
MFXCheckableButton* menuCheckToggleTAZRelOnlyTo = nullptr;
1067
1068
private:
1069
/// @brief pointer to net
1070
GNEViewNet* myViewNet;
1071
1072
/// @brief Invalidated copy constructor.
1073
DataViewOptions(const DataViewOptions&) = delete;
1074
1075
/// @brief Invalidated assignment operator.
1076
DataViewOptions& operator=(const DataViewOptions&) = delete;
1077
};
1078
1079
/// @brief class used to group all variables related to interval bar
1080
class IntervalBar {
1081
1082
public:
1083
/// @brief default constructor
1084
IntervalBar(GNEViewNet* viewNet);
1085
1086
/// @brief build interval bar elements
1087
void buildIntervalBarElements();
1088
1089
/// @brief show interval option bar
1090
void showIntervalBar();
1091
1092
/// @brief hide all options menu checks
1093
void hideIntervalBar();
1094
1095
/// @brief update interval bar
1096
void updateIntervalBar();
1097
1098
// @brief mark for update
1099
void markForUpdate();
1100
1101
/// @name get functions (called by GNEViewNet)
1102
/// @{
1103
1104
/// @brief get generic data type
1105
SumoXMLTag getGenericDataType() const;
1106
1107
/// @brief get dataSet
1108
GNEDataSet* getDataSet() const;
1109
1110
/// @brief get begin
1111
double getBegin() const;
1112
1113
/// @brief get end
1114
double getEnd() const;
1115
1116
/// @brief get parameter
1117
std::string getParameter() const;
1118
1119
/// @}
1120
1121
/// @name set functions (called by GNEViewNet)
1122
/// @{
1123
1124
/// @brief set generic data type
1125
void setGenericDataType();
1126
1127
/// @brief set dataSet
1128
void setDataSet();
1129
1130
/// @brief update limit by interval
1131
void setInterval();
1132
1133
/// @brief set begin
1134
void setBegin();
1135
1136
/// @brief set end
1137
void setEnd();
1138
1139
/// @brief set parameter
1140
void setParameter();
1141
1142
/// @}
1143
1144
protected:
1145
/// @brief enable interval bar
1146
void enableIntervalBar();
1147
1148
/// @brief disable interval bar
1149
void disableIntervalBar();
1150
1151
private:
1152
/// @brief pointer to net
1153
GNEViewNet* myViewNet;
1154
1155
/// @brief flag for update interval bar
1156
bool myUpdateInterval = true;
1157
1158
/// @brief combo box for generic data types
1159
MFXComboBoxIcon* myGenericDataTypesComboBox = nullptr;
1160
1161
/// @brief combo box for data sets
1162
MFXComboBoxIcon* myDataSetsComboBox = nullptr;
1163
1164
/// @brief checkbox for limit data elements by interval
1165
FXCheckButton* myIntervalCheckBox = nullptr;
1166
1167
/// @brief text field for interval begin
1168
FXTextField* myBeginTextField = nullptr;
1169
1170
/// @brief text field for interval end
1171
FXTextField* myEndTextField = nullptr;
1172
1173
/// @brief combo box for filtered parameters
1174
MFXComboBoxIcon* myParametersComboBox = nullptr;
1175
1176
/// @brief current dataSets
1177
std::vector<std::string> myDataSets;
1178
1179
/// @brief current parameters
1180
std::set<std::string> myParameters;
1181
1182
/// @brief Invalidated copy constructor.
1183
IntervalBar(const IntervalBar&) = delete;
1184
1185
/// @brief Invalidated assignment operator.
1186
IntervalBar& operator=(const IntervalBar&) = delete;
1187
};
1188
1189
/// @brief struct used to group all variables related with movement of single elements
1190
struct MoveSingleElementModul {
1191
1192
/// @brief constructor
1193
MoveSingleElementModul(GNEViewNet* viewNet);
1194
1195
/// @brief begin move network elementshape
1196
bool beginMoveNetworkElementShape();
1197
1198
/// @brief begin move single element in Network mode
1199
bool beginMoveSingleElementNetworkMode();
1200
1201
/// @brief begin move single element in Demand mode
1202
bool beginMoveSingleElementDemandMode();
1203
1204
/// @brief move single element in Network AND Demand mode
1205
void moveSingleElement(const bool mouseLeftButtonPressed);
1206
1207
/// @brief finish moving single elements in Network AND Demand mode
1208
void finishMoveSingleElement();
1209
1210
/// @brief check if there are moving elements
1211
bool isCurrentlyMovingSingleElement() const;
1212
1213
/// @brief get moved element
1214
GNEMoveElement* getMovedElement() const;
1215
1216
protected:
1217
/// @brief calculate offset
1218
const GNEMoveOffset calculateMoveOffset() const;
1219
1220
private:
1221
/// @brief pointer to net
1222
GNEViewNet* myViewNet;
1223
1224
/// @brief relative position of Clicked Position regarding to originalGeometryPointPosition (Used when user doesn't click exactly over the center of element)
1225
Position myRelativeClickedPosition;
1226
1227
/// @brief move operations
1228
GNEMoveOperation* myMoveOperation = nullptr;
1229
1230
/// @brief Invalidated copy constructor.
1231
MoveSingleElementModul(const MoveSingleElementModul&) = delete;
1232
1233
/// @brief Invalidated assignment operator.
1234
MoveSingleElementModul& operator=(const MoveSingleElementModul&) = delete;
1235
};
1236
1237
/// @brief struct used to group all variables related with movement of groups of elements
1238
struct MoveMultipleElementModul {
1239
1240
/// @brief constructor
1241
MoveMultipleElementModul(GNEViewNet* viewNet);
1242
1243
/// @brief begin move selection
1244
void beginMoveSelection();
1245
1246
/// @brief move selection
1247
void moveSelection(const bool mouseLeftButtonPressed);
1248
1249
/// @brief finish moving selection
1250
void finishMoveSelection();
1251
1252
/// @brief check if currently there is element being moved
1253
bool isMovingSelection() const;
1254
1255
/// @brief flag for moving edge
1256
bool isMovingSelectedEdge() const;
1257
1258
/// @brief reset flag for moving edge
1259
void resetMovingSelectedEdge();
1260
1261
/// @brief edge offset
1262
double getEdgeOffset() const;
1263
1264
/// @brief check if there are moving elements
1265
bool isCurrentlyMovingMultipleElements() const;
1266
1267
protected:
1268
/// @brief calculate move offset
1269
const GNEMoveOffset calculateMoveOffset() const;
1270
1271
/// @brief calculate junction selection
1272
void calculateJunctionSelection();
1273
1274
/// @brief calculate edge selection
1275
void calculateEdgeSelection(const GNEEdge* clickedEdge);
1276
1277
private:
1278
/// @brief pointer to net
1279
GNEViewNet* myViewNet;
1280
1281
/// @brief original clicked position when moveSelection is called (used for calculate offset during moveSelection())
1282
Position myClickedPosition;
1283
1284
/// @brief flag for enable moving edge
1285
bool myMovingSelectedEdge;
1286
1287
/// @brief offset of moved edge
1288
double myEdgeOffset;
1289
1290
/// @brief move operations
1291
std::vector<GNEMoveOperation*> myMoveOperations;
1292
1293
/// @brief Invalidated copy constructor.
1294
MoveMultipleElementModul(const MoveMultipleElementModul&) = delete;
1295
1296
/// @brief Invalidated assignment operator.
1297
MoveMultipleElementModul& operator=(const MoveMultipleElementModul&) = delete;
1298
};
1299
1300
/// @brief struct used to group all variables related with movement of groups of elements
1301
struct VehicleOptions {
1302
1303
/// @brief constructor
1304
VehicleOptions(GNEViewNet* viewNet);
1305
1306
/// @brief build menu checks
1307
void buildVehicleOptionsMenuChecks();
1308
1309
/// @brief hide all options menu checks
1310
void hideVehicleOptionsMenuChecks();
1311
1312
private:
1313
/// @brief pointer to net
1314
GNEViewNet* myViewNet;
1315
1316
/// @brief Invalidated copy constructor.
1317
VehicleOptions(const VehicleOptions&) = delete;
1318
1319
/// @brief Invalidated assignment operator.
1320
VehicleOptions& operator=(const VehicleOptions&) = delete;
1321
};
1322
1323
/// @brief struct used to group all variables related with movement of groups of elements
1324
struct VehicleTypeOptions {
1325
1326
/// @brief constructor
1327
VehicleTypeOptions(GNEViewNet* viewNet);
1328
1329
/// @brief build menu checks
1330
void buildVehicleTypeOptionsMenuChecks();
1331
1332
/// @brief hide all options menu checks
1333
void hideVehicleTypeOptionsMenuChecks();
1334
1335
private:
1336
/// @brief pointer to net
1337
GNEViewNet* myViewNet;
1338
1339
/// @brief Invalidated copy constructor.
1340
VehicleTypeOptions(const VehicleTypeOptions&) = delete;
1341
1342
/// @brief Invalidated assignment operator.
1343
VehicleTypeOptions& operator=(const VehicleTypeOptions&) = delete;
1344
};
1345
1346
/// @brief struct used to group all variables related with selecting using a square or polygon
1347
/// @note in the future the variables used for selecting through a polygon will be placed here
1348
struct SelectingArea {
1349
1350
/// @brief default constructor
1351
SelectingArea(GNEViewNet* viewNet);
1352
1353
/// @brief begin rectangle selection
1354
void beginRectangleSelection();
1355
1356
/// @brief move rectangle selection
1357
void moveRectangleSelection();
1358
1359
/// @brief finish rectangle selection
1360
void finishRectangleSelection();
1361
1362
/// @brief process rectangle Selection
1363
void processRectangleSelection();
1364
1365
/// @brief process rectangle Selection (only limited to Edges)
1366
std::vector<GNEEdge*> processEdgeRectangleSelection();
1367
1368
/// @brief draw rectangle selection
1369
void drawRectangleSelection(const RGBColor& color) const;
1370
1371
/// @brief whether we have started rectangle-selection
1372
bool selectingUsingRectangle;
1373
1374
/// @brief whether we have started rectangle-selection
1375
bool startDrawing;
1376
1377
private:
1378
/// @brief Process boundary Selection
1379
void processBoundarySelection(const Boundary& boundary);
1380
1381
/// @brief first corner of the rectangle-selection
1382
Position selectionCorner1;
1383
1384
/// @brief second corner of the rectangle-selection
1385
Position selectionCorner2;
1386
1387
/// @brief pointer to net
1388
GNEViewNet* myViewNet;
1389
1390
/// @brief Invalidated copy constructor.
1391
SelectingArea(const SelectingArea&) = delete;
1392
1393
/// @brief Invalidated assignment operator.
1394
SelectingArea& operator=(const SelectingArea&) = delete;
1395
};
1396
1397
/// @brief struct used to group all variables related with testing
1398
struct TestingMode {
1399
1400
/// @brief default constructor
1401
TestingMode(GNEViewNet* viewNet);
1402
1403
/// @brief init testing mode
1404
void initTestingMode();
1405
1406
/// @brief draw testing element
1407
void drawTestingElements(GUIMainWindow* mainWindow);
1408
1409
private:
1410
/// @brief pointer to net
1411
GNEViewNet* myViewNet;
1412
1413
/// @brief Width of net in testing mode
1414
int myTestingWidth = 0;
1415
1416
/// @brief Height of net in testing mode
1417
int myTestingHeight = 0;
1418
1419
/// @brief Invalidated copy constructor.
1420
TestingMode(const TestingMode&) = delete;
1421
1422
/// @brief Invalidated assignment operator.
1423
TestingMode& operator=(const TestingMode&) = delete;
1424
};
1425
1426
/// @brief struct used to group all variables related with common checkable Buttons
1427
struct CommonCheckableButtons {
1428
1429
/// @brief default constructor
1430
CommonCheckableButtons(GNEViewNet* viewNet);
1431
1432
/// @brief build checkable buttons
1433
void buildCommonCheckableButtons();
1434
1435
/// @brief show all Common Checkable Buttons
1436
void showCommonCheckableButtons();
1437
1438
/// @brief hide all Common Checkable Buttons
1439
void hideCommonCheckableButtons();
1440
1441
/// @brief hide all options menu checks
1442
void disableCommonCheckableButtons();
1443
1444
/// @brief update Common checkable buttons
1445
void updateCommonCheckableButtons();
1446
1447
/// @brief checkable button for edit mode inspect
1448
MFXCheckableButton* inspectButton = nullptr;
1449
1450
/// @brief checkable button for edit mode delete
1451
MFXCheckableButton* deleteButton = nullptr;
1452
1453
/// @brief checkable button for edit mode select
1454
MFXCheckableButton* selectButton = nullptr;
1455
1456
private:
1457
/// @brief pointer to net
1458
GNEViewNet* myViewNet;
1459
1460
/// @brief Invalidated copy constructor.
1461
CommonCheckableButtons(const CommonCheckableButtons&) = delete;
1462
1463
/// @brief Invalidated assignment operator.
1464
CommonCheckableButtons& operator=(const CommonCheckableButtons&) = delete;
1465
};
1466
1467
/// @brief struct used to group all variables related with Network checkable Buttons
1468
struct NetworkCheckableButtons {
1469
1470
/// @brief default constructor
1471
NetworkCheckableButtons(GNEViewNet* viewNet);
1472
1473
/// @brief build checkable buttons
1474
void buildNetworkCheckableButtons();
1475
1476
/// @brief show all Network Checkable Buttons
1477
void showNetworkCheckableButtons();
1478
1479
/// @brief hide all Network Checkable Buttons
1480
void hideNetworkCheckableButtons();
1481
1482
/// @brief hide all options menu checks
1483
void disableNetworkCheckableButtons();
1484
1485
/// @brief update network checkable buttons
1486
void updateNetworkCheckableButtons();
1487
1488
/// @brief checkable button for edit mode "move network elements"
1489
MFXCheckableButton* moveNetworkElementsButton = nullptr;
1490
1491
/// @brief checkable button for edit mode create edge
1492
MFXCheckableButton* createEdgeButton = nullptr;
1493
1494
/// @brief checkable button for edit mode connection
1495
MFXCheckableButton* connectionButton = nullptr;
1496
1497
/// @brief checkable button for edit mode traffic light
1498
MFXCheckableButton* trafficLightButton = nullptr;
1499
1500
/// @brief checkable button for edit mode additional
1501
MFXCheckableButton* additionalButton = nullptr;
1502
1503
/// @brief checkable button for edit mode crossing
1504
MFXCheckableButton* crossingButton = nullptr;
1505
1506
/// @brief checkable button for edit mode TAZ
1507
MFXCheckableButton* TAZButton = nullptr;
1508
1509
/// @brief checkable button for edit mode shape
1510
MFXCheckableButton* shapeButton = nullptr;
1511
1512
/// @brief checkable button for edit mode prohibition
1513
MFXCheckableButton* prohibitionButton = nullptr;
1514
1515
/// @brief checkable button for edit mode wires
1516
MFXCheckableButton* wireButton = nullptr;
1517
1518
/// @brief checkable button for edit mode decals
1519
MFXCheckableButton* decalButton = nullptr;
1520
1521
private:
1522
/// @brief pointer to net
1523
GNEViewNet* myViewNet;
1524
1525
/// @brief Invalidated copy constructor.
1526
NetworkCheckableButtons(const NetworkCheckableButtons&) = delete;
1527
1528
/// @brief Invalidated assignment operator.
1529
NetworkCheckableButtons& operator=(const NetworkCheckableButtons&) = delete;
1530
};
1531
1532
/// @brief struct used to group all variables related with Demand checkable Buttons
1533
struct DemandCheckableButtons {
1534
1535
/// @brief default constructor
1536
DemandCheckableButtons(GNEViewNet* viewNet);
1537
1538
/// @brief build checkable buttons
1539
void buildDemandCheckableButtons();
1540
1541
/// @brief show all Demand Checkable Buttons
1542
void showDemandCheckableButtons();
1543
1544
/// @brief hide all Demand Checkable Buttons
1545
void hideDemandCheckableButtons();
1546
1547
/// @brief hide all options menu checks
1548
void disableDemandCheckableButtons();
1549
1550
/// @brief update Demand checkable buttons
1551
void updateDemandCheckableButtons();
1552
1553
/// @brief checkable button for edit mode "move demand elements"
1554
MFXCheckableButton* moveDemandElementsButton = nullptr;
1555
1556
/// @brief checkable button for edit mode create routes
1557
MFXCheckableButton* routeButton = nullptr;
1558
1559
/// @brief checkable button for edit mode create route distributions
1560
MFXCheckableButton* routeDistributionButton = nullptr;
1561
1562
/// @brief checkable button for edit mode create vehicles
1563
MFXCheckableButton* vehicleButton = nullptr;
1564
1565
/// @brief checkable button for edit mode create type
1566
MFXCheckableButton* typeButton = nullptr;
1567
1568
/// @brief checkable button for edit mode create type distribution
1569
MFXCheckableButton* typeDistributionButton = nullptr;
1570
1571
/// @brief checkable button for edit mode create stops
1572
MFXCheckableButton* stopButton = nullptr;
1573
1574
/// @brief checkable button for edit mode create persons
1575
MFXCheckableButton* personButton = nullptr;
1576
1577
/// @brief checkable button for edit mode create person plans
1578
MFXCheckableButton* personPlanButton = nullptr;
1579
1580
/// @brief checkable button for edit mode create containers
1581
MFXCheckableButton* containerButton = nullptr;
1582
1583
/// @brief checkable button for edit mode create container plans
1584
MFXCheckableButton* containerPlanButton = nullptr;
1585
1586
private:
1587
/// @brief pointer to net
1588
GNEViewNet* myViewNet;
1589
1590
/// @brief Invalidated copy constructor.
1591
DemandCheckableButtons(const DemandCheckableButtons&) = delete;
1592
1593
/// @brief Invalidated assignment operator.
1594
DemandCheckableButtons& operator=(const DemandCheckableButtons&) = delete;
1595
};
1596
1597
/// @brief struct used to group all variables related with Data checkable Buttons
1598
struct DataCheckableButtons {
1599
1600
/// @brief default constructor
1601
DataCheckableButtons(GNEViewNet* viewNet);
1602
1603
/// @brief build checkable buttons
1604
void buildDataCheckableButtons();
1605
1606
/// @brief show all Data Checkable Buttons
1607
void showDataCheckableButtons();
1608
1609
/// @brief hide all Data Checkable Buttons
1610
void hideDataCheckableButtons();
1611
1612
/// @brief hide all options menu checks
1613
void disableDataCheckableButtons();
1614
1615
/// @brief update Data checkable buttons
1616
void updateDataCheckableButtons();
1617
1618
/// @brief checkable button for edit mode "edgeData"
1619
MFXCheckableButton* edgeDataButton = nullptr;
1620
1621
/// @brief checkable button for edit mode "edgeRelData"
1622
MFXCheckableButton* edgeRelDataButton = nullptr;
1623
1624
/// @brief checkable button for edit mode "TAZRelData"
1625
MFXCheckableButton* TAZRelDataButton = nullptr;
1626
1627
/// @brief checkable button for edit mode "meanData"
1628
MFXCheckableButton* meanDataButton = nullptr;
1629
1630
private:
1631
/// @brief pointer to net
1632
GNEViewNet* myViewNet;
1633
1634
/// @brief Invalidated copy constructor.
1635
DataCheckableButtons(const DataCheckableButtons&) = delete;
1636
1637
/// @brief Invalidated assignment operator.
1638
DataCheckableButtons& operator=(const DataCheckableButtons&) = delete;
1639
};
1640
1641
/// @brief struct used to group all variables related with edit shapes of NetworkElements
1642
struct EditNetworkElementShapes {
1643
1644
/// @brief default constructor
1645
EditNetworkElementShapes(GNEViewNet* viewNet);
1646
1647
/// @brief start edit custom shape
1648
void startEditCustomShape(GNENetworkElement* element);
1649
1650
/// @brief edit edit shape
1651
void stopEditCustomShape();
1652
1653
/// @brief save edited shape
1654
void commitShapeEdited();
1655
1656
/// @brief pointer to edited network element
1657
GNENetworkElement* getEditedNetworkElement() const;
1658
1659
private:
1660
/// @brief pointer to viewNet
1661
GNEViewNet* myViewNet;
1662
1663
/// @brief pointer to edited network element
1664
GNENetworkElement* myEditedNetworkElement = nullptr;
1665
1666
/// @brief the previous edit mode before edit NetworkElement's shapes
1667
NetworkEditMode myPreviousNetworkEditMode;
1668
1669
/// @brief Invalidated copy constructor.
1670
EditNetworkElementShapes(const EditNetworkElementShapes&) = delete;
1671
1672
/// @brief Invalidated assignment operator.
1673
EditNetworkElementShapes& operator=(const EditNetworkElementShapes&) = delete;
1674
};
1675
1676
/// @brief struct for pack all variables and functions related with Block Icon
1677
struct LockIcon {
1678
/// @brief draw lock icon
1679
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier* AC, GUIGlObjectType type, const Position position,
1680
const double exaggeration, const double size = 0.5,
1681
const double offsetx = 0, const double offsety = 0);
1682
1683
/// @brief check if icon can be drawn
1684
static bool checkDrawing(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier* AC,
1685
GUIGlObjectType type, const double exaggeration);
1686
private:
1687
/// @brief constructor
1688
LockIcon();
1689
1690
/// @brief Invalidated copy constructor.
1691
LockIcon(const LockIcon&) = delete;
1692
1693
/// @brief Invalidated assignment operator.
1694
LockIcon& operator=(const LockIcon&) = delete;
1695
};
1696
1697
/// @brief get scaled rainbow colors
1698
static const std::vector<RGBColor>& getRainbowScaledColors();
1699
1700
/// @brief get rainbow scaled color
1701
static const RGBColor& getRainbowScaledColor(const double min, const double max, const double value);
1702
1703
/// @brief filter elements based on the layer
1704
static std::vector<GUIGlObject*> filterElementsByLayer(const std::vector<GUIGlObject*>& GLObjects);
1705
1706
private:
1707
/// @brief scale (rainbow) colors
1708
static std::vector<RGBColor> myRainbowScaledColors;
1709
};
1710
1711