/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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 GNEVClassesDialog.h14/// @author Pablo Alvarez Lopez15/// @date Feb 201716///17// Dialog for edit allow VClass attribute18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/common/SUMOVehicleClass.h>2324#include "GNEDialog.h"2526// ===========================================================================27// class definitions28// ===========================================================================2930class GNEAttributeCarrier;3132// ===========================================================================33// class definitions34// ===========================================================================3536class GNEVClassesDialog : public GNEDialog {37/// @brief FOX-declaration38FXDECLARE(GNEVClassesDialog)3940public:41/// @brief vclass row42class VClassRow : protected FXHorizontalFrame {43/// @brief FOX-declaration44FXDECLARE(VClassRow)4546public:47/// @brief Constructor48VClassRow(FXVerticalFrame* contentsFrame, SUMOVehicleClass vClass,49GUIIcon vClassIcon, const std::string& description);5051/// @brief destructor52~VClassRow();5354/// @brief get vclass in string format55const std::string& getVClassString() const;5657/// @brief set vClass button status58void setVClassButtonStatus(const bool enabled);5960/// @brief check if vClass button is enabled61bool isVClassButtonEnabled() const;6263/// @name FOX-callbacks64/// @{6566/// @brief event when user toogle the vClass button67long onCmdToggleVClass(FXObject*, FXSelector, void*);6869/// @}7071protected:72/// @brief FOX need this73FOX_CONSTRUCTOR(VClassRow)7475/// @brief vclass button76FXButton* myVClassButton = nullptr;7778/// @brief vclass in string format79const std::string myVClassString;8081private:82/// @brief Invalidated copy constructor.83VClassRow(const VClassRow&) = delete;8485/// @brief Invalidated assignment operator.86VClassRow& operator=(const VClassRow&) = delete;87};8889/// @brief Constructor90GNEVClassesDialog(GNEApplicationWindow* applicationWindow, SumoXMLAttr attr,91const std::string originalVClasses);9293/// @brief Constructor with parent dialog94GNEVClassesDialog(GNEApplicationWindow* applicationWindow, GNEDialog* parentDialog,95SumoXMLAttr attr, const std::string originalVClasses);9697/// @brief destructor98~GNEVClassesDialog();99100/// @brief run internal test101void runInternalTest(const InternalTestStep::DialogArgument* dialogArgument);102103/// @brief get vClasses modified by this dialog104std::string getModifiedVClasses() const;105106/// @name FOX-callbacks107/// @{108109/// @brief event when user press select all VClasses button110long onCmdSelectAll(FXObject*, FXSelector, void*);111112/// @brief event when user press unselect all VClasses button113long onCmdUnselectAll(FXObject*, FXSelector, void*);114115/// @brief event when user press select only road button116long onCmdSelectOnlyRoad(FXObject*, FXSelector, void*);117118/// @brief event when user press select only rail button119long onCmdSelectOnlyRail(FXObject*, FXSelector, void*);120121/// @brief event after press accept button122long onCmdAccept(FXObject*, FXSelector, void*);123124/// @brief event after press cancel button125long onCmdCancel(FXObject*, FXSelector, void*);126127/// @brief event after press reset button128long onCmdReset(FXObject*, FXSelector, void*);129130/// @}131132protected:133/// @brief FOX need this134FOX_CONSTRUCTOR(GNEVClassesDialog)135136/// @brief original vClasses (used for reset)137const std::string myOriginalVClasses;138139/// @brief edited vClasses140std::string myEditedVClasses;141142/// @brief map with the buttons for every VClass143std::map<SUMOVehicleClass, VClassRow* > myVClassMap;144145private:146/// @brief builder147void builder();148149/// @brief Invalidated copy constructor.150GNEVClassesDialog(const GNEVClassesDialog&) = delete;151152/// @brief Invalidated assignment operator.153GNEVClassesDialog& operator=(const GNEVClassesDialog&) = delete;154};155156157