SUMO - Simulation of Urban MObility
GUIPerson.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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // A MSPerson extended by some values for usage within the gui
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <cmath>
33 #include <vector>
34 #include <string>
36 #include <microsim/MSVehicleType.h>
45 #include <utils/geom/GeomHelper.h>
51 #include <utils/gui/div/GLHelper.h>
55 #include <gui/GUIGlobals.h>
56 #include "GUILane.h"
57 #include "GUINet.h"
58 #include "GUIEdge.h"
59 #include "GUIPerson.h"
60 
61 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
62 
63 // ===========================================================================
64 // FOX callback mapping
65 // ===========================================================================
66 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
73 };
74 
75 // Object implementation
76 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
77 
78 
79 
80 // ===========================================================================
81 // method definitions
82 // ===========================================================================
83 /* -------------------------------------------------------------------------
84  * GUIPerson::GUIPersonPopupMenu - methods
85  * ----------------------------------------------------------------------- */
87  GUIMainWindow& app, GUISUMOAbstractView& parent,
88  GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations) :
89  GUIGLObjectPopupMenu(app, parent, o),
90  myVehiclesAdditionalVisualizations(additionalVisualizations) {
91 }
92 
93 
95 
96 long
98  assert(myObject->getType() == GLO_PERSON);
99  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
101  }
102  return 1;
103 }
104 
105 long
107  assert(myObject->getType() == GLO_PERSON);
109  return 1;
110 }
111 
112 
113 
114 long
116  assert(myObject->getType() == GLO_PERSON);
117  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
119  }
120  return 1;
121 }
122 
123 long
125  assert(myObject->getType() == GLO_PERSON);
127  return 1;
128 }
129 
130 
131 long
132 GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(FXObject*, FXSelector, void*) {
133  assert(myObject->getType() == GLO_PERSON);
134  if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
135  myParent->startTrack(static_cast<GUIPerson*>(myObject)->getGlID());
136  }
137  return 1;
138 }
139 
140 long
141 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
142  assert(myObject->getType() == GLO_PERSON);
143  myParent->stopTrack();
144  return 1;
145 }
146 
147 
148 
149 
150 /* -------------------------------------------------------------------------
151  * GUIPerson - methods
152  * ----------------------------------------------------------------------- */
154  MSPerson(pars, vtype, plan, speedFactor),
155  GUIGlObject(GLO_PERSON, pars->id),
157 }
158 
159 
161  myLock.lock();
162  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
163  if (i->first->getTrackedID() == getGlID()) {
164  i->first->stopTrack();
165  }
166  while (i->first->removeAdditionalGLVisualisation(this));
167  }
168  myLock.unlock();
169 }
170 
171 
174  GUISUMOAbstractView& parent) {
176  buildPopupHeader(ret, app);
181  new FXMenuCommand(ret, "Hide Current Route", 0, ret, MID_HIDE_CURRENTROUTE);
182  } else {
183  new FXMenuCommand(ret, "Show Current Route", 0, ret, MID_SHOW_CURRENTROUTE);
184  }
186  new FXMenuCommand(ret, "Hide Walkingarea Path", 0, ret, MID_HIDE_WALKINGAREA_PATH);
187  } else {
188  new FXMenuCommand(ret, "Show Walkingarea Path", 0, ret, MID_SHOW_WALKINGAREA_PATH);
189  }
190  new FXMenuSeparator(ret);
191  if (parent.getTrackedID() != getGlID()) {
192  new FXMenuCommand(ret, "Start Tracking", 0, ret, MID_START_TRACK);
193  } else {
194  new FXMenuCommand(ret, "Stop Tracking", 0, ret, MID_STOP_TRACK);
195  }
196  new FXMenuSeparator(ret);
197  //
200  buildPositionCopyEntry(ret, false);
201  return ret;
202 }
203 
204 
209  new GUIParameterTableWindow(app, *this, 12 + (int)getParameter().getMap().size());
210  // add items
211  ret->mkItem("stage", false, getCurrentStageDescription());
212  ret->mkItem("start edge [id]", false, getFromEdge()->getID());
213  ret->mkItem("dest edge [id]", false, getDestination().getID());
214  ret->mkItem("edge [id]", false, getEdge()->getID());
215  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
216  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
217  ret->mkItem("speed factor", false, getSpeedFactor());
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  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
221  // close building
222  ret->closeBuilding(&getParameter());
223  return ret;
224 }
225 
226 
231  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getMap().size());
232  // add items
233  ret->mkItem("Type Information:", false, "");
234  ret->mkItem("type [id]", false, myVType->getID());
235  ret->mkItem("length", false, myVType->getLength());
236  ret->mkItem("width", false, myVType->getWidth());
237  ret->mkItem("height", false, myVType->getHeight());
238  ret->mkItem("minGap", false, myVType->getMinGap());
239  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
240  // close building
241  ret->closeBuilding(&(myVType->getParameter()));
242  return ret;
243 }
244 
245 
246 Boundary
248  Boundary b;
249  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
250  b.add(getPosition());
251  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
252  return b;
253 }
254 
255 
256 void
258  glPushName(getGlID());
259  glPushMatrix();
260  Position p1 = getPosition();
262  p1 = myPositionInVehicle;
263  }
264  glTranslated(p1.x(), p1.y(), getType());
265  glRotated(90, 0, 0, 1);
266  // set person color
267  setColor(s);
268  // scale
269  const double upscale = s.personSize.getExaggeration(s, 80);
270  glScaled(upscale, upscale, 1);
271  switch (s.personQuality) {
272  case 0:
273  case 1:
275  break;
276  case 2:
278  break;
279  case 3:
280  default:
282  break;
283  }
284  glPopMatrix();
285 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
287 #endif
288  drawName(p1, s.scale, s.personName);
289  glPopName();
290 }
291 
292 void
295  if (stage != 0) {
296  setColor(s);
297  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
298  if (stripingState != 0) {
299  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
300  if (waPath != 0) {
301  glPushMatrix();
302  glTranslated(0, 0, getType());
303  GLHelper::drawBoxLines(waPath->shape, 0.05);
304  glPopMatrix();
305  }
306  }
307  }
308 }
309 
310 void
312  glPushName(getGlID());
313  glPushMatrix();
314  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
317  }
320  setColor(s);
321  RGBColor current = GLHelper::getColor();
322  RGBColor darker = current.changedBrightness(-51);
323  GLHelper::setColor(darker);
325  assert(stage != 0);
326  const double exaggeration = s.personSize.getExaggeration(s);
327  const ConstMSEdgeVector& edges = stage->getRoute();
328  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
329  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
330  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
331  }
332  }
333  }
334  glPopMatrix();
335  glPopName();
336 }
337 
338 
339 
340 
341 void
343  const GUIColorer& c = s.personColorer;
344  if (!setFunctionalColor(c.getActive())) {
346  }
347 }
348 
349 
350 bool
351 GUIPerson::setFunctionalColor(int activeScheme) const {
352  switch (activeScheme) {
353  case 0: {
354  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
356  return true;
357  }
358  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
359  GLHelper::setColor(getVehicleType().getColor());
360  return true;
361  }
362  return false;
363  }
364  case 2: {
365  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
367  return true;
368  }
369  return false;
370  }
371  case 3: {
372  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
373  GLHelper::setColor(getVehicleType().getColor());
374  return true;
375  }
376  return false;
377  }
378  case 8: { // color by angle
379  double hue = GeomHelper::naviDegree(getAngle());
381  return true;
382  }
383  case 9: { // color randomly (by pointer)
384  const double hue = (long)this % 360; // [0-360]
385  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
386  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
387  return true;
388  }
389  default:
390  return false;
391  }
392 }
393 
394 
395 double
396 GUIPerson::getColorValue(int activeScheme) const {
397  switch (activeScheme) {
398  case 4:
399  return getSpeed();
400  case 5:
401  if (isWaiting4Vehicle()) {
402  return 3;
403  } else {
404  return (double)getCurrentStageType();
405  }
406  case 6:
407  return getWaitingSeconds();
408  case 7:
410  }
411  return 0;
412 }
413 
414 
415 double
418  return MSPerson::getEdgePos();
419 }
420 
421 
422 Position
425  return MSPerson::getPosition();
426 }
427 
428 
429 double
433 }
434 
435 
436 double
440 }
441 
442 
443 double
446  return MSPerson::getSpeed();
447 }
448 
449 
450 void
452  // draw triangle pointing forward
453  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
454  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
455  glBegin(GL_TRIANGLES);
456  glVertex2d(0., 0.);
457  glVertex2d(1, -0.5);
458  glVertex2d(1, 0.5);
459  glEnd();
460  // draw a smaller triangle to indicate facing
461  GLHelper::setColor(GLHelper::getColor().changedBrightness(-64));
462  glTranslated(0, 0, .045);
463  glBegin(GL_TRIANGLES);
464  glVertex2d(0., 0.);
465  glVertex2d(0.5, -0.25);
466  glVertex2d(0.5, 0.25);
467  glEnd();
468  glTranslated(0, 0, -.045);
469 }
470 
471 
472 void
474  // draw pedestrian shape
475  glRotated(GeomHelper::naviDegree(getAngle()) - 180, 0, 0, -1);
476  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
478  glTranslated(0, 0, .045);
479  // head
480  glScaled(1, 0.5, 1.);
482  // nose
483  glBegin(GL_TRIANGLES);
484  glVertex2d(0.0, -0.2);
485  glVertex2d(0.0, 0.2);
486  glVertex2d(-0.6, 0.0);
487  glEnd();
488  glTranslated(0, 0, -.045);
489  // body
490  glScaled(0.9, 2.0, 1);
491  glTranslated(0, 0, .04);
492  GLHelper::setColor(lighter);
494  glTranslated(0, 0, -.04);
495 }
496 
497 
498 void
500  const std::string& file = getVehicleType().getImgFile();
501  if (file != "") {
502  if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) {
503  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
504  }
505  int textureID = GUITexturesHelper::getTextureID(file);
506  if (textureID > 0) {
507  const double exaggeration = s.personSize.getExaggeration(s);
508  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
509  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
510  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
511  }
512  } else {
513  // fallback if no image is defined
515  }
516 }
517 
518 
519 // ------------ Additional visualisations
520 bool
522  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
523 }
524 
525 
526 void
528  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
529  myAdditionalVisualizations[parent] = 0;
530  }
531  myAdditionalVisualizations[parent] |= which;
532  parent->addAdditionalGLVisualisation(this);
533 }
534 
535 
536 void
538  myAdditionalVisualizations[parent] &= ~which;
539  parent->removeAdditionalGLVisualisation(this);
540 }
541 
542 bool
545 }
546 
547 /****************************************************************************/
548 
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:830
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:213
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:293
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:183
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:207
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:124
GUIVisualizationTextSettings personName
double getEdgePos() const
return the offset from the start of the current edge
Definition: GUIPerson.cpp:416
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:437
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb.
Definition: RGBColor.cpp:301
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:499
const SUMOVehicleParameter & getParameter() const
double x() const
Returns the x-position.
Definition: Position.h:62
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:521
#define INVALID
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:59
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:73
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:342
#define RAD2DEG(x)
Definition: GeomHelper.h:45
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:473
virtual void stopTrack()
stop track
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:350
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.
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
Definition: GUIPerson.cpp:153
GUIGlID getGlID() const
Returns the numerical id of the object.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:47
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:72
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:206
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:396
virtual double getSpeed() const
the current speed of the transportable
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:836
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:69
virtual GUIGlID getTrackedID() const
get tracked id
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:94
Hide persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:280
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:246
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:106
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:132
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:173
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.
Show vehicle&#39;s current route.
Definition: GUIAppEnum.h:258
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:186
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:247
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...
Show persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:278
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:311
const MSEdge * getEdge() const
Returns the current edge.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:449
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:172
Hide vehicle&#39;s current route.
Definition: GUIAppEnum.h:260
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:45
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:168
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:115
StageType getCurrentStageType() const
the current stage type of the transportable
a person
double y() const
Returns the y-position.
Definition: Position.h:67
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:228
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:156
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:451
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:444
show the current walkingarea path
Definition: GUIPerson.h:205
const int VEHPARS_COLOR_SET
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:430
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:537
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:257
const MSEdge & getDestination() const
Returns the current destination.
void unlock()
release mutex lock
Definition: MFXMutex.cpp:93
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:141
Structure representing possible vehicle parameter.
#define M_PI
Definition: odrSpiral.cpp:40
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:70
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:527
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.h:302
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:83
virtual Position getPosition() const
Return the Network coordinate of the transportable.
~GUIPerson()
destructor
Definition: GUIPerson.cpp:160
Start to track a vehicle.
Definition: GUIAppEnum.h:270
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:543
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:97
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:85
GUIGlObject * myObject
The object that belongs to this popup-menu.
Stop to track a vehicle.
Definition: GUIAppEnum.h:272
Position getPosition() const
return the Network coordinate of the person
Definition: GUIPerson.cpp:423
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:249
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:351
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const PositionVector & getShape() const
Definition: GUILane.cpp:824
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:455