Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIVehicle.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
21// A MSVehicle extended by some values for usage within the gui
22/****************************************************************************/
23#pragma once
24#include <config.h>
25
26#include <vector>
27#include <string>
30#include <microsim/MSVehicle.h>
31#include "GUIBaseVehicle.h"
32
33
34// ===========================================================================
35// class declarations
36// ===========================================================================
38
39
40// ===========================================================================
41// class definitions
42// ===========================================================================
52class GUIVehicle : public MSVehicle, public GUIBaseVehicle {
53public:
62 MSVehicleType* type, const double speedFactor);
63
64
67
72 Position getPosition(const double offset = 0) const override {
73 return MSVehicle::getPosition(offset);
74 }
75
76 Position getVisualPosition(bool s2, const double offset = 0) const override;
77
82 double getAngle() const override {
83 return MSVehicle::getAngle();
84 }
85
90 double getVisualAngle(bool s2) const override;
91
95 void drawRouteHelper(const GUIVisualizationSettings& s, ConstMSRoutePtr r, bool future,
96 bool noLoop, const RGBColor& col) const override;
97
98 void drawAction_drawVehicleBlinker(double length) const override;
99 void drawAction_drawVehicleBrakeLight(double length, bool onlyOne = false) const override;
100 void drawAction_drawLinkItems(const GUIVisualizationSettings& s) const override;
101 void drawAction_drawVehicleBlueLight() const override;
102
107 double getLastLaneChangeOffset() const override;
108
110 void drawBestLanes() const override;
112
114 void selectBlockingFoes() const override;
115
117 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const override;
118
127
135
137 bool isSelected() const override;
138
140 double getRightSideOnEdge2() const {
141 return getRightSideOnEdge();
142 }
143
145 double getLeftSideOnEdge() const {
147 }
148
150 int getRightSublaneOnEdge() const;
151 int getLeftSublaneOnEdge() const;
152
154 std::string getLCStateRight() const;
155 std::string getLCStateLeft() const;
156 std::string getLCStateCenter() const;
157
159 std::string getLaneID() const;
160 std::string getBackLaneIDs() const;
161 std::string getShadowLaneID() const;
162 std::string getTargetLaneID() const;
163
164 std::string getDriveWays() const;
165
167 double getManeuverDist() const;
169 std::string getSpeedMode() const;
171 std::string getLaneChangeMode() const;
172
174 std::string getDynamicAlignment() const;
175
177 void rerouteDRTStop(MSStoppingPlace* busStop);
178
179 std::unique_ptr<MFXOptionalLock> getScopeLock() override {
180 return std::unique_ptr<MFXOptionalLock>(new MFXLock(myLock));
181 }
182
183
184protected:
186 void drawOutsideNetwork(bool add) override;
187
188private:
189 /* @brief draw train with individual carriages. The number of carriages is
190 * determined from defaultLength of carriages and vehicle length
191 * passengerSeats are computed beginning at firstPassengerCarriage */
192 void drawAction_drawCarriageClass(const GUIVisualizationSettings& s, double scaledLength, bool asImage) const override;
193
195 std::string getStopInfo() const override;
196};
std::shared_ptr< const MSRoute > ConstMSRoutePtr
Definition Route.h:32
A MSVehicle extended by some values for usage within the gui.
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
A window containing a gl-object's parameter.
A MSVehicle extended by some values for usage within the gui.
Definition GUIVehicle.h:52
void drawAction_drawVehicleBlueLight() const override
int getLeftSublaneOnEdge() const
Position getVisualPosition(bool s2, const double offset=0) const override
Return current position taking into account secondary shape.
std::string getDynamicAlignment() const
return the current lateral alignment as string
bool isSelected() const override
whether this vehicle is selected in the GUI
void drawOutsideNetwork(bool add) override
register vehicle for drawing while outside the network
double getLastLaneChangeOffset() const override
Returns the time since the last lane change in seconds.
double getAngle() const override
Return current angle.
Definition GUIVehicle.h:82
int getRightSublaneOnEdge() const
return the righmost sublane on the edge occupied by the vehicle
Position getPosition(const double offset=0) const override
Return current position (x/y, cartesian)
Definition GUIVehicle.h:72
void drawBestLanes() const override
Draws the vehicle's best lanes.
void drawAction_drawVehicleBlinker(double length) const override
std::string getBackLaneIDs() const
std::unique_ptr< MFXOptionalLock > getScopeLock() override
Definition GUIVehicle.h:179
void drawRouteHelper(const GUIVisualizationSettings &s, ConstMSRoutePtr r, bool future, bool noLoop, const RGBColor &col) const override
Draws the route.
double getLeftSideOnEdge() const
return left vehicle side on current edge
Definition GUIVehicle.h:145
std::string getStopInfo() const override
retrieve information about the current stop state
std::string getShadowLaneID() const
double getManeuverDist() const
return the lane-change maneuver distance
double getRightSideOnEdge2() const
return right vehicle side on current edge (without argument)
Definition GUIVehicle.h:140
std::string getSpeedMode() const
return the speed mode as bit string
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
void rerouteDRTStop(MSStoppingPlace *busStop)
handle route to accomodate to given stop
void drawAction_drawLinkItems(const GUIVisualizationSettings &s) const override
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
std::string getLCStateRight() const
return the lanechange state
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
void drawAction_drawCarriageClass(const GUIVisualizationSettings &s, double scaledLength, bool asImage) const override
draws the given guiShape with distinct carriages/modules
std::string getLaneID() const
return vehicle lane id
void drawAction_drawVehicleBrakeLight(double length, bool onlyOne=false) const override
std::string getTargetLaneID() const
std::string getLCStateLeft() const
void selectBlockingFoes() const override
adds the blocking foes to the current selection
double getVisualAngle(bool s2) const override
Returns the vehicle's direction in radians taking into account secondary shape.
std::string getDriveWays() const
~GUIVehicle()
destructor
std::string getLCStateCenter() const
std::string getLaneChangeMode() const
return the lane change mode as bit string
Stores the information about how to visualize structures.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
A lane area vehicles can halt at.
Representation of a vehicle in the micro simulation.
Definition MSVehicle.h:77
double getRightSideOnEdge(const MSLane *lane=0) const
Get the vehicle's lateral position on the edge of the given lane (or its current edge if lane == 0)
Position getPosition(const double offset=0) const
Return current position (x/y, cartesian)
double getAngle() const
Returns the vehicle's direction in radians.
Definition MSVehicle.h:735
The car-following model and parameter.
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
Structure representing possible vehicle parameter.