/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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 {3031public:32/// @brief Default constructor33GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, FileBucket* fileBucket);3435/// @brief Parameter constructor36GNEMeanData(SumoXMLTag tag, std::string ID, GNENet* net, FileBucket* fileBucket, const std::string& file,37const std::string& type, const SUMOTime period, const SUMOTime begin, const SUMOTime end,38const bool trackVehicles, const std::vector<SumoXMLAttr>& writtenAttributes, const bool aggregate,39const std::vector<std::string>& edges, const std::string& edgeFile, const std::string& excludeEmpty,40const bool withInternal, const std::vector<std::string>& detectPersons, const double minSamples,41const double maxTravelTime, const std::vector<std::string>& vTypes, const double speedThreshold);4243/// @brief Destructor44~GNEMeanData();4546/// @brief methods to retrieve the elements linked to this meanData47/// @{4849/// @brief get GNEHierarchicalElement associated with this meanData50GNEHierarchicalElement* getHierarchicalElement() override;5152/// @brief get GNEMoveElement associated with this meanData53GNEMoveElement* getMoveElement() const override;5455/// @brief get parameters associated with this meanData56Parameterised* getParameters() override;5758/// @brief get parameters associated with this meanData (constant)59const Parameterised* getParameters() const override;6061/// @brief get GUIGlObject associated with this meanData62GUIGlObject* getGUIGlObject() override;6364/// @brief get GUIGlObject associated with this meanData (constant)65const GUIGlObject* getGUIGlObject() const override;6667/// @}6869/// @brief get reference to fileBucket in which save this AC70FileBucket* getFileBucket() const override;7172/**@brief write meanData element into a xml file73* @param[in] device device in which write parameters of meanData element74*/75void writeMeanData(OutputDevice& device) const;7677/// @brief update pre-computed geometry information78void updateGeometry() override;7980/// @brief Returns element position in view81Position getPositionInView() const;8283/// @name Function related with contour drawing84/// @{8586/// @brief check if draw from contour (green)87bool checkDrawFromContour() const override;8889/// @brief check if draw from contour (magenta)90bool checkDrawToContour() const override;9192/// @brief check if draw related contour (cyan)93bool checkDrawRelatedContour() const override;9495/// @brief check if draw over contour (orange)96bool checkDrawOverContour() const override;9798/// @brief check if draw delete contour (pink/white)99bool checkDrawDeleteContour() const override;100101/// @brief check if draw delete contour small (pink/white)102bool checkDrawDeleteContourSmall() const override;103104/// @brief check if draw select contour (blue)105bool checkDrawSelectContour() const override;106107/// @brief check if draw move contour (red)108bool checkDrawMoveContour() const override;109110/// @}111112/// @name inherited from GNEAttributeCarrier113/// @{114/* @brief method for getting the Attribute of an XML key115* @param[in] key The attribute key116* @return string with the value associated to key117*/118std::string getAttribute(SumoXMLAttr key) const override;119120/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)121* @param[in] key The attribute key122* @return double with the value associated to key123*/124double getAttributeDouble(SumoXMLAttr key) const override;125126/* @brief method for getting the Attribute of an XML key in position format127* @param[in] key The attribute key128* @return position with the value associated to key129*/130Position getAttributePosition(SumoXMLAttr key) const override;131132/* @brief method for getting the Attribute of an XML key in positionVector format133* @param[in] key The attribute key134* @return positionVector with the value associated to key135*/136PositionVector getAttributePositionVector(SumoXMLAttr key) const override;137138/**@brief method for setting the attribute and letting the object perform data set changes139* @param[in] key The attribute key140* @param[in] value The new value141* @param[in] undoList The undoList on which to register changes142*/143void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;144145/**@brief method for checking if the key and their conrrespond attribute are valids146* @param[in] key The attribute key147* @param[in] value The value associated to key key148* @return true if the value is valid, false in other case149*/150bool isValid(SumoXMLAttr key, const std::string& value) override;151152/// @brief get PopPup ID (Used in AC Hierarchy)153std::string getPopUpID() const override;154155/// @brief get Hierarchy Name (Used in AC Hierarchy)156std::string getHierarchyName() const override;157/// @}158159protected:160/// @brief id161std::string myID;162163/// @brief filename164std::string myFile;165166/// @brief type167std::string myType;168169/// @brief period170SUMOTime myPeriod = 0;171172/// @brief begin173SUMOTime myBegin = 0;174175/// @brief end176SUMOTime myEnd = 0;177178/// @brief Whether vehicles are tracked179bool myTrackVehicles = false;180181/// @brief bit mask for checking attributes to be written182std::vector<SumoXMLAttr> myWrittenAttributes;183184/// @brief whether the data for all edges shall be aggregated185bool myAggregate = false;186187/// @brief list of edges188std::vector<std::string> myEdges;189190/// @brief edge file191std::string myEdgeFile;192193/// @brief exclude empty194std::string myExcludeEmpty;195196/// @brief width internal197bool myWithInternal = false;198199/// @brief detect persons200std::vector<std::string> myDetectPersons;201202/// @brief minSamples203double myMinSamples = 0;204205/// @brief max travel time206double myMaxTravelTime = 0;207208/// @brief VTypes209std::vector<std::string> myVTypes;210211/// @brief speed threshold212double mySpeedThreshold = 0;213214private:215/// @brief method for setting the attribute and nothing else (used in GNEChange_Attribute)216void setAttribute(SumoXMLAttr key, const std::string& value) override;217218/// @brief Invalidated copy constructor.219GNEMeanData(const GNEMeanData&) = delete;220221/// @brief Invalidated assignment operator.222GNEMeanData& operator=(const GNEMeanData&) = delete;223};224225/****************************************************************************/226227228