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