Path: blob/main/src/netedit/frames/demand/GNEVehicleFrame.h
169684 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 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>2324// ===========================================================================25// class declaration26// ===========================================================================2728class MFXDynamicLabel;29class GNEAttributesEditor;30class GNEDemandElementSelector;31class GNETagSelector;32class GNEPathLegendModule;33class GNEPathCreator;3435// ===========================================================================36// class definitions37// ===========================================================================3839class GNEVehicleFrame : public GNEFrame {4041public:4243// ===========================================================================44// class HelpCreation45// ===========================================================================4647class HelpCreation : public MFXGroupBoxModule {4849public:50/// @brief constructor51HelpCreation(GNEVehicleFrame* vehicleFrameParent);5253/// @brief destructor54~HelpCreation();5556/// @brief show HelpCreation57void showHelpCreation();5859/// @brief hide HelpCreation60void hideHelpCreation();6162/// @brief update HelpCreation63void updateHelpCreation();6465private:66/// @brief pointer to Vehicle Frame Parent67GNEVehicleFrame* myVehicleFrameParent;6869/// @brief Label with creation information70MFXDynamicLabel* myInformationLabel;71};7273/**@brief Constructor74* @brief viewParent GNEViewParent in which this GNEFrame is placed75* @brief viewNet viewNet that uses this GNEFrame76*/77GNEVehicleFrame(GNEViewParent* viewParent, GNEViewNet* viewNet);7879/// @brief Destructor80~GNEVehicleFrame();8182/// @brief show Frame83void show();8485/// @brief hide Frame86void hide();8788/**@brief add vehicle element89* @param viewObjects collection of objects under cursor after click over view90* @param mouseButtonKeyPressed key pressed during click91* @return true if element was successfully added92*/93bool addVehicle(const GNEViewNetHelper::ViewObjectsSelector& viewObjects, const GNEViewNetHelper::MouseButtonKeyPressed& mouseButtonKeyPressed);9495/// @brief get vehicle tag selector (needed for transform vehicles)96GNETagSelector* getVehicleTagSelector() const;9798/// @brief getVehicle Type selectors99GNEDemandElementSelector* getTypeSelector() const;100101/// @brief get GNEPathCreator module102GNEPathCreator* getPathCreator() const;103104/// @brief get attributes creator105GNEAttributesEditor* getVehicleAttributesEditor() const;106107protected:108/// @brief Tag selected in GNETagSelector109void tagSelected();110111/// @brief selected vehicle type in DemandElementSelector112void demandElementSelected();113114/// @brief create path115bool createPath(const bool useLastRoute);116117/// @brief build vehicle over route118bool buildVehicleOverRoute(SumoXMLTag vehicleTag, GNEDemandElement* route);119120/// @brief update flow attributes121void updateFlowAttributes();122123private:124/// @brief vehicle base object125CommonXMLStructure::SumoBaseObject* myVehicleBaseObject = nullptr;126127/// @brief vehicle tag selector (used to select diffent kind of vehicles)128GNETagSelector* myVehicleTagSelector = nullptr;129130/// @brief Vehicle Type selectors131GNEDemandElementSelector* myTypeSelector = nullptr;132133/// @brief attributes editor134GNEAttributesEditor* myVehicleAttributesEditor = nullptr;135136/// @brief edge path creator (used for trips and flows)137GNEPathCreator* myPathCreator = nullptr;138139/// @brief Help creation140HelpCreation* myHelpCreation = nullptr;141142/// @brief path legend modul143GNEPathLegendModule* myPathLegend = nullptr;144};145146147