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-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/****************************************************************************/
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 Property property, const Over over, const File file,
29 const Conflicts conflicts, const GUIIcon icon, const GUIGlObjectType GLType,
30 const SumoXMLTag XMLTag, const std::string tooltipText, const std::vector<SumoXMLTag> XMLParentTags,
31 const unsigned int backgroundColor, const std::string selectorText) :
32 myTag(tag),
33 myTagStr(toString(tag)),
34 myParent(parent),
35 myType(type),
36 myProperty(property),
37 myOver(over),
38 myFile(file),
39 myConflicts(conflicts),
40 myIcon(icon),
41 myGLType(GLType),
42 myXMLTag(XMLTag),
43 myTooltipText(tooltipText),
44 myXMLParentTags(XMLParentTags),
45 mySelectorText(selectorText.empty() ? toString(tag) : selectorText),
46 myBackgroundColor(backgroundColor) {
47 if (parent) {
48 parent->addChild(this);
49 }
50}
51
52
53GNETagProperties::GNETagProperties(const SumoXMLTag tag, GNETagProperties* parent, const GUIIcon icon, const std::string tooltipText,
54 const unsigned int backgroundColor, const std::string selectorText) :
55 myTag(tag),
56 myTagStr(toString(tag)),
57 myParent(parent),
58 myProperty(Property::HIERARCHICAL),
59 myIcon(icon),
60 myXMLTag(tag),
61 myTooltipText(tooltipText),
62 mySelectorText(selectorText.empty() ? toString(tag) : selectorText),
63 myBackgroundColor(backgroundColor) {
64 if (parent) {
65 parent->addChild(this);
66 }
67}
68
69
71 for (const auto& attrProperties : myAttributeProperties) {
72 delete attrProperties;
73 }
74}
75
76
79 return myTag;
80}
81
82
83const std::string&
85 return myTagStr;
86}
87
88
89void
91 // check integrity only in debug mode
92#ifdef DEBUG
93 // check that this edge has parents (Except supermodes)
94 if (myTag == SUMO_TAG_ROOTFILE) {
95 if (myParent != nullptr) {
96 throw ProcessError("Root parent must be empty");
97 }
98 } else if (myParent == nullptr) {
99 throw ProcessError("No parent defined");
100 }
101 // check network parents
102 if (isNetworkElement() && (myParent->getTag() != SUMO_TAG_NET)) {
103 throw ProcessError("Invalid network element parent");
104 }
105 // check additional parents
106 if (isStoppingPlace()) {
107 if (myParent->getTag() != GNE_TAG_STOPPINGPLACES) {
108 throw ProcessError("Invalid stoppingPlace parent");
109 }
110 } else if (isDetector()) {
111 if (myParent->getTag() != GNE_TAG_DETECTORS) {
112 throw ProcessError("Invalid detector parent");
113 }
114 } else if (isWireElement()) {
115 if (myParent->getTag() != GNE_TAG_WIRES) {
116 throw ProcessError("Invalid wire parent");
117 }
118 } else if (isJuPedSimElement()) {
119 if (myParent->getTag() != GNE_TAG_JUPEDSIM) {
120 throw ProcessError("Invalid juPedSim parent");
121 }
122 } else if (isTAZElement()) {
123 if (myParent->getTag() != GNE_TAG_TAZS) {
124 throw ProcessError("Invalid TAZ parent");
125 }
126 } else if (isShapeElement()) {
127 if (myParent->getTag() != GNE_TAG_SHAPES) {
128 throw ProcessError("Invalid shape parent");
129 }
130 } else if (isAdditionalElement()) {
132 throw ProcessError("Invalid additional parent");
133 }
134 }
135 // check demand parents
136 if (isVehicle()) {
137 if (myParent->getTag() != SUMO_TAG_VIEWSETTINGS_VEHICLES) {
138 throw ProcessError("Invalid vehicle parent");
139 }
140 } else if (isVehicleStop()) {
141 if (myParent->getTag() != GNE_TAG_STOPS) {
142 throw ProcessError("Invalid vehicle stop parent");
143 }
144 } else if (isPlanPersonTrip()) {
145 if (myParent->getTag() != GNE_TAG_PERSONTRIPS) {
146 throw ProcessError("Invalid person trip parent");
147 }
148 } else if (isPlanRide()) {
149 if (myParent->getTag() != GNE_TAG_RIDES) {
150 throw ProcessError("Invalid ride parent");
151 }
152 } else if (isPlanWalk()) {
153 if (myParent->getTag() != GNE_TAG_WALKS) {
154 throw ProcessError("Invalid walk parent");
155 }
156 } else if (isPlanStopPerson()) {
157 if (myParent->getTag() != GNE_TAG_PERSONSTOPS) {
158 throw ProcessError("Invalid person stop parent");
159 }
160 } else if (isPlanPerson()) {
161 if (myParent->getTag() != GNE_TAG_PERSONPLANS) {
162 throw ProcessError("Invalid person plan parent");
163 }
164 } else if (isPlanTransport()) {
165 if (myParent->getTag() != GNE_TAG_TRANSPORTS) {
166 throw ProcessError("Invalid ride parent");
167 }
168 } else if (isPlanTranship()) {
169 if (myParent->getTag() != GNE_TAG_TRANSHIPS) {
170 throw ProcessError("Invalid walk parent");
171 }
172 } else if (isPlanStopContainer()) {
173 if (myParent->getTag() != GNE_TAG_CONTAINERSTOPS) {
174 throw ProcessError("Invalid container stop parent");
175 }
176 } else if (isPlanContainer()) {
177 if (myParent->getTag() != GNE_TAG_CONTAINERPLANS) {
178 throw ProcessError("Invalid container plan parent");
179 }
180 } else if (isDemandElement()) {
181 if (myParent->getTag() != GNE_TAG_SUPERMODE_DEMAND) {
182 throw ProcessError("Invalid supermode demand parent");
183 }
184 }
185 // check data parents
186 if (isGenericData()) {
187 if (myParent->getTag() != GNE_TAG_DATAS) {
188 throw ProcessError("Invalid generic data parent");
189 }
190 } else if (isDataElement()) {
191 if (myParent->getTag() != GNE_TAG_SUPERMODE_DATA) {
192 throw ProcessError("Invalid supermode data parent");
193 }
194 }
195 // check that element must ist at least networkElement, Additional, or shape
197 throw ProcessError("no basic type property defined");
198 }
199 // check that element only is networkElement, Additional, or shape at the same time
201 throw ProcessError("multiple basic type properties defined");
202 }
203 // check that element only is shape, TAZ, or wire at the same time
204 if ((isShapeElement() + isTAZElement() + isWireElement()) > 1) {
205 throw ProcessError("element can be either shape or TAZ or wire element at the same time");
206 }
207 // check that master tag is valid
208 if (isChild() && myXMLParentTags.empty()) {
209 throw FormatException("Parent tags cannot be empty");
210 }
211 // check that master was defined
212 if (!isChild() && !myXMLParentTags.empty()) {
213 throw FormatException("Element doesn't support parent elements");
214 }
215 // check reparent
216 if (!isChild() && canBeReparent()) {
217 throw FormatException("Only Child elements can be reparent");
218 }
219 // check vClass icons
221 throw FormatException("Element require attribute SUMO_ATTR_VCLASS");
222 }
223 // check glType
225 throw FormatException("Only hierarchical tags can have a GLType GLO_MAX");
226 }
227 // check drawable
228 if (!isDrawable() && isPlacedInRTree()) {
229 throw FormatException("Non-drawable elements cannot be placed in RTREE");
230 }
231 // check integrity of all attributes
232 for (const auto& attributeProperty : myAttributeProperties) {
233 attributeProperty->checkAttributeIntegrity();
234 // check that if attribute is vehicle classes, own a combination of Allow/disallow attribute
235 if (attributeProperty->isSVCPermission()) {
236 if ((attributeProperty->getAttr() != SUMO_ATTR_ALLOW) && (attributeProperty->getAttr() != SUMO_ATTR_DISALLOW) &&
237 (attributeProperty->getAttr() != SUMO_ATTR_CHANGE_LEFT) && (attributeProperty->getAttr() != SUMO_ATTR_CHANGE_RIGHT) &&
238 (attributeProperty->getAttr() != GNE_ATTR_STOPOEXCEPTION)) {
239 throw ProcessError("Attributes aren't combinables");
240 } else if ((attributeProperty->getAttr() == SUMO_ATTR_ALLOW) && !hasAttribute(SUMO_ATTR_DISALLOW)) {
241 throw ProcessError("allow need a disallow attribute in the same tag");
242 } else if ((attributeProperty->getAttr() == SUMO_ATTR_DISALLOW) && !hasAttribute(SUMO_ATTR_ALLOW)) {
243 throw ProcessError("disallow need an allow attribute in the same tag");
244 }
245 }
246 }
247#endif // DEBUG
248}
249
250
251const std::string&
253 // iterate over attribute properties
254 for (const auto& attributeProperty : myAttributeProperties) {
255 if (attributeProperty->getAttr() == attr) {
256 return attributeProperty->getDefaultStringValue();
257 }
258 }
259 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
260}
261
262
263int
265 // iterate over attribute properties
266 for (const auto& attributeProperty : myAttributeProperties) {
267 if (attributeProperty->getAttr() == attr) {
268 return attributeProperty->getDefaultIntValue();
269 }
270 }
271 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
272}
273
274
275double
277 // iterate over attribute properties
278 for (const auto& attributeProperty : myAttributeProperties) {
279 if (attributeProperty->getAttr() == attr) {
280 return attributeProperty->getDefaultDoubleValue();
281 }
282 }
283 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
284}
285
286
289 // iterate over attribute properties
290 for (const auto& attributeProperty : myAttributeProperties) {
291 if (attributeProperty->getAttr() == attr) {
292 return attributeProperty->getDefaultTimeValue();
293 }
294 }
295 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
296}
297
298
299bool
301 // iterate over attribute properties
302 for (const auto& attributeProperty : myAttributeProperties) {
303 if (attributeProperty->getAttr() == attr) {
304 return attributeProperty->getDefaultBoolValue();
305 }
306 }
307 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
308}
309
310
311const RGBColor&
313 // iterate over attribute properties
314 for (const auto& attributeProperty : myAttributeProperties) {
315 if (attributeProperty->getAttr() == attr) {
316 return attributeProperty->getDefaultColorValue();
317 }
318 }
319 throw ProcessError(TLF("Attribute '%' not defined", toString(attr)));
320}
321
322
323const std::string&
327
328
329const std::string&
333
334
335unsigned int
339
340
341const std::vector<const GNEAttributeProperties*>&
345
346
349 // iterate over attribute properties
350 for (const auto& attributeProperty : myAttributeProperties) {
351 if ((attributeProperty->getAttr() == attr) || (attributeProperty->hasAttrSynonym() && (attributeProperty->getAttrSynonym() == attr))) {
352 return attributeProperty;
353 }
354 }
355 // throw error if these attribute doesn't exist
356 throw ProcessError(TLF("Attribute '%' doesn't exist", toString(attr)));
357}
358
359
362 if (index < 0 || index >= (int)myAttributeProperties.size()) {
363 throw ProcessError(TLF("Invalid index '%' used in getAttributeProperties(int)", toString(index)));
364 } else {
365 return myAttributeProperties.at(index);
366 }
367}
368
369
371GNETagProperties::at(int index) const {
372 return myAttributeProperties.at(index);
373}
374
375
376bool
378 // iterate over attribute properties
379 for (const auto& attributeProperty : myAttributeProperties) {
380 if (attributeProperty->getAttr() == attr) {
381 return true;
382 }
383 }
384 return false;
385}
386
387
388int
392
393
396 return myIcon;
397}
398
399
402 return myGLType;
403}
404
405
408 return myXMLTag;
409}
410
411
412const std::vector<SumoXMLTag>&
416
417
418const GNETagProperties*
422
423
424const std::vector<const GNETagProperties*>
426 // get the list of all roots
427 std::vector<const GNETagProperties*> parents;
428 parents.push_back(this);
429 while (parents.back()->myParent != nullptr) {
430 parents.push_back(parents.back()->myParent);
431 }
432 std::reverse(parents.begin(), parents.end());
433 return parents;
434}
435
436
437const std::vector<const GNETagProperties*>&
441
442
443std::vector<const GNETagProperties*>
445 std::vector<const GNETagProperties*> children;
446 // obtain all tags recursively (including this)
447 getChildrenTagProperties(this, children);
448 return children;
449}
450
451
452std::map<std::string, const GNEAttributeProperties*>
453GNETagProperties::getHierarchicalChildrenAttributesRecursively(const bool onlyCommon, const bool onlyDrawables) const {
454 std::map<std::string, const GNEAttributeProperties*> allChildrenAttributes;
455 // obtain all children attributes recursively (including this)
456 getChildrenAttributes(this, allChildrenAttributes, onlyDrawables);
457 // check if get only commons
458 if (onlyCommon) {
459 std::map<std::string, const GNEAttributeProperties*> commonChildrenAttributes;
460 // get all tag children and take only the common attributes
461 const auto tagChildren = getHierarchicalChildrenRecursively();
462 // iterate over all children and check if exist in child tag
463 for (const auto& attributeChild : allChildrenAttributes) {
464 bool isCommon = true;
465 for (const auto tagChild : tagChildren) {
466 if ((!onlyDrawables || tagChild->isDrawable()) && // filter only drawables
467 !tagChild->isHierarchicalTag() && // hierarchical tags doesn't have attirbutes
468 !tagChild->hasAttribute(attributeChild.second->getAttr())) {
469 isCommon = false;
470 }
471 }
472 if (isCommon) {
473 commonChildrenAttributes.insert(attributeChild);
474 }
475 }
476 return commonChildrenAttributes;
477 } else {
478 return allChildrenAttributes;
479 }
480}
481
482
485 if (myParent == nullptr) {
486 throw ProcessError("Root doesn't have an associated supermode");
487 } else {
488 auto parents = getHierarchicalParentsRecuersively();
489 // continue depending of supermode
490 if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_NETWORK) {
491 return Supermode::NETWORK;
492 } else if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_DEMAND) {
493 return Supermode::DEMAND;
494 } else if (parents.at(1)->getTag() == GNE_TAG_SUPERMODE_DATA) {
495 return Supermode::DATA;
496 } else {
497 throw ProcessError("Invalid supermode");
498 }
499 }
500}
501
502
503bool
507
508
509bool
513
514
515bool
519
520
521bool
525
526
527bool
531
532
533bool
537
538
539bool
543
544
545bool
549
550
551bool
555
556
557bool
561
562
563bool
567
568
569bool
573
574
575bool
579
580
581bool
585
586
587bool
589 return myType & Type::VTYPE;
590}
591
592
593bool
597
598
599bool
601 return myType & Type::ROUTE;
602}
603
604
605bool
609
610
611bool
615
616
617bool
619 return myType & Type::FLOW;
620}
621
622
623bool
625 return myType & Type::PERSON;
626}
627
628
629bool
633
634
635bool
637 return isVehicle() || isPerson() || isContainer();
638}
639
640
641bool
645
646
647bool
651
652
653bool
657
658
659bool
663
664
665bool
667 return isPlanPerson() || isPlanContainer();
668}
669
670
671bool
675
676
677bool
681
682
683bool
687
688
689bool
691 return myType & Type::WALK;
692}
693
694
695bool
697 return myType & Type::RIDE;
698}
699
700
701bool
705
706
707bool
711
712
713bool
717
718
719bool
723
724
725bool
729
730
731bool
735
736
737bool
741
742
743bool
745 return isVehicle() && (myOver & Over::ROUTE);
746}
747
748
749bool
753
754
755bool
759
760
761bool
765
766
767bool
771
772
773bool
777
778
779bool
781 return isPlan() && (myOver & Over::ROUTE);
782}
783
784
785bool
787 return isPlan() && (myOver & Over::EDGE);
788}
789
790
791bool
793 return isPlan() && (myOver & Over::BUSSTOP);
794}
795
796
797bool
801
802
803bool
807
808
809bool
813
814
815bool
819
820
821bool
826
827
828bool
835
836
837bool
841
842
843bool
845 return isPlan() && (myOver & Over::FROM_TAZ);
846}
847
848
849bool
853
854
855bool
859
860
861bool
865
866
867bool
871
872
873bool
877
878
879bool
883
884
885bool
890
891
892bool
894 return isPlan() && (myOver & Over::TO_EDGE);
895}
896
897
898bool
900 return isPlan() && (myOver & Over::TO_TAZ);
901}
902
903
904bool
908
909bool
913
914
915bool
919
920
921bool
925
926
927bool
931
932
933bool
937
938
939bool
944
945
946bool
950
951
952bool
956
957
958bool
962
963
964bool
966 return (myProperty & Property::NOTDRAWABLE) == false;
967}
968
969
970bool
972 // note: By default all elements can be selected, except Tags with "NOTSELECTABLE"
973 return (myProperty & Property::NOTSELECTABLE) == false;
974}
975
976
977bool
981
982
983bool
987
988
989bool
993
994
995bool
997 // note: By default all elements support parameters, except Tags with "NOPARAMETERS"
998 return (myProperty & Property::NOPARAMETERS) == false;
999}
1000
1001
1002bool
1006
1007
1008bool
1012
1013
1014bool
1018
1019
1020bool
1024
1025
1026bool
1030
1031
1032bool
1036
1037
1038bool
1042
1043
1044bool
1048
1049
1050bool
1054
1055
1056bool
1058 return (myFile & File::DATA);
1059}
1060
1061
1062bool
1066
1067
1068bool
1072
1073
1074bool
1078
1079
1080bool
1082 return (myFile & File::TLS);
1083}
1084
1085
1086void
1088 myChildren.push_back(child);
1089}
1090
1091
1092void
1093GNETagProperties::getChildrenTagProperties(const GNETagProperties* tagProperties, std::vector<const GNETagProperties*>& result) const {
1094 result.push_back(tagProperties);
1095 // call it iterative for all children
1096 for (const auto& child : tagProperties->myChildren) {
1097 getChildrenTagProperties(child, result);
1098 }
1099}
1100
1101
1102void
1103GNETagProperties::getChildrenAttributes(const GNETagProperties* tagProperties, std::map<std::string, const GNEAttributeProperties*>& result, const bool onlyDrawables) const {
1104 // add every attribute only once
1105 if (!onlyDrawables || tagProperties->isDrawable()) {
1106 for (const auto& attributeProperty : tagProperties->myAttributeProperties) {
1107 result[attributeProperty->getAttrStr()] = attributeProperty;
1108 }
1109 }
1110 // call it iterative for all children
1111 for (const auto& child : tagProperties->myChildren) {
1112 getChildrenAttributes(child, result, onlyDrawables);
1113 }
1114}
1115
1116/****************************************************************************/
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:46
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
File
files in which element can be saved
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)
const File myFile
tag file
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
bool saveInEdgeTypeFile() const
element is saved in a edge type file
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
GNETagProperties(const SumoXMLTag tag, GNETagProperties *parent, const Type type, const Property property, const Over over, const File file, const 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 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
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.
bool saveInTLSFile() const
element is saved in a TLS type file
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
int getNumberOfAttributes() const
get number of attributes
bool saveInJunctionFile() const
element is saved in a junction file
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
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
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