Eclipse SUMO - Simulation of Urban MObility
GNECrossing.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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A class for visualizing Inner Lanes (used when editing traffic lights)
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
26 #include <utils/gui/div/GLHelper.h>
28 #include <netedit/GNEViewNet.h>
29 #include <netedit/GNEUndoList.h>
30 #include <netedit/GNENet.h>
32 
33 #include "GNECrossing.h"
34 #include "GNEJunction.h"
35 #include "GNEEdge.h"
36 
37 
38 // ===========================================================================
39 // method definitions
40 // ===========================================================================
41 GNECrossing::GNECrossing(GNEJunction* parentJunction, std::vector<NBEdge*> crossingEdges) :
42  GNENetElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, GLO_CROSSING, SUMO_TAG_CROSSING),
43  myParentJunction(parentJunction),
44  myCrossingEdges(crossingEdges) {
45 }
46 
47 
49 
50 
51 std::string
53  // currently unused
54  return "";
55 }
56 
57 
58 const PositionVector&
61  if (crossing) {
62  return (crossing->customShape.size() > 0) ? crossing->customShape : crossing->shape;
63  } else {
64  throw ProcessError("Crossing doesn't exist");
65  }
66 }
67 
68 
69 void
71  // rebuild crossing and walking areas form node parent
73  // obtain shape
74  myCrossingGeometry.updateGeometryShape(crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape);
75  /*
76  // only rebuild shape if junction's shape isn't in Buuble mode
77  if (myParentJunction->getNBNode()->getShape().size() > 0) {
78  myCrossingGeometry.calculateShapeRotationsAndLengths();
79  }
80  */
81 }
82 
83 
86  // currently unused
87  return Position(0, 0);
88 }
89 
90 
93  return myParentJunction;
94 }
95 
96 
97 const std::vector<NBEdge*>&
99  return myCrossingEdges;
100 }
101 
102 
106 }
107 
108 
109 void
111  // only draw if option drawCrossingsAndWalkingareas is enabled and size of shape is greather than 0 and zoom is close enough
113  (myCrossingGeometry.getShapeRotations().size() > 0) &&
114  (myCrossingGeometry.getShapeLengths().size() > 0) &&
115  (s.scale > 3.0)) {
118  // push first draw matrix
119  glPushMatrix();
120  // push name
121  glPushName(getGlID());
122  // must draw on top of junction
123  glTranslated(0, 0, GLO_JUNCTION + 0.1);
124  // set color depending of selection and priority
125  if (drawUsingSelectColor()) {
127  } else if (!crossing->valid) {
129  } else if (crossing->priority) {
131  } else {
133  }
134  // traslate to front
135  glTranslated(0, 0, .2);
136  // set default values
137  double length = 0.5;
138  double spacing = 1.0;
139  double halfWidth = crossing->width * 0.5;
140  // push second draw matrix
141  glPushMatrix();
142  // draw on top of of the white area between the rails
143  glTranslated(0, 0, 0.1);
144  for (int i = 0; i < (int)myCrossingGeometry.getShape().size() - 1; ++i) {
145  // push three draw matrix
146  glPushMatrix();
147  // translate and rotate
148  glTranslated(myCrossingGeometry.getShape()[i].x(), myCrossingGeometry.getShape()[i].y(), 0.0);
149  glRotated(myCrossingGeometry.getShapeRotations()[i], 0, 0, 1);
150  // draw crossing depending if isn't being drawn for selecting
151  if (!s.drawForRectangleSelection) {
152  for (double t = 0; t < myCrossingGeometry.getShapeLengths()[i]; t += spacing) {
153  glBegin(GL_QUADS);
154  glVertex2d(-halfWidth, -t);
155  glVertex2d(-halfWidth, -t - length);
156  glVertex2d(halfWidth, -t - length);
157  glVertex2d(halfWidth, -t);
158  glEnd();
159  }
160  } else {
161  // only draw a single rectangle if it's being drawn only for selecting
162  glBegin(GL_QUADS);
163  glVertex2d(-halfWidth, 0);
164  glVertex2d(-halfWidth, -myCrossingGeometry.getShapeLengths().back());
165  glVertex2d(halfWidth, -myCrossingGeometry.getShapeLengths().back());
166  glVertex2d(halfWidth, 0);
167  glEnd();
168  }
169  // pop three draw matrix
170  glPopMatrix();
171  }
172  // pop second draw matrix
173  glPopMatrix();
174  // traslate to back
175  glTranslated(0, 0, -.2);
176  // pop name
177  glPopName();
178  // pop draw matrix
179  glPopMatrix();
180  }
181  // link indices must be drawn in all edit modes if isn't being drawn for selecting
183  drawTLSLinkNo(s);
184  }
185  // check if dotted contour has to be drawn
186  if (myNet->getViewNet()->getDottedAC() == this) {
188  }
189  }
190 }
191 
192 
193 void
196  glPushMatrix();
197  glTranslated(0, 0, GLO_JUNCTION + 0.5);
198  PositionVector shape = crossing->shape;
199  shape.extrapolate(0.5); // draw on top of the walking area
200  int linkNo = crossing->tlLinkIndex;
201  int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo;
204  glPopMatrix();
205 }
206 
207 
210  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
211  buildPopupHeader(ret, app);
214  // build selection and show parameters menu
217  // build position copy entry
218  buildPositionCopyEntry(ret, false);
219  // check if we're in supermode network
221  // create menu commands
222  FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom crossing shape", nullptr, &parent, MID_GNE_CROSSING_EDIT_SHAPE);
223  // check if menu commands has to be disabled
225  if ((editMode == GNE_NMODE_CONNECT) || (editMode == GNE_NMODE_TLS) || (editMode == GNE_NMODE_CREATE_EDGE)) {
226  mcCustomShape->disable();
227  }
228  }
229  return ret;
230 }
231 
232 
233 Boundary
235  Boundary b;
237  if (crossing) {
238  if (crossing->customShape.size() > 0) {
239  b = crossing->customShape.getBoxBoundary();
240  } else if (crossing->shape.size() > 0) {
241  b = crossing->shape.getBoxBoundary();
242  } else {
244  }
245  b.grow(10);
246  return b;
247  }
248  // in other case return boundary of parent junction
250 }
251 
252 
253 std::string
255  auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges, (key != SUMO_ATTR_ID));
256  switch (key) {
257  case SUMO_ATTR_ID:
258  // get attribute requires a special case
259  if (crossing) {
260  return crossing->id;
261  } else {
262  return "Temporal Unreferenced";
263  }
264  case SUMO_ATTR_WIDTH:
265  return toString(crossing->customWidth);
266  case SUMO_ATTR_PRIORITY:
267  return crossing->priority ? "true" : "false";
268  case SUMO_ATTR_EDGES:
269  return toString(crossing->edges);
271  return toString(crossing->customTLIndex);
273  return toString(crossing->customTLIndex2);
275  return toString(crossing->customShape);
276  case GNE_ATTR_SELECTED:
278  case GNE_ATTR_PARAMETERS:
279  return crossing->getParametersStr();
280  default:
281  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
282  }
283 }
284 
285 
286 void
287 GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
288  if (value == getAttribute(key)) {
289  return; //avoid needless changes, later logic relies on the fact that attributes have changed
290  }
291  switch (key) {
292  case SUMO_ATTR_ID:
293  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed");
294  case SUMO_ATTR_EDGES:
295  case SUMO_ATTR_WIDTH:
296  case SUMO_ATTR_PRIORITY:
300  case GNE_ATTR_SELECTED:
301  case GNE_ATTR_PARAMETERS:
302  undoList->add(new GNEChange_Attribute(this, myNet, key, value), true);
303  break;
304  default:
305  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
306  }
307 }
308 
309 
310 bool
312  switch (key) {
313  case SUMO_ATTR_ID:
314  // id isn't editable
315  return false;
319  default:
320  return true;
321  }
322 }
323 
324 
325 bool
326 GNECrossing::isValid(SumoXMLAttr key, const std::string& value) {
328  switch (key) {
329  case SUMO_ATTR_ID:
330  return false;
331  case SUMO_ATTR_EDGES:
332  if (canParse<std::vector<GNEEdge*> >(myNet, value, false)) {
333  // parse edges and save their IDs in a set
334  std::vector<GNEEdge*> parsedEdges = parse<std::vector<GNEEdge*> >(myNet, value);
335  EdgeVector nbEdges;
336  for (auto i : parsedEdges) {
337  nbEdges.push_back(i->getNBEdge());
338  }
339  std::sort(nbEdges.begin(), nbEdges.end());
340  //
341  EdgeVector originalEdges = crossing->edges;
342  std::sort(originalEdges.begin(), originalEdges.end());
343  // return true if we're setting the same edges
344  if (toString(nbEdges) == toString(originalEdges)) {
345  return true;
346  } else {
348  }
349  } else {
350  return false;
351  }
352  case SUMO_ATTR_WIDTH:
353  return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == -1)); // kann NICHT 0 sein, oder -1 (bedeutet default)
354  case SUMO_ATTR_PRIORITY:
355  return canParse<bool>(value);
358  // -1 means that tlLinkIndex2 takes on the same value as tlLinkIndex when setting idnices
359  return (isAttributeEnabled(key) &&
360  canParse<int>(value)
361  && ((parse<double>(value) >= 0) || ((parse<double>(value) == -1) && (key == SUMO_ATTR_TLLINKINDEX2)))
362  && myParentJunction->getNBNode()->getControllingTLS().size() > 0
363  && (*myParentJunction->getNBNode()->getControllingTLS().begin())->getMaxValidIndex() >= parse<int>(value));
364  case SUMO_ATTR_CUSTOMSHAPE: {
365  // empty shapes are allowed
366  return canParse<PositionVector>(value);
367  }
368  case GNE_ATTR_SELECTED:
369  return canParse<bool>(value);
370  case GNE_ATTR_PARAMETERS:
371  return Parameterised::areParametersValid(value);
372  default:
373  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
374  }
375 }
376 
377 
378 bool
381  if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->getNBEdge()) != crossing->edges.end()) {
382  return true;
383  } else {
384  return false;
385  }
386 }
387 
388 
389 bool
390 GNECrossing::checkEdgeBelong(const std::vector<GNEEdge*>& edges) const {
391  for (auto i : edges) {
392  if (checkEdgeBelong(i)) {
393  return true;
394  }
395  }
396  return false;
397 }
398 
399 // ===========================================================================
400 // private
401 // ===========================================================================
402 
403 void
404 GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value) {
406  switch (key) {
407  case SUMO_ATTR_ID:
408  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed");
409  case SUMO_ATTR_EDGES: {
410  // obtain GNEEdges
411  std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(myNet, value);
412  // remove NBEdges of crossing
413  crossing->edges.clear();
414  // set NBEdge of every GNEEdge into Crossing Edges
415  for (auto i : edges) {
416  crossing->edges.push_back(i->getNBEdge());
417  }
418  // sort new edges
419  std::sort(crossing->edges.begin(), crossing->edges.end());
420  // change myCrossingEdges by the new edges
421  myCrossingEdges = crossing->edges;
422  // update geometry of parent junction
424  break;
425  }
426  case SUMO_ATTR_WIDTH:
427  // Change width an refresh element
428  crossing->customWidth = parse<double>(value);
429  break;
430  case SUMO_ATTR_PRIORITY:
431  crossing->priority = parse<bool>(value);
432  break;
434  crossing->customTLIndex = parse<int>(value);
435  // make new value visible immediately
436  crossing->tlLinkIndex = crossing->customTLIndex;
437  break;
439  crossing->customTLIndex2 = parse<int>(value);
440  // make new value visible immediately
441  crossing->tlLinkIndex2 = crossing->customTLIndex2;
442  break;
443  case SUMO_ATTR_CUSTOMSHAPE: {
444  // set custom shape
445  crossing->customShape = parse<PositionVector>(value);
446  break;
447  }
448  case GNE_ATTR_SELECTED:
449  if (parse<bool>(value)) {
451  } else {
453  }
454  break;
455  case GNE_ATTR_PARAMETERS:
456  crossing->setParametersStr(value);
457  break;
458  default:
459  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
460  }
461  // Crossing are a special case and we need ot update geometry of junction instead of crossing
462  if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) {
464  }
465 }
466 
467 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
GNENetElement::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:99
GNECrossing::myParentJunction
GNEJunction * myParentJunction
the parent junction of this crossing
Definition: GNECrossing.h:141
GNECrossing::~GNECrossing
~GNECrossing()
Destructor.
Definition: GNECrossing.cpp:48
GNEGeometry::Geometry::updateGeometryShape
void updateGeometryShape(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
Definition: GNEGeometry.cpp:48
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
GNECrossing::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNECrossing.cpp:311
GNECrossing::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNECrossing.cpp:234
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:647
GNEGeometry::Geometry::getShapeLengths
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
Definition: GNEGeometry.cpp:159
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:74
EdgeVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
Definition: SUMOXMLDefinitions.h:702
GUIGLObjectPopupMenu.h
GNECrossing::getCrossingShape
const PositionVector & getCrossingShape() const
Definition: GNECrossing.cpp:59
GUIVisualizationColorSettings::crossing
static const RGBColor crossing
color for crossings
Definition: GUIVisualizationSettings.h:165
PositionVector::extrapolate
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
Definition: PositionVector.cpp:1042
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
GLHelper.h
GNE_NMODE_CREATE_EDGE
mode for creating new edges
Definition: GNEViewNetHelper.h:64
GNE_NMODE_TLS
mode for editing tls
Definition: GNEViewNetHelper.h:68
GNECrossing::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNECrossing.cpp:254
GLO_CROSSING
a tl-logic
Definition: GUIGlObjectTypes.h:52
GNENetElement::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNENetElement.cpp:120
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GNECrossing::drawTLSLinkNo
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
Definition: GNECrossing.cpp:194
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GUIVisualizationColorSettings::crossingPriority
static const RGBColor crossingPriority
color for priority crossing
Definition: GUIVisualizationSettings.h:168
GNEJunction::updateGeometry
void updateGeometry()
update pre-computed geometry information (including crossings)
Definition: GNEJunction.cpp:109
GUIAppEnum.h
GNEJunction.h
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNECrossing::getNBCrossing
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
Definition: GNECrossing.cpp:104
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNECrossing::getPositionInView
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNECrossing.cpp:85
MID_GNE_CROSSING_EDIT_SHAPE
edit junction shape
Definition: GUIAppEnum.h:891
GNEJunction::getNBNode
NBNode * getNBNode() const
Return net build node.
Definition: GNEJunction.cpp:398
GUIVisualizationSettings::drawCrossingsAndWalkingareas
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
Definition: GUIVisualizationSettings.h:576
GNECrossing::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNECrossing.cpp:110
GNECrossing::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNECrossing.cpp:209
GNEJunction::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEJunction.cpp:253
GNEGeometry::Geometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GNEGeometry.cpp:147
GUIGlObject::buildNameCopyPopupEntry
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Definition: GUIGlObject.cpp:225
GNEEdge::getNBEdge
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:631
GNECrossing::myCrossingGeometry
GNEGeometry::Geometry myCrossingGeometry
crossing geometry
Definition: GNECrossing.h:147
GNEViewNet::buildSelectionACPopupEntry
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:338
SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
Definition: SUMOXMLDefinitions.h:688
GNEViewNet.h
SUMO_ATTR_WIDTH
Definition: SUMOXMLDefinitions.h:386
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:1026
SUMO_ATTR_EDGES
the edges of a route
Definition: SUMOXMLDefinitions.h:427
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
ProcessError
Definition: UtilExceptions.h:39
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNE_NMODE_CONNECT
mode for connecting lanes
Definition: GNEViewNetHelper.h:66
GNEEdge.h
GNENetElement::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNENetElement.cpp:114
GUIVisualizationSettings::drawLinkTLIndex
GUIVisualizationTextSettings drawLinkTLIndex
Definition: GUIVisualizationSettings.h:569
GNECrossing::checkEdgeBelong
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing's edges
Definition: GNECrossing.cpp:379
GNENetElement
Definition: GNENetElement.h:43
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
GNECrossing.h
GNECrossing::myCrossingEdges
std::vector< NBEdge * > myCrossingEdges
Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges)
Definition: GNECrossing.h:144
GLHelper::drawShapeDottedContourAroundShape
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
Definition: GLHelper.cpp:461
NetworkEditMode
NetworkEditMode
@brie enum for network edit modes
Definition: GNEViewNetHelper.h:52
GNEAttributeCarrier::canParse
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
Definition: GNEAttributeCarrier.h:636
GUIVisualizationColorSettings::crossingInvalid
static const RGBColor crossingInvalid
color for invalid crossing
Definition: GUIVisualizationSettings.h:171
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2117
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:677
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
SUMO_ATTR_PRIORITY
Definition: SUMOXMLDefinitions.h:382
GNECrossing::getParentJunction
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:92
GUIMainWindow
Definition: GUIMainWindow.h:46
SUMO_TAG_CROSSING
crossing between edges for pedestrians
Definition: SUMOXMLDefinitions.h:226
NBNode::Crossing::customShape
PositionVector customShape
optional customShape for this crossing
Definition: NBNode.h:153
SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
Definition: SUMOXMLDefinitions.h:686
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
PositionVector::reverse
PositionVector reverse() const
reverse position vector
Definition: PositionVector.cpp:1086
NBNode::getControllingTLS
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition: NBNode.h:318
InvalidArgument
Definition: UtilExceptions.h:56
GNECrossing::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
Definition: GNECrossing.cpp:326
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
GNECrossing::GNECrossing
GNECrossing(GNEJunction *parentJunction, std::vector< NBEdge * > edges)
Constructor.
Definition: GNECrossing.cpp:41
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
GUIGlObject::buildPositionCopyEntry
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Definition: GUIGlObject.cpp:266
GUIVisualizationTextSettings::size
double size
text size
Definition: GUIVisualizationSettings.h:71
NBNode::getCrossing
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:3096
GNENetElement::myNet
GNENet * myNet
the net to inform about updates
Definition: GNENetElement.h:166
config.h
GNECrossing::generateChildID
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNECrossing.cpp:52
GLO_JUNCTION
a junction
Definition: GUIGlObjectTypes.h:50
GNECrossing::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNECrossing.cpp:70
GNEGeometry::Geometry::getShapeRotations
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
Definition: GNEGeometry.cpp:153
GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
StringTokenizer.h
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:434
GUIVisualizationColorSettings::selectedCrossingColor
RGBColor selectedCrossingColor
crossings selection color
Definition: GUIVisualizationSettings.h:144
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
GNENetElement::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:83
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNEJunction
Definition: GNEJunction.h:47
NBNode::Crossing
A definition of a pedestrian crossing.
Definition: NBNode.h:131
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNECrossing::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNECrossing.cpp:287
GNEViewNetHelper::EditModes::networkEditMode
NetworkEditMode networkEditMode
the current Network edit mode
Definition: GNEViewNetHelper.h:308
NBNode::Crossing::tlID
std::string tlID
The id of the traffic light that controls this connection.
Definition: NBNode.h:161
GNECrossing::getCrossingEdges
const std::vector< NBEdge * > & getCrossingEdges() const
get crossingEdges
Definition: GNECrossing.cpp:98
GNEChange_Attribute.h
GNENet.h
NBNode::checkCrossingDuplicated
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
Definition: NBNode.cpp:2387
GNEUndoList.h
GLHelper::drawTextAtEnd
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
Definition: GLHelper.cpp:755