Path: blob/main/src/netedit/elements/network/GNEEdgeTemplate.h
185790 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 GNEEdgeTemplate.h14/// @author Pablo Alvarez Lopez15/// @date Dec 202116///17// Template for edges18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/elements/GNEAttributeCarrier.h>2324// ===========================================================================25// class declarations26// ===========================================================================2728class GNEEdge;29class GNELaneTemplate;3031// ===========================================================================32// class definitions33// ===========================================================================3435class GNEEdgeTemplate : public GNEAttributeCarrier {3637public:38/// @brief Constructor39GNEEdgeTemplate(const GNEEdge* edge);4041/// @brief Destructor.42~GNEEdgeTemplate();4344/// @brief methods to retrieve the elements linked to this edgeTemplate45/// @{4647/// @brief get GNEHierarchicalElement associated with this AttributeCarrier48GNEHierarchicalElement* getHierarchicalElement() override;4950/// @brief get GNEMoveElement associated with this edgeTemplate51GNEMoveElement* getMoveElement() const override;5253/// @brief get parameters associated with this edgeTemplate54Parameterised* getParameters() override;5556/// @brief get parameters associated with this edgeTemplate (constant)57const Parameterised* getParameters() const override;5859/// @}6061/// @brief get reference to fileBucket in which save this AC62FileBucket* getFileBucket() const override;6364/// @brief get vector with the lane templates of this edge65const std::vector<GNELaneTemplate*>& getLaneTemplates() const;6667/// @brief update lane templates68void updateLaneTemplates();6970/// @name Function related with graphics71/// @{7273/// @brief get GUIGlObject associated with this AttributeCarrier74GUIGlObject* getGUIGlObject() override;7576/// @brief get GUIGlObject associated with this AttributeCarrier (constant)77const GUIGlObject* getGUIGlObject() const override;7879/// @brief update pre-computed geometry information80void updateGeometry() override;8182/// @}8384/// @name Function related with contour drawing85/// @{8687/// @brief check if draw from contour (green)88bool checkDrawFromContour() const override;8990/// @brief check if draw from contour (magenta)91bool checkDrawToContour() const override;9293/// @brief check if draw related contour (cyan)94bool checkDrawRelatedContour() const override;9596/// @brief check if draw over contour (orange)97bool checkDrawOverContour() const override;9899/// @brief check if draw delete contour (pink/white)100bool checkDrawDeleteContour() const override;101102/// @brief check if draw delete contour small (pink/white)103bool checkDrawDeleteContourSmall() const override;104105/// @brief check if draw select contour (blue)106bool checkDrawSelectContour() const override;107108/// @brief check if draw move contour (red)109bool checkDrawMoveContour() const override;110111/// @}112113/// @name Functions related with attributes114/// @{115/* @brief method for getting the Attribute of an XML key116* @param[in] key The attribute key117* @return string with the value associated to key118*/119std::string getAttribute(SumoXMLAttr key) const override;120121/* @brief method for getting the Attribute of an XML key in double format122* @param[in] key The attribute key123* @return double with the value associated to key124*/125double getAttributeDouble(SumoXMLAttr key) const override;126127/* @brief method for getting the Attribute of an XML key in position format128* @param[in] key The attribute key129* @return position with the value associated to key130*/131Position getAttributePosition(SumoXMLAttr key) const override;132133/* @brief method for getting the Attribute of an XML key in Position format134* @param[in] key The attribute key135* @return position with the value associated to key136*/137PositionVector getAttributePositionVector(SumoXMLAttr key) const override;138139/* @brief method for setting the attribute and letting the object perform additional changes140* @param[in] key The attribute key141* @param[in] value The new value142* @param[in] undoList The undoList on which to register changes143*/144void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;145146/* @brief method for check if new value for certain attribute is valid147* @param[in] key The attribute key148* @param[in] value The new value149*/150bool isValid(SumoXMLAttr key, const std::string& value) override;151152/* @brief method for check if the value for certain attribute is set153* @param[in] key The attribute key154*/155bool isAttributeEnabled(SumoXMLAttr key) const override;156157/// @brief get PopPup ID (Used in AC Hierarchy)158std::string getPopUpID() const override;159160/// @brief get Hierarchy Name (Used in AC Hierarchy)161std::string getHierarchyName() const override;162163/// @}164165protected:166/// @brief pointer to original edge167const GNEEdge* myEdge;168169/// @brief vector with the lane templates of this edge170std::vector<GNELaneTemplate*> myLaneTemplates;171172private:173/// @brief set attribute after validation174void setAttribute(SumoXMLAttr key, const std::string& value) override;175176/// @brief invalidated copy constructor177GNEEdgeTemplate(const GNEEdgeTemplate& s) = delete;178179/// @brief invalidated assignment operator180GNEEdgeTemplate& operator=(const GNEEdgeTemplate& s) = delete;181};182183184