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-2022 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  // obtain pointer to edge data frame (only for code legibly)
82  const GNEEdgeRelDataFrame* edgeRelDataFrame = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame();
83  // get current data edit mode
85  // check if we have to filter generic data
86  if ((dataMode == DataEditMode::DATA_INSPECT) || (dataMode == DataEditMode::DATA_DELETE) || (dataMode == DataEditMode::DATA_SELECT)) {
88  } else if (edgeRelDataFrame->shown()) {
89  // check interval
90  if ((edgeRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) &&
91  (edgeRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) {
92  return false;
93  }
94  // check attribute
95  if ((edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) &&
96  (getParametersMap().count(edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) {
97  return false;
98  }
99  // all checks ok, then return true
100  return true;
101  } else {
102  // GNEEdgeRelDataFrame hidden, then return false
103  return false;
104  }
105 }
106 
107 
108 void
110  // just compute path
112 }
113 
114 
115 void
117  // Nothing to draw
118 }
119 
120 
121 double
123  return 1;
124 }
125 
126 
127 void
129  // calculate path
131 }
132 
133 
134 void
135 GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
137  // get flag for only draw contour
138  const bool onlyDrawContour = !isGenericDataVisible();
139  // get lane width
140  const double laneWidth = s.addSize.getExaggeration(s, lane) * (lane->getParentEdge()->getNBEdge()->getLaneWidth(lane->getIndex()) * 0.5);
141  // Start drawing adding an gl identificator
142  if (!onlyDrawContour) {
144  }
145  // Add a draw matrix
147  // Start with the drawing of the area traslating matrix to origin
149  // Set orange color
151  // draw box lines
152  GUIGeometry::drawLaneGeometry(s, myNet->getViewNet()->getPositionInformation(), lane->getLaneShape(), lane->getShapeRotations(), lane->getShapeLengths(), {}, laneWidth, onlyDrawContour);
153  // translate to top
154  glTranslated(0, 0, 0.01);
155  // Set color
158  } else {
160  }
161  // draw interne box lines
162  GUIGeometry::drawLaneGeometry(s, myNet->getViewNet()->getPositionInformation(), lane->getLaneShape(), lane->getShapeRotations(), lane->getShapeLengths(), {}, laneWidth - 0.1, onlyDrawContour);
163  // Pop last matrix
165  // Pop name
166  if (!onlyDrawContour) {
168  }
169  // draw lock icon
171  // draw filtered attribute
172  if (getParentEdges().front()->getLanes().front() == lane) {
174  }
175  // draw dotted contour
177  if (getParentEdges().front() == lane->getParentEdge()) {
179  } else {
181  }
182  }
183  }
184 }
185 
186 
187 void
188 GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
190  // get flag for only draw contour
191  const bool onlyDrawContour = !isGenericDataVisible();
192  if ((fromLane->getParentEdge() == getParentEdges().front()) && (toLane->getParentEdge() == getParentEdges().back()) &&
193  (getParentEdges().front() != getParentEdges().back())) {
194  // Start drawing adding an gl identificator
195  if (!onlyDrawContour) {
197  }
198  // draw lanes
199  const auto fromLanes = fromLane->getParentEdge()->getLanes();
200  const auto toLanes = toLane->getParentEdge()->getLanes();
201  size_t index = 0;
202  while ((index < fromLanes.size()) || (index < toLanes.size())) {
203  // get lanes
204  const GNELane* from = (index < fromLanes.size()) ? fromLanes.at(index) : fromLanes.back();
205  const GNELane* to = (index < toLanes.size()) ? toLanes.at(index) : toLanes.back();
206  // get lane widths
207  const double laneWidthFrom = s.addSize.getExaggeration(s, from) * (from->getParentEdge()->getNBEdge()->getLaneWidth(from->getIndex()) * 0.5);
208  const double laneWidthTo = s.addSize.getExaggeration(s, to) * (to->getParentEdge()->getNBEdge()->getLaneWidth(to->getIndex()) * 0.5);
209  const double laneWidth = laneWidthFrom < laneWidthTo ? laneWidthFrom : laneWidthTo;
210  // Add a draw matrix
212  // translate to GLO
213  glTranslated(0, 0, getType() + offsetFront);
214  // Set color
216  if (from->getLane2laneConnections().exist(to)) {
217  // draw box lines
219  // translate to top
220  glTranslated(0, 0, 0.01);
221  // Set color
224  } else {
226  }
227  // draw interne box lines
229  } else {
230  // draw line between end of first shape and first position of second shape
231  GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth);
232  // translate to top
233  glTranslated(0, 0, 0.01);
234  // Set color
237  } else {
239  }
240  // draw interne line between end of first shape and first position of second shape
241  GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth - 0.1);
242  }
243  // Pop last matrix
245  // update index
246  index++;
247  }
248  // Pop name
249  if (!onlyDrawContour) {
251  }
252  // draw dotted contour
254  // declare lanes
255  const GNELane* laneTopA = getParentEdges().front()->getLanes().front();
256  const GNELane* laneTopB = getParentEdges().back()->getLanes().front();
257  const GNELane* laneBotA = getParentEdges().front()->getLanes().back();
258  const GNELane* laneBotB = getParentEdges().back()->getLanes().back();
259  // declare LaneDrawingConstants
260  GNELane::LaneDrawingConstants laneDrawingConstantsTop(s, laneTopA);
261  GNELane::LaneDrawingConstants laneDrawingConstantsBot(s, laneBotA);
262  // declare DottedGeometryColor
263  GUIDottedGeometry::DottedGeometryColor dottedGeometryColor(s);
264  // Push draw matrix
266  // translate to front
267  glTranslated(0, 0, GLO_DOTTEDCONTOUR_INSPECTED);
268  // check if lane2lane connection exist
269  if (laneTopA->getLane2laneConnections().exist(laneTopB)) {
270  // obtain lane2lane top dotted geometry
271  GUIDottedGeometry lane2lane(s, laneTopA->getLane2laneConnections().getLane2laneGeometry(laneTopB).getShape(), false);
272  // move shape to side
273  lane2lane.moveShapeToSide(laneDrawingConstantsTop.halfWidth);
274  // invert offset
275  lane2lane.invertOffset();
276  // reset dottedGeometryColor
277  dottedGeometryColor.reset();
278  // draw top dotted geometry
280  } else {
281  // create dotted geometry using lane extremes
282  GUIDottedGeometry dottedGeometry(s, {laneTopA->getLaneShape().back(), laneTopB->getLaneShape().front()}, false);
283  // move shape to side
284  dottedGeometry.moveShapeToSide(laneDrawingConstantsTop.halfWidth);
285  // invert offset
286  dottedGeometry.invertOffset();
287  // reset dottedGeometryColor
288  dottedGeometryColor.reset();
289  // draw top dotted geometry
290  dottedGeometry.drawDottedGeometry(dottedGeometryColor, GUIDottedGeometry::DottedContourType::INSPECT);
291  }
292  // check if lane2lane bot connection exist
293  if (laneBotA->getLane2laneConnections().exist(laneBotB)) {
294  // obtain lane2lane dotted geometry
295  GUIDottedGeometry lane2lane(s, laneBotA->getLane2laneConnections().getLane2laneGeometry(laneBotB).getShape(), false);
296  // move shape to side
297  lane2lane.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1);
298  // reset dottedGeometryColor
299  dottedGeometryColor.reset();
300  // draw top dotted geometry
302  } else {
303  // create dotted geometry using lane extremes
304  GUIDottedGeometry dottedGeometry(s, {laneBotA->getLaneShape().back(), laneBotB->getLaneShape().front()}, false);
305  // move shape to side
306  dottedGeometry.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1);
307  // reset dottedGeometryColor
308  dottedGeometryColor.reset();
309  // draw top dotted geometry
310  dottedGeometry.drawDottedGeometry(dottedGeometryColor, GUIDottedGeometry::DottedContourType::INSPECT);
311  }
312  // pop matrix
314  }
315  }
316  }
317 }
318 
319 
320 GNELane*
322  /* temporal */
323  return nullptr;
324 }
325 
326 
327 GNELane*
329  /* temporal */
330  return nullptr;
331 }
332 
333 
334 Position
336  return getParentEdges().front()->getPositionInView();
337 }
338 
339 
340 void
342  // open device
343  device.openTag(SUMO_TAG_EDGEREL);
344  // write from
345  device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
346  // write to
347  device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
348  // iterate over attributes
349  for (const auto& attribute : getParametersMap()) {
350  // write attribute (don't use writeParams)
351  device.writeAttr(attribute.first, attribute.second);
352  }
353  // close device
354  device.closeTag();
355 }
356 
357 
358 bool
360  return true;
361 }
362 
363 
364 std::string
366  return "";
367 }
368 
369 
370 void
372  throw InvalidArgument(getTagStr() + " cannot fix any problem");
373 }
374 
375 
376 Boundary
378  return getParentEdges().front()->getCenteringBoundary();
379 }
380 
381 
382 std::string
384  switch (key) {
385  case SUMO_ATTR_ID:
386  return getParentEdges().front()->getID();
387  case SUMO_ATTR_FROM:
388  return getParentEdges().front()->getID();
389  case SUMO_ATTR_TO:
390  return getParentEdges().back()->getID();
391  case GNE_ATTR_DATASET:
393  case GNE_ATTR_SELECTED:
395  case GNE_ATTR_PARAMETERS:
396  return getParametersStr();
397  default:
398  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
399  }
400 }
401 
402 
403 double
405  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
406 }
407 
408 
409 void
410 GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
411  if (value == getAttribute(key)) {
412  return; //avoid needless changes, later logic relies on the fact that attributes have changed
413  }
414  switch (key) {
415  case SUMO_ATTR_FROM:
416  case SUMO_ATTR_TO:
417  case GNE_ATTR_SELECTED:
418  case GNE_ATTR_PARAMETERS:
419  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
420  break;
421  default:
422  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
423  }
424 }
425 
426 
427 bool
428 GNEEdgeRelData::isValid(SumoXMLAttr key, const std::string& value) {
429  switch (key) {
430  case SUMO_ATTR_FROM:
431  case SUMO_ATTR_TO:
432  return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr);
433  case GNE_ATTR_SELECTED:
434  return canParse<bool>(value);
435  case GNE_ATTR_PARAMETERS:
436  return Parameterised::areParametersValid(value);
437  default:
438  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
439  }
440 }
441 
442 
443 void
445  // Nothing to enable
446 }
447 
448 
449 void
451  // Nothing to disable enable
452 }
453 
454 
456  switch (key) {
457  case SUMO_ATTR_ID:
458  return false;
459  default:
460  return true;
461  }
462 }
463 
464 
465 std::string
467  return getTagStr();
468 }
469 
470 
471 std::string
473  return getTagStr() + ": " + getParentEdges().front()->getID() + "->" + getParentEdges().back()->getID();
474 }
475 
476 
477 void
478 GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
479  switch (key) {
480  case SUMO_ATTR_FROM: {
481  // change first edge
482  replaceFirstParentEdge(value);
483  break;
484  }
485  case SUMO_ATTR_TO: {
486  // change last edge
487  replaceLastParentEdge(value);
488  break;
489  }
490  case GNE_ATTR_SELECTED:
491  if (parse<bool>(value)) {
493  } else {
495  }
496  break;
497  case GNE_ATTR_PARAMETERS:
498  setParametersStr(value);
499  // update attribute colors
501  break;
502  default:
503  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
504  }
505 }
506 
507 
508 void
509 GNEEdgeRelData::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) {
510  throw InvalidArgument("Nothing to enable");
511 }
512 
513 /****************************************************************************/
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)
@ SVC_IGNORING
vehicles ignoring classes
@ 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:46
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:507
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:132
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
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:277
static void popName()
pop Name
Definition: GLHelper.cpp:141
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:114
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
reference to tagProperty associated with this attribute carrier
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:131
void updateAttributeColors()
update attribute colors deprecated
Definition: GNEDataSet.cpp:143
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:435
static void drawDottedContourEdge(const GUIDottedGeometry::DottedContourType type, const GUIVisualizationSettings &s, const GNEEdge *edge, const bool drawFrontExtreme, const bool drawBackExtreme)
draw dotted contour for the given dottedGeometries
Definition: GNEEdge.cpp:1379
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:782
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 getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
GNELane * getLastPathLane() const
get last path lane
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
void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters)
method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute)
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 drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
void computePathElement()
compute pathElement
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 updateGeometry()
update pre-computed geometry information
GNELane * getFirstPathLane() const
get first path lane
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
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given tolane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
FOX-declaration.
Definition: GNELane.h:52
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:68
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition: GNELane.cpp:131
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:838
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:797
const std::vector< double > & getShapeRotations() const
get rotations of the single shape parts
Definition: GNELane.cpp:141
const std::vector< double > & getShapeLengths() const
get lengths of the single shape parts
Definition: GNELane.cpp:147
GNEEdge * getParentEdge() const
get arent edge
Definition: GNELane.cpp:113
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:131
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1964
void calculateConsecutivePathEdges(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > edges)
calculate consecutive path edges
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:513
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewParent * getViewParent() const
get the net object
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
class for pack all variables related with GUIDottedGeometry color
void reset()
rest Dotted Geometry Color
void drawDottedGeometry(DottedGeometryColor &dottedGeometryColor, GUIDottedGeometry::DottedContourType type, const double customWidth=-1) const
draw inspected dottedShape
void moveShapeToSide(const double value)
move shape to side
void invertOffset()
invert offset of all segments
static void drawLaneGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width, const bool onlyContour=false)
draw lane geometry (use their own function due colors)
static void drawContourGeometry(const GUIGeometry &geometry, const double width, const bool drawExtremes=false)
draw contour geometry
const PositionVector & getShape() const
The shape of the additional element.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
GUIVisualizationColorSettings colorSettings
color settings
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:630
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
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:248
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, 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"
virtual 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:37
static const RGBColor GREEN
Definition: RGBColor.h:186
static const RGBColor BLACK
Definition: RGBColor.h:193
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
DataEditMode dataEditMode
the current Data edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
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