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>
46 #include <utils/geom/GeomHelper.h>
52 #include <utils/gui/div/GLHelper.h>
56 #include <gui/GUIGlobals.h>
57 #include "GUILane.h"
58 #include "GUINet.h"
59 #include "GUIEdge.h"
60 #include "GUIPerson.h"
61 
62 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
63 
64 // ===========================================================================
65 // FOX callback mapping
66 // ===========================================================================
67 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
74 };
75 
76 // Object implementation
77 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
78 
79 
80 
81 // ===========================================================================
82 // method definitions
83 // ===========================================================================
84 /* -------------------------------------------------------------------------
85  * GUIPerson::GUIPersonPopupMenu - methods
86  * ----------------------------------------------------------------------- */
88  GUIMainWindow& app, GUISUMOAbstractView& parent,
89  GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations) :
90  GUIGLObjectPopupMenu(app, parent, o),
91  myVehiclesAdditionalVisualizations(additionalVisualizations) {
92 }
93 
94 
96 
97 long
99  assert(myObject->getType() == GLO_PERSON);
100  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
102  }
103  return 1;
104 }
105 
106 long
108  assert(myObject->getType() == GLO_PERSON);
110  return 1;
111 }
112 
113 
114 
115 long
117  assert(myObject->getType() == GLO_PERSON);
118  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
120  }
121  return 1;
122 }
123 
124 long
126  assert(myObject->getType() == GLO_PERSON);
128  return 1;
129 }
130 
131 
132 long
133 GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(FXObject*, FXSelector, void*) {
134  assert(myObject->getType() == GLO_PERSON);
135  if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
136  myParent->startTrack(static_cast<GUIPerson*>(myObject)->getGlID());
137  }
138  return 1;
139 }
140 
141 long
142 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
143  assert(myObject->getType() == GLO_PERSON);
144  myParent->stopTrack();
145  return 1;
146 }
147 
148 
149 
150 
151 /* -------------------------------------------------------------------------
152  * GUIPerson - methods
153  * ----------------------------------------------------------------------- */
155  MSPerson(pars, vtype, plan),
156  GUIGlObject(GLO_PERSON, pars->id),
158 }
159 
160 
162  myLock.lock();
163  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
164  if (i->first->getTrackedID() == getGlID()) {
165  i->first->stopTrack();
166  }
167  while (i->first->removeAdditionalGLVisualisation(this));
168  }
169  myLock.unlock();
170 }
171 
172 
175  GUISUMOAbstractView& parent) {
177  buildPopupHeader(ret, app);
182  new FXMenuCommand(ret, "Hide Current Route", 0, ret, MID_HIDE_CURRENTROUTE);
183  } else {
184  new FXMenuCommand(ret, "Show Current Route", 0, ret, MID_SHOW_CURRENTROUTE);
185  }
187  new FXMenuCommand(ret, "Hide Walkingarea Path", 0, ret, MID_HIDE_WALKINGAREA_PATH);
188  } else {
189  new FXMenuCommand(ret, "Show Walkingarea Path", 0, ret, MID_SHOW_WALKINGAREA_PATH);
190  }
191  new FXMenuSeparator(ret);
192  if (parent.getTrackedID() != getGlID()) {
193  new FXMenuCommand(ret, "Start Tracking", 0, ret, MID_START_TRACK);
194  } else {
195  new FXMenuCommand(ret, "Stop Tracking", 0, ret, MID_STOP_TRACK);
196  }
197  new FXMenuSeparator(ret);
198  //
201  buildPositionCopyEntry(ret, false);
202  return ret;
203 }
204 
205 
210  new GUIParameterTableWindow(app, *this, 16);
211  // add items
212  ret->mkItem("stage", false, getCurrentStageDescription());
213  ret->mkItem("start edge [id]", false, getFromEdge()->getID());
214  ret->mkItem("dest edge [id]", false, getDestination().getID());
215  ret->mkItem("edge [id]", false, getEdge()->getID());
216  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
217  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
218  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getNaviDegree));
219  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getWaitingSeconds));
220 
221  ret->mkItem("parameters [key:val]", false, toString(getParameter().getMap()));
222  // close building
223  ret->closeBuilding();
224  return ret;
225 }
226 
227 
232  new GUIParameterTableWindow(app, *this, 9);
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 
242  ret->mkItem("type parameters [key:val]", false, toString(myVType->getParameter().getMap()));
243  // close building
244  ret->closeBuilding();
245  return ret;
246 }
247 
248 
249 
250 Boundary
252  Boundary b;
253  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
254  b.add(getPosition());
255  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
256  return b;
257 }
258 
259 
260 void
262  glPushName(getGlID());
263  glPushMatrix();
264  Position p1 = getPosition();
266  p1 = myPositionInVehicle;
267  }
268  glTranslated(p1.x(), p1.y(), getType());
269  glRotated(90, 0, 0, 1);
270  // set person color
271  setColor(s);
272  // scale
273  const double upscale = s.personSize.getExaggeration(s, 80);
274  glScaled(upscale, upscale, 1);
275  switch (s.personQuality) {
276  case 0:
277  case 1:
279  break;
280  case 2:
282  break;
283  case 3:
284  default:
286  break;
287  }
288  glPopMatrix();
289 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
291 #endif
292  drawName(p1, s.scale, s.personName);
293  glPopName();
294 }
295 
296 void
299  if (stage != 0) {
300  setColor(s);
301  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
302  if (stripingState != 0) {
303  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
304  if (waPath != 0) {
305  glPushMatrix();
306  glTranslated(0, 0, getType());
307  GLHelper::drawBoxLines(waPath->shape, 0.05);
308  glPopMatrix();
309  }
310  }
311  }
312 }
313 
314 void
316  glPushName(getGlID());
317  glPushMatrix();
318  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
321  }
324  setColor(s);
325  RGBColor current = GLHelper::getColor();
326  RGBColor darker = current.changedBrightness(-51);
327  GLHelper::setColor(darker);
329  assert(stage != 0);
330  const double exaggeration = s.personSize.getExaggeration(s);
331  const ConstMSEdgeVector& edges = stage->getRoute();
332  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
333  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
334  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
335  }
336  }
337  }
338  glPopMatrix();
339  glPopName();
340 }
341 
342 
343 
344 
345 void
347  const GUIColorer& c = s.personColorer;
348  if (!setFunctionalColor(c.getActive())) {
350  }
351 }
352 
353 
354 bool
355 GUIPerson::setFunctionalColor(int activeScheme) const {
356  switch (activeScheme) {
357  case 0: {
358  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
360  return true;
361  }
362  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
363  GLHelper::setColor(getVehicleType().getColor());
364  return true;
365  }
366  return false;
367  }
368  case 2: {
369  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
371  return true;
372  }
373  return false;
374  }
375  case 3: {
376  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
377  GLHelper::setColor(getVehicleType().getColor());
378  return true;
379  }
380  return false;
381  }
382  case 8: { // color by angle
383  double hue = GeomHelper::naviDegree(getAngle());
385  return true;
386  }
387  case 9: { // color randomly (by pointer)
388  const double hue = (long)this % 360; // [0-360]
389  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
390  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
391  return true;
392  }
393  default:
394  return false;
395  }
396 }
397 
398 
399 double
400 GUIPerson::getColorValue(int activeScheme) const {
401  switch (activeScheme) {
402  case 4:
403  return getSpeed();
404  case 5:
405  if (isWaiting4Vehicle()) {
406  return 3;
407  } else {
408  return (double)getCurrentStageType();
409  }
410  case 6:
411  return getWaitingSeconds();
412  case 7:
414  }
415  return 0;
416 }
417 
418 
419 double
422  return MSPerson::getEdgePos();
423 }
424 
425 
426 Position
429  return MSPerson::getPosition();
430 }
431 
432 
433 double
437 }
438 
439 
440 double
444 }
445 
446 
447 double
450  return MSPerson::getSpeed();
451 }
452 
453 
454 void
456  // draw triangle pointing forward
457  glRotated(RAD2DEG(getAngle() + PI / 2.), 0, 0, 1);
458  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
459  glBegin(GL_TRIANGLES);
460  glVertex2d(0., 0.);
461  glVertex2d(1, -0.5);
462  glVertex2d(1, 0.5);
463  glEnd();
464  // draw a smaller triangle to indicate facing
465  GLHelper::setColor(GLHelper::getColor().changedBrightness(-64));
466  glTranslated(0, 0, .045);
467  glBegin(GL_TRIANGLES);
468  glVertex2d(0., 0.);
469  glVertex2d(0.5, -0.25);
470  glVertex2d(0.5, 0.25);
471  glEnd();
472  glTranslated(0, 0, -.045);
473 }
474 
475 
476 void
478  // draw pedestrian shape
479  glRotated(GeomHelper::naviDegree(getAngle()) - 180, 0, 0, -1);
480  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
482  glTranslated(0, 0, .045);
483  // head
484  glScaled(1, 0.5, 1.);
486  // nose
487  glBegin(GL_TRIANGLES);
488  glVertex2d(0.0, -0.2);
489  glVertex2d(0.0, 0.2);
490  glVertex2d(-0.6, 0.0);
491  glEnd();
492  glTranslated(0, 0, -.045);
493  // body
494  glScaled(0.9, 2.0, 1);
495  glTranslated(0, 0, .04);
496  GLHelper::setColor(lighter);
498  glTranslated(0, 0, -.04);
499 }
500 
501 
502 void
504  const std::string& file = getVehicleType().getImgFile();
505  if (file != "") {
506  if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) {
507  glRotated(RAD2DEG(getAngle() + PI / 2.), 0, 0, 1);
508  }
509  int textureID = GUITexturesHelper::getTextureID(file);
510  if (textureID > 0) {
511  const double exaggeration = s.personSize.getExaggeration(s);
512  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
513  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
514  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
515  }
516  } else {
517  // fallback if no image is defined
519  }
520 }
521 
522 
523 // ------------ Additional visualisations
524 bool
526  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
527 }
528 
529 
530 void
532  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
533  myAdditionalVisualizations[parent] = 0;
534  }
535  myAdditionalVisualizations[parent] |= which;
536  parent->addAdditionalGLVisualisation(this);
537 }
538 
539 
540 void
542  myAdditionalVisualizations[parent] &= ~which;
543  parent->removeAdditionalGLVisualisation(this);
544 }
545 /****************************************************************************/
546 
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
Hide vehicle&#39;s current route.
Definition: GUIAppEnum.h:263
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:794
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:212
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 drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:297
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:206
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:125
GUIVisualizationTextSettings personName
double getEdgePos() const
return the offset from the start of the current edge
Definition: GUIPerson.cpp:420
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:441
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb.
Definition: RGBColor.cpp:290
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:503
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:525
Stop to track a vehicle.
Definition: GUIAppEnum.h:275
#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:70
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:78
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:346
#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:477
virtual void stopTrack()
stop track
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:340
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.
Start to track a vehicle.
Definition: GUIAppEnum.h:273
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:74
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:207
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:400
virtual double getSpeed() const
the current speed of the transportable
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:800
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:95
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:245
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:107
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:133
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:174
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:251
const MSVehicleType & getVehicleType() const
virtual void startTrack(int)
star track
Show vehicle&#39;s current route.
Definition: GUIAppEnum.h:261
#define PI
Definition: polyfonts.c:61
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:315
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:56
const MSEdge * getEdge() const
Returns the current edge.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:439
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
const MSVehicleType * myVType
This transportable&#39;s type. (mainly used for drawing related information Note sure if it is really nec...
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:116
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:146
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:234
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:455
Show persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:281
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:448
show the current walkingarea path
Definition: GUIPerson.h:204
const int VEHPARS_COLOR_SET
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:434
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
GUIPerson(const SUMOVehicleParameter *pars, const MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan)
Constructor.
Definition: GUIPerson.cpp:154
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:541
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:261
const MSEdge & getDestination() const
Returns the current destination.
Hide persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:283
void unlock()
release mutex lock
Definition: MFXMutex.cpp:92
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:142
Structure representing possible vehicle parameter.
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:531
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:82
virtual Position getPosition() const
Return the Network coordinate of the transportable.
~GUIPerson()
destructor
Definition: GUIPerson.cpp:161
std::string getImgFile() const
Get this vehicle type&#39;s raster model file name.
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:98
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:427
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.
void closeBuilding()
Closes the building of the table.
Position myPositionInVehicle
The position of a person while riding a vehicle.
Definition: GUIPerson.h:248
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:355
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const PositionVector & getShape() const
Definition: GUILane.cpp:788
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:445