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.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 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>
33 #include <utils/gui/div/GLHelper.h>
35 
36 #include "GNETAZRelData.h"
37 #include "GNEDataInterval.h"
38 
39 
40 // ===========================================================================
41 // member method definitions
42 // ===========================================================================
43 
44 // ---------------------------------------------------------------------------
45 // GNETAZRelData - methods
46 // ---------------------------------------------------------------------------
47 
49  const std::map<std::string, std::string>& parameters) :
50  GNEGenericData(SUMO_TAG_TAZREL, GLO_TAZRELDATA, dataIntervalParent, parameters,
51 {}, {}, {}, {}, {}, {fromTAZ, toTAZ}, {}, {}),
52 myLastWidth(0) {
53  // update geometry
55 }
56 
57 
59  const std::map<std::string, std::string>& parameters) :
60  GNEGenericData(SUMO_TAG_TAZREL, GLO_TAZRELDATA, dataIntervalParent, parameters,
61 {}, {}, {}, {}, {}, {TAZ}, {}, {}),
62 myLastWidth(0) {
63  // update geometry
65 }
66 
67 
69 
70 
71 const RGBColor&
73  return myColor;
74 }
75 
76 
77 double
78 GNETAZRelData::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const {
79  switch (activeScheme) {
80  case 0:
81  return 0;
82  case 1:
84  case 2:
85  return 0; // setfunctional color const GNETAZElement* TAZA = getParentTAZElements().front();
86  case 3:
87  return 0; // setfunctional color const GNETAZElement* TAZA = getParentTAZElements().back();
88  case 4:
89  // by numerical attribute value
90  try {
92  } catch (NumberFormatException&) {
93  return -1;
94  }
95 
96  }
97  return 0;
98 
99 }
100 
101 
102 bool
104  // obtain pointer to TAZ data frame (only for code legibly)
105  const GNETAZRelDataFrame* TAZRelDataFrame = myNet->getViewNet()->getViewParent()->getTAZRelDataFrame();
106  // get current data edit mode
108  // check if we have to filter generic data
109  if ((dataMode == DataEditMode::DATA_INSPECT) || (dataMode == DataEditMode::DATA_DELETE) || (dataMode == DataEditMode::DATA_SELECT)) {
110  return /*isVisibleInspectDeleteSelect()*/ true;
111  } else if (TAZRelDataFrame->shown()) {
112  // check interval
113  if ((TAZRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) &&
114  (TAZRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) {
115  return false;
116  }
117  // check attribute
118  if ((TAZRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) &&
119  (getParametersMap().count(TAZRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) {
120  return false;
121  }
122  // all checks ok, then return true
123  return true;
124  } else {
125  // GNETAZRelDataFrame hidden, then return false
126  return false;
127  }
128 }
129 
130 
131 void
133  // get both TAZs
134  const GNETAZElement* TAZA = getParentTAZElements().front();
135  const GNETAZElement* TAZB = getParentTAZElements().back();
136  // check if this is the same TAZ
137  if (TAZA == TAZB) {
138  // declare ring
139  PositionVector ring;
140  // declare first point
141  std::pair<double, double> p1 = GLHelper::getCircleCoords().at(GLHelper::angleLookup(0));
142  // add 8 segments
143  for (int i = 0; i <= 8; ++i) {
144  const std::pair<double, double>& p2 = GLHelper::getCircleCoords().at(GLHelper::angleLookup(0 + i * 45));
145  // make al line between 0,0 and p2
146  PositionVector line = {Position(), Position(p2.first, p2.second)};
147  // extrapolate
148  line.extrapolate(3, false, true);
149  // add line back to ring
150  ring.push_back(line.back());
151  // update p1
152  p1 = p2;
153  }
154  // make a copy of ring
155  PositionVector ringCenter = ring;
156  // move ring to first geometry point
157  ring.add(TAZA->getTAZElementShape().front());
159  // move ringCenter to center
160  ringCenter.add(TAZA->getAttributePosition(SUMO_ATTR_CENTER));
162  } else {
163  // calculate line betwen to TAZ centers
165  // check line
166  if (line.length() < 1) {
168  }
169  // add offset to line
170  line.move2side(0.5 + myLastWidth);
171  // calculate middle point
172  const Position middlePoint = line.getLineCenter();
173  // get closest points to middlePoint
176  // check positions
177  if (posA == Position::INVALID) {
178  posA = TAZA->getTAZElementShape().front();
179  }
180  if (posB == Position::INVALID) {
181  posB = TAZB->getTAZElementShape().front();
182  }
183  // update geometry
184  if (posA.distanceTo(posB) < 1) {
185  myTAZRelGeometry.updateGeometry({posA - 0.5, posB + 0.5});
186  } else {
187  myTAZRelGeometry.updateGeometry({posA, posB});
188  }
189  // update center geometry
191  }
192 }
193 
194 
195 Position
197  return getParentTAZElements().front()->getAttributePosition(SUMO_ATTR_CENTER);
198 }
199 
200 
201 void
203  // open device
204  device.openTag(SUMO_TAG_TAZREL);
205  // write from
206  device.writeAttr(SUMO_ATTR_FROM, getParentTAZElements().front()->getID());
207  // write to
208  device.writeAttr(SUMO_ATTR_TO, getParentTAZElements().back()->getID());
209  // iterate over attributes
210  for (const auto& attribute : getParametersMap()) {
211  // write attribute (don't use writeParams)
212  device.writeAttr(attribute.first, attribute.second);
213  }
214  // close device
215  device.closeTag();
216 }
217 
218 
219 bool
221  return true;
222 }
223 
224 
225 std::string
227  return "";
228 }
229 
230 
231 void
233  throw InvalidArgument(getTagStr() + " cannot fix any problem");
234 }
235 
236 
237 void
239  // draw TAZRels
240  if (drawTAZRel()) {
241  // get flag for only draw contour
242  const bool onlyDrawContour = !isGenericDataVisible();
243  // push name (needed for getGUIGlObjectsUnderCursor(...)
244  if (!onlyDrawContour) {
246  }
247  // push matrix
249  // translate to front
251  // set color
252  double val = getColorValue(s, s.dataColorer.getActive());
255  // check if update lastWidth
256  const double width = onlyDrawContour ? 0.1 : 0.5 * s.tazRelWidthExaggeration;
257  if (width != myLastWidth) {
258  myLastWidth = width;
259  // cast object (check this, is ugly)
260  GNETAZRelData* TAZRelData = const_cast<GNETAZRelData*>(this);
261  myNet->removeGLObjectFromGrid(TAZRelData);
262  TAZRelData->updateGeometry();
263  myNet->addGLObjectIntoGrid(TAZRelData);
264  }
265  // draw geometry
266  if (onlyDrawContour) {
267  // draw depending of TAZRelDrawing
270  } else {
272  }
273  } else {
274  // draw depending of TAZRelDrawing
279  *(geom.getShape().end() - 2),
280  *(geom.getShape().end() - 1),
281  1.5 + width, 1.5 + width, 0.5 + width);
282  }
283  // pop matrix
285  // pop name
286  if (!onlyDrawContour) {
288  }
289  // check if dotted contours has to be drawn
293  } else {
295  }
296  }
297  if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
300  } else {
302  }
303  }
304  }
305 }
306 
307 
308 void
310  // nothing to compute
311 }
312 
313 
314 void
315 GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
316  // nothing to draw
317 }
318 
319 
320 void
321 GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
322  // nothing to draw
323 }
324 
325 
326 GNELane*
328  return nullptr;
329 }
330 
331 
332 GNELane*
334  return nullptr;
335 }
336 
337 
338 double
340  return 1;
341 }
342 
343 
344 Boundary
346  Boundary b;
347  // add two shapes
350  b.grow(20);
351  return b;
352 }
353 
354 
355 std::string
357  switch (key) {
358  case SUMO_ATTR_ID:
359  return getParentTAZElements().front()->getID();
360  case SUMO_ATTR_FROM:
361  return getParentTAZElements().front()->getID();
362  case SUMO_ATTR_TO:
363  return getParentTAZElements().back()->getID();
364  case GNE_ATTR_DATASET:
366  case GNE_ATTR_SELECTED:
368  case GNE_ATTR_PARAMETERS:
369  return getParametersStr();
370  default:
371  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
372  }
373 }
374 
375 
376 double
378  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
379 }
380 
381 
382 void
383 GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
384  if (value == getAttribute(key)) {
385  return; //avoid needless changes, later logic relies on the fact that attributes have changed
386  }
387  switch (key) {
388  case SUMO_ATTR_FROM:
389  case SUMO_ATTR_TO:
390  case GNE_ATTR_SELECTED:
391  case GNE_ATTR_PARAMETERS:
392  undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
393  break;
394  default:
395  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
396  }
397 }
398 
399 
400 bool
401 GNETAZRelData::isValid(SumoXMLAttr key, const std::string& value) {
402  switch (key) {
403  case SUMO_ATTR_FROM:
404  case SUMO_ATTR_TO:
405  return SUMOXMLDefinitions::isValidNetID(value) &&
406  (myNet->getAttributeCarriers()->retrieveTAZElement(SUMO_TAG_TAZ, value, false) != nullptr);
407  case GNE_ATTR_SELECTED:
408  return canParse<bool>(value);
409  case GNE_ATTR_PARAMETERS:
410  return Parameterised::areParametersValid(value);
411  default:
412  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
413  }
414 }
415 
416 
417 void
419  // Nothing to enable
420 }
421 
422 
423 void
425  // Nothing to disable enable
426 }
427 
428 
430  switch (key) {
431  case SUMO_ATTR_ID:
432  return false;
433  default:
434  return true;
435  }
436 }
437 
438 
439 std::string
441  return getTagStr();
442 }
443 
444 
445 std::string
447  return getTagStr() + ": " + getParentTAZElements().front()->getID() + "->" + getParentTAZElements().back()->getID();
448 }
449 
450 
451 bool
453  // first check supermode
455  return false;
456  }
457  // check dataSet
459  if (dataSet && (myDataIntervalParent->getDataSetParent() != dataSet)) {
460  return false;
461  }
462  // check interval
464  if (dataInterval && (myDataIntervalParent != dataInterval)) {
465  return false;
466  }
467  // check if we're inspecting a TAZ
469  (myNet->getViewNet()->getInspectedAttributeCarriers().size() == 1) &&
470  (myNet->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() == SUMO_TAG_TAZ)) {
471  // get TAZ
472  const auto TAZ = myNet->getViewNet()->getInspectedAttributeCarriers().front();
473  // ignore TAZRels with one TAZParent
474  if (getParentTAZElements().size() == 2) {
475  if ((getParentTAZElements().front() == TAZ) &&
477  return true;
478  } else if ((getParentTAZElements().back() == TAZ) &&
480  return true;
481  } else {
482  return false;
483  }
484  }
485  }
486  return true;
487 }
488 
489 
490 void
491 GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
492  switch (key) {
493  case SUMO_ATTR_FROM: {
494  // remove from grid
496  // check number of parent TAZ elements
497  if ((getParentTAZElements().size() > 1) &&
498  (value == getParentTAZElements().at(1)->getID())) {
499  // reset second TAZ
501  }
502  // change first TAZ
504  // update geometry
505  updateGeometry();
506  // add into grid again
507  myNet->addGLObjectIntoGrid(this);
508  break;
509  }
510  case SUMO_ATTR_TO: {
511  // remove from grid
513  if (value == getParentTAZElements().front()->getID()) {
515  } else {
516  // change second TAZ
518  }
519  // update geometry
520  updateGeometry();
521  // add into grid again
522  myNet->addGLObjectIntoGrid(this);
523  break;
524  }
525  case GNE_ATTR_SELECTED:
526  if (parse<bool>(value)) {
528  } else {
530  }
531  break;
532  case GNE_ATTR_PARAMETERS:
533  setParametersStr(value);
534  // update attribute colors
536  break;
537  default:
538  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
539  }
540 }
541 
542 
543 void
544 GNETAZRelData::toogleAttribute(SumoXMLAttr /*key*/, const bool /*value*/, const int /*previousParameters*/) {
545  throw InvalidArgument("Nothing to enable");
546 }
547 
548 /****************************************************************************/
DataEditMode
@brie 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)
@ 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
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_CENTER
@ 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
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:77
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:299
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:507
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:485
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:132
static int angleLookup(double angleDeg)
normalize angle for lookup in myCircleCoords
Definition: GLHelper.cpp:102
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:123
static const std::vector< std::pair< double, double > > & getCircleCoords()
Storage for precomputed sin/cos-values describing a circle.
Definition: GLHelper.cpp:88
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
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::string & getID() const
get ID
Definition: GNEDataSet.cpp:131
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 belongs to GNENet but has influency in the simulation.
void replaceSecondParentTAZElement(SumoXMLTag tag, const std::string &value)
replace the second parent TAZElement
void replaceFirstParentTAZElement(SumoXMLTag tag, const std::string &value)
replace the first parent TAZElement
GNEDataInterval * myDataIntervalParent
dataInterval Parent
const std::string & getID() const
get ID
const std::vector< GNETAZElement * > & getParentTAZElements() const
get parent TAZElements
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNETAZElement * retrieveTAZElement(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named TAZElement.
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1210
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1222
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:125
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1964
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNETAZElement.h:45
virtual const PositionVector & getTAZElementShape() const =0
get TAZ Shape
virtual Position getAttributePosition(SumoXMLAttr key) const =0
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNETAZRelData.h:38
void toogleAttribute(SumoXMLAttr key, const bool value, const int previousParameters)
method for enable or disable the attribute and nothing else (used in GNEChange_EnableAttribute)
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
GNETAZRelData(GNEDataInterval *dataIntervalParent, GNETAZElement *fromTAZ, GNETAZElement *toTAZ, const std::map< std::string, std::string > &parameters)
Constructor for two TAZs.
void writeGenericData(OutputDevice &device) const
writte data set element into a xml file
void enableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
RGBColor myColor
TAZRel data color.
Boundary getCenteringBoundary() const
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
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
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
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...
void disableAttribute(SumoXMLAttr key, GNEUndoList *undoList)
const RGBColor & getColor() const
get TAZ rel data color
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
void computePathElement()
compute pathElement
~GNETAZRelData()
Destructor.
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:537
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
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
const std::vector< GNEAttributeCarrier * > & getInspectedAttributeCarriers() const
get inspected attribute carriers
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNETAZRelDataFrame * getTAZRelDataFrame() const
get frame for DATA_TAZRELDATA
static void drawDottedContourShape(const DottedContourType type, const GUIVisualizationSettings &s, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem, const double lineWidth=-1)
draw dotted contour for the given shape (used by additionals)
static void drawGeometry(const GUIVisualizationSettings &s, const Position &mousePos, 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:58
GUIGlID getGlID() const
Returns the numerical id of the object.
const T getColor(const double value) const
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
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: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 Position INVALID
used to indicate that a position is valid
Definition: Position.h:293
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:242
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 ammount
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
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 toogle TAZRel only to checkbox is enabled
bool TAZRelOnlyFrom() const
check if toogle TAZRel only from checkbox is enabled
bool TAZRelDrawing() const
check if toogle TAZRel drawing checkbox is enabled
DataEditMode dataEditMode
the current Data edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data