Eclipse SUMO - Simulation of Urban MObility
GNETAZRelData.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3 // Copyright (C) 2001-2024 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 TAZ 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>
34 #include <utils/gui/div/GLHelper.h>
37 
38 #include "GNETAZRelData.h"
39 #include "GNEDataInterval.h"
40 
41 
42 // ===========================================================================
43 // member method definitions
44 // ===========================================================================
45 
46 // ---------------------------------------------------------------------------
47 // GNETAZRelData - methods
48 // ---------------------------------------------------------------------------
49 
51  const Parameterised::Map& parameters) :
52  GNEGenericData(SUMO_TAG_TAZREL, GUIIconSubSys::getIcon(GUIIcon::EDGERELDATA), GLO_TAZRELDATA, dataIntervalParent, parameters,
53 {}, {}, {}, {fromTAZ, toTAZ}, {}, {}),
54 myLastWidth(0) {
55 }
56 
57 
59  const Parameterised::Map& parameters) :
60  GNEGenericData(SUMO_TAG_TAZREL, GUIIconSubSys::getIcon(GUIIcon::EDGERELDATA), GLO_TAZRELDATA, dataIntervalParent, parameters,
61 {}, {}, {}, {TAZ}, {}, {}),
62 myLastWidth(0) {
63 }
64 
65 
67 
68 
71  RGBColor color;
74  } else {
75  if (!setFunctionalColor(s.dataColorer.getActive(), color)) {
76  double val = getColorValue(s, s.dataColorer.getActive());
77  color = s.dataColorer.getScheme().getColor(val);
78  }
79  }
80  return color;
81 }
82 
83 
84 double
85 GNETAZRelData::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const {
86  switch (activeScheme) {
87  case 0:
88  return 0;
89  case 1:
91  case 2:
92  return 0; // setfunctional color const GNEAdditional* TAZA = getParentAdditionals().front();
93  case 3:
94  return 0; // setfunctional color const GNEAdditional* TAZA = getParentAdditionals().back();
95  case 4:
96  // by numerical attribute value
97  try {
98  if (hasParameter(s.relDataAttr)) {
100  } else {
102  }
103  } catch (NumberFormatException&) {
105  }
106 
107  }
108  return 0;
109 
110 }
111 
112 
113 bool
115  // obtain pointer to TAZ data frame (only for code legibly)
116  const GNETAZRelDataFrame* TAZRelDataFrame = myNet->getViewNet()->getViewParent()->getTAZRelDataFrame();
117  // get current data edit mode
119  // check if we have to filter generic data
120  if ((dataMode == DataEditMode::DATA_INSPECT) || (dataMode == DataEditMode::DATA_DELETE) || (dataMode == DataEditMode::DATA_SELECT)) {
121  return /*isVisibleInspectDeleteSelect()*/ true;
122  } else if (TAZRelDataFrame->shown()) {
123  // check interval
124  if ((TAZRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) &&
125  (TAZRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) {
126  return false;
127  }
128  // check attribute
129  if ((TAZRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) &&
130  (getParametersMap().count(TAZRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) {
131  return false;
132  }
133  // all checks ok, then return true
134  return true;
135  } else {
136  // GNETAZRelDataFrame hidden, then return false
137  return false;
138  }
139 }
140 
141 
142 void
144  // remove from grid
146  // get both TAZs
147  const GNEAdditional* TAZA = getParentAdditionals().front();
148  const GNEAdditional* TAZB = getParentAdditionals().back();
149  // check if this is the same TAZ
150  if (TAZA == TAZB) {
151  // declare ring
152  PositionVector ring;
153  // declare first point
154  std::pair<double, double> p1 = GLHelper::getCircleCoords().at(GLHelper::angleLookup(0));
155  // add 8 segments
156  for (int i = 0; i <= 8; ++i) {
157  const std::pair<double, double>& p2 = GLHelper::getCircleCoords().at(GLHelper::angleLookup(0 + i * 45));
158  // make al line between 0,0 and p2
159  PositionVector line = {Position(), Position(p2.first, p2.second)};
160  // extrapolate
161  line.extrapolate(3, false, true);
162  // add line back to ring
163  ring.push_back(line.back());
164  // update p1
165  p1 = p2;
166  }
167  // make a copy of ring
168  PositionVector ringCenter = ring;
169  // move ring to first geometry point
170  ring.add(TAZA->getAdditionalGeometry().getShape().front());
172  // move ringCenter to center
173  ringCenter.add(TAZA->getAttributePosition(SUMO_ATTR_CENTER));
175  } else {
176  // calculate line between to TAZ centers
178  // check line
179  if (line.length() < 1) {
181  }
182  // add offset to line
183  line.move2side(0.5 + myLastWidth);
184  // calculate middle point
185  const Position middlePoint = line.getLineCenter();
186  // get closest points to middlePoint
189  // check positions
190  if (posA == Position::INVALID) {
191  posA = TAZA->getAdditionalGeometry().getShape().front();
192  }
193  if (posB == Position::INVALID) {
194  posB = TAZB->getAdditionalGeometry().getShape().front();
195  }
196  // update geometry
197  if (posA.distanceTo(posB) < 1) {
198  myTAZRelGeometry.updateGeometry({posA - 0.5, posB + 0.5});
199  } else {
200  myTAZRelGeometry.updateGeometry({posA, posB});
201  }
202  // update center geometry
204  }
205  // add into grid again
206  myNet->addGLObjectIntoGrid(this);
207 }
208 
209 
210 Position
212  return getParentAdditionals().front()->getAttributePosition(SUMO_ATTR_CENTER);
213 }
214 
215 
216 void
218  // open device
219  device.openTag(SUMO_TAG_TAZREL);
220  // write from
221  device.writeAttr(SUMO_ATTR_FROM, getParentAdditionals().front()->getID());
222  // write to
223  device.writeAttr(SUMO_ATTR_TO, getParentAdditionals().back()->getID());
224  // iterate over attributes
225  for (const auto& attribute : getParametersMap()) {
226  // write attribute (don't use writeParams)
227  device.writeAttr(attribute.first, attribute.second);
228  }
229  // close device
230  device.closeTag();
231 }
232 
233 
234 bool
236  return true;
237 }
238 
239 
240 std::string
242  return "";
243 }
244 
245 
246 void
248  throw InvalidArgument(getTagStr() + " cannot fix any problem");
249 }
250 
251 
252 void
254  // draw boundaries
256  // draw TAZRels
257  if (drawTAZRel()) {
258  // get detail level
259  const auto d = s.getDetailLevel(1);
260  // draw geometry only if we'rent in drawForObjectUnderCursor mode
261  if (!s.drawForViewObjectsHandler) {
262  const auto& color = setColor(s);
263  // get flag for only draw contour
264  const bool onlyDrawContour = !isGenericDataVisible();
265  // push matrix
267  // translate to front
269  GLHelper::setColor(color);
270  // check if update lastWidth
271  const double width = onlyDrawContour ? 0.1 : 0.5 * s.tazRelWidthExaggeration;
272  if (width != myLastWidth) {
273  myLastWidth = width;
274  }
275  // draw geometry
276  if (onlyDrawContour) {
277  // draw depending of TAZRelDrawing
280  } else {
282  }
283  } else {
284  // draw depending of TAZRelDrawing
287  GUIGeometry::drawGeometry(d, geom, width);
289  *(geom.getShape().end() - 2),
290  *(geom.getShape().end() - 1),
291  1.5 + width, 1.5 + width, 0.5 + width);
292  }
293  // pop matrix
295  // draw dotted contour
297  }
299  // calculate contour and draw dotted geometry
301  } else {
302  // calculate contour and draw dotted geometry
303  myTAZRelDataContour.calculateContourExtrudedShape(s, d, this, myTAZRelGeometry.getShape(), 0.5, 1, true, true, 0);
304  }
305  }
306 }
307 
308 
309 bool
310 GNETAZRelData::setFunctionalColor(int activeScheme, RGBColor& col) const {
311  switch (activeScheme) {
312  case 2: { // origin taz
313  const GNETAZ* from = dynamic_cast<const GNETAZ*>(getParentAdditionals().front());
314  col = from->getShapeColor();
315  return true;
316  }
317  case 3: { // destination taz
318  const GNETAZ* to = dynamic_cast<const GNETAZ*>(getParentAdditionals().back());
319  col = to->getShapeColor();
320  return true;
321  }
322  default:
323  return false;
324  }
325 }
326 
327 void
329  // nothing to compute
330 }
331 
332 
333 void
334 GNETAZRelData::drawLanePartialGL(const GUIVisualizationSettings& /*s*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
335  // nothing to draw
336 }
337 
338 
339 void
340 GNETAZRelData::drawJunctionPartialGL(const GUIVisualizationSettings& /*s*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
341  // nothing to draw
342 }
343 
344 
345 GNELane*
347  return nullptr;
348 }
349 
350 
351 GNELane*
353  return nullptr;
354 }
355 
356 
357 Boundary
359  Boundary b;
360  // add two shapes
363  b.grow(20);
364  return b;
365 }
366 
367 
368 std::string
370  switch (key) {
371  case SUMO_ATTR_ID:
372  if (getParentAdditionals().size() == 1) {
373  return getPartialID() + getParentAdditionals().front()->getID();
374  } else {
375  return getPartialID() + (getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID());
376  }
377  case SUMO_ATTR_FROM:
378  return getParentAdditionals().front()->getID();
379  case SUMO_ATTR_TO:
380  return getParentAdditionals().back()->getID();
381  case GNE_ATTR_DATASET:
383  case SUMO_ATTR_BEGIN:
385  case SUMO_ATTR_END:
387  case GNE_ATTR_SELECTED:
389  case GNE_ATTR_PARAMETERS:
390  return getParametersStr();
391  default:
392  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
393  }
394 }
395 
396 
397 double
399  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
400 }
401 
402 
403 void
404 GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
405  if (value == getAttribute(key)) {
406  return; //avoid needless changes, later logic relies on the fact that attributes have changed
407  }
408  switch (key) {
409  case SUMO_ATTR_FROM:
410  case SUMO_ATTR_TO:
411  case GNE_ATTR_SELECTED:
412  case GNE_ATTR_PARAMETERS:
413  GNEChange_Attribute::changeAttribute(this, key, value, undoList);
414  break;
415  default:
416  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
417  }
418 }
419 
420 
421 bool
422 GNETAZRelData::isValid(SumoXMLAttr key, const std::string& value) {
423  switch (key) {
424  case SUMO_ATTR_FROM:
425  case SUMO_ATTR_TO:
426  return SUMOXMLDefinitions::isValidNetID(value) &&
427  (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TAZ, value, false) != nullptr);
428  case GNE_ATTR_SELECTED:
429  return canParse<bool>(value);
430  case GNE_ATTR_PARAMETERS:
431  return Parameterised::areAttributesValid(value, true);
432  default:
433  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
434  }
435 }
436 
437 
439  switch (key) {
440  case SUMO_ATTR_ID:
441  return false;
442  default:
443  return true;
444  }
445 }
446 
447 
448 std::string
450  return getTagStr();
451 }
452 
453 
454 std::string
456  if (getParentAdditionals().size() == 1) {
457  return getTagStr() + ": " + getParentAdditionals().front()->getID();
458  } else {
459  return getTagStr() + ": " + getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID();
460  }
461 }
462 
463 
464 bool
466  // first check supermode
468  return false;
469  }
470  // check TAZRelFrame
471  if (myNet->getViewNet()->getViewParent()->getTAZRelDataFrame()->shown()) {
472  // check dataSet
474  if (dataSet && (myDataIntervalParent->getDataSetParent() != dataSet)) {
475  return false;
476  }
477  // check interval
479  if (dataInterval && (myDataIntervalParent != dataInterval)) {
480  return false;
481  }
482  }
483  // check if both draw TAZRel checkBox are disabled
485  return false;
486  }
487  // check if we're inspecting a TAZ
489  (myNet->getViewNet()->getInspectedAttributeCarriers().size() == 1) &&
490  (myNet->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() == SUMO_TAG_TAZ)) {
491  // get TAZ
492  const auto TAZ = myNet->getViewNet()->getInspectedAttributeCarriers().front();
493  // ignore TAZRels with one TAZParent
494  if (getParentAdditionals().size() == 2) {
495  if ((getParentAdditionals().front() == TAZ) &&
497  return true;
498  } else if ((getParentAdditionals().back() == TAZ) &&
500  return true;
501  } else {
502  return false;
503  }
504  }
505  }
506  return true;
507 }
508 
509 
510 void
511 GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
512  switch (key) {
513  case SUMO_ATTR_FROM: {
514  // replace first TAZ Parent
515  replaceParentTAZElement(0, value);
516  // update geometry
517  updateGeometry();
518  break;
519  }
520  case SUMO_ATTR_TO: {
521  // replace second TAZ Parent
522  replaceParentTAZElement(1, value);
523  // update geometry
524  updateGeometry();
525  break;
526  }
527  case GNE_ATTR_SELECTED:
528  if (parse<bool>(value)) {
530  } else {
532  }
533  break;
534  case GNE_ATTR_PARAMETERS:
535  setParametersStr(value);
536  // update attribute colors
538  break;
539  default:
540  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
541  }
542  // mark interval toolbar for update
544 }
545 
546 /****************************************************************************/
DataEditMode
enum for data edit modes
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_DELETE
mode for deleting data elements
@ GLO_TAZRELDATA
TAZ relation data.
@ GLO_TAZ
Traffic Assignment Zones (TAZs)
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
@ SUMO_TAG_TAZ
a traffic assignment zone
@ SUMO_TAG_TAZREL
a relation between two TAZs
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_BEGIN
weights: time range begin
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_CENTER
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_END
weights: time range end
@ 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
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:319
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:654
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:629
static int angleLookup(double angleDeg)
normalize angle for lookup in myCircleCoords
Definition: GLHelper.cpp:105
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
Definition: GLHelper.cpp:967
static const std::vector< std::pair< double, double > > & getCircleCoords()
Storage for precomputed sin/cos-values describing a circle.
Definition: GLHelper.cpp:91
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
virtual Position getAttributePosition(SumoXMLAttr key) const
const GUIGeometry & getAdditionalGeometry() const
obtain additional geometry
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
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
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset) const
calculate contour extruded (used in elements formed by a central shape)
Definition: GNEContour.cpp:88
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
drawing contour functions
Definition: GNEContour.cpp:265
An Element which don't belong to GNENet but has influence in the simulation.
std::string getAttribute(SumoXMLAttr key) const
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
void updateAttributeColors()
update attribute colors deprecated
Definition: GNEDataSet.cpp:143
std::string getFilteredAttribute() const
get filtered attribute
GNEDataSet * getDataSet() const
get current select data set ID
GNEDataInterval * getDataInterval() const
get current select data set ID
const AttributeSelector * getAttributeSelector() const
getattribute selector modul
const DataSetSelector * getDataSetSelector() const
get dataSet selector modul
const IntervalSelector * getIntervalSelector() const
get interval selector modul
An Element which don't belong to GNENet but has influence in the simulation.
GNEDataInterval * myDataIntervalParent
dataInterval Parent
std::string getPartialID() const
get partial ID
void replaceParentTAZElement(const int index, const std::string &value)
replace the first parent TAZElement
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1368
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1378
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:123
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2136
Definition: GNETAZ.h:34
bool isGenericDataValid() const
check if current data set is valid to be written into XML (by default true, can be reimplemented in c...
RGBColor setColor(const GUIVisualizationSettings &s) const
get TAZ rel data color
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object over lane.
Boundary getCenteringBoundary() const
GNEContour myTAZRelDataContour
variable used for draw contours
GUIGeometry myTAZRelGeometry
Geometry for TAZRel data.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
GNETAZRelData(GNEDataInterval *dataIntervalParent, GNEAdditional *fromTAZ, GNEAdditional *toTAZ, const Parameterised::Map &parameters)
Constructor for two TAZs.
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object over junction.
bool isGenericDataVisible() const
check if current TAZ rel data is visible
GNELane * getLastPathLane() const
get last path lane
std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
std::string getAttribute(SumoXMLAttr key) const
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
void updateGeometry()
update pre-computed geometry information
Position getPositionInView() const
Returns element position in view.
GNELane * getFirstPathLane() const
get first path lane
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIGeometry myTAZRelGeometryCenter
Geometry for TAZRel data (center)
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
bool drawTAZRel() const
check draw conditions
bool isAttributeEnabled(SumoXMLAttr key) const
double myLastWidth
TAZRel data width.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double getAttributeDouble(SumoXMLAttr key) const
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some tazRel function
void computePathElement()
compute pathElement
~GNETAZRelData()
Destructor.
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:747
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:723
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewNetHelper::IntervalBar & getIntervalBar()
get interval bar
GNEViewParent * getViewParent() const
get the net object
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:59
T getColor(const double value) const
Stores the information about how to visualize structures.
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
double tazRelWidthExaggeration
The tazRelation exaggeration (upscale thickness)
std::string relDataAttr
key for coloring by edgeRelation / tazRelation attribute
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:254
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
static bool areAttributesValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to an attributes map "key1=value1|key2=value2|....
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
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.
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
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".
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:322
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
Definition: Position.h:266
A list of positions.
double length() const
Returns the length.
void add(double xoff, double yoff, double zoff)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
Position getLineCenter() const
get line center
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
const RGBColor & getShapeColor() const
Returns the color of the Shape.
Definition: Shape.h:84
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
bool TAZRelOnlyTo() const
check if toggle TAZRel only to checkbox is enabled
bool TAZRelOnlyFrom() const
check if toggle TAZRel only from checkbox is enabled
bool TAZRelDrawing() const
check if toggle TAZRel drawing checkbox is enabled
DataEditMode dataEditMode
the current Data edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
RGBColor selectedEdgeDataColor
edge data selection color
static const double segmentWidth
width of dotted contour segments