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