Eclipse 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-2019 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 
30 #include <utils/gui/div/GLHelper.h>
35 
36 #include "GUILane.h"
37 #include "GUIPerson.h"
38 
39 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
40 
41 // ===========================================================================
42 // FOX callback mapping
43 // ===========================================================================
44 
45 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
54 };
55 
56 // Object implementation
57 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
58 
59 // ===========================================================================
60 // method definitions
61 // ===========================================================================
62 
63 // -------------------------------------------------------------------------
64 // GUIPerson::GUIPersonPopupMenu - methods
65 // -------------------------------------------------------------------------
66 
68  GUIMainWindow& app, GUISUMOAbstractView& parent,
69  GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations) :
70  GUIGLObjectPopupMenu(app, parent, o),
71  myVehiclesAdditionalVisualizations(additionalVisualizations) {
72 }
73 
74 
76 
77 
78 long
80  assert(myObject->getType() == GLO_PERSON);
81  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
83  }
84  return 1;
85 }
86 
87 
88 long
90  assert(myObject->getType() == GLO_PERSON);
92  return 1;
93 }
94 
95 
96 long
98  assert(myObject->getType() == GLO_PERSON);
99  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
101  }
102  return 1;
103 }
104 
105 
106 long
108  assert(myObject->getType() == GLO_PERSON);
110  return 1;
111 }
112 
113 
114 long
115 GUIPerson::GUIPersonPopupMenu::onCmdShowPlan(FXObject*, FXSelector, void*) {
116  GUIPerson* p = dynamic_cast<GUIPerson*>(myObject);
117  if (p == nullptr) {
118  return 1;
119  }
121  // add items
122  for (int stage = 1; stage < p->getNumStages(); stage++) {
123  ret->mkItem(toString(stage).c_str(), false, p->getStageSummary(stage));
124  }
125  // close building (use an object that is not Parameterised as argument)
126  Parameterised dummyParameterised;
127  ret->closeBuilding(&dummyParameterised);
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 
142 long
143 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
144  assert(myObject->getType() == GLO_PERSON);
145  myParent->stopTrack();
146  return 1;
147 }
148 
149 
150 long
152  GUIPerson* person = static_cast<GUIPerson*>(myObject);
153  MSTransportable::Stage* stage = person->getCurrentStage();
154  stage->abort(person);
155  stage->getEdge()->removePerson(person);
156  if (stage->getDestinationStop() != nullptr) {
157  stage->getDestinationStop()->removeTransportable(person);
158  }
160  myParent->update();
161  return 1;
162 }
163 
164 // -------------------------------------------------------------------------
165 // GUIPerson - methods
166 // -------------------------------------------------------------------------
167 
169  MSPerson(pars, vtype, plan, speedFactor),
170  GUIGlObject(GLO_PERSON, pars->id),
172 }
173 
174 
176  myLock.lock();
177  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
178  if (i->first->getTrackedID() == getGlID()) {
179  i->first->stopTrack();
180  }
181  while (i->first->removeAdditionalGLVisualisation(this));
182  }
183  myLock.unlock();
184 }
185 
186 
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 FXMenuCommand(ret, "Remove", nullptr, ret, MID_REMOVE_OBJECT);
211  new FXMenuSeparator(ret);
212  //
215  new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN);
216  new FXMenuSeparator(ret);
217  buildPositionCopyEntry(ret, false);
218  return ret;
219 }
220 
221 
226  new GUIParameterTableWindow(app, *this, 12 + (int)getParameter().getParametersMap().size());
227  // add items
229  // there is always the "start" stage which we do not count here because it is not strictly part of the plan
230  ret->mkItem("stage index", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getStageIndexDescription));
231  ret->mkItem("start edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getFromEdgeID));
232  ret->mkItem("dest edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getDestinationEdgeID));
233  ret->mkItem("arrivalPos [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getStageArrivalPos));
234  ret->mkItem("edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getEdgeID));
235  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
236  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
237  ret->mkItem("speed factor", false, getSpeedFactor());
238  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getNaviDegree));
239  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getWaitingSeconds));
240  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
241  // close building
242  ret->closeBuilding(&getParameter());
243  return ret;
244 }
245 
246 
251  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getParametersMap().size());
252  // add items
253  ret->mkItem("Type Information:", false, "");
254  ret->mkItem("type [id]", false, myVType->getID());
255  ret->mkItem("length", false, myVType->getLength());
256  ret->mkItem("width", false, myVType->getWidth());
257  ret->mkItem("height", false, myVType->getHeight());
258  ret->mkItem("minGap", false, myVType->getMinGap());
259  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
260  // close building
261  ret->closeBuilding(&(myVType->getParameter()));
262  return ret;
263 }
264 
265 
266 Boundary
268  Boundary b;
269  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
270  b.add(getGUIPosition());
271  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
272  return b;
273 }
274 
275 
276 void
278  glPushName(getGlID());
279  glPushMatrix();
280  Position p1 = getGUIPosition();
281  glTranslated(p1.x(), p1.y(), getType());
282  glRotated(90, 0, 0, 1);
283  // set person color
284  setColor(s);
285  // scale
286  const double exaggeration = s.personSize.getExaggeration(s, this, 80);
287  glScaled(exaggeration, exaggeration, 1);
288  switch (s.personQuality) {
289  case 0:
291  break;
292  case 1:
294  break;
295  case 2:
297  break;
298  case 3:
299  default:
301  getVehicleType().getImgFile(), getVehicleType().getGuiShape(), exaggeration);
302  break;
303  }
304  glPopMatrix();
305 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
307 #endif
308  drawName(p1, s.scale, s.personName, s.angle);
309  if (s.personValue.show) {
310  Position p2 = p1 + Position(0, 0.6 * s.personName.scaledSize(s.scale));
311  const double value = getColorValue(s, s.personColorer.getActive());
313  }
314  glPopName();
315 }
316 
317 
318 void
321  if (stage != nullptr) {
322  setColor(s);
323  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
324  if (stripingState != nullptr) {
325  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
326  if (waPath != nullptr) {
327  glPushMatrix();
328  glTranslated(0, 0, getType());
329  GLHelper::drawBoxLines(waPath->shape, 0.05);
330  glPopMatrix();
331  }
332  }
333  }
334 }
335 
336 
337 void
339  glPushName(getGlID());
340  glPushMatrix();
341  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
344  }
347  setColor(s);
348  RGBColor current = GLHelper::getColor();
349  RGBColor darker = current.changedBrightness(-51);
350  GLHelper::setColor(darker);
352  assert(stage != 0);
353  const double exaggeration = s.personSize.getExaggeration(s, this);
354  const ConstMSEdgeVector& edges = stage->getRoute();
355  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
356  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
357  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
358  }
359  }
360  }
361  glPopMatrix();
362  glPopName();
363 }
364 
365 
366 void
368  myPositionInVehicle = pos;
369 }
370 
371 
372 void
374  const GUIColorer& c = s.personColorer;
375  if (!setFunctionalColor(c.getActive())) {
377  }
378 }
379 
380 
381 bool
382 GUIPerson::setFunctionalColor(int activeScheme) const {
383  switch (activeScheme) {
384  case 0: {
385  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
387  return true;
388  }
389  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
390  GLHelper::setColor(getVehicleType().getColor());
391  return true;
392  }
393  return false;
394  }
395  case 2: {
396  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
398  return true;
399  }
400  return false;
401  }
402  case 3: {
403  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
404  GLHelper::setColor(getVehicleType().getColor());
405  return true;
406  }
407  return false;
408  }
409  case 8: { // color by angle
410  double hue = GeomHelper::naviDegree(getAngle());
412  return true;
413  }
414  case 9: { // color randomly (by pointer)
415  const double hue = (long)this % 360; // [0-360]
416  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
417  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
418  return true;
419  }
420  default:
421  return false;
422  }
423 }
424 
425 
426 double
427 GUIPerson::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const {
428  switch (activeScheme) {
429  case 4:
430  return getSpeed();
431  case 5:
432  if (isWaiting4Vehicle()) {
433  return 5;
434  } else {
435  return (double)getCurrentStageType();
436  }
437  case 6:
438  return getWaitingSeconds();
439  case 7:
441  }
442  return 0;
443 }
444 
445 
446 double
448  FXMutexLock locker(myLock);
449  return MSPerson::getEdgePos();
450 }
451 
452 
453 Position
455  FXMutexLock locker(myLock);
456  return MSPerson::getPosition();
457 }
458 
459 
460 Position
462  FXMutexLock locker(myLock);
464  return myPositionInVehicle;
465  } else {
466  return MSPerson::getPosition();
467  }
468 }
469 
470 
471 double
473  FXMutexLock locker(myLock);
475 }
476 
477 
478 double
480  FXMutexLock locker(myLock);
482 }
483 
484 
485 double
487  FXMutexLock locker(myLock);
488  return MSPerson::getSpeed();
489 }
490 
491 
492 std::string
494  FXMutexLock locker(myLock);
495  return toString(getNumStages() - getNumRemainingStages()) + " of " + toString(getNumStages() - 1);
496 }
497 
498 
499 std::string
501  FXMutexLock locker(myLock);
502  return getEdge()->getID();
503 }
504 
505 
506 std::string
508  FXMutexLock locker(myLock);
509  return getFromEdge()->getID();
510 }
511 
512 
513 std::string
515  FXMutexLock locker(myLock);
516  return getDestination()->getID();
517 }
518 
519 
520 double
522  FXMutexLock locker(myLock);
523  return getCurrentStage()->getArrivalPos();
524 }
525 
526 // -------------------------------------------------------------------------
527 // GUIPerson - Additional Visualsation methods
528 // -------------------------------------------------------------------------
529 
530 bool
532  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
533 }
534 
535 
536 void
538  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
539  myAdditionalVisualizations[parent] = 0;
540  }
541  myAdditionalVisualizations[parent] |= which;
542  parent->addAdditionalGLVisualisation(this);
543 }
544 
545 
546 void
548  myAdditionalVisualizations[parent] &= ~which;
549  parent->removeAdditionalGLVisualisation(this);
550 }
551 
552 bool
555 }
556 
557 /****************************************************************************/
558 
bool isSelected() const
whether this person is selected in the GUI
Definition: GUIPerson.cpp:553
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:338
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIPerson.h:269
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:531
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.
std::string getEdgeID() const
get edge ID
Definition: GUIPerson.cpp:500
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:182
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:219
GUIVisualizationTextSettings personValue
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:107
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, inspired by http://alvyray.com/Papers/CG/hsv2rgb.htm.
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:454
Stores the information about how to visualize structures.
virtual const MSEdge * getEdge() const
Returns the current edge.
double y() const
Returns the y-position.
Definition: Position.h:62
#define INVALID
std::string getFromEdgeID() const
ger from edge ID
Definition: GUIPerson.cpp:507
virtual void abort(MSTransportable *)
abort this stage (TraCI)
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:701
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
double x() const
Returns the x-position.
Definition: Position.h:57
static void drawAction_drawAsImage(const double angle, const double lenght, const double width, const std::string &file, const SUMOVehicleShape guiShape, const double exaggeration)
static void drawAction_drawAsTriangle(const double angle, const double lenght, const double width)
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
T MAX2(T a, T b)
Definition: StdDefs.h:80
static void drawAction_drawAsPoly(const double angle, const double lenght, const double width)
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:73
const std::string & getID() const
Returns the id.
Definition: Named.h:77
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
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:263
const SUMOVehicleParameter & getParameter() const
virtual void stopTrack()
stop track
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:905
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:168
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.
static void drawAction_drawAsCircle(const double lenght, const double width)
The car-following model and parameter.
Definition: MSVehicleType.h:66
virtual void erase(MSTransportable *transportable)
removes a single transportable
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:223
Start to track a vehicle.
Definition: GUIAppEnum.h:419
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:179
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:62
double getEdgePos() const
Return the position on the edge.
Definition: GUIPerson.cpp:447
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:75
const MSEdge * getFromEdge() const
Returns the departure edge.
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
draw walking area path
Definition: GUIPerson.cpp:319
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:89
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:188
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:194
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:427
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:421
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
std::string getStageIndexDescription() const
get stage index description
Definition: GUIPerson.cpp:493
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
double getWaitingSeconds() const
the time this person spent waiting in seconds
Definition: GUIPerson.cpp:479
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:798
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
double scaledSize(double scale, double constFactor=0.1) const
get scale size
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:472
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:97
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIPerson.cpp:382
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:248
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
double getArrivalPos() const
void setPositionInVehicle(const Position &pos)
Definition: GUIPerson.cpp:367
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 PositionVector & getShape() const
Definition: GUILane.cpp:899
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:613
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:486
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 getStageArrivalPos() const
get stage arrival position
Definition: GUIPerson.cpp:521
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
double angle
The current view rotation angle.
const T getColor(const double value) const
Show vehicle&#39;s current route.
Definition: GUIAppEnum.h:403
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
An upper class for objects with additional parameters.
Definition: Parameterised.h:43
show the current walkingarea path
Definition: GUIPerson.h:217
const int VEHPARS_COLOR_SET
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:175
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
const SUMOVTypeParameter & getParameter() const
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:277
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:547
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
remove a vehice or person
Definition: GUIAppEnum.h:427
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.
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIPerson.cpp:143
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.h:387
Structure representing possible vehicle parameter.
virtual Position getPosition() const
Return the Network coordinate of the transportable.
long onCmdRemoveObject(FXObject *, FXSelector, void *)
Called when removing the person.
Definition: GUIPerson.cpp:151
Show transportable plan.
Definition: GUIAppEnum.h:385
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:373
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:537
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:911
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].
~GUIPerson()
destructor
Definition: GUIPerson.cpp:175
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:267
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:115
GUIGlID getGlID() const
Returns the numerical id of the object.
const MSVehicleType & getVehicleType() const
Returns the vehicle&#39;s type.
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:79
empty max
Show persons&#39;s path on walkingarea.
Definition: GUIAppEnum.h:429
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:431
std::string getDestinationEdgeID() const
get destination edge ID
Definition: GUIPerson.cpp:514
GUISelectedStorage gSelected
A global holder of selected objects.
Position myPositionInVehicle
The position of a person while riding a vehicle.
Definition: GUIPerson.h:266
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:405
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
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:622
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking) ...
Definition: GUIPerson.cpp:461