Path: blob/main/src/netedit/frames/GNEConsecutiveSelector.h
169678 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 GNEConsecutiveSelector.h14/// @author Pablo Alvarez Lopez15/// @date Mar 202216///17// Consecutive lane selector module18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/foxtools/MFXGroupBoxModule.h>2324// ===========================================================================25// class declaration26// ===========================================================================2728class GNEFrame;29class GNELane;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEConsecutiveSelector : public MFXGroupBoxModule {36/// @brief FOX-declaration37FXDECLARE(GNEConsecutiveSelector)3839public:40/// @brief default constructor41GNEConsecutiveSelector(GNEFrame* frameParent, const bool allowOneLane);4243/// @brief destructor44~GNEConsecutiveSelector();4546/// @brief show GNEConsecutiveSelector47void showConsecutiveLaneSelectorModule();4849/// @brief show GNEConsecutiveSelector50void hideConsecutiveLaneSelectorModule();5152/// @brief get vector with lanes and clicked positions53const std::vector<std::pair<GNELane*, double> >& getLanePath() const;5455/// @brief get lane IDs56const std::vector<std::string> getLaneIDPath() const;5758/// @brief add lane59bool addLane(GNELane* lane);6061/// @brief draw candidate lanes with special color (Only for candidates, special and conflicted)62bool drawCandidateLanesWithSpecialColor() const;6364/// @brief update lane colors65void updateLaneColors();6667/// @brief draw temporal consecutive lane path68void drawTemporalConsecutiveLanePath() const;6970/// @brief abort path creation71void abortPathCreation();7273/// @brief remove path element74void removeLastElement();7576/// @name FOX-callbacks77/// @{78/// @brief Called when the user click over button "Finish route creation"79long onCmdCreatePath(FXObject*, FXSelector, void*);8081/// @brief Called when the user click over button "Abort route creation"82long onCmdAbortPathCreation(FXObject*, FXSelector, void*);8384/// @brief Called when the user click over button "Remove las inserted lane"85long onCmdRemoveLastElement(FXObject*, FXSelector, void*);8687/// @brief Called when the user click over check button "show candidate lanes"88long onCmdShowCandidateLanes(FXObject*, FXSelector, void*);89/// @}9091protected:92/// @brief FOX need this93GNEConsecutiveSelector();9495/// @brief update InfoRouteLabel96void updateInfoRouteLabel();9798/// @brief clear lanes (and restore colors)99void clearPath();100101private:102/// @brief pointer to frame parent103GNEFrame* myFrameParent;104105/// @brief vector with lanes and clicked positions106std::vector<std::pair<GNELane*, double> > myLanePath;107108/// @brief label with path info109FXLabel* myInfoPathLabel = nullptr;110111/// @brief button for finish route creation112FXButton* myFinishCreationButton = nullptr;113114/// @brief button for abort route creation115FXButton* myAbortCreationButton = nullptr;116117/// @brief button for removing last inserted element118FXButton* myRemoveLastInsertedElement = nullptr;119120/// @brief CheckBox for show candidate lanes121FXCheckButton* myShowCandidateLanes = nullptr;122123/// @brief allow one lane124const bool myAllowOneLane;125126private:127/// @brief Invalidated copy constructor.128GNEConsecutiveSelector(GNEConsecutiveSelector*) = delete;129130/// @brief Invalidated assignment operator.131GNEConsecutiveSelector& operator=(GNEConsecutiveSelector*) = delete;132};133134135