Path: blob/main/src/netedit/frames/network/GNECrossingFrame.cpp
169685 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNECrossingFrame.cpp14/// @author Pablo Alvarez Lopez15/// @date Oct 201616///17// The Widget for add Crossing elements18/****************************************************************************/1920#include <netedit/GNENet.h>21#include <netedit/GNETagPropertiesDatabase.h>22#include <netedit/GNEUndoList.h>23#include <netedit/GNEViewParent.h>24#include <netedit/changes/GNEChange_Crossing.h>25#include <netedit/elements/network/GNECrossing.h>26#include <netedit/frames/network/GNECreateEdgeFrame.h>27#include <utils/foxtools/MFXDynamicLabel.h>28#include <utils/gui/div/GUIDesigns.h>29#include <utils/gui/windows/GUIAppEnum.h>3031#include "GNECrossingFrame.h"3233// ===========================================================================34// FOX callback mapping35// ===========================================================================3637FXDEFMAP(GNECrossingFrame::EdgesSelector) EdgesSelectorMap[] = {38FXMAPFUNC(SEL_COMMAND, MID_GNE_USESELECTED, GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges),39FXMAPFUNC(SEL_COMMAND, MID_GNE_CLEARSELECTION, GNECrossingFrame::EdgesSelector::onCmdClearSelection)40};4142FXDEFMAP(GNECrossingFrame::CrossingParameters) CrossingParametersMap[] = {43FXMAPFUNC(SEL_COMMAND, MID_GNE_SET_ATTRIBUTE, GNECrossingFrame::CrossingParameters::onCmdSetAttribute),44FXMAPFUNC(SEL_COMMAND, MID_HELP, GNECrossingFrame::CrossingParameters::onCmdHelp),45};4647FXDEFMAP(GNECrossingFrame::CreateCrossing) CreateCrossingMap[] = {48FXMAPFUNC(SEL_COMMAND, MID_GNE_CREATE, GNECrossingFrame::CreateCrossing::onCmdCreateCrossing),49};5051// Object implementation52FXIMPLEMENT(GNECrossingFrame::EdgesSelector, MFXGroupBoxModule, EdgesSelectorMap, ARRAYNUMBER(EdgesSelectorMap))53FXIMPLEMENT(GNECrossingFrame::CrossingParameters, MFXGroupBoxModule, CrossingParametersMap, ARRAYNUMBER(CrossingParametersMap))54FXIMPLEMENT(GNECrossingFrame::CreateCrossing, MFXGroupBoxModule, CreateCrossingMap, ARRAYNUMBER(CreateCrossingMap))555657// ===========================================================================58// method definitions59// ===========================================================================6061// ---------------------------------------------------------------------------62// GNECrossingFrame::CurrentJunction - methods63// ---------------------------------------------------------------------------6465GNECrossingFrame::JunctionInformation::JunctionInformation(GNECrossingFrame* crossingFrameParent) :66MFXGroupBoxModule(crossingFrameParent, TL("Junction")) {67// Create frame for junction ID68FXHorizontalFrame* junctionIDFrame = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);69// create label70new FXLabel(junctionIDFrame, TL("Edited"), nullptr, GUIDesignLabelThickedFixed(100));71// create text field and disable it72myTextFieldJunctionID = new FXTextField(junctionIDFrame, GUIDesignTextFieldNCol, this, MID_GNE_SELECT, GUIDesignTextField);73myTextFieldJunctionID->disable();74}757677GNECrossingFrame::JunctionInformation::~JunctionInformation() {}787980void81GNECrossingFrame::JunctionInformation::updateCurrentJunctionLabel(const std::string& junctionID) {82if (junctionID.empty()) {83myTextFieldJunctionID->setText("");84} else {85myTextFieldJunctionID->setText(junctionID.c_str());86}87}8889// ---------------------------------------------------------------------------90// GNECrossingFrame::EdgesSelector - methods91// ---------------------------------------------------------------------------9293GNECrossingFrame::EdgesSelector::EdgesSelector(GNECrossingFrame* crossingFrameParent) :94MFXGroupBoxModule(crossingFrameParent, TL("selection of edges")),95myCrossingFrameParent(crossingFrameParent),96myCurrentJunction(nullptr) {9798// Create button for selected edges99myUseSelectedEdges = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Use selected edges"), "", "", nullptr, this, MID_GNE_USESELECTED, GUIDesignButton);100101// Create button for clear selection102myClearEdgesSelection = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Clear edges"), "", "", nullptr, this, MID_GNE_CLEARSELECTION, GUIDesignButton);103}104105106GNECrossingFrame::EdgesSelector::~EdgesSelector() {}107108109GNEJunction*110GNECrossingFrame::EdgesSelector::getCurrentJunction() const {111return myCurrentJunction;112}113114115void116GNECrossingFrame::EdgesSelector::enableEdgeSelector(GNEJunction* currentJunction) {117// restore color of all lanes of edge candidates118restoreEdgeColors();119// Set current junction120myCurrentJunction = currentJunction;121// Update view net to show the new colors122myCrossingFrameParent->getViewNet()->updateViewNet();123// check if use selected eges must be enabled124myUseSelectedEdges->disable();125for (const auto& edge : myCurrentJunction->getChildEdges()) {126if (edge->isAttributeCarrierSelected()) {127myUseSelectedEdges->enable();128}129}130// Enable rest of elements131myClearEdgesSelection->enable();132}133134135void136GNECrossingFrame::EdgesSelector::disableEdgeSelector() {137// disable current junction138myCurrentJunction = nullptr;139// disable all elements of the EdgesSelector140myUseSelectedEdges->disable();141myClearEdgesSelection->disable();142// Disable crossing parameters143myCrossingFrameParent->myCrossingParameters->disableCrossingParameters();144// Update view net to show the new colors145myCrossingFrameParent->getViewNet()->updateViewNet();146}147148149void150GNECrossingFrame::EdgesSelector::restoreEdgeColors() {151if (myCurrentJunction != nullptr) {152// restore color of all lanes of edge candidates153for (const auto& edge : myCurrentJunction->getChildEdges()) {154edge->resetCandidateFlags();155}156// Update view net to show the new colors157myCrossingFrameParent->getViewNet()->updateViewNet();158myCurrentJunction = nullptr;159}160}161162163long164GNECrossingFrame::EdgesSelector::onCmdUseSelectedEdges(FXObject*, FXSelector, void*) {165myCrossingFrameParent->myCrossingParameters->useSelectedEdges(myCurrentJunction);166return 1;167}168169170long171GNECrossingFrame::EdgesSelector::onCmdClearSelection(FXObject*, FXSelector, void*) {172myCrossingFrameParent->myCrossingParameters->clearEdges();173return 1;174}175176// ---------------------------------------------------------------------------177// GNECrossingFrame::GNENeteditAttributes- methods178// ---------------------------------------------------------------------------179180GNECrossingFrame::CrossingParameters::CrossingParameters(GNECrossingFrame* crossingFrameParent) :181MFXGroupBoxModule(crossingFrameParent, TL("Crossing parameters")),182myCrossingFrameParent(crossingFrameParent),183myCurrentParametersValid(true) {184FXHorizontalFrame* crossingParameter = nullptr;185// create label and string textField for edges186crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);187myCrossingEdgesLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_EDGES).c_str(), nullptr, GUIDesignLabelThickedFixed(100));188myCrossingEdges = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);189myCrossingEdgesLabel->disable();190myCrossingEdges->disable();191// create label and checkbox for Priority192crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);193myCrossingPriorityLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_PRIORITY).c_str(), nullptr, GUIDesignLabelThickedFixed(100));194myCrossingPriorityCheckButton = new FXCheckButton(crossingParameter, "", this, MID_GNE_SET_ATTRIBUTE, GUIDesignCheckButton);195myCrossingPriorityLabel->disable();196myCrossingPriorityCheckButton->disable();197// create label and textfield for width198crossingParameter = new FXHorizontalFrame(getCollapsableFrame(), GUIDesignAuxiliarHorizontalFrame);199myCrossingWidthLabel = new FXLabel(crossingParameter, toString(SUMO_ATTR_WIDTH).c_str(), nullptr, GUIDesignLabelThickedFixed(100));200myCrossingWidth = new FXTextField(crossingParameter, GUIDesignTextFieldNCol, this, MID_GNE_SET_ATTRIBUTE, GUIDesignTextField);201myCrossingWidthLabel->disable();202myCrossingWidth->disable();203// Create help button204myHelpCrossingAttribute = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Help"), "", "", nullptr, this, MID_HELP, GUIDesignButtonRectangular);205myHelpCrossingAttribute->disable();206}207208209GNECrossingFrame::CrossingParameters::~CrossingParameters() {210}211212213void214GNECrossingFrame::CrossingParameters::enableCrossingParameters(bool hasTLS) {215// obtain Tag Values216const auto crossingTagProperties = myCrossingFrameParent->getViewNet()->getNet()->getACTemplates()->getTemplateAC(SUMO_TAG_CROSSING)->getTagProperty();217// Enable all elements of the crossing frames218myCrossingEdgesLabel->enable();219myCrossingEdges->enable();220myCrossingPriorityLabel->enable();221// only enable priority check button if junction's crossing doesn't have TLS222if (hasTLS) {223myCrossingPriorityCheckButton->disable();224} else {225myCrossingPriorityCheckButton->enable();226}227myCrossingWidthLabel->enable();228myCrossingWidth->enable();229myHelpCrossingAttribute->enable();230// set values of parameters231onCmdSetAttribute(nullptr, 0, nullptr);232// Crossings placed in junctinos with TLS always has priority233if (hasTLS) {234myCrossingPriorityCheckButton->setCheck(TRUE);235} else {236myCrossingPriorityCheckButton->setCheck(crossingTagProperties->getDefaultBoolValue(SUMO_ATTR_PRIORITY));237}238myCrossingWidth->setText(crossingTagProperties->getDefaultStringValue(SUMO_ATTR_WIDTH).c_str());239myCrossingWidth->setTextColor(GUIDesignTextColorBlack);240}241242243void244GNECrossingFrame::CrossingParameters::disableCrossingParameters() {245// clear all values of parameters246myCrossingEdges->setText("");247myCrossingPriorityCheckButton->setCheck(false);248myCrossingPriorityCheckButton->setText("false");249myCrossingWidth->setText("");250// Disable all elements of the crossing frames251myCrossingEdgesLabel->disable();252myCrossingEdges->disable();253myCrossingPriorityLabel->disable();254myCrossingPriorityCheckButton->disable();255myCrossingWidthLabel->disable();256myCrossingWidth->disable();257myHelpCrossingAttribute->disable();258myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(false);259}260261262bool263GNECrossingFrame::CrossingParameters::isCrossingParametersEnabled() const {264return myCrossingEdgesLabel->isEnabled();265}266267268void269GNECrossingFrame::CrossingParameters::markEdge(GNEEdge* edge) {270GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();271if (currentJunction != nullptr) {272// Check if edge belongs to junction's edge273if (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) != currentJunction->getChildEdges().end()) {274// Update text field with the new edge275std::vector<std::string> crossingEdges = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());276// Check if new edge must be added or removed277std::vector<std::string>::iterator itFinder = std::find(crossingEdges.begin(), crossingEdges.end(), edge->getID());278if (itFinder == crossingEdges.end()) {279crossingEdges.push_back(edge->getID());280} else {281crossingEdges.erase(itFinder);282}283myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());284}285// Update colors and attributes286onCmdSetAttribute(nullptr, 0, nullptr);287}288}289290291void292GNECrossingFrame::CrossingParameters::clearEdges() {293myCrossingEdges->setText("");294// Update colors and attributes295onCmdSetAttribute(nullptr, 0, nullptr);296}297298299void300GNECrossingFrame::CrossingParameters::useSelectedEdges(GNEJunction* parentJunction) {301std::vector<std::string> crossingEdges;302for (const auto& edge : parentJunction->getChildEdges()) {303if (edge->isAttributeCarrierSelected()) {304crossingEdges.push_back(edge->getID());305}306}307myCrossingEdges->setText(joinToString(crossingEdges, " ").c_str());308// Update colors and attributes309onCmdSetAttribute(nullptr, 0, nullptr);310}311312313std::vector<NBEdge*>314GNECrossingFrame::CrossingParameters::getCrossingEdges() const {315std::vector<NBEdge*> NBEdgeVector;316// Iterate over myCurrentSelectedEdges317for (const auto& edge : myCurrentSelectedEdges) {318NBEdgeVector.push_back(edge->getNBEdge());319}320return NBEdgeVector;321}322323324bool325GNECrossingFrame::CrossingParameters::getCrossingPriority() const {326if (myCrossingPriorityCheckButton->getCheck()) {327return true;328} else {329return false;330}331}332333334bool335GNECrossingFrame::CrossingParameters::isCurrentParametersValid() const {336return myCurrentParametersValid;337}338339340double341GNECrossingFrame::CrossingParameters::getCrossingWidth() const {342return GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text());343}344345346long347GNECrossingFrame::CrossingParameters::onCmdSetAttribute(FXObject*, FXSelector, void*) {348myCurrentParametersValid = true;349// get string vector with the edges350const auto& crossingEdgeIDs = GNEAttributeCarrier::parse<std::vector<std::string> > (myCrossingEdges->getText().text());351GNEJunction* currentJunction = myCrossingFrameParent->myEdgeSelector->getCurrentJunction();352// Clear selected edges353myCurrentSelectedEdges.clear();354// iterate over vector of edge IDs355for (const auto& crossingEdgeID : crossingEdgeIDs) {356GNEEdge* edge = myCrossingFrameParent->getViewNet()->getNet()->getAttributeCarriers()->retrieveEdge(crossingEdgeID, false);357// Check that edge exists and belongs to Junction358if (edge == nullptr) {359myCurrentParametersValid = false;360} else if (currentJunction && (std::find(currentJunction->getChildEdges().begin(), currentJunction->getChildEdges().end(), edge) == currentJunction->getChildEdges().end())) {361myCurrentParametersValid = false;362} else {363// select or unselected edge364auto itFinder = std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge);365if (itFinder == myCurrentSelectedEdges.end()) {366myCurrentSelectedEdges.push_back(edge);367} else {368myCurrentSelectedEdges.erase(itFinder);369}370}371}372// change color of textfield dependig of myCurrentParametersValid373if (myCurrentParametersValid) {374myCrossingEdges->setTextColor(GUIDesignTextColorBlack);375myCrossingEdges->killFocus();376} else {377myCrossingEdges->setTextColor(GUIDesignTextColorRed);378myCurrentParametersValid = false;379}380// Update edge colors381if (currentJunction) {382if (myCurrentSelectedEdges.empty()) {383for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {384// restore colors385edge->resetCandidateFlags();386// mark all edges as possible candidate387edge->setPossibleCandidate(true);388}389} else {390EdgeVector selected;391for (GNEEdge* e : myCurrentSelectedEdges) {392selected.push_back(e->getNBEdge());393}394for (const auto& edge : myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getChildEdges()) {395// restore colors396edge->resetCandidateFlags();397// set selected or candidate color398if (std::find(myCurrentSelectedEdges.begin(), myCurrentSelectedEdges.end(), edge) != myCurrentSelectedEdges.end()) {399edge->setTargetCandidate(true);400} else {401EdgeVector newCandidates = selected;;402newCandidates.push_back(edge->getNBEdge());403if (currentJunction->getNBNode()->checkCrossing(newCandidates, true) == 0) {404edge->setInvalidCandidate(true);405} else {406edge->setPossibleCandidate(true);407}408}409}410}411}412// Update view net413myCrossingFrameParent->getViewNet()->updateViewNet();414// Check that at least there are one selected edge415if (crossingEdgeIDs.empty()) {416myCurrentParametersValid = false;417}418// change label of crossing priority419if (myCrossingPriorityCheckButton->getCheck()) {420myCrossingPriorityCheckButton->setText("true");421} else {422myCrossingPriorityCheckButton->setText("false");423}424425// Check width426if (GNEAttributeCarrier::canParse<double>(myCrossingWidth->getText().text()) &&427GNEAttributeCarrier::parse<double>(myCrossingWidth->getText().text()) > 0) {428myCrossingWidth->setTextColor(GUIDesignTextColorBlack);429myCrossingWidth->killFocus();430} else {431myCrossingWidth->setTextColor(GUIDesignTextColorRed);432myCurrentParametersValid = false;433}434435// Enable or disable create crossing button depending of the current parameters436myCrossingFrameParent->myCreateCrossing->setCreateCrossingButton(myCurrentParametersValid);437return 0;438}439440441long442GNECrossingFrame::CrossingParameters::onCmdHelp(FXObject*, FXSelector, void*) {443return 1;444}445446// ---------------------------------------------------------------------------447// GNECrossingFrame::CreateCrossing - methods448// ---------------------------------------------------------------------------449450GNECrossingFrame::CreateCrossing::CreateCrossing(GNECrossingFrame* crossingFrameParent) :451MFXGroupBoxModule(crossingFrameParent, TL("Create")),452myCrossingFrameParent(crossingFrameParent) {453// Create groupbox for create crossings454myCreateCrossingButton = GUIDesigns::buildFXButton(getCollapsableFrame(), TL("Create crossing"), "", "", 0, this, MID_GNE_CREATE, GUIDesignButton);455myCreateCrossingButton->disable();456}457458459GNECrossingFrame::CreateCrossing::~CreateCrossing() {}460461462long463GNECrossingFrame::CreateCrossing::onCmdCreateCrossing(FXObject*, FXSelector, void*) {464// First check that current parameters are valid465if (myCrossingFrameParent->myCrossingParameters->isCurrentParametersValid()) {466// iterate over junction's crossing to find duplicated crossings467if (myCrossingFrameParent->myEdgeSelector->getCurrentJunction()->getNBNode()->checkCrossingDuplicated(myCrossingFrameParent->myCrossingParameters->getCrossingEdges()) == false) {468// create new crossing469myCrossingFrameParent->myViewNet->getUndoList()->add(new GNEChange_Crossing(myCrossingFrameParent->myEdgeSelector->getCurrentJunction(),470myCrossingFrameParent->myCrossingParameters->getCrossingEdges(),471myCrossingFrameParent->myCrossingParameters->getCrossingWidth(),472myCrossingFrameParent->myCrossingParameters->getCrossingPriority(),473-1, -1,474PositionVector::EMPTY,475false, true), true);476// clear selected edges477myCrossingFrameParent->myEdgeSelector->onCmdClearSelection(0, 0, 0);478// update default create edge option479myCrossingFrameParent->getViewNet()->getViewParent()->getCreateEdgeFrame()->getEdgeTypeSelector()->enableCheckBoxDisablePedestrians();480} else {481WRITE_WARNING(TL("There is already another crossing with the same edges in the junction; Duplicated crossing aren't allowed."));482}483}484return 1;485}486487488void489GNECrossingFrame::CreateCrossing::setCreateCrossingButton(bool value) {490if (value) {491myCreateCrossingButton->enable();492} else {493myCreateCrossingButton->disable();494}495}496497// ---------------------------------------------------------------------------498// GNECrossingFrame::Legend - methods499// ---------------------------------------------------------------------------500501GNECrossingFrame::Information::Information(GNECrossingFrame* crossingFrameParent) :502MFXGroupBoxModule(crossingFrameParent, TL("Information")) {503504// create label505new MFXDynamicLabel(getCollapsableFrame(), (std::string("- ") + TL("Click over junction to mark candidate edges.") + std::string("\n- ") + TL("Click over candidate edges for selecting.")).c_str(), 0, GUIDesignLabelFrameInformation);506// candidate507FXLabel* colorCandidateLabel = new FXLabel(getCollapsableFrame(), TL(" Candidate"), 0, GUIDesignLabel(JUSTIFY_LEFT));508colorCandidateLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.possible));509colorCandidateLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));510// selected511FXLabel* colorSelectedLabel = new FXLabel(getCollapsableFrame(), TL(" Selected"), 0, GUIDesignLabel(JUSTIFY_LEFT));512colorSelectedLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.target));513// invalid514FXLabel* colorInvalidLabel = new FXLabel(getCollapsableFrame(), TL(" Invalid"), 0, GUIDesignLabel(JUSTIFY_LEFT));515colorInvalidLabel->setBackColor(MFXUtils::getFXColor(crossingFrameParent->getViewNet()->getVisualisationSettings().candidateColorSettings.invalid));516colorInvalidLabel->setTextColor(MFXUtils::getFXColor(RGBColor::WHITE));517}518519520GNECrossingFrame::Information::~Information() {}521522// ---------------------------------------------------------------------------523// GNECrossingFrame - methods524// ---------------------------------------------------------------------------525526GNECrossingFrame::GNECrossingFrame(GNEViewParent* viewParent, GNEViewNet* viewNet) :527GNEFrame(viewParent, viewNet, TL("Crossings")) {528// create JunctionInformation module529myJunctionInformation = new JunctionInformation(this);530531// Create edge Selector module532myEdgeSelector = new EdgesSelector(this);533534// Create CrossingParameters module535myCrossingParameters = new CrossingParameters(this);536537// create CreateCrossing module538myCreateCrossing = new CreateCrossing(this);539540// create information module541myInformation = new Information(this);542543// disable edge selector544myEdgeSelector->disableEdgeSelector();545}546547548GNECrossingFrame::~GNECrossingFrame() {549}550551552void553GNECrossingFrame::hide() {554// restore color of all lanes of edge candidates555myEdgeSelector->restoreEdgeColors();556// hide frame557GNEFrame::hide();558}559560561void562GNECrossingFrame::addCrossing(const GNEViewNetHelper::ViewObjectsSelector& viewObjects) {563// If current element is a junction564if (viewObjects.getJunctionFront() && (viewObjects.getAttributeCarriers().front() == viewObjects.getJunctionFront())) {565// change label566myJunctionInformation->updateCurrentJunctionLabel(viewObjects.getJunctionFront()->getID());567// Enable edge selector and crossing parameters568myEdgeSelector->enableEdgeSelector(viewObjects.getJunctionFront());569myCrossingParameters->enableCrossingParameters(viewObjects.getJunctionFront()->getNBNode()->isTLControlled());570// clears selected edges571myCrossingParameters->clearEdges();572} else if (viewObjects.getEdgeFront()) {573// check if mark edge574if (!viewObjects.getEdgeFront()->isInvalidCandidate()) {575myCrossingParameters->markEdge(viewObjects.getEdgeFront());576}577} else {578// set default label579myJunctionInformation->updateCurrentJunctionLabel("");580// restore color of all lanes of edge candidates581myEdgeSelector->restoreEdgeColors();582// Disable edge selector583myEdgeSelector->disableEdgeSelector();584}585// always update view after an operation586myViewNet->updateViewNet();587}588589590void591GNECrossingFrame::createCrossingHotkey() {592if (myEdgeSelector->getCurrentJunction()) {593// simply call onCmdCreateCrossing of CreateCrossing module594myCreateCrossing->onCmdCreateCrossing(0, 0, 0);595}596}597598599void600GNECrossingFrame::clearEdgesHotkey() {601if (myCrossingParameters->getCrossingEdges().size() > 0) {602myCrossingParameters->clearEdges();603} else if (myEdgeSelector->getCurrentJunction()) {604myEdgeSelector->restoreEdgeColors();605myEdgeSelector->disableEdgeSelector();606}607}608609610GNECrossingFrame::EdgesSelector*611GNECrossingFrame::getEdgesSelector() const {612return myEdgeSelector;613}614615/****************************************************************************/616617618