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-2024 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// method definitions
42// ===========================================================================
43
45 GNENetworkElement(from->getNet(), "from" + from->getID() + "to" + to->getID(),
46 GLO_CONNECTION, SUMO_TAG_CONNECTION, GUIIconSubSys::getIcon(GUIIcon::CONNECTION), {}, {}, {}, {}, {}, {}),
47 myFromLane(from),
48 myToLane(to),
49 myLinkState(LINKSTATE_TL_OFF_NOSIGNAL),
50 mySpecialColor(nullptr),
51myShapeDeprecated(true) {
52 // update centering boundary without updating grid
53 updateCenteringBoundary(false);
54}
55
56
59
60
61const PositionVector&
63 if (myConnectionGeometry.getShape().size() > 0) {
65 } else {
67 }
68}
69
70
71void
73 // check if adjust shape
75 // Get shape of from and to lanes
77 // obtain lane shapes
78 auto laneShapeFrom = myFromLane->getLaneShape();
79 auto laneShapeTo = myToLane->getLaneShape();
80 // Calculate shape of connection depending of the size of Junction shape
81 if (nbCon.customShape.size() > 0) {
83 } else if (nbCon.shape.size() > 1) {
84 PositionVector connectionShape;
85 if (nbCon.shape.front() == nbCon.shape.back()) {
86 laneShapeFrom.move2side(0.7);
87 laneShapeTo.move2side(0.7);
88 connectionShape.push_back(laneShapeFrom.back());
89 connectionShape.push_back(laneShapeTo.front());
90 } else {
91 connectionShape = nbCon.shape;
92 }
93 // only append via shape if it exists
94 if (nbCon.haveVia) {
95 connectionShape.append(nbCon.viaShape);
96 }
97 myConnectionGeometry.updateGeometry(connectionShape);
100 } else {
102 }
103 // check if internal junction marker must be calculated
104 if (nbCon.haveVia && (nbCon.shape.size() > 0)) {
105 // create marker for internal junction waiting position (contPos)
106 const double orthoLength = 0.5;
107 myInternalJunctionMarker = nbCon.shape.getOrthogonal(nbCon.shape.back(), 10, true, 0.1);
108 if (myInternalJunctionMarker.length() < orthoLength) {
110 }
111 } else {
113 }
114 // mark connection as non-deprecated
115 myShapeDeprecated = false;
116 }
117}
118
119
122 // currently unused
123 return Position(0, 0);
124}
125
126
127bool
129 return false;
130}
131
132
133bool
135 return false;
136}
137
138
139bool
141 return false;
142}
143
144
145bool
147 return false;
148}
149
150
151bool
153 // get edit modes
154 const auto& editModes = myNet->getViewNet()->getEditModes();
155 // check if we're in delete mode
156 if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_DELETE)) {
158 } else {
159 return false;
160 }
161}
162
163
164bool
166 // get edit modes
167 const auto& editModes = myNet->getViewNet()->getEditModes();
168 // check if we're in select mode
169 if (editModes.isCurrentSupermodeNetwork() && (editModes.networkEditMode == NetworkEditMode::NETWORK_SELECT)) {
171 } else {
172 return false;
173 }
174}
175
176
177bool
179 // get edit modes
180 const auto& editModes = myNet->getViewNet()->getEditModes();
181 // check if we're in move mode
182 if (!myNet->getViewNet()->isCurrentlyMovingElements() && editModes.isCurrentSupermodeNetwork() &&
183 (editModes.networkEditMode == NetworkEditMode::NETWORK_MOVE) && myNet->getViewNet()->checkOverLockedElement(this, mySelected)) {
184 // check if we're editing this network element
186 if (editedNetworkElement) {
187 return editedNetworkElement == this;
188 } else {
189 // only move the first element
191 }
192 } else {
193 return false;
194 }
195}
196
197
200 // edit depending if shape is being edited
201 if (isShapeEdited()) {
202 // get connection
203 const auto& connection = getNBEdgeConnection();
204 // calculate move shape operation
205 return calculateMoveShapeOperation(this, connection.customShape.size() > 0 ? connection.customShape : myConnectionGeometry.getShape(), false);
206 } else {
207 return nullptr;
208 }
209}
210
211
212void
213GNEConnection::removeGeometryPoint(const Position clickedPosition, GNEUndoList* undoList) {
214 // edit depending if shape is being edited
215 if (isShapeEdited()) {
216 // get connection
217 const auto& connection = getNBEdgeConnection();
218 // get original shape
219 PositionVector shape = connection.customShape.size() > 0 ? connection.customShape : connection.shape;
220 // check shape size
221 if (shape.size() > 2) {
222 // obtain index
223 int index = shape.indexOfClosest(clickedPosition);
224 // get snap radius
226 // check if we have to create a new index
227 if ((index != -1) && shape[index].distanceSquaredTo2D(clickedPosition) < (snap_radius * snap_radius)) {
228 // remove geometry point
229 shape.erase(shape.begin() + index);
230 // commit new shape
231 undoList->begin(this, "remove geometry point of " + getTagStr());
233 undoList->end();
234 }
235 }
236 }
237}
238
239
240GNEEdge*
244
245
246GNEEdge*
248 return myToLane->getParentEdge();
249}
250
251
252GNELane*
254 return myFromLane;
255}
256
257
258GNELane*
260 return myToLane;
261}
262
263
264int
268
269
270int
272 return myToLane->getIndex();
273}
274
275
280
281
285 return NBConnection(getEdgeFrom()->getNBEdge(), getFromLaneIndex(),
286 getEdgeTo()->getNBEdge(), getToLaneIndex(),
287 (int)c.tlLinkIndex, (int)c.tlLinkIndex2);
288}
289
290
291void
295
296
299 return myLinkState;
300}
301
302
303void
307
308
309void
313 nbCon.toEdge,
314 nbCon.fromLane,
315 nbCon.toLane,
316 nbCon.mayDefinitelyPass,
317 nbCon.tlID);
318}
319
320
321void
323 auto shape = getConnectionShape();
324 shape = shape.bezier(5);
326}
327
328
331 if (myShapeEdited) {
332 return getShapeEditedPopUpMenu(app, parent, getNBEdgeConnection().customShape);
333 } else {
334 GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
335 buildPopupHeader(ret, app);
338 // build selection and show parameters menu
341 // build position copy entry
342 buildPositionCopyEntry(ret, app);
343 // check if we're in supermode network
345 // create menu commands
346 FXMenuCommand* mcCustomShape = GUIDesigns::buildFXMenuCommand(ret, "Set custom connection shape", nullptr, &parent, MID_GNE_CONNECTION_EDIT_SHAPE);
347 GUIDesigns::buildFXMenuCommand(ret, "Smooth connection shape", nullptr, &parent, MID_GNE_CONNECTION_SMOOTH_SHAPE);
348 // check if menu commands has to be disabled
350 // check if we're in the correct edit mode
352 mcCustomShape->disable();
353 }
354 }
355 return ret;
356 }
357}
358
359
360double
364
365
370
371
372void
373GNEConnection::updateCenteringBoundary(const bool /*updateGrid*/) {
374 // nothing to update
375}
376
377
378void
380 // Check if connection must be drawed
381 if (checkDrawConnection()) {
382 // get connection exaggeration
383 const double connectionExaggeration = isAttributeCarrierSelected() ? s.selectorFrameScale : 1;
384 // get detail level
385 const auto d = s.getDetailLevel(connectionExaggeration);
386 // check if draw shape superposed (used in train lanes)
387 PositionVector shapeSuperposed = myConnectionGeometry.getShape();
389 shapeSuperposed.move2side(0.5);
390 }
391 // draw geometry only if we'rent in drawForObjectUnderCursor mode
393 // draw connection
394 drawConnection(s, d, shapeSuperposed, connectionExaggeration);
395 // draw lock icon
397 // draw dotted contour depending if we're editing the custom shape
399 if (editedNetworkElement && (editedNetworkElement == this)) {
400 // draw dotted contour geometry points
402 connectionExaggeration, s.dottedContourSettings.segmentWidthSmall);
403 } else {
404 // draw dotted contour
406 }
407 }
408 // calculate contour
409 calculateConnectionContour(s, d, shapeSuperposed, connectionExaggeration);
410 }
411}
412
413
414void
418
419
420void
424
425
426void
430
431
432std::string
434 // first get attributes in which nbConnection reference can be invalid
435 switch (key) {
436 case SUMO_ATTR_ID:
437 return getMicrosimID();
438 case SUMO_ATTR_FROM:
439 return myFromLane->getParentEdge()->getID();
440 case SUMO_ATTR_TO:
441 return myToLane->getParentEdge()->getID();
445 return myFromLane->getID();
449 return myToLane->getID();
452 return getCommonAttribute(key);
453 case GNE_ATTR_PARENT:
454 return getEdgeFrom()->getToJunction()->getID();
455 default:
456 break;
457 }
458 // now continue with attributes that needs a nbConnection reference
460 switch (key) {
461 case SUMO_ATTR_PASS:
462 return toString(nbCon.mayDefinitelyPass);
464 return toString(nbCon.indirectLeft);
465 case SUMO_ATTR_TYPE:
466 return toString(nbCon.edgeType);
468 return toString(nbCon.keepClear);
470 return toString(nbCon.contPos);
472 return toString(nbCon.uncontrolled);
474 return toString(nbCon.visibility);
476 return toString(nbCon.tlLinkIndex);
478 return toString(nbCon.tlLinkIndex2);
479 case SUMO_ATTR_ALLOW:
480 if (nbCon.permissions == SVC_UNSPECIFIED) {
481 return getVehicleClassNames(nbCon.toEdge->getLanes()[nbCon.toLane].permissions);
482 } else {
483 return getVehicleClassNames(nbCon.permissions);
484 }
486 if (nbCon.permissions == SVC_UNSPECIFIED) {
487 return getVehicleClassNames(invertPermissions(nbCon.toEdge->getLanes()[nbCon.toLane].permissions));
488 } else {
490 }
492 if (nbCon.changeLeft == SVC_UNSPECIFIED) {
493 return "all";
494 } else {
495 return getVehicleClassNames(nbCon.changeLeft);
496 }
498 if (nbCon.changeRight == SVC_UNSPECIFIED) {
499 return "all";
500 } else {
501 return getVehicleClassNames(nbCon.changeRight);
502 }
503 case SUMO_ATTR_SPEED:
504 if (nbCon.speed == NBEdge::UNSPECIFIED_SPEED) {
505 return "default";
506 } else {
507 return toString(nbCon.speed);
508 }
509 case SUMO_ATTR_LENGTH:
510 return toString(nbCon.customLength);
511 case SUMO_ATTR_DIR:
512 return toString(getEdgeFrom()->getNBEdge()->getToNode()->getDirection(
513 getEdgeFrom()->getNBEdge(), nbCon.toEdge, OptionsCont::getOptions().getBool("lefthand")));
514 case SUMO_ATTR_STATE:
515 return toString(getEdgeFrom()->getNBEdge()->getToNode()->getLinkState(
516 getEdgeFrom()->getNBEdge(), nbCon.toEdge, nbCon.fromLane, nbCon.toLane, nbCon.mayDefinitelyPass, nbCon.tlID));
517 case SUMO_ATTR_SHAPE:
519 return toString(nbCon.customShape);
521 return nbCon.getParametersStr();
522 default:
523 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
524 }
525}
526
527
530 switch (key) {
531 case SUMO_ATTR_SHAPE:
534 default:
535 throw InvalidArgument(getTagStr() + " doesn't have an attribute of type '" + toString(key) + "'");
536 }
537}
538
539
540void
541GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) {
543 switch (key) {
544 case SUMO_ATTR_FROM:
545 case SUMO_ATTR_TO:
548 case SUMO_ATTR_PASS:
553 case SUMO_ATTR_ALLOW:
557 case SUMO_ATTR_SPEED:
558 case SUMO_ATTR_LENGTH:
559 case SUMO_ATTR_SHAPE:
561 case SUMO_ATTR_TYPE:
563 // no special handling
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 = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS();
584 NBEdge* from = getEdgeFrom()->getNBEdge();
585 for (NBTrafficLightDefinition* tlDef : defs) {
586 for (const NBConnection& c2 : tlDef->getControlledLinks()) {
587 if (c2.getTo() == c.toEdge && c2.getFrom() != from) {
588 LinkDirection dir = from->getToNode()->getDirection(c2.getFrom(), c2.getTo());
589 if (dir == LinkDirection::STRAIGHT) {
590 linkIndex2 = c2.getTLIndex();
591 break;
592 }
593 }
594 }
595 }
596 }
597 changeTLIndex(key, c.tlLinkIndex, linkIndex2, undoList);
598 }
599 undoList->end();
600 break;
601 case SUMO_ATTR_DIR:
602 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
603 case SUMO_ATTR_STATE:
604 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
605 default:
606 setCommonAttribute(key, value, undoList);
607 break;
608 }
609}
610
611
612void
613GNEConnection::changeTLIndex(SumoXMLAttr key, int tlIndex, int tlIndex2, GNEUndoList* undoList) {
614 // trigger GNEChange_TLS
615 undoList->begin(this, "change tls linkIndex for connection");
616 // make a copy
617 std::set<NBTrafficLightDefinition*> defs = getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS();
618 for (const auto& tlDef : defs) {
619 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
620 NBTrafficLightLogic* tllogic = sumoDef ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
621 if (tllogic != nullptr) {
622 NBLoadedSUMOTLDef* newDef = new NBLoadedSUMOTLDef(*tlDef, *tllogic);
623 newDef->addConnection(getEdgeFrom()->getNBEdge(), getEdgeTo()->getNBEdge(),
624 getLaneFrom()->getIndex(), getLaneTo()->getIndex(), tlIndex, tlIndex2, false);
625 // make a copy
626 std::vector<NBNode*> nodes = tlDef->getNodes();
627 for (const auto& node : nodes) {
628 GNEJunction* junction = getNet()->getAttributeCarriers()->retrieveJunction(node->getID());
629 undoList->add(new GNEChange_TLS(junction, tlDef, false), true);
630 undoList->add(new GNEChange_TLS(junction, newDef, true), true);
631 }
632 } else {
633 WRITE_ERRORF(TL("Could not set attribute '%' (tls is broken)"), toString(key));
634 }
635 }
636 undoList->end();
637}
638
639
640bool
644
645
646bool
648 // declare a flag to check if shape has to be draw (by deafult false)
649 bool drawConnection = false;
650 // only draw connections if shape isn't deprecated
656 } else {
657 drawConnection = false;
658 }
659 } else {
660 drawConnection = false;
661 }
662 // check if we're editing this connection
664 if (editedNetworkElement && (editedNetworkElement->getTagProperty().getTag() == SUMO_TAG_CONNECTION)) {
665 if (editedNetworkElement->getAttribute(GNE_ATTR_PARENT) == getAttribute(GNE_ATTR_PARENT)) {
666 drawConnection = true;
667 }
668 }
669 return drawConnection;
670}
671
672
675 // check conditions
676 if (myShapeEdited) {
677 // return shape edit color
679 } else if (drawUsingSelectColor()) {
680 // override with special colors (unless the color scheme is based on selection)
682 } else if (mySpecialColor != nullptr) {
683 // return special color
684 return *mySpecialColor;
685 } else {
686 // Set color depending of the link state
688 }
689}
690
691
692void
694 const PositionVector& shape, const double exaggeration) const {
695 // get color
696 RGBColor connectionColor = getConnectionColor(s);
697 // Push layer matrix
699 // translate to front
702 } else {
704 }
705 // Set color
706 GLHelper::setColor(connectionColor);
707 // continue depending of detail level
709 // draw geometry
711 s.connectionSettings.connectionWidth * exaggeration);
712 // draw arrows over connection
713 drawConnectionArrows(s, connectionColor);
714 // check if internal junction marker has to be drawn
715 if (myInternalJunctionMarker.size() > 0) {
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
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, myFromLane->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 (getEdgeFrom()->getNBEdge()->getToNode()->getControllingTLS().size() > 0) &&
821 canParse<int>(value) &&
822 (parse<int>(value) >= 0 || parse<int>(value) == -1)) {
823 // obtain Traffic light definition
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;
852 default:
853 return isCommonValid(key, value);
854 }
855}
856
857
858bool
860 switch (key) {
861 case SUMO_ATTR_FROM:
862 case SUMO_ATTR_TO:
865 case SUMO_ATTR_DIR:
866 case SUMO_ATTR_STATE:
867 // this attributes cannot be edited
868 return false;
871 // get Traffic Light definitions
872 if (getEdgeFrom()->getNBEdge()->getToNode()->isTLControlled()) {
874 NBLoadedSUMOTLDef* sumoDef = dynamic_cast<NBLoadedSUMOTLDef*>(tlDef);
875 NBTrafficLightLogic* tllogic = sumoDef != nullptr ? sumoDef->getLogic() : tlDef->compute(OptionsCont::getOptions());
876 if (tllogic != nullptr) {
877 return true;
878 } else {
879 return false;
880 }
881 }
882 return false;
883 default:
884 return true;
885 }
886}
887
888
889bool
891 switch (key) {
892 case SUMO_ATTR_SPEED:
894 default:
895 return false;
896 }
897}
898
899
904
905// ===========================================================================
906// private
907// ===========================================================================
908
909void
910GNEConnection::setAttribute(SumoXMLAttr key, const std::string& value) {
911 if (!existNBEdgeConnection()) {
912 WRITE_WARNINGF("Cannot restore attribute '%=%' for computed connection from lane '%'", toString(key), value, myFromLane->getID());
913 return;
914 }
916 switch (key) {
917 case SUMO_ATTR_PASS:
918 nbCon.mayDefinitelyPass = parse<bool>(value);
919 break;
921 nbCon.indirectLeft = parse<bool>(value);
922 break;
924 if (value == toString(KEEPCLEAR_UNSPECIFIED)) {
926 } else {
927 nbCon.keepClear = parse<bool>(value) ? KEEPCLEAR_TRUE : KEEPCLEAR_FALSE;
928 }
929 break;
931 nbCon.uncontrolled = parse<bool>(value);
932 break;
934 nbCon.contPos = parse<double>(value);
935 break;
937 nbCon.visibility = parse<double>(value);
938 break;
939 case SUMO_ATTR_SPEED:
940 if (value.empty() || (value == "default")) {
942 } else {
943 nbCon.speed = parse<double>(value);
944 }
945 break;
946 case SUMO_ATTR_LENGTH:
947 nbCon.customLength = parse<double>(value);
948 break;
949 case SUMO_ATTR_ALLOW:
950 nbCon.permissions = parseVehicleClasses(value);
951 break;
954 break;
956 nbCon.changeLeft = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
957 break;
959 nbCon.changeRight = value == "" ? SVC_UNSPECIFIED : parseVehicleClasses(value);
960 break;
961 case SUMO_ATTR_STATE:
962 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
963 case SUMO_ATTR_DIR:
964 throw InvalidArgument("Attribute of '" + toString(key) + "' cannot be modified");
965 case SUMO_ATTR_SHAPE:
967 nbCon.customShape = parse<PositionVector>(value);
968 // update centering boundary
970 break;
971 case SUMO_ATTR_TYPE:
972 nbCon.edgeType = value;
973 break;
975 nbCon.setParametersStr(value);
976 break;
977 default:
978 setCommonAttribute(key, value);
979 break;
980 }
981 // Update Geometry after setting a new attribute (but avoided for certain attributes)
982 if ((key != SUMO_ATTR_ID) && (key != GNE_ATTR_PARAMETERS) && (key != GNE_ATTR_SELECTED)) {
985 }
986 // invalidate demand path calculator
988}
989
990
991void
993 // set custom shape
995 // mark junction as deprecated
996 myShapeDeprecated = true;
997 // update geometry
999}
1000
1001
1002void
1004 // commit new shape
1005 undoList->begin(this, "moving " + toString(SUMO_ATTR_CUSTOMSHAPE) + " of " + getTagStr());
1007 undoList->end();
1008}
1009
1010/****************************************************************************/
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
GUIIcon
An enumeration of icons used by the gui applications.
Definition GUIIcons.h:33
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:296
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define TL(string)
Definition MsgHandler.h:315
@ 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
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"
@ 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:782
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)
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
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
bool drawUsingSelectColor() const
check if attribute carrier must be drawn using selecting color.
bool isCommonValid(SumoXMLAttr key, const std::string &value)
void drawInLayer(const double typeOrLayer, const double extraOffset=0) const
draw element in the given layer, or in front if corresponding flag is enabled
GNENet * myNet
pointer to net
GNENet * getNet() const
get pointer to net
std::string getCommonAttribute(SumoXMLAttr key) const
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
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
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
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
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
PositionVector myInternalJunctionMarker
waiting position for internal junction
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
NBEdge * getNBEdge() const
returns the internal NBEdge
Definition GNEEdge.cpp:781
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
bool exist(const GNELane *toLane) const
check if exist a lane2lane geometry for the given toLane
const GUIGeometry & getLane2laneGeometry(const GNELane *toLane) const
get lane2lane geometry
bool drawSuperposed() const
draw superposed
Definition GNELane.cpp:154
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
const PositionVector & getLaneShape() const
get elements shape
Definition GNELane.cpp:214
const GNELane2laneConnection & getLane2laneConnections() const
get Lane2laneConnection struct
Definition GNELane.cpp:662
std::string getAttribute(SumoXMLAttr key) const
Definition GNELane.cpp:668
int getIndex() const
returns the index of the lane
Definition GNELane.cpp:620
const DrawingConstants * getDrawingConstants() const
get lane drawing constants (previously calculated in drawGL())
Definition GNELane.cpp:236
GNEEdge * getParentEdge() const
get parent edge
Definition GNELane.cpp:196
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:345
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:145
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2163
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
void buildSelectionACPopupEntry(GUIGLObjectPopupMenu *ret, GNEAttributeCarrier *AC)
Builds an entry which allows to (de)select the object.
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.
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
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.
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
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.
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, const GUIMainWindow &app) const
Builds an entry which allows to copy the cursor position if geo projection is used,...
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
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
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:1313
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition NBEdge.h:730
std::vector< Connection > getConnectionsFromLane(int lane, const NBEdge *to=nullptr, int toLane=-1) const
Returns connections from a given lane.
Definition NBEdge.cpp:1287
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:2409
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:336
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:2494
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
A list of positions.
void append(const PositionVector &v, double sameThreshold=2.0)
double length() const
Returns the 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 amount
void extrapolate(const double val, const bool onlyFirst=false, const bool onlyLast=false)
extrapolate position vector
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 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