Eclipse SUMO - Simulation of Urban MObility
GUIContainer.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // A MSContainer extended by some values for usage within the gui
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
24 #include <cmath>
25 #include <vector>
26 #include <string>
27 #include <microsim/MSContainer.h>
36 #include <utils/geom/GeomHelper.h>
42 #include <utils/gui/div/GLHelper.h>
46 #include <gui/GUIGlobals.h>
47 #include "GUIContainer.h"
48 #include "GUINet.h"
49 #include "GUIEdge.h"
51 
52 //#define GUIContainer_DEBUG_DRAW_WALKING_AREA_SHAPE
53 
54 // ===========================================================================
55 // FOX callback mapping
56 // ===========================================================================
57 FXDEFMAP(GUIContainer::GUIContainerPopupMenu) GUIContainerPopupMenuMap[] = {
61 };
62 
63 // Object implementation
64 FXIMPLEMENT(GUIContainer::GUIContainerPopupMenu, GUIGLObjectPopupMenu, GUIContainerPopupMenuMap, ARRAYNUMBER(GUIContainerPopupMenuMap))
65 
66 #define WATER_WAY_OFFSET 6.0
67 
68 // ===========================================================================
69 // method definitions
70 // ===========================================================================
71 /* -------------------------------------------------------------------------
72  * GUIContainer::GUIContainerPopupMenu - methods
73  * ----------------------------------------------------------------------- */
76  : GUIGLObjectPopupMenu(app, parent, o) {
77 }
78 
79 
81 
82 
83 long
85  GUIContainer* p = dynamic_cast<GUIContainer*>(myObject);
86  if (p == nullptr) {
87  return 1;
88  }
89  GUIParameterTableWindow* ret = new GUIParameterTableWindow(*myApplication, *p, p->getNumStages());
90  // add items
91  for (int stage = 1; stage < p->getNumStages(); stage++) {
92  ret->mkItem(toString(stage).c_str(), false, p->getStageSummary(stage));
93  }
94  // close building (use an object that is not Parameterised as argument)
95  Parameterised dummy;
96  ret->closeBuilding(&dummy);
97  return 1;
98 }
99 
100 
101 long
103  assert(myObject->getType() == GLO_PERSON);
104  if (myParent->getTrackedID() != static_cast<GUIContainer*>(myObject)->getGlID()) {
105  myParent->startTrack(static_cast<GUIContainer*>(myObject)->getGlID());
106  }
107  return 1;
108 }
109 
110 long
112  assert(myObject->getType() == GLO_PERSON);
113  myParent->stopTrack();
114  return 1;
115 }
116 
117 
118 
119 
120 /* -------------------------------------------------------------------------
121  * GUIContainer - methods
122  * ----------------------------------------------------------------------- */
124  MSContainer(pars, vtype, plan),
125  GUIGlObject(GLO_CONTAINER, pars->id) {
126 }
127 
128 
130 }
131 
132 
135  GUISUMOAbstractView& parent) {
136  GUIGLObjectPopupMenu* ret = new GUIContainerPopupMenu(app, parent, *this);
137  buildPopupHeader(ret, app);
141  new FXMenuSeparator(ret);
142  if (parent.getTrackedID() != getGlID()) {
143  new FXMenuCommand(ret, "Start Tracking", nullptr, ret, MID_START_TRACK);
144  } else {
145  new FXMenuCommand(ret, "Stop Tracking", nullptr, ret, MID_STOP_TRACK);
146  }
147  //
148 
151  new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN);
152  new FXMenuSeparator(ret);
153  buildPositionCopyEntry(ret, false);
154  return ret;
155 }
156 
157 
162  new GUIParameterTableWindow(app, *this, 12 + (int)getParameter().getParametersMap().size());
163  // add items
164  ret->mkItem("stage", false, getCurrentStageDescription());
165  // there is always the "start" stage which we do not count here because it is not strictly part of the plan
166  ret->mkItem("stage index", false, toString(getNumStages() - getNumRemainingStages()) + " of " + toString(getNumStages() - 1));
167  ret->mkItem("start edge [id]", false, getFromEdge()->getID());
168  ret->mkItem("dest edge [id]", false, getDestination()->getID());
169  ret->mkItem("arrivalPos [m]", false, toString(getCurrentStage()->getArrivalPos()));
170  ret->mkItem("edge [id]", false, getEdge()->getID());
171  ret->mkItem("position [m]", true, new FunctionBinding<GUIContainer, double>(this, &GUIContainer::getEdgePos));
172  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIContainer, double>(this, &GUIContainer::getSpeed));
173  ret->mkItem("speed factor", false, getSpeedFactor());
174  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIContainer, double>(this, &GUIContainer::getAngle));
175  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIContainer, double>(this, &GUIContainer::getWaitingSeconds));
176  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
177  // close building
178  ret->closeBuilding(&getParameter());
179  return ret;
180 }
181 
182 
187  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getParametersMap().size());
188  // add items
189  ret->mkItem("Type Information:", false, "");
190  ret->mkItem("type [id]", false, myVType->getID());
191  ret->mkItem("length", false, myVType->getLength());
192  ret->mkItem("width", false, myVType->getWidth());
193  ret->mkItem("height", false, myVType->getHeight());
194  ret->mkItem("minGap", false, myVType->getMinGap());
195  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
196  // close building
197  ret->closeBuilding(&(myVType->getParameter()));
198  return ret;
199 }
200 
201 
202 Boundary
204  Boundary b;
205  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
206  b.add(getPosition());
207  b.grow(20);
208  return b;
209 }
210 
211 
212 void
214  glPushName(getGlID());
215  glPushMatrix();
216  Position p1 = getPosition();
218  p1 = myPositionInVehicle;
219  }
220  glTranslated(p1.x(), p1.y(), getType());
221  glRotated(90, 0, 0, 1);
222  // set container color
223  setColor(s);
224  // scale
225  const double upscale = s.containerSize.getExaggeration(s, this);
226  glScaled(upscale, upscale, 1);
227  switch (s.containerQuality) {
228  case 0:
229  case 1:
230  case 2:
232  break;
233  case 3:
234  default:
236  break;
237  }
238  glPopMatrix();
239 
240  drawName(p1, s.scale, s.containerName, s.angle);
241  glPopName();
242 }
243 
244 
245 void
247  glPushName(getGlID());
248  glPushMatrix();
249  /*
250  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
251  if (hasActiveAddVisualisation(parent, VO_SHOW_BEST_LANES)) {
252  drawBestLanes();
253  }
254  if (hasActiveAddVisualisation(parent, VO_SHOW_ROUTE)) {
255  drawRoute(s, 0, 0.25);
256  }
257  if (hasActiveAddVisualisation(parent, VO_SHOW_ALL_ROUTES)) {
258  if (getNumberReroutes() > 0) {
259  const int noReroutePlus1 = getNumberReroutes() + 1;
260  for (int i = noReroutePlus1 - 1; i >= 0; i--) {
261  double darken = double(0.4) / double(noReroutePlus1) * double(i);
262  drawRoute(s, i, darken);
263  }
264  } else {
265  drawRoute(s, 0, 0.25);
266  }
267  }
268  if (hasActiveAddVisualisation(parent, VO_SHOW_LFLINKITEMS)) {
269  for (DriveItemVector::const_iterator i = myLFLinkLanes.begin(); i != myLFLinkLanes.end(); ++i) {
270  if((*i).myLink==0) {
271  continue;
272  }
273  MSLink* link = (*i).myLink;
274  MSLane *via = link->getViaLane();
275  if (via == 0) {
276  via = link->getLane();
277  }
278  if (via != 0) {
279  Position p = via->getShape()[0];
280  if((*i).mySetRequest) {
281  glColor3f(0, 1, 0);
282  } else {
283  glColor3f(1, 0, 0);
284  }
285  glTranslated(p.x(), p.y(), -.1);
286  GLHelper::drawFilledCircle(1);
287  glTranslated(-p.x(), -p.y(), .1);
288  }
289  }
290  }
291  */
292  glPopMatrix();
293  glPopName();
294 }
295 
296 
297 
298 
299 void
301  const GUIColorer& c = s.containerColorer;
302  if (!setFunctionalColor(c.getActive())) {
304  }
305 }
306 
307 
308 bool
309 GUIContainer::setFunctionalColor(int activeScheme) const {
310  switch (activeScheme) {
311  case 0: {
312  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
314  return true;
315  }
316  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
317  GLHelper::setColor(getVehicleType().getColor());
318  return true;
319  }
320  return false;
321  }
322  case 2: {
323  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
325  return true;
326  }
327  return false;
328  }
329  case 3: {
330  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
331  GLHelper::setColor(getVehicleType().getColor());
332  return true;
333  }
334  return false;
335  }
336  case 8: {
337  double hue = GeomHelper::naviDegree(getAngle());
339  return true;
340  }
341  default:
342  return false;
343  }
344 }
345 
346 
347 double
348 GUIContainer::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const {
349  switch (activeScheme) {
350  case 4:
351  return getSpeed();
352  case 5:
353  if (isWaiting4Vehicle()) {
354  return 5;
355  } else {
356  return (double)getCurrentStageType();
357  }
358  case 6:
359  return getWaitingSeconds();
360  case 7:
362  }
363  return 0;
364 }
365 
366 
367 double
369  FXMutexLock locker(myLock);
370  return MSContainer::getEdgePos();
371 }
372 
373 
374 Position
376  FXMutexLock locker(myLock);
377  if (getCurrentStageType() == WAITING && getEdge()->getPermissions() == SVC_SHIP) {
378  MSLane* lane = getEdge()->getLanes().front(); //the most right lane of the water way
379  PositionVector laneShape = lane->getShape();
380  return laneShape.positionAtOffset2D(getEdgePos(), WATER_WAY_OFFSET);
381  }
382  return MSContainer::getPosition();
383 }
384 
385 
386 double
388  FXMutexLock locker(myLock);
389  return MSContainer::getAngle();
390 }
391 
392 
393 double
395  FXMutexLock locker(myLock);
397 }
398 
399 
400 double
402  FXMutexLock locker(myLock);
403  return MSContainer::getSpeed();
404 }
405 
406 
407 void
409  // draw pedestrian shape
410  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
411  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
412  glBegin(GL_QUADS);
413  glVertex2d(0, 0.5);
414  glVertex2d(0, -0.5);
415  glVertex2d(-1, -0.5);
416  glVertex2d(-1, 0.5);
417  glEnd();
418  GLHelper::setColor(GLHelper::getColor().changedBrightness(-30));
419  glTranslated(0, 0, .045);
420  glBegin(GL_QUADS);
421  glVertex2d(-0.1, 0.4);
422  glVertex2d(-0.1, -0.4);
423  glVertex2d(-0.9, -0.4);
424  glVertex2d(-0.9, 0.4);
425  glEnd();
426 }
427 
428 
429 void
431  const std::string& file = getVehicleType().getImgFile();
432  if (file != "") {
433  // @todo invent an option for controlling whether images should be rotated or not
434  //if (getVehicleType().getGuiShape() == SVS_CONTAINER) {
435  // glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
436  //}
437  int textureID = GUITexturesHelper::getTextureID(file);
438  if (textureID > 0) {
439  const double exaggeration = s.personSize.getExaggeration(s, this);
440  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
441  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
442  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
443  }
444  } else {
445  // fallback if no image is defined
447  }
448 }
449 /****************************************************************************/
450 
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
GUIContainer::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIContainer.cpp:203
GUIContainer::setColor
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIContainer.cpp:300
GUIContainer::drawAction_drawAsImage
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
Definition: GUIContainer.cpp:430
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:93
GLHelper::getColor
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:627
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:62
MSTransportable::getDestination
const MSEdge * getDestination() const
Returns the current destination.
Definition: MSTransportable.h:617
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:42
GUIContainer.h
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
MSTransportable::getStageSummary
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Definition: MSTransportable.cpp:833
MSLane
Representation of a lane in the micro simulation.
Definition: MSLane.h:82
GUIParameterTableWindow.h
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:354
GUIVisualizationSettings::angle
double angle
The current view rotation angle.
Definition: GUIVisualizationSettings.h:405
GUIGlObject::buildSelectionPopupEntry
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Definition: GUIGlObject.cpp:235
GUIVisualizationSettings::containerName
GUIVisualizationTextSettings containerName
Definition: GUIVisualizationSettings.h:558
MSCModel_NonInteracting.h
GUIContainer::GUIContainerPopupMenu
Definition: GUIContainer.h:149
MID_START_TRACK
Start to track a vehicle.
Definition: GUIAppEnum.h:432
GUIGlobalSelection.h
GUIContainer::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIContainer.cpp:134
GUIContainer::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIContainer.cpp:159
GeomHelper::naviDegree
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:193
GUIContainer::getSpeed
double getSpeed() const
the current speed of the container
Definition: GUIContainer.cpp:401
FXDEFMAP
FXDEFMAP(GUIContainer::GUIContainerPopupMenu) GUIContainerPopupMenuMap[]
GUIContainer::GUIContainerPopupMenu::onCmdStopTrack
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIContainer.cpp:111
WATER_WAY_OFFSET
#define WATER_WAY_OFFSET
Definition: GUIContainer.cpp:66
GUIContainer::setFunctionalColor
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIContainer.cpp:309
RAD2DEG
#define RAD2DEG(x)
Definition: GeomHelper.h:38
GLO_PERSON
Definition: GUIGlObjectTypes.h:159
GUIContainer::GUIContainerPopupMenu::onCmdShowPlan
long onCmdShowPlan(FXObject *, FXSelector, void *)
Called if the plan shall be shown.
Definition: GUIContainer.cpp:84
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
GUIVisualizationSettings::containerSize
GUIVisualizationSizeSettings containerSize
Definition: GUIVisualizationSettings.h:555
GLHelper.h
MID_STOP_TRACK
Stop to track a vehicle.
Definition: GUIAppEnum.h:434
GUINet.h
PositionVector
A list of positions.
Definition: PositionVector.h:45
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:657
ICON_APP_TABLE
Definition: GUIIcons.h:113
GUIParameterTableWindow::closeBuilding
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Definition: GUIParameterTableWindow.cpp:219
GUITexturesHelper::drawTexturedBox
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Definition: GUITexturesHelper.cpp:72
GUIContainer::GUIContainerPopupMenu::~GUIContainerPopupMenu
~GUIContainerPopupMenu()
Destructor.
Definition: GUIContainer.cpp:80
GUIAppEnum.h
SUMOVehicleParameter.h
MSTransportable::getSpeedFactor
virtual double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSTransportable.h:652
GUIContainer::getPosition
Position getPosition() const
return the Network coordinate of the container
Definition: GUIContainer.cpp:375
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:253
GUISUMOAbstractView.h
MSTransportable::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.h:627
Parameterised::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Definition: Parameterised.cpp:106
GUIContainer::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIContainer.cpp:213
MSTransportable::getCurrentStage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
Definition: MSTransportable.h:677
MSTransportable::WAITING
Definition: MSTransportable.h:62
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:246
GUIContainer::myPositionInVehicle
Position myPositionInVehicle
The position of a container while riding a vehicle.
Definition: GUIContainer.h:188
GUIGlObject::buildNameCopyPopupEntry
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Definition: GUIGlObject.cpp:225
GUIContainer::drawAction_drawAsPoly
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
Definition: GUIContainer.cpp:408
GUIContainer
Definition: GUIContainer.h:51
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:79
GUIContainer::GUIContainerPopupMenu::GUIContainerPopupMenu
GUIContainerPopupMenu(GUIMainWindow &app, GUISUMOAbstractView &parent, GUIGlObject &o)
Constructor.
Definition: GUIContainer.cpp:74
MSTransportable::getNumStages
int getNumStages() const
Return the total number stages in this persons plan.
Definition: MSTransportable.cpp:745
MSTransportable::getWaitingSeconds
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Definition: MSTransportable.cpp:729
VEHPARS_COLOR_SET
const int VEHPARS_COLOR_SET
Definition: SUMOVehicleParameter.h:45
GUIParameterTableWindow::mkItem
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Definition: GUIParameterTableWindow.h:108
GUITexturesHelper.h
MSContainer
Definition: MSContainer.h:60
GUIGlobals.h
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GUIContainer::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIContainer.h:185
CastingFunctionBinding.h
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
GUIApplicationWindow.h
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GUIVisualizationSettings::containerQuality
int containerQuality
The quality of container drawing.
Definition: GUIVisualizationSettings.h:552
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
GUIContainer::getEdgePos
double getEdgePos() const
return the offset from the start of the current edge
Definition: GUIContainer.cpp:368
MSTransportable::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:721
GUIContainer::~GUIContainer
~GUIContainer()
destructor
Definition: GUIContainer.cpp:129
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:125
GUIVisualizationSettings::personSize
GUIVisualizationSizeSettings personSize
Definition: GUIVisualizationSettings.h:538
GUIContainer::getTypeParameterWindow
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIContainer.cpp:184
RGBColor::fromHSV
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:298
GLO_CONTAINER
Definition: GUIGlObjectTypes.h:153
GUIGlObject
Definition: GUIGlObject.h:65
MSContainer.h
MID_SHOWPLAN
Show transportable plan.
Definition: GUIAppEnum.h:398
MSTransportable::DRIVING
Definition: MSTransportable.h:64
SVC_SHIP
is an arbitrary ship
Definition: SUMOVehicleClass.h:195
MSTransportable::getEdgePos
virtual double getEdgePos() const
Return the position on the edge.
Definition: MSTransportable.cpp:714
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
GLIncludes.h
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
StringUtils.h
MSLane::getShape
const PositionVector & getShape() const
Returns this lane's shape.
Definition: MSLane.h:477
GLObjectValuePassConnector.h
MSTransportable::MSTransportablePlan
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
Definition: MSTransportable.h:587
FunctionBinding.h
GUIMainWindow
Definition: GUIMainWindow.h:46
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
MSTransportable::getNumRemainingStages
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Definition: MSTransportable.cpp:740
M_PI
#define M_PI
Definition: odrSpiral.cpp:40
PositionVector::positionAtOffset2D
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
Definition: PositionVector.cpp:273
MSTransportable::getSpeed
virtual double getSpeed() const
the current speed of the transportable
Definition: MSTransportable.cpp:734
MSTransportable::getArrivalPos
double getArrivalPos() const
returns the final arrival pos
Definition: MSTransportable.h:740
GUIContainer::drawGLAdditional
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIContainer.cpp:246
MSTransportable::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
Definition: MSTransportable.h:606
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:109
GUIContainer::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIContainer.cpp:348
GUIContainer::getWaitingSeconds
double getWaitingSeconds() const
the time this container spent waiting in seconds
Definition: GUIContainer.cpp:394
MSVehicleType::getImgFile
std::string getImgFile() const
Get this vehicle type's raster model file name.
Definition: MSVehicleType.h:276
GUIEdge.h
GUIGlObject::buildShowTypeParamsPopupEntry
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
Definition: GUIGlObject.cpp:257
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
MSTransportable::getID
const std::string & getID() const
returns the id of the transportable
Definition: MSTransportable.cpp:699
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:560
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:33
GUIContainer::getAngle
double getAngle() const
return the current angle of the container
Definition: GUIContainer.cpp:387
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
GUIGlObject::buildPositionCopyEntry
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Definition: GUIGlObject.cpp:266
MSTransportable::getPosition
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Definition: MSTransportable.cpp:719
GUIContainer::GUIContainer
GUIContainer(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
Constructor.
Definition: GUIContainer.cpp:123
MSEdge::getLanes
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:167
MSDevice_Vehroutes.h
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:161
GUIContainer::GUIContainerPopupMenu::onCmdStartTrack
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIContainer.cpp:102
config.h
GeomHelper.h
GUIVisualizationSettings::containerColorer
GUIColorer containerColorer
The container colorer.
Definition: GUIVisualizationSettings.h:549
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
MSTransportable::getFromEdge
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSTransportable.h:632
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
FunctionBinding
Definition: FunctionBinding.h:40
VTYPEPARS_COLOR_SET
const int VTYPEPARS_COLOR_SET
Definition: SUMOVTypeParameter.h:51
MSTransportable::myVType
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Definition: MSTransportable.h:801
GUITexturesHelper::getTextureID
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
Definition: GUITexturesHelper.cpp:112
MSTransportable::getParameter
const SUMOVehicleParameter & getParameter() const
Definition: MSTransportable.h:602
MSVehicleControl.h
MSTransportable::getAngle
virtual double getAngle() const
return the current angle of the transportable
Definition: MSTransportable.cpp:724
PositionVector.h
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:110
GUISUMOAbstractView::getTrackedID
virtual GUIGlID getTrackedID() const
get tracked id
Definition: GUISUMOAbstractView.cpp:1435
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:75
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
MSAbstractLaneChangeModel.h
GUIPropertySchemeStorage< GUIColorScheme >
GUISelectedStorage::isSelected
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Definition: GUISelectedStorage.cpp:94
MSTransportable::getCurrentStageDescription
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
Definition: MSTransportable.h:672