/****************************************************************************/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 GNEEdgeData.h14/// @author Pablo Alvarez Lopez15/// @date Jan 202016///17// class for edge data18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEGenericData.h"2324// ===========================================================================25// class definitions26// ===========================================================================27/**28* @class GNEEdgeData29* @brief An Element which don't belong to GNENet but has influence in the simulation30*/31class GNEEdgeData : public GNEGenericData {3233public:34/// @brief default Constructor35GNEEdgeData(GNENet* net);3637/**@brief Constructor38* @param[in] dataIntervalParent pointer to data interval parent39* @param[in] edge pointer to Edge parent40* @param[in] parameters parameters map41*/42GNEEdgeData(GNEDataInterval* dataIntervalParent, GNEEdge* edge, const Parameterised::Map& parameters);4344/// @brief Destructor45~GNEEdgeData();4647/// @brief get edge data color48RGBColor setColor(const GUIVisualizationSettings& s) const;4950double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;5152/// @brief check if current edge data is visible53bool isGenericDataVisible() const;5455/// @brief update pre-computed geometry information56void updateGeometry();5758/// @brief Returns element position in view59Position getPositionInView() const;6061/// @name members and functions relative to write data sets into XML62/// @{63/**@brief write data set element into a xml file64* @param[in] device device in which write parameters of data set element65*/66void writeGenericData(OutputDevice& device) const;6768/// @brief check if current data set is valid to be written into XML (by default true, can be reimplemented in children)69bool isGenericDataValid() const;7071/// @brief return a string with the current data set problem (by default empty, can be reimplemented in children)72std::string getGenericDataProblem() const;7374/// @brief fix data set problem (by default throw an exception, has to be reimplemented in children)75void fixGenericDataProblem();76/// @}7778/// @name inherited from GUIGlObject79/// @{8081/**@brief Draws the object82* @param[in] s The settings for the current view (may influence drawing)83* @see GUIGlObject::drawGL84*/85void drawGL(const GUIVisualizationSettings& s) const;8687//// @brief Returns the boundary to which the view shall be centered in order to show the object88Boundary getCenteringBoundary() const;8990/// @}9192/// @name inherited from GNEPathElement93/// @{9495/// @brief compute pathElement96void computePathElement();9798/**@brief Draws partial object over lane99* @param[in] s The settings for the current view (may influence drawing)100* @param[in] segment lane segment101* @param[in] offsetFront front offset102*/103void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;104105/**@brief Draws partial object over junction106* @param[in] s The settings for the current view (may influence drawing)107* @param[in] segment junction segment108* @param[in] offsetFront front offset109*/110void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;111112/// @brief get first path lane113GNELane* getFirstPathLane() const;114115/// @brief get last path lane116GNELane* getLastPathLane() const;117/// @}118119/// @name inherited from GNEAttributeCarrier120/// @{121/* @brief method for getting the Attribute of an XML key122* @param[in] key The attribute key123* @return string with the value associated to key124*/125std::string getAttribute(SumoXMLAttr key) const;126127/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)128* @param[in] key The attribute key129* @return double with the value associated to key130*/131double getAttributeDouble(SumoXMLAttr key) const;132133/**@brief method for setting the attribute and letting the object perform data set changes134* @param[in] key The attribute key135* @param[in] value The new value136* @param[in] undoList The undoList on which to register changes137*/138void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);139140/**@brief method for checking if the key and their conrrespond attribute are valids141* @param[in] key The attribute key142* @param[in] value The value associated to key key143* @return true if the value is valid, false in other case144*/145bool isValid(SumoXMLAttr key, const std::string& value);146147/* @brief method for check if the value for certain attribute is set148* @param[in] key The attribute key149*/150bool isAttributeEnabled(SumoXMLAttr key) const;151152/// @brief get PopPup ID (Used in AC Hierarchy)153std::string getPopUpID() const;154155/// @brief get Hierarchy Name (Used in AC Hierarchy)156std::string getHierarchyName() const;157/// @}158159private:160/// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute)161void setAttribute(SumoXMLAttr key, const std::string& value);162163/// @brief Invalidated copy constructor.164GNEEdgeData(const GNEEdgeData&) = delete;165166/// @brief Invalidated assignment operator.167GNEEdgeData& operator=(const GNEEdgeData&) = delete;168};169170/****************************************************************************/171172173