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)) {
82  static_cast<GUIPerson*>(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_ROUTE);
83  }
84  return 1;
85 }
86 
87 
88 long
90  assert(myObject->getType() == GLO_PERSON);
91  static_cast<GUIPerson*>(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_ROUTE);
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)) {
100  static_cast<GUIPerson*>(myObject)->addActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH);
101  }
102  return 1;
103 }
104 
105 
106 long
108  assert(myObject->getType() == GLO_PERSON);
109  static_cast<GUIPerson*>(myObject)->removeActiveAddVisualisation(myParent, VO_SHOW_WALKINGAREA_PATH);
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  }
120  GUIParameterTableWindow* ret = new GUIParameterTableWindow(*myApplication, *p, p->getNumStages());
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
320  MSPersonStage_Walking* stage = dynamic_cast<MSPersonStage_Walking*>(getCurrentStage());
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);
351  MSPersonStage_Walking* stage = dynamic_cast<MSPersonStage_Walking*>(getCurrentStage());
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 
GUIGlObject::getType
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.cpp:181
MSPModel_Striping::PState
Container for pedestrian state and individual position update function.
Definition: MSPModel_Striping.h:265
MSVehicleType
The car-following model and parameter.
Definition: MSVehicleType.h:66
GUISUMOAbstractView::addAdditionalGLVisualisation
bool addAdditionalGLVisualisation(const GUIGlObject *const which)
Adds an object to call its additional visualisation method.
Definition: GUISUMOAbstractView.cpp:1545
GUIPerson::getStageIndexDescription
std::string getStageIndexDescription() const
get stage index description
Definition: GUIPerson.cpp:493
GUIPerson::getGUIPosition
Position getGUIPosition() const
return the Network coordinate of the person (only for drawing centering and tracking)
Definition: GUIPerson.cpp:461
GLO_MAX
empty max
Definition: GUIGlObjectTypes.h:166
GUIPerson::getSpeed
double getSpeed() const
the current speed of the person
Definition: GUIPerson.cpp:486
MSVehicleType::getID
const std::string & getID() const
Returns the name of the vehicle type.
Definition: MSVehicleType.h:94
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:701
GLHelper::getColor
static RGBColor getColor()
gets the gl-color
Definition: GLHelper.cpp:622
GUIParameterTableWindow
A window containing a gl-object's parameter.
Definition: GUIParameterTableWindow.h:63
GUIPerson::setColor
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
Definition: GUIPerson.cpp:373
MSTransportable::getDestination
const MSEdge * getDestination() const
Returns the current destination.
Definition: MSTransportable.h:618
Parameterised
An upper class for objects with additional parameters.
Definition: Parameterised.h:43
GUISUMOAbstractView
Definition: GUISUMOAbstractView.h:73
MSTransportable::getStageSummary
std::string getStageSummary(int stageIndex) const
return textual summary for the given stage
Definition: MSTransportable.cpp:828
GUIParameterTableWindow.h
MSPModel_Striping::PState::myWalkingAreaPath
WalkingAreaPath * myWalkingAreaPath
the current walkingAreaPath or 0
Definition: MSPModel_Striping.h:305
GUIPerson::drawAction_drawWalkingareaPath
void drawAction_drawWalkingareaPath(const GUIVisualizationSettings &s) const
draw walking area path
Definition: GUIPerson.cpp:319
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:355
GUIVisualizationSettings::angle
double angle
The current view rotation angle.
Definition: GUIVisualizationSettings.h:403
GUIGlObject::buildSelectionPopupEntry
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
Definition: GUIGlObject.cpp:236
Position::INVALID
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:285
MID_SHOW_CURRENTROUTE
Show vehicle's current route.
Definition: GUIAppEnum.h:403
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:500
MSTransportableControl::erase
virtual void erase(MSTransportable *transportable)
removes a single transportable
Definition: MSTransportableControl.cpp:86
MID_START_TRACK
Start to track a vehicle.
Definition: GUIAppEnum.h:419
GUIPerson::setPositionInVehicle
void setPositionInVehicle(const Position &pos)
Definition: GUIPerson.cpp:367
MSPerson
Definition: MSPerson.h:64
GUIGlobalSelection.h
MSTransportable::Stage
Definition: MSTransportable.h:74
GeomHelper::naviDegree
static double naviDegree(const double angle)
Definition: GeomHelper.cpp:194
MID_SHOW_WALKINGAREA_PATH
Show persons's path on walkingarea.
Definition: GUIAppEnum.h:429
ConstMSEdgeVector
std::vector< const MSEdge * > ConstMSEdgeVector
Definition: MSEdge.h:73
GUIVisualizationSettings::personColorer
GUIColorer personColorer
The person colorer.
Definition: GUIVisualizationSettings.h:523
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:89
MSStoppingPlace::removeTransportable
void removeTransportable(MSTransportable *p)
Removes a transportable from this stop.
Definition: MSStoppingPlace.cpp:199
GUIPerson::GUIPersonPopupMenu::onCmdStartTrack
long onCmdStartTrack(FXObject *, FXSelector, void *)
Called if the person shall be tracked.
Definition: GUIPerson.cpp:133
GLO_PERSON
Definition: GUIGlObjectTypes.h:160
GUIPerson::isSelected
bool isSelected() const
whether this person is selected in the GUI
Definition: GUIPerson.cpp:553
SUMOVehicleParameter
Structure representing possible vehicle parameter.
Definition: SUMOVehicleParameter.h:291
GLHelper.h
MID_STOP_TRACK
Stop to track a vehicle.
Definition: GUIAppEnum.h:421
GUIPerson::GUIPersonPopupMenu::onCmdHideWalkingareaPath
long onCmdHideWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be hidden.
Definition: GUIPerson.cpp:107
GUIPerson::myLock
FXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
Definition: GUIPerson.h:263
GUIGLObjectPopupMenu
The popup menu of a globject.
Definition: GUIGLObjectPopupMenu.h:48
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:602
GUIPerson::getDestinationEdgeID
std::string getDestinationEdgeID() const
get destination edge ID
Definition: GUIPerson.cpp:514
MID_HIDE_WALKINGAREA_PATH
Hide persons's path on walkingarea.
Definition: GUIAppEnum.h:431
GLHelper::setColor
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:616
FunctionBindingString
Definition: FunctionBinding.h:83
MSTransportable::getCurrentStageType
StageType getCurrentStageType() const
the current stage type of the transportable
Definition: MSTransportable.h:658
GUIPerson::GUIPersonPopupMenu::~GUIPersonPopupMenu
~GUIPersonPopupMenu()
Destructor.
Definition: GUIPerson.cpp:75
ICON_APP_TABLE
Definition: GUIIcons.h:114
GUIParameterTableWindow::closeBuilding
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Definition: GUIParameterTableWindow.cpp:220
GUIPerson::GUIPersonPopupMenu::onCmdShowWalkingareaPath
long onCmdShowWalkingareaPath(FXObject *, FXSelector, void *)
Called if the walkingarea path of the person shall be shown.
Definition: GUIPerson.cpp:97
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:64
MSVehicleType::getHeight
double getHeight() const
Get the height which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:254
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
GUIPerson::GUIPerson
GUIPerson(const SUMOVehicleParameter *pars, MSVehicleType *vtype, MSTransportable::MSTransportablePlan *plan, const double speedFactor)
Constructor.
Definition: GUIPerson.cpp:168
MSTransportable::Stage::abort
virtual void abort(MSTransportable *)
abort this stage (TraCI)
Definition: MSTransportable.h:125
GUIPerson::getColorValue
double getColorValue(const GUIVisualizationSettings &s, int activeScheme) const
gets the color value according to the current scheme index
Definition: GUIPerson.cpp:427
RGBColor
Definition: RGBColor.h:40
MSTransportable::getEdge
const MSEdge * getEdge() const
Returns the current edge.
Definition: MSTransportable.h:628
GUIBasePersonHelper::drawAction_drawAsPoly
static void drawAction_drawAsPoly(const double angle, const double lenght, const double width)
Definition: GUIBasePersonHelper.cpp:65
Parameterised::getParametersMap
const std::map< std::string, std::string > & getParametersMap() const
Returns the inner key/value map.
Definition: Parameterised.cpp:105
GUIPerson::getParameterWindow
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIPerson.cpp:223
MSTransportable::getCurrentStage
MSTransportable::Stage * getCurrentStage() const
Return the current stage.
Definition: MSTransportable.h:678
GUILane::getShape
const PositionVector & getShape() const
Definition: GUILane.cpp:899
MSVehicleType::getWidth
double getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Definition: MSVehicleType.h:247
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:226
GUIPerson::~GUIPerson
~GUIPerson()
destructor
Definition: GUIPerson.cpp:175
GUIPropertySchemeStorage::getScheme
T & getScheme()
Definition: GUIPropertySchemeStorage.h:80
MSPModel_Striping::WalkingAreaPath::shape
PositionVector shape
Definition: MSPModel_Striping.h:239
MSTransportable::getNumStages
int getNumStages() const
Return the total number stages in this persons plan.
Definition: MSTransportable.cpp:740
MSTransportable::getWaitingSeconds
virtual double getWaitingSeconds() const
the time this transportable spent waiting in seconds
Definition: MSTransportable.cpp:724
GUILane.h
VEHPARS_COLOR_SET
const int VEHPARS_COLOR_SET
Definition: SUMOVehicleParameter.h:46
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:109
GUILane::getShapeRotations
const std::vector< double > & getShapeRotations() const
Definition: GUILane.cpp:905
GUIGlObject::getGlID
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.cpp:150
GUIPerson::hasActiveAddVisualisation
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
Definition: GUIPerson.cpp:531
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GUILane::getShapeLengths
const std::vector< double > & getShapeLengths() const
Definition: GUILane.cpp:911
GUIVisualizationSettings::scale
double scale
information about a lane's width (temporary, used for a single view)
Definition: GUIVisualizationSettings.h:623
GUIPerson::getFromEdgeID
std::string getFromEdgeID() const
ger from edge ID
Definition: GUIPerson.cpp:507
GUIApplicationWindow.h
GUIPerson::addActiveAddVisualisation
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:537
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GUIBasePersonHelper.h
GUIPerson::GUIPersonPopupMenu::onCmdStopTrack
long onCmdStopTrack(FXObject *, FXSelector, void *)
Called if the person shall not be tracked any longer.
Definition: GUIPerson.cpp:143
Position::x
double x() const
Returns the x-position.
Definition: Position.h:57
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
time2string
std::string time2string(SUMOTime t)
Definition: SUMOTime.cpp:65
GUIPerson::GUIPersonPopupMenu
Definition: GUIPerson.h:162
MSTransportable::isWaiting4Vehicle
bool isWaiting4Vehicle() const
Whether the transportable waits for a vehicle.
Definition: MSTransportable.h:722
MSVehicleType::getMinGap
double getMinGap() const
Get the free space in front of vehicles of this class.
Definition: MSVehicleType.h:126
GUIVisualizationSettings::personSize
GUIVisualizationSizeSettings personSize
Definition: GUIVisualizationSettings.h:529
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:299
GUIVisualizationTextSettings::show
bool show
flag show
Definition: GUIVisualizationSettings.h:69
GUIGlObject
Definition: GUIGlObject.h:66
GUIPerson::getWaitingSeconds
double getWaitingSeconds() const
the time this person spent waiting in seconds
Definition: GUIPerson.cpp:479
MID_SHOWPLAN
Show transportable plan.
Definition: GUIAppEnum.h:385
MSTransportable::DRIVING
Definition: MSTransportable.h:65
MSTransportable::Stage::getArrivalPos
double getArrivalPos() const
Definition: MSTransportable.h:95
MSTransportable::getEdgePos
virtual double getEdgePos() const
Return the position on the edge.
Definition: MSTransportable.cpp:709
GUIGlObject::buildPopupHeader
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
Definition: GUIGlObject.cpp:208
MSEdge::removePerson
virtual void removePerson(MSTransportable *p) const
Definition: MSEdge.h:613
GUIPerson::getPosition
Position getPosition() const
return the Network coordinate of the person
Definition: GUIPerson.cpp:454
GLIncludes.h
MSPerson::getSpeedFactor
double getSpeedFactor() const
the current speed factor of the transportable (where applicable)
Definition: MSPerson.h:387
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
GUILane
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:62
MSTransportable::MSTransportablePlan
std::vector< MSTransportable::Stage * > MSTransportablePlan
the structure holding the plan of a transportable
Definition: MSTransportable.h:588
GUIPerson::VO_SHOW_WALKINGAREA_PATH
show the current walkingarea path
Definition: GUIPerson.h:217
FunctionBinding.h
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:168
GUIPerson::GUIPersonPopupMenu::onCmdShowCurrentRoute
long onCmdShowCurrentRoute(FXObject *, FXSelector, void *)
Called if the current route of the person shall be shown.
Definition: GUIPerson.cpp:79
GUIMainWindow
Definition: GUIMainWindow.h:47
Position::y
double y() const
Returns the y-position.
Definition: Position.h:62
MSTransportable::getNumRemainingStages
int getNumRemainingStages() const
Return the number of remaining stages (including the current)
Definition: MSTransportable.cpp:735
MSNet::getPersonControl
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:798
GUIPerson::removeActiveAddVisualisation
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
Definition: GUIPerson.cpp:547
GUISUMOAbstractView::removeAdditionalGLVisualisation
bool removeAdditionalGLVisualisation(const GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
Definition: GUISUMOAbstractView.cpp:1557
MSTransportable::getSpeed
virtual double getSpeed() const
the current speed of the transportable
Definition: MSTransportable.cpp:729
MSPerson::MSPersonStage_Walking::getRoute
const ConstMSEdgeVector & getRoute() const
Definition: MSPerson.h:175
GUIPerson::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:277
MSTransportable::getVehicleType
const MSVehicleType & getVehicleType() const
Returns the vehicle's type.
Definition: MSTransportable.h:607
MSVehicleType::getLength
double getLength() const
Get vehicle's length [m].
Definition: MSVehicleType.h:110
GUIPerson
Definition: GUIPerson.h:54
GUIGlObject::buildShowTypeParamsPopupEntry
void buildShowTypeParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the type parameter window.
Definition: GUIGlObject.cpp:258
GUIPerson::setFunctionalColor
bool setFunctionalColor(int activeScheme) const
sets the color according to the current scheme index and some vehicle function
Definition: GUIPerson.cpp:382
GUIGlObject::buildShowParamsPopupEntry
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
Definition: GUIGlObject.cpp:249
MSPerson::MSPersonStage_Walking
Definition: MSPerson.h:71
MSVehicleType::getParameter
const SUMOVTypeParameter & getParameter() const
Definition: MSVehicleType.h:556
GUIPerson::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIPerson.cpp:267
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:34
GUIGlObject::buildCenterPopupEntry
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
Definition: GUIGlObject.cpp:217
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:267
MSTransportable::getPosition
virtual Position getPosition() const
Return the Network coordinate of the transportable.
Definition: MSTransportable.cpp:714
GUIPerson::VO_SHOW_ROUTE
show persons's current route
Definition: GUIPerson.h:219
MSVehicleType::getMaxSpeed
double getMaxSpeed() const
Get vehicle's maximum speed [m/s].
Definition: MSVehicleType.h:162
GUIVisualizationSettings::personQuality
int personQuality
The quality of person drawing.
Definition: GUIVisualizationSettings.h:526
GUIPerson::getTypeParameterWindow
GUIParameterTableWindow * getTypeParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own type parameter window.
Definition: GUIPerson.cpp:248
config.h
GUIVisualizationSettings::personValue
GUIVisualizationTextSettings personValue
Definition: GUIVisualizationSettings.h:532
GUIVisualizationSettings::personName
GUIVisualizationTextSettings personName
Definition: GUIVisualizationSettings.h:532
MSTransportable::MOVING_WITHOUT_VEHICLE
Definition: MSTransportable.h:64
MID_HIDE_CURRENTROUTE
Hide vehicle's current route.
Definition: GUIAppEnum.h:405
MSTransportable::Stage::getDestinationStop
MSStoppingPlace * getDestinationStop() const
returns the destination stop (if any)
Definition: MSTransportable.h:86
GUIBasePersonHelper::drawAction_drawAsCircle
static void drawAction_drawAsCircle(const double lenght, const double width)
Definition: GUIBasePersonHelper.cpp:58
Boundary::grow
Boundary & grow(double by)
extends the boundary by the given amount
Definition: Boundary.cpp:301
GUIPerson::drawGLAdditional
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
Definition: GUIPerson.cpp:338
MSTransportable::getFromEdge
const MSEdge * getFromEdge() const
Returns the departure edge.
Definition: MSTransportable.h:633
GUIPerson::GUIPersonPopupMenu::onCmdShowPlan
long onCmdShowPlan(FXObject *, FXSelector, void *)
Called if the plan shall be shown.
Definition: GUIPerson.cpp:115
GUIPerson::myPositionInVehicle
Position myPositionInVehicle
The position of a person while riding a vehicle.
Definition: GUIPerson.h:266
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GUIBasePersonHelper::drawAction_drawAsImage
static void drawAction_drawAsImage(const double angle, const double lenght, const double width, const std::string &file, const SUMOVehicleShape guiShape, const double exaggeration)
Definition: GUIBasePersonHelper.cpp:91
FunctionBinding
Definition: FunctionBinding.h:41
VTYPEPARS_COLOR_SET
const int VTYPEPARS_COLOR_SET
Definition: SUMOVTypeParameter.h:52
GUIBasePersonHelper::drawAction_drawAsTriangle
static void drawAction_drawAsTriangle(const double angle, const double lenght, const double width)
Definition: GUIBasePersonHelper.cpp:36
MSTransportable::myVType
MSVehicleType * myVType
This transportable's type. (mainly used for drawing related information Note sure if it is really nec...
Definition: MSTransportable.h:802
MSPModel_Striping.h
RGBColor::changedBrightness
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
Definition: RGBColor.cpp:154
GUIPerson::getNaviDegree
double getNaviDegree() const
return the current angle of the person
Definition: GUIPerson.cpp:472
GUIPerson::GUIPersonPopupMenu::onCmdRemoveObject
long onCmdRemoveObject(FXObject *, FXSelector, void *)
Called when removing the person.
Definition: GUIPerson.cpp:151
MSTransportable::getParameter
const SUMOVehicleParameter & getParameter() const
Definition: MSTransportable.h:603
Named::getID
const std::string & getID() const
Returns the id.
Definition: Named.h:77
MSTransportable::getAngle
virtual double getAngle() const
return the current angle of the transportable
Definition: MSTransportable.cpp:719
GUIPropertyScheme::getColor
const T getColor(const double value) const
Definition: GUIPropertyScheme.h:111
MSPModel_Striping::WalkingAreaPath
Definition: MSPModel_Striping.h:225
GUISUMOAbstractView::getTrackedID
virtual GUIGlID getTrackedID() const
get tracked id
Definition: GUISUMOAbstractView.cpp:1397
GUIPropertySchemeStorage::getActive
int getActive() const
Definition: GUIPropertySchemeStorage.h:76
GUIPerson::myAdditionalVisualizations
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
Definition: GUIPerson.h:269
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:447
GUIPerson::getPopUpMenu
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIPerson.cpp:188
MID_REMOVE_OBJECT
remove a vehice or person
Definition: GUIAppEnum.h:427
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:95
GUIPerson::getStageArrivalPos
double getStageArrivalPos() const
get stage arrival position
Definition: GUIPerson.cpp:521
MSTransportable::getCurrentStageDescription
std::string getCurrentStageDescription() const
Returns the current stage description as a string.
Definition: MSTransportable.h:673
MSPerson::MSPersonStage_Walking::getPedestrianState
PedestrianState * getPedestrianState() const
Definition: MSPerson.h:179