SUMO - Simulation of Urban MObility
GUIPerson.cpp
Go to the documentation of this file.
1 /****************************************************************************/
9 // A MSPerson extended by some values for usage within the gui
10 /****************************************************************************/
11 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
12 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
13 /****************************************************************************/
14 //
15 // This file is part of SUMO.
16 // SUMO is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <cmath>
34 #include <vector>
35 #include <string>
38 #include <microsim/MSVehicleType.h>
47 #include <utils/geom/GeomHelper.h>
53 #include <utils/gui/div/GLHelper.h>
57 #include <gui/GUIGlobals.h>
58 #include "GUILane.h"
59 #include "GUINet.h"
60 #include "GUIEdge.h"
61 #include "GUIPerson.h"
62 
63 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
64 
65 // ===========================================================================
66 // FOX callback mapping
67 // ===========================================================================
68 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
75 };
76 
77 // Object implementation
78 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
79 
80 
81 
82 // ===========================================================================
83 // method definitions
84 // ===========================================================================
85 /* -------------------------------------------------------------------------
86  * GUIPerson::GUIPersonPopupMenu - methods
87  * ----------------------------------------------------------------------- */
89  GUIMainWindow& app, GUISUMOAbstractView& parent,
90  GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations) :
91  GUIGLObjectPopupMenu(app, parent, o),
92  myVehiclesAdditionalVisualizations(additionalVisualizations) {
93 }
94 
95 
97 
98 long
100  assert(myObject->getType() == GLO_PERSON);
101  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
103  }
104  return 1;
105 }
106 
107 long
109  assert(myObject->getType() == GLO_PERSON);
111  return 1;
112 }
113 
114 
115 
116 long
118  assert(myObject->getType() == GLO_PERSON);
119  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
121  }
122  return 1;
123 }
124 
125 long
127  assert(myObject->getType() == GLO_PERSON);
129  return 1;
130 }
131 
132 
133 long
134 GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(FXObject*, FXSelector, void*) {
135  assert(myObject->getType() == GLO_PERSON);
136  if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
137  myParent->startTrack(static_cast<GUIPerson*>(myObject)->getGlID());
138  }
139  return 1;
140 }
141 
142 long
143 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
144  assert(myObject->getType() == GLO_PERSON);
145  myParent->stopTrack();
146  return 1;
147 }
148 
149 
150 
151 
152 /* -------------------------------------------------------------------------
153  * GUIPerson - methods
154  * ----------------------------------------------------------------------- */
156  MSPerson(pars, vtype, plan),
157  GUIGlObject(GLO_PERSON, pars->id),
159 }
160 
161 
163  myLock.lock();
164  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
165  if (i->first->getTrackedID() == getGlID()) {
166  i->first->stopTrack();
167  }
168  while (i->first->removeAdditionalGLVisualisation(this));
169  }
170  myLock.unlock();
171 }
172 
173 
176  GUISUMOAbstractView& parent) {
178  buildPopupHeader(ret, app);
183  new FXMenuCommand(ret, "Hide Current Route", 0, ret, MID_HIDE_CURRENTROUTE);
184  } else {
185  new FXMenuCommand(ret, "Show Current Route", 0, ret, MID_SHOW_CURRENTROUTE);
186  }
188  new FXMenuCommand(ret, "Hide Walkingarea Path", 0, ret, MID_HIDE_WALKINGAREA_PATH);
189  } else {
190  new FXMenuCommand(ret, "Show Walkingarea Path", 0, ret, MID_SHOW_WALKINGAREA_PATH);
191  }
192  new FXMenuSeparator(ret);
193  if (parent.getTrackedID() != getGlID()) {
194  new FXMenuCommand(ret, "Start Tracking", 0, ret, MID_START_TRACK);
195  } else {
196  new FXMenuCommand(ret, "Stop Tracking", 0, ret, MID_STOP_TRACK);
197  }
198  new FXMenuSeparator(ret);
199  //
202  buildPositionCopyEntry(ret, false);
203  return ret;
204 }
205 
206 
211  new GUIParameterTableWindow(app, *this, 15);
212  // add items
213  ret->mkItem("stage", false, getCurrentStageDescription());
214  ret->mkItem("start edge [id]", false, getFromEdge()->getID());
215  ret->mkItem("dest edge [id]", false, getDestination().getID());
216  ret->mkItem("edge [id]", false, getEdge()->getID());
217  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
218  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
219  ret->mkItem("speed factor", false, getSpeedFactor());
220  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getNaviDegree));
221  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getWaitingSeconds));
222  // close building
223  ret->closeBuilding();
224  return ret;
225 }
226 
227 
232  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getMap().size());
233  // add items
234  ret->mkItem("Type Information:", false, "");
235  ret->mkItem("type [id]", false, myVType->getID());
236  ret->mkItem("length", false, myVType->getLength());
237  ret->mkItem("width", false, myVType->getWidth());
238  ret->mkItem("height", false, myVType->getHeight());
239  ret->mkItem("minGap", false, myVType->getMinGap());
240  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
241  // close building
242  ret->closeBuilding(&(myVType->getParameter()));
243  return ret;
244 }
245 
246 
247 
248 Boundary
250  Boundary b;
251  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
252  b.add(getPosition());
253  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
254  return b;
255 }
256 
257 
258 void
260  glPushName(getGlID());
261  glPushMatrix();
262  Position p1 = getPosition();
264  p1 = myPositionInVehicle;
265  }
266  glTranslated(p1.x(), p1.y(), getType());
267  glRotated(90, 0, 0, 1);
268  // set person color
269  setColor(s);
270  // scale
271  const double upscale = s.personSize.getExaggeration(s, 80);
272  glScaled(upscale, upscale, 1);
273  switch (s.personQuality) {
274  case 0:
275  case 1:
277  break;
278  case 2:
280  break;
281  case 3:
282  default:
284  break;
285  }
286  glPopMatrix();
287 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
289 #endif
290  drawName(p1, s.scale, s.personName);
291  glPopName();
292 }
293 
294 void
297  if (stage != 0) {
298  setColor(s);
299  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
300  if (stripingState != 0) {
301  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
302  if (waPath != 0) {
303  glPushMatrix();
304  glTranslated(0, 0, getType());
305  GLHelper::drawBoxLines(waPath->shape, 0.05);
306  glPopMatrix();
307  }
308  }
309  }
310 }
311 
312 void
314  glPushName(getGlID());
315  glPushMatrix();
316  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
319  }
322  setColor(s);
323  RGBColor current = GLHelper::getColor();
324  RGBColor darker = current.changedBrightness(-51);
325  GLHelper::setColor(darker);
327  assert(stage != 0);
328  const double exaggeration = s.personSize.getExaggeration(s);
329  const ConstMSEdgeVector& edges = stage->getRoute();
330  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
331  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
332  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
333  }
334  }
335  }
336  glPopMatrix();
337  glPopName();
338 }
339 
340 
341 
342 
343 void
345  const GUIColorer& c = s.personColorer;
346  if (!setFunctionalColor(c.getActive())) {
348  }
349 }
350 
351 
352 bool
353 GUIPerson::setFunctionalColor(int activeScheme) const {
354  switch (activeScheme) {
355  case 0: {
356  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
358  return true;
359  }
360  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
361  GLHelper::setColor(getVehicleType().getColor());
362  return true;
363  }
364  return false;
365  }
366  case 2: {
367  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
369  return true;
370  }
371  return false;
372  }
373  case 3: {
374  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
375  GLHelper::setColor(getVehicleType().getColor());
376  return true;
377  }
378  return false;
379  }
380  case 8: { // color by angle
381  double hue = GeomHelper::naviDegree(getAngle());
383  return true;
384  }
385  case 9: { // color randomly (by pointer)
386  const double hue = (long)this % 360; // [0-360]
387  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
388  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
389  return true;
390  }
391  default:
392  return false;
393  }
394 }
395 
396 
397 double
398 GUIPerson::getColorValue(int activeScheme) const {
399  switch (activeScheme) {
400  case 4:
401  return getSpeed();
402  case 5:
403  if (isWaiting4Vehicle()) {
404  return 3;
405  } else {
406  return (double)getCurrentStageType();
407  }
408  case 6:
409  return getWaitingSeconds();
410  case 7:
412  }
413  return 0;
414 }
415 
416 
417 double
420  return MSPerson::getEdgePos();
421 }
422 
423 
424 Position
427  return MSPerson::getPosition();
428 }
429 
430 
431 double
435 }
436 
437 
438 double
442 }
443 
444 
445 double
448  return MSPerson::getSpeed();
449 }
450 
451 
452 void
454  // draw triangle pointing forward
455  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
456  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
457  glBegin(GL_TRIANGLES);
458  glVertex2d(0., 0.);
459  glVertex2d(1, -0.5);
460  glVertex2d(1, 0.5);
461  glEnd();
462  // draw a smaller triangle to indicate facing
463  GLHelper::setColor(GLHelper::getColor().changedBrightness(-64));
464  glTranslated(0, 0, .045);
465  glBegin(GL_TRIANGLES);
466  glVertex2d(0., 0.);
467  glVertex2d(0.5, -0.25);
468  glVertex2d(0.5, 0.25);
469  glEnd();
470  glTranslated(0, 0, -.045);
471 }
472 
473 
474 void
476  // draw pedestrian shape
477  glRotated(GeomHelper::naviDegree(getAngle()) - 180, 0, 0, -1);
478  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
480  glTranslated(0, 0, .045);
481  // head
482  glScaled(1, 0.5, 1.);
484  // nose
485  glBegin(GL_TRIANGLES);
486  glVertex2d(0.0, -0.2);
487  glVertex2d(0.0, 0.2);
488  glVertex2d(-0.6, 0.0);
489  glEnd();
490  glTranslated(0, 0, -.045);
491  // body
492  glScaled(0.9, 2.0, 1);
493  glTranslated(0, 0, .04);
494  GLHelper::setColor(lighter);
496  glTranslated(0, 0, -.04);
497 }
498 
499 
500 void
502  const std::string& file = getVehicleType().getImgFile();
503  if (file != "") {
504  if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) {
505  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
506  }
507  int textureID = GUITexturesHelper::getTextureID(file);
508  if (textureID > 0) {
509  const double exaggeration = s.personSize.getExaggeration(s);
510  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
511  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
512  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
513  }
514  } else {
515  // fallback if no image is defined
517  }
518 }
519 
520 
521 // ------------ Additional visualisations
522 bool
524  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
525 }
526 
527 
528 void
530  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
531  myAdditionalVisualizations[parent] = 0;
532  }
533  myAdditionalVisualizations[parent] |= which;
534  parent->addAdditionalGLVisualisation(this);
535 }
536 
537 
538 void
540  myAdditionalVisualizations[parent] &= ~which;
541  parent->removeAdditionalGLVisualisation(this);
542 }
543 
544 bool
547 }
548 
549 /****************************************************************************/
550 
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:829
double getMinGap() const
Get the free space in front of vehicles of this class.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIPerson.h:214
virtual double getAngle() const
return the current angle of the transportable
virtual double getEdgePos() const
Return the position on the edge.
double scale
information about a lane&#39;s width (temporary, used for a single view)
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:295
static void drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
Definition: GLHelper.cpp:172
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
show persons&#39;s current route
Definition: GUIPerson.h:208
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:126
GUIVisualizationTextSettings personName
double getEdgePos() const
return the offset from the start of the current edge
Definition: GUIPerson.cpp:418
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
double getWaitingSeconds() const
the time this person spent waiting in seconds
Definition: GUIPerson.cpp:439
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb.
Definition: RGBColor.cpp:302
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:501
const SUMOVehicleParameter & getParameter() const
double x() const
Returns the x-position.
Definition: Position.h:63
Stores the information about how to visualize structures.
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
Definition: GUIPerson.cpp:523
Start to track a vehicle.
Definition: GUIAppEnum.h:273
#define INVALID
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
T MAX2(T a, T b)
Definition: StdDefs.h:74
double getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
const std::string & getID() const
returns the id of the transportable
GUISUMOAbstractView * myParent
The parent window.
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:79
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:344
#define RAD2DEG(x)
Definition: GeomHelper.h:46
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:475
virtual void stopTrack()
stop track
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:339
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
The car-following model and parameter.
Definition: MSVehicleType.h:73
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:208
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:398
virtual double getSpeed() const
the current speed of the transportable
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:835
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
virtual GUIGlID getTrackedID() const
get tracked id
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:96
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:247
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:108
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:134
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:175
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:187
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:249
const MSVehicleType & getVehicleType() const
virtual void startTrack(int)
star track
MSVehicleType * myVType
This transportable&#39;s type. (mainly used for drawing related information Note sure if it is really nec...
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
const SUMOVTypeParameter & getParameter() const
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:313
const MSEdge * getEdge() const
Returns the current edge.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:438
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:174
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:170
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:117
StageType getCurrentStageType() const
the current stage type of the transportable
a person
double y() const
Returns the y-position.
Definition: Position.h:68
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:229
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
const T getColor(const double value) const
GUIColorer personColorer
The person colorer.
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:157
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:302
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:453
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:446
show the current walkingarea path
Definition: GUIPerson.h:206
const int VEHPARS_COLOR_SET
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:432
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
Hide persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:283
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:539
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:259
const MSEdge & getDestination() const
Returns the current destination.
Show persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:281
void unlock()
release mutex lock
Definition: MFXMutex.cpp:94
const MSEdge * getFromEdge() const
Returns the departure edge.
double getLength() const
Get vehicle&#39;s length [m].
render as a pedestrian
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIPerson.cpp:143
Stop to track a vehicle.
Definition: GUIAppEnum.h:275
Structure representing possible vehicle parameter.
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
Constructor.
Definition: GUIPerson.cpp:155
Hide vehicle&#39;s current route.
Definition: GUIAppEnum.h:263
#define M_PI
Definition: odrSpiral.cpp:40
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:71
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:529
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.cpp:434
The popup menu of a globject.
Container for pedestrian state and individual position update function.
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
const std::string & getID() const
Returns the name of the vehicle type.
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
void lock()
lock mutex
Definition: MFXMutex.cpp:84
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Show vehicle&#39;s current route.
Definition: GUIAppEnum.h:261
~GUIPerson()
destructor
Definition: GUIPerson.cpp:162
std::string getImgFile() const
Get this vehicle type&#39;s raster model file name.
bool isSelected() const
whether this person is selected in the GUI
Definition: GUIPerson.cpp:545
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:99
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:86
GUIGlObject * myObject
The object that belongs to this popup-menu.
Position getPosition() const
return the Network coordinate of the person
Definition: GUIPerson.cpp:425
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUISelectedStorage gSelected
A global holder of selected objects.
Position myPositionInVehicle
The position of a person while riding a vehicle.
Definition: GUIPerson.h:250
A window containing a gl-object&#39;s parameter.
const int VTYPEPARS_COLOR_SET
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIPerson.cpp:353
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const PositionVector & getShape() const
Definition: GUILane.cpp:823
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:444