SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
47 #include <microsim/MSGlobals.h>
48 #include <microsim/MSLane.h>
51 #include <microsim/MSNet.h>
53 #include "GUILane.h"
54 #include "GUIEdge.h"
55 #include "GUIVehicle.h"
56 #include "GUINet.h"
57 
58 #ifdef HAVE_OSG
59 #include <osg/Geometry>
60 #endif
61 
62 #ifdef CHECK_MEMORY_LEAKS
63 #include <foreign/nvwa/debug_new.h>
64 #endif // CHECK_MEMORY_LEAKS
65 
66 //#define GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
67 
68 // ===========================================================================
69 // method definitions
70 // ===========================================================================
71 GUILane::GUILane(const std::string& id, SUMOReal maxSpeed, SUMOReal length,
72  MSEdge* const edge, unsigned int numericalID,
73  const PositionVector& shape, SUMOReal width,
74  SVCPermissions permissions, unsigned int index) :
75  MSLane(id, maxSpeed, length, edge, numericalID, shape, width, permissions),
76  GUIGlObject(GLO_LANE, id) {
77  myShapeRotations.reserve(myShape.size() - 1);
78  myShapeLengths.reserve(myShape.size() - 1);
79  myShapeColors.reserve(myShape.size() - 1);
80  int e = (int) myShape.size() - 1;
81  for (int i = 0; i < e; ++i) {
82  const Position& f = myShape[i];
83  const Position& s = myShape[i + 1];
84  myShapeLengths.push_back(f.distanceTo2D(s));
85  myShapeRotations.push_back(RAD2DEG(atan2(s.x() - f.x(), f.y() - s.y())));
86  }
87  //
90  myIndex = index;
91 }
92 
93 
95  // just to quit cleanly on a failure
96  if (myLock.locked()) {
97  myLock.unlock();
98  }
99 }
100 
101 
102 // ------ Vehicle insertion ------
103 void
105  const MSLane::VehCont::iterator& at,
106  MSMoveReminder::Notification notification) {
108  MSLane::incorporateVehicle(veh, pos, speed, at, notification);
109 }
110 
111 
112 // ------ Access to vehicles ------
113 const MSLane::VehCont&
115  myLock.lock();
116  return myVehicles;
117 }
118 
119 
120 void
122  myLock.unlock();
123 }
124 
125 
126 void
130 }
131 
132 
133 bool
134 GUILane::executeMovements(SUMOTime t, std::vector<MSLane*>& into) {
136  return MSLane::executeMovements(t, into);
137 }
138 
139 
140 MSVehicle*
141 GUILane::removeVehicle(MSVehicle* remVehicle, MSMoveReminder::Notification notification, bool notify) {
143  return MSLane::removeVehicle(remVehicle, notification, notify);
144 }
145 
146 
147 void
151 }
152 
153 
154 bool
157  return MSLane::integrateNewVehicle(t);
158 }
159 
160 
161 void
162 GUILane::detectCollisions(SUMOTime timestep, const std::string& stage) {
164  MSLane::detectCollisions(timestep, stage);
165 }
166 
167 
168 // ------ Drawing methods ------
169 void
171  unsigned int noLinks = (unsigned int)myLinks.size();
172  if (noLinks == 0) {
173  return;
174  }
175  // draw all links
176  if (getEdge().isCrossing()) {
177  // draw indices at the start and end of the crossing
179  PositionVector shape = getShape();
180  shape.extrapolate(0.5); // draw on top of the walking area
181  drawTextAtEnd(toString(link->getIndex()), shape, 0);
182  drawTextAtEnd(toString(link->getIndex()), shape.reverse(), 0);
183  return;
184  }
185  // draw all links
186  SUMOReal w = myWidth / (SUMOReal) noLinks;
188  for (int i = noLinks; --i >= 0;) {
189  SUMOReal x2 = x1 - (SUMOReal)(w / 2.);
190  drawTextAtEnd(toString(myLinks[i]->getIndex()), getShape(), x2);
191  x1 -= w;
192  }
193 }
194 
195 
196 void
197 GUILane::drawTLSLinkNo(const GUINet& net) const {
198  unsigned int noLinks = (unsigned int)myLinks.size();
199  if (noLinks == 0) {
200  return;
201  }
202  if (getEdge().isCrossing()) {
203  // draw indices at the start and end of the crossing
205  int linkNo = net.getLinkTLIndex(link);
206  if (linkNo >= 0) {
207  PositionVector shape = getShape();
208  shape.extrapolate(0.5); // draw on top of the walking area
209  drawTextAtEnd(toString(linkNo), shape, 0);
210  drawTextAtEnd(toString(linkNo), shape.reverse(), 0);
211  }
212  return;
213  }
214  // draw all links
215  SUMOReal w = myWidth / (SUMOReal) noLinks;
217  for (int i = noLinks; --i >= 0;) {
218  SUMOReal x2 = x1 - (SUMOReal)(w / 2.);
219  int linkNo = net.getLinkTLIndex(myLinks[i]);
220  if (linkNo < 0) {
221  continue;
222  }
223  drawTextAtEnd(toString(linkNo), getShape(), x2);
224  x1 -= w;
225  }
226 }
227 
228 
229 void
230 GUILane::drawTextAtEnd(const std::string& text, const PositionVector& shape, SUMOReal x) const {
231  glPushMatrix();
232  const Position& end = shape.back();
233  const Position& f = shape[-2];
234  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
235  glTranslated(end.x(), end.y(), 0);
236  glRotated(rot, 0, 0, 1);
237  GLHelper::drawText(text, Position(x, 0.26), 0, .6, RGBColor(128, 128, 255, 255), 180);
238  glPopMatrix();
239 }
240 
241 
242 void
244  unsigned int noLinks = (unsigned int)myLinks.size();
245  if (noLinks == 0) {
246  drawLinkRule(s, net, 0, getShape(), 0, 0);
247  return;
248  }
249  if (getEdge().isCrossing()) {
250  // draw rules at the start and end of the crossing
252  PositionVector shape = getShape();
253  shape.extrapolate(0.5); // draw on top of the walking area
254  drawLinkRule(s, net, link, shape, 0, myWidth);
255  drawLinkRule(s, net, link, shape.reverse(), 0, myWidth);
256  return;
257  }
258  // draw all links
259  SUMOReal w = myWidth / (SUMOReal) noLinks;
260  SUMOReal x1 = 0;
261  for (unsigned int i = 0; i < noLinks; ++i) {
262  SUMOReal x2 = x1 + w;
263  drawLinkRule(s, net, myLinks[i], getShape(), x1, x2);
264  x1 = x2;
265  }
266 }
267 
268 
269 void
270 GUILane::drawLinkRule(const GUIVisualizationSettings& s, const GUINet& net, MSLink* link, const PositionVector& shape, SUMOReal x1, SUMOReal x2) const {
271  const Position& end = shape.back();
272  const Position& f = shape[-2];
273  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
274  if (link == 0) {
276  glPushMatrix();
277  glTranslated(end.x(), end.y(), 0);
278  glRotated(rot, 0, 0, 1);
279  glBegin(GL_QUADS);
280  glVertex2d(-myHalfLaneWidth, 0.0);
281  glVertex2d(-myHalfLaneWidth, 0.5);
282  glVertex2d(myHalfLaneWidth, 0.5);
283  glVertex2d(myHalfLaneWidth, 0.0);
284  glEnd();
285  glPopMatrix();
286  } else {
287  glPushMatrix();
288  glTranslated(end.x(), end.y(), 0);
289  glRotated(rot, 0, 0, 1);
290  // select glID
291  switch (link->getState()) {
294  case LINKSTATE_TL_RED:
299  glPushName(net.getLinkTLID(link));
300  break;
301  case LINKSTATE_MAJOR:
302  case LINKSTATE_MINOR:
303  case LINKSTATE_EQUAL:
305  default:
306  glPushName(getGlID());
307  break;
308  }
310  if (!(drawAsRailway(s) || drawAsWaterway(s)) || link->getState() != LINKSTATE_MAJOR) {
311  // the white bar should be the default for most railway
312  // links and looks ugly so we do not draw it
313  glBegin(GL_QUADS);
314  glVertex2d(x1 - myHalfLaneWidth, 0.0);
315  glVertex2d(x1 - myHalfLaneWidth, 0.5);
316  glVertex2d(x2 - myHalfLaneWidth, 0.5);
317  glVertex2d(x2 - myHalfLaneWidth, 0.0);
318  glEnd();
319  }
320  glPopName();
321  glPopMatrix();
322  }
323 }
324 
325 void
327  if (myLinks.size() == 0) {
328  return;
329  }
330  // draw all links
331  const Position& end = getShape().back();
332  const Position& f = getShape()[-2];
333  const SUMOReal rot = RAD2DEG(atan2((end.x() - f.x()), (f.y() - end.y())));
334  glPushMatrix();
335  glColor3d(1, 1, 1);
336  glTranslated(end.x(), end.y(), 0);
337  glRotated(rot, 0, 0, 1);
339  glScaled(myWidth / SUMO_const_laneWidth, 1, 1);
340  }
341  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
342  LinkDirection dir = (*i)->getDirection();
343  LinkState state = (*i)->getState();
344  if (state == LINKSTATE_TL_OFF_NOSIGNAL || dir == LINKDIR_NODIR) {
345  continue;
346  }
347  switch (dir) {
348  case LINKDIR_STRAIGHT:
349  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
351  break;
352  case LINKDIR_TURN:
353  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
354  GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
355  GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
356  GLHelper::drawTriangleAtEnd(Line(Position(0.5, 2.5), Position(0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
357  break;
359  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
360  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
361  GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05);
362  GLHelper::drawTriangleAtEnd(Line(Position(-0.5, 2.5), Position(-0.5, 4)), (SUMOReal) 1, (SUMOReal) .25);
363  break;
364  case LINKDIR_LEFT:
365  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
366  GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
367  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
368  break;
369  case LINKDIR_RIGHT:
370  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
371  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
372  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
373  break;
374  case LINKDIR_PARTLEFT:
375  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
376  GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
377  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
378  break;
379  case LINKDIR_PARTRIGHT:
380  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
381  GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
382  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
383  break;
384  default:
385  break;
386  }
387  }
388  glPopMatrix();
389 }
390 
391 
392 void
394  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
395  const MSLane* connected = (*i)->getLane();
396  if (connected == 0) {
397  continue;
398  }
399  GLHelper::setColor(getLinkColor((*i)->getState()));
400  glBegin(GL_LINES);
401  const Position& p1 = getShape()[-1];
402  const Position& p2 = connected->getShape()[0];
403  glVertex2f(p1.x(), p1.y());
404  glVertex2f(p2.x(), p2.y());
405  glEnd();
406  GLHelper::drawTriangleAtEnd(Line(p1, p2), (SUMOReal) .4, (SUMOReal) .2);
407  }
408 }
409 
410 
411 void
413  glPushMatrix();
414  glPushName(getGlID());
415  const bool isCrossing = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_CROSSING;
416  const bool isWalkingArea = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_WALKINGAREA;
417  const bool isInternal = isCrossing || isWalkingArea || myEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL;
418  bool mustDrawMarkings = false;
420 #ifdef HAVE_INTERNAL
422  GUIEdge* myGUIEdge = dynamic_cast<GUIEdge*>(myEdge);
423  exaggeration *= s.edgeScaler.getScheme().getColor(myGUIEdge->getScaleValue(s.edgeScaler.getActive()));
424  }
425 #endif
426  const bool drawDetails = s.scale * exaggeration > 5;
427  if (isCrossing || isWalkingArea) {
428  // draw internal lanes on top of junctions
429  glTranslated(0, 0, GLO_JUNCTION + 0.1);
430  } else if (isWaterway(myPermissions)) {
431  // draw waterways below normal roads
432  glTranslated(0, 0, getType() - 0.2);
433  } else {
434  glTranslated(0, 0, getType());
435  }
436  // set lane color
437  if (!MSGlobals::gUseMesoSim) {
438  setColor(s);
439  }
440  // recognize full transparency and simply don't draw
441  GLfloat color[4];
442  glGetFloatv(GL_CURRENT_COLOR, color);
443  if (color[3] != 0) {
444  // draw lane
445  // check whether it is not too small
446  if (s.scale * exaggeration < 1.) {
447  if (myShapeColors.size() > 0) {
449  } else {
451  }
452  glPopMatrix();
453  } else {
454  GUINet* net = (GUINet*) MSNet::getInstance();
455  if (drawAsRailway(s)) {
456  // draw as railway
457  const SUMOReal halfRailWidth = 0.725 * exaggeration;
458  if (myShapeColors.size() > 0) {
460  } else {
462  }
463  glColor3d(1, 1, 1);
464  glTranslated(0, 0, .1);
466  if (!MSGlobals::gUseMesoSim) {
467  setColor(s);
468  }
469  drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration);
470  } else if (isCrossing) {
471  // determine priority to decide color
473  if (link->havePriority() || net->getLinkTLIndex(link) > 0) {
474  glColor3d(0.9, 0.9, 0.9);
475  } else {
476  glColor3d(0.1, 0.1, 0.1);
477  }
478  glTranslated(0, 0, .2);
479  drawCrossties(0.5, 1.0, getWidth() * 0.5);
480  glTranslated(0, 0, -.2);
481  } else if (isWalkingArea) {
482  glTranslated(0, 0, .2);
483  if (s.scale * exaggeration < 20.) {
485  } else {
487  }
488  glTranslated(0, 0, -.2);
489 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
491 #endif
492  } else {
493  const SUMOReal halfWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth;
494  mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN && exaggeration == 1.0 && !isWaterway(myPermissions);
495  const int cornerDetail = drawDetails && !isInternal ? s.scale * exaggeration : 0;
496  const SUMOReal offset = halfWidth * MAX2((SUMOReal)0, (exaggeration - 1));
497  if (myShapeColors.size() > 0) {
498  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfWidth * exaggeration, cornerDetail, offset);
499  } else {
500  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfWidth * exaggeration, cornerDetail, offset);
501  }
502  }
503  glPopMatrix();
504  // draw ROWs (not for inner lanes)
505  if ((!isInternal || isCrossing) && drawDetails) {
506  glPushMatrix();
507  glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape
508  glTranslated(0, 0, .5);
509  drawLinkRules(s, *net);
511  drawArrows();
512  }
513  if (s.showLane2Lane) {
514  // this should be independent to the geometry:
515  // draw from end of first to the begin of second
517  }
518  glTranslated(0, 0, .1);
519  if (s.drawLinkJunctionIndex) {
520  drawLinkNo();
521  }
522  if (s.drawLinkTLIndex) {
523  drawTLSLinkNo(*net);
524  }
525  glPopMatrix();
526  }
527  }
528  if (mustDrawMarkings && drawDetails) { // needs matrix reset
529  drawMarkings(s, exaggeration);
530  }
531  if (drawDetails && isInternal && myPermissions == SVC_BICYCLE && exaggeration == 1.0 && s.showLinkDecals) {
533  }
534  } else {
535  glPopMatrix();
536  }
537  // draw vehicles
539  // retrieve vehicles from lane; disallow simulation
540  const MSLane::VehCont& vehicles = getVehiclesSecure();
541  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
542  if ((*v)->getLane() == this) {
543  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
544  } // else: this is the shadow during a continuous lane change
545  }
546  // draw parking vehicles
547  const std::set<const MSVehicle*> parking = MSVehicleTransfer::getInstance()->getParkingVehicles(this);
548  for (std::set<const MSVehicle*>::const_iterator v = parking.begin(); v != parking.end(); ++v) {
549  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
550  }
551  // allow lane simulation
552  releaseVehicles();
553  }
554  glPopName();
555 }
556 
557 
558 void
560  glPushMatrix();
561  glTranslated(0, 0, GLO_EDGE);
562 #ifdef HAVE_INTERNAL
564 #endif
565  setColor(s);
566  // optionally draw inverse markings
567  if (myIndex > 0 && (myEdge->getLanes()[myIndex - 1]->getPermissions() & myPermissions) != 0) {
568  SUMOReal mw = (myHalfLaneWidth + SUMO_const_laneOffset + .01) * scale;
569  int e = (int) getShape().size() - 1;
570  for (int i = 0; i < e; ++i) {
571  glPushMatrix();
572  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1);
573  glRotated(myShapeRotations[i], 0, 0, 1);
574  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 6) {
575  const SUMOReal length = MIN2((SUMOReal)3, myShapeLengths[i] - t);
576  glBegin(GL_QUADS);
577  glVertex2d(-mw, -t);
578  glVertex2d(-mw, -t - length);
579  glVertex2d(myQuarterLaneWidth * scale, -t - length);
580  glVertex2d(myQuarterLaneWidth * scale, -t);
581  glEnd();
582  }
583  glPopMatrix();
584  }
585  }
586  // draw white boundings and white markings
587  glColor3d(1, 1, 1);
589  getShape(),
591  getShapeLengths(),
593  glPopMatrix();
594 }
595 
596 
597 void
599  // draw bike lane markings onto the intersection
600  glColor3d(1, 1, 1);
601  int e = (int) getShape().size() - 1;
603  for (int i = 0; i < e; ++i) {
604  glPushMatrix();
605  glTranslated(getShape()[i].x(), getShape()[i].y(), GLO_JUNCTION + 0.1);
606  glRotated(myShapeRotations[i], 0, 0, 1);
607  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 0.5) {
608  // left and right marking
609  for (int side = -1; side <= 1; side += 2) {
610  glBegin(GL_QUADS);
611  glVertex2d(side * mw, -t);
612  glVertex2d(side * mw, -t - 0.35);
613  glVertex2d(side * (mw + SUMO_const_laneOffset), -t - 0.35);
614  glVertex2d(side * (mw + SUMO_const_laneOffset), -t);
615  glEnd();
616  }
617  }
618  glPopMatrix();
619  }
620 }
621 
622 void
623 GUILane::drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const {
624  glPushMatrix();
625  // draw on top of of the white area between the rails
626  glTranslated(0, 0, 0.1);
627  int e = (int) getShape().size() - 1;
628  for (int i = 0; i < e; ++i) {
629  glPushMatrix();
630  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.0);
631  glRotated(myShapeRotations[i], 0, 0, 1);
632  for (SUMOReal t = 0; t < myShapeLengths[i]; t += spacing) {
633  glBegin(GL_QUADS);
634  glVertex2d(-halfWidth, -t);
635  glVertex2d(-halfWidth, -t - length);
636  glVertex2d(halfWidth, -t - length);
637  glVertex2d(halfWidth, -t);
638  glEnd();
639  }
640  glPopMatrix();
641  }
642  glPopMatrix();
643 }
644 
645 // ------ inherited from GUIGlObject
648  GUISUMOAbstractView& parent) {
649  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
650  buildPopupHeader(ret, app);
652  //
655  //
656  buildShowParamsPopupEntry(ret, false);
659  new FXMenuCommand(ret, ("pos: " + toString(pos) + " height: " + toString(height)).c_str(), 0, 0, 0);
660  new FXMenuSeparator(ret);
661  buildPositionCopyEntry(ret, false);
662  return ret;
663 }
664 
665 
669  GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 11);
670  // add items
671  ret->mkItem("maxspeed [m/s]", false, getSpeedLimit());
672  ret->mkItem("length [m]", false, myLength);
673  ret->mkItem("width [m]", false, myWidth);
674  ret->mkItem("street name", false, myEdge->getStreetName());
675  ret->mkItem("stored traveltime [s]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getStoredEdgeTravelTime));
676  ret->mkItem("loaded weight", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getLoadedEdgeWeight));
677  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getBruttoOccupancy, 100.));
678  ret->mkItem("edge type", false, myEdge->getEdgeType());
679  ret->mkItem("priority", false, myEdge->getPriority());
680  ret->mkItem("allowed vehicle class", false, getVehicleClassNames(myPermissions));
681  ret->mkItem("disallowed vehicle class", false, getVehicleClassNames(~myPermissions));
682  ret->mkItem("permission code", false, myPermissions);
683  // close building
684  ret->closeBuilding();
685  return ret;
686 }
687 
688 
689 Boundary
691  Boundary b;
692  b.add(myShape[0]);
693  b.add(myShape[-1]);
694  b.grow(20);
695  return b;
696 }
697 
698 
699 
700 
701 
702 
703 
704 const PositionVector&
706  return myShape;
707 }
708 
709 
710 const std::vector<SUMOReal>&
712  return myShapeRotations;
713 }
714 
715 
716 const std::vector<SUMOReal>&
718  return myShapeLengths;
719 }
720 
721 
722 SUMOReal
724  return myVehicles.size() == 0 ? 0 : myVehicles.back()->getWaitingSeconds();
725 }
726 
727 
728 SUMOReal
730  return (SUMOReal) myEdge->getLanes().size();
731 }
732 
733 
734 SUMOReal
737  if (!ews.knowsTravelTime(myEdge)) {
738  return -1;
739  } else {
740  SUMOReal value(0);
741  ews.retrieveExistingTravelTime(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
742  return value;
743  }
744 }
745 
746 
747 SUMOReal
750  if (!ews.knowsEffort(myEdge)) {
751  return -1;
752  } else {
753  SUMOReal value(0);
754  ews.retrieveExistingEffort(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
755  return value;
756  }
757 }
758 
759 
760 void
762  const GUIColorer& c = s.laneColorer;
763  if (!setFunctionalColor(c.getActive()) && !setMultiColor(c)) {
765  }
766 }
767 
768 
769 bool
770 GUILane::setFunctionalColor(size_t activeScheme) const {
771  switch (activeScheme) {
772  case 18: {
773  SUMOReal hue = RAD2DEG(myShape.beginEndAngle()) + 180; // [0-360]
775  return true;
776  }
777  default:
778  return false;
779  }
780 }
781 
782 
783 bool
785  const size_t activeScheme = c.getActive();
786  myShapeColors.clear();
787  switch (activeScheme) {
788  case 22: // color by height at segment start
789  for (PositionVector::const_iterator ii = myShape.begin(); ii != myShape.end() - 1; ++ii) {
790  myShapeColors.push_back(c.getScheme().getColor(ii->z()));
791  }
792  return true;
793  case 24: // color by inclination at segment start
794  for (int ii = 1; ii < (int)myShape.size(); ++ii) {
795  const SUMOReal inc = (myShape[ii].z() - myShape[ii - 1].z()) / MAX2(POSITION_EPS, myShape[ii].distanceTo2D(myShape[ii - 1]));
796  myShapeColors.push_back(c.getScheme().getColor(inc));
797  }
798  return true;
799  default:
800  return false;
801  }
802 }
803 
804 
805 SUMOReal
806 GUILane::getColorValue(size_t activeScheme) const {
807  switch (activeScheme) {
808  case 0:
809  switch (myPermissions) {
810  case SVC_PEDESTRIAN:
811  return 1;
812  case SVC_BICYCLE:
813  return 2;
814  case 0:
815  return 3;
816  case SVC_SHIP:
817  return 4;
818  default:
819  break;
820  }
822  return 0;
823  } else {
824  return 5;
825  }
826  case 1:
827  return gSelected.isSelected(getType(), getGlID()) ||
828  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
829  case 2:
830  return (SUMOReal)myPermissions;
831  case 3:
832  return getSpeedLimit();
833  case 4:
834  return getBruttoOccupancy();
835  case 5:
836  return getNettoOccupancy();
837  case 6:
838  return firstWaitingTime();
839  case 7:
840  return getEdgeLaneNumber();
841  case 8:
842  return getCO2Emissions() / myLength;
843  case 9:
844  return getCOEmissions() / myLength;
845  case 10:
846  return getPMxEmissions() / myLength;
847  case 11:
848  return getNOxEmissions() / myLength;
849  case 12:
850  return getHCEmissions() / myLength;
851  case 13:
852  return getFuelConsumption() / myLength;
853  case 14:
855  case 15: {
856  return getStoredEdgeTravelTime();
857  }
858  case 16: {
860  if (!ews.knowsTravelTime(myEdge)) {
861  return -1;
862  } else {
863  SUMOReal value(0);
864  ews.retrieveExistingTravelTime(myEdge, 0, value);
865  return 100 * myLength / value / getSpeedLimit();
866  }
867  }
868  case 17: {
869  return 1 / myLengthGeometryFactor;
870  }
871  case 19: {
872  return getLoadedEdgeWeight();
873  }
874  case 20: {
875  return myEdge->getPriority();
876  }
877  case 21: {
878  // color by z of first shape point
879  return getShape()[0].z();
880  }
881  case 23: {
882  // color by incline
883  return (getShape()[-1].z() - getShape()[0].z()) / getLength();
884  }
885  case 25: {
886  // color by average speed
887  return getMeanSpeed();
888  }
889  case 26: {
890  // color by average relative speed
891  return getMeanSpeed() / myMaxSpeed;
892  }
893  }
894  return 0;
895 }
896 
897 
898 SUMOReal
899 GUILane::getScaleValue(size_t activeScheme) const {
900  switch (activeScheme) {
901  case 0:
902  return 0;
903  case 1:
904  return gSelected.isSelected(getType(), getGlID()) ||
905  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
906  case 2:
907  return getSpeedLimit();
908  case 3:
909  return getBruttoOccupancy();
910  case 4:
911  return getNettoOccupancy();
912  case 5:
913  return firstWaitingTime();
914  case 6:
915  return getEdgeLaneNumber();
916  case 7:
917  return getCO2Emissions() / myLength;
918  case 8:
919  return getCOEmissions() / myLength;
920  case 9:
921  return getPMxEmissions() / myLength;
922  case 10:
923  return getNOxEmissions() / myLength;
924  case 11:
925  return getHCEmissions() / myLength;
926  case 12:
927  return getFuelConsumption() / myLength;
928  case 13:
930  case 14: {
931  return getStoredEdgeTravelTime();
932  }
933  case 15: {
935  if (!ews.knowsTravelTime(myEdge)) {
936  return -1;
937  } else {
938  SUMOReal value(0);
939  ews.retrieveExistingTravelTime(myEdge, 0, value);
940  return 100 * myLength / value / getSpeedLimit();
941  }
942  }
943  case 16: {
944  return 1 / myLengthGeometryFactor;
945  }
946  case 17: {
947  return getLoadedEdgeWeight();
948  }
949  case 18: {
950  return myEdge->getPriority();
951  }
952  case 19: {
953  // scale by average speed
954  return getMeanSpeed();
955  }
956  case 20: {
957  // scale by average relative speed
958  return getMeanSpeed() / myMaxSpeed;
959  }
960  }
961  return 0;
962 }
963 
964 
965 bool
967  return isRailway(myPermissions) && s.showRails;
968 }
969 
970 
971 bool
973  return isWaterway(myPermissions) && s.showRails; // reusing the showRails setting
974 }
975 
976 
977 #ifdef HAVE_OSG
978 void
979 GUILane::updateColor(const GUIVisualizationSettings& s) {
981  osg::Vec4ubArray* colors = dynamic_cast<osg::Vec4ubArray*>(myGeom->getColorArray());
982  (*colors)[0].set(col.red(), col.green(), col.blue(), col.alpha());
983  myGeom->setColorArray(colors);
984 }
985 #endif
986 
987 
988 
989 /****************************************************************************/
990 
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:393
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Definition: GUILane.h:283
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:711
MSEdge & getEdge() const
Returns the lane&#39;s edge.
Definition: MSLane.h:461
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:899
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
SUMOReal getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
Definition: GUILane.cpp:748
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUILane.cpp:761
const SUMOReal SUMO_const_laneWidth
Definition: StdDefs.h:46
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:243
~GUILane()
Destructor.
Definition: GUILane.cpp:94
unsigned int myIndex
The lane index.
Definition: GUILane.h:292
bool drawLinkTLIndex
Information whether a link&#39;s tls index shall be drawn.
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:517
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:186
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
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:966
bool showRails
Information whether rails shall be drawn.
The link is a 180 degree turn.
const RGBColor & getLinkColor(const LinkState &ls)
Definition: StdDefs.cpp:52
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:412
Notification
Definition of a vehicle state.
void drawTextAtEnd(const std::string &text, const PositionVector &shape, SUMOReal x) const
Definition: GUILane.cpp:230
SUMOReal getFuelConsumption() const
Returns the sum of last step fuel consumption.
Definition: MSLane.cpp:1638
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:1092
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:127
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:559
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:1528
T MAX2(T a, T b)
Definition: StdDefs.h:74
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width, SUMOReal offset=0)
Draws a thick line.
Definition: GLHelper.cpp:130
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:717
#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:459
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:49
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:623
void drawArrows() const
Definition: GUILane.cpp:326
SUMOReal beginEndAngle() const
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:115
bool integrateNewVehicle(SUMOTime t)
Definition: GUILane.cpp:155
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:784
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:1626
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:598
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:780
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:713
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:61
std::vector< SUMOReal > myShapeRotations
The rotations of the shape parts.
Definition: GUILane.h:277
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:159
MSLane * getLogicalPredecessorLane() const
get the most likely precedecessor lane (sorted using by_connections_to_sorter). The result is cached ...
Definition: MSLane.cpp:1426
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUILane.cpp:667
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:442
bool executeMovements(SUMOTime t, std::vector< MSLane * > &into)
Definition: GUILane.cpp:134
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUILane.h:301
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUILane.cpp:690
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 drawTLSLinkNo(const GUINet &net) const
Definition: GUILane.cpp:197
void planMovements(const SUMOTime t)
Definition: GUILane.cpp:127
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:972
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:1562
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
Definition: GUILane.h:280
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
Definition: Line.h:51
SUMOReal firstWaitingTime() const
Definition: GUILane.cpp:723
void drawLinkNo() const
helper methods
Definition: GUILane.cpp:170
T MIN2(T a, T b)
Definition: StdDefs.h:68
The link is a (hard) right direction.
#define POSITION_EPS
Definition: config.h:189
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:71
float minSize
The minimum size to draw this object.
MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify)
Definition: GUILane.cpp:141
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:104
bool setFunctionalColor(size_t activeScheme) const
sets the color according to the current scheme index and some lane function
Definition: GUILane.cpp:770
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:1085
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 &quot;normal&quot; car)
SUMOReal getEdgeLaneNumber() const
Definition: GUILane.cpp:729
void drawLinkRule(const GUIVisualizationSettings &s, const GUINet &net, MSLink *link, const PositionVector &shape, SUMOReal x1, SUMOReal x2) const
Definition: GUILane.cpp:270
is an arbitrary ship
const SUMOReal myLengthGeometryFactor
Definition: MSLane.h:892
static MSVehicleTransfer * getInstance()
Returns the instance of this object.
void extrapolate(SUMOReal val)
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:148
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:1614
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:200
SUMOReal getPMxEmissions() const
Returns the sum of last step PMx emissions.
Definition: MSLane.cpp:1602
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:235
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIVehicle.cpp:965
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
Definition: GUILane.cpp:806
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:90
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:735
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:1578
MSEdge *const myEdge
The lane&#39;s edge, for routing only.
Definition: MSLane.h:849
static void drawTriangleAtEnd(const Line &l, SUMOReal tLength, SUMOReal tWidth)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:422
SUMOReal getCOEmissions() const
Returns the sum of last step CO emissions.
Definition: MSLane.cpp:1590
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:162
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:286
bool drawLinkJunctionIndex
Information whether a link&#39;s junction index shall be drawn.
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:966
void lock()
lock mutex
Definition: MFXMutex.cpp:86
void text()
Definition: gl2psTest.c:260
unsigned int getLinkTLID(MSLink *link) const
Definition: GUINet.cpp:198
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
Definition: GUILane.h:289
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:114
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
Definition: Position.h:240
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:215
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:1650
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUILane.cpp:647
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:1513
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.
void releaseVehicles() const
Allows to use the container for microsimulation again.
Definition: GUILane.cpp:121
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
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:698
The link has no direction (is a dead end link)
const PositionVector & getShape() const
Definition: GUILane.cpp:705
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net&#39;s internal edge travel times/efforts container.
Definition: MSNet.cpp:702
a junction
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:68