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-2018 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 /****************************************************************************/
17 // A MSPerson extended by some values for usage within the gui
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <cmath>
27 #include <vector>
28 #include <string>
30 #include <microsim/MSVehicleType.h>
39 #include <utils/geom/GeomHelper.h>
45 #include <utils/gui/div/GLHelper.h>
50 #include <gui/GUIGlobals.h>
51 #include "GUILane.h"
52 #include "GUINet.h"
53 #include "GUIEdge.h"
54 #include "GUIPerson.h"
55 
56 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
57 
58 // ===========================================================================
59 // FOX callback mapping
60 // ===========================================================================
61 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
69 };
70 
71 // Object implementation
72 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
73 
74 
75 
76 // ===========================================================================
77 // method definitions
78 // ===========================================================================
79 /* -------------------------------------------------------------------------
80  * GUIPerson::GUIPersonPopupMenu - methods
81  * ----------------------------------------------------------------------- */
83  GUIMainWindow& app, GUISUMOAbstractView& parent,
84  GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations) :
85  GUIGLObjectPopupMenu(app, parent, o),
86  myVehiclesAdditionalVisualizations(additionalVisualizations) {
87 }
88 
89 
91 
92 long
94  assert(myObject->getType() == GLO_PERSON);
95  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
97  }
98  return 1;
99 }
100 
101 long
103  assert(myObject->getType() == GLO_PERSON);
105  return 1;
106 }
107 
108 
109 
110 long
112  assert(myObject->getType() == GLO_PERSON);
113  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
115  }
116  return 1;
117 }
118 
119 long
121  assert(myObject->getType() == GLO_PERSON);
123  return 1;
124 }
125 
126 
127 long
128 GUIPerson::GUIPersonPopupMenu::onCmdShowPlan(FXObject*, FXSelector, void*) {
129  GUIPerson* p = dynamic_cast<GUIPerson*>(myObject);
130  if (p == 0) {
131  return 1;
132  }
134  // add items
135  for (int stage = 1; stage < p->getNumStages(); stage++) {
136  ret->mkItem(toString(stage).c_str(), false, p->getStageSummary(stage));
137  }
138  // close building (use an object that is not Parameterised as argument)
140  ret->closeBuilding(&dummy);
141  return 1;
142 }
143 
144 
145 long
146 GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(FXObject*, FXSelector, void*) {
147  assert(myObject->getType() == GLO_PERSON);
148  if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
149  myParent->startTrack(static_cast<GUIPerson*>(myObject)->getGlID());
150  }
151  return 1;
152 }
153 
154 long
155 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
156  assert(myObject->getType() == GLO_PERSON);
157  myParent->stopTrack();
158  return 1;
159 }
160 
161 
162 
163 
164 /* -------------------------------------------------------------------------
165  * GUIPerson - methods
166  * ----------------------------------------------------------------------- */
168  MSPerson(pars, vtype, plan, speedFactor),
169  GUIGlObject(GLO_PERSON, pars->id),
171 }
172 
173 
175  myLock.lock();
176  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
177  if (i->first->getTrackedID() == getGlID()) {
178  i->first->stopTrack();
179  }
180  while (i->first->removeAdditionalGLVisualisation(this));
181  }
182  myLock.unlock();
183 }
184 
185 
188  GUISUMOAbstractView& parent) {
190  buildPopupHeader(ret, app);
195  new FXMenuCommand(ret, "Hide Current Route", 0, ret, MID_HIDE_CURRENTROUTE);
196  } else {
197  new FXMenuCommand(ret, "Show Current Route", 0, ret, MID_SHOW_CURRENTROUTE);
198  }
200  new FXMenuCommand(ret, "Hide Walkingarea Path", 0, ret, MID_HIDE_WALKINGAREA_PATH);
201  } else {
202  new FXMenuCommand(ret, "Show Walkingarea Path", 0, ret, MID_SHOW_WALKINGAREA_PATH);
203  }
204  new FXMenuSeparator(ret);
205  if (parent.getTrackedID() != getGlID()) {
206  new FXMenuCommand(ret, "Start Tracking", 0, ret, MID_START_TRACK);
207  } else {
208  new FXMenuCommand(ret, "Stop Tracking", 0, ret, MID_STOP_TRACK);
209  }
210  new FXMenuSeparator(ret);
211  //
214  new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN);
215  new FXMenuSeparator(ret);
216  buildPositionCopyEntry(ret, false);
217  return ret;
218 }
219 
220 
225  new GUIParameterTableWindow(app, *this, 12 + (int)getParameter().getParametersMap().size());
226  // add items
227  ret->mkItem("stage", false, getCurrentStageDescription());
228  // there is always the "start" stage which we do not count here because it is not strictly part of the plan
229  ret->mkItem("stage index", false, toString(getNumStages() - getNumRemainingStages()) + " of " + toString(getNumStages() - 1));
230  ret->mkItem("start edge [id]", false, getFromEdge()->getID());
231  ret->mkItem("dest edge [id]", false, getDestination()->getID());
232  ret->mkItem("arrivalPos [m]", false, toString(getCurrentStage()->getArrivalPos()));
233  ret->mkItem("edge [id]", false, getEdge()->getID());
234  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
235  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
236  ret->mkItem("speed factor", false, getSpeedFactor());
237  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getNaviDegree));
238  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getWaitingSeconds));
239  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
240  // close building
241  ret->closeBuilding(&getParameter());
242  return ret;
243 }
244 
245 
250  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getParametersMap().size());
251  // add items
252  ret->mkItem("Type Information:", false, "");
253  ret->mkItem("type [id]", false, myVType->getID());
254  ret->mkItem("length", false, myVType->getLength());
255  ret->mkItem("width", false, myVType->getWidth());
256  ret->mkItem("height", false, myVType->getHeight());
257  ret->mkItem("minGap", false, myVType->getMinGap());
258  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
259  // close building
260  ret->closeBuilding(&(myVType->getParameter()));
261  return ret;
262 }
263 
264 
265 Boundary
267  Boundary b;
268  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
269  b.add(getGUIPosition());
270  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
271  return b;
272 }
273 
274 
275 void
277  glPushName(getGlID());
278  glPushMatrix();
279  Position p1 = getGUIPosition();
280  glTranslated(p1.x(), p1.y(), getType());
281  glRotated(90, 0, 0, 1);
282  // set person color
283  setColor(s);
284  // scale
285  const double upscale = s.personSize.getExaggeration(s, 80);
286  glScaled(upscale, upscale, 1);
287  switch (s.personQuality) {
288  case 0:
289  case 1:
291  break;
292  case 2:
294  break;
295  case 3:
296  default:
298  break;
299  }
300  glPopMatrix();
301 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
303 #endif
304  drawName(p1, s.scale, s.personName, s.angle);
305  glPopName();
306 }
307 
308 void
311  if (stage != 0) {
312  setColor(s);
313  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
314  if (stripingState != 0) {
315  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
316  if (waPath != 0) {
317  glPushMatrix();
318  glTranslated(0, 0, getType());
319  GLHelper::drawBoxLines(waPath->shape, 0.05);
320  glPopMatrix();
321  }
322  }
323  }
324 }
325 
326 void
328  glPushName(getGlID());
329  glPushMatrix();
330  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
333  }
336  setColor(s);
337  RGBColor current = GLHelper::getColor();
338  RGBColor darker = current.changedBrightness(-51);
339  GLHelper::setColor(darker);
341  assert(stage != 0);
342  const double exaggeration = s.personSize.getExaggeration(s);
343  const ConstMSEdgeVector& edges = stage->getRoute();
344  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
345  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
346  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
347  }
348  }
349  }
350  glPopMatrix();
351  glPopName();
352 }
353 
354 
355 
356 
357 void
359  const GUIColorer& c = s.personColorer;
360  if (!setFunctionalColor(c.getActive())) {
362  }
363 }
364 
365 
366 bool
367 GUIPerson::setFunctionalColor(int activeScheme) const {
368  switch (activeScheme) {
369  case 0: {
370  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
372  return true;
373  }
374  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
375  GLHelper::setColor(getVehicleType().getColor());
376  return true;
377  }
378  return false;
379  }
380  case 2: {
381  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
383  return true;
384  }
385  return false;
386  }
387  case 3: {
388  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
389  GLHelper::setColor(getVehicleType().getColor());
390  return true;
391  }
392  return false;
393  }
394  case 8: { // color by angle
395  double hue = GeomHelper::naviDegree(getAngle());
397  return true;
398  }
399  case 9: { // color randomly (by pointer)
400  const double hue = (long)this % 360; // [0-360]
401  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
402  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
403  return true;
404  }
405  default:
406  return false;
407  }
408 }
409 
410 
411 double
412 GUIPerson::getColorValue(int activeScheme) const {
413  switch (activeScheme) {
414  case 4:
415  return getSpeed();
416  case 5:
417  if (isWaiting4Vehicle()) {
418  return 5;
419  } else {
420  return (double)getCurrentStageType();
421  }
422  case 6:
423  return getWaitingSeconds();
424  case 7:
426  }
427  return 0;
428 }
429 
430 
431 double
434  return MSPerson::getEdgePos();
435 }
436 
437 
438 Position
441  return MSPerson::getPosition();
442 }
443 
444 
445 Position
449  return myPositionInVehicle;
450  } else {
451  return MSPerson::getPosition();
452  }
453 }
454 
455 
456 double
460 }
461 
462 
463 double
467 }
468 
469 
470 double
473  return MSPerson::getSpeed();
474 }
475 
476 
477 void
479  // draw triangle pointing forward
480  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
481  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
482  glBegin(GL_TRIANGLES);
483  glVertex2d(0., 0.);
484  glVertex2d(1, -0.5);
485  glVertex2d(1, 0.5);
486  glEnd();
487  // draw a smaller triangle to indicate facing
488  GLHelper::setColor(GLHelper::getColor().changedBrightness(-64));
489  glTranslated(0, 0, .045);
490  glBegin(GL_TRIANGLES);
491  glVertex2d(0., 0.);
492  glVertex2d(0.5, -0.25);
493  glVertex2d(0.5, 0.25);
494  glEnd();
495  glTranslated(0, 0, -.045);
496 }
497 
498 
499 void
501  // draw pedestrian shape
502  glRotated(GeomHelper::naviDegree(getAngle()) - 180, 0, 0, -1);
503  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
505  glTranslated(0, 0, .045);
506  // head
507  glScaled(1, 0.5, 1.);
509  // nose
510  glBegin(GL_TRIANGLES);
511  glVertex2d(0.0, -0.2);
512  glVertex2d(0.0, 0.2);
513  glVertex2d(-0.6, 0.0);
514  glEnd();
515  glTranslated(0, 0, -.045);
516  // body
517  glScaled(0.9, 2.0, 1);
518  glTranslated(0, 0, .04);
519  GLHelper::setColor(lighter);
521  glTranslated(0, 0, -.04);
522 }
523 
524 
525 void
527  const std::string& file = getVehicleType().getImgFile();
528  if (file != "") {
529  if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) {
530  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
531  }
532  int textureID = GUITexturesHelper::getTextureID(file);
533  if (textureID > 0) {
534  const double exaggeration = s.personSize.getExaggeration(s);
535  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
536  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
537  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
538  }
539  } else {
540  // fallback if no image is defined
542  }
543 }
544 
545 
546 // ------------ Additional visualisations
547 bool
549  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
550 }
551 
552 
553 void
555  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
556  myAdditionalVisualizations[parent] = 0;
557  }
558  myAdditionalVisualizations[parent] |= which;
559  parent->addAdditionalGLVisualisation(this);
560 }
561 
562 
563 void
565  myAdditionalVisualizations[parent] &= ~which;
566  parent->removeAdditionalGLVisualisation(this);
567 }
568 
569 bool
572 }
573 
574 /****************************************************************************/
575 
static void drawTexturedBox(int which, double size)
Draws a named texture as a box with the given size.
bool isSelected() const
whether this person is selected in the GUI
Definition: GUIPerson.cpp:570
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:327
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIPerson.h:212
double scale
information about a lane&#39;s width (temporary, used for a single view)
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
Definition: GUIPerson.cpp:548
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:150
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
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:178
double getArrivalPos() const
returns the final arrival pos
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:120
const MSEdge * getEdge() const
Returns the current edge.
GUIVisualizationTextSettings personName
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb.
Definition: RGBColor.cpp:295
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
virtual double getEdgePos() const
Return the position on the edge.
Position getPosition() const
return the Network coordinate of the person
Definition: GUIPerson.cpp:439
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
Definition: Position.h:61
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:526
#define INVALID
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
std::map< GUISUMOAbstractView *, int > dummy
Needed for parameterless instantiation.
Definition: GUIPerson.h:191
double x() const
Returns the x-position.
Definition: Position.h:56
std::string getImgFile() const
Get this vehicle type&#39;s raster model file name.
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:76
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
GUISUMOAbstractView * myParent
The parent window.
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:72
#define RAD2DEG(x)
Definition: GeomHelper.h:39
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
virtual double getSpeed() const
the current speed of the transportable
const SUMOVehicleParameter & getParameter() const
virtual void stopTrack()
stop track
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:856
static void drawFilledCircle(double width, int steps=8)
Draws a filled circle around (0,0)
Definition: GLHelper.cpp:344
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:167
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
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:66
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:222
Start to track a vehicle.
Definition: GUIAppEnum.h:274
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:171
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:63
double getEdgePos() const
return the offset from the start of the current edge
Definition: GUIPerson.cpp:432
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:90
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:245
const MSEdge * getFromEdge() const
Returns the departure edge.
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:309
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:102
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:146
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:187
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:180
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
virtual GUIGlID getTrackedID() const
get tracked id
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...
Stop to track a vehicle.
Definition: GUIAppEnum.h:276
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
void drawAction_drawAsPoly(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:500
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:49
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:573
double getWaitingSeconds() const
the time this person spent waiting in seconds
Definition: GUIPerson.cpp:464
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:457
virtual double getAngle() const
return the current angle of the transportable
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:111
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIPerson.cpp:367
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:247
static int getTextureID(const std::string &filename, const bool mirrorX=false)
return texture id for the given filename (initialize on first use)
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
double getMaxSpeed() const
Get vehicle&#39;s maximum speed [m/s].
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
GUIColorer personColorer
The person colorer.
const std::string & getID() const
returns the id of the transportable
const PositionVector & getShape() const
Definition: GUILane.cpp:850
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:471
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
double getMinGap() const
Get the free space in front of vehicles of this class.
double angle
The current view rotation angle.
double getColorValue(int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:412
const T getColor(const double value) const
Show vehicle&#39;s current route.
Definition: GUIAppEnum.h:262
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
An upper class for objects with additional parameters.
Definition: Parameterised.h:44
show the current walkingarea path
Definition: GUIPerson.h:204
const int VEHPARS_COLOR_SET
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:167
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
const SUMOVTypeParameter & getParameter() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:276
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:564
void unlock()
release mutex lock
Definition: MFXMutex.cpp:87
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
render as a pedestrian
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIPerson.cpp:155
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.h:366
Structure representing possible vehicle parameter.
#define M_PI
Definition: odrSpiral.cpp:40
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Show transportable plan.
Definition: GUIAppEnum.h:246
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
Definition: AbstractMutex.h:59
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:358
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:554
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:862
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
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.
GUIVisualizationSizeSettings personSize
int personQuality
The quality of person drawing.
double getLength() const
Get vehicle&#39;s length [m].
void lock()
lock mutex
Definition: MFXMutex.cpp:77
~GUIPerson()
destructor
Definition: GUIPerson.cpp:174
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:266
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
long onCmdShowPlan(FXObject *, FXSelector, void *)
Called if the plan shall be shown.
Definition: GUIPerson.cpp:128
GUIGlID getGlID() const
Returns the numerical id of the object.
double getExaggeration(const GUIVisualizationSettings &s, double factor=20) const
return the drawing size including exaggeration and constantSize values
const MSVehicleType & getVehicleType() const
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
GUIMainWindow * myApplication
The main application.
const MSEdge * getDestination() const
Returns the current destination.
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:93
Show persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:282
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
GUIGlObject * myObject
The object that belongs to this popup-menu.
Hide persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:284
GUISelectedStorage gSelected
A global holder of selected objects.
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
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Hide vehicle&#39;s current route.
Definition: GUIAppEnum.h:264
int getNumStages() const
Return the total number stages in this persons plan.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:274
StageType getCurrentStageType() const
the current stage type of the transportable
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:478
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:579
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking) ...
Definition: GUIPerson.cpp:446