SUMO - Simulation of Urban MObility
GNEAttributeCarrier.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // Abstract Base class for gui objects which carry attributes
18 /****************************************************************************/
19 #ifndef GNEAttributeCarrier_h
20 #define GNEAttributeCarrier_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <fx.h>
33 #include <string>
34 #include <vector>
35 #include <map>
40 #include <utils/common/RGBColor.h>
42 #include <utils/common/ToString.h>
45 
46 #include "GNEReferenceCounter.h"
47 
48 
49 // ===========================================================================
50 // class declarations
51 // ===========================================================================
52 class GNENet;
53 class GNEEdge;
54 class GNELane;
55 class GNEUndoList;
56 class GUIGlObject;
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
69  friend class GNEChange_Attribute;
70 
71 public:
77 
79  virtual ~GNEAttributeCarrier() {};
80 
83  /* @brief method for getting the Attribute of an XML key
84  * @param[in] key The attribute key
85  * @return string with the value associated to key
86  */
87  virtual std::string getAttribute(SumoXMLAttr key) const = 0;
88 
89  /* @brief method for setting the attribute and letting the object perform additional changes
90  * @param[in] key The attribute key
91  * @param[in] value The new value
92  * @param[in] undoList The undoList on which to register changes
93  * @param[in] net optionally the GNENet to inform about gui updates
94  */
95  virtual void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) = 0;
96 
97  /* @brief method for setting the attribute and letting the object perform additional changes
98  * @param[in] key The attribute key
99  * @param[in] value The new value
100  * @param[in] undoList The undoList on which to register changes
101  */
102  virtual bool isValid(SumoXMLAttr key, const std::string& value) = 0;
104 
106  virtual std::string getAttributeForSelection(SumoXMLAttr key) const;
107 
109  SumoXMLTag getTag() const;
110 
112  FXIcon* getIcon() const;
113 
115  GUIIcon getGUIIcon() const;
116 
120  const GUIGlObject* getGUIGLObject() const;
121 
126 
128  std::vector<SumoXMLAttr> getAttrs() const;
129 
131  const std::string getID() const;
132 
134  static std::string getAttributeType(SumoXMLTag tag, SumoXMLAttr attr);
135 
137  static const std::vector<std::pair<SumoXMLAttr, std::string> >& allowedAttributes(SumoXMLTag tag);
138 
140  static std::vector<SumoXMLTag> allowedTags();
141 
143  static const std::vector<SumoXMLTag>& allowedNetElementsTags();
144 
146  static const std::vector<SumoXMLTag>& allowedAdditionalTags();
147 
149  static const std::vector<SumoXMLTag>& allowedShapeTags();
150 
152  static bool canBlockMovement(SumoXMLTag tag);
153 
155  static bool canBlockShape(SumoXMLTag tag);
156 
158  static bool canOpenDialog(SumoXMLTag tag);
159 
161  static bool isNumerical(SumoXMLTag tag, SumoXMLAttr attr);
162 
164  static bool isInt(SumoXMLTag tag, SumoXMLAttr attr);
165 
167  static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr);
168 
170  static bool isTime(SumoXMLTag tag, SumoXMLAttr attr);
171 
173  static bool isBool(SumoXMLTag tag, SumoXMLAttr attr);
174 
176  static bool isColor(SumoXMLTag tag, SumoXMLAttr attr);
177 
179  static bool isString(SumoXMLTag tag, SumoXMLAttr attr);
180 
182  static bool isList(SumoXMLTag tag, SumoXMLAttr attr);
183 
185  static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr);
186 
188  static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr);
189 
191  static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr);
192 
194  static bool isProbability(SumoXMLTag tag, SumoXMLAttr attr);
195 
197  static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr);
198 
200  static bool isVClass(SumoXMLTag tag, SumoXMLAttr attr);
201 
203  static bool isNonEditable(SumoXMLTag tag, SumoXMLAttr attr);
204 
206  static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr);
207 
209  static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr);
210 
212  static const std::vector<std::string>& discreteChoices(SumoXMLTag tag, SumoXMLAttr attr);
213 
215  static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr);
216 
218  static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr);
219 
221  static int getHigherNumberOfAttributes();
222 
225  template<typename T>
226  static T getDefaultValue(SumoXMLTag tag, SumoXMLAttr attr);
227 
229  template<typename T>
230  static bool canParse(const std::string& string) {
231  try {
232  parse<T>(string);
233  } catch (NumberFormatException&) {
234  return false;
235  } catch (EmptyData&) {
236  return false;
237  } catch (BoolFormatException&) {
238  return false;
239  }
240  return true;
241  }
242 
244  template<typename T>
245  static T parse(const std::string& string);
246 
248  template<typename T>
249  static bool isPositive(const std::string& string) {
250  return canParse<T>(string) && parse<T>(string) > 0;
251  }
252 
254  static bool isValidID(const std::string& value);
255 
257  static bool isValidFilename(const std::string& value);
258 
260  static const std::string LOADED;
261 
263  static const std::string GUESSED;
264 
266  static const std::string MODIFIED;
267 
269  static const std::string APPROVED;
270 
272  static const double INVALID_POSITION;
273 
275  template <typename T>
276  static T parseAttributeFromXML(const SUMOSAXAttributes& attrs, const std::string& objectID, const SumoXMLTag tag, const SumoXMLAttr attribute, bool& abort, bool report = true) {
277  bool parsedOk = true;
278  std::string defaultValue, parsedAttribute;
279  // set additionalOfWarningMessage
280  std::string additionalOfWarningMessage;
281  if (objectID != "") {
282  additionalOfWarningMessage = toString(tag) + " with ID '" + objectID + "'";
283  } else {
284  additionalOfWarningMessage = toString(tag);
285  }
286  // first check what kind of default value has to be give if parsing isn't valid (needed to avoid exceptions)
287  if (isInt(tag, attribute) || isFloat(tag, attribute) || isTime(tag, attribute)) {
288  defaultValue = "0";
289  } else if (isColor(tag, attribute)) {
290  defaultValue = "BLACK";
291  }
292  // first check that attribute exists in XML
293  if (attrs.hasAttribute(attribute)) {
294  // First check if attribute can be parsed to string
295  parsedAttribute = attrs.get<std::string>(attribute, objectID.c_str(), parsedOk, false);
296  // check that sucesfully parsed attribute can be converted to type T
297  if (parsedOk && !canParse<T>(parsedAttribute)) {
298  parsedOk = false;
299  parsedAttribute = defaultValue;
300  }
301  // declare a string for details about error formats
302  std::string errorFormat;
303  // set extra check for ID Values
304  if (attribute == SUMO_ATTR_ID) {
305  if (parsedAttribute.empty()) {
306  errorFormat = "ID cannot be empty; ";
307  parsedOk = false;
308  } else if (isValidID(parsedAttribute) == false) {
309  errorFormat = "'" + parsedAttribute + "' contains invalid characters; ";
310  parsedOk = false;
311  }
312  }
313  // Set extra checks for int values
314  if (isInt(tag, attribute)) {
315  if (canParse<int>(parsedAttribute)) {
316  // parse to int and check if can be negative
317  int parsedIntAttribute = parse<int>(parsedAttribute);
318  if (isPositive(tag, attribute) && parsedIntAttribute < 0) {
319  errorFormat = "Cannot be negative; ";
320  parsedOk = false;
321  }
322  } else if (canParse<double>(parsedAttribute)) {
323  errorFormat = "Float cannot be reinterpreted as int; ";
324  parsedOk = false;
325  } else {
326  errorFormat = "Cannot be parsed to int; ";
327  parsedOk = false;
328  }
329  }
330  // Set extra checks for float(double) values
331  if (isFloat(tag, attribute)) {
332  if (canParse<double>(parsedAttribute)) {
333  // parse to double and check if can be negative
334  if (isPositive(tag, attribute) && parse<double>(parsedAttribute) < 0) {
335  errorFormat = "Cannot be negative; ";
336  parsedOk = false;
337  }
338  } else {
339  errorFormat = "Cannot be parsed to float; ";
340  parsedOk = false;
341  }
342  }
343  // set extra check for time(double) values
344  if (isTime(tag, attribute)) {
345  if (canParse<double>(parsedAttribute)) {
346  // parse to SUMO Real and check if is negative
347  if (parse<double>(parsedAttribute) < 0) {
348  errorFormat = "Time cannot be negative; ";
349  parsedOk = false;
350  }
351  } else {
352  errorFormat = "Cannot be parsed to time; ";
353  parsedOk = false;
354  }
355  }
356  // set extra check for color values
357  if (isColor(tag, attribute) && !canParse<RGBColor>(parsedAttribute)) {
358  errorFormat = "Invalid RGB format or named color; ";
359  parsedOk = false;
360  }
361  // set extra check for filename values
362  if (isFilename(tag, attribute) && (isValidFilename(parsedAttribute) == false)) {
363  errorFormat = "Filename contains invalid characters; ";
364  parsedOk = false;
365  }
366  // set extra check for filename values
367  if (isVClass(tag, attribute) && (canParseVehicleClasses(parsedAttribute) == false)) {
368  errorFormat = "List of VClasses isn't valid; ";
369  parsedOk = false;
370  }
371  // set extra check for Vehicle Classes
372  if ((!parsedOk) && (attribute == SUMO_ATTR_VCLASS)) {
373  errorFormat = "Is not a part of defined set of Vehicle Classes; ";
374  }
375  // set extra check for Vehicle Classes
376  if ((!parsedOk) && (attribute == SUMO_ATTR_GUISHAPE)) {
377  errorFormat = "Is not a part of defined set of Gui Vehicle Shapes; ";
378  }
379  // set extra check for RouteProbes
380  if ((attribute == SUMO_ATTR_ROUTEPROBE) && !isValidID(parsedAttribute)) {
381  errorFormat = "RouteProbe ID contains invalid characters; ";
382  parsedOk = false;
383  }
384  // If attribute has an invalid format
385  if (!parsedOk) {
386  // if attribute has a default value, take it as string. In other case, abort.
387  if (hasDefaultValue(tag, attribute)) {
388  parsedAttribute = toString(getDefaultValue<T>(tag, attribute));
389  // report warning of default value
390  if (report) {
391  WRITE_WARNING("Format of optional " + getAttributeType(tag, attribute) + " attribute '" + toString(attribute) + "' of " +
392  additionalOfWarningMessage + " is invalid; " + errorFormat + "Default value '" + toString(parsedAttribute) + "' will be used.");
393  }
394  } else {
395  WRITE_WARNING("Format of essential " + getAttributeType(tag, attribute) + " attribute '" + toString(attribute) + "' of " +
396  additionalOfWarningMessage + " is invalid; " + errorFormat + toString(tag) + " cannot be created");
397  // abort parsing of element
398  abort = true;
399  // set default value
400  parsedAttribute = defaultValue;
401  }
402  }
403  } else {
404  // if attribute has a default value, take it. In other case, abort.
405  if (hasDefaultValue(tag, attribute)) {
406  parsedAttribute = toString(getDefaultValue<T>(tag, attribute));
407  // report warning of default value
408  if (report) {
409  WRITE_WARNING("Optional " + getAttributeType(tag, attribute) + " attribute '" + toString(attribute) + "' of " +
410  additionalOfWarningMessage + " is missing; Default value '" + toString(parsedAttribute) + "' will be used.");
411  }
412  } else {
413  WRITE_WARNING("Essential " + getAttributeType(tag, attribute) + " attribute '" + toString(attribute) + "' of " +
414  additionalOfWarningMessage + " is missing; " + toString(tag) + " cannot be created");
415  // abort parsing of element
416  abort = true;
417  // set default value
418  parsedAttribute = defaultValue;
419  }
420  }
421  // return parsed attribute
422  return parse<T>(parsedAttribute);
423  }
424 
427 
432  static bool checkGNEEdgesValid(GNENet* net, const std::string& value, bool report);
433 
438  static bool checkGNELanesValid(GNENet* net, const std::string& value, bool report);
439 
443  static std::vector<GNEEdge*> parseGNEEdges(GNENet* net, const std::string& value);
444 
448  static std::vector<GNELane*> parseGNELanes(GNENet* net, const std::string& value);
449 
453  static std::string parseGNEEdges(const std::vector<GNEEdge*>& edges);
454 
458  static std::string parseGNELanes(const std::vector<GNELane*>& lanes);
459 
461 
462 private:
464  virtual void setAttribute(SumoXMLAttr key, const std::string& value) = 0;
465 
468 
471 
473  static std::map<SumoXMLTag, std::vector<std::pair <SumoXMLAttr, std::string> > > _allowedAttributes;
474 
476  static std::vector<SumoXMLTag> myAllowedNetElementTags;
477 
479  static std::vector<SumoXMLTag> myAllowedAdditionalTags;
480 
482  static std::vector<SumoXMLTag> myAllowedShapeTags;
483 
485  static std::vector<SumoXMLTag> myBlockMovementTags;
486 
488  static std::vector<SumoXMLTag> myBlockShapeTags;
489 
491  static std::vector<SumoXMLTag> myDialogTags;
492 
494  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myNumericalIntAttrs;
495 
497  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myNumericalFloatAttrs;
498 
500  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myTimeAttrs;
501 
503  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myBoolAttrs;
504 
506  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myColorAttrs;
507 
509  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myListAttrs;
510 
512  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myUniqueAttrs;
513 
515  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myNonEditableAttrs;
516 
518  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myPositiveAttrs;
519 
521  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myProbabilityAttrs;
522 
524  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myFileAttrs;
525 
527  static std::map<SumoXMLTag, std::set<SumoXMLAttr> > myVClassAttrs;
528 
530  static std::map<SumoXMLTag, SumoXMLTag> myAllowedAdditionalWithParentTags;
531 
533  static std::map<SumoXMLTag, std::map<SumoXMLAttr, std::vector<std::string> > > myDiscreteChoices;
534 
536  static std::map<SumoXMLTag, std::map<SumoXMLAttr, std::string> > myAttrDefinitions;
537 
539  static int myMaxNumAttribute;
540 
542  GNEAttributeCarrier& operator=(const GNEAttributeCarrier& src) = delete;
543 };
544 
545 #endif
546 
547 /****************************************************************************/
548 
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myColorAttrs
map with the color attributes
SumoXMLTag
Numbers representing SUMO-XML - element names.
static bool isPositive(const std::string &string)
true if a positive number of type T can be parsed from string
static bool isFloat(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical of type float
static std::string getAttributeType(SumoXMLTag tag, SumoXMLAttr attr)
get type of attribute
GNEAttributeCarrier(SumoXMLTag tag, GUIIcon icon)
Constructor.
const SumoXMLTag myTag
the xml tag to which this attribute carrier corresponds
GNEAttributeCarrier & operator=(const GNEAttributeCarrier &src)=delete
Invalidated assignment operator.
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::string > > myAttrDefinitions
map with the definition of attributes
static bool isDiscrete(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is Discrete
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:42
static T parseAttributeFromXML(const SUMOSAXAttributes &attrs, const std::string &objectID, const SumoXMLTag tag, const SumoXMLAttr attribute, bool &abort, bool report=true)
Parse attribute from XML and show warnings if there are problems parsing it.
static std::vector< SumoXMLTag > myAllowedShapeTags
vector with the allowed tags of shapes
static const std::vector< SumoXMLTag > & allowedShapeTags()
get all editable for tag shape elements
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myPositiveAttrs
map with the positive attributes
static const std::vector< SumoXMLTag > & allowedNetElementsTags()
get all editable for tag net elements
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myUniqueAttrs
map with the unique attributes (i.e. attributes without default values)
static std::map< SumoXMLTag, std::map< SumoXMLAttr, std::vector< std::string > > > myDiscreteChoices
map with the values of discrete choices
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myBoolAttrs
map with the boolean attributes
static const std::string LOADED
feature is still unchanged after being loaded (implies approval)
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myProbabilityAttrs
map with the probability attributes
static int getHigherNumberOfAttributes()
return the number of attributes of the tag with the most highter number of attributes ...
GUIIcon myIcon
icon associated to this AC
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myTimeAttrs
map with the attributes of type time
static bool isPositive(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is only Positive (i.e. cannot take negative values)
FXIcon * getIcon() const
get FXIcon assigned to this object
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:53
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
static std::map< SumoXMLTag, std::vector< std::pair< SumoXMLAttr, std::string > > > _allowedAttributes
map with the allowed attributes and their default values
static std::vector< SumoXMLTag > myBlockShapeTags
vector with the allowed tags that can block their shapes
static bool isValidFilename(const std::string &value)
true if value is a valid file value
virtual void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)=0
static std::vector< GNEEdge * > parseGNEEdges(GNENet *net, const std::string &value)
parse string into vector of GNEEdges
virtual std::string getAttribute(SumoXMLAttr key) const =0
This functions has to be implemented in all GNEAttributeCarriers.
static const std::vector< std::pair< SumoXMLAttr, std::string > > & allowedAttributes(SumoXMLTag tag)
get all editable attributes for tag and their default values.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
static std::vector< SumoXMLTag > myAllowedNetElementTags
vector with the allowed tags of netElements
static bool isString(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type string
static std::vector< SumoXMLTag > allowedTags()
get all editable for tag elements of all types
static const std::vector< std::string > & discreteChoices(SumoXMLTag tag, SumoXMLAttr attr)
return a list of discrete choices for this attribute or an empty vector
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myListAttrs
map with the attributes of type list
static bool isInt(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical or type int
the function-object for an editing operation (abstract base)
static bool isVClass(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a list of Vehicle Classes
static bool isValidID(const std::string &value)
true if value is a valid sumo ID
static const std::string MODIFIED
feature has been manually modified (implies approval)
static bool isTime(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is time
static bool isNonEditable(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is non editable
static std::vector< SumoXMLTag > myBlockMovementTags
vector with the allowed tags that can block their movement
static std::vector< SumoXMLTag > myAllowedAdditionalTags
vector with the allowed tags of additionals
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
static bool hasAttribute(SumoXMLTag tag, SumoXMLAttr attr)
check if an element with certain tag has a certain attribute
virtual bool isValid(SumoXMLAttr key, const std::string &value)=0
static bool canBlockMovement(SumoXMLTag tag)
return true if element tag can block their movement
Encapsulated SAX-Attributes.
static bool hasDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
check if attribute of an element has a default avlue
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.
static const double INVALID_POSITION
default value for invalid positions (used by POIs and Polygons)
static bool isColor(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type color for a certain tag
static bool isFilename(SumoXMLTag tag, SumoXMLAttr attr)
whether a string attribute is a filename
static bool checkGNELanesValid(GNENet *net, const std::string &value, bool report)
check if a list of Lane IDs is valid
static T getDefaultValue(SumoXMLTag tag, SumoXMLAttr attr)
return the default value of the attribute of an element
std::vector< SumoXMLAttr > getAttrs() const
get vector of attributes
const std::string getID() const
function to support debugging
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNonEditableAttrs
map with the non-editable attributes
virtual ~GNEAttributeCarrier()
Destructor.
static std::vector< SumoXMLTag > myDialogTags
vector with the allowed tags that has a editor values
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:56
static bool isUnique(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is unique (may not be edited for a multi-selection and don&#39;t have a default valu...
static bool canParse(const std::string &string)
true if a number of type T can be parsed from string
static int myMaxNumAttribute
maximum number of attributes of all tags
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myVClassAttrs
map with the Vehicle Class attributes
static bool isProbability(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is a probability (i.e. oly can values between [0, 1])
static const std::vector< SumoXMLTag > & allowedAdditionalTags()
get all editable for tag additional elements
virtual std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
static const std::string APPROVED
feature has been approved but not changed (i.e. after being reguessed)
static bool isBool(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool for a certain tag
static bool canOpenDialog(SumoXMLTag tag)
return true if element tag can open a values editor
static std::string getDefinition(SumoXMLTag tag, SumoXMLAttr attr)
return definition of a certain SumoXMLAttr
static bool discreteCombinableChoices(SumoXMLTag tag, SumoXMLAttr attr)
return whether the given attribute allows for a combination of discrete values
static const std::string GUESSED
feature has been reguessed (may still be unchanged be we can&#39;t tell (yet)
GUIIcon getGUIIcon() const
get GUI icon assigned to this object
static std::vector< GNELane * > parseGNELanes(GNENet *net, const std::string &value)
parse string into vector of GNELanes
static bool isNumerical(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is numerical (int or float)
static bool checkGNEEdgesValid(GNENet *net, const std::string &value, bool report)
check if a list of edge IDs is valid
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalIntAttrs
map with the numerical attributes of type Int
static T parse(const std::string &string)
parses a number of type T from string
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myNumericalFloatAttrs
map with the numerical attributes of type Float
static bool canBlockShape(SumoXMLTag tag)
return true if element tag can block their shape
static std::map< SumoXMLTag, SumoXMLTag > myAllowedAdditionalWithParentTags
map with the allowed tags of additionals with parent and their parent
static bool isList(SumoXMLTag tag, SumoXMLAttr attr)
whether an attribute is of type bool
const GUIGlObject * getGUIGLObject() const
get const pointer to GUIGlObject vinculated with this Attribute Carrier
SumoXMLTag getTag() const
get XML Tag assigned to this object
static std::map< SumoXMLTag, std::set< SumoXMLAttr > > myFileAttrs
map with the file attributes