Path: blob/main/src/netedit/elements/additional/GNEEntryExitDetector.h
169684 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 GNEEntryExitDetector.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///17//18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEDetector.h"2324// ===========================================================================25// class declarations26// ===========================================================================27class GNEMultiEntryExitDetector;2829// ===========================================================================30// class definitions31// ===========================================================================3233class GNEEntryExitDetector : public GNEDetector {3435public:36/// @brief default Constructor37GNEEntryExitDetector(SumoXMLTag entryExitTag, GNENet* net);3839/**@brief Constructor40* @param[in] entryExitTag Child Tag (Either SUMO_TAG_DET_ENTRY or SUMO_TAG_DET_EXIT)41* @param[in] parent pointer to GNEMultiEntryExitDetector of this GNEEntryExitDetector belongs42* @param[in] lane Lane of this detector is placed43* @param[in] pos position of the detector on the lane44* @param[in] friendlyPos enable or disable friendly positions45* @param[in] parameters generic parameters46*/47GNEEntryExitDetector(SumoXMLTag entryExitTag, GNEAdditional* parent, GNELane* lane, const double pos, const bool friendlyPos,48const Parameterised::Map& parameters);4950/// @brief destructor51~GNEEntryExitDetector();5253/// @name members and functions relative to write additionals into XML54/// @{5556/**@brief write additional element into a xml file57* @param[in] device device in which write parameters of additional element58*/59void writeAdditional(OutputDevice& device) const;6061/// @brief check if current additional is valid to be written into XML62bool isAdditionalValid() const;6364/// @brief return a string with the current additional problem65std::string getAdditionalProblem() const;6667/// @brief fix additional problem68void fixAdditionalProblem();6970/// @}7172/// @brief update pre-computed geometry information73void updateGeometry();7475/// @name inherited from GUIGlObject76/// @{7778/**@brief Draws the object79* @param[in] s The settings for the current view (may influence drawing)80* @see GUIGlObject::drawGL81*/82void drawGL(const GUIVisualizationSettings& s) const;8384/// @}8586/// @name inherited from GNEAttributeCarrier87/// @{8889/* @brief method for getting the Attribute of an XML key90* @param[in] key The attribute key91* @return string with the value associated to key92*/93std::string getAttribute(SumoXMLAttr key) const;9495/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)96* @param[in] key The attribute key97* @return double with the value associated to key98*/99double getAttributeDouble(SumoXMLAttr key) const;100101/* @brief method for setting the attribute and letting the object perform additional changes102* @param[in] key The attribute key103* @param[in] value The new value104* @param[in] undoList The undoList on which to register changes105*/106void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);107108/* @brief method for checking if the key and their correspond attribute are valids109* @param[in] key The attribute key110* @param[in] value The value associated to key key111* @return true if the value is valid, false in other case112*/113bool isValid(SumoXMLAttr key, const std::string& value);114115/// @}116117private:118/// @brief draw body119void drawBody(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;120121/// @brief draw entry logo122void drawEntryLogo(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;123124/// @brief draw E3 logo125void drawE3Logo(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;126127/// @brief set attribute after validation128void setAttribute(SumoXMLAttr key, const std::string& value);129130/// @brief set move shape131void setMoveShape(const GNEMoveResult& moveResult);132133/// @brief commit move shape134void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);135136/// @brief Invalidated copy constructor.137GNEEntryExitDetector(const GNEEntryExitDetector&) = delete;138139/// @brief Invalidated assignment operator.140GNEEntryExitDetector& operator=(const GNEEntryExitDetector&) = delete;141};142143144