Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEConnection.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2023 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
18// A class for visualizing connections between lanes
19/****************************************************************************/
20#include <config.h>
21
23#include <netedit/GNENet.h>
24#include <netedit/GNEUndoList.h>
25#include <netedit/GNEViewNet.h>
35
36#include "GNEConnection.h"
37#include "GNEInternalLane.h"
38
39
40// ===========================================================================
41// static member definitions
42// ===========================================================================
43static const int NUM_POINTS = 5;
44
45// ===========================================================================
46// method definitions
47// ===========================================================================
48
50 GNENetworkElement(from->getNet(), "from" + from->getID() + "to" + to->getID(),
51 GLO_CONNECTION, SUMO_TAG_CONNECTION, GUIIconSubSys::getIcon(GUIIcon::CONNECTION), {}, {}, {}, {}, {}, {}),
52 myFromLane(from),
53 myToLane(to),
54 myLinkState(LINKSTATE_TL_OFF_NOSIGNAL),
55 mySpecialColor(nullptr),
56myShapeDeprecated(true) {
57 // update centering boundary without updating grid
58 updateCenteringBoundary(false);
59}
60
61
64
65
66const PositionVector&
68 if (myConnectionGeometry.getShape().size() > 0) {
70 } else {
72 }
73}
74
75
76void
78 // Get shape of from and to lanes
81 // obtain lane shape from
82 PositionVector laneShapeFrom;
83 if ((int)getEdgeFrom()->getNBEdge()->getLanes().size() > nbCon.fromLane) {
84 laneShapeFrom = getEdgeFrom()->getNBEdge()->getLanes().at(nbCon.fromLane).shape;
85 } else {
86 return;
87 }
88 // obtain lane shape to
89 PositionVector laneShapeTo;
90 if ((int)nbCon.toEdge->getLanes().size() > nbCon.toLane) {
91 laneShapeTo = nbCon.toEdge->getLanes().at(nbCon.toLane).shape;
92 } else {
93 return;
94 }
95 // Calculate shape of connection depending of the size of Junction shape
96 // value obtained from GNEJunction::drawgl
97 if (nbCon.customShape.size() != 0) {
99 } else if (getEdgeFrom()->getNBEdge()->getToNode()->getShape().area() > 4) {
100 if (nbCon.shape.size() > 1) {
101 PositionVector connectionShape;
102 if (nbCon.shape.front() == nbCon.shape.back()) {
103 laneShapeFrom.move2side(0.7);
104 laneShapeTo.move2side(0.7);
105 connectionShape.push_back(laneShapeFrom.back());
106 connectionShape.push_back(laneShapeTo.front());
107 } else {
108 connectionShape = nbCon.shape;
109 }
110 // only append via shape if it exists
111 if (nbCon.haveVia) {
112 connectionShape.append(nbCon.viaShape);
113 }
114 myConnectionGeometry.updateGeometry(connectionShape);
115 } else {
116 // Calculate shape so something can be drawn immediately
117 myConnectionGeometry.updateGeometry(getEdgeFrom()->getNBEdge()->getToNode()->computeSmoothShape(
118 laneShapeFrom, laneShapeTo, NUM_POINTS,
119 getEdgeFrom()->getNBEdge()->getTurnDestination() == nbCon.toEdge,
120 (double) 5. * (double) getEdgeFrom()->getNBEdge()->getNumLanes(),
121 (double) 5. * (double) nbCon.toEdge->getNumLanes()));
122 }
123 } else {
124 myConnectionGeometry.updateGeometry({laneShapeFrom.positionAtOffset(MAX2(0.0, laneShapeFrom.length() - 1)),
125 laneShapeTo.positionAtOffset(MIN2(1.0, laneShapeFrom.length()))});
126 }
127 // check if internal junction marker must be calculated
128 if (nbCon.haveVia && (nbCon.shape.size() != 0)) {
129 // create marker for internal junction waiting position (contPos)
130 const double orthoLength = 0.5;
131 Position pos = nbCon.shape.back();
132 myInternalJunctionMarker = nbCon.shape.getOrthogonal(pos, 10, true, 0.1);
133 if (myInternalJunctionMarker.length() < orthoLength) {
135 }
136 } else {
138 }
139 // mark connection as non-deprecated
140 myShapeDeprecated = false;
141 }
142}
143
144
147 // currently unused
148 return Position(0, 0);
149}
150
151
154 // edit depending if shape is being edited
155 if (isShapeEdited()) {
156 // get connection
157 const auto& connection = getNBEdgeConnection();
158 // calculate move shape operation
159 return calculateMoveShapeOperation(connection.customShape.size() > 0 ? connection.customShape : myConnectionGeometry.getShape(),
162 } else {
163 return nullptr;
164 }
165}
166
167
168void
169GNEConnection::removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) {
170 // edit depending if shape is being edited
171 if (isShapeEdited()) {
172 // get connection
173 const auto& connection = getNBEdgeConnection();
174 // get original shape
175 PositionVector shape = connection.customShape.size() > 0 ? connection.customShape : connection.shape;
176 // check shape size
177 if (shape.size() > 2) {
178 // obtain index
179 int index = shape.indexOfClosest(clickedPosition);
180 // get snap radius
182 // check if we have to create a new index
183 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
184 // remove geometry point
185 shape.erase(shape.begin() + index);
186 // commit new shape
187 undoList->begin(GUIIcon::CONNECTION, "remove geometry point of " + getTagStr());
189 undoList->end();
190 }
191 }
192 }
193}
194
195
196GNEEdge*
200
201
202GNEEdge*
204 return myToLane->getParentEdge();
205}
206
207
208GNELane*
210 return myFromLane;
211}
212
213
214GNELane*
216 return myToLane;
217}
218
219
220int
224
225
226int
228 return myToLane->getIndex();
229}
230
231
236
237
241 return NBConnection(getEdgeFrom()->getNBEdge(), getFromLaneIndex(),
242 getEdgeTo()->getNBEdge(), getToLaneIndex(),
243 (int)c.tlLinkIndex, (int)c.tlLinkIndex2);
244}
245
246
247void
251
252
255 return myLinkState;
256}
257
258
259void
263
264
265void
269 nbCon.toEdge,
270 nbCon.fromLane,
271 nbCon.toLane,
272 nbCon.mayDefinitelyPass,
273 nbCon.tlID);
274}
275
276
277void
279 auto shape = getConnectionShape();
280 shape = shape.bezier(5);
282}
283
284
287 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
288 buildPopupHeader(ret, app);
291 // build selection and show parameters menu
294 // build position copy entry
295 buildPositionCopyEntry(ret, app);
296 // check if we're in supermode network
298 // create menu commands
299 FXMenuCommand* mcCustomShape = GUIDesigns::buildFXMenuCommand(ret, "Set custom connection shape", nullptr, &parent, MID_GNE_CONNECTION_EDIT_SHAPE);
300 GUIDesigns::buildFXMenuCommand(ret, "Smooth connection shape", nullptr, &parent, MID_GNE_CONNECTION_SMOOTH_SHAPE);
301 // check if menu commands has to be disabled
303 // check if we're in the correct edit mode
305 mcCustomShape->disable();
306 }
307 }
308 return ret;
309}
310
311
312double
316
317
318void
319GNEConnection::updateCenteringBoundary(const bool /*updateGrid*/) {
320 // calculate boundary
321 if (myConnectionGeometry.getShape().size() == 0) {
322 // we need to use the center of junction parent as boundary if shape is empty
323 const Position junctionParentPosition = myFromLane->getParentEdge()->getToJunction()->getPositionInView();
324 myBoundary = Boundary(junctionParentPosition.x() - 0.1, junctionParentPosition.y() - 0.1,
325 junctionParentPosition.x() + 0.1, junctionParentPosition.x() + 0.1);
326 } else {
328 }
329 // grow
330 myBoundary.grow(10);
331}
332
333
334void
336 // check if draw start und end
337 const bool drawExtremeSymbols = myNet->getViewNet()->getEditModes().isCurrentSupermodeNetwork() &&
339 // get edited network element
341 // declare a flag to check if shape has to be draw
342 bool drawConnection = true;
343 // declare flag to check if push glID
344 bool pushGLID = true;
348 drawConnection = !myShapeDeprecated;
351 drawConnection = !myShapeDeprecated;
352 } else {
353 drawConnection = false;
354 }
355 } else {
356 drawConnection = false;
357 }
358 // check if we're editing this connection
359 if (editedNetworkElement && (editedNetworkElement->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
360 if (editedNetworkElement->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT)) {
361 drawConnection = true;
362 }
363 if (editedNetworkElement != this) {
364 pushGLID = false;
365 }
366 }
367 // Check if connection must be drawed
368 if (drawConnection) {
369 // draw connection checking whether it is not too small if isn't being drawn for selecting
370 const double selectionScale = isAttributeCarrierSelected() ? s.selectorFrameScale : 1;
371 // get color
372 RGBColor connectionColor;
373 // first check if we're editing shape
374 if (myShapeEdited) {
375 connectionColor = s.colorSettings.editShapeColor;
376 } else if (drawUsingSelectColor()) {
377 // override with special colors (unless the color scheme is based on selection)
378 connectionColor = s.colorSettings.selectedConnectionColor;
379 } else if (mySpecialColor != nullptr) {
380 connectionColor = *mySpecialColor;
381 } else {
382 // Set color depending of the link state
384 }
385 // avoid draw invisible elements
386 if (connectionColor.alpha() != 0) {
387 // check if boundary has to be drawn
388 if (s.drawBoundaries) {
390 }
391 // Push name
392 if (pushGLID) {
394 }
395 // Push layer matrix
397 // translate to front
398 myNet->getViewNet()->drawTranslateFrontAttributeCarrier(this, GLO_CONNECTION, (editedNetworkElement == this) ? 1 : 0);
399 // Set color
400 GLHelper::setColor(connectionColor);
401 if ((s.scale * selectionScale < 5.) && !s.drawForRectangleSelection) {
402 // If it's small, draw a simple line
404 } else {
405 // draw connections geometry
406 const bool spreadSuperposed = s.scale >= 1 && s.spreadSuperposed && myFromLane->drawAsRailway(s) && getEdgeFrom()->getNBEdge()->isBidiRail();
407 PositionVector shapeSuperposed = myConnectionGeometry.getShape();
408 if (spreadSuperposed) {
409 shapeSuperposed.move2side(0.5);
410 }
412 glTranslated(0, 0, 0.1);
413 GLHelper::setColor(GLHelper::getColor().changedBrightness(51));
414 // draw arrows over connection
416 // check if internal junction marker has to be drawn
417 if (myInternalJunctionMarker.size() > 0) {
419 }
420 // draw shape points only in Network supemode
422 // color
423 const RGBColor darkerColor = connectionColor.changedBrightness(-32);
424 // draw geometry points
427 myNet->getViewNet()->getNetworkViewOptions().editingElevation(), drawExtremeSymbols);
428 // draw moving hint
432 }
433 }
434 // Pop layer matrix
436 // check if edge value has to be shown
437 if (s.edgeValue.show(this)) {
439 std::string value = nbCon.getParameter(s.edgeParam, "");
440 if (value != "") {
441 int shapeIndex = (int)myConnectionGeometry.getShape().size() / 2;
442 Position p = (myConnectionGeometry.getShape().size() == 2
443 ? (myConnectionGeometry.getShape().front() * 0.67 + myConnectionGeometry.getShape().back() * 0.33)
444 : myConnectionGeometry.getShape()[shapeIndex]);
445 GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, 0);
446 }
447 }
448 // Pop name
449 if (pushGLID) {
451 }
452 // draw lock icon
454 // check if mouse is over element
456 // inspect contour
458 // use drawDottedContourGeometry to draw it
460 }
461 // front contour
462 if (myNet->getViewNet()->getFrontAttributeCarrier() == this) {
463 // use drawDottedContourGeometry to draw it
465 }
466 // delete contour
467 if (myNet->getViewNet()->drawDeleteContour(this, this)) {
468 // use drawDottedContourGeometry to draw it
470 }
471 // select contour
472 if (myNet->getViewNet()->drawSelectContour(this, this)) {
473 // use drawDottedContourGeometry to draw it
475 }
476 }
477 }
478 }
479}
480
481
482void
486
487
488void
492
493
494void
498
499
500std::string
502 if (key == SUMO_ATTR_ID) {
503 // used by GNEReferenceCounter
504 // @note: may be called for connections without a valid nbCon reference
505 return getMicrosimID();
506 }
508 switch (key) {
509 case SUMO_ATTR_FROM:
510 return getEdgeFrom()->getID();
511 case SUMO_ATTR_TO:
512 return nbCon.toEdge->getID();
514 return toString(nbCon.fromLane);
516 return toString(nbCon.toLane);
517 case SUMO_ATTR_PASS:
518 return toString(nbCon.mayDefinitelyPass);
520 return toString(nbCon.indirectLeft);
521 case SUMO_ATTR_TYPE:
522 return toString(nbCon.edgeType);
524 return toString(nbCon.keepClear);
526 return toString(nbCon.contPos);
528 return toString(nbCon.uncontrolled);
530 return toString(nbCon.visibility);
532 return toString(nbCon.tlLinkIndex);
534 return toString(nbCon.tlLinkIndex2);
535 case SUMO_ATTR_ALLOW:
536 if (nbCon.permissions == SVC_UNSPECIFIED) {
537 return getVehicleClassNames(nbCon.toEdge->getLanes()[nbCon.toLane].permissions);
538 } else {
539 return getVehicleClassNames(nbCon.permissions);
540 }
542 if (nbCon.permissions == SVC_UNSPECIFIED) {
543 return getVehicleClassNames(invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions));
544 } else {
546 }
548 if (nbCon.changeLeft == SVC_UNSPECIFIED) {
549 return "all";
550 } else {
551 return getVehicleClassNames(nbCon.changeLeft);
552 }
554 if (nbCon.changeRight == SVC_UNSPECIFIED) {
555 return "all";
556 } else {
557 return getVehicleClassNames(nbCon.changeRight);
558 }
559 case SUMO_ATTR_SPEED:
560 if (nbCon.speed == NBEdge::UNSPECIFIED_SPEED) {
561 return "default";
562 } else {
563 return toString(nbCon.speed);
564 }
565 case SUMO_ATTR_LENGTH:
566 return toString(nbCon.customLength);
567 case SUMO_ATTR_DIR:
568 return toString(getEdgeFrom()->getNBEdge()->getToNode()->getDirection(
569 getEdgeFrom()->getNBEdge(), nbCon.toEdge, OptionsCont::getOptions().getBool("lefthand")));
570 case SUMO_ATTR_STATE:
571 return toString(getEdgeFrom()->getNBEdge()->getToNode()->getLinkState(
572 getEdgeFrom()->getNBEdge(), nbCon.toEdge, nbCon.fromLane, nbCon.toLane, nbCon.mayDefinitelyPass, nbCon.tlID));
574 return toString(nbCon.customShape);
578 return nbCon.getParametersStr();
579 case GNE_ATTR_PARENT:
580 return getEdgeFrom()->getToJunction()->getID();
581 default:
582 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
583 }
584}
585
586
587void
588GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
590 switch (key) {
591 case SUMO_ATTR_FROM:
592 case SUMO_ATTR_TO:
595 case SUMO_ATTR_PASS:
600 case SUMO_ATTR_ALLOW:
604 case SUMO_ATTR_SPEED:
605 case SUMO_ATTR_LENGTH:
607 case SUMO_ATTR_TYPE:
610 // no special handling
611 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
612 break;
614 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
615 changeTLIndex(key, parse<int>(value), c.tlLinkIndex2, undoList);
616 }
617 break;
619 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
620 changeTLIndex(key, c.tlLinkIndex, parse<int>(value), undoList);
621 }
622 break;
624 undoList->begin(GUIIcon::CONNECTION, "change attribute indirect for connection");
625 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
626 undoList->changeAttribute(new GNEChange_Attribute(this, key, value));
627 int linkIndex2 = -1;
628 if (parse<bool>(value)) {
629 // find straight connection with the same toEdge
630 std::set<NBTrafficLightDefinition*> defs = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS();
631 NBEdge* from = getEdgeFrom()->getNBEdge();
632 for (NBTrafficLightDefinition* tlDef : defs) {
633 for (const NBConnection& c2 : tlDef->getControlledLinks()) {
634 if (c2.getTo() == c.toEdge && c2.getFrom() != from) {
635 LinkDirection dir = from->getToNode()->getDirection(c2.getFrom(), c2.getTo());
636 if (dir == LinkDirection::STRAIGHT) {
637 linkIndex2 = c2.getTLIndex();
638 break;
639 }
640 }
641 }
642 }
643 }
644 changeTLIndex(key, c.tlLinkIndex, linkIndex2, undoList);
645 }
646 undoList->end();
647 break;
648 case SUMO_ATTR_DIR:
649 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
650 case SUMO_ATTR_STATE:
651 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
652 default:
653 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
654 }
655}
656
657
658void
659GNEConnection::changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList) {
660 // trigger GNEChange_TLS
661 undoList->begin(GUIIcon::CONNECTION, "change tls linkIndex for connection");
662 // make a copy
663 std::set<NBTrafficLightDefinition*> defs = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS();
664 for (const auto& tlDef : defs) {
665 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
666 NBTrafficLightLogic* tllogic = sumoDef ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
667 if (tllogic != nullptr) {
668 NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*tlDef, *tllogic);
669 newDef->addConnection(getEdgeFrom()->getNBEdge(), getEdgeTo()->getNBEdge(),
670 getLaneFrom()->getIndex(), getLaneTo()->getIndex(), tlIndex, tlIndex2, false);
671 // make a copy
672 std::vector<NBNode*> nodes = tlDef->getNodes();
673 for (const auto& node : nodes) {
674 GNEJunction* junction = getNet()->getAttributeCarriers()->retrieveJunction(node->getID());
675 undoList->add(new GNEChange_TLS(junction, tlDef, false), true);
676 undoList->add(new GNEChange_TLS(junction, newDef, true), true);
677 }
678 } else {
679 WRITE_ERRORF(TL("Could not set attribute '%' (tls is broken)"), toString(key));
680 }
681 }
682 undoList->end();
683}
684
685
686void
688 if (s.showLaneDirection) {
689 for (int i = 1; i < (int)myConnectionGeometry.getShape().size(); i++) {
690 const auto posA = myConnectionGeometry.getShape()[i - 1];
691 const auto posB = myConnectionGeometry.getShape()[i];
692 GLHelper::drawTriangleAtEnd(posA, posB, (double) 1, (double) .2);
693 }
694 }
695}
696
697
698bool
699GNEConnection::isValid(SumoXMLAttr key, const std::string& value) {
700 // Currently ignored before implementation to avoid warnings
701 switch (key) {
702 case SUMO_ATTR_FROM:
703 case SUMO_ATTR_TO:
706 return false;
707 case SUMO_ATTR_PASS:
708 return canParse<bool>(value);
710 return canParse<bool>(value);
711 case SUMO_ATTR_TYPE:
712 return true;
714 return canParse<bool>(value);
716 return canParse<double>(value) && (parse<double>(value) >= -1);
718 return canParse<bool>(value);
720 return canParse<double>(value) && (parse<double>(value) >= -1);
724 (getNBEdgeConnection().uncontrolled == false) &&
725 (getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) &&
726 canParse<int>(value) &&
727 (parse<int>(value) >= 0 || parse<int>(value) == -1)) {
728 // obtain Traffic light definition
730 return def->getMaxValidIndex() >= parse<int>(value);
731 } else {
732 return false;
733 }
734 case SUMO_ATTR_ALLOW:
738 return canParseVehicleClasses(value);
739 case SUMO_ATTR_SPEED:
740 if (value.empty() || value == "default") {
741 return true;
742 } else {
743 return canParse<double>(value) && ((parse<double>(value) >= 0) || (parse<double>(value) == NBEdge::UNSPECIFIED_SPEED));
744 }
745 case SUMO_ATTR_LENGTH:
746 return canParse<double>(value) && (parse<double>(value) >= -1);
748 // empty custom shapes are allowed
749 return canParse<PositionVector>(value);
750 }
751 case SUMO_ATTR_STATE:
752 return false;
753 case SUMO_ATTR_DIR:
754 return false;
756 return canParse<bool>(value);
759 default:
760 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
761 }
762}
763
764
765bool
767 switch (key) {
768 case SUMO_ATTR_FROM:
769 case SUMO_ATTR_TO:
772 case SUMO_ATTR_DIR:
773 case SUMO_ATTR_STATE:
774 // this attributes cannot be edited
775 return false;
778 // get Traffic Light definitions
779 if (getEdgeFrom()->getNBEdge()->getToNode()->isTLControlled()) {
781 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
782 NBTrafficLightLogic* tllogic = sumoDef != nullptr ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
783 if (tllogic != nullptr) {
784 return true;
785 } else {
786 return false;
787 }
788 }
789 return false;
790 default:
791 return true;
792 }
793}
794
795
796bool
798 switch (key) {
799 case SUMO_ATTR_SPEED:
801 default:
802 return false;
803 }
804}
805
806
811
812// ===========================================================================
813// private
814// ===========================================================================
815
816void
817GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value) {
819 switch (key) {
820 case SUMO_ATTR_PASS:
821 nbCon.mayDefinitelyPass = parse<bool>(value);
822 break;
824 nbCon.indirectLeft = parse<bool>(value);
825 break;
827 nbCon.keepClear = parse<bool>(value) ? KEEPCLEAR_TRUE : KEEPCLEAR_FALSE;
828 break;
830 nbCon.uncontrolled = parse<bool>(value);
831 break;
833 nbCon.contPos = parse<double>(value);
834 break;
836 nbCon.visibility = parse<double>(value);
837 break;
838 case SUMO_ATTR_SPEED:
839 if (value.empty() || (value == "default")) {
841 } else {
842 nbCon.speed = parse<double>(value);
843 }
844 break;
845 case SUMO_ATTR_LENGTH:
846 nbCon.customLength = parse<double>(value);
847 break;
848 case SUMO_ATTR_ALLOW: {
849 const SVCPermissions successorAllows = nbCon.toEdge->getLanes()[nbCon.toLane].permissions;
850 SVCPermissions customPermissions = parseVehicleClasses(value);
851 if (successorAllows != customPermissions) {
852 nbCon.permissions = customPermissions;
853 }
854 break;
855 }
856 case SUMO_ATTR_DISALLOW: {
857 const SVCPermissions successorDisallows = invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions);
858 SVCPermissions customPermissions = invertPermissions(parseVehicleClasses(value));
859 if (successorDisallows != customPermissions) {
860 nbCon.permissions = customPermissions;
861 }
862 break;
863 }
865 nbCon.changeLeft = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
866 break;
867 }
869 nbCon.changeRight = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
870 break;
871 }
872 case SUMO_ATTR_STATE:
873 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
874 case SUMO_ATTR_DIR:
875 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
877 nbCon.customShape = parse<PositionVector>(value);
878 // update centering boundary
880 break;
881 }
882 case SUMO_ATTR_TYPE: {
883 nbCon.edgeType = value;
884 break;
885 }
887 if (parse<bool>(value)) {
889 } else {
891 }
892 break;
894 nbCon.setParametersStr(value);
895 break;
896 default:
897 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
898 }
899 // Update Geometry after setting a new attribute (but avoided for certain attributes)
900 if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) {
903 }
904 // invalidate path calculator
906}
907
908
909void
911 // set custom shape
913 // mark junction as deprecated
914 myShapeDeprecated = true;
915 // update geometry
917}
918
919
920void
922 // commit new shape
923 undoList->begin(GUIIcon::CONNECTION, "moving " + toString(SUMO_ATTR_CUSTOMSHAPE) + " of " + getTagStr());
925 undoList->end();
926}
927
928/****************************************************************************/
static const int NUM_POINTS
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_CONNECT
mode for connecting lanes
@ MID_GNE_CONNECTION_SMOOTH_SHAPE
@ brief smooth connection shape
@ MID_GNE_CONNECTION_EDIT_SHAPE
edit connection shape
@ GLO_CONNECTION
a connection
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define WRITE_ERRORF(...)
Definition MsgHandler.h:280
#define TL(string)
Definition MsgHandler.h:287
@ KEEPCLEAR_FALSE
Definition NBCont.h:59
@ KEEPCLEAR_TRUE
Definition NBCont.h:60
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
const SVCPermissions SVC_UNSPECIFIED
permissions not specified
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
@ SUMO_TAG_CONNECTION
connectioon between two lanes
LinkDirection
The different directions a link between two lanes may take (or a stream between two edges)....
@ STRAIGHT
The link is a straight direction.
LinkState
The right-of-way state of a link between two lanes used when constructing a NBTrafficLightLogic,...
@ LINKSTATE_TL_OFF_NOSIGNAL
The link is controlled by a tls which is off, not blinking, may pass.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_DISALLOW
@ SUMO_ATTR_ALLOW
@ SUMO_ATTR_TLLINKINDEX2
link: the index of the opposite direction link of a pedestrian crossing
@ SUMO_ATTR_SPEED
@ SUMO_ATTR_INDIRECT
Whether this connection is an indirect (left) turn.
@ SUMO_ATTR_FROM_LANE
@ GNE_ATTR_PARENT
parent of an additional element
@ GNE_ATTR_SELECTED
element is selected
@ SUMO_ATTR_CUSTOMSHAPE
whether a given shape is user-defined
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ SUMO_ATTR_CHANGE_LEFT
@ SUMO_ATTR_PASS
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ SUMO_ATTR_CHANGE_RIGHT
@ SUMO_ATTR_TO_LANE
@ SUMO_ATTR_UNCONTROLLED
@ SUMO_ATTR_TYPE
@ SUMO_ATTR_LENGTH
@ SUMO_ATTR_ID
@ SUMO_ATTR_VISIBILITY_DISTANCE
foe visibility distance of a link
@ SUMO_ATTR_CONTPOS
@ SUMO_ATTR_DIR
The abstract direction of a link.
@ SUMO_ATTR_TLLINKINDEX
link: the index of the link within the traffic light
@ SUMO_ATTR_KEEP_CLEAR
Whether vehicles must keep the junction clear.
@ SUMO_ATTR_STATE
The state of a link.
T MIN2(T a, T b)
Definition StdDefs.h:76
T MAX2(T a, T b)
Definition StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
Boundary & grow(double by)
extends the boundary by the given amount
Definition Boundary.cpp:300
static void drawBoundary(const Boundary &b)
Draw a boundary (used for debugging)
Definition GLHelper.cpp:897
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:421
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:583
static void drawTriangleAtEnd(const Position &p1, const Position &p2, double tLength, double tWidth, const double extraOffset=0)
Draws a triangle at the end of the given line.
Definition GLHelper.cpp:558
static void pushName(unsigned int name)
push Name
Definition GLHelper.cpp:139
static void popMatrix()
pop matrix
Definition GLHelper.cpp:130
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:329
static RGBColor getColor()
gets the gl-color
Definition GLHelper.cpp:589
static void popName()
pop Name
Definition GLHelper.cpp:148
static void pushMatrix()
push matrix
Definition GLHelper.cpp:117
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048, const int align=0)
Definition GLHelper.cpp:716
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
friend class GNEChange_Attribute
declare friend class
const std::string & getTagStr() const
get tag assigned to this object in string format
const GNETagProperties & getTagProperty() const
get tagProperty associated with this Attribute Carrier
void unselectAttributeCarrier(const bool changeFlag=true)
unselect attribute carrier using GUIGlobalSelection
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
void selectAttributeCarrier(const bool changeFlag=true)
select attribute carrier using GUIGlobalSelection
NBConnection getNBConnection() const
get NBConnection
Position getPositionInView() const
Returns position of hierarchical element in view.
GNELane * getLaneFrom() const
@briefthe get lane of the incoming lane
void smootShape()
smoothShape
const PositionVector & getConnectionShape() const
GNELane * getLaneTo() const
@briefthe get lane of the outgoing lane
GNELane * myFromLane
incoming lane of this connection
LinkState getLinkState() const
get LinkState
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
int getFromLaneIndex() const
@briefthe get lane index of the incoming lane
void deleteGLObject()
delete element
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList)
remove geometry point in the clicked position
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
GUIGeometry myConnectionGeometry
connection geometry
GNELane * myToLane
outgoing lane of this connection
std::string getAttribute(SumoXMLAttr key) const
GNEEdge * getEdgeFrom() const
get the name of the edge the vehicles leave
bool isAttributeComputed(SumoXMLAttr key) const
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
GNEConnection(GNELane *from, GNELane *to)
GNEEdge * getEdgeTo() const
get the name of the edge the vehicles may reach when leaving "from"
NBEdge::Connection & getNBEdgeConnection() const
get Edge::Connection
void setSpecialColor(const RGBColor *Color2)
GNEMoveOperation * getMoveOperation()
get move operation
void updateGeometry()
update pre-computed geometry information
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration associated with this GLObject
bool isValid(SumoXMLAttr key, const std::string &value)
const RGBColor * mySpecialColor
optional special color
~GNEConnection()
Destructor.
int getToLaneIndex() const
@briefthe get lane index of the outgoing lane
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
bool myShapeDeprecated
flag to indicate that connection's shape has to be updated
void updateLinkState()
recompute cached myLinkState
const Parameterised::Map & getACParametersMap() const
get parameters map
void drawConnectionArrows(const GUIVisualizationSettings &s) const
draw arrows over connections
PositionVector myInternalJunctionMarker
waiting position for internal junction
bool isAttributeEnabled(SumoXMLAttr key) const
LinkState myLinkState
Linkstate.
void updateGLObject()
update GLObject (geometry, ID, etc.)
void updateID()
update internal ID of Connection
void changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList *undoList)
manage change of tlLinkindices
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:480
GNEJunction * getToJunction() const
get from Junction (only used to increase readability)
Definition GNEEdge.h:82
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
Position getPositionInView() const
Returns position of hierarchical element in view.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:788
bool drawAsRailway(const GUIVisualizationSettings &s) const
whether to draw this lane as a railway
Definition GNELane.cpp:1501
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:118
GNEMoveOperation * calculateMoveShapeOperation(const PositionVector originalShape, const Position mousePosition, const double snapRadius, const bool onlyContour)
calculate move shape operation
move operation
move result
PositionVector shapeToUpdate
shape to update (edited in moveElement)
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
void deleteNetworkElement(GNENetworkElement *networkElement, GNEUndoList *undoList)
delete network element
Definition GNENet.cpp:325
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:120
GNEPathManager * getPathManager()
get path manager
Definition GNENet.cpp:132
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2030
virtual std::string getAttribute(SumoXMLAttr key) const =0
bool myShapeEdited
flag to check if element shape is being edited
bool isShapeEdited() const
check if shape is being edited
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Boundary myBoundary
object boundary
void invalidatePathCalculator()
invalidate pathCalculator
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void changeAttribute(GNEChange_Attribute *change)
special method for change attributes, avoid empty changes, always execute
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
bool drawSelectContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw select contour
bool drawDeleteContour(const GUIGlObject *GLObject, const GNEAttributeCarrier *AC) const
check if draw delete contour
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void drawTranslateFrontAttributeCarrier(const GNEAttributeCarrier *AC, double typeOrLayer, const double extraOffset=0)
draw front attributeCarrier
GNEUndoList * getUndoList() const
get the undoList object
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
bool isAttributeCarrierInspected(const GNEAttributeCarrier *AC) const
check if attribute carrier is being inspected
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
static void drawDottedContourShape(const GUIVisualizationSettings &s, const DottedContourType type, const PositionVector &shape, const double width, const double exaggeration, const bool drawFirstExtrem, const bool drawLastExtrem)
draw dotted contour for the given shape (used by additionals)
The popup menu of a globject.
static void drawGeometryPoints(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const RGBColor &geometryPointColor, const RGBColor &textColor, const double radius, const double exaggeration, const bool editingElevation, const bool drawExtremeSymbols)
draw geometry points
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
static void drawMovingHint(const GUIVisualizationSettings &s, const Position &mousePos, const PositionVector &shape, const RGBColor &hintColor, const double radius, const double exaggeration)
draw moving hint
const std::vector< double > & getShapeLengths() const
The lengths of the single shape parts.
const std::string & getMicrosimID() const
Returns the id of the object as known to microsim.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual void setMicrosimID(const std::string &newID)
Changes the microsimID of the object.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
bool mouseWithinGeometry(const Position center, const double radius) const
check if mouse is within elements geometry (for circles)
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
GUIGlID getGlID() const
Returns the numerical id of the object.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
virtual Position getPositionInformation() const
Returns the cursor's x/y position within the network.
Stores the information about how to visualize structures.
bool drawBoundaries
enable or disable draw boundaries
bool drawForRectangleSelection
whether drawing is performed for the purpose of selecting objects using a rectangle
GUIVisualizationDetailSettings detailSettings
detail settings
GUIVisualizationSizeSettings addSize
GUIVisualizationTextSettings edgeValue
bool drawMovingGeometryPoint(const double exaggeration, const double radius) const
check if moving geometry point can be draw
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationConnectionSettings connectionSettings
connection settings
double scale
information about a lane's width (temporary, used for a single view)
bool showLaneDirection
Whether to show direction indicators for lanes.
bool drawDetail(const double detail, const double exaggeration) const
check if details can be drawn for the given GUIVisualizationDetailSettings and current scale and exxa...
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
std::string edgeParam
key for coloring by edge parameter
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
The representation of a single edge during network building.
Definition NBEdge.h:92
NBNode * getToNode() const
Returns the destination node of the edge.
Definition NBEdge.h:536
Connection & getConnectionRef(int fromLane, const NBEdge *to, int toLane)
Returns reference to the specified connection This method goes through "myConnections" and returns th...
Definition NBEdge.cpp:1247
bool isBidiRail(bool ignoreSpread=false) const
whether this edge is part of a bidirectional railway
Definition NBEdge.cpp:729
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition NBEdge.h:720
const std::string & getID() const
Definition NBEdge.h:1515
int getNumLanes() const
Returns the number of lanes.
Definition NBEdge.h:510
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition NBEdge.h:347
A loaded (complete) traffic light logic.
NBTrafficLightLogic * getLogic()
Returns the internal logic.
void addConnection(NBEdge *from, NBEdge *to, int fromLane, int toLane, int linkIndex, int linkIndex2, bool reconstruct=true)
Adds a connection and immediately informs the edges.
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:2315
const std::set< NBTrafficLightDefinition * > & getControllingTLS() const
Returns the traffic lights that were assigned to this node (The set of tls that control this node)
Definition NBNode.h:334
LinkState getLinkState(const NBEdge *incoming, const NBEdge *outgoing, int fromLane, int toLane, bool mayDefinitelyPass, const std::string &tlID) const
get link state
Definition NBNode.cpp:2398
The base class for traffic light logic definitions.
NBTrafficLightLogic * compute(const OptionsCont &oc)
Computes the traffic light logic.
virtual int getMaxValidIndex()
Returns the maximum index controlled by this traffic light.
A SUMO-compliant built logic for a traffic light.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static OptionsCont & getOptions()
Retrieves the options.
static bool areParametersValid(const std::string &value, bool report=false, const std::string kvsep="=", const std::string sep="|")
check if given string can be parsed to a parameters map "key1=value1|key2=value2|....
std::map< std::string, std::string > Map
parameters map
void setParametersStr(const std::string &paramsString, const std::string kvsep="=", const std::string sep="|")
set the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN"
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
const Parameterised::Map & getParametersMap() const
Returns the inner key/value map.
std::string getParametersStr(const std::string kvsep="=", const std::string sep="|") const
Returns the inner key/value map in string format "key1=value1|key2=value2|...|keyN=valueN".
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
A list of positions.
void append(const PositionVector &v, double sameThreshold=2.0)
double length() const
Returns the length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
PositionVector getOrthogonal(const Position &p, double extend, bool before, double length=1.0, double deg=90) const
return orthogonal through p (extending this vector if necessary)
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain ammount
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
unsigned char alpha() const
Returns the alpha-amount of the color.
Definition RGBColor.cpp:92
static const RGBColor BLACK
Definition RGBColor.h:193
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:200
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
GNENetworkElement * getEditedNetworkElement() const
pointer to edited network element
static void drawLockIcon(const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position viewPosition, const double exaggeration, const double size=0.5, const double offsetx=0, const double offsety=0)
draw lock icon
bool showConnections() const
check if select show connections checkbox is enabled
bool editingElevation() const
check if we're editing elevation
static const RGBColor editShapeColor
color for edited shapes (Junctions, crossings and connections)
RGBColor selectedConnectionColor
connection selection color
static const double connectionWidth
connection width
static const double connectionsDemandMode
draw connections in demand mode
static const double connectionGeometryPointRadius
moving connection geometry point radius
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
bool show(const GUIGlObject *o) const
whether to show the text
A structure which describes a connection between edges or lanes.
Definition NBEdge.h:201
bool indirectLeft
Whether this connection is an indirect left turn.
Definition NBEdge.h:261
int fromLane
The lane the connections starts at.
Definition NBEdge.h:210
int toLane
The lane the connections yields in.
Definition NBEdge.h:216
SVCPermissions permissions
List of vehicle types that are allowed on this connection.
Definition NBEdge.h:252
double speed
custom speed for connection
Definition NBEdge.h:240
NBEdge * toEdge
The edge the connections yields in.
Definition NBEdge.h:213
KeepClear keepClear
whether the junction must be kept clear when using this connection
Definition NBEdge.h:231
double customLength
custom length for connection
Definition NBEdge.h:246
std::string edgeType
optional type of Connection
Definition NBEdge.h:264
bool uncontrolled
check if Connection is uncontrolled
Definition NBEdge.h:297
PositionVector customShape
custom shape for connection
Definition NBEdge.h:249
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
Definition NBEdge.h:228
SVCPermissions changeLeft
List of vehicle types that are allowed to change Left from this connections internal lane(s)
Definition NBEdge.h:255
SVCPermissions changeRight
List of vehicle types that are allowed to change right from this connections internal lane(s)
Definition NBEdge.h:258
PositionVector viaShape
shape of via
Definition NBEdge.h:282
double contPos
custom position for internal junction on this connection
Definition NBEdge.h:234
std::string tlID
The id of the traffic light that controls this connection.
Definition NBEdge.h:219
double visibility
custom foe visiblity for connection
Definition NBEdge.h:237
int tlLinkIndex2
The index of the internal junction within the controlling traffic light (optional)
Definition NBEdge.h:225
PositionVector shape
shape of Connection
Definition NBEdge.h:270
bool haveVia
check if Connection have a Via
Definition NBEdge.h:276
int tlLinkIndex
The index of this connection within the controlling traffic light.
Definition NBEdge.h:222