SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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), 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;
358  case LINKDIR_LEFT:
359  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
360  GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
361  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
362  break;
363  case LINKDIR_RIGHT:
364  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
365  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
366  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.5, 2.5)), (SUMOReal) 1, (SUMOReal) .25);
367  break;
368  case LINKDIR_PARTLEFT:
369  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
370  GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
371  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
372  break;
373  case LINKDIR_PARTRIGHT:
374  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
375  GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
376  GLHelper::drawTriangleAtEnd(Line(Position(0, 2.5), Position(-1.2, 1.3)), (SUMOReal) 1, (SUMOReal) .25);
377  break;
378  default:
379  break;
380  }
381  }
382  glPopMatrix();
383 }
384 
385 
386 void
388  for (std::vector<MSLink*>::const_iterator i = myLinks.begin(); i != myLinks.end(); ++i) {
389  const MSLane* connected = (*i)->getLane();
390  if (connected == 0) {
391  continue;
392  }
393  GLHelper::setColor(getLinkColor((*i)->getState()));
394  glBegin(GL_LINES);
395  const Position& p1 = getShape()[-1];
396  const Position& p2 = connected->getShape()[0];
397  glVertex2f(p1.x(), p1.y());
398  glVertex2f(p2.x(), p2.y());
399  glEnd();
400  GLHelper::drawTriangleAtEnd(Line(p1, p2), (SUMOReal) .4, (SUMOReal) .2);
401  }
402 }
403 
404 
405 void
407  glPushMatrix();
408  glPushName(getGlID());
409  const bool isCrossing = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_CROSSING;
410  const bool isWalkingArea = myEdge->getPurpose() == MSEdge::EDGEFUNCTION_WALKINGAREA;
411  const bool isInternal = isCrossing || isWalkingArea || myEdge->getPurpose() == MSEdge::EDGEFUNCTION_INTERNAL;
412  bool mustDrawMarkings = false;
414 #ifdef HAVE_INTERNAL
416  GUIEdge* myGUIEdge = dynamic_cast<GUIEdge*>(myEdge);
417  exaggeration *= s.edgeScaler.getScheme().getColor(myGUIEdge->getScaleValue(s.edgeScaler.getActive()));
418  }
419 #endif
420  const bool drawDetails = s.scale * exaggeration > 5;
421  if (isCrossing || isWalkingArea) {
422  // draw internal lanes on top of junctions
423  glTranslated(0, 0, GLO_JUNCTION + 0.1);
424  } else if (isWaterway(myPermissions)) {
425  // draw waterways below normal roads
426  glTranslated(0, 0, getType() - 0.2);
427  } else {
428  glTranslated(0, 0, getType());
429  }
430  // set lane color
431  if (!MSGlobals::gUseMesoSim) {
432  setColor(s);
433  }
434  // recognize full transparency and simply don't draw
435  GLfloat color[4];
436  glGetFloatv(GL_CURRENT_COLOR, color);
437  if (color[3] != 0) {
438  // draw lane
439  // check whether it is not too small
440  if (s.scale * exaggeration < 1.) {
441  if (myShapeColors.size() > 0) {
443  } else {
445  }
446  glPopMatrix();
447  } else {
448  GUINet* net = (GUINet*) MSNet::getInstance();
449  if (drawAsRailway(s)) {
450  // draw as railway
451  const SUMOReal halfRailWidth = 0.725 * exaggeration;
452  if (myShapeColors.size() > 0) {
454  } else {
456  }
457  glColor3d(1, 1, 1);
458  glTranslated(0, 0, .1);
460  if (!MSGlobals::gUseMesoSim) {
461  setColor(s);
462  }
463  drawCrossties(0.3 * exaggeration, 1 * exaggeration, 1 * exaggeration);
464  } else if (isCrossing) {
465  // determine priority to decide color
467  if (link->havePriority() || net->getLinkTLIndex(link) > 0) {
468  glColor3d(0.9, 0.9, 0.9);
469  } else {
470  glColor3d(0.1, 0.1, 0.1);
471  }
472  glTranslated(0, 0, .2);
473  drawCrossties(0.5, 1.0, getWidth() * 0.5);
474  glTranslated(0, 0, -.2);
475  } else if (isWalkingArea) {
476  glTranslated(0, 0, .2);
477  if (s.scale * exaggeration < 20.) {
479  } else {
481  }
482  glTranslated(0, 0, -.2);
483 #ifdef GUILane_DEBUG_DRAW_WALKING_AREA_VERTICES
485 #endif
486  } else {
487  const SUMOReal halfWidth = isInternal ? myQuarterLaneWidth : myHalfLaneWidth;
488  mustDrawMarkings = !isInternal && myPermissions != 0 && myPermissions != SVC_PEDESTRIAN && exaggeration == 1.0 && !isWaterway(myPermissions);
489  const int cornerDetail = drawDetails && !isInternal ? s.scale * exaggeration : 0;
490  const SUMOReal offset = halfWidth * MAX2((SUMOReal)0, (exaggeration - 1));
491  if (myShapeColors.size() > 0) {
492  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, myShapeColors, halfWidth * exaggeration, cornerDetail, offset);
493  } else {
494  GLHelper::drawBoxLines(myShape, myShapeRotations, myShapeLengths, halfWidth * exaggeration, cornerDetail, offset);
495  }
496  }
497  glPopMatrix();
498  // draw ROWs (not for inner lanes)
499  if ((!isInternal || isCrossing) && drawDetails) {
500  glPushMatrix();
501  glTranslated(0, 0, GLO_JUNCTION); // must draw on top of junction shape
502  glTranslated(0, 0, .5);
503  drawLinkRules(s, *net);
505  drawArrows();
506  }
507  if (s.showLane2Lane) {
508  // this should be independent to the geometry:
509  // draw from end of first to the begin of second
511  }
512  glTranslated(0, 0, .1);
513  if (s.drawLinkJunctionIndex) {
514  drawLinkNo();
515  }
516  if (s.drawLinkTLIndex) {
517  drawTLSLinkNo(*net);
518  }
519  glPopMatrix();
520  }
521  }
522  if (mustDrawMarkings && drawDetails) { // needs matrix reset
523  drawMarkings(s, exaggeration);
524  }
525  if (drawDetails && isInternal && myPermissions == SVC_BICYCLE && exaggeration == 1.0 && s.showLinkDecals) {
527  }
528  } else {
529  glPopMatrix();
530  }
531  // draw vehicles
533  // retrieve vehicles from lane; disallow simulation
534  const MSLane::VehCont& vehicles = getVehiclesSecure();
535  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
536  if ((*v)->getLane() == this) {
537  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
538  } // else: this is the shadow during a continuous lane change
539  }
540  // draw parking vehicles
541  const std::set<const MSVehicle*> parking = MSVehicleTransfer::getInstance()->getParkingVehicles(this);
542  for (std::set<const MSVehicle*>::const_iterator v = parking.begin(); v != parking.end(); ++v) {
543  static_cast<const GUIVehicle* const>(*v)->drawGL(s);
544  }
545  // allow lane simulation
546  releaseVehicles();
547  }
548  glPopName();
549 }
550 
551 
552 void
554  glPushMatrix();
555  glTranslated(0, 0, GLO_EDGE);
556 #ifdef HAVE_INTERNAL
558 #endif
559  setColor(s);
560  // optionally draw inverse markings
561  if (myIndex > 0 && (myEdge->getLanes()[myIndex - 1]->getPermissions() & myPermissions) != 0) {
562  SUMOReal mw = (myHalfLaneWidth + SUMO_const_laneOffset + .01) * scale;
563  int e = (int) getShape().size() - 1;
564  for (int i = 0; i < e; ++i) {
565  glPushMatrix();
566  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1);
567  glRotated(myShapeRotations[i], 0, 0, 1);
568  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 6) {
569  const SUMOReal length = MIN2((SUMOReal)3, myShapeLengths[i] - t);
570  glBegin(GL_QUADS);
571  glVertex2d(-mw, -t);
572  glVertex2d(-mw, -t - length);
573  glVertex2d(myQuarterLaneWidth * scale, -t - length);
574  glVertex2d(myQuarterLaneWidth * scale, -t);
575  glEnd();
576  }
577  glPopMatrix();
578  }
579  }
580  // draw white boundings and white markings
581  glColor3d(1, 1, 1);
583  getShape(),
585  getShapeLengths(),
586  (getHalfWidth() + SUMO_const_laneOffset) * scale);
587  glPopMatrix();
588 }
589 
590 
591 void
593  // draw bike lane markings onto the intersection
594  glColor3d(1, 1, 1);
595  int e = (int) getShape().size() - 1;
597  for (int i = 0; i < e; ++i) {
598  glPushMatrix();
599  glTranslated(getShape()[i].x(), getShape()[i].y(), GLO_JUNCTION + 0.1);
600  glRotated(myShapeRotations[i], 0, 0, 1);
601  for (SUMOReal t = 0; t < myShapeLengths[i]; t += 0.5) {
602  // left and right marking
603  for (int side = -1; side <= 1; side += 2) {
604  glBegin(GL_QUADS);
605  glVertex2d(side * mw, -t);
606  glVertex2d(side * mw, -t - 0.35);
607  glVertex2d(side * (mw + SUMO_const_laneOffset), -t - 0.35);
608  glVertex2d(side * (mw + SUMO_const_laneOffset), -t);
609  glEnd();
610  }
611  }
612  glPopMatrix();
613  }
614 }
615 
616 void
617 GUILane::drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const {
618  glPushMatrix();
619  // draw on top of of the white area between the rails
620  glTranslated(0, 0, 0.1);
621  int e = (int) getShape().size() - 1;
622  for (int i = 0; i < e; ++i) {
623  glPushMatrix();
624  glTranslated(getShape()[i].x(), getShape()[i].y(), 0.0);
625  glRotated(myShapeRotations[i], 0, 0, 1);
626  for (SUMOReal t = 0; t < myShapeLengths[i]; t += spacing) {
627  glBegin(GL_QUADS);
628  glVertex2d(-halfWidth, -t);
629  glVertex2d(-halfWidth, -t - length);
630  glVertex2d(halfWidth, -t - length);
631  glVertex2d(halfWidth, -t);
632  glEnd();
633  }
634  glPopMatrix();
635  }
636  glPopMatrix();
637 }
638 
639 // ------ inherited from GUIGlObject
642  GUISUMOAbstractView& parent) {
643  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
644  buildPopupHeader(ret, app);
646  //
649  //
650  buildShowParamsPopupEntry(ret, false);
653  new FXMenuCommand(ret, ("pos: " + toString(pos) + " height: " + toString(height)).c_str(), 0, 0, 0);
654  new FXMenuSeparator(ret);
655  buildPositionCopyEntry(ret, false);
656  return ret;
657 }
658 
659 
663  GUIParameterTableWindow* ret = new GUIParameterTableWindow(app, *this, 11);
664  // add items
665  ret->mkItem("maxspeed [m/s]", false, getSpeedLimit());
666  ret->mkItem("length [m]", false, myLength);
667  ret->mkItem("width [m]", false, myWidth);
668  ret->mkItem("street name", false, myEdge->getStreetName());
669  ret->mkItem("stored traveltime [s]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getStoredEdgeTravelTime));
670  ret->mkItem("loaded weight", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getLoadedEdgeWeight));
671  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUILane, SUMOReal>(this, &GUILane::getBruttoOccupancy, 100.));
672  ret->mkItem("edge type", false, myEdge->getEdgeType());
673  ret->mkItem("priority", false, myEdge->getPriority());
674  ret->mkItem("allowed vehicle class", false, getVehicleClassNames(myPermissions));
675  ret->mkItem("disallowed vehicle class", false, getVehicleClassNames(~myPermissions));
676  ret->mkItem("permission code", false, myPermissions);
677  // close building
678  ret->closeBuilding();
679  return ret;
680 }
681 
682 
683 Boundary
685  Boundary b;
686  b.add(myShape[0]);
687  b.add(myShape[-1]);
688  b.grow(20);
689  return b;
690 }
691 
692 
693 
694 
695 
696 
697 
698 const PositionVector&
700  return myShape;
701 }
702 
703 
704 const std::vector<SUMOReal>&
706  return myShapeRotations;
707 }
708 
709 
710 const std::vector<SUMOReal>&
712  return myShapeLengths;
713 }
714 
715 
716 SUMOReal
718  return myVehicles.size() == 0 ? 0 : myVehicles.back()->getWaitingSeconds();
719 }
720 
721 
722 SUMOReal
724  return (SUMOReal) myEdge->getLanes().size();
725 }
726 
727 
728 SUMOReal
731  if (!ews.knowsTravelTime(myEdge)) {
732  return -1;
733  } else {
734  SUMOReal value(0);
735  ews.retrieveExistingTravelTime(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
736  return value;
737  }
738 }
739 
740 
741 SUMOReal
744  if (!ews.knowsEffort(myEdge)) {
745  return -1;
746  } else {
747  SUMOReal value(0);
748  ews.retrieveExistingEffort(myEdge, STEPS2TIME(MSNet::getInstance()->getCurrentTimeStep()), value);
749  return value;
750  }
751 }
752 
753 
754 void
756  const GUIColorer& c = s.laneColorer;
757  if (!setFunctionalColor(c.getActive()) && !setMultiColor(c)) {
759  }
760 }
761 
762 
763 bool
764 GUILane::setFunctionalColor(size_t activeScheme) const {
765  switch (activeScheme) {
766  case 18: {
767  SUMOReal hue = RAD2DEG(myShape.beginEndAngle()) + 180; // [0-360]
769  return true;
770  }
771  default:
772  return false;
773  }
774 }
775 
776 
777 bool
779  const size_t activeScheme = c.getActive();
780  myShapeColors.clear();
781  switch (activeScheme) {
782  case 22: // color by height at segment start
783  for (PositionVector::const_iterator ii = myShape.begin(); ii != myShape.end() - 1; ++ii) {
784  myShapeColors.push_back(c.getScheme().getColor(ii->z()));
785  }
786  return true;
787  case 24: // color by inclination at segment start
788  for (int ii = 1; ii < (int)myShape.size(); ++ii) {
789  const SUMOReal inc = (myShape[ii].z() - myShape[ii - 1].z()) / MAX2(POSITION_EPS, myShape[ii].distanceTo2D(myShape[ii - 1]));
790  myShapeColors.push_back(c.getScheme().getColor(inc));
791  }
792  return true;
793  default:
794  return false;
795  }
796 }
797 
798 
799 SUMOReal
800 GUILane::getColorValue(size_t activeScheme) const {
801  switch (activeScheme) {
802  case 0:
803  switch (myPermissions) {
804  case SVC_PEDESTRIAN:
805  return 1;
806  case SVC_BICYCLE:
807  return 2;
808  case 0:
809  return 3;
810  case SVC_SHIP:
811  return 4;
812  default:
813  return 0;
814  }
815  case 1:
816  return gSelected.isSelected(getType(), getGlID()) ||
817  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
818  case 2:
819  return (SUMOReal)myPermissions;
820  case 3:
821  return getSpeedLimit();
822  case 4:
823  return getBruttoOccupancy();
824  case 5:
825  return getNettoOccupancy();
826  case 6:
827  return firstWaitingTime();
828  case 7:
829  return getEdgeLaneNumber();
830  case 8:
831  return getCO2Emissions() / myLength;
832  case 9:
833  return getCOEmissions() / myLength;
834  case 10:
835  return getPMxEmissions() / myLength;
836  case 11:
837  return getNOxEmissions() / myLength;
838  case 12:
839  return getHCEmissions() / myLength;
840  case 13:
841  return getFuelConsumption() / myLength;
842  case 14:
844  case 15: {
845  return getStoredEdgeTravelTime();
846  }
847  case 16: {
849  if (!ews.knowsTravelTime(myEdge)) {
850  return -1;
851  } else {
852  SUMOReal value(0);
853  ews.retrieveExistingTravelTime(myEdge, 0, value);
854  return 100 * myLength / value / getSpeedLimit();
855  }
856  }
857  case 17: {
858  return 1 / myLengthGeometryFactor;
859  }
860  case 19: {
861  return getLoadedEdgeWeight();
862  }
863  case 20: {
864  return myEdge->getPriority();
865  }
866  case 21: {
867  // color by z of first shape point
868  return getShape()[0].z();
869  }
870  case 23: {
871  // color by incline
872  return (getShape()[-1].z() - getShape()[0].z()) / getLength();
873  }
874  case 25: {
875  // color by average speed
876  return getMeanSpeed();
877  }
878  case 26: {
879  // color by average relative speed
880  return getMeanSpeed() / myMaxSpeed;
881  }
882  }
883  return 0;
884 }
885 
886 
887 SUMOReal
888 GUILane::getScaleValue(size_t activeScheme) const {
889  switch (activeScheme) {
890  case 0:
891  return 0;
892  case 1:
893  return gSelected.isSelected(getType(), getGlID()) ||
894  gSelected.isSelected(GLO_EDGE, dynamic_cast<GUIEdge*>(myEdge)->getGlID());
895  case 2:
896  return getSpeedLimit();
897  case 3:
898  return getBruttoOccupancy();
899  case 4:
900  return getNettoOccupancy();
901  case 5:
902  return firstWaitingTime();
903  case 6:
904  return getEdgeLaneNumber();
905  case 7:
906  return getCO2Emissions() / myLength;
907  case 8:
908  return getCOEmissions() / myLength;
909  case 9:
910  return getPMxEmissions() / myLength;
911  case 10:
912  return getNOxEmissions() / myLength;
913  case 11:
914  return getHCEmissions() / myLength;
915  case 12:
916  return getFuelConsumption() / myLength;
917  case 13:
919  case 14: {
920  return getStoredEdgeTravelTime();
921  }
922  case 15: {
924  if (!ews.knowsTravelTime(myEdge)) {
925  return -1;
926  } else {
927  SUMOReal value(0);
928  ews.retrieveExistingTravelTime(myEdge, 0, value);
929  return 100 * myLength / value / getSpeedLimit();
930  }
931  }
932  case 16: {
933  return 1 / myLengthGeometryFactor;
934  }
935  case 17: {
936  return getLoadedEdgeWeight();
937  }
938  case 18: {
939  return myEdge->getPriority();
940  }
941  case 19: {
942  // scale by average speed
943  return getMeanSpeed();
944  }
945  case 20: {
946  // scale by average relative speed
947  return getMeanSpeed() / myMaxSpeed;
948  }
949  }
950  return 0;
951 }
952 
953 
954 bool
956  return isRailway(myPermissions) && s.showRails;
957 }
958 
959 
960 bool
962  return isWaterway(myPermissions) && s.showRails; // reusing the showRails setting
963 }
964 
965 
966 #ifdef HAVE_OSG
967 void
968 GUILane::updateColor(const GUIVisualizationSettings& s) {
970  osg::Vec4ubArray* colors = dynamic_cast<osg::Vec4ubArray*>(myGeom->getColorArray());
971  (*colors)[0].set(col.red(), col.green(), col.blue(), col.alpha());
972  myGeom->setColorArray(colors);
973 }
974 #endif
975 
976 
977 
978 /****************************************************************************/
979 
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:832
void drawLane2LaneConnections() const
Definition: GUILane.cpp:387
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Definition: GUILane.h:288
VehCont myVehicles
The lane's vehicles. The entering vehicles are inserted at the front of this container and the leavin...
Definition: MSLane.h:809
const std::vector< SUMOReal > & getShapeRotations() const
Definition: GUILane.cpp:705
MSEdge & getEdge() const
Returns the lane's edge.
Definition: MSLane.h:455
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:888
float laneWidthExaggeration
The lane exaggeration (upscale thickness)
SUMOReal getLoadedEdgeWeight() const
Returns the loaded weight (effort) for the edge of this lane.
Definition: GUILane.cpp:742
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUILane.cpp:755
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:297
bool drawLinkTLIndex
Information whether a link'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'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's length.
Definition: MSLane.h:370
vehicle is a bicycle
int SVCPermissions
virtual bool integrateNewVehicle(SUMOTime t)
Insert buffered vehicle into the real lane.
Definition: MSLane.cpp:928
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:406
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:1557
virtual MSVehicle * removeVehicle(MSVehicle *remVehicle, MSMoveReminder::Notification notification, bool notify=true)
Definition: MSLane.cpp:1053
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:125
SUMOReal getWidth() const
Returns the lane's width.
Definition: MSLane.h:386
void drawMarkings(const GUIVisualizationSettings &s, SUMOReal scale) const
draw lane borders and white markings
Definition: GUILane.cpp:553
This is a dead end link.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:159
SUMOReal getNettoOccupancy() const
Returns the netto (excluding minGaps) occupancy of this lane during the last step (including minGaps)...
Definition: MSLane.cpp:1447
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:711
#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:815
void drawCrossties(SUMOReal length, SUMOReal spacing, SUMOReal halfWidth) const
draw crossties for railroads or pedestrian crossings
Definition: GUILane.cpp:617
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:821
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:778
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:552
SUMOReal getHCEmissions() const
Returns the sum of last step HC emissions.
Definition: MSLane.cpp:1545
SUMOReal scale
information about a lane's width (temporary, used for a single view)
void drawBikeMarkings() const
bike lane markings on top of an intersection
Definition: GUILane.cpp:592
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:742
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:853
virtual void detectCollisions(SUMOTime timestep, const std::string &stage)
Check if vehicles are too close.
Definition: MSLane.cpp:683
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:282
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
Definition: MSLane.cpp:1357
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUILane.cpp:661
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:306
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUILane.cpp:684
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:961
SUMOReal getMeanSpeed() const
Returns the mean speed on this lane.
Definition: MSLane.cpp:1481
std::vector< SUMOReal > myShapeLengths
The lengths of the shape parts.
Definition: GUILane.h:285
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:717
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's maximum allowed speed.
Definition: MSLane.h:362
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:812
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:764
virtual void swapAfterLaneChange(SUMOTime t)
moves myTmpVehicles int myVehicles after a lane change procedure
Definition: MSLane.cpp:1046
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 ' '.
const std::string & getEdgeType() const
Returns the type of the edge.
Definition: MSEdge.h:270
SUMOReal getEdgeLaneNumber() const
Definition: GUILane.cpp:723
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:858
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:1533
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:1521
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:235
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIVehicle.cpp:957
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
Definition: GUILane.cpp:800
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:729
SUMOReal getCO2Emissions() const
Returns the sum of last step CO2 emissions.
Definition: MSLane.cpp:1497
MSEdge *const myEdge
The lane's edge, for routing only.
Definition: MSLane.h:818
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:1509
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)
SUMOReal getHalfWidth() const
Definition: GUILane.h:206
The popup menu of a globject.
an edge
SUMOReal myHalfLaneWidth
Half of lane width, for speed-up.
Definition: GUILane.h:291
bool drawLinkJunctionIndex
Information whether a link'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.
int SUMOTime
Definition: SUMOTime.h:43
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition: GUILane.cpp:955
void lock()
lock mutex
Definition: MFXMutex.cpp:86
unsigned int getLinkTLID(MSLink *link) const
Definition: GUINet.cpp:198
SUMOReal myQuarterLaneWidth
Quarter of lane width, for speed-up.
Definition: GUILane.h:294
const PositionVector & getShape() const
Returns this lane'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
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:218
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:1569
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUILane.cpp:641
Position getPositionInformation() const
Returns the cursor'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:1432
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'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:668
The link has no direction (is a dead end link)
const PositionVector & getShape() const
Definition: GUILane.cpp:699
MSEdgeWeightsStorage & getWeightsStorage()
Returns the net's internal edge travel times/efforts container.
Definition: MSNet.cpp:675
a junction
A MSVehicle extended by some values for usage within the gui.
Definition: GUIVehicle.h:68