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 == nullptr) {
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", nullptr, ret, MID_HIDE_CURRENTROUTE);
196  } else {
197  new FXMenuCommand(ret, "Show Current Route", nullptr, ret, MID_SHOW_CURRENTROUTE);
198  }
200  new FXMenuCommand(ret, "Hide Walkingarea Path", nullptr, ret, MID_HIDE_WALKINGAREA_PATH);
201  } else {
202  new FXMenuCommand(ret, "Show Walkingarea Path", nullptr, ret, MID_SHOW_WALKINGAREA_PATH);
203  }
204  new FXMenuSeparator(ret);
205  if (parent.getTrackedID() != getGlID()) {
206  new FXMenuCommand(ret, "Start Tracking", nullptr, ret, MID_START_TRACK);
207  } else {
208  new FXMenuCommand(ret, "Stop Tracking", nullptr, 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, this, 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  if (s.personValue.show) {
306  Position p2 = p1 + Position(0, 0.6 * s.personName.scaledSize(s.scale));
307  const double value = getColorValue(s.personColorer.getActive());
309  }
310  glPopName();
311 }
312 
313 void
316  if (stage != nullptr) {
317  setColor(s);
318  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
319  if (stripingState != nullptr) {
320  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
321  if (waPath != nullptr) {
322  glPushMatrix();
323  glTranslated(0, 0, getType());
324  GLHelper::drawBoxLines(waPath->shape, 0.05);
325  glPopMatrix();
326  }
327  }
328  }
329 }
330 
331 void
333  glPushName(getGlID());
334  glPushMatrix();
335  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
338  }
341  setColor(s);
342  RGBColor current = GLHelper::getColor();
343  RGBColor darker = current.changedBrightness(-51);
344  GLHelper::setColor(darker);
346  assert(stage != 0);
347  const double exaggeration = s.personSize.getExaggeration(s, this);
348  const ConstMSEdgeVector& edges = stage->getRoute();
349  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
350  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
351  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
352  }
353  }
354  }
355  glPopMatrix();
356  glPopName();
357 }
358 
359 
360 
361 
362 void
364  const GUIColorer& c = s.personColorer;
365  if (!setFunctionalColor(c.getActive())) {
367  }
368 }
369 
370 
371 bool
372 GUIPerson::setFunctionalColor(int activeScheme) const {
373  switch (activeScheme) {
374  case 0: {
375  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
377  return true;
378  }
379  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
380  GLHelper::setColor(getVehicleType().getColor());
381  return true;
382  }
383  return false;
384  }
385  case 2: {
386  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
388  return true;
389  }
390  return false;
391  }
392  case 3: {
393  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
394  GLHelper::setColor(getVehicleType().getColor());
395  return true;
396  }
397  return false;
398  }
399  case 8: { // color by angle
400  double hue = GeomHelper::naviDegree(getAngle());
402  return true;
403  }
404  case 9: { // color randomly (by pointer)
405  const double hue = (long)this % 360; // [0-360]
406  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
407  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
408  return true;
409  }
410  default:
411  return false;
412  }
413 }
414 
415 
416 double
417 GUIPerson::getColorValue(int activeScheme) const {
418  switch (activeScheme) {
419  case 4:
420  return getSpeed();
421  case 5:
422  if (isWaiting4Vehicle()) {
423  return 5;
424  } else {
425  return (double)getCurrentStageType();
426  }
427  case 6:
428  return getWaitingSeconds();
429  case 7:
431  }
432  return 0;
433 }
434 
435 
436 double
439  return MSPerson::getEdgePos();
440 }
441 
442 
443 Position
446  return MSPerson::getPosition();
447 }
448 
449 
450 Position
454  return myPositionInVehicle;
455  } else {
456  return MSPerson::getPosition();
457  }
458 }
459 
460 
461 double
465 }
466 
467 
468 double
472 }
473 
474 
475 double
478  return MSPerson::getSpeed();
479 }
480 
481 
482 void
484  // draw triangle pointing forward
485  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
486  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
487  glBegin(GL_TRIANGLES);
488  glVertex2d(0., 0.);
489  glVertex2d(1, -0.5);
490  glVertex2d(1, 0.5);
491  glEnd();
492  // draw a smaller triangle to indicate facing
493  GLHelper::setColor(GLHelper::getColor().changedBrightness(-64));
494  glTranslated(0, 0, .045);
495  glBegin(GL_TRIANGLES);
496  glVertex2d(0., 0.);
497  glVertex2d(0.5, -0.25);
498  glVertex2d(0.5, 0.25);
499  glEnd();
500  glTranslated(0, 0, -.045);
501 }
502 
503 
504 void
506  // draw pedestrian shape
507  glRotated(GeomHelper::naviDegree(getAngle()) - 180, 0, 0, -1);
508  glScaled(getVehicleType().getLength(), getVehicleType().getWidth(), 1);
510  glTranslated(0, 0, .045);
511  // head
512  glScaled(1, 0.5, 1.);
514  // nose
515  glBegin(GL_TRIANGLES);
516  glVertex2d(0.0, -0.2);
517  glVertex2d(0.0, 0.2);
518  glVertex2d(-0.6, 0.0);
519  glEnd();
520  glTranslated(0, 0, -.045);
521  // body
522  glScaled(0.9, 2.0, 1);
523  glTranslated(0, 0, .04);
524  GLHelper::setColor(lighter);
526  glTranslated(0, 0, -.04);
527 }
528 
529 
530 void
532  const std::string& file = getVehicleType().getImgFile();
533  if (file != "") {
534  if (getVehicleType().getGuiShape() == SVS_PEDESTRIAN) {
535  glRotated(RAD2DEG(getAngle() + M_PI / 2.), 0, 0, 1);
536  }
537  int textureID = GUITexturesHelper::getTextureID(file);
538  if (textureID > 0) {
539  const double exaggeration = s.personSize.getExaggeration(s, this);
540  const double halfLength = getVehicleType().getLength() / 2.0 * exaggeration;
541  const double halfWidth = getVehicleType().getWidth() / 2.0 * exaggeration;
542  GUITexturesHelper::drawTexturedBox(textureID, -halfWidth, -halfLength, halfWidth, halfLength);
543  }
544  } else {
545  // fallback if no image is defined
547  }
548 }
549 
550 
551 // ------------ Additional visualisations
552 bool
554  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
555 }
556 
557 
558 void
560  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
561  myAdditionalVisualizations[parent] = 0;
562  }
563  myAdditionalVisualizations[parent] |= which;
564  parent->addAdditionalGLVisualisation(this);
565 }
566 
567 
568 void
570  myAdditionalVisualizations[parent] &= ~which;
571  parent->removeAdditionalGLVisualisation(this);
572 }
573 
574 bool
577 }
578 
579 /****************************************************************************/
580 
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:575
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:332
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:553
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:154
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
GUIVisualizationTextSettings personValue
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:299
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:444
Stores the information about how to visualize structures.
double y() const
Returns the y-position.
Definition: Position.h:62
void drawAction_drawAsImage(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:531
#define INVALID
static void drawTextSettings(const GUIVisualizationTextSettings &settings, const std::string &text, const Position &pos, const double scale, const double angle=0, const double layer=2048)
Definition: GLHelper.cpp:635
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:65
std::map< GUISUMOAbstractView *, int > dummy
Needed for parameterless instantiation.
Definition: GUIPerson.h:191
double x() const
Returns the x-position.
Definition: Position.h:57
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:883
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:172
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:437
~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:314
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:505
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:469
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
double scaledSize(double scale, double constFactor=0.1) const
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:462
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:372
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:877
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:476
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:417
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:168
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:569
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:368
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:363
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:559
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:889
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.
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
empty max
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.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
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:285
StageType getCurrentStageType() const
the current stage type of the transportable
void drawAction_drawAsTriangle(const GUIVisualizationSettings &s) const
Definition: GUIPerson.cpp:483
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:451