/****************************************************************************/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 GUIBusStop.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @author Johannes Rummel18/// @date Wed, 07.12.200519///20// A lane area vehicles can halt at (gui-version)21/****************************************************************************/22#pragma once23#include <config.h>2425#include <vector>26#include <string>27#include <microsim/MSStoppingPlace.h>28#include <utils/common/Command.h>29#include <utils/common/VectorHelper.h>30#include <utils/common/RGBColor.h>31#include <utils/geom/PositionVector.h>32#include <utils/gui/globjects/GUIGlObject.h>33#include <utils/gui/globjects/GUIGlObject_AbstractAdd.h>34#include <utils/gui/globjects/GUIGLObjectPopupMenu.h>35#include <utils/geom/Position.h>36#include <utils/xml/SUMOXMLDefinitions.h>37#include <gui/GUIManipulator.h>383940// ===========================================================================41// class declarations42// ===========================================================================43class MSNet;44class MSLane;45class GUIManipulator;464748// ===========================================================================49// class definitions50// ===========================================================================51/**52* @class GUIBusStop53* @brief A lane area vehicles can halt at (gui-version)54*55* This gui-version of a bus-stop extends MSStoppingPlace by methods for displaying56* and interaction.57*58* @see MSStoppingPlace59* @see GUIGlObject_AbstractAdd60* @see GUIGlObject61*/62class GUIBusStop : public MSStoppingPlace, public GUIGlObject_AbstractAdd {63public:64/** @brief Constructor65* @param[in] idStorage The gl-id storage for giving this object an gl-id66* @param[in] id The id of the bus stop67* @param[in] lines Names of the bus lines that halt on this bus stop68* @param[in] lane The lane the bus stop is placed on69* @param[in] begPos Begin position of the bus stop on the lane70* @param[in] endPos End position of the bus stop on the lane71*/72GUIBusStop(const std::string& id,73SumoXMLTag element,74const std::vector<std::string>& lines, MSLane& lane,75double frompos, double topos, const std::string name,76int personCapacity, double parkingLength, const RGBColor& color, double angle);777879/// @brief Destructor80~GUIBusStop();8182void finishedLoading();8384/// @brief adds an access point to this stop85bool addAccess(MSLane* const lane, const double startPos, const double endPos, double length, const MSStoppingPlace::AccessExit exit);8687/// @name inherited from GUIGlObject88//@{8990/** @brief Returns an own popup-menu91*92* @param[in] app The application needed to build the popup-menu93* @param[in] parent The parent window needed to build the popup-menu94* @return The built popup-menu95* @see GUIGlObject::getPopUpMenu96*/97GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app,98GUISUMOAbstractView& parent);99100/** @brief Returns an own parameter window101*102* Bus stops have no parameter windows (yet).103*104* @param[in] app The application needed to build the parameter window105* @param[in] parent The parent window needed to build the parameter window106* @return The built parameter window (always 0 in this case)107* @see GUIGlObject::getParameterWindow108*/109GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app,110GUISUMOAbstractView& parent);111112/// @brief return exaggeration associated with this GLObject113double getExaggeration(const GUIVisualizationSettings& s) const;114115/** @brief Returns the boundary to which the view shall be centered in order to show the object116*117* @return The boundary the object is within118* @see GUIGlObject::getCenteringBoundary119*/120Boundary getCenteringBoundary() const;121122/// @brief Returns the street name123const std::string getOptionalName() const;124125/// @brief Formats the last free pos value126double getCroppedLastFreePos() const;127128/** @brief Draws the object129* @param[in] s The settings for the current view (may influence drawing)130* @see GUIGlObject::drawGL131*/132void drawGL(const GUIVisualizationSettings& s) const;133134//@}135136private:137138139/// @brief init constants for faster rendering140void initShape(PositionVector& fgShape,141std::vector<double>& fgShapeRotations, std::vector<double>& fgShapeLengths,142Position& fgSignPos, double& fgSignRot, bool secondaryShape = false);143144private:145/// @brief The rotations of the shape parts146std::vector<double> myFGShapeRotations;147std::vector<double> myFGShapeRotations2;148149/// @brief The lengths of the shape parts150std::vector<double> myFGShapeLengths;151std::vector<double> myFGShapeLengths2;152153/// @brief The shape154PositionVector myFGShape;155PositionVector myFGShape2;156157/// @brief The position of the sign158Position myFGSignPos;159Position myFGSignPos2;160161/// @brief The rotation of the sign162double myFGSignRot;163double myFGSignRot2;164165/// @brief The visual width of the stoppling place166double myWidth;167168/// @brief The coordinates of access points169PositionVector myAccessCoords;170171RGBColor myEmptyColor;172};173174175