Eclipse SUMO - Simulation of Urban MObility
GNEEdgeRelData.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 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
58void
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 }
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
155double
157 return 1;
158}
159
160
161void
163 // calculate path
165}
166
167
168void
169GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
171 // get flag for only draw contour
172 const bool onlyDrawContour = !isGenericDataVisible();
173 // Start drawing adding an gl identificator
174 if (!onlyDrawContour) {
176 }
177 // draw over all edge's lanes
178 for (const auto& laneEdge : lane->getParentEdge()->getLanes()) {
179 // get lane width
180 const double laneWidth = s.addSize.getExaggeration(s, laneEdge) * s.edgeRelWidthExaggeration *
181 (laneEdge->getParentEdge()->getNBEdge()->getLaneWidth(laneEdge->getIndex()) * 0.5);
182 // Add a draw matrix
184 // Start with the drawing of the area translating matrix to origin
187 // draw box lines
189 laneEdge->getLaneShape(), laneEdge->getShapeRotations(),
190 laneEdge->getShapeLengths(), {}, laneWidth, onlyDrawContour);
191 // translate to top
192 glTranslated(0, 0, 0.01);
193 setColor(s);
194 // draw interne box lines
196 laneEdge->getLaneShape(), laneEdge->getShapeRotations(),
197 laneEdge->getShapeLengths(), {}, laneWidth - 0.1, onlyDrawContour);
198 // Pop last matrix
200 // draw lock icon
202 // check if mouse is over element
203 for (const auto& laneEdgeParent : laneEdge->getParentEdge()->getLanes()) {
204 // get lane drawing constants
205 GNELane::LaneDrawingConstants laneDrawingConstants(s, laneEdgeParent);
206 mouseWithinGeometry(laneEdgeParent->getLaneShape(), laneDrawingConstants.halfWidth * s.edgeRelWidthExaggeration);
207 }
208 // draw filtered attribute
209 if (getParentEdges().front()->getLanes().front() == laneEdge) {
210 drawFilteredAttribute(s, laneEdge->getLaneShape(),
213 }
214 // inspect contour
217 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
218 }
219 // front contour
220 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
222 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
223 }
224 // delete contour
225 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
227 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
228 }
229 // delete contour
230 if (myNet->getViewNet()->drawSelectContour(this, this)) {
232 laneEdge->getParentEdge(), true, true, s.edgeRelWidthExaggeration);
233 }
234 }
235 // Pop name
236 if (!onlyDrawContour) {
238 }
239 }
240}
241
242
243void
244GNEEdgeRelData::drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* /*segment*/, const double offsetFront) const {
246 // get flag for only draw contour
247 const bool onlyDrawContour = !isGenericDataVisible();
248 if ((fromLane->getParentEdge() == getParentEdges().front()) && (toLane->getParentEdge() == getParentEdges().back()) &&
249 (getParentEdges().front() != getParentEdges().back())) {
250 // Start drawing adding an gl identificator
251 if (!onlyDrawContour) {
253 }
254 // draw lanes
255 const auto fromLanes = fromLane->getParentEdge()->getLanes();
256 const auto toLanes = toLane->getParentEdge()->getLanes();
257 size_t index = 0;
258 while ((index < fromLanes.size()) || (index < toLanes.size())) {
259 // get lanes
260 const GNELane* from = (index < fromLanes.size()) ? fromLanes.at(index) : fromLanes.back();
261 const GNELane* to = (index < toLanes.size()) ? toLanes.at(index) : toLanes.back();
262 // get lane widths
263 const double laneWidthFrom = s.addSize.getExaggeration(s, from) * s.edgeRelWidthExaggeration *
264 (from->getParentEdge()->getNBEdge()->getLaneWidth(from->getIndex()) * 0.5);
265 const double laneWidthTo = s.addSize.getExaggeration(s, to) * s.edgeRelWidthExaggeration *
266 (to->getParentEdge()->getNBEdge()->getLaneWidth(to->getIndex()) * 0.5);
267 const double laneWidth = (laneWidthFrom < laneWidthTo) ? laneWidthFrom : laneWidthTo;
268 // Add a draw matrix
270 // translate to GLO
271 glTranslated(0, 0, getType() + offsetFront);
272 // Set color
274 if (from->getLane2laneConnections().exist(to)) {
275 // draw box lines
277 // translate to top
278 glTranslated(0, 0, 0.01);
279 setColor(s);
280 // draw interne box lines
282 } else {
283 // draw line between end of first shape and first position of second shape
284 GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth);
285 // translate to top
286 glTranslated(0, 0, 0.01);
287 setColor(s);
288 // draw interne line between end of first shape and first position of second shape
289 GLHelper::drawBoxLines({from->getLaneShape().back(), to->getLaneShape().front()}, laneWidth - 0.1);
290 }
291 // Pop last matrix
293 // update index
294 index++;
295 }
296 // Pop name
297 if (!onlyDrawContour) {
299 }
300 // declare contour type
304 } else if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
306 } else if (myNet->getViewNet()->drawDeleteContour(this, this)) {
308 } else if (myNet->getViewNet()->drawSelectContour(this, this)) {
310 }
311 // draw dotted contour
313 // declare lanes
314 const GNELane* laneTopA = getParentEdges().front()->getLanes().front();
315 const GNELane* laneTopB = getParentEdges().back()->getLanes().front();
316 const GNELane* laneBotA = getParentEdges().front()->getLanes().back();
317 const GNELane* laneBotB = getParentEdges().back()->getLanes().back();
318 // declare LaneDrawingConstants
319 GNELane::LaneDrawingConstants laneDrawingConstantsTop(s, laneTopA);
320 GNELane::LaneDrawingConstants laneDrawingConstantsBot(s, laneBotA);
321 // declare DottedGeometryColor
322 GUIDottedGeometry::DottedGeometryColor dottedGeometryColor(s);
323 // Push draw matrix
325 // translate to front
326 glTranslated(0, 0, GLO_DOTTEDCONTOUR_INSPECTED);
327 // check if lane2lane connection exist
328 if (laneTopA->getLane2laneConnections().exist(laneTopB)) {
329 // obtain lane2lane top dotted geometry
330 GUIDottedGeometry lane2lane(s, laneTopA->getLane2laneConnections().getLane2laneGeometry(laneTopB).getShape(), false);
331 // move shape to side
332 lane2lane.moveShapeToSide(laneDrawingConstantsTop.halfWidth * s.edgeRelWidthExaggeration);
333 // invert offset
334 lane2lane.invertOffset();
335 // reset dottedGeometryColor
336 dottedGeometryColor.reset();
337 // draw top dotted geometry
338 lane2lane.drawDottedGeometry(s, type, dottedGeometryColor);
339 } else {
340 // create dotted geometry using lane extremes
341 GUIDottedGeometry dottedGeometry(s, {laneTopA->getLaneShape().back(), laneTopB->getLaneShape().front()}, false);
342 // move shape to side
343 dottedGeometry.moveShapeToSide(laneDrawingConstantsTop.halfWidth * s.edgeRelWidthExaggeration);
344 // invert offset
345 dottedGeometry.invertOffset();
346 // reset dottedGeometryColor
347 dottedGeometryColor.reset();
348 // draw top dotted geometry
349 dottedGeometry.drawDottedGeometry(s, type, dottedGeometryColor);
350 }
351 // check if lane2lane bot connection exist
352 if (laneBotA->getLane2laneConnections().exist(laneBotB)) {
353 // obtain lane2lane dotted geometry
354 GUIDottedGeometry lane2lane(s, laneBotA->getLane2laneConnections().getLane2laneGeometry(laneBotB).getShape(), false);
355 // move shape to side
356 lane2lane.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1 * s.edgeRelWidthExaggeration);
357 // reset dottedGeometryColor
358 dottedGeometryColor.reset();
359 // draw top dotted geometry
360 lane2lane.drawDottedGeometry(s, type, dottedGeometryColor);
361 } else {
362 // create dotted geometry using lane extremes
363 GUIDottedGeometry dottedGeometry(s, {laneBotA->getLaneShape().back(), laneBotB->getLaneShape().front()}, false);
364 // move shape to side
365 dottedGeometry.moveShapeToSide(laneDrawingConstantsBot.halfWidth * -1 * s.edgeRelWidthExaggeration);
366 // reset dottedGeometryColor
367 dottedGeometryColor.reset();
368 // draw top dotted geometry
369 dottedGeometry.drawDottedGeometry(s, type, dottedGeometryColor);
370 }
371 // pop matrix
373 }
374 }
375 }
376}
377
378
379GNELane*
381 /* temporal */
382 return nullptr;
383}
384
385
386GNELane*
388 /* temporal */
389 return nullptr;
390}
391
392
395 return getParentEdges().front()->getPositionInView();
396}
397
398
399void
401 // open device
403 // write from
404 device.writeAttr(SUMO_ATTR_FROM, getParentEdges().front()->getID());
405 // write to
406 device.writeAttr(SUMO_ATTR_TO, getParentEdges().back()->getID());
407 // iterate over attributes
408 for (const auto& attribute : getParametersMap()) {
409 // write attribute (don't use writeParams)
410 device.writeAttr(attribute.first, attribute.second);
411 }
412 // close device
413 device.closeTag();
414}
415
416
417bool
419 return true;
420}
421
422
423std::string
425 return "";
426}
427
428
429void
431 throw InvalidArgument(getTagStr() + " cannot fix any problem");
432}
433
434
437 return getParentEdges().front()->getCenteringBoundary();
438}
439
440
441std::string
443 switch (key) {
444 case SUMO_ATTR_ID:
445 return getPartialID() + getParentEdges().front()->getID();
446 case SUMO_ATTR_FROM:
447 return getParentEdges().front()->getID();
448 case SUMO_ATTR_TO:
449 return getParentEdges().back()->getID();
450 case GNE_ATTR_DATASET:
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
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ 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
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.
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
Definition: GNEDataSet.cpp:137
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:1464
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:481
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:839
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)
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
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.
void 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
FOX-declaration.
Definition: GNELane.h:52
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:142
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:917
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:876
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:124
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:132
GNEPathManager * getPathManager()
get path manager
Definition: GNENet.cpp:138
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1987
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
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
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)
void mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:154
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:102
const 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:648
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 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