Eclipse SUMO - Simulation of Urban MObility
GUILane.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 /****************************************************************************/
17 // Representation of a lane in the micro simulation (gui-version)
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <utility>
28 #include <fx.h>
29 #include <utils/geom/GeomHelper.h>
30 #include <utils/geom/Position.h>
34 #include <utils/common/StdDefs.h>
35 #include <utils/geom/GeomHelper.h>
36 #include <utils/gui/div/GLHelper.h>
42 #include <microsim/MSGlobals.h>
43 #include <microsim/MSLane.h>
47 #include <microsim/MSNet.h>
50 #include <mesosim/MELoop.h>
51 #include <mesosim/MESegment.h>
52 #include "GUILane.h"
53 #include "GUIEdge.h"
54 #include "GUIVehicle.h"
55 #include "GUINet.h"
56 
57 #ifdef HAVE_OSG
58 #include <osg/Geometry>
59 #endif
60 
61 //#define GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
62 //#define GUILane_DEBUG_DRAW_VERTICES
63 //#define GUILane_DEBUG_DRAW_FOE_INTERSECTIONS
64 
65 // ===========================================================================
66 // static member declaration
67 // ===========================================================================
68 const RGBColor GUILane::MESO_USE_LANE_COLOR(0, 0, 0, 0);
69 
70 
71 // ===========================================================================
72 // method definitions
73 // ===========================================================================
74 GUILane::GUILane(const std::string& id, double maxSpeed, double length,
75  MSEdge* const edge, int numericalID,
76  const PositionVector& shape, double width,
77  SVCPermissions permissions, int index, bool isRampAccel,
78  const std::string& type) :
79  MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions, index, isRampAccel, type),
80  GUIGlObject(GLO_LANE, id),
81 #ifdef HAVE_OSG
82  myGeom(0),
83 #endif
84  myAmClosed(false),
85  myLock(true) {
87  myShape = splitAtSegments(shape);
88  assert(fabs(myShape.length() - shape.length()) < POSITION_EPS);
89  assert(myShapeSegments.size() == myShape.size());
90  }
91  myShapeRotations.reserve(myShape.size() - 1);
92  myShapeLengths.reserve(myShape.size() - 1);
93  myShapeColors.reserve(myShape.size() - 1);
94  int e = (int) myShape.size() - 1;
95  for (int i = 0; i < e; ++i) {
96  const Position& f = myShape[i];
97  const Position& s = myShape[i + 1];
98  myShapeLengths.push_back(f.distanceTo2D(s));
99  myShapeRotations.push_back(RAD2DEG(atan2(s.x() - f.x(), f.y() - s.y())));
100  }
101  //
102  myHalfLaneWidth = myWidth / 2.;
104 }
105 
106 
108  // just to quit cleanly on a failure
109  if (myLock.locked()) {
110  myLock.unlock();
111  }
112 }
113 
114 
115 // ------ Vehicle insertion ------
116 void
117 GUILane::incorporateVehicle(MSVehicle* veh, double pos, double speed, double posLat,
118  const MSLane::VehCont::iterator& at,
119  MSMoveReminder::Notification notification) {
120  FXMutexLock locker(myLock);
121  MSLane::incorporateVehicle(veh, pos, speed, posLat, at, notification);
122 }
123 
124 
125 // ------ Access to vehicles ------
126 const MSLane::VehCont&
128  myLock.lock();
129  return myVehicles;
130 }
131 
132 
133 void
135  myLock.unlock();
136 }
137 
138 
139 void
141  FXMutexLock locker(myLock);
143 }
144 
145 void
147  FXMutexLock locker(myLock);
149 }
150 
151 
152 void
154  FXMutexLock locker(myLock);
156 }
157 
158 
159 MSVehicle*
160 GUILane::removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify) {
161  FXMutexLock locker(myLock);
162  return MSLane::removeVehicle(remVehicle, notification, notify);
163 }
164 
165 
166 void
168  FXMutexLock locker(myLock);
169  return MSLane::removeParking(remVehicle);
170 }
171 
172 
173 void
175  FXMutexLock locker(myLock);
177 }
178 
179 
180 void
182  FXMutexLock locker(myLock);
184 }
185 
186 
187 void
188 GUILane::detectCollisions(SUMOTime timestep, const std::string& stage) {
189  FXMutexLock locker(myLock);
190  MSLane::detectCollisions(timestep, stage);
191 }
192 
193 
194 double
196  FXMutexLock locker(myLock);
198 }
199 
200 
201 void
203  FXMutexLock locker(myLock);
205 }
206 
207 
208 // ------ Drawing methods ------
209 void
211  int noLinks = (int)myLinks.size();
212  if (noLinks == 0) {
213  return;
214  }
215  // draw all links
216  if (getEdge().isCrossing()) {
217  // draw indices at the start and end of the crossing
219  PositionVector shape = getShape();
220  shape.extrapolate(0.5); // draw on top of the walking area
223  return;
224  }
225  // draw all links
226  double w = myWidth / (double) noLinks;
227  double x1 = myHalfLaneWidth;
228  const bool lefthand = MSNet::getInstance()->lefthand();
229  for (int i = noLinks; --i >= 0;) {
230  double x2 = x1 - (double)(w / 2.);
232  x1 -= w;
233  }
234 }
235 
236 
237 void
239  int noLinks = (int)myLinks.size();
240  if (noLinks == 0) {
241  return;
242  }
243  if (getEdge().isCrossing()) {
244  // draw indices at the start and end of the crossing
246  int linkNo = net.getLinkTLIndex(link);
247  // maybe the reverse link is controlled separately
248  int linkNo2 = net.getLinkTLIndex(myLinks.front());
249  // otherwise, use the same index as the forward link
250  if (linkNo2 < 0) {
251  linkNo2 = linkNo;
252  }
253  if (linkNo >= 0) {
254  PositionVector shape = getShape();
255  shape.extrapolate(0.5); // draw on top of the walking area
258  }
259  return;
260  }
261  // draw all links
262  double w = myWidth / (double) noLinks;
263  double x1 = myHalfLaneWidth;
264  const bool lefthand = MSNet::getInstance()->lefthand();
265  for (int i = noLinks; --i >= 0;) {
266  double x2 = x1 - (double)(w / 2.);
267  int linkNo = net.getLinkTLIndex(myLinks[lefthand ? noLinks - 1 - i : i]);
268  if (linkNo < 0) {
269  continue;
270  }
272  x1 -= w;
273  }
274 }
275 
276 
277 void
279  int noLinks = (int)myLinks.size();
280  if (noLinks == 0) {
281  drawLinkRule(s, net, nullptr, getShape(), 0, 0);
282  return;
283  }
284  if (getEdge().isCrossing()) {
285  // draw rules at the start and end of the crossing
287  MSLink* link2 = myLinks.front();
288  if (link2->getTLLogic() == nullptr) {
289  link2 = link;
290  }
291  PositionVector shape = getShape();
292  shape.extrapolate(0.5); // draw on top of the walking area
293  drawLinkRule(s, net, link2, shape, 0, myWidth);
294  drawLinkRule(s, net, link, shape.reverse(), 0, myWidth);
295  return;
296  }
297  // draw all links
298  const double w = myWidth / (double) noLinks;
299  double x1 = myEdge->getToJunction()->getType() == NODETYPE_RAIL_SIGNAL ? -myWidth * 0.5 : 0;
300  const bool lefthand = MSNet::getInstance()->lefthand();
301  for (int i = 0; i < noLinks; ++i) {
302  double x2 = x1 + w;
303  drawLinkRule(s, net, myLinks[lefthand ? noLinks - 1 - i : i], getShape(), x1, x2);
304  x1 = x2;
305  }
306  // draw stopOffset for passenger cars
307  if (myStopOffsets.size() != 0 && (myStopOffsets.begin()->first & SVC_PASSENGER) != 0) {
308  const double stopOffsetPassenger = myStopOffsets.begin()->second;
309  const Position& end = myShape.back();
310  const Position& f = myShape[-2];
311  const double rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
313  glPushMatrix();
314  glTranslated(end.x(), end.y(), 0);
315  glRotated(rot, 0, 0, 1);
316  glTranslated(0, stopOffsetPassenger, 0);
317  glBegin(GL_QUADS);
318  glVertex2d(-myHalfLaneWidth, 0.0);
319  glVertex2d(-myHalfLaneWidth, 0.2);
320  glVertex2d(myHalfLaneWidth, 0.2);
321  glVertex2d(myHalfLaneWidth, 0.0);
322  glEnd();
323  glPopMatrix();
324  }
325 }
326 
327 
328 void
329 GUILane::drawLinkRule(const GUIVisualizationSettings& s, const GUINet& net, MSLink* link, const PositionVector& shape, double x1, double x2) const {
330  const Position& end = shape.back();
331  const Position& f = shape[-2];
332  const double rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
333  if (link == nullptr) {
335  glPushMatrix();
336  glTranslated(end.x(), end.y(), 0);
337  glRotated(rot, 0, 0, 1);
338  glBegin(GL_QUADS);
339  glVertex2d(-myHalfLaneWidth, 0.0);
340  glVertex2d(-myHalfLaneWidth, 0.5);
341  glVertex2d(myHalfLaneWidth, 0.5);
342  glVertex2d(myHalfLaneWidth, 0.0);
343  glEnd();
344  glPopMatrix();
345  } else {
346  glPushMatrix();
347  glTranslated(end.x(), end.y(), 0);
348  glRotated(rot, 0, 0, 1);
349  // select glID
350  switch (link->getState()) {
353  case LINKSTATE_TL_RED:
359  glPushName(net.getLinkTLID(link));
360  break;
361  case LINKSTATE_MAJOR:
362  case LINKSTATE_MINOR:
363  case LINKSTATE_EQUAL:
364  default:
365  glPushName(getGlID());
366  break;
367  }
369  if (!(drawAsRailway(s) || drawAsWaterway(s)) || link->getState() != LINKSTATE_MAJOR) {
370  // the white bar should be the default for most railway
371  // links and looks ugly so we do not draw it
372  double scale = isInternal() ? 0.5 : 1;
374  scale *= MAX2(s.laneWidthExaggeration, s.junctionSize.getExaggeration(s, this, 10));
375  }
376  glScaled(scale, scale, 1);
377  glBegin(GL_QUADS);
378  glVertex2d(x1 - myHalfLaneWidth, 0.0);
379  glVertex2d(x1 - myHalfLaneWidth, 0.5);
380  glVertex2d(x2 - myHalfLaneWidth, 0.5);
381  glVertex2d(x2 - myHalfLaneWidth, 0.0);
382  glEnd();
383  }
384  glPopName();
385  glPopMatrix();
386  }
387 }
388 
389 void
391  if (myLinks.size() == 0) {
392  return;
393  }
394  // draw all links
395  const Position& end = getShape().back();
396  const Position& f = getShape()[-2];
397  const double rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
398  glPushMatrix();
399  glColor3d(1, 1, 1);
400  glTranslated(end.x(), end.y(), 0);
401  glRotated(rot, 0, 0, 1);
403  glScaled(myWidth / SUMO_const_laneWidth, 1, 1);
404  }
405  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
406  LinkDirection dir = (*i)->getDirection();
407  LinkState state = (*i)->getState();
408  if (state == LINKSTATE_DEADEND || dir == LINKDIR_NODIR) {
409  continue;
410  }
411  switch (dir) {
412  case LINKDIR_STRAIGHT:
413  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
414  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
415  break;
416  case LINKDIR_TURN:
417  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
418  GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
419  GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
420  GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (double) 1, (double) .25);
421  break;
423  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
424  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
425  GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05);
426  GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (double) 1, (double) .25);
427  break;
428  case LINKDIR_LEFT:
429  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
430  GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
431  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (double) 1, (double) .25);
432  break;
433  case LINKDIR_RIGHT:
434  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
435  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
436  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (double) 1, (double) .25);
437  break;
438  case LINKDIR_PARTLEFT:
439  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
440  GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
441  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (double) 1, (double) .25);
442  break;
443  case LINKDIR_PARTRIGHT:
444  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
445  GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
446  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (double) 1, (double) .25);
447  break;
448  default:
449  break;
450  }
451  }
452  glPopMatrix();
453 }
454 
455 
456 void
457 GUILane::drawLane2LaneConnections(double exaggeration) const {
458  Position centroid;
459  if (exaggeration > 1) {
460  centroid = myEdge->getToJunction()->getShape().getCentroid();
461  }
462  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
463  const MSLane* connected = (*i)->getLane();
464  if (connected == nullptr) {
465  continue;
466  }
468  glBegin(GL_LINES);
470  Position p2 = connected->getEdge().isWalkingArea() ? connected->getShape().getCentroid() : connected->getShape()[0];
471  if (exaggeration > 1) {
472  p1 = centroid + ((p1 - centroid) * exaggeration);
473  p2 = centroid + ((p2 - centroid) * exaggeration);
474  }
475  glVertex2d(p1.x(), p1.y());
476  glVertex2d(p2.x(), p2.y());
477  glEnd();
478  GLHelper::drawTriangleAtEnd(p1, p2, (double) .4, (double) .2);
479  }
480 }
481 
482 
483 void
485  glPushMatrix();
486  glPushName(getGlID());
487  const bool isCrossing = myEdge->isCrossing();
488  const bool isWalkingArea = myEdge->isWalkingArea();
489  const bool isInternal = isCrossing || isWalkingArea || myEdge->isInternal();
490  bool mustDrawMarkings = false;
491  double exaggeration = s.laneWidthExaggeration;
493  GUIEdge* myGUIEdge = dynamic_cast<GUIEdge*>(myEdge);
494  exaggeration *= s.edgeScaler.getScheme().getColor(myGUIEdge->getScaleValue(s.edgeScaler.getActive()));
495  } else {
497  }
498  const bool hasRailSignal = myEdge->getToJunction()->getType() == NODETYPE_RAIL_SIGNAL;
499  const bool detailZoom = s.scale * exaggeration > 5;
500  const bool drawDetails = (detailZoom || s.junctionSize.minSize == 0 || hasRailSignal) && !s.drawForSelecting;
501  if (isCrossing || isWalkingArea) {
502  // draw internal lanes on top of junctions
503  glTranslated(0, 0, GLO_JUNCTION + 0.1);
504  } else if (isWaterway(myPermissions)) {
505  // draw waterways below normal roads
506  glTranslated(0, 0, getType() - 0.2);
507  } else {
508  glTranslated(0, 0, getType());
509  }
510  // set lane color
511  const RGBColor color = setColor(s);
513  myShapeColors.clear();
514  const std::vector<RGBColor>& segmentColors = static_cast<const GUIEdge*>(myEdge)->getSegmentColors();
515  if (segmentColors.size() > 0) {
516  // apply segment specific shape colors
517  //std::cout << getID() << " shape=" << myShape << " shapeSegs=" << toString(myShapeSegments) << "\n";
518  for (int ii = 0; ii < (int)myShape.size() - 1; ++ii) {
519  myShapeColors.push_back(segmentColors[myShapeSegments[ii]]);
520  }
521  }
522  }
523  // recognize full transparency and simply don't draw
524  bool hiddenBidi = myEdge->getBidiEdge() != nullptr && myEdge->getNumericalID() > myEdge->getBidiEdge()->getNumericalID();
525  if (color.alpha() != 0 && s.scale * exaggeration > s.laneMinSize) {
526  // scale tls-controlled lane2lane-arrows along with their junction shapes
527  double junctionExaggeration = 1;
528  if (!isInternal
531  junctionExaggeration = MAX2(1.001, s.junctionSize.getExaggeration(s, this, 4));
532  }
533  // draw lane
534  // check whether it is not too small
535  if (s.scale * exaggeration < 1. && junctionExaggeration == 1 && s.junctionSize.minSize != 0) {
536  if (!isInternal || hasRailSignal) {
537  if (myShapeColors.size() > 0) {
539  } else {
541  }
542  }
543  glPopMatrix();
544  } else {
545  GUINet* net = (GUINet*) MSNet::getInstance();
546  const bool spreadSuperposed = s.spreadSuperposed && myEdge->getBidiEdge() != nullptr && drawAsRailway(s);
547  if (hiddenBidi && !spreadSuperposed) {
548  // do not draw shape
549  } else if (drawAsRailway(s) && (!s.drawForSelecting || spreadSuperposed)) {
550  // draw as railway: assume standard gauge of 1435mm when lane width is not set
551  // draw foot width 150mm, assume that distance between rail feet inner sides is reduced on both sides by 39mm with regard to the gauge
552  // assume crosstie length of 181% gauge (2600mm for standard gauge)
553  PositionVector shape = myShape;
554  const double width = myWidth;
555  double halfGauge = 0.5 * (width == SUMO_const_laneWidth ? 1.4350 : width) * exaggeration;
556  if (spreadSuperposed) {
557  shape.move2side(halfGauge * 0.8);
558  halfGauge *= 0.4;
559  }
560  const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
561  const double halfRailWidth = detailZoom ? (halfInnerFeetWidth + 0.15 * exaggeration) : SUMO_const_halfLaneWidth;
562  const double halfCrossTieWidth = halfGauge * 1.81;
563  if (myShapeColors.size() > 0) {
565  } else {
567  }
568  // Draw white on top with reduced width (the area between the two tracks)
569  if (detailZoom) {
570  glColor3d(1, 1, 1);
571  glTranslated(0, 0, .1);
572  GLHelper::drawBoxLines(shape, myShapeRotations, myShapeLengths, halfInnerFeetWidth);
573  setColor(s);
574  GLHelper::drawCrossTies(shape, myShapeRotations, myShapeLengths, 0.26 * exaggeration, 0.6 * exaggeration, halfCrossTieWidth, s.drawForSelecting);
575  }
576  } else if (isCrossing) {
577  if (s.drawCrossingsAndWalkingareas && (s.scale > 3.0 || s.junctionSize.minSize == 0)) {
578  glTranslated(0, 0, .2);
580  glTranslated(0, 0, -.2);
581  }
582  } else if (isWalkingArea) {
583  if (s.drawCrossingsAndWalkingareas && (s.scale > 3.0 || s.junctionSize.minSize == 0)) {
584  glTranslated(0, 0, .2);
585  if (s.scale * exaggeration < 20.) {
587  } else {
589  }
590  glTranslated(0, 0, -.2);
591 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
593 #endif
594  }
595  } else {
596  // we draw the lanes with reduced width so that the lane markings below are visible
597  // (this avoids artifacts at geometry corners without having to
598  // compute lane-marking intersection points)
599  const double halfWidth = isInternal ? myQuarterLaneWidth : (myHalfLaneWidth - SUMO_const_laneMarkWidth / 2);
600  mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN && exaggeration == 1.0 && !isWaterway(myPermissions);
601  const int cornerDetail = drawDetails && !isInternal ? (int)(s.scale * exaggeration) : 0;
602  const double offset = halfWidth * MAX2(0., (exaggeration - 1));
603  if (myShapeColors.size() > 0) {
604  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfWidth * exaggeration, cornerDetail, offset);
605  } else {
606  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfWidth * exaggeration, cornerDetail, offset);
607  }
608  }
609 #ifdef GUILane_DEBUG_DRAW_VERTICES
611 #endif
612 #ifdef GUILane_DEBUG_DRAW_FOE_INTERSECTIONS
615  }
616 #endif
617  glPopMatrix();
618  // draw details
619  if ((!isInternal || isCrossing || !s.drawJunctionShape) && (drawDetails || s.drawForSelecting || junctionExaggeration > 1)) {
620  glPushMatrix();
621  glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape
622  glTranslated(0, 0, .5);
623  if (drawDetails) {
624  if (s.showLaneDirection) {
625  if (drawAsRailway(s)) {
626  // improve visibility of superposed rail edges
627  GLHelper::setColor(setColor(s).changedBrightness(100));
628  } else {
629  glColor3d(0.3, 0.3, 0.3);
630  }
631  if (!isCrossing || s.drawCrossingsAndWalkingareas) {
632  drawDirectionIndicators(exaggeration, spreadSuperposed);
633  }
634  }
635  if ((!isInternal || isCrossing)) {
636  if (MSGlobals::gLateralResolution > 0 && s.showSublanes && !hiddenBidi && !isCrossing) {
637  // draw sublane-borders
638  const double offsetSign = MSNet::getInstance()->lefthand() ? -1 : 1;
639  GLHelper::setColor(GLHelper::getColor().changedBrightness(51));
640  for (double offset = -myHalfLaneWidth; offset < myHalfLaneWidth; offset += MSGlobals::gLateralResolution) {
641  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, 0.01, 0, -offset * offsetSign);
642  }
643  }
645  drawArrows();
646  }
647  glTranslated(0, 0, 1000);
648  if (s.drawLinkJunctionIndex.show) {
649  drawLinkNo(s);
650  }
651  if (s.drawLinkTLIndex.show) {
652  drawTLSLinkNo(s, *net);
653  }
654  glTranslated(0, 0, -1000);
655  }
656  glTranslated(0, 0, .1);
657  }
658  // make sure link rules are drawn so tls can be selected via right-click
659  if (s.showLinkRules && (drawDetails || s.drawForSelecting)
660  && !isWalkingArea
661  && (!myEdge->isInternal() || getLinkCont()[0]->isInternalJunctionLink())) {
662  drawLinkRules(s, *net);
663  }
664  if ((drawDetails || junctionExaggeration > 1) && s.showLane2Lane) {
665  // draw from end of first to the begin of second but respect junction scaling
666  drawLane2LaneConnections(junctionExaggeration);
667  }
668  glPopMatrix();
669  }
670  }
671  if (mustDrawMarkings && drawDetails && s.laneShowBorders && !hiddenBidi) { // needs matrix reset
672  drawMarkings(s, exaggeration);
673  }
674  if (drawDetails && isInternal && s.showBikeMarkings && myPermissions == SVC_BICYCLE && exaggeration == 1.0 && s.showLinkDecals && s.laneShowBorders && !hiddenBidi) {
676  }
677  } else {
678  glPopMatrix();
679  }
680  // draw vehicles
681  if (s.scale * s.vehicleSize.getExaggeration(s, nullptr) > s.vehicleSize.minSize) {
682  // retrieve vehicles from lane; disallow simulation
683  const MSLane::VehCont& vehicles = getVehiclesSecure();
684  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
685  if ((*v)->getLane() == this) {
686  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
687  } // else: this is the shadow during a continuous lane change
688  }
689  // draw parking vehicles
690  for (std::set<const MSVehicle*>::const_iterator v = myParkingVehicles.begin(); v != myParkingVehicles.end(); ++v) {
691  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
692  }
693  // allow lane simulation
694  releaseVehicles();
695  }
696  glPopName();
697 }
698 
699 
700 void
701 GUILane::drawMarkings(const GUIVisualizationSettings& s, double scale) const {
702  glPushMatrix();
703  glTranslated(0, 0, GLO_EDGE);
704  setColor(s);
705  // optionally draw inverse markings
706  if (myIndex > 0 && (myEdge->getLanes()[myIndex - 1]->getPermissions() & myPermissions) != 0) {
707  double mw = (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale;
708  double mw2 = (myHalfLaneWidth - SUMO_const_laneMarkWidth) * scale;
709  if (MSNet::getInstance()->lefthand()) {
710  mw *= -1;
711  mw2 *= -1;
712  }
713  int e = (int) getShape().size() - 1;
714  for (int i = 0; i < e; ++i) {
715  glPushMatrix();
716  glTranslated(getShape()[i].x(), getShape()[i].y(), 2.1);
717  glRotated(myShapeRotations[i], 0, 0, 1);
718  for (double t = 0; t < myShapeLengths[i]; t += 6) {
719  const double length = MIN2((double)3, myShapeLengths[i] - t);
720  glBegin(GL_QUADS);
721  glVertex2d(-mw, -t);
722  glVertex2d(-mw, -t - length);
723  glVertex2d(-mw2, -t - length);
724  glVertex2d(-mw2, -t);
725  glEnd();
726  }
727  glPopMatrix();
728  }
729  }
730  // draw white boundings and white markings
731  glColor3d(1, 1, 1);
733  getShape(),
735  getShapeLengths(),
737  glPopMatrix();
738 }
739 
740 
741 void
743  // draw bike lane markings onto the intersection
744  glColor3d(1, 1, 1);
745  const int e = (int) getShape().size() - 1;
746  const double markWidth = 0.1;
747  const double mw = myHalfLaneWidth;
748  for (int i = 0; i < e; ++i) {
749  glPushMatrix();
750  glTranslated(getShape()[i].x(), getShape()[i].y(), GLO_JUNCTION + 0.4);
751  glRotated(myShapeRotations[i], 0, 0, 1);
752  for (double t = 0; t < myShapeLengths[i]; t += 0.5) {
753  // left and right marking
754  for (int side = -1; side <= 1; side += 2) {
755  glBegin(GL_QUADS);
756  glVertex2d(side * mw, -t);
757  glVertex2d(side * mw, -t - 0.35);
758  glVertex2d(side * (mw + markWidth), -t - 0.35);
759  glVertex2d(side * (mw + markWidth), -t);
760  glEnd();
761  }
762  }
763  glPopMatrix();
764  }
765 }
766 
767 void
768 GUILane::drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const {
769  glPushMatrix();
770  glTranslated(0, 0, GLO_EDGE);
771  int e = (int) getShape().size() - 1;
772  const double widthFactor = spreadSuperposed ? 0.4 : 1;
773  const double w = MAX2(POSITION_EPS, myWidth * widthFactor);
774  const double w2 = MAX2(POSITION_EPS, myHalfLaneWidth * widthFactor);
775  const double w4 = MAX2(POSITION_EPS, myQuarterLaneWidth * widthFactor);
776  const double sideOffset = spreadSuperposed ? w * -0.5 : 0;
777  for (int i = 0; i < e; ++i) {
778  glPushMatrix();
779  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1);
780  glRotated(myShapeRotations[i], 0, 0, 1);
781  for (double t = 0; t < myShapeLengths[i]; t += w) {
782  const double length = MIN2(w2, myShapeLengths[i] - t) * exaggeration;
783  glBegin(GL_TRIANGLES);
784  glVertex2d(sideOffset, -t - length);
785  glVertex2d(sideOffset - w4 * exaggeration, -t);
786  glVertex2d(sideOffset + w4 * exaggeration, -t);
787  glEnd();
788  }
789  glPopMatrix();
790  }
791  glPopMatrix();
792 }
793 
794 
795 void
797  glPushMatrix();
798  glColor3d(1.0, 0.3, 0.3);
799  const double orthoLength = 0.5;
800  const MSLink* link = getLinkCont().front();
801  const std::vector<const MSLane*>& foeLanes = link->getFoeLanes();
802  const std::vector<std::pair<double, double> >& lengthsBehind = link->getLengthsBehindCrossing();
803  if (foeLanes.size() == lengthsBehind.size()) {
804  for (int i = 0; i < (int)foeLanes.size(); ++i) {
805  const MSLane* l = foeLanes[i];
806  Position pos = l->geometryPositionAtOffset(l->getLength() - lengthsBehind[i].second);
807  PositionVector ortho = l->getShape().getOrthogonal(pos, 10, true, orthoLength);
808  if (ortho.length() < orthoLength) {
809  ortho.extrapolate(orthoLength - ortho.length(), false, true);
810  }
811  GLHelper::drawLine(ortho);
812  //std::cout << "foe=" << l->getID() << " lanePos=" << l->getLength() - lengthsBehind[i].second << " pos=" << pos << "\n";
813  }
814  }
815  glPopMatrix();
816 }
817 
818 
819 // ------ inherited from GUIGlObject
822  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
823  buildPopupHeader(ret, app);
825  //
826  new FXMenuCommand(ret, "Copy edge name to clipboard", nullptr, ret, MID_COPY_EDGE_NAME);
829  //
830  buildShowParamsPopupEntry(ret, false);
832  const double height = myShape.positionAtOffset(pos).z();
833  new FXMenuCommand(ret, ("pos: " + toString(pos) + " height: " + toString(height)).c_str(), nullptr, nullptr, 0);
834  new FXMenuSeparator(ret);
835  buildPositionCopyEntry(ret, false);
836  new FXMenuSeparator(ret);
837  if (myAmClosed) {
838  if (myPermissionChanges.empty()) {
839  new FXMenuCommand(ret, "Reopen lane", nullptr, &parent, MID_CLOSE_LANE);
840  new FXMenuCommand(ret, "Reopen edge", nullptr, &parent, MID_CLOSE_EDGE);
841  } else {
842  new FXMenuCommand(ret, "Reopen lane (override rerouter)", nullptr, &parent, MID_CLOSE_LANE);
843  new FXMenuCommand(ret, "Reopen edge (override rerouter)", nullptr, &parent, MID_CLOSE_EDGE);
844  }
845  } else {
846  new FXMenuCommand(ret, "Close lane", nullptr, &parent, MID_CLOSE_LANE);
847  new FXMenuCommand(ret, "Close edge", nullptr, &parent, MID_CLOSE_EDGE);
848  }
849  new FXMenuCommand(ret, "Add rerouter", nullptr, &parent, MID_ADD_REROUTER);
850  return ret;
851 }
852 
853 
856  GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 19 + (int)myEdge->getParametersMap().size());
857  // add items
858  ret->mkItem("maxspeed [m/s]", false, getSpeedLimit());
859  ret->mkItem("length [m]", false, myLength);
860  ret->mkItem("width [m]", false, myWidth);
861  ret->mkItem("street name", false, myEdge->getStreetName());
862  ret->mkItem("stored traveltime [s]", true, new FunctionBinding<GUILane, double>(this, &GUILane::getStoredEdgeTravelTime));
863  ret->mkItem("loaded weight", true, new FunctionBinding<GUILane, double>(this, &GUILane::getLoadedEdgeWeight));
864  ret->mkItem("routing speed [m/s]", true, new FunctionBinding<MSEdge, double>(myEdge, &MSEdge::getRoutingSpeed));
865  ret->mkItem("brutto occupancy [%]", true, new FunctionBinding<GUILane, double>(this, &GUILane::getBruttoOccupancy, 100.));
866  ret->mkItem("netto occupancy [%]", true, new FunctionBinding<GUILane, double>(this, &GUILane::getNettoOccupancy, 100.));
867  ret->mkItem("pending insertions [#]", true, new FunctionBinding<GUILane, double>(this, &GUILane::getPendingEmits));
868  ret->mkItem("edge type", false, myEdge->getEdgeType());
869  ret->mkItem("type", false, myLaneType);
870  ret->mkItem("priority", false, myEdge->getPriority());
871  ret->mkItem("distance [km]", false, myEdge->getDistance() / 1000);
872  ret->mkItem("allowed vehicle class", false, getVehicleClassNames(myPermissions));
873  ret->mkItem("disallowed vehicle class", false, getVehicleClassNames(~myPermissions));
874  ret->mkItem("permission code", false, myPermissions);
875  if (myEdge->getBidiEdge() != nullptr) {
876  ret->mkItem("bidi-edge", false, myEdge->getBidiEdge()->getID());
877  }
878  for (const auto& kv : myEdge->getParametersMap()) {
879  ret->mkItem(("edgeParam:" + kv.first).c_str(), false, kv.second);
880  }
881  ret->closeBuilding();
882  return ret;
883 }
884 
885 
886 Boundary
888  Boundary b;
889  b.add(myShape[0]);
890  b.add(myShape[-1]);
891  b.grow(10);
892  // ensure that vehicles and persons on the side are drawn even if the edge
893  // is outside the view
894  return b;
895 }
896 
897 
898 const PositionVector&
900  return myShape;
901 }
902 
903 
904 const std::vector<double>&
906  return myShapeRotations;
907 }
908 
909 
910 const std::vector<double>&
912  return myShapeLengths;
913 }
914 
915 
916 double
918  return myVehicles.size() == 0 ? 0 : myVehicles.back()->getWaitingSeconds();
919 }
920 
921 
922 double
924  return (double) myEdge->getLanes().size();
925 }
926 
927 
928 double
931  if (!ews.knowsTravelTime(myEdge)) {
932  return -1;
933  } else {
934  double value(0);
935  ews.retrieveExistingTravelTime(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
936  return value;
937  }
938 }
939 
940 
941 double
944  if (!ews.knowsEffort(myEdge)) {
945  return -1;
946  } else {
947  double value(-1);
948  ews.retrieveExistingEffort(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
949  return value;
950  }
951 }
952 
953 
954 RGBColor
956  // setting and retrieving the color does not work in OSGView so we return it explicitliy
957  RGBColor col;
958  if (MSGlobals::gUseMesoSim && static_cast<const GUIEdge*>(myEdge)->getMesoColor() != MESO_USE_LANE_COLOR) {
959  col = static_cast<const GUIEdge*>(myEdge)->getMesoColor();
960  } else {
961  const GUIColorer& c = s.laneColorer;
962  if (!setFunctionalColor(c, col) && !setMultiColor(s, c, col)) {
963  col = c.getScheme().getColor(getColorValue(s, c.getActive()));
964  }
965  }
966  GLHelper::setColor(col);
967  return col;
968 }
969 
970 
971 bool
972 GUILane::setFunctionalColor(const GUIColorer& c, RGBColor& col, int activeScheme) const {
973  if (activeScheme < 0) {
974  activeScheme = c.getActive();
975  }
976  switch (activeScheme) {
977  case 0:
978  if (myEdge->isCrossing()) {
979  // determine priority to decide color
981  if (link->havePriority() || link->getTLLogic() != nullptr) {
982  col = RGBColor(230, 230, 230);
983  } else {
984  col = RGBColor(26, 26, 26);
985  }
986  GLHelper::setColor(col);
987  return true;
988  } else {
989  return false;
990  }
991  case 18: {
992  double hue = GeomHelper::naviDegree(myShape.beginEndAngle()); // [0-360]
993  col = RGBColor::fromHSV(hue, 1., 1.);
994  GLHelper::setColor(col);
995  return true;
996  }
997  case 30: { // taz color
998  col = c.getScheme().getColor(0);
999  std::vector<RGBColor> tazColors;
1000  for (MSEdge* e : myEdge->getPredecessors()) {
1001  if (e->isTazConnector() && e->knowsParameter("tazColor")) {
1002  tazColors.push_back(RGBColor::parseColor(e->getParameter("tazColor")));
1003  }
1004  }
1005  for (MSEdge* e : myEdge->getSuccessors()) {
1006  if (e->isTazConnector() && e->knowsParameter("tazColor")) {
1007  tazColors.push_back(RGBColor::parseColor(e->getParameter("tazColor")));
1008  }
1009  }
1010  if (tazColors.size() > 0) {
1011  int randColor = RandHelper::rand((int)tazColors.size(), RGBColor::getColorRNG());
1012  col = tazColors[randColor];
1013  }
1014  GLHelper::setColor(col);
1015  return true;
1016  }
1017  default:
1018  return false;
1019  }
1020 }
1021 
1022 
1023 bool
1025  const int activeScheme = c.getActive();
1026  myShapeColors.clear();
1027  switch (activeScheme) {
1028  case 22: // color by height at segment start
1029  for (PositionVector::const_iterator ii = myShape.begin(); ii != myShape.end() - 1; ++ii) {
1030  myShapeColors.push_back(c.getScheme().getColor(ii->z()));
1031  }
1032  // osg fallback (edge height at start)
1033  col = c.getScheme().getColor(getColorValue(s, 21));
1034  return true;
1035  case 24: // color by inclination at segment start
1036  for (int ii = 1; ii < (int)myShape.size(); ++ii) {
1037  const double inc = (myShape[ii].z() - myShape[ii - 1].z()) / MAX2(POSITION_EPS, myShape[ii].distanceTo2D(myShape[ii - 1]));
1038  myShapeColors.push_back(c.getScheme().getColor(inc));
1039  }
1040  col = c.getScheme().getColor(getColorValue(s, 23));
1041  return true;
1042  default:
1043  return false;
1044  }
1045 }
1046 
1047 
1048 double
1049 GUILane::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const {
1050  switch (activeScheme) {
1051  case 0:
1052  switch (myPermissions) {
1053  case SVC_PEDESTRIAN:
1054  return 1;
1055  case SVC_BICYCLE:
1056  return 2;
1057  case 0:
1058  // forbidden road or green verge
1059  return myEdge->getPermissions() == 0 ? 9 : 3;
1060  case SVC_SHIP:
1061  return 4;
1062  case SVC_AUTHORITY:
1063  return 7;
1064  default:
1065  break;
1066  }
1067  if (myEdge->isTazConnector()) {
1068  return 8;
1069  } else if (isRailway(myPermissions)) {
1070  return 5;
1071  } else if ((myPermissions & SVC_PASSENGER) != 0) {
1072  return 0;
1073  } else {
1074  return 6;
1075  }
1076  case 1:
1077  return isLaneOrEdgeSelected();
1078  case 2:
1079  return (double)myPermissions;
1080  case 3:
1081  return getSpeedLimit();
1082  case 4:
1083  return getBruttoOccupancy();
1084  case 5:
1085  return getNettoOccupancy();
1086  case 6:
1087  return firstWaitingTime();
1088  case 7:
1089  return getEdgeLaneNumber();
1090  case 8:
1091  return getCO2Emissions() / myLength;
1092  case 9:
1093  return getCOEmissions() / myLength;
1094  case 10:
1095  return getPMxEmissions() / myLength;
1096  case 11:
1097  return getNOxEmissions() / myLength;
1098  case 12:
1099  return getHCEmissions() / myLength;
1100  case 13:
1101  return getFuelConsumption() / myLength;
1102  case 14:
1104  case 15: {
1105  return getStoredEdgeTravelTime();
1106  }
1107  case 16: {
1109  if (!ews.knowsTravelTime(myEdge)) {
1110  return -1;
1111  } else {
1112  double value(0);
1113  ews.retrieveExistingTravelTime(myEdge, 0, value);
1114  return 100 * myLength / value / getSpeedLimit();
1115  }
1116  }
1117  case 17: {
1118  // geometrical length has no meaning for walkingAreas since it describes the outer boundary
1119  return myEdge->isWalkingArea() ? 1 : 1 / myLengthGeometryFactor;
1120  }
1121  case 19: {
1122  return getLoadedEdgeWeight();
1123  }
1124  case 20: {
1125  return myEdge->getPriority();
1126  }
1127  case 21: {
1128  // color by z of first shape point
1129  return getShape()[0].z();
1130  }
1131  case 23: {
1132  // color by incline
1133  return (getShape()[-1].z() - getShape()[0].z()) / getLength();
1134  }
1135  case 25: {
1136  // color by average speed
1137  return getMeanSpeed();
1138  }
1139  case 26: {
1140  // color by average relative speed
1141  return getMeanSpeed() / myMaxSpeed;
1142  }
1143  case 27: {
1144  // color by routing device assumed speed
1145  return myEdge->getRoutingSpeed();
1146  }
1147  case 28:
1149  case 29:
1150  return getPendingEmits();
1151  case 31: {
1152  // by numerical edge param value
1153  try {
1155  } catch (NumberFormatException&) {
1156  try {
1158  } catch (BoolFormatException&) {
1159  WRITE_WARNING("Edge parameter '" + myEdge->getParameter(s.edgeParam, "0") + "' key '" + s.edgeParam + "' is not a number for edge '" + myEdge->getID() + "'");
1160  return -1;
1161  }
1162  }
1163  }
1164  case 32: {
1165  // by numerical lane param value
1166  try {
1168  } catch (NumberFormatException&) {
1169  try {
1170  return StringUtils::toBool(getParameter(s.laneParam, "0"));
1171  } catch (BoolFormatException&) {
1172  WRITE_WARNING("Lane parameter '" + getParameter(s.laneParam, "0") + "' key '" + s.laneParam + "' is not a number for lane '" + getID() + "'");
1173  return -1;
1174  }
1175  }
1176  }
1177  case 33: {
1178  // by edge data value
1180  }
1181  case 34: {
1182  return myEdge->getDistance();
1183  }
1184  case 35: {
1185  return fabs(myEdge->getDistance());
1186  }
1187  }
1188  return 0;
1189 }
1190 
1191 
1192 double
1193 GUILane::getScaleValue(int activeScheme) const {
1194  switch (activeScheme) {
1195  case 0:
1196  return 0;
1197  case 1:
1198  return isLaneOrEdgeSelected();
1199  case 2:
1200  return getSpeedLimit();
1201  case 3:
1202  return getBruttoOccupancy();
1203  case 4:
1204  return getNettoOccupancy();
1205  case 5:
1206  return firstWaitingTime();
1207  case 6:
1208  return getEdgeLaneNumber();
1209  case 7:
1210  return getCO2Emissions() / myLength;
1211  case 8:
1212  return getCOEmissions() / myLength;
1213  case 9:
1214  return getPMxEmissions() / myLength;
1215  case 10:
1216  return getNOxEmissions() / myLength;
1217  case 11:
1218  return getHCEmissions() / myLength;
1219  case 12:
1220  return getFuelConsumption() / myLength;
1221  case 13:
1223  case 14: {
1224  return getStoredEdgeTravelTime();
1225  }
1226  case 15: {
1228  if (!ews.knowsTravelTime(myEdge)) {
1229  return -1;
1230  } else {
1231  double value(0);
1232  ews.retrieveExistingTravelTime(myEdge, 0, value);
1233  return 100 * myLength / value / getSpeedLimit();
1234  }
1235  }
1236  case 16: {
1237  return 1 / myLengthGeometryFactor;
1238  }
1239  case 17: {
1240  return getLoadedEdgeWeight();
1241  }
1242  case 18: {
1243  return myEdge->getPriority();
1244  }
1245  case 19: {
1246  // scale by average speed
1247  return getMeanSpeed();
1248  }
1249  case 20: {
1250  // scale by average relative speed
1251  return getMeanSpeed() / myMaxSpeed;
1252  }
1253  case 21:
1255  case 22:
1257  }
1258  return 0;
1259 }
1260 
1261 
1262 bool
1265 }
1266 
1267 
1268 bool
1270  return isWaterway(myPermissions) && s.showRails && !s.drawForSelecting; // reusing the showRails setting
1271 }
1272 
1273 
1274 #ifdef HAVE_OSG
1275 void
1276 GUILane::updateColor(const GUIVisualizationSettings& s) {
1277  if (myGeom == 0) {
1278  // not drawn
1279  return;
1280  }
1281  const RGBColor col = setColor(s);
1282  osg::Vec4ubArray* colors = dynamic_cast<osg::Vec4ubArray*>(myGeom->getColorArray());
1283  (*colors)[0].set(col.red(), col.green(), col.blue(), col.alpha());
1284  myGeom->setColorArray(colors);
1285 }
1286 #endif
1287 
1288 
1289 void
1290 GUILane::closeTraffic(bool rebuildAllowed) {
1291  MSGlobals::gCheckRoutes = false;
1292  if (myAmClosed) {
1293  myPermissionChanges.clear(); // reset rerouters
1295  } else {
1297  }
1299  if (rebuildAllowed) {
1301  for (MSEdge* const pred : getEdge().getPredecessors()) {
1302  pred->rebuildAllowedTargets();
1303  }
1304  }
1305 }
1306 
1307 
1310  assert(MSGlobals::gUseMesoSim);
1311  int no = MELoop::numSegmentsFor(myLength, OptionsCont::getOptions().getFloat("meso-edgelength"));
1312  const double slength = myLength / no;
1313  PositionVector result = shape;
1314  double offset = 0;
1315  for (int i = 0; i < no; ++i) {
1316  offset += slength;
1317  Position pos = shape.positionAtOffset(offset);
1318  int index = result.indexOfClosest(pos);
1319  if (pos.distanceTo(result[index]) > POSITION_EPS) {
1320  index = result.insertAtClosest(pos);
1321  }
1322  while ((int)myShapeSegments.size() < index) {
1323  myShapeSegments.push_back(i);
1324  }
1325  //std::cout << "splitAtSegments " << getID() << " no=" << no << " i=" << i << " offset=" << offset << " index=" << index << " segs=" << toString(myShapeSegments) << " resultSize=" << result.size() << " result=" << toString(result) << "\n";
1326  }
1327  while (myShapeSegments.size() < result.size()) {
1328  myShapeSegments.push_back(no - 1);
1329  }
1330  return result;
1331 }
1332 
1333 bool
1335  return gSelected.isSelected(GLO_LANE, getGlID());
1336 }
1337 
1338 bool
1340  return isSelected() || gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
1341 }
1342 
1343 double
1346 }
1347 
1348 
1349 /****************************************************************************/
std::vector< int > myShapeSegments
the meso segment index for each geometry segment
Definition: GUILane.h:333
GUIVisualizationSizeSettings junctionSize
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
Definition: GUILane.cpp:768
The link is a partial left direction.
double getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
Definition: MSLane.cpp:2666
The link has green light, may pass.
static double gLateralResolution
Definition: MSGlobals.h:85
void debugDrawFoeIntersections() const
draw intersection positions of foe internal lanes with this one
Definition: GUILane.cpp:796
SVCPermissions myPermissions
The vClass permissions for this lane.
Definition: MSLane.h:1339
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Definition: MSLane.cpp:2532
double getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
Definition: GUILane.cpp:942
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Definition: GUILane.h:330
VehCont myVehicles
The lane&#39;s vehicles. This container holds all vehicles that have their front (longitudinally) and the...
Definition: MSLane.h:1286
static RGBColor parseColor(std::string coldef)
Parses a color information.
Definition: RGBColor.cpp:177
double getNOxEmissions() const
Returns the sum of last step NOx emissions.
Definition: MSLane.cpp:2761
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:670
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
long long int SUMOTime
Definition: SUMOTime.h:35
double scale
information about a lane&#39;s width (temporary, used for a single view)
add rerouter
Definition: GUIAppEnum.h:546
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
bool setFunctionalColor(const GUIColorer &c, RGBColor &col, int activeScheme=-1) const
Definition: GUILane.cpp:972
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:282
close edge
Definition: GUIAppEnum.h:544
const std::string myLaneType
the type of this lane
Definition: MSLane.h:1395
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:182
void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
Definition: GUILane.cpp:202
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0) const
return orthogonal through p (extending this vector if necessary)
double z() const
Returns the z-position.
Definition: Position.h:67
void drawLinkRules(const GUIVisualizationSettings &s, const GUINet &net) const
Definition: GUILane.cpp:278
virtual void removeParking(MSVehicle *veh)
remove parking vehicle. This must be syncrhonized when running with GUI
Definition: MSLane.cpp:3012
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
static const long CHANGE_PERMISSIONS_GUI
Definition: MSLane.h:1207
~GUILane()
Destructor.
Definition: GUILane.cpp:107
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
Definition: GUIEdge.cpp:510
bool isLaneOrEdgeSelected() const
whether this lane or its parent edge is selected in the GUI
Definition: GUILane.cpp:1339
void drawArrows() const
Definition: GUILane.cpp:390
GUILane(const std::string &id, double maxSpeed, double length, MSEdge *const edge, int numericalID, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel, const std::string &type)
Constructor.
Definition: GUILane.cpp:74
double getScaleValue(int activeScheme) const
gets the scaling value according to the current scheme index
Definition: GUILane.cpp:1193
int getLinkTLID(MSLink *link) const
Definition: GUINet.cpp:189
int indexOfClosest(const Position &p) const
index of the closest position to p
double getFuelConsumption() const
Returns the sum of last step fuel consumption.
Definition: MSLane.cpp:2785
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
Definition: GLHelper.cpp:750
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb.htm.
Definition: RGBColor.cpp:299
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:244
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
Definition: GUILane.cpp:1290
static const RGBColor MESO_USE_LANE_COLOR
special color to signify alternative coloring scheme
Definition: GUILane.h:353
double exaggeration
The size exaggeration (upscale)
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition: RGBColor.h:83
virtual void executeMovements(const SUMOTime t)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSLane.cpp:1703
GUIColorer laneColorer
The lane colorer.
The link has green light, has to brake.
Stores the information about how to visualize structures.
const MSEdgeVector & getPredecessors() const
Definition: MSEdge.h:352
vehicle is a bicycle
static void debugVertices(const PositionVector &shape, double size, double layer=256)
draw vertex numbers for the given shape (in a random color)
Definition: GLHelper.cpp:803
const double SUMO_const_laneWidth
Definition: StdDefs.h:50
double y() const
Returns the y-position.
Definition: Position.h:62
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
PositionVector splitAtSegments(const PositionVector &shape)
add intermediate points at segment borders
Definition: GUILane.cpp:1309
int myIndex
The lane index.
Definition: MSLane.h:1273
static double rand(std::mt19937 *rng=0)
Returns a random real number in [0, 1)
Definition: RandHelper.h:60
bool showRails
Information whether rails shall be drawn.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const GUINet &net) const
Definition: GUILane.cpp:238
void executeMovements(const SUMOTime t)
Definition: GUILane.cpp:153
The link is a 180 degree turn.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Notification
Definition of a vehicle state.
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function ...
Definition: GUILane.cpp:1024
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:2169
double x() const
Returns the x-position.
Definition: Position.h:57
void integrateNewVehicles()
Definition: GUILane.cpp:181
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
std::map< long long, SVCPermissions > myPermissionChanges
Definition: MSLane.h:1409
This is a dead end link.
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:165
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
Position getCentroid() const
Returns the centroid (closes the polygon if unclosed)
T MAX2(T a, T b)
Definition: StdDefs.h:80
bool retrieveExistingEffort(const MSEdge *const e, const double t, double &value) const
Returns an effort for an edge and time if stored.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
double getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:2749
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
Definition: GLHelper.cpp:82
double getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:541
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:478
bool showLaneDirection
Whether to show direction indicators for lanes.
PositionVector reverse() const
reverse position vector
unsigned char blue() const
Returns the blue-amount of the color.
Definition: RGBColor.h:76
bool laneShowBorders
Information whether lane borders shall be drawn.
This is an uncontrolled, right-before-left link.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUILane.cpp:887
#define RAD2DEG(x)
Definition: GeomHelper.h:39
const std::string & getID() const
Returns the id.
Definition: Named.h:77
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
bool showLinkRules
Information whether link rules (colored bars) shall be drawn.
A storage for edge travel times and efforts.
The link is controlled by a tls which is off, not blinking, may pass.
virtual double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:268
const MSJunction * getToJunction() const
Definition: MSEdge.h:361
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:905
int getNumericalID() const
Returns the numerical id of the edge.
Definition: MSEdge.h:263
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
double getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:557
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
const MSEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: MSEdge.h:247
std::vector< double > myShapeLengths
The lengths of the shape parts.
Definition: GUILane.h:327
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterway
Definition: GUILane.cpp:1269
The link is a (hard) left direction.
PositionVector myShape
The shape of the lane.
Definition: MSLane.h:1270
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
std::set< const MSVehicle * > myParkingVehicles
Definition: MSLane.h:1319
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
void setJunctionApproaches(const SUMOTime t) const
Definition: GUILane.cpp:146
authorities vehicles
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:276
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter ...
double getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
Definition: GUILane.cpp:929
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
The link is a straight direction.
MSLinkCont myLinks
Definition: MSLane.h:1373
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:1260
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
Definition: GLHelper.cpp:101
std::string edgeParam
key for coloring by edge parameter
bool isInternal() const
Definition: MSLane.cpp:1999
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:53
double firstWaitingTime() const
Definition: GUILane.cpp:917
A road/street connecting two junctions.
Definition: MSEdge.h:76
close lane
Definition: GUIAppEnum.h:542
bool constantSize
whether the object shall be drawn with constant size regardless of zoom
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:194
void rebuildAllowedLanes()
Definition: MSEdge.cpp:268
double myLength
Lane length [m].
Definition: MSLane.h:1322
int getIndex() const
Returns the lane&#39;s index.
Definition: MSLane.h:564
void removeParking(MSVehicle *veh)
remove parking vehicle
Definition: GUILane.cpp:167
double getEdgeLaneNumber() const
Definition: GUILane.cpp:923
void resetPermissions(long long transientID)
Definition: MSLane.cpp:3623
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUILane.cpp:855
double getEdgeData(const MSEdge *edge, const std::string &attr)
retrieve loaded edged weight for the given attribute and the current simulation time ...
Definition: GUINet.cpp:549
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
Definition: GUILane.cpp:117
void setPermissions(SVCPermissions permissions, long long transientID)
Sets the permissions to the given value. If a transientID is given, the permissions are recored as te...
Definition: MSLane.cpp:3611
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawLinkNo(const GUIVisualizationSettings &s) const
helper methods
Definition: GUILane.cpp:210
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
double nearest_offset_to_point25D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D projected onto the 3D geometry
virtual void resetPartialOccupation(MSVehicle *v)
Removes the information about a vehicle lapping into this lane.
Definition: MSLane.cpp:282
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
double getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:2725
const double SUMO_const_halfLaneWidth
Definition: StdDefs.h:52
static bool gCheckRoutes
Definition: MSGlobals.h:79
double minSize
The minimum size to draw this object.
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:516
double interpolateGeometryPosToLanePos(double geometryPos) const
Definition: MSLane.h:511
Copy edge name (for lanes only)
Definition: GUIAppEnum.h:373
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position ...
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter ...
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
A list of positions.
void planMovements(const SUMOTime t)
Definition: GUILane.cpp:140
void drawBikeMarkings() const
bike lane markings on top of an intersection
Definition: GUILane.cpp:742
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
double getPendingEmits() const
get number of vehicles waiting for departure on this lane
Definition: GUILane.cpp:1344
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
bool showSublanes
Whether to show sublane boundaries.
bool isSelected() const
whether this lane is selected in the GUI
Definition: GUILane.cpp:1334
const double SUMO_const_laneMarkWidth
Definition: StdDefs.h:56
double getSpeedLimit() const
Returns the lane&#39;s maximum allowed speed.
Definition: MSLane.h:533
double getRoutingSpeed() const
Returns the averaged speed used by the routing device.
Definition: MSEdge.cpp:797
#define STEPS2TIME(x)
Definition: SUMOTime.h:57
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIVisualizationTextSettings drawLinkTLIndex
T MIN2(T a, T b)
Definition: StdDefs.h:74
The link is a (hard) right direction.
RGBColor setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUILane.cpp:955
#define POSITION_EPS
Definition: config.h:169
const PositionVector & getShape() const
Definition: GUILane.cpp:899
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUILane.cpp:1049
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
Definition: GUILane.cpp:127
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
Definition: GUILane.cpp:160
int insertAtClosest(const Position &p)
inserts p between the two closest positions and returns the insertion index
const T getColor(const double value) const
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition: GUILane.cpp:1263
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: MSEdge.h:238
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:2158
bool isInternal() const
return whether this edge is an internal edge
Definition: MSEdge.h:233
double laneMinSize
The minimum visual lane width for drawing.
double getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:2773
GUIScaler edgeScaler
The mesoscopic edge scaler.
The link is a partial right direction.
bool lefthand() const
return whether the network was built for lefthand traffic
Definition: MSNet.h:662
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:93
vehicle is a passenger car (a "normal" car)
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:270
std::map< SVCPermissions, double > myStopOffsets
Definition: MSLane.h:1330
is an arbitrary ship
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: GUILane.cpp:174
const MSEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: MSEdge.cpp:998
virtual void setJunctionApproaches(const SUMOTime t) const
Register junction approaches for all vehicles after velocities have been planned. ...
Definition: MSLane.cpp:1202
virtual void integrateNewVehicles()
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:1929
double getElectricityConsumption() const
Returns the sum of last step electricity consumption.
Definition: MSLane.cpp:2797
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane borders and white markings
Definition: GUILane.cpp:701
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
double getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:2737
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, MSLink *link, const PositionVector &shape, double x1, double x2) const
Definition: GUILane.cpp:329
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
double length() const
Returns the length.
bool retrieveExistingTravelTime(const MSEdge *const e, const double t, double &value) const
Returns a travel time for an edge and time if stored.
bool isTazConnector() const
Definition: MSEdge.h:256
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:83
The link has yellow light, may pass.
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a &#39; &#39;.
MSInsertionControl & getInsertionControl()
Returns the insertion control.
Definition: MSNet.h:390
std::string edgeData
key for coloring by edgeData
unsigned char green() const
Returns the green-amount of the color.
Definition: RGBColor.h:69
The link is controlled by a tls which is off and blinks, has to brake.
static void drawCrossTies(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForSelecting)
draw crossties for railroads or pedestrian crossings
Definition: GLHelper.cpp:763
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:1333
void drawLane2LaneConnections(double exaggeration) const
Definition: GUILane.cpp:457
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:911
void detectCollisions(SUMOTime timestep, const std::string &stage)
Definition: GUILane.cpp:188
The link has red light (must brake)
The popup menu of a globject.
an edge
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
Definition: MSLane.h:505
This is an uncontrolled, major link, may pass.
double getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Definition: MSLane.cpp:2809
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
std::vector< double > myShapeRotations
The rotations of the shape parts.
Definition: GUILane.h:324
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
bool myAmClosed
state for dynamic lane closings
Definition: GUILane.h:346
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
GUIGlID getGlID() const
Returns the numerical id of the object.
unsigned char red() const
Returns the red-amount of the color.
Definition: RGBColor.h:62
bool isWalkingArea() const
return whether this edge is walking area
Definition: MSEdge.h:252
The link is a 180 degree turn (left-hand network)
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:440
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
Definition: Position.h:234
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
GUIVisualizationSizeSettings vehicleSize
bool drawJunctionShape
whether the shape of the junction should be drawn
double getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:2709
double setPartialOccupation(MSVehicle *v)
Sets the information about a vehicle lapping into this lane.
Definition: GUILane.cpp:195
const double myLengthGeometryFactor
precomputed myShape.length / myLength
Definition: MSLane.h:1389
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:484
SVCPermissions getPermissions() const
Definition: MSEdge.h:546
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:136
The link has yellow light, has to brake anyway.
const MSLinkCont & getLinkCont() const
returns the container with all links !!!
Definition: MSLane.cpp:2099
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUILane.h:350
static int numSegmentsFor(const double length, const double slength)
Compute number of segments per edge (best value stay close to the configured segment length) ...
Definition: MELoop.cpp:254
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
double getDistance() const
Returns the kilometrage/mileage at the start of the edge.
Definition: MSEdge.h:288
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUILane.cpp:821
double myHalfLaneWidth
Half of lane width, for speed-up.
Definition: GUILane.h:336
bool drawForSelecting
whether drawing is performed for the purpose of selecting objects
static std::mt19937 * getColorRNG()
Definition: RGBColor.h:113
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
GUIScaler laneScaler
The lane scaler.
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
double myQuarterLaneWidth
Quarter of lane width, for speed-up.
Definition: GUILane.h:339
double myMaxSpeed
Lane-wide speedlimit [m/s].
Definition: MSLane.h:1336
double getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:2681
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
GUISelectedStorage gSelected
A global holder of selected objects.
static bool gUseMesoSim
Definition: MSGlobals.h:91
Representation of a lane in the micro simulation.
Definition: MSLane.h:83
void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: GUILane.cpp:134
int getLinkTLIndex(MSLink *link) const
Definition: GUINet.cpp:204
A window containing a gl-object&#39;s parameter.
static const RGBColor & getLinkColor(const LinkState &ls)
map from LinkState to color constants
The link has red light (must brake) but indicates upcoming green.
GUIVisualizationTextSettings drawLinkJunctionIndex
const PositionVector & getShape() const
Returns this junction&#39;s shape.
Definition: MSJunction.h:90
int getPendingEmits(const MSLane *lane)
return the number of pending emits for the given lane
const double myWidth
Lane width [m].
Definition: MSLane.h:1325
bool showBikeMarkings
Information whether bicycle lane marking shall be drawn.
virtual void incorporateVehicle(MSVehicle *veh, double pos, double speed, double posLat, const MSLane::VehCont::iterator &at, MSMoveReminder::Notification notification=MSMoveReminder::NOTIFICATION_DEPARTED)
Inserts the vehicle into this lane, and informs it about entering the network.
Definition: MSLane.cpp:330
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
virtual void planMovements(const SUMOTime t)
Compute safe velocities for all vehicles based on positions and speeds from the last time step...
Definition: MSLane.cpp:1162
SumoXMLNodeType getType() const
return the type of this Junction
Definition: MSJunction.h:127
The link has no direction (is a dead end link)
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net&#39;s internal edge travel times/efforts container.
Definition: MSNet.cpp:820
a junction
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:622
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:54