Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
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-2023 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
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
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 const auto& color = setColor(s);
255 // draw TAZRels
256 if ((color.alpha() != 0) && drawTAZRel()) {
257 // get flag for only draw contour
258 const bool onlyDrawContour = !isGenericDataVisible();
259 // push name (needed for getGUIGlObjectsUnderCursor(...)
260 if (!onlyDrawContour) {
262 }
263 // push matrix
265 // translate to front
267 GLHelper::setColor(color);
268 // check if update lastWidth
269 const double width = onlyDrawContour ? 0.1 : 0.5 * s.tazRelWidthExaggeration;
270 if (width != myLastWidth) {
271 myLastWidth = width;
273 }
274 // draw geometry
275 if (onlyDrawContour) {
276 // draw depending of TAZRelDrawing
279 } else {
281 }
282 } else {
283 // draw depending of TAZRelDrawing
288 *(geom.getShape().end() - 2),
289 *(geom.getShape().end() - 1),
290 1.5 + width, 1.5 + width, 0.5 + width);
291 }
292 // pop matrix
294 // pop name
295 if (!onlyDrawContour) {
297 }
300 } else {
302 }
303 // inspect contour
307 } else {
309 }
310 }
311 // front contour
312 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
315 } else {
317 }
318 }
319 // delete contour
320 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
323 } else {
325 }
326 }
327 // select contour
328 if (myNet->getViewNet()->drawSelectContour(this, this)) {
331 } else {
333 }
334 }
335 }
336}
337
338
339bool
340GNETAZRelData::setFunctionalColor(int activeScheme, RGBColor& col) const {
341 switch (activeScheme) {
342 case 2: { // origin taz
343 const GNETAZ* from = dynamic_cast<const GNETAZ*>(getParentAdditionals().front());
344 col = from->getShapeColor();
345 return true;
346 }
347 case 3: { // destination taz
348 const GNETAZ* to = dynamic_cast<const GNETAZ*>(getParentAdditionals().back());
349 col = to->getShapeColor();
350 return true;
351 }
352 default:
353 return false;
354 }
355}
356
357void
359 // nothing to compute
360}
361
362
363void
364GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*lane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
365 // nothing to draw
366}
367
368
369void
370GNETAZRelData::drawPartialGL(const GUIVisualizationSettings& /*s*/, const GNELane* /*fromLane*/, const GNELane* /*toLane*/, const GNEPathManager::Segment* /*segment*/, const double /*offsetFront*/) const {
371 // nothing to draw
372}
373
374
375GNELane*
377 return nullptr;
378}
379
380
381GNELane*
383 return nullptr;
384}
385
386
389 Boundary b;
390 // add two shapes
393 b.grow(20);
394 return b;
395}
396
397
398std::string
400 switch (key) {
401 case SUMO_ATTR_ID:
402 if (getParentAdditionals().size() == 1) {
403 return getPartialID() + getParentAdditionals().front()->getID();
404 } else {
405 return getPartialID() + (getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID());
406 }
407 case SUMO_ATTR_FROM:
408 return getParentAdditionals().front()->getID();
409 case SUMO_ATTR_TO:
410 return getParentAdditionals().back()->getID();
411 case GNE_ATTR_DATASET:
413 case SUMO_ATTR_BEGIN:
415 case SUMO_ATTR_END:
420 return getParametersStr();
421 default:
422 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
423 }
424}
425
426
427double
429 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
430}
431
432
433void
434GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
435 if (value == getAttribute(key)) {
436 return; //avoid needless changes, later logic relies on the fact that attributes have changed
437 }
438 switch (key) {
439 case SUMO_ATTR_FROM:
440 case SUMO_ATTR_TO:
443 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
444 break;
445 default:
446 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
447 }
448}
449
450
451bool
452GNETAZRelData::isValid(SumoXMLAttr key, const std::string& value) {
453 switch (key) {
454 case SUMO_ATTR_FROM:
455 case SUMO_ATTR_TO:
456 return SUMOXMLDefinitions::isValidNetID(value) &&
457 (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_TAZ, value, false) != nullptr);
459 return canParse<bool>(value);
461 return Parameterised::areAttributesValid(value, true);
462 default:
463 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
464 }
465}
466
467
469 switch (key) {
470 case SUMO_ATTR_ID:
471 return false;
472 default:
473 return true;
474 }
475}
476
477
478std::string
480 return getTagStr();
481}
482
483
484std::string
486 if (getParentAdditionals().size() == 1) {
487 return getTagStr() + ": " + getParentAdditionals().front()->getID();
488 } else {
489 return getTagStr() + ": " + getParentAdditionals().front()->getID() + "->" + getParentAdditionals().back()->getID();
490 }
491}
492
493
494bool
496 // first check supermode
498 return false;
499 }
500 // check TAZRelFrame
501 if (myNet->getViewNet()->getViewParent()->getTAZRelDataFrame()->shown()) {
502 // check dataSet
504 if (dataSet && (myDataIntervalParent->getDataSetParent() != dataSet)) {
505 return false;
506 }
507 // check interval
509 if (dataInterval && (myDataIntervalParent != dataInterval)) {
510 return false;
511 }
512 }
513 // check if both draw TAZRel checkBox are disabled
515 return false;
516 }
517 // check if we're inspecting a TAZ
519 (myNet->getViewNet()->getInspectedAttributeCarriers().size() == 1) &&
520 (myNet->getViewNet()->getInspectedAttributeCarriers().front()->getTagProperty().getTag() == SUMO_TAG_TAZ)) {
521 // get TAZ
522 const auto TAZ = myNet->getViewNet()->getInspectedAttributeCarriers().front();
523 // ignore TAZRels with one TAZParent
524 if (getParentAdditionals().size() == 2) {
525 if ((getParentAdditionals().front() == TAZ) &&
527 return true;
528 } else if ((getParentAdditionals().back() == TAZ) &&
530 return true;
531 } else {
532 return false;
533 }
534 }
535 }
536 return true;
537}
538
539
540void
541GNETAZRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
542 switch (key) {
543 case SUMO_ATTR_FROM: {
544 // replace first TAZ Parent
545 replaceParentTAZElement(0, value);
546 // update geometry
548 break;
549 }
550 case SUMO_ATTR_TO: {
551 // replace second TAZ Parent
552 replaceParentTAZElement(1, value);
553 // update geometry
555 break;
556 }
558 if (parse<bool>(value)) {
560 } else {
562 }
563 break;
565 setParametersStr(value);
566 // update attribute colors
568 break;
569 default:
570 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
571 }
572 // mark interval toolbar for update
574}
575
576/****************************************************************************/
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
@ 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: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.
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.
std::string getAttribute(SumoXMLAttr key) const
GNEDataSet * getDataSetParent() const
Returns a pointer to GNEDataSet parent.
void updateAttributeColors()
update attribute colors deprecated
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:1248
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
Definition GNENet.cpp:1260
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
An Element which don't belong to GNENet but has influence in the simulation.
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
RGBColor setColor(const GUIVisualizationSettings &s) const
get TAZ rel data color
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
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)
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
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
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
bool 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.
void markGLObjectToUpdate(GUIGlObject *GLObject)
mark GLObject to update (usually the geometry)
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.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
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
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:300
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition Position.h:244
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