Path: blob/main/src/netedit/elements/additional/GNEBusStop.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 GNEBusStop.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///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 GNEBusStop : public GNEStoppingPlace {2930public:31/// @brief default constructor32static GNEBusStop* buildBusStop(GNENet* net);3334/// @brief default constructor35static GNEBusStop* buildTrainStop(GNENet* net);3637/**@brief parameter constructor for bus stops38* @param[in] id busStop ID39* @param[in] net pointer to GNENet of this additional element belongs40* @param[in] filename file in which this element is stored41* @param[in] lane Lane of this StoppingPlace belongs42* @param[in] startPos Start position of the StoppingPlace43* @param[in] endPos End position of the StoppingPlace44* @param[in] name Name of busStop45* @param[in] lines lines of the busStop46* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.47* @param[in] parkingLength parking length48* @param[in] color busStop color49* @param[in] friendlyPos enable or disable friendly position50* @param[in] angle busStop's angle51* @param[in] parameters generic parameters52*/53static GNEBusStop* buildBusStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,54const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,55const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,56const double angle, const Parameterised::Map& parameters);5758/**@brief parameter constructor for train stops59* @param[in] id trainStop ID60* @param[in] net pointer to GNENet of this additional element belongs61* @param[in] filename file in which this element is stored62* @param[in] lane Lane of this StoppingPlace belongs63* @param[in] startPos Start position of the StoppingPlace64* @param[in] endPos End position of the StoppingPlace65* @param[in] name Name of busStop66* @param[in] lines lines of the busStop67* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.68* @param[in] parkingLength parking length69* @param[in] color busStop color70* @param[in] friendlyPos enable or disable friendly position71* @param[in] angle busStop's angle72* @param[in] parameters generic parameters73*/74static GNEBusStop* buildTrainStop(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane,75const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,76const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,77const double angle, const Parameterised::Map& parameters);7879/// @brief Destructor80~GNEBusStop();8182/**@brief write additional element into a xml file83* @param[in] device device in which write parameters of additional element84*/85void writeAdditional(OutputDevice& device) const;8687/// @name Functions related with geometry of element88/// @{8990/// @brief update pre-computed geometry information91void updateGeometry();9293/// @}9495/// @name inherited from GUIGlObject96/// @{97/**@brief Draws the object98* @param[in] s The settings for the current view (may influence drawing)99* @see GUIGlObject::drawGL100*/101void drawGL(const GUIVisualizationSettings& s) const;102103/// @}104105/// @name inherited from GNEAttributeCarrier106/// @{107108/* @brief method for getting the Attribute of an XML key109* @param[in] key The attribute key110* @return string with the value associated to key111*/112std::string getAttribute(SumoXMLAttr key) const;113114/* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)115* @param[in] key The attribute key116* @return double with the value associated to key117*/118double getAttributeDouble(SumoXMLAttr key) const;119120/* @brief method for setting the attribute and letting the object perform additional changes121* @param[in] key The attribute key122* @param[in] value The new value123* @param[in] undoList The undoList on which to register changes124*/125void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);126127/* @brief method for checking if the key and their correspond attribute are valids128* @param[in] key The attribute key129* @param[in] value The value associated to key key130* @return true if the value is valid, false in other case131*/132bool isValid(SumoXMLAttr key, const std::string& value);133134/// @}135136protected:137/// @brief The list of lines that are assigned to this stop138std::vector<std::string> myLines;139140/// @brief maximum number of persons that can wait at this stop141int myPersonCapacity = 0;142143/// @brief custom space for vehicles that park at this stop144double myParkingLength = 0;145146private:147/// @brief set attribute after validation148void setAttribute(SumoXMLAttr key, const std::string& value);149150/// @brief default constructor151GNEBusStop(SumoXMLTag tag, GNENet* net);152153/**@brief parameter Constructor154* @param[in] tag busStop or trainStop tag155* @param[in] id busStop ID156* @param[in] net pointer to GNENet of this additional element belongs157* @param[in] filename file in which this element is stored158* @param[in] lane Lane of this StoppingPlace belongs159* @param[in] startPos Start position of the StoppingPlace160* @param[in] endPos End position of the StoppingPlace161* @param[in] name Name of busStop162* @param[in] lines lines of the busStop163* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.164* @param[in] parkingLength parking length165* @param[in] color busStop color166* @param[in] friendlyPos enable or disable friendly position167* @param[in] angle busStop's angle168* @param[in] parameters generic parameters169*/170GNEBusStop(SumoXMLTag tag, const std::string& id, GNENet* net, const std::string& filename,171GNELane* lane, const double startPos, const double endPos, const std::string& name,172const std::vector<std::string>& lines, const int personCapacity, const double parkingLength,173const RGBColor& color, const bool friendlyPosition, const double angle,174const Parameterised::Map& parameters);175176/// @brief Invalidated copy constructor.177GNEBusStop(const GNEBusStop&) = delete;178179/// @brief Invalidated assignment operator.180GNEBusStop& operator=(const GNEBusStop&) = delete;181};182183184