Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNETagProperties.cpp
Go to the documentation of this file.
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/****************************************************************************/
18// Abstract Base class for tag properties used in GNEAttributeCarrier
19/****************************************************************************/
20
21#include "GNETagProperties.h"
22
23// ===========================================================================
24// method definitions
25// ===========================================================================
26
28 const GNETagProperties::Property property, const GNETagProperties::Over over,
29 const FileBucket::Type bucketType, const GNETagProperties::Conflicts conflicts,
30 const GUIIcon icon, const GUIGlObjectType GLType, const SumoXMLTag XMLTag,
31 const std::string tooltipText, const std::vector<SumoXMLTag> XMLParentTags,
32 const unsigned int backgroundColor, const std::string selectorText) :
33 myTag(tag),
34 myTagStr(toString(tag)),
35 myParent(parent),
36 myType(type),
37 myProperty(property),
38 myOver(over),
39 myBucketType(bucketType),
40 myConflicts(conflicts),
41 myIcon(icon),
42 myGLType(GLType),
43 myXMLTag(XMLTag),
44 myTooltipText(tooltipText),
45 myXMLParentTags(XMLParentTags),
46 mySelectorText(selectorText.empty() ? toString(tag) : selectorText),
47 myBackgroundColor(backgroundColor) {
48 if (parent) {
49 parent->addChild(this);
50 }
51}
52
53
54GNETagProperties::GNETagProperties(const SumoXMLTag tag, GNETagProperties* parent, const GUIIcon icon, const std::string tooltipText,
55 const unsigned int backgroundColor, const std::string selectorText) :
56 myTag(tag),
57 myTagStr(toString(tag)),
58 myParent(parent),
59 myProperty(Property::HIERARCHICAL),
60 myIcon(icon),
61 myXMLTag(tag),
62 myTooltipText(tooltipText),
63 mySelectorText(selectorText.empty() ? toString(tag) : selectorText),
64 myBackgroundColor(backgroundColor) {
65 if (parent) {
66 parent->addChild(this);
67 }
68}
69
70
72 for (const auto& attrProperties : myAttributeProperties) {
73 delete attrProperties;
74 }
75}
76
77
80 return myTag;
81}
82
83
84const std::string&
86 return myTagStr;
87}
88
89
90void
92 // check integrity only in debug mode
93#ifdef DEBUG
94 // check that this edge has parents (Except supermodes)
95 if (myTag == SUMO_TAG_ROOTFILE) {
96 if (myParent != nullptr) {
97 throw ProcessError("Root parent must be empty");
98 }
99 } else if (myParent == nullptr) {
100 throw ProcessError("No parent defined");
101 }
102 // check network parents
103 if (isNetworkElement() && (myParent->getTag() != SUMO_TAG_NET)) {
104 throw ProcessError("Invalid network element parent");
105 }
106 // check additional parents
107 if (isStoppingPlace()) {
108 if (myParent->getTag() != GNE_TAG_STOPPINGPLACES) {
109 throw ProcessError("Invalid stoppingPlace parent");
110 }
111 } else if (isDetector()) {
112 if (myParent->getTag() != GNE_TAG_DETECTORS) {
113 throw ProcessError("Invalid detector parent");
114 }
115 } else if (isWireElement()) {
116 if (myParent->getTag() != GNE_TAG_WIRES) {
117 throw ProcessError("Invalid wire parent");
118 }
119 } else if (isJuPedSimElement()) {
120 if (myParent->getTag() != GNE_TAG_JUPEDSIM) {
121 throw ProcessError("Invalid juPedSim parent");
122 }
123 } else if (isTAZElement()) {
124 if (myParent->getTag() != GNE_TAG_TAZS) {
125 throw ProcessError("Invalid TAZ parent");
126 }
127 } else if (isShapeElement()) {
128 if (myParent->getTag() != GNE_TAG_SHAPES) {
129 throw ProcessError("Invalid shape parent");
130 }
131 } else if (isAdditionalElement()) {
133 throw ProcessError("Invalid additional parent");
134 }
135 }
136 // check demand parents
137 if (isVehicle()) {
138 if (myParent->getTag() != SUMO_TAG_VIEWSETTINGS_VEHICLES) {
139 throw ProcessError("Invalid vehicle parent");
140 }
141 } else if (isVehicleStop()) {
142 if (myParent->getTag() != GNE_TAG_STOPS) {
143 throw ProcessError("Invalid vehicle stop parent");
144 }
145 } else if (isPlanPersonTrip()) {
146 if (myParent->getTag() != GNE_TAG_PERSONTRIPS) {
147 throw ProcessError("Invalid person trip parent");
148 }
149 } else if (isPlanRide()) {
150 if (myParent->getTag() != GNE_TAG_RIDES) {
151 throw ProcessError("Invalid ride parent");
152 }
153 } else if (isPlanWalk()) {
154 if (myParent->getTag() != GNE_TAG_WALKS) {
155 throw ProcessError("Invalid walk parent");
156 }
157 } else if (isPlanStopPerson()) {
158 if (myParent->getTag() != GNE_TAG_PERSONSTOPS) {
159 throw ProcessError("Invalid person stop parent");
160 }
161 } else if (isPlanPerson()) {
162 if (myParent->getTag() != GNE_TAG_PERSONPLANS) {
163 throw ProcessError("Invalid person plan parent");
164 }
165 } else if (isPlanTransport()) {
166 if (myParent->getTag() != GNE_TAG_TRANSPORTS) {
167 throw ProcessError("Invalid ride parent");
168 }
169 } else if (isPlanTranship()) {
170 if (myParent->getTag() != GNE_TAG_TRANSHIPS) {
171 throw ProcessError("Invalid walk parent");
172 }
173 } else if (isPlanStopContainer()) {
174 if (myParent->getTag() != GNE_TAG_CONTAINERSTOPS) {
175 throw ProcessError("Invalid container stop parent");
176 }
177 } else if (isPlanContainer()) {
178 if (myParent->getTag() != GNE_TAG_CONTAINERPLANS) {
179 throw ProcessError("Invalid container plan parent");
180 }
181 } else if (isDemandElement()) {
182 if (myParent->getTag() != GNE_TAG_SUPERMODE_DEMAND) {
183 throw ProcessError("Invalid supermode demand parent");
184 }
185 }
186 // check data parents
187 if (isGenericData()) {
188 if (myParent->getTag() != GNE_TAG_DATAS) {
189 throw ProcessError("Invalid generic data parent");
190 }
191 } else if (isDataElement()) {
192 if (myParent->getTag() != GNE_TAG_SUPERMODE_DATA) {
193 throw ProcessError("Invalid supermode data parent");
194 }
195 }
196 // check that element must ist at least networkElement, Additional, or shape
198 throw ProcessError("no basic type property defined");
199 }
200 // check that element only is networkElement, Additional, or shape at the same time
202 throw ProcessError("multiple basic type properties defined");
203 }
204 // check that element only is shape, TAZ, or wire at the same time
205 if ((isShapeElement() + isTAZElement() + isWireElement()) > 1) {
206 throw ProcessError("element can be either shape or TAZ or wire element at the same time");
207 }
208 // check that master tag is valid
209 if (isChild() && myXMLParentTags.empty()) {
210 throw FormatException("Parent tags cannot be empty");
211 }
212 // check that master was defined
213 if (!isChild() && !myXMLParentTags.empty()) {
214 throw FormatException("Element doesn't support parent elements");
215 }
216 // check reparent
217 if (!isChild() && canBeReparent()) {
218 throw FormatException("Only Child elements can be reparent");
219 }
220 // check vClass icons
222 throw FormatException("Element require attribute SUMO_ATTR_VCLASS");
223 }
224 // check glType
226 throw FormatException("Only hierarchical tags can have a GLType GLO_MAX");
227 }
228 // check drawable
229 if (!isDrawable() && isPlacedInRTree()) {
230 throw FormatException("Non-drawable elements cannot be placed in RTREE");
231 }
232 // check integrity of all attributes
233 for (const auto& attributeProperty : myAttributeProperties) {
234 attributeProperty->checkAttributeIntegrity();
235 // check that if attribute is vehicle classes, own a combination of Allow/disallow attribute
236 if (attributeProperty->isSVCPermission()) {
237 if ((attributeProperty->getAttr() != SUMO_ATTR_ALLOW) && (attributeProperty->getAttr() != SUMO_ATTR_DISALLOW) &&
238 (attributeProperty->getAttr() != SUMO_ATTR_CHANGE_LEFT) && (attributeProperty->getAttr() != SUMO_ATTR_CHANGE_RIGHT) &&
239 (attributeProperty->getAttr() != GNE_ATTR_STOPOEXCEPTION)) {
240 throw ProcessError("Attributes aren't combinables");
241 } else if ((attributeProperty->getAttr() == SUMO_ATTR_ALLOW) && !hasAttribute(SUMO_ATTR_DISALLOW)) {
242 throw ProcessError("allow need a disallow attribute in the same tag");
243 } else if ((attributeProperty->getAttr() == SUMO_ATTR_DISALLOW) && !hasAttribute(SUMO_ATTR_ALLOW)) {
244 throw ProcessError("disallow need an allow attribute in the same tag");
245 }
246 }
247 }
248#endif // DEBUG
249}
250
251
252const std::string&
254 // iterate over attribute properties
255 for (const auto& attributeProperty : myAttributeProperties) {
256 if (attributeProperty->getAttr() == attr) {
257 return attributeProperty->getDefaultStringValue();
258 }
259 }
260 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
261}
262
263
264int
266 // iterate over attribute properties
267 for (const auto& attributeProperty : myAttributeProperties) {
268 if (attributeProperty->getAttr() == attr) {
269 return attributeProperty->getDefaultIntValue();
270 }
271 }
272 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
273}
274
275
276double
278 // iterate over attribute properties
279 for (const auto& attributeProperty : myAttributeProperties) {
280 if (attributeProperty->getAttr() == attr) {
281 return attributeProperty->getDefaultDoubleValue();
282 }
283 }
284 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
285}
286
287
290 // iterate over attribute properties
291 for (const auto& attributeProperty : myAttributeProperties) {
292 if (attributeProperty->getAttr() == attr) {
293 return attributeProperty->getDefaultTimeValue();
294 }
295 }
296 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
297}
298
299
300bool
302 // iterate over attribute properties
303 for (const auto& attributeProperty : myAttributeProperties) {
304 if (attributeProperty->getAttr() == attr) {
305 return attributeProperty->getDefaultBoolValue();
306 }
307 }
308 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
309}
310
311
312const RGBColor&
314 // iterate over attribute properties
315 for (const auto& attributeProperty : myAttributeProperties) {
316 if (attributeProperty->getAttr() == attr) {
317 return attributeProperty->getDefaultColorValue();
318 }
319 }
320 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
321}
322
323
324const std::string&
328
329
330const std::string&
334
335
336unsigned int
340
341
342const std::vector<const GNEAttributeProperties*>&
346
347
350 // iterate over attribute properties
351 for (const auto& attributeProperty : myAttributeProperties) {
352 if ((attributeProperty->getAttr() == attr) || (attributeProperty->hasAttrSynonym() && (attributeProperty->getAttrSynonym() == attr))) {
353 return attributeProperty;
354 }
355 }
356 // throw error if these attribute doesn't exist
357 throw ProcessError(TLF("Attribute '%' doesn't exist", toString(attr)));
358}
359
360
363 if (index < 0 || index >= (int)myAttributeProperties.size()) {
364 throw ProcessError(TLF("Invalid index '%' used in getAttributeProperties(int)", toString(index)));
365 } else {
366 return myAttributeProperties.at(index);
367 }
368}
369
370
372GNETagProperties::at(int index) const {
373 return myAttributeProperties.at(index);
374}
375
376
377bool
379 // iterate over attribute properties
380 for (const auto& attributeProperty : myAttributeProperties) {
381 if (attributeProperty->getAttr() == attr) {
382 return true;
383 }
384 }
385 return false;
386}
387
388
389int
393
394
397 return myIcon;
398}
399
400
403 return myGLType;
404}
405
406
409 return myXMLTag;
410}
411
412
413const std::vector<SumoXMLTag>&
417
418
419const GNETagProperties*
423
424
425const std::vector<const GNETagProperties*>
427 // get the list of all roots
428 std::vector<const GNETagProperties*> parents;
429 parents.push_back(this);
430 while (parents.back()->myParent != nullptr) {
431 parents.push_back(parents.back()->myParent);
432 }
433 std::reverse(parents.begin(), parents.end());
434 return parents;
435}
436
437
438const std::vector<const GNETagProperties*>&
442
443
444std::vector<const GNETagProperties*>
446 std::vector<const GNETagProperties*> children;
447 // obtain all tags recursively (including this)
448 getChildrenTagProperties(this, children);
449 return children;
450}
451
452
453std::map<std::string, const GNEAttributeProperties*>
454GNETagProperties::getHierarchicalChildrenAttributesRecursively(const bool onlyCommon, const bool onlyDrawables) const {
455 std::map<std::string, const GNEAttributeProperties*> allChildrenAttributes;
456 // obtain all children attributes recursively (including this)
457 getChildrenAttributes(this, allChildrenAttributes, onlyDrawables);
458 // check if get only commons
459 if (onlyCommon) {
460 std::map<std::string, const GNEAttributeProperties*> commonChildrenAttributes;
461 // get all tag children and take only the common attributes
462 const auto tagChildren = getHierarchicalChildrenRecursively();
463 // iterate over all children and check if exist in child tag
464 for (const auto& attributeChild : allChildrenAttributes) {
465 bool isCommon = true;
466 for (const auto tagChild : tagChildren) {
467 if ((!onlyDrawables || tagChild->isDrawable()) && // filter only drawables
468 !tagChild->isHierarchicalTag() && // hierarchical tags doesn't have attirbutes
469 !tagChild->hasAttribute(attributeChild.second->getAttr())) {
470 isCommon = false;
471 }
472 }
473 if (isCommon) {
474 commonChildrenAttributes.insert(attributeChild);
475 }
476 }
477 return commonChildrenAttributes;
478 } else {
479 return allChildrenAttributes;
480 }
481}
482
483
486 if (myParent == nullptr) {
487 throw ProcessError("Root doesn't have an associated supermode");
488 } else {
489 auto parents = getHierarchicalParentsRecuersively();
490 // continue depending of supermode
491 if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_NETWORK) {
492 return Supermode::NETWORK;
493 } else if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_DEMAND) {
494 return Supermode::DEMAND;
495 } else if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_DATA) {
496 return Supermode::DATA;
497 } else {
498 throw ProcessError("Invalid supermode");
499 }
500 }
501}
502
503
504bool
508
509
510bool
514
515
516bool
520
521
522bool
526
527
528bool
532
533
534bool
538
539
540bool
544
545
546bool
550
551
552bool
556
557
558bool
562
563
564bool
568
569
570bool
574
575
576bool
580
581
582bool
586
587
588bool
590 return myType & Type::VTYPE;
591}
592
593
594bool
598
599
600bool
602 return myType & Type::ROUTE;
603}
604
605
606bool
610
611
612bool
616
617
618bool
620 return myType & Type::FLOW;
621}
622
623
624bool
626 return myType & Type::PERSON;
627}
628
629
630bool
634
635
636bool
638 return isVehicle() || isPerson() || isContainer();
639}
640
641
642bool
646
647
648bool
652
653
654bool
658
659
660bool
664
665
666bool
668 return isPlanPerson() || isPlanContainer();
669}
670
671
672bool
676
677
678bool
682
683
684bool
688
689
690bool
692 return myType & Type::WALK;
693}
694
695
696bool
698 return myType & Type::RIDE;
699}
700
701
702bool
706
707
708bool
712
713
714bool
718
719
720bool
724
725
726bool
730
731
732bool
736
737
738bool
742
743
744bool
746 return isVehicle() && (myOver & Over::ROUTE);
747}
748
749
750bool
754
755
756bool
760
761
762bool
766
767
768bool
772
773
774bool
778
779
780bool
782 return isPlan() && (myOver & Over::ROUTE);
783}
784
785
786bool
788 return isPlan() && (myOver & Over::EDGE);
789}
790
791
792bool
794 return isPlan() && (myOver & Over::BUSSTOP);
795}
796
797
798bool
802
803
804bool
808
809
810bool
814
815
816bool
820
821
822bool
827
828
829bool
836
837
838bool
842
843
844bool
846 return isPlan() && (myOver & Over::FROM_TAZ);
847}
848
849
850bool
854
855
856bool
860
861
862bool
866
867
868bool
872
873
874bool
878
879
880bool
884
885
886bool
891
892
893bool
895 return isPlan() && (myOver & Over::TO_EDGE);
896}
897
898
899bool
901 return isPlan() && (myOver & Over::TO_TAZ);
902}
903
904
905bool
909
910bool
914
915
916bool
920
921
922bool
926
927
928bool
932
933
934bool
938
939
940bool
945
946
947bool
951
952
953bool
957
958
959bool
963
964
965bool
967 return (myProperty & Property::NOTDRAWABLE) == false;
968}
969
970
971bool
973 // note: By default all elements can be selected, except Tags with "NOTSELECTABLE"
974 return (myProperty & Property::NOTSELECTABLE) == false;
975}
976
977
978bool
982
983
984bool
988
989
990bool
994
995
996bool
998 // note: By default all elements support parameters, except Tags with "NOPARAMETERS"
999 return (myProperty & Property::NOPARAMETERS) == false;
1000}
1001
1002
1003bool
1007
1008
1009bool
1013
1014
1015bool
1019
1020
1021bool
1025
1026
1027bool
1031
1032
1033bool
1037
1038
1039bool
1041 return (myBucketType & file);
1042}
1043
1044
1045bool
1049
1050
1051bool
1055
1056
1057bool
1061
1062
1063bool
1067
1068
1069bool
1073
1074
1075bool
1079
1080void
1082 myChildren.push_back(child);
1083}
1084
1085
1086void
1087GNETagProperties::getChildrenTagProperties(const GNETagProperties* tagProperties, std::vector<const GNETagProperties*>& result) const {
1088 result.push_back(tagProperties);
1089 // call it iterative for all children
1090 for (const auto& child : tagProperties->myChildren) {
1091 getChildrenTagProperties(child, result);
1092 }
1093}
1094
1095
1096void
1097GNETagProperties::getChildrenAttributes(const GNETagProperties* tagProperties, std::map<std::string, const GNEAttributeProperties*>& result, const bool onlyDrawables) const {
1098 // add every attribute only once
1099 if (!onlyDrawables || tagProperties->isDrawable()) {
1100 for (const auto& attributeProperty : tagProperties->myAttributeProperties) {
1101 result[attributeProperty->getAttrStr()] = attributeProperty;
1102 }
1103 }
1104 // call it iterative for all children
1105 for (const auto& child : tagProperties->myChildren) {
1106 getChildrenAttributes(child, result, onlyDrawables);
1107 }
1108}
1109
1110/****************************************************************************/
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..).
@ DATA
Data mode (edgeData, LaneData etc..).
@ DEMAND
Demand mode (Routes, Vehicles etc..).
long long int SUMOTime
Definition GUI.h:36
GUIGlObjectType
@ GLO_MAX
empty max
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define TLF(string,...)
Definition MsgHandler.h:306
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ GNE_TAG_PERSONTRIPS
@ SUMO_TAG_NET
root element of a network file
@ GNE_TAG_JUPEDSIM
@ SUMO_TAG_ROOTFILE
root file
@ GNE_TAG_CONTAINERPLANS
@ GNE_TAG_WIRES
@ GNE_TAG_SUPERMODE_DATA
@ GNE_TAG_DETECTORS
@ SUMO_TAG_VIEWSETTINGS_ADDITIONALS
@ GNE_TAG_DATAS
@ GNE_TAG_STOPS
@ SUMO_TAG_VIEWSETTINGS_VEHICLES
@ GNE_TAG_SUPERMODE_NETWORK
@ GNE_TAG_STOPPINGPLACES
@ GNE_TAG_TRANSPORTS
@ GNE_TAG_PERSONPLANS
@ GNE_TAG_CONTAINERSTOPS
@ GNE_TAG_SHAPES
@ GNE_TAG_SUPERMODE_DEMAND
@ GNE_TAG_WALKS
@ GNE_TAG_TAZS
@ GNE_TAG_RIDES
@ GNE_TAG_PERSONSTOPS
@ GNE_TAG_TRANSHIPS
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ GNE_ATTR_STOPOEXCEPTION
stop exceptions (virtual, used by edge and lanes)
@ SUMO_ATTR_CHANGE_LEFT
@ SUMO_ATTR_CHANGE_RIGHT
@ SUMO_ATTR_VCLASS
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:49
Type
Files that this bucket can save.
Definition FileBucket.h:34
bool hasExtendedAttributes() const
return true if tag correspond to an element that contains extended attributes
const std::string & getTooltipText() const
get tooltip text
bool isPlanTransport() const
return true if tag correspond to a transport
bool isMeanData() const
return true if tag correspond to a mean data element
Over
element in which this element is placed
bool isContainer() const
return true if tag correspond to a container element
bool planToContainerStop() const
return true if tag correspond to a plan that starts in containerStop
bool canBeReparent() const
return true if tag correspond to an element that can be reparent
bool isShapeElement() const
return true if tag correspond to a shape
const std::string & getSelectorText() const
get field string (by default tag in string format)
bool vClassIcon() const
return true if tag correspond to an element that has vClass icons
bool getDefaultBoolValue(SumoXMLAttr attr) const
get default bool value
bool planFromChargingStation() const
return true if tag correspond to a plan that starts in chargingStation
bool isPlan() const
plans
bool planFromJunction() const
return true if tag correspond to a plan that starts in junction
bool isTAZElement() const
return true if tag correspond to a TAZ element
bool isFlow() const
return true if tag correspond to a flow element
bool isTypeDistribution() const
return true if tag correspond to a type distribution element
bool hasGEOShape() const
return true if tag correspond to an element that can use a geo shape
bool saveInDataFile() const
element is saved in a data file
GUIGlObjectType getGLType() const
get GUIGlObjectType associated with this tag property
bool planToBusStop() const
return true if tag correspond to a plan that starts in busStop
const Property myProperty
tag properties
bool isOtherElement() const
return true if tag correspond to a other element (sourceSinks, vTypes, etc.)
std::map< std::string, const GNEAttributeProperties * > getHierarchicalChildrenAttributesRecursively(const bool onlyCommon, const bool onlyDrawables) const
get all children attributes sorted by name (Including this)
bool isGenericData() const
data elements
const unsigned int myBackgroundColor
background color (used in labels and textFields, by default white)
bool planToStoppingPlace() const
return true if tag correspond to a plan that ends in stoppingPlace
bool isListedElement() const
return true if Tag correspond to a listed element
bool planFromContainerStop() const
return true if tag correspond to a plan that starts in containerStop
const std::string & getTagStr() const
get Tag vinculated with this attribute Property in String Format (used to avoid multiple calls to toS...
bool planFromTo() const
return true if tag correspond to a plan with from-to parents
const RGBColor & getDefaultColorValue(SumoXMLAttr attr) const
get default bool value
const std::string myTooltipText
tooltip text
std::vector< const GNETagProperties * > myChildren
tag property children
bool planRoute() const
return true if tag correspond to a plan placed over route
bool saveInAdditionalFile() const
element is saved in an additional file
const SumoXMLTag myTag
Sumo XML Tag vinculated wit this tag Property.
bool isChild() const
properties
const std::vector< SumoXMLTag > myXMLParentTags
vector with XML parent tags (used by child elements like access or spaces)
bool planStoppingPlace() const
return true if tag correspond to a plan placed in stoppingPlace
bool isNetworkElement() const
network elements
const GNETagProperties * myParent
tag property parent
bool saveInDemandFile() const
element is saved in a demand file
bool isDataElement() const
return true if tag correspond to a data element
double getDefaultDoubleValue(SumoXMLAttr attr) const
get default double value
bool isSelectable() const
return true if tag correspond to a selectable element
bool planToJunction() const
return true if tag correspond to a plan that starts in junction
bool isType() const
demand elements
bool planFromParkingArea() const
return true if tag correspond to a plan that starts in parkingAera
bool isRoute() const
return true if tag correspond to a route element
bool isVehicle() const
return true if tag correspond to a vehicle element
bool isDistributionReference() const
return true if tag correspond to a dstribution reference element
bool planParkingArea() const
return true if tag correspond to a plan placed over parkingArea
SUMOTime getDefaultTimeValue(SumoXMLAttr attr) const
get default time value
bool isPlanStop() const
return true if tag correspond to a stop plan
bool planToTAZ() const
return true if tag correspond to a plan that starts in TAZ
bool planFromStoppingPlace() const
return true if tag correspond to a plan that starts in stoppingPlace
bool planConsecutiveEdges() const
plan parents
const std::vector< const GNETagProperties * > getHierarchicalParentsRecuersively() const
get all parents, beginning from current element (root not included) until this element
std::vector< const GNETagProperties * > getHierarchicalChildrenRecursively() const
get all children tags (Including children of their children)
bool isDistribution() const
return true if tag correspond to a distribution element
bool isHierarchicalTag() const
check if this is a hierarchical tag
bool isPlacedInRTree() const
return true if Tag correspond to an element that has to be placed in RTREE
bool vehicleJunctions() const
return true if tag correspond to a vehicle placed over from-to junctions
bool isPlanStopContainer() const
return true if tag correspond to a container stop plan
GNETagProperties()=delete
default constructor
GUIIcon getGUIIcon() const
get GUI icon associated to this tag property
bool hasParameters() const
return true if Tag correspond to an element that supports parameters "key1=value1|key2=value2|....
bool isStoppingPlace() const
additional elements
bool hasTypeParent() const
return true if tag correspond to an element with a type as a first parent
const GNEAttributeProperties * at(int index) const
get attribute value
void getChildrenAttributes(const GNETagProperties *tagProperties, std::map< std::string, const GNEAttributeProperties * > &result, const bool onlyDrawables) const
recursive function for get all children attributes (Including this)
const std::string myTagStr
Sumo XML Tag vinculated wit this tag Property in String format.
bool isCalibrator() const
return true if tag correspond to a calibrator (Only used to group all detectors in the XML)
const std::vector< const GNETagProperties * > & getHierarchicalChildren() const
get children of this tag property
bool isDrawable() const
return true if tag correspond to a drawable element
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const Conflicts myConflicts
conflicts
bool planFromEdge() const
return true if tag correspond to a plan that starts in edge
Supermode getSupermode() const
get supermode associated with this tag
bool planFromBusStop() const
return true if tag correspond to a plan that starts in busStop
bool isDetector() const
return true if tag correspond to a shape (Only used to group all detectors in the XML)
bool planFromTrainStop() const
return true if tag correspond to a plan that starts in trainStop
void checkTagIntegrity() const
check Tag integrity (this include all their attributes)
bool planToTrainStop() const
return true if tag correspond to a plan that starts in trainStop
bool planFromTAZ() const
return true if tag correspond to a plan that starts in TAZ
bool vehicleRouteEmbedded() const
return true if tag correspond to a vehicle placed over an embedded route
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
bool isRouteDistribution() const
return true if tag correspond to a route distribution element
bool isJuPedSimElement() const
return true if tag correspond to a JuPedSim element
bool isPlanContainer() const
return true if tag correspond to a container plan
bool isPlanPersonTrip() const
return true if tag correspond to a person trip plan
const FileBucket::Type myBucketType
tag file
bool isFileCompatible(FileBucket::Type file) const
file
bool planEdge() const
return true if tag correspond to a plan placed over edge
bool hasDialog() const
return true if tag correspond to an element that can be edited using a dialog
bool isAdditionalPureElement() const
return true if tag correspond to a pure additional element
const SumoXMLTag myXMLTag
Tag written in XML and used in GNENetHelper::AttributeCarriers.
void getChildrenTagProperties(const GNETagProperties *tagProperties, std::vector< const GNETagProperties * > &result) const
recursive function for get all children tag properites (Including this)
bool saveInMeanDataFile() const
element is saved in a meanData file
const std::string mySelectorText
text show in selector text
const Over myOver
tag over
bool isWireElement() const
return true if tag correspond to a Wire element
const GNETagProperties * getHierarchicalParent() const
hierarchy functions
bool saveInParentFile() const
element is saved in the parent file
int getNumberOfAttributes() const
get number of attributes
bool planContainerStop() const
return true if tag correspond to a plan placed over containerStop
bool vehicleEdges() const
return true if tag correspond to a vehicle placed over from-to edges
void addChild(const GNETagProperties *child)
add child
bool isPlanPerson() const
return true if tag correspond to a person plan
int getDefaultIntValue(SumoXMLAttr attr) const
get default int value
bool isDemandElement() const
return true if tag correspond to a demand element
const GUIGlObjectType myGLType
GUIGlObjectType associated with this tag property.
SumoXMLTag getXMLTag() const
default values
bool isPlanRide() const
return true if tag correspond to a ride plan
bool isInternalLane() const
return true if tag correspond to an internal lane
const Type myType
tag Types
bool planTrainStop() const
return true if tag correspond to a plan placed over trainStop
bool isVehicleWaypoint() const
return true if tag correspond to a vehicle waypoint element
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
bool isAdditionalElement() const
return true if tag correspond to an additional element (note: this include TAZ, shapes and wires)
bool isSymbol() const
return true if tag correspond to a symbol element
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute "attr"
bool planToParkingArea() const
return true if tag correspond to a plan that starts in parkingArea
bool planToChargingStation() const
return true if tag correspond to a plan that starts in chargingStation
bool isPlanStopPerson() const
return true if tag correspond to a person stop plan
std::vector< const GNEAttributeProperties * > myAttributeProperties
vector with the attribute values vinculated with this Tag
unsigned int getBackGroundColor() const
get background color
bool isVehicleStop() const
return true if tag correspond to a vehicle stop element
bool isPerson() const
return true if tag correspond to a person element
bool vehicleTAZs() const
return true if tag correspond to a vehicle placed over from-to TAZs
~GNETagProperties()
destructor
bool vehicleRoute() const
plan parents
bool isPlanWalk() const
return true if tag correspond to a walk plan
bool planToEdge() const
return true if tag correspond to a plan that starts in edge
GNETagProperties(const SumoXMLTag tag, GNETagProperties *parent, const GNETagProperties::Type type, const GNETagProperties::Property property, const GNETagProperties::Over over, const FileBucket::Type bucketType, const GNETagProperties::Conflicts conflicts, const GUIIcon icon, const GUIGlObjectType GLType, const SumoXMLTag XMLTag, const std::string tooltipText, std::vector< SumoXMLTag > XMLParentTags={}, const unsigned int backgroundColor=FXRGBA(255, 255, 255, 255), const std::string selectorText="")
parameter constructor
const GUIIcon myIcon
icon associated to this tag property
bool planBusStop() const
return true if tag correspond to a plan placed over busStop
bool saveInNetworkFile() const
element is saved in a network file
const std::string & getDefaultStringValue(SumoXMLAttr attr) const
default values
bool requireProj() const
return true if tag correspond to an element that requires a geo projection
bool planChargingStation() const
return true if tag correspond to a plan placed over chargingStation
const std::vector< SumoXMLTag > & getXMLParentTags() const
get XML parent tags
bool isPlanTranship() const
return true if tag correspond to a tranship