Eclipse SUMO - Simulation of Urban MObility
GNEAccess.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-2024 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 //
19 /****************************************************************************/
20 #include <config.h>
21 
22 #include <netedit/GNENet.h>
23 #include <netedit/GNEUndoList.h>
24 #include <netedit/GNEViewNet.h>
25 #include <netedit/GNEViewParent.h>
28 #include <utils/gui/div/GLHelper.h>
31 #include <utils/xml/NamespaceIDs.h>
32 
33 #include "GNEAccess.h"
34 #include "GNEAdditionalHandler.h"
35 
36 // ===========================================================================
37 // member method definitions
38 // ===========================================================================
39 
41  GNEAdditional("", net, GLO_ACCESS, SUMO_TAG_ACCESS, GUIIconSubSys::getIcon(GUIIcon::ACCESS), "", {}, {}, {}, {}, {}, {}),
42  myPositionOverLane(0),
43  myLength(0),
44 myFriendlyPosition(false) {
45  // reset default values
46  resetDefaultValues();
47 }
48 
49 
50 GNEAccess::GNEAccess(GNEAdditional* busStop, GNELane* lane, GNENet* net, const double pos, const std::string& specialPos,
51  const bool friendlyPos, const double length, const Parameterised::Map& parameters) :
52  GNEAdditional(net, GLO_ACCESS, SUMO_TAG_ACCESS, GUIIconSubSys::getIcon(GUIIcon::ACCESS), "", {}, {}, {lane}, {busStop}, {}, {}),
53 Parameterised(parameters),
54 myPositionOverLane(pos),
55 mySpecialPosition(specialPos),
56 myLength(length),
57 myFriendlyPosition(friendlyPos) {
58  // update centering boundary without updating grid
59  updateCenteringBoundary(false);
60 }
61 
62 
64 }
65 
66 
69  // return move operation for additional placed over shape
70  return new GNEMoveOperation(this, getParentLanes().front(), myPositionOverLane,
72 }
73 
74 
75 void
77  // set start position
78  double fixedPositionOverLane;
79  if (myPositionOverLane < 0) {
80  fixedPositionOverLane = 0;
81  } else if (myPositionOverLane > getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength()) {
82  fixedPositionOverLane = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
83  } else {
84  fixedPositionOverLane = myPositionOverLane;
85  }
86  // update geometry
87  myAdditionalGeometry.updateGeometry(getParentLanes().front()->getLaneShape(), fixedPositionOverLane * getParentLanes().front()->getLengthGeometryFactor(), myMoveElementLateralOffset);
88 }
89 
90 
94 }
95 
96 
97 void
98 GNEAccess::updateCenteringBoundary(const bool /*updateGrid*/) {
99  // nothing to update
100 }
101 
102 
103 void
104 GNEAccess::splitEdgeGeometry(const double splitPosition, const GNENetworkElement* /*originalElement*/, const GNENetworkElement* newElement, GNEUndoList* undoList) {
105  if (splitPosition < myPositionOverLane) {
106  // change lane
107  setAttribute(SUMO_ATTR_LANE, newElement->getID(), undoList);
108  // now adjust start position
109  setAttribute(SUMO_ATTR_POSITION, toString(myPositionOverLane - splitPosition), undoList);
110  }
111 }
112 
113 
114 bool
116  // with friendly position enabled position are "always fixed"
117  if (myFriendlyPosition) {
118  return true;
119  } else {
121  return (myPositionOverLane >= 0) && (myPositionOverLane <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
122  } else {
123  return false;
124  }
125  }
126 }
127 
128 
129 void
131  device.openTag(SUMO_TAG_ACCESS);
132  device.writeAttr(SUMO_ATTR_LANE, getParentLanes().front()->getID());
134  if (myLength != -1) {
136  }
137  if (myFriendlyPosition) {
138  device.writeAttr(SUMO_ATTR_FRIENDLY_POS, true);
139  }
140  device.closeTag();
141 }
142 
143 
144 bool
146  // with friendly position enabled position is "always fixed"
147  if (myFriendlyPosition) {
148  return true;
149  } else if (myPositionOverLane == INVALID_DOUBLE) {
150  return true;
151  } else {
152  return fabs(myPositionOverLane) <= getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
153  }
154 }
155 
156 
157 std::string GNEAccess::getAdditionalProblem() const {
158  // obtain final length
159  const double len = getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength();
160  // check if detector has a problem
162  return "";
163  } else {
164  // declare variable for error position
165  std::string errorPosition;
166  // check positions over lane
167  if (myPositionOverLane < 0) {
168  errorPosition = (toString(SUMO_ATTR_POSITION) + " < 0");
169  }
170  if (myPositionOverLane > len) {
171  errorPosition = (toString(SUMO_ATTR_POSITION) + TL(" > lanes's length"));
172  }
173  return errorPosition;
174  }
175 }
176 
177 
179  // declare new position
180  double newPositionOverLane = myPositionOverLane;
181  // declare new length (but unsed in this context)
182  double length = 0;
183  // fix pos and length with fixLanePosition
184  GNEAdditionalHandler::fixLanePosition(newPositionOverLane, length, getParentLanes().front()->getParentEdge()->getNBEdge()->getFinalLength());
185  // set new position
186  setAttribute(SUMO_ATTR_POSITION, toString(newPositionOverLane), myNet->getViewNet()->getUndoList());
187 }
188 
189 
190 bool
192  // get edit modes
193  const auto& editModes = myNet->getViewNet()->getEditModes();
194  // check if we're in move mode
195  if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
197  (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
198  // only move the first element
200  } else {
201  return false;
202  }
203 }
204 
205 
206 GNEEdge*
208  return getParentLanes().front()->getParentEdge();
209 }
210 
211 
212 std::string
214  return getParentAdditionals().at(0)->getID();
215 }
216 
217 
218 void
220  // first check if additional has to be drawn
222  // Obtain exaggeration
223  const double accessExaggeration = getExaggeration(s);
224  // get detail level
225  const auto d = s.getDetailLevel(1);
226  // draw geometry only if we'rent in drawForObjectUnderCursor mode
228  // radius depends if mouse is over element
229  const double radius = gViewObjectsHandler.isElementSelected(this) ? 1 : 0.5;
230  // get color
231  RGBColor accessColor;
232  if (drawUsingSelectColor()) {
233  accessColor = s.colorSettings.selectedAdditionalColor;
234  } else if (!getParentAdditionals().front()->getAttribute(SUMO_ATTR_COLOR).empty()) {
235  accessColor = parse<RGBColor>(getParentAdditionals().front()->getAttribute(SUMO_ATTR_COLOR));
236  } else {
237  accessColor = s.colorSettings.busStopColor;
238  }
239  // draw parent and child lines
240  drawParentChildLines(s, accessColor);
241  // push layer matrix
243  // translate to front
245  // set color
246  GLHelper::setColor(accessColor);
247  // translate to geometry position
248  glTranslated(myAdditionalGeometry.getShape().front().x(), myAdditionalGeometry.getShape().front().y(), 0);
249  // draw circle
251  // pop layer matrix
253  // draw lock icon
254  GNEViewNetHelper::LockIcon::drawLockIcon(d, this, getType(), myAdditionalGeometry.getShape().front(), accessExaggeration, 0.3);
255  // draw dotted contour
257  }
258  // calculate contour
259  myAdditionalContour.calculateContourCircleShape(s, d, this, myAdditionalGeometry.getShape().front(), 1, accessExaggeration);
260  }
261 }
262 
263 
264 std::string
266  switch (key) {
267  case SUMO_ATTR_ID:
268  return getParentAdditionals().front()->getID();
269  case SUMO_ATTR_LANE:
270  return getParentLanes().front()->getID();
271  case SUMO_ATTR_POSITION:
273  return mySpecialPosition;
274  } else {
276  }
277  case SUMO_ATTR_LENGTH:
278  return toString(myLength);
281  case GNE_ATTR_PARENT:
282  return getParentAdditionals().at(0)->getID();
283  case GNE_ATTR_SELECTED:
285  case GNE_ATTR_PARAMETERS:
286  return getParametersStr();
288  return "";
289  default:
290  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
291  }
292 }
293 
294 
295 double
297  throw InvalidArgument(getTagStr() + " doesn't have a double attribute of type '" + toString(key) + "'");
298 }
299 
300 
301 const Parameterised::Map&
303  return getParametersMap();
304 }
305 
306 
307 void
308 GNEAccess::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
309  switch (key) {
310  case SUMO_ATTR_LANE:
311  case SUMO_ATTR_POSITION:
312  case SUMO_ATTR_LENGTH:
314  case GNE_ATTR_PARENT:
315  case GNE_ATTR_SELECTED:
316  case GNE_ATTR_PARAMETERS:
318  GNEChange_Attribute::changeAttribute(this, key, value, undoList);
319  break;
320  default:
321  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
322  }
323 }
324 
325 
326 bool
327 GNEAccess::isValid(SumoXMLAttr key, const std::string& value) {
328  switch (key) {
329  case SUMO_ATTR_LANE: {
330  GNELane* lane = myNet->getAttributeCarriers()->retrieveLane(value, false);
331  if (lane != nullptr) {
332  if (getParentLanes().front()->getParentEdge()->getID() != lane->getParentEdge()->getID()) {
334  } else {
335  return true;
336  }
337  } else {
338  return false;
339  }
340  }
341  case SUMO_ATTR_POSITION:
342  if (value.empty() || value == "random" || value == "doors" || value == "carriage") {
343  return true;
344  } else {
345  return canParse<double>(value);
346  }
347  case SUMO_ATTR_LENGTH:
348  if (canParse<double>(value)) {
349  const double valueDouble = parse<double>(value);
350  return (valueDouble == -1) || (valueDouble >= 0);
351  } else {
352  return false;
353  }
355  return canParse<bool>(value);
356  case GNE_ATTR_PARENT:
357  return (myNet->getAttributeCarriers()->retrieveAdditionals(NamespaceIDs::busStops, value, false) != nullptr);
358  case GNE_ATTR_SELECTED:
359  return canParse<bool>(value);
360  case GNE_ATTR_PARAMETERS:
361  return areParametersValid(value);
362  default:
363  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
364  }
365 }
366 
367 
368 std::string
370  return getTagStr();
371 }
372 
373 
374 std::string
376  return getTagStr() + ": " + getParentLanes().front()->getParentEdge()->getID();
377 }
378 
379 // ===========================================================================
380 // private
381 // ===========================================================================
382 
383 void
384 GNEAccess::setAttribute(SumoXMLAttr key, const std::string& value) {
385  switch (key) {
386  case SUMO_ATTR_LANE:
388  break;
389  case SUMO_ATTR_POSITION:
390  if (value.empty()) {
391  myPositionOverLane = 0;
392  } else if (value == "random" || value == "doors" || value == "carriage") {
394  mySpecialPosition = value;
395  } else {
396  myPositionOverLane = parse<double>(value);
397  }
398  break;
399  case SUMO_ATTR_LENGTH:
400  myLength = parse<double>(value);
401  break;
403  myFriendlyPosition = parse<bool>(value);
404  break;
405  case GNE_ATTR_PARENT:
406  if (myNet->getAttributeCarriers()->retrieveAdditional(SUMO_TAG_BUS_STOP, value, false) != nullptr) {
408  } else {
410  }
411  break;
412  case GNE_ATTR_SELECTED:
413  if (parse<bool>(value)) {
415  } else {
417  }
418  break;
419  case GNE_ATTR_PARAMETERS:
420  setParametersStr(value);
421  break;
423  shiftLaneIndex();
424  break;
425  default:
426  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
427  }
428 }
429 
430 
431 void
433  // change both position
434  myPositionOverLane = moveResult.newFirstPos;
435  // set lateral offset
437  // update geometry
438  updateGeometry();
439 }
440 
441 
442 void
443 GNEAccess::commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList) {
444  // reset lateral offset
446  undoList->begin(this, "position of " + getTagStr());
447  // now adjust start position
448  setAttribute(SUMO_ATTR_POSITION, toString(moveResult.newFirstPos), undoList);
449  // check if lane has to be changed
450  if (moveResult.newFirstLane) {
451  // set new lane
452  setAttribute(SUMO_ATTR_LANE, moveResult.newFirstLane->getID(), undoList);
453  }
454  // end change attribute
455  undoList->end();
456 }
457 
458 
459 /****************************************************************************/
@ NETWORK_MOVE
mode for moving network elements
@ GLO_ACCESS
a Acces
GUIViewObjectsHandler gViewObjectsHandler
GUIIcon
An enumeration of icons used by the gui applications.
Definition: GUIIcons.h:33
#define TL(string)
Definition: MsgHandler.h:315
@ SUMO_TAG_ACCESS
An access point for a train stop.
@ SUMO_TAG_BUS_STOP
A bus stop.
@ SUMO_TAG_TRAIN_STOP
A train stop (alias for bus stop)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_LANE
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_FRIENDLY_POS
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_COLOR
A color information.
@ SUMO_ATTR_ID
@ SUMO_ATTR_POSITION
@ GNE_ATTR_SHIFTLANEINDEX
shift lane index (only used by elements over lanes)
const double INVALID_DOUBLE
invalid double
Definition: StdDefs.h:64
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:46
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:654
static void popMatrix()
pop matrix
Definition: GLHelper.cpp:130
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
Definition: GLHelper.cpp:539
static void pushMatrix()
push matrix
Definition: GLHelper.cpp:117
~GNEAccess()
Destructor.
Definition: GNEAccess.cpp:63
std::string getParentName() const
Returns the name (ID) of the parent object.
Definition: GNEAccess.cpp:213
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
Definition: GNEAccess.cpp:327
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
Definition: GNEAccess.cpp:104
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
Definition: GNEAccess.cpp:432
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
Definition: GNEAccess.cpp:130
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEAccess.cpp:369
void updateGeometry()
update pre-computed geometry information
Definition: GNEAccess.cpp:76
bool isAdditionalValid() const
check if current additional is valid to be written into XML (must be reimplemented in all detector ch...
Definition: GNEAccess.cpp:145
void fixAdditionalProblem()
fix additional problem (must be reimplemented in all detector children)
Definition: GNEAccess.cpp:178
bool isAccessPositionFixed() const
check if Position of Access is fixed
Definition: GNEAccess.cpp:115
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
Definition: GNEAccess.cpp:98
bool myFriendlyPosition
flag to check if friendly position is enabled
Definition: GNEAccess.h:178
double getAttributeDouble(SumoXMLAttr key) const
Definition: GNEAccess.cpp:296
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
Definition: GNEAccess.cpp:443
GNEMoveOperation * getMoveOperation()
get move operation
Definition: GNEAccess.cpp:68
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEAccess.cpp:375
GNEEdge * getEdge() const
get edge in which this Access is placed
Definition: GNEAccess.cpp:207
GNEAccess(GNENet *net)
Default constructor.
Definition: GNEAccess.cpp:40
const Parameterised::Map & getACParametersMap() const
get parameters map
Definition: GNEAccess.cpp:302
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEAccess.cpp:265
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEAccess.cpp:92
std::string mySpecialPosition
position over lane
Definition: GNEAccess.h:172
double myLength
Access length.
Definition: GNEAccess.h:175
std::string getAdditionalProblem() const
return a string with the current additional problem (must be reimplemented in all detector children)
Definition: GNEAccess.cpp:157
double myPositionOverLane
position over lane
Definition: GNEAccess.h:169
bool checkDrawMoveContour() const
check if draw move contour (red)
Definition: GNEAccess.cpp:191
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEAccess.cpp:308
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEAccess.cpp:219
static bool accessCanBeCreated(GNEAdditional *busStopParent, GNEEdge *edge)
check if a GNEAccess can be created in a certain Edge
static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos)
check if the given position over a lane is valid
static void fixLanePosition(double &pos, double &length, const double laneLength)
fix given position over lane
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:49
void replaceAdditionalParent(SumoXMLTag tag, const std::string &value, const int parentIndex)
replace additional parent
GNEContour myAdditionalContour
variable used for draw additional contours
GUIGeometry myAdditionalGeometry
geometry to be precomputed in updateGeometry(...)
void replaceAdditionalParentLanes(const std::string &value)
replace additional parent lanes
void shiftLaneIndex()
shift lane index
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
void drawParentChildLines(const GUIVisualizationSettings &s, const RGBColor &color, const bool onlySymbols=false) const
draw parent and child lines
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (instead of GUIGlObjectStorage)
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
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void calculateContourCircleShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const Position &pos, double radius, const double scale) const
calculate contour (circle elements)
Definition: GNEContour.cpp:117
void drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
drawing contour functions
Definition: GNEContour.cpp:265
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:53
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:46
GNEEdge * getParentEdge() const
get parent edge
Definition: GNELane.cpp:196
double myMoveElementLateralOffset
move element lateral offset (used by elements placed over lanes
bool getAllowChangeLane() const
allow change lane
CommonModeOptions * getCommonModeOptions() const
get common mode options
move operation
move result
const GNELane * newFirstLane
new first Lane
double newFirstPos
new first position
double firstLaneOffset
lane offset
GNELane * retrieveLane(const std::string &id, bool hardFail=true, bool checkVolatileChange=false) const
get lane by id
GNEAdditional * retrieveAdditional(SumoXMLTag type, const std::string &id, bool hardFail=true) const
Returns the named additional.
GNEAdditional * retrieveAdditionals(const std::vector< SumoXMLTag > types, const std::string &id, bool hardFail=true) const
Returns the named additional.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:42
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition: GNENet.cpp:123
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2136
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
const GUIGlObject * getGUIGlObjectFront() const
get front attribute carrier or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
Definition: GNEViewNet.cpp:747
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:723
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
Definition: GNEViewNet.cpp:759
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEViewParent * getViewParent() const
get the net object
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
Definition: GNEViewNet.cpp:477
GNEMoveFrame * getMoveFrame() const
get frame for move elements
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
Definition: GUIGeometry.cpp:59
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:156
bool isElementSelected(const GUIGlObject *GLObject) const
check if element was already selected
Stores the information about how to visualize structures.
bool checkDrawAdditional(Detail d, const bool selected) const
check if draw additionals
Detail getDetailLevel(const double exaggeration) const
return the detail level
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
static const std::vector< SumoXMLTag > busStops
busStops namespace
Definition: NamespaceIDs.h:38
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:61
OutputDevice & openTag(const std::string &xmlElement)
Opens an XML tag.
OutputDevice & writeAttr(const SumoXMLAttr attr, const T &val)
writes a named attribute
Definition: OutputDevice.h:254
bool closeTag(const std::string &comment="")
Closes the most recently opened tag and optionally adds a comment.
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
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"
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".
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37
Position getPolygonCenter() const
Returns the arithmetic of all corner points.
bool showAdditionals() const
check if additionals has to be drawn
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
static void drawLockIcon(const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
RGBColor selectedAdditionalColor
additional selection color (busStops, Detectors...)
RGBColor busStopColor
color for busStops
static const double segmentWidthSmall
width of small dotted contour segments