#include <netedit/GNEApplicationWindow.h>
#include <netedit/GNENet.h>
#include <netedit/GNETagProperties.h>
#include <netedit/GNEViewNet.h>
#include <netedit/GNEViewParent.h>
#include <netedit/elements/additional/GNETAZ.h>
#include <netedit/frames/common/GNEInspectorFrame.h>
#include <utils/gui/div/GLHelper.h>
#include <utils/gui/div/GUIDesigns.h>
#include <utils/gui/windows/GUIAppEnum.h>
#include "GNEPathCreator.h"
FXDEFMAP(GNEPathCreator) PathCreatorMap[] = {
FXMAPFUNC(SEL_COMMAND, MID_GNE_PATHCREATOR_ABORT, GNEPathCreator::onCmdAbortPathCreation),
FXMAPFUNC(SEL_COMMAND, MID_GNE_PATHCREATOR_FINISH, GNEPathCreator::onCmdCreatePath),
FXMAPFUNC(SEL_COMMAND, MID_GNE_PATHCREATOR_USELASTROUTE, GNEPathCreator::onCmdUseLastRoute),
FXMAPFUNC(SEL_UPDATE, MID_GNE_PATHCREATOR_USELASTROUTE, GNEPathCreator::onUpdUseLastRoute),
FXMAPFUNC(SEL_COMMAND, MID_GNE_PATHCREATOR_REMOVELAST, GNEPathCreator::onCmdRemoveLastElement),
FXMAPFUNC(SEL_COMMAND, MID_GNE_PATHCREATOR_SHOWCANDIDATES, GNEPathCreator::onCmdShowCandidateEdges)
};
FXIMPLEMENT(GNEPathCreator, MFXGroupBoxModule, PathCreatorMap, ARRAYNUMBER(PathCreatorMap))
GNEPathCreator::Path::Path(const SUMOVehicleClass vClass, GNEEdge* edge) :
mySubPath({edge}),
myConflictVClass(false),
myConflictDisconnected(false) {
if (edge->getNBEdge()->getNumLanesThatAllow(vClass) == 0) {
myConflictVClass = true;
}
}
GNEPathCreator::Path::Path(GNEPathManager* pathManager, const SUMOVehicleClass vClass, GNEEdge* edgeFrom, GNEEdge* edgeTo) :
myConflictVClass(false),
myConflictDisconnected(false) {
mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(vClass, {edgeFrom, edgeTo});
if (mySubPath.empty()) {
mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, {edgeFrom, edgeTo});
if (mySubPath.empty()) {
mySubPath = { edgeFrom, edgeTo };
myConflictDisconnected = true;
} else {
myConflictVClass = true;
}
}
}
GNEPathCreator::Path::Path(GNEPathManager* pathManager, const SUMOVehicleClass vClass, GNEJunction* junctionFrom, GNEJunction* junctionTo) :
myConflictVClass(false),
myConflictDisconnected(false) {
mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(vClass, junctionFrom, junctionTo);
if (mySubPath.empty()) {
mySubPath = pathManager->getPathCalculator()->calculateDijkstraPath(SVC_PEDESTRIAN, junctionFrom, junctionTo);
if (mySubPath.empty()) {
myConflictDisconnected = true;
} else {
myConflictVClass = true;
}
}
}
const std::vector<GNEEdge*>&
GNEPathCreator::Path::getSubPath() const {
return mySubPath;
}
bool
GNEPathCreator::Path::isConflictVClass() const {
return myConflictVClass;
}
bool
GNEPathCreator::Path::isConflictDisconnected() const {
return myConflictDisconnected;
}
GNEPathCreator::Path::Path() :
myConflictVClass(false),
myConflictDisconnected(false) {
}
GNEPathCreator::GNEPathCreator(GNEFrame* frameParent, GNEPathManager* pathManager) :
MFXGroupBoxModule(frameParent, TL("Route creator")),
myFrameParent(frameParent),
myPathManager(pathManager),
myVClass(SVC_PASSENGER),
myCreationMode(0),
myRoute(nullptr) {
myInfoRouteLabel = new FXLabel(getCollapsableFrame(), TL("No edges selected"), 0, GUIDesignLabelFrameInformation);
myUseLastRoute = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Use last route"), "", "", GUIIconSubSys::getIcon(GUIIcon::ROUTE), this, MID_GNE_PATHCREATOR_USELASTROUTE, GUIDesignButton);
myUseLastRoute->disable();
myFinishCreationButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Finish route creation"), "", "", nullptr, this, MID_GNE_PATHCREATOR_FINISH, GUIDesignButton);
myFinishCreationButton->disable();
myAbortCreationButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Abort route creation"), "", "", nullptr, this, MID_GNE_PATHCREATOR_ABORT, GUIDesignButton);
myAbortCreationButton->disable();
myRemoveLastInsertedElement = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Remove last edge"), "", "", nullptr, this, MID_GNE_PATHCREATOR_REMOVELAST, GUIDesignButton);
myRemoveLastInsertedElement->disable();
myShowCandidateEdges = new FXCheckButton(getCollapsableFrame(), TL("Show candidate edges"), this, MID_GNE_PATHCREATOR_SHOWCANDIDATES, GUIDesignCheckButton);
myShowCandidateEdges->setCheck(TRUE);
myShiftLabel = new FXLabel(this,
TL("SHIFT-click: ignore vClass"),
0, GUIDesignLabelFrameInformation);
myControlLabel = new FXLabel(this,
TL("CTRL-click: force add"),
0, GUIDesignLabelFrameInformation);
myBackSpaceLabel = new FXLabel(this,
TL("BACKSPACE: undo click"),
0, GUIDesignLabelFrameInformation);
}
GNEPathCreator::~GNEPathCreator() {}
void
GNEPathCreator::showPathCreatorModule(const GNETagProperties* tagProperty, const bool consecutives) {
bool showPathCreator = true;
abortPathCreation();
myUseLastRoute->hide();
myFinishCreationButton->disable();
myAbortCreationButton->disable();
myRemoveLastInsertedElement->disable();
myInfoRouteLabel->show();
myShowCandidateEdges->show();
myShiftLabel->show();
myControlLabel->show();
myBackSpaceLabel->show();
myCreationMode = 0;
if (consecutives) {
myCreationMode |= CONSECUTIVE_EDGES;
} else {
myCreationMode |= NONCONSECUTIVE_EDGES;
}
if (tagProperty->isRoute() || tagProperty->vehicleRouteEmbedded()) {
myCreationMode |= SHOW_CANDIDATE_EDGES;
myCreationMode |= START_EDGE;
myCreationMode |= END_EDGE;
} else if (tagProperty->vehicleRoute()) {
myCreationMode |= ROUTE;
myUseLastRoute->show();
myFinishCreationButton->hide();
myAbortCreationButton->hide();
myRemoveLastInsertedElement->hide();
myInfoRouteLabel->hide();
myShowCandidateEdges->hide();
myShiftLabel->hide();
myControlLabel->hide();
myBackSpaceLabel->hide();
} else if (tagProperty->vehicleEdges() || (tagProperty->getTag() == SUMO_TAG_EDGEREL)) {
myCreationMode |= SHOW_CANDIDATE_EDGES;
myCreationMode |= START_EDGE;
myCreationMode |= END_EDGE;
} else if (tagProperty->vehicleJunctions()) {
myCreationMode |= SHOW_CANDIDATE_JUNCTIONS;
myCreationMode |= START_JUNCTION;
myCreationMode |= END_JUNCTION;
myCreationMode |= ONLY_FROMTO;
} else if (tagProperty->vehicleTAZs()) {
myCreationMode |= START_TAZ;
myCreationMode |= END_TAZ;
myCreationMode |= ONLY_FROMTO;
} else {
showPathCreator = false;
}
updateEdgeColors();
updateJunctionColors();
if (showPathCreator) {
recalc();
show();
} else {
hide();
}
}
void
GNEPathCreator::hidePathCreatorModule() {
clearPath();
hide();
}
SUMOVehicleClass
GNEPathCreator::getVClass() const {
return myVClass;
}
void
GNEPathCreator::setVClass(SUMOVehicleClass vClass) {
myVClass = vClass;
updateEdgeColors();
}
bool
GNEPathCreator::addJunction(GNEJunction* junction) {
if (((myCreationMode & START_JUNCTION) == 0) && ((myCreationMode & END_JUNCTION) == 0)) {
return false;
}
if (mySelectedJunctions.size() > 0) {
if (mySelectedJunctions.back() == junction) {
WRITE_WARNING(TL("Double junctions aren't allowed"));
return false;
}
}
if (mySelectedJunctions.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) {
WRITE_WARNING(TL("Only two junctions are allowed"));
return false;
}
mySelectedJunctions.push_back(junction);
myAbortCreationButton->enable();
myFinishCreationButton->enable();
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedoTemporally(TL("creation of path between junctions"));
if (mySelectedJunctions.size() > 1) {
myRemoveLastInsertedElement->enable();
} else {
myRemoveLastInsertedElement->disable();
}
recalculatePath();
updateInfoRouteLabel();
updateJunctionColors();
return true;
}
bool
GNEPathCreator::addTAZ(GNETAZ* TAZ) {
if (((myCreationMode & START_TAZ) == 0) && ((myCreationMode & END_TAZ) == 0)) {
return false;
}
if (mySelectedTAZs.size() > 0) {
if (mySelectedTAZs.back() == TAZ) {
WRITE_WARNING(TL("Double TAZs aren't allowed"));
return false;
}
}
if ((mySelectedTAZs.size() == 2) && (myCreationMode & Mode::ONLY_FROMTO)) {
WRITE_WARNING(TL("Only two TAZs are allowed"));
return false;
}
mySelectedTAZs.push_back(TAZ);
myAbortCreationButton->enable();
myFinishCreationButton->enable();
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedoTemporally(TL("creation of path between TAZs"));
if (mySelectedTAZs.size() > 1) {
myRemoveLastInsertedElement->enable();
} else {
myRemoveLastInsertedElement->disable();
}
updateInfoRouteLabel();
return true;
}
bool
GNEPathCreator::addEdge(GNEEdge* edge, const bool shiftKeyPressed, const bool controlKeyPressed) {
if (((myCreationMode & START_EDGE) == 0) && ((myCreationMode & END_EDGE) == 0)) {
return false;
}
if (mySelectedEdges.size() > 0) {
if (mySelectedEdges.back() == edge) {
WRITE_WARNING(TL("Double edges aren't allowed"));
return false;
}
if (myCreationMode & Mode::CONSECUTIVE_EDGES) {
const auto& outgoingEdges = mySelectedEdges.back()->getToJunction()->getGNEOutgoingEdges();
if (std::find(outgoingEdges.begin(), outgoingEdges.end(), edge) == outgoingEdges.end()) {
WRITE_WARNING(TL("Only consecutives edges are allowed"));
return false;
}
}
}
if (mySelectedEdges.size() == 2 && (myCreationMode & Mode::ONLY_FROMTO)) {
WRITE_WARNING(TL("Only two edges are allowed"));
return false;
}
if ((myShowCandidateEdges->getCheck() == TRUE) && !edge->isPossibleCandidate()) {
if (edge->isSpecialCandidate()) {
if (!shiftKeyPressed) {
WRITE_WARNING(TL("Invalid edge (SHIFT + click to add an invalid vClass edge)"));
return false;
}
} else if (edge->isConflictedCandidate()) {
if (!controlKeyPressed) {
WRITE_WARNING(TL("Invalid edge (CONTROL + click to add a disconnected edge)"));
return false;
}
}
}
mySelectedEdges.push_back(edge);
myAbortCreationButton->enable();
myFinishCreationButton->enable();
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->disableUndoRedoTemporally(TL("creation of path between edges"));
if (mySelectedEdges.size() > 1) {
myRemoveLastInsertedElement->enable();
} else {
myRemoveLastInsertedElement->disable();
}
recalculatePath();
updateInfoRouteLabel();
updateEdgeColors();
return true;
}
const std::vector<GNEEdge*>&
GNEPathCreator::getSelectedEdges() const {
return mySelectedEdges;
}
const std::vector<GNEJunction*>&
GNEPathCreator::getSelectedJunctions() const {
return mySelectedJunctions;
}
const std::vector<GNETAZ*>&
GNEPathCreator::getSelectedTAZs() const {
return mySelectedTAZs;
}
bool
GNEPathCreator::addRoute(GNEDemandElement* route) {
if ((myCreationMode & ROUTE) == 0) {
return false;
}
if (myRoute) {
return false;
}
myRoute = route;
createPath(false);
myRoute = nullptr;
recalculatePath();
updateInfoRouteLabel();
updateEdgeColors();
return true;
}
GNEDemandElement*
GNEPathCreator::getRoute() const {
return myRoute;
}
const std::vector<GNEPathCreator::Path>&
GNEPathCreator::getPath() const {
return myPath;
}
bool
GNEPathCreator::drawCandidateEdgesWithSpecialColor() const {
return (myShowCandidateEdges->getCheck() == TRUE);
}
void
GNEPathCreator::updateJunctionColors() {
clearJunctionColors();
if (myCreationMode & SHOW_CANDIDATE_JUNCTIONS) {
for (const auto& junction : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
junction.second->resetCandidateFlags();
junction.second->setPossibleCandidate(true);
}
}
if (mySelectedJunctions.size() > 0) {
for (const auto& junction : mySelectedJunctions) {
junction->resetCandidateFlags();
junction->setSourceCandidate(true);
}
mySelectedJunctions.back()->resetCandidateFlags();
mySelectedJunctions.back()->setTargetCandidate(true);
}
myFrameParent->getViewNet()->updateViewNet();
}
void
GNEPathCreator::updateEdgeColors() {
clearEdgeColors();
if (myShowCandidateEdges->getCheck() == TRUE && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
if (edge.second->getNBEdge()->getNumLanesThatAllow(myVClass) > 0) {
edge.second->setPossibleCandidate(true);
} else {
edge.second->setSpecialCandidate(true);
}
}
}
if (mySelectedEdges.size() > 0) {
if ((myShowCandidateEdges->getCheck() == TRUE) && (myCreationMode & SHOW_CANDIDATE_EDGES)) {
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
edge.second->resetCandidateFlags();
edge.second->setConflictedCandidate(true);
}
setSpecialCandidates(mySelectedEdges.back());
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
edge.second->setConflictedCandidate(true);
}
setPossibleCandidates(mySelectedEdges.back(), myVClass);
}
for (const auto& edge : mySelectedEdges) {
edge->resetCandidateFlags();
edge->setSourceCandidate(true);
}
mySelectedEdges.back()->resetCandidateFlags();
mySelectedEdges.back()->setTargetCandidate(true);
}
myFrameParent->getViewNet()->updateViewNet();
}
void
GNEPathCreator::clearJunctionColors() {
for (const auto& junction : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getJunctions()) {
junction.second->resetCandidateFlags();
}
}
void
GNEPathCreator::clearEdgeColors() {
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
edge.second->resetCandidateFlags();
}
}
void
GNEPathCreator::drawTemporalRoute(const GUIVisualizationSettings& s) const {
const double lineWidth = 0.35;
const double lineWidthin = 0.25;
GLHelper::pushMatrix();
glTranslated(0, 0, GLO_MAX - 0.1);
if (myPath.size() > 0) {
GLHelper::setColor(RGBColor::GREY);
for (int i = 0; i < (int)myPath.size(); i++) {
const GNEPathCreator::Path& path = myPath.at(i);
for (int j = 0; j < (int)path.getSubPath().size(); j++) {
const GNELane* lane = path.getSubPath().at(j)->getChildLanes().back();
if (((i == 0) && (j == 0)) || (j > 0)) {
GLHelper::drawBoxLines(lane->getLaneShape(), lineWidth);
}
if ((j + 1) < (int)path.getSubPath().size()) {
const GNELane* nextLane = path.getSubPath().at(j + 1)->getChildLanes().back();
if (lane->getLane2laneConnections().exist(nextLane)) {
GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidth);
} else {
GLHelper::drawBoxLines({lane->getLaneShape().back(), nextLane->getLaneShape().front()}, lineWidth);
}
}
}
}
glTranslated(0, 0, 0.1);
for (int i = 0; i < (int)myPath.size(); i++) {
const GNEPathCreator::Path& path = myPath.at(i);
if ((myCreationMode & SHOW_CANDIDATE_EDGES) == 0) {
GLHelper::setColor(RGBColor::ORANGE);
} else if (path.isConflictDisconnected()) {
GLHelper::setColor(s.candidateColorSettings.conflict);
} else if (path.isConflictVClass()) {
GLHelper::setColor(s.candidateColorSettings.special);
} else {
GLHelper::setColor(RGBColor::ORANGE);
}
for (int j = 0; j < (int)path.getSubPath().size(); j++) {
const GNELane* lane = path.getSubPath().at(j)->getChildLanes().back();
if (((i == 0) && (j == 0)) || (j > 0)) {
GLHelper::drawBoxLines(lane->getLaneShape(), lineWidthin);
}
if ((j + 1) < (int)path.getSubPath().size()) {
const GNELane* nextLane = path.getSubPath().at(j + 1)->getChildLanes().back();
if (lane->getLane2laneConnections().exist(nextLane)) {
GLHelper::drawBoxLines(lane->getLane2laneConnections().getLane2laneGeometry(nextLane).getShape(), lineWidthin);
} else {
GLHelper::drawBoxLines({ lane->getLaneShape().back(), nextLane->getLaneShape().front() }, lineWidthin);
}
}
}
}
} else if (mySelectedJunctions.size() > 0) {
GLHelper::setColor(RGBColor::ORANGE);
for (int i = 0; i < (int)mySelectedJunctions.size() - 1; i++) {
const Position posA = mySelectedJunctions.at(i)->getPositionInView();
const Position posB = mySelectedJunctions.at(i + 1)->getPositionInView();
const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) 180.0 / (double)M_PI);
const double len = posA.distanceTo2D(posB);
GLHelper::drawBoxLine(posA, rot, len, 0.25);
}
} else if (mySelectedTAZs.size() > 0) {
GLHelper::setColor(RGBColor::ORANGE);
for (int i = 0; i < (int)mySelectedTAZs.size() - 1; i++) {
const Position posA = mySelectedTAZs.at(i)->getPositionInView();
const Position posB = mySelectedTAZs.at(i + 1)->getPositionInView();
const double rot = ((double)atan2((posB.x() - posA.x()), (posA.y() - posB.y())) * (double) 180.0 / (double)M_PI);
const double len = posA.distanceTo2D(posB);
GLHelper::drawBoxLine(posA, rot, len, 0.25);
}
}
GLHelper::popMatrix();
}
bool
GNEPathCreator::createPath(const bool useLastRoute) {
return myFrameParent->createPath(useLastRoute);
}
void
GNEPathCreator::abortPathCreation() {
if ((mySelectedJunctions.size() > 0) || (mySelectedTAZs.size() > 0) || (mySelectedEdges.size() > 0) || myRoute) {
myFrameParent->getViewNet()->getViewParent()->getGNEAppWindows()->enableUndoRedoTemporally();
clearPath();
myFinishCreationButton->disable();
myAbortCreationButton->disable();
myRemoveLastInsertedElement->disable();
updateInfoRouteLabel();
updateJunctionColors();
updateEdgeColors();
myFrameParent->getViewNet()->updateViewNet();
}
}
void
GNEPathCreator::removeLastElement() {
if (mySelectedEdges.size() > 1) {
mySelectedEdges.back()->resetCandidateFlags();
mySelectedEdges.pop_back();
if ((mySelectedEdges.size() > 0) && mySelectedEdges.back()->isSourceCandidate()) {
mySelectedEdges.back()->setSourceCandidate(false);
mySelectedEdges.back()->setTargetCandidate(true);
}
if (mySelectedEdges.size() > 1) {
myRemoveLastInsertedElement->enable();
} else {
myRemoveLastInsertedElement->disable();
}
recalculatePath();
updateInfoRouteLabel();
updateJunctionColors();
updateEdgeColors();
myFrameParent->getViewNet()->updateViewNet();
}
}
long
GNEPathCreator::onCmdCreatePath(FXObject*, FXSelector, void*) {
return createPath(false);
}
long
GNEPathCreator::onCmdUseLastRoute(FXObject*, FXSelector, void*) {
return createPath(true);
}
long
GNEPathCreator::onUpdUseLastRoute(FXObject* sender, FXSelector, void*) {
if ((myCreationMode & ROUTE) && myFrameParent->getViewNet()->getLastCreatedRoute()) {
return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
} else {
return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
}
}
long
GNEPathCreator::onCmdAbortPathCreation(FXObject*, FXSelector, void*) {
abortPathCreation();
return 1;
}
long
GNEPathCreator::onCmdRemoveLastElement(FXObject*, FXSelector, void*) {
removeLastElement();
return 1;
}
long
GNEPathCreator::onCmdShowCandidateEdges(FXObject*, FXSelector, void*) {
if (myShowCandidateEdges->getCheck() == TRUE) {
myShiftLabel->show();
myControlLabel->show();
} else {
myShiftLabel->hide();
myControlLabel->hide();
}
recalc();
updateEdgeColors();
return 1;
}
void
GNEPathCreator::updateInfoRouteLabel() {
if (myPath.size() > 0) {
double length = 0;
double speed = 0;
int pathSize = 0;
for (const auto& path : myPath) {
for (const auto& edge : path.getSubPath()) {
length += edge->getNBEdge()->getLength();
speed += edge->getNBEdge()->getSpeed();
}
pathSize += (int)path.getSubPath().size();
}
std::ostringstream information;
information
<< TL("- Selected edges: ") << toString(mySelectedEdges.size()) << "\n"
<< TL("- Path edges: ") << toString(pathSize) << "\n"
<< TL("- Length: ") << toString(length) << "\n"
<< TL("- Average speed: ") << toString(speed / pathSize);
myInfoRouteLabel->setText(information.str().c_str());
} else {
myInfoRouteLabel->setText(TL("No edges selected"));
}
}
void
GNEPathCreator::clearPath() {
clearJunctionColors();
clearEdgeColors();
mySelectedJunctions.clear();
mySelectedTAZs.clear();
mySelectedEdges.clear();
myRoute = nullptr;
myPath.clear();
updateInfoRouteLabel();
}
void
GNEPathCreator::recalculatePath() {
myPath.clear();
std::vector<GNEEdge*> edges;
if (myRoute) {
edges = myRoute->getParentEdges();
} else {
for (const auto& edge : mySelectedEdges) {
edges.push_back(edge);
}
}
if (edges.size() == 1) {
myPath.push_back(Path(myVClass, edges.front()));
} else if (mySelectedJunctions.size() == 2) {
myPath.push_back(Path(myPathManager, myVClass, mySelectedJunctions.front(), mySelectedJunctions.back()));
} else {
for (int i = 1; i < (int)edges.size(); i++) {
myPath.push_back(Path(myPathManager, myVClass, edges.at(i - 1), edges.at(i)));
}
}
}
void
GNEPathCreator::setSpecialCandidates(GNEEdge* originEdge) {
myPathManager->getPathCalculator()->calculateReachability(SVC_PEDESTRIAN, originEdge);
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
for (const auto& lane : edge.second->getChildLanes()) {
if (lane->getReachability() > 0) {
lane->getParentEdge()->resetCandidateFlags();
lane->getParentEdge()->setSpecialCandidate(true);
}
}
}
}
void
GNEPathCreator::setPossibleCandidates(GNEEdge* originEdge, const SUMOVehicleClass vClass) {
myPathManager->getPathCalculator()->calculateReachability(vClass, originEdge);
for (const auto& edge : myFrameParent->getViewNet()->getNet()->getAttributeCarriers()->getEdges()) {
for (const auto& lane : edge.second->getChildLanes()) {
if (lane->getReachability() > 0) {
lane->getParentEdge()->resetCandidateFlags();
lane->getParentEdge()->setPossibleCandidate(true);
}
}
}
}