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-2018 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 /****************************************************************************/
15 // A class for visualizing Inner Lanes (used when editing traffic lights)
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <string>
25 #include <iostream>
26 #include <utility>
27 #include <time.h>
33 #include <utils/common/ToString.h>
36 #include <utils/gui/div/GLHelper.h>
39 #include <netedit/GNEViewParent.h>
40 #include <netedit/GNEViewNet.h>
41 #include <netedit/GNEUndoList.h>
42 #include <netedit/GNENet.h>
44 
45 #include "GNECrossing.h"
46 #include "GNEJunction.h"
47 #include "GNEEdge.h"
48 
49 
50 // ===========================================================================
51 // method definitions
52 // ===========================================================================
53 GNECrossing::GNECrossing(GNEJunction* parentJunction, std::vector<NBEdge*> crossingEdges) :
54  GNENetElement(parentJunction->getNet(), parentJunction->getNBNode()->getCrossing(crossingEdges)->id, GLO_CROSSING, SUMO_TAG_CROSSING),
55  myParentJunction(parentJunction),
56  myCrossingEdges(crossingEdges) {
57 }
58 
59 
61 
62 
63 void
64 GNECrossing::updateGeometry(bool updateGrid) {
65  // first check if object has to be removed from grid (SUMOTree)
66  if (updateGrid) {
68  }
69  // rebuild crossing and walking areas form node parent
71  // obtain shape
72  myShape = crossing->customShape.size() > 0 ? crossing->customShape : crossing->shape;
73  // Clear Shape rotations and segments
74  myShapeRotations.clear();
75  myShapeLengths.clear();
76  // only rebuild shape if junction's shape isn't in Buuble mode
77  if (myParentJunction->getNBNode()->getShape().size() > 0) {
78  int segments = (int)myShape.size() - 1;
79  if (segments >= 0) {
80  myShapeRotations.reserve(segments);
81  myShapeLengths.reserve(segments);
82  for (int i = 0; i < segments; ++i) {
83  const Position& f = myShape[i];
84  const Position& s = myShape[i + 1];
85  myShapeLengths.push_back(f.distanceTo2D(s));
86  myShapeRotations.push_back((double) atan2((s.x() - f.x()), (f.y() - s.y())) * (double) 180.0 / (double)M_PI);
87  }
88  }
89  }
90  // last step is to check if object has to be added into grid (SUMOTree) again
91  if (updateGrid) {
93  }
94 }
95 
96 
99  return myParentJunction;
100 }
101 
102 
103 const std::vector<NBEdge*>&
105  return myCrossingEdges;
106 }
107 
108 
112 }
113 
114 
115 void
117  // only draw if option drawCrossingsAndWalkingareas is enabled and size of shape is greather than 0 and zoom is close enough
119  (myShapeRotations.size() > 0) &&
120  (myShapeLengths.size() > 0) &&
121  (s.scale > 3.0)) {
123  if (s.editMode != GNE_MODE_TLS) {
124  // push first draw matrix
125  glPushMatrix();
126  // push name
127  glPushName(getGlID());
128  // must draw on top of junction
129  glTranslated(0, 0, GLO_JUNCTION + 0.1);
130  // set color depending of selection and priority
132  glColor3d(0.118, 0.565, 1.000);
133  } else if (!crossing->valid) {
134  glColor3d(1.0, 0.1, 0.1);
135  } else if (crossing->priority) {
136  glColor3d(0.9, 0.9, 0.9);
137  } else {
138  glColor3d(0.1, 0.1, 0.1);
139  }
140  // traslate to front
141  glTranslated(0, 0, .2);
142  // set default values
143  double length = 0.5;
144  double spacing = 1.0;
145  double halfWidth = crossing->width * 0.5;
146  // push second draw matrix
147  glPushMatrix();
148  // draw on top of of the white area between the rails
149  glTranslated(0, 0, 0.1);
150  for (int i = 0; i < (int)myShape.size() - 1; ++i) {
151  // push three draw matrix
152  glPushMatrix();
153  // translate and rotate
154  glTranslated(myShape[i].x(), myShape[i].y(), 0.0);
155  glRotated(myShapeRotations[i], 0, 0, 1);
156  // draw crossing depending if isn't being drawn for selecting
157  if (!s.drawForSelecting) {
158  for (double t = 0; t < myShapeLengths[i]; t += spacing) {
159  glBegin(GL_QUADS);
160  glVertex2d(-halfWidth, -t);
161  glVertex2d(-halfWidth, -t - length);
162  glVertex2d(halfWidth, -t - length);
163  glVertex2d(halfWidth, -t);
164  glEnd();
165  }
166  } else {
167  // only draw a single rectangle if it's being drawn only for selecting
168  glBegin(GL_QUADS);
169  glVertex2d(-halfWidth, 0);
170  glVertex2d(-halfWidth, -myShapeLengths.back());
171  glVertex2d(halfWidth, -myShapeLengths.back());
172  glVertex2d(halfWidth, 0);
173  glEnd();
174  }
175  // pop three draw matrix
176  glPopMatrix();
177  }
178  // XXX draw junction index / tls index
179  // pop second draw matrix
180  glPopMatrix();
181  // traslate to back
182  glTranslated(0, 0, -.2);
183  // pop name
184  glPopName();
185  // pop draw matrix
186  glPopMatrix();
187  }
188  // link indices must be drawn in all edit modes if isn't being drawn for selecting
189  if (s.drawLinkTLIndex.show && !s.drawForSelecting) {
190  drawTLSLinkNo(s);
191  }
192  // check if dotted contour has to be drawn
193  if (!s.drawForSelecting && (myNet->getViewNet()->getACUnderCursor() == this)) {
194  GLHelper::drawShapeDottedContour(getType(), myShape, crossing->width * 0.5);
195  }
196  }
197 }
198 
199 
200 void
203  glPushMatrix();
204  glTranslated(0, 0, GLO_JUNCTION + 0.5);
205  PositionVector shape = crossing->shape;
206  shape.extrapolate(0.5); // draw on top of the walking area
207  int linkNo = crossing->tlLinkIndex;
208  int linkNo2 = crossing->tlLinkIndex2 > 0 ? crossing->tlLinkIndex2 : linkNo;
211  glPopMatrix();
212 }
213 
214 
217  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
218  buildPopupHeader(ret, app);
221  // build selection and show parameters menu
224  // build position copy entry
225  buildPositionCopyEntry(ret, false);
226  // create menu commands
227  FXMenuCommand* mcCustomShape = new FXMenuCommand(ret, "Set custom crossing shape", 0, &parent, MID_GNE_CROSSING_EDIT_SHAPE);
228  // check if menu commands has to be disabled
229  EditMode editMode = myNet->getViewNet()->getCurrentEditMode();
230  const bool wrongMode = (editMode == GNE_MODE_CONNECT || editMode == GNE_MODE_TLS || editMode == GNE_MODE_CREATE_EDGE);
231  if (wrongMode) {
232  mcCustomShape->disable();
233  }
234  return ret;
235 }
236 
237 
238 Boundary
240  // make sure that shape isn't empty
241  if (myShape.size() == 0) {
242  // we need to use the center of junction parent as boundary if shape is empty
245  } else {
246  // use crossing boundary
248  b.grow(10);
249  return b;
250  }
251 }
252 
253 
254 std::string
256  auto crossing = myParentJunction->getNBNode()->getCrossing(myCrossingEdges, (key != SUMO_ATTR_ID));
257  switch (key) {
258  case SUMO_ATTR_ID:
259  // get attribute requieres a special case
260  if (crossing) {
261  return crossing->id;
262  } else {
263  return "Temporal Unreferenced";
264  }
265  case SUMO_ATTR_WIDTH:
266  return toString(crossing->customWidth);
267  case SUMO_ATTR_PRIORITY:
268  return crossing->priority ? "true" : "false";
269  case SUMO_ATTR_EDGES:
270  return toString(crossing->edges);
272  return toString(crossing->customTLIndex);
274  return toString(crossing->customTLIndex2);
276  return toString(crossing->customShape);
277  case GNE_ATTR_SELECTED:
279  case GNE_ATTR_GENERIC:
280  return getGenericParametersStr();
281  default:
282  throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'");
283  }
284 }
285 
286 
287 void
288 GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
289  if (value == getAttribute(key)) {
290  return; //avoid needless changes, later logic relies on the fact that attributes have changed
291  }
292  switch (key) {
293  case SUMO_ATTR_ID:
294  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + toString(getTag()) + " isn't allowed");
295  case SUMO_ATTR_EDGES:
296  case SUMO_ATTR_WIDTH:
297  case SUMO_ATTR_PRIORITY:
301  case GNE_ATTR_SELECTED:
302  case GNE_ATTR_GENERIC:
303  undoList->add(new GNEChange_Attribute(this, key, value), true);
304  break;
305  default:
306  throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'");
307  }
308 }
309 
310 
311 bool
312 GNECrossing::isValid(SumoXMLAttr key, const std::string& value) {
314  switch (key) {
315  case SUMO_ATTR_ID:
316  return false;
317  case SUMO_ATTR_EDGES:
318  if (canParse<std::vector<GNEEdge*> >(myNet, value, false)) {
319  // parse edges and save their IDs in a set
320  std::vector<GNEEdge*> parsedEdges = parse<std::vector<GNEEdge*> >(myNet, value);
321  EdgeVector nbEdges;
322  for (auto i : parsedEdges) {
323  nbEdges.push_back(i->getNBEdge());
324  }
325  std::sort(nbEdges.begin(), nbEdges.end());
326  //
327  EdgeVector originalEdges = crossing->edges;
328  std::sort(originalEdges.begin(), originalEdges.end());
329  // return true if we're setting the same edges
330  if (toString(nbEdges) == toString(originalEdges)) {
331  return true;
332  } else {
334  }
335  } else {
336  return false;
337  }
338  case SUMO_ATTR_WIDTH:
339  return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == -1)); // kann NICHT 0 sein, oder -1 (bedeutet default)
340  case SUMO_ATTR_PRIORITY:
341  return canParse<bool>(value);
344  return (crossing->tlID != "" && canParse<int>(value)
345  // -1 means that tlLinkIndex2 takes on the same value as tlLinkIndex when setting idnices
346  && ((parse<double>(value) >= 0) || ((parse<double>(value) == -1) && (key == SUMO_ATTR_TLLINKINDEX2)))
347  && myParentJunction->getNBNode()->getControllingTLS().size() > 0
348  && (*myParentJunction->getNBNode()->getControllingTLS().begin())->getMaxValidIndex() >= parse<int>(value));
349  case SUMO_ATTR_CUSTOMSHAPE: {
350  bool ok = true;
351  PositionVector shape = GeomConvHelper::parseShapeReporting(value, "user-supplied shape", 0, ok, true);
352  return ok;
353  }
354  case GNE_ATTR_SELECTED:
355  return canParse<bool>(value);
356  case GNE_ATTR_GENERIC:
357  return isGenericParametersValid(value);
358  default:
359  throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'");
360  }
361 }
362 
363 
364 bool
365 GNECrossing::addGenericParameter(const std::string& key, const std::string& value) {
367  if (!crossing->knowsParameter(key)) {
368  crossing->setParameter(key, value);
369  return true;
370  } else {
371  return false;
372  }
373 }
374 
375 
376 bool
377 GNECrossing::removeGenericParameter(const std::string& key) {
379  if (crossing->knowsParameter(key)) {
380  crossing->unsetParameter(key);
381  return true;
382  } else {
383  return false;
384  }
385 }
386 
387 
388 bool
389 GNECrossing::updateGenericParameter(const std::string& oldKey, const std::string& newKey) {
391  if (crossing->knowsParameter(oldKey) && !crossing->knowsParameter(newKey)) {
392  std::string value = crossing->getParameter(oldKey);
393  crossing->unsetParameter(oldKey);
394  crossing->setParameter(newKey, value);
395  return true;
396  } else {
397  return false;
398  }
399 }
400 
401 
402 bool
403 GNECrossing::updateGenericParameterValue(const std::string& key, const std::string& newValue) {
405  if (crossing->knowsParameter(key)) {
406  crossing->setParameter(key, newValue);
407  return true;
408  } else {
409  return false;
410  }
411 }
412 
413 
414 std::string
417  std::string result;
418  // Generate an string using the following structure: "key1=value1|key2=value2|...
419  for (auto i : crossing->getParametersMap()) {
420  result += i.first + "=" + i.second + "|";
421  }
422  // remove the last "|"
423  if (!result.empty()) {
424  result.pop_back();
425  }
426  return result;
427 }
428 
429 
430 std::vector<std::pair<std::string, std::string> >
433  std::vector<std::pair<std::string, std::string> > result;
434  // iterate over parameters map and fill result
435  for (auto i : crossing->getParametersMap()) {
436  result.push_back(std::make_pair(i.first, i.second));
437  }
438  return result;
439 }
440 
441 
442 void
443 GNECrossing::setGenericParametersStr(const std::string& value) {
445  // clear parameters
446  crossing->clearParameter();
447  // separate value in a vector of string using | as separator
448  std::vector<std::string> parsedValues;
449  StringTokenizer stValues(value, "|", true);
450  while (stValues.hasNext()) {
451  parsedValues.push_back(stValues.next());
452  }
453  // check that parsed values (A=B)can be parsed in generic parameters
454  for (auto i : parsedValues) {
455  std::vector<std::string> parsedParameters;
456  StringTokenizer stParam(i, "=", true);
457  while (stParam.hasNext()) {
458  parsedParameters.push_back(stParam.next());
459  }
460  // Check that parsed parameters are exactly two and contains valid chracters
461  if (parsedParameters.size() == 2 && SUMOXMLDefinitions::isValidGenericParameterKey(parsedParameters.front()) && SUMOXMLDefinitions::isValidGenericParameterValue(parsedParameters.back())) {
462  crossing->setParameter(parsedParameters.front(), parsedParameters.back());
463  }
464  }
465 }
466 
467 
468 bool
471  if (std::find(crossing->edges.begin(), crossing->edges.end(), edge->getNBEdge()) != crossing->edges.end()) {
472  return true;
473  } else {
474  return false;
475  }
476 }
477 
478 
479 bool
480 GNECrossing::checkEdgeBelong(const std::vector<GNEEdge*>& edges) const {
481  for (auto i : edges) {
482  if (checkEdgeBelong(i)) {
483  return true;
484  }
485  }
486  return false;
487 }
488 
489 // ===========================================================================
490 // private
491 // ===========================================================================
492 
493 void
494 GNECrossing::setAttribute(SumoXMLAttr key, const std::string& value) {
496  switch (key) {
497  case SUMO_ATTR_ID:
498  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + toString(getTag()) + " isn't allowed");
499  case SUMO_ATTR_EDGES: {
500  // obtain GNEEdges
501  std::vector<GNEEdge*> edges = parse<std::vector<GNEEdge*> >(myNet, value);
502  // remove NBEdges of crossing
503  crossing->edges.clear();
504  // set NBEdge of every GNEEdge into Crossing Edges
505  for (auto i : edges) {
506  crossing->edges.push_back(i->getNBEdge());
507  }
508  // sort new edges
509  std::sort(crossing->edges.begin(), crossing->edges.end());
510  // change myCrossingEdges by the new edges
511  myCrossingEdges = crossing->edges;
512  // update geometry of parent junction
514  break;
515  }
516  case SUMO_ATTR_WIDTH:
517  // Change width an refresh element
518  crossing->customWidth = parse<double>(value);
519  break;
520  case SUMO_ATTR_PRIORITY:
521  crossing->priority = parse<bool>(value);
522  break;
524  crossing->customTLIndex = parse<int>(value);
525  // make new value visible immediately
526  crossing->tlLinkIndex = crossing->customTLIndex;
527  break;
529  crossing->customTLIndex2 = parse<int>(value);
530  // make new value visible immediately
531  crossing->tlLinkIndex2 = crossing->customTLIndex2;
532  break;
533  case SUMO_ATTR_CUSTOMSHAPE: {
534  bool ok;
535  // first remove object from grid
537  // set custom shape
538  crossing->customShape = GeomConvHelper::parseShapeReporting(value, "user-supplied shape", 0, ok, true);
539  // insert object in grid again
541  break;
542  }
543  case GNE_ATTR_SELECTED:
544  if (parse<bool>(value)) {
546  } else {
548  }
549  break;
550  case GNE_ATTR_GENERIC:
552  break;
553  default:
554  throw InvalidArgument(toString(getTag()) + " doesn't have an attribute of type '" + toString(key) + "'");
555  }
556  // Crossing are a special case and we need ot update geometry of junction instead of crossing
558 }
559 
560 
561 void
563 }
564 
565 
566 /****************************************************************************/
GNECrossing(GNEJunction *parentJunction, std::vector< NBEdge *> edges)
Constructor.
Definition: GNECrossing.cpp:53
a tl-logic
const GNEAttributeCarrier * getACUnderCursor() const
get AttributeCarrier under cursor
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Position getPositionInView() const
Return current position.
bool checkEdgeBelong(GNEEdge *edges) const
return true if a edge belongs to crossing&#39;s edges
double scale
information about a lane&#39;s width (temporary, used for a single view)
const std::vector< NBEdge * > & getCrossingEdges() const
get crossingEdges
whether a given shape is user-defined
GNENet * myNet
the net to inform about updates
std::string next()
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void mouseOverObject(const GUIVisualizationSettings &s) const
method for check if mouse is over objects
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:667
edit junction shape
Definition: GUIAppEnum.h:742
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:243
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
Definition: Position.h:61
bool addGenericParameter(const std::string &key, const std::string &value)
add generic parameter
void unsetParameter(const std::string &key)
Removes a parameter.
bool removeGenericParameter(const std::string &key)
remove generic parameter
double x() const
Returns the x-position.
Definition: Position.h:56
mode for editing tls
Definition: GNEViewNet.h:58
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void setGenericParametersStr(const std::string &value)
set generic parameters in string format
Crossing * getCrossing(const std::string &id) const
return the crossing with the given id
Definition: NBNode.cpp:2863
int editMode
the current NETEDIT mode (temporary)
PositionVector reverse() const
reverse position vector
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
std::string getGenericParametersStr() const
return generic parameters in string format
static bool isValidGenericParameterKey(const std::string &value)
whether the given string is a valid key for a generic parameter
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
generic attribute
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
link: the index of the opposite direction link of a pedestrian crossing
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void updateGeometry(bool updateGrid)
update pre-computed geometry information
Definition: GNECrossing.cpp:64
static bool isValidGenericParameterValue(const std::string &value)
whether the given string is a valid value for a generic parameter
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
the edges of a route
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
std::vector< double > myShapeRotations
Definition: GNECrossing.h:162
std::vector< NBEdge * > myCrossingEdges
Crossing Edges (It works as ID because a junction can only ONE Crossing with the same edges) ...
Definition: GNECrossing.h:154
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
A list of positions.
static bool isGenericParametersValid(const std::string &value)
check if given string can be parsed to a map/list of generic parameters
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1175
friend class GNEChange_Attribute
declare friend class
bool updateGenericParameterValue(const std::string &key, const std::string &newValue)
update value generic parameter
void updateGeometry(bool updateGrid)
Update the boundary of the junction.
GUIVisualizationTextSettings drawLinkTLIndex
GNEJunction * myParentJunction
the parent junction of this crossing
Definition: GNECrossing.h:151
void setParameter(const std::string &key, const std::string &value)
Sets a parameter.
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
EditMode
Definition: GNEViewNet.h:42
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
EditMode getCurrentEditMode() const
get the current edit mode
const PositionVector & getShape() const
retrieve the junction shape
Definition: NBNode.cpp:1911
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:50
static bool canParse(const std::string &string)
true if a value of type T can be parsed from string
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:263
bool checkCrossingDuplicated(EdgeVector edges)
return true if there already exist a crossing with the same edges as the input
Definition: NBNode.cpp:2172
bool updateGenericParameter(const std::string &oldKey, const std::string &newKey)
update generic parameter
#define M_PI
Definition: odrSpiral.cpp:40
static void drawShapeDottedContour(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:471
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:302
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
element is selected
The popup menu of a globject.
std::vector< std::pair< std::string, std::string > > getGenericParameters() const
return generic parameters as vector of pairs format
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
crossing between edges for pedestrians
~GNECrossing()
Destructor.
Definition: GNECrossing.cpp:60
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
GUIGlID getGlID() const
Returns the numerical id of the object.
A definition of a pedestrian crossing.
Definition: NBNode.h:125
PositionVector myShape
crossingShape
Definition: GNECrossing.h:157
link: the index of the link within the traffic light
bool isValid(SumoXMLAttr key, const std::string &value)
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
NBNode::Crossing * getNBCrossing() const
get referente to NBode::Crossing
std::vector< double > myShapeLengths
The lengths of the shape parts.
Definition: GNECrossing.h:165
mode for connecting lanes
Definition: GNEViewNet.h:56
mode for creating new edges
Definition: GNEViewNet.h:46
NBEdge * getNBEdge()
returns the internal NBEdge
Definition: GNEEdge.cpp:586
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
NBNode * getNBNode() const
Return net build node.
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1168
static PositionVector parseShapeReporting(const std::string &shpdef, const std::string &objecttype, const char *objectid, bool &ok, bool allowEmpty, bool report=true)
Builds a PositionVector from a string representation, reporting occurred errors.
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
std::string getAttribute(SumoXMLAttr key) const
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1745
void clearParameter()
Clears the parameter map.
a junction
GNEJunction * getParentJunction() const
get parent Junction
Definition: GNECrossing.cpp:98
SumoXMLTag getTag() const
get XML Tag assigned to this object