30 const std::string tooltip,
const std::vector<SumoXMLTag> XMLParentTags,
31 const unsigned int backgroundColor,
const std::string selectorText) :
36 myTagProperty(tagProperty),
38 myConflicts(conflicts),
42 myTooltipText(tooltip),
43 myXMLParentTags(XMLParentTags),
44 mySelectorText(selectorText.empty() ?
toString(tag) : selectorText),
45 myBackgroundColor(backgroundColor) {
53 const unsigned int backgroundColor,
const std::string selectorText) :
57 myTagProperty(
Property::HIERARCHICAL),
60 myTooltipText(tooltip),
61 mySelectorText(selectorText.empty() ?
toString(tag) : selectorText),
62 myBackgroundColor(backgroundColor) {
71 delete attrProperties;
200 throw ProcessError(
"multiple basic type properties defined");
204 throw ProcessError(
"element can be either shape or TAZ or wire element at the same time");
224 throw FormatException(
"Only hierarchical tags can have a GLType GLO_MAX");
228 attributeProperty->checkAttributeIntegrity();
230 if (attributeProperty->isSVCPermission()) {
236 throw ProcessError(
"allow need a disallow attribute in the same tag");
238 throw ProcessError(
"disallow need an allow attribute in the same tag");
250 if (attributeProperty->getAttr() == attr) {
251 return attributeProperty->getDefaultStringValue();
262 if (attributeProperty->getAttr() == attr) {
263 return attributeProperty->getDefaultIntValue();
274 if (attributeProperty->getAttr() == attr) {
275 return attributeProperty->getDefaultDoubleValue();
286 if (attributeProperty->getAttr() == attr) {
287 return attributeProperty->getDefaultTimeValue();
298 if (attributeProperty->getAttr() == attr) {
299 return attributeProperty->getDefaultBoolValue();
310 if (attributeProperty->getAttr() == attr) {
311 return attributeProperty->getDefaultColorValue();
336const std::vector<const GNEAttributeProperties*>&
346 if ((attributeProperty->getAttr() == attr) || (attributeProperty->hasAttrSynonym() && (attributeProperty->getAttrSynonym() == attr))) {
347 return attributeProperty;
375 if (attributeProperty->getAttr() == attr) {
407const std::vector<SumoXMLTag>&
419const std::vector<const GNETagProperties*>
422 std::vector<const GNETagProperties*> parents;
423 parents.push_back(
this);
424 while (parents.back()->myParent !=
nullptr) {
425 parents.push_back(parents.back()->myParent);
427 std::reverse(parents.begin(), parents.end());
432const std::vector<const GNETagProperties*>&
438std::vector<const GNETagProperties*>
440 std::vector<const GNETagProperties*> children;
447std::map<std::string, const GNEAttributeProperties*>
449 std::map<std::string, const GNEAttributeProperties*> allChildrenAttributes;
454 std::map<std::string, const GNEAttributeProperties*> commonChildrenAttributes;
458 for (
const auto& attributeChild : allChildrenAttributes) {
459 bool isCommon =
true;
460 for (
const auto tagChild : tagChildren) {
461 if ((!onlyDrawables || tagChild->isDrawable()) &&
462 !tagChild->isHierarchicalTag() &&
463 !tagChild->hasAttribute(attributeChild.second->getAttr())) {
468 commonChildrenAttributes.insert(attributeChild);
471 return commonChildrenAttributes;
473 return allChildrenAttributes;
481 throw ProcessError(
"Root doesn't have an associated supermode");
1015 result.push_back(tagProperties);
1017 for (
const auto& child : tagProperties->
myChildren) {
1026 if (!onlyDrawables || tagProperties->
isDrawable()) {
1028 result[attributeProperty->getAttrStr()] = attributeProperty;
1032 for (
const auto& child : tagProperties->
myChildren) {
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
GUIIcon
An enumeration of icons used by the gui applications.
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_NET
root element of a network file
@ SUMO_TAG_ROOTFILE
root file
@ SUMO_TAG_VIEWSETTINGS_ADDITIONALS
@ SUMO_TAG_VIEWSETTINGS_VEHICLES
@ GNE_TAG_SUPERMODE_NETWORK
@ SUMO_TAG_VTYPE_DISTRIBUTION
distribution of a vehicle type
@ GNE_TAG_SUPERMODE_DEMAND
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_STOPOEXCEPTION
stop exceptions (virtual, used by edge and lanes)
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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
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
const Type myTagType
tag Types
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 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 hasGEOShape() const
return true if tag correspond to an element that can use a geo shape
const Over myTagOver
tag over
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
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 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
const SumoXMLTag myTag
Sumo XML Tag vinculated wit this tag Property.
bool isChild() const
return true if tag correspond to an element child of another element (Example: E3->Entry/Exit)
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 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 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) untils this element
std::vector< const GNETagProperties * > getHierarchicalChildrenRecursively() const
get all children tags (Including children of their children)
bool isHierarchicalTag() const
check if this is a hirearchical 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
const Property myTagProperty
tag properties
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)
Over
element in which this element is placed
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
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 isTypeDist() const
return true if tag correspond to a type distribution element
bool canCenterCameraAfterCreation() const
return true if tag correspond to an element that center camera after creation
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.
void getChildrenTagProperties(const GNETagProperties *tagProperties, std::vector< const GNETagProperties * > &result) const
recursive function for get all children tag properites (Including this)
const std::string mySelectorText
text show in selector text
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 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
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
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