SUMO - Simulation of Urban MObility
GUILane.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // Representation of a lane in the micro simulation (gui-version)
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <string>
34 #include <utility>
36 #include <utils/geom/GeomHelper.h>
37 #include <utils/geom/Position.h>
40 #include <utils/common/StdDefs.h>
41 #include <utils/geom/GeomHelper.h>
42 #include <utils/gui/div/GLHelper.h>
48 #include <microsim/MSGlobals.h>
49 #include <microsim/MSLane.h>
52 #include <microsim/MSNet.h>
54 #include "GUILane.h"
55 #include "GUIEdge.h"
56 #include "GUIVehicle.h"
57 #include "GUINet.h"
58 
59 #ifdef HAVE_OSG
60 #include <osg/Geometry>
61 #endif
62 
63 #ifdef CHECK_MEMORY_LEAKS
64 #include <foreign/nvwa/debug_new.h>
65 #endif // CHECK_MEMORY_LEAKS
66 
67 //#define GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
68 
69 // ===========================================================================
70 // method definitions
71 // ===========================================================================
72 GUILane::GUILane(const std::string& id, SUMOReal maxSpeed, SUMOReal length,
73  MSEdge* const edge, unsigned int numericalID,
74  const PositionVector& shape, SUMOReal width,
75  SVCPermissions permissions, unsigned int index) :
76  MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions),
77  GUIGlObject(GLO_LANE, id),
78  myAmClosed(false) {
79  myShapeRotations.reserve(myShape.size() - 1);
80  myShapeLengths.reserve(myShape.size() - 1);
81  myShapeColors.reserve(myShape.size() - 1);
82  int e = (int) myShape.size() - 1;
83  for (int i = 0; i < e; ++i) {
84  const Position& f = myShape[i];
85  const Position& s = myShape[i + 1];
86  myShapeLengths.push_back(f.distanceTo2D(s));
87  myShapeRotations.push_back(RAD2DEG(atan2(s.x() - f.x(), f.y() - s.y())));
88  }
89  //
92  myIndex = index;
93 }
94 
95 
97  // just to quit cleanly on a failure
98  if (myLock.locked()) {
99  myLock.unlock();
100  }
101 }
102 
103 
104 // ------ Vehicle insertion ------
105 void
107  const MSLane::VehCont::iterator& at,
108  MSMoveReminder::Notification notification) {
110  MSLane::incorporateVehicle(veh, pos, speed, at, notification);
111 }
112 
113 
114 // ------ Access to vehicles ------
115 const MSLane::VehCont&
117  myLock.lock();
118  return myVehicles;
119 }
120 
121 
122 void
124  myLock.unlock();
125 }
126 
127 
128 void
132 }
133 
134 
135 bool
136 GUILane::executeMovements(SUMOTime t, std::vector<MSLane*>& into) {
138  return MSLane::executeMovements(t, into);
139 }
140 
141 
142 MSVehicle*
143 GUILane::removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify) {
145  return MSLane::removeVehicle(remVehicle, notification, notify);
146 }
147 
148 
149 void
153 }
154 
155 
156 bool
159  return MSLane::integrateNewVehicle(t);
160 }
161 
162 
163 void
164 GUILane::detectCollisions(SUMOTime timestep, const std::string& stage) {
166  MSLane::detectCollisions(timestep, stage);
167 }
168 
169 
170 // ------ Drawing methods ------
171 void
173  unsigned int noLinks = (unsigned int)myLinks.size();
174  if (noLinks == 0) {
175  return;
176  }
177  // draw all links
178  if (getEdge().isCrossing()) {
179  // draw indices at the start and end of the crossing
181  PositionVector shape = getShape();
182  shape.extrapolate(0.5); // draw on top of the walking area
183  drawTextAtEnd(toString(link->getIndex()), shape, 0, s.drawLinkJunctionIndex);
185  return;
186  }
187  // draw all links
188  SUMOReal w = myWidth / (SUMOReal) noLinks;
190  const bool lefthand = MSNet::getInstance()->lefthand();
191  for (int i = noLinks; --i >= 0;) {
192  SUMOReal x2 = x1 - (SUMOReal)(w / 2.);
193  drawTextAtEnd(toString(myLinks[lefthand ? noLinks - 1 - i : i]->getIndex()), getShape(), x2, s.drawLinkJunctionIndex);
194  x1 -= w;
195  }
196 }
197 
198 
199 void
201  unsigned int noLinks = (unsigned int)myLinks.size();
202  if (noLinks == 0) {
203  return;
204  }
205  if (getEdge().isCrossing()) {
206  // draw indices at the start and end of the crossing
208  int linkNo = net.getLinkTLIndex(link);
209  if (linkNo >= 0) {
210  PositionVector shape = getShape();
211  shape.extrapolate(0.5); // draw on top of the walking area
212  drawTextAtEnd(toString(linkNo), shape, 0, s.drawLinkTLIndex);
213  drawTextAtEnd(toString(linkNo), shape.reverse(), 0, s.drawLinkTLIndex);
214  }
215  return;
216  }
217  // draw all links
218  SUMOReal w = myWidth / (SUMOReal) noLinks;
220  const bool lefthand = MSNet::getInstance()->lefthand();
221  for (int i = noLinks; --i >= 0;) {
222  SUMOReal x2 = x1 - (SUMOReal)(w / 2.);
223  int linkNo = net.getLinkTLIndex(myLinks[lefthand ? noLinks - 1 - i : i]);
224  if (linkNo < 0) {
225  continue;
226  }
227  drawTextAtEnd(toString(linkNo), getShape(), x2, s.drawLinkTLIndex);
228  x1 -= w;
229  }
230 }
231 
232 
233 void
234 GUILane::drawTextAtEnd(const std::string& text, const PositionVector& shape, SUMOReal x, const GUIVisualizationTextSettings& settings) const {
235  glPushMatrix();
236  const Position& end = shape.back();
237  const Position& f = shape[-2];
238  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
239  glTranslated(end.x(), end.y(), 0);
240  glRotated(rot, 0, 0, 1);
241  GLHelper::drawText(text, Position(x, 0.26), 0, .6 * settings.size / 50, settings.color, 180);
242  glPopMatrix();
243 }
244 
245 
246 void
248  unsigned int noLinks = (unsigned int)myLinks.size();
249  if (noLinks == 0) {
250  drawLinkRule(s, net, 0, getShape(), 0, 0);
251  return;
252  }
253  if (getEdge().isCrossing()) {
254  // draw rules at the start and end of the crossing
256  PositionVector shape = getShape();
257  shape.extrapolate(0.5); // draw on top of the walking area
258  drawLinkRule(s, net, link, shape, 0, myWidth);
259  drawLinkRule(s, net, link, shape.reverse(), 0, myWidth);
260  return;
261  }
262  // draw all links
263  SUMOReal w = myWidth / (SUMOReal) noLinks;
264  SUMOReal x1 = 0;
265  const bool lefthand = MSNet::getInstance()->lefthand();
266  for (unsigned int i = 0; i < noLinks; ++i) {
267  SUMOReal x2 = x1 + w;
268  drawLinkRule(s, net, myLinks[lefthand ? noLinks - 1 - i : i], getShape(), x1, x2);
269  x1 = x2;
270  }
271 }
272 
273 
274 void
275 GUILane::drawLinkRule(const GUIVisualizationSettings& s, const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const {
276  const Position& end = shape.back();
277  const Position& f = shape[-2];
278  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
279  if (link == 0) {
281  glPushMatrix();
282  glTranslated(end.x(), end.y(), 0);
283  glRotated(rot, 0, 0, 1);
284  glBegin(GL_QUADS);
285  glVertex2d(-myHalfLaneWidth, 0.0);
286  glVertex2d(-myHalfLaneWidth, 0.5);
287  glVertex2d(myHalfLaneWidth, 0.5);
288  glVertex2d(myHalfLaneWidth, 0.0);
289  glEnd();
290  glPopMatrix();
291  } else {
292  glPushMatrix();
293  glTranslated(end.x(), end.y(), 0);
294  glRotated(rot, 0, 0, 1);
295  // select glID
296  switch (link->getState()) {
299  case LINKSTATE_TL_RED:
304  glPushName(net.getLinkTLID(link));
305  break;
306  case LINKSTATE_MAJOR:
307  case LINKSTATE_MINOR:
308  case LINKSTATE_EQUAL:
310  default:
311  glPushName(getGlID());
312  break;
313  }
315  if (!(drawAsRailway(s) || drawAsWaterway(s)) || link->getState() != LINKSTATE_MAJOR) {
316  // the white bar should be the default for most railway
317  // links and looks ugly so we do not draw it
318  glBegin(GL_QUADS);
319  glVertex2d(x1 - myHalfLaneWidth, 0.0);
320  glVertex2d(x1 - myHalfLaneWidth, 0.5);
321  glVertex2d(x2 - myHalfLaneWidth, 0.5);
322  glVertex2d(x2 - myHalfLaneWidth, 0.0);
323  glEnd();
324  }
325  glPopName();
326  glPopMatrix();
327  }
328 }
329 
330 void
332  if (myLinks.size() == 0) {
333  return;
334  }
335  // draw all links
336  const Position& end = getShape().back();
337  const Position& f = getShape()[-2];
338  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
339  glPushMatrix();
340  glColor3d(1, 1, 1);
341  glTranslated(end.x(), end.y(), 0);
342  glRotated(rot, 0, 0, 1);
344  glScaled(myWidth / SUMO_const_laneWidth, 1, 1);
345  }
346  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
347  LinkDirection dir = (*i)->getDirection();
348  LinkState state = (*i)->getState();
349  if (state == LINKSTATE_TL_OFF_NOSIGNAL || dir == LINKDIR_NODIR) {
350  continue;
351  }
352  switch (dir) {
353  case LINKDIR_STRAIGHT:
354  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
356  break;
357  case LINKDIR_TURN:
358  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
359  GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
360  GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
361  GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (SUMOReal) 1, (SUMOReal) .25);
362  break;
364  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
365  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
366  GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05);
367  GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (SUMOReal) 1, (SUMOReal) .25);
368  break;
369  case LINKDIR_LEFT:
370  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
371  GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
372  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (SUMOReal) 1, (SUMOReal) .25);
373  break;
374  case LINKDIR_RIGHT:
375  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
376  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
377  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (SUMOReal) 1, (SUMOReal) .25);
378  break;
379  case LINKDIR_PARTLEFT:
380  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
381  GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
382  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (SUMOReal) 1, (SUMOReal) .25);
383  break;
384  case LINKDIR_PARTRIGHT:
385  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
386  GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
387  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (SUMOReal) 1, (SUMOReal) .25);
388  break;
389  default:
390  break;
391  }
392  }
393  glPopMatrix();
394 }
395 
396 
397 void
399  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
400  const MSLane* connected = (*i)->getLane();
401  if (connected == 0) {
402  continue;
403  }
404  GLHelper::setColor(getLinkColor((*i)->getState()));
405  glBegin(GL_LINES);
406  const Position& p1 = getShape()[-1];
407  const Position& p2 = connected->getShape()[0];
408  glVertex2f(p1.x(), p1.y());
409  glVertex2f(p2.x(), p2.y());
410  glEnd();
411  GLHelper::drawTriangleAtEnd(p1, p2, (SUMOReal) .4, (SUMOReal) .2);
412  }
413 }
414 
415 
416 void
418  glPushMatrix();
419  glPushName(getGlID());
420  const bool isCrossing = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_CROSSING;
421  const bool isWalkingArea = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_WALKINGAREA;
422  const bool isInternal = isCrossing || isWalkingArea || myEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL;
423  bool mustDrawMarkings = false;
424  SUMOReal exaggeration = s.laneWidthExaggeration;
426 #ifdef HAVE_INTERNAL
427  GUIEdge* myGUIEdge = dynamic_cast<GUIEdge*>(myEdge);
428  exaggeration *= s.edgeScaler.getScheme().getColor(myGUIEdge->getScaleValue(s.edgeScaler.getActive()));
429 #endif
430  } else {
432  }
433  const bool drawDetails = s.scale * exaggeration > 5;
434  if (isCrossing || isWalkingArea) {
435  // draw internal lanes on top of junctions
436  glTranslated(0, 0, GLO_JUNCTION + 0.1);
437  } else if (isWaterway(myPermissions)) {
438  // draw waterways below normal roads
439  glTranslated(0, 0, getType() - 0.2);
440  } else {
441  glTranslated(0, 0, getType());
442  }
443  // set lane color
444  if (!MSGlobals::gUseMesoSim) {
445  setColor(s);
446  }
447  // recognize full transparency and simply don't draw
448  GLfloat color[4];
449  glGetFloatv(GL_CURRENT_COLOR, color);
450  if (color[3] != 0) {
451  // draw lane
452  // check whether it is not too small
453  if (s.scale * exaggeration < 1.) {
454  if (myShapeColors.size() > 0) {
456  } else {
458  }
459  glPopMatrix();
460  } else {
461  GUINet* net = (GUINet*) MSNet::getInstance();
462  if (drawAsRailway(s)) {
463  // draw as railway
464  const SUMOReal halfRailWidth = 0.725 * exaggeration;
465  if (myShapeColors.size() > 0) {
467  } else {
469  }
470  glColor3d(1, 1, 1);
471  glTranslated(0, 0, .1);
473  if (!MSGlobals::gUseMesoSim) {
474  setColor(s);
475  }
476  drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration);
477  } else if (isCrossing) {
479  // determine priority to decide color
481  if (link->havePriority() || net->getLinkTLIndex(link) > 0) {
482  glColor3d(0.9, 0.9, 0.9);
483  } else {
484  glColor3d(0.1, 0.1, 0.1);
485  }
486  glTranslated(0, 0, .2);
487  drawCrossties(0.5, 1.0, getWidth() * 0.5);
488  glTranslated(0, 0, -.2);
489  }
490  } else if (isWalkingArea) {
492  glTranslated(0, 0, .2);
493  if (s.scale * exaggeration < 20.) {
495  } else {
497  }
498  glTranslated(0, 0, -.2);
499 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
501 #endif
502  }
503  } else {
504  const SUMOReal halfWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth;
505  mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN && exaggeration == 1.0 && !isWaterway(myPermissions);
506  const int cornerDetail = drawDetails && !isInternal ? s.scale * exaggeration : 0;
507  const SUMOReal offset = halfWidth * MAX2((SUMOReal)0, (exaggeration - 1));
508  if (myShapeColors.size() > 0) {
509  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfWidth * exaggeration, cornerDetail, offset);
510  } else {
511  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfWidth * exaggeration, cornerDetail, offset);
512  }
513  }
514  glPopMatrix();
515  // draw ROWs (not for inner lanes)
516  if ((!isInternal || isCrossing) && drawDetails) {
517  glPushMatrix();
518  glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape
519  glTranslated(0, 0, .5);
520  drawLinkRules(s, *net);
522  drawArrows();
523  }
524  if (s.showLane2Lane) {
525  // this should be independent to the geometry:
526  // draw from end of first to the begin of second
528  }
529  glTranslated(0, 0, .1);
530  if (s.drawLinkJunctionIndex.show) {
531  drawLinkNo(s);
532  }
533  if (s.drawLinkTLIndex.show) {
534  drawTLSLinkNo(s, *net);
535  }
536  glPopMatrix();
537  }
538  }
539  if (mustDrawMarkings && drawDetails) { // needs matrix reset
540  drawMarkings(s, exaggeration);
541  }
542  if (drawDetails && isInternal && myPermissions == SVC_BICYCLE && exaggeration == 1.0 && s.showLinkDecals) {
544  }
545  } else {
546  glPopMatrix();
547  }
548  // draw vehicles
550  // retrieve vehicles from lane; disallow simulation
551  const MSLane::VehCont& vehicles = getVehiclesSecure();
552  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
553  if ((*v)->getLane() == this) {
554  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
555  } // else: this is the shadow during a continuous lane change
556  }
557  // draw parking vehicles
558  const std::set<const MSVehicle*> parking = MSVehicleTransfer::getInstance()->getParkingVehicles(this);
559  for (std::set<const MSVehicle*>::const_iterator v = parking.begin(); v != parking.end(); ++v) {
560  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
561  }
562  // allow lane simulation
563  releaseVehicles();
564  }
565  glPopName();
566 }
567 
568 
569 void
571  glPushMatrix();
572  glTranslated(0, 0, GLO_EDGE);
573 #ifdef HAVE_INTERNAL
575 #endif
576  setColor(s);
577  // optionally draw inverse markings
578  if (myIndex > 0 && (myEdge->getLanes()[myIndex - 1]->getPermissions() & myPermissions) != 0) {
579  SUMOReal mw = (myHalfLaneWidth + SUMO_const_laneOffset + .01) * scale * (MSNet::getInstance()->lefthand() ? -1 : 1);
580  int e = (int) getShape().size() - 1;
581  for (int i = 0; i < e; ++i) {
582  glPushMatrix();
583  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1);
584  glRotated(myShapeRotations[i], 0, 0, 1);
585  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 6) {
586  const SUMOReal length = MIN2((SUMOReal)3, myShapeLengths[i] - t);
587  glBegin(GL_QUADS);
588  glVertex2d(-mw, -t);
589  glVertex2d(-mw, -t - length);
590  glVertex2d(myQuarterLaneWidth * scale, -t - length);
591  glVertex2d(myQuarterLaneWidth * scale, -t);
592  glEnd();
593  }
594  glPopMatrix();
595  }
596  }
597  // draw white boundings and white markings
598  glColor3d(1, 1, 1);
600  getShape(),
602  getShapeLengths(),
604  glPopMatrix();
605 }
606 
607 
608 void
610  // draw bike lane markings onto the intersection
611  glColor3d(1, 1, 1);
612  int e = (int) getShape().size() - 1;
614  for (int i = 0; i < e; ++i) {
615  glPushMatrix();
616  glTranslated(getShape()[i].x(), getShape()[i].y(), GLO_JUNCTION + 0.1);
617  glRotated(myShapeRotations[i], 0, 0, 1);
618  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 0.5) {
619  // left and right marking
620  for (int side = -1; side <= 1; side += 2) {
621  glBegin(GL_QUADS);
622  glVertex2d(side * mw, -t);
623  glVertex2d(side * mw, -t - 0.35);
624  glVertex2d(side * (mw + SUMO_const_laneOffset), -t - 0.35);
625  glVertex2d(side * (mw + SUMO_const_laneOffset), -t);
626  glEnd();
627  }
628  }
629  glPopMatrix();
630  }
631 }
632 
633 void
634 GUILane::drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const {
635  glPushMatrix();
636  // draw on top of of the white area between the rails
637  glTranslated(0, 0, 0.1);
638  int e = (int) getShape().size() - 1;
639  for (int i = 0; i < e; ++i) {
640  glPushMatrix();
641  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.0);
642  glRotated(myShapeRotations[i], 0, 0, 1);
643  for (SUMOReal t = 0; t < myShapeLengths[i]; t += spacing) {
644  glBegin(GL_QUADS);
645  glVertex2d(-halfWidth, -t);
646  glVertex2d(-halfWidth, -t - length);
647  glVertex2d(halfWidth, -t - length);
648  glVertex2d(halfWidth, -t);
649  glEnd();
650  }
651  glPopMatrix();
652  }
653  glPopMatrix();
654 }
655 
656 // ------ inherited from GUIGlObject
659  GUISUMOAbstractView& parent) {
660  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
661  buildPopupHeader(ret, app);
663  //
664  new FXMenuCommand(ret, "Copy edge name to clipboard", 0, ret, MID_COPY_EDGE_NAME);
667  //
668  buildShowParamsPopupEntry(ret, false);
671  new FXMenuCommand(ret, ("pos: " + toString(pos) + " height: " + toString(height)).c_str(), 0, 0, 0);
672  new FXMenuSeparator(ret);
673  buildPositionCopyEntry(ret, false);
674  new FXMenuSeparator(ret);
675  if (myAmClosed) {
676  new FXMenuCommand(ret, "Reopen lane", 0, &parent, MID_CLOSE_LANE);
677  new FXMenuCommand(ret, "Reopen edge", 0, &parent, MID_CLOSE_EDGE);
678  } else {
679  new FXMenuCommand(ret, "Close lane", 0, &parent, MID_CLOSE_LANE);
680  new FXMenuCommand(ret, "Close edge", 0, &parent, MID_CLOSE_EDGE);
681  }
682  new FXMenuCommand(ret, "Add rerouter", 0, &parent, MID_ADD_REROUTER);
683  return ret;
684 }
685 
686 
690  GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 11);
691  // add items
692  ret->mkItem("maxspeed [m/s]", false, getSpeedLimit());
693  ret->mkItem("length [m]", false, myLength);
694  ret->mkItem("width [m]", false, myWidth);
695  ret->mkItem("street name", false, myEdge->getStreetName());
696  ret->mkItem("stored traveltime [s]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getStoredEdgeTravelTime));
697  ret->mkItem("loaded weight", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getLoadedEdgeWeight));
698  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getBruttoOccupancy, 100.));
699  ret->mkItem("edge type", false, myEdge->getEdgeType());
700  ret->mkItem("priority", false, myEdge->getPriority());
701  ret->mkItem("allowed vehicle class", false, getVehicleClassNames(myPermissions));
702  ret->mkItem("disallowed vehicle class", false, getVehicleClassNames(~myPermissions));
703  ret->mkItem("permission code", false, myPermissions);
704  // close building
705  ret->closeBuilding();
706  return ret;
707 }
708 
709 
710 Boundary
712  Boundary b;
713  b.add(myShape[0]);
714  b.add(myShape[-1]);
715  b.grow(20);
716  return b;
717 }
718 
719 
720 
721 
722 
723 
724 
725 const PositionVector&
727  return myShape;
728 }
729 
730 
731 const std::vector<SUMOReal>&
733  return myShapeRotations;
734 }
735 
736 
737 const std::vector<SUMOReal>&
739  return myShapeLengths;
740 }
741 
742 
743 SUMOReal
745  return myVehicles.size() == 0 ? 0 : myVehicles.back()->getWaitingSeconds();
746 }
747 
748 
749 SUMOReal
751  return (SUMOReal) myEdge->getLanes().size();
752 }
753 
754 
755 SUMOReal
758  if (!ews.knowsTravelTime(myEdge)) {
759  return -1;
760  } else {
761  SUMOReal value(0);
762  ews.retrieveExistingTravelTime(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
763  return value;
764  }
765 }
766 
767 
768 SUMOReal
771  if (!ews.knowsEffort(myEdge)) {
772  return -1;
773  } else {
774  SUMOReal value(0);
775  ews.retrieveExistingEffort(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
776  return value;
777  }
778 }
779 
780 
781 void
783  const GUIColorer& c = s.laneColorer;
784  if (!setFunctionalColor(c.getActive()) && !setMultiColor(c)) {
786  }
787 }
788 
789 
790 bool
791 GUILane::setFunctionalColor(size_t activeScheme) const {
792  switch (activeScheme) {
793  case 18: {
796  return true;
797  }
798  default:
799  return false;
800  }
801 }
802 
803 
804 bool
806  const size_t activeScheme = c.getActive();
807  myShapeColors.clear();
808  switch (activeScheme) {
809  case 22: // color by height at segment start
810  for (PositionVector::const_iterator ii = myShape.begin(); ii != myShape.end() - 1; ++ii) {
811  myShapeColors.push_back(c.getScheme().getColor(ii->z()));
812  }
813  return true;
814  case 24: // color by inclination at segment start
815  for (int ii = 1; ii < (int)myShape.size(); ++ii) {
816  const SUMOReal inc = (myShape[ii].z() - myShape[ii - 1].z()) / MAX2(POSITION_EPS, myShape[ii].distanceTo2D(myShape[ii - 1]));
817  myShapeColors.push_back(c.getScheme().getColor(inc));
818  }
819  return true;
820  default:
821  return false;
822  }
823 }
824 
825 
826 SUMOReal
827 GUILane::getColorValue(size_t activeScheme) const {
828  switch (activeScheme) {
829  case 0:
830  switch (myPermissions) {
831  case SVC_PEDESTRIAN:
832  return 1;
833  case SVC_BICYCLE:
834  return 2;
835  case 0:
836  return 3;
837  case SVC_SHIP:
838  return 4;
839  case SVC_AUTHORITY:
840  return 6;
841  default:
842  break;
843  }
845  return 0;
846  } else {
847  return 5;
848  }
849  case 1:
850  return gSelected.isSelected(getType(), getGlID()) ||
851  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
852  case 2:
853  return (SUMOReal)myPermissions;
854  case 3:
855  return getSpeedLimit();
856  case 4:
857  return getBruttoOccupancy();
858  case 5:
859  return getNettoOccupancy();
860  case 6:
861  return firstWaitingTime();
862  case 7:
863  return getEdgeLaneNumber();
864  case 8:
865  return getCO2Emissions() / myLength;
866  case 9:
867  return getCOEmissions() / myLength;
868  case 10:
869  return getPMxEmissions() / myLength;
870  case 11:
871  return getNOxEmissions() / myLength;
872  case 12:
873  return getHCEmissions() / myLength;
874  case 13:
875  return getFuelConsumption() / myLength;
876  case 14:
878  case 15: {
879  return getStoredEdgeTravelTime();
880  }
881  case 16: {
883  if (!ews.knowsTravelTime(myEdge)) {
884  return -1;
885  } else {
886  SUMOReal value(0);
887  ews.retrieveExistingTravelTime(myEdge, 0, value);
888  return 100 * myLength / value / getSpeedLimit();
889  }
890  }
891  case 17: {
892  return 1 / myLengthGeometryFactor;
893  }
894  case 19: {
895  return getLoadedEdgeWeight();
896  }
897  case 20: {
898  return myEdge->getPriority();
899  }
900  case 21: {
901  // color by z of first shape point
902  return getShape()[0].z();
903  }
904  case 23: {
905  // color by incline
906  return (getShape()[-1].z() - getShape()[0].z()) / getLength();
907  }
908  case 25: {
909  // color by average speed
910  return getMeanSpeed();
911  }
912  case 26: {
913  // color by average relative speed
914  return getMeanSpeed() / myMaxSpeed;
915  }
916  }
917  return 0;
918 }
919 
920 
921 SUMOReal
922 GUILane::getScaleValue(size_t activeScheme) const {
923  switch (activeScheme) {
924  case 0:
925  return 0;
926  case 1:
927  return gSelected.isSelected(getType(), getGlID()) ||
928  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
929  case 2:
930  return getSpeedLimit();
931  case 3:
932  return getBruttoOccupancy();
933  case 4:
934  return getNettoOccupancy();
935  case 5:
936  return firstWaitingTime();
937  case 6:
938  return getEdgeLaneNumber();
939  case 7:
940  return getCO2Emissions() / myLength;
941  case 8:
942  return getCOEmissions() / myLength;
943  case 9:
944  return getPMxEmissions() / myLength;
945  case 10:
946  return getNOxEmissions() / myLength;
947  case 11:
948  return getHCEmissions() / myLength;
949  case 12:
950  return getFuelConsumption() / myLength;
951  case 13:
953  case 14: {
954  return getStoredEdgeTravelTime();
955  }
956  case 15: {
958  if (!ews.knowsTravelTime(myEdge)) {
959  return -1;
960  } else {
961  SUMOReal value(0);
962  ews.retrieveExistingTravelTime(myEdge, 0, value);
963  return 100 * myLength / value / getSpeedLimit();
964  }
965  }
966  case 16: {
967  return 1 / myLengthGeometryFactor;
968  }
969  case 17: {
970  return getLoadedEdgeWeight();
971  }
972  case 18: {
973  return myEdge->getPriority();
974  }
975  case 19: {
976  // scale by average speed
977  return getMeanSpeed();
978  }
979  case 20: {
980  // scale by average relative speed
981  return getMeanSpeed() / myMaxSpeed;
982  }
983  }
984  return 0;
985 }
986 
987 
988 bool
990  return isRailway(myPermissions) && s.showRails;
991 }
992 
993 
994 bool
996  return isWaterway(myPermissions) && s.showRails; // reusing the showRails setting
997 }
998 
999 
1000 #ifdef HAVE_OSG
1001 void
1002 GUILane::updateColor(const GUIVisualizationSettings& s) {
1004  osg::Vec4ubArray* colors = dynamic_cast<osg::Vec4ubArray*>(myGeom->getColorArray());
1005  (*colors)[0].set(col.red(), col.green(), col.blue(), col.alpha());
1006  myGeom->setColorArray(colors);
1007 }
1008 #endif
1009 
1010 
1011 void
1012 GUILane::closeTraffic(bool rebuildAllowed) {
1013  MSGlobals::gCheckRoutes = false;
1014  if (myAmClosed) {
1016  } else {
1019  }
1021  if (rebuildAllowed) {
1023  }
1024 }
1025 
1026 /****************************************************************************/
1027 
The link is a partial left direction.
The link has green light, may pass.
SVCPermissions myPermissions
The vClass permissions for this lane.
Definition: MSLane.h:863
void drawLane2LaneConnections() const
Definition: GUILane.cpp:398
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Definition: GUILane.h:299
VehCont myVehicles
The lane&#39;s vehicles. The entering vehicles are inserted at the front of this container and the leavin...
Definition: MSLane.h:840
const std::vector< SUMOReal > & getShapeRotations() const
Definition: GUILane.cpp:732
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:461
bool lefthand() const
return whether the network was built for lefthand traffic
Definition: MSNet.h:638
Representation of a vehicle in the micro simulation.
Definition: MSVehicle.h:80
SUMOReal getScaleValue(size_t activeScheme) const
gets the scaling value according to the current scheme index
Definition: GUILane.cpp:922
long long int SUMOTime
Definition: SUMOTime.h:43
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
SUMOReal getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
Definition: GUILane.cpp:769
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUILane.cpp:782
const SUMOReal SUMO_const_laneWidth
Definition: StdDefs.h:49
is a pedestrian
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v)
Converts the given hsv-triplet to rgb.
Definition: RGBColor.cpp:294
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void drawLinkRules(const GUIVisualizationSettings &s, const GUINet &net) const
Definition: GUILane.cpp:247
~GUILane()
Destructor.
Definition: GUILane.cpp:96
unsigned int myIndex
The lane index.
Definition: GUILane.h:308
static void debugVertices(const PositionVector &shape, SUMOReal size, SUMOReal layer=256)
draw vertex numbers for the given shape (in a random color)
Definition: GLHelper.cpp:518
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:186
Copy edge name (for lanes only)
Definition: GUIAppEnum.h:223
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
Definition: GUILane.cpp:1012
GUIColorer laneColorer
The lane colorer.
The link has green light, has to brake.
Stores the information about how to visualize structures.
SUMOReal getLength() const
Returns the lane&#39;s length.
Definition: MSLane.h:376
vehicle is a bicycle
int SVCPermissions
void drawTextAtEnd(const std::string &text, const PositionVector &shape, SUMOReal x, const GUIVisualizationTextSettings &settings) const
Definition: GUILane.cpp:234
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:960
bool showRails
Information whether rails shall be drawn.
The link is a 180 degree turn.
const RGBColor & getLinkColor(const LinkState &ls)
Definition: StdDefs.cpp:53
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:417
Notification
Definition of a vehicle state.
SUMOReal getFuelConsumption() const
Returns the sum of last step fuel consumption.
Definition: MSLane.cpp:1632
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:1086
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width, int cornerDetail=0, SUMOReal offset=0)
Draws thick lines.
Definition: GLHelper.cpp:176
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:264
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, 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:126
SUMOReal getWidth() const
Returns the lane&#39;s width.
Definition: MSLane.h:392
void drawMarkings(const GUIVisualizationSettings &s, SUMOReal scale) const
draw lane borders and white markings
Definition: GUILane.cpp:570
This is a dead end link.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:162
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:1522
T MAX2(T a, T b)
Definition: StdDefs.h:79
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width, SUMOReal offset=0)
Draws a thick line.
Definition: GLHelper.cpp:130
SVCPermissions myOriginalPermissions
Definition: GUILane.h:316
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
static void drawFilledPoly(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
Definition: GLHelper.cpp:76
This is an uncontrolled, right-before-left link.
const std::vector< SUMOReal > & getShapeLengths() const
Definition: GUILane.cpp:738
#define RAD2DEG(x)
Definition: GeomHelper.h:46
static void drawText(const std::string &text, const Position &pos, const SUMOReal layer, const SUMOReal size, const RGBColor &col=RGBColor::BLACK, const SUMOReal angle=0)
draw Text with given parameters
Definition: GLHelper.cpp:460
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
const SUMOReal SUMO_const_laneOffset
Definition: StdDefs.h:52
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
const SUMOReal myWidth
Lane width [m].
Definition: MSLane.h:846
void drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const
draw crossties for railroads or pedestrian crossings
Definition: GUILane.cpp:634
void drawArrows() const
Definition: GUILane.cpp:331
SUMOReal beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position ...
A storage for edge travel times and efforts.
The link is controlled by a tls which is off, not blinking, may pass.
SUMOReal x() const
Returns the x-position.
Definition: Position.h:63
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.
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
SUMOReal myMaxSpeed
Lane-wide speedlimit [m/s].
Definition: MSLane.h:852
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:123
static void drawTriangleAtEnd(const Position &p1, const Position &p2, SUMOReal tLength, SUMOReal tWidth)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:422
bool integrateNewVehicle(SUMOTime t)
Definition: GUILane.cpp:157
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
bool setMultiColor(const GUIColorer &c) const
sets multiple colors according to the current scheme index and some lane function ...
Definition: GUILane.cpp:805
const std::set< const MSVehicle * > & getParkingVehicles(const MSLane *lane) const
return parking vehicles on the given lane
The link is a (hard) left direction.
PositionVector myShape
The shape of the lane.
Definition: MSLane.h:558
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:1620
SUMOReal scale
information about a lane&#39;s width (temporary, used for a single view)
void drawBikeMarkings() const
bike lane markings on top of an intersection
Definition: GUILane.cpp:609
authorities vehicles
PositionVector reverse() const
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)...
virtual bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Executes planned vehicle movements with regards to right-of-way.
Definition: MSLane.cpp:774
unsigned char blue() const
Returns the blue-amount of the color.
Definition: RGBColor.h:91
The link is a straight direction.
MSLinkCont myLinks
Definition: MSLane.h:887
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:707
static void drawFilledPolyTesselated(const PositionVector &v, bool close)
Draws a filled polygon described by the list of points.
Definition: GLHelper.cpp:95
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:62
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
Definition: GUILane.h:293
A road/street connecting two junctions.
Definition: MSEdge.h:81
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:167
void rebuildAllowedLanes()
Definition: MSEdge.cpp:175
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Definition: MSLane.cpp:1420
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUILane.cpp:688
void drawLinkNo(const GUIVisualizationSettings &s) const
helper methods
Definition: GUILane.cpp:172
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:443
bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Definition: GUILane.cpp:136
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUILane.h:320
static bool gCheckRoutes
Definition: MSGlobals.h:80
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUILane.cpp:711
This is an uncontrolled, minor link, has to brake.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
void planMovements(const SUMOTime t)
Definition: GUILane.cpp:129
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition: RGBColor.h:99
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterway
Definition: GUILane.cpp:995
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:1556
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
Definition: GUILane.h:296
SUMOReal z() const
Returns the z-position.
Definition: Position.h:73
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic, in MSLink and GNEInternalLane.
int getLinkTLIndex(MSLink *link) const
Definition: GUINet.cpp:213
const T getColor(const SUMOReal value) const
SUMOReal firstWaitingTime() const
Definition: GUILane.cpp:744
GUIVisualizationTextSettings drawLinkTLIndex
T MIN2(T a, T b)
Definition: StdDefs.h:73
The link is a (hard) right direction.
#define POSITION_EPS
Definition: config.h:188
SUMOReal getSpeedLimit() const
Returns the lane&#39;s maximum allowed speed.
Definition: MSLane.h:368
GUILane(const std::string &id, SUMOReal maxSpeed, SUMOReal length, MSEdge *const edge, unsigned int numericalID, const PositionVector &shape, SUMOReal width, SVCPermissions permissions, unsigned int index)
Constructor.
Definition: GUILane.cpp:72
float minSize
The minimum size to draw this object.
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
Definition: GUILane.cpp:143
SUMOReal myLength
Lane length [m].
Definition: MSLane.h:843
virtual void incorporateVehicle(MSVehicle *veh, SUMOReal pos, SUMOReal speed, 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:106
bool setFunctionalColor(size_t activeScheme) const
sets the color according to the current scheme index and some lane function
Definition: GUILane.cpp:791
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:1079
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
The link is a partial right direction.
std::string getVehicleClassNames(SVCPermissions permissions)
Returns the ids of the given classes, divided using a &#39; &#39;.
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:270
vehicle is a passenger car (a "normal" car)
SUMOReal getEdgeLaneNumber() const
Definition: GUILane.cpp:750
static SUMOReal naviDegree(const SUMOReal angle)
Definition: GeomHelper.cpp:191
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, MSLink *link, const PositionVector &shape, SUMOReal x1, SUMOReal x2) const
Definition: GUILane.cpp:275
is an arbitrary ship
const SUMOReal myLengthGeometryFactor
Definition: MSLane.h:892
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: GUILane.cpp:150
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:104
SUMOReal getNOxEmissions() const
Returns the sum of last step NOx emissions.
Definition: MSLane.cpp:1608
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:76
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Definition: Boundary.cpp:201
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:1596
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:235
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
Definition: GUILane.cpp:827
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
void drawTLSLinkNo(const GUIVisualizationSettings &s, const GUINet &net) const
Definition: GUILane.cpp:200
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:91
int getPriority() const
Returns the priority of the edge.
Definition: MSEdge.h:276
The link has yellow light, may pass.
The link is controlled by a tls which is off and blinks, has to brake.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:71
SUMOReal getStoredEdgeTravelTime() const
Returns the stored traveltime for the edge of this lane.
Definition: GUILane.cpp:756
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:1572
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:849
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:1584
SUMOReal y() const
Returns the y-position.
Definition: Position.h:68
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:102
void detectCollisions(SUMOTime timestep, const std::string &stage)
Definition: GUILane.cpp:164
The link has red light (must brake)
The popup menu of a globject.
an edge
SUMOReal myHalfLaneWidth
Half of lane width, for speed-up.
Definition: GUILane.h:302
This is an uncontrolled, major link, may pass.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition: GUILane.cpp:989
void lock()
lock mutex
Definition: MFXMutex.cpp:86
bool drawCrossingsAndWalkingareas
whether crosings and walkingareas shall be drawn
unsigned int getLinkTLID(MSLink *link) const
Definition: GUINet.cpp:198
bool myAmClosed
state for dynamic lane closings
Definition: GUILane.h:315
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
Definition: GUILane.h:305
const PositionVector & getShape() const
Returns this lane&#39;s shape.
Definition: MSLane.h:323
const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
Definition: GUILane.cpp:116
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:232
The link is a 180 degree turn (left-hand network)
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
Definition: GLHelper.cpp:269
bool showLane2Lane
Information whether lane-to-lane arrows shall be drawn.
bool knowsEffort(const MSEdge *const e) const
Returns the information whether any effort is known for the given edge.
unsigned char green() const
Returns the green-amount of the color.
Definition: RGBColor.h:83
#define SUMOReal
Definition: config.h:214
static const bool gUseMesoSim
Definition: MSGlobals.h:102
GUIVisualizationSizeSettings vehicleSize
FXbool locked()
Definition: MFXMutex.h:70
bool retrieveExistingEffort(const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
Returns an effort for an edge and time if stored.
The link has yellow light, has to brake anyway.
bool knowsTravelTime(const MSEdge *const e) const
Returns the information whether any travel time is known for the given edge.
SUMOReal getHarmonoise_NoiseEmissions() const
Returns the sum of last step noise emissions.
Definition: MSLane.cpp:1644
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUILane.cpp:658
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
The edge is an internal edge.
Definition: MSEdge.h:98
SUMOReal interpolateGeometryPosToLanePos(SUMOReal geometryPos) const
Definition: MSLane.h:346
SUMOReal getBruttoOccupancy() const
Returns the brutto (including minGaps) occupancy of this lane during the last step.
Definition: MSLane.cpp:1507
GUIScaler laneScaler
The lane scaler.
unsigned char red() const
Returns the red-amount of the color.
Definition: RGBColor.h:75
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUISelectedStorage gSelected
A global holder of selected objects.
void closeBuilding()
Closes the building of the table.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A window containing a gl-object&#39;s parameter.
bool retrieveExistingTravelTime(const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
Returns a travel time for an edge and time if stored.
The link has red light (must brake) but indicates upcoming green.
GUIVisualizationTextSettings drawLinkJunctionIndex
void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: GUILane.cpp:123
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
void extrapolate(const SUMOReal val, const bool onlyFirst=false)
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:692
The link has no direction (is a dead end link)
const PositionVector & getShape() const
Definition: GUILane.cpp:726
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net&#39;s internal edge travel times/efforts container.
Definition: MSNet.cpp:713
a junction
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:61