Eclipse SUMO - Simulation of Urban MObility
GNEEdgeRelData.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2020 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 // class for edge relation data
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <netedit/GNENet.h>
28 #include <netedit/GNEUndoList.h>
29 #include <netedit/GNEViewNet.h>
30 #include <netedit/GNEViewParent.h>
33 #include <utils/gui/div/GLHelper.h>
35 
36 #include "GNEEdgeRelData.h"
37 #include "GNEDataInterval.h"
38 
39 
40 // ===========================================================================
41 // member method definitions
42 // ===========================================================================
43 
44 // ---------------------------------------------------------------------------
45 // GNEEdgeRelData - methods
46 // ---------------------------------------------------------------------------
47 
48 GNEEdgeRelData::GNEEdgeRelData(GNEDataInterval* dataIntervalParent, GNEEdge* fromEdge, GNEEdge* toEdge,
49  const std::map<std::string, std::string>& parameters) :
50  GNEGenericData(SUMO_TAG_EDGEREL, GLO_EDGERELDATA, dataIntervalParent, parameters,
51 {}, {fromEdge, toEdge}, {}, {}, {}, {}, {}, {}) {
52 }
53 
54 
56 
57 
58 const RGBColor&
61  // get selected data interval and filtered attribute
63  const std::string filteredAttribute = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame()->getAttributeSelector()->getFilteredAttribute();
64  // continue if there is a selected data interval and filtered attribute
65  if (dataInterval && (filteredAttribute.size() > 0)) {
66  // obtain minimum and maximum value
67  const double minValue = dataInterval->getSpecificAttributeColors().at(myTagProperty.getTag()).getMinValue(filteredAttribute);
68  const double maxValue = dataInterval->getSpecificAttributeColors().at(myTagProperty.getTag()).getMaxValue(filteredAttribute);
69  // get value
70  const double value = parse<double>(getParameter(filteredAttribute, "0"));
71  // return color
72  return GNEViewNetHelper::getRainbowScaledColor(minValue, maxValue, value);
73  }
74  }
75  return RGBColor::GREEN;
76 }
77 
78 
79 bool
81  // first check if we're in supermode data
83  return false;
84  }
85  // obtain pointer to edge data frame (only for code legibly)
86  const GNEEdgeRelDataFrame* edgeRelDataFrame = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame();
87  // get current data edit mode
89  // check if we have to filter generic data
90  if ((dataMode == DataEditMode::DATA_INSPECT) || (dataMode == DataEditMode::DATA_DELETE) || (dataMode == DataEditMode::DATA_SELECT)) {
92  } else if (edgeRelDataFrame->shown()) {
93  // check interval
94  if ((edgeRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) &&
95  (edgeRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) {
96  return false;
97  }
98  // check attribute
99  if ((edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) &&
100  (getParametersMap().count(edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) {
101  return false;
102  }
103  // all checks ok, then return true
104  return true;
105  } else {
106  // GNEEdgeRelDataFrame hidden, then return false
107  return false;
108  }
109 }
110 
111 
112 void
114  // calculate generic data path
116 }
117 
118 
119 void
121  // Nothing to draw
122 }
123 
124 
125 void
126 GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const double offsetFront) const {
127  // get lane width
128  const double laneWidth = s.addSize.getExaggeration(s, lane) * (lane->getParentEdge()->getNBEdge()->getLaneWidth(lane->getIndex()) * 0.5);
129  // Start drawing adding an gl identificator
130  glPushName(getGlID());
131  // Add a draw matrix
132  glPushMatrix();
133  // Start with the drawing of the area traslating matrix to origin
135  // Set orange color
137  // draw box lines
138  GNEGeometry::drawLaneGeometry(myNet->getViewNet(), lane->getLaneShape(), lane->getShapeRotations(), lane->getShapeLengths(), {}, laneWidth);
139  // translate to top
140  glTranslated(0, 0, 0.01);
141  // Set color
144  } else {
146  }
147  // draw interne box lines
148  GNEGeometry::drawLaneGeometry(myNet->getViewNet(), lane->getLaneShape(), lane->getShapeRotations(), lane->getShapeLengths(), {}, laneWidth - 0.1);
149  // Pop last matrix
150  glPopMatrix();
151  // Pop name
152  glPopName();
153  // draw filtered attribute
154  if (getParentEdges().front()->getLanes().front() == lane) {
156  }
157  // draw dotted contour
159  if (getParentEdges().front() == lane->getParentEdge()) {
161  } else {
163  }
164  }
165 }
166 
167 
168 void
169 GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const double offsetFront) const {
170  if ((fromLane->getParentEdge() == getParentEdges().front()) && (toLane->getParentEdge() == getParentEdges().back()) &&
171  (getParentEdges().front() != getParentEdges().back())) {
172  // Start drawing adding an gl identificator
173  glPushName(getGlID());
174  // draw lanes
175  const auto fromLanes = fromLane->getParentEdge()->getLanes();
176  const auto toLanes = toLane->getParentEdge()->getLanes();
177  size_t index = 0;
178  while ((index < fromLanes.size()) || (index < toLanes.size())) {
179  // get lanes
180  const GNELane* from = (index < fromLanes.size()) ? fromLanes.at(index) : fromLanes.back();
181  const GNELane* to = (index < toLanes.size()) ? toLanes.at(index) : toLanes.back();
182  // get lane widths
183  const double laneWidthFrom = s.addSize.getExaggeration(s, from) * (from->getParentEdge()->getNBEdge()->getLaneWidth(from->getIndex()) * 0.5);
184  const double laneWidthTo = s.addSize.getExaggeration(s, to) * (to->getParentEdge()->getNBEdge()->getLaneWidth(to->getIndex()) * 0.5);
185  const double laneWidth = laneWidthFrom < laneWidthTo ? laneWidthFrom : laneWidthTo;
186  // Add a draw matrix
187  glPushMatrix();
188  // translate to GLO
189  glTranslated(0, 0, getType() + offsetFront);
190  // Set color
192  if (from->getLane2laneConnections().exist(to)) {
193  // draw box lines
195  // translate to top
196  glTranslated(0, 0, 0.01);
197  // Set color
200  } else {
202  }
203  // draw interne box lines
205  } else {
206  // draw line between end of first shape and first position of second shape
207  GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth);
208  // translate to top
209  glTranslated(0, 0, 0.01);
210  // Set color
213  } else {
215  }
216  // draw interne line between end of first shape and first position of second shape
217  GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth - 0.1);
218  }
219  // Pop last matrix
220  glPopMatrix();
221  // update index
222  index++;
223  }
224  // Pop name
225  glPopName();
226  // draw dotted contour
228  // declare lanes
229  const GNELane* laneTopA = getParentEdges().front()->getLanes().front();
230  const GNELane* laneTopB = getParentEdges().back()->getLanes().front();
231  const GNELane* laneBotA = getParentEdges().front()->getLanes().back();
232  const GNELane* laneBotB = getParentEdges().back()->getLanes().back();
233  // declare LaneDrawingConstants
234  GNELane::LaneDrawingConstants laneDrawingConstantsTop(s, laneTopA);
235  GNELane::LaneDrawingConstants laneDrawingConstantsBot(s, laneBotA);
236  // declare DottedGeometryColor
237  GNEGeometry::DottedGeometryColor dottedGeometryColor(s);
238  // Push draw matrix
239  glPushMatrix();
240  // translate to front
241  glTranslated(0, 0, GLO_DOTTEDCONTOUR_INSPECTED);
242  // check if lane2lane connection exist
243  if (laneTopA->getLane2laneConnections().exist(laneTopB)) {
244  // obtain lane2lane top dotted geometry
246  // move shape to side
247  lane2lane.moveShapeToSide(laneDrawingConstantsTop.halfWidth);
248  // invert offset
249  lane2lane.invertOffset();
250  // reset dottedGeometryColor
251  dottedGeometryColor.reset();
252  // draw top dotted geometry
253  lane2lane.drawInspectedDottedGeometry(dottedGeometryColor);
254  } else {
255  // create dotted geometry using lane extremes
256  GNEGeometry::DottedGeometry dottedGeometry(s, {laneTopA->getLaneShape().back(), laneTopB->getLaneShape().front()}, false);
257  // move shape to side
258  dottedGeometry.moveShapeToSide(laneDrawingConstantsTop.halfWidth);
259  // invert offset
260  dottedGeometry.invertOffset();
261  // reset dottedGeometryColor
262  dottedGeometryColor.reset();
263  // draw top dotted geometry
264  dottedGeometry.drawInspectedDottedGeometry(dottedGeometryColor);
265  }
266  // check if lane2lane bot connection exist
267  if (laneBotA->getLane2laneConnections().exist(laneBotB)) {
268  // obtain lane2lane dotted geometry
270  // move shape to side
271  lane2lane.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1);
272  // reset dottedGeometryColor
273  dottedGeometryColor.reset();
274  // draw top dotted geometry
275  lane2lane.drawInspectedDottedGeometry(dottedGeometryColor);
276  } else {
277  // create dotted geometry using lane extremes
278  GNEGeometry::DottedGeometry dottedGeometry(s, {laneBotA->getLaneShape().back(), laneBotB->getLaneShape().front()}, false);
279  // move shape to side
280  dottedGeometry.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1);
281  // reset dottedGeometryColor
282  dottedGeometryColor.reset();
283  // draw top dotted geometry
284  dottedGeometry.drawInspectedDottedGeometry(dottedGeometryColor);
285  }
286  // pop matrix
287  glPopMatrix();
288  }
289  }
290 }
291 
292 
293 Position
295  return getParentEdges().front()->getPositionInView();
296 }
297 
298 
299 void
301  // open device
302  device.openTag(SUMO_TAG_EDGEREL);
303  // write from
304  device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
305  // write to
306  device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
307  // iterate over attributes
308  for (const auto& attribute : getParametersMap()) {
309  // write attribute (don't use writeParams)
310  device.writeAttr(attribute.first, attribute.second);
311  }
312  // close device
313  device.closeTag();
314 }
315 
316 
317 bool
319  return true;
320 }
321 
322 
323 std::string
325  return "";
326 }
327 
328 
329 void
331  throw InvalidArgument(getTagStr() + " cannot fix any problem");
332 }
333 
334 
335 Boundary
337  return getParentEdges().front()->getCenteringBoundary();
338 }
339 
340 
341 std::string
343  switch (key) {
344  case SUMO_ATTR_ID:
345  return getParentEdges().front()->getID();
346  case SUMO_ATTR_FROM:
347  return getParentEdges().front()->getID();
348  case SUMO_ATTR_TO:
349  return getParentEdges().back()->getID();
350  case GNE_ATTR_DATASET:
352  case GNE_ATTR_SELECTED:
354  case GNE_ATTR_PARAMETERS:
355  return getParametersStr();
356  default:
357  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
358  }
359 }
360 
361 
362 double
364  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
365 }
366 
367 
368 void
369 GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
370  if (value == getAttribute(key)) {
371  return; //avoid needless changes, later logic relies on the fact that attributes have changed
372  }
373  switch (key) {
374  case SUMO_ATTR_FROM:
375  case SUMO_ATTR_TO:
376  case GNE_ATTR_SELECTED:
377  case GNE_ATTR_PARAMETERS:
378  undoList->p_add(new GNEChange_Attribute(this, key, value));
379  break;
380  default:
381  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
382  }
383 }
384 
385 
386 bool
387 GNEEdgeRelData::isValid(SumoXMLAttr key, const std::string& value) {
388  switch (key) {
389  case SUMO_ATTR_FROM:
390  case SUMO_ATTR_TO:
391  return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) != nullptr);
392  case GNE_ATTR_SELECTED:
393  return canParse<bool>(value);
394  case GNE_ATTR_PARAMETERS:
395  return Parameterised::areParametersValid(value);
396  default:
397  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
398  }
399 }
400 
401 
402 void
404  // Nothing to enable
405 }
406 
407 
408 void
410  // Nothing to disable enable
411 }
412 
413 
415  switch (key) {
416  case SUMO_ATTR_ID:
417  return false;
418  default:
419  return true;
420  }
421 }
422 
423 
424 std::string
426  return getTagStr();
427 }
428 
429 
430 std::string
432  return getTagStr() + ": " + getParentEdges().front()->getID() + "->" + getParentEdges().back()->getID();
433 }
434 
435 
436 void
437 GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
438  switch (key) {
439  case SUMO_ATTR_FROM: {
440  // change first edge
441  replaceFirstParentEdge(value);
442  break;
443  }
444  case SUMO_ATTR_TO: {
445  // change last edge
446  replaceLastParentEdge(value);
447  break;
448  }
449  case GNE_ATTR_SELECTED:
450  if (parse<bool>(value)) {
452  } else {
454  }
455  break;
456  case GNE_ATTR_PARAMETERS:
457  setParametersStr(value);
458  // update attribute colors
460  break;
461  default:
462  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
463  }
464 }
465 
466 
467 void
468 GNEEdgeRelData::setEnabledAttribute(const int /*enabledAttributes*/) {
469  throw InvalidArgument("Nothing to enable");
470 }
471 
472 /****************************************************************************/
DataEditMode
@brie enum for data edit modes
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_DELETE
mode for deleting data elements
@ GLO_EDGERELDATA
edge relation data
@ GLO_DOTTEDCONTOUR_INSPECTED
dotted contour inspected element (used in NETEDIT)
@ SUMO_TAG_EDGEREL
a relation between two edges
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ GNE_ATTR_DATASET
data set of a generic data
@ SUMO_ATTR_ID
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:446
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:181
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
const GNETagProperties & myTagProperty
the xml tag to which this attribute carrier corresponds
An Element which don't belongs to GNENet but has influency in the simulation.
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
const std::map< SumoXMLTag, GNEDataSet::AttributeColors > & getSpecificAttributeColors() const
specific attribute colors
const std::string & getID() const
get ID
Definition: GNEDataSet.cpp:119
void updateAttributeColors()
update attribute colors deprecated
Definition: GNEDataSet.cpp:142
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:49
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:399
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:723
Position getPositionInView() const
Returns element position in view.
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
double getAttributeDouble(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
bool isAttributeEnabled(SumoXMLAttr key) const
const RGBColor & getColor() const
get edge rel data color
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
bool isGenericDataVisible() const
check if current edge rel data is visible
Boundary getCenteringBoundary() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
~GNEEdgeRelData()
Destructor.
void writeGenericData(OutputDevice &device) const
writte data set element into a xml file
GNEEdgeRelData(GNEDataInterval *dataIntervalParent, GNEEdge *fromEdge, GNEEdge *toEdge, const std::map< std::string, std::string > &parameters)
Constructor.
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const double offsetFront) const
Draws partial object (lane)
void updateGeometry()
update pre-computed geometry information
void setEnabledAttribute(const int enabledAttributes)
method for enabling the attribute and nothing else (used in GNEChange_EnableAttribute)
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getFilteredAttribute() const
get filtered attribute
GNEDataInterval * getDataInterval() const
get current select data set ID
const AttributeSelector * getAttributeSelector() const
getattribute selector modul
const IntervalSelector * getIntervalSelector() const
get interval selector modul
An Element which don't belongs to GNENet but has influency in the simulation.
void drawFilteredAttribute(const GUIVisualizationSettings &s, const PositionVector &laneShape, const std::string &attribute) const
draw filtered attribute
GNEDataInterval * myDataIntervalParent
dataInterval Parent
bool isVisibleInspectDeleteSelect() const
check if attribute is visible in inspect, delete or select mode
const std::string & getID() const
get ID
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
class for pack all variables related with DottedGeometry color
Definition: GNEGeometry.h:157
void reset()
rest Dotted Geometry Color
class for pack all variables related with DottedGeometry
Definition: GNEGeometry.h:187
void moveShapeToSide(const double value)
move shape to side
void drawInspectedDottedGeometry(DottedGeometryColor &dottedGeometryColor) const
draw inspected dottedShape
void invertOffset()
invert offset of all segments
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
const GNEGeometry::Geometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
const GNEGeometry::DottedGeometry & getLane2laneDottedGeometry(const GNELane *toLane) const
get lane2lane dotted geometry
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
FOX-declaration.
Definition: GNELane.h:51
const double halfWidth
Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen.
Definition: GNELane.h:67
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
const PositionVector & getLaneShape() const
Definition: GNELane.cpp:117
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:774
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:733
const std::vector< double > & getShapeRotations() const
get rotations of the single shape parts
Definition: GNELane.cpp:123
const std::vector< double > & getShapeLengths() const
get lengths of the single shape parts
Definition: GNELane.cpp:129
GNEEdge * getParentEdge() const
get arent edge
Definition: GNELane.cpp:111
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true) const
get edge by id
Definition: GNENet.cpp:1141
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2245
void calculateGenericDataLanePath(const std::vector< GNEEdge * > &edges)
calculate consecutive path lanes (used by genericdatas)
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:467
GNEViewParent * getViewParent() const
get the net object
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, GUIGlObjectType objectType, const double extraOffset=0)
draw front attributeCarrier
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
bool drawDottedContour() const
check if dotted contour can be drawn
GUIVisualizationColorSettings colorSettings
color settings
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:605
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:60
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:239
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static bool areParametersValid(const std::string &value, bool report=false, ParameterisedAttrType attrType=ParameterisedAttrType::STRING, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
void setParametersStr(const std::string &paramsString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:36
static const RGBColor GREEN
Definition: RGBColor.h:181
static const RGBColor BLACK
Definition: RGBColor.h:188
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static void drawDottedContourEdge(const DottedContourType type, const GUIVisualizationSettings &s, const GNEEdge *edge, const bool drawFrontExtreme, const bool drawBackExtreme)
draw dotted contour for the given dottedGeometries (used by edges)
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
static void drawLaneGeometry(const GNEViewNet *viewNet, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width)
draw lane geometry (use their own function due colors)
DataEditMode dataEditMode
the current Data edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
static const RGBColor & getRainbowScaledColor(const double min, const double max, const double value)
get rainbow scaled color
RGBColor selectedEdgeDataColor
edge data selection color
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values