Path: blob/main/src/netedit/frames/demand/GNEVehicleFrame.h
193784 views
/****************************************************************************/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 GNEVehicleFrame.h14/// @author Pablo Alvarez Lopez15/// @date Jan 201816///17// The Widget for add Vehicles/Flows/Trips/etc. elements18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/frames/GNEFrame.h>23#include <netedit/frames/common/GNEGroupBoxModule.h>2425// ===========================================================================26// class declaration27// ===========================================================================2829class MFXDynamicLabel;30class GNEAttributesEditor;31class GNEDemandElementSelector;32class GNETagSelector;33class GNEPathLegendModule;34class GNEPathCreator;3536// ===========================================================================37// class definitions38// ===========================================================================3940class GNEVehicleFrame : public GNEFrame {4142public:4344// ===========================================================================45// class HelpCreation46// ===========================================================================4748class HelpCreation : public GNEGroupBoxModule {4950public:51/// @brief constructor52HelpCreation(GNEVehicleFrame* vehicleFrameParent);5354/// @brief destructor55~HelpCreation();5657/// @brief show HelpCreation58void showHelpCreation();5960/// @brief hide HelpCreation61void hideHelpCreation();6263/// @brief update HelpCreation64void updateHelpCreation();6566private:67/// @brief pointer to Vehicle Frame Parent68GNEVehicleFrame* myVehicleFrameParent;6970/// @brief Label with creation information71MFXDynamicLabel* myInformationLabel;72};7374/**@brief Constructor75* @brief viewParent GNEViewParent in which this GNEFrame is placed76* @brief viewNet viewNet that uses this GNEFrame77*/78GNEVehicleFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);7980/// @brief Destructor81~GNEVehicleFrame();8283/// @brief show Frame84void show();8586/// @brief hide Frame87void hide();8889/**@brief add vehicle element90* @param viewObjects collection of objects under cursor after click over view91* @param mouseButtonKeyPressed key pressed during click92* @return true if element was successfully added93*/94bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector& viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);9596/// @brief get vehicle tag selector (needed for transform vehicles)97GNETagSelector* getVehicleTagSelector() const;9899/// @brief getVehicle Type selectors100GNEDemandElementSelector* getTypeSelector() const;101102/// @brief get GNEPathCreator module103GNEPathCreator* getPathCreator() const;104105/// @brief get attributes creator106GNEAttributesEditor* getVehicleAttributesEditor() const;107108protected:109/// @brief Tag selected in GNETagSelector110void tagSelected();111112/// @brief selected vehicle type in DemandElementSelector113void demandElementSelected();114115/// @brief create path116bool createPath(const bool useLastRoute);117118/// @brief build vehicle over route119bool buildVehicleOverRoute(SumoXMLTag vehicleTag, GNEDemandElement* route);120121/// @brief update flow attributes122void updateFlowAttributes();123124private:125/// @brief vehicle base object126CommonXMLStructure::SumoBaseObject* myVehicleBaseObject = nullptr;127128/// @brief vehicle tag selector (used to select diffent kind of vehicles)129GNETagSelector* myVehicleTagSelector = nullptr;130131/// @brief Vehicle Type selectors132GNEDemandElementSelector* myTypeSelector = nullptr;133134/// @brief attributes editor135GNEAttributesEditor* myVehicleAttributesEditor = nullptr;136137/// @brief edge path creator (used for trips and flows)138GNEPathCreator* myPathCreator = nullptr;139140/// @brief Help creation141HelpCreation* myHelpCreation = nullptr;142143/// @brief path legend modul144GNEPathLegendModule* myPathLegend = nullptr;145};146147148