Path: blob/main/src/netedit/elements/demand/GNEPlanParents.h
185833 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 GNEPlanParents.h14/// @author Pablo Alvarez Lopez15/// @date Aug 202416///17// Builds demand objects for netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/frames/GNEPathCreator.h>23#include <netedit/frames/GNEPlanCreator.h>24#include <netedit/GNENetHelper.h>25#include <utils/common/SUMOVehicleClass.h>26#include <utils/vehicle/SUMORouteHandler.h>27#include <utils/xml/SUMOSAXAttributes.h>28#include <utils/xml/SUMOSAXHandler.h>29#include <utils/xml/SUMOXMLDefinitions.h>30#include <utils/handlers/RouteHandler.h>3132// ===========================================================================33// class declarations34// ===========================================================================3536class GNEViewNet;37class GNEEdge;38class GNETAZ;39class GNEDemandElement;40class GNEVehicle;41class GNEPerson;42class GNEContainer;43class GNEUndoList;4445// ===========================================================================46// class definitions47// ===========================================================================4849/// @brief GNEPlanParents (used for group all plan parents)50class GNEPlanParents {5152public:53/// @brief default constructor54GNEPlanParents();5556/// @brief constructor for parsing the parameters from SUMOSAXAttributes57GNEPlanParents(const CommonXMLStructure::PlanParameters& planParameters,58const GNENetHelper::AttributeCarriers* ACs);5960/// @brief check integrity between planParameters and GNE elements61bool checkIntegrity(SumoXMLTag planTag, const GNEDemandElement* parent,62const CommonXMLStructure::PlanParameters& planParameters) const;6364/// @brief add the given demand element in the element as child65void addDemandElementChild(GNEDemandElement* element);6667/// @brief clear elements68void clear();6970/// @name functions for checking stopping places71/// @{72/// @brief get from busStop73bool getFromBusStop() const;7475/// @brief get to busStop76bool getToBusStop() const;7778/// @brief get from trainStop79bool getFromTrainStop() const;8081/// @brief get to trainStop82bool getToTrainStop() const;8384/// @brief get from containerStop85bool getFromContainerStop() const;8687/// @brief get to containerStop88bool getToContainerStop() const;8990/// @brief get from chargingStation91bool getFromChargingStation() const;9293/// @brief get to chargingStation94bool getToChargingStation() const;9596/// @brief get from parkingArea97bool getFromParkingArea() const;9899/// @brief get to parkingArea100bool getToParkingArea() const;101102/// @}103104/// @brief get junctions (used in plan constructors)105std::vector<GNEJunction*> getJunctions() const;106107/// @brief get edges (used in plan constructors)108std::vector<GNEEdge*> getEdges() const;109110/// @brief get additionalElements (used in plan constructors)111std::vector<GNEAdditional*> getAdditionalElements() const;112113/// @brief get demand elements (used in plan constructors)114std::vector<GNEDemandElement*> getDemandElements(GNEDemandElement* parent) const;115116/// @brief from edge117GNEEdge* fromEdge = nullptr;118119/// @brief to edge120GNEEdge* toEdge = nullptr;121122/// @brief edges123std::vector<GNEEdge*> consecutiveEdges;124125/// @brief from junction126GNEJunction* fromJunction = nullptr;127128/// @brief to junction129GNEJunction* toJunction = nullptr;130131/// @brief from TAZ132GNEAdditional* fromTAZ = nullptr;133134/// @brief to TAZ135GNEAdditional* toTAZ = nullptr;136137/// @brief from stoppingPlace138GNEAdditional* fromStoppingPlace = nullptr;139140/// @brief to stoppingPlace141GNEAdditional* toStoppingPlace = nullptr;142143/// @brief from route (currently only used by walks)144GNEDemandElement* fromRoute = nullptr;145146/// @brief to route (currently only used by walks)147GNEDemandElement* toRoute = nullptr;148};149150151