Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GUIContainer.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-2025 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/****************************************************************************/
19// A MSVehicle extended by some values for usage within the gui
20/****************************************************************************/
21#pragma once
22#include <config.h>
23
24#include <vector>
25#include <set>
26#include <string>
33#include "GUIBaseVehicle.h"
34
35
36// ===========================================================================
37// class declarations
38// ===========================================================================
42
43
44// ===========================================================================
45// class definitions
46// ===========================================================================
51public:
55
58
60
61
70
79
87
89 double getExaggeration(const GUIVisualizationSettings& s) const override;
90
96 Boundary getCenteringBoundary() const override;
97
102 void drawGL(const GUIVisualizationSettings& s) const override;
103
108 virtual void drawGLAdditional(GUISUMOAbstractView* const parent, const GUIVisualizationSettings& s) const override;
110
111 /* @brief set the position of a container while being transported by a vehicle
112 * @note This must be called by the vehicle before the call to drawGl */
116
118
119
121 double getEdgePos() const override;
122
124 int getDirection() const override;
125
127 // @note overrides the base method and returns myPositionInVehicle while in driving stage
128 Position getPosition() const override;
129
131 double getAngle() const override;
132
134 double getWaitingSeconds() const override;
135
137 double getSpeed() const override;
138
140
142 bool isSelected() const override;
143
144 double getScaleVisual() const override {
146 }
154 FXDECLARE(GUIContainerPopupMenu)
155 public:
162
165
167 long onCmdShowPlan(FXObject*, FXSelector, void*);
168
170 long onCmdStartTrack(FXObject*, FXSelector, void*);
171
173 long onCmdStopTrack(FXObject*, FXSelector, void*);
174
175 protected:
177 FOX_CONSTRUCTOR(GUIContainerPopupMenu)
178
179 };
180
181
182
184 std::map<GUISUMOAbstractView*, int> myAdditionalVisualizations;
185
186
187
188
189private:
191 mutable FXMutex myLock;
192
195
197 void setColor(const GUIVisualizationSettings& s) const;
198
200 double getColorValue(const GUIVisualizationSettings& s, int activeScheme) const override;
201
203 bool setFunctionalColor(int activeScheme) const;
204
210};
A class that stores a 2D geometrical boundary.
Definition Boundary.h:39
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
long onCmdShowPlan(FXObject *, FXSelector, void *)
Called if the plan shall be shown.
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
void setPositionInVehicle(const GUIBaseVehicle::Seat &pos)
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
double getWaitingSeconds() const override
the time this container spent waiting in seconds
Position getPosition() const override
return the Network coordinate of the container
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool isSelected() const override
whether this container is selected in the GUI
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
double getSpeed() const override
the current speed of the container
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own popup-menu.
double getAngle() const override
return the current angle of the container
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
double getEdgePos() const override
return the offset from the start of the current edge
GUIBaseVehicle::Seat myPositionInVehicle
The position of a container while riding a vehicle.
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own type parameter window.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
~GUIContainer()
destructor
int getDirection() const override
Return the movement directon on the edge.
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const override
Draws additionally triggered visualisations.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const override
gets the color value according to the current scheme index
double getScaleVisual() const override
return individual scaling factor for this object
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
The popup menu of a globject.
A window containing a gl-object's parameter.
Stores the information about how to visualize structures.
A device which collects info on the vehicle trip (mainly on departure and arrival)
const MSVehicleType & getVehicleType() const
Returns the object's "vehicle" type.
std::vector< MSStage * > MSTransportablePlan
the structure holding the plan of a transportable
The car-following model and parameter.
const SUMOVTypeParameter & getParameter() const
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
double scaleVisual
the scaling factor when drawing the object
Structure representing possible vehicle parameter.