Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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-2025 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
22#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// method definitions
41// ===========================================================================
42
44 GNENetworkElement(from->getNet(), "from" + from->getID() + "to" + to->getID(), SUMO_TAG_CONNECTION),
45 myLinkState(LINKSTATE_TL_OFF_NOSIGNAL),
46 mySpecialColor(nullptr),
47 myShapeDeprecated(true) {
48 // set parents
49 setParents<GNELane*>({from, to});
50 setParents<GNEEdge*>({from->getParentEdge(), to->getParentEdge()});
51}
52
53
56
57
58const PositionVector&
60 if (myConnectionGeometry.getShape().size() > 0) {
62 } else {
64 }
65}
66
67
68void
70 // check if adjust shape
72 // Get shape of from and to lanes
74 // obtain lane shapes
75 auto laneShapeFrom = getParentLanes().front()->getLaneShape();
76 auto laneShapeTo = getParentLanes().back()->getLaneShape();
77 // Calculate shape of connection depending of the size of Junction shape
78 if (nbCon.customShape.size() > 0) {
80 } else if (nbCon.shape.size() > 1) {
81 PositionVector connectionShape;
82 if (nbCon.shape.front().distanceSquaredTo(nbCon.shape.back()) < 0.2) {
83 laneShapeFrom.move2side(0.8);
84 laneShapeTo.move2side(-0.8);
85 connectionShape.push_back(laneShapeFrom.back());
86 connectionShape.push_back(laneShapeTo.front());
87 connectionShape.rotate2D(nbCon.shape.front(), 0.5 * M_PI);
88 } else {
89 connectionShape = nbCon.shape;
90 }
91 // only append via shape if it exists
92 if (nbCon.haveVia) {
93 connectionShape.append(nbCon.viaShape);
94 }
95 myConnectionGeometry.updateGeometry(connectionShape);
96 } else if (getParentLanes().front()->getLane2laneConnections().exist(getParentLanes().back())) {
97 myConnectionGeometry = getParentLanes().front()->getLane2laneConnections().getLane2laneGeometry(getParentLanes().back());
98 } else {
100 }
101 // check if internal junction marker must be calculated
102 if (nbCon.haveVia && (nbCon.shape.size() > 0)) {
103 // create marker for internal junction waiting position (contPos)
104 const double orthoLength = 0.5;
105 PositionVector internalJunctionMarker = nbCon.shape.getOrthogonal(nbCon.shape.back(), 10, true, 0.1);
106 if (internalJunctionMarker.length() < orthoLength) {
107 internalJunctionMarker.extrapolate(orthoLength - internalJunctionMarker.length());
108 }
109 myInternalJunctionMarkerGeometry.updateGeometry(internalJunctionMarker);
110 } else {
112 }
113 // mark connection as non-deprecated
114 myShapeDeprecated = false;
115 }
116}
117
118
121 // currently unused
122 return Position(0, 0);
123}
124
125
126bool
128 return false;
129}
130
131
132bool
134 return false;
135}
136
137
138bool
140 // check opened popup
141 if (myNet->getViewNet()->getPopup()) {
142 return myNet->getViewNet()->getPopup()->getGLObject() == this;
143 }
144 return false;
145}
146
147
148bool
150 return false;
151}
152
153
154bool
156 // get edit modes
157 const auto& editModes = myNet->getViewNet()->getEditModes();
158 // check if we're in delete mode
159 if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_DELETE)) {
161 } else {
162 return false;
163 }
164}
165
166
167bool
169 return false;
170}
171
172
173bool
175 // get edit modes
176 const auto& editModes = myNet->getViewNet()->getEditModes();
177 // check if we're in select mode
178 if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_SELECT)) {
180 } else {
181 return false;
182 }
183}
184
185
186bool
188 // get edit modes
189 const auto& editModes = myNet->getViewNet()->getEditModes();
190 // check if we're in move mode
191 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
192 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
193 // check if we're editing this network element
195 if (editedNetworkElement) {
196 return editedNetworkElement == this;
197 } else {
198 // only move the first element
200 }
201 } else {
202 return false;
203 }
204}
205
206
209 // edit depending if shape is being edited
210 if (isShapeEdited()) {
211 // get connection
212 const auto& connection = getNBEdgeConnection();
213 // calculate move shape operation
214 return calculateMoveShapeOperation(this, connection.customShape.size() > 0 ? connection.customShape : myConnectionGeometry.getShape(), false);
215 } else {
216 return nullptr;
217 }
218}
219
220
221void
222GNEConnection::removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) {
223 // edit depending if shape is being edited
224 if (isShapeEdited()) {
225 // get connection
226 const auto& connection = getNBEdgeConnection();
227 // get original shape
228 PositionVector shape = connection.customShape.size() > 0 ? connection.customShape : connection.shape;
229 // check shape size
230 if (shape.size() > 2) {
231 // obtain index
232 int index = shape.indexOfClosest(clickedPosition);
233 // get snap radius
235 // check if we have to create a new index
236 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
237 // remove geometry point
238 shape.erase(shape.begin() + index);
239 // commit new shape
240 undoList->begin(this, "remove geometry point of " + getTagStr());
242 undoList->end();
243 }
244 }
245 }
246}
247
248
249GNEEdge*
251 return getParentEdges().front();
252}
253
254
255GNEEdge*
257 return getParentEdges().back();
258}
259
260
261GNELane*
263 return getParentLanes().front();
264}
265
266
267GNELane*
269 return getParentLanes().back();
270}
271
272
273int
275 return getParentLanes().front()->getIndex();
276}
277
278
279int
281 return getParentLanes().back()->getIndex();
282}
283
284
287 return getParentEdges().front()->getNBEdge()->getConnectionRef(getFromLaneIndex(), getParentEdges().back()->getNBEdge(), getToLaneIndex());
288}
289
290
294 return NBConnection(getParentEdges().front()->getNBEdge(), getFromLaneIndex(),
295 getParentEdges().back()->getNBEdge(), getToLaneIndex(),
296 (int)c.tlLinkIndex, (int)c.tlLinkIndex2);
297}
298
299
300void
304
305
308 return myLinkState;
309}
310
311
312void
316
317
318void
321 myLinkState = getParentEdges().front()->getNBEdge()->getToNode()->getLinkState(getParentEdges().front()->getNBEdge(),
322 nbCon.toEdge,
323 nbCon.fromLane,
324 nbCon.toLane,
325 nbCon.mayDefinitelyPass,
326 nbCon.tlID);
327}
328
329
330void
332 auto shape = getConnectionShape();
333 shape = shape.bezier(5);
335}
336
337
340 if (myShapeEdited) {
341 return getShapeEditedPopUpMenu(app, parent, getNBEdgeConnection().customShape);
342 } else {
343 // create popup
344 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, this);
345 // build common options
347 // check if we're in supermode network
349 // create menu commands
350 FXMenuCommand* mcCustomShape = GUIDesigns::buildFXMenuCommand(ret, "Set custom connection shape", nullptr, &parent, MID_GNE_CONNECTION_EDIT_SHAPE);
351 GUIDesigns::buildFXMenuCommand(ret, "Smooth connection shape", nullptr, &parent, MID_GNE_CONNECTION_SMOOTH_SHAPE);
352 // check if menu commands has to be disabled
354 // check if we're in the correct edit mode
356 mcCustomShape->disable();
357 }
358 }
359 return ret;
360 }
361}
362
363
364double
368
369
374
375
376void
377GNEConnection::updateCenteringBoundary(const bool /*updateGrid*/) {
378 // nothing to update
379}
380
381
382void
384 // Check if connection must be drawed
385 if (checkDrawConnection()) {
386 // get connection exaggeration
387 const double connectionExaggeration = isAttributeCarrierSelected() ? s.selectorFrameScale : 1;
388 // get detail level
389 const auto d = s.getDetailLevel(connectionExaggeration);
390 // check if draw shape superposed (used in train lanes)
391 PositionVector shapeSuperposed = myConnectionGeometry.getShape();
392 if (getParentLanes().front()->getDrawingConstants()->drawSuperposed()) {
393 shapeSuperposed.move2side(0.5);
394 }
395 // draw geometry only if we'rent in drawForObjectUnderCursor mode
397 // draw connection
398 drawConnection(s, d, shapeSuperposed, connectionExaggeration);
399 // draw lock icon
401 // draw dotted contour depending if we're editing the custom shape
403 if (editedNetworkElement && (editedNetworkElement == this)) {
404 // draw dotted contour geometry points
406 connectionExaggeration, s.dottedContourSettings.segmentWidthSmall);
407 } else {
408 // draw dotted contour
410 }
411 }
412 // calculate contour
413 calculateConnectionContour(s, d, shapeSuperposed, connectionExaggeration);
414 }
415}
416
417
418void
422
423
424void
428
429
430void
434
435
436std::string
438 // first get attributes in which nbConnection reference can be invalid
439 switch (key) {
440 case SUMO_ATTR_ID:
441 return getMicrosimID();
442 case SUMO_ATTR_FROM:
443 return getParentLanes().front()->getParentEdge()->getID();
444 case SUMO_ATTR_TO:
445 return getParentLanes().back()->getParentEdge()->getID();
447 return getParentLanes().front()->getAttribute(SUMO_ATTR_INDEX);
449 return getParentLanes().front()->getID();
451 return getParentLanes().back()->getAttribute(SUMO_ATTR_INDEX);
453 return getParentLanes().back()->getID();
456 return getCommonAttribute(nullptr, key);
457 case GNE_ATTR_PARENT:
458 return getParentEdges().front()->getToJunction()->getID();
459 default:
460 break;
461 }
462 // now continue with attributes that needs a nbConnection reference
464 switch (key) {
465 case SUMO_ATTR_PASS:
466 return toString(nbCon.mayDefinitelyPass);
468 return toString(nbCon.indirectLeft);
469 case SUMO_ATTR_TYPE:
470 return toString(nbCon.edgeType);
472 return toString(nbCon.keepClear);
474 return toString(nbCon.contPos);
476 return toString(nbCon.uncontrolled);
478 return toString(nbCon.visibility);
480 return toString(nbCon.tlLinkIndex);
482 return toString(nbCon.tlLinkIndex2);
483 case SUMO_ATTR_ALLOW:
484 if (nbCon.permissions == SVC_UNSPECIFIED) {
485 return getVehicleClassNames(nbCon.toEdge->getLanes()[nbCon.toLane].permissions);
486 } else {
487 return getVehicleClassNames(nbCon.permissions);
488 }
490 if (nbCon.permissions == SVC_UNSPECIFIED) {
491 return getVehicleClassNames(invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions));
492 } else {
494 }
496 if (nbCon.changeLeft == SVC_UNSPECIFIED) {
497 return "all";
498 } else {
499 return getVehicleClassNames(nbCon.changeLeft);
500 }
502 if (nbCon.changeRight == SVC_UNSPECIFIED) {
503 return "all";
504 } else {
505 return getVehicleClassNames(nbCon.changeRight);
506 }
507 case SUMO_ATTR_SPEED:
508 if (nbCon.speed == NBEdge::UNSPECIFIED_SPEED) {
509 return "default";
510 } else {
511 return toString(nbCon.speed);
512 }
513 case SUMO_ATTR_LENGTH:
514 return toString(nbCon.customLength);
515 case SUMO_ATTR_DIR:
516 return toString(getParentEdges().front()->getNBEdge()->getToNode()->getDirection(
517 getParentEdges().front()->getNBEdge(), nbCon.toEdge, OptionsCont::getOptions().getBool("lefthand")));
518 case SUMO_ATTR_STATE:
519 return toString(getParentEdges().front()->getNBEdge()->getToNode()->getLinkState(
520 getParentEdges().front()->getNBEdge(), nbCon.toEdge, nbCon.fromLane, nbCon.toLane, nbCon.mayDefinitelyPass, nbCon.tlID));
521 case SUMO_ATTR_SHAPE:
523 return toString(nbCon.customShape);
524 default:
525 return getCommonAttribute(&nbCon, key);
526 }
527}
528
529
532 switch (key) {
533 case SUMO_ATTR_SHAPE:
536 default:
537 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
538 }
539}
540
541
542void
543GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
545 switch (key) {
546 case SUMO_ATTR_FROM:
547 case SUMO_ATTR_TO:
550 case SUMO_ATTR_PASS:
555 case SUMO_ATTR_ALLOW:
559 case SUMO_ATTR_SPEED:
560 case SUMO_ATTR_LENGTH:
561 case SUMO_ATTR_SHAPE:
563 case SUMO_ATTR_TYPE:
564 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
565 break;
567 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
568 changeTLIndex(key, parse<int>(value), c.tlLinkIndex2, undoList);
569 }
570 break;
572 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
573 changeTLIndex(key, c.tlLinkIndex, parse<int>(value), undoList);
574 }
575 break;
577 undoList->begin(this, "change attribute indirect for connection");
578 if (isAttributeEnabled(SUMO_ATTR_TLLINKINDEX) && (value != getAttribute(key))) {
579 GNEChange_Attribute::changeAttribute(this, key, value, undoList);
580 int linkIndex2 = -1;
581 if (parse<bool>(value)) {
582 // find straight connection with the same toEdge
583 std::set<NBTrafficLightDefinition*> defs = getParentEdges().front()->getNBEdge()->getToNode()->getControllingTLS();
584 NBEdge* from = getParentEdges().front()->getNBEdge();
585 for (NBTrafficLightDefinition* tlDef : defs) {
586 for (const NBConnection& c2 : tlDef->getControlledLinks()) {
587 if (c2.getTo() == c.toEdge && c2.getFrom() != from) {
588 if (from->getToNode()->getDirection(c2.getFrom(), c2.getTo()) == LinkDirection::STRAIGHT) {
589 linkIndex2 = c2.getTLIndex();
590 break;
591 }
592 }
593 }
594 }
595 }
596 changeTLIndex(key, c.tlLinkIndex, linkIndex2, undoList);
597 }
598 undoList->end();
599 break;
600 case SUMO_ATTR_DIR:
601 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
602 case SUMO_ATTR_STATE:
603 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
604 default:
605 setCommonAttribute(key, value, undoList);
606 break;
607 }
608}
609
610
611void
612GNEConnection::changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList) {
613 // trigger GNEChange_TLS
614 undoList->begin(this, "change tls linkIndex for connection");
615 // make a copy
616 std::set<NBTrafficLightDefinition*> defs = getParentEdges().front()->getNBEdge()->getToNode()->getControllingTLS();
617 for (const auto& tlDef : defs) {
618 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
619 NBTrafficLightLogic* tllogic = sumoDef ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
620 if (tllogic != nullptr) {
621 NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*tlDef, *tllogic);
622 newDef->addConnection(getParentEdges().front()->getNBEdge(), getParentEdges().back()->getNBEdge(),
623 getLaneFrom()->getIndex(), getLaneTo()->getIndex(), tlIndex, tlIndex2, false);
624 // make a copy
625 std::vector<NBNode*> nodes = tlDef->getNodes();
626 for (const auto& node : nodes) {
627 GNEJunction* junction = getNet()->getAttributeCarriers()->retrieveJunction(node->getID());
628 undoList->add(new GNEChange_TLS(junction, tlDef, false), true);
629 undoList->add(new GNEChange_TLS(junction, newDef, true), true);
630 }
631 } else {
632 WRITE_ERRORF(TL("Could not set attribute '%' (tls is broken)"), toString(key));
633 }
634 }
635 undoList->end();
636}
637
638
639bool
641 return getParentEdges().front()->getNBEdge()->getConnectionsFromLane(getFromLaneIndex(), getParentEdges().back()->getNBEdge(), getToLaneIndex()).size() > 0;
642}
643
644
645bool
647 // declare a flag to check if shape has to be draw (by deafult false)
648 bool drawConnection = false;
649 // only draw connections if shape isn't deprecated
655 } else {
656 drawConnection = false;
657 }
658 } else {
659 drawConnection = false;
660 }
661 // check if we're editing this connection
663 if (editedNetworkElement && (editedNetworkElement->getTagProperty()->getTag() == SUMO_TAG_CONNECTION)) {
664 if (editedNetworkElement->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT)) {
665 drawConnection = true;
666 }
667 }
668 return drawConnection;
669}
670
671
674 // check conditions
675 if (myShapeEdited) {
676 // return shape edit color
678 } else if (drawUsingSelectColor()) {
679 // override with special colors (unless the color scheme is based on selection)
681 } else if (mySpecialColor != nullptr) {
682 // return special color
683 return *mySpecialColor;
684 } else {
685 // Set color depending of the link state
687 }
688}
689
690
691void
693 const PositionVector& shape, const double exaggeration) const {
694 // get color
695 RGBColor connectionColor = getConnectionColor(s);
696 // Push layer matrix
698 // translate to front
701 } else {
703 }
704 // Set color
705 GLHelper::setColor(connectionColor);
706 // continue depending of detail level
708 // draw geometry
710 s.connectionSettings.connectionWidth * exaggeration);
711 // draw arrows over connection
712 drawConnectionArrows(s, connectionColor);
713 // check if internal junction marker has to be drawn
717 }
718 // draw edge values
719 drawEdgeValues(s, shape);
720 // draw shape points only in Network supemode
722 // draw geometry points
726 }
727 } else {
729 }
730 // Pop layer matrix
732}
733
734
735void
737 if (s.showLaneDirection) {
738 // Push matrix
740 // move front
741 glTranslated(0, 0, 0.1);
742 // change color
744 // draw triangles
745 for (int i = 1; i < (int)myConnectionGeometry.getShape().size(); i++) {
746 const auto posA = myConnectionGeometry.getShape()[i - 1];
747 const auto posB = myConnectionGeometry.getShape()[i];
748 GLHelper::drawTriangleAtEnd(posA, posB, (double) 1, (double) .2);
749 }
750 // Pop matrix
752 }
753}
754
755
756void
758 // check if edge value has to be shown
759 if (s.edgeValue.show(this)) {
761 const std::string value = nbCon.getParameter(s.edgeParam, "");
762 if (value != "") {
763 int shapeIndex = (int)shape.size() / 2;
764 const Position p = (myConnectionGeometry.getShape().size() == 2) ? (shape.front() * 0.67 + shape.back() * 0.33) : shape[shapeIndex];
765 GLHelper::drawTextSettings(s.edgeValue, value, p, s.scale, 0);
766 }
767 }
768}
769
770
771void
773 const PositionVector& shape, const double exaggeration) const {
774 // first check if junction parent was inserted with full boundary
775 if (!gViewObjectsHandler.checkBoundaryParentObject(this, getType(), getParentLanes().front()->getParentEdge()->getToJunction())) {
776 // calculate geometry points contour if we're editing shape
777 if (myShapeEdited) {
779 exaggeration, true);
780 } else {
781 // in move mode, add to selected object if this is the edited element
782 const auto& editModes = myNet->getViewNet()->getEditModes();
783 const bool addToSelectedObjects = (editModes.isCurrentSupermodeNetwork() && editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) ?
785 // calculate connection shape contour
787 true, true, 0, nullptr, getParentLanes().front()->getParentEdge()->getToJunction(), addToSelectedObjects);
788 }
789 }
790}
791
792
793bool
794GNEConnection::isValid(SumoXMLAttr key, const std::string& value) {
795 // Currently ignored before implementation to avoid warnings
796 switch (key) {
797 case SUMO_ATTR_FROM:
798 case SUMO_ATTR_TO:
801 return false;
802 case SUMO_ATTR_PASS:
803 return canParse<bool>(value);
805 return canParse<bool>(value);
806 case SUMO_ATTR_TYPE:
807 return true;
809 return canParse<bool>(value);
811 return canParse<double>(value) && (parse<double>(value) >= -1);
813 return canParse<bool>(value);
815 return canParse<double>(value) && (parse<double>(value) >= -1);
820 (getParentEdges().front()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) &&
821 canParse<int>(value) &&
822 (parse<int>(value) >= 0 || parse<int>(value) == -1)) {
823 // obtain Traffic light definition
824 NBTrafficLightDefinition* def = *getParentEdges().front()->getNBEdge()->getToNode()->getControllingTLS().begin();
825 return def->getMaxValidIndex() >= parse<int>(value);
826 } else {
827 return false;
828 }
829 case SUMO_ATTR_ALLOW:
833 return canParseVehicleClasses(value);
834 case SUMO_ATTR_SPEED:
835 if (value.empty() || value == "default") {
836 return true;
837 } else {
838 return canParse<double>(value) && ((parse<double>(value) >= 0) || (parse<double>(value) == NBEdge::UNSPECIFIED_SPEED));
839 }
840 case SUMO_ATTR_LENGTH:
841 return canParse<double>(value) && (parse<double>(value) >= -1);
842 case SUMO_ATTR_SHAPE:
844 // empty custom shapes are allowed
845 return canParse<PositionVector>(value);
846 case SUMO_ATTR_STATE:
847 return false;
848 case SUMO_ATTR_DIR:
849 return false;
850 default:
851 return isCommonValid(key, value);
852 }
853}
854
855
856bool
858 switch (key) {
859 case SUMO_ATTR_FROM:
860 case SUMO_ATTR_TO:
863 case SUMO_ATTR_DIR:
864 case SUMO_ATTR_STATE:
865 // this attributes cannot be edited
866 return false;
869 // get Traffic Light definitions
870 if (getParentEdges().front()->getNBEdge()->getToNode()->isTLControlled()) {
871 NBTrafficLightDefinition* tlDef = *getParentEdges().front()->getNBEdge()->getToNode()->getControllingTLS().begin();
872 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
873 NBTrafficLightLogic* tllogic = sumoDef != nullptr ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
874 if (tllogic != nullptr) {
875 return true;
876 } else {
877 return false;
878 }
879 }
880 return false;
881 default:
882 return true;
883 }
884}
885
886
887bool
889 switch (key) {
890 case SUMO_ATTR_SPEED:
892 default:
893 return false;
894 }
895}
896
897
902
903// ===========================================================================
904// private
905// ===========================================================================
906
907void
908GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value) {
909 if (!existNBEdgeConnection()) {
910 WRITE_WARNINGF("Cannot restore attribute '%=%' for computed connection from lane '%'", toString(key), value, getParentLanes().front()->getID());
911 return;
912 }
914 switch (key) {
915 case SUMO_ATTR_PASS:
916 nbCon.mayDefinitelyPass = parse<bool>(value);
917 break;
919 nbCon.indirectLeft = parse<bool>(value);
920 break;
922 if (value == toString(KEEPCLEAR_UNSPECIFIED)) {
924 } else {
925 nbCon.keepClear = parse<bool>(value) ? KEEPCLEAR_TRUE : KEEPCLEAR_FALSE;
926 }
927 break;
929 nbCon.uncontrolled = parse<bool>(value);
930 break;
932 nbCon.contPos = parse<double>(value);
933 break;
935 nbCon.visibility = parse<double>(value);
936 break;
937 case SUMO_ATTR_SPEED:
938 if (value.empty() || (value == "default")) {
940 } else {
941 nbCon.speed = parse<double>(value);
942 }
943 break;
944 case SUMO_ATTR_LENGTH:
945 nbCon.customLength = parse<double>(value);
946 break;
947 case SUMO_ATTR_ALLOW:
948 nbCon.permissions = parseVehicleClasses(value);
949 break;
952 break;
954 nbCon.changeLeft = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
955 break;
957 nbCon.changeRight = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
958 break;
959 case SUMO_ATTR_STATE:
960 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
961 case SUMO_ATTR_DIR:
962 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
963 case SUMO_ATTR_SHAPE:
965 nbCon.customShape = parse<PositionVector>(value);
966 break;
967 case SUMO_ATTR_TYPE:
968 nbCon.edgeType = value;
969 break;
970 default:
971 setCommonAttribute(&nbCon, key, value);
972 break;
973 }
974 // Update Geometry after setting a new attribute (but avoided for certain attributes)
975 if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) {
978 }
979 // invalidate demand path calculator
981}
982
983
984void
986 // set custom shape
988 // mark junction as deprecated
989 myShapeDeprecated = true;
990 // update geometry
992}
993
994
995void
997 // commit new shape
998 undoList->begin(this, "moving " + toString(SUMO_ATTR_CUSTOMSHAPE) + " of " + getTagStr());
1000 undoList->end();
1001}
1002
1003/****************************************************************************/
NetworkEditMode
@brie enum for network edit modes
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_CREATE_EDGE
mode for creating new edges
@ NETWORK_TLS
mode for editing tls
@ NETWORK_SELECT
mode for selecting network elements
@ 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
GUIViewObjectsHandler gViewObjectsHandler
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:284
#define WRITE_ERRORF(...)
Definition MsgHandler.h:293
#define TL(string)
Definition MsgHandler.h:301
@ KEEPCLEAR_FALSE
Definition NBCont.h:59
@ KEEPCLEAR_TRUE
Definition NBCont.h:60
@ KEEPCLEAR_UNSPECIFIED
Definition NBCont.h:61
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.
@ SUMO_TAG_CONNECTION
connectioon between two lanes
@ 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"
@ GNE_ATTR_FROM_LANEID
from lane ID (used in GNEConnection)
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_CHANGE_LEFT
@ SUMO_ATTR_INDEX
@ SUMO_ATTR_PASS
@ SUMO_ATTR_TO
@ SUMO_ATTR_FROM
@ GNE_ATTR_TO_LANEID
to lane ID (used in GNEConnection)
@ SUMO_ATTR_CHANGE_RIGHT
@ GNE_ATTR_FRONTELEMENT
@ 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.
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
static void drawLine(const Position &beg, double rot, double visLength)
Draws a thin line.
Definition GLHelper.cpp:433
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition GLHelper.cpp:649
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:624
static void popMatrix()
pop matrix
Definition GLHelper.cpp:131
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:348
static void pushMatrix()
push matrix
Definition GLHelper.cpp:118
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:779
const std::string getID() const
get ID (all Attribute Carriers have one)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
std::string getCommonAttribute(const Parameterised *parameterised, SumoXMLAttr key) const
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonValid(SumoXMLAttr key, const std::string &value) const
GNENet * getNet() const
get pointer to net
const GNETagProperties * myTagProperty
reference to tagProperty associated with this attribute carrier
static void changeAttribute(GNEAttributeCarrier *AC, SumoXMLAttr key, const std::string &value, GNEUndoList *undoList, const bool force=false)
change attribute
void updateConnectionID()
update internal ID of Connection
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
get connection shape
bool checkDrawSelectContour() const
check if draw select contour (blue)
GNELane * getLaneTo() const
@briefthe get lane of the outgoing lane
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
bool checkDrawOverContour() const
check if draw over contour (orange)
void drawEdgeValues(const GUIVisualizationSettings &s, const PositionVector &shape) const
draw edge value
bool checkDrawFromContour() const
check if draw from contour (green)
bool existNBEdgeConnection() const
check if the edgeConnection vinculated with this connection exists
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
PositionVector getAttributePositionVector(SumoXMLAttr key) const
GNEConnection(GNELane *from, GNELane *to)
void drawConnection(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double exaggeration) const
draw connection
bool checkDrawDeleteContourSmall() const
check if draw delete contour small (pink/white)
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)
void drawConnectionArrows(const GUIVisualizationSettings &s, const RGBColor &color) const
draw arrows over connections
GNEMoveOperation * getMoveOperation()
get move operation for the given shapeOffset (can be nullptr)
void updateGeometry()
update pre-computed geometry information
GUIGeometry myInternalJunctionMarkerGeometry
junction maker geometry
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.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show 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 calculateConnectionContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const PositionVector &shape, const double exaggeration) const
calculate connection contour
bool checkDrawRelatedContour() const
check if draw related contour (cyan)
void updateLinkState()
recompute cached myLinkState
const Parameterised::Map & getACParametersMap() const
get parameters map
bool checkDrawConnection() const
check if draw connection
RGBColor getConnectionColor(const GUIVisualizationSettings &s) const
get connection color
bool checkDrawMoveContour() const
check if draw move contour (red)
bool isAttributeEnabled(SumoXMLAttr key) const
bool checkDrawDeleteContour() const
check if draw delete contour (pink/white)
LinkState myLinkState
Linkstate.
void updateGLObject()
update GLObject (geometry, ID, etc.)
bool checkDrawToContour() const
check if draw from contour (magenta)
void changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList *undoList)
manage change of tlLinkindices
void calculateContourExtrudedShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double extrusionWidth, const double scale, const bool closeFirstExtrem, const bool closeLastExtrem, const double offset, const GNESegment *segment, const GUIGlObject *boundaryParent, const bool addToSelectedObjects=true) const
calculate contour extruded (used in elements formed by a central shape)
void drawDottedContourGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const PositionVector &shape, const double radius, const double scale, const double lineWidth) const
draw dotted contour for geometry points
Boundary getContourBoundary() const
get contour boundary
bool drawDottedContours(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, const double lineWidth, const bool addOffset) const
draw dotted contours (basics, select, delete, inspect...)
void calculateContourAllGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale, const bool calculatePosOverShape) const
calculate contour for all geometry points
A road/street connecting two junctions (netedit-version)
Definition GNEEdge.h:53
const GNEHierarchicalContainerParents< GNEEdge * > & getParentEdges() const
get parent edges
const GNEHierarchicalContainerParents< GNELane * > & getParentLanes() const
get parent lanes
static RGBColor colorForLinksState(FXuint state)
return the color for each linkstate
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:650
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:202
GNEMoveOperation * calculateMoveShapeOperation(const GUIGlObject *obj, const PositionVector originalShape, const bool maintainShapeClosed)
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:372
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:176
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:146
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2194
virtual std::string getAttribute(SumoXMLAttr key) const =0
GNEContour myNetworkElementContour
network element contour
bool myShapeEdited
flag to check if element shape is being edited
GUIGLObjectPopupMenu * getShapeEditedPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent, const PositionVector &shape)
get shape edited popup menu
void setNetworkElementID(const std::string &newID)
set network element id
bool isShapeEdited() const
check if shape is being edited
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...
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
bool checkOverLockedElement(const GUIGlObject *GLObject, const bool isSelected) const
check if given element is locked (used for drawing select and delete contour)
GNEUndoList * getUndoList() const
get the undoList object
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
static FXMenuCommand * buildFXMenuCommand(FXComposite *p, const std::string &text, FXIcon *icon, FXObject *tgt, FXSelector sel, const bool disable=false)
build menu command
The popup menu of a globject.
GUIGlObject * getGLObject() const
The object that belongs to this popup-menu.
const std::vector< double > & getShapeRotations() const
The rotations of the single shape parts.
static void drawGeometryPoints(const GUIVisualizationSettings::Detail d, const PositionVector &shape, const RGBColor &color, const double radius, const double exaggeration, const bool editingElevation)
draw geometry points
void clearGeometry()
clear geometry
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
const PositionVector & getShape() const
The shape of the additional element.
void updateGeometry(const PositionVector &shape)
update entire geometry
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.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void buildPopUpMenuCommonOptions(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, GUISUMOAbstractView *parent, const SumoXMLTag tag, const bool selected, bool addSeparator=true)
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIGLObjectPopupMenu * getPopup() const
ge the current popup-menu
bool checkBoundaryParentObject(const GUIGlObject *GLObject, const double layer, const GUIGlObject *parent)
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
GUIVisualizationTextSettings edgeValue
Detail getDetailLevel(const double exaggeration) const
return the detail level
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
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour 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 drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
double selectorFrameScale
the current selection scaling in netedit (set in SelectorFrame)
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:546
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition NBEdge.h:730
static const double UNSPECIFIED_SPEED
unspecified lane speed
Definition NBEdge.h:352
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:2473
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.
std::map< std::string, std::string > Map
parameters map
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.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.
void append(const PositionVector &v, double sameThreshold=2.0)
double length() const
Returns the length.
void rotate2D(double angle)
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 amount
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
static const RGBColor GREY
Definition RGBColor.h:197
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition RGBColor.cpp:200
#define M_PI
Definition odrSpiral.cpp:45
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 GUIVisualizationSettings::Detail d, const GNEAttributeCarrier *AC, GUIGlObjectType type, const Position position, 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 segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
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:298
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