Eclipse SUMO - Simulation of Urban MObility
|
#include <GNEAttributeProperties.h>
Public Types | |
enum | AttrProperty { INT = 1 << 0 , FLOAT = 1 << 1 , SUMOTIME = 1 << 2 , BOOL = 1 << 3 , STRING = 1 << 4 , POSITION = 1 << 5 , COLOR = 1 << 6 , VTYPE = 1 << 7 , VCLASS = 1 << 8 , POSITIVE = 1 << 9 , UNIQUE = 1 << 10 , FILENAME = 1 << 11 , DISCRETE = 1 << 12 , PROBABILITY = 1 << 13 , ANGLE = 1 << 14 , LIST = 1 << 15 , SECUENCIAL = 1 << 16 , DEFAULTVALUE = 1 << 17 , SYNONYM = 1 << 18 , RANGE = 1 << 19 , EXTENDED = 1 << 20 , UPDATEGEOMETRY = 1 << 21 , ACTIVATABLE = 1 << 22 , FLOW = 1 << 23 , AUTOMATICID = 1 << 24 , COPYABLE = 1 << 25 , ALWAYSENABLED = 1 << 26 , GEO = 1 << 27 , NETEDIT = 1 << 28 } |
struct with the tag Properties More... | |
Public Member Functions | |
void | checkAttributeIntegrity () const |
check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float) | |
SumoXMLAttr | getAttr () const |
get XML Attribute | |
const std::string & | getAttrStr () const |
get XML Attribute | |
SumoXMLAttr | getAttrSynonym () const |
get tag synonym | |
bool | getDefaultActivated () const |
get default active value | |
const std::string & | getDefaultValue () const |
get default value | |
const std::string & | getDefinition () const |
get default value | |
std::string | getDescription () const |
return a description of attribute | |
const std::vector< std::string > & | getDiscreteValues () const |
get discrete values | |
double | getMaximumRange () const |
get maximum range | |
double | getMinimumRange () const |
get minimum range | |
int | getPositionListed () const |
get position in list (used in frames for listing attributes with certain sort) | |
const GNETagProperties & | getTagPropertyParent () const |
get reference to tagProperty parent | |
GNEAttributeProperties () | |
default constructor | |
GNEAttributeProperties (const SumoXMLAttr attribute, const int attributeProperty, const std::string &definition, std::string defaultValue="") | |
parameter constructor | |
bool | hasAttrRange () const |
return true if Attr correspond to an element that only accept a range of values | |
bool | hasAttrSynonym () const |
return true if Attr correspond to an element that will be written in XML with another name | |
bool | hasAutomaticID () const |
return true if attribute ID can generate an automatic ID | |
bool | hasDefaultValue () const |
return true if attribute owns a default value | |
bool | isActivatable () const |
return true if attribute is activatable | |
bool | isAlwaysEnabled () const |
return true if attribute is always enabled | |
bool | isBool () const |
return true if attribute is boolean | |
bool | isColor () const |
return true if attribute is a color | |
bool | isCopyable () const |
return true if attribute is copyable | |
bool | isDiscrete () const |
return true if attribute is discrete | |
bool | isExtended () const |
return true if attribute is extended | |
bool | isFilename () const |
return true if attribute is a filename | |
bool | isFloat () const |
return true if attribute is a float | |
bool | isFlow () const |
return true if attribute is part of a flow definition | |
bool | isGEO () const |
return true if attribute is GEO | |
bool | isInt () const |
return true if attribute is an integer | |
bool | isList () const |
return true if attribute is a list | |
bool | isNetedit () const |
return true if attribute is exclusive of netedit | |
bool | isNumerical () const |
return true if attribute is numerical (int or float) | |
bool | isPosition () const |
return true if attribute is a position | |
bool | isPositive () const |
return true if attribute is positive | |
bool | isProbability () const |
return true if attribute is a probability | |
bool | isSecuential () const |
return true if attribute is sequential | |
bool | isString () const |
return true if attribute is a string | |
bool | isSUMOTime () const |
return true if attribute is a SUMOTime | |
bool | isSVCPermission () const |
return true if attribute is a VehicleClass | |
bool | isUnique () const |
return true if attribute is unique | |
bool | isVClass () const |
return true if attribute is a VehicleClass | |
bool | isVType () const |
return true if attribute is a VType or vTypeDistribution | |
bool | requireUpdateGeometry () const |
return true if attribute requires a update geometry in setAttribute(...) | |
void | setDefaultActivated (const bool value) |
set default activated value | |
void | setDiscreteValues (const std::vector< std::string > &discreteValues) |
set discrete values | |
void | setRange (const double minimum, const double maximum) |
set range | |
void | setSynonym (const SumoXMLAttr synonym) |
set synonim | |
void | setTagPropertyParent (GNETagProperties *tagPropertyParent) |
set tag property parent | |
~GNEAttributeProperties () | |
destructor | |
Private Attributes | |
SumoXMLAttr | myAttribute = SUMO_ATTR_NOTHING |
XML Attribute. | |
int | myAttributeProperty = STRING |
Property of attribute. | |
std::string | myAttrStr |
string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls) | |
SumoXMLAttr | myAttrSynonym = SUMO_ATTR_NOTHING |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written) | |
bool | myDefaultActivated = false |
default activated (by default false) | |
std::string | myDefaultValue |
default value (by default empty) | |
std::string | myDefinition |
text with a definition of attribute | |
std::vector< std::string > | myDiscreteValues |
discrete values that can take this Attribute (by default empty) | |
double | myMaximumRange = 0 |
maxium Range | |
double | myMinimumRange = 0 |
minimun Range | |
GNETagProperties * | myTagPropertyParent = nullptr |
pointer to tagProperty parent | |
Definition at line 42 of file GNEAttributeProperties.h.
struct with the tag Properties
Definition at line 47 of file GNEAttributeProperties.h.
GNEAttributeProperties::GNEAttributeProperties | ( | ) |
default constructor
Definition at line 29 of file GNEAttributeProperties.cpp.
GNEAttributeProperties::GNEAttributeProperties | ( | const SumoXMLAttr | attribute, |
const int | attributeProperty, | ||
const std::string & | definition, | ||
std::string | defaultValue = "" |
||
) |
parameter constructor
Definition at line 32 of file GNEAttributeProperties.cpp.
References ACTIVATABLE, DEFAULTVALUE, FLOW, and toString().
GNEAttributeProperties::~GNEAttributeProperties | ( | ) |
destructor
Definition at line 58 of file GNEAttributeProperties.cpp.
void GNEAttributeProperties::checkAttributeIntegrity | ( | ) | const |
check Attribute integrity (For example, throw an exception if tag has a Float default value, but given default value cannot be parse to float)
Definition at line 62 of file GNEAttributeProperties.cpp.
References hasAttrRange(), hasAttrSynonym(), hasDefaultValue(), isBool(), isColor(), isCopyable(), isFloat(), isInt(), isList(), isPosition(), isPositive(), isSecuential(), isSUMOTime(), isUnique(), myAttrSynonym, myDefaultValue, myMaximumRange, myMinimumRange, and SUMO_ATTR_NOTHING.
SumoXMLAttr GNEAttributeProperties::getAttr | ( | ) | const |
get XML Attribute
Definition at line 172 of file GNEAttributeProperties.cpp.
References myAttribute.
Referenced by GNETagProperties::addAttribute(), GNEAttributesCreatorRow::onCmdOpenAllowDialog(), GNEAttributesCreatorRow::onCmdSetAttribute(), GNEAttributesCreatorRow::refreshRow(), GNEAttributesEditorRow::showAttributeRow(), and GNEAttributesEditorRow::showValueComboBox().
const std::string & GNEAttributeProperties::getAttrStr | ( | ) | const |
get XML Attribute
Definition at line 178 of file GNEAttributeProperties.cpp.
References myAttrStr.
Referenced by GNETagProperties::addAttribute(), GNEAttributesCreatorRow::refreshRow(), GNEAttributesEditorRow::showAttributeColor(), GNEAttributesEditorRow::showAttributeInspectParent(), GNEAttributesEditorRow::showAttributeLabel(), GNEAttributesEditorRow::showAttributeToggleEnable(), and GNEAttributesEditorRow::showAttributeVClass().
SumoXMLAttr GNEAttributeProperties::getAttrSynonym | ( | ) | const |
get tag synonym
Definition at line 289 of file GNEAttributeProperties.cpp.
References hasAttrSynonym(), and myAttrSynonym.
bool GNEAttributeProperties::getDefaultActivated | ( | ) | const |
get default active value
Definition at line 213 of file GNEAttributeProperties.cpp.
References myDefaultActivated.
const std::string & GNEAttributeProperties::getDefaultValue | ( | ) | const |
get default value
Definition at line 207 of file GNEAttributeProperties.cpp.
References myDefaultValue.
Referenced by GNEAttributesCreatorRow::onCmdOpenColorDialog(), GNEAttributesCreatorRow::onCmdSetAttribute(), and GNEAttributesCreatorRow::refreshRow().
const std::string & GNEAttributeProperties::getDefinition | ( | ) | const |
get default value
Definition at line 201 of file GNEAttributeProperties.cpp.
References myDefinition.
Referenced by GNEAttributesCreatorRow::refreshRow(), and GNEFlowEditor::refreshSingleFlow().
std::string GNEAttributeProperties::getDescription | ( | ) | const |
const std::vector< std::string > & GNEAttributeProperties::getDiscreteValues | ( | ) | const |
get discrete values
Definition at line 283 of file GNEAttributeProperties.cpp.
References myDiscreteValues.
Referenced by GNEChargingStation::isValid(), GNEStop::isValid(), GNEDemandElementFlow::isValidFlowAttribute(), GNEAttributesCreatorRow::refreshRow(), and GNEAttributesEditorRow::showValueComboBox().
double GNEAttributeProperties::getMaximumRange | ( | ) | const |
get maximum range
Definition at line 309 of file GNEAttributeProperties.cpp.
References hasAttrRange(), and myMaximumRange.
double GNEAttributeProperties::getMinimumRange | ( | ) | const |
get minimum range
Definition at line 299 of file GNEAttributeProperties.cpp.
References hasAttrRange(), and myMinimumRange.
int GNEAttributeProperties::getPositionListed | ( | ) | const |
get position in list (used in frames for listing attributes with certain sort)
Definition at line 190 of file GNEAttributeProperties.cpp.
References GNETagProperties::begin(), GNETagProperties::end(), myAttribute, and myTagPropertyParent.
const GNETagProperties & GNEAttributeProperties::getTagPropertyParent | ( | ) | const |
get reference to tagProperty parent
Definition at line 184 of file GNEAttributeProperties.cpp.
References myTagPropertyParent.
Referenced by GNEAttributesEditorRow::enableElements(), GNEAttributesCreatorRow::generateID(), GNEFrameAttributeModules::isSupermodeValid(), GNEAttributesCreatorRow::isValidID(), GNEAttributesEditorRow::showAttributeInspectParent(), GNEAttributesEditorRow::showAttributeRow(), and GNEAttributesEditorRow::showValueComboBox().
bool GNEAttributeProperties::hasAttrRange | ( | ) | const |
return true if Attr correspond to an element that only accept a range of values
Definition at line 330 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and RANGE.
Referenced by checkAttributeIntegrity(), getMaximumRange(), getMinimumRange(), and setRange().
bool GNEAttributeProperties::hasAttrSynonym | ( | ) | const |
return true if Attr correspond to an element that will be written in XML with another name
Definition at line 325 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SYNONYM.
Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().
bool GNEAttributeProperties::hasAutomaticID | ( | ) | const |
return true if attribute ID can generate an automatic ID
Definition at line 468 of file GNEAttributeProperties.cpp.
References AUTOMATICID, and myAttributeProperty.
Referenced by GNEAttributesCreatorRow::refreshRow().
bool GNEAttributeProperties::hasDefaultValue | ( | ) | const |
return true if attribute owns a default value
Definition at line 319 of file GNEAttributeProperties.cpp.
References DEFAULTVALUE, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), GNEAttributesCreatorRow::onCmdSetAttribute(), and GNEAttributesCreatorRow::refreshRow().
bool GNEAttributeProperties::isActivatable | ( | ) | const |
return true if attribute is activatable
Definition at line 456 of file GNEAttributeProperties.cpp.
References ACTIVATABLE, and myAttributeProperty.
Referenced by GNEAttributesCreatorRow::refreshRow(), setDefaultActivated(), and GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isAlwaysEnabled | ( | ) | const |
return true if attribute is always enabled
Definition at line 480 of file GNEAttributeProperties.cpp.
References ALWAYSENABLED, and myAttributeProperty.
Referenced by GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isBool | ( | ) | const |
return true if attribute is boolean
Definition at line 354 of file GNEAttributeProperties.cpp.
References BOOL, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), GNEAttributesCreatorRow::disableAttributesCreatorRow(), GNEAttributesCreatorRow::enableAttributesCreatorRow(), GNEAttributesCreatorRow::getValue(), GNEAttributesCreatorRow::isAttributesCreatorRowEnabled(), GNEAttributesCreatorRow::refreshRow(), GNEAttributesCreatorRow::setAttributeCheckButtonCheck(), and GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isColor | ( | ) | const |
return true if attribute is a color
Definition at line 390 of file GNEAttributeProperties.cpp.
References COLOR, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), and GNEAttributesCreatorRow::refreshRow().
bool GNEAttributeProperties::isCopyable | ( | ) | const |
return true if attribute is copyable
Definition at line 474 of file GNEAttributeProperties.cpp.
References COPYABLE, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isDiscrete | ( | ) | const |
return true if attribute is discrete
Definition at line 438 of file GNEAttributeProperties.cpp.
References DISCRETE, and myAttributeProperty.
Referenced by GNEAttributesCreatorRow::disableAttributesCreatorRow(), GNEAttributesCreatorRow::enableAttributesCreatorRow(), GNEAttributesCreatorRow::getValue(), GNEAttributesCreatorRow::isAttributesCreatorRowEnabled(), GNEAttributesCreatorRow::refreshRow(), GNEAttributesCreatorRow::setAttributeCheckButtonCheck(), setDiscreteValues(), and GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isExtended | ( | ) | const |
return true if attribute is extended
Definition at line 444 of file GNEAttributeProperties.cpp.
References EXTENDED, and myAttributeProperty.
bool GNEAttributeProperties::isFilename | ( | ) | const |
return true if attribute is a filename
Definition at line 402 of file GNEAttributeProperties.cpp.
References FILENAME, and myAttributeProperty.
bool GNEAttributeProperties::isFloat | ( | ) | const |
return true if attribute is a float
Definition at line 342 of file GNEAttributeProperties.cpp.
References FLOAT, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isFlow | ( | ) | const |
return true if attribute is part of a flow definition
Definition at line 462 of file GNEAttributeProperties.cpp.
References FLOW, and myAttributeProperty.
Referenced by GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isGEO | ( | ) | const |
return true if attribute is GEO
Definition at line 486 of file GNEAttributeProperties.cpp.
References GEO, and myAttributeProperty.
bool GNEAttributeProperties::isInt | ( | ) | const |
return true if attribute is an integer
Definition at line 336 of file GNEAttributeProperties.cpp.
References INT, and myAttributeProperty.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isList | ( | ) | const |
return true if attribute is a list
Definition at line 420 of file GNEAttributeProperties.cpp.
References LIST, and myAttributeProperty.
Referenced by checkAttributeIntegrity(), and GNENet::replaceInListAttribute().
bool GNEAttributeProperties::isNetedit | ( | ) | const |
return true if attribute is exclusive of netedit
Definition at line 491 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and NETEDIT.
bool GNEAttributeProperties::isNumerical | ( | ) | const |
return true if attribute is numerical (int or float)
Definition at line 378 of file GNEAttributeProperties.cpp.
References FLOAT, INT, myAttributeProperty, and SUMOTIME.
bool GNEAttributeProperties::isPosition | ( | ) | const |
return true if attribute is a position
Definition at line 366 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and POSITION.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isPositive | ( | ) | const |
return true if attribute is positive
Definition at line 384 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and POSITIVE.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isProbability | ( | ) | const |
return true if attribute is a probability
Definition at line 372 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and PROBABILITY.
bool GNEAttributeProperties::isSecuential | ( | ) | const |
return true if attribute is sequential
Definition at line 426 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SECUENCIAL.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isString | ( | ) | const |
return true if attribute is a string
Definition at line 360 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and STRING.
bool GNEAttributeProperties::isSUMOTime | ( | ) | const |
return true if attribute is a SUMOTime
Definition at line 348 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and SUMOTIME.
Referenced by checkAttributeIntegrity().
bool GNEAttributeProperties::isSVCPermission | ( | ) | const |
return true if attribute is a VehicleClass
Definition at line 414 of file GNEAttributeProperties.cpp.
References LIST, myAttributeProperty, and VCLASS.
Referenced by GNEAttributesCreatorRow::refreshRow().
bool GNEAttributeProperties::isUnique | ( | ) | const |
return true if attribute is unique
Definition at line 432 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and UNIQUE.
Referenced by checkAttributeIntegrity(), and GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isVClass | ( | ) | const |
return true if attribute is a VehicleClass
Definition at line 408 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and VCLASS.
Referenced by GNEAttributesEditorRow::showAttributeRow().
bool GNEAttributeProperties::isVType | ( | ) | const |
return true if attribute is a VType or vTypeDistribution
Definition at line 396 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and VTYPE.
Referenced by GNEAttributesEditorRow::showAttributeRow(), and GNEAttributesEditorRow::showValueComboBox().
bool GNEAttributeProperties::requireUpdateGeometry | ( | ) | const |
return true if attribute requires a update geometry in setAttribute(...)
Definition at line 450 of file GNEAttributeProperties.cpp.
References myAttributeProperty, and UPDATEGEOMETRY.
Referenced by GNEChange_Attribute::redo(), GNEVType::setAttribute(), and GNEChange_Attribute::undo().
void GNEAttributeProperties::setDefaultActivated | ( | const bool | value | ) |
set default activated value
Definition at line 127 of file GNEAttributeProperties.cpp.
References isActivatable(), and myDefaultActivated.
Referenced by GNEAttributeCarrier::fillCommonStopAttributes(), and GNEAttributeCarrier::fillPlanStopCommonAttributes().
void GNEAttributeProperties::setDiscreteValues | ( | const std::vector< std::string > & | discreteValues | ) |
set discrete values
Definition at line 117 of file GNEAttributeProperties.cpp.
References isDiscrete(), and myDiscreteValues.
Referenced by GNEAttributeCarrier::fillCarFollowingModelAttributes(), GNEAttributeCarrier::fillCommonFlowAttributes(), GNEAttributeCarrier::fillCommonMeanDataAttributes(), GNEAttributeCarrier::fillCommonStopAttributes(), GNEAttributeCarrier::fillDemandElements(), GNEAttributeCarrier::fillNetworkElements(), and GNEAttributeCarrier::fillPOIAttributes().
void GNEAttributeProperties::setRange | ( | const double | minimum, |
const double | maximum | ||
) |
set range
Definition at line 147 of file GNEAttributeProperties.cpp.
References hasAttrRange(), myMaximumRange, and myMinimumRange.
Referenced by GNEAttributeCarrier::fillCarFollowingModelAttributes(), and GNEAttributeCarrier::fillLaneChangingModelAttributes().
void GNEAttributeProperties::setSynonym | ( | const SumoXMLAttr | synonym | ) |
set synonim
Definition at line 137 of file GNEAttributeProperties.cpp.
References hasAttrSynonym(), and myAttrSynonym.
void GNEAttributeProperties::setTagPropertyParent | ( | GNETagProperties * | tagPropertyParent | ) |
set tag property parent
Definition at line 166 of file GNEAttributeProperties.cpp.
References myTagPropertyParent.
|
private |
XML Attribute.
Definition at line 234 of file GNEAttributeProperties.h.
Referenced by getAttr(), and getPositionListed().
|
private |
Property of attribute.
Definition at line 243 of file GNEAttributeProperties.h.
Referenced by getDescription(), hasAttrRange(), hasAttrSynonym(), hasAutomaticID(), hasDefaultValue(), isActivatable(), isAlwaysEnabled(), isBool(), isColor(), isCopyable(), isDiscrete(), isExtended(), isFilename(), isFloat(), isFlow(), isGEO(), isInt(), isList(), isNetedit(), isNumerical(), isPosition(), isPositive(), isProbability(), isSecuential(), isString(), isSUMOTime(), isSVCPermission(), isUnique(), isVClass(), isVType(), and requireUpdateGeometry().
|
private |
string with the Attribute in text format (to avoid unnecesaries toStrings(...) calls)
Definition at line 240 of file GNEAttributeProperties.h.
Referenced by getAttrStr().
|
private |
Attribute written in XML (If is SUMO_ATTR_NOTHING), original Attribute will be written)
Definition at line 258 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getAttrSynonym(), and setSynonym().
|
private |
default activated (by default false)
Definition at line 252 of file GNEAttributeProperties.h.
Referenced by getDefaultActivated(), and setDefaultActivated().
|
private |
default value (by default empty)
Definition at line 249 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), and getDefaultValue().
|
private |
text with a definition of attribute
Definition at line 246 of file GNEAttributeProperties.h.
Referenced by getDefinition().
|
private |
discrete values that can take this Attribute (by default empty)
Definition at line 255 of file GNEAttributeProperties.h.
Referenced by getDiscreteValues(), and setDiscreteValues().
|
private |
maxium Range
Definition at line 264 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getMaximumRange(), and setRange().
|
private |
minimun Range
Definition at line 261 of file GNEAttributeProperties.h.
Referenced by checkAttributeIntegrity(), getMinimumRange(), and setRange().
|
private |
pointer to tagProperty parent
Definition at line 237 of file GNEAttributeProperties.h.
Referenced by getPositionListed(), getTagPropertyParent(), and setTagPropertyParent().