Eclipse SUMO - Simulation of Urban MObility
GNEEdge.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 road/street connecting two junctions (netedit-version, adapted from GUIEdge)
15 // Basically a container for an NBEdge with drawing and editing capabilities
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <netedit/GNENet.h>
25 #include <netedit/GNEUndoList.h>
26 #include <netedit/GNEViewNet.h>
33 #include <utils/gui/div/GLHelper.h>
36 
37 #include "GNEConnection.h"
38 #include "GNECrossing.h"
39 #include "GNEJunction.h"
40 #include "GNELane.h"
41 #include "GNEEdge.h"
42 
43 //#define DEBUG_SMOOTH_GEOM
44 //#define DEBUGCOND(obj) (true)
45 
46 // ===========================================================================
47 // static
48 // ===========================================================================
50 
51 // ===========================================================================
52 // members methods
53 // ===========================================================================
54 
55 GNEEdge::GNEEdge(GNENet* net, NBEdge* nbe, bool wasSplit, bool loaded):
56  GNENetElement(net, nbe->getID(), GLO_EDGE, SUMO_TAG_EDGE),
57  myNBEdge(nbe),
58  myGNEJunctionSource(myNet->retrieveJunction(nbe->getFromNode()->getID())),
59  myGNEJunctionDestiny(myNet->retrieveJunction(nbe->getToNode()->getID())),
60  myLanes(0),
61  myAmResponsible(false),
62  myWasSplit(wasSplit),
63  myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
64  myUpdateGeometry(true) {
65  // Create lanes
66  int numLanes = myNBEdge->getNumLanes();
67  myLanes.reserve(numLanes);
68  for (int i = 0; i < numLanes; i++) {
69  myLanes.push_back(new GNELane(this, i));
70  myLanes.back()->incRef("GNEEdge::GNEEdge");
71  }
72  // update Lane geometries
73  for (const auto& i : myLanes) {
74  i->updateGeometry();
75  }
76 }
77 
78 
80  // Delete references to this eddge in lanes
81  for (const auto& lane : myLanes) {
82  lane->decRef("GNEEdge::~GNEEdge");
83  if (lane->unreferenced()) {
84  // show extra information for tests
85  WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in GNEEdge destructor");
86  delete lane;
87  }
88  }
89  // delete references to this eddge in connections
90  for (const auto& connection : myGNEConnections) {
91  connection->decRef("GNEEdge::~GNEEdge");
92  if (connection->unreferenced()) {
93  // show extra information for tests
94  WRITE_DEBUG("Deleting unreferenced " + connection->getTagStr() + " '" + connection->getID() + "' in GNEEdge destructor");
95  delete connection;
96  }
97  }
98  if (myAmResponsible) {
99  delete myNBEdge;
100  }
101 }
102 
103 
104 std::string
106  // currently unused
107  return "";
108 }
109 
110 
111 void
113  // first check if myUpdateGeometry flag is enabled
114  if (myUpdateGeometry) {
115  // Update geometry of lanes
116  for (const auto& lane : myLanes) {
117  lane->updateGeometry();
118  }
119  // Update geometry of connections (Only if updateGrid is enabled, because in move mode connections are hidden
120  // (note: only the previous marked as deprecated will be updated)
122  for (const auto& connection : myGNEConnections) {
123  connection->updateGeometry();
124  }
125  }
126  // Update geometry of additionals children vinculated to this edge
127  for (const auto& childAdditionals : getChildAdditionals()) {
128  childAdditionals->updateGeometry();
129  }
130  // Update geometry of parent additionals that have this edge as parent
131  for (const auto& additionalParent : getParentAdditionals()) {
132  additionalParent->updateGeometry();
133  }
134  // Update partial geometry of demand elements parents that have this edge as parent
135  for (const auto& demandElementParent : getParentDemandElements()) {
136  demandElementParent->updatePartialGeometry(this);
137  }
138  // Update partial geometry of demand elements children vinculated to this edge
139  for (const auto& childDemandElements : getChildDemandElements()) {
140  childDemandElements->updatePartialGeometry(this);
141  }
142  // Update partial geometry of routes vinculated to this edge
143  for (const auto& pathElementChild : myPathElementChilds) {
144  pathElementChild->updatePartialGeometry(this);
145  }
146  }
147 }
148 
149 
150 Position
152  // currently unused
153  return Position(0, 0);
154 }
155 
156 
157 bool
160  return (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS);
161  } else {
162  return false;
163  }
164 }
165 
166 
167 bool
170  return (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS);
171  } else {
172  return false;
173  }
174 }
175 
176 
177 void
178 GNEEdge::moveShapeStart(const Position& oldPos, const Position& offset) {
179  // change shape startPosition using oldPosition and offset
180  Position shapeStartEdited = oldPos;
181  shapeStartEdited.add(offset);
182  // snap to active grid
183  shapeStartEdited = myNet->getViewNet()->snapToActiveGrid(shapeStartEdited, offset.z() == 0);
184  // make sure that start and end position are different
185  if (shapeStartEdited != myNBEdge->getGeometry().back()) {
186  // set shape start position without updating grid
187  setShapeStartPos(shapeStartEdited);
188  updateGeometry();
189  }
190 }
191 
192 
193 void
194 GNEEdge::moveShapeEnd(const Position& oldPos, const Position& offset) {
195  // change shape endPosition using oldPosition and offset
196  Position shapeEndEdited = oldPos;
197  shapeEndEdited.add(offset);
198  // snap to active grid
199  shapeEndEdited = myNet->getViewNet()->snapToActiveGrid(shapeEndEdited, offset.z() == 0);
200  // make sure that start and end position are different
201  if (shapeEndEdited != myNBEdge->getGeometry().front()) {
202  // set shape end position without updating grid
203  setShapeEndPos(shapeEndEdited);
204  updateGeometry();
205  }
206 }
207 
208 
209 void
211  // first save current shape start position
212  Position modifiedShapeStartPos = myNBEdge->getGeometry().front();
213  // restore old shape start position
214  setShapeStartPos(oldPos);
215  // end geometry moving
217  // set attribute using undolist
218  undoList->p_begin("shape start of " + getTagStr());
219  undoList->p_add(new GNEChange_Attribute(this, myNet, GNE_ATTR_SHAPE_START, toString(modifiedShapeStartPos), true, toString(oldPos)));
220  undoList->p_end();
221 }
222 
223 
224 void
226  // first save current shape end position
227  Position modifiedShapeEndPos = myNBEdge->getGeometry().back();
228  // restore old shape end position
229  setShapeEndPos(oldPos);
230  // end geometry moving
232  // set attribute using undolist
233  undoList->p_begin("shape end of " + getTagStr());
234  undoList->p_add(new GNEChange_Attribute(this, myNet, GNE_ATTR_SHAPE_END, toString(modifiedShapeEndPos), true, toString(oldPos)));
235  undoList->p_end();
236 }
237 
238 
239 void
241  // save current centering boundary
243  // Save current centering boundary of lanes (and their children)
244  for (auto i : myLanes) {
245  i->startGeometryMoving();
246  }
247  // Save current centering boundary of additionals children vinculated to this edge
248  for (auto i : getChildAdditionals()) {
249  i->startGeometryMoving();
250  }
251  // Save current centering boundary of parent additionals that have this edge as parent
252  for (auto i : getParentAdditionals()) {
253  i->startGeometryMoving();
254  }
255  // Save current centering boundary of demand elements children vinculated to this edge
256  for (auto i : getChildDemandElements()) {
257  i->startGeometryMoving();
258  }
259  // Save current centering boundary of demand elements parents that have this edge as parent
260  for (auto i : getParentDemandElements()) {
261  i->startGeometryMoving();
262  }
263 }
264 
265 
266 void
268  // check that endGeometryMoving was called only once
270  // Remove object from net
272  // reset myMovingGeometryBoundary
274  // Restore centering boundary of lanes (and their children)
275  for (auto i : myLanes) {
276  i->endGeometryMoving();
277  }
278  // Restore centering boundary of additionals children vinculated to this edge
279  for (auto i : getChildAdditionals()) {
280  i->endGeometryMoving();
281  }
282  // Restore centering boundary of parent additionals that have this edge as parent
283  for (auto i : getParentAdditionals()) {
284  i->endGeometryMoving();
285  }
286  // Restore centering boundary of demand elements children vinculated to this edge
287  for (auto i : getChildDemandElements()) {
288  i->endGeometryMoving();
289  }
290  // Restore centering boundary of demand elements parents that have this edge as parent
291  for (auto i : getParentDemandElements()) {
292  i->endGeometryMoving();
293  }
294  // add object into grid again (using the new centering boundary)
295  myNet->addGLObjectIntoGrid(this);
296  }
297 }
298 
299 
300 int
301 GNEEdge::getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid) {
302  PositionVector entireGeometry = myNBEdge->getGeometry();
303  // check if position has to be snapped to grid
304  if (snapToGrid) {
305  pos = myNet->getViewNet()->snapToActiveGrid(pos);
306  }
307  double offset = entireGeometry.nearest_offset_to_point2D(pos, true);
308  if (offset == GeomHelper::INVALID_OFFSET) {
309  return -1;
310  }
311  Position newPos = entireGeometry.positionAtOffset2D(offset);
312  // first check if vertex already exists in the inner geometry
313  for (int i = 0; i < (int)entireGeometry.size(); i++) {
314  if (entireGeometry[i].distanceTo2D(newPos) < SNAP_RADIUS) {
315  if (i == 0 || i == (int)(entireGeometry.size() - 1)) {
316  return -1;
317  }
318  // index refers to inner geometry
319  return i - 1;
320  }
321  }
322  // if vertex doesn't exist, insert it
323  if (createIfNoExist) {
324  // check if position has to be snapped to grid
325  if (snapToGrid) {
326  newPos = myNet->getViewNet()->snapToActiveGrid(newPos);
327  }
329  int index = entireGeometry.insertAtClosest(myNet->getViewNet()->snapToActiveGrid(newPos), true);
330  setGeometry(entireGeometry, false);
332  // index refers to inner geometry
333  return (index - 1);
334  } else {
335  return -1;
336  }
337 }
338 
339 
340 int
341 GNEEdge::getVertexIndex(const double offset, bool createIfNoExist, bool snapToGrid) {
342  return getVertexIndex(myNBEdge->getGeometry().positionAtOffset2D(offset), createIfNoExist, snapToGrid);
343 }
344 
345 
346 int
347 GNEEdge::moveVertexShape(const int index, const Position& oldPos, const Position& offset) {
348  // obtain inner geometry of edge
349  PositionVector edgeGeometry = myNBEdge->getInnerGeometry();
350  // Make sure that index is valid AND ins't the first and last index
351  if (index != -1) {
352  // check that index is correct before change position
353  if (index < (int)edgeGeometry.size()) {
354  // change position of vertex
355  edgeGeometry[index] = oldPos;
356  edgeGeometry[index].add(offset);
357  // filtern position using snap to active grid
358  edgeGeometry[index] = myNet->getViewNet()->snapToActiveGrid(edgeGeometry[index], offset.z() == 0);
359  // update edge's geometry without updating RTree (To avoid unnecesary changes in RTree)
360  setGeometry(edgeGeometry, true);
361  return index;
362  } else {
363  throw InvalidArgument("Index greater than shape size");
364  }
365  } else {
366  return index;
367  }
368 }
369 
370 
371 void
372 GNEEdge::moveEntireShape(const PositionVector& oldShape, const Position& offset) {
373  // make a copy of the old shape to change it
374  PositionVector modifiedShape = oldShape;
375  // change all points of the inner geometry using offset
376  for (auto& i : modifiedShape) {
377  i.add(offset);
378  }
379  // restore modified shape
380  setGeometry(modifiedShape, true);
381 }
382 
383 
384 void
386  // restore original shape into shapeToCommit
387  PositionVector innerShapeToCommit = myNBEdge->getInnerGeometry();
388  // first check if second and penultimate isn't in Junction's buubles
390  if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[0].distanceTo2D(myNBEdge->getGeometry()[1]) < buubleRadius) {
391  innerShapeToCommit.removeClosest(innerShapeToCommit[0]);
392  }
393  if (myNBEdge->getGeometry().size() > 2 && myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 2].distanceTo2D(myNBEdge->getGeometry()[(int)myNBEdge->getGeometry().size() - 1]) < buubleRadius) {
394  innerShapeToCommit.removeClosest(innerShapeToCommit[(int)innerShapeToCommit.size() - 1]);
395  }
396  // second check if double points has to be removed
397  innerShapeToCommit.removeDoublePoints(SNAP_RADIUS);
398  // show warning if some of edge's shape was merged
399  if (innerShapeToCommit.size() != myNBEdge->getInnerGeometry().size()) {
400  WRITE_WARNING("Merged shape's point")
401  }
402 
403  updateGeometry();
404  // restore old geometry to allow change attribute (And restore shape if during movement a new point was created
405  setGeometry(oldShape, true);
406  // finish geometry moving
408  // commit new shape
409  undoList->p_begin("moving " + toString(SUMO_ATTR_SHAPE) + " of " + getTagStr());
410  undoList->p_add(new GNEChange_Attribute(this, myNet, SUMO_ATTR_SHAPE, toString(innerShapeToCommit)));
411  undoList->p_end();
412 }
413 
414 
415 void
416 GNEEdge::deleteGeometryPoint(const Position& pos, bool allowUndo) {
417  // obtain index and remove point
418  PositionVector modifiedShape = myNBEdge->getInnerGeometry();
419  int index = modifiedShape.indexOfClosest(pos);
420  modifiedShape.erase(modifiedShape.begin() + index);
421  // set new shape depending of allowUndo
422  if (allowUndo) {
423  myNet->getViewNet()->getUndoList()->p_begin("delete geometry point");
426  } else {
427  // set new shape
428  setGeometry(modifiedShape, true);
429  }
430 }
431 
432 
433 void
435  Position delta = junction->getNBNode()->getPosition() - origPos;
437  // geometry endpoint need not equal junction position hence we modify it with delta
438  if (junction == myGNEJunctionSource) {
439  geom[0].add(delta);
440  } else {
441  geom[-1].add(delta);
442  }
443  setGeometry(geom, false);
444 }
445 
446 
447 Boundary
449  // Return Boundary depending if myMovingGeometryBoundary is initialised (important for move geometry)
452  } else {
453  Boundary b;
454  for (const auto& i : myLanes) {
455  b.add(i->getCenteringBoundary());
456  }
457  // ensure that geometry points are selectable even if the lane geometry is strange
458  for (const Position& pos : myNBEdge->getGeometry()) {
459  b.add(pos);
460  }
461  b.grow(10);
462  return b;
463  }
464 }
465 
466 const std::string
468  return myNBEdge->getStreetName();
469 }
470 
473  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
474  buildPopupHeader(ret, app);
477  // build selection and show parameters menu
480  // build position copy entry
481  buildPositionCopyEntry(ret, false);
482  return ret;
483 }
484 
485 
488  return myGNEJunctionSource;
489 }
490 
491 
494  return myGNEJunctionDestiny;
495 }
496 
497 
498 GNEEdge*
501 }
502 
503 
504 void
506  // check if boundary has to be drawn
507  if (s.drawBoundaries) {
509  }
510  // draw lanes
511  for (auto i : myLanes) {
512  i->drawGL(s);
513  }
514  // draw parent additionals
515  for (const auto& i : getParentAdditionals()) {
516  if (i->getTagProperty().getTag() == SUMO_TAG_REROUTER) {
517  // draw rerouter symbol
518  drawRerouterSymbol(s, i);
519  }
520  }
521  // draw child additional
522  for (const auto& i : getChildAdditionals()) {
523  i->drawGL(s);
524  }
525  // draw child edge
527  // certain demand elements children can contain loops (for example, routes) and it causes overlapping problems. It's needed to filter it before drawing
528  for (const auto& route : getChildDemandElementsSortedByType(SUMO_TAG_ROUTE)) {
529  // first check if route can be drawn
531  // draw partial route
532  drawPartialRoute(s, route, nullptr);
533  }
534  }
535  for (const auto& embeddedRoute : getChildDemandElementsSortedByType(SUMO_TAG_EMBEDDEDROUTE)) {
536  // first check if embedded route can be drawn
538  // draw partial route
539  drawPartialRoute(s, embeddedRoute, nullptr);
540  }
541  }
542  for (const auto& trip : getChildDemandElementsSortedByType(SUMO_TAG_TRIP)) {
543  // Start drawing adding an gl identificator
544  glPushName(trip->getGlID());
545  // draw partial trip only if is being inspected or selected (and we aren't in draw for selecting mode)
546  if (!s.drawForRectangleSelection && ((myNet->getViewNet()->getDottedAC() == trip) || trip->isAttributeCarrierSelected())) {
547  drawPartialTripFromTo(s, trip, nullptr);
548  }
549  // only draw trip in the first edge
550  if (trip->getAttribute(SUMO_ATTR_FROM) == getID()) {
551  trip->drawGL(s);
552  }
553  // Pop name
554  glPopName();
555  }
556  for (const auto& flow : getChildDemandElementsSortedByType(SUMO_TAG_FLOW)) {
557  // Start drawing adding an gl identificator
558  glPushName(flow->getGlID());
559  // draw partial trip only if is being inspected or selected (and we aren't in draw for selecting mode)
560  if (!s.drawForRectangleSelection && ((myNet->getViewNet()->getDottedAC() == flow) || flow->isAttributeCarrierSelected())) {
561  drawPartialTripFromTo(s, flow, nullptr);
562  }
563  // only draw flow in the first edge
564  if (flow->getAttribute(SUMO_ATTR_FROM) == getID()) {
565  flow->drawGL(s);
566  }
567  // Pop name
568  glPopName();
569  }
570  for (const auto& personTripFromTo : getChildDemandElementsSortedByType(SUMO_TAG_PERSONTRIP_FROMTO)) {
571  drawPartialPersonPlan(s, personTripFromTo, nullptr);
572  }
573  for (const auto& personTripBusStop : getChildDemandElementsSortedByType(SUMO_TAG_PERSONTRIP_BUSSTOP)) {
574  drawPartialPersonPlan(s, personTripBusStop, nullptr);
575  }
576  for (const auto& walkEdges : getChildDemandElementsSortedByType(SUMO_TAG_WALK_EDGES)) {
577  drawPartialPersonPlan(s, walkEdges, nullptr);
578  }
579  for (const auto& walkFromTo : getChildDemandElementsSortedByType(SUMO_TAG_WALK_FROMTO)) {
580  drawPartialPersonPlan(s, walkFromTo, nullptr);
581  }
582  for (const auto& walkBusStop : getChildDemandElementsSortedByType(SUMO_TAG_WALK_BUSSTOP)) {
583  drawPartialPersonPlan(s, walkBusStop, nullptr);
584  }
585  for (const auto& walkRoute : getChildDemandElementsSortedByType(SUMO_TAG_WALK_ROUTE)) {
586  drawPartialPersonPlan(s, walkRoute, nullptr);
587  }
588  for (const auto& rideFromTo : getChildDemandElementsSortedByType(SUMO_TAG_RIDE_FROMTO)) {
589  drawPartialPersonPlan(s, rideFromTo, nullptr);
590  }
591  for (const auto& rideBusStop : getChildDemandElementsSortedByType(SUMO_TAG_RIDE_BUSSTOP)) {
592  drawPartialPersonPlan(s, rideBusStop, nullptr);
593  }
594  // draw path element childs
595  for (const auto& elementChild : myPathElementChilds) {
596  if (elementChild->getTagProperty().isVehicle()) {
597  // Start drawing adding an gl identificator
598  glPushName(elementChild->getGlID());
599  // draw partial trip only if is being inspected or selected (and we aren't in draw for selecting mode)
600  if (!s.drawForRectangleSelection && ((myNet->getViewNet()->getDottedAC() == elementChild) || elementChild->isAttributeCarrierSelected())) {
601  drawPartialTripFromTo(s, elementChild, nullptr);
602  }
603  // Pop name
604  glPopName();
605  } else if (elementChild->getTagProperty().isPersonPlan()) {
606  drawPartialPersonPlan(s, elementChild, nullptr);
607  }
608  }
609  }
610  // draw geometry points if isnt's too small and
613  }
614  // draw name if isn't being drawn for selecting
615  if (!s.drawForRectangleSelection) {
616  drawEdgeName(s);
617  }
618  // draw dotted contor around the first and last lane if isn't being drawn for selecting
619  if (myNet->getViewNet()->getDottedAC() == this) {
620  const double myHalfLaneWidthFront = myNBEdge->getLaneWidth(myLanes.front()->getIndex()) / 2;
621  const double myHalfLaneWidthBack = (s.spreadSuperposed && myLanes.back()->drawAsRailway(s) && myNBEdge->isBidiRail()) ? 0 : myNBEdge->getLaneWidth(myLanes.back()->getIndex()) / 2;
622  // obtain shapes from NBEdge
623  const PositionVector& frontShape = myLanes.front()->getParentEdge()->getNBEdge()->getLaneShape(myLanes.front()->getIndex());
624  const PositionVector& backShape = myLanes.back()->getParentEdge()->getNBEdge()->getLaneShape(myLanes.back()->getIndex());
625  GLHelper::drawShapeDottedContourBetweenLanes(s, GLO_JUNCTION, frontShape, myHalfLaneWidthFront, backShape, -1 * myHalfLaneWidthBack);
626  }
627 }
628 
629 
630 NBEdge*
632  return myNBEdge;
633 }
634 
635 
636 Position
637 GNEEdge::getSplitPos(const Position& clickPos) {
638  const PositionVector& geom = myNBEdge->getGeometry();
639  int index = geom.indexOfClosest(clickPos);
640  if (geom[index].distanceTo2D(clickPos) < SNAP_RADIUS) {
641  // split at existing geometry point
642  return geom[index];
643  } else {
644  // split straight between the next two points
645  return geom.positionAtOffset(geom.nearest_offset_to_point2D(clickPos));
646  }
647 }
648 
649 
650 void
652  if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) && (myNBEdge->getGeometry().front().distanceTo2D(pos) < SNAP_RADIUS)) {
653  undoList->p_begin("remove endpoint");
654  setAttribute(GNE_ATTR_SHAPE_START, "", undoList);
655  undoList->p_end();
656  } else if ((myNBEdge->getGeometry().back() != myGNEJunctionDestiny->getPositionInView()) && (myNBEdge->getGeometry().back().distanceTo2D(pos) < SNAP_RADIUS)) {
657  undoList->p_begin("remove endpoint");
658  setAttribute(GNE_ATTR_SHAPE_END, "", undoList);
659  undoList->p_end();
660  } else {
661  // we need to create new Start/End position over Edge shape, not over clicked position
663  if (offset != GeomHelper::INVALID_OFFSET) {
665  // calculate position over edge shape relative to clicked positino
666  Position newPos = geom.positionAtOffset2D(offset);
667  // snap new position to grid
668  newPos = myNet->getViewNet()->snapToActiveGrid(newPos);
669  undoList->p_begin("set endpoint");
670  int index = geom.indexOfClosest(pos);
671  // check if snap to existing geometry
672  if (geom[index].distanceTo2D(pos) < SNAP_RADIUS) {
673  pos = geom[index];
674  }
677  if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) {
678  setAttribute(GNE_ATTR_SHAPE_END, toString(newPos), undoList);
680  } else {
681  setAttribute(GNE_ATTR_SHAPE_START, toString(newPos), undoList);
683  }
684  // possibly existing inner point is no longer needed
685  if (myNBEdge->getInnerGeometry().size() > 0 && getVertexIndex(pos, false, false) != -1) {
686  deleteGeometryPoint(pos, false);
687  }
688  undoList->p_end();
689  }
690  }
691 }
692 
693 
694 void
698  if (pos.distanceTo2D(destPos) < pos.distanceTo2D(sourcePos)) {
699  setAttribute(GNE_ATTR_SHAPE_END, toString(destPos), undoList);
701  } else {
702  setAttribute(GNE_ATTR_SHAPE_START, toString(sourcePos), undoList);
704  }
705 }
706 
707 
708 void
710  // set new geometry
711  const bool lefthand = OptionsCont::getOptions().getBool("lefthand");
712  if (lefthand) {
713  geom.mirrorX();
714  myNBEdge->mirrorX();
715  }
716  myNBEdge->setGeometry(geom, inner);
717  if (lefthand) {
718  myNBEdge->mirrorX();
719  }
720  // update geometry
721  updateGeometry();
722  // invalidate junction source shape
724  // iterate over GNEJunctionSource edges and update geometry
725  for (const auto& edge : myGNEJunctionSource->getGNEIncomingEdges()) {
726  edge->updateGeometry();
727  }
728  for (const auto& edge : myGNEJunctionSource->getGNEOutgoingEdges()) {
729  edge->updateGeometry();
730  }
731  // invalidate junction destiny shape
733  // iterate over GNEJunctionDestiny edges and update geometry
734  for (const auto& edge : myGNEJunctionDestiny->getGNEIncomingEdges()) {
735  edge->updateGeometry();
736  }
737  for (const auto& edge : myGNEJunctionDestiny->getGNEOutgoingEdges()) {
738  edge->updateGeometry();
739  }
740 }
741 
742 
743 void
745  // create new and removed unused GNEConnectinos
746  const std::vector<NBEdge::Connection>& connections = myNBEdge->getConnections();
747  // create a vector to keep retrieved and created connections
748  std::vector<GNEConnection*> retrievedConnections;
749  // iterate over NBEdge::Connections of GNEEdge
750  for (auto it : connections) {
751  // retrieve existent GNEConnection, or create it
752  GNEConnection* retrievedGNEConnection = retrieveGNEConnection(it.fromLane, it.toEdge, it.toLane);
753  retrievedGNEConnection->updateLinkState();
754  retrievedConnections.push_back(retrievedGNEConnection);
755  // check if previously this GNEConnections exists, and if true, remove it from myGNEConnections
756  std::vector<GNEConnection*>::iterator retrievedExists = std::find(myGNEConnections.begin(), myGNEConnections.end(), retrievedGNEConnection);
757  if (retrievedExists != myGNEConnections.end()) {
758  myGNEConnections.erase(retrievedExists);
759  } else {
760  // include reference to created GNEConnection
761  retrievedGNEConnection->incRef("GNEEdge::remakeGNEConnections");
762  }
763  // mark it as deprecated
764  retrievedGNEConnection->markConnectionGeometryDeprecated();
765  }
766  // delete non retrieved GNEConnections
767  for (auto it : myGNEConnections) {
768  // decrease reference
769  it->decRef();
770  // delete GNEConnection if is unreferenced
771  if (it->unreferenced()) {
772  // show extra information for tests
773  WRITE_DEBUG("Deleting unreferenced " + it->getTagStr() + " '" + it->getID() + "' in rebuildGNEConnections()");
774  delete it;
775  }
776  }
777  // copy retrieved (existent and created) GNECrossigns to myGNEConnections
778  myGNEConnections = retrievedConnections;
779 }
780 
781 
782 void
784  // Drop all existents connections that aren't referenced anymore
785  for (auto i : myGNEConnections) {
786  // check if connection is selected
787  if (i->isAttributeCarrierSelected()) {
788  i->unselectAttributeCarrier();
789  }
790  // Dec reference of connection
791  i->decRef("GNEEdge::clearGNEConnections");
792  // Delete GNEConnectionToErase if is unreferenced
793  if (i->unreferenced()) {
794  // show extra information for tests
795  WRITE_DEBUG("Deleting unreferenced " + i->getTagStr() + " '" + i->getID() + "' in clearGNEConnections()");
796  delete i;
797  }
798  }
799  myGNEConnections.clear();
800 }
801 
802 
803 int
805  std::vector<GNEAdditional*> routeProbes;
806  for (auto i : getChildAdditionals()) {
807  if (i->getTagProperty().getTag() == routeProbe->getTagProperty().getTag()) {
808  routeProbes.push_back(i);
809  }
810  }
811  // return index of routeProbe in routeProbes vector
812  auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe);
813  if (it == routeProbes.end()) {
814  return -1;
815  } else {
816  return (int)(it - routeProbes.begin());
817  }
818 }
819 
820 
821 std::vector<GNECrossing*>
823  std::vector<GNECrossing*> crossings;
824  for (auto i : myGNEJunctionSource->getGNECrossings()) {
825  if (i->checkEdgeBelong(this)) {
826  crossings.push_back(i);
827  }
828  }
829  for (auto i : myGNEJunctionDestiny->getGNECrossings()) {
830  if (i->checkEdgeBelong(this)) {
831  crossings.push_back(i);
832  }
833  }
834  return crossings;
835 }
836 
837 
838 void
840  // begin undo list
841  undoList->p_begin("copy template");
842  // copy edge-specific attributes
847  // copy raw values for lane-specific attributes
851  // copy lane attributes as well
852  for (int i = 0; i < (int)myLanes.size(); i++) {
853  myLanes[i]->setAttribute(SUMO_ATTR_ALLOW, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ALLOW), undoList);
854  myLanes[i]->setAttribute(SUMO_ATTR_SPEED, tpl->myLanes[i]->getAttribute(SUMO_ATTR_SPEED), undoList);
855  myLanes[i]->setAttribute(SUMO_ATTR_WIDTH, tpl->myLanes[i]->getAttribute(SUMO_ATTR_WIDTH), undoList);
856  myLanes[i]->setAttribute(SUMO_ATTR_ENDOFFSET, tpl->myLanes[i]->getAttribute(SUMO_ATTR_ENDOFFSET), undoList);
857  }
858  // end undo list
859  undoList->p_end();
860 }
861 
862 
863 std::set<GUIGlID>
865  std::set<GUIGlID> result;
866  for (auto i : myLanes) {
867  result.insert(i->getGlID());
868  }
869  return result;
870 }
871 
872 
873 const std::vector<GNELane*>&
875  return myLanes;
876 }
877 
878 
879 const std::vector<GNEConnection*>&
881  return myGNEConnections;
882 }
883 
884 
885 bool
887  return myWasSplit;
888 }
889 
890 
891 std::string
893  switch (key) {
894  case SUMO_ATTR_ID:
895  return getMicrosimID();
896  case SUMO_ATTR_FROM:
898  case SUMO_ATTR_TO:
900  case SUMO_ATTR_NUMLANES:
901  return toString(myNBEdge->getNumLanes());
902  case SUMO_ATTR_PRIORITY:
903  return toString(myNBEdge->getPriority());
904  case SUMO_ATTR_LENGTH:
905  return toString(myNBEdge->getFinalLength());
906  case SUMO_ATTR_TYPE:
907  return myNBEdge->getTypeID();
908  case SUMO_ATTR_SHAPE:
912  case SUMO_ATTR_NAME:
913  return myNBEdge->getStreetName();
914  case SUMO_ATTR_ALLOW:
915  return (getVehicleClassNames(myNBEdge->getPermissions()) + (myNBEdge->hasLaneSpecificPermissions() ? " (combined!)" : ""));
916  case SUMO_ATTR_DISALLOW: {
918  }
919  case SUMO_ATTR_SPEED:
921  return "lane specific";
922  } else {
923  return toString(myNBEdge->getSpeed());
924  }
925  case SUMO_ATTR_WIDTH:
927  return "lane specific";
928  } else {
929  return toString(myNBEdge->getLaneWidth());
930  }
931  case SUMO_ATTR_ENDOFFSET:
933  return "lane specific";
934  } else {
935  return toString(myNBEdge->getEndOffset());
936  }
937  case SUMO_ATTR_DISTANCE:
938  return toString(myNBEdge->getDistance());
940  return myConnectionStatus;
943  return "";
944  } else {
945  return toString(myNBEdge->getGeometry().front());
946  }
947  case GNE_ATTR_SHAPE_END:
949  return "";
950  } else {
951  return toString(myNBEdge->getGeometry().back());
952  }
953  case GNE_ATTR_BIDIR:
954  return toString(myNBEdge->isBidiRail());
955  case GNE_ATTR_SELECTED:
957  case GNE_ATTR_PARAMETERS:
958  return myNBEdge->getParametersStr();
959  default:
960  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
961  }
962 }
963 
964 std::string
966  std::string result = getAttribute(key);
967  if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) {
968  result += " " + getVehicleClassNames(SVCAll, true);
969  }
970  return result;
971 }
972 
973 void
974 GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
975  switch (key) {
976  case SUMO_ATTR_WIDTH:
977  case SUMO_ATTR_ENDOFFSET:
978  case SUMO_ATTR_SPEED:
979  case SUMO_ATTR_ALLOW:
980  case SUMO_ATTR_DISALLOW: {
981  undoList->p_begin("change " + getTagStr() + " attribute");
982  const std::string origValue = myLanes.at(0)->getAttribute(key); // will have intermediate value of "lane specific"
983  // lane specific attributes need to be changed via lanes to allow undo
984  for (auto it : myLanes) {
985  it->setAttribute(key, value, undoList);
986  }
987  // ensure that the edge value is also changed. Actually this sets the lane attributes again but it does not matter
988  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value, true, origValue));
989  undoList->p_end();
990  break;
991  }
992  case SUMO_ATTR_FROM: {
993  undoList->p_begin("change " + getTagStr() + " attribute");
994  // Remove edge from crossings of junction source
996  // continue changing from junction
997  GNEJunction* oldGNEJunctionSource = myGNEJunctionSource;
998  myGNEJunctionSource->setLogicValid(false, undoList);
999  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
1000  myGNEJunctionSource->setLogicValid(false, undoList);
1001  myNet->retrieveJunction(value)->setLogicValid(false, undoList);
1004  undoList->p_end();
1005  // update geometries of all implicated junctions
1006  oldGNEJunctionSource->updateGeometry();
1009  break;
1010  }
1011  case SUMO_ATTR_TO: {
1012  undoList->p_begin("change " + getTagStr() + " attribute");
1013  // Remove edge from crossings of junction destiny
1015  // continue changing destiny junction
1016  GNEJunction* oldGNEJunctionDestiny = myGNEJunctionDestiny;
1017  myGNEJunctionDestiny->setLogicValid(false, undoList);
1018  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
1019  myGNEJunctionDestiny->setLogicValid(false, undoList);
1020  myNet->retrieveJunction(value)->setLogicValid(false, undoList);
1023  undoList->p_end();
1024  // update geometries of all implicated junctions
1025  oldGNEJunctionDestiny->updateGeometry();
1028  break;
1029  }
1030  case SUMO_ATTR_ID:
1031  case SUMO_ATTR_PRIORITY:
1032  case SUMO_ATTR_LENGTH:
1033  case SUMO_ATTR_TYPE:
1034  case SUMO_ATTR_SPREADTYPE:
1035  case SUMO_ATTR_DISTANCE:
1037  case GNE_ATTR_SHAPE_START:
1038  case GNE_ATTR_SHAPE_END:
1039  case GNE_ATTR_SELECTED:
1040  case GNE_ATTR_PARAMETERS:
1041  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
1042  break;
1043  case SUMO_ATTR_NAME:
1044  // user cares about street names. Make sure they appear in the output
1046  OptionsCont::getOptions().set("output.street-names", "true");
1047  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
1048  break;
1049  case SUMO_ATTR_NUMLANES:
1050  if (value != getAttribute(key)) {
1051  // Remove edge from crossings of junction source
1053  // Remove edge from crossings of junction destiny
1055  // set num lanes
1056  setNumLanes(parse<int>(value), undoList);
1057  }
1058  break;
1059  case SUMO_ATTR_SHAPE:
1060  // @note: assumes value of inner geometry!
1061  // actually the geometry is already updated (incrementally
1062  // during mouse movement). We set the restore point to the end
1063  // of the last change-set
1064  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
1065  break;
1066  case GNE_ATTR_BIDIR:
1067  throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
1068  default:
1069  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1070  }
1071 }
1072 
1073 
1074 bool
1075 GNEEdge::isValid(SumoXMLAttr key, const std::string& value) {
1076  switch (key) {
1077  case SUMO_ATTR_ID:
1078  return SUMOXMLDefinitions::isValidNetID(value) && (myNet->retrieveEdge(value, false) == nullptr);
1079  case SUMO_ATTR_FROM: {
1080  // check that is a valid ID and is different of ID of junction destiny
1082  GNEJunction* junctionFrom = myNet->retrieveJunction(value, false);
1083  // check that there isn't already another edge with the same From and To Edge
1084  if ((junctionFrom != nullptr) && (myNet->retrieveEdge(junctionFrom, myGNEJunctionDestiny, false) == nullptr)) {
1085  return true;
1086  } else {
1087  return false;
1088  }
1089  } else {
1090  return false;
1091  }
1092  }
1093  case SUMO_ATTR_TO: {
1094  // check that is a valid ID and is different of ID of junction Source
1096  GNEJunction* junctionTo = myNet->retrieveJunction(value, false);
1097  // check that there isn't already another edge with the same From and To Edge
1098  if ((junctionTo != nullptr) && (myNet->retrieveEdge(myGNEJunctionSource, junctionTo, false) == nullptr)) {
1099  return true;
1100  } else {
1101  return false;
1102  }
1103  } else {
1104  return false;
1105  }
1106  }
1107  case SUMO_ATTR_SPEED:
1108  return canParse<double>(value) && (parse<double>(value) > 0);
1109  case SUMO_ATTR_NUMLANES:
1110  return canParse<int>(value) && (parse<double>(value) > 0);
1111  case SUMO_ATTR_PRIORITY:
1112  return canParse<int>(value);
1113  case SUMO_ATTR_LENGTH:
1114  return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == NBEdge::UNSPECIFIED_LOADED_LENGTH));
1115  case SUMO_ATTR_ALLOW:
1116  case SUMO_ATTR_DISALLOW:
1117  return canParseVehicleClasses(value);
1118  case SUMO_ATTR_TYPE:
1119  return true;
1120  case SUMO_ATTR_SHAPE:
1121  // empty shapes are allowed
1122  return canParse<PositionVector>(value);
1123  case SUMO_ATTR_SPREADTYPE:
1125  case SUMO_ATTR_NAME:
1126  return true;
1127  case SUMO_ATTR_WIDTH:
1128  return canParse<double>(value) && ((parse<double>(value) >= -1) || (parse<double>(value) == NBEdge::UNSPECIFIED_WIDTH));
1129  case SUMO_ATTR_ENDOFFSET:
1130  return canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) < myNBEdge->getLoadedLength();
1131  case SUMO_ATTR_DISTANCE:
1132  return canParse<double>(value);
1133  case GNE_ATTR_SHAPE_START: {
1134  if (value.empty()) {
1135  return true;
1136  } else if (canParse<Position>(value)) {
1137  Position shapeStart = parse<Position>(value);
1138  return (shapeStart != myNBEdge->getGeometry()[-1]);
1139  } else {
1140  return false;
1141  }
1142  }
1143  case GNE_ATTR_SHAPE_END: {
1144  if (value.empty()) {
1145  return true;
1146  } else if (canParse<Position>(value)) {
1147  Position shapeEnd = parse<Position>(value);
1148  return (shapeEnd != myNBEdge->getGeometry()[0]);
1149  } else {
1150  return false;
1151  }
1152  }
1153  case GNE_ATTR_BIDIR:
1154  return false;
1155  case GNE_ATTR_SELECTED:
1156  return canParse<bool>(value);
1157  case GNE_ATTR_PARAMETERS:
1158  return Parameterised::areParametersValid(value);
1159  default:
1160  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1161  }
1162 }
1163 
1164 
1165 bool
1167  switch (key) {
1168  case GNE_ATTR_BIDIR:
1169  return false;
1170  default:
1171  return true;
1172  }
1173 }
1174 
1175 
1176 void
1178  myAmResponsible = newVal;
1179 }
1180 
1181 
1182 GNELane*
1184  // iterate over all NBEdge lanes
1185  for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) {
1186  // if given VClass is in permissions, return lane
1187  if (myNBEdge->getLanes().at(i).permissions & vClass) {
1188  // return GNELane
1189  return myLanes.at(i);
1190  }
1191  }
1192  // return first lane
1193  return myLanes.front();
1194 }
1195 
1196 
1197 GNELane*
1199  // iterate over all NBEdge lanes
1200  for (int i = 0; i < (int)myNBEdge->getLanes().size(); i++) {
1201  // if given VClass isn't in permissions, return lane
1202  if (~(myNBEdge->getLanes().at(i).permissions) & vClass) {
1203  // return GNELane
1204  return myLanes.at(i);
1205  }
1206  }
1207  // return first lane
1208  return myLanes.front();
1209 }
1210 
1211 
1212 void
1213 GNEEdge::drawPartialRoute(const GUIVisualizationSettings& s, const GNEDemandElement* route, const GNEJunction* junction) const {
1214  // calculate route width
1215  double routeWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.route;
1216  // obtain color
1217  RGBColor routeColor;
1218  if (route->drawUsingSelectColor()) {
1219  routeColor = s.colorSettings.selectedRouteColor;
1220  } else {
1221  routeColor = route->getColor();
1222  }
1223  // Start drawing adding an gl identificator
1224  glPushName(route->getGlID());
1225  // Add a draw matrix
1226  glPushMatrix();
1227  // Start with the drawing of the area traslating matrix to origin
1228  glTranslated(0, 0, route->getType());
1229  // draw route
1230  if (junction) {
1231  // iterate over segments
1232  for (const auto& segment : route->getDemandElementSegmentGeometry()) {
1233  // draw partial segment
1234  if ((segment.junction == junction) && (segment.AC == route)) {
1235  // Set route color (needed due drawShapeDottedContour)
1236  GLHelper::setColor(routeColor);
1237  // draw box lines
1238  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth);
1239  // check if shape dotted contour has to be drawn
1240  if (myNet->getViewNet()->getDottedAC() == route) {
1241  GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth);
1242  }
1243  }
1244  }
1245  } else {
1246  // iterate over segments
1247  for (const auto& segment : route->getDemandElementSegmentGeometry()) {
1248  // draw partial segment
1249  if ((segment.edge == this) && (segment.AC == route)) {
1250  // Set route color (needed due drawShapeDottedContour)
1251  GLHelper::setColor(routeColor);
1252  // draw box lines
1253  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, routeWidth);
1254  // check if shape dotted contour has to be drawn
1255  if (myNet->getViewNet()->getDottedAC() == route) {
1256  GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), routeWidth);
1257  }
1258  }
1259  }
1260  }
1261  // Pop last matrix
1262  glPopMatrix();
1263  // Draw name if isn't being drawn for selecting
1264  if (!s.drawForRectangleSelection) {
1265  drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
1266  }
1267  // Pop name
1268  glPopName();
1269  // draw route children
1270  for (const auto& i : route->getChildDemandElements()) {
1271  if (i->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) {
1272  drawPartialPersonPlan(s, i, junction);
1273  } else {
1274  i->drawGL(s);
1275  }
1276  }
1277  // special case for embedded routes
1278  if ((route->getTagProperty().getTag() == SUMO_TAG_EMBEDDEDROUTE) && (route->getParentDemandElements().size() > 0) && (route->getParentEdges().front() == this)) {
1279  // draw vehicle parent
1280  route->getParentDemandElements().at(0)->drawGL(s);
1281  }
1282 }
1283 
1284 
1285 void
1286 GNEEdge::drawPartialTripFromTo(const GUIVisualizationSettings& s, const GNEDemandElement* tripOrFromTo, const GNEJunction* junction) const {
1287  // calculate tripOrFromTo width
1288  double tripOrFromToWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.trip;
1289  // Add a draw matrix
1290  glPushMatrix();
1291  // Start with the drawing of the area traslating matrix to origin
1292  glTranslated(0, 0, tripOrFromTo->getType());
1293  // Set color of the base
1294  if (tripOrFromTo->drawUsingSelectColor()) {
1296  } else {
1298  }
1299  // draw trip from to
1300  if (junction) {
1301  // iterate over segments
1302  for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) {
1303  // draw partial segment
1304  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth);
1305  }
1306  } else {
1307  // iterate over segments
1308  for (const auto& segment : tripOrFromTo->getDemandElementSegmentGeometry()) {
1309  // draw partial segment
1310  if ((segment.edge == this) && (segment.AC == tripOrFromTo)) {
1311  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, tripOrFromToWidth);
1312  }
1313  }
1314  }
1315  // Pop last matrix
1316  glPopMatrix();
1317  // Draw name if isn't being drawn for selecting
1318  if (!s.drawForRectangleSelection) {
1319  drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
1320  }
1321  // Pop name
1322  glPopName();
1323 }
1324 
1325 
1326 void
1327 GNEEdge::drawPartialPersonPlan(const GUIVisualizationSettings& s, const GNEDemandElement* personPlan, const GNEJunction* junction) const {
1328  // declare flag to enable or disable draw person plan
1329  bool drawPersonPlan = false;
1331  drawPersonPlan = true;
1332  } else if (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) {
1333  drawPersonPlan = true;
1334  } else if (myNet->getViewNet()->getDemandViewOptions().getLockedPerson() == personPlan->getParentDemandElements().front()) {
1335  drawPersonPlan = true;
1338  drawPersonPlan = true;
1339  }
1340  // check if draw person plan elements can be drawn
1341  if (drawPersonPlan) {
1342  // calculate personPlan width
1343  double personPlanWidth = 0;
1344  // flag to check if width must be duplicated
1345  bool duplicateWidth = (myNet->getViewNet()->getDottedAC() == personPlan) || (myNet->getViewNet()->getDottedAC() == personPlan->getParentDemandElements().front()) ? true : false;
1346  // Set width depending of person plan type
1347  if (personPlan->getTagProperty().isPersonTrip()) {
1348  personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.personTrip;
1349  } else if (personPlan->getTagProperty().isWalk()) {
1350  personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.walk;
1351  } else if (personPlan->getTagProperty().isRide()) {
1352  personPlanWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.ride;
1353  }
1354  // check if width has to be duplicated
1355  if (duplicateWidth) {
1356  personPlanWidth *= 2;
1357  }
1358  // set personPlan color
1359  RGBColor personPlanColor;
1360  // Set color depending of person plan type
1361  if (personPlan->drawUsingSelectColor()) {
1362  personPlanColor = s.colorSettings.selectedPersonPlanColor;
1363  } else if (personPlan->getTagProperty().isPersonTrip()) {
1364  personPlanColor = s.colorSettings.personTrip;
1365  } else if (personPlan->getTagProperty().isWalk()) {
1366  personPlanColor = s.colorSettings.walk;
1367  } else if (personPlan->getTagProperty().isRide()) {
1368  personPlanColor = s.colorSettings.ride;
1369  }
1370  // Start drawing adding an gl identificator
1371  glPushName(personPlan->getGlID());
1372  // Add a draw matrix
1373  glPushMatrix();
1374  // Start with the drawing of the area traslating matrix to origin
1375  glTranslated(0, 0, personPlan->getType());
1376  // draw person plan
1377  if (junction) {
1378  // iterate over segments
1379  for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) {
1380  // draw partial segment
1381  if ((segment.junction == junction) && (segment.AC == personPlan)) {
1382  // Set person plan color (needed due drawShapeDottedContour)
1383  GLHelper::setColor(personPlanColor);
1384  // draw box line
1385  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth);
1386  // check if shape dotted contour has to be drawn
1387  if (myNet->getViewNet()->getDottedAC() == personPlan) {
1388  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth);
1389  }
1390  }
1391  }
1392  } else {
1393  // iterate over segments
1394  for (const auto& segment : personPlan->getDemandElementSegmentGeometry()) {
1395  // draw partial segment
1396  if ((segment.edge == this) && (segment.AC == personPlan)) {
1397  // Set person plan color (needed due drawShapeDottedContour)
1398  GLHelper::setColor(personPlanColor);
1399  // draw box line
1400  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth);
1401  // check if shape dotted contour has to be drawn
1402  if (myNet->getViewNet()->getDottedAC() == personPlan) {
1403  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, personPlanWidth);
1404  }
1405  }
1406  }
1407  }
1408  // Pop last matrix
1409  glPopMatrix();
1410  // Draw name if isn't being drawn for selecting
1411  if (!s.drawForRectangleSelection) {
1412  drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
1413  }
1414  // Pop name
1415  glPopName();
1416  // check if person plan ArrivalPos attribute
1417  if (personPlan->getTagProperty().hasAttribute(SUMO_ATTR_ARRIVALPOS)) {
1418  // obtain arrival position using last segment
1419  const Position& arrivalPos = personPlan->getDemandElementSegmentGeometry().getLastPosition();
1420  // only draw arrival position point if isn't -1
1421  if (arrivalPos != Position::INVALID) {
1422  // obtain circle width
1423  const double circleWidth = (duplicateWidth ? SNAP_RADIUS : (SNAP_RADIUS / 2.0)) * MIN2((double)0.5, s.laneWidthExaggeration);
1424  const double circleWidthSquared = circleWidth * circleWidth;
1425  if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(arrivalPos) <= (circleWidthSquared + 2))) {
1426  glPushMatrix();
1427  // translate to pos and move to upper using GLO_PERSONTRIP (to avoid overlapping)
1428  glTranslated(arrivalPos.x(), arrivalPos.y(), GLO_PERSONTRIP + 0.01);
1429  // Set color depending of person plan type
1430  if (personPlan->drawUsingSelectColor()) {
1432  } else if (personPlan->getTagProperty().isPersonTrip()) {
1434  } else if (personPlan->getTagProperty().isWalk()) {
1436  } else if (personPlan->getTagProperty().isRide()) {
1438  }
1439  // resolution of drawn circle depending of the zoom (To improve smothness)
1441  glPopMatrix();
1442  }
1443  }
1444  }
1445  // draw personPlan children
1446  for (const auto& i : personPlan->getChildDemandElements()) {
1447  i->drawGL(s);
1448  }
1449  }
1450  // draw person if this edge correspond to the first edge of first Person's person plan
1451  GNEEdge* firstEdge = nullptr;
1452  const GNEDemandElement* firstPersonPlan = personPlan->getParentDemandElements().front()->getChildDemandElements().front();
1453  if (firstPersonPlan->getTagProperty().isPersonStop()) {
1454  if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_PERSONSTOP_LANE) {
1455  // obtain edge of parent lane
1456  firstEdge = firstPersonPlan->getParentLanes().front()->getParentEdge();
1457  } else {
1458  // obtain edge of busstop's parent lane
1459  firstEdge = firstPersonPlan->getParentAdditionals().front()->getParentLanes().front()->getParentEdge();
1460  }
1461  } else if (firstPersonPlan->getTagProperty().getTag() == SUMO_TAG_WALK_ROUTE) {
1462  // obtain first rute edge
1463  firstEdge = firstPersonPlan->getParentDemandElements().at(1)->getParentEdges().front();
1464  } else {
1465  // obtain first parent edge
1466  firstEdge = firstPersonPlan->getParentEdges().front();
1467  }
1468  // draw person parent if this is the edge first edge and this is the first plan
1469  if ((firstEdge == this) && (firstPersonPlan == personPlan)) {
1470  personPlan->getParentDemandElements().front()->drawGL(s);
1471  }
1472 }
1473 
1474 
1475 void
1477  // avoid insert duplicatd path element childs
1478  if (std::find(myPathElementChilds.begin(), myPathElementChilds.end(), pathElementChild) == myPathElementChilds.end()) {
1479  myPathElementChilds.push_back(pathElementChild);
1480  }
1481 }
1482 
1483 
1484 void
1486  // search and remove pathElementChild
1487  auto it = std::find(myPathElementChilds.begin(), myPathElementChilds.end(), pathElementChild);
1488  if (it != myPathElementChilds.end()) {
1489  myPathElementChilds.erase(it);
1490  }
1491 }
1492 
1493 
1494 void
1496  // make a copy of myPathElementChilds
1497  auto copyOfMyPathElementChilds = myPathElementChilds;
1498  for (const auto& pathElementChild : copyOfMyPathElementChilds) {
1499  pathElementChild->invalidatePath();
1500  }
1501 }
1502 
1503 // ===========================================================================
1504 // private
1505 // ===========================================================================
1506 
1507 void
1508 GNEEdge::setAttribute(SumoXMLAttr key, const std::string& value) {
1509  switch (key) {
1510  case SUMO_ATTR_ID:
1511  myNet->renameEdge(this, value);
1512  break;
1513  case SUMO_ATTR_FROM:
1515  // update this edge of list of outgoings edges of the old GNEJunctionSource
1517  // update GNEJunctionSource
1519  // update this edge of list of outgoings edges of the new GNEJunctionSource
1521  break;
1522  case SUMO_ATTR_TO:
1524  // update this edge of list of incomings edges of the old GNEJunctionDestiny
1526  // update GNEJunctionDestiny
1528  // update this edge of list of incomings edges of the new GNEJunctionDestiny
1530  break;
1531  case SUMO_ATTR_NUMLANES:
1532  throw InvalidArgument("GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen");
1533  break;
1534  case SUMO_ATTR_PRIORITY:
1535  myNBEdge->myPriority = parse<int>(value);
1536  break;
1537  case SUMO_ATTR_LENGTH:
1538  myNBEdge->setLoadedLength(parse<double>(value));
1539  break;
1540  case SUMO_ATTR_TYPE:
1541  myNBEdge->myType = value;
1542  break;
1543  case SUMO_ATTR_SHAPE:
1544  // start geometry moving (because a new shape affect all child edges)
1546  // set new geometry
1547  setGeometry(parse<PositionVector>(value), true);
1548  // start geometry moving (because a new shape affect all child edges)
1550  break;
1551  case SUMO_ATTR_SPREADTYPE:
1553  break;
1554  case SUMO_ATTR_NAME:
1555  myNBEdge->setStreetName(value);
1556  break;
1557  case SUMO_ATTR_SPEED:
1558  myNBEdge->setSpeed(-1, parse<double>(value));
1559  break;
1560  case SUMO_ATTR_WIDTH:
1561  myNBEdge->setLaneWidth(-1, parse<double>(value));
1562  break;
1563  case SUMO_ATTR_ENDOFFSET:
1564  myNBEdge->setEndOffset(-1, parse<double>(value));
1565  break;
1566  case SUMO_ATTR_ALLOW:
1567  break; // no edge value
1568  case SUMO_ATTR_DISALLOW:
1569  break; // no edge value
1570  case SUMO_ATTR_DISTANCE:
1571  myNBEdge->setDistance(parse<double>(value));
1572  break;
1574  myConnectionStatus = value;
1575  if (value == FEATURE_GUESSED) {
1576  WRITE_DEBUG("invalidating (removing) connections of edge '" + getID() + "' due it were guessed");
1579  } else if (value != FEATURE_GUESSED) {
1580  WRITE_DEBUG("declaring connections of edge '" + getID() + "' as loaded (It will not be removed)");
1582  }
1583  break;
1584  case GNE_ATTR_SHAPE_START: {
1585  // get geometry of NBEdge, remove FIRST element with the new value (or with the Junction Source position) and set it back to edge
1586  Position newShapeStart;
1587  if (value == "") {
1588  newShapeStart = myGNEJunctionSource->getPositionInView();
1589  } else {
1590  newShapeStart = parse<Position>(value);
1591  }
1592  // start geometry moving (because a new shape affect all child edges)
1594  // set shape start position
1595  setShapeStartPos(newShapeStart);
1596  // end geometry moving
1598  break;
1599  }
1600  case GNE_ATTR_SHAPE_END: {
1601  // get geometry of NBEdge, remove LAST element with the new value (or with the Junction Destiny position) and set it back to edge
1602  Position newShapeEnd;
1603  if (value == "") {
1604  newShapeEnd = myGNEJunctionDestiny->getPositionInView();
1605  } else {
1606  newShapeEnd = parse<Position>(value);
1607  }
1608  // start geometry moving (because a new shape affect all child edges)
1610  // set shape end position
1611  setShapeEndPos(newShapeEnd);
1612  // end geometry moving
1614  break;
1615  }
1616  case GNE_ATTR_BIDIR:
1617  throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
1618  case GNE_ATTR_SELECTED:
1619  if (parse<bool>(value)) {
1621  } else {
1623  }
1624  break;
1625  case GNE_ATTR_PARAMETERS:
1626  myNBEdge->setParametersStr(value);
1627  break;
1628  default:
1629  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1630  }
1631 }
1632 
1633 
1634 void
1635 GNEEdge::setNumLanes(int numLanes, GNEUndoList* undoList) {
1636  // begin undo list
1637  undoList->p_begin("change number of " + toString(SUMO_TAG_LANE) + "s");
1638  // invalidate logic of source/destiny edges
1639  myGNEJunctionSource->setLogicValid(false, undoList);
1640  myGNEJunctionDestiny->setLogicValid(false, undoList);
1641  // disable update geometry (see #6336)
1642  myUpdateGeometry = false;
1643  // remove edge of RTREE
1645  const int oldNumLanes = (int)myLanes.size();
1646  for (int i = oldNumLanes; i < numLanes; i++) {
1647  // since the GNELane does not exist yet, it cannot have yet been referenced so we only pass a zero-pointer
1648  undoList->add(new GNEChange_Lane(this, nullptr, myNBEdge->getLaneStruct(oldNumLanes - 1), true), true);
1649  }
1650  for (int i = (oldNumLanes - 1); i > (numLanes - 1); i--) {
1651  // delete leftmost lane
1652  undoList->add(new GNEChange_Lane(this, myLanes[i], myNBEdge->getLaneStruct(i), false), true);
1653  }
1654  // enable updateGeometry again
1655  myUpdateGeometry = true;
1656  // insert edge in RTREE again
1657  myNet->addGLObjectIntoGrid(this);
1658  // update geometry of entire edge
1659  updateGeometry();
1660  // end undo list
1661  undoList->p_end();
1662 }
1663 
1664 
1665 void
1666 GNEEdge::addLane(GNELane* lane, const NBEdge::Lane& laneAttrs, bool recomputeConnections) {
1667  // boundary of edge depends of number of lanes. We need to extract if before add or remove lane
1668  if (myUpdateGeometry) {
1670  }
1671  const int index = lane ? lane->getIndex() : myNBEdge->getNumLanes();
1672  // the laneStruct must be created first to ensure we have some geometry
1673  // unless the connections are fully recomputed, existing indices must be shifted
1674  myNBEdge->addLane(index, true, recomputeConnections, !recomputeConnections);
1675  if (lane) {
1676  // restore a previously deleted lane
1677  myLanes.insert(myLanes.begin() + index, lane);
1678 
1679  } else {
1680  // create a new lane by copying leftmost lane
1681  lane = new GNELane(this, index);
1682  myLanes.push_back(lane);
1683  }
1684  lane->incRef("GNEEdge::addLane");
1685  // check if lane is selected
1686  if (lane->isAttributeCarrierSelected()) {
1687  lane->selectAttributeCarrier();
1688  }
1689  // we copy all attributes except shape since this is recomputed from edge shape
1690  myNBEdge->setSpeed(lane->getIndex(), laneAttrs.speed);
1691  myNBEdge->setPermissions(laneAttrs.permissions, lane->getIndex());
1692  myNBEdge->setPreferredVehicleClass(laneAttrs.preferred, lane->getIndex());
1693  myNBEdge->setEndOffset(lane->getIndex(), laneAttrs.endOffset);
1694  myNBEdge->setLaneWidth(lane->getIndex(), laneAttrs.width);
1695  // udate indices
1696  for (int i = 0; i < (int)myLanes.size(); ++i) {
1697  myLanes[i]->setIndex(i);
1698  }
1699  /* while technically correct, this looks ugly
1700  myGNEJunctionSource->invalidateShape();
1701  myGNEJunctionDestiny->invalidateShape();
1702  */
1703  // Remake connections for this edge and all edges that target this lane
1705  // remake connections of all edges of junction source and destiny
1706  for (auto i : myGNEJunctionSource->getGNEEdges()) {
1707  i->remakeGNEConnections();
1708  }
1709  // remake connections of all edges of junction source and destiny
1710  for (auto i : myGNEJunctionDestiny->getGNEEdges()) {
1711  i->remakeGNEConnections();
1712  }
1713  // add object again
1714  if (myUpdateGeometry) {
1715  myNet->addGLObjectIntoGrid(this);
1716  }
1717  // Update geometry with the new lane
1718  updateGeometry();
1719 }
1720 
1721 
1722 void
1723 GNEEdge::removeLane(GNELane* lane, bool recomputeConnections) {
1724  // boundary of edge depends of number of lanes. We need to extract if before add or remove lane
1725  if (myUpdateGeometry) {
1727  }
1728  if (myLanes.size() == 0) {
1729  throw ProcessError("Should not remove the last " + toString(SUMO_TAG_LANE) + " from an " + getTagStr());
1730  }
1731  if (lane == nullptr) {
1732  lane = myLanes.back();
1733  }
1734  // check if lane is selected
1735  if (lane->isAttributeCarrierSelected()) {
1736  lane->unselectAttributeCarrier();
1737  }
1738  // Delete lane of edge's container
1739  // unless the connections are fully recomputed, existing indices must be shifted
1740  myNBEdge->deleteLane(lane->getIndex(), recomputeConnections, !recomputeConnections);
1741  lane->decRef("GNEEdge::removeLane");
1742  myLanes.erase(myLanes.begin() + lane->getIndex());
1743  // Delete lane if is unreferenced
1744  if (lane->unreferenced()) {
1745  // show extra information for tests
1746  WRITE_DEBUG("Deleting unreferenced " + lane->getTagStr() + " '" + lane->getID() + "' in removeLane()");
1747  delete lane;
1748  }
1749  // udate indices
1750  for (int i = 0; i < (int)myLanes.size(); ++i) {
1751  myLanes[i]->setIndex(i);
1752  }
1753  /* while technically correct, this looks ugly
1754  myGNEJunctionSource->invalidateShape();
1755  myGNEJunctionDestiny->invalidateShape();
1756  */
1757  // Remake connections of this edge
1759  // remake connections of all edges of junction source and destiny
1760  for (auto i : myGNEJunctionSource->getGNEEdges()) {
1761  i->remakeGNEConnections();
1762  }
1763  // remake connections of all edges of junction source and destiny
1764  for (auto i : myGNEJunctionDestiny->getGNEEdges()) {
1765  i->remakeGNEConnections();
1766  }
1767  // add object again
1768  if (myUpdateGeometry) {
1769  myNet->addGLObjectIntoGrid(this);
1770  }
1771  // Update element
1772  updateGeometry();
1773 }
1774 
1775 
1776 void
1777 GNEEdge::addConnection(NBEdge::Connection nbCon, bool selectAfterCreation) {
1778  // If a new connection was sucesfully created
1779  if (myNBEdge->setConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, NBEdge::L2L_USER, true, nbCon.mayDefinitelyPass,
1780  nbCon.keepClear, nbCon.contPos, nbCon.visibility,
1781  nbCon.speed, nbCon.customShape, nbCon.uncontrolled)) {
1782  // Create or retrieve existent GNEConection
1783  GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane);
1784  // add it to GNEConnection container
1785  myGNEConnections.push_back(con);
1786  // Add reference
1787  myGNEConnections.back()->incRef("GNEEdge::addConnection");
1788  // select GNEConnection if needed
1789  if (selectAfterCreation) {
1790  con->selectAttributeCarrier();
1791  }
1792  // update geometry
1793  con->updateGeometry();
1794  // iterate over all additionals from "from" lane and check E2 multilane integrity
1795  for (auto i : con->getLaneFrom()->getChildAdditionals()) {
1796  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1797  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1798  }
1799  }
1800  // iterate over all additionals from "to" lane and check E2 multilane integrity
1801  for (auto i : con->getLaneTo()->getChildAdditionals()) {
1802  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1803  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1804  }
1805  }
1806  }
1807  // actually we only do this to force a redraw
1808  updateGeometry();
1809 }
1810 
1811 
1812 void
1814  // check if is a explicit turnaround
1815  if (nbCon.toEdge == myNBEdge->getTurnDestination()) {
1817  }
1818  // remove NBEdge::connection from NBEdge
1820  // remove their associated GNEConnection
1821  GNEConnection* con = retrieveGNEConnection(nbCon.fromLane, nbCon.toEdge, nbCon.toLane, false);
1822  if (con != nullptr) {
1823  con->decRef("GNEEdge::removeConnection");
1824  myGNEConnections.erase(std::find(myGNEConnections.begin(), myGNEConnections.end(), con));
1825  // iterate over all additionals from "from" lane and check E2 multilane integrity
1826  for (auto i : con->getLaneFrom()->getChildAdditionals()) {
1827  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1828  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1829  }
1830  }
1831  // iterate over all additionals from "to" lane and check E2 multilane integrity
1832  for (auto i : con->getLaneTo()->getChildAdditionals()) {
1833  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1834  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1835  }
1836  }
1837  // check if connection is selected
1838  if (con->isAttributeCarrierSelected()) {
1839  con->unselectAttributeCarrier();
1840  }
1841  if (con->unreferenced()) {
1842  // show extra information for tests
1843  WRITE_DEBUG("Deleting unreferenced " + con->getTagStr() + " '" + con->getID() + "' in removeConnection()");
1844  delete con;
1845  // actually we only do this to force a redraw
1846  updateGeometry();
1847  }
1848  }
1849 }
1850 
1851 
1853 GNEEdge::retrieveGNEConnection(int fromLane, NBEdge* to, int toLane, bool createIfNoExist) {
1854  for (auto i : myGNEConnections) {
1855  if ((i->getFromLaneIndex() == fromLane) && (i->getEdgeTo()->getNBEdge() == to) && (i->getToLaneIndex() == toLane)) {
1856  return i;
1857  }
1858  }
1859  if (createIfNoExist) {
1860  // create new connection. Will be added to the rTree on first geometry computation
1861  GNEConnection* createdConnection = new GNEConnection(myLanes[fromLane], myNet->retrieveEdge(to->getID())->getLanes()[toLane]);
1862  // show extra information for tests
1863  WRITE_DEBUG("Created " + createdConnection->getTagStr() + " '" + createdConnection->getID() + "' in retrieveGNEConnection()");
1864  // iterate over all additionals from "from" lane and check E2 multilane integrity
1865  for (auto i : createdConnection->getLaneFrom()->getChildAdditionals()) {
1866  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1867  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1868  }
1869  }
1870  // iterate over all additionals from "to" lane and check E2 multilane integrity
1871  for (auto i : createdConnection->getLaneTo()->getChildAdditionals()) {
1872  if (i->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
1873  dynamic_cast<GNEDetectorE2*>(i)->checkE2MultilaneIntegrity();
1874  }
1875  }
1876  return createdConnection;
1877  } else {
1878  return nullptr;
1879  }
1880 }
1881 
1882 
1883 
1884 void
1885 GNEEdge::setMicrosimID(const std::string& newID) {
1887  for (auto i : myLanes) {
1888  i->setMicrosimID(getNBEdge()->getLaneID(i->getIndex()));
1889  }
1890 }
1891 
1892 
1893 bool
1895  for (auto i : myLanes) {
1896  if (i->isRestricted(vclass)) {
1897  return true;
1898  }
1899  }
1900  return false;
1901 }
1902 
1903 
1904 void
1906  // Remove all crossings that contain this edge in parameter "edges"
1907  for (GNECrossing* const i : junction->getGNECrossings()) {
1908  if (i->checkEdgeBelong(this)) {
1909  myNet->deleteCrossing(i, undoList);
1910  }
1911  }
1912 }
1913 
1914 
1915 void
1917  PositionVector modifiedShape = myNBEdge->getGeometry().interpolateZ(
1919  myNBEdge->getToNode()->getPosition().z());
1920  PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
1921  setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList);
1922 }
1923 
1924 
1926 GNEEdge::smoothShape(const PositionVector& old, bool forElevation) {
1927  const OptionsCont& oc = OptionsCont::getOptions();
1928  // distinguish 3 cases:
1929  // a) if the edge has exactly 3 or 4 points, use these as control points
1930  // b) if the edge has more than 4 points, use the first 2 and the last 2 as control points
1931  // c) if the edge is straight and both nodes are geometry-like nodes, use geometry of the continuation edges as control points
1932  PositionVector init;
1933 #ifdef DEBUG_SMOOTH_GEOM
1934  if (DEBUGCOND(this)) std::cout << getID()
1935  << " forElevation=" << forElevation
1936  << " fromGeometryLike=" << myNBEdge->getFromNode()->geometryLike()
1937  << " toGeometryLike=" << myNBEdge->getToNode()->geometryLike()
1938  << " smoothShape old=" << old << "\n";
1939 #endif
1940  if (old.size() == 3 || old.size() == 4) {
1941  init = old;
1942  } else if (old.size() > 4 && !forElevation) {
1943  // for elevation, the initial segments are not useful
1944  init.push_back(old[0]);
1945  init.push_back(old[1]);
1946  init.push_back(old[-2]);
1947  init.push_back(old[-1]);
1948  } else if (myNBEdge->getFromNode()->geometryLike() && myNBEdge->getToNode()->geometryLike()) {
1949  PositionVector begShape;
1950  PositionVector endShape;
1951  const EdgeVector& incoming = myNBEdge->getFromNode()->getIncomingEdges();
1952  const EdgeVector& outgoing = myNBEdge->getToNode()->getOutgoingEdges();
1953  if (incoming.size() == 1) {
1954  begShape = incoming[0]->getGeometry();
1955  } else {
1956  assert(incoming.size() == 2);
1957  begShape = myNBEdge->isTurningDirectionAt(incoming[0]) ? incoming[1]->getGeometry() : incoming[0]->getGeometry();
1958  }
1959  if (outgoing.size() == 1) {
1960  endShape = outgoing[0]->getGeometry();
1961  } else {
1962  assert(outgoing.size() == 2);
1963  endShape = myNBEdge->isTurningDirectionAt(outgoing[0]) ? outgoing[1]->getGeometry() : outgoing[0]->getGeometry();
1964  }
1965  const double dist = MIN2(old.length2D(), MAX2(old.length2D() / 8, fabs(old[0].z() - old[-1].z()) * OptionsCont::getOptions().getFloat("geometry.max-grade") / 3));
1966  if (forElevation) {
1967  // initialize control point elevation for smooth continuation
1968  init.push_back(old[0]);
1969  init.push_back(old.positionAtOffset2D(dist));
1970  init.push_back(old.positionAtOffset2D(old.length2D() - dist));
1971  init.push_back(old[-1]);
1972  double begZ = begShape.positionAtOffset2D(MAX2(0.0, begShape.length2D() - dist)).z();
1973  double endZ = endShape.positionAtOffset2D(MIN2(begShape.length2D(), dist)).z();
1974  // continue incline
1975  init[1].setz(2 * init[0].z() - begZ);
1976  init[2].setz(2 * init[-1].z() - endZ);
1977  } else {
1978  bool ok = true;
1979  const double straightThresh = DEG2RAD(oc.getFloat("opendrive-output.straight-threshold"));
1980  init = NBNode::bezierControlPoints(begShape, endShape, false, dist, dist, ok, nullptr, straightThresh);
1981  }
1982 #ifdef DEBUG_SMOOTH_GEOM
1983  if (DEBUGCOND(this)) {
1984  std::cout << " begShape=" << begShape << " endShape=" << endShape << " forElevation=" << forElevation << " dist=" << dist << " ok=" << ok << " init=" << init << "\n";
1985  }
1986 #endif
1987  }
1988  if (init.size() == 0) {
1989  return PositionVector::EMPTY;
1990  } else {
1991  const int numPoints = MAX2(oc.getInt("junctions.internal-link-detail"),
1992  int(old.length2D() / oc.getFloat("opendrive.curve-resolution")));
1993  return init.bezier(numPoints);
1994  }
1995 }
1996 
1997 
1998 void
2000  PositionVector modifiedShape = smoothShape(myNBEdge->getGeometry(), false);
2001  if (modifiedShape.size() < 2) {
2002  WRITE_WARNING("Could not compute smooth shape for edge '" + getID() + "'");
2003  } else {
2004  PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2005  setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList);
2006  }
2007 }
2008 
2009 
2010 void
2012  PositionVector elevationBase;
2013  for (const Position& pos : myNBEdge->getGeometry()) {
2014  if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) {
2015  elevationBase.push_back(pos);
2016  }
2017  }
2018  PositionVector elevation = smoothShape(elevationBase, true);
2019  if (elevation.size() <= 2) {
2020  WRITE_WARNING("Could not compute smooth elevation for edge '" + getID() + "'");
2021  } else {
2022  PositionVector modifiedShape = myNBEdge->getGeometry();
2023  if (modifiedShape.size() < 5) {
2024  modifiedShape = modifiedShape.resample(OptionsCont::getOptions().getFloat("opendrive.curve-resolution"));
2025  }
2026  const double scale = elevation.length2D() / modifiedShape.length2D();
2027  //std::cout << " elevation=" << elevation << "\n mod1=" << modifiedShape << " scale=" << scale << "\n";
2028  double seen = 0;
2029  for (int i = 1; i < (int)modifiedShape.size(); ++i) {
2030  seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]);
2031  modifiedShape[i].setz(elevation.positionAtOffset2D(seen * scale).z());
2032  }
2033  //std::cout << " mod2=" << modifiedShape << "\n";
2034  PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2035  setAttribute(SUMO_ATTR_SHAPE, toString(innerShape), undoList);
2036  }
2037 }
2038 
2039 
2040 void
2042  // remove start position and add it the new position
2044  geom.erase(geom.begin());
2045  geom.push_front_noDoublePos(pos);
2046  // restore modified shape
2047  setGeometry(geom, false);
2048 }
2049 
2050 
2051 void
2053  // remove end position and add it the new position
2055  geom.pop_back();
2056  geom.push_back_noDoublePos(pos);
2057  // restore modified shape
2058  setGeometry(geom, false);
2059 }
2060 
2061 
2062 void
2064  // Obtain exaggeration of the draw
2065  const double exaggeration = s.addSize.getExaggeration(s, this);
2066  // obtain circle width
2067  double circleWidth = SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration);
2068  double circleWidthSquared = circleWidth * circleWidth;
2069  // obtain color
2070  RGBColor color = s.junctionColorer.getSchemes()[0].getColor(2);
2071  if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) {
2072  // override with special colors (unless the color scheme is based on selection)
2074  }
2075  GLHelper::setColor(color);
2076  // recognize full transparency and simply don't draw
2077  if (color.alpha() > 0) {
2078  // push name
2079  glPushName(getGlID());
2080  // draw geometry points expect initial and final
2081  for (int i = 1; i < (int)myNBEdge->getGeometry().size() - 1; i++) {
2082  Position pos = myNBEdge->getGeometry()[i];
2083  if (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(pos) <= (circleWidthSquared + 2))) {
2084  glPushMatrix();
2085  glTranslated(pos.x(), pos.y(), GLO_JUNCTION - 0.01);
2086  // resolution of drawn circle depending of the zoom (To improve smothness)
2088  glPopMatrix();
2089  // draw elevation or special symbols (Start, End and Block)
2091  glPushMatrix();
2092  // Translate to geometry point
2093  glTranslated(pos.x(), pos.y(), GLO_JUNCTION);
2094  // draw Z value
2096  glPopMatrix();
2097  }
2098  }
2099  }
2100  // draw line geometry, start and end points if shapeStart or shape end is edited, and depending of drawForRectangleSelection
2102  if ((myNBEdge->getGeometry().front() != myGNEJunctionSource->getPositionInView()) &&
2103  (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().front()) <= (circleWidthSquared + 2)))) {
2104  glPushMatrix();
2105  glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.01);
2106  // resolution of drawn circle depending of the zoom (To improve smothness)
2108  glPopMatrix();
2109  // draw a "s" over last point depending of drawForRectangleSelection
2111  glPushMatrix();
2112  glTranslated(myNBEdge->getGeometry().front().x(), myNBEdge->getGeometry().front().y(), GLO_JUNCTION + 0.02);
2113  GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE);
2114  glPopMatrix();
2115  // draw line between Junction and point
2116  glPushMatrix();
2117  glTranslated(0, 0, GLO_JUNCTION - 0.01);
2118  glLineWidth(4);
2120  // draw line between begin point of last lane shape and the first edge shape point
2121  GLHelper::drawLine(myNBEdge->getGeometry().front(), myNBEdge->getLanes().back().shape.front());
2122  glPopMatrix();
2123  }
2124  }
2126  (!s.drawForRectangleSelection || (myNet->getViewNet()->getPositionInformation().distanceSquaredTo2D(myNBEdge->getGeometry().back()) <= (circleWidthSquared + 2)))) {
2127  glPushMatrix();
2128  glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.01);
2129  // resolution of drawn circle depending of the zoom (To improve smothness)
2131  glPopMatrix();
2132  // draw a "e" over last point depending of drawForRectangleSelection
2134  glPushMatrix();
2135  glTranslated(myNBEdge->getGeometry().back().x(), myNBEdge->getGeometry().back().y(), GLO_JUNCTION + 0.02);
2136  GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE);
2137  glPopMatrix();
2138  // draw line between Junction and point
2139  glPushMatrix();
2140  glTranslated(0, 0, GLO_JUNCTION - 0.01);
2141  glLineWidth(4);
2143  // draw line between last point of first lane shape and the last edge shape point
2144  GLHelper::drawLine(myNBEdge->getGeometry().back(), myNBEdge->getLanes().back().shape.back());
2145  glPopMatrix();
2146  }
2147  }
2148  }
2149  // pop name
2150  glPopName();
2151  }
2152 }
2153 
2154 
2155 void
2157  // draw the name and/or the street name
2158  const bool drawStreetName = s.streetName.show && (myNBEdge->getStreetName() != "");
2159  const bool spreadSuperposed = s.spreadSuperposed && myLanes.back()->drawAsRailway(s) && myNBEdge->isBidiRail();
2160  if (s.edgeName.show || drawStreetName || s.edgeValue.show) {
2161  glPushName(getGlID());
2162  GNELane* lane1 = myLanes[0];
2163  GNELane* lane2 = myLanes[myLanes.size() - 1];
2164  Position p = lane1->getLaneShape().positionAtOffset(lane1->getLaneShape().length() / (double) 2.);
2165  p.add(lane2->getLaneShape().positionAtOffset(lane2->getLaneShape().length() / (double) 2.));
2166  p.mul(.5);
2167  if (spreadSuperposed) {
2168  // move name to the right of the edge and towards its beginning
2169  const double dist = 0.6 * s.edgeName.scaledSize(s.scale);
2170  const double shiftA = lane1->getLaneShape().rotationAtOffset(lane1->getLaneShape().length() / (double) 2.) - DEG2RAD(135);
2171  Position shift(dist * cos(shiftA), dist * sin(shiftA));
2172  p.add(shift);
2173  }
2174  double angle = lane1->getLaneShape().rotationDegreeAtOffset(lane1->getLaneShape().length() / (double) 2.);
2175  angle += 90;
2176  if (angle > 90 && angle < 270) {
2177  angle -= 180;
2178  }
2179  if (s.edgeName.show) {
2180  drawName(p, s.scale, s.edgeName, angle);
2181  }
2182  if (drawStreetName) {
2184  }
2185  if (s.edgeValue.show) {
2186  const int activeScheme = s.laneColorer.getActive();
2187  std::string value;
2188  if (activeScheme == 12) {
2189  // edge param, could be non-numerical
2190  value = getNBEdge()->getParameter(s.edgeParam, "");
2191  } else if (activeScheme == 13) {
2192  // lane param, could be non-numerical
2193  value = getNBEdge()->getLaneStruct(lane2->getIndex()).getParameter(s.laneParam, "");
2194  } else {
2195  // use numerical value value of leftmost lane to hopefully avoid sidewalks, bikelanes etc
2196  const double doubleValue = lane2->getColorValue(s, activeScheme);
2197  const RGBColor color = s.laneColorer.getScheme().getColor(doubleValue);
2198  value = color.alpha() == 0 ? "" : toString(doubleValue);
2199  }
2200  if (value != "") {
2201  GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, angle);
2202  }
2203  }
2204  glPopName();
2205  }
2206 }
2207 
2208 
2209 void
2211  // Obtain exaggeration of the draw
2212  const double exaggeration = s.addSize.getExaggeration(s, rerouter);
2213  // first check if additional has to be drawn
2214  if (s.drawAdditionals(exaggeration)) {
2215  // Start drawing adding an gl identificator
2216  glPushName(rerouter->getGlID());
2217  // draw rerouter symbol over all lanes
2218  for (const auto& j : myLanes) {
2219  const Position& lanePos = rerouter->getChildPosition(j);
2220  const double laneRot = rerouter->getChildRotation(j);
2221  // draw rerouter symbol
2222  glPushMatrix();
2223  glTranslated(lanePos.x(), lanePos.y(), rerouter->getType());
2224  glRotated(-1 * laneRot, 0, 0, 1);
2225  glScaled(exaggeration, exaggeration, 1);
2226  // mode
2227  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
2228  glBegin(GL_TRIANGLES);
2229  glColor3d(1, .8f, 0);
2230  // base
2231  glVertex2d(0 - 1.4, 0);
2232  glVertex2d(0 - 1.4, 6);
2233  glVertex2d(0 + 1.4, 6);
2234  glVertex2d(0 + 1.4, 0);
2235  glVertex2d(0 - 1.4, 0);
2236  glVertex2d(0 + 1.4, 6);
2237  glEnd();
2238  // draw "U"
2239  if (!s.drawForRectangleSelection) {
2240  GLHelper::drawText("U", Position(0, 2), .1, 3, RGBColor::BLACK, 180);
2241  double probability = parse<double>(rerouter->getAttribute(SUMO_ATTR_PROB)) * 100;
2242  // draw Probability
2243  GLHelper::drawText((toString(probability) + "%").c_str(), Position(0, 4), .1, 0.7, RGBColor::BLACK, 180);
2244  }
2245  // finish draw
2246  glPopMatrix();
2247  // draw contour if is selected
2248  if (myNet->getViewNet()->getDottedAC() == rerouter) {
2249  GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.8, 6, -1 * laneRot, 0, 3);
2250  }
2251  }
2252  }
2253  // Pop name
2254  glPopName();
2255  // Draw connections
2256  rerouter->drawChildConnections(s, getType());
2257 }
2258 
2259 /****************************************************************************/
RGBColor::alpha
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition: RGBColor.h:82
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
GNEEdge::getSplitPos
Position getSplitPos(const Position &clickPos)
Definition: GNEEdge.cpp:637
SUMO_ATTR_ENDOFFSET
@ SUMO_ATTR_ENDOFFSET
Definition: SUMOXMLDefinitions.h:414
GNEJunction::BUBBLE_RADIUS
static const double BUBBLE_RADIUS
constant values for drawing buubles
Definition: GNEJunction.h:55
NBEdge::Lane::preferred
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
Definition: NBEdge.h:156
SUMO_TAG_WALK_FROMTO
@ SUMO_TAG_WALK_FROMTO
Definition: SUMOXMLDefinitions.h:307
SUMO_ATTR_TYPE
@ SUMO_ATTR_TYPE
Definition: SUMOXMLDefinitions.h:381
GNEJunction::getPositionInView
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNEJunction.cpp:122
GLO_MAX
@ GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:165
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
GNEEdge::myAmResponsible
bool myAmResponsible
whether we are responsible for deleting myNBNode
Definition: GNEEdge.h:343
OptionsCont::getInt
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
Definition: OptionsCont.cpp:215
GUIVisualizationColorSettings::selectedEdgeColor
RGBColor selectedEdgeColor
edge selection color
Definition: GUIVisualizationSettings.h:132
GNEEdge::smoothElevation
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
Definition: GNEEdge.cpp:2011
NBEdge::Connection::toEdge
NBEdge * toEdge
The edge the connections yields in.
Definition: NBEdge.h:212
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNENetElement::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:99
GNEEdge::addLane
void addLane(GNELane *lane, const NBEdge::Lane &laneAttrs, bool recomputeConnections)
increase number of lanes by one use the given attributes and restore the GNELane
Definition: GNEEdge.cpp:1666
GLHelper::drawTextSettings
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
Definition: GLHelper.cpp:706
NBEdge::Lane::speed
double speed
The speed allowed on this lane.
Definition: NBEdge.h:150
GNEDetectorE2
Definition: GNEDetectorE2.h:34
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:73
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNEReferenceCounter::unreferenced
bool unreferenced()
check if object ins't referenced
Definition: GNEReferenceCounter.h:78
GNEEdge::myConnectionStatus
std::string myConnectionStatus
modification status of the connections
Definition: GNEEdge.h:349
Parameterised::getParametersStr
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Definition: Parameterised.cpp:112
GNEEdge::copyTemplate
void copyTemplate(GNEEdge *tpl, GNEUndoList *undolist)
copy edge attributes from tpl
Definition: GNEEdge.cpp:839
GUIVisualizationSettings::edgeParam
std::string edgeParam
key for coloring by edge parameter
Definition: GUIVisualizationSettings.h:482
GNEEdge::myGNEJunctionSource
GNEJunction * myGNEJunctionSource
pointer to GNEJunction source
Definition: GNEEdge.h:331
GNEConnection::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEConnection.cpp:85
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1289
SUMO_ATTR_DISALLOW
@ SUMO_ATTR_DISALLOW
Definition: SUMOXMLDefinitions.h:783
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
GNENet::removeExplicitTurnaround
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
Definition: GNENet.cpp:2177
DEBUGCOND
#define DEBUGCOND(PEDID)
Definition: MSPModel_NonInteracting.cpp:42
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
GUIVisualizationSettings::junctionSize
GUIVisualizationSizeSettings junctionSize
Definition: GUIVisualizationSettings.h:578
GNEEdge::straightenElevation
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
Definition: GNEEdge.cpp:1916
SUMO_ATTR_LENGTH
@ SUMO_ATTR_LENGTH
Definition: SUMOXMLDefinitions.h:393
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
GNEJunction::invalidateShape
void invalidateShape()
Definition: GNEJunction.cpp:641
GNEGeometry::drawSegmentGeometry
static void drawSegmentGeometry(const GNEViewNet *viewNet, const SegmentGeometry::Segment &segment, const double width)
draw geometry segment
Definition: GNEGeometry.cpp:850
NBEdge::declareConnectionsAsLoaded
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
Definition: NBEdge.h:1301
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:354
NBEdge::mirrorX
void mirrorX()
mirror coordinates along the x-axis
Definition: NBEdge.cpp:535
GNEHierarchicalParentElements::getParentEdges
const std::vector< GNEEdge * > & getParentEdges() const
get parent edges
Definition: GNEHierarchicalParentElements.cpp:181
GNEEdge::SNAP_RADIUS
static const double SNAP_RADIUS
Definition: GNEEdge.h:273
GNEViewNetHelper::DemandViewOptions::getLockedPerson
const GNEDemandElement * getLockedPerson() const
get locked person
Definition: GNEViewNetHelper.cpp:1811
RGBColor::BLACK
static const RGBColor BLACK
Definition: RGBColor.h:197
NBEdge::Connection::uncontrolled
bool uncontrolled
check if Connection is uncontrolled
Definition: NBEdge.h:275
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:79
Position::z
double z() const
Returns the z-position.
Definition: Position.h:66
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:647
NBEdge::hasLaneSpecificSpeed
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
Definition: NBEdge.cpp:2027
Position::INVALID
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:284
OptionsCont.h
GUIVisualizationSettings::drawBoundaries
bool drawBoundaries
enable or disable draw boundaries
Definition: GUIVisualizationSettings.h:638
OptionsCont::resetWritable
void resetWritable()
Resets all options to be writeable.
Definition: OptionsCont.cpp:441
GNENet::removeGLObjectFromGrid
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1328
GNEEdge::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEEdge.cpp:505
GLO_PERSONTRIP
@ GLO_PERSONTRIP
a person trip
Definition: GUIGlObjectTypes.h:127
GNEEdge::drawPartialPersonPlan
void drawPartialPersonPlan(const GUIVisualizationSettings &s, const GNEDemandElement *personPlan, const GNEJunction *junction) const
draw partial person plan
Definition: GNEEdge.cpp:1327
GNERouteProbe.h
NBNode::bezierControlPoints
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5), int shapeFlag=0)
get bezier control points
Definition: NBNode.cpp:533
OptionsCont::set
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
Definition: OptionsCont.cpp:241
GNEEdge::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEEdge.cpp:448
GNEDemandElement::getDemandElementSegmentGeometry
const GNEGeometry::SegmentGeometry & getDemandElementSegmentGeometry() const
get demand element segment geometry
Definition: GNEDemandElement.cpp:217
GNEEdge::moveShapeStart
void moveShapeStart(const Position &oldPos, const Position &offset)
move position of shape start without commiting change
Definition: GNEEdge.cpp:178
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
GUIVisualizationWidthSettings::route
static const double route
width for routes
Definition: GUIVisualizationSettings.h:260
GNEHierarchicalChildElements::drawChildConnections
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
Definition: GNEHierarchicalChildElements.cpp:89
NBEdge::setStreetName
void setStreetName(const std::string &name)
sets the street name of this edge
Definition: NBEdge.h:605
SUMO_TAG_WALK_ROUTE
@ SUMO_TAG_WALK_ROUTE
Definition: SUMOXMLDefinitions.h:309
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:74
GNEEdge::myGNEJunctionDestiny
GNEJunction * myGNEJunctionDestiny
pointer to GNEJunction destiny
Definition: GNEEdge.h:334
EdgeVector
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
Definition: NBCont.h:34
NBEdge::Connection::contPos
double contPos
custom position for internal junction on this connection
Definition: NBEdge.h:233
GNEEdge::invalidatePathChildElementss
void invalidatePathChildElementss()
invalidate path element childs
Definition: GNEEdge.cpp:1495
GNEEdge::drawPartialTripFromTo
void drawPartialTripFromTo(const GUIVisualizationSettings &s, const GNEDemandElement *tripOrFromTo, const GNEJunction *junction) const
draw partial trip and Flow
Definition: GNEEdge.cpp:1286
GUIVisualizationSettings::widthSettings
GUIVisualizationWidthSettings widthSettings
width settings
Definition: GUIVisualizationSettings.h:680
NBEdge::isTurningDirectionAt
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
Definition: NBEdge.cpp:2756
GNEEdge::setMicrosimID
void setMicrosimID(const std::string &newID)
override to also set lane ids
Definition: GNEEdge.cpp:1885
SUMO_ATTR_NUMLANES
@ SUMO_ATTR_NUMLANES
Definition: SUMOXMLDefinitions.h:383
GNEEdge::endGeometryMoving
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
Definition: GNEEdge.cpp:267
NBNode::getOutgoingEdges
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
Definition: NBNode.h:260
GNEJunction::getGNEOutgoingEdges
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
Definition: GNEJunction.cpp:487
GNEEdge::GNEEdge
GNEEdge()
constructor for dummy edge
NBEdge::isBidiRail
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:691
SUMO_TAG_LANE
@ SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:49
GNEJunction::removeIncomingGNEEdge
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
Definition: GNEJunction.cpp:447
GNEEdge::setShapeEndPos
void setShapeEndPos(const Position &pos)
change Shape EndPos
Definition: GNEEdge.cpp:2052
GNEEdge::drawEdgeName
void drawEdgeName(const GUIVisualizationSettings &s) const
draw edge name
Definition: GNEEdge.cpp:2156
GNEEdge::clearGNEConnections
void clearGNEConnections()
clear current connections
Definition: GNEEdge.cpp:783
GUIVisualizationWidthSettings::ride
static const double ride
width for rides
Definition: GUIVisualizationSettings.h:272
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
GNEJunction::getGNECrossings
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
Definition: GNEJunction.cpp:493
GNEHierarchicalParentElements::getParentLanes
const std::vector< GNELane * > & getParentLanes() const
get parent lanes
Definition: GNEHierarchicalParentElements.cpp:235
GNEGeometry::SegmentGeometry::getLastPosition
const Position & getLastPosition() const
get first position (or Invalid position if segments are empty)
Definition: GNEGeometry.cpp:333
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
NBEdge::getPriority
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:484
GNEViewNetHelper::NetworkViewOptions::showDemandElements
bool showDemandElements() const
check if show demand elements checkbox is enabled
Definition: GNEViewNetHelper.cpp:1616
NBEdge::setDistance
void setDistance(double distance)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.h:1279
SUMO_ATTR_SPEED
@ SUMO_ATTR_SPEED
Definition: SUMOXMLDefinitions.h:384
GUIVisualizationColorSettings::selectedRouteColor
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
Definition: GUIVisualizationSettings.h:150
GNE_ATTR_SHAPE_END
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
Definition: SUMOXMLDefinitions.h:977
GNEEdge::getGNEConnections
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
Definition: GNEEdge.cpp:880
SUMO_ATTR_ARRIVALPOS
@ SUMO_ATTR_ARRIVALPOS
Definition: SUMOXMLDefinitions.h:437
GNEEdge::removeLane
void removeLane(GNELane *lane, bool recomputeConnections)
@briefdecrease the number of lanes by one. argument is only used to increase robustness (assertions)
Definition: GNEEdge.cpp:1723
SUMO_ATTR_ID
@ SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:484
GNEEdge::~GNEEdge
~GNEEdge()
Destructor.
Definition: GNEEdge.cpp:79
GNEEdge::hasRestrictedLane
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
Definition: GNEEdge.cpp:1894
GLHelper.h
NBEdge::setPermissions
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3376
NBEdge::getPermissions
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3404
GNEEdge::drawPartialRoute
void drawPartialRoute(const GUIVisualizationSettings &s, const GNEDemandElement *route, const GNEJunction *junction) const
draw partial route
Definition: GNEEdge.cpp:1213
NBEdge::setLoadedLength
void setLoadedLength(double val)
set loaded length
Definition: NBEdge.cpp:3419
NBEdge::setLaneSpreadFunction
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
Definition: NBEdge.cpp:885
GNEEdge::smooth
void smooth(GNEUndoList *undoList)
make geometry smooth
Definition: GNEEdge.cpp:1999
GNEEdge::editEndpoint
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
Definition: GNEEdge.cpp:651
GNENetElement::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNENetElement.cpp:120
NBEdge::L2L_USER
@ L2L_USER
The connection was given by the user.
Definition: NBEdge.h:133
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
NBEdge::myPriority
int myPriority
The priority of the edge.
Definition: NBEdge.h:1559
SUMO_ATTR_SPREADTYPE
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
Definition: SUMOXMLDefinitions.h:692
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
GNEConnection::getLaneFrom
GNELane * getLaneFrom() const
@briefthe get lane of the incoming lane
Definition: GNEConnection.cpp:178
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GUISUMOAbstractView::snapToActiveGrid
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
Definition: GUISUMOAbstractView.cpp:196
GNEEdge::moveShapeEnd
void moveShapeEnd(const Position &oldPos, const Position &offset)
move position of shape end without commiting change
Definition: GNEEdge.cpp:194
NBEdge::Connection::fromLane
int fromLane
The lane the connections starts at.
Definition: NBEdge.h:209
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
GNENet::deleteCrossing
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
Definition: GNENet.cpp:602
GUIVisualizationDetailSettings::geometryPointsText
static const double geometryPointsText
details for Geometry Points Texts
Definition: GUIVisualizationSettings.h:295
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
Parameterised::getParameter
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Definition: Parameterised.cpp:72
GNEJunction::updateGeometry
void updateGeometry()
update pre-computed geometry information (including crossings)
Definition: GNEJunction.cpp:109
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
GNEEdge::removeEdgeFromCrossings
void removeEdgeFromCrossings(GNEJunction *junction, GNEUndoList *undoList)
remove crossing of junction
Definition: GNEEdge.cpp:1905
GNERouteProbe
Representation of a RouteProbe in netedit.
Definition: GNERouteProbe.h:34
GNEEdge::getVertexIndex
int getVertexIndex(Position pos, bool createIfNoExist, bool snapToGrid)
return index of a vertex of shape, or of a new vertex if position is over an shape's edge
Definition: GNEEdge.cpp:301
GLHelper::drawBoundary
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
Definition: GLHelper.cpp:817
GNEJunction.h
SUMO_ATTR_TO
@ SUMO_ATTR_TO
Definition: SUMOXMLDefinitions.h:640
GUIVisualizationSettings::junctionColorer
GUIColorer junctionColorer
The junction colorer.
Definition: GUIVisualizationSettings.h:566
GNELane::getIndex
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:774
GNEEdge::commitShapeStartChange
void commitShapeStartChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape start
Definition: GNEEdge.cpp:210
GNEAttributeCarrier::TagProperties::hasAttribute
bool hasAttribute(SumoXMLAttr attr) const
check if current TagProperties owns the attribute attr
Definition: GNEAttributeCarrier.cpp:680
NBEdge::Connection::speed
double speed
custom speed for connection
Definition: NBEdge.h:239
GNEEdge::smoothShape
PositionVector smoothShape(const PositionVector &shape, bool forElevation)
return smoothed shape
Definition: GNEEdge.cpp:1926
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
GNEEdge::myNBEdge
NBEdge * myNBEdge
the underlying NBEdge
Definition: GNEEdge.h:325
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEEdge::myWasSplit
bool myWasSplit
whether this edge was created from a split
Definition: GNEEdge.h:346
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
GNEEdge::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEEdge.cpp:892
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:131
PositionVector::add
void add(double xoff, double yoff, double zoff)
Definition: PositionVector.cpp:617
NBEdge::Connection::toLane
int toLane
The lane the connections yields in.
Definition: NBEdge.h:215
GNEHierarchicalChildElements::getChildRotation
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
Definition: GNEHierarchicalChildElements.cpp:72
GLHelper::drawFilledCircle
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
NBNode::getPosition
const Position & getPosition() const
Definition: NBNode.h:247
GNERoute.h
NBEdge::setEndOffset
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3300
GNE_ATTR_SHAPE_START
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
Definition: SUMOXMLDefinitions.h:975
GNEHierarchicalParentElements::getParentAdditionals
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
Definition: GNEHierarchicalParentElements.cpp:85
GNEJunction::getNBNode
NBNode * getNBNode() const
Return net build node.
Definition: GNEJunction.cpp:398
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:817
NBEdge::invalidateConnections
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
Definition: NBEdge.cpp:1336
SUMO_TAG_WALK_EDGES
@ SUMO_TAG_WALK_EDGES
Definition: SUMOXMLDefinitions.h:306
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:673
GNEAttributeCarrier::FEATURE_GUESSED
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
Definition: GNEAttributeCarrier.h:595
RGBColor
Definition: RGBColor.h:39
GNEAdditional::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
GUIGlObject::setMicrosimID
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
Definition: GUIGlObject.cpp:173
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:591
GNEEdge::deleteGeometryPoint
void deleteGeometryPoint(const Position &pos, bool allowUndo=true)
delete the geometry point closest to the given pos
Definition: GNEEdge.cpp:416
Boundary::reset
void reset()
Resets the boundary.
Definition: Boundary.cpp:66
PositionVector::removeClosest
int removeClosest(const Position &p)
removes the point closest to p and return the removal index
Definition: PositionVector.cpp:989
NBEdge::getToNode
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:498
GNE_ATTR_MODIFICATION_STATUS
@ GNE_ATTR_MODIFICATION_STATUS
whether a feature has been loaded,guessed,modified or approved
Definition: SUMOXMLDefinitions.h:973
SUMO_const_halfLaneWidth
const double SUMO_const_halfLaneWidth
Definition: StdDefs.h:51
canParseVehicleClasses
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
Definition: SUMOVehicleClass.cpp:251
NBEdge::setConnection
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, bool keepClear=true, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED)
Adds a connection to a certain lane of a certain edge.
Definition: NBEdge.cpp:1029
GNEEdge::getLaneByAllowedVClass
GNELane * getLaneByAllowedVClass(const SUMOVehicleClass vClass) const
return the first lane that allow a vehicle of type vClass (or the first lane, if none was found)
Definition: GNEEdge.cpp:1183
NBEdge::getGeometry
const PositionVector & getGeometry() const
Returns the geometry of the edge.
Definition: NBEdge.h:692
PositionVector::push_back_noDoublePos
void push_back_noDoublePos(const Position &p)
insert in back a non double position
Definition: PositionVector.cpp:1295
SUMO_TAG_FLOW
@ SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:149
GNECrossing
This object is responsible for drawing a shape and for supplying a a popup menu. Messages are routete...
Definition: GNECrossing.h:44
SUMO_ATTR_PROB
@ SUMO_ATTR_PROB
Definition: SUMOXMLDefinitions.h:629
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:683
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEHierarchicalParentElements::getParentDemandElements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
Definition: GNEHierarchicalParentElements.cpp:114
GNEEdge::clickedOverShapeStart
bool clickedOverShapeStart(const Position &pos)
Definition: GNEEdge.cpp:158
GNEEdge::commitShapeEndChange
void commitShapeEndChange(const Position &oldPos, GNEUndoList *undoList)
commit position changing in shape end
Definition: GNEEdge.cpp:225
NBEdge::hasLaneSpecificPermissions
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
Definition: NBEdge.cpp:2013
NBEdge::getLaneWidth
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:587
NBEdge::Connection::mayDefinitelyPass
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition: NBEdge.h:227
NBEdge::hasLaneSpecificEndOffset
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
Definition: NBEdge.cpp:2060
GNEConnection::getLaneTo
GNELane * getLaneTo() const
@briefthe get lane of the outgoing lane
Definition: GNEConnection.cpp:184
GNELane::getLaneShape
const PositionVector & getLaneShape() const
Definition: GNELane.cpp:86
GUIVisualizationSettings::laneWidthExaggeration
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
Definition: GUIVisualizationSettings.h:467
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
GNEDemandElement::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
SUMO_TAG_PERSONSTOP_LANE
@ SUMO_TAG_PERSONSTOP_LANE
Definition: SUMOXMLDefinitions.h:313
GUISUMOAbstractView::getVisualisationSettings
GUIVisualizationSettings * getVisualisationSettings() const
get visualitation settings
Definition: GUISUMOAbstractView.cpp:1395
GNEEdge::getNBEdge
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:631
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:79
GeomHelper::INVALID_OFFSET
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
Definition: GeomHelper.h:51
GNEViewNet::buildSelectionACPopupEntry
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:338
GNEJunction::addIncomingGNEEdge
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
Definition: GNEJunction.cpp:418
GNEEdge::myUpdateGeometry
bool myUpdateGeometry
@brif flag to enable/disable update geomtetry of lanes (used mainly by setNumLanes)
Definition: GNEEdge.h:356
GNEViewNet::getNetworkViewOptions
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:452
GNEDemandElement::getColor
virtual const RGBColor & getColor() const =0
get color
GNEViewNet.h
PositionVector::positionAtOffset
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:248
SUMO_ATTR_WIDTH
@ SUMO_ATTR_WIDTH
Definition: SUMOXMLDefinitions.h:386
PositionVector::rotationDegreeAtOffset
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Definition: PositionVector.cpp:319
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
NBEdge::getInnerGeometry
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
Definition: NBEdge.cpp:552
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:1026
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GNEEdge::getPositionInView
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNEEdge.cpp:151
NBEdge::getNumLanes
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:477
GNEEdge::myPathElementChilds
std::vector< GNEDemandElement * > myPathElementChilds
vector with references to path element childs
Definition: GNEEdge.h:352
SUMO_TAG_EDGE
@ SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNE_ATTR_PARAMETERS
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GLHelper::drawShapeDottedContourRectangle
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position &center, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
Definition: GLHelper.cpp:560
GUIVisualizationWidthSettings::personTrip
static const double personTrip
width for person trips
Definition: GUIVisualizationSettings.h:266
GUIVisualizationColorSettings::personTrip
static const RGBColor personTrip
color for personStops
Definition: GUIVisualizationSettings.h:240
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
ProcessError
Definition: UtilExceptions.h:39
GNENet::retrieveJunction
GNEJunction * retrieveJunction(const std::string &id, bool failHard=true)
get junction by id
Definition: GNENet.cpp:1050
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
getVehicleClassNames
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
Definition: SUMOVehicleClass.cpp:168
GNEEdge::drawRerouterSymbol
void drawRerouterSymbol(const GUIVisualizationSettings &s, GNEAdditional *rerouter) const
draw Rerouter symbols
Definition: GNEEdge.cpp:2210
GLHelper::drawShapeDottedContourBetweenLanes
static void drawShapeDottedContourBetweenLanes(const GUIVisualizationSettings &s, const int type, const PositionVector &frontLaneShape, const double offsetFrontLaneShape, const PositionVector &backLaneShape, const double offsetBackLaneShape)
draw a dotted contour around the given lane shapes
Definition: GLHelper.cpp:523
NBEdge::setSpeed
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3345
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GLO_EDGE
@ GLO_EDGE
an edge
Definition: GUIGlObjectTypes.h:46
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
GNEEdge.h
GUIVisualizationWidthSettings::trip
static const double trip
width for trips
Definition: GUIVisualizationSettings.h:263
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
GNEViewNet::getDemandViewOptions
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:458
GNENetElement::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNENetElement.cpp:114
GLHelper::drawLine
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
NBEdge::setPreferredVehicleClass
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
Definition: NBEdge.cpp:3390
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
GNEEdge::generateChildID
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNEEdge.cpp:105
GNEAttributeCarrier::TagProperties::isWalk
bool isWalk() const
return true if tag correspond to a walk element
Definition: GNEAttributeCarrier.cpp:774
PositionVector::EMPTY
static const PositionVector EMPTY
empty Vector
Definition: PositionVector.h:73
GNEEdge::clickedOverShapeEnd
bool clickedOverShapeEnd(const Position &pos)
return true if user clicked over ShapeEnd
Definition: GNEEdge.cpp:168
SUMO_TAG_REROUTER
@ SUMO_TAG_REROUTER
A rerouter.
Definition: SUMOXMLDefinitions.h:95
GNEViewNetHelper::NetworkViewOptions::editingElevation
bool editingElevation() const
check if we're editing elevation
Definition: GNEViewNetHelper.cpp:1653
NBEdge::getLaneStruct
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1287
NBEdge::Lane::width
double width
This lane's width.
Definition: NBEdge.h:166
SUMO_TAG_PERSONTRIP_BUSSTOP
@ SUMO_TAG_PERSONTRIP_BUSSTOP
Definition: SUMOXMLDefinitions.h:305
GNEEdge::getOppositeEdge
GNEEdge * getOppositeEdge() const
get opposite edge
Definition: GNEEdge.cpp:499
GNENetElement
Definition: GNENetElement.h:43
GNEJunction::addOutgoingGNEEdge
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
Definition: GNEJunction.cpp:433
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
PositionVector::indexOfClosest
int indexOfClosest(const Position &p) const
index of the closest position to p
Definition: PositionVector.cpp:940
GNEReferenceCounter::decRef
void decRef(const std::string &debugMsg="")
Decrease reference.
Definition: GNEReferenceCounter.h:52
GNEEdge::getGNEJunctionDestiny
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:493
GNEDetectorE2.h
PositionVector::length2D
double length2D() const
Returns the length.
Definition: PositionVector.cpp:497
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:190
SUMO_ATTR_DISTANCE
@ SUMO_ATTR_DISTANCE
Definition: SUMOXMLDefinitions.h:395
GNECrossing.h
GNEEdge::retrieveGNEConnection
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
Definition: GNEEdge.cpp:1853
GNEEdge::setGeometry
void setGeometry(PositionVector geom, bool inner)
update edge geometry and inform the lanes
Definition: GNEEdge.cpp:709
Position::mul
void mul(double val)
Multiplies both positions with the given value.
Definition: Position.h:106
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
GNEEdge::getLanes
const std::vector< GNELane * > & getLanes() const
returns a reference to the lane vector
Definition: GNEEdge.cpp:874
GUIVisualizationSettings::laneParam
std::string laneParam
Definition: GUIVisualizationSettings.h:482
NBEdge::removeFromConnections
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
Definition: NBEdge.cpp:1266
GNELane.h
PositionVector::insertAtClosest
int insertAtClosest(const Position &p, bool interpolateZ)
inserts p between the two closest positions
Definition: PositionVector.cpp:959
GNEEdge::getRouteProbeRelativePosition
int getRouteProbeRelativePosition(GNERouteProbe *routeProbe) const
obtain relative positions of RouteProbes
Definition: GNEEdge.cpp:804
GNEJunction::setLogicValid
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
Definition: GNEJunction.cpp:659
GNEEdge::startGeometryMoving
void startGeometryMoving()
Definition: GNEEdge.cpp:240
DEG2RAD
#define DEG2RAD(x)
Definition: GeomHelper.h:37
NBEdge::getLanes
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:656
NBEdge::UNSPECIFIED_LOADED_LENGTH
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
Definition: NBEdge.h:330
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2117
Position::distanceSquaredTo2D
double distanceSquaredTo2D(const Position &p2) const
returns the square of the distance to another position (Only using x and y positions)
Definition: Position.h:248
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
GNEEdge::myGNEConnections
ConnectionVector myGNEConnections
vector with the connections of this edge
Definition: GNEEdge.h:340
GUIVisualizationSettings::streetName
GUIVisualizationTextSettings streetName
Definition: GUIVisualizationSettings.h:461
NBEdge::getStreetName
const std::string & getStreetName() const
Returns the street name of this edge.
Definition: NBEdge.h:600
SUMO_TAG_E2DETECTOR_MULTILANE
@ SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
Definition: SUMOXMLDefinitions.h:69
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:677
SUMO_ATTR_FROM
@ SUMO_ATTR_FROM
Definition: SUMOXMLDefinitions.h:639
GUIVisualizationSettings::getCircleResolution
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
Definition: GUIVisualizationSettings.cpp:1679
GNEEdge::setResponsible
void setResponsible(bool newVal)
set responsibility for deleting internal strctures
Definition: GNEEdge.cpp:1177
GNEEdge::addConnection
void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation=false)
adds a connection
Definition: GNEEdge.cpp:1777
NBEdge::getLoadedLength
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:554
GNEAttributeCarrier::TagProperties::isPersonTrip
bool isPersonTrip() const
return true if tag correspond to a person trip
Definition: GNEAttributeCarrier.cpp:768
GNEHierarchicalChildElements::getChildPosition
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
Definition: GNEHierarchicalChildElements.cpp:61
Position::distanceTo2D
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:243
GNEEdge::drawGeometryPoints
void drawGeometryPoints(const GUIVisualizationSettings &s) const
draw geometry points
Definition: GNEEdge.cpp:2063
GNEJunction::getGNEIncomingEdges
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
Definition: GNEJunction.cpp:481
Parameterised::setParametersStr
void setParametersStr(const std::string &paramsString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
Definition: Parameterised.cpp:139
GNEViewNetHelper::DemandViewOptions::showNonInspectedDemandElements
bool showNonInspectedDemandElements(const GNEDemandElement *demandElement) const
check if non inspected element has to be hidden
Definition: GNEViewNetHelper.cpp:1741
OptionsCont::getFloat
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
Definition: OptionsCont.cpp:208
GLIncludes.h
GNEEdge::getGNEJunctionSource
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:487
NBEdge::getEndOffset
double getEndOffset() const
Returns the offset to the destination node.
Definition: NBEdge.h:612
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEAttributeCarrier::TagProperties::isPersonPlan
bool isPersonPlan() const
return true if tag correspond to a person plan
Definition: GNEAttributeCarrier.cpp:762
GNEEdge::getLaneGlIDs
std::set< GUIGlID > getLaneGlIDs() const
returns GLIDs of all lanes
Definition: GNEEdge.cpp:864
GNENet::addGLObjectIntoGrid
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1322
SUMO_ATTR_PRIORITY
@ SUMO_ATTR_PRIORITY
Definition: SUMOXMLDefinitions.h:382
GNEHierarchicalChildElements::getChildDemandElementsSortedByType
const std::set< GNEDemandElement * > & getChildDemandElementsSortedByType(SumoXMLTag tag) const
return child demand elements sorted by type
Definition: GNEHierarchicalChildElements.cpp:302
GNEEdge::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNEEdge.cpp:472
GNEEdge::getGNECrossings
std::vector< GNECrossing * > getGNECrossings()
get GNECrossings vinculated with this Edge
Definition: GNEEdge.cpp:822
GUIMainWindow
Definition: GUIMainWindow.h:46
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
GNEEdge::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNEEdge.cpp:1166
GNEEdge::moveEntireShape
void moveEntireShape(const PositionVector &oldShape, const Position &offset)
move entire shape without commiting change
Definition: GNEEdge.cpp:372
NBEdge::deleteLane
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
Definition: NBEdge.cpp:3161
GNEAttributeCarrier::TagProperties::isPersonStop
bool isPersonStop() const
return true if tag correspond to a person stop element
Definition: GNEAttributeCarrier.cpp:786
PositionVector::positionAtOffset2D
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:273
GNEJunction::getGNEEdges
const std::vector< GNEEdge * > & getGNEEdges() const
Returns all GNEEdges vinculated with this Junction.
Definition: GNEJunction.cpp:475
PositionVector::resample
PositionVector resample(double maxLength) const
resample shape with the given number of points (equal spacing)
Definition: PositionVector.cpp:1633
NBEdge::setLaneWidth
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3239
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
GNEEdge::updateJunctionPosition
void updateJunctionPosition(GNEJunction *junction, const Position &origPos)
update edge geometry after junction move
Definition: GNEEdge.cpp:434
PositionVector::rotationAtOffset
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
Definition: PositionVector.cpp:294
NBEdge::getSpeed
double getSpeed() const
Returns the speed allowed on this edge.
Definition: NBEdge.h:571
GNE_SUPERMODE_DEMAND
@ GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:48
NBNode::geometryLike
bool geometryLike() const
whether this is structurally similar to a geometry node
Definition: NBNode.cpp:3026
InvalidArgument
Definition: UtilExceptions.h:56
NBEdge::Lane
An (internal) definition of a single lane of an edge.
Definition: NBEdge.h:142
PositionVector::interpolateZ
PositionVector interpolateZ(double zStart, double zEnd) const
returned vector that varies z smoothly over its length
Definition: PositionVector.cpp:1614
SUMOXMLDefinitions::isValidNetID
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
Definition: SUMOXMLDefinitions.cpp:967
GNEEdge::moveVertexShape
int moveVertexShape(const int index, const Position &oldPos, const Position &offset)
change position of a vertex of shape without commiting change
Definition: GNEEdge.cpp:347
NBEdge::Connection::keepClear
bool keepClear
whether the junction must be kept clear when using this connection
Definition: NBEdge.h:230
SVCAll
const SVCPermissions SVCAll
all VClasses are allowed
Definition: SUMOVehicleClass.cpp:146
NBNode::getIncomingEdges
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
Definition: NBNode.h:255
GNEAttributeCarrier::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNEEdge::removePathElement
void removePathElement(GNEDemandElement *pathElementChild)
remove path element (Only used by GNEHierarchicalParentElements::changeRouteEdges)
Definition: GNEEdge.cpp:1485
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
GNEReferenceCounter::incRef
void incRef(const std::string &debugMsg="")
Increarse reference.
Definition: GNEReferenceCounter.h:67
GUIVisualizationSettings::drawAdditionals
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
Definition: GUIVisualizationSettings.cpp:1663
SUMO_TAG_PERSONTRIP_FROMTO
@ SUMO_TAG_PERSONTRIP_FROMTO
Definition: SUMOXMLDefinitions.h:304
SUMO_ATTR_ALLOW
@ SUMO_ATTR_ALLOW
Definition: SUMOXMLDefinitions.h:782
SUMO_TAG_RIDE_BUSSTOP
@ SUMO_TAG_RIDE_BUSSTOP
Definition: SUMOXMLDefinitions.h:311
NBEdge::Lane::permissions
SVCPermissions permissions
List of vehicle types that are allowed on this lane.
Definition: NBEdge.h:153
NBEdge::myType
std::string myType
The type of the edge.
Definition: NBEdge.h:1543
GNEEdge::addPathElement
void addPathElement(GNEDemandElement *pathElementChild)
add path element (Only used by GNEHierarchicalParentElements::changeRouteEdges)
Definition: GNEEdge.cpp:1476
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
NBEdge::UNSPECIFIED_WIDTH
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:315
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
GUIVisualizationColorSettings::ride
static const RGBColor ride
color for rides
Definition: GUIVisualizationSettings.h:246
NBEdge::addLane
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
Definition: NBEdge.cpp:3107
NBEdge::Connection::customShape
PositionVector customShape
custom shape for connection
Definition: NBEdge.h:242
GNEEdge::removeConnection
void removeConnection(NBEdge::Connection nbCon)
removes a connection
Definition: GNEEdge.cpp:1813
SUMO_TAG_WALK_BUSSTOP
@ SUMO_TAG_WALK_BUSSTOP
Definition: SUMOXMLDefinitions.h:308
GNENet::retrieveEdge
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:1069
NBEdge::getFinalLength
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3682
GNEConnection
Definition: GNEConnection.h:38
GNENetElement::myNet
GNENet * myNet
the net to inform about updates
Definition: GNENetElement.h:166
GNEConnection::updateLinkState
void updateLinkState()
recompute cached myLinkState
Definition: GNEConnection.cpp:235
SUMO_TAG_ROUTE
@ SUMO_TAG_ROUTE
begin/end of the description of a route
Definition: SUMOXMLDefinitions.h:125
NBEdge::getTypeID
const std::string & getTypeID() const
get ID of type
Definition: NBEdge.h:1074
GUIVisualizationColorSettings::selectedPersonPlanColor
RGBColor selectedPersonPlanColor
person plan selection color (Rides, Walks, personStops...)
Definition: GUIVisualizationSettings.h:159
config.h
GNENet::renameEdge
void renameEdge(GNEEdge *edge, const std::string &newID)
updates the map and reserves new id
Definition: GNENet.cpp:2094
SUMOXMLDefinitions::LaneSpreadFunctions
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
Definition: SUMOXMLDefinitions.h:1374
GNEEdge::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEEdge.cpp:112
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:589
StringBijection::hasString
bool hasString(const std::string &str) const
Definition: StringBijection.h:116
GNEChange_Lane.h
Position::add
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:126
GUIVisualizationSettings::laneColorer
GUIColorer laneColorer
The lane colorer.
Definition: GUIVisualizationSettings.h:440
Boundary::isInitialised
bool isInitialised() const
check if Boundary is Initialised
Definition: Boundary.cpp:216
GLO_JUNCTION
@ GLO_JUNCTION
a junction
Definition: GUIGlObjectTypes.h:50
GNEConnection::markConnectionGeometryDeprecated
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
Definition: GNEConnection.cpp:229
GNE_ATTR_SELECTED
@ 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
PositionVector::bezier
PositionVector bezier(int numPoints)
return a bezier interpolation
Definition: PositionVector.cpp:1682
GUIVisualizationSettings::spreadSuperposed
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
Definition: GUIVisualizationSettings.h:479
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
GNEEdge::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
Definition: GNEEdge.cpp:1075
GUIVisualizationColorSettings::walk
static const RGBColor walk
color for walks
Definition: GUIVisualizationSettings.h:243
GNELane::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
Definition: GNELane.cpp:1134
GUIVisualizationSettings::drawDetail
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
Definition: GUIVisualizationSettings.cpp:1669
NBEdge::Lane::endOffset
double endOffset
This lane's offset to the intersection begin.
Definition: NBEdge.h:159
GNENetElement::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:83
GNEAttributeCarrier::TagProperties::isRide
bool isRide() const
return true if tag correspond to a ride element
Definition: GNEAttributeCarrier.cpp:780
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
GNEEdge::commitShapeChange
void commitShapeChange(const PositionVector &oldShape, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of changeShapeGeometry(....
Definition: GNEEdge.cpp:385
SUMO_ATTR_NAME
@ SUMO_ATTR_NAME
Definition: SUMOXMLDefinitions.h:380
GNEUndoList
Definition: GNEUndoList.h:48
GNEEdge::myLanes
LaneVector myLanes
vectgor with the lanes of this edge
Definition: GNEEdge.h:337
GNEEdge::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNEEdge.cpp:974
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNEEdge::resetEndpoint
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
Definition: GNEEdge.cpp:695
GNEEdge::getLaneByDisallowedVClass
GNELane * getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const
return the first lane that disallow a vehicle of type vClass (or the first lane, if none was found)
Definition: GNEEdge.cpp:1198
GUIVisualizationColorSettings::vehicleTrips
static const RGBColor vehicleTrips
color for vehicle trips
Definition: GUIVisualizationSettings.h:234
GNEJunction
Definition: GNEJunction.h:47
GNEEdge::GNEChange_Lane
friend class GNEChange_Lane
Friend class.
Definition: GNEEdge.h:54
NBEdge::Connection
A structure which describes a connection between edges or lanes.
Definition: NBEdge.h:189
GNEUndoList::p_begin
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:72
invertPermissions
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
Definition: SUMOVehicleClass.cpp:285
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
SUMO_TAG_EMBEDDEDROUTE
@ SUMO_TAG_EMBEDDEDROUTE
begin/end of the description of a embedded route (used in NETEDIT)
Definition: SUMOXMLDefinitions.h:127
GNEEdge::getOptionalName
const std::string getOptionalName() const
Returns the street name.
Definition: GNEEdge.cpp:467
GNEViewNetHelper::DemandViewOptions::showAllPersonPlans
bool showAllPersonPlans() const
check all person plans has to be show
Definition: GNEViewNetHelper.cpp:1789
GNE_ATTR_BIDIR
@ GNE_ATTR_BIDIR
whether an edge is part of a bidirectional railway
Definition: SUMOXMLDefinitions.h:979
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:153
NBEdge::Connection::visibility
double visibility
custom foe visiblity for connection
Definition: NBEdge.h:236
GUIVisualizationColorSettings::selectedVehicleColor
RGBColor selectedVehicleColor
vehicle selection color
Definition: GUIVisualizationSettings.h:153
PositionVector::mirrorX
void mirrorX()
Definition: PositionVector.cpp:655
SUMO_ATTR_SHAPE
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
Definition: SUMOXMLDefinitions.h:690
GUIGlObject::getMicrosimID
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.cpp:163
GNEViewNetHelper::EditModes::networkEditMode
NetworkEditMode networkEditMode
the current Network edit mode
Definition: GNEViewNetHelper.h:308
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:110
NBEdge::getConnections
const std::vector< Connection > & getConnections() const
Returns the connections.
Definition: NBEdge.h:934
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
GUIVisualizationSettings::edgeName
GUIVisualizationTextSettings edgeName
Definition: GUIVisualizationSettings.h:461
NBEdge::getFromNode
NBNode * getFromNode() const
Returns the origin node of the edge.
Definition: NBEdge.h:491
GUIPropertySchemeStorage::getSchemes
const std::vector< T > & getSchemes() const
Definition: GUIPropertySchemeStorage.h:87
GNE_NMODE_MOVE
@ GNE_NMODE_MOVE
mode for moving network elements
Definition: GNEViewNetHelper.h:62
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GUIVisualizationSettings::edgeValue
GUIVisualizationTextSettings edgeValue
Definition: GUIVisualizationSettings.h:461
GNEHierarchicalChildElements::getChildAdditionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
Definition: GNEHierarchicalChildElements.cpp:131
SUMO_TAG_RIDE_FROMTO
@ SUMO_TAG_RIDE_FROMTO
Definition: SUMOXMLDefinitions.h:310
GNEDemandElement::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEDemandElement.cpp:558
GNEChange_Attribute.h
GNENet.h
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:75
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
NBEdge::setGeometry
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
Definition: NBEdge.cpp:582
SUMO_TAG_TRIP
@ SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:145
GNENet::changeEdgeEndpoints
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
Definition: GNENet.cpp:2107
GNEEdge::remakeGNEConnections
void remakeGNEConnections()
remake connections
Definition: GNEEdge.cpp:744
PositionVector::push_front_noDoublePos
void push_front_noDoublePos(const Position &p)
insert in front a non double position
Definition: PositionVector.cpp:1303
GNEEdge::setShapeStartPos
void setShapeStartPos(const Position &pos)
change Shape StartPos
Definition: GNEEdge.cpp:2041
PositionVector::removeDoublePoints
void removeDoublePoints(double minDist=POSITION_EPS, bool assertLength=false)
Removes positions if too near.
Definition: PositionVector.cpp:1344
NBEdge::getDistance
double getDistance() const
Definition: NBEdge.h:616
GNEJunction::removeOutgoingGNEEdge
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
Definition: GNEJunction.cpp:461
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:196
GNEUndoList.h
GUIVisualizationSizeSettings::exaggeration
double exaggeration
The size exaggeration (upscale)
Definition: GUIVisualizationSettings.h:106
NBEdge::getLaneSpreadFunction
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
Definition: NBEdge.h:777
GNE_ATTR_PARENT
@ GNE_ATTR_PARENT
parent of an additional element
Definition: SUMOXMLDefinitions.h:987
NBEdge::hasLaneSpecificWidth
bool hasLaneSpecificWidth() const
whether lanes differ in width
Definition: NBEdge.cpp:2038
GNENetElement::myMovingGeometryBoundary
Boundary myMovingGeometryBoundary
boundary used during moving of elements
Definition: GNENetElement.h:169
GUIVisualizationWidthSettings::walk
static const double walk
width for walks
Definition: GUIVisualizationSettings.h:269
GNEEdge::getAttributeForSelection
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
Definition: GNEEdge.cpp:965
NBEdge::getTurnDestination
NBEdge * getTurnDestination(bool possibleDestination=false) const
Definition: NBEdge.cpp:3084
GNEEdge::wasSplit
bool wasSplit()
whether this edge was created from a split
Definition: GNEEdge.cpp:886
NBEdge::getID
const std::string & getID() const
Definition: NBEdge.h:1380
GNEConnection.h
GNEEdge::setNumLanes
void setNumLanes(int numLanes, GNEUndoList *undoList)
changes the number of lanes. When reducing the number of lanes, higher-numbered lanes are removed fir...
Definition: GNEEdge.cpp:1635