Path: blob/main/src/netedit/elements/additional/GNEContainerStop.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 GNEContainerStop.h14/// @author Pablo Alvarez Lopez15/// @date Jun 201616///17// A class for visualizing busStop geometry (adapted from GUILaneWrapper)18/****************************************************************************/19#pragma once20#include <config.h>2122#include "GNEStoppingPlace.h"2324// ===========================================================================25// class definitions26// ===========================================================================2728class GNEContainerStop : public GNEStoppingPlace {2930public:31/// @brief default constructor32GNEContainerStop(GNENet* net);3334/**@brief Constructor35* @param[in] id containerStop ID36* @param[in] net pointer to GNENet of this additional element belongs37* @param[in] filename file in which this element is stored38* @param[in] lane Lane of this StoppingPlace belongs39* @param[in] startPos Start position of the StoppingPlace40* @param[in] endPos End position of the StoppingPlace41* @param[in] name Name of busStop42* @param[in] lines lines of the busStop43* @param[in] containerCapacity larger numbers of containers trying to enter will create an upstream jam on the sidewalk.44* @param[in] parkingLength parking length45* @param[in] color containerStop color46* @param[in] friendlyPos enable or disable friendly position47* @param[in] angle container stop angle48* @param[in] parameters generic parameters49*/50GNEContainerStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,51const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,52const int containerCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,53const double angle, const Parameterised::Map& parameters);5455/// @brief Destructor56~GNEContainerStop();5758/**@brief write additional element into a xml file59* @param[in] device device in which write parameters of additional element60*/61void writeAdditional(OutputDevice& device) const;6263/// @name Functions related with geometry of element64/// @{6566/// @brief update pre-computed geometry information67void updateGeometry();6869/// @}7071/// @name inherited from GUIGlObject72/// @{73/**@brief Draws the object74* @param[in] s The settings for the current view (may influence drawing)75* @see GUIGlObject::drawGL76*/77void drawGL(const GUIVisualizationSettings& s) const;7879/// @}8081/// @name inherited from GNEAttributeCarrier82/// @{8384/* @brief method for getting the Attribute of an XML key85* @param[in] key The attribute key86* @return string with the value associated to key87*/88std::string getAttribute(SumoXMLAttr key) const;8990/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)91* @param[in] key The attribute key92* @return double with the value associated to key93*/94double getAttributeDouble(SumoXMLAttr key) const;9596/* @brief method for setting the attribute and letting the object perform additional changes97* @param[in] key The attribute key98* @param[in] value The new value99* @param[in] undoList The undoList on which to register changes100*/101void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);102103/* @brief method for checking if the key and their correspond attribute are valids104* @param[in] key The attribute key105* @param[in] value The value associated to key key106* @return true if the value is valid, false in other case107*/108bool isValid(SumoXMLAttr key, const std::string& value);109110/// @}111112protected:113/// @brief The list of lines that are assigned to this stop114std::vector<std::string> myLines;115116/// @brief maximum number of container that can wait at this stop117int myContainerCapacity;118119/// @brief custom space for vehicles that park at this stop120double myParkingLength;121122private:123/// @brief set attribute after validation124void setAttribute(SumoXMLAttr key, const std::string& value);125126/// @brief Invalidated copy constructor.127GNEContainerStop(const GNEContainerStop&) = delete;128129/// @brief Invalidated assignment operator.130GNEContainerStop& operator=(const GNEContainerStop&) = delete;131};132133134