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>
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}, {}, {}),
54myLastWidth(0) {
55}
56
57
59 const Parameterised::Map& parameters) :
60 GNEGenericData(SUMO_TAG_TAZREL, GUIIconSubSys::getIcon(GUIIcon::EDGERELDATA), GLO_TAZRELDATA, dataIntervalParent, parameters,
61{}, {}, {}, {TAZ}, {}, {}),
62myLastWidth(0) {
63}
64
65
67
68
69void
71 RGBColor col;
74 } else {
76 double val = getColorValue(s, s.dataColorer.getActive());
77 col = s.dataColorer.getScheme().getColor(val);
78 }
79 }
81}
82
83
84double
85GNETAZRelData::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 {
100 } else {
102 }
103 } catch (NumberFormatException&) {
105 }
106
107 }
108 return 0;
109
110}
111
112
113bool
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
142void
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 betwen 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
207}
208
209
212 return getParentAdditionals().front()->getAttributePosition(SUMO_ATTR_CENTER);
213}
214
215
216void
218 // open device
219 device.openTag(SUMO_TAG_TAZREL);
220 // write from
222 // write to
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
234bool
236 return true;
237}
238
239
240std::string
242 return "";
243}
244
245
246void
248 throw InvalidArgument(getTagStr() + " cannot fix any problem");
249}
250
251
252void
254 // draw TAZRels
255 if (drawTAZRel()) {
256 // get flag for only draw contour
257 const bool onlyDrawContour = !isGenericDataVisible();
258 // push name (needed for getGUIGlObjectsUnderCursor(...)
259 if (!onlyDrawContour) {
261 }
262 // push matrix
264 // translate to front
266 setColor(s);
267 // check if update lastWidth
268 const double width = onlyDrawContour ? 0.1 : 0.5 * s.tazRelWidthExaggeration;
269 if (width != myLastWidth) {
270 myLastWidth = width;
272 }
273 // draw geometry
274 if (onlyDrawContour) {
275 // draw depending of TAZRelDrawing
278 } else {
280 }
281 } else {
282 // draw depending of TAZRelDrawing
287 *(geom.getShape().end() - 2),
288 *(geom.getShape().end() - 1),
289 1.5 + width, 1.5 + width, 0.5 + width);
290 }
291 // pop matrix
293 // pop name
294 if (!onlyDrawContour) {
296 }
299 } else {
301 }
302 // inspect contour
306 } else {
308 }
309 }
310 // front contour
311 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
314 } else {
316 }
317 }
318 // delete contour
319 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
322 } else {
324 }
325 }
326 // select contour
327 if (myNet->getViewNet()->drawSelectContour(this, this)) {
330 } else {
332 }
333 }
334 }
335}
336
337
338bool
339GNETAZRelData::setFunctionalColor(int activeScheme, RGBColor& col) const {
340 switch (activeScheme) {
341 case 2: { // origin taz
342 const GNETAZ* from = dynamic_cast<const GNETAZ*>(getParentAdditionals().front());
343 col = from->getShapeColor();
344 return true;
345 }
346 case 3: { // destination taz
347 const GNETAZ* to = dynamic_cast<const GNETAZ*>(getParentAdditionals().back());
348 col = to->getShapeColor();
349 return true;
350 }
351 default:
352 return false;
353 }
354}
355
356void
358 // nothing to compute
359}
360
361
362void
363GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
364 // nothing to draw
365}
366
367
368void
369GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
370 // nothing to draw
371}
372
373
374GNELane*
376 return nullptr;
377}
378
379
380GNELane*
382 return nullptr;
383}
384
385
386double
388 return 1;
389}
390
391
394 Boundary b;
395 // add two shapes
398 b.grow(20);
399 return b;
400}
401
402
403std::string
405 switch (key) {
406 case SUMO_ATTR_ID:
407 if (getParentAdditionals().size() == 1) {
408 return getPartialID() + getParentAdditionals().front()->getID();
409 } else {
410 return getPartialID() + (getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID());
411 }
412 case SUMO_ATTR_FROM:
413 return getParentAdditionals().front()->getID();
414 case SUMO_ATTR_TO:
415 return getParentAdditionals().back()->getID();
416 case GNE_ATTR_DATASET:
421 return getParametersStr();
422 default:
423 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
424 }
425}
426
427
428double
430 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
431}
432
433
434void
435GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
436 if (value == getAttribute(key)) {
437 return; //avoid needless changes, later logic relies on the fact that attributes have changed
438 }
439 switch (key) {
440 case SUMO_ATTR_FROM:
441 case SUMO_ATTR_TO:
444 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
445 break;
446 default:
447 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
448 }
449}
450
451
452bool
453GNETAZRelData::isValid(SumoXMLAttr key, const std::string& value) {
454 switch (key) {
455 case SUMO_ATTR_FROM:
456 case SUMO_ATTR_TO:
457 return SUMOXMLDefinitions::isValidNetID(value) &&
458 (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TAZ, value, false) != nullptr);
460 return canParse<bool>(value);
462 return Parameterised::areAttributesValid(value, true);
463 default:
464 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
465 }
466}
467
468
470 switch (key) {
471 case SUMO_ATTR_ID:
472 return false;
473 default:
474 return true;
475 }
476}
477
478
479std::string
481 return getTagStr();
482}
483
484
485std::string
487 if (getParentAdditionals().size() == 1) {
488 return getTagStr() + ": " + getParentAdditionals().front()->getID();
489 } else {
490 return getTagStr() + ": " + getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID();
491 }
492}
493
494
495bool
497 // first check supermode
499 return false;
500 }
501 // check TAZRelFrame
502 if (myNet->getViewNet()->getViewParent()->getTAZRelDataFrame()->shown()) {
503 // check dataSet
505 if (dataSet && (myDataIntervalParent->getDataSetParent() != dataSet)) {
506 return false;
507 }
508 // check interval
510 if (dataInterval && (myDataIntervalParent != dataInterval)) {
511 return false;
512 }
513 }
514 // check if both draw TAZRel checkBox are disabled
516 return false;
517 }
518 // check if we're inspecting a TAZ
520 (myNet->getViewNet()->getInspectedAttributeCarriers().size() == 1) &&
521 (myNet->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() == SUMO_TAG_TAZ)) {
522 // get TAZ
523 const auto TAZ = myNet->getViewNet()->getInspectedAttributeCarriers().front();
524 // ignore TAZRels with one TAZParent
525 if (getParentAdditionals().size() == 2) {
526 if ((getParentAdditionals().front() == TAZ) &&
528 return true;
529 } else if ((getParentAdditionals().back() == TAZ) &&
531 return true;
532 } else {
533 return false;
534 }
535 }
536 }
537 return true;
538}
539
540
541void
542GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
543 switch (key) {
544 case SUMO_ATTR_FROM: {
545 // replace first TAZ Parent
546 replaceParentTAZElement(0, value);
547 // update geometry
549 break;
550 }
551 case SUMO_ATTR_TO: {
552 // replace second TAZ Parent
553 replaceParentTAZElement(1, value);
554 // update geometry
556 break;
557 }
559 if (parse<bool>(value)) {
561 } else {
563 }
564 break;
566 setParametersStr(value);
567 // update attribute colors
569 break;
570 default:
571 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
572 }
573 // mark interval toolbar for update
575}
576
577/****************************************************************************/
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)
GUIPostDrawing gPostDrawing
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
@ 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:78
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:583
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:558
static void pushName(unsigned int name)
push Name
Definition: GLHelper.cpp:139
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 const std::vector< std::pair< double, double > > & getCircleCoords()
Storage for precomputed sin/cos-values describing a circle.
Definition: GLHelper.cpp:91
static void popName()
pop Name
Definition: GLHelper.cpp:148
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:48
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
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 belong to GNENet but has influence in the simulation.
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
void updateAttributeColors()
update attribute colors deprecated
Definition: GNEDataSet.cpp:137
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:1245
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition: GNENet.cpp:1257
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:132
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1987
Definition: GNETAZ.h:34
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNETAZRelData.h:38
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)
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
Boundary getCenteringBoundary() const
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated 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
void setColor(const GUIVisualizationSettings &s) const
get TAZ rel data color
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)
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.
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:656
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:632
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
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
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 GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem)
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
void mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:102
void markGLObjectToUpdate(GUIGlObject *GLObject)
mark GLObject to update (usually the geometry)
const T getColor(const double value) const
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
GUIVisualizationColorSettings colorSettings
color settings
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 & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:251
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
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|....
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".
bool knowsParameter(const std::string &key) const
Returns whether the parameter is known.
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:298
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
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