/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2026 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() override;8384/// @brief adds an access point to this stop85bool addAccess(MSLane* const lane, const double startPos, const double endPos,86double length, const MSStoppingPlace::AccessExit exit) override;8788/// @name inherited from GUIGlObject89//@{9091/** @brief Returns an own popup-menu92*93* @param[in] app The application needed to build the popup-menu94* @param[in] parent The parent window needed to build the popup-menu95* @return The built popup-menu96* @see GUIGlObject::getPopUpMenu97*/98GUIGLObjectPopupMenu* getPopUpMenu(GUIMainWindow& app, GUISUMOAbstractView& parent) override;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, GUISUMOAbstractView& parent) override;110111/// @brief return exaggeration associated with this GLObject112double getExaggeration(const GUIVisualizationSettings& s) const override;113114/** @brief Returns the boundary to which the view shall be centered in order to show the object115*116* @return The boundary the object is within117* @see GUIGlObject::getCenteringBoundary118*/119Boundary getCenteringBoundary() const override;120121/// @brief Returns the street name122const std::string getOptionalName() const override;123124/// @brief Formats the last free pos value125double getCroppedLastFreePos() const;126127/** @brief Draws the object128* @param[in] s The settings for the current view (may influence drawing)129* @see GUIGlObject::drawGL130*/131void drawGL(const GUIVisualizationSettings& s) const override;132133//@}134135private:136137138/// @brief init constants for faster rendering139void initShape(PositionVector& fgShape,140std::vector<double>& fgShapeRotations, std::vector<double>& fgShapeLengths,141Position& fgSignPos, double& fgSignRot, bool secondaryShape = false);142143private:144/// @brief The rotations of the shape parts145std::vector<double> myFGShapeRotations;146std::vector<double> myFGShapeRotations2;147148/// @brief The lengths of the shape parts149std::vector<double> myFGShapeLengths;150std::vector<double> myFGShapeLengths2;151152/// @brief The shape153PositionVector myFGShape;154PositionVector myFGShape2;155156/// @brief The position of the sign157Position myFGSignPos;158Position myFGSignPos2;159160/// @brief The rotation of the sign161double myFGSignRot;162double myFGSignRot2;163164/// @brief The visual width of the stoppling place165double myWidth;166167/// @brief The coordinates of access points168PositionVector myAccessCoords;169170RGBColor myEmptyColor;171};172173174