SUMO - Simulation of Urban MObility
GUIMEVehicle.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // A MSVehicle extended by some values for usage within the gui
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef GUIMEVehicle_h
24 #define GUIMEVehicle_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
36 #include <vector>
37 #include <set>
38 #include <string>
39 #include <guisim/GUIBaseVehicle.h>
40 #include <mesosim/MEVehicle.h>
41 
42 
43 // ===========================================================================
44 // class declarations
45 // ===========================================================================
47 
48 
49 // ===========================================================================
50 // class definitions
51 // ===========================================================================
61 class GUIMEVehicle : public MEVehicle, public GUIBaseVehicle {
62 public:
70  GUIMEVehicle(SUMOVehicleParameter* pars, const MSRoute* route,
71  const MSVehicleType* type, const SUMOReal speedFactor);
72 
73 
75  ~GUIMEVehicle();
76 
77 
85  Position getPosition(const SUMOReal offset = 0) const;
86 
90  SUMOReal getAngle() const;
91 
93  SUMOReal getColorValue(size_t activeScheme) const;
94 
96  bool drawAction_drawCarriageClass(const GUIVisualizationSettings& s, SUMOVehicleShape guiShape, bool asImage) const;
97 
103 
107  void drawRouteHelper(const MSRoute& r, SUMOReal exaggeration) const;
108 
110  std::string getStopInfo() const;
111 
113  void selectBlockingFoes() const;
114 
115  inline void setSegment(MESegment* s, size_t idx = 0) {
116  MEVehicle::setSegment(s, idx);
118  }
119 
128 
136 
137 
139  void setPositionAndAngle(const Position& pos, SUMOReal angle) {
140  myPos = pos;
141  myAngle = angle;
142  }
143 
144 private:
145 
148 
151 
152 };
153 
154 
155 #endif
156 
157 /****************************************************************************/
158 
A vehicle from the mesoscopic point of view.
Definition: MEVehicle.h:52
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
Position myPos
the position for drawing
Definition: GUIMEVehicle.h:147
Stores the information about how to visualize structures.
void drawRouteHelper(const MSRoute &r, SUMOReal exaggeration) const
Draws the route.
void setPositionAndAngle(const Position &pos, SUMOReal angle)
set position and angle for drawing
Definition: GUIMEVehicle.h:139
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
The car-following model and parameter.
Definition: MSVehicleType.h:74
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
~GUIMEVehicle()
destructor
SUMOReal myAngle
the angle for drawing
Definition: GUIMEVehicle.h:150
A MSVehicle extended by some values for usage within the gui.
void setSegment(MESegment *s, size_t idx=0)
Sets the current segment the vehicle is at together with its que.
Definition: GUIMEVehicle.h:115
SUMOReal getAngle() const
Returns the vehicle&#39;s direction in degrees.
bool drawAction_drawCarriageClass(const GUIVisualizationSettings &s, SUMOVehicleShape guiShape, bool asImage) const
draws the given guiShape if it has distinc carriages/modules and eturns true if so ...
std::string getStopInfo() const
retrieve information about the current stop state
SUMOReal getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
Structure representing possible vehicle parameter.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
void selectBlockingFoes() const
adds the blocking foes to the current selection
A MSVehicle extended by some values for usage within the gui.
Definition: GUIMEVehicle.h:61
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
A single mesoscopic segment (cell)
Definition: MESegment.h:57
#define SUMOReal
Definition: config.h:213
virtual void setSegment(MESegment *s, size_t idx=0)
Sets the current segment the vehicle is at together with its que.
Definition: MEVehicle.h:198
GUIMEVehicle(SUMOVehicleParameter *pars, const MSRoute *route, const MSVehicleType *type, const SUMOReal speedFactor)
Constructor.
A window containing a gl-object&#39;s parameter.
static const Position INVALID
Definition: Position.h:261