/****************************************************************************/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 GNEMeanData.h14/// @author Pablo Alvarez Lopez15/// @date Nov 202216///17// Class for representing MeanData18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/elements/GNEAttributeCarrier.h>23#include <netedit/elements/GNEHierarchicalElement.h>2425// ===========================================================================26// class definitions27// ===========================================================================2829class GNEMeanData : public GNEAttributeCarrier, public GNEHierarchicalElement, public Parameterised {3031public:32/// @brief Default constructor33GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, const std::string& filename);3435/// @brief Parameter constructor36GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, const std::string& filename, const std::string& file, const SUMOTime period,37const SUMOTime begin, const SUMOTime end, const bool trackVehicles, const std::vector<SumoXMLAttr>& writtenAttributes,38const bool aggregate, const std::vector<std::string>& edges, const std::string& edgeFile,39const std::string& excludeEmpty, const bool withInternal, const std::vector<std::string>& detectPersons,40const double minSamples, const double maxTravelTime, const std::vector<std::string>& vTypes, const double speedThreshold);4142/// @brief Destructor43~GNEMeanData();4445/// @brief get GNEHierarchicalElement associated with this AttributeCarrier46GNEHierarchicalElement* getHierarchicalElement();4748/**@brief write meanData element into a xml file49* @param[in] device device in which write parameters of meanData element50*/51void writeMeanData(OutputDevice& device) const;5253/// @brief get GUIGlObject associated with this AttributeCarrier54GUIGlObject* getGUIGlObject();5556/// @brief get GUIGlObject associated with this AttributeCarrier (constant)57const GUIGlObject* getGUIGlObject() const;5859/// @brief update pre-computed geometry information60void updateGeometry();6162/// @brief Returns element position in view63Position getPositionInView() const;6465/// @name Function related with contour drawing66/// @{6768/// @brief check if draw from contour (green)69bool checkDrawFromContour() const;7071/// @brief check if draw from contour (magenta)72bool checkDrawToContour() const;7374/// @brief check if draw related contour (cyan)75bool checkDrawRelatedContour() const;7677/// @brief check if draw over contour (orange)78bool checkDrawOverContour() const;7980/// @brief check if draw delete contour (pink/white)81bool checkDrawDeleteContour() const;8283/// @brief check if draw delete contour small (pink/white)84bool checkDrawDeleteContourSmall() const;8586/// @brief check if draw select contour (blue)87bool checkDrawSelectContour() const;8889/// @brief check if draw move contour (red)90bool checkDrawMoveContour() const;9192/// @}9394/// @name inherited from GNEAttributeCarrier95/// @{96/* @brief method for getting the Attribute of an XML key97* @param[in] key The attribute key98* @return string with the value associated to key99*/100std::string getAttribute(SumoXMLAttr key) const;101102/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)103* @param[in] key The attribute key104* @return double with the value associated to key105*/106double getAttributeDouble(SumoXMLAttr key) const;107108/**@brief method for setting the attribute and letting the object perform data set changes109* @param[in] key The attribute key110* @param[in] value The new value111* @param[in] undoList The undoList on which to register changes112*/113void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);114115/**@brief method for checking if the key and their conrrespond attribute are valids116* @param[in] key The attribute key117* @param[in] value The value associated to key key118* @return true if the value is valid, false in other case119*/120bool isValid(SumoXMLAttr key, const std::string& value);121122/// @brief get PopPup ID (Used in AC Hierarchy)123std::string getPopUpID() const;124125/// @brief get Hierarchy Name (Used in AC Hierarchy)126std::string getHierarchyName() const;127/// @}128129/// @brief get parameters map130const Parameterised::Map& getACParametersMap() const;131132protected:133/// @brief id134std::string myID;135136/// @brief filename137std::string myFile;138139/// @brief period140SUMOTime myPeriod = 0;141142/// @brief begin143SUMOTime myBegin = 0;144145/// @brief end146SUMOTime myEnd = 0;147148/// @brief Whether vehicles are tracked149bool myTrackVehicles = false;150151/// @brief bit mask for checking attributes to be written152std::vector<SumoXMLAttr> myWrittenAttributes;153154/// @brief whether the data for all edges shall be aggregated155bool myAggregate = false;156157/// @brief list of edges158std::vector<std::string> myEdges;159160/// @brief edge file161std::string myEdgeFile;162163/// @brief exclude empty164std::string myExcludeEmpty;165166/// @brief width internal167bool myWithInternal = false;168169/// @brief detect persons170std::vector<std::string> myDetectPersons;171172/// @brief minSamples173double myMinSamples = 0;174175/// @brief max travel time176double myMaxTravelTime = 0;177178/// @brief VTypes179std::vector<std::string> myVTypes;180181/// @brief speed threshold182double mySpeedThreshold = 0;183184private:185/// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute)186void setAttribute(SumoXMLAttr key, const std::string& value);187188/// @brief Invalidated copy constructor.189GNEMeanData(const GNEMeanData&) = delete;190191/// @brief Invalidated assignment operator.192GNEMeanData& operator=(const GNEMeanData&) = delete;193};194195/****************************************************************************/196197198