Path: blob/main/src/netedit/elements/network/GNELaneTemplate.h
185849 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 GNELaneTemplate.h14/// @author Pablo Alvarez Lopez15/// @date Dec 202116///17// Template for lanes18/****************************************************************************/19#pragma once20#include <config.h>2122#include <netedit/elements/GNEAttributeCarrier.h>2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNELaneTemplate : public GNEAttributeCarrier {2930public:31/// @brief Constructor32GNELaneTemplate(const GNELane* lane);3334/// @brief Destructor.35~GNELaneTemplate();3637/// @brief methods to retrieve the elements linked to this laneType38/// @{3940/// @brief get GNEHierarchicalElement associated with this AttributeCarrier41GNEHierarchicalElement* getHierarchicalElement() override;4243/// @brief get GNEMoveElement associated with this laneType44GNEMoveElement* getMoveElement() const override;4546/// @brief get parameters associated with this laneType47Parameterised* getParameters() override;4849/// @brief get parameters associated with this laneType (constant)50const Parameterised* getParameters() const override;5152/// @}5354/// @brief get reference to fileBucket in which save this AC55FileBucket* getFileBucket() const override;5657/// @name Function related with graphics58/// @{5960/// @brief get GUIGlObject associated with this AttributeCarrier61GUIGlObject* getGUIGlObject() override;6263/// @brief get GUIGlObject associated with this AttributeCarrier (constant)64const GUIGlObject* getGUIGlObject() const override;6566/// @brief update pre-computed geometry information67void updateGeometry() override;6869/// @}7071/// @name Function related with contour drawing72/// @{7374/// @brief check if draw from contour (green)75bool checkDrawFromContour() const override;7677/// @brief check if draw from contour (magenta)78bool checkDrawToContour() const override;7980/// @brief check if draw related contour (cyan)81bool checkDrawRelatedContour() const override;8283/// @brief check if draw over contour (orange)84bool checkDrawOverContour() const override;8586/// @brief check if draw delete contour (pink/white)87bool checkDrawDeleteContour() const override;8889/// @brief check if draw delete contour small (pink/white)90bool checkDrawDeleteContourSmall() const override;9192/// @brief check if draw select contour (blue)93bool checkDrawSelectContour() const override;9495/// @brief check if draw move contour (red)96bool checkDrawMoveContour() const override;9798/// @}99100/// @name Functions related with attributes101/// @{102/* @brief method for getting the Attribute of an XML key103* @param[in] key The attribute key104* @return string with the value associated to key105*/106std::string getAttribute(SumoXMLAttr key) const override;107108/* @brief method for getting the Attribute of an XML key in double format109* @param[in] key The attribute key110* @return double with the value associated to key111*/112double getAttributeDouble(SumoXMLAttr key) const override;113114/* @brief method for getting the Attribute of an XML key in position format115* @param[in] key The attribute key116* @return position with the value associated to key117*/118Position getAttributePosition(SumoXMLAttr key) const override;119120/* @brief method for getting the Attribute of an XML key in Position format121* @param[in] key The attribute key122* @return position with the value associated to key123*/124PositionVector getAttributePositionVector(SumoXMLAttr key) const override;125126/* @brief method for setting the attribute and letting the object perform additional changes127* @param[in] key The attribute key128* @param[in] value The new value129* @param[in] undoList The undoList on which to register changes130*/131void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;132133/* @brief method for check if new value for certain attribute is valid134* @param[in] key The attribute key135* @param[in] value The new value136*/137bool isValid(SumoXMLAttr key, const std::string& value) override;138139/* @brief method for check if the value for certain attribute is set140* @param[in] key The attribute key141*/142bool isAttributeEnabled(SumoXMLAttr key) const override;143144/// @brief get PopPup ID (Used in AC Hierarchy)145std::string getPopUpID() const override;146147/// @brief get Hierarchy Name (Used in AC Hierarchy)148std::string getHierarchyName() const override;149150/// @}151152protected:153/// @brief pointer to original lane154const GNELane* myLane;155156private:157/// @brief set attribute after validation158void setAttribute(SumoXMLAttr key, const std::string& value) override;159160/// @brief invalidated copy constructor161GNELaneTemplate(const GNELaneTemplate& s) = delete;162163/// @brief invalidated assignment operator164GNELaneTemplate& operator=(const GNELaneTemplate& s) = delete;165};166167168