/****************************************************************************/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 GUIMEVehicle.h14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Sascha Krieg17/// @author Michael Behrisch18/// @date Sept 200219///20// A MSVehicle extended by some values for usage within the gui21/****************************************************************************/22#pragma once23#include <config.h>2425#include <vector>26#include <set>27#include <string>28#include <guisim/GUIBaseVehicle.h>29#include <mesosim/MEVehicle.h>303132// ===========================================================================33// class declarations34// ===========================================================================35class GUISUMOAbstractView;36class GUIVisualizationSettings;373839// ===========================================================================40// class definitions41// ===========================================================================42/**43* @class GUIMEVehicle44* @brief A MSVehicle extended by some values for usage within the gui45*46* A visualisable MSVehicle. Extended by the possibility to retrieve names47* of all available vehicles (static) and the possibility to retrieve the48* color of the vehicle which is available in different forms allowing an49* easier recognition of done actions such as lane changing.50*/51class GUIMEVehicle : public MEVehicle, public GUIBaseVehicle {52public:53/** @brief Constructor54* @param[in] pars The vehicle description55* @param[in] route The vehicle's route56* @param[in] type The vehicle's type57* @param[in] speedFactor The factor for driven lane's speed limits58* @exception ProcessError If a value is wrong59*/60GUIMEVehicle(SUMOVehicleParameter* pars, ConstMSRoutePtr route,61MSVehicleType* type, const double speedFactor);626364/// @brief destructor65~GUIMEVehicle();666768/** @brief Return current position (x/y, cartesian)69*70* @note implementation of abstract method does not work otherwise71*/72Position getPosition(const double offset = 0) const {73return MEVehicle::getPosition(offset);74}7576Position getVisualPosition(bool s2, const double offset = 0) const;7778/// @brief return exaggeration associated with this GLObject79double getExaggeration(const GUIVisualizationSettings& s) const;8081/** @brief Returns the boundary to which the view shall be centered in order to show the object82*83* @return The boundary the object is within84* @see GUIGlObject::getCenteringBoundary85*/86virtual Boundary getCenteringBoundary() const;8788/** @brief Return current angle89*90* @note implementation of abstract method does not work otherwise91*/92double getAngle() const {93return MEVehicle::getAngle();94}9596double getVisualAngle(bool /*s2*/) const {97return MEVehicle::getAngle();98}99100/// @brief gets the color value according to the current scheme index101double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const;102103/// @brief draws the given guiShape with distinct carriages/modules104void drawAction_drawCarriageClass(const GUIVisualizationSettings& s, double scaledLength, bool asImage) const;105106/** @brief Returns the time since the last lane change in seconds107* @see MSVehicle::myLastLaneChangeOffset108* @return The time since the last lane change in seconds109*/110double getLastLaneChangeOffset() const;111112/** @brief Draws the route113* @param[in] r The route to draw114*/115void drawRouteHelper(const GUIVisualizationSettings& s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor& col) const;116117/// @brief retrieve information about the current stop state118std::string getStopInfo() const;119120std::string getEdgeID() const;121122/// @brief adds the blocking foes to the current selection123void selectBlockingFoes() const;124125/** @brief Returns an own parameter window126*127* @param[in] app The application needed to build the parameter window128* @param[in] parent The parent window needed to build the parameter window129* @return The built parameter window130* @see GUIGlObject::getParameterWindow131*/132GUIParameterTableWindow* getParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent);133134/** @brief Returns an own type parameter window135*136* @param[in] app The application needed to build the parameter window137* @param[in] parent The parent window needed to build the parameter window138* @return The built parameter window139*/140GUIParameterTableWindow* getTypeParameterWindow(GUIMainWindow& app, GUISUMOAbstractView& parent);141142/// @brief whether this vehicle is selected in the GUI143bool isSelected() const;144};145146147