Eclipse SUMO - Simulation of Urban MObility
GNELane.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // A class for visualizing Lane geometry (adapted from GNELaneWrapper)
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 #include <config.h>
22 
26 #include <utils/gui/div/GLHelper.h>
30 #include <netedit/GNEUndoList.h>
31 #include <netedit/GNENet.h>
32 #include <netedit/GNEViewNet.h>
33 #include <netedit/GNEViewParent.h>
39 
40 #include "GNELane.h"
41 #include "GNEEdge.h"
42 #include "GNEJunction.h"
43 #include "GNEInternalLane.h"
44 #include "GNEConnection.h"
45 
46 // ===========================================================================
47 // FOX callback mapping
48 // ===========================================================================
49 
50 // Object implementation
51 FXIMPLEMENT(GNELane, FXDelegator, 0, 0)
52 
53 // ===========================================================================
54 // method definitions
55 // ===========================================================================
56 
57 GNELane::GNELane(GNEEdge* edge, const int index) :
58  GNENetElement(edge->getNet(), edge->getNBEdge()->getLaneID(index), GLO_LANE, SUMO_TAG_LANE),
59  myParentEdge(edge),
60  myIndex(index),
61  mySpecialColor(nullptr),
62  mySpecialColorValue(-1),
63  myLane2laneConnections(this) {
64 }
65 
67  GNENetElement(nullptr, "dummyConstructorGNELane", GLO_LANE, SUMO_TAG_LANE),
68  myParentEdge(nullptr),
69  myIndex(-1),
70  mySpecialColor(nullptr),
71  mySpecialColorValue(-1),
72  myLane2laneConnections(this) {
73 }
74 
75 
77 
78 std::string
80  // currently unused
81  return "";
82 }
83 
84 
85 const PositionVector&
88 }
89 
90 
91 const std::vector<double>&
94 }
95 
96 
97 const std::vector<double>&
100 }
101 
102 
103 void
105  // Clear texture containers
108  //double length = myParentEdge->getLength(); // @todo see ticket #448
109  // may be different from length
110  // Obtain lane shape of NBEdge
112  // update connections
114  // update shapes parents associated with this lane
115  for (auto i : getParentShapes()) {
116  i->updateGeometry();
117  }
118  // update child shapes associated with this lane
119  for (auto i : getChildShapes()) {
120  i->updateGeometry();
121  }
122  // update additionals children associated with this lane
123  for (auto i : getParentAdditionals()) {
124  i->updateGeometry();
125  }
126  // update additionals parents associated with this lane
127  for (auto i : getChildAdditionals()) {
128  i->updateGeometry();
129  }
130  // partial update demand elements parents associated with this lane
131  for (auto i : getParentDemandElements()) {
132  i->updatePartialGeometry(myParentEdge);
133  }
134  // partial update demand elements children associated with this lane
135  for (auto i : getChildDemandElements()) {
136  i->updatePartialGeometry(myParentEdge);
137  }
138  // In Move mode, connections aren't updated
140  // Update incoming connections of this lane
141  auto incomingConnections = getGNEIncomingConnections();
142  for (auto i : incomingConnections) {
143  i->updateGeometry();
144  }
145  // Update outgoings connections of this lane
146  auto outGoingConnections = getGNEOutcomingConnections();
147  for (auto i : outGoingConnections) {
148  i->updateGeometry();
149  }
150  }
151  // If lane has enought length for show textures of restricted lanes
152  if ((getLaneShapeLength() > 4)) {
153  // if lane is restricted
155  // get values for position and rotation of icons
156  for (int i = 2; i < getLaneShapeLength() - 1; i += 15) {
159  }
160  }
161  }
162 }
163 
164 
165 Position
167  // currently unused
168  return Position(0, 0);
169 }
170 
171 
172 void
174  const std::vector<NBEdge::Connection>& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex);
175  int noLinks = (int)cons.size();
176  if (noLinks == 0) {
177  return;
178  }
179  // draw all links
180  glPushMatrix();
181  glTranslated(0, 0, GLO_JUNCTION + 0.5);
182  double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks;
183  double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2;
184  for (int i = noLinks; --i >= 0;) {
185  double x2 = x1 - (double)(w / 2.);
187  cons[s.lefthand ? noLinks - 1 - i : i]);
189  x1 -= w;
190  }
191  glPopMatrix();
192 }
193 
194 
195 void
197  const std::vector<NBEdge::Connection>& cons = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex);
198  int noLinks = (int)cons.size();
199  if (noLinks == 0) {
200  return;
201  }
202  // draw all links
203  glPushMatrix();
204  glTranslated(0, 0, GLO_JUNCTION + 0.5);
205  double w = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / (double) noLinks;
206  double x1 = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2;
207  for (int i = noLinks; --i >= 0;) {
208  double x2 = x1 - (double)(w / 2.);
209  int linkNo = cons[s.lefthand ? noLinks - 1 - i : i].tlLinkIndex;
211  x1 -= w;
212  }
213  glPopMatrix();
214 }
215 
216 
217 void
219  // currently unused
220 }
221 
222 
223 void
225  const Position& begin = myLaneGeometry.getShape()[-2];
226  const Position& end = myLaneGeometry.getShape().back();
227  const double rot = GNEGeometry::calculateRotation(begin, end);
228  glPushMatrix();
229  glPushName(0);
230  glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape
231  glColor3d(1, 1, 1);
232  glTranslated(end.x(), end.y(), 0);
233  glRotated(rot, 0, 0, 1);
234  // draw all links
235  const std::vector<NBEdge::Connection>& edgeCons = myParentEdge->getNBEdge()->myConnections;
236  NBNode* dest = myParentEdge->getNBEdge()->myTo;
237  for (auto i : edgeCons) {
238  if (i.fromLane == myIndex) {
239  LinkDirection dir = dest->getDirection(myParentEdge->getNBEdge(), i.toEdge, s.lefthand);
240  switch (dir) {
241  case LINKDIR_STRAIGHT:
242  GLHelper::drawBoxLine(Position(0, 4), 0, 2, .05);
243  GLHelper::drawTriangleAtEnd(Position(0, 4), Position(0, 1), (double) 1, (double) .25);
244  break;
245  case LINKDIR_LEFT:
246  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
247  GLHelper::drawBoxLine(Position(0, 2.5), 90, 1, .05);
248  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.5, 2.5), (double) 1, (double) .25);
249  break;
250  case LINKDIR_RIGHT:
251  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
252  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
253  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.5, 2.5), (double) 1, (double) .25);
254  break;
255  case LINKDIR_TURN:
256  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
257  GLHelper::drawBoxLine(Position(0, 2.5), 90, .5, .05);
258  GLHelper::drawBoxLine(Position(0.5, 2.5), 180, 1, .05);
259  GLHelper::drawTriangleAtEnd(Position(0.5, 2.5), Position(0.5, 4), (double) 1, (double) .25);
260  break;
262  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
263  GLHelper::drawBoxLine(Position(0, 2.5), -90, 1, .05);
264  GLHelper::drawBoxLine(Position(-0.5, 2.5), -180, 1, .05);
265  GLHelper::drawTriangleAtEnd(Position(-0.5, 2.5), Position(-0.5, 4), (double) 1, (double) .25);
266  break;
267  case LINKDIR_PARTLEFT:
268  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
269  GLHelper::drawBoxLine(Position(0, 2.5), 45, .7, .05);
270  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(1.2, 1.3), (double) 1, (double) .25);
271  break;
272  case LINKDIR_PARTRIGHT:
273  GLHelper::drawBoxLine(Position(0, 4), 0, 1.5, .05);
274  GLHelper::drawBoxLine(Position(0, 2.5), -45, .7, .05);
275  GLHelper::drawTriangleAtEnd(Position(0, 2.5), Position(-1.2, 1.3), (double) 1, (double) .25);
276  break;
277  case LINKDIR_NODIR:
278  GLHelper::drawBoxLine(Position(1, 5.8), 245, 2, .05);
279  GLHelper::drawBoxLine(Position(-1, 5.8), 115, 2, .05);
280  glTranslated(0, 5, 0);
281  GLHelper::drawOutlineCircle(0.9, 0.8, 32);
282  glTranslated(0, -5, 0);
283  break;
284  }
285  }
286  }
287  glPopName();
288  glPopMatrix();
289 }
290 
291 
292 void
294  glPushMatrix();
295  glPushName(0);
296  glTranslated(0, 0, GLO_JUNCTION + .1); // must draw on top of junction shape
297  std::vector<NBEdge::Connection> connections = myParentEdge->getNBEdge()->getConnectionsFromLane(myIndex);
298  NBNode* node = myParentEdge->getNBEdge()->getToNode();
299  const Position& startPos = myLaneGeometry.getShape()[-1];
300  for (auto it : connections) {
301  const LinkState state = node->getLinkState(myParentEdge->getNBEdge(), it.toEdge, it.fromLane, it.toLane, it.mayDefinitelyPass, it.tlID);
302  switch (state) {
304  glColor3d(1, 1, 0);
305  break;
307  glColor3d(0, 1, 1);
308  break;
309  case LINKSTATE_MAJOR:
310  glColor3d(1, 1, 1);
311  break;
312  case LINKSTATE_MINOR:
313  glColor3d(.4, .4, .4);
314  break;
315  case LINKSTATE_STOP:
316  glColor3d(.7, .4, .4);
317  break;
318  case LINKSTATE_EQUAL:
319  glColor3d(.7, .7, .7);
320  break;
322  glColor3d(.7, .7, 1);
323  break;
324  case LINKSTATE_ZIPPER:
325  glColor3d(.75, .5, 0.25);
326  break;
327  default:
328  throw ProcessError("Unexpected LinkState '" + toString(state) + "'");
329  }
330  const Position& endPos = it.toEdge->getLaneShape(it.toLane)[0];
331  glBegin(GL_LINES);
332  glVertex2d(startPos.x(), startPos.y());
333  glVertex2d(endPos.x(), endPos.y());
334  glEnd();
335  GLHelper::drawTriangleAtEnd(startPos, endPos, (double) 1.5, (double) .2);
336  }
337  glPopName();
338  glPopMatrix();
339 }
340 
341 
342 void
344  // Push draw matrix 1
345  glPushMatrix();
346  // Push name
347  glPushName(getGlID());
348  // Traslate to fromt
349  glTranslated(0, 0, myParentEdge->getNBEdge()->getLength() < 1 ? GLO_JUNCTION + 1 : getType());
350  const RGBColor color = setLaneColor(s);
351  // start drawing lane checking whether it is not too small
352  const double selectionScale = isAttributeCarrierSelected() || myParentEdge->isAttributeCarrierSelected() ? s.selectionScale : 1;
353  double exaggeration = selectionScale * s.laneWidthExaggeration; // * s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive()));
354  // XXX apply usefull scale values
355  //exaggeration *= s.laneScaler.getScheme().getColor(getScaleValue(s.laneScaler.getActive()));
356  // recognize full transparency and simply don't draw
357  if ((color.alpha() == 0) || ((s.scale * exaggeration) < s.laneMinSize)) {
358  // Pop draw matrix 1
359  glPopMatrix();
360  // Pop Lane Name
361  glPopName();
362  } else if ((s.scale * exaggeration) < 1.) {
363  // draw as lines, depending of myShapeColors
364  if (myShapeColors.size() > 0) {
366  } else {
368  }
369  // Pop draw matrix 1
370  glPopMatrix();
371  // Pop Lane Name
372  glPopName();
373  // draw parents
374  for (const auto& i : getParentAdditionals()) {
375  if (i->getTagProperty().getTag() == SUMO_TAG_VSS) {
376  // draw VSS Symbol
377  drawVSSSymbol(s, i);
378  }
379  }
380  // draw child shapes
381  for (const auto& i : getChildShapes()) {
382  i->drawGL(s);
383  }
384  // draw child additional
385  for (const auto& additional : getChildAdditionals()) {
386  //draw partial E2 detectors
387  if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
388  drawPartialE2DetectorPlan(s, additional, nullptr);
389  } else if (!additional->getTagProperty().isPlacedInRTree()) {
390  // check that ParkingAreas aren't draw two times
391  additional->drawGL(s);
392  }
393  }
394  // draw child demand elements
395  for (const auto& i : getChildDemandElements()) {
396  if (!i->getTagProperty().isPlacedInRTree()) {
397  i->drawGL(s);
398  }
399  }
400  } else {
401  // we draw the lanes with reduced width so that the lane markings below are visible
402  // (this avoids artifacts at geometry corners without having to
403  // compute lane-marking intersection points)
404  const double halfWidth2 = exaggeration * (myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2 - SUMO_const_laneMarkWidth / 2);
405  // Draw as a normal lane, and reduce width to make sure that a selected edge can still be seen
406  const double halfWidth = drawUsingSelectColor() ? halfWidth2 - exaggeration * 0.3 : halfWidth2;
407  const bool spreadSuperposed = s.spreadSuperposed && drawAsRailway(s) && myParentEdge->getNBEdge()->isBidiRail();
408  // Check if lane has to be draw as railway and if isn't being drawn for selecting
409  if (drawAsRailway(s) && (!s.drawForRectangleSelection || spreadSuperposed)) {
411  const double width = myParentEdge->getNBEdge()->getLaneWidth(myIndex);
412  // draw as railway: assume standard gauge of 1435mm when lane width is not set
413  // draw foot width 150mm, assume that distance between rail feet inner sides is reduced on both sides by 39mm with regard to the gauge
414  // assume crosstie length of 181% gauge (2600mm for standard gauge)
415  double halfGauge = 0.5 * (width == SUMO_const_laneWidth ? 1.4350 : width) * exaggeration;
416  if (spreadSuperposed) {
417  shape.move2side(halfGauge * 0.8);
418  halfGauge *= 0.4;
419  //std::cout << "spreadSuperposed " << getID() << " old=" << myLaneGeometry.getShape() << " new=" << shape << "\n";
420  }
421  const double halfInnerFeetWidth = halfGauge - 0.039 * exaggeration;
422  const double halfRailWidth = halfInnerFeetWidth + 0.15 * exaggeration;
423  const double halfCrossTieWidth = halfGauge * 1.81;
424  // Draw lane geometry
426  // Save current color
427  RGBColor current = GLHelper::getColor();
428  // Draw gray on top with reduced width (the area between the two tracks)
429  glColor3d(0.8, 0.8, 0.8);
430  glTranslated(0, 0, .1);
432  // Set current color back
433  GLHelper::setColor(current);
434  // Draw crossties
435  GLHelper::drawCrossTies(shape, myLaneGeometry.getShapeRotations(), myLaneGeometry.getShapeLengths(), 0.26 * exaggeration, 0.6 * exaggeration, halfCrossTieWidth, s.drawForRectangleSelection);
436  } else {
438  }
439  if (halfWidth != halfWidth2 && !spreadSuperposed) {
440  // draw again to show the selected edge
442  glTranslated(0, 0, -.1);
444  }
445  // check if dotted contour has to be drawn
446  if (myNet->getViewNet()->getDottedAC() == this) {
448  }
449  // Pop draw matrix 1
450  glPopMatrix();
451  // only draw details depending of the scale and if isn't being drawn for selecting
452  if ((s.scale >= 10) && !s.drawForRectangleSelection) {
453  // if exaggeration is 1, draw drawMarkings
454  if (s.laneShowBorders && exaggeration == 1 && !drawAsRailway(s)) {
455  drawMarkings(s, exaggeration);
456  }
457  // draw ROWs only if target junction has a valid logic)
459  drawArrows(s);
460  }
461  // Draw direction indicators if the correspondient option is enabled
462  if (s.showLaneDirection) {
463  if (drawAsRailway(s)) {
464  // improve visibility of superposed rail edges
465  setLaneColor(s);
466  } else {
467  glColor3d(0.3, 0.3, 0.3);
468  }
469  drawDirectionIndicators(exaggeration, spreadSuperposed);
470  }
471  if (s.drawLinkJunctionIndex.show) {
472  drawLinkNo(s);
473  }
474  if (s.drawLinkTLIndex.show) {
475  drawTLSLinkNo(s);
476  }
477  }
478  // If there are texture of restricted lanes to draw, check if icons can be drawn
480  // Declare default width of icon (3)
481  double iconWidth = 1;
482  // Obtain width of icon, if width of lane is different
484  iconWidth = myParentEdge->getNBEdge()->getLaneStruct(myIndex).width / 3;
485  }
486  // Draw list of icons
487  for (int i = 0; i < (int)myLaneRestrictedTexturePositions.size(); i++) {
488  // Push draw matrix 2
489  glPushMatrix();
490  // Set white color
491  glColor3d(1, 1, 1);
492  // Traslate matrix 2
493  glTranslated(myLaneRestrictedTexturePositions.at(i).x(), myLaneRestrictedTexturePositions.at(i).y(), getType() + 0.1);
494  // Rotate matrix 2
495  glRotated(myLaneRestrictedTextureRotations.at(i), 0, 0, -1);
496  glRotated(90, 0, 0, 1);
497  // draw texture box depending of type of restriction
500  } else if (isRestricted(SVC_BICYCLE)) {
502  } else if (isRestricted(SVC_BUS)) {
504  }
505  // Pop draw matrix 2
506  glPopMatrix();
507  }
508  }
509  // draw a Start/endPoints if lane has a custom shape
512  }
513  // Pop Lane Name
514  glPopName();
515  // draw parents
516  for (const auto& i : getParentAdditionals()) {
517  if (i->getTagProperty().getTag() == SUMO_TAG_VSS) {
518  // draw VSS Symbol
519  drawVSSSymbol(s, i);
520  }
521  }
522  // draw child shapes
523  for (const auto& i : getChildShapes()) {
524  i->drawGL(s);
525  }
526  // draw child additional
527  for (const auto& additional : getChildAdditionals()) {
528  //draw partial E2 detectors
529  if (additional->getTagProperty().getTag() == SUMO_TAG_E2DETECTOR_MULTILANE) {
530  drawPartialE2DetectorPlan(s, additional, nullptr);
531  } else if (!additional->getTagProperty().isPlacedInRTree()) {
532  // check that ParkingAreas aren't draw two times
533  additional->drawGL(s);
534  }
535  }
536  // draw child demand elements
537  for (const auto& i : getChildDemandElements()) {
538  if (!i->getTagProperty().isPlacedInRTree()) {
539  i->drawGL(s);
540  }
541  }
542  }
543 }
544 
545 
546 void
547 GNELane::drawMarkings(const GUIVisualizationSettings& s, double scale) const {
548  glPushMatrix();
549  glTranslated(0, 0, GLO_EDGE);
550  const double myHalfLaneWidth = myParentEdge->getNBEdge()->getLaneWidth(myIndex) / 2;
551  // optionally draw inverse markings
553  double mw = (myHalfLaneWidth + SUMO_const_laneMarkWidth) * scale;
554  double mw2 = (myHalfLaneWidth - SUMO_const_laneMarkWidth) * scale;
555  if (s.lefthand) {
556  mw *= -1;
557  mw2 *= -1;
558  }
559  int e = (int) myLaneGeometry.getShape().size() - 1;
560  for (int i = 0; i < e; ++i) {
561  glPushMatrix();
562  glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 2.1);
563  glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1);
564  for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += 6) {
565  const double length = MIN2((double)3, myLaneGeometry.getShapeLengths()[i] - t);
566  glBegin(GL_QUADS);
567  glVertex2d(-mw, -t);
568  glVertex2d(-mw, -t - length);
569  glVertex2d(-mw2, -t - length);
570  glVertex2d(-mw2, -t);
571  glEnd();
572  }
573  glPopMatrix();
574  }
575  }
576  // draw white boundings and white markings
577  glColor3d(1, 1, 1);
579  glPopMatrix();
580 }
581 
582 
585  // first obtain edit mode (needed because certain Commands depend of current edit mode)
587  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
588  buildPopupHeader(ret, app);
590  // build copy names entry
591  if (editMode != GNE_NMODE_TLS) {
592  new FXMenuCommand(ret, "Copy parent edge name to clipboard", nullptr, ret, MID_COPY_EDGE_NAME);
594  }
595  // build selection
597  if (editMode != GNE_NMODE_TLS) {
598  // build show parameters menu
600  // build position copy entry
601  buildPositionCopyEntry(ret, false);
602  }
603  // check if we're in supermode network
605  if (editMode != GNE_NMODE_CONNECT && editMode != GNE_NMODE_TLS && editMode != GNE_NMODE_CREATE_EDGE) {
606  // Get icons
607  FXIcon* pedestrianIcon = GUIIconSubSys::getIcon(ICON_LANEPEDESTRIAN);
608  FXIcon* bikeIcon = GUIIconSubSys::getIcon(ICON_LANEBIKE);
609  FXIcon* busIcon = GUIIconSubSys::getIcon(ICON_LANEBUS);
610  FXIcon* greenVergeIcon = GUIIconSubSys::getIcon(ICON_LANEGREENVERGE);
611  // Create basic commands
612  std::string edgeDescPossibleMulti = toString(SUMO_TAG_EDGE);
613  const int edgeSelSize = (int)myNet->retrieveEdges(true).size();
614  if (edgeSelSize && myParentEdge->isAttributeCarrierSelected() && (edgeSelSize > 1)) {
615  edgeDescPossibleMulti = toString(edgeSelSize) + " " + toString(SUMO_TAG_EDGE) + "s";
616  }
617  // if lane is selected, calculate number of restricted lanes
618  bool edgeHasSidewalk = false;
619  bool edgeHasBikelane = false;
620  bool edgeHasBuslane = false;
621  bool edgeHasGreenVerge = false;
622  bool differentLaneShapes = false;
624  auto selectedLanes = myNet->retrieveLanes(true);
625  for (auto i : selectedLanes) {
626  if (i->getParentEdge()->hasRestrictedLane(SVC_PEDESTRIAN)) {
627  edgeHasSidewalk = true;
628  }
629  if (i->getParentEdge()->hasRestrictedLane(SVC_BICYCLE)) {
630  edgeHasBikelane = true;
631  }
632  if (i->getParentEdge()->hasRestrictedLane(SVC_BUS)) {
633  edgeHasBuslane = true;
634  }
635  if (i->getParentEdge()->hasRestrictedLane(SVC_IGNORING)) {
636  edgeHasGreenVerge = true;
637  }
638  if (i->getParentEdge()->getNBEdge()->getLaneStruct(i->getIndex()).customShape.size() != 0) {
639  differentLaneShapes = true;
640  }
641  }
642  } else {
643  edgeHasSidewalk = myParentEdge->hasRestrictedLane(SVC_PEDESTRIAN);
644  edgeHasBikelane = myParentEdge->hasRestrictedLane(SVC_BICYCLE);
645  edgeHasBuslane = myParentEdge->hasRestrictedLane(SVC_BUS);
646  edgeHasGreenVerge = myParentEdge->hasRestrictedLane(SVC_IGNORING);
647  differentLaneShapes = myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() != 0;
648  }
649  // create menu pane for edge operations
650  FXMenuPane* edgeOperations = new FXMenuPane(ret);
651  ret->insertMenuPaneChild(edgeOperations);
652  new FXMenuCascade(ret, "edge operations", nullptr, edgeOperations);
653  // create menu commands for all edge oeprations
654  new FXMenuCommand(edgeOperations, "Split edge here", nullptr, &parent, MID_GNE_EDGE_SPLIT);
655  new FXMenuCommand(edgeOperations, "Split edge in both directions here", nullptr, &parent, MID_GNE_EDGE_SPLIT_BIDI);
656  new FXMenuCommand(edgeOperations, "Set geometry endpoint here (shift-click)", nullptr, &parent, MID_GNE_EDGE_EDIT_ENDPOINT);
657  new FXMenuCommand(edgeOperations, "Restore geometry endpoint (shift-click)", nullptr, &parent, MID_GNE_EDGE_RESET_ENDPOINT);
658  new FXMenuCommand(edgeOperations, ("Reverse " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_REVERSE);
659  new FXMenuCommand(edgeOperations, ("Add reverse direction for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_ADD_REVERSE);
660  new FXMenuCommand(edgeOperations, ("Reset lengths for " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_RESET_LENGTH);
661  new FXMenuCommand(edgeOperations, ("Straighten " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN);
662  new FXMenuCommand(edgeOperations, ("Smooth " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH);
663  new FXMenuCommand(edgeOperations, ("Straighten elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_STRAIGHTEN_ELEVATION);
664  new FXMenuCommand(edgeOperations, ("Smooth elevation of " + edgeDescPossibleMulti).c_str(), nullptr, &parent, MID_GNE_EDGE_SMOOTH_ELEVATION);
665  // create menu pane for lane operations
666  FXMenuPane* laneOperations = new FXMenuPane(ret);
667  ret->insertMenuPaneChild(laneOperations);
668  new FXMenuCascade(ret, "lane operations", nullptr, laneOperations);
669  new FXMenuCommand(laneOperations, "Duplicate lane", nullptr, &parent, MID_GNE_LANE_DUPLICATE);
670  if (differentLaneShapes) {
671  new FXMenuCommand(laneOperations, "reset custom shape", nullptr, &parent, MID_GNE_LANE_RESET_CUSTOMSHAPE);
672  }
673  // Create panel for lane operations and insert it in ret
674  FXMenuPane* addSpecialLanes = new FXMenuPane(laneOperations);
675  ret->insertMenuPaneChild(addSpecialLanes);
676  FXMenuPane* removeSpecialLanes = new FXMenuPane(laneOperations);
677  ret->insertMenuPaneChild(removeSpecialLanes);
678  FXMenuPane* transformSlanes = new FXMenuPane(laneOperations);
679  ret->insertMenuPaneChild(transformSlanes);
680  // Create menu comands for all add special lanes
681  FXMenuCommand* addSidewalk = new FXMenuCommand(addSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_ADD_SIDEWALK);
682  FXMenuCommand* addBikelane = new FXMenuCommand(addSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_ADD_BIKE);
683  FXMenuCommand* addBuslane = new FXMenuCommand(addSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_ADD_BUS);
684  FXMenuCommand* addGreenVerge = new FXMenuCommand(addSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_ADD_GREENVERGE);
685  // Create menu comands for all remove special lanes and disable it
686  FXMenuCommand* removeSidewalk = new FXMenuCommand(removeSpecialLanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_REMOVE_SIDEWALK);
687  removeSidewalk->disable();
688  FXMenuCommand* removeBikelane = new FXMenuCommand(removeSpecialLanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_REMOVE_BIKE);
689  removeBikelane->disable();
690  FXMenuCommand* removeBuslane = new FXMenuCommand(removeSpecialLanes, "Buslane", busIcon, &parent, MID_GNE_LANE_REMOVE_BUS);
691  removeBuslane->disable();
692  FXMenuCommand* removeGreenVerge = new FXMenuCommand(removeSpecialLanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_REMOVE_GREENVERGE);
693  removeGreenVerge->disable();
694  // Create menu comands for all trasform special lanes and disable it
695  FXMenuCommand* transformLaneToSidewalk = new FXMenuCommand(transformSlanes, "Sidewalk", pedestrianIcon, &parent, MID_GNE_LANE_TRANSFORM_SIDEWALK);
696  FXMenuCommand* transformLaneToBikelane = new FXMenuCommand(transformSlanes, "Bikelane", bikeIcon, &parent, MID_GNE_LANE_TRANSFORM_BIKE);
697  FXMenuCommand* transformLaneToBuslane = new FXMenuCommand(transformSlanes, "Buslane", busIcon, &parent, MID_GNE_LANE_TRANSFORM_BUS);
698  FXMenuCommand* transformLaneToGreenVerge = new FXMenuCommand(transformSlanes, "Greenverge", greenVergeIcon, &parent, MID_GNE_LANE_TRANSFORM_GREENVERGE);
699  // add menuCascade for lane operations
700  FXMenuCascade* cascadeAddSpecialLane = new FXMenuCascade(laneOperations, ("add restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, addSpecialLanes);
701  FXMenuCascade* cascadeRemoveSpecialLane = new FXMenuCascade(laneOperations, ("remove restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, removeSpecialLanes);
702  new FXMenuCascade(laneOperations, ("transform to restricted " + toString(SUMO_TAG_LANE)).c_str(), nullptr, transformSlanes);
703  // Enable and disable options depending of current transform of the lane
704  if (edgeHasSidewalk) {
705  transformLaneToSidewalk->disable();
706  addSidewalk->disable();
707  removeSidewalk->enable();
708  }
709  if (edgeHasBikelane) {
710  transformLaneToBikelane->disable();
711  addBikelane->disable();
712  removeBikelane->enable();
713  }
714  if (edgeHasBuslane) {
715  transformLaneToBuslane->disable();
716  addBuslane->disable();
717  removeBuslane->enable();
718  }
719  if (edgeHasGreenVerge) {
720  transformLaneToGreenVerge->disable();
721  addGreenVerge->disable();
722  removeGreenVerge->enable();
723  }
724  // Check if cascade menus must be disabled
725  if (edgeHasSidewalk && edgeHasBikelane && edgeHasBuslane && edgeHasGreenVerge) {
726  cascadeAddSpecialLane->disable();
727  }
728  if (!edgeHasSidewalk && !edgeHasBikelane && !edgeHasBuslane && !edgeHasGreenVerge) {
729  cascadeRemoveSpecialLane->disable();
730  }
731  } else if (editMode == GNE_NMODE_TLS) {
733  new FXMenuCommand(ret, "Select state for all links from this edge:", nullptr, nullptr, 0);
734  const std::vector<std::string> names = GNEInternalLane::LinkStateNames.getStrings();
735  for (auto it : names) {
736  FXuint state = GNEInternalLane::LinkStateNames.get(it);
737  FXMenuRadio* mc = new FXMenuRadio(ret, it.c_str(), this, FXDataTarget::ID_OPTION + state);
738  mc->setSelBackColor(MFXUtils::getFXColor(GNEInternalLane::colorForLinksState(state)));
740  }
741  }
742  } else {
743  FXMenuCommand* mc = new FXMenuCommand(ret, "Additional options available in 'Inspect Mode'", nullptr, nullptr, 0);
744  mc->handle(&parent, FXSEL(SEL_COMMAND, FXWindow::ID_DISABLE), nullptr);
745  }
746  // buildShowParamsPopupEntry(ret, false);
747  // build shape positions menu
748  if (editMode != GNE_NMODE_TLS) {
749  new FXMenuSeparator(ret);
752  new FXMenuCommand(ret, ("Shape pos: " + toString(pos)).c_str(), nullptr, nullptr, 0);
753  new FXMenuCommand(ret, ("Length pos: " + toString(pos * getLaneParametricLength() / getLaneShapeLength())).c_str(), nullptr, nullptr, 0);
754  new FXMenuCommand(ret, ("Height: " + toString(height)).c_str(), nullptr, nullptr, 0);
755  }
756  // new FXMenuSeparator(ret);
757  // buildPositionCopyEntry(ret, false);
758  }
759  return ret;
760 }
761 
762 
763 Boundary
765  if (myParentEdge->getNBEdge()->getLaneStruct(myIndex).customShape.size() == 0) {
767  } else {
769  }
770 }
771 
772 
773 int
775  return myIndex;
776 }
777 
778 void
779 GNELane::setIndex(int index) {
780  myIndex = index;
782 }
783 
784 
785 double
788 }
789 
790 
791 double
793  double laneParametricLength = myParentEdge->getNBEdge()->getLoadedLength();
794  if (laneParametricLength > 0) {
795  return laneParametricLength;
796  } else {
797  throw ProcessError("Lane Parametric Length cannot be never 0");
798  }
799 }
800 
801 
802 double
804  return myLaneGeometry.getShape().length();
805 }
806 
807 
808 bool
810  return myParentEdge->getNBEdge()->getPermissions(myIndex) == vclass;
811 }
812 
813 
816  return myLane2laneConnections;
817 }
818 
819 
820 std::string
822  const NBEdge* edge = myParentEdge->getNBEdge();
823  switch (key) {
824  case SUMO_ATTR_ID:
825  return getMicrosimID();
826  case SUMO_ATTR_SPEED:
827  return toString(edge->getLaneSpeed(myIndex));
828  case SUMO_ATTR_ALLOW:
830  case SUMO_ATTR_DISALLOW:
832  case SUMO_ATTR_WIDTH:
833  return toString(edge->getLaneStruct(myIndex).width);
834  case SUMO_ATTR_ENDOFFSET:
835  return toString(edge->getLaneStruct(myIndex).endOffset);
837  return toString(edge->getLaneStruct(myIndex).accelRamp);
839  return toString(edge->getLaneStruct(myIndex).customShape);
840  case SUMO_ATTR_INDEX:
841  return toString(myIndex);
842  case GNE_ATTR_SELECTED:
844  case GNE_ATTR_PARAMETERS:
846  default:
847  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
848  }
849 }
850 
851 std::string
853  std::string result = getAttribute(key);
854  if ((key == SUMO_ATTR_ALLOW || key == SUMO_ATTR_DISALLOW) && result.find("all") != std::string::npos) {
855  result += " " + getVehicleClassNames(SVCAll, true);
856  }
857  return result;
858 }
859 
860 
861 void
862 GNELane::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
863  switch (key) {
864  case SUMO_ATTR_ID:
865  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed");
866  case SUMO_ATTR_SPEED:
867  case SUMO_ATTR_ALLOW:
868  case SUMO_ATTR_DISALLOW:
869  case SUMO_ATTR_WIDTH:
870  case SUMO_ATTR_ENDOFFSET:
873  case SUMO_ATTR_INDEX:
874  case GNE_ATTR_SELECTED:
875  case GNE_ATTR_PARAMETERS:
876  // no special handling
877  undoList->p_add(new GNEChange_Attribute(this, myNet, key, value));
878  break;
879  default:
880  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
881  }
882 }
883 
884 
885 bool
886 GNELane::isValid(SumoXMLAttr key, const std::string& value) {
887  switch (key) {
888  case SUMO_ATTR_ID:
889  case SUMO_ATTR_INDEX:
890  return false;
891  case SUMO_ATTR_SPEED:
892  return canParse<double>(value);
893  case SUMO_ATTR_ALLOW:
894  case SUMO_ATTR_DISALLOW:
895  return canParseVehicleClasses(value);
896  case SUMO_ATTR_WIDTH:
897  return canParse<double>(value) && ((parse<double>(value) > 0) || (parse<double>(value) == NBEdge::UNSPECIFIED_WIDTH));
898  case SUMO_ATTR_ENDOFFSET:
899  return canParse<double>(value) && (parse<double>(value) >= 0);
901  return canParse<bool>(value);
902  case SUMO_ATTR_CUSTOMSHAPE: {
903  // A lane shape can either be empty or have more than 1 element
904  if (value.empty()) {
905  return true;
906  } else if (canParse<PositionVector>(value)) {
907  return parse<PositionVector>(value).size() > 1;
908  }
909  return false;
910  }
911  case GNE_ATTR_SELECTED:
912  return canParse<bool>(value);
913  case GNE_ATTR_PARAMETERS:
914  return Parameterised::areParametersValid(value);
915  default:
916  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
917  }
918 }
919 
920 
921 bool
923  switch (key) {
924  case SUMO_ATTR_ID:
925  case SUMO_ATTR_INDEX:
926  return false;
927  default:
928  return true;
929  }
930 }
931 
932 
933 void
934 GNELane::setSpecialColor(const RGBColor* color, double colorValue) {
935  mySpecialColor = color;
936  mySpecialColorValue = colorValue;
937 }
938 
939 
940 void
941 GNELane::drawPartialE2DetectorPlan(const GUIVisualizationSettings& s, const GNEAdditional* E2Detector, const GNEJunction* junction) const {
942  // calculate E2Detector width
943  //double E2DetectorWidth = s.addSize.getExaggeration(s, this) * s.widthSettings.E2Detector;
944  double E2DetectorWidth = s.addSize.getExaggeration(s, E2Detector);
945  // obtain color
946  RGBColor E2DetectorColor;
947  if (E2Detector->drawUsingSelectColor()) {
948  E2DetectorColor = s.colorSettings.selectedRouteColor;
949  } else {
950  E2DetectorColor = s.colorSettings.E2;
951  }
952  // Start drawing adding an gl identificator
953  glPushName(E2Detector->getGlID());
954  // Add a draw matrix
955  glPushMatrix();
956  // Start with the drawing of the area traslating matrix to origin
957  glTranslated(0, 0, E2Detector->getType());
958  // draw E2Detector
959  if (junction) {
960  // iterate over segments
961  for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) {
962  // draw partial segment
963  if ((segment.junction == junction) && (segment.AC == E2Detector)) {
964  // Set E2Detector color (needed due drawShapeDottedContour)
965  GLHelper::setColor(E2DetectorColor);
966  // draw box lines
967  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth);
968  // check if shape dotted contour has to be drawn
969  if (myNet->getViewNet()->getDottedAC() == E2Detector) {
970  GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth);
971  }
972  }
973  }
974  } else {
975  // iterate over segments
976  for (const auto& segment : E2Detector->getAdditionalSegmentGeometry()) {
977  // draw partial segment
978  if ((segment.lane == this) && (segment.AC == E2Detector)) {
979  // Set E2Detector color (needed due drawShapeDottedContour)
980  GLHelper::setColor(E2DetectorColor);
981  // draw box lines
982  GNEGeometry::drawSegmentGeometry(myNet->getViewNet(), segment, E2DetectorWidth);
983  // check if shape dotted contour has to be drawn
984  if (myNet->getViewNet()->getDottedAC() == E2Detector) {
985  GLHelper::drawShapeDottedContourAroundShape(s, getType(), segment.getShape(), E2DetectorWidth);
986  }
987  }
988  }
989  }
990  // Pop last matrix
991  glPopMatrix();
992  // Draw name if isn't being drawn for selecting
993  if (!s.drawForRectangleSelection) {
994  drawName(getCenteringBoundary().getCenter(), s.scale, s.addName);
995  }
996  // Pop name
997  glPopName();
998 }
999 
1000 // ===========================================================================
1001 // private
1002 // ===========================================================================
1003 
1004 void
1005 GNELane::setAttribute(SumoXMLAttr key, const std::string& value) {
1006  NBEdge* edge = myParentEdge->getNBEdge();
1007  switch (key) {
1008  case SUMO_ATTR_ID:
1009  case SUMO_ATTR_INDEX:
1010  throw InvalidArgument("Modifying attribute '" + toString(key) + "' of " + getTagStr() + " isn't allowed");
1011  case SUMO_ATTR_SPEED:
1012  edge->setSpeed(myIndex, parse<double>(value));
1013  break;
1014  case SUMO_ATTR_ALLOW:
1016  break;
1017  case SUMO_ATTR_DISALLOW:
1019  break;
1020  case SUMO_ATTR_WIDTH:
1021  edge->setLaneWidth(myIndex, parse<double>(value));
1022  break;
1023  case SUMO_ATTR_ENDOFFSET:
1024  edge->setEndOffset(myIndex, parse<double>(value));
1025  break;
1027  edge->setAcceleration(myIndex, parse<bool>(value));
1028  break;
1029  case SUMO_ATTR_CUSTOMSHAPE: {
1030  // first remove parent edge from net
1032  // set new shape
1033  edge->setLaneShape(myIndex, parse<PositionVector>(value));
1034  // add parent edge into net again
1036  break;
1037  }
1038  case GNE_ATTR_SELECTED:
1039  if (parse<bool>(value)) {
1041  } else {
1043  }
1044  break;
1045  case GNE_ATTR_PARAMETERS:
1047  break;
1048  default:
1049  throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
1050  }
1051 }
1052 
1053 
1054 RGBColor
1056  // we need to draw lanes with a special color if we're inspecting a Trip or Flow and this lane belongs to a via's edge.
1060  // obtain attribute "via"
1061  std::vector<std::string> viaEdges = parse<std::vector<std::string> >(myNet->getViewNet()->getDottedAC()->getAttribute(SUMO_ATTR_VIA));
1062  // iterate over viaEdges
1063  for (const auto& i : viaEdges) {
1064  // check if parent edge is in the via edges
1065  if (myParentEdge->getID() == i) {
1066  // set green color in GLHelper and return it
1068  return RGBColor::GREEN;
1069  }
1070  }
1071  }
1072  // declare a RGBColor variable
1073  RGBColor color;
1074  if (mySpecialColor != nullptr) {
1075  // If special color is enabled, set it
1076  color = *mySpecialColor;
1077  } else if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) {
1078  // override with special colors (unless the color scheme is based on selection)
1079  color = s.colorSettings.selectedLaneColor;
1080  } else if (myParentEdge->drawUsingSelectColor() && s.laneColorer.getActive() != 1) {
1081  // override with special colors (unless the color scheme is based on selection)
1082  color = s.colorSettings.selectedEdgeColor;
1083  } else {
1084  // Get normal lane color
1085  const GUIColorer& c = s.laneColorer;
1086  if (!setFunctionalColor(c.getActive(), color) && !setMultiColor(s, c, color)) {
1087  color = c.getScheme().getColor(getColorValue(s, c.getActive()));
1088  }
1089  }
1090  // set color in GLHelper
1091  GLHelper::setColor(color);
1092  return color;
1093 }
1094 
1095 bool
1096 GNELane::setFunctionalColor(int activeScheme, RGBColor& col) const {
1097  switch (activeScheme) {
1098  case 6: {
1099  double hue = GeomHelper::naviDegree(myLaneGeometry.getShape().beginEndAngle()); // [0-360]
1100  col = RGBColor::fromHSV(hue, 1., 1.);
1101  return true;
1102  }
1103  default:
1104  return false;
1105  }
1106 }
1107 
1108 
1109 bool
1111  const int activeScheme = c.getActive();
1112  myShapeColors.clear();
1113  switch (activeScheme) {
1114  case 9: // color by height at segment start
1115  for (PositionVector::const_iterator ii = myLaneGeometry.getShape().begin(); ii != myLaneGeometry.getShape().end() - 1; ++ii) {
1116  myShapeColors.push_back(c.getScheme().getColor(ii->z()));
1117  }
1118  col = c.getScheme().getColor(getColorValue(s, 8));
1119  return true;
1120  case 11: // color by inclination at segment start
1121  for (int ii = 1; ii < (int)myLaneGeometry.getShape().size(); ++ii) {
1122  const double inc = (myLaneGeometry.getShape()[ii].z() - myLaneGeometry.getShape()[ii - 1].z()) / MAX2(POSITION_EPS, myLaneGeometry.getShape()[ii].distanceTo2D(myLaneGeometry.getShape()[ii - 1]));
1123  myShapeColors.push_back(c.getScheme().getColor(inc));
1124  }
1125  col = c.getScheme().getColor(getColorValue(s, 10));
1126  return true;
1127  default:
1128  return false;
1129  }
1130 }
1131 
1132 
1133 double
1134 GNELane::getColorValue(const GUIVisualizationSettings& s, int activeScheme) const {
1135  const SVCPermissions myPermissions = myParentEdge->getNBEdge()->getPermissions(myIndex);
1136  if (mySpecialColor != nullptr && mySpecialColorValue != std::numeric_limits<double>::max()) {
1137  return mySpecialColorValue;
1138  }
1139  switch (activeScheme) {
1140  case 0:
1141  switch (myPermissions) {
1142  case SVC_PEDESTRIAN:
1143  return 1;
1144  case SVC_BICYCLE:
1145  return 2;
1146  case 0:
1147  return 3;
1148  case SVC_SHIP:
1149  return 4;
1150  default:
1151  break;
1152  }
1153  if (isRailway(myPermissions)) {
1154  return 5;
1155  } else if ((myPermissions & SVC_PASSENGER) != 0) {
1156  return 0;
1157  } else {
1158  return 6;
1159  }
1160  case 1:
1162  case 2:
1163  return (double)myPermissions;
1164  case 3:
1166  case 4:
1167  return myParentEdge->getNBEdge()->getNumLanes();
1168  case 5: {
1170  }
1171  // case 6: by angle (functional)
1172  case 7: {
1173  return myParentEdge->getNBEdge()->getPriority();
1174  }
1175  case 8: {
1176  // color by z of first shape point
1177  return myLaneGeometry.getShape()[0].z();
1178  }
1179  // case 9: by segment height
1180  case 10: {
1181  // color by incline
1182  return (myLaneGeometry.getShape()[-1].z() - myLaneGeometry.getShape()[0].z()) / myParentEdge->getNBEdge()->getLength();
1183  }
1184  // case 11: by segment incline
1185 
1186  case 12: {
1187  // by numerical edge param value
1188  try {
1190  } catch (NumberFormatException&) {
1191  try {
1193  } catch (BoolFormatException&) {
1194  return -1;
1195  }
1196  }
1197  }
1198  case 13: {
1199  // by numerical lane param value
1200  try {
1202  } catch (NumberFormatException&) {
1203  try {
1205  } catch (BoolFormatException&) {
1206  return -1;
1207  }
1208  }
1209  }
1210  case 14: {
1211  return myParentEdge->getNBEdge()->getDistance();
1212  }
1213  case 15: {
1214  return fabs(myParentEdge->getNBEdge()->getDistance());
1215  }
1216  }
1217  return 0;
1218 }
1219 
1220 
1221 bool
1224 }
1225 
1226 
1227 bool
1229  return isWaterway(myParentEdge->getNBEdge()->getPermissions(myIndex)) && s.showRails && !s.drawForRectangleSelection; // reusing the showRails setting
1230 }
1231 
1232 
1233 void
1234 GNELane::drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const {
1235  const double width = MAX2(NUMERICAL_EPS, (myParentEdge->getNBEdge()->getLaneWidth(myIndex) * exaggeration
1236  * (spreadSuperposed ? 0.4 : 1)));
1237  const double sideOffset = spreadSuperposed ? width * -0.5 : 0;
1238  glPushMatrix();
1239  glTranslated(0, 0, GLO_JUNCTION + 0.1);
1240  int e = (int) myLaneGeometry.getShape().size() - 1;
1241  for (int i = 0; i < e; ++i) {
1242  glPushMatrix();
1243  glTranslated(myLaneGeometry.getShape()[i].x(), myLaneGeometry.getShape()[i].y(), 0.1);
1244  glRotated(myLaneGeometry.getShapeRotations()[i], 0, 0, 1);
1245  for (double t = 0; t < myLaneGeometry.getShapeLengths()[i]; t += width) {
1246  const double length = MIN2(width * 0.5, myLaneGeometry.getShapeLengths()[i] - t);
1247  glBegin(GL_TRIANGLES);
1248  glVertex2d(sideOffset, -t - length);
1249  glVertex2d(sideOffset - width * 0.25, -t);
1250  glVertex2d(sideOffset + width * 0.25, -t);
1251  glEnd();
1252  }
1253  glPopMatrix();
1254  }
1255  glPopMatrix();
1256 }
1257 
1258 
1259 void
1261  // Obtain exaggeration of the draw
1262  const double exaggeration = s.addSize.getExaggeration(s, vss);
1263  // first check if additional has to be drawn
1264  if (s.drawAdditionals(exaggeration)) {
1265  // obtain lanePos and route
1266  const Position& lanePos = vss->getChildPosition(this);
1267  const double laneRot = vss->getChildRotation(this);
1268  // Start drawing adding an VSS gl identificator (used to identify element after clicking)
1269  glPushName(vss->getGlID());
1270  // start drawing symbol
1271  glPushMatrix();
1272  glTranslated(lanePos.x(), lanePos.y(), vss->getType());
1273  glRotated(-1 * laneRot, 0, 0, 1);
1274  glTranslated(0, -1.5, 0);
1275  glScaled(exaggeration, exaggeration, 1);
1276  // draw circle
1277  int noPoints = 9;
1278  if (s.scale > 25) {
1279  noPoints = (int)(9.0 + s.scale / 10.0);
1280  if (noPoints > 36) {
1281  noPoints = 36;
1282  }
1283  }
1284  glColor3d(1, 0, 0);
1285  GLHelper::drawFilledCircle((double) 1.3, noPoints);
1286  if (!s.drawForRectangleSelection && (s.scale >= 5)) {
1287  glTranslated(0, 0, .1);
1288  glColor3d(0, 0, 0);
1289  GLHelper::drawFilledCircle((double) 1.1, noPoints);
1290  // draw the speed string
1291  glColor3d(1, 1, 0);
1292  glTranslated(0, 0, .1);
1293  glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1294  // draw last value string
1295  GLHelper::drawText("S", Position(0, 0), .1, 1.2, RGBColor(255, 255, 0), 180);
1296  }
1297  // Pop symbol matrix
1298  glPopMatrix();
1299  // Pop VSS name
1300  glPopName();
1301  // check if dotted contour has to be drawn
1302  if (myNet->getViewNet()->getDottedAC() == vss) {
1303  GLHelper::drawShapeDottedContourRectangle(s, getType(), lanePos, 2.6, 2.6, -1 * laneRot, 0, -1.5);
1304  }
1305  // Draw connections
1306  vss->drawChildConnections(s, getType());
1307  }
1308 }
1309 
1310 
1311 void
1313  GLHelper::setColor(s.junctionColorer.getSchemes()[0].getColor(2));
1314  if (drawUsingSelectColor() && s.laneColorer.getActive() != 1) {
1315  // override with special colors (unless the color scheme is based on selection)
1317  }
1318  // obtain circle width and resolution
1319  double circleWidth = GNEEdge::SNAP_RADIUS * MIN2((double)1, s.laneWidthExaggeration) / 2;
1320  // Obtain exaggeration of the draw
1321  const double exaggeration = s.addSize.getExaggeration(s, this);
1322  // obtain custom shape
1324  // draw s depending of detail
1325  if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) {
1326  glPushMatrix();
1327  glTranslated(customShape.front().x(), customShape.front().y(), GLO_JUNCTION + 0.01);
1329  glTranslated(0, 0, 0.01);
1330  GLHelper::drawText("S", Position(), 0, circleWidth, RGBColor::WHITE);
1331  glPopMatrix();
1332  }
1333  // draw line between Junction and point
1334  glPushMatrix();
1335  glTranslated(0, 0, GLO_JUNCTION - 0.01);
1336  glLineWidth(4);
1338  glPopMatrix();
1339  // draw "e" depending of detail
1340  if (s.drawDetail(s.detailSettings.geometryPointsText, exaggeration)) {
1341  glPushMatrix();
1342  glTranslated(customShape.back().x(), customShape.back().y(), GLO_JUNCTION + 0.01);
1344  glTranslated(0, 0, 0.01);
1345  GLHelper::drawText("E", Position(), 0, circleWidth, RGBColor::WHITE);
1346  glPopMatrix();
1347  }
1348  // draw line between Junction and point
1349  glPushMatrix();
1350  glTranslated(0, 0, GLO_JUNCTION - 0.01);
1351  glLineWidth(4);
1353  glPopMatrix();
1354 }
1355 
1356 
1357 std::string
1359  return myParentEdge->getMicrosimID();
1360 }
1361 
1362 
1363 long
1364 GNELane::onDefault(FXObject* obj, FXSelector sel, void* data) {
1365  myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->handleMultiChange(this, obj, sel, data);
1366  return 1;
1367 }
1368 
1369 
1370 GNEEdge*
1372  return myParentEdge;
1373 }
1374 
1375 
1376 std::vector<GNEConnection*>
1378  // Declare a vector to save incoming connections
1379  std::vector<GNEConnection*> incomingConnections;
1380  // Obtain incoming edges if junction source was already created
1381  GNEJunction* junctionSource = myParentEdge->getGNEJunctionSource();
1382  if (junctionSource) {
1383  // Iterate over incoming GNEEdges of junction
1384  for (auto i : junctionSource->getGNEIncomingEdges()) {
1385  // Iterate over connection of incoming edges
1386  for (auto j : i->getGNEConnections()) {
1387  if (j->getNBEdgeConnection().fromLane == getIndex()) {
1388  incomingConnections.push_back(j);
1389  }
1390  }
1391  }
1392  }
1393  return incomingConnections;
1394 }
1395 
1396 
1397 std::vector<GNEConnection*>
1399  // Obtain GNEConnection of parent edge
1400  const std::vector<GNEConnection*>& edgeConnections = myParentEdge->getGNEConnections();
1401  std::vector<GNEConnection*> outcomingConnections;
1402  // Obtain outgoing connections
1403  for (auto i : edgeConnections) {
1404  if (i->getNBEdgeConnection().fromLane == getIndex()) {
1405  outcomingConnections.push_back(i);
1406  }
1407  }
1408  return outcomingConnections;
1409 }
1410 
1411 
1412 void
1414  // update incoming connections of lane
1415  std::vector<GNEConnection*> incomingConnections = getGNEIncomingConnections();
1416  for (auto i : incomingConnections) {
1417  i->updateID();
1418  }
1419  // update outocming connections of lane
1420  std::vector<GNEConnection*> outcomingConnections = getGNEOutcomingConnections();
1421  for (auto i : outcomingConnections) {
1422  i->updateID();
1423  }
1424 }
1425 
1426 
1427 double
1429  // factor should not be 0
1430  if (myParentEdge->getNBEdge()->getFinalLength() > 0) {
1432  } else {
1433  return POSITION_EPS;
1434  };
1435 }
1436 
1437 
1438 void
1440  // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge
1441  // Save current centering boundary of child shapes
1442  for (auto i : getChildShapes()) {
1443  i->startGeometryMoving();
1444  }
1445  // Save current centering boundary of shapes with this lane as chid
1446  for (auto i : getParentShapes()) {
1447  i->startGeometryMoving();
1448  }
1449  // Save current centering boundary of child additional
1450  for (auto i : getChildAdditionals()) {
1451  i->startGeometryMoving();
1452  }
1453  // Save current centering boundary of additionals with this lane as chid
1454  for (auto i : getParentAdditionals()) {
1455  i->startGeometryMoving();
1456  }
1457  // Save current centering boundary of child demand elements
1458  for (auto i : getChildDemandElements()) {
1459  i->startGeometryMoving();
1460  }
1461  // Save current centering boundary of demand element with this lane as chid
1462  for (auto i : getParentDemandElements()) {
1463  i->startGeometryMoving();
1464  }
1465 }
1466 
1467 
1468 void
1470  // Lanes don't need to save the current Centering Boundary, due they are parts of an Edge
1471  // Restore centering boundary of shapes with this lane as chid
1472  for (auto i : getChildShapes()) {
1473  i->endGeometryMoving();
1474  }
1475  // Restore centering boundary of shapes with this lane as chid
1476  for (auto i : getParentShapes()) {
1477  i->endGeometryMoving();
1478  }
1479  // Restore centering boundary of additionals with this lane as chid
1480  for (auto i : getChildAdditionals()) {
1481  i->endGeometryMoving();
1482  }
1483  // Restore centering boundary of additionals with this lane as chid
1484  for (auto i : getParentAdditionals()) {
1485  i->endGeometryMoving();
1486  }
1487  // Restore centering boundary of demand elements with this lane as chid
1488  for (auto i : getChildDemandElements()) {
1489  i->endGeometryMoving();
1490  }
1491  // Restore centering boundary of demand elements with this lane as chid
1492  for (auto i : getParentDemandElements()) {
1493  i->endGeometryMoving();
1494  }
1495 }
1496 
1497 /****************************************************************************/
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
SUMO_ATTR_ENDOFFSET
Definition: SUMOXMLDefinitions.h:414
GNELane::setFunctionalColor
bool setFunctionalColor(int activeScheme, RGBColor &col) const
sets the color according to the current scheme index and some lane function
Definition: GNELane.cpp:1096
GNELane::drawVSSSymbol
void drawVSSSymbol(const GUIVisualizationSettings &s, GNEAdditional *vss) const
draw VSS symbol
Definition: GNELane.cpp:1260
MID_GNE_LANE_DUPLICATE
duplicate a lane
Definition: GUIAppEnum.h:924
MID_GNE_EDGE_EDIT_ENDPOINT
change default geometry endpoints
Definition: GUIAppEnum.h:834
MID_GNE_LANE_RESET_CUSTOMSHAPE
remove greenVerge
Definition: GUIAppEnum.h:926
GNELane::getParentName
std::string getParentName() const
Returns the name of the parent object (if any)
Definition: GNELane.cpp:1358
MID_GNE_EDGE_RESET_ENDPOINT
reset default geometry endpoints
Definition: GUIAppEnum.h:836
GNEJunction::getPositionInView
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNEJunction.cpp:122
MID_GNE_LANE_REMOVE_GREENVERGE
remove greenVerge
Definition: GUIAppEnum.h:950
PositionVector::beginEndAngle
double beginEndAngle() const
returns the angle in radians of the line connecting the first and the last position
Definition: PositionVector.cpp:808
GNELane::getPositionInView
Position getPositionInView() const
Returns position of hierarchical element in view.
Definition: GNELane.cpp:166
SVC_PEDESTRIAN
pedestrian
Definition: SUMOVehicleClass.h:156
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:133
GNELane::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNELane.cpp:764
GUIVisualizationColorSettings::selectedEdgeColor
RGBColor selectedEdgeColor
edge selection color
Definition: GUIVisualizationSettings.h:132
GNENetElement::unselectAttributeCarrier
void unselectAttributeCarrier(bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:99
SUMO_ATTR_ACCELERATION
Definition: SUMOXMLDefinitions.h:892
LINKSTATE_EQUAL
This is an uncontrolled, right-before-left link.
Definition: SUMOXMLDefinitions.h:1159
NBEdge::myTo
NBNode * myTo
Definition: NBEdge.h:1546
GLHelper::getColor
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:627
GNEJunction::isLogicValid
bool isLogicValid()
whether this junction has a valid logic
Definition: GNEJunction.cpp:890
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:73
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
NBEdge::getLaneSpeed
double getLaneSpeed(int lane) const
get lane speed
Definition: NBEdge.cpp:1872
Parameterised::getParametersStr
std::string getParametersStr() const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
Definition: Parameterised.cpp:112
ICON_LANEBIKE
Definition: GUIIcons.h:201
GNEAdditional.h
GUIVisualizationSettings::laneShowBorders
bool laneShowBorders
Information whether lane borders shall be drawn.
Definition: GUIVisualizationSettings.h:446
GUIVisualizationSettings::edgeParam
std::string edgeParam
key for coloring by edge parameter
Definition: GUIVisualizationSettings.h:482
GNEGeometry::Lane2laneConnection
lane2lane struct
Definition: GNEGeometry.h:255
NBNode::getLinkState
LinkState getLinkState(const NBEdge *incoming, NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
Definition: NBNode.cpp:2011
GNELane::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GNELane.cpp:584
GNEAttributeCarrier::getID
const std::string getID() const
function to support debugging
Definition: GNEAttributeCarrier.cpp:1289
SUMO_ATTR_DISALLOW
Definition: SUMOXMLDefinitions.h:783
StringUtils::toBool
static bool toBool(const std::string &sData)
converts a string into the bool value described by it by calling the char-type converter
Definition: StringUtils.cpp:374
GUIVisualizationSettings::laneMinSize
double laneMinSize
The minimum visual lane width for drawing.
Definition: GUIVisualizationSettings.h:470
GNELane::setLaneColor
RGBColor setLaneColor(const GUIVisualizationSettings &s) const
set color according to edit mode and visualisation settings
Definition: GNELane.cpp:1055
GNEGeometry::Geometry::updateGeometryShape
void updateGeometryShape(const PositionVector &shape, double startPos=-1, double endPos=-1, const Position &extraFirstPosition=Position::INVALID, const Position &extraLastPosition=Position::INVALID)
update geometry shape
Definition: GNEGeometry.cpp:48
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
GNELane::mySpecialColor
const RGBColor * mySpecialColor
optional special color
Definition: GNELane.h:229
GUIGLObjectPopupMenu::insertMenuPaneChild
void insertMenuPaneChild(FXMenuPane *child)
Insert a sub-menu pane in this GUIGLObjectPopupMenu.
Definition: GUIGLObjectPopupMenu.cpp:80
LINKSTATE_TL_OFF_BLINKING
The link is controlled by a tls which is off and blinks, has to brake.
Definition: SUMOXMLDefinitions.h:1151
GNEInternalLane.h
MID_GNE_LANE_TRANSFORM_BIKE
transform lane to bikelane
Definition: GUIAppEnum.h:930
GNEHierarchicalChildElements::getChildDemandElements
const std::vector< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
Definition: GNEHierarchicalChildElements.cpp:296
MID_GNE_EDGE_REVERSE
reverse an edge
Definition: GUIAppEnum.h:850
MID_GNE_LANE_TRANSFORM_BUS
transform lane to busLane
Definition: GUIAppEnum.h:932
GNEGeometry::drawSegmentGeometry
static void drawSegmentGeometry(const GNEViewNet *viewNet, const SegmentGeometry::Segment &segment, const double width)
draw geometry segment
Definition: GNEGeometry.cpp:850
GNELane::isAttributeEnabled
bool isAttributeEnabled(SumoXMLAttr key) const
Definition: GNELane.cpp:922
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:354
GNELane::isRestricted
bool isRestricted(SUMOVehicleClass vclass) const
check if this lane is restricted
Definition: GNELane.cpp:809
GNEEdge::SNAP_RADIUS
static const double SNAP_RADIUS
Definition: GNEEdge.h:273
NUMERICAL_EPS
#define NUMERICAL_EPS
Definition: config.h:148
GNELane::myLane2laneConnections
GNEGeometry::Lane2laneConnection myLane2laneConnections
lane2lane connections
Definition: GNELane.h:238
GNELane::drawPartialE2DetectorPlan
void drawPartialE2DetectorPlan(const GUIVisualizationSettings &s, const GNEAdditional *E2Detector, const GNEJunction *junction) const
draw partial E2 detector plan
Definition: GNELane.cpp:941
LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
Definition: SUMOXMLDefinitions.h:1153
Position::z
double z() const
Returns the z-position.
Definition: Position.h:66
GUIVisualizationSettings::drawForRectangleSelection
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
Definition: GUIVisualizationSettings.h:647
GNELane::getParentEdge
GNEEdge * getParentEdge() const
Returns underlying parent edge.
Definition: GNELane.cpp:1371
OptionsCont.h
GNENet::removeGLObjectFromGrid
void removeGLObjectFromGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1328
GNEGeometry::Geometry::getShapeLengths
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
Definition: GNEGeometry.cpp:159
StringUtils::toDouble
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
Definition: StringUtils.cpp:345
GUIVisualizationColorSettings::E2
static const RGBColor E2
color for E2 detectors
Definition: GUIVisualizationSettings.h:213
GNEHierarchicalChildElements::drawChildConnections
void drawChildConnections(const GUIVisualizationSettings &s, const GUIGlObjectType GLTypeParent) const
Definition: GNEHierarchicalChildElements.cpp:89
GLHelper::drawCrossTies
static void drawCrossTies(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double length, double spacing, double halfWidth, bool drawForRectangleSelection)
draw crossties for railroads or pedestrian crossings
Definition: GLHelper.cpp:768
GUIVisualizationTextSettings::color
RGBColor color
text color
Definition: GUIVisualizationSettings.h:74
MID_GNE_EDGE_RESET_LENGTH
reset custom lengths
Definition: GUIAppEnum.h:854
LINKDIR_PARTRIGHT
The link is a partial right direction.
Definition: SUMOXMLDefinitions.h:1190
GNELane::getAttributeForSelection
std::string getAttributeForSelection(SumoXMLAttr key) const
method for getting the attribute in the context of object selection
Definition: GNELane.cpp:852
SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
Definition: SUMOXMLDefinitions.h:702
GUIGLObjectPopupMenu.h
ICON_LANEGREENVERGE
Definition: GUIIcons.h:202
GNEGeometry::drawLaneGeometry
static void drawLaneGeometry(const GNEViewNet *viewNet, const PositionVector &shape, const std::vector< double > &rotations, const std::vector< double > &lengths, const std::vector< RGBColor > &colors, double width)
draw lane geometry (use their own function due colors)
Definition: GNEGeometry.cpp:820
StringBijection::getStrings
std::vector< std::string > getStrings() const
Definition: StringBijection.h:131
NBEdge::getConnectionsFromLane
std::vector< Connection > getConnectionsFromLane(int lane, NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition: NBEdge.cpp:1100
NBEdge::isBidiRail
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition: NBEdge.cpp:691
SUMO_TAG_LANE
begin/end of the description of a single lane
Definition: SUMOXMLDefinitions.h:49
GeomHelper::naviDegree
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:193
MID_GNE_LANE_ADD_BUS
add busLane
Definition: GUIAppEnum.h:940
GNELane::drawArrows
void drawArrows(const GUIVisualizationSettings &s) const
draw arrows
Definition: GNELane.cpp:224
LINKDIR_TURN_LEFTHAND
The link is a 180 degree turn (left-hand network)
Definition: SUMOXMLDefinitions.h:1182
GNELane::GNELane
GNELane()
FOX needs this.
Definition: GNELane.cpp:66
SVC_BICYCLE
vehicle is a bicycle
Definition: SUMOVehicleClass.h:179
GNELane::myShapeColors
std::vector< RGBColor > myShapeColors
The color of the shape parts (cached)
Definition: GNELane.h:235
NBEdge::getPriority
int getPriority() const
Returns the priority of the edge.
Definition: NBEdge.h:484
GNELane::getShapeRotations
const std::vector< double > & getShapeRotations() const
get rotations of the single shape parts
Definition: GNELane.cpp:92
SUMO_const_laneWidth
const double SUMO_const_laneWidth
Definition: StdDefs.h:49
SUMO_ATTR_SPEED
Definition: SUMOXMLDefinitions.h:384
GNETEXTURE_LANEBIKE
Definition: GUITextures.h:51
GUIVisualizationColorSettings::selectedRouteColor
RGBColor selectedRouteColor
route selection color (used for routes and vehicle stops)
Definition: GUIVisualizationSettings.h:150
MID_GNE_EDGE_SMOOTH
smooth geometry
Definition: GUIAppEnum.h:840
GNEEdge::getGNEConnections
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
Definition: GNEEdge.cpp:880
SUMO_ATTR_ID
Definition: SUMOXMLDefinitions.h:378
PositionVector::length
double length() const
Returns the length.
Definition: PositionVector.cpp:484
GNEEdge::hasRestrictedLane
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
Definition: GNEEdge.cpp:1894
GLHelper.h
GUIVisualizationSettings::drawLinkJunctionIndex
GUIVisualizationTextSettings drawLinkJunctionIndex
Definition: GUIVisualizationSettings.h:569
GUIVisualizationSettings::showRails
bool showRails
Information whether rails shall be drawn.
Definition: GUIVisualizationSettings.h:458
NBEdge::setPermissions
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
Definition: NBEdge.cpp:3376
GNE_NMODE_CREATE_EDGE
mode for creating new edges
Definition: GNEViewNetHelper.h:64
NBEdge::getPermissions
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
Definition: NBEdge.cpp:3404
LinkDirection
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
Definition: SUMOXMLDefinitions.h:1176
GNE_NMODE_TLS
mode for editing tls
Definition: GNEViewNetHelper.h:68
GNELane::myIndex
int myIndex
The index of this lane.
Definition: GNELane.h:213
GNENetElement::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNENetElement.cpp:120
LINKSTATE_MAJOR
This is an uncontrolled, major link, may pass.
Definition: SUMOXMLDefinitions.h:1155
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GNELane::setIndex
void setIndex(int index)
Definition: GNELane.cpp:779
LINKDIR_NODIR
The link has no direction (is a dead end link)
Definition: SUMOXMLDefinitions.h:1192
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
PositionVector::getBoxBoundary
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
Definition: PositionVector.cpp:390
SumoXMLTag
SumoXMLTag
Numbers representing SUMO-XML - element names.
Definition: SUMOXMLDefinitions.h:41
GNELane::drawAsRailway
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition: GNELane.cpp:1222
GUITexturesHelper::drawTexturedBox
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Definition: GUITexturesHelper.cpp:72
GNEAttributeCarrier::TagProperties::getTag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
Definition: GNEAttributeCarrier.cpp:523
GNELane::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNELane.cpp:343
GNELane::getSpeed
double getSpeed() const
returns the current speed of lane
Definition: GNELane.cpp:786
GUIVisualizationDetailSettings::geometryPointsText
static const double geometryPointsText
details for Geometry Points Texts
Definition: GUIVisualizationSettings.h:295
Parameterised::getParameter
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
Definition: Parameterised.cpp:72
NBEdge
The representation of a single edge during network building.
Definition: NBEdge.h:91
GUIAppEnum.h
MID_GNE_EDGE_SPLIT_BIDI
split an edge
Definition: GUIAppEnum.h:848
MID_GNE_LANE_REMOVE_SIDEWALK
remove sidewalk
Definition: GUIAppEnum.h:944
GNEAdditional::getAdditionalSegmentGeometry
const GNEGeometry::SegmentGeometry & getAdditionalSegmentGeometry() const
obtain additional segment geometry
Definition: GNEAdditional.cpp:112
GNEJunction.h
GUIVisualizationSettings::junctionColorer
GUIColorer junctionColorer
The junction colorer.
Definition: GUIVisualizationSettings.h:566
GUIVisualizationSettings::lefthand
bool lefthand
whether drawing is performed in left-hand networks
Definition: GUIVisualizationSettings.h:659
GNELane::getIndex
int getIndex() const
returns the index of the lane
Definition: GNELane.cpp:774
LINKDIR_RIGHT
The link is a (hard) right direction.
Definition: SUMOXMLDefinitions.h:1186
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
GNEEdge
A road/street connecting two junctions (netedit-version)
Definition: GNEEdge.h:51
GNEAttributeCarrier::GNEChange_Attribute
friend class GNEChange_Attribute
declare friend class
Definition: GNEAttributeCarrier.h:57
MID_GNE_EDGE_STRAIGHTEN
remove inner geometry
Definition: GUIAppEnum.h:838
GNEUndoList::p_add
void p_add(GNEChange_Attribute *cmd)
special method, avoid empty changes, always execute
Definition: GNEUndoList.cpp:131
GNELane::myLaneGeometry
GNEGeometry::Geometry myLaneGeometry
lane geometry
Definition: GNELane.h:216
parseVehicleClasses
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
Definition: SUMOVehicleClass.cpp:222
GNEHierarchicalChildElements::getChildRotation
double getChildRotation(const GNELane *lane)
get child rotation calculated in ChildConnections
Definition: GNEHierarchicalChildElements.cpp:72
GLHelper::drawFilledCircle
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:348
NBEdge::setLaneShape
void setLaneShape(int lane, const PositionVector &shape)
sets a custom lane shape
Definition: NBEdge.cpp:3368
NBEdge::setEndOffset
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3300
GNEHierarchicalParentElements::getParentAdditionals
const std::vector< GNEAdditional * > & getParentAdditionals() const
get parent additionals
Definition: GNEHierarchicalParentElements.cpp:85
LINKDIR_TURN
The link is a 180 degree turn.
Definition: SUMOXMLDefinitions.h:1180
PositionVector::nearest_offset_to_point2D
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
Definition: PositionVector.cpp:817
NumberFormatException
Definition: UtilExceptions.h:95
GLHelper::drawText
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, int align=0, double width=-1)
Definition: GLHelper.cpp:673
GNELane::getLaneParametricLength
double getLaneParametricLength() const
returns the parameteric length of the lane
Definition: GNELane.cpp:792
RGBColor
Definition: RGBColor.h:39
LinkState
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
Definition: SUMOXMLDefinitions.h:1137
GUIGlObject::setMicrosimID
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
Definition: GUIGlObject.cpp:173
GUIVisualizationSettings::addName
GUIVisualizationTextSettings addName
Definition: GUIVisualizationSettings.h:591
GNENet::retrieveLanes
std::vector< GNELane * > retrieveLanes(bool onlySelected=false)
return all lanes
Definition: GNENet.cpp:1213
LINKDIR_STRAIGHT
The link is a straight direction.
Definition: SUMOXMLDefinitions.h:1178
NBEdge::getToNode
NBNode * getToNode() const
Returns the destination node of the edge.
Definition: NBEdge.h:498
canParseVehicleClasses
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
Definition: SUMOVehicleClass.cpp:251
SUMO_TAG_FLOW
a flow definitio nusing a from-to edges instead of a route (used by router)
Definition: SUMOXMLDefinitions.h:149
GLHelper::drawOutlineCircle
static void drawOutlineCircle(double width, double iwidth, int steps=8)
Draws an unfilled circle around (0,0)
Definition: GLHelper.cpp:393
GUIVisualizationSettings::detailSettings
GUIVisualizationDetailSettings detailSettings
detail settings
Definition: GUIVisualizationSettings.h:683
GNEAttributeCarrier::getTagProperty
const TagProperties & getTagProperty() const
get Tag Property assigned to this object
Definition: GNEAttributeCarrier.cpp:1273
GNEHierarchicalParentElements::getParentDemandElements
const std::vector< GNEDemandElement * > & getParentDemandElements() const
get parent demand elements
Definition: GNEHierarchicalParentElements.cpp:114
GNELane::mySpecialColorValue
double mySpecialColorValue
optional value that corresponds to which the special color corresponds
Definition: GNELane.h:232
NBEdge::getLaneWidth
double getLaneWidth() const
Returns the default width of lanes of this edge.
Definition: NBEdge.h:587
GNELane::myLaneRestrictedTextureRotations
std::vector< double > myLaneRestrictedTextureRotations
Rotations of textures of restricted lanes.
Definition: GNELane.h:225
GNELane::endGeometryMoving
void endGeometryMoving()
begin movement (used when user click over edge to start a movement, to avoid problems with problems w...
Definition: GNELane.cpp:1469
GUIVisualizationSettings::showLinkDecals
bool showLinkDecals
Information whether link textures (arrows) shall be drawn.
Definition: GUIVisualizationSettings.h:452
SVCPermissions
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
Definition: SUMOVehicleClass.h:218
GNEGeometry::Geometry::getShape
const PositionVector & getShape() const
The shape of the additional element.
Definition: GNEGeometry.cpp:147
MID_COPY_EDGE_NAME
Copy edge name (for lanes only)
Definition: GUIAppEnum.h:386
GNELane::getLaneShape
const PositionVector & getLaneShape() const
Definition: GNELane.cpp:86
GUIVisualizationSettings::laneWidthExaggeration
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
Definition: GUIVisualizationSettings.h:467
GUIGlObject::buildNameCopyPopupEntry
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Definition: GUIGlObject.cpp:225
SUMO_TAG_VSS
A variable speed sign.
Definition: SUMOXMLDefinitions.h:89
GNELane::drawAsWaterway
bool drawAsWaterway(const GUIVisualizationSettings &s) const
whether to draw this lane as a waterways
Definition: GNELane.cpp:1228
GNEEdge::getNBEdge
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition: GNEEdge.cpp:631
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:79
GNEViewNet::buildSelectionACPopupEntry
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
Definition: GNEViewNet.cpp:338
GNETEXTURE_LANEBUS
Definition: GUITextures.h:52
NBEdge::getLaneID
std::string getLaneID(int lane) const
get lane ID
Definition: NBEdge.cpp:3093
StringBijection::get
T get(const std::string &str) const
Definition: StringBijection.h:97
GNEHierarchicalChildElements::getChildShapes
const std::vector< GNEShape * > & getChildShapes() const
get child shapes
Definition: GNEHierarchicalChildElements.cpp:444
NBNode::getConnectionIndex
int getConnectionIndex(const NBEdge *from, const NBEdge::Connection &con) const
return the index of the given connection
Definition: NBNode.cpp:3155
GNEDemandElement.h
isWaterway
bool isWaterway(SVCPermissions permissions)
Returns whether an edge with the given permission is a waterway edge.
Definition: SUMOVehicleClass.cpp:369
GNEViewNet.h
NBNode::getDirection
LinkDirection getDirection(const NBEdge *const incoming, const NBEdge *const outgoing, bool leftHand=false) const
Returns the representation of the described stream's direction.
Definition: NBNode.cpp:1933
SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
Definition: SUMOVehicleClass.h:159
GNELane::getLane2laneConnections
const GNEGeometry::Lane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition: GNELane.cpp:815
PositionVector::positionAtOffset
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:248
SUMO_ATTR_WIDTH
Definition: SUMOXMLDefinitions.h:386
GNELane::getLengthGeometryFactor
double getLengthGeometryFactor() const
get length geometry factor
Definition: GNELane.cpp:1428
PositionVector::rotationDegreeAtOffset
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Definition: PositionVector.cpp:319
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
GNEViewNet::getDottedAC
const GNEAttributeCarrier * getDottedAC() const
get AttributeCarrier under cursor
Definition: GNEViewNet.cpp:1026
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
MID_GNE_LANE_REMOVE_BIKE
remove bikelane
Definition: GUIAppEnum.h:946
LINKSTATE_ZIPPER
This is an uncontrolled, zipper-merge link.
Definition: SUMOXMLDefinitions.h:1165
GNELane::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
Definition: GNELane.cpp:862
NBEdge::getNumLanes
int getNumLanes() const
Returns the number of lanes.
Definition: NBEdge.h:477
GNEInternalLane::colorForLinksState
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
Definition: GNEInternalLane.cpp:184
SUMO_TAG_EDGE
begin/end of the description of an edge
Definition: SUMOXMLDefinitions.h:47
GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
Definition: SUMOXMLDefinitions.h:989
GUITextureSubSys::getTexture
static GUIGlID getTexture(GUITexture which)
returns a texture previously defined in the enum GUITexture
Definition: GUITextureSubSys.cpp:101
GNEGeometry::Lane2laneConnection::updateLane2laneConnection
void updateLane2laneConnection()
update
Definition: GNEGeometry.cpp:401
GNETLSEditorFrame.h
GLHelper::drawShapeDottedContourRectangle
static void drawShapeDottedContourRectangle(const GUIVisualizationSettings &s, const int type, const Position &center, const double width, const double height, const double rotation=0, const double offsetX=0, const double offsetY=0)
draw a dotted contour around the given Position with certain width and height
Definition: GLHelper.cpp:560
GNEGeometry::drawGeometry
static void drawGeometry(const GNEViewNet *viewNet, const Geometry &geometry, const double width)
draw geometry
Definition: GNEGeometry.cpp:795
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
ProcessError
Definition: UtilExceptions.h:39
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
getVehicleClassNames
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
Definition: SUMOVehicleClass.cpp:168
isRailway
bool isRailway(SVCPermissions permissions)
Returns whether an edge with the given permission is a railway edge.
Definition: SUMOVehicleClass.cpp:363
NBEdge::setSpeed
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3345
GNELane::setMultiColor
bool setMultiColor(const GUIVisualizationSettings &s, const GUIColorer &c, RGBColor &col) const
sets multiple colors according to the current scheme index and some lane function
Definition: GNELane.cpp:1110
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GLO_EDGE
an edge
Definition: GUIGlObjectTypes.h:46
GNE_NMODE_CONNECT
mode for connecting lanes
Definition: GNEViewNetHelper.h:66
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
GNEEdge.h
GUIVisualizationSettings::selectionScale
double selectionScale
the current selection scaling in NETEDIT (temporary)
Definition: GUIVisualizationSettings.h:641
GNENetElement::isAttributeCarrierSelected
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
Definition: GNENetElement.cpp:114
GLHelper::drawLine
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition: GLHelper.cpp:274
GUIVisualizationSettings::drawLinkTLIndex
GUIVisualizationTextSettings drawLinkTLIndex
Definition: GUIVisualizationSettings.h:569
GLO_LANE
a lane
Definition: GUIGlObjectTypes.h:48
NBEdge::getLaneStruct
Lane & getLaneStruct(int lane)
Definition: NBEdge.h:1287
NBEdge::Lane::width
double width
This lane's width.
Definition: NBEdge.h:166
LINKDIR_LEFT
The link is a (hard) left direction.
Definition: SUMOXMLDefinitions.h:1184
MID_GNE_LANE_TRANSFORM_SIDEWALK
transform lane to sidewalk
Definition: GUIAppEnum.h:928
GNENetElement
Definition: GNENetElement.h:43
RGBColor::fromHSV
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:298
GNELane::getLaneShapeLength
double getLaneShapeLength() const
returns the length of the lane's shape
Definition: GNELane.cpp:803
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
LINKSTATE_MINOR
This is an uncontrolled, minor link, has to brake.
Definition: SUMOXMLDefinitions.h:1157
GNELane::getGNEIncomingConnections
std::vector< GNEConnection * > getGNEIncomingConnections()
returns a vector with the incoming GNEConnections of this lane
Definition: GNELane.cpp:1377
GNEEdge::getGNEJunctionDestiny
GNEJunction * getGNEJunctionDestiny() const
returns the destination-junction
Definition: GNEEdge.cpp:493
GUIVisualizationDetailSettings::laneTextures
static const double laneTextures
details for lane textures
Definition: GUIVisualizationSettings.h:283
GUISUMOAbstractView::getPositionInformation
Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Definition: GUISUMOAbstractView.cpp:190
GLHelper::drawShapeDottedContourAroundShape
static void drawShapeDottedContourAroundShape(const GUIVisualizationSettings &s, const int type, const PositionVector &shape, const double width)
draw a dotted contour around the given Non closed shape with certain width
Definition: GLHelper.cpp:461
GUIVisualizationSettings::laneParam
std::string laneParam
Definition: GUIVisualizationSettings.h:482
SVC_SHIP
is an arbitrary ship
Definition: SUMOVehicleClass.h:195
MID_GNE_LANE_ADD_SIDEWALK
add sidewalk
Definition: GUIAppEnum.h:936
NetworkEditMode
NetworkEditMode
@brie enum for network edit modes
Definition: GNEViewNetHelper.h:52
GNELane.h
GNELane::setSpecialColor
void setSpecialColor(const RGBColor *Color2, double colorValue=std::numeric_limits< double >::max())
Definition: GNELane.cpp:934
GNELane::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNELane.cpp:821
NBEdge::myConnections
std::vector< Connection > myConnections
List of connections to following edges.
Definition: NBEdge.h:1570
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2117
GNELane::drawMarkings
void drawMarkings(const GUIVisualizationSettings &s, double scale) const
draw lane markings
Definition: GNELane.cpp:547
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
GNEShape.h
SUMO_ATTR_INDEX
Definition: SUMOXMLDefinitions.h:804
SUMO_TAG_E2DETECTOR_MULTILANE
an e2 detector over multiple lanes (used by Netedit)
Definition: SUMOXMLDefinitions.h:69
GUIVisualizationSettings::colorSettings
GUIVisualizationColorSettings colorSettings
color settings
Definition: GUIVisualizationSettings.h:677
BoolFormatException
Definition: UtilExceptions.h:121
GNEAttributeCarrier::isAttributeCarrierSelected
virtual bool isAttributeCarrierSelected() const =0
check if attribute carrier is selected
GUIVisualizationSettings::getCircleResolution
int getCircleResolution() const
function to calculate circle resolution for all circles drawn in drawGL(...) functions
Definition: GUIVisualizationSettings.cpp:1679
MID_GNE_LANE_TRANSFORM_GREENVERGE
transform lane to greenVerge
Definition: GUIAppEnum.h:934
NBEdge::getLoadedLength
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
Definition: NBEdge.h:554
GNEHierarchicalChildElements::getChildPosition
const Position & getChildPosition(const GNELane *lane)
get child position calculated in ChildConnections
Definition: GNEHierarchicalChildElements.cpp:61
GNEJunction::getGNEIncomingEdges
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
Definition: GNEJunction.cpp:481
GNELane::getGNEOutcomingConnections
std::vector< GNEConnection * > getGNEOutcomingConnections()
returns a vector with the outgoing GNEConnections of this lane
Definition: GNELane.cpp:1398
Parameterised::setParametersStr
void setParametersStr(const std::string &paramsString)
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
Definition: Parameterised.cpp:139
GNEViewParent.h
NBEdge::getLength
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:545
GLIncludes.h
GNEEdge::getGNEJunctionSource
GNEJunction * getGNEJunctionSource() const
returns the source-junction
Definition: GNEEdge.cpp:487
NBEdge::getLaneShape
const PositionVector & getLaneShape(int i) const
Returns the shape of the nth lane.
Definition: NBEdge.cpp:879
GNELane::startGeometryMoving
void startGeometryMoving()
Definition: GNELane.cpp:1439
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNELane::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNELane.cpp:104
GNENet::addGLObjectIntoGrid
void addGLObjectIntoGrid(GUIGlObject *o)
add GL Object into net
Definition: GNENet.cpp:1322
NBEdge::Lane::customShape
PositionVector customShape
A custom shape for this lane set by the user.
Definition: NBEdge.h:179
SUMO_ATTR_VIA
Definition: SUMOXMLDefinitions.h:723
GUIMainWindow
Definition: GUIMainWindow.h:46
GNELane::onDefault
long onDefault(FXObject *, FXSelector, void *)
multiplexes message to two targets
Definition: GNELane.cpp:1364
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
GUIVisualizationSettings::showLaneDirection
bool showLaneDirection
Whether to show direction indicators for lanes.
Definition: GUIVisualizationSettings.h:473
MID_GNE_EDGE_SPLIT
split an edge
Definition: GUIAppEnum.h:846
PositionVector::positionAtOffset2D
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:273
NBEdge::setAcceleration
void setAcceleration(int lane, bool accelRamp)
marks one lane as acceleration lane
Definition: NBEdge.cpp:3360
NBEdge::setLaneWidth
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
Definition: NBEdge.cpp:3239
Parameterised::areParametersValid
static bool areParametersValid(const std::string &value, bool report=false)
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
Definition: Parameterised.cpp:166
GNELane::myLaneRestrictedTexturePositions
std::vector< Position > myLaneRestrictedTexturePositions
Position of textures of restricted lanes.
Definition: GNELane.h:222
MID_GNE_EDGE_STRAIGHTEN_ELEVATION
interpolate z values linear between junctions
Definition: GUIAppEnum.h:842
InvalidArgument
Definition: UtilExceptions.h:56
GLHelper::drawBoxLine
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
Definition: GLHelper.cpp:136
ICON_LANEBUS
Definition: GUIIcons.h:200
SVCAll
const SVCPermissions SVCAll
all VClasses are allowed
Definition: SUMOVehicleClass.cpp:146
GNEAttributeCarrier::getAttribute
virtual std::string getAttribute(SumoXMLAttr key) const =0
MID_GNE_EDGE_ADD_REVERSE
add reverse edge
Definition: GUIAppEnum.h:852
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
GNENet::retrieveEdges
std::vector< GNEEdge * > retrieveEdges(bool onlySelected=false)
return all edges
Definition: GNENet.cpp:1200
GUIVisualizationSettings::drawAdditionals
bool drawAdditionals(const double exaggeration) const
check if additionals must be drawn
Definition: GUIVisualizationSettings.cpp:1663
GNEAdditional::drawUsingSelectColor
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
Definition: GNEAdditional.cpp:554
GNETLSEditorFrame::handleMultiChange
void handleMultiChange(GNELane *lane, FXObject *obj, FXSelector sel, void *data)
update phase definition for the current traffic light and phase
Definition: GNETLSEditorFrame.cpp:774
SUMO_ATTR_ALLOW
Definition: SUMOXMLDefinitions.h:782
GNELane::updateConnectionIDs
void updateConnectionIDs()
update IDs of incoming connections of this lane
Definition: GNELane.cpp:1413
GNELane::generateChildID
std::string generateChildID(SumoXMLTag childTag)
gererate a new ID for an element child
Definition: GNELane.cpp:79
GNEHierarchicalParentElements::getParentShapes
const std::vector< GNEShape * > & getParentShapes() const
get parent shapes
Definition: GNEHierarchicalParentElements.cpp:267
GNEViewParent::getTLSEditorFrame
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
Definition: GNEViewParent.cpp:198
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
NBEdge::UNSPECIFIED_WIDTH
static const double UNSPECIFIED_WIDTH
unspecified lane width
Definition: NBEdge.h:315
GUIGlObject::buildPositionCopyEntry
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Definition: GUIGlObject.cpp:266
GNELane::drawDirectionIndicators
void drawDirectionIndicators(double exaggeration, bool spreadSuperposed) const
direction indicators for lanes
Definition: GNELane.cpp:1234
GUIVisualizationTextSettings::size
double size
text size
Definition: GUIVisualizationSettings.h:71
GNETLSEditorFrame::controlsEdge
bool controlsEdge(GNEEdge *edge) const
whether the given edge is controlled by the currently edited tlDef
Definition: GNETLSEditorFrame.cpp:818
NBEdge::getFinalLength
double getFinalLength() const
get length that will be assigned to the lanes in the final network
Definition: NBEdge.cpp:3682
GNENetElement::myNet
GNENet * myNet
the net to inform about updates
Definition: GNENetElement.h:166
GNELane::drawStartEndShapePoints
void drawStartEndShapePoints(const GUIVisualizationSettings &s) const
draw start and end shape points
Definition: GNELane.cpp:1312
GNELane::drawTLSLinkNo
void drawTLSLinkNo(const GUIVisualizationSettings &s) const
draw TLS Link Number
Definition: GNELane.cpp:196
NBEdge::Lane::accelRamp
bool accelRamp
Whether this lane is an acceleration lane.
Definition: NBEdge.h:172
LINKSTATE_ALLWAY_STOP
This is an uncontrolled, all-way stop link.
Definition: SUMOXMLDefinitions.h:1163
MID_GNE_LANE_ADD_GREENVERGE
add greenVerge
Definition: GUIAppEnum.h:942
config.h
MID_GNE_EDGE_SMOOTH_ELEVATION
smooth elevation with regard to adjoining edges
Definition: GUIAppEnum.h:844
GUIVisualizationSettings::addSize
GUIVisualizationSizeSettings addSize
Definition: GUIVisualizationSettings.h:589
GNEInternalLane::LinkStateNames
static const StringBijection< FXuint > LinkStateNames
long names for link states
Definition: GNEInternalLane.h:106
GUIVisualizationSettings::laneColorer
GUIColorer laneColorer
The lane colorer.
Definition: GUIVisualizationSettings.h:440
GLO_JUNCTION
a junction
Definition: GUIGlObjectTypes.h:50
SVC_BUS
vehicle is a bus
Definition: SUMOVehicleClass.h:165
GNEGeometry::Geometry::getShapeRotations
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
Definition: GNEGeometry.cpp:153
GNE_ATTR_SELECTED
element is selected
Definition: SUMOXMLDefinitions.h:971
StringTokenizer.h
MID_GNE_LANE_REMOVE_BUS
remove busLane
Definition: GUIAppEnum.h:948
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:434
GUIVisualizationSettings::spreadSuperposed
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
Definition: GUIVisualizationSettings.h:479
GNELane::getShapeLengths
const std::vector< double > & getShapeLengths() const
get lengths of the single shape parts
Definition: GNELane.cpp:98
SUMO_const_laneMarkWidth
const double SUMO_const_laneMarkWidth
Definition: StdDefs.h:55
RGBColor::GREEN
static const RGBColor GREEN
Definition: RGBColor.h:190
GNEGeometry::calculateRotation
static double calculateRotation(const Position &first, const Position &second)
return angle between two points (used in geometric calculations)
Definition: GNEGeometry.cpp:548
GNELane::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
return value for lane coloring according to the given scheme
Definition: GNELane.cpp:1134
GUIVisualizationSettings::drawDetail
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
Definition: GUIVisualizationSettings.cpp:1669
NBEdge::Lane::endOffset
double endOffset
This lane's offset to the intersection begin.
Definition: NBEdge.h:159
GNENetElement::selectAttributeCarrier
void selectAttributeCarrier(bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
Definition: GNENetElement.cpp:83
GNELane::drawLinkRules
void drawLinkRules(const GUIVisualizationSettings &s) const
draw link rules
Definition: GNELane.cpp:218
GNELane::drawLinkNo
void drawLinkNo(const GUIVisualizationSettings &s) const
draw link Number
Definition: GNELane.cpp:173
NBEdge::Lane::shape
PositionVector shape
The lane's shape.
Definition: NBEdge.h:147
MFXUtils::getFXColor
static FXColor getFXColor(const RGBColor &col)
converts FXColor to RGBColor
Definition: MFXUtils.cpp:113
GNEAttributeCarrier::getTagStr
const std::string & getTagStr() const
get tag assigned to this object in string format
Definition: GNEAttributeCarrier.cpp:1267
NBNode
Represents a single node (junction) during network building.
Definition: NBNode.h:67
GNEUndoList
Definition: GNEUndoList.h:48
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
GNEJunction
Definition: GNEJunction.h:47
ICON_LANEPEDESTRIAN
Definition: GUIIcons.h:199
invertPermissions
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
Definition: SUMOVehicleClass.cpp:285
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:153
SVC_IGNORING
vehicles ignoring classes
Definition: SUMOVehicleClass.h:135
GNETEXTURE_LANEPEDESTRIAN
Definition: GUITextures.h:53
GNELane::~GNELane
~GNELane()
Destructor.
Definition: GNELane.cpp:76
LINKDIR_PARTLEFT
The link is a partial left direction.
Definition: SUMOXMLDefinitions.h:1188
GUIGlObject::getMicrosimID
virtual const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
Definition: GUIGlObject.cpp:163
GNEViewNetHelper::EditModes::networkEditMode
NetworkEditMode networkEditMode
the current Network edit mode
Definition: GNEViewNetHelper.h:308
POSITION_EPS
#define POSITION_EPS
Definition: config.h:172
GUIVisualizationColorSettings::selectedLaneColor
RGBColor selectedLaneColor
lane selection color
Definition: GUIVisualizationSettings.h:135
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:110
GNELane
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:45
MID_GNE_LANE_ADD_BIKE
add bikelane
Definition: GUIAppEnum.h:938
GNELane::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
Definition: GNELane.cpp:886
GUIPropertySchemeStorage::getSchemes
const std::vector< T > & getSchemes() const
Definition: GUIPropertySchemeStorage.h:87
GNE_NMODE_MOVE
mode for moving network elements
Definition: GNEViewNetHelper.h:62
GUIVisualizationSettings::disableLaneIcons
bool disableLaneIcons
whether drawing is performed in left-hand networks
Definition: GUIVisualizationSettings.h:665
GUITextureSubSys.h
GNEHierarchicalChildElements::getChildAdditionals
const std::vector< GNEAdditional * > & getChildAdditionals() const
return child additionals
Definition: GNEHierarchicalChildElements.cpp:131
GNEChange_Attribute.h
GNENet.h
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:75
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
PositionVector::move2side
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Definition: PositionVector.cpp:1103
SUMO_TAG_TRIP
a single trip definition (used by router)
Definition: SUMOXMLDefinitions.h:145
GNEViewNet::getViewParent
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:1008
NBEdge::getDistance
double getDistance() const
Definition: NBEdge.h:616
RGBColor::WHITE
static const RGBColor WHITE
Definition: RGBColor.h:196
GNEUndoList.h
GNELane::drawLane2LaneConnections
void drawLane2LaneConnections() const
draw lane to lane connections
Definition: GNELane.cpp:293
GLHelper::drawTextAtEnd
static void drawTextAtEnd(const std::string &text, const PositionVector &shape, double x, double size, RGBColor color)
draw text and the end of shape
Definition: GLHelper.cpp:755
GUIPropertySchemeStorage< GUIColorScheme >
GNELane::myParentEdge
GNEEdge * myParentEdge
The Edge that to which this lane belongs.
Definition: GNELane.h:210
LINKSTATE_STOP
This is an uncontrolled, minor link, has to stop.
Definition: SUMOXMLDefinitions.h:1161
GNEConnection.h
GLHelper::drawTriangleAtEnd
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth)
Draws a triangle at the end of the given line.
Definition: GLHelper.cpp:440