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 /****************************************************************************/
16 // A MSPerson extended by some values for usage within the gui
17 /****************************************************************************/
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
29 #include <utils/gui/div/GLHelper.h>
34 
35 #include "GUILane.h"
36 #include "GUIPerson.h"
37 
38 //#define GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS 1
39 
40 // ===========================================================================
41 // FOX callback mapping
42 // ===========================================================================
43 
44 FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[] = {
53 };
54 
55 // Object implementation
56 FXIMPLEMENT(GUIPerson::GUIPersonPopupMenu, GUIGLObjectPopupMenu, GUIPersonPopupMenuMap, ARRAYNUMBER(GUIPersonPopupMenuMap))
57 
58 // ===========================================================================
59 // method definitions
60 // ===========================================================================
61 
62 // -------------------------------------------------------------------------
63 // GUIPerson::GUIPersonPopupMenu - methods
64 // -------------------------------------------------------------------------
65 
67  GUIMainWindow& app, GUISUMOAbstractView& parent, GUIGlObject& o) :
68  GUIGLObjectPopupMenu(app, parent, o) {
69 }
70 
71 
73 
74 
75 long
77  assert(myObject->getType() == GLO_PERSON);
78  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_ROUTE)) {
79  static_cast<GUIPerson*>(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_ROUTE);
80  }
81  return 1;
82 }
83 
84 
85 long
87  assert(myObject->getType() == GLO_PERSON);
88  static_cast<GUIPerson*>(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_ROUTE);
89  return 1;
90 }
91 
92 
93 long
95  assert(myObject->getType() == GLO_PERSON);
96  if (!static_cast<GUIPerson*>(myObject)->hasActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH)) {
97  static_cast<GUIPerson*>(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH);
98  }
99  return 1;
100 }
101 
102 
103 long
105  assert(myObject->getType() == GLO_PERSON);
106  static_cast<GUIPerson*>(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH);
107  return 1;
108 }
109 
110 
111 long
112 GUIPerson::GUIPersonPopupMenu::onCmdShowPlan(FXObject*, FXSelector, void*) {
113  GUIPerson* p = dynamic_cast<GUIPerson*>(myObject);
114  if (p == nullptr) {
115  return 1;
116  }
117  GUIParameterTableWindow* ret = new GUIParameterTableWindow(*myApplication, *p, p->getNumStages());
118  // add items
119  for (int stage = 1; stage < p->getNumStages(); stage++) {
120  ret->mkItem(toString(stage).c_str(), false, p->getStageSummary(stage));
121  }
122  // close building (use an object that is not Parameterised as argument)
123  Parameterised dummyParameterised;
124  ret->closeBuilding(&dummyParameterised);
125  return 1;
126 }
127 
128 
129 long
130 GUIPerson::GUIPersonPopupMenu::onCmdStartTrack(FXObject*, FXSelector, void*) {
131  assert(myObject->getType() == GLO_PERSON);
132  if (myParent->getTrackedID() != static_cast<GUIPerson*>(myObject)->getGlID()) {
133  myParent->startTrack(static_cast<GUIPerson*>(myObject)->getGlID());
134  }
135  return 1;
136 }
137 
138 
139 long
140 GUIPerson::GUIPersonPopupMenu::onCmdStopTrack(FXObject*, FXSelector, void*) {
141  assert(myObject->getType() == GLO_PERSON);
142  myParent->stopTrack();
143  return 1;
144 }
145 
146 
147 long
149  GUIPerson* person = static_cast<GUIPerson*>(myObject);
150  MSTransportable::Stage* stage = person->getCurrentStage();
151  stage->abort(person);
152  stage->getEdge()->removePerson(person);
153  if (stage->getDestinationStop() != nullptr) {
154  stage->getDestinationStop()->removeTransportable(person);
155  }
157  myParent->update();
158  return 1;
159 }
160 
161 // -------------------------------------------------------------------------
162 // GUIPerson - methods
163 // -------------------------------------------------------------------------
164 
166  MSPerson(pars, vtype, plan, speedFactor),
167  GUIGlObject(GLO_PERSON, pars->id),
169 }
170 
171 
173  myLock.lock();
174  for (std::map<GUISUMOAbstractView*, int>::iterator i = myAdditionalVisualizations.begin(); i != myAdditionalVisualizations.end(); ++i) {
175  if (i->first->getTrackedID() == getGlID()) {
176  i->first->stopTrack();
177  }
178  while (i->first->removeAdditionalGLVisualisation(this));
179  }
180  myLock.unlock();
181 }
182 
183 
186  GUIGLObjectPopupMenu* ret = new GUIPersonPopupMenu(app, parent, *this);
187  buildPopupHeader(ret, app);
192  new FXMenuCommand(ret, "Hide Current Route", nullptr, ret, MID_HIDE_CURRENTROUTE);
193  } else {
194  new FXMenuCommand(ret, "Show Current Route", nullptr, ret, MID_SHOW_CURRENTROUTE);
195  }
197  new FXMenuCommand(ret, "Hide Walkingarea Path", nullptr, ret, MID_HIDE_WALKINGAREA_PATH);
198  } else {
199  new FXMenuCommand(ret, "Show Walkingarea Path", nullptr, ret, MID_SHOW_WALKINGAREA_PATH);
200  }
201  new FXMenuSeparator(ret);
202  if (parent.getTrackedID() != getGlID()) {
203  new FXMenuCommand(ret, "Start Tracking", nullptr, ret, MID_START_TRACK);
204  } else {
205  new FXMenuCommand(ret, "Stop Tracking", nullptr, ret, MID_STOP_TRACK);
206  }
207  new FXMenuCommand(ret, "Remove", nullptr, ret, MID_REMOVE_OBJECT);
208  new FXMenuSeparator(ret);
209  //
212  new FXMenuCommand(ret, "Show Plan", GUIIconSubSys::getIcon(ICON_APP_TABLE), ret, MID_SHOWPLAN);
213  new FXMenuSeparator(ret);
214  buildPositionCopyEntry(ret, false);
215  return ret;
216 }
217 
218 
223  new GUIParameterTableWindow(app, *this, 12 + (int)getParameter().getParametersMap().size());
224  // add items
226  // there is always the "start" stage which we do not count here because it is not strictly part of the plan
227  ret->mkItem("stage index", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getStageIndexDescription));
228  ret->mkItem("start edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getFromEdgeID));
229  ret->mkItem("dest edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getDestinationEdgeID));
230  ret->mkItem("arrivalPos [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getStageArrivalPos));
231  ret->mkItem("edge [id]", true, new FunctionBindingString<GUIPerson>(this, &GUIPerson::getEdgeID));
232  ret->mkItem("position [m]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getEdgePos));
233  ret->mkItem("speed [m/s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getSpeed));
234  ret->mkItem("speed factor", false, getSpeedFactor());
235  ret->mkItem("angle [degree]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getNaviDegree));
236  ret->mkItem("waiting time [s]", true, new FunctionBinding<GUIPerson, double>(this, &GUIPerson::getWaitingSeconds));
237  ret->mkItem("desired depart [s]", false, time2string(getParameter().depart));
238  // close building
239  ret->closeBuilding(&getParameter());
240  return ret;
241 }
242 
243 
248  new GUIParameterTableWindow(app, *this, 8 + (int)myVType->getParameter().getParametersMap().size());
249  // add items
250  ret->mkItem("Type Information:", false, "");
251  ret->mkItem("type [id]", false, myVType->getID());
252  ret->mkItem("length", false, myVType->getLength());
253  ret->mkItem("width", false, myVType->getWidth());
254  ret->mkItem("height", false, myVType->getHeight());
255  ret->mkItem("minGap", false, myVType->getMinGap());
256  ret->mkItem("maximum speed [m/s]", false, myVType->getMaxSpeed());
257  // close building
258  ret->closeBuilding(&(myVType->getParameter()));
259  return ret;
260 }
261 
262 
263 Boundary
265  Boundary b;
266  // ensure that the vehicle is drawn, otherwise myPositionInVehicle will not be updated
267  b.add(getGUIPosition());
268  b.grow(MAX2(getVehicleType().getWidth(), getVehicleType().getLength()));
269  return b;
270 }
271 
272 
273 void
275  glPushName(getGlID());
276  glPushMatrix();
277  Position p1 = getGUIPosition();
278  glTranslated(p1.x(), p1.y(), getType());
279  glRotated(90, 0, 0, 1);
280  // set person color
281  setColor(s);
282  // scale
283  const double exaggeration = s.personSize.getExaggeration(s, this, 80);
284  glScaled(exaggeration, exaggeration, 1);
285  switch (s.personQuality) {
286  case 0:
288  break;
289  case 1:
291  break;
292  case 2:
294  break;
295  case 3:
296  default:
298  getVehicleType().getImgFile(), getVehicleType().getGuiShape(), exaggeration);
299  break;
300  }
301  glPopMatrix();
302 #ifdef GUIPerson_DEBUG_DRAW_WALKINGAREA_PATHS
304 #endif
305  drawName(p1, s.scale, s.personName, s.angle);
306  if (s.personValue.show) {
307  Position p2 = p1 + Position(0, 0.6 * s.personName.scaledSize(s.scale));
308  const double value = getColorValue(s, s.personColorer.getActive());
310  }
311  glPopName();
312 }
313 
314 
315 void
317  MSPersonStage_Walking* stage = dynamic_cast<MSPersonStage_Walking*>(getCurrentStage());
318  if (stage != nullptr) {
319  setColor(s);
320  MSPModel_Striping::PState* stripingState = dynamic_cast<MSPModel_Striping::PState*>(stage->getPedestrianState());
321  if (stripingState != nullptr) {
322  MSPModel_Striping::WalkingAreaPath* waPath = stripingState->myWalkingAreaPath;
323  if (waPath != nullptr) {
324  glPushMatrix();
325  glTranslated(0, 0, getType());
326  GLHelper::drawBoxLines(waPath->shape, 0.05);
327  glPopMatrix();
328  }
329  }
330  }
331 }
332 
333 
334 void
336  glPushName(getGlID());
337  glPushMatrix();
338  glTranslated(0, 0, getType() - .1); // don't draw on top of other cars
341  }
344  setColor(s);
345  RGBColor current = GLHelper::getColor();
346  RGBColor darker = current.changedBrightness(-51);
347  GLHelper::setColor(darker);
348  MSPersonStage_Walking* stage = dynamic_cast<MSPersonStage_Walking*>(getCurrentStage());
349  assert(stage != 0);
350  const double exaggeration = s.personSize.getExaggeration(s, this);
351  const ConstMSEdgeVector& edges = stage->getRoute();
352  for (ConstMSEdgeVector::const_iterator it = edges.begin(); it != edges.end(); ++it) {
353  GUILane* lane = static_cast<GUILane*>((*it)->getLanes()[0]);
354  GLHelper::drawBoxLines(lane->getShape(), lane->getShapeRotations(), lane->getShapeLengths(), exaggeration);
355  }
356  }
357  }
358  glPopMatrix();
359  glPopName();
360 }
361 
362 
363 void
365  myPositionInVehicle = pos;
366 }
367 
368 
369 void
371  const GUIColorer& c = s.personColorer;
372  if (!setFunctionalColor(c.getActive())) {
374  }
375 }
376 
377 
378 bool
379 GUIPerson::setFunctionalColor(int activeScheme) const {
380  switch (activeScheme) {
381  case 0: {
382  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
384  return true;
385  }
386  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
387  GLHelper::setColor(getVehicleType().getColor());
388  return true;
389  }
390  return false;
391  }
392  case 2: {
393  if (getParameter().wasSet(VEHPARS_COLOR_SET)) {
395  return true;
396  }
397  return false;
398  }
399  case 3: {
400  if (getVehicleType().wasSet(VTYPEPARS_COLOR_SET)) {
401  GLHelper::setColor(getVehicleType().getColor());
402  return true;
403  }
404  return false;
405  }
406  case 8: { // color by angle
407  double hue = GeomHelper::naviDegree(getAngle());
409  return true;
410  }
411  case 9: { // color randomly (by pointer)
412  const double hue = (long)this % 360; // [0-360]
413  const double sat = (((long)this / 360) % 67) / 100.0 + 0.33; // [0.33-1]
414  GLHelper::setColor(RGBColor::fromHSV(hue, sat, 1.));
415  return true;
416  }
417  default:
418  return false;
419  }
420 }
421 
422 
423 double
424 GUIPerson::getColorValue(const GUIVisualizationSettings& /* s */, int activeScheme) const {
425  switch (activeScheme) {
426  case 4:
427  return getSpeed();
428  case 5:
429  if (isWaiting4Vehicle()) {
430  return 5;
431  } else {
432  return (double)getCurrentStageType();
433  }
434  case 6:
435  return getWaitingSeconds();
436  case 7:
438  }
439  return 0;
440 }
441 
442 
443 double
445  FXMutexLock locker(myLock);
446  return MSPerson::getEdgePos();
447 }
448 
449 
450 Position
452  FXMutexLock locker(myLock);
453  return MSPerson::getPosition();
454 }
455 
456 
457 Position
459  FXMutexLock locker(myLock);
461  return myPositionInVehicle;
462  } else {
463  return MSPerson::getPosition();
464  }
465 }
466 
467 
468 double
470  FXMutexLock locker(myLock);
472 }
473 
474 
475 double
477  FXMutexLock locker(myLock);
479 }
480 
481 
482 double
484  FXMutexLock locker(myLock);
485  return MSPerson::getSpeed();
486 }
487 
488 
489 std::string
491  FXMutexLock locker(myLock);
492  return toString(getNumStages() - getNumRemainingStages()) + " of " + toString(getNumStages() - 1);
493 }
494 
495 
496 std::string
498  FXMutexLock locker(myLock);
499  return getEdge()->getID();
500 }
501 
502 
503 std::string
505  FXMutexLock locker(myLock);
506  return getFromEdge()->getID();
507 }
508 
509 
510 std::string
512  FXMutexLock locker(myLock);
513  return getDestination()->getID();
514 }
515 
516 
517 double
519  FXMutexLock locker(myLock);
520  return getCurrentStage()->getArrivalPos();
521 }
522 
523 // -------------------------------------------------------------------------
524 // GUIPerson - Additional Visualsation methods
525 // -------------------------------------------------------------------------
526 
527 bool
529  return myAdditionalVisualizations.find(parent) != myAdditionalVisualizations.end() && (myAdditionalVisualizations.find(parent)->second & which) != 0;
530 }
531 
532 
533 void
535  if (myAdditionalVisualizations.find(parent) == myAdditionalVisualizations.end()) {
536  myAdditionalVisualizations[parent] = 0;
537  }
538  myAdditionalVisualizations[parent] |= which;
539  parent->addAdditionalGLVisualisation(this);
540 }
541 
542 
543 void
545  myAdditionalVisualizations[parent] &= ~which;
546  parent->removeAdditionalGLVisualisation(this);
547 }
548 
549 bool
552 }
553 
554 /****************************************************************************/
555 
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:180
MSPModel_Striping::PState
Container for pedestrian state and individual position update function.
Definition: MSPModel_Striping.h:264
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:65
GUIPerson::getStageIndexDescription
std::string getStageIndexDescription() const
get stage index description
Definition: GUIPerson.cpp:490
GUIPerson::getGUIPosition
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking)
Definition: GUIPerson.cpp:458
GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:165
GUIPerson::getSpeed
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:483
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:93
GLHelper::drawTextSettings
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:706
GLHelper::getColor
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:627
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:62
GUIPerson::setColor
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:370
MSTransportable::getDestination
const MSEdge * getDestination() const
Returns the current destination.
Definition: MSTransportable.h:617
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:42
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:72
MSTransportable::getStageSummary
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Definition: MSTransportable.cpp:833
GUIParameterTableWindow.h
MSPModel_Striping::PState::myWalkingAreaPath
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
Definition: MSPModel_Striping.h:304
GUIPerson::drawAction_drawWalkingareaPath
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
draw walking area path
Definition: GUIPerson.cpp:316
GUIGlObject::drawName
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0) const
draw name of item
Definition: GUIGlObject.cpp:354
GUIVisualizationSettings::angle
double angle
The current view rotation angle.
Definition: GUIVisualizationSettings.h:405
GUIGlObject::buildSelectionPopupEntry
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Definition: GUIGlObject.cpp:235
Position::INVALID
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:284
MID_SHOW_CURRENTROUTE
Show vehicle's current route.
Definition: GUIAppEnum.h:416
GLHelper::drawBoxLines
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
GUIPerson.h
GUIPerson::getEdgeID
std::string getEdgeID() const
get edge ID
Definition: GUIPerson.cpp:497
MSTransportableControl::erase
virtual void erase(MSTransportable *transportable)
removes a single transportable
Definition: MSTransportableControl.cpp:85
MID_START_TRACK
Start to track a vehicle.
Definition: GUIAppEnum.h:432
GUIPerson::setPositionInVehicle
void setPositionInVehicle(const Position &pos)
Definition: GUIPerson.cpp:364
MSPerson
Definition: MSPerson.h:63
GUIGlobalSelection.h
MSTransportable::Stage
Definition: MSTransportable.h:73
GeomHelper::naviDegree
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:193
MID_SHOW_WALKINGAREA_PATH
Show persons's path on walkingarea.
Definition: GUIAppEnum.h:442
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:75
GUIVisualizationSettings::personColorer
GUIColorer personColorer
The person colorer.
Definition: GUIVisualizationSettings.h:532
FXDEFMAP
FXDEFMAP(GUIPerson::GUIPersonPopupMenu) GUIPersonPopupMenuMap[]
GUIPerson::GUIPersonPopupMenu::onCmdHideCurrentRoute
long onCmdHideCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be hidden.
Definition: GUIPerson.cpp:86
MSStoppingPlace::removeTransportable
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
Definition: MSStoppingPlace.cpp:198
GUIPerson::GUIPersonPopupMenu::onCmdStartTrack
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:130
GLO_PERSON
Definition: GUIGlObjectTypes.h:159
GUIPerson::isSelected
bool isSelected() const
whether this person is selected in the GUI
Definition: GUIPerson.cpp:550
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:297
GLHelper.h
MID_STOP_TRACK
Stop to track a vehicle.
Definition: GUIAppEnum.h:434
GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:104
GUIPerson::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:253
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:47
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
GUIPerson::getDestinationEdgeID
std::string getDestinationEdgeID() const
get destination edge ID
Definition: GUIPerson.cpp:511
MID_HIDE_WALKINGAREA_PATH
Hide persons's path on walkingarea.
Definition: GUIAppEnum.h:444
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:621
FunctionBindingString
Definition: FunctionBinding.h:82
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:657
GUIPerson::GUIPersonPopupMenu::~GUIPersonPopupMenu
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:72
ICON_APP_TABLE
Definition: GUIIcons.h:113
GUIParameterTableWindow::closeBuilding
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Definition: GUIParameterTableWindow.cpp:219
GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:94
GUIVisualizationTextSettings::scaledSize
double scaledSize(double scale, double constFactor=0.1) const
get scale size
Definition: GUIVisualizationSettings.cpp:195
INVALID
#define INVALID
Definition: MSDevice_SSM.cpp:70
MSTransportable::Stage::getEdge
virtual const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.cpp:63
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:253
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:79
GUIBasePersonHelper::drawAction_drawAsCircle
static void drawAction_drawAsCircle(const double length, const double width)
Definition: GUIBasePersonHelper.cpp:57
GUIPerson::GUIPerson
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
Definition: GUIPerson.cpp:165
MSTransportable::Stage::abort
virtual void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.h:124
GUIPerson::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:424
RGBColor
Definition: RGBColor.h:39
MSTransportable::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.h:627
Parameterised::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Definition: Parameterised.cpp:106
GUIPerson::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:220
MSTransportable::getCurrentStage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
Definition: MSTransportable.h:677
GUILane::getShape
const PositionVector & getShape() const
Definition: GUILane.cpp:907
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:246
MSTransportableControl.h
GUIGlObject::buildNameCopyPopupEntry
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
Definition: GUIGlObject.cpp:225
GUIPerson::~GUIPerson
~GUIPerson()
destructor
Definition: GUIPerson.cpp:172
GUIBasePersonHelper::drawAction_drawAsPoly
static void drawAction_drawAsPoly(const double angle, const double length, const double width)
Definition: GUIBasePersonHelper.cpp:64
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:79
MSPModel_Striping::WalkingAreaPath::shape
PositionVector shape
Definition: MSPModel_Striping.h:238
MSTransportable::getNumStages
int getNumStages() const
Return the total number stages in this persons plan.
Definition: MSTransportable.cpp:745
MSTransportable::getWaitingSeconds
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Definition: MSTransportable.cpp:729
GUILane.h
VEHPARS_COLOR_SET
const int VEHPARS_COLOR_SET
Definition: SUMOVehicleParameter.h:45
GUIParameterTableWindow::mkItem
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
Definition: GUIParameterTableWindow.h:108
GUILane::getShapeRotations
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:913
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:149
GUIPerson::hasActiveAddVisualisation
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
Definition: GUIPerson.cpp:528
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:41
GUILane::getShapeLengths
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:919
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:632
GUIPerson::getFromEdgeID
std::string getFromEdgeID() const
ger from edge ID
Definition: GUIPerson.cpp:504
GUIApplicationWindow.h
GUIPerson::addActiveAddVisualisation
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:534
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GUIBasePersonHelper.h
GUIPerson::GUIPersonPopupMenu::onCmdStopTrack
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIPerson.cpp:140
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:78
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:67
GUIPerson::GUIPersonPopupMenu
Definition: GUIPerson.h:161
MSTransportable::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:721
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:125
GUIVisualizationSettings::personSize
GUIVisualizationSizeSettings personSize
Definition: GUIVisualizationSettings.h:538
RGBColor::fromHSV
static RGBColor fromHSV(double h, double s, double v)
Converts the given hsv-triplet to rgb, inspired by http://alvyray.com/Papers/CG/hsv2rgb....
Definition: RGBColor.cpp:298
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:68
GUIGlObject
Definition: GUIGlObject.h:65
GUIPerson::getWaitingSeconds
double getWaitingSeconds() const
the time this person spent waiting in seconds
Definition: GUIPerson.cpp:476
MID_SHOWPLAN
Show transportable plan.
Definition: GUIAppEnum.h:398
MSTransportable::DRIVING
Definition: MSTransportable.h:64
GUIBasePersonHelper::drawAction_drawAsTriangle
static void drawAction_drawAsTriangle(const double angle, const double length, const double width)
Definition: GUIBasePersonHelper.cpp:35
MSTransportable::Stage::getArrivalPos
double getArrivalPos() const
Definition: MSTransportable.h:94
MSTransportable::getEdgePos
virtual double getEdgePos() const
Return the position on the edge.
Definition: MSTransportable.cpp:714
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:207
MSEdge::removePerson
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:620
GUIPerson::getPosition
Position getPosition() const
return the Network coordinate of the person
Definition: GUIPerson.cpp:451
GLIncludes.h
MSPerson::getSpeedFactor
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.h:386
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GUILane
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:61
MSTransportable::MSTransportablePlan
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
Definition: MSTransportable.h:587
GUIPerson::VO_SHOW_WALKINGAREA_PATH
show the current walkingarea path
Definition: GUIPerson.h:207
FunctionBinding.h
GUISUMOAbstractView::removeAdditionalGLVisualisation
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
Definition: GUISUMOAbstractView.cpp:1595
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
GUIPerson::GUIPersonPopupMenu::onCmdShowCurrentRoute
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:76
GUIMainWindow
Definition: GUIMainWindow.h:46
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
MSTransportable::getNumRemainingStages
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Definition: MSTransportable.cpp:740
MSNet::getPersonControl
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:810
GUIPerson::removeActiveAddVisualisation
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:544
GUISUMOAbstractView::addAdditionalGLVisualisation
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
Definition: GUISUMOAbstractView.cpp:1583
MSTransportable::getSpeed
virtual double getSpeed() const
the current speed of the transportable
Definition: MSTransportable.cpp:734
MSPerson::MSPersonStage_Walking::getRoute
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:174
GUIPerson::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:274
MSTransportable::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
Definition: MSTransportable.h:606
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:109
GUIPerson
Definition: GUIPerson.h:53
GUIGlObject::buildShowTypeParamsPopupEntry
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
Definition: GUIGlObject.cpp:257
GUIPerson::setFunctionalColor
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIPerson.cpp:379
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:248
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:70
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:560
GUIPerson::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:264
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:33
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:216
GUIGlObject::buildPositionCopyEntry
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used,...
Definition: GUIGlObject.cpp:266
MSTransportable::getPosition
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Definition: MSTransportable.cpp:719
GUIPerson::VO_SHOW_ROUTE
show persons's current route
Definition: GUIPerson.h:209
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:161
GUIVisualizationSettings::personQuality
int personQuality
The quality of person drawing.
Definition: GUIVisualizationSettings.h:535
GUIPerson::getTypeParameterWindow
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:245
config.h
GUIVisualizationSettings::personValue
GUIVisualizationTextSettings personValue
Definition: GUIVisualizationSettings.h:541
GUIBasePersonHelper::drawAction_drawAsImage
static void drawAction_drawAsImage(const double angle, const double length, const double width, const std::string &file, const SUMOVehicleShape guiShape, const double exaggeration)
Definition: GUIBasePersonHelper.cpp:90
GUIVisualizationSettings::personName
GUIVisualizationTextSettings personName
Definition: GUIVisualizationSettings.h:541
MSTransportable::MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:63
MID_HIDE_CURRENTROUTE
Hide vehicle's current route.
Definition: GUIAppEnum.h:418
MSTransportable::Stage::getDestinationStop
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
Definition: MSTransportable.h:85
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:300
GUIPerson::drawGLAdditional
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:335
MSTransportable::getFromEdge
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSTransportable.h:632
GUIPerson::GUIPersonPopupMenu::onCmdShowPlan
long onCmdShowPlan(FXObject *, FXSelector, void *)
Called if the plan shall be shown.
Definition: GUIPerson.cpp:112
GUIPerson::myPositionInVehicle
Position myPositionInVehicle
The position of a person while riding a vehicle.
Definition: GUIPerson.h:256
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:345
FunctionBinding
Definition: FunctionBinding.h:40
VTYPEPARS_COLOR_SET
const int VTYPEPARS_COLOR_SET
Definition: SUMOVTypeParameter.h:51
MSTransportable::myVType
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Definition: MSTransportable.h:801
MSPModel_Striping.h
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:153
GUIPerson::getNaviDegree
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:469
GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject
long onCmdRemoveObject(FXObject *, FXSelector, void *)
Called when removing the person.
Definition: GUIPerson.cpp:148
MSTransportable::getParameter
const SUMOVehicleParameter & getParameter() const
Definition: MSTransportable.h:602
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:76
MSTransportable::getAngle
virtual double getAngle() const
return the current angle of the transportable
Definition: MSTransportable.cpp:724
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:110
MSPModel_Striping::WalkingAreaPath
Definition: MSPModel_Striping.h:224
GUISUMOAbstractView::getTrackedID
virtual GUIGlID getTrackedID() const
get tracked id
Definition: GUISUMOAbstractView.cpp:1435
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:75
GUIPerson::myAdditionalVisualizations
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIPerson.h:259
GUIVisualizationSizeSettings::getExaggeration
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
Definition: GUIVisualizationSettings.cpp:212
GUIPerson::getEdgePos
double getEdgePos() const
Return the position on the edge.
Definition: GUIPerson.cpp:444
GUIPerson::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:185
MID_REMOVE_OBJECT
remove a vehice or person
Definition: GUIAppEnum.h:440
GUIPropertySchemeStorage< GUIColorScheme >
GUISelectedStorage::isSelected
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Definition: GUISelectedStorage.cpp:94
GUIPerson::getStageArrivalPos
double getStageArrivalPos() const
get stage arrival position
Definition: GUIPerson.cpp:518
MSTransportable::getCurrentStageDescription
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
Definition: MSTransportable.h:672
MSPerson::MSPersonStage_Walking::getPedestrianState
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:178