/****************************************************************************/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 GNETagPropertiesDatabase.h14/// @author Pablo Alvarez lopez15/// @date Feb 202516///17// Database with all information about netedit elements18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNETagProperties.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNETagPropertiesDatabase {2930public:31/// @brief constructor32GNETagPropertiesDatabase();3334/// @brief destructor35~GNETagPropertiesDatabase();3637/// @brief get tagProperty associated to the given tag38const GNETagProperties* getTagProperty(const SumoXMLTag tag, const bool hardFail) const;3940/// @brief get tagProperties associated to the given set tag (persons, stops, plans, etc.)41const std::vector<const GNETagProperties*> getTagPropertiesSet(const SumoXMLTag tag, const bool hardFail) const;4243/// @brief get tagProperties associated to the given GNETagProperties::Type (NETWORKELEMENT, ADDITIONALELEMENT, VEHICLE, etc.)44const std::vector<const GNETagProperties*> getTagPropertiesByType(const GNETagProperties::Type type) const;4546/// @brief max number of editable (non extended) attributes47int getMaxNumberOfEditableAttributeRows() const;4849/// @brief get max number of geo attribute rows50int getMaxNumberOfGeoAttributeRows() const;5152/// @brief get max number of flow attribute rows53int getMaxNumberOfFlowAttributeRows() const;5455/// @brief get max number of netedit attribute rows56int getMaxNumberOfNeteditAttributesRows() const;5758/// @brief get hierarchy dept59int getHierarchyDepth() const;6061/// @brief write machine readable attribute help to file62void writeAttributeHelp() const;6364protected:65/// @brief fill hierarchy elements66void fillHierarchy();6768/// @brief fill network elements69void fillNetworkElements();7071/// @brief fill additional elements72void fillAdditionalElements();7374/// @brief fill shape elements75void fillShapeElements();7677/// @brief fill TAZ elements78void fillTAZElements();7980/// @brief fill Wire elements81void fillWireElements();8283/// @brief fill JuPedSim elements84void fillJuPedSimElements();8586/// @brief fill demand elements87void fillDemandElements();8889/// @brief fill vehicle elements90void fillVehicleElements();9192/// @brief fill stop elements93void fillStopElements();9495/// @brief fill waypoint elements96void fillWaypointElements();9798/// @brief fill person elements99void fillPersonElements();100101/// @brief fill person plan trips102void fillPersonPlanTrips();103104/// @brief fill person plan walks105void fillPersonPlanWalks();106107/// @brief fill person plan rides108void fillPersonPlanRides();109110/// @brief fill person stop elements111void fillPersonStopElements();112113/// @brief fill container elements114void fillContainerElements();115116/// @brief fill container transport elements117void fillContainerTransportElements();118119/// @brief fill container tranship elements120void fillContainerTranshipElements();121122/// @brief fill container stop elements123void fillContainerStopElements();124125/// @brief fill common attributes126void fillCommonAttributes(GNETagProperties* tagProperties);127128/// @brief fill common stoppingPlace attributes129void fillCommonStoppingPlaceAttributes(GNETagProperties* tagProperties, const bool includeColor);130131/// @brief fill common POI attributes132void fillCommonPOIAttributes(GNETagProperties* tagProperties);133134/// @brief fill common route attributes135void fillCommonRouteAttributes(GNETagProperties* tagProperties);136137/// @brief fill common vType attributes138void fillCommonVTypeAttributes(GNETagProperties* tagProperties);139140/// @brief fill common vehicle attributes (used by vehicles, trips, routeFlows and flows)141void fillCommonVehicleAttributes(GNETagProperties* tagProperties);142143/// @brief fill common flow attributes (used by flows, routeFlows and personFlows)144void fillCommonFlowAttributes(GNETagProperties* tagProperties, SumoXMLAttr perHour);145146/// @brief fill Car Following Model of Vehicle/Person Types147void fillCarFollowingModelAttributes(GNETagProperties* tagProperties);148149/// @brief fill Junction Model Attributes of Vehicle/Person Types150void fillJunctionModelAttributes(GNETagProperties* tagProperties);151152/// @brief fill Junction Model Attributes of Vehicle/Person Types153void fillLaneChangingModelAttributes(GNETagProperties* tagProperties);154155/// @brief fill common person attributes (used by person and personFlows)156void fillCommonPersonAttributes(GNETagProperties* tagProperties);157158/// @brief fill common container attributes (used by container and containerFlows)159void fillCommonContainerAttributes(GNETagProperties* tagProperties);160161/// @brief fill stop person attributes162void fillCommonStopAttributes(GNETagProperties* tagProperties, const bool waypoint);163164/// @brief fill plan from-to attribute165void fillPlanParentAttributes(GNETagProperties* tagProperties);166167/// @brief fill person trip common attributes168void fillPersonTripCommonAttributes(GNETagProperties* tagProperties);169170/// @brief fill walk common attributes171void fillWalkCommonAttributes(GNETagProperties* tagProperties);172173/// @brief fill ride common attributes174void fillRideCommonAttributes(GNETagProperties* tagProperties);175176/// @brief fill transport common attributes177void fillTransportCommonAttributes(GNETagProperties* tagProperties);178179/// @brief fill ride common attributes180void fillTranshipCommonAttributes(GNETagProperties* tagProperties);181182/// @brief fill plan stop common attributes183void fillPlanStopCommonAttributes(GNETagProperties* tagProperties);184185/// @brief fill Data elements186void fillDataElements();187188/// @brief fill stop person attributes189void fillCommonMeanDataAttributes(GNETagProperties* tagProperties);190191/// @name specific attributes192/// @{193194/// @brief fill ID attribute195void fillIDAttribute(GNETagProperties* tagProperties, const bool createMode);196197/// @brief fill name attribute198void fillNameAttribute(GNETagProperties* tagProperties);199200/// @brief fill edge attribute201void fillEdgeAttribute(GNETagProperties* tagProperties, const bool synonymID);202203/// @brief fill lane attribute204void fillLaneAttribute(GNETagProperties* tagProperties, const bool synonymID);205206/// @brief fill friendlyPos attribute207void fillFriendlyPosAttribute(GNETagProperties* tagProperties);208209/// @brief fill vTypes attribute210void fillVTypesAttribute(GNETagProperties* tagProperties);211212/// @brief fill file attribute213void fillFileAttribute(GNETagProperties* tagProperties);214215/// @brief fill output attribute216void fillOutputAttribute(GNETagProperties* tagProperties);217218/// @brief fill imgFile attribute219void fillImgFileAttribute(GNETagProperties* tagProperties, const bool isExtended);220221/// @brief fill depart attribute222void fillDepartAttribute(GNETagProperties* tagProperties);223224/// @brief fill allowDisallow attributes225void fillAllowDisallowAttributes(GNETagProperties* tagProperties);226227/// @brief fill lane position attribute228void fillPosOverLaneAttribute(GNETagProperties* tagProperties);229230/// @brief fill detect person attribute231void fillDetectPersonsAttribute(GNETagProperties* tagProperties);232233/// @brief fill color attribute234void fillColorAttribute(GNETagProperties* tagProperties, const std::string& defaultColor);235236/// @brief fill detector period attribute237void fillDetectorPeriodAttribute(GNETagProperties* tagProperties);238239/// @brief fill detector next edges attribute240void fillDetectorNextEdgesAttribute(GNETagProperties* tagProperties);241242/// @brief fill detector threshold attribute243void fillDetectorThresholdAttributes(GNETagProperties* tagProperties, const bool includingJam);244245/// @brief fill distribution probability attribute246void fillDistributionProbability(GNETagProperties* tagProperties, const bool visible);247248/// @}249250/// @brief update max number of attributes by type251void updateMaxNumberOfAttributesEditorRows();252253/// @brief update max hierarchy depth254void updateMaxHierarchyDepth();255256private:257/// @brief max number of editable (non extended) attributes (needed for attributes editor)258int myMaxNumberOfEditableAttributeRows = 0;259260/// @brief max number of geo attributes (needed for geo attributes editor)261int myMaxNumberOfGeoAttributeRows = 0;262263/// @brief max number of flow attributes (needed for geo attributes editor)264int myMaxNumberOfFlowAttributeRows = 0;265266/// @brief max number of netedit attributes (needed for netedit attributes editor)267int myMaxNumberOfNeteditAttributeRows = 0;268269/// @brief hierarchy dept270int myHierarchyDepth = 0;271272/// @brief map with tag properties sets (persons, stops, etc.)273std::map<SumoXMLTag, GNETagProperties*> mySetTagProperties;274275/// @brief map with the tags properties276std::map<SumoXMLTag, GNETagProperties*> myTagProperties;277278/// @brief Invalidated copy constructor.279GNETagPropertiesDatabase(const GNETagPropertiesDatabase&) = delete;280281/// @brief Invalidated assignment operator282GNETagPropertiesDatabase& operator=(const GNETagPropertiesDatabase& src) = delete;283};284285286