Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/GNETagProperties.h
193718 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 GNETagProperties.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Jan 2020
17
///
18
// Abstract Base class for tag properties used in GNEAttributeCarrier
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include <netedit/GNEViewNetHelper.h>
24
#include <utils/common/FileBucket.h>
25
#include <utils/gui/globjects/GUIGlObjectTypes.h>
26
#include <utils/gui/images/GUIIcons.h>
27
28
#include "GNEAttributeProperties.h"
29
30
// ===========================================================================
31
// class definitions
32
// ===========================================================================
33
34
class GNETagProperties {
35
36
public:
37
38
/// @brief tag types
39
enum class Type : std::uint64_t {
40
// basic types
41
NETWORKELEMENT = 1ULL << 0, // Network elements (Edges, Junctions, Lanes...)
42
ADDITIONALELEMENT = 1ULL << 1, // Additional elements (Bus Stops, Charging Stations, Detectors...)
43
DEMANDELEMENT = 1ULL << 2, // Demand elements (Routes, Vehicles, Trips...)
44
DATAELEMENT = 1ULL << 3, // Data elements (DataSets, Data Intervals, EdgeData...)
45
// sub additional elements
46
STOPPINGPLACE = 1ULL << 4, // StoppingPlaces (BusStops, ChargingStations...)
47
DETECTOR = 1ULL << 5, // Detectors (E1, E2...)
48
CALIBRATOR = 1ULL << 6, // Calibrators
49
SHAPE = 1ULL << 7, // Shapes (Polygons and POIs)
50
TAZELEMENT = 1ULL << 8, // Traffic Assignment Zones
51
WIRE = 1ULL << 9, // Wire elements
52
JUPEDSIM = 1ULL << 10, // JuPedSim elements
53
// sub demand elements
54
VTYPE = 1ULL << 11, // Vehicle types (vType and vTypeDistribution)
55
VEHICLE = 1ULL << 12, // Vehicles (Vehicles, trips, flows...)
56
ROUTE = 1ULL << 13, // Routes and embedded routes
57
STOP_VEHICLE = 1ULL << 14, // Vehicle stops
58
WAYPOINT_VEHICLE = 1ULL << 15, // Vehicle waypoints (note: All waypoints are also Stops)
59
FLOW = 1ULL << 16, // Flows
60
// persons
61
PERSON = 1ULL << 17, // Persons (Persons and personFlows)
62
PERSONPLAN = 1ULL << 18, // Person plans (Walks, rides, personTrips and stopPersons)
63
PERSONTRIP = 1ULL << 19, // Person Trips
64
WALK = 1ULL << 20, // Walks
65
RIDE = 1ULL << 21, // Rides
66
STOP_PERSON = 1ULL << 22, // Person stops
67
// containers
68
CONTAINER = 1ULL << 23, // Containers (Containers and personFlows)
69
CONTAINERPLAN = 1ULL << 24, // Container plans (transport, tranships and containerStops)
70
TRANSPORT = 1ULL << 25, // Transport
71
TRANSHIP = 1ULL << 26, // Tranship
72
STOP_CONTAINER = 1ULL << 27, // Container stops
73
// sub data elements
74
GENERICDATA = 1ULL << 28, // Generic data (GNEEdgeData, GNELaneData...)
75
MEANDATA = 1ULL << 29, // Mean datas
76
// distributions
77
DISTRIBUTION = 1ULL << 30, // Element is a distribution (routeDistribution or vTypeDistribution)
78
DISTRIBUTIONREF = 1ULL << 31, // Element is a distribution reference of routeDistribution or vTypeDistribution
79
// other
80
INTERNALLANE = 1ULL << 32, // Internal Lane
81
OTHER = 1ULL << 33, // Other type (used for TAZSourceSinks, VTypes, etc.)
82
};
83
84
/// @brief tag property
85
enum class Property : std::uint64_t {
86
NOTDRAWABLE = 1ULL << 0, // Element cannot be drawn in view
87
GEOSHAPE = 1ULL << 1, // Element's shape acn be defined using a GEO Shape
88
DIALOG = 1ULL << 2, // Element can be edited using a dialog (GNECalibratorDialog, GNERerouterDialog...)
89
XMLCHILD = 1ULL << 3, // Element is child of another element and will be written in XML (Example: E3Entry -> E3Detector...)
90
REPARENT = 1ULL << 4, // Element can be reparent
91
NOTSELECTABLE = 1ULL << 5, // Element cannot be selected
92
NOPARAMETERS = 1ULL << 6, // Element doesn't accept parameters "key1=value1|key2=value2|...|keyN=valueN" (by default all tags supports parameters)
93
RTREE = 1ULL << 7, // Element is placed in RTREE
94
CENTERAFTERCREATION = 1ULL << 8, // Camera is moved after element creation
95
REQUIRE_PROJ = 1ULL << 9, // Element require a geo-projection defined in network
96
VCLASS_ICON = 1ULL << 10, // Element returns icon depending of their vClass
97
SYMBOL = 1ULL << 11, // Element is a symbol (VSSSymbols, RerouterSymbols...)
98
EXTENDED = 1ULL << 12, // Element contains extended attributes (Usually vTypes)
99
HIERARCHICAL = 1ULL << 13, // Element is a hierarchical
100
LISTED = 1ULL << 14, // Element is a listed elements (for example, rerouter children)
101
NO_PROPERTY = 1ULL << 15, // Element doesn't have properties
102
};
103
104
/// @brief element in which this element is placed
105
enum class Over : std::uint64_t {
106
VIEW = 1ULL << 0, // No parents
107
JUNCTION = 1ULL << 1, // Placed over junction
108
EDGE = 1ULL << 2, // Placed over edge
109
EDGES = 1ULL << 3, // Placed over edges
110
CONSECUTIVE_EDGES = 1ULL << 4, // Placed over consecutive
111
LANE = 1ULL << 5, // Placed over lane
112
LANES = 1ULL << 6, // Placed over lanes
113
CONSECUTIVE_LANES = 1ULL << 4, // Placed over consecutive lanes
114
ROUTE = 1ULL << 7, // Placed over route
115
ROUTE_EMBEDDED = 1ULL << 8, // Placed over route embedded
116
BUSSTOP = 1ULL << 9, // Placed over busStop
117
TRAINSTOP = 1ULL << 10, // Placed over trainStop
118
CONTAINERSTOP = 1ULL << 11, // Placed over containerStop
119
CHARGINGSTATION = 1ULL << 12, // Placed over charging station
120
PARKINGAREA = 1ULL << 13, // Placed over parking area
121
FROM_EDGE = 1ULL << 14, // Starts in edge
122
FROM_TAZ = 1ULL << 15, // Starts in TAZ
123
FROM_JUNCTION = 1ULL << 16, // Starts in junction
124
FROM_BUSSTOP = 1ULL << 17, // Starts in busStop
125
FROM_TRAINSTOP = 1ULL << 18, // Starts in trainStop
126
FROM_CONTAINERSTOP = 1ULL << 19, // Starts in containerStop
127
FROM_CHARGINGSTATION = 1ULL << 20, // Starts in chargingStation
128
FROM_PARKINGAREA = 1ULL << 21, // Starts in parkingArea
129
TO_EDGE = 1ULL << 22, // Ends in edge
130
TO_TAZ = 1ULL << 23, // Ends in TAZ
131
TO_JUNCTION = 1ULL << 24, // Ends in junction
132
TO_BUSSTOP = 1ULL << 25, // Ends in busStop
133
TO_TRAINSTOP = 1ULL << 26, // Ends in trainStop
134
TO_CONTAINERSTOP = 1ULL << 27, // Ends in containerStop
135
TO_CHARGINGSTATION = 1ULL << 28, // Ends in chargingStation
136
TO_PARKINGAREA = 1ULL << 29, // Ends in parkingArea
137
};
138
139
// @brief conflicts
140
enum class Conflicts : std::uint64_t {
141
POS_LANE = 1ULL << 0, // Position over lane isn't valid
142
POS_LANE_START = 1ULL << 1, // Start position over lane isn't valid
143
POS_LANE_END = 1ULL << 2, // End position over lane isn't valid
144
NO_ADDITIONAL_CHILDREN = 1ULL << 3, // Element doesn't have additional children
145
NO_CONFLICTS = 1ULL << 4, // Element doesn't have conflicts
146
};
147
148
/// @brief declare friend class
149
friend class GNEAttributeProperties;
150
151
/// @brief parameter constructor
152
GNETagProperties(const SumoXMLTag tag, GNETagProperties* parent, const GNETagProperties::Type type, const GNETagProperties::Property property,
153
const GNETagProperties::Over over, const FileBucket::Type bucketType, const GNETagProperties::Conflicts conflicts, const GUIIcon icon,
154
const GUIGlObjectType GLType, const SumoXMLTag XMLTag, const std::string tooltipText, std::vector<SumoXMLTag> XMLParentTags = {},
155
const unsigned int backgroundColor = FXRGBA(255, 255, 255, 255), const std::string selectorText = "");
156
157
/// @brief parameter constructor for hierarchical elements
158
GNETagProperties(const SumoXMLTag tag, GNETagProperties* parent, const GUIIcon icon, const std::string tooltip,
159
const unsigned int backgroundColor = FXRGBA(255, 255, 255, 255), const std::string selectorText = "");
160
161
/// @brief destructor
162
~GNETagProperties();
163
164
/// @brief get Tag vinculated with this attribute Property
165
SumoXMLTag getTag() const;
166
167
/// @brief get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toString(...)
168
const std::string& getTagStr() const;
169
170
/// @brief check Tag integrity (this include all their attributes)
171
void checkTagIntegrity() const;
172
173
/// @brief get field string (by default tag in string format)
174
const std::string& getSelectorText() const;
175
176
/// @brief get tooltip text
177
const std::string& getTooltipText() const;
178
179
/// @brief get background color
180
unsigned int getBackGroundColor() const;
181
182
/// @brief get all attribute properties
183
const std::vector<const GNEAttributeProperties*>& getAttributeProperties() const;
184
185
/// @brief get attribute propety associated with the given Sumo XML Attribute (throw error if doesn't exist)
186
const GNEAttributeProperties* getAttributeProperties(SumoXMLAttr attr) const;
187
188
/// @brief get attribute propety by index (throw error if doesn't exist)
189
const GNEAttributeProperties* getAttributeProperties(const int index) const;
190
191
/// @brief get attribute value
192
const GNEAttributeProperties* at(int index) const;
193
194
/// @brief check if current TagProperties owns the attribute "attr"
195
bool hasAttribute(SumoXMLAttr attr) const;
196
197
/// @brief get number of attributes
198
int getNumberOfAttributes() const;
199
200
/// @brief get GUI icon associated to this tag property
201
GUIIcon getGUIIcon() const;
202
203
/// @brief get GUIGlObjectType associated with this tag property
204
GUIGlObjectType getGLType() const;
205
206
/// @brief default values
207
/// @{
208
209
/// @brief get XML tag
210
SumoXMLTag getXMLTag() const;
211
212
/// @brief get XML parent tags
213
const std::vector<SumoXMLTag>& getXMLParentTags() const;
214
215
/// @brief return true if tag correspond to an element that can be reparent
216
bool canBeReparent() const;
217
218
/// @brief default values
219
/// @{
220
221
/// @brief return the default value of the attribute of an element
222
const std::string& getDefaultStringValue(SumoXMLAttr attr) const;
223
224
/// @brief get default int value
225
int getDefaultIntValue(SumoXMLAttr attr) const;
226
227
/// @brief get default double value
228
double getDefaultDoubleValue(SumoXMLAttr attr) const;
229
230
/// @brief get default time value
231
SUMOTime getDefaultTimeValue(SumoXMLAttr attr) const;
232
233
/// @brief get default bool value
234
bool getDefaultBoolValue(SumoXMLAttr attr) const;
235
236
/// @brief get default bool value
237
const RGBColor& getDefaultColorValue(SumoXMLAttr attr) const;
238
239
/// @}
240
241
/// @brief hierarchy functions
242
/// @{
243
244
/// @brief get hierarchical parent of this element
245
const GNETagProperties* getHierarchicalParent() const;
246
247
/// @brief get all parents, beginning from current element (root not included) until this element
248
const std::vector<const GNETagProperties*> getHierarchicalParentsRecuersively() const;
249
250
/// @brief get children of this tag property
251
const std::vector<const GNETagProperties*>& getHierarchicalChildren() const;
252
253
/// @brief get all children tags (Including children of their children)
254
std::vector<const GNETagProperties*> getHierarchicalChildrenRecursively() const;
255
256
/// @brief get all children attributes sorted by name (Including this)
257
std::map<std::string, const GNEAttributeProperties*> getHierarchicalChildrenAttributesRecursively(const bool onlyCommon, const bool onlyDrawables) const;
258
259
/// @}
260
261
/// @brief get supermode associated with this tag
262
Supermode getSupermode() const;
263
264
/// @brief check if this is a hierarchical tag
265
bool isHierarchicalTag() const;
266
267
/// @brief network elements
268
/// @{
269
270
/// @brief return true if tag correspond to a network element
271
bool isNetworkElement() const;
272
273
/// @brief return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
274
bool isAdditionalElement() const;
275
276
/// @brief return true if tag correspond to a pure additional element
277
bool isAdditionalPureElement() const;
278
279
/// @brief return true if tag correspond to a demand element
280
bool isDemandElement() const;
281
282
/// @brief return true if tag correspond to a data element
283
bool isDataElement() const;
284
285
/// @brief return true if tag correspond to a other element (sourceSinks, vTypes, etc.)
286
bool isOtherElement() const;
287
288
/// @}
289
290
/// @brief additional elements
291
/// @{
292
/// @brief return true if tag correspond to a detector (Only used to group all stoppingPlaces in the output XML)
293
bool isStoppingPlace() const;
294
295
/// @brief return true if tag correspond to a shape (Only used to group all detectors in the XML)
296
bool isDetector() const;
297
298
/// @brief return true if tag correspond to a calibrator (Only used to group all detectors in the XML)
299
bool isCalibrator() const;
300
301
/// @brief return true if tag correspond to a shape
302
bool isShapeElement() const;
303
304
/// @brief return true if tag correspond to a TAZ element
305
bool isTAZElement() const;
306
307
/// @brief return true if tag correspond to a Wire element
308
bool isWireElement() const;
309
310
/// @brief return true if tag correspond to a JuPedSim element
311
bool isJuPedSimElement() const;
312
313
/// @}
314
315
/// @brief demand elements
316
/// @{
317
/// @brief return true if tag correspond to a vehicle/person/container type element
318
bool isType() const;
319
320
/// @brief return true if tag correspond to a vehicle element
321
bool isVehicle() const;
322
323
/// @brief return true if tag correspond to a route element
324
bool isRoute() const;
325
326
/// @brief return true if tag correspond to a vehicle stop element
327
bool isVehicleStop() const;
328
329
/// @brief return true if tag correspond to a vehicle waypoint element
330
bool isVehicleWaypoint() const;
331
332
/// @brief return true if tag correspond to a flow element
333
bool isFlow() const;
334
335
/// @brief return true if tag correspond to a person element
336
bool isPerson() const;
337
338
/// @brief return true if tag correspond to a container element
339
bool isContainer() const;
340
341
/// @brief return true if tag correspond to an element with a type as a first parent
342
bool hasTypeParent() const;
343
344
/// @brief return true if tag correspond to a distribution element
345
bool isDistribution() const;
346
347
/// @brief return true if tag correspond to a dstribution reference element
348
bool isDistributionReference() const;
349
350
/// @brief return true if tag correspond to a type distribution element
351
bool isTypeDistribution() const;
352
353
/// @brief return true if tag correspond to a route distribution element
354
bool isRouteDistribution() const;
355
356
/// @}
357
358
/// @brief plans
359
/// @{
360
/// @brief return true if tag correspond to a plan
361
bool isPlan() const;
362
363
/// @brief return true if tag correspond to a person plan
364
bool isPlanPerson() const;
365
366
/// @brief return true if tag correspond to a container plan
367
bool isPlanContainer() const;
368
369
/// @brief return true if tag correspond to a person trip plan
370
bool isPlanPersonTrip() const;
371
372
/// @brief return true if tag correspond to a walk plan
373
bool isPlanWalk() const;
374
375
/// @brief return true if tag correspond to a ride plan
376
bool isPlanRide() const;
377
378
/// @brief return true if tag correspond to a transport
379
bool isPlanTransport() const;
380
381
/// @brief return true if tag correspond to a tranship
382
bool isPlanTranship() const;
383
384
/// @brief return true if tag correspond to a stop plan
385
bool isPlanStop() const;
386
387
/// @brief return true if tag correspond to a person stop plan
388
bool isPlanStopPerson() const;
389
390
/// @brief return true if tag correspond to a container stop plan
391
bool isPlanStopContainer() const;
392
393
/// @}
394
395
/// @brief data elements
396
/// @{
397
/// @brief return true if tag correspond to a generic data element
398
bool isGenericData() const;
399
400
/// @brief return true if tag correspond to a mean data element
401
bool isMeanData() const;
402
403
/// @}
404
405
/// @brief plan parents
406
/// @{
407
408
/// @brief return true if tag correspond to a vehicle placed over a route
409
bool vehicleRoute() const;
410
411
/// @brief return true if tag correspond to a vehicle placed over an embedded route
412
bool vehicleRouteEmbedded() const;
413
414
/// @brief return true if tag correspond to a vehicle placed over from-to edges
415
bool vehicleEdges() const;
416
417
/// @brief return true if tag correspond to a vehicle placed over from-to junctions
418
bool vehicleJunctions() const;
419
420
/// @brief return true if tag correspond to a vehicle placed over from-to TAZs
421
bool vehicleTAZs() const;
422
423
/// @}
424
425
/// @brief plan parents
426
/// @{
427
/// @brief return true if tag correspond to a plan placed over edges
428
bool planConsecutiveEdges() const;
429
430
/// @brief return true if tag correspond to a plan placed over route
431
bool planRoute() const;
432
433
/// @brief return true if tag correspond to a plan placed over edge
434
bool planEdge() const;
435
436
/// @brief return true if tag correspond to a plan placed over busStop
437
bool planBusStop() const;
438
439
/// @brief return true if tag correspond to a plan placed over trainStop
440
bool planTrainStop() const;
441
442
/// @brief return true if tag correspond to a plan placed over containerStop
443
bool planContainerStop() const;
444
445
/// @brief return true if tag correspond to a plan placed over chargingStation
446
bool planChargingStation() const;
447
448
/// @brief return true if tag correspond to a plan placed over parkingArea
449
bool planParkingArea() const;
450
451
/// @brief return true if tag correspond to a plan placed in stoppingPlace
452
bool planStoppingPlace() const;
453
454
/// @brief return true if tag correspond to a plan with from-to parents
455
bool planFromTo() const;
456
457
/// @brief return true if tag correspond to a plan that starts in edge
458
bool planFromEdge() const;
459
460
/// @brief return true if tag correspond to a plan that starts in TAZ
461
bool planFromTAZ() const;
462
463
/// @brief return true if tag correspond to a plan that starts in junction
464
bool planFromJunction() const;
465
466
/// @brief return true if tag correspond to a plan that starts in busStop
467
bool planFromBusStop() const;
468
469
/// @brief return true if tag correspond to a plan that starts in trainStop
470
bool planFromTrainStop() const;
471
472
/// @brief return true if tag correspond to a plan that starts in containerStop
473
bool planFromContainerStop() const;
474
475
/// @brief return true if tag correspond to a plan that starts in chargingStation
476
bool planFromChargingStation() const;
477
478
/// @brief return true if tag correspond to a plan that starts in parkingAera
479
bool planFromParkingArea() const;
480
481
/// @brief return true if tag correspond to a plan that starts in stoppingPlace
482
bool planFromStoppingPlace() const;
483
484
/// @brief return true if tag correspond to a plan that starts in edge
485
bool planToEdge() const;
486
487
/// @brief return true if tag correspond to a plan that starts in TAZ
488
bool planToTAZ() const;
489
490
/// @brief return true if tag correspond to a plan that starts in junction
491
bool planToJunction() const;
492
493
/// @brief return true if tag correspond to a plan that starts in busStop
494
bool planToBusStop() const;
495
496
/// @brief return true if tag correspond to a plan that starts in trainStop
497
bool planToTrainStop() const;
498
499
/// @brief return true if tag correspond to a plan that starts in containerStop
500
bool planToContainerStop() const;
501
502
/// @brief return true if tag correspond to a plan that starts in chargingStation
503
bool planToChargingStation() const;
504
505
/// @brief return true if tag correspond to a plan that starts in parkingArea
506
bool planToParkingArea() const;
507
508
/// @brief return true if tag correspond to a plan that ends in stoppingPlace
509
bool planToStoppingPlace() const;
510
511
/// @}
512
513
/// @brief properties
514
/// @{
515
/// @brief return true if tag correspond to an element child of another element (Example: E3->Entry/Exit)
516
bool isChild() const;
517
518
/// @brief return true if tag correspond to a symbol element
519
bool isSymbol() const;
520
521
/// @brief return true if tag correspond to an internal lane
522
bool isInternalLane() const;
523
524
/// @brief return true if tag correspond to a drawable element
525
bool isDrawable() const;
526
527
/// @brief return true if tag correspond to a selectable element
528
bool isSelectable() const;
529
530
/// @brief return true if tag correspond to an element that can use a geo shape
531
bool hasGEOShape() const;
532
533
/// @brief return true if tag correspond to an element that can be edited using a dialog
534
bool hasDialog() const;
535
536
/// @brief return true if tag correspond to an element that contains extended attributes
537
bool hasExtendedAttributes() const;
538
539
/// @brief return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|...|keyN=valueN"
540
bool hasParameters() const;
541
542
/// @brief return true if Tag correspond to an element that has to be placed in RTREE
543
bool isPlacedInRTree() const;
544
545
/// @brief return true if Tag correspond to a listed element
546
bool isListedElement() const;
547
548
/// @brief return true if tag correspond to an element that center camera after creation
549
bool canCenterCameraAfterCreation() const;
550
551
/// @brief return true if tag correspond to an element that requires a geo projection
552
bool requireProj() const;
553
554
/// @brief return true if tag correspond to an element that has vClass icons
555
bool vClassIcon() const;
556
557
/// @}
558
559
/// @brief file
560
/// @{
561
/// @brief check if the given File property is compatible with this TagProperty
562
bool isFileCompatible(FileBucket::Type file) const;
563
564
/// @brief element is saved in a network file
565
bool saveInNetworkFile() const;
566
567
/// @brief element is saved in an additional file
568
bool saveInAdditionalFile() const;
569
570
/// @brief element is saved in a demand file
571
bool saveInDemandFile() const;
572
573
/// @brief element is saved in a data file
574
bool saveInDataFile() const;
575
576
/// @brief element is saved in a meanData file
577
bool saveInMeanDataFile() const;
578
579
/// @brief element is saved in the parent file
580
bool saveInParentFile() const;
581
582
/// @}
583
584
protected:
585
/// @brief add child
586
void addChild(const GNETagProperties* child);
587
588
private:
589
/// @brief Sumo XML Tag vinculated wit this tag Property
590
const SumoXMLTag myTag = SUMO_TAG_NOTHING;
591
592
/// @brief Sumo XML Tag vinculated wit this tag Property in String format
593
const std::string myTagStr;
594
595
/// @brief tag property parent
596
const GNETagProperties* myParent = nullptr;
597
598
/// @brief tag property children
599
std::vector<const GNETagProperties*> myChildren;
600
601
/// @brief tag Types
602
const Type myType = Type::OTHER;
603
604
/// @brief tag properties
605
const Property myProperty = Property::NO_PROPERTY;
606
607
/// @brief tag over
608
const Over myOver = Over::VIEW;
609
610
/// @brief tag file
611
const FileBucket::Type myBucketType = FileBucket::Type::NOTHING;
612
613
/// @brief conflicts
614
const Conflicts myConflicts = Conflicts::NO_CONFLICTS;
615
616
/// @brief vector with the attribute values vinculated with this Tag
617
std::vector<const GNEAttributeProperties*> myAttributeProperties;
618
619
/// @brief icon associated to this tag property
620
const GUIIcon myIcon = GUIIcon::EMPTY;
621
622
/// @brief GUIGlObjectType associated with this tag property
623
const GUIGlObjectType myGLType = GUIGlObjectType::GLO_MAX;
624
625
/// @brief Tag written in XML and used in GNENetHelper::AttributeCarriers
626
const SumoXMLTag myXMLTag = SUMO_TAG_NOTHING;
627
628
/// @brief tooltip text
629
const std::string myTooltipText;
630
631
/// @brief vector with XML parent tags (used by child elements like access or spaces)
632
const std::vector<SumoXMLTag> myXMLParentTags;
633
634
/// @brief text show in selector text
635
const std::string mySelectorText;
636
637
/// @brief background color (used in labels and textFields, by default white)
638
const unsigned int myBackgroundColor = 0;
639
640
/// @brief recursive function for get all children tag properites (Including this)
641
void getChildrenTagProperties(const GNETagProperties* tagProperties, std::vector<const GNETagProperties*>& result) const;
642
643
/// @brief recursive function for get all children attributes (Including this)
644
void getChildrenAttributes(const GNETagProperties* tagProperties, std::map<std::string, const GNEAttributeProperties*>& result, const bool onlyDrawables) const;
645
646
/// @brief default constructor
647
GNETagProperties() = delete;
648
649
/// @brief Invalidated copy constructor.
650
GNETagProperties(const GNETagProperties&) = delete;
651
652
/// @brief Invalidated assignment operator
653
GNETagProperties& operator=(const GNETagProperties& src) = delete;
654
};
655
656
/// @brief override tag parent bit operator
657
constexpr GNETagProperties::Type operator|(GNETagProperties::Type a, GNETagProperties::Type b) {
658
return static_cast<GNETagProperties::Type>(static_cast<std::uint64_t>(a) | static_cast<std::uint64_t>(b));
659
}
660
661
/// @brief override tag parent bit operator
662
constexpr bool operator&(GNETagProperties::Type a, GNETagProperties::Type b) {
663
return (static_cast<std::uint64_t>(a) & static_cast<std::uint64_t>(b)) != 0;
664
}
665
666
/// @brief override tag parent bit operator
667
constexpr GNETagProperties::Property operator|(GNETagProperties::Property a, GNETagProperties::Property b) {
668
return static_cast<GNETagProperties::Property>(static_cast<std::uint64_t>(a) | static_cast<std::uint64_t>(b));
669
}
670
671
/// @brief override tag parent bit operator
672
constexpr bool operator&(GNETagProperties::Property a, GNETagProperties::Property b) {
673
return (static_cast<std::uint64_t>(a) & static_cast<std::uint64_t>(b)) != 0;
674
}
675
676
/// @brief override tag parent bit operator
677
constexpr GNETagProperties::Over operator|(GNETagProperties::Over a, GNETagProperties::Over b) {
678
return static_cast<GNETagProperties::Over>(static_cast<std::uint64_t>(a) | static_cast<std::uint64_t>(b));
679
}
680
681
/// @brief override tag parent bit operator
682
constexpr bool operator&(GNETagProperties::Over a, GNETagProperties::Over b) {
683
return (static_cast<std::uint64_t>(a) & static_cast<std::uint64_t>(b)) != 0;
684
}
685
686
/// @brief override tag parent bit operator
687
constexpr GNETagProperties::Conflicts operator|(GNETagProperties::Conflicts a, GNETagProperties::Conflicts b) {
688
return static_cast<GNETagProperties::Conflicts>(static_cast<std::uint64_t>(a) | static_cast<std::uint64_t>(b));
689
}
690
691
/// @brief override tag parent bit operator
692
constexpr bool operator&(GNETagProperties::Conflicts a, GNETagProperties::Conflicts b) {
693
return (static_cast<std::uint64_t>(a) & static_cast<std::uint64_t>(b)) != 0;
694
}
695
696
/****************************************************************************/
697
698