Path: blob/main/src/netedit/elements/demand/GNERouteDistribution.h
185851 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 GNERouteDistribution.h14/// @author Pablo Alvarez Lopez15/// @date Jan 202216///17// Route distribution used in netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEDemandElement.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNERouteDistribution : public GNEDemandElement {2930public:31/// @brief default constructor32GNERouteDistribution(GNENet* net);3334/// @brief parameter constructor35GNERouteDistribution(const std::string& ID, GNENet* net, FileBucket* fileBucket);3637/// @brief destructor38~GNERouteDistribution();3940/// @brief methods to retrieve the elements linked to this routeDistribution41/// @{4243/// @brief get GNEMoveElement associated with this routeDistribution44GNEMoveElement* getMoveElement() const override;4546/// @brief get parameters associated with this routeDistribution47Parameterised* getParameters() override;4849/// @brief get parameters associated with this routeDistribution (constant)50const Parameterised* getParameters() const override;5152/// @}5354/**@brief write demand element element into a xml file55* @param[in] device device in which write parameters of demand element element56*/57void writeDemandElement(OutputDevice& device) const override;5859/// @brief check if current demand element is valid to be written into XML60Problem isDemandElementValid() const override;6162/// @brief return a string with the current demand element problem63std::string getDemandElementProblem() const override;6465/// @brief fix demand element problem66void fixDemandElementProblem() override;6768/// @name members and functions relative to elements common to all demand elements69/// @{70/// @brief obtain VClass related with this demand element71SUMOVehicleClass getVClass() const override;7273/// @brief get color74const RGBColor& getColor() const override;7576/// @}7778/// @name Functions related with geometry of element79/// @{80/// @brief update pre-computed geometry information81void updateGeometry() override;8283/// @brief Returns position of additional in view84Position getPositionInView() const override;85/// @}8687/// @name inherited from GUIGlObject88/// @{89/**@brief Returns the name of the parent object90* @return This object's parent id91*/92std::string getParentName() const override;9394/**@brief Returns the boundary to which the view shall be centered in order to show the object95* @return The boundary the object is within96*/97Boundary getCenteringBoundary() const override;9899/// @brief split geometry100void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;101102/**@brief Draws the object103* @param[in] s The settings for the current view (may influence drawing)104* @see GUIGlObject::drawGL105*/106void drawGL(const GUIVisualizationSettings& s) const override;107108/// @}109110/// @name inherited from GNEPathElement111/// @{112113/// @brief compute pathElement114void computePathElement() override;115116/**@brief Draws partial object over lane117* @param[in] s The settings for the current view (may influence drawing)118* @param[in] segment lane segment119* @param[in] offsetFront front offset120*/121void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;122123/**@brief Draws partial object over junction124* @param[in] s The settings for the current view (may influence drawing)125* @param[in] segment junction segment126* @param[in] offsetFront front offset127*/128void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;129130/// @brief get first path lane131GNELane* getFirstPathLane() const override;132133/// @brief get last path lane134GNELane* getLastPathLane() const override;135/// @}136137/// @brief inherited from GNEAttributeCarrier138/// @{139/* @brief method for getting the Attribute of an XML key140* @param[in] key The attribute key141* @return string with the value associated to key142*/143std::string getAttribute(SumoXMLAttr key) const override;144145/* @brief method for getting the Attribute of an XML key in double format146* @param[in] key The attribute key147* @return double with the value associated to key148*/149double getAttributeDouble(SumoXMLAttr key) const override;150151/* @brief method for getting the Attribute of an XML key in position format152* @param[in] key The attribute key153* @return position with the value associated to key154*/155Position getAttributePosition(SumoXMLAttr key) const override;156157/* @brief method for setting the attribute and letting the object perform additional changes158* @param[in] key The attribute key159* @param[in] value The new value160* @param[in] undoList The undoList on which to register changes161* @param[in] net optionally the GNENet to inform about gui updates162*/163void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;164165/* @brief method for setting the attribute and letting the object perform additional changes166* @param[in] key The attribute key167* @param[in] value The new value168* @param[in] undoList The undoList on which to register changes169*/170bool isValid(SumoXMLAttr key, const std::string& value) override;171172/// @brief get PopPup ID (Used in AC Hierarchy)173std::string getPopUpID() const override;174175/// @brief get Hierarchy Name (Used in AC Hierarchy)176std::string getHierarchyName() const override;177/// @}178179private:180/// @brief method for setting the attribute and nothing else181void setAttribute(SumoXMLAttr key, const std::string& value) override;182183/// @brief Invalidated copy constructor.184GNERouteDistribution(GNERouteDistribution*) = delete;185186/// @brief Invalidated assignment operator187GNERouteDistribution* operator=(GNERouteDistribution*) = delete;188};189190191