Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEdgeRelData.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 edge relation data
19/****************************************************************************/
20
21
22// ===========================================================================
23// included modules
24// ===========================================================================
25#include <config.h>
26
27#include <netedit/GNENet.h>
28#include <netedit/GNEUndoList.h>
29#include <netedit/GNEViewNet.h>
35
36#include "GNEEdgeRelData.h"
37#include "GNEDataInterval.h"
38
39
40// ===========================================================================
41// member method definitions
42// ===========================================================================
43
44// ---------------------------------------------------------------------------
45// GNEEdgeRelData - methods
46// ---------------------------------------------------------------------------
47
48GNEEdgeRelData::GNEEdgeRelData(GNEDataInterval* dataIntervalParent, GNEEdge* fromEdge, GNEEdge* toEdge,
49 const Parameterised::Map& parameters) :
51 dataIntervalParent, parameters, {}, {fromEdge, toEdge}, {}, {}, {}, {}) {
52}
53
54
56
57
60 // set default color
65 // user defined rainbow
66 double val = getColorValue(s, s.dataColorer.getActive());
67 col = s.dataColorer.getScheme().getColor(val);
69 // get selected data interval and filtered attribute
71 const std::string filteredAttribute = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame()->getAttributeSelector()->getFilteredAttribute();
72 // continue if there is a selected data interval and filtered attribute
73 if (dataInterval && (filteredAttribute.size() > 0)) {
74 // obtain minimum and maximum value
75 const double minValue = dataInterval->getSpecificAttributeColors().at(myTagProperty.getTag()).getMinValue(filteredAttribute);
76 const double maxValue = dataInterval->getSpecificAttributeColors().at(myTagProperty.getTag()).getMaxValue(filteredAttribute);
77 // get value
78 const double value = parse<double>(getParameter(filteredAttribute, "0"));
79 col = GNEViewNetHelper::getRainbowScaledColor(minValue, maxValue, value);
80 }
81 }
82 return col;
83}
84
85
86double
88 switch (activeScheme) {
89 case 0:
90 return 0;
91 case 1:
93 case 2:
94 return 0; // setfunctional color const GNEAdditional* TAZA = getParentAdditionals().front();
95 case 3:
96 return 0; // setfunctional color const GNEAdditional* TAZA = getParentAdditionals().back();
97 case 4:
98 // by numerical attribute value
99 try {
102 } else {
104 }
105 } catch (NumberFormatException&) {
107 }
108 }
109 return 0;
110}
111
112
113bool
115 // obtain pointer to edge data frame (only for code legibly)
116 const GNEEdgeRelDataFrame* edgeRelDataFrame = myNet->getViewNet()->getViewParent()->getEdgeRelDataFrame();
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)) {
122 } else if (edgeRelDataFrame->shown()) {
123 // check interval
124 if ((edgeRelDataFrame->getIntervalSelector()->getDataInterval() != nullptr) &&
125 (edgeRelDataFrame->getIntervalSelector()->getDataInterval() != myDataIntervalParent)) {
126 return false;
127 }
128 // check attribute
129 if ((edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute().size() > 0) &&
130 (getParametersMap().count(edgeRelDataFrame->getAttributeSelector()->getFilteredAttribute()) == 0)) {
131 return false;
132 }
133 // all checks ok, then return true
134 return true;
135 } else {
136 // GNEEdgeRelDataFrame hidden, then return false
137 return false;
138 }
139}
140
141
142void
144 // just compute path
146}
147
148
149void
151 // Nothing to draw
152}
153
154
155void
160
161
162void
163GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
164 // get color
165 const auto color = setColor(s);
166 if ((color.alpha() != 0) && myNet->getViewNet()->getEditModes().isCurrentSupermodeData()) {
167 // get flag for only draw contour
168 const bool onlyDrawContour = !isGenericDataVisible();
169 // Start drawing adding an gl identificator
170 if (!onlyDrawContour) {
172 }
173 // draw over all edge's lanes
174 for (const auto& laneEdge : lane->getParentEdge()->getLanes()) {
175 // get lane width
176 const double laneWidth = s.addSize.getExaggeration(s, laneEdge) * s.edgeRelWidthExaggeration *
177 (laneEdge->getParentEdge()->getNBEdge()->getLaneWidth(laneEdge->getIndex()) * 0.5);
178 // Add a draw matrix
180 // Start with the drawing of the area translating matrix to origin
183 // draw box lines
185 laneEdge->getLaneShape(), laneEdge->getShapeRotations(),
186 laneEdge->getShapeLengths(), {}, laneWidth, onlyDrawContour);
187 // translate to top
188 glTranslated(0, 0, 0.01);
189 GLHelper::setColor(color);
190 // draw interne box lines
192 laneEdge->getLaneShape(), laneEdge->getShapeRotations(),
193 laneEdge->getShapeLengths(), {}, laneWidth - 0.1, onlyDrawContour);
194 // Pop last matrix
196 // draw lock icon
198 // check if mouse is over element
199 for (const auto& laneEdgeParent : laneEdge->getParentEdge()->getLanes()) {
200 // get lane drawing constants
201 GNELane::LaneDrawingConstants laneDrawingConstants(s, laneEdgeParent);
202 mouseWithinGeometry(laneEdgeParent->getLaneShape(), laneDrawingConstants.halfWidth * s.edgeRelWidthExaggeration);
203 }
204 // draw filtered attribute
205 if (getParentEdges().front()->getLanes().front() == laneEdge) {
206 drawFilteredAttribute(s, laneEdge->getLaneShape(),
209 }
210 // inspect contour
213 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
214 }
215 // front contour
216 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
218 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
219 }
220 // delete contour
221 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
223 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
224 }
225 // delete contour
226 if (myNet->getViewNet()->drawSelectContour(this, this)) {
228 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
229 }
230 }
231 // Pop name
232 if (!onlyDrawContour) {
234 }
235 }
236}
237
238
239void
240GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
242 // get flag for only draw contour
243 const bool onlyDrawContour = !isGenericDataVisible();
244 if ((fromLane->getParentEdge() == getParentEdges().front()) && (toLane->getParentEdge() == getParentEdges().back()) &&
245 (getParentEdges().front() != getParentEdges().back())) {
246 // Start drawing adding an gl identificator
247 if (!onlyDrawContour) {
249 }
250 // draw lanes
251 const auto fromLanes = fromLane->getParentEdge()->getLanes();
252 const auto toLanes = toLane->getParentEdge()->getLanes();
253 size_t index = 0;
254 while ((index < fromLanes.size()) || (index < toLanes.size())) {
255 // get lanes
256 const GNELane* from = (index < fromLanes.size()) ? fromLanes.at(index) : fromLanes.back();
257 const GNELane* to = (index < toLanes.size()) ? toLanes.at(index) : toLanes.back();
258 // get lane widths
259 const double laneWidthFrom = s.addSize.getExaggeration(s, from) * s.edgeRelWidthExaggeration *
260 (from->getParentEdge()->getNBEdge()->getLaneWidth(from->getIndex()) * 0.5);
261 const double laneWidthTo = s.addSize.getExaggeration(s, to) * s.edgeRelWidthExaggeration *
262 (to->getParentEdge()->getNBEdge()->getLaneWidth(to->getIndex()) * 0.5);
263 const double laneWidth = (laneWidthFrom < laneWidthTo) ? laneWidthFrom : laneWidthTo;
264 // Add a draw matrix
266 // translate to GLO
267 glTranslated(0, 0, getType() + offsetFront);
268 // Set color
270 if (from->getLane2laneConnections().exist(to)) {
271 // draw box lines
273 // translate to top
274 glTranslated(0, 0, 0.01);
275 setColor(s);
276 // draw interne box lines
278 } else {
279 // draw line between end of first shape and first position of second shape
280 GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth);
281 // translate to top
282 glTranslated(0, 0, 0.01);
283 setColor(s);
284 // draw interne line between end of first shape and first position of second shape
285 GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth - 0.1);
286 }
287 // Pop last matrix
289 // update index
290 index++;
291 }
292 // Pop name
293 if (!onlyDrawContour) {
295 }
296 // declare contour type
300 } else if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
302 } else if (myNet->getViewNet()->drawDeleteContour(this, this)) {
304 } else if (myNet->getViewNet()->drawSelectContour(this, this)) {
306 }
307 // draw dotted contour
309 // declare lanes
310 const GNELane* laneTopA = getParentEdges().front()->getLanes().front();
311 const GNELane* laneTopB = getParentEdges().back()->getLanes().front();
312 const GNELane* laneBotA = getParentEdges().front()->getLanes().back();
313 const GNELane* laneBotB = getParentEdges().back()->getLanes().back();
314 // declare LaneDrawingConstants
315 GNELane::LaneDrawingConstants laneDrawingConstantsTop(s, laneTopA);
316 GNELane::LaneDrawingConstants laneDrawingConstantsBot(s, laneBotA);
317 // declare DottedGeometryColor
318 GUIDottedGeometry::DottedGeometryColor dottedGeometryColor(s);
319 // Push draw matrix
321 // translate to front
322 glTranslated(0, 0, GLO_DOTTEDCONTOUR_INSPECTED);
323 // check if lane2lane connection exist
324 if (laneTopA->getLane2laneConnections().exist(laneTopB)) {
325 // obtain lane2lane top dotted geometry
326 GUIDottedGeometry lane2lane(s, laneTopA->getLane2laneConnections().getLane2laneGeometry(laneTopB).getShape(), false);
327 // move shape to side
328 lane2lane.moveShapeToSide(laneDrawingConstantsTop.halfWidth * s.edgeRelWidthExaggeration);
329 // invert offset
330 lane2lane.invertOffset();
331 // reset dottedGeometryColor
332 dottedGeometryColor.reset();
333 // draw top dotted geometry
334 lane2lane.drawDottedGeometry(s, type, dottedGeometryColor);
335 } else {
336 // create dotted geometry using lane extremes
337 GUIDottedGeometry dottedGeometry(s, {laneTopA->getLaneShape().back(), laneTopB->getLaneShape().front()}, false);
338 // move shape to side
339 dottedGeometry.moveShapeToSide(laneDrawingConstantsTop.halfWidth * s.edgeRelWidthExaggeration);
340 // invert offset
341 dottedGeometry.invertOffset();
342 // reset dottedGeometryColor
343 dottedGeometryColor.reset();
344 // draw top dotted geometry
345 dottedGeometry.drawDottedGeometry(s, type, dottedGeometryColor);
346 }
347 // check if lane2lane bot connection exist
348 if (laneBotA->getLane2laneConnections().exist(laneBotB)) {
349 // obtain lane2lane dotted geometry
350 GUIDottedGeometry lane2lane(s, laneBotA->getLane2laneConnections().getLane2laneGeometry(laneBotB).getShape(), false);
351 // move shape to side
352 lane2lane.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1 * s.edgeRelWidthExaggeration);
353 // reset dottedGeometryColor
354 dottedGeometryColor.reset();
355 // draw top dotted geometry
356 lane2lane.drawDottedGeometry(s, type, dottedGeometryColor);
357 } else {
358 // create dotted geometry using lane extremes
359 GUIDottedGeometry dottedGeometry(s, {laneBotA->getLaneShape().back(), laneBotB->getLaneShape().front()}, false);
360 // move shape to side
361 dottedGeometry.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1 * s.edgeRelWidthExaggeration);
362 // reset dottedGeometryColor
363 dottedGeometryColor.reset();
364 // draw top dotted geometry
365 dottedGeometry.drawDottedGeometry(s, type, dottedGeometryColor);
366 }
367 // pop matrix
369 }
370 }
371 }
372}
373
374
375GNELane*
377 /* temporal */
378 return nullptr;
379}
380
381
382GNELane*
384 /* temporal */
385 return nullptr;
386}
387
388
391 return getParentEdges().front()->getPositionInView();
392}
393
394
395void
397 // open device
399 // write from
400 device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
401 // write to
402 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
403 // iterate over attributes
404 for (const auto& attribute : getParametersMap()) {
405 // write attribute (don't use writeParams)
406 device.writeAttr(attribute.first, attribute.second);
407 }
408 // close device
409 device.closeTag();
410}
411
412
413bool
415 return true;
416}
417
418
419std::string
421 return "";
422}
423
424
425void
427 throw InvalidArgument(getTagStr() + " cannot fix any problem");
428}
429
430
433 return getParentEdges().front()->getCenteringBoundary();
434}
435
436
437std::string
439 switch (key) {
440 case SUMO_ATTR_ID:
441 return getPartialID() + getParentEdges().front()->getID();
442 case SUMO_ATTR_FROM:
443 return getParentEdges().front()->getID();
444 case SUMO_ATTR_TO:
445 return getParentEdges().back()->getID();
446 case GNE_ATTR_DATASET:
448 case SUMO_ATTR_BEGIN:
450 case SUMO_ATTR_END:
455 return getParametersStr();
456 default:
457 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
458 }
459}
460
461
462double
464 throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
465}
466
467
468void
469GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
470 if (value == getAttribute(key)) {
471 return; //avoid needless changes, later logic relies on the fact that attributes have changed
472 }
473 switch (key) {
474 case SUMO_ATTR_FROM:
475 case SUMO_ATTR_TO:
478 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
479 break;
480 default:
481 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
482 }
483}
484
485
486bool
487GNEEdgeRelData::isValid(SumoXMLAttr key, const std::string& value) {
488 switch (key) {
489 case SUMO_ATTR_FROM:
490 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) &&
491 (value != getParentEdges().back()->getID());
492 case SUMO_ATTR_TO:
493 return SUMOXMLDefinitions::isValidNetID(value) && (myNet->getAttributeCarriers()->retrieveEdge(value, false) != nullptr) &&
494 (value != getParentEdges().front()->getID());
496 return canParse<bool>(value);
498 return Parameterised::areAttributesValid(value, true);
499 default:
500 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
501 }
502}
503
504
506 switch (key) {
507 case SUMO_ATTR_ID:
508 return false;
509 default:
510 return true;
511 }
512}
513
514
515std::string
517 return getTagStr();
518}
519
520
521std::string
523 return getTagStr() + ": " + getParentEdges().front()->getID() + "->" + getParentEdges().back()->getID();
524}
525
526
527void
528GNEEdgeRelData::setAttribute(SumoXMLAttr key, const std::string& value) {
529 switch (key) {
530 case SUMO_ATTR_FROM: {
531 // change first edge
533 break;
534 }
535 case SUMO_ATTR_TO: {
536 // change last edge
538 break;
539 }
541 if (parse<bool>(value)) {
543 } else {
545 }
546 break;
548 setParametersStr(value);
549 // update attribute colors
551 break;
552 default:
553 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
554 }
555 // mark interval toolbar for update
557}
558
559/****************************************************************************/
DataEditMode
@brie enum for data edit modes
@ DATA_EDGERELDATA
mode for create edgeRelData elements
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_DELETE
mode for deleting data elements
@ GLO_EDGERELDATA
edge relation data
@ GLO_DOTTEDCONTOUR_INSPECTED
dotted contour inspected element (used in netedit)
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
@ SVC_IGNORING
vehicles ignoring classes
@ SUMO_TAG_EDGEREL
a relation between two edges
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_BEGIN
weights: time range begin
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ 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
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:583
static void pushName(unsigned int name)
push Name
Definition GLHelper.cpp:139
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition GLHelper.cpp:329
static void popName()
pop Name
Definition GLHelper.cpp:148
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
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
const GNETagProperties & myTagProperty
reference to tagProperty associated with this attribute carrier
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.
const std::map< SumoXMLTag, GNEDataSet::AttributeColors > & getSpecificAttributeColors() const
specific attribute colors
void updateAttributeColors()
update attribute colors deprecated
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
static void drawDottedContourEdge(const GUIVisualizationSettings &s, const GUIDottedGeometry::DottedContourType type, const GNEEdge *edge, const bool drawFrontExtreme, const bool drawBackExtreme, const double exaggeration=1)
draw dotted contour for the given dottedGeometries
Definition GNEEdge.cpp:1456
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:480
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition GNEEdge.cpp:840
Position getPositionInView() const
Returns element position in view.
bool isGenericDataValid() const
check if current data set is valid to be writed into XML (by default true, can be reimplemented in ch...
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
GNELane * getLastPathLane() const
get last path lane
double getAttributeDouble(SumoXMLAttr key) const
std::string getAttribute(SumoXMLAttr key) const
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform data set changes
bool isAttributeEnabled(SumoXMLAttr key) const
void fixGenericDataProblem()
fix data set problem (by default throw an exception, has to be reimplemented in children)
void drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
void computePathElement()
compute pathElement
std::string getGenericDataProblem() const
return a string with the current data set problem (by default empty, can be reimplemented in children...
bool isGenericDataVisible() const
check if current edge rel data is visible
Boundary getCenteringBoundary() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
RGBColor setColor(const GUIVisualizationSettings &s) const
get edge rel data color
~GNEEdgeRelData()
Destructor.
void writeGenericData(OutputDevice &device) const
write data set element into a xml file
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
GNEEdgeRelData(GNEDataInterval *dataIntervalParent, GNEEdge *fromEdge, GNEEdge *toEdge, const Parameterised::Map &parameters)
Constructor.
void updateGeometry()
update pre-computed geometry information
GNELane * getFirstPathLane() const
get first path lane
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
std::string getFilteredAttribute() const
get filtered attribute
GNEDataInterval * getDataInterval() const
get current select data set ID
const AttributeSelector * getAttributeSelector() const
getattribute selector modul
const IntervalSelector * getIntervalSelector() const
get interval selector modul
An Element which don't belong to GNENet but has influence in the simulation.
GNEDataInterval * myDataIntervalParent
dataInterval Parent
std::string getPartialID() const
get partial ID
bool isVisibleInspectDeleteSelect() const
check if attribute is visible in inspect, delete or select mode
void replaceFirstParentEdge(const std::string &value)
replace the first parent edge
void drawFilteredAttribute(const GUIVisualizationSettings &s, const PositionVector &laneShape, const std::string &attribute, const GNEDataInterval *dataIntervalParent) const
draw filtered attribute
void replaceLastParentEdge(const std::string &value)
replace the last parent edge
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given toLane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
const double halfWidth
Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen.
Definition GNELane.h:68
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:136
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition GNELane.cpp:829
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:788
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:118
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
GNEPathManager * getPathManager()
get path manager
Definition GNENet.cpp:132
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
void calculateConsecutivePathEdges(PathElement *pathElement, SUMOVehicleClass vClass, const std::vector< GNEEdge * > edges)
calculate consecutive path edges
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const 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
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
GNEEdgeRelDataFrame * getEdgeRelDataFrame() const
get frame for DATA_EDGERELDATA
class for pack all variables related with GUIDottedGeometry color
void reset()
rest Dotted Geometry Color
void drawDottedGeometry(const GUIVisualizationSettings &s, GUIDottedGeometry::DottedContourType type, DottedGeometryColor &dottedGeometryColor, const double customWidth=1) const
draw inspected dottedShape
void moveShapeToSide(const double value)
move shape to side
void invertOffset()
invert offset of all segments
static void drawContourGeometry(const GUIGeometry &geometry, const double width, const bool drawExtremes=false)
draw contour geometry
const PositionVector & getShape() const
The shape of the additional element.
static void drawLaneGeometry(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width, const bool onlyContour=false, const double offset=0)
draw lane geometry (use their own function due colors)
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
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.
T getColor(const double value) const
const std::string & getName() const
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
static const std::string SCHEME_NAME_DATA_ATTRIBUTE_NUMERICAL
GUIVisualizationSizeSettings addSize
GUIVisualizationColorSettings colorSettings
color settings
double edgeRelWidthExaggeration
The edgeRelation exaggeration (upscale thickness)
std::string relDataAttr
key for coloring by edgeRelation / tazRelation attribute
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition NBEdge.h:632
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 RGBColor GREEN
Definition RGBColor.h:186
static const RGBColor BLACK
Definition RGBColor.h:193
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
DataEditMode dataEditMode
the current Data edit mode
bool isCurrentSupermodeData() const
@check if current supermode is Data
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
static const RGBColor & getRainbowScaledColor(const double min, const double max, const double value)
get rainbow scaled color
RGBColor selectedEdgeDataColor
edge data selection color
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values