Eclipse SUMO - Simulation of Urban MObility
GUISUMOViewParent.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-2020 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
22 // A single child window which contains a view of the simulation area
23 /****************************************************************************/
24 #include <config.h>
25 
26 #include <string>
27 #include <vector>
28 #include <fxkeys.h>
30 #include <utils/geom/Position.h>
31 #include <utils/geom/Boundary.h>
45 #include <guisim/GUIVehicle.h>
46 #include <guisim/GUIPerson.h>
47 #include <guisim/GUIEdge.h>
48 #include <guisim/GUILane.h>
49 #include <guisim/GUINet.h>
52 #include <microsim/MSJunction.h>
53 #include <microsim/MSGlobals.h>
54 
55 #include "GUIGlobals.h"
56 #include "GUIViewTraffic.h"
57 #include "GUIApplicationWindow.h"
58 #include "GUISUMOViewParent.h"
59 
61 
62 #ifdef HAVE_OSG
63 #include <osgview/GUIOSGView.h>
64 #endif
65 
66 #define SPEEDFACTOR_SCALE 100.0
67 
68 // ===========================================================================
69 // FOX callback mapping
70 // ===========================================================================
71 FXDEFMAP(GUISUMOViewParent) GUISUMOViewParentMap[] = {
73  // FXMAPFUNC(SEL_COMMAND, MID_ALLOWROTATION, GUISUMOViewParent::onCmdAllowRotation),
74  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GUISUMOViewParent::onCmdLocate),
75  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GUISUMOViewParent::onCmdLocate),
76  FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GUISUMOViewParent::onCmdLocate),
77  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GUISUMOViewParent::onCmdLocate),
78  FXMAPFUNC(SEL_COMMAND, MID_LOCATECONTAINER, GUISUMOViewParent::onCmdLocate),
79  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GUISUMOViewParent::onCmdLocate),
80  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GUISUMOViewParent::onCmdLocate),
81  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GUISUMOViewParent::onCmdLocate),
82  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GUISUMOViewParent::onCmdLocate),
85  FXMAPFUNC(SEL_COMMAND, MID_SIMSTEP, GUISUMOViewParent::onSimStep),
86 
87 };
88 
89 // Object implementation
90 FXIMPLEMENT(GUISUMOViewParent, GUIGlChildWindow, GUISUMOViewParentMap, ARRAYNUMBER(GUISUMOViewParentMap))
91 
92 
93 // ===========================================================================
94 // member method definitions
95 // ===========================================================================
96 GUISUMOViewParent::GUISUMOViewParent(FXMDIClient* p, FXMDIMenu* mdimenu,
97  const FXString& name,
98  GUIMainWindow* parentWindow,
99  FXIcon* ic, FXuint opts,
100  FXint x, FXint y, FXint w, FXint h) :
101  GUIGlChildWindow(p, parentWindow, mdimenu, name, nullptr, ic, opts, x, y, w, h) {
102  buildSpeedControlToolbar();
103  myParent->addGLChild(this);
104 }
105 
106 
109  switch (type) {
110  default:
111  case VIEW_2D_OPENGL:
112  myView = new GUIViewTraffic(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share);
113  break;
114 #ifdef HAVE_OSG
115  case VIEW_3D_OSG:
116  myView = new GUIOSGView(myContentFrame, *myParent, this, net, myParent->getGLVisual(), share);
117  break;
118 #endif
119  }
120  myView->buildViewToolBars(this);
121  if (myParent->isGaming()) {
123  }
124  return myView;
125 }
126 
127 
129  myParent->removeGLChild(this);
130 }
131 
132 
133 void
135  if (value) {
137  } else {
139  }
140 }
141 
142 
143 void
145  if (GLObjChooser == nullptr) {
146  throw ProcessError("ChooserDialog already deleted");
150  myGLObjChooser.ACChooserEdges = nullptr;
158  myGLObjChooser.ACChooserStops = nullptr;
159  } else if (GLObjChooser == myGLObjChooser.ACChooserTLS) {
160  myGLObjChooser.ACChooserTLS = nullptr;
165  } else if (GLObjChooser == myGLObjChooser.ACChooserPOI) {
166  myGLObjChooser.ACChooserPOI = nullptr;
171  } else {
172  throw ProcessError("Unregistered chooserDialog");
173  }
174 }
175 
176 
177 long
178 GUISUMOViewParent::onCmdMakeSnapshot(FXObject* sender, FXSelector, void*) {
179  MFXCheckableButton* button = dynamic_cast<MFXCheckableButton*>(sender);
180  // check if cast was sucesfully
181  if (button) {
182  if (button->amChecked()) {
183  myView->endSnapshot();
184  button->setChecked(false);
185  return 1;
186  }
187  // get the new file name
188  FXFileDialog opendialog(this, "Save Snapshot");
189  opendialog.setIcon(GUIIconSubSys::getIcon(GUIIcon::CAMERA));
190  opendialog.setSelectMode(SELECTFILE_ANY);
191 #ifdef HAVE_FFMPEG
192  opendialog.setPatternList("All Image and Video Files (*.gif,*.bmp,*.xpm,*.pcx,*.ico,*.rgb,*.xbm,*.tga,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ps,*.eps,*.pdf,*.svg,*.tex,*.pgf,*.h264,*.hevc)\n"
193  "All Video Files (*.h264,*.hevc)\n"
194 #else
195  opendialog.setPatternList("All Image Files (*.gif,*.bmp,*.xpm,*.pcx,*.ico,*.rgb,*.xbm,*.tga,*.png,*.jpg,*.jpeg,*.tif,*.tiff,*.ps,*.eps,*.pdf,*.svg,*.tex,*.pgf)\n"
196 #endif
197  "GIF Image (*.gif)\nBMP Image (*.bmp)\nXPM Image (*.xpm)\nPCX Image (*.pcx)\nICO Image (*.ico)\n"
198  "RGB Image (*.rgb)\nXBM Image (*.xbm)\nTARGA Image (*.tga)\nPNG Image (*.png)\n"
199  "JPEG Image (*.jpg,*.jpeg)\nTIFF Image (*.tif,*.tiff)\n"
200  "Postscript (*.ps)\nEncapsulated Postscript (*.eps)\nPortable Document Format (*.pdf)\n"
201  "Scalable Vector Graphics (*.svg)\nLATEX text strings (*.tex)\nPortable LaTeX Graphics (*.pgf)\n"
202  "All Files (*)");
203  if (gCurrentFolder.length() != 0) {
204  opendialog.setDirectory(gCurrentFolder);
205  }
206  if (!opendialog.execute() || !MFXUtils::userPermitsOverwritingWhenFileExists(this, opendialog.getFilename())) {
207  return 1;
208  }
209  gCurrentFolder = opendialog.getDirectory();
210  std::string file = opendialog.getFilename().text();
211  std::string error = myView->makeSnapshot(file);
212  if (error == "video") {
213  button->setChecked(!button->amChecked());
214  } else if (error != "") {
215  FXMessageBox::error(this, MBOX_OK, "Saving failed.", "%s", error.c_str());
216  }
217  }
218  return 1;
219 }
220 
221 
222 long
223 GUISUMOViewParent::onCmdLocate(FXObject*, FXSelector sel, void*) {
224  switch (FXSELID(sel)) {
225  case MID_LOCATEJUNCTION: {
226  // check if dialog is already opened
228  // restore focus in the existent chooser dialog
230  myGLObjChooser.ACChooserJunction->setFocus();
231  } else {
233  GUIIconSubSys::getIcon(GUIIcon::LOCATEJUNCTION), "Junction Chooser",
234  static_cast<GUINet*>(GUINet::getInstance())->getJunctionIDs(myParent->listInternal()),
236  }
237  break;
238  }
239  case MID_LOCATEEDGE: {
240  // check if dialog is already opened
242  // restore focus in the existent chooser dialog
243  myGLObjChooser.ACChooserEdges->restore();
244  myGLObjChooser.ACChooserEdges->setFocus();
245  } else {
250  }
251  break;
252  }
253  case MID_LOCATEVEHICLE: {
254  // get vehicles
255  std::vector<GUIGlID> vehicles;
257  static_cast<GUIMEVehicleControl*>(static_cast<GUINet*>(MSNet::getInstance())->getGUIMEVehicleControl())->insertVehicleIDs(vehicles);
258  } else {
259  static_cast<GUIVehicleControl&>(MSNet::getInstance()->getVehicleControl()).insertVehicleIDs(
260  vehicles, myParent->listParking(), myParent->listTeleporting());
261  }
262  // check if dialog is already opened
264  // restore focus in the existent chooser dialog
266  myGLObjChooser.ACChooserVehicles->setFocus();
267  } else {
270  vehicles,
272  }
273  break;
274  }
275  case MID_LOCATEPERSON: {
276  // get persons
277  std::vector<GUIGlID> persons;
278  static_cast<GUITransportableControl&>(MSNet::getInstance()->getPersonControl()).insertIDs(persons);
279  // check if dialog is already opened
281  // restore focus in the existent chooser dialog
282  myGLObjChooser.ACChooserPersons->restore();
283  myGLObjChooser.ACChooserPersons->setFocus();
284  } else {
287  persons,
289  }
290  break;
291  }
292  case MID_LOCATECONTAINER: {
293  // get containers
294  std::vector<GUIGlID> containers;
295  static_cast<GUITransportableControl&>(MSNet::getInstance()->getContainerControl()).insertIDs(containers);
296  // check if dialog is already opened
298  // restore focus in the existent chooser dialog
301  } else {
303  GUIIconSubSys::getIcon(GUIIcon::LOCATECONTAINER), "Container Chooser",
304  containers,
306  }
307  break;
308  }
309  case MID_LOCATETLS: {
310  // check if dialog is already opened
312  // restore focus in the existent chooser dialog
313  myGLObjChooser.ACChooserTLS->restore();
314  myGLObjChooser.ACChooserTLS->setFocus();
315  } else {
317  GUIIconSubSys::getIcon(GUIIcon::LOCATETLS), "Traffic Lights Chooser",
318  static_cast<GUINet*>(GUINet::getInstance())->getTLSIDs(),
320  }
321  break;
322  }
323  case MID_LOCATEADD: {
324  // check if dialog is already opened
326  // restore focus in the existent chooser dialog
329  } else {
331  GUIIconSubSys::getIcon(GUIIcon::LOCATEADD), "Additional Objects Chooser",
334  }
335  break;
336  }
337  case MID_LOCATEPOI: {
338  // check if dialog is already opened
340  // restore focus in the existent chooser dialog
341  myGLObjChooser.ACChooserPOI->restore();
342  myGLObjChooser.ACChooserPOI->setFocus();
343  } else {
346  static_cast<GUIShapeContainer&>(GUINet::getInstance()->getShapeContainer()).getPOIIds(),
348  }
349  break;
350  }
351  case MID_LOCATEPOLY: {
352  // check if dialog is already opened
354  // restore focus in the existent chooser dialog
355  myGLObjChooser.ACChooserPolygon->restore();
356  myGLObjChooser.ACChooserPolygon->setFocus();
357  } else {
359  GUIIconSubSys::getIcon(GUIIcon::LOCATEPOLY), "Polygon Chooser",
360  static_cast<GUIShapeContainer&>(GUINet::getInstance()->getShapeContainer()).getPolygonIDs(),
362  }
363  break;
364  }
365  default:
366  throw ProcessError("Unknown Message ID in onCmdLocate");
367  }
368  myLocatorPopup->popdown();
369  myLocatorButton->killFocus();
370  myLocatorPopup->update();
371  return 1;
372 }
373 
374 
375 long
376 GUISUMOViewParent::onSimStep(FXObject*, FXSelector, void*) {
377  myView->update();
379  return 1;
380 }
381 
382 
383 bool
385  GUIGlObjectType type = o->getType();
386  if (gSelected.isSelected(type, o->getGlID())) {
387  return true;
388  } else if (type == GLO_EDGE) {
389  GUIEdge* edge = dynamic_cast<GUIEdge*>(o);
390  if (edge == nullptr) {
391  // hmph, just some security stuff
392  return false;
393  }
394  const std::vector<MSLane*>& lanes = edge->getLanes();
395  for (std::vector<MSLane*>::const_iterator j = lanes.begin(); j != lanes.end(); ++j) {
396  GUILane* l = dynamic_cast<GUILane*>(*j);
397  if (l != nullptr && gSelected.isSelected(GLO_LANE, l->getGlID())) {
398  return true;
399  }
400  }
401  return false;
402  } else {
403  return false;
404  }
405 }
406 
407 
408 long
409 GUISUMOViewParent::onKeyPress(FXObject* o, FXSelector sel, void* ptr) {
410  myView->onKeyPress(o, sel, ptr);
411  return 0;
412 }
413 
414 
415 long
416 GUISUMOViewParent::onKeyRelease(FXObject* o, FXSelector sel, void* ptr) {
417  myView->onKeyRelease(o, sel, ptr);
418  return 0;
419 }
420 
421 
422 void
425  new FXVerticalSeparator(toolbar, GUIDesignVerticalSeparator);
426 
427  //myToolBarDragSpeed = new FXToolBarShell(this, GUIDesignToolBar);
428  //myToolBarSpeed = new FXToolBar(toolbar, myToolBarDragSpeed, GUIDesignToolBarRaisedSameTop);
429  //mySpeedFactorSlider = new FXSlider(myToolBarSpeed, this, MID_SPEEDFACTOR, LAYOUT_FIX_WIDTH | SLIDER_ARROW_UP | SLIDER_TICKS_TOP, 0, 0, 300, 10, 0, 0, 5, 0);
430  mySpeedFactorSlider = new FXSlider(toolbar, this, MID_SPEEDFACTOR, LAYOUT_FIX_WIDTH | SLIDER_ARROW_UP | SLIDER_TICKS_TOP, 0, 0, 200, 10, 0, 0, 5, 0);
431  mySpeedFactorSlider->setRange(0, 200);
432  mySpeedFactorSlider->setHeadSize(10);
433  mySpeedFactorSlider->setIncrement(1);
434  mySpeedFactorSlider->setTickDelta(100);
435  mySpeedFactorSlider->setValue(100);
436  mySpeedFactorSlider->setHelpText("Control speedFactor of tracked object");
437  //mySpeedFactorSlider->hide();
438 }
439 
440 long
441 GUISUMOViewParent::onCmdSpeedFactor(FXObject*, FXSelector, void*) {
442  if (myView != nullptr && myView->getTrackedID() != GUIGlObject::INVALID_ID) {
444  if (o != nullptr) {
445  const double speedFactor = mySpeedFactorSlider->getValue() / SPEEDFACTOR_SCALE;
446  if (o->getType() == GLO_VEHICLE) {
447  MSBaseVehicle* veh = dynamic_cast<MSBaseVehicle*>(o);
448  veh->setChosenSpeedFactor(speedFactor);
449  } else if (o->getType() == GLO_PERSON) {
450  //MSPerson* person = dynamic_cast<MSPerson*>(o);
451  //person->setChosenSpeedFactor(speedFactor);
452  }
453  mySpeedFactorSlider->setTipText(toString(speedFactor).c_str());
454  }
455 
456  }
457  return 1;
458 }
459 
460 long
461 GUISUMOViewParent::onUpdSpeedFactor(FXObject* sender, FXSelector, void* ptr) {
462  bool disable = myView == nullptr || myView->getTrackedID() == GUIGlObject::INVALID_ID;
463  sender->handle(this, FXSEL(SEL_COMMAND, disable ? ID_DISABLE : ID_ENABLE), ptr);
464  if (disable) {
465  mySpeedFactorSlider->hide();
466  } else {
468  if (o != nullptr) {
469  if (o->getType() == GLO_VEHICLE) {
470  MSBaseVehicle* veh = dynamic_cast<MSBaseVehicle*>(o);
472  } else if (o->getType() == GLO_PERSON) {
473  MSPerson* person = dynamic_cast<MSPerson*>(o);
474  mySpeedFactorSlider->setValue((int)(person->getChosenSpeedFactor() * SPEEDFACTOR_SCALE));
475  }
476  mySpeedFactorSlider->show();
477  } else {
478  myView->stopTrack();
479  mySpeedFactorSlider->hide();
480  }
481  }
482  return 1;
483 }
484 
485 // ===========================================================================
486 // private
487 // ===========================================================================
488 
490  ACChooserJunction(nullptr),
491  ACChooserEdges(nullptr),
492  ACChooserVehicles(nullptr),
493  ACChooserPersons(nullptr),
494  ACChooserContainer(nullptr),
495  ACChooserTLS(nullptr),
496  ACChooserAdditional(nullptr),
497  ACChooserPOI(nullptr),
498  ACChooserPolygon(nullptr),
499  ACChooserRoutes(nullptr),
500  ACChooserStops(nullptr),
501  ACChooserProhibition(nullptr) {
502 }
503 
504 
506  // remove all dialogs
507  // delete for a nullptr is valid, so no check needed
508  delete ACChooserJunction;
509  delete ACChooserEdges;
510  delete ACChooserVehicles;
511  delete ACChooserPersons;
512  delete ACChooserContainer;
513  delete ACChooserTLS;
514  delete ACChooserAdditional;
515  delete ACChooserPOI;
516  delete ACChooserPolygon;
517  delete ACChooserRoutes;
518  delete ACChooserStops;
519  delete ACChooserProhibition;
520 }
521 
522 /****************************************************************************/
@ MID_MAKESNAPSHOT
Make snapshot - button.
Definition: GUIAppEnum.h:363
@ MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:349
@ MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:339
@ MID_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:359
@ MID_SPEEDFACTOR
scale vehicle speed
Definition: GUIAppEnum.h:373
@ MID_LOCATEADD
Locate addtional structure - button.
Definition: GUIAppEnum.h:355
@ MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:357
@ MID_SIMSTEP
A Simulation step was performed.
Definition: GUIAppEnum.h:481
@ MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:341
@ MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:343
@ MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:353
@ MID_LOCATECONTAINER
Locate container - button.
Definition: GUIAppEnum.h:351
#define GUIDesignVerticalSeparator
vertical separator
Definition: GUIDesigns.h:365
GUIGlObjectType
@ GLO_LANE
a lane
@ GLO_ADDITIONALELEMENT
reserved GLO type to pack all additionals elements
@ GLO_EDGE
an edge
@ GLO_VEHICLE
a vehicle
@ GLO_PERSON
a person
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
@ LOCATEVEHICLE
@ LOCATEPERSON
@ LOCATECONTAINER
@ LOCATEJUNCTION
#define SPEEDFACTOR_SCALE
FXDEFMAP(GUISUMOViewParent) GUISUMOViewParentMap[]
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:50
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:101
GUISUMOAbstractView * myView
The view.
FXMenuButton * myLocatorButton
The locator button.
FXVerticalFrame * myContentFrame
The contents frame.
FXPopup * myLocatorPopup
The locator menu.
GUIMainWindow * myParent
The parent window.
FXToolBar * myStaticNavigationToolBar
The static navigation tool bar.
FXMenuBar * myGripNavigationToolbar
The grip navigation tool bar.
static std::vector< GUIGlID > getIDList(GUIGlObjectType typeFilter)
Returns the list of gl-ids of all additional objects that match the given type.
static const GUIGlID INVALID_ID
Definition: GUIGlObject.h:67
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
GUIGlID getGlID() const
Returns the numerical id of the object.
static GUIGlObjectStorage gIDStorage
A single static instance of this class.
GUIGlObject * getObjectBlocking(GUIGlID id)
Returns the object from the container locking it.
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:59
The class responsible for building and deletion of vehicles (gui-version)
bool isGaming() const
return whether the gui is in gaming mode
bool listTeleporting() const
return whether to list teleporting vehicles
bool listParking() const
return whether to list parking vehicles
bool listInternal() const
return whether to list internal structures
FXGLVisual * getGLVisual() const
get GL Visual
void removeGLChild(GUIGlChildWindow *child)
removes the given child window from the list (GUIGlChildWindow)
A MSNet extended by some values for usage within the gui.
Definition: GUINet.h:81
std::string makeSnapshot(const std::string &destFile, const int w=-1, const int h=-1)
Takes a snapshots and writes it into the given file.
virtual void checkSnapshots()
Checks whether it is time for a snapshot.
virtual void endSnapshot()
Ends a video snapshot.
virtual void buildViewToolBars(GUIGlChildWindow *)
builds the view toolbars
virtual long onKeyPress(FXObject *o, FXSelector sel, void *data)
keyboard functions
virtual void stopTrack()
stop track
virtual long onKeyRelease(FXObject *o, FXSelector sel, void *data)
virtual GUIGlID getTrackedID() const
get tracked id
struct for GLObjChooser dialog
GUIDialog_GLObjChooser * ACChooserVehicles
pointer to ACChooser dialog used for locate vehicles
GUIDialog_GLObjChooser * ACChooserPolygon
pointer to ACChooser dialog used for locate Polygons
GUIDialog_GLObjChooser * ACChooserPOI
pointer to ACChooser dialog used for locate POIs
GUIDialog_GLObjChooser * ACChooserEdges
pointer to ACChooser dialog used for locate edges
GUIDialog_GLObjChooser * ACChooserProhibition
pointer to ACChooser dialog used for locate Prohibitions
GUIDialog_GLObjChooser * ACChooserJunction
pointer to ACChooser dialog used for locate junctions
GUIDialog_GLObjChooser * ACChooserTLS
pointer to ACChooser dialog used for locate TLSs
GUIDialog_GLObjChooser * ACChooserAdditional
pointer to ACChooser dialog used for locate additional
GUIDialog_GLObjChooser * ACChooserContainer
pointer to ACChooser dialog used for locate Containers
GUIDialog_GLObjChooser * ACChooserStops
pointer to ACChooser dialog used for locate stops
GUIDialog_GLObjChooser * ACChooserPersons
pointer to ACChooser dialog used for locate persons
GUIDialog_GLObjChooser * ACChooserRoutes
pointer to ACChooser dialog used for locate routes
A single child window which contains a view of the simulation area.
bool isSelected(GUIGlObject *o) const
true if the object is selected (may include extra logic besides calling gSelected)
ViewType
Available view types.
@ VIEW_3D_OSG
plain 3D OSG view (
@ VIEW_2D_OPENGL
plain 2D openGL view (
long onCmdSpeedFactor(FXObject *, FXSelector, void *)
speedFactor-callback
void eraseGLObjChooser(GUIDialog_GLObjChooser *GLObjChooser)
erase GLObjChooser
virtual GUISUMOAbstractView * init(FXGLCanvas *share, GUINet &net, ViewType type)
"Initialises" this window by building the contents
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
void buildSpeedControlToolbar()
fox need this
long onUpdSpeedFactor(FXObject *, FXSelector, void *)
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
long onCmdMakeSnapshot(FXObject *sender, FXSelector, void *)
Called if the user wants to make a snapshot (screenshot)
long onSimStep(FXObject *sender, FXSelector, void *)
Called on a simulation step.
FXSlider * mySpeedFactorSlider
slider for speedfactor
void setToolBarVisibility(const bool value)
about toggled gaming status
long onKeyPress(FXObject *o, FXSelector sel, void *data)
handle keys
~GUISUMOViewParent()
Destructor.
GLObjChooser myGLObjChooser
GLObjChooser.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
Storage for geometrical objects extended by mutexes.
GUI-version of the transportable control for building gui persons and containers.
The class responsible for building and deletion of vehicles (gui-version)
bool amChecked() const
check if this MFXCheckableButton is checked
void setChecked(bool val)
check or uncheck this MFXCheckableButton
static FXbool userPermitsOverwritingWhenFileExists(FXWindow *const parent, const FXString &file)
Returns true if either the file given by its name does not exist or the user allows overwriting it.
Definition: MFXUtils.cpp:39
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:51
void setChosenSpeedFactor(const double factor)
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
double getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit.
const std::vector< MSLane * > & getLanes() const
Returns this edge's lanes.
Definition: MSEdge.h:166
static bool gUseMesoSim
Definition: MSGlobals.h:88
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:171
virtual MSTransportableControl & getContainerControl()
Returns the container control.
Definition: MSNet.cpp:995
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
Definition: MSNet.h:371
virtual MSTransportableControl & getPersonControl()
Returns the person control.
Definition: MSNet.cpp:986
double getChosenSpeedFactor() const