63#define ENDPOINT_TOLERANCE 2
78#pragma warning(disable: 4355)
83 myAmResponsible(false),
85 myConnectionStatus(loaded ? FEATURE_LOADED : FEATURE_GUESSED),
87 myUpdateGeometry(true) {
89 setParents<GNEJunction*>({
95 auto lane =
new GNELane(
this, i);
96 lane->incRef(
"GNEEdge::GNEEdge");
101 lane->updateGeometry();
114 lane->decRef(
"GNEEdge::~GNEEdge");
115 if (lane->unreferenced()) {
125 connection->decRef(
"GNEEdge::~GNEEdge");
126 if (connection->unreferenced()) {
170 return TLF(
"Parent junctions are in the same position: %, %",
182 lane->updateGeometry();
186 connection->updateGeometry();
190 childAdditional->updateGeometry();
194 childDemandElement->updateGeometry();
198 childGenericData->updateGeometry();
203 childAdditional->computePathElement();
206 childDemandElement->computePathElement();
209 childGenericData->computePathElement();
235 if (inspectedElements.isInspectingSingleElement()) {
237 if (inspectedElements.getFirstAC()->getTagProperty()->vehicleEdges() &&
242 }
else if (modes.isCurrentSupermodeDemand()) {
246 planCreator = viewParent->getPersonFrame()->getPlanCreator();
248 planCreator = viewParent->getPersonPlanFrame()->getPlanCreator();
250 planCreator = viewParent->getContainerFrame()->getPlanCreator();
252 planCreator = viewParent->getContainerPlanFrame()->getPlanCreator();
263 const auto& selectedEdges = viewParent->getVehicleFrame()->getPathCreator()->getSelectedEdges();
265 if ((selectedEdges.size() > 0) && (selectedEdges.front() ==
this)) {
269 }
else if (modes.isCurrentSupermodeData()) {
271 const auto& edgeRelDataFrame = viewParent->getEdgeRelDataFrame();
272 if (edgeRelDataFrame->shown()) {
274 if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().empty()) {
277 return edgeRelDataFrame->getPathCreator()->getSelectedEdges().front() ==
this;
293 if (inspectedElements.isInspectingSingleElement()) {
295 if (inspectedElements.getFirstAC()->getTagProperty()->vehicleEdges() &&
296 inspectedElements.getFirstAC()->hasAttribute(
SUMO_ATTR_TO) &&
300 }
else if (modes.isCurrentSupermodeDemand()) {
304 planCreator = viewParent->getPersonFrame()->getPlanCreator();
306 planCreator = viewParent->getPersonPlanFrame()->getPlanCreator();
308 planCreator = viewParent->getContainerFrame()->getPlanCreator();
310 planCreator = viewParent->getContainerPlanFrame()->getPlanCreator();
321 const auto& selectedEdges = viewParent->getVehicleFrame()->getPathCreator()->getSelectedEdges();
323 if ((selectedEdges.size() > 1) && (selectedEdges.back() ==
this)) {
327 }
else if (modes.isCurrentSupermodeData()) {
329 const auto& edgeRelDataFrame = viewParent->getEdgeRelDataFrame();
330 if (edgeRelDataFrame->shown()) {
332 if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().empty()) {
335 return edgeRelDataFrame->getPathCreator()->getSelectedEdges().back() ==
this;
348 if (inspectedElements.isInspectingSingleElement() &&
349 inspectedElements.getFirstAC()->getTagProperty()->getTag() ==
SUMO_TAG_TAZ) {
352 if (sourceSink->getParentAdditionals().front() == inspectedElements.getFirstAC()) {
372 if (viewParent->getAdditionalFrame()->getViewObjetsSelector()->isNetworkElementSelected(
this)) {
374 }
else if (viewParent->getAdditionalFrame()->getViewObjetsSelector()->getTag() ==
myTagProperty->
getTag()) {
381 if (viewObjectsSelector.getEdgeFront() !=
this) {
385 if (modes.isCurrentSupermodeDemand()) {
389 planSelector = viewParent->getPersonFrame()->getPlanSelector();
391 planSelector = viewParent->getPersonPlanFrame()->getPlanSelector();
393 planSelector = viewParent->getContainerFrame()->getPlanSelector();
395 planSelector = viewParent->getContainerPlanFrame()->getPlanSelector();
398 if (planSelector && planSelector->
markEdges()) {
399 return (viewObjectsSelector.getAttributeCarrierFront()->getTagProperty()->getTag() ==
SUMO_TAG_LANE);
402 const auto& vehicleTemplate = viewParent->getVehicleFrame()->getVehicleTagSelector()->getCurrentTemplateAC();
404 if (vehicleTemplate && vehicleTemplate->getTagProperty()->vehicleEdges()) {
405 return (viewObjectsSelector.getAttributeCarrierFront()->getTagProperty()->getTag() ==
SUMO_TAG_LANE);
408 }
else if (modes.isCurrentSupermodeData()) {
410 const auto& edgeDataFrame = viewParent->getEdgeDataFrame();
411 const auto& edgeRelDataFrame = viewParent->getEdgeRelDataFrame();
412 if (edgeDataFrame->shown()) {
414 }
else if (edgeRelDataFrame->shown()) {
416 if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().empty()) {
418 }
else if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().size() == 2) {
420 }
else if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().front() ==
this) {
422 }
else if (edgeRelDataFrame->getPathCreator()->getSelectedEdges().back() ==
this) {
524 if (editedNetworkElement) {
525 if (editedNetworkElement ==
this) {
530 if (editedNetworkElement == lane) {
574 return (
myNBEdge->
getGeometry().front().distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius));
586 return (
myNBEdge->
getGeometry().back().distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius));
600 for (
const auto& geometryPoint : innenShape) {
601 if (geometryPoint.distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius)) {
631 if (lane->isVisible(s)) {
661 const auto laneBoundary = lane->getCenteringBoundary();
662 if (laneBoundary.isInitialised()) {
665 for (
const auto& additional : lane->getChildAdditionals()) {
666 const auto additionalBoundary = additional->getCenteringBoundary();
667 if (additionalBoundary.isInitialised()) {
675 const auto additionalBoundary = additional->getCenteringBoundary();
676 if (additionalBoundary.isInitialised()) {
719 const auto d =
getChildLanes().front()->getDrawingConstants()->getDetail();
784 if (geom[index].distanceSquaredTo2D(clickPos) < (geometryPointRadius * geometryPointRadius)) {
799 (
myNBEdge->
getGeometry().front().distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius))) {
800 undoList->
begin(
this,
"remove endpoint");
804 (
myNBEdge->
getGeometry().back().distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius))) {
805 undoList->
begin(
this,
"remove endpoint");
817 undoList->
begin(
this,
"set endpoint");
823 if (geom[index].distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius)) {
824 newPos = geom[index];
832 if (geom[index].distanceSquaredTo2D(pos) < (geometryPointRadius * geometryPointRadius)) {
833 newPos = geom[index];
888 edge->updateGeometry();
891 edge->updateGeometry();
897 edge->updateGeometry();
900 edge->updateGeometry();
909 return laneShape.front();
917 return laneShape.front();
925 return laneShape.back();
933 return laneShape.back();
941 std::vector<GNEConnection*> retrievedConnections;
943 for (
const auto& connection : connections) {
946 if (junctionsReady) {
949 retrievedConnections.push_back(retrievedGNEConnection);
956 retrievedGNEConnection->
incRef(
"GNEEdge::remakeGNEConnections");
964 connection->decRef();
972 if (connection->unreferenced()) {
986 if (connection->isAttributeCarrierSelected()) {
987 connection->unselectAttributeCarrier();
990 connection->decRef(
"GNEEdge::clearGNEConnections");
998 if (connection->unreferenced()) {
1008 std::vector<GNEAdditional*> routeProbes;
1011 routeProbes.push_back(additional);
1015 auto it = std::find(routeProbes.begin(), routeProbes.end(), routeProbe);
1016 if (it == routeProbes.end()) {
1019 return (
int)(it - routeProbes.begin());
1024std::vector<GNECrossing*>
1026 std::vector<GNECrossing*> crossings;
1028 if (i->checkEdgeBelong(
this)) {
1029 crossings.push_back(i);
1033 if (i->checkEdgeBelong(
this)) {
1034 crossings.push_back(i);
1045 if (attProperty->isCopyable() &&
isValid(attProperty->getAttr(), edgeTemplate->
getAttribute(attProperty->getAttr()))) {
1053 for (
const auto& attProperty : edgeTemplate->
getLaneTemplates().at(i)->getTagProperty()->getAttributeProperties()) {
1054 if (attProperty->isCopyable() &&
getChildLanes()[i]->isValid(attProperty->getAttr(), edgeTemplate->
getLaneTemplates().at(i)->getAttribute(attProperty->getAttr()))) {
1055 getChildLanes()[i]->setAttribute(attProperty->getAttr(), edgeTemplate->
getLaneTemplates().at(i)->getAttribute(attProperty->getAttr()), undoList);
1069 const auto laneProperties = tagPropertiesDatabase->getTagProperty(
SUMO_TAG_LANE,
true);
1070 const auto edgeTypeProperties = tagPropertiesDatabase->getTagProperty(
SUMO_TAG_TYPE,
true);
1071 const auto laneTypeProperties = tagPropertiesDatabase->getTagProperty(
SUMO_TAG_LANETYPE,
true);
1075 for (
const auto& attrProperty : edgeTypeProperties->getAttributeProperties()) {
1076 if (attrProperty->isCopyable() && edgeProperties->hasAttribute(attrProperty->getAttr())) {
1083 for (
const auto& attrProperty : laneTypeProperties->getAttributeProperties()) {
1084 if (attrProperty->isCopyable() && laneProperties->hasAttribute(attrProperty->getAttr()) &&
1085 (edgeType->
getLaneTypes().at(i)->getAttribute(attrProperty->getAttr()) != laneTypeProperties->getAttributeProperties(attrProperty->getAttr())->getDefaultStringValue())) {
1086 getChildLanes()[i]->setAttribute(attrProperty->getAttr(), edgeType->
getLaneTypes().at(i)->getAttribute(attrProperty->getAttr()), undoList);
1098 std::set<GUIGlID> result;
1100 result.insert(glID->getGlID());
1106const std::vector<GNEConnection*>&
1152 return "lane specific";
1158 return "lane specific";
1164 return "lane specific";
1172 return "lane specific";
1261 const std::string origValue =
getChildLanes().at(0)->getAttribute(key);
1264 it->setAttribute(key, value, undoList);
1326 if (canParse<double>(value) && (parse<double>(value) == 0)) {
1379 if (updateTemplate) {
1411 return canParse<double>(value) && (parse<double>(value) > 0);
1413 return canParse<double>(value) && (parse<double>(value) > 0);
1415 return canParse<int>(value) && (parse<double>(value) > 0);
1417 return canParse<int>(value);
1419 if (value.empty()) {
1432 return canParse<PositionVector>(value);
1438 if (value.empty() || (value ==
"default")) {
1441 return canParse<double>(value) && ((parse<double>(value) >= -1) || (parse<double>(value) ==
NBEdge::UNSPECIFIED_WIDTH));
1444 return canParse<double>(value) && parse<double>(value) >= 0 && parse<double>(value) <
myNBEdge->
getLoadedLength();
1446 if (value.empty()) {
1449 return canParse<double>(value);
1452 if (value.empty()) {
1454 }
else if (canParse<Position>(value)) {
1455 Position shapeStart = parse<Position>(value);
1462 if (value.empty()) {
1464 }
else if (canParse<Position>(value)) {
1465 Position shapeEnd = parse<Position>(value);
1474 if (value.empty()) {
1477 return canParse<double>(value) && (parse<double>(value) >= 0);
1558 const std::map<const GNELane*, std::vector<GNEDemandElement*> > laneVehiclesMap =
getVehiclesOverEdgeMap();
1560 for (
const auto& laneVehicle : laneVehiclesMap) {
1562 double totalLength = 0;
1563 for (
const auto& vehicle : laneVehicle.second) {
1567 double multiplier = 1;
1568 const double laneShapeLength = laneVehicle.first->getLaneShape().length();
1569 if (laneShapeLength == 0) {
1571 }
else if (totalLength > laneShapeLength) {
1572 multiplier = (laneShapeLength / totalLength);
1577 for (
const auto& vehicle : laneVehicle.second) {
1578 vehicle->updateDemandElementSpreadGeometry(laneVehicle.first, length * multiplier);
1589 const std::map<const GNELane*, std::vector<GNEDemandElement*> > laneVehiclesMap =
getVehiclesOverEdgeMap();
1591 for (
const auto& vehicleMap : laneVehiclesMap) {
1593 std::vector<std::pair<GNEEdge::StackPosition, GNEDemandElement*> > departPosVehicles;
1595 std::vector<GNEEdge::StackDemandElements> stackedVehicles;
1597 for (
const auto& vehicle : vehicleMap.second) {
1603 if (posOverLane < 0) {
1604 posOverLane += vehicleMap.first->getLaneShape().length();
1607 departPosVehicles.push_back(std::make_pair(
StackPosition(departPos, length), vehicle));
1609 vehicle->updateDemandElementGeometry(vehicleMap.first, posOverLane);
1611 vehicle->updateDemandElementStackLabel(0);
1615 std::sort(departPosVehicles.begin(), departPosVehicles.end());
1617 for (
const auto& departPosVehicle : departPosVehicles) {
1622 if (stackedVehicles.empty()) {
1626 stackedVehicles[stackedVehicles.size() - 1].addDemandElements(vehicle);
1633 for (
const auto& vehicle : stackedVehicles) {
1635 if (vehicle.getDemandElements().size() > 1) {
1647 const std::map<const GNELane*, std::vector<GNEDemandElement*> > lanePersonsMap =
getPersonsOverEdgeMap();
1649 for (
const auto& personMap : lanePersonsMap) {
1651 std::vector<std::pair<GNEEdge::StackPosition, GNEDemandElement*> > departPosPersons;
1653 std::vector<GNEEdge::StackDemandElements> stackedPersons;
1655 for (
const auto& person : personMap.second) {
1659 departPosPersons.push_back(std::make_pair(
StackPosition(departPos, 1.8), person));
1661 person->updateDemandElementGeometry(personMap.first, departPos);
1663 person->updateDemandElementStackLabel(0);
1667 std::sort(departPosPersons.begin(), departPosPersons.end());
1669 for (
const auto& departPosPerson : departPosPersons) {
1674 if (stackedPersons.empty()) {
1678 stackedPersons[stackedPersons.size() - 1].addDemandElements(person);
1685 for (
const auto& person : stackedPersons) {
1687 if (person.getDemandElements().size() > 1) {
1701 for (
const auto& containerMap : laneContainersMap) {
1703 std::vector<std::pair<GNEEdge::StackPosition, GNEDemandElement*> > departPosContainers;
1705 std::vector<GNEEdge::StackDemandElements> stackedContainers;
1707 for (
const auto& container : containerMap.second) {
1711 departPosContainers.push_back(std::make_pair(
StackPosition(departPos, 1.8), container));
1713 container->updateDemandElementGeometry(containerMap.first, departPos);
1715 container->updateDemandElementStackLabel(0);
1719 std::sort(departPosContainers.begin(), departPosContainers.end());
1721 for (
const auto& departPosContainer : departPosContainers) {
1726 if (stackedContainers.empty()) {
1730 stackedContainers[stackedContainers.size() - 1].addDemandElements(container);
1737 for (
const auto& container : stackedContainers) {
1739 if (container.getDemandElements().size() > 1) {
1753 while (edgeAngle < 0) {
1757 edgeAngle = fmod(edgeAngle, 360);
1759 return edgeAngle >= 0 && edgeAngle < 180;
1768 for (
const auto& incomingEdge : incomingEdges) {
1769 for (
const auto& connection : incomingEdge->getGNEConnections()) {
1770 if (connection->getEdgeTo() ==
this) {
1787 for (
const auto& outgoingEdge :
getParentJunctions().back()->getGNEOutgoingEdges()) {
1789 return outgoingEdge;
1800 pair(departPos, departPos + length) {
1817 pair(stackedPosition, {
1825 second.push_back(demandElement);
1835const std::vector<GNEDemandElement*>&
1848 if (stop->getTagProperty()->isVehicleStop()) {
1854 for (
const auto& stop : lane->getChildDemandElements()) {
1855 if (stop->getTagProperty()->isVehicleStop()) {
1884 throw InvalidArgument(
"GNEEdge::setAttribute (private) called for attr SUMO_ATTR_NUMLANES. This should never happen");
1889 if (value.empty()) {
1920 if (value.empty() || (value ==
"default")) {
1934 if (value.empty()) {
1955 newShapeStart = parse<Position>(value);
1969 newShapeEnd = parse<Position>(value);
1981 if (value.empty()) {
2021 if (oppositeID !=
"") {
2025 for (
int i = oldNumLanes; i < numLanes; i++) {
2029 for (
int i = (oldNumLanes - 1); i > (numLanes - 1); i--) {
2032 if (oppositeID !=
"") {
2067 myNBEdge->
addLane(index,
true, recomputeConnections, !recomputeConnections);
2071 newParentLanes.insert(newParentLanes.begin() + index, lane);
2075 for (
const auto newParentLane : newParentLanes) {
2080 lane =
new GNELane(
this, index);
2083 lane->
incRef(
"GNEEdge::addLane");
2109 fromEdge->remakeGNEConnections();
2113 toEdge->remakeGNEConnections();
2127 if (lane ==
nullptr) {
2140 lane->
decRef(
"GNEEdge::removeLane");
2161 fromEdge->remakeGNEConnections();
2165 toEdge->remakeGNEConnections();
2187 if (selectAfterCreation) {
2208 if (connection !=
nullptr) {
2212 connection->
decRef(
"GNEEdge::removeConnection");
2235 if ((connection->getFromLaneIndex() == fromLane) && (connection->getEdgeTo()->getNBEdge() == to) && (connection->getToLaneIndex() == toLane)) {
2239 if (createIfNoExist) {
2265 if (lane->isRestricted(vclass)) {
2277 if (crossing->checkEdgeBelong(
this)) {
2289 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2302#ifdef DEBUG_SMOOTH_GEOM
2304 <<
" forElevation=" << forElevation
2307 <<
" smoothShape old=" << old <<
"\n";
2309 if (old.size() == 3 || old.size() == 4) {
2311 }
else if (old.size() > 4 && !forElevation) {
2313 init.push_back(old[0]);
2314 init.push_back(old[1]);
2315 init.push_back(old[-2]);
2316 init.push_back(old[-1]);
2322 if (incoming.size() == 1) {
2323 begShape = incoming[0]->getGeometry();
2325 assert(incoming.size() == 2);
2328 if (outgoing.size() == 1) {
2329 endShape = outgoing[0]->getGeometry();
2331 assert(outgoing.size() == 2);
2337 init.push_back(old[0]);
2340 init.push_back(old[-1]);
2344 init[1].setz(2 * init[0].z() - begZ);
2345 init[2].setz(2 * init[-1].z() - endZ);
2348 const double straightThresh =
DEG2RAD(neteditOptions.getFloat(
"opendrive-output.straight-threshold"));
2351#ifdef DEBUG_SMOOTH_GEOM
2353 std::cout <<
" begShape=" << begShape <<
" endShape=" << endShape <<
" forElevation=" << forElevation <<
" dist=" << dist <<
" ok=" << ok <<
" init=" << init <<
"\n";
2357 if (init.size() == 0) {
2360 const int numPoints =
MAX2(neteditOptions.getInt(
"junctions.internal-link-detail"),
2361 int(old.
length2D() / neteditOptions.getFloat(
"opendrive.curve-resolution")));
2362 return init.
bezier(numPoints);
2370 if (modifiedShape.size() < 2) {
2373 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2383 if (elevationBase.size() == 0 || elevationBase[-1].z() != pos.z()) {
2384 elevationBase.push_back(pos);
2388 if (elevation.size() <= 2) {
2392 if (modifiedShape.size() < 5) {
2398 for (
int i = 1; i < (int)modifiedShape.size(); ++i) {
2399 seen += modifiedShape[i - 1].distanceTo2D(modifiedShape[i]);
2403 PositionVector innerShape(modifiedShape.begin() + 1, modifiedShape.end() - 1);
2425 geom.push_back(pos);
2431const std::map<const GNELane*, std::vector<GNEDemandElement*> >
2434 std::vector<GNEDemandElement*> vehiclesOverEdge;
2436 std::map<const GNELane*, std::vector<GNEDemandElement*> > vehiclesOverEdgeMap;
2438 std::set<std::pair<double, GNEDemandElement*> > vehicles;
2441 if (((edgeChild->getTagProperty()->getTag() ==
SUMO_TAG_TRIP) || (edgeChild->getTagProperty()->getTag() ==
SUMO_TAG_FLOW)) &&
2442 (edgeChild->getParentEdges().front() ==
this)) {
2443 vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(
SUMO_ATTR_DEPART), edgeChild));
2444 vehicles.insert(std::make_pair(edgeChild->getAttributeDouble(
SUMO_ATTR_DEPART), edgeChild));
2445 }
else if ((edgeChild->getTagProperty()->getTag() ==
SUMO_TAG_ROUTE) && (edgeChild->getParentEdges().front() ==
this)) {
2446 for (
const auto& routeChild : edgeChild->getChildDemandElements()) {
2447 if (routeChild->getTagProperty()->vehicleRoute()) {
2448 vehicles.insert(std::make_pair(routeChild->getAttributeDouble(
SUMO_ATTR_DEPART), routeChild));
2451 }
else if ((edgeChild->getTagProperty()->getTag() ==
GNE_TAG_ROUTE_EMBEDDED) && (edgeChild->getParentEdges().front() ==
this) && (edgeChild->getParentDemandElements().size() > 0)) {
2452 vehicles.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(
SUMO_ATTR_DEPART), edgeChild->getParentDemandElements().front()));
2456 vehiclesOverEdge.reserve(vehicles.size());
2458 for (
const auto& vehicle : vehicles) {
2460 vehiclesOverEdge.push_back(vehicle.second);
2463 for (
const auto& vehicle : vehiclesOverEdge) {
2464 const GNELane* vehicleLane = vehicle->getFirstPathLane();
2466 vehiclesOverEdgeMap[vehicleLane].push_back(vehicle);
2469 return vehiclesOverEdgeMap;
2473const std::map<const GNELane*, std::vector<GNEDemandElement*> >
2476 std::vector<GNEDemandElement*> personsOverEdge;
2478 std::map<const GNELane*, std::vector<GNEDemandElement*> > personsOverEdgeMap;
2480 std::set<std::pair<double, GNEDemandElement*> > persons;
2483 if (edgeChild->getTagProperty()->isPlanPerson() && (edgeChild->getParentDemandElements().size() > 0)) {
2484 persons.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(
SUMO_ATTR_DEPARTPOS), edgeChild->getParentDemandElements().front()));
2488 personsOverEdge.reserve(persons.size());
2490 for (
const auto& person : persons) {
2492 personsOverEdge.push_back(person.second);
2495 for (
const auto& person : personsOverEdge) {
2496 const GNELane* personLane = person->getFirstPathLane();
2498 personsOverEdgeMap[personLane].push_back(person);
2501 return personsOverEdgeMap;
2506const std::map<const GNELane*, std::vector<GNEDemandElement*> >
2509 std::vector<GNEDemandElement*> containersOverEdge;
2511 std::map<const GNELane*, std::vector<GNEDemandElement*> > containersOverEdgeMap;
2513 std::set<std::pair<double, GNEDemandElement*> > containers;
2516 if (edgeChild->getTagProperty()->isPlanContainer() && (edgeChild->getParentDemandElements().size() > 0)) {
2517 containers.insert(std::make_pair(edgeChild->getParentDemandElements().front()->getAttributeDouble(
SUMO_ATTR_DEPARTPOS), edgeChild->getParentDemandElements().front()));
2521 containersOverEdge.reserve(containers.size());
2523 for (
const auto& container : containers) {
2525 containersOverEdge.push_back(container.second);
2528 for (
const auto& container : containersOverEdge) {
2529 const GNELane* containerLane = container->getFirstPathLane();
2530 if (containerLane) {
2531 containersOverEdgeMap[containerLane].push_back(container);
2534 return containersOverEdgeMap;
2569 glTranslated(0, 0, 0.2);
2577 if (bigGeometryPoints) {
2590 const double geometryPointRadius,
const double layer,
const double exaggeration)
const {
2596 const bool startPosEdited = (startGeometryPointPos !=
getParentJunctions().front()->getPositionInView());
2599 if (startPosEdited || forceDraw) {
2613 glTranslated(startGeometryPointPos.x(), startGeometryPointPos.y(),
GLO_GEOMETRYPOINT);
2629 if ((selectedGeometryPoints.size() > 0) && (selectedGeometryPoints.front() == 0)) {
2646 geometryPointRadius, exaggeration);
2654 const double geometryPointRadius,
const double layer,
const double exaggeration)
const {
2660 const bool endPosEdited = (geometryPointPos !=
getParentJunctions().back()->getPositionInView());
2663 if (endPosEdited || forceDraw) {
2693 if ((selectedGeometryPoints.size() > 0) && (selectedGeometryPoints.back() == ((
int)
myNBEdge->
getGeometry().size() - 1))) {
2710 geometryPointRadius, exaggeration);
2729 drawPosition.
mul(.5);
2730 if (spreadSuperposed) {
2734 const Position shift(dist * cos(shiftA), dist * sin(shiftA));
2735 drawPosition.
add(shift);
2741 if (drawAngle > 90 && drawAngle < 270) {
2749 if (drawStreetName) {
2758 if (activeScheme == 12) {
2761 }
else if (activeScheme == 13) {
2766 const double doubleValue = lastLane->
getColorValue(s, activeScheme);
2789 lane->drawLaneStopOffset(s);
2802 if (!additional->getTagProperty()->isListedElement()) {
2803 additional->drawGL(s);
2810 stopEdge->drawGL(s);
2816 for (
const auto& vehicleMap : vehiclesMap) {
2817 for (
const auto& vehicle : vehicleMap.second) {
2855 bool selected =
false;
2857 if (TAZSourceSink->isAttributeCarrierSelected()) {
2874 glTranslated(0, 0, 0.1);
2883 lane->getDrawingConstants()->getDrawingWidth());
2913 glTranslated(0, 0, layer);
2922 if (geometryPointColor.
alpha() != 0) {
2945 if (!editModes.isCurrentSupermodeNetwork()) {
std::vector< ChildType > GNEHierarchicalContainerChildren
#define ENDPOINT_TOLERANCE
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_ADDITIONAL
Mode for editing additionals.
@ NETWORK_SELECT
mode for selecting network elements
@ DEMAND_PERSONPLAN
Mode for editing person plan.
@ DEMAND_CONTAINER
Mode for editing container.
@ DEMAND_PERSON
Mode for editing person.
@ DEMAND_VEHICLE
Mode for editing vehicles.
@ DEMAND_CONTAINERPLAN
Mode for editing container plan.
@ GLO_FRONTELEMENT
front element (used in netedit)
@ GLO_GEOMETRYPOINT
geometry point (used in netedit)
GUIViewObjectsHandler gViewObjectsHandler
#define WRITE_WARNINGF(...)
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const SVCPermissions SVCAll
all VClasses are allowed
SVCPermissions invertPermissions(SVCPermissions permissions)
negate the given permissions and ensure that only relevant bits are set
const std::string & getVehicleClassNames(SVCPermissions permissions, bool expand)
Returns the ids of the given classes, divided using a ' '.
bool canParseVehicleClasses(const std::string &classes)
Checks whether the given string contains only known vehicle classes.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_PASSENGER
vehicle is a passenger car (a "normal" car)
@ SUMO_TAG_TAZ
a traffic assignment zone
@ GNE_TAG_STOPCONTAINER_EDGE
@ SUMO_TAG_LANETYPE
lane type
@ SUMO_TAG_FLOW
a flow definition using from and to edges or a route
@ SUMO_TAG_ROUTE
description of a route
@ SUMO_TAG_LANE
begin/end of the description of a single lane
@ SUMO_TAG_TYPE
type (edge)
@ GNE_TAG_ROUTE_EMBEDDED
embedded route
@ GNE_TAG_STOPPERSON_EDGE
@ SUMO_TAG_TRIP
a single trip definition (used by router)
@ SUMO_TAG_EDGE
begin/end of the description of an edge
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
@ SUMO_ATTR_FROM_JUNCTION
@ GNE_ATTR_STOPOFFSET
stop offset (virtual, used by edge and lanes)
@ GNE_ATTR_OPPOSITE
to busStop (used by personPlans)
@ GNE_ATTR_PARAMETERS
parameters "key1=value1|key2=value2|...|keyN=valueN"
@ GNE_ATTR_STOPOEXCEPTION
stop exceptions (virtual, used by edge and lanes)
@ GNE_ATTR_MODIFICATION_STATUS
whether a feature has been loaded,guessed,modified or approved
@ SUMO_ATTR_SHAPE
edge: the shape in xml-definition
@ SUMO_ATTR_SPREADTYPE
The information about how to spread the lanes from the given position.
@ GNE_ATTR_SHAPE_END
last coordinate of edge shape
@ GNE_ATTR_BIDIR
whether an edge is part of a bidirectional railway
@ GNE_ATTR_SHAPE_START
first coordinate of edge shape
const double SUMO_const_halfLaneWidth
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
std::string fromEdge
from edge
std::string toEdge
to edge
std::vector< std::string > consecutiveEdges
consecutive edges
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void popMatrix()
pop matrix
static void drawBoundary(const GUIVisualizationSettings &s, const Boundary &b)
Draw a boundary (used for debugging)
static void drawBoxLine(const Position &beg, double rot, double visLength, double width, double offset=0)
Draws a thick line.
static void drawFilledCircleDetailled(const GUIVisualizationSettings::Detail d, const double radius)
Draws a filled circle around (0,0) depending of level of detail.
static void pushMatrix()
push matrix
static void drawText(const std::string &text, const Position &pos, const double layer, const double size, const RGBColor &col=RGBColor::BLACK, const double angle=0, const int align=0, double width=-1)
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)
bool isAttributeCarrierSelected() const
check if attribute carrier is selected
double getCommonAttributeDouble(SumoXMLAttr key) const
void selectAttributeCarrier()
bool myDrawInFront
boolean to check if drawn this AC over other elements
bool mySelected
boolean to check if this AC is selected (more quickly as checking GUIGlObjectStorage)
static const std::string FALSE_STR
true value in string format(used for comparing boolean values in getAttribute(...))
static const std::string TRUE_STR
true value in string format (used for comparing boolean values in getAttribute(......
const std::string getID() const override
get ID (all Attribute Carriers have one)
PositionVector getCommonAttributePositionVector(SumoXMLAttr key) const
void unselectAttributeCarrier()
unselect attribute carrier using GUIGlobalSelection
void setCommonAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
const std::string & getTagStr() const
get tag assigned to this object in string format
static const std::string FEATURE_GUESSED
feature has been reguessed (may still be unchanged be we can't tell (yet)
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
Position getCommonAttributePosition(SumoXMLAttr key) const
const GNETagProperties * getTagProperty() const
get tagProperty associated with this Attribute Carrier
GNENet * myNet
pointer to net
bool isCommonAttributeValid(SumoXMLAttr key, const std::string &value) const
std::string getCommonAttribute(SumoXMLAttr key) const
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 updateGeometry() override
update pre-computed geometry information
void markConnectionGeometryDeprecated()
check that connection's Geometry has to be updated
void updateLinkState()
recompute cached myLinkState
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
void calculateContourEdgeGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const double radius, const bool calculatePosOverShape, const bool firstExtrem, const bool lastExtrem) const
calculate contour for edge geometry points
void calculateContourEdge(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GNEEdge *edge, const GUIGlObject *elementToRegister, const double layer, const bool closeFirstExtrem, const bool closeLastExtrem) const
calculate contour edge
void calculateContourFirstGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const GUIGlObject *glObject, const PositionVector &shape, const double layer, const double radius, const double scale, const bool forceCalculation=false) const
calculate contour for first geometry point
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...)
bool deleteOnlyGeometryPoints() const
check if only delete geometry points checkbox is enabled
struct for saving subordinated elements (Junction->Edge->Lane->(Additional | DemandElement)
ProtectElements * getProtectElements() const
get protect elements modul
DeleteOptions * getDeleteOptions() const
get delete options modul
void updateDemandElementStackLabel(const int stack)
update stack label
const StackPosition & getStackPosition() const
get stack position
const std::vector< GNEDemandElement * > & getDemandElements() const
get demand elements
void addDemandElements(GNEDemandElement *demandElement)
add demand elment to current StackDemandElements
StackDemandElements(const StackPosition stackedPosition, GNEDemandElement *demandElement)
constructor
Stack position (used to stack demand elements over edges)
double beginPosition() const
get begin position
StackPosition(const double departPos, const double length)
constructor
double endPosition() const
get end position
void drawEdgeGeometryPoints(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double layer) const
draw edge geometry points (note: This function is called by GNELane::drawGL(...)
double getAttributeDouble(SumoXMLAttr key) const override
const Position getFrontDownShapePosition() const
get front down shape position
Boundary myEdgeBoundary
edge boundary
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
void drawEdgeName(const GUIVisualizationSettings &s) const
draw edge name
bool isConvexAngle() const
check if edge makes a convex angle [0 - 180) degrees
void setNumLanes(int numLanes, GNEUndoList *undoList)
changes the number of lanes. When reducing the number of lanes, higher-numbered lanes are removed fir...
bool isNetworkElementValid() const override
check if current network element is valid to be written into XML
std::string getAttributeForSelection(SumoXMLAttr key) const override
method for getting the attribute in the context of object selection
const std::map< const GNELane *, std::vector< GNEDemandElement * > > getPersonsOverEdgeMap() const
get persons a that start over this edge
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
const std::map< const GNELane *, std::vector< GNEDemandElement * > > getContainersOverEdgeMap() const
get containers a that start over this edge
bool hasPredecessors() const
check if this edge has predecessors (note: only for vehicles, this function ignore walking areas!...
friend class GNEChange_Lane
Friend class.
void updateGLObject() override
update GLObject (geometry, ID, etc.)
void smooth(GNEUndoList *undoList)
make geometry smooth
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
double getGeometryPointRadius() const
get geometry point radius
void setResponsible(bool newVal)
set responsibility for deleting internal structures
void copyEdgeType(const GNEEdgeType *edgeType, GNEUndoList *undoList)
copy edge attributes from edgeType
NBEdge * getNBEdge() const
returns the internal NBEdge
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
const std::map< const GNELane *, std::vector< GNEDemandElement * > > getVehiclesOverEdgeMap() const
get vehicles a that start over this edge
std::set< GUIGlID > getLaneGlIDs() const
returns GLIDs of all lanes
GNEEdge * getReverseEdge() const
get reverse edge (if exist)
const Position getFrontUpShapePosition() const
get front up shape position
void setGeometry(PositionVector geom, bool inner)
update edge geometry and inform the lanes
void smoothElevation(GNEUndoList *undoList)
smooth elevation with regard to adjoining edges
bool clickedOverGeometryPoint(const Position &pos) const
return true if user clicked over a Geometry Point
bool clickedOverShapeEnd(const Position &pos) const
return true if user clicked over ShapeEnd
void updateVehicleStackLabels()
void remakeGNEConnections(bool junctionsReady=false)
remake connections
bool isAttributeComputed(SumoXMLAttr key) const override
void calculateEdgeContour(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double layer) const
calculate contours
static const double SNAP_RADIUS
GNELane * getLaneByAllowedVClass(const SUMOVehicleClass vClass) const
return the first lane that allow a vehicle of type vClass (or the first lane, if none was found)
bool hasCustomEndPoints() const
void updatePersonStackLabels()
void setEdgeID(const std::string &newID)
set edge ID
void removeConnection(NBEdge::Connection nbCon)
removes a connection
void drawChildrens(const GUIVisualizationSettings &s) const
draw children
bool hasSuccessors() const
check if this edge has successors (note: only for vehicles, this function ignore walking areas!...
void drawStartGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double geometryPointRadius, const double layer, const double exaggeration) const
draw start extreme geometry point
GNEMoveElementEdge * myMoveElementEdge
move element edge
bool drawBigGeometryPoints() const
check if draw big geometry points
bool myWasSplit
whether this edge was created from a split
void removeLane(GNELane *lane, bool recomputeConnections)
@briefdecrease the number of lanes by one. argument is only used to increase robustness (assertions)
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this edge
bool hasRestrictedLane(SUMOVehicleClass vclass) const
check if edge has a restricted lane
static const double SNAP_RADIUS_SQUARED
void updateSecondParentJunction(const std::string &value)
update last parent junction
bool isVisible(const GUIVisualizationSettings &s) const override
check if object is visible (Currently used only in netedit)
const std::string getOptionalName() const override
Returns the street name.
std::vector< GNEEdge * > getOppositeEdges() const
get opposite edges
PositionVector smoothShape(const PositionVector &shape, bool forElevation)
return smoothed shape
bool checkDrawSelectContour() const override
check if draw select contour (blue)
GNEJunction * getFromJunction() const
get from Junction (only used to increase readability)
bool wasSplit()
whether this edge was created from a split
NBEdge * myNBEdge
the underlying NBEdge
void copyTemplate(const GNEEdgeTemplate *edgeTemplate, GNEUndoList *undoList)
copy edge attributes from edgetemplate
void removeEdgeFromCrossings(GNEJunction *junction, GNEUndoList *undoList)
remove crossing of junction
bool checkDrawMoveContour() const override
check if draw move contour (red)
Position getPositionInView() const
Returns position of hierarchical element in view.
void addLane(GNELane *lane, const NBEdge::Lane &laneAttrs, bool recomputeConnections)
increase number of lanes by one use the given attributes and restore the GNELane
GNEConnection * retrieveGNEConnection(int fromLane, NBEdge *to, int toLane, bool createIfNoExist=true)
get GNEConnection if exist, and if not create it if create is enabled
Position getAttributePosition(SumoXMLAttr key) const override
bool checkDrawToContour() const override
check if draw from contour (magenta)
ConnectionVector myGNEConnections
vector with the connections of this edge
void editEndpoint(Position pos, GNEUndoList *undoList)
makes pos the new geometry endpoint at the appropriate end, or remove current existent endpoint
void resetBothEndpoint(GNEUndoList *undoList)
restores both endpoint to the junction position at the appropriate end
Position getSplitPos(const Position &clickPos)
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
const std::vector< GNEConnection * > & getGNEConnections() const
returns a reference to the GNEConnection vector
bool isValid(SumoXMLAttr key, const std::string &value) override
int getRouteProbeRelativePosition(GNERouteProbe *routeProbe) const
obtain relative positions of RouteProbes
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
std::string myConnectionStatus
modification status of the connections
void drawEndGeometryPoint(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double geometryPointRadius, const double layer, const double exaggeration) const
draw end extreme geometry point
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
bool checkDrawDeleteContour() const override
check if draw delete contour (pink/white)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
void clearGNEConnections()
clear current connections
bool myUpdateGeometry
flag to enable/disable update geometry of lanes (used mainly by setNumLanes)
const Position getBackDownShapePosition() const
get back down shape position
bool areStackPositionOverlapped(const GNEEdge::StackPosition &vehicleA, const GNEEdge::StackPosition &vehicleB) const
check if given stacked positions are overlapped
bool checkDrawDeleteContourSmall() const override
check if draw delete contour small (pink/white)
void updateFirstParentJunction(const std::string &value)
update front parent junction
void updateGeometry() override
update pre-computed geometry information
void straightenElevation(GNEUndoList *undoList)
interpolate z values linear between junctions
void updateContainerStackLabels()
bool clickedOverShapeStart(const Position &pos) const
return true if user clicked over ShapeStart
void deleteGLObject() override
delete element
void setShapeStartPos(const Position &pos)
change Shape StartPos
GNEJunction * getToJunction() const
get from Junction (only used to increase readability)
const Position getBackUpShapePosition() const
get back up shape position
void resetEndpoint(const Position &pos, GNEUndoList *undoList)
restores the endpoint to the junction position at the appropriate end
bool isAttributeEnabled(SumoXMLAttr key) const override
void addConnection(NBEdge::Connection nbCon, bool selectAfterCreation=false)
adds a connection
void drawLaneStopOffset(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double layer) const
draw edgeStopOffset
void drawTAZElements(const GUIVisualizationSettings &s) const
draw TAZElements
void drawEdgeShape(const GUIVisualizationSettings &s, const GUIVisualizationSettings::Detail d, const double layer) const
draw edge shape (only one line)
std::vector< GNECrossing * > getGNECrossings()
get GNECrossings vinculated with this Edge
bool checkDrawFromContour() const override
check if draw from contour (green)
GNELane * getLaneByDisallowedVClass(const SUMOVehicleClass vClass) const
return the first lane that disallow a vehicle of type vClass (or the first lane, if none was found)
Parameterised * getParameters() override
get parameters associated with this edge
void updateVehicleSpreadGeometries()
bool checkDrawOverContour() const override
check if draw over contour (orange)
std::string getAttribute(SumoXMLAttr key) const override
void updateJunctionPosition(GNEJunction *junction, const Position &origPos)
update edge geometry after junction move
bool myAmResponsible
whether we are responsible for deleting myNBNode
GNEEdge(GNENet *net, NBEdge *nbe, bool wasSplit=false, bool loaded=false)
Constructor.
void setShapeEndPos(const Position &pos)
change Shape EndPos
std::string getNetworkElementProblem() const override
return a string with the current network element problem
const std::vector< GNELaneTemplate * > & getLaneTemplates() const
get vector with the lane templates of this edge
std::string getAttribute(SumoXMLAttr key) const override
std::string getAttribute(SumoXMLAttr key) const override
const std::vector< GNELaneType * > & getLaneTypes() const
get laneTypes
void removeCurrentEditedAttributeCarrier(const GNEAttributeCarrier *HE)
if given AttributeCarrier is the same of myHE, set it as nullptr
const GNEHierarchicalContainerChildren< GNEEdge * > & getChildEdges() const
get child edges
const GNEHierarchicalContainerChildren< GNEGenericData * > & getChildGenericDatas() const
return child generic data elements
const GNEHierarchicalContainerChildren< GNELane * > & getChildLanes() const
get child lanes
static void insertChild(ElementType element, ChildType child)
insert child element
const GNEHierarchicalContainerChildren< GNEAdditional * > & getChildAdditionals() const
return child additionals
const GNEHierarchicalContainerChildrenSet< GNETAZSourceSink * > & getChildTAZSourceSinks() const
return child TAZSourceSinks (Set)
void addChildElement(ChildType *element)
add child without updating parent (ONLY used if we're creating elements without undo-redo)
const GNEHierarchicalContainerParents< GNEJunction * > & getParentJunctions() const
get parent junctions
static void removeChild(ElementType element, ChildType child)
remove child element
static void updateParent(ElementType element, const int index, ParentType newParent)
update single parent element
const GNEHierarchicalContainerChildren< GNEDemandElement * > & getChildDemandElements() const
return child demand elements
void setEdgeTemplate(const GNEEdge *edge)
set edge template
GNEEdgeTemplate * getEdgeTemplate() const
get edge template (to copy attributes from)
void updateEdgeTemplate()
update edge template
TemplateEditor * getTemplateEditor() const
get template editor
GNEElementTree * getHierarchicalElementTree() const
get GNEElementTree modul
const std::vector< GNEEdge * > & getGNEIncomingEdges() const
Returns incoming GNEEdges.
const std::vector< GNECrossing * > & getGNECrossings() const
Returns GNECrossings.
void updateGeometry() override
update pre-computed geometry information (including crossings)
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
void removeOutgoingGNEEdge(GNEEdge *edge)
remove outgoing GNEEdge
void removeIncomingGNEEdge(GNEEdge *edge)
remove incoming GNEEdge
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
void addIncomingGNEEdge(GNEEdge *edge)
add incoming GNEEdge
const std::vector< GNEEdge * > & getGNEOutgoingEdges() const
Returns incoming GNEEdges.
NBNode * getNBNode() const
Return net build node.
void setLogicValid(bool valid, GNEUndoList *undoList, const std::string &status=FEATURE_GUESSED)
void addOutgoingGNEEdge(GNEEdge *edge)
add outgoing GNEEdge
const PositionVector & getLaneShape() const
get elements shape
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
return value for lane coloring according to the given scheme
int getIndex() const
returns the index of the lane
void removeGeometryPoint(const Position clickedPosition, GNEUndoList *undoList) override
remove geometry point in the clicked position
bool getForceDrawGeometryPoints() const
check if option "force draw geometry points" is enabled
NetworkMoveOptions * getNetworkMoveOptions() const
get network mode options
std::vector< GNEEdge * > retrieveEdges(GNEJunction *from, GNEJunction *to) const
get all edges by from and to GNEJunction
const std::unordered_map< const GUIGlObject *, GNEConnection * > & getConnections() const
get connections
void insertLane(GNELane *lane)
insert lane in container
void deleteConnection(GNEConnection *connection)
delete connection from container
GNEJunction * retrieveJunction(const std::string &id, bool hardFail=true) const
get junction by id
void insertConnection(GNEConnection *connection)
insert connection in container
void updateEdgeID(GNEEdge *edge, const std::string &newID)
update edge ID in container
GNEEdge * retrieveEdge(const std::string &id, bool hardFail=true) const
get edge by id
const std::unordered_map< const GUIGlObject *, GNELane * > & getLanes() const
get lanes
void deleteLane(GNELane *lane)
delete lane from container
void requireSaveDemandElements()
inform that demand elements has to be saved
void deleteEdge(GNEEdge *edge, GNEUndoList *undoList, bool recomputeConnections)
removes edge
void deleteLane(GNELane *lane, GNEUndoList *undoList, bool recomputeConnections)
removes lane
void deleteCrossing(GNECrossing *crossing, GNEUndoList *undoList)
remove crossing
void addGLObjectIntoGrid(GNEAttributeCarrier *AC)
add GL Object into net
void removeGLObjectFromGrid(GNEAttributeCarrier *AC)
add GL Object into net
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
GNEPathManager * getDemandPathManager()
get demand path manager
void removeExplicitTurnaround(std::string id)
remove edge id from the list of explicit turnarounds
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
void changeEdgeEndpoints(GNEEdge *edge, const std::string &newSourceID, const std::string &newDestID)
modifies endpoins of the given edge
const GNETagPropertiesDatabase * getTagPropertiesDatabase() const
get tag properties database (used for simplify code)
GNEViewParent * getViewParent() const
get view parent (used for simplify code)
GNEUndoList * getUndoList() const
get undo list(used for simplify code)
GNEViewNet * getViewNet() const
get view net (used for simplify code)
bool checkDrawingBoundarySelection() const
GNEContour myNetworkElementContour
network element contour
GNEHierarchicalElement * getHierarchicalElement() override
methods to retrieve the elements linked to this network element
void setNetworkElementID(const std::string &newID)
set network element id
void invalidatePathCalculator()
invalidate pathCalculator
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
const CommonXMLStructure::PlanParameters & getPlanParameteres() const
get plan parameters
bool markEdges() const
check if mark edges with dotted contours
void decRef(const std::string &debugMsg="")
Decrease reference.
void incRef(const std::string &debugMsg="")
Increase reference.
bool unreferenced()
check if object ins't referenced
const GNETagProperties * getTagProperty(const SumoXMLTag tag, const bool hardFail) const
get tagProperty associated to the given tag
SumoXMLTag getTag() const
get Tag vinculated with this attribute Property
const std::vector< const GNEAttributeProperties * > & getAttributeProperties() const
get all attribute properties
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
void uninspectAC(GNEAttributeCarrier *AC)
uninspect AC
GNEEdge * getEdgeFront() const
get front edge or a pointer to nullptr
GNEAttributeCarrier * getAttributeCarrierFront() const
get front attribute carrier or a pointer to nullptr
const GUIGlObject * getGUIGlObjectFront() const
get front GUIGLObject or a pointer to nullptr
GNEJunction * getJunctionFront() const
get front junction or a pointer to nullptr
bool isCurrentlyMovingElements() const
check if an element is being moved
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
const GNEViewNetHelper::EditNetworkElementShapes & getEditNetworkElementShapes() const
get Edit Shape module
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
const GNEViewNetHelper::MoveSingleElementModul & getMoveSingleElementValues() const
get move single element values
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)
bool checkSelectEdges() const
check if select edges (toggle using button or shift)
const GNEViewNetHelper::ViewObjectsSelector & getViewObjectsSelector() const
get objects under cursor
GNEMoveFrame * getMoveFrame() const
get frame for move elements
GNEDeleteFrame * getDeleteFrame() const
get frame for delete elements
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
static void drawGeometry(const GUIVisualizationSettings::Detail d, const GUIGeometry &geometry, const double width, double offset=0)
draw geometry
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 drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
T getColor(const double value) const
const std::vector< T > & getSchemes() const
Position snapToActiveGrid(const Position &pos, bool snapXY=true) const
Returns a position that is mapped to the closest grid point if the grid is active.
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIGLObjectPopupMenu * getPopup() const
ge the current popup-menu
bool selectObject(const GUIVisualizationSettings &s, const GUIGlObject *GLObject, const double layer, const bool checkDuplicated, const GNESegment *segment)
const Triangle & getSelectionTriangle() const
get selection triangle
const std::vector< int > & getSelectedGeometryPoints(const GUIGlObject *GLObject) const
get geometry points for the given glObject
bool selectingUsingRectangle() const
return true if we're selecting using a triangle
const GUIGlObject * markedFirstGeometryPoint
marked first geometry point (used for moving/delete geometry points)
Stores the information about how to visualize structures.
GUIVisualizationSizeSettings addSize
GUIVisualizationTextSettings edgeValue
double laneWidthExaggeration
The lane exaggeration (upscale thickness)
GUIVisualizationColorSettings colorSettings
color settings
GUIVisualizationDottedContourSettings dottedContourSettings
dotted contour settings
double scale
information about a lane's width (temporary, used for a single view)
GUIVisualizationTextSettings streetName
bool drawForViewObjectsHandler
whether drawing is performed for the purpose of selecting objects in view using ViewObjectsHandler
GUIColorer laneColorer
The lane colorer.
GUIVisualizationTextSettings edgeName
Setting bundles for optional drawing names with size and color.
bool checkDrawEdge(const Boundary &b) const
check if draw edge
bool spreadSuperposed
Whether to improve visualisation of superposed (rail) edges.
GUIColorer junctionColorer
The junction colorer.
std::string edgeParam
key for coloring by edge parameter
GUIVisualizationNeteditSizeSettings neteditSizeSettings
netedit size settings
static const double INVALID_OFFSET
a value to signify offsets outside the range of [0, Line.length()]
The representation of a single edge during network building.
void setStreetName(const std::string &name)
sets the street name of this edge
void mirrorX()
mirror coordinates along the x-axis
void setPreferredVehicleClass(SVCPermissions permissions, int lane=-1)
set preferred Vehicle Class
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
const std::vector< Connection > & getConnections() const
Returns the connections.
void setPermissions(SVCPermissions permissions, int lane=-1)
set allowed/disallowed classes for the given lane or for all lanes if -1 is given
StopOffset myEdgeStopOffset
A vClass specific stop offset - assumed of length 0 (unspecified) or 1. For the latter case the int i...
double getLoadedLength() const
Returns the length was set explicitly or the computed length if it wasn't set.
void setSpeed(int lane, double speed)
set lane specific speed (negative lane implies set for all lanes)
bool hasLaneSpecificFriction() const
whether lanes differ in friction
double getLaneWidth() const
Returns the default width of lanes of this edge.
NBNode * getToNode() const
Returns the destination node of the edge.
Lane & getLaneStruct(int lane)
void addLane(int index, bool recomputeShape, bool recomputeConnections, bool shiftIndices)
add lane
bool hasLaneSpecificSpeed() const
whether lanes differ in speed
std::string myType
The type of the edge.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
LaneSpreadFunction getLaneSpreadFunction() const
Returns how this edge's lanes' lateral offset is computed.
bool hasLoadedLength() const
Returns whether a length was set explicitly.
void setDistance(double distance)
set kilometrage at start of edge (negative value implies couting down along the edge)
const std::string & getRoutingType() const
return whether this edge should be a bidi edge
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
double getSpeed() const
Returns the speed allowed on this edge.
const std::string & getID() const
double getDistance() const
get distance
static const double UNSPECIFIED_LOADED_LENGTH
no length override given
void setLaneWidth(int lane, double width)
set lane specific width (negative lane implies set for all lanes)
void setLaneSpreadFunction(LaneSpreadFunction spread)
(Re)sets how the lanes lateral offset shall be computed
bool isTurningDirectionAt(const NBEdge *const edge) const
Returns whether the given edge is the opposite direction to this edge.
bool hasLaneSpecificPermissions() const
whether lanes differ in allowed vehicle classes
bool isBidiEdge(bool checkPotential=false) const
whether this edge is part of a bidirectional edge pair
void setBidi(bool isBidi)
mark this edge as a bidi edge
int getNumLanes() const
Returns the number of lanes.
void setFriction(int lane, double friction)
set lane specific friction (negative lane implies set for all lanes)
void removeFromConnections(NBEdge *toEdge, int fromLane=-1, int toLane=-1, bool tryLater=false, const bool adaptToLaneRemoval=false, const bool keepPossibleTurns=false)
Removes the specified connection(s)
void invalidateConnections(bool reallowSetting=false)
invalidate current connections of edge
void deleteLane(int index, bool recompute, bool shiftIndices)
delete lane
bool hasLaneSpecificWidth() const
whether lanes differ in width
std::string getLaneID(int lane) const
get lane ID
@ USER
The connection was given by the user.
double getFriction() const
Returns the friction on this edge.
bool setConnection(int lane, NBEdge *destEdge, int destLane, Lane2LaneInfoType type, bool mayUseSameDestination=false, bool mayDefinitelyPass=false, KeepClear keepClear=KEEPCLEAR_UNSPECIFIED, double contPos=UNSPECIFIED_CONTPOS, double visibility=UNSPECIFIED_VISIBILITY_DISTANCE, double speed=UNSPECIFIED_SPEED, double friction=UNSPECIFIED_FRICTION, double length=myDefaultConnectionLength, const PositionVector &customShape=PositionVector::EMPTY, const bool uncontrolled=UNSPECIFIED_CONNECTION_UNCONTROLLED, SVCPermissions permissions=SVC_UNSPECIFIED, bool indirectLeft=false, const std::string &edgeType="", SVCPermissions changeLeft=SVC_UNSPECIFIED, SVCPermissions changeRight=SVC_UNSPECIFIED, bool postProcess=false)
Adds a connection to a certain lane of a certain edge.
bool hasLaneSpecificEndOffset() const
whether lanes differ in offset
const std::string & getTypeID() const
get ID of type
const std::string & getStreetName() const
Returns the street name of this edge.
const NBEdge * getBidiEdge() const
NBNode * getFromNode() const
Returns the origin node of the edge.
NBEdge * getTurnDestination(bool possibleDestination=false) const
std::string myRoutingType
The routing type of the edge.
int getPriority() const
Returns the priority of the edge.
static const double UNSPECIFIED_WIDTH
unspecified lane width
void declareConnectionsAsLoaded(EdgeBuildingStep step=EdgeBuildingStep::LANES2LANES_USER)
declares connections as fully loaded. This is needed to avoid recomputing connections if an edge has ...
double getEndOffset() const
Returns the offset to the destination node.
void setEndOffset(int lane, double offset)
set lane specific end-offset (negative lane implies set for all lanes)
void setLoadedLength(double val)
set loaded length
const PositionVector getInnerGeometry() const
Returns the geometry of the edge without the endpoints.
double getFinalLength() const
get length that will be assigned to the lanes in the final network
void setGeometry(const PositionVector &g, bool inner=false)
(Re)sets the edge's geometry
int myPriority
The priority of the edge.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const Position & getPosition() const
bool isRoundabout() const
return whether this node is part of a roundabout
bool geometryLike() const
whether this is structurally similar to a geometry node
static PositionVector bezierControlPoints(const PositionVector &begShape, const PositionVector &endShape, bool isTurnaround, double extrapolateBeg, double extrapolateEnd, bool &ok, NBNode *recordError=0, double straightThresh=DEG2RAD(5), int shapeFlag=0)
get bezier control points
const std::string & getID() const
Returns the id.
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
An upper class for objects with additional parameters.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
A point in 2D or 3D with translation and scaling methods.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
void add(const Position &pos)
Adds the given position to this one.
void mul(double val)
Multiplies position with the given value.
double z() const
Returns the z-position.
double length2D() const
Returns the length.
double length() const
Returns the length.
double rotationAtOffset(double pos) const
Returns the rotation at the given length.
PositionVector resample(double maxLength, const bool adjustEnd) const
resample shape (i.e. transform to segments, equal spacing)
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
Position positionAtOffset(double pos, double lateralOffset=0) const
Returns the position at the given length.
void add(double xoff, double yoff, double zoff)
double nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
return the nearest offest to point 2D
int indexOfClosest(const Position &p, bool twoD=false) const
void move2side(double amount, double maxExtension=100)
move position vector to side using certain amount
PositionVector interpolateZ(double zStart, double zEnd) const
returned vector that varies z smoothly over its length
Boundary getBoxBoundary() const
Returns a boundary enclosing this list of lines.
static const PositionVector EMPTY
empty Vector
PositionVector bezier(int numPoints)
return a bezier interpolation
void push_front(const Position &p)
insert in front a Position
Position positionAtOffset2D(double pos, double lateralOffset=0, bool extrapolateBeyond=false) const
Returns the position at the given length.
void pop_front()
pop first Position
PositionVector reverse() const
reverse position vector
static const RGBColor BLUE
unsigned char alpha() const
Returns the alpha-amount of the color.
static const RGBColor ORANGE
static const RGBColor CYAN
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
static StringBijection< LaneSpreadFunction > LaneSpreadFunctions
lane spread functions
static bool isValidNetID(const std::string &value)
whether the given string is a valid id for a network element
void setOffset(const double offset)
set offset
bool isDefined() const
check if stopOffset was defined
SVCPermissions getPermissions() const
get permissions
void setExceptions(const std::string permissions)
set exceptions (used in netedit)
std::string getExceptions() const
get exceptions (used in netedit)
double getOffset() const
get offset
const std::string & getString(const T key) const
get string
bool hasString(const std::string &str) const
check if the given string exist
bool isBoundaryFullWithin(const Boundary &boundary) const
check if the given position is FULL within this triangle
bool showDemandElements() const
check if show demand elements checkbox is enabled
NetworkEditMode networkEditMode
the current Network edit mode
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
GNEMoveElement * getMovedElement() const
get moved element
bool editingElevation() const
check if we're editing elevation
bool showDemandElements() const
check if show demand elements checkbox is enabled
bool showTAZElements() const
check if show TAZ Elements
RGBColor selectedEdgeColor
edge selection color
static const double segmentWidthSmall
width of small dotted contour segments
static const double segmentWidth
width of dotted contour segments
static const double junctionBubbleRadius
junction bubble 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
double scaledSize(double scale, double constFactor=0.1) const
get scale size
A structure which describes a connection between edges or lanes.
int fromLane
The lane the connections starts at.
int toLane
The lane the connections yields in.
double speed
custom speed for connection
NBEdge * toEdge
The edge the connections yields in.
KeepClear keepClear
whether the junction must be kept clear when using this connection
double customLength
custom length for connection
bool uncontrolled
check if Connection is uncontrolled
PositionVector customShape
custom shape for connection
bool mayDefinitelyPass
Information about being definitely free to drive (on-ramps)
double contPos
custom position for internal junction on this connection
double visibility
custom foe visiblity for connection
An (internal) definition of a single lane of an edge.
double width
This lane's width.
double endOffset
This lane's offset to the intersection begin.
SVCPermissions preferred
List of vehicle types that are preferred on this lane.
double speed
The speed allowed on this lane.
double friction
The friction on this lane.
SVCPermissions permissions
List of vehicle types that are allowed on this lane.