Eclipse SUMO - Simulation of Urban MObility
GNEApplicationWindow.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 /****************************************************************************/
15 // The main window of Netedit (adapted from GUIApplicationWindow)
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 
23 #include <netbuild/NBFrame.h>
29 #include <netimport/NIFrame.h>
30 #include <netwrite/NWFrame.h>
31 #include <utils/common/SysUtils.h>
36 #include <utils/gui/div/GLHelper.h>
49 #include <utils/xml/XMLSubSys.h>
50 
51 #include "GNEApplicationWindow.h"
52 #include "GNEEvent_NetworkLoaded.h"
53 #include "GNELoadThread.h"
54 #include "GNENet.h"
55 #include "GNEViewNet.h"
56 #include "GNEUndoList.h"
57 #include "GNEViewParent.h"
58 
59 #ifdef HAVE_VERSION_H
60 #include <version.h>
61 #endif
62 
63 // ===========================================================================
64 // FOX-declarations
65 // ===========================================================================
66 FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[] = {
67  // quit calls
71  FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GNEApplicationWindow::onCmdQuit),
72 
73  // toolbar file
77  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GNEApplicationWindow::onUpdOpen),
79  FXMAPFUNC(SEL_UPDATE, MID_OPEN_CONFIG, GNEApplicationWindow::onUpdOpen),
83  FXMAPFUNC(SEL_UPDATE, MID_RECENTFILE, GNEApplicationWindow::onUpdOpen),
86  // network
95  // TLS
100  // additionals
107  // demand elements
114  // other
119 
120  // Toolbar supermode
123 
124  // Toolbar edit
150 
151  // Toolbar processing
163 
164  // Toolbar locate
165  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GNEApplicationWindow::onCmdLocate),
167  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GNEApplicationWindow::onCmdLocate),
169  FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GNEApplicationWindow::onCmdLocate),
171  FXMAPFUNC(SEL_COMMAND, MID_LOCATEROUTE, GNEApplicationWindow::onCmdLocate),
173  FXMAPFUNC(SEL_COMMAND, MID_LOCATESTOP, GNEApplicationWindow::onCmdLocate),
175  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GNEApplicationWindow::onCmdLocate),
177  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GNEApplicationWindow::onCmdLocate),
179  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GNEApplicationWindow::onCmdLocate),
181  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GNEApplicationWindow::onCmdLocate),
183 
184  // toolbar windows
186 
187  // toolbar help
189  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_ABOUT, GNEApplicationWindow::onCmdAbout),
190 
191  // alt + <number>
212 
213  // key events
214  FXMAPFUNC(SEL_KEYPRESS, 0, GNEApplicationWindow::onKeyPress),
215  FXMAPFUNC(SEL_KEYRELEASE, 0, GNEApplicationWindow::onKeyRelease),
216  FXMAPFUNC(SEL_COMMAND, MID_GNE_HOTKEY_ESC, GNEApplicationWindow::onCmdAbort),
217  FXMAPFUNC(SEL_COMMAND, MID_GNE_HOTKEY_DEL, GNEApplicationWindow::onCmdDel),
220 
221  // threads events
224 
225  // Other
226  FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest),
228 };
229 
230 // Object implementation
231 FXIMPLEMENT(GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
232 
233 
234 // ===========================================================================
235 // GNEApplicationWindow::ToolbarsGrip method definitions
236 // ===========================================================================
237 
239  myGNEApp(GNEApp) {
240 }
241 
242 
243 void
245  // build menu bar (for File, edit, processing...) using specify design
246  myToolBarShellMenu = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
248  // declare toolbar grip for menu bar
249  new FXToolBarGrip(menu, menu, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
250 }
251 
252 
253 void
255  // build menu bar for supermodes (next to menu bar)
256  myToolBarShellSuperModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
258  // declare toolbar grip for menu bar Supermodes
259  new FXToolBarGrip(superModes, superModes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
260  // build menu bar for navigation (bot to menu bar)
261  myToolBarShellNavigation = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
263  // declare toolbar grip for menu bar Navigation
264  new FXToolBarGrip(navigation, navigation, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
265  // build menu bar for modes
266  myToolBarShellModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
268  // declare toolbar grip for menu bar modes
269  new FXToolBarGrip(modes, modes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
270  // build menu bar for mode Options
271  myToolBarShellModeOptions = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
273  // declare toolbar grip for menu bar modes
274  new FXToolBarGrip(modeOptions, modeOptions, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
275  // create menu bars
276  superModes->create();
277  navigation->create();
278  modes->create();
279  modeOptions->create();
280  // create shell supermodes
281  myToolBarShellSuperModes->create();
282  myToolBarShellNavigation->create();
283  myToolBarShellModes->create();
284  myToolBarShellModeOptions->create();
285  // recalc top dop after creating elements
286  myGNEApp->myTopDock->recalc();
287 }
288 
289 
290 void
292  // delete Menu bars
293  delete superModes;
294  delete navigation;
295  delete modes;
296  delete modeOptions;
297  // also delete toolbar shells to avoid floating windows
300  delete myToolBarShellModes;
302  // recalc top dop after deleting elements
303  myGNEApp->myTopDock->recalc();
304 }
305 
306 // ===========================================================================
307 // GNEApplicationWindow method definitions
308 // ===========================================================================
309 
310 GNEApplicationWindow::GNEApplicationWindow(FXApp* a, const std::string& configPattern) :
311  GUIMainWindow(a),
312  myLoadThread(nullptr),
313  myAmLoading(false),
314  hadDependentBuild(false),
315  myNet(nullptr),
316  myUndoList(new GNEUndoList(this)),
317  myConfigPattern(configPattern),
318  myToolbarsGrip(this),
319  myMenuBarFile(this),
320  myFileMenuCommands(this),
321  myEditMenuCommands(this),
323  myLocateMenuCommands(this),
324  mySupermodeCommands(this),
325  myViewNet(nullptr),
326  myTitlePrefix("NETEDIT " VERSION_STRING) {
327  // init icons
329  // init Textures
331  // init cursors
333 }
334 
335 
336 void
338  // do this not twice
339  if (hadDependentBuild) {
340  WRITE_ERROR("DEBUG: GNEApplicationWindow::dependentBuild called twice");
341  return;
342  }
343  hadDependentBuild = true;
344  setTarget(this);
345  setSelector(MID_WINDOW);
346  // build toolbar menu
348  // build the thread - io
350  // build the status bar
351  myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
352  {
353  myGeoFrame =
354  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
355  myGeoCoordinate = new FXLabel(myGeoFrame, "N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", nullptr, LAYOUT_CENTER_Y);
357  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
358  myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A\t\tNetwork coordinate", nullptr, LAYOUT_CENTER_Y);
359  }
360  // make the window a mdi-window
361  myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
362  myMDIClient = new FXMDIClient(myMainSplitter, GUIDesignSplitterMDI);
363  myMDIMenu = new FXMDIMenu(this, myMDIClient);
364  // build the message window
366  myMainSplitter->setSplit(1, 65);
367  // fill menu and tool bar
368  fillMenuBar();
369  // build additional threads
370  myLoadThread = new GNELoadThread(getApp(), this, myEvents, myLoadThreadEvent);
371  // set the status bar
372  myStatusbar->getStatusLine()->setText("Ready.");
373  // set the caption
374  setTitle(myTitlePrefix);
375  // set Netedit ICON
377  // build NETEDIT Accelerators (hotkeys)
379 }
380 
381 
382 void
385  gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
386  FXMainWindow::create();
387  myFileMenu->create();
388  myEditMenu->create();
389  myFileMenuAdditionals->create();
390  myFileMenuTLS->create();
391  myFileMenuDemandElements->create();
392  //mySettingsMenu->create();
393  myWindowsMenu->create();
394  myHelpMenu->create();
395 
396  FXint textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 22;
397  myCartesianFrame->setWidth(textWidth);
398  myGeoFrame->setWidth(textWidth);
399 
400  show(PLACEMENT_DEFAULT);
401  if (!OptionsCont::getOptions().isSet("window-size")) {
402  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
403  maximize();
404  }
405  }
406 
407 }
408 
409 
411  closeAllWindows();
412  // Close icons
414  // Close gifs (Textures)
416  // delete visuals
417  delete myGLVisual;
418  // must delete menus to avoid segfault on removing accelerators
419  // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s)
420  delete myFileMenuAdditionals,
421  delete myFileMenuTLS,
423  delete myFileMenu;
424  delete myEditMenu;
425  delete myLocatorMenu;
426  delete myProcessingMenu;
427  delete myWindowsMenu;
428  delete myHelpMenu;
429  // Delete load thread
430  delete myLoadThread;
431  // drop all events
432  while (!myEvents.empty()) {
433  // get the next event
434  GUIEvent* e = myEvents.top();
435  myEvents.pop();
436  delete e;
437  }
438  // delte undo list
439  delete myUndoList;
440 }
441 
442 
443 long
444 GNEApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
447  getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
448  if (isMaximized()) {
449  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 1);
450  } else {
451  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 0);
452  }
453  getApp()->exit(0);
454  }
455  return 1;
456 }
457 
458 
459 long
460 GNEApplicationWindow::onCmdEditChosen(FXObject*, FXSelector, void*) {
461  GUIDialog_GLChosenEditor* chooser =
463  chooser->create();
464  chooser->show();
465  return 1;
466 }
467 
468 
469 long
470 GNEApplicationWindow::onCmdNewNetwork(FXObject*, FXSelector, void*) {
471  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
472  if (myViewNet && !onCmdClose(0, 0, 0)) {
473  return 1;
474  } else {
478  loadConfigOrNet("", true, false, true, true);
479  return 1;
480  }
481 }
482 
483 
484 long
485 GNEApplicationWindow::onCmdOpenConfiguration(FXObject*, FXSelector, void*) {
486  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
487  if (myViewNet && !onCmdClose(0, 0, 0)) {
488  return 1;
489  } else {
490  // get the new file name
491  FXFileDialog opendialog(this, "Open Netconvert Configuration");
492  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODECREATEEDGE));
493  opendialog.setSelectMode(SELECTFILE_EXISTING);
494  opendialog.setPatternList(myConfigPattern.c_str());
495  if (gCurrentFolder.length() != 0) {
496  opendialog.setDirectory(gCurrentFolder);
497  }
498  if (opendialog.execute()) {
499  gCurrentFolder = opendialog.getDirectory();
500  std::string file = opendialog.getFilename().text();
501  loadConfigOrNet(file, false);
502  // add it into recent configs
503  myMenuBarFile.myRecentConfigs.appendFile(file.c_str());
504  }
505  return 1;
506  }
507 }
508 
509 
510 long
511 GNEApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
512  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
513  if (myViewNet && !onCmdClose(0, 0, 0)) {
514  return 1;
515  } else {
516  // get the new file name
517  FXFileDialog opendialog(this, "Open Network");
518  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODECREATEEDGE));
519  opendialog.setSelectMode(SELECTFILE_EXISTING);
520  opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)");
521  if (gCurrentFolder.length() != 0) {
522  opendialog.setDirectory(gCurrentFolder);
523  }
524  if (opendialog.execute()) {
525  gCurrentFolder = opendialog.getDirectory();
526  std::string file = opendialog.getFilename().text();
527  loadConfigOrNet(file, true);
528  // add it into recent nets
529  myMenuBarFile.myRecentNets.appendFile(file.c_str());
530  // when a net is loaded, save additionals and TLSPrograms are disabled
533  }
534  return 1;
535  }
536 }
537 
538 
539 long
540 GNEApplicationWindow::onCmdOpenForeign(FXObject*, FXSelector, void*) {
541  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
542  if (myViewNet && !onCmdClose(0, 0, 0)) {
543  return 1;
544  } else {
545  // get the new file name
546  FXFileDialog opendialog(this, "Import Foreign Network");
547  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODECREATEEDGE));
548  opendialog.setSelectMode(SELECTFILE_EXISTING);
549  FXString osmPattern("OSM net (*.osm.xml,*.osm)");
550  opendialog.setPatternText(0, osmPattern);
551  if (gCurrentFolder.length() != 0) {
552  opendialog.setDirectory(gCurrentFolder);
553  }
554  if (opendialog.execute()) {
555  gCurrentFolder = opendialog.getDirectory();
556  std::string file = opendialog.getFilename().text();
557 
560  if (osmPattern.contains(opendialog.getPattern())) {
561  // recommended osm options
562  // https://sumo.dlr.de/wiki/Networks/Import/OpenStreetMap#Recommended_NETCONVERT_Options
563  oc.set("osm-files", file);
564  oc.set("geometry.remove", "true");
565  oc.set("ramps.guess", "true");
566  oc.set("junctions.join", "true");
567  oc.set("tls.guess-signals", "true");
568  oc.set("tls.discard-simple", "true");
569  } else {
570  throw ProcessError("Attempted to import unknown file format '" + file + "'.");
571  }
572 
573  GUIDialog_Options* wizard =
574  new GUIDialog_Options(this, "Select Import Options", getWidth(), getHeight());
575 
576  if (wizard->execute()) {
577  NIFrame::checkOptions(); // needed to set projection parameters
578  loadConfigOrNet("", false, false, false);
579  }
580  }
581  return 1;
582  }
583 }
584 
585 
586 long
587 GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
588  // write debug information
589  WRITE_DEBUG("Open additional dialog");
590  // get the Additional file name
591  FXFileDialog opendialog(this, "Open Additionals file");
592  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
593  opendialog.setSelectMode(SELECTFILE_EXISTING);
594  opendialog.setPatternList("Additional files (*.xml)\nAll files (*)");
595  if (gCurrentFolder.length() != 0) {
596  opendialog.setDirectory(gCurrentFolder);
597  }
598  if (opendialog.execute()) {
599  // close additional dialog
600  WRITE_DEBUG("Close additional dialog");
601  // udpate current folder
602  gCurrentFolder = opendialog.getDirectory();
603  std::string file = opendialog.getFilename().text();
604  // disable validation for additionals
605  XMLSubSys::setValidation("never", "auto");
606  // Create additional handler
607  GNEAdditionalHandler additionalHandler(file, myNet->getViewNet());
608  // begin undoList operation
609  myUndoList->p_begin("Loading additionals from '" + file + "'");
610  // Run parser for additionals
611  if (!XMLSubSys::runParser(additionalHandler, file, false)) {
612  WRITE_ERROR("Loading of " + file + " failed.");
613  }
614  // end undoList operation and update view
615  myUndoList->p_end();
616  update();
617  // restore validation for additionals
618  XMLSubSys::setValidation("auto", "auto");
619  } else {
620  // write debug information
621  WRITE_DEBUG("Cancel additional dialog");
622  }
623  return 1;
624 }
625 
626 
627 long
628 GNEApplicationWindow::onCmdOpenTLSPrograms(FXObject*, FXSelector, void*) {
629  // write debug information
630  WRITE_DEBUG("Open TLSProgram dialog");
631  // get the shape file name
632  FXFileDialog opendialog(this, "Open TLSPrograms file");
633  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODETLS));
634  opendialog.setSelectMode(SELECTFILE_EXISTING);
635  opendialog.setPatternList("TLSProgram files (*.xml)\nAll files (*)");
636  if (gCurrentFolder.length() != 0) {
637  opendialog.setDirectory(gCurrentFolder);
638  }
639  if (opendialog.execute()) {
640  // close additional dialog
641  WRITE_DEBUG("Close TLSProgram dialog");
642  gCurrentFolder = opendialog.getDirectory();
643  std::string file = opendialog.getFilename().text();
644  // Run parser
645  myUndoList->p_begin("Loading TLS Programs from '" + file + "'");
646  myNet->computeNetwork(this);
647  if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(file) == false) {
648  // Abort undo/redo
649  myUndoList->abort();
650  } else {
651  // commit undo/redo operation
652  myUndoList->p_end();
653  update();
654  }
655  } else {
656  // write debug information
657  WRITE_DEBUG("Cancel TLSProgram dialog");
658  }
659  return 1;
660 }
661 
662 
663 long
664 GNEApplicationWindow::onCmdOpenDemandElements(FXObject*, FXSelector, void*) {
665  // write debug information
666  WRITE_DEBUG("Open demand element dialog");
667  // get the demand element file name
668  FXFileDialog opendialog(this, "Open demand element file");
669  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND));
670  opendialog.setSelectMode(SELECTFILE_EXISTING);
671  opendialog.setPatternList("Demand element files (*.xml)\nAll files (*)");
672  if (gCurrentFolder.length() != 0) {
673  opendialog.setDirectory(gCurrentFolder);
674  }
675  if (opendialog.execute()) {
676  // close additional dialog
677  WRITE_DEBUG("Close demand element dialog");
678  // udpate current folder
679  gCurrentFolder = opendialog.getDirectory();
680  std::string file = opendialog.getFilename().text();
681  // disable validation for additionals
682  XMLSubSys::setValidation("never", "auto");
683  // Create additional handler
684  GNERouteHandler demandHandler(file, myNet->getViewNet());
685  // begin undoList operation
686  myUndoList->p_begin("Loading demand elements from '" + file + "'");
687  // Run parser for additionals
688  if (!XMLSubSys::runParser(demandHandler, file, false)) {
689  WRITE_ERROR("Loading of " + file + " failed.");
690  }
691  // end undoList operation and update view
692  myUndoList->p_end();
693  update();
694  // restore validation for demand
695  XMLSubSys::setValidation("auto", "auto");
696  } else {
697  // write debug information
698  WRITE_DEBUG("Cancel demand element dialog");
699  }
700  return 1;
701 }
702 
703 
704 long
705 GNEApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* fileData) {
706  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
707  if (myViewNet && !onCmdClose(0, 0, 0)) {
708  return 1;
709  } else if (myAmLoading) {
710  myStatusbar->getStatusLine()->setText("Already loading!");
711  return 1;
712  } else {
713  std::string file((const char*)fileData);
714  loadConfigOrNet(file, sender == &myMenuBarFile.myRecentNets);
715  return 1;
716  }
717 }
718 
719 
720 long
721 GNEApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) {
722  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
723  if (myViewNet && !onCmdClose(0, 0, 0)) {
724  return 1;
725  } else {
726  // @note. If another network has been load during this session, it might not be desirable to set useStartupOptions
727  loadConfigOrNet(OptionsCont::getOptions().getString("sumo-net-file"), true, true);
728  return 1;
729  }
730 }
731 
732 
733 long
734 GNEApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
736  closeAllWindows();
737  // disable save additionals and TLS menu
740  // hide all Supermode, Network and demand commands
744  }
745  return 1;
746 }
747 
748 
749 long
750 GNEApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
751  if (myMDIClient->numChildren() > 0) {
752  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
753  if (w != nullptr) {
754  w->onCmdLocate(nullptr, sel, nullptr);
755  }
756  }
757  return 1;
758 }
759 
760 long
761 GNEApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void*) {
762  sender->handle(this, myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
763  return 1;
764 }
765 
766 
767 long
768 GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
770  return 1;
771 }
772 
773 
774 long
775 GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
776  // write warning if netedit is running in testing mode
777  WRITE_DEBUG("Opening about dialog");
778  // create and open about dialog
779  GNEDialog_About* about = new GNEDialog_About(this);
780  about->create();
781  about->show(PLACEMENT_OWNER);
782  // write warning if netedit is running in testing mode
783  WRITE_DEBUG("Closed about dialog");
784  return 1;
785 }
786 
787 
788 long GNEApplicationWindow::onClipboardRequest(FXObject*, FXSelector, void* ptr) {
789  FXEvent* event = (FXEvent*)ptr;
790  FXString string = GUIUserIO::clipped.c_str();
791  setDNDData(FROM_CLIPBOARD, event->target, string);
792  return 1;
793 }
794 
795 
796 long
797 GNEApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
798  eventOccurred();
799  return 1;
800 }
801 
802 
803 void
805  while (!myEvents.empty()) {
806  // get the next event
807  GUIEvent* e = myEvents.top();
808  myEvents.pop();
809  // process
810  switch (e->getOwnType()) {
813  break;
820  break;
821  default:
822  break;
823  }
824  delete e;
825  }
826 }
827 
828 
829 void
832  myAmLoading = false;
833  GNEEvent_NetworkLoaded* ec = static_cast<GNEEvent_NetworkLoaded*>(e);
834  // check whether the loading was successfull
835  if (ec->myNet == nullptr) {
836  // report failure
837  setStatusBarText("Loading of '" + ec->myFile + "' failed!");
838  } else {
839  // set new Net
840  myNet = ec->myNet;
841  // report success
842  setStatusBarText("'" + ec->myFile + "' loaded.");
844  // build viewparent toolbar grips before creating view parent
846  // initialise NETEDIT View
847  GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, "NETEDIT VIEW", this, nullptr, myNet, myUndoList, nullptr, MDI_TRACKING, 10, 10, 300, 200);
848  // create it maximized
849  viewParent->maximize();
850  // mark it as Active child
851  myMDIClient->setActiveChild(viewParent);
852  // cast pointer myViewNet
853  myViewNet = dynamic_cast<GNEViewNet*>(viewParent->getView());
854  // set settings in view
855  if (viewParent->getView() && ec->mySettingsFile != "") {
856  GUISettingsHandler settings(ec->mySettingsFile, true, true);
857  std::string settingsName = settings.addSettings(viewParent->getView());
858  viewParent->getView()->addDecals(settings.getDecals());
859  settings.applyViewport(viewParent->getView());
860  settings.setSnapshots(viewParent->getView());
861  }
862  // set network name on the caption
863  setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->myFile.c_str()));
864  // set supermode network
865  if (myViewNet) {
867  }
868  if (myViewNet && ec->myViewportFromRegistry) {
869  Position off;
870  off.set(getApp()->reg().readRealEntry("viewport", "x"), getApp()->reg().readRealEntry("viewport", "y"), getApp()->reg().readRealEntry("viewport", "z"));
871  Position p(off.x(), off.y(), 0);
872  myViewNet->setViewportFromToRot(off, p, 0);
873  }
874  }
875  getApp()->endWaitCursor();
877  // check if additionals/shapes has to be loaded at start
878  if (oc.isSet("additional-files") && !oc.getString("additional-files").empty() && myNet) {
879  // obtain vector of additional files
880  std::vector<std::string> additionalFiles = oc.getStringVector("additional-files");
881  // begin undolist
882  myUndoList->p_begin("Loading additionals and shapes from '" + toString(additionalFiles) + "'");
883  // iterate over every additional file
884  for (const auto& additionalFile : additionalFiles) {
885  WRITE_MESSAGE("Loading additionals and shapes from '" + additionalFile + "'");
886  GNEAdditionalHandler additionalHandler(additionalFile, myNet->getViewNet());
887  // disable validation for additionals
888  XMLSubSys::setValidation("never", "auto");
889  // Run parser
890  if (!XMLSubSys::runParser(additionalHandler, additionalFile, false)) {
891  WRITE_ERROR("Loading of " + additionalFile + " failed.");
892  }
893  // disable validation for additionals
894  XMLSubSys::setValidation("auto", "auto");
895  }
896 
897  myUndoList->p_end();
898  }
899  // check if demand elements has to be loaded at start
900  if (oc.isSet("route-files") && !oc.getString("route-files").empty() && myNet) {
901  // obtain vector of route files
902  std::vector<std::string> demandElementsFiles = oc.getStringVector("route-files");
903  // begin undolist
904  myUndoList->p_begin("Loading demand elements from '" + toString(demandElementsFiles) + "'");
905  // iterate over every route file
906  for (const auto& demandElementsFile : demandElementsFiles) {
907  WRITE_MESSAGE("Loading demand elements from '" + demandElementsFile + "'");
908  GNERouteHandler routeHandler(demandElementsFile, myNet->getViewNet());
909  // disable validation for demand elements
910  XMLSubSys::setValidation("never", "auto");
911  if (!XMLSubSys::runParser(routeHandler, demandElementsFile, false)) {
912  WRITE_ERROR("Loading of " + demandElementsFile + " failed.");
913  }
914  // disable validation for demand elements
915  XMLSubSys::setValidation("auto", "auto");
916  }
917 
918  myUndoList->p_end();
919  }
920  // check if additionals output must be changed
921  if (oc.isSet("additionals-output")) {
922  // overwrite "additional-files" with value "additionals-output"
923  oc.resetWritable();
924  oc.set("additional-files", oc.getString("additionals-output"));
925  }
926  // check if demand elements output must be changed
927  if (oc.isSet("demandelements-output")) {
928  // overwrite "route-files" with value "demandelements-output"
929  oc.resetWritable();
930  oc.set("route-files", oc.getString("demandelements-output"));
931  }
932  // after loading net shouldn't be saved
933  if (myNet) {
934  myNet->requiereSaveNet(false);
935  }
936  // update app
937  update();
938 }
939 
940 
941 void
943  GUIEvent_Message* ec = static_cast<GUIEvent_Message*>(e);
945 }
946 
947 // ===========================================================================
948 // GNEApplicationWindow::MenuBarFile method definitions
949 // ===========================================================================
950 
952  myRecentNets(GNEApp->getApp(), "nets"),
953  myGNEApp(GNEApp)
954 { }
955 
956 
957 void
959  FXMenuSeparator* sep1 = new FXMenuSeparator(fileMenu);
960  sep1->setTarget(&myRecentConfigs);
961  sep1->setSelector(FXRecentFiles::ID_ANYFILES);
962  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1);
963  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2);
964  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3);
965  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4);
966  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5);
967  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6);
968  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7);
969  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8);
970  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9);
971  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10);
972  new FXMenuCommand(fileMenu, "Clear Recent Configurat&ions", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR);
973  myRecentConfigs.setTarget(myGNEApp);
974  myRecentConfigs.setSelector(MID_RECENTFILE);
975  FXMenuSeparator* sep2 = new FXMenuSeparator(fileMenu);
976  sep2->setTarget(&myRecentNets);
977  sep2->setSelector(FXRecentFiles::ID_ANYFILES);
978  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1);
979  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2);
980  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3);
981  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4);
982  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5);
983  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6);
984  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7);
985  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8);
986  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9);
987  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10);
988  new FXMenuCommand(fileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR);
989  myRecentNets.setTarget(myGNEApp);
990  myRecentNets.setSelector(MID_RECENTFILE);
991 }
992 
993 // ---------------------------------------------------------------------------
994 // GNEViewNet::FileMenuCommands - methods
995 // ---------------------------------------------------------------------------
996 
998  myGNEApp(GNEApp) {
999 }
1000 
1001 
1002 void
1004  new FXMenuCommand(fileMenu,
1005  "&New Network...\tCtrl+N\tCreate a new network.",
1007  new FXMenuCommand(fileMenu,
1008  "&Open Network...\tCtrl+O\tOpen a SUMO network.",
1010  new FXMenuCommand(fileMenu,
1011  "Open Netconvert Configura&tion...\tCtrl+Shift+O\tOpen a configuration file with NETCONVERT options.",
1013  new FXMenuCommand(fileMenu,
1014  "Import &Foreign Network...\t\tImport a foreign network such as OSM.",
1016  new FXMenuCommand(fileMenu,
1017  "&Reload\tCtrl+R\tReloads the network.",
1019  new FXMenuCommand(fileMenu,
1020  "&Save Network...\tCtrl+S\tSave the network.",
1022  new FXMenuCommand(fileMenu,
1023  "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.",
1025  new FXMenuCommand(fileMenu,
1026  "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.",
1028  new FXMenuCommand(fileMenu,
1029  "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).",
1031  // create Additionals menu options
1032  myGNEApp->myFileMenuAdditionals = new FXMenuPane(myGNEApp);
1033  new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1034  "Load A&dditionals...\tCtrl+A\tLoad additionals and shapes.",
1036  saveAdditionals = new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1037  "Save Additionals\tCtrl+Shift+A\tSave additionals and shapes.",
1039  saveAdditionals->disable();
1040  saveAdditionalsAs = new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1041  "Save Additionals As...\t\tSave additional elements in another file.",
1043  saveAdditionalsAs->disable();
1044  new FXMenuCascade(fileMenu, "Additionals and shapes", GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), myGNEApp->myFileMenuAdditionals);
1045  // create TLS menu options
1046  myGNEApp->myFileMenuTLS = new FXMenuPane(myGNEApp);
1047  new FXMenuCommand(myGNEApp->myFileMenuTLS,
1048  "load TLS Programs...\tCtrl+K\tload TLS Programs in all Traffic Lights of the net.",
1050  saveTLSPrograms = new FXMenuCommand(myGNEApp->myFileMenuTLS,
1051  "Save TLS Programs \tCtrl+Shift+K\tSave TLS Programs of all Traffic Lights of the current net.",
1053  saveTLSPrograms->disable();
1054  new FXMenuCommand(myGNEApp->myFileMenuTLS,
1055  "Save TLS Programs As...\t\tSave TLS Programs of all Traffic Lights of the current net in another file.",
1057  new FXMenuCascade(fileMenu, "Traffic Lights", GUIIconSubSys::getIcon(ICON_MODETLS), myGNEApp->myFileMenuTLS);
1058  // create DemandElements menu options
1059  myGNEApp->myFileMenuDemandElements = new FXMenuPane(myGNEApp);
1060  new FXMenuCommand(myGNEApp->myFileMenuDemandElements,
1061  "Load demand elements...\tCtrl+D\tLoad demand elements.",
1064  "Save demand elements\tCtrl+Shift+D\tSave demand elements.",
1066  saveDemandElements->disable();
1068  "Save demand elements as...\t\tSave demand elements in another file.",
1070  saveDemandElementsAs->disable();
1071  new FXMenuCascade(fileMenu, "Demand elements", GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), myGNEApp->myFileMenuDemandElements);
1072  // close network
1073  new FXMenuSeparator(fileMenu);
1074  new FXMenuCommand(fileMenu,
1075  "Close\tCtrl+W\tClose the net&work.",
1077  // build recent files
1079  new FXMenuSeparator(fileMenu);
1080  new FXMenuCommand(fileMenu, "&Quit\tCtrl+Q\tQuit the Application.", nullptr, myGNEApp, MID_HOTKEY_CTRL_Q_CLOSE, 0);
1081 }
1082 
1083 // ---------------------------------------------------------------------------
1084 // GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands - methods
1085 // ---------------------------------------------------------------------------
1086 
1088  createEdgeMode(nullptr),
1089  moveMode(nullptr),
1090  deleteMode(nullptr),
1091  inspectMode(nullptr),
1092  selectMode(nullptr),
1093  connectMode(nullptr),
1094  prohibitionMode(nullptr),
1095  TLSMode(nullptr),
1096  additionalMode(nullptr),
1097  crossingMode(nullptr),
1098  TAZMode(nullptr),
1099  shapeMode(nullptr),
1100  myEditMenuCommandsParent(editMenuCommandsParent) {
1101 }
1102 
1103 
1104 void
1106  createEdgeMode->show();
1107  moveMode->show();
1108  deleteMode->show();
1109  inspectMode->show();
1110  selectMode->show();
1111  connectMode->show();
1112  prohibitionMode->show();
1113  TLSMode->show();
1114  additionalMode->show();
1115  crossingMode->show();
1116  TAZMode->show();
1117  shapeMode->show();
1118  // also show separator
1119  myHorizontalSeparator->show();
1120 }
1121 
1122 
1123 void
1125  createEdgeMode->hide();
1126  moveMode->hide();
1127  deleteMode->hide();
1128  inspectMode->hide();
1129  selectMode->hide();
1130  connectMode->hide();
1131  prohibitionMode->hide();
1132  TLSMode->hide();
1133  additionalMode->hide();
1134  crossingMode->hide();
1135  TAZMode->hide();
1136  shapeMode->hide();
1137  // also hide separator
1138  myHorizontalSeparator->hide();
1139 }
1140 
1141 
1142 void
1144  // build every FXMenuCommand giving it a shortcut
1145  createEdgeMode = new FXMenuCommand(editMenu,
1146  "&Edge mode\tE\tCreate junction and edges.",
1148  moveMode = new FXMenuCommand(editMenu,
1149  "&Move mode\tM\tMove elements.",
1151  deleteMode = new FXMenuCommand(editMenu,
1152  "&Delete mode\tD\tDelete elements.",
1154  inspectMode = new FXMenuCommand(editMenu,
1155  "&Inspect mode\tI\tInspect elements and change their attributes.",
1157  selectMode = new FXMenuCommand(editMenu,
1158  "&Select mode\tS\tSelect elements.",
1160  connectMode = new FXMenuCommand(editMenu,
1161  "&Connection mode\tC\tEdit connections between lanes.",
1163  prohibitionMode = new FXMenuCommand(editMenu,
1164  "Pro&hibition mode\tW\tEdit connection prohibitions.",
1166  TLSMode = new FXMenuCommand(editMenu,
1167  "&Traffic light mode\tT\tEdit traffic lights over junctions.",
1169  additionalMode = new FXMenuCommand(editMenu,
1170  "&Additional mode\tA\tCreate additional elements.",
1172  crossingMode = new FXMenuCommand(editMenu,
1173  "C&rossing mode\tR\tCreate crossings between edges.",
1175  TAZMode = new FXMenuCommand(editMenu,
1176  "TA&Z mode\tZ\tCreate Traffic Assignment Zones.",
1178  shapeMode = new FXMenuCommand(editMenu,
1179  "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.",
1181  // build separator
1182  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1183 }
1184 
1185 // ---------------------------------------------------------------------------
1186 // GNEApplicationWindow::EditMenuCommands::DemandMenuCommands - methods
1187 // ---------------------------------------------------------------------------
1188 
1190  routeMode(nullptr),
1191  vehicleMode(nullptr),
1192  vehicleTypeMode(nullptr),
1193  stopMode(nullptr),
1194  personTypeMode(nullptr),
1195  personMode(nullptr),
1196  personPlanMode(nullptr),
1197  myEditMenuCommandsParent(editMenuCommandsParent) {
1198 }
1199 
1200 
1201 void
1203  routeMode->show();
1204  vehicleMode->show();
1205  vehicleTypeMode->show();
1206  stopMode->show();
1207  personTypeMode->show();
1208  personMode->show();
1209  personPlanMode->show();
1210  // also show separator
1211  myHorizontalSeparator->show();
1212 }
1213 
1214 
1215 void
1217  routeMode->hide();
1218  vehicleMode->hide();
1219  vehicleTypeMode->hide();
1220  stopMode->hide();
1221  personTypeMode->hide();
1222  personMode->hide();
1223  personPlanMode->hide();
1224  // also hide separator
1225  myHorizontalSeparator->hide();
1226 }
1227 
1228 
1229 void
1231  // build every FXMenuCommand giving it a shortcut
1232  routeMode = new FXMenuCommand(editMenu,
1233  "Route mode\tR\tCreate Routes.",
1235  vehicleMode = new FXMenuCommand(editMenu,
1236  "Vehicle mode\tV\tCreate vehicles.",
1238  vehicleTypeMode = new FXMenuCommand(editMenu,
1239  "Vehicle type mode\tT\tCreate vehicle types.",
1241  stopMode = new FXMenuCommand(editMenu,
1242  "Stop mode\tA\tCreate stops.",
1244  personTypeMode = new FXMenuCommand(editMenu,
1245  "Person type mode\tW\tCreate person types.",
1247  personMode = new FXMenuCommand(editMenu,
1248  "Person mode\tP\tCreate persons.",
1250  personPlanMode = new FXMenuCommand(editMenu,
1251  "Person plan mode\tC\tCreate person plans.",
1253  // build separator
1254  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1255 }
1256 
1257 // ---------------------------------------------------------------------------
1258 // GNEApplicationWindow::EditMenuCommands - methods
1259 // ---------------------------------------------------------------------------
1260 
1262  networkMenuCommands(this),
1263  demandMenuCommands(this),
1264  myGNEApp(GNEApp) {
1265 }
1266 
1267 
1268 void
1270  // build undo/redo command
1271  undoLastChange = new FXMenuCommand(fileMenu,
1272  "&Undo\tCtrl+Z\tUndo the last change.",
1274  redoLastChange = new FXMenuCommand(fileMenu,
1275  "&Redo\tCtrl+Y\tRedo the last change.",
1277  // build separator
1278  new FXMenuSeparator(fileMenu);
1279  // build Supermode commands and hide it
1282  // build Network modes commands and hide it
1285  // build Demand Modes commands
1288  editViewScheme = new FXMenuCommand(fileMenu,
1289  "Edit Visualisation\tCtrl+V\tOpens a dialog for editing visualization settings.",
1290  nullptr, myGNEApp, MID_EDITVIEWSCHEME);
1291  editViewPort = new FXMenuCommand(fileMenu,
1292  "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.",
1293  nullptr, myGNEApp, MID_EDITVIEWPORT);
1294  toogleGrid = new FXMenuCommand(fileMenu,
1295  "Toggle Grid\tCtrl+G\tToggles background grid (and snap-to-grid functionality).",
1297  new FXMenuSeparator(fileMenu);
1298  openInSUMOGUI = new FXMenuCommand(fileMenu,
1299  "Open in SUMO GUI\tCtrl+T\tOpens the SUMO GUI application with the current network.",
1301 }
1302 
1303 // ---------------------------------------------------------------------------
1304 // GNEViewNet::ProcessingMenuCommands - methods
1305 // ---------------------------------------------------------------------------
1306 
1308  myGNEApp(GNEApp) {
1309 }
1310 
1311 
1312 void
1314  // build network processing menu commands
1315  computeNetwork = new FXMenuCommand(fileMenu,
1316  "Compute Junctions\tF5\tComputes junction shape and logic.",
1318  computeNetworkVolatile = new FXMenuCommand(fileMenu,
1319  "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.",
1321  cleanJunctions = new FXMenuCommand(fileMenu,
1322  "Clean Junctions\tF6\tRemoves solitary junctions.",
1324  joinJunctions = new FXMenuCommand(fileMenu,
1325  "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.",
1327  clearInvalidCrossings = new FXMenuCommand(fileMenu,
1328  "Clean invalid crossings\tF8\tClear invalid crossings.",
1330  // build demand processing menu commands
1331  computeDemand = new FXMenuCommand(fileMenu,
1332  "Compute demand\tF5\tComputes demand elements.",
1334  cleanRoutes = new FXMenuCommand(fileMenu,
1335  "Clean routes\tF6\tRemoves routes without vehicles.",
1337  joinRoutes = new FXMenuCommand(fileMenu,
1338  "Join routes\tF7\tJoins routes with the same edges.",
1340  clearInvalidDemandElements = new FXMenuCommand(fileMenu,
1341  "Clean invalid route elements\tF8\tClear elements with an invalid path (routes, Trips, Flows...).",
1343  // add separator (because optionsmenu is commmon for Network and Demand modes
1344  new FXMenuSeparator(fileMenu);
1345  optionMenus = new FXMenuCommand(fileMenu,
1346  "Options\tF10\t\tConfigure Processing Options.",
1348 }
1349 
1350 
1351 void
1353  // first enable menu commands
1354  computeNetwork->enable();
1355  computeNetworkVolatile->enable();
1356  cleanJunctions->enable();
1357  joinJunctions->enable();
1358  clearInvalidCrossings->enable();
1359  // now show it
1360  computeNetwork->show();
1361  computeNetworkVolatile->show();
1362  cleanJunctions->show();
1363  joinJunctions->show();
1364  clearInvalidCrossings->show();
1365 }
1366 
1367 
1368 void
1370  // first disable menu commands
1371  computeNetwork->disable();
1372  computeNetworkVolatile->disable();
1373  cleanJunctions->disable();
1374  joinJunctions->disable();
1375  clearInvalidCrossings->disable();
1376  // now hide it
1377  computeNetwork->hide();
1378  computeNetworkVolatile->hide();
1379  cleanJunctions->hide();
1380  joinJunctions->hide();
1381  clearInvalidCrossings->hide();
1382 }
1383 
1384 
1385 void
1387  // first enable menu commands
1388  computeDemand->enable();
1389  cleanRoutes->enable();
1390  joinRoutes->enable();
1391  clearInvalidDemandElements->enable();
1392  // now show it
1393  computeDemand->show();
1394  cleanRoutes->show();
1395  joinRoutes->show();
1397 }
1398 
1399 
1400 void
1402  // first disable menu commands
1403  computeDemand->disable();
1404  cleanRoutes->disable();
1405  joinRoutes->disable();
1406  clearInvalidDemandElements->disable();
1407  // now hide it
1408  computeDemand->hide();
1409  cleanRoutes->hide();
1410  joinRoutes->hide();
1412 }
1413 
1414 // ---------------------------------------------------------------------------
1415 // GNEViewNet::LocateMenuCommands - methods
1416 // ---------------------------------------------------------------------------
1417 
1419  myGNEApp(GNEApp) {
1420 }
1421 
1422 
1423 void
1425  // build locate menu commands
1426  new FXMenuCommand(fileMenu,
1427  "Locate &Junctions\tShift+J\tOpen a dialog for locating a Junction.",
1429  new FXMenuCommand(fileMenu,
1430  "Locate &Edges\tShift+E\tOpen a dialog for locating an Edge.",
1432  new FXMenuCommand(fileMenu,
1433  "Locate &Vehicles\tShift+V\tOpen a dialog for locating a Vehicle.",
1435  new FXMenuCommand(fileMenu,
1436  "Locate &Route\tShift+R\tOpen a dialog for locating a Route.",
1438  new FXMenuCommand(fileMenu,
1439  "Locate &Stops\tShift+S\tOpen a dialog for locating a Stop.",
1441  new FXMenuCommand(fileMenu,
1442  "Locate &TLS\tShift+T\tOpen a dialog for locating a Traffic Light.",
1444  new FXMenuCommand(fileMenu,
1445  "Locate &Additional\tShift+A\tOpen a dialog for locating an Additional Structure.",
1447  new FXMenuCommand(fileMenu,
1448  "Locate P&oI\tShift+O\tOpen a dialog for locating a Point of Interest.",
1450  new FXMenuCommand(fileMenu,
1451  "Locate Po&lygon\tShift+L\tOpen a dialog for locating a Polygon.",
1453 }
1454 
1455 // ---------------------------------------------------------------------------
1456 // GNEViewNet::NetworkCheckableButtons - methods
1457 // ---------------------------------------------------------------------------
1458 
1460  networkMode(nullptr),
1461  demandMode(nullptr),
1462  myGNEApp(GNEApp) {
1463 }
1464 
1465 
1466 void
1468  networkMode->show();
1469  demandMode->show();
1470  // also show separator
1471  myHorizontalSeparator->show();
1472 }
1473 
1474 
1475 void
1477  networkMode->hide();
1478  demandMode->hide();
1479  // also hide separator
1480  myHorizontalSeparator->hide();
1481 }
1482 
1483 
1484 void
1486  // build supermode menu commands
1487  networkMode = new FXMenuCommand(editMenu, "&Network mode\tF3\tSelect network mode.",
1489  demandMode = new FXMenuCommand(editMenu, "&Demand mode\tF4\tSelect demand mode.",
1491  // build separator
1492  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1493 }
1494 
1495 // ---------------------------------------------------------------------------
1496 // private methods
1497 // ---------------------------------------------------------------------------
1498 
1499 void
1501  // declare a FXMenuTitle needed to set height in all menu titles
1502  FXMenuTitle* menuTitle;
1503  // build file menu
1504  myFileMenu = new FXMenuPane(this, LAYOUT_FIX_HEIGHT);
1505  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&File", nullptr, myFileMenu, LAYOUT_FIX_HEIGHT);
1506  menuTitle->setHeight(23);
1508  // build edit menu
1509  myEditMenu = new FXMenuPane(this);
1510  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Edit", nullptr, myEditMenu, LAYOUT_FIX_HEIGHT);
1511  menuTitle->setHeight(23);
1513  // build processing menu (trigger netbuild computations)
1514  myProcessingMenu = new FXMenuPane(this);
1515  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Processing", nullptr, myProcessingMenu, LAYOUT_FIX_HEIGHT);
1516  menuTitle->setHeight(23);
1518  // build locate menu
1519  myLocatorMenu = new FXMenuPane(this);
1520  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Locate", nullptr, myLocatorMenu, LAYOUT_FIX_HEIGHT);
1521  menuTitle->setHeight(23);
1523  // build windows menu
1524  myWindowsMenu = new FXMenuPane(this);
1525  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Windows", nullptr, myWindowsMenu, LAYOUT_FIX_HEIGHT);
1526  menuTitle->setHeight(23);
1527  // build windows menu commands
1528  new FXMenuCheck(myWindowsMenu,
1529  "&Show Status Line\t\tToggle this Status Bar on/off.",
1530  myStatusbar, FXWindow::ID_TOGGLESHOWN);
1531  new FXMenuCheck(myWindowsMenu,
1532  "Show &Message Window\t\tToggle the Message Window on/off.",
1533  myMessageWindow, FXWindow::ID_TOGGLESHOWN);
1534  new FXMenuCommand(myWindowsMenu,
1535  "&Clear Message Window\t\tClear the message window.",
1536  nullptr, this, MID_CLEARMESSAGEWINDOW);
1537  // build help menu
1538  myHelpMenu = new FXMenuPane(this);
1539  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Help", nullptr, myHelpMenu, LAYOUT_FIX_HEIGHT);
1540  menuTitle->setHeight(23);
1541  // build help menu commands
1542  new FXMenuCommand(myHelpMenu,
1543  "&Online Documentation\tF1\tOpen Online documentation.",
1544  nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION);
1545  new FXMenuCommand(myHelpMenu,
1546  "&About\tF2\tAbout netedit.",
1547  nullptr, this, MID_HOTKEY_F2_ABOUT);
1548 }
1549 
1550 
1551 void
1552 GNEApplicationWindow::loadConfigOrNet(const std::string file, bool isNet, bool isReload, bool useStartupOptions, bool newNet) {
1554  getApp()->beginWaitCursor();
1555  myAmLoading = true;
1556  closeAllWindows();
1557  if (isReload) {
1558  myLoadThread->start();
1559  setStatusBarText("Reloading.");
1560  } else {
1561  gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1562  myLoadThread->loadConfigOrNet(file, isNet, useStartupOptions, newNet);
1563  setStatusBarText("Loading '" + file + "'.");
1564  }
1565  // show supermode commands menu
1567  // show Network command menus (because Network is the default supermode)
1569  // update window
1570  update();
1571 }
1572 
1573 
1574 FXGLCanvas*
1576  // NETEDIT uses only a single View, then return nullptr
1577  return nullptr;
1578 }
1579 
1580 
1581 SUMOTime
1583  return 0;
1584 }
1585 
1586 
1587 double
1589  return 1;
1590 }
1591 
1592 
1593 GNEUndoList*
1595  return myUndoList;
1596 }
1597 
1598 
1601  return myToolbarsGrip;
1602 }
1603 
1604 
1605 void
1607  myTrackerLock.lock();
1608  // remove trackers and other external windows
1609  while (!myGLWindows.empty()) {
1610  delete myGLWindows.front();
1611  }
1612  myViewNet = nullptr;
1613  for (FXMainWindow* const window : myTrackerWindows) {
1614  window->destroy();
1615  delete window;
1616  }
1617  myTrackerWindows.clear();
1618  // reset the caption
1619  setTitle(myTitlePrefix);
1620  // add a separator to the log
1622  myTrackerLock.unlock();
1623  // remove coordinate information
1624  myGeoCoordinate->setText("N/A");
1625  myCartesianCoordinate->setText("N/A");
1626  // check if net can be deleted
1627  if (myNet != nullptr) {
1628  delete myNet;
1629  myNet = nullptr;
1631  }
1633  // Reset textures
1635  // reset fonts
1637  // disable saving commmand
1639 }
1640 
1641 
1642 FXCursor*
1644  return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1645 }
1646 
1647 
1648 void
1651  // Disable normalization preserve the given network as far as possible
1652  oc.set("offset.disable-normalization", "true");
1653  loadConfigOrNet("", true, false, true, oc.getBool("new"));
1654 }
1655 
1656 
1657 void
1658 GNEApplicationWindow::setStatusBarText(const std::string& statusBarText) {
1659  myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1660  myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1661 }
1662 
1663 
1664 long
1666  // obtain option container
1668  // declare variable to save FXMessageBox outputs.
1669  FXuint answer = 0;
1670  // declare string to save paths in wich additionals, shapes and demand will be saved
1671  std::string additionalsSavePath = oc.getString("additional-files");
1672  std::string demandElementsSavePath = oc.getString("route-files");
1673  // write warning if netedit is running in testing mode
1674  WRITE_DEBUG("Opening FXMessageBox 'Volatile Recomputing'");
1675  // open question dialog box
1676  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Recompute with volatile options",
1677  "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?");
1678  if (answer != 1) { //1:yes, 2:no, 4:esc
1679  // write warning if netedit is running in testing mode
1680  if (answer == 2) {
1681  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1682  } else if (answer == 4) {
1683  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1684  }
1685  // abort recompute with volatile options
1686  return 0;
1687  } else {
1688  // write warning if netedit is running in testing mode
1689  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1690  // Check if there are additionals in our net
1691  if (myNet->getNumberOfAdditionals() > 0) {
1692  // ask user if want to save additionals if weren't saved previously
1693  if (oc.getString("additional-files") == "") {
1694  // write warning if netedit is running in testing mode
1695  WRITE_DEBUG("Opening FXMessageBox 'Save additionals before recomputing'");
1696  // open question dialog box
1697  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save additionals before recomputing with volatile options",
1698  "Would you like to save additionals before recomputing?");
1699  if (answer != 1) { //1:yes, 2:no, 4:esc
1700  // write warning if netedit is running in testing mode
1701  if (answer == 2) {
1702  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'No'");
1703  } else if (answer == 4) {
1704  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'ESC'");
1705  }
1706  } else {
1707  // write warning if netedit is running in testing mode
1708  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'Yes'");
1709  // Open a dialog to set filename output
1710  FXString file = MFXUtils::getFilename2Write(this,
1711  "Select name of the demand element file", ".xml",
1713  gCurrentFolder).text();
1714  // add xml extension
1715  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
1716  // check that file is valid
1717  if (fileWithExtension != "") {
1718  // update additional files
1719  oc.resetWritable();
1720  oc.set("additional-files", fileWithExtension);
1721  // set obtanied filename output into additionalsSavePath (can be "")
1722  additionalsSavePath = oc.getString("additional-files");
1723  }
1724  }
1725  }
1726  // Check if additional must be saved in a temporal directory, if user didn't define a directory for additionals
1727  if (oc.getString("additional-files") == "") {
1728  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1729  additionalsSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpAdditionalsNetedit.xml");
1730  }
1731  // Start saving additionals
1732  getApp()->beginWaitCursor();
1733  try {
1734  myNet->saveAdditionals(additionalsSavePath);
1735  } catch (IOError& e) {
1736  // write warning if netedit is running in testing mode
1737  WRITE_DEBUG("Opening FXMessageBox 'Error saving additionals before recomputing'");
1738  // open error message box
1739  FXMessageBox::error(this, MBOX_OK, "Saving additionals in temporal folder failed!", "%s", e.what());
1740  // write warning if netedit is running in testing mode
1741  WRITE_DEBUG("Closed FXMessageBox 'Error saving additionals before recomputing' with 'OK'");
1742  }
1743  // end saving additionals
1745  getApp()->endWaitCursor();
1746  } else {
1747  // clear additional path
1748  additionalsSavePath = "";
1749  }
1750  // Check if there are demand elements in our net
1751  if (myNet->getNumberOfDemandElements() > 0) {
1752  // ask user if want to save demand elements if weren't saved previously
1753  if (oc.getString("route-files") == "") {
1754  // write warning if netedit is running in testing mode
1755  WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before recomputing'");
1756  // open question dialog box
1757  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save demand elements before recomputing with volatile options",
1758  "Would you like to save demand elements before recomputing?");
1759  if (answer != 1) { //1:yes, 2:no, 4:esc
1760  // write warning if netedit is running in testing mode
1761  if (answer == 2) {
1762  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'No'");
1763  } else if (answer == 4) {
1764  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'ESC'");
1765  }
1766  } else {
1767  // write warning if netedit is running in testing mode
1768  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'Yes'");
1769  // Open a dialog to set filename output
1770  FXString file = MFXUtils::getFilename2Write(this,
1771  "Select name of the demand element file", ".xml",
1773  gCurrentFolder).text();
1774  // add xml extension
1775  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
1776  // check that file is valid
1777  if (fileWithExtension != "") {
1778  // update route files
1779  oc.resetWritable();
1780  oc.set("route-files", fileWithExtension);
1781  // set obtanied filename output into demand elementSavePath (can be "")
1782  demandElementsSavePath = oc.getString("route-files");
1783  }
1784  }
1785  }
1786  // Check if demand element must be saved in a temporal directory, if user didn't define a directory for demand elements
1787  if (oc.getString("route-files") == "") {
1788  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1789  demandElementsSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpDemandElementsNetedit.xml");
1790  }
1791  // Start saving demand elements
1792  getApp()->beginWaitCursor();
1793  try {
1794  myNet->saveDemandElements(demandElementsSavePath);
1795  } catch (IOError& e) {
1796  // write warning if netedit is running in testing mode
1797  WRITE_DEBUG("Opening FXMessageBox 'Error saving demand elements before recomputing'");
1798  // open error message box
1799  FXMessageBox::error(this, MBOX_OK, "Saving demand elements in temporal folder failed!", "%s", e.what());
1800  // write warning if netedit is running in testing mode
1801  WRITE_DEBUG("Closed FXMessageBox 'Error saving demand elements before recomputing' with 'OK'");
1802  }
1803  // end saving demand elements
1805  getApp()->endWaitCursor();
1806  } else {
1807  // clear demand element path
1808  demandElementsSavePath = "";
1809  }
1810  // compute with volatile options
1811  myNet->computeNetwork(this, true, true, additionalsSavePath, demandElementsSavePath);
1812  updateControls();
1813  return 1;
1814  }
1815 }
1816 
1817 
1818 void
1822 }
1823 
1824 
1825 void
1829 }
1830 
1831 
1832 void
1835 }
1836 
1837 
1838 void
1842 }
1843 
1844 
1845 void
1849 }
1850 
1851 
1852 long
1853 GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) {
1854  // check that currently there is a View
1855  if (myViewNet) {
1856  myViewNet->onCmdSetSupermode(sender, sel, ptr);
1857  }
1858  return 1;
1859 }
1860 
1861 
1862 long
1863 GNEApplicationWindow::onCmdSetMode(FXObject* sender, FXSelector sel, void* ptr) {
1864  // check that currently there is a View
1865  if (myViewNet) {
1866  myViewNet->onCmdSetMode(sender, sel, ptr);
1867  }
1868  return 1;
1869 }
1870 
1871 
1872 long
1873 GNEApplicationWindow::onCmdProcessButton(FXObject*, FXSelector sel, void*) {
1874  // first check if there is a view
1875  if (myViewNet) {
1876  // process depending of supermode
1878  // check what FXMenuCommand was called
1879  switch (FXSELID(sel)) {
1881  // show extra information for tests
1882  WRITE_DEBUG("Key F5 (Compute) pressed");
1883  myNet->computeNetwork(this, true, false);
1884  updateControls();
1885  break;
1887  // show extra information for tests
1888  WRITE_DEBUG("Keys Shift + F5 (Compute with volatile options) pressed");
1890  break;
1892  // show extra information for tests
1893  WRITE_DEBUG("Key F6 (Clean junction) pressed");
1895  break;
1897  // show extra information for tests
1898  WRITE_DEBUG("Key F7 (Join junctions) pressed");
1900  break;
1902  // show extra information for tests
1903  WRITE_DEBUG("Key F8 (Clean invalid crossings) pressed");
1905  break;
1906  default:
1907  break;
1908  }
1909  } else {
1910  // check what FXMenuCommand was called
1911  switch (FXSELID(sel)) {
1913  // show extra information for tests
1914  WRITE_DEBUG("Key F5 (Compute) pressed");
1916  updateControls();
1917  break;
1919  // show extra information for tests
1920  WRITE_DEBUG("Key F6 (RemoveUnusedRoutes) pressed");
1922  break;
1924  // show extra information for tests
1925  WRITE_DEBUG("Key F7 (JoinRoutes) pressed");
1927  break;
1929  // show extra information for tests
1930  WRITE_DEBUG("Key F8 (CleanInvalidDemandElements) pressed");
1932  break;
1933  default:
1934  break;
1935  }
1936  }
1937  }
1938  return 1;
1939 }
1940 
1941 
1942 long
1943 GNEApplicationWindow::onCmdOpenSUMOGUI(FXObject*, FXSelector, void*) {
1944  // check that currently there is a View
1945  if (myViewNet) {
1946  FXRegistry reg("SUMO GUI", "Eclipse");
1947  reg.read();
1948  reg.writeRealEntry("viewport", "x", myViewNet->getChanger().getXPos());
1949  reg.writeRealEntry("viewport", "y", myViewNet->getChanger().getYPos());
1950  reg.writeRealEntry("viewport", "z", myViewNet->getChanger().getZPos());
1951  reg.write();
1952  std::string sumogui = "sumo-gui";
1953  const char* sumoPath = getenv("SUMO_HOME");
1954  if (sumoPath != nullptr) {
1955  std::string newPath = std::string(sumoPath) + "/bin/sumo-gui";
1956  if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
1957  sumogui = "\"" + newPath + "\"";
1958  }
1959  }
1960  std::string cmd = sumogui + " --registry-viewport" + " -n " + OptionsCont::getOptions().getString("output-file");
1961  // start in background
1962 #ifndef WIN32
1963  cmd = cmd + " &";
1964 #else
1965  // see "help start" for the parameters
1966  cmd = "start /B \"\" " + cmd;
1967 #endif
1968  WRITE_MESSAGE("Running " + cmd + ".");
1969  // yay! fun with dangerous commands... Never use this over the internet
1971  }
1972  return 1;
1973 }
1974 
1975 
1976 long
1977 GNEApplicationWindow::onCmdAbort(FXObject*, FXSelector, void*) {
1978  // check that view exists
1979  if (myViewNet) {
1980  // show extra information for tests
1981  WRITE_DEBUG("Key ESC (abort) pressed");
1982  // first check if we're selecting a subset of edges in TAZ Frame
1984  // show extra information for tests
1985  WRITE_DEBUG("Cleaning current selected edges");
1986  // clear current selection
1988  } else {
1989  // abort current operation
1991  myViewNet->update();
1992  }
1993  }
1994  return 1;
1995 }
1996 
1997 
1998 long
1999 GNEApplicationWindow::onCmdDel(FXObject*, FXSelector, void*) {
2000  // check that view exists
2001  if (myViewNet) {
2002  // show extra information for tests
2003  WRITE_DEBUG("Key DEL (delete) pressed");
2004  myViewNet->hotkeyDel();
2005  }
2006  return 1;
2007 }
2008 
2009 
2010 long
2011 GNEApplicationWindow::onCmdEnter(FXObject*, FXSelector, void*) {
2012  // check that view exists
2013  if (myViewNet) {
2014  // show extra information for tests
2015  WRITE_DEBUG("Key ENTER pressed");
2017  }
2018  return 1;
2019 }
2020 
2021 
2022 long
2023 GNEApplicationWindow::onCmdBackspace(FXObject*, FXSelector, void*) {
2024  // check that view exists
2025  if (myViewNet) {
2026  // show extra information for tests
2027  WRITE_DEBUG("Key BACKSPACE pressed");
2029  }
2030  return 1;
2031 }
2032 
2033 
2034 long
2035 GNEApplicationWindow::onCmdFocusFrame(FXObject*, FXSelector, void*) {
2036  // check that view exists
2037  if (myViewNet) {
2039  }
2040  return 1;
2041 }
2042 
2043 
2044 long
2045 GNEApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
2046  // check that view exists
2047  if (myViewNet) {
2049  }
2050  return 1;
2051 }
2052 
2053 
2054 long
2055 GNEApplicationWindow::onCmdEditViewScheme(FXObject*, FXSelector, void*) {
2056  // check that view exists
2057  if (myViewNet) {
2059  }
2060  return 1;
2061 }
2062 
2063 
2064 long
2065 GNEApplicationWindow::onCmdToogleGrid(FXObject* obj, FXSelector sel, void* ptr) {
2066  // check that view exists
2067  if (myViewNet) {
2068  // Toogle getMenuCheckShowGrid of GNEViewNet
2069  if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) {
2070  myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE);
2071  // show extra information for tests
2072  WRITE_DEBUG("Disabled grid throught Ctrl+g hotkey");
2073  } else {
2075  // show extra information for tests
2076  WRITE_WARNING("Enabled grid throught Ctrl+g hotkey");
2077  }
2078  // Call manually show grid function
2079  myViewNet->onCmdToogleShowGrid(obj, sel, ptr);
2080  }
2081  return 1;
2082 }
2083 
2084 
2085 long
2086 GNEApplicationWindow::onCmdToogleEditOptions(FXObject* obj, FXSelector sel, void* ptr) {
2087  // first check that we have a ViewNet
2088  if (myViewNet) {
2089  // first check what selector was called
2090  int numericalKeyPressed = sel - FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOOGLEEDITOPTION) - 1;
2091  // check that numericalKeyPressed is valid
2092  if ((numericalKeyPressed < 0) || (numericalKeyPressed > 10)) {
2093  return 1;
2094  }
2095  // declare a vector in which save visible menu commands
2096  std::vector<FXMenuCheck*> visibleMenuCommands;
2097  // get common, network and demand visible menu commands
2101  // now check that numericalKeyPressed isn't greather than visible view options
2102  if (numericalKeyPressed >= (int)visibleMenuCommands.size()) {
2103  return 1;
2104  }
2105  // finally function correspond to visibleMenuCommands[numericalKeyPressed]
2106  if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getCommonViewOptions().menuCheckShowGrid) {
2107  // Toogle menuCheckShowGrid
2108  if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) {
2109  myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE);
2110  // show extra information for tests
2111  WRITE_DEBUG("Disabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1));
2112  } else {
2114  // show extra information for tests
2115  WRITE_DEBUG("Enabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1));
2116  }
2117  // Call manually onCmdToogleShowGrid
2118  return myViewNet->onCmdToogleShowGrid(obj, sel, ptr);
2119  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowDemandElements) {
2120  // Toogle menuCheckShowDemandElements
2121  if (myViewNet->getNetworkViewOptions().menuCheckShowDemandElements->getCheck() == TRUE) {
2123  // show extra information for tests
2124  WRITE_DEBUG("Disabled show demand elements throught alt + " + toString(numericalKeyPressed + 1));
2125  } else {
2127  // show extra information for tests
2128  WRITE_DEBUG("Enabled show demand elements throught alt + " + toString(numericalKeyPressed + 1));
2129  }
2130  // Call manually onCmdToogleShowDemandElements
2131  return myViewNet->onCmdToogleShowDemandElements(obj, sel, ptr);
2132  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckSelectEdges) {
2133  // Toogle menuCheckSelectEdges
2134  if (myViewNet->getNetworkViewOptions().menuCheckSelectEdges->getCheck() == TRUE) {
2136  // show extra information for tests
2137  WRITE_DEBUG("Disabled select edges throught alt + " + toString(numericalKeyPressed + 1));
2138  } else {
2140  // show extra information for tests
2141  WRITE_DEBUG("Enabled select edges throught alt + " + toString(numericalKeyPressed + 1));
2142  }
2143  // Call manually onCmdToogleSelectEdges
2144  return myViewNet->onCmdToogleSelectEdges(obj, sel, ptr);
2145  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowConnections) {
2146  // Toogle menuCheckShowConnections
2147  if (myViewNet->getNetworkViewOptions().menuCheckShowConnections->getCheck() == TRUE) {
2149  // show extra information for tests
2150  WRITE_DEBUG("Disabled show connections throught alt + " + toString(numericalKeyPressed + 1));
2151  } else {
2153  // show extra information for tests
2154  WRITE_DEBUG("Enabled show connections throught alt + " + toString(numericalKeyPressed + 1));
2155  }
2156  // Call manually onCmdToogleShowConnections
2157  return myViewNet->onCmdToogleShowConnections(obj, sel, ptr);
2158  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckHideConnections) {
2159  // Toogle menuCheckHideConnections
2160  if (myViewNet->getNetworkViewOptions().menuCheckHideConnections->getCheck() == TRUE) {
2162  // show extra information for tests
2163  WRITE_DEBUG("Disabled hide connections throught alt + " + toString(numericalKeyPressed + 1));
2164  } else {
2166  // show extra information for tests
2167  WRITE_DEBUG("Enabled hide connections throught alt + " + toString(numericalKeyPressed + 1));
2168  }
2169  // Call manually onCmdToogleHideConnections
2170  return myViewNet->onCmdToogleHideConnections(obj, sel, ptr);
2171  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckExtendSelection) {
2172  // Toogle menuCheckExtendSelection
2173  if (myViewNet->getNetworkViewOptions().menuCheckExtendSelection->getCheck() == TRUE) {
2175  // show extra information for tests
2176  WRITE_DEBUG("Disabled extend selection throught alt + " + toString(numericalKeyPressed + 1));
2177  } else {
2179  // show extra information for tests
2180  WRITE_DEBUG("Enabled extend selection throught alt + " + toString(numericalKeyPressed + 1));
2181  }
2182  // Call manually onCmdToogleExtendSelection
2183  return myViewNet->onCmdToogleExtendSelection(obj, sel, ptr);
2184  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases) {
2185  // Toogle menuCheckChangeAllPhases
2186  if (myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases->getCheck() == TRUE) {
2188  // show extra information for tests
2189  WRITE_DEBUG("Disabled change all phases throught alt + " + toString(numericalKeyPressed + 1));
2190  } else {
2192  // show extra information for tests
2193  WRITE_DEBUG("Enabled change all phases throught alt + " + toString(numericalKeyPressed + 1));
2194  }
2195  // Call manually onCmdToogleChangeAllPhases
2196  return myViewNet->onCmdToogleChangeAllPhases(obj, sel, ptr);
2197  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge) {
2198  // Toogle menuCheckWarnAboutMerge
2199  if (myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->getCheck() == TRUE) {
2201  // show extra information for tests
2202  WRITE_DEBUG("Disabled warn about merge throught alt + " + toString(numericalKeyPressed + 1));
2203  } else {
2205  // show extra information for tests
2206  WRITE_DEBUG("Enabled warn about merge throught alt + " + toString(numericalKeyPressed + 1));
2207  }
2208  // Call manually onCmdToogleWarnAboutMerge
2209  return myViewNet->onCmdToogleWarnAboutMerge(obj, sel, ptr);
2210  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble) {
2211  // Toogle menuCheckShowJunctionBubble
2212  if (myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->getCheck() == TRUE) {
2214  // show extra information for tests
2215  WRITE_DEBUG("Disabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1));
2216  } else {
2218  // show extra information for tests
2219  WRITE_DEBUG("Enabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1));
2220  }
2221  // Call manually onCmdToogleShowJunctionBubble
2222  return myViewNet->onCmdToogleShowJunctionBubbles(obj, sel, ptr);
2223  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckMoveElevation) {
2224  // Toogle menuCheckMoveElevation
2225  if (myViewNet->getNetworkViewOptions().menuCheckMoveElevation->getCheck() == TRUE) {
2227  // show extra information for tests
2228  WRITE_DEBUG("Disabled move elevation throught alt + " + toString(numericalKeyPressed + 1));
2229  } else {
2231  // show extra information for tests
2232  WRITE_DEBUG("Enabled move elevation throught alt + " + toString(numericalKeyPressed + 1));
2233  }
2234  // Call manually onCmdToogleMoveElevation
2235  return myViewNet->onCmdToogleMoveElevation(obj, sel, ptr);
2236  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChainEdges) {
2237  // Toogle menuCheckChainEdges
2238  if (myViewNet->getNetworkViewOptions().menuCheckChainEdges->getCheck() == TRUE) {
2240  // show extra information for tests
2241  WRITE_DEBUG("Disabled chain edges throught alt + " + toString(numericalKeyPressed + 1));
2242  } else {
2244  // show extra information for tests
2245  WRITE_DEBUG("Enabled chain edges throught alt + " + toString(numericalKeyPressed + 1));
2246  }
2247  // Call manually onCmdToogleChainEdges
2248  return myViewNet->onCmdToogleChainEdges(obj, sel, ptr);
2249  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge) {
2250  // Toogle menuCheckAutoOppositeEdge
2251  if (myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->getCheck() == TRUE) {
2253  // show extra information for tests
2254  WRITE_DEBUG("Disabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1));
2255  } else {
2257  // show extra information for tests
2258  WRITE_DEBUG("Enabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1));
2259  }
2260  // Call manually onCmdToogleAutoOppositeEdge
2261  return myViewNet->onCmdToogleAutoOppositeEdge(obj, sel, ptr);
2262  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideShapes) {
2263  // Toogle menuCheckHideShapes
2264  if (myViewNet->getDemandViewOptions().menuCheckHideShapes->getCheck() == TRUE) {
2266  // show extra information for tests
2267  WRITE_DEBUG("Disabled hide shapes throught alt + " + toString(numericalKeyPressed + 1));
2268  } else {
2270  // show extra information for tests
2271  WRITE_DEBUG("Enabled hide shapes throught alt + " + toString(numericalKeyPressed + 1));
2272  }
2273  // Call manually onCmdToogleHideNonInspecteDemandElements
2274  return myViewNet->onCmdToogleHideShapes(obj, sel, ptr);
2275  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements) {
2276  // Toogle menuCheckHideNonInspectedDemandElements
2279  // show extra information for tests
2280  WRITE_DEBUG("Disabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1));
2281  } else {
2283  // show extra information for tests
2284  WRITE_DEBUG("Enabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1));
2285  }
2286  // Call manually onCmdToogleHideNonInspecteDemandElements
2287  return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr);
2288  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans) {
2289  // Toogle menuCheckShowAllPersonPlans
2290  if (myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->getCheck() == TRUE) {
2292  // show extra information for tests
2293  WRITE_DEBUG("Disabled show all person plans throught alt + " + toString(numericalKeyPressed + 1));
2294  } else {
2296  // show extra information for tests
2297  WRITE_DEBUG("Enabled show all person plans throught alt + " + toString(numericalKeyPressed + 1));
2298  }
2299  // Call manually onCmdToogleHideNonInspecteDemandElements
2300  return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr);
2301  } else {
2302  // nothing to call
2303  return 1;
2304  }
2305  }
2306  return 1;
2307 }
2308 
2309 
2310 long
2311 GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
2312  FXLinkLabel::fxexecute("https://sumo.dlr.de/wiki/NETEDIT");
2313  return 1;
2314 }
2315 
2316 
2317 long
2318 GNEApplicationWindow::onCmdOptions(FXObject*, FXSelector, void*) {
2319  GUIDialog_Options* wizard =
2320  new GUIDialog_Options(this, "Configure Options", getWidth(), getHeight());
2321 
2322  if (wizard->execute()) {
2323  NIFrame::checkOptions(); // needed to set projection parameters
2326  SystemFrame::checkOptions(); // needed to set precision
2327  }
2328  return 1;
2329 }
2330 
2331 
2332 long
2333 GNEApplicationWindow::onCmdUndo(FXObject*, FXSelector, void*) {
2334  // Undo needs a viewnet and a enabled undoLastChange menu command
2335  if (myViewNet && myEditMenuCommands.undoLastChange->isEnabled()) {
2336  myViewNet->getUndoList()->undo();
2337  // update current show frame after undo
2340  }
2341  }
2342  return 1;
2343 }
2344 
2345 
2346 long
2347 GNEApplicationWindow::onCmdRedo(FXObject*, FXSelector, void*) {
2348  // redo needs a viewnet and a enabled redoLastChange menu command
2349  if (myViewNet && myEditMenuCommands.redoLastChange->isEnabled()) {
2350  myViewNet->getUndoList()->redo();
2351  // update current show frame after redo
2354  }
2355  }
2356  return 1;
2357 }
2358 
2359 
2360 long
2361 GNEApplicationWindow::onCmdSaveAsNetwork(FXObject*, FXSelector, void*) {
2362  FXString file = MFXUtils::getFilename2Write(this,
2363  "Save Network as", ".net.xml",
2365  gCurrentFolder);
2366  // add xml extension
2367  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2368  // check that file with extension is valid
2369  if (fileWithExtension != "") {
2371  oc.resetWritable();
2372  oc.set("output-file", fileWithExtension);
2373  setTitle(MFXUtils::getTitleText(myTitlePrefix, fileWithExtension.c_str()));
2374  onCmdSaveNetwork(nullptr, 0, nullptr);
2375  }
2376  return 1;
2377 }
2378 
2379 
2380 long
2381 GNEApplicationWindow::onCmdSaveAsPlainXML(FXObject*, FXSelector, void*) {
2382  FXString file = MFXUtils::getFilename2Write(this,
2383  "Select name of the plain-xml edge-file (other names will be deduced from this)", "",
2385  gCurrentFolder);
2386  // check that file is valid (note: in this case we don't need to use function FileHelpers::addExtension)
2387  if (file != "") {
2389  bool wasSet = oc.isSet("plain-output-prefix");
2390  std::string oldPrefix = oc.getString("plain-output-prefix");
2391  std::string prefix = file.text();
2392  // if the name of an edg.xml file was given, remove the suffix
2393  if (StringUtils::endsWith(prefix, ".edg.xml")) {
2394  prefix = prefix.substr(0, prefix.size() - 8);
2395  }
2396  if (StringUtils::endsWith(prefix, ".")) {
2397  prefix = prefix.substr(0, prefix.size() - 1);
2398  }
2399  oc.resetWritable();
2400  oc.set("plain-output-prefix", prefix);
2401  getApp()->beginWaitCursor();
2402  try {
2403  myNet->savePlain(oc);
2404  myUndoList->unmark();
2405  myUndoList->mark();
2406  } catch (IOError& e) {
2407  // write warning if netedit is running in testing mode
2408  WRITE_DEBUG("Opening FXMessageBox 'Error saving plainXML'");
2409  // open message box
2410  FXMessageBox::error(this, MBOX_OK, "Saving plain xml failed!", "%s", e.what());
2411  // write warning if netedit is running in testing mode
2412  WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
2413  }
2414  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Plain XML saved with prefix '" + prefix + "'.\n");
2416  if (wasSet) {
2417  oc.resetWritable();
2418  oc.set("plain-output-prefix", oldPrefix);
2419  } else {
2420  oc.unSet("plain-output-prefix");
2421  }
2422  getApp()->endWaitCursor();
2423  }
2424  return 1;
2425 }
2426 
2427 
2428 long
2429 GNEApplicationWindow::onCmdSaveJoined(FXObject*, FXSelector, void*) {
2430  FXString file = MFXUtils::getFilename2Write(this,
2431  "Select name of the joined-junctions file", ".nod.xml",
2433  gCurrentFolder);
2434  // add xml extension
2435  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2436  // check that file with extension is valid
2437  if (fileWithExtension != "") {
2439  bool wasSet = oc.isSet("junctions.join-output");
2440  std::string oldFile = oc.getString("junctions.join-output");
2441  oc.resetWritable();
2442  oc.set("junctions.join-output", fileWithExtension);
2443  getApp()->beginWaitCursor();
2444  try {
2445  myNet->saveJoined(oc);
2446  } catch (IOError& e) {
2447  // write warning if netedit is running in testing mode
2448  WRITE_DEBUG("Opening FXMessageBox 'error saving joined'");
2449  // opening error message
2450  FXMessageBox::error(this, MBOX_OK, "Saving joined junctions failed!", "%s", e.what());
2451  // write warning if netedit is running in testing mode
2452  WRITE_DEBUG("Closed FXMessageBox 'error saving joined' with 'OK'");
2453  }
2454  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Joined junctions saved to '" + fileWithExtension + "'.\n");
2456  if (wasSet) {
2457  oc.resetWritable();
2458  oc.set("junctions.join-output", oldFile);
2459  } else {
2460  oc.unSet("junctions.join-output");
2461  }
2462  getApp()->endWaitCursor();
2463  }
2464  return 1;
2465 }
2466 
2467 
2468 long
2469 GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
2470  sender->handle(this, myNet == nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2471  return 1;
2472 }
2473 
2474 
2475 long
2476 GNEApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void*) {
2477  sender->handle(this, ((myNet == nullptr) || !OptionsCont::getOptions().isSet("sumo-net-file")) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2478  return 1;
2479 }
2480 
2481 long
2482 GNEApplicationWindow::onUpdSaveAdditionals(FXObject* sender, FXSelector, void*) {
2483  sender->handle(this, ((myNet == nullptr) || myNet->isAdditionalsSaved()) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2484  return 1;
2485 }
2486 
2487 
2488 long
2489 GNEApplicationWindow::onUpdSaveDemandElements(FXObject* sender, FXSelector, void*) {
2490  sender->handle(this, ((myNet == nullptr) || myNet->isDemandElementsSaved()) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2491  return 1;
2492 }
2493 
2494 
2495 long
2496 GNEApplicationWindow::onUpdUndo(FXObject* obj, FXSelector sel, void* ptr) {
2497  return myUndoList->p_onUpdUndo(obj, sel, ptr);
2498 }
2499 
2500 
2501 long
2502 GNEApplicationWindow::onUpdRedo(FXObject* obj, FXSelector sel, void* ptr) {
2503  return myUndoList->p_onUpdRedo(obj, sel, ptr);
2504 }
2505 
2506 
2507 long
2508 GNEApplicationWindow::onCmdSaveNetwork(FXObject*, FXSelector, void*) {
2510  // function onCmdSaveAsNetwork must be executed if this is the first save
2511  if (oc.getString("output-file") == "") {
2512  return onCmdSaveAsNetwork(nullptr, 0, nullptr);
2513  } else {
2514  getApp()->beginWaitCursor();
2515  try {
2516  myNet->save(oc);
2517  myUndoList->unmark();
2518  myUndoList->mark();
2519  } catch (IOError& e) {
2520  // write warning if netedit is running in testing mode
2521  WRITE_DEBUG("Opening FXMessageBox 'error saving network'");
2522  // open error message box
2523  FXMessageBox::error(this, MBOX_OK, "Saving Network failed!", "%s", e.what());
2524  // write warning if netedit is running in testing mode
2525  WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'");
2526  }
2527  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Network saved in " + oc.getString("output-file") + ".\n");
2528  // After saveing a net sucesfully, add it into Recent Nets list.
2529  myMenuBarFile.myRecentNets.appendFile(oc.getString("output-file").c_str());
2531  getApp()->endWaitCursor();
2532  return 1;
2533  }
2534 }
2535 
2536 
2537 long
2538 GNEApplicationWindow::onCmdSaveAdditionals(FXObject*, FXSelector, void*) {
2539  // obtain option container
2541  // check if save additional menu is enabled
2542  if (myFileMenuCommands.saveAdditionals->isEnabled()) {
2543  // Check if additionals file was already set at start of netedit or with a previous save
2544  if (oc.getString("additional-files").empty()) {
2545  FXString file = MFXUtils::getFilename2Write(this,
2546  "Select name of the additional file", ".xml",
2548  gCurrentFolder);
2549  // add xml extension
2550  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2551  // check tat file is valid
2552  if (fileWithExtension != "") {
2553  // change value of "additional-files"
2554  oc.resetWritable();
2555  oc.set("additional-files", fileWithExtension);
2556  } else {
2557  // None additionals file was selected, then stop function
2558  return 0;
2559  }
2560  }
2561  // Start saving additionals
2562  getApp()->beginWaitCursor();
2563  try {
2564  myNet->saveAdditionals(oc.getString("additional-files"));
2565  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Additionals saved in " + oc.getString("additional-files") + ".\n");
2567  } catch (IOError& e) {
2568  // write warning if netedit is running in testing mode
2569  WRITE_DEBUG("Opening FXMessageBox 'error saving additionals'");
2570  // open error message box
2571  FXMessageBox::error(this, MBOX_OK, "Saving additionals failed!", "%s", e.what());
2572  // write warning if netedit is running in testing mode
2573  WRITE_DEBUG("Closed FXMessageBox 'error saving additionals' with 'OK'");
2574  }
2576  getApp()->endWaitCursor();
2577  return 1;
2578  } else {
2579  return 0;
2580  }
2581 }
2582 
2583 
2584 long
2585 GNEApplicationWindow::onCmdSaveAdditionalsAs(FXObject*, FXSelector, void*) {
2586  // Open window to select additional file
2587  FXString file = MFXUtils::getFilename2Write(this,
2588  "Select name of the additional file", ".xml",
2590  gCurrentFolder);
2591  // add xml extension
2592  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2593  // check tat file is valid
2594  if (fileWithExtension != "") {
2595  // reset writtable flag
2597  // change value of "additional-files"
2598  OptionsCont::getOptions().set("additional-files", fileWithExtension);
2599  // change flag of menu command for save additionals
2601  // save additionals
2602  return onCmdSaveAdditionals(nullptr, 0, nullptr);
2603  } else {
2604  return 1;
2605  }
2606 }
2607 
2608 
2609 long
2610 GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject*, FXSelector, void*) {
2611  // obtain option container
2613  // check if save additional menu is enabled
2614  if (myFileMenuCommands.saveTLSPrograms->isEnabled()) {
2615  // Check if TLS Programs file was already set at start of netedit or with a previous save
2616  if (oc.getString("TLSPrograms-output").empty()) {
2617  FXString file = MFXUtils::getFilename2Write(this,
2618  "Select name of the TLS file", ".xml",
2620  gCurrentFolder);
2621  // add xml extension
2622  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2623  // check tat file is valid
2624  if (file == "") {
2625  // None TLS Programs file was selected, then stop function
2626  return 0;
2627  } else {
2628  // change value of "TLSPrograms-output"
2629  oc.resetWritable();
2630  oc.set("TLSPrograms-output", fileWithExtension);
2631  }
2632  }
2633  // Start saving TLS Programs
2634  getApp()->beginWaitCursor();
2635  try {
2636  myNet->saveTLSPrograms(oc.getString("TLSPrograms-output"));
2637  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "TLS Programs saved in " + oc.getString("TLSPrograms-output") + ".\n");
2639  } catch (IOError& e) {
2640  // write warning if netedit is running in testing mode
2641  WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'");
2642  // open error message box
2643  FXMessageBox::error(this, MBOX_OK, "Saving TLS Programs failed!", "%s", e.what());
2644  // write warning if netedit is running in testing mode
2645  WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
2646  }
2648  getApp()->endWaitCursor();
2649  return 1;
2650  } else {
2651  return 0;
2652  }
2653 }
2654 
2655 
2656 long
2657 GNEApplicationWindow::onCmdSaveTLSProgramsAs(FXObject*, FXSelector, void*) {
2658  // Open window to select TLS Programs file
2659  FXString file = MFXUtils::getFilename2Write(this,
2660  "Select name of the TLS Progarm file", ".xml",
2662  gCurrentFolder);
2663  // add xml extension
2664  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2665  // check tat file is valid
2666  if (fileWithExtension != "") {
2667  // change value of "TLSPrograms-files"
2668  OptionsCont::getOptions().set("TLSPrograms-output", fileWithExtension);
2669  // save TLS Programs
2670  return onCmdSaveTLSPrograms(nullptr, 0, nullptr);
2671  } else {
2672  return 1;
2673  }
2674 }
2675 
2676 
2677 long
2678 GNEApplicationWindow::onCmdSaveDemandElements(FXObject*, FXSelector, void*) {
2679  // obtain option container
2681  // check if save demand element menu is enabled
2682  if (myFileMenuCommands.saveDemandElements->isEnabled()) {
2683  // Check if demand elements file was already set at start of netedit or with a previous save
2684  if (oc.getString("route-files").empty()) {
2685  FXString file = MFXUtils::getFilename2Write(this,
2686  "Select name of the demand element file", ".xml",
2688  gCurrentFolder);
2689  // add xml extension
2690  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2691  // check tat file is valid
2692  if (fileWithExtension != "") {
2693  // change value of "route-files"
2694  oc.resetWritable();
2695  oc.set("route-files", fileWithExtension);
2696  } else {
2697  // None demand elements file was selected, then stop function
2698  return 0;
2699  }
2700  }
2701  // Start saving demand elements
2702  getApp()->beginWaitCursor();
2703  try {
2704  myNet->saveDemandElements(oc.getString("route-files"));
2705  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Demand elements saved in " + oc.getString("route-files") + ".\n");
2707  } catch (IOError& e) {
2708  // write warning if netedit is running in testing mode
2709  WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
2710  // open error message box
2711  FXMessageBox::error(this, MBOX_OK, "Saving demand elements failed!", "%s", e.what());
2712  // write warning if netedit is running in testing mode
2713  WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
2714  }
2716  getApp()->endWaitCursor();
2717  return 1;
2718  } else {
2719  return 0;
2720  }
2721 }
2722 
2723 
2724 long
2726  // Open window to select additionasl file
2727  FXString file = MFXUtils::getFilename2Write(this,
2728  "Select name of the demand element file", ".xml",
2730  gCurrentFolder);
2731  // add xml extension
2732  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2733  // check that file is correct
2734  if (fileWithExtension != "") {
2735  // reset writtable flag
2737  // change value of "route-files"
2738  OptionsCont::getOptions().set("route-files", fileWithExtension);
2739  // change flag of menu command for save demand elements
2741  // save demand elements
2742  return onCmdSaveDemandElements(nullptr, 0, nullptr);
2743  } else {
2744  return 1;
2745  }
2746 }
2747 
2748 
2749 long
2750 GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
2752  bool enable = myNet != nullptr && oc.isSet("output-file");
2753  sender->handle(this, FXSEL(SEL_COMMAND, enable ? ID_ENABLE : ID_DISABLE), nullptr);
2754  if (enable) {
2755  FXString caption = ("Save " + oc.getString("output-file")).c_str();
2756  sender->handle(this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (void*)&caption);
2757  }
2758  return 1;
2759 }
2760 
2761 
2762 bool
2764  FXuint answer = 0;
2765  if (myViewNet && myNet && !myNet->isNetSaved()) {
2766  // write warning if netedit is running in testing mode
2767  WRITE_DEBUG("Opening FXMessageBox 'Confirm closing network'");
2768  // open question box
2769  answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
2770  "Confirm closing Network", "%s",
2771  "You have unsaved changes in the network. Do you wish to quit and discard all changes?");
2772  // restore focus to view net
2773  myViewNet->setFocus();
2774  // if user close dialog box, check additionasl and shapes
2775  if (answer == MBOX_CLICKED_QUIT) {
2776  // write warning if netedit is running in testing mode
2777  WRITE_DEBUG("Closed FXMessageBox 'Confirm closing network' with 'Quit'");
2779  // clear undo list and return true to continue with closing/reload
2780  myUndoList->p_clear();
2781  return true;
2782  } else {
2783  return false;
2784  }
2785  } else if (answer == MBOX_CLICKED_SAVE) {
2786  // save newtork
2787  onCmdSaveNetwork(nullptr, 0, nullptr);
2788  if (!myUndoList->marked()) {
2789  // saving failed
2790  return false;
2791  }
2793  // clear undo list and return true to continue with closing/reload
2794  myUndoList->p_clear();
2795  return true;
2796  } else {
2797  return false;
2798  }
2799  } else {
2800  // write warning if netedit is running in testing mode
2801  if (answer == 2) {
2802  WRITE_DEBUG("Closed FXMessageBox 'Confirm closing network' with 'No'");
2803  } else if (answer == 4) {
2804  WRITE_DEBUG("Closed FXMessageBox 'Confirm closing network' with 'ESC'");
2805  }
2806  // return false to stop closing/reloading
2807  return false;
2808  }
2809  } else {
2811  // clear undo list and return true to continue with closing/reload
2812  myUndoList->p_clear(); //only ask once
2813  return true;
2814  } else {
2815  // return false to stop closing/reloading
2816  return false;
2817  }
2818  }
2819 }
2820 
2821 
2822 bool
2824  // Check if there are non saved additionals
2825  if (myViewNet && myFileMenuCommands.saveAdditionals->isEnabled()) {
2826  WRITE_DEBUG("Opening FXMessageBox 'Save additionals before exit'");
2827  // open question box
2828  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
2829  "Save additionals before exit", "%s",
2830  "You have unsaved additionals. Do you wish to quit and discard all changes?");
2831  // restore focus to view net
2832  myViewNet->setFocus();
2833  // if answer was affirmative, but there was an error during saving additional, return false to stop closing/reloading
2834  if (answer == MBOX_CLICKED_QUIT) {
2835  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before exit' with 'Quit'");
2836  // nothing to save, return true
2837  return true;
2838  } else if (answer == MBOX_CLICKED_SAVE) {
2839  // write warning if netedit is running in testing mode
2840  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before exit' with 'Yes'");
2841  if (onCmdSaveAdditionals(nullptr, 0, nullptr) == 1) {
2842  // additionals sucesfully saved
2843  return true;
2844  } else {
2845  // error saving additionals, abort saving
2846  return false;
2847  }
2848  } else {
2849  // write warning if netedit is running in testing mode
2850  if (answer == 2) {
2851  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before exit' with 'No'");
2852  } else if (answer == 4) {
2853  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before exit' with 'ESC'");
2854  }
2855  // abort saving
2856  return false;
2857  }
2858  } else {
2859  // nothing to save, return true
2860  return true;
2861  }
2862 }
2863 
2864 
2865 bool
2867  // Check if there are non saved DemandElements
2868  if (myViewNet && myFileMenuCommands.saveDemandElements->isEnabled()) {
2869  WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before exit'");
2870  // open question box
2871  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
2872  "Save demand elements before exit", "%s",
2873  "You have unsaved demand elements. Do you wish to quit and discard all changes?");
2874  // restore focus to view net
2875  myViewNet->setFocus();
2876  // if answer was affirmative, but there was an error during saving DemandElement, return false to stop closing/reloading
2877  if (answer == MBOX_CLICKED_QUIT) {
2878  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before exit' with 'Quit'");
2879  // nothing to save, return true
2880  return true;
2881  } else if (answer == MBOX_CLICKED_SAVE) {
2882  // write warning if netedit is running in testing mode
2883  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before exit' with 'Yes'");
2884  if (onCmdSaveDemandElements(nullptr, 0, nullptr) == 1) {
2885  // DemandElements sucesfully saved
2886  return true;
2887  } else {
2888  // error saving DemandElements, abort saving
2889  return false;
2890  }
2891  } else {
2892  // write warning if netedit is running in testing mode
2893  if (answer == 2) {
2894  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before exit' with 'No'");
2895  } else if (answer == 4) {
2896  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before exit' with 'ESC'");
2897  }
2898  // abort saving
2899  return false;
2900  }
2901  } else {
2902  // nothing to save, return true
2903  return true;
2904  }
2905 }
2906 
2907 
2908 void
2910  // check that view exists
2911  if (myViewNet) {
2913  }
2914 }
2915 
2916 
2917 void
2919  // cast supermode
2920  Supermode currentSupermode = static_cast<Supermode>(supermode);
2921  if (currentSupermode == Supermode::GNE_SUPERMODE_NETWORK) {
2926  } else if (currentSupermode == Supermode::GNE_SUPERMODE_DEMAND) {
2931  } else {
2936  }
2937 }
2938 
2939 
2940 void
2941 GNEApplicationWindow::disableUndoRedo(const std::string& reason) {
2942  myUndoRedoListEnabled = reason;
2943 }
2944 
2945 
2946 void
2948  myUndoRedoListEnabled.clear();
2949 }
2950 
2951 
2952 const std::string&
2954  return myUndoRedoListEnabled;
2955 }
2956 
2957 // ---------------------------------------------------------------------------
2958 // GNEApplicationWindow - protected methods
2959 // ---------------------------------------------------------------------------
2960 
2962  myToolbarsGrip(this),
2963  myMenuBarFile(this),
2964  myFileMenuCommands(this),
2965  myEditMenuCommands(this),
2967  myLocateMenuCommands(this),
2968  mySupermodeCommands(this) {
2969 }
2970 
2971 
2972 long
2973 GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
2974  const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
2975  if (handled == 0 && myMDIClient->numChildren() > 0) {
2976  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
2977  if (w != nullptr) {
2978  w->onKeyPress(nullptr, sel, eventData);
2979  }
2980  }
2981  return 0;
2982 }
2983 
2984 
2985 long
2986 GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
2987  const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
2988  if (handled == 0 && myMDIClient->numChildren() > 0) {
2989  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
2990  if (w != nullptr) {
2991  w->onKeyRelease(nullptr, sel, eventData);
2992  }
2993  }
2994  return 0;
2995 }
2996 
2997 /****************************************************************************/
Locate junction - button.
Definition: GUIAppEnum.h:307
Main window-ID.
Definition: GUIAppEnum.h:205
std::vector< FXMainWindow * > myTrackerWindows
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Perform a single simulation step in SUMO and open Demand Elements in NETEDIT.
Definition: GUIAppEnum.h:82
MenuBarFile myMenuBarFile
MenuBarFile.
Main window closes.
Definition: GUIAppEnum.h:96
std::string myConfigPattern
Input file pattern.
void enableSaveTLSProgramsMenu()
enable save TLS Programs
FXMenuCommand * clearInvalidCrossings
FXMenuCommand for clear invalid crosings.
FXLabel * myGeoCoordinate
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:64
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
FXSynchQue< GUIEvent * > myEvents
List of got requests.
void buildFileMenuCommands(FXMenuPane *editMenu)
build menu commands
#define GUIDesignToolBarRaisedSame
design for toolbar
Definition: GUIDesigns.h:314
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out ...
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don&#39;t need it)
GUICompleteSchemeStorage gSchemeStorage
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NWFrame.cpp:126
hot key <F4> set demand mode in NETEDIT
Definition: GUIAppEnum.h:164
FXMenuCommand * optionMenus
FXMenuCommand for open option menus.
void enableSaveAdditionalsMenu()
enable save additionals
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
send when a warning occured
Definition: GUIEvent.h:46
static std::string clipped
Definition: GUIUserIO.h:61
long long int SUMOTime
Definition: SUMOTime.h:35
long onCmdNewNetwork(FXObject *, FXSelector, void *)
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
FXMenuCommand * shapeMode
menu command for shape mode
static void resetFont()
to be called when the font context is invalidated
Definition: GLHelper.cpp:633
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NBFrame.cpp:577
FXToolBarShell * myToolBarShellModeOptions
menu bar drag for mode options(show connections, select edges...)
long onCmdToogleGrid(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + G to toogle grid
FXMenuCommand * saveDemandElementsAs
FXMenuCommand for enable or disable save demand elements as.
Locate route - button.
Definition: GUIAppEnum.h:313
void abortOperation(bool clearSelection=true)
abort current edition operation
Definition: GNEViewNet.cpp:749
bool parseTLSPrograms(const std::string &file)
parse TLS Programs from a file
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
void resetWritable()
Resets all options to be writeable.
long onCmdBackspace(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits backspace
long onCmdToogleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toogle hide non inspected demand elements
GNEUndoList * getUndoList()
get pointer to undoList
FXMenuCommand * routeMode
menu command for route mode
long onCmdReload(FXObject *, FXSelector, void *)
called when the command/FXCall reload is executed
void create()
Creates the widget.
Reload the previously loaded simulation.
Definition: GUIAppEnum.h:100
void closeAllWindows()
this method closes all windows and deletes the current simulation */
FXMenuCommand * cleanRoutes
FXMenuCommand for clean routes without vehicles.
long onCmdToogleHideShapes(FXObject *, FXSelector, void *)
toogle hide shapes in super mode demand
FXMenuCommand * cleanJunctions
FXMenuCommand for clean junctions without edges.
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
FXMenuPane * myFileMenuAdditionals
const std::string & isUndoRedoEnabled() const
check if undo-redo is enabled
void hotkeyBackSpace()
handle backspace keypress
Definition: GNEViewNet.cpp:893
hot key <Backspace> remove last sub-operation
Definition: GUIAppEnum.h:197
void buildLocateMenuCommands(FXMenuPane *editMenu)
build menu commands
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:49
void enableSaveDemandElementsMenu()
enable save demand elements
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:292
long onCmdToogleChainEdges(FXObject *, FXSelector, void *)
toogle chain edges
The main window of the Netedit.
EditMenuCommands myEditMenuCommands
Edit Menu Commands.
long computeJunctionWithVolatileOptions()
called if the user selects Processing->compute junctions with volatile options
FXMenuCheck * menuCheckShowAllPersonPlans
show all person plans
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
long onCmdToogleMoveElevation(FXObject *, FXSelector, void *)
toogle move elevation
#define GUIDesignSplitterMDI
MDI Splitter.
Definition: GUIDesigns.h:350
void hotkeyFocusFrame()
handle focus frame keypress
Definition: GNEViewNet.cpp:910
open foreign network
Definition: GUIAppEnum.h:554
void buildViewParentToolbarsGrips()
build toolbars grips
Locate stop - button.
Definition: GUIAppEnum.h:315
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:59
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
Locate addtional structure - button.
Definition: GUIAppEnum.h:321
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
long onCmdToogleChangeAllPhases(FXObject *, FXSelector, void *)
toogle change all phases
FXToolBarShell * myToolBarShellSuperModes
menu bar drag for modes (network and demand)
void create()
Creates the main window (required by FOX)
FXMenuCommand * stopMode
menu command for stop mode
bool hadDependentBuild
check if had dependent build
hotkey for mode editing connection prohibitions AND person types
Definition: GUIAppEnum.h:68
Open configuration - ID.
Definition: GUIAppEnum.h:222
FXMenuCommand * createEdgeMode
menu command for create edge
DemandMenuCommands demandMenuCommands
Demand Menu Commands.
clean invalid crossings in network mode and demand elements in demand mode
Definition: GUIAppEnum.h:172
FXMenuCommand * saveDemandElements
FXMenuCommand for enable or disable save demand elements.
void destroyParentToolbarsGrips()
build toolbars grips
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle select edges
long onUpdRedo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall redo is executed
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:921
double y() const
Returns the y-position.
Definition: Position.h:62
long onCmdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is executed
FXMenuCheck * menuCheckChangeAllPhases
menu check to set change all phases
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
GNEUndoList * myUndoList
the one and only undo list
static void resetTextures()
Reset textures.
long onCmdOpenSUMOGUI(FXObject *sender, FXSelector sel, void *ptr)
called if the user hints ctrl + T
void registerMsgHandlers()
register message handlers
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
hot key <F12> focus upper element of current frame
Definition: GUIAppEnum.h:176
void buildNetworkMenuCommands(FXMenuPane *editMenu)
build menu commands
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
hotkey for mode deleting things
Definition: GUIAppEnum.h:50
#define GUIDesignStatusBar
design used in status bar
Definition: GUIDesigns.h:320
bool empty()
Definition: FXSynchQue.h:105
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort ...
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
double x() const
Returns the x-position.
Definition: Position.h:57
static void buildNETEDITAccelerators(GNEApplicationWindow *GNEApp)
build NETEDIT Accelerators
send when a debug occured
Definition: GUIEvent.h:52
void loadConfigOrNet(const std::string file, bool isNet, bool isReload=false, bool useStartupOptions=false, bool newNet=false)
starts to load a netimport configuration or a network */
LocateMenuCommands(GNEApplicationWindow *GNEApp)
constructor
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
Definition: GUIDesigns.h:323
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
long onCmdProcessButton(FXObject *, FXSelector sel, void *)
called when user press a process button (or a shortcut)
#define GUIDesignSplitter
Definition: GUIDesigns.h:347
void getVisibleNetworkMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible network menu commands
Load file with TLS Programs.
Definition: GUIAppEnum.h:90
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
hotkey for mode editing crossing AND routes
Definition: GUIAppEnum.h:62
Close simulation - ID.
Definition: GUIAppEnum.h:104
Editor for the list of chosen objects.
bool continueWithUnsavedChanges()
warns about unsaved changes and gives the user the option to abort
FXGLVisual * myGLVisual
The gl-visual used.
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
FXMenuCheck * menuCheckWarnAboutMerge
menu check to we should warn about merging junctions
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
long onCmdToogleShowConnections(FXObject *, FXSelector, void *)
toogle show connections
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
Definition: GNEUndoList.cpp:73
void buildProcessingMenuCommands(FXMenuPane *editMenu)
build menu commands
hot key <DEL> delete selections or elements
Definition: GUIAppEnum.h:193
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
Open current network in SUMO or in NETEDIT.
Definition: GUIAppEnum.h:102
void clearSelectedEdges()
clear current TAZ children
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1687
FXString gCurrentFolder
The folder used as last.
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2160
FXMenuCommand * saveTLSPrograms
FXMenuCommand for enable or disable save additionals.
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:46
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall needs network is executed
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
ProcessingMenuCommands(GNEApplicationWindow *GNEApp)
constructor
#define GUIDesignToolBar
design for default toolbar
Definition: GUIDesigns.h:311
std::string myFile
the name of the loaded file
const std::vector< TAZCurrent::TAZEdge > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
DemandMenuCommands(const EditMenuCommands *editMenuCommandsParent)
constructor
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
static void resetLoaded()
resets loaded location elements
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
void unregisterMsgHandlers()
unregister message handlers
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
FXMenuCommand * inspectMode
menu command for inspect mode
void set(double x, double y)
set positions x and y
Definition: Position.h:87
FXMenuCommand * crossingMode
menu command for crossing mode
FXMenuBar * modeOptions
The application menu bar for mode options (show connections, select edges...)
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything&#39;s ok.
Definition: XMLSubSys.cpp:113
void updateControls()
update control contents after undo/redo or recompute
void redo()
redo the last command group
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
FXMenuCommand * editViewPort
FXMenuCommand for edit view port.
NetworkMenuCommands networkMenuCommands
Network Menu Commands.
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:84
FXMenuCommand * clearInvalidDemandElements
FXMenuCommand for clear invalid demand elements.
compute Network in network mode and Demand elements in demand mode
Definition: GUIAppEnum.h:166
ToolbarsGrip myToolbarsGrip
Toolbars Grip.
FXMenuCheck * menuCheckShowGrid
menu check to show grid button
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:1850
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
void updateControls()
update control contents after undo/redo or recompute
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
Main window closes.
Definition: GUIAppEnum.h:136
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc..)
void addDecals(const std::vector< Decal > &decals)
add decals
GNENet * myNet
the loaded net
FXMenuBar * modes
The application menu bar (for select, inspect...)
FXMenuCommand * personTypeMode
menu command for person type mode
long onUpdReload(FXObject *, FXSelector, void *)
called when the update/FXCall reload is executed
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:72
void undo()
undo the last command group
void enableUndoRedo()
disable undo-redo
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2405
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2606
Loads a file previously loaded.
Definition: GUIAppEnum.h:230
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:58
FXMenuCommand * joinJunctions
FXMenuCommand for join selected junctions.
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
The application&#39;s "About" - dialog.
const GNEViewNetHelper::CommonViewOptions & getCommonViewOptions() const
get Common view options
Definition: GNEViewNet.cpp:405
void addSeparator()
Adds a a separator to this log window.
void buildDemandMenuCommands(FXMenuPane *editMenu)
build menu commands
void p_clear()
clears the undo list (implies abort)
Definition: GNEUndoList.cpp:87
FXMenuCommand * joinRoutes
FXMenuCommand for join routes.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
void disableUndoRedo(const std::string &reason)
disable undo-redo giving a string with the reason
void disableSaveAdditionalsMenu()
disable save additionals
create new empty newtork
Definition: GUIAppEnum.h:94
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1784
FXHorizontalFrame * myCartesianFrame
FileMenuCommands myFileMenuCommands
File Menu Commands.
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
long onCmdSaveTLSProgramsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms as is executed
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
const std::string & getMsg() const
Returns the message.
void hideDemandProcessingMenuCommands()
show demand processing menu commands
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
long onCmdOptions(FXObject *, FXSelector, void *)
called if the user selects Processing->Configure Options
FXMenuCheck * menuCheckShowDemandElements
menu check to show Demand Elements
FXMenuCheck * menuCheckHideConnections
menu check to hide connections in connect mode
FXToolBarShell * myToolBarShellModes
menu bar drag for modes (select, inspect, delete...)
static void close()
close GUITextureSubSys
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:933
NetworkMenuCommands(const EditMenuCommands *editMenuCommandsParent)
constructor
FXMenuSeparator * myHorizontalSeparator
separator between sets of FXMenuCommand
void updateSuperModeMenuCommands(int supermode)
update FXMenuCommands
ProcessingMenuCommands myProcessingMenuCommands
Edit Menu Commands.
Locate polygons - button.
Definition: GUIAppEnum.h:325
FXMenuCheck * menuCheckMoveElevation
menu check to apply movement to elevation
FXMenuCommand * openInSUMOGUI
FXMenuCommand for open in SUMO GUI.
GNEApplicationWindow()
FOX needs this for static members.
hotkey for mode connecting lanes
Definition: GUIAppEnum.h:48
SupermodeCommands(GNEApplicationWindow *GNEApp)
constructor
FXMenuCheck * menuCheckAutoOppositeEdge
menu check to create auto create opposite edge
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
FXMenuCheck * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
Save Additional Elements.
Definition: GUIAppEnum.h:144
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
FXRecentFiles myRecentConfigs
List of recent config files.
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition: SysUtils.cpp:64
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
FXMenuSeparator * myHorizontalSeparator
separator between sets of FXMenuCommand
FXGLCanvas * getBuildGLCanvas() const
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:80
void hideSupermodeCommands()
hide all menu commands
FXMenuCheck * menuCheckChainEdges
menu check to the endpoint for a created edge should be set as the new source
Supermode currentSupermode
the current supermode
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1549
void showSupermodeCommands()
show all menu commands
void fillMenuBar()
Builds the menu bar.
FXMenuCheck * menuCheckSelectEdges
menu check to select only edges
long onCmdToogleHideConnections(FXObject *, FXSelector, void *)
toogle hide connections
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Open viewport editor - button.
Definition: GUIAppEnum.h:327
long onCmdToogleAutoOppositeEdge(FXObject *, FXSelector, void *)
toogle autoOpposite edge
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2293
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
FXMenuCommand * saveAdditionalsAs
FXMenuCommand for enable or disable save additionals As.
Locate vehicle - button.
Definition: GUIAppEnum.h:311
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
GUIPerspectiveChanger & getChanger() const
get changer
long onCmdRedo(FXObject *, FXSelector, void *)
#define GUIDesignToolBarRaisedNext
design for first toolbar shell positioned in the next position of dock
Definition: GUIDesigns.h:317
void getVisibleCommonMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible common menu commands
std::vector< std::string > getStringVector(const std::string &name) const
Returns the list of string-vector-value of the named option (only for Option_String) ...
hotkey for mode moving element
Definition: GUIAppEnum.h:56
Toogle Gaming mode in SUMO and grid in NETEDIT.
Definition: GUIAppEnum.h:84
long onCmdToogleEditOptions(FXObject *, FXSelector, void *)
called if the user press key combination Alt + <0-9>
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2250
long onCmdSaveAsPlainXML(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:951
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1756
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
called when the command/FXCall open configuration is executed
Locate edge - button.
Definition: GUIAppEnum.h:309
static bool checkOptions()
checks shared options and sets StdDefs
void showDemandProcessingMenuCommands()
show demand processing menu commands
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
std::string mySettingsFile
the name of the settings file to load
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
double getTrackerInterval() const
get current tracker interval (pure virtual but we don&#39;t need it)
FXMenuCommand * redoLastChange
FXMenuCommand for redo last change.
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NIFrame.cpp:330
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:246
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
Clear simulation output.
Definition: GUIAppEnum.h:289
#define GUIDesignToolbarMenuBarNetedit
design for top toolbar (file, edit, processing...) used only in netedit (due supermodes buttons) ...
Definition: GUIDesigns.h:308
void setTarget(FXObject *tgt)
set the target
Definition: FXBaseObject.h:130
long onCmdUndo(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindow
FXCursor * getDefaultCursor()
get default cursor
clean junctions without edges in network mode and unused routes in demand mode
Definition: GUIAppEnum.h:168
FXMenuCheck * menuCheckExtendSelection
menu check to extend to edge nodes
MenuBarFile(GNEApplicationWindow *GNEApp)
constructor
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:54
Start the simulation in SUMO and open Additionals Elemements in NETEDIT.
Definition: GUIAppEnum.h:78
long onCmdToogleShowGrid(FXObject *, FXSelector, void *)
toogle show grid
std::vector< GUIGlChildWindow * > myGLWindows
void buildMenuToolbarsGrip()
build menu toolbar grips
long p_onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
void buildSupermodeCommands(FXMenuPane *editMenu)
build menu commands
GNEViewNet * myViewNet
pointer to current view net
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:411
long onUpdSaveAdditionals(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals is executed
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
#define VERSION_STRING
Definition: config.h:207
Open view editor - button.
Definition: GUIAppEnum.h:329
FXToolBarShell * myToolBarShellNavigation
menu bar drag for navigation (Zoom, coloring...)
hot key <ENTER> accept current operation
Definition: GUIAppEnum.h:195
long onUpdUndo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall undo is executed
FileMenuCommands(GNEApplicationWindow *GNEApp)
constructor
FXMenuCommand * connectMode
menu command for connect mode
save network as plain XML
Definition: GUIAppEnum.h:92
bool continueWithUnsavedDemandElementChanges()
warns about unsaved changes in demand elements and gives the user the option to abort ...
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
GNELoadThread * myLoadThread
the thread that loads the network
FXStatusBar * myStatusbar
The status bar.
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:245
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
virtual void showViewportEditor()
show viewport editor
long onCmdToogleShowJunctionBubbles(FXObject *, FXSelector, void *)
toogle show junction bubbles
bool myViewportFromRegistry
whether loading viewport from registry
FXMenuCommand * undoLastChange
FXMenuCommand for undo last change.
hotkey for mode adding edges
Definition: GUIAppEnum.h:52
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits f
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
long onCmdSaveDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements is executed
LocateMenuCommands myLocateMenuCommands
Locate Menu Commands.
Locate TLS - button.
Definition: GUIAppEnum.h:319
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
send when a gldebug occured
Definition: GUIEvent.h:55
hotkey for mode create vehicles
Definition: GUIAppEnum.h:66
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
long onCmdSetSuperMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-supermode hotkey
Open network - ID.
Definition: GUIAppEnum.h:224
void setSelector(FXSelector sel)
set the selector
Definition: FXBaseObject.h:140
The loading thread.
Definition: GUIAppEnum.h:256
FXMenuCheck * menuCheckShowConnections
menu check to show connections
const EditMenuCommands * myEditMenuCommandsParent
reference to EditMenuCommands
FXMenuBar * menu
The application menu bar (for file, edit, processing...)
void unSet(const std::string &name, bool failOnNonExistant=true) const
Marks the option as unset.
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:417
FXMenuBar * superModes
The application menu bar for supermodes (network and demand)
void loadOptionOnStartup()
load net on startup
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string demandPath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1408
FXMenuCheck * menuCheckShowJunctionBubble
menu check to show connection as buuble in "Move" mode.
send when a message occured
Definition: GUIEvent.h:43
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1739
const EditMenuCommands * myEditMenuCommandsParent
reference to EditMenuCommands
static void close()
close GUIIconSubSys
void requiereSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:933
void pop()
Definition: FXSynchQue.h:54
Demanding mode (Routes, Vehicles etc..)
FXRecentFiles myRecentNets
List of recent nets.
FXMenuCommand * additionalMode
menu command for additional mode
FXHorizontalFrame * myGeoFrame
SupermodeCommands mySupermodeCommands
Supermode Commands.
FXDockSite * myTopDock
A storage for options typed value containers)
Definition: OptionsCont.h:90
void disableSaveDemandElementsMenu()
disable save demand elements
hotkey for mode selecting objects
Definition: GUIAppEnum.h:60
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1489
FXMenuPane * myFileMenuDemandElements
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
long onCmdOpenTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
send when a error occured
Definition: GUIEvent.h:49
FXMenuCommand * editViewScheme
FXMenuCommand for edit view scheme.
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindow
FXMDIClient * myMDIClient
The multi view panel.
send when a simulation has been loaded
Definition: GUIEvent.h:37
Supermode
enum for supermodes
Stop the simulation in SUMO and save network in NETEDIT.
Definition: GUIAppEnum.h:98
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
FXMenuCommand * deleteMode
menu command for delete mode
FXMenuCommand * toogleGrid
FXMenuCommand for toogle grid.
void handleEvent_Message(GUIEvent *e)
hanlde event of type message
hotkey for mode creating polygons
Definition: GUIAppEnum.h:58
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:969
long onCmdToogleShowDemandElements(FXObject *, FXSelector, void *)
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition: GUIDesigns.h:249
FXMenuCommand * saveAdditionals
FXMenuCommand for enable or disable save additionals.
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
void saveDemandElements(const std::string &filename)
save demand element elements of the network
Definition: GNENet.cpp:2361
hot key <F1> open online documentation
Definition: GUIAppEnum.h:158
FXMenuCommand * demandMode
FXMenuCommand for demand supermode.
hotkey for mode editing TAZ
Definition: GUIAppEnum.h:70
long onCmdSaveJoined(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
An XML-handler for visualisation schemes.
long onUpdSaveDemandElements(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements is executed
const FXString myTitlePrefix
the prefix for the window title
join selected junctions in network mode and normalice demand element ids in demand mode ...
Definition: GUIAppEnum.h:170
static std::string addExtension(const std::string &path, const std::string &extension)
Add an extension to the given file path.
Definition: FileHelpers.cpp:77
GUIEventType getOwnType() const
returns the event type
Definition: GUIEvent.h:80
void getVisibleDemandMenuCommands(std::vector< FXMenuCheck *> &commands) const
get visible demand menu commands
FXMenuCheck * menuCheckHideShapes
Hide shapes (Polygons and POIs)
virtual void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children) ...
Definition: GNEFrame.cpp:151
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:62
FXMenuCommand * personPlanMode
menu command for person plan mode
long onCmdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements as is executed
GNENet * myNet
we are responsible for the net
hot key <ESC> abort current edit operation
Definition: GUIAppEnum.h:191
FXMenuCommand * computeNetworkVolatile
FXMenuCommand for compute network with volatile options.
void dependentBuild()
build dependent
FXMenuCommand * vehicleTypeMode
menu command for vehicle type mode
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
void clear()
Clears the window.
void showViewschemeEditor()
show viewsscheme editor
FXMenuSeparator * myHorizontalSeparator
separator between sets of FXMenuCommand
EditMenuCommands(GNEApplicationWindow *GNEApp)
constructor
FXToolBarShell * myToolBarShellMenu
menu bar drag (for file, edit, processing...)
long onCmdOpenDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall open demand is executed
FXMenuCommand * selectMode
menu command for select mode
Locate poi - button.
Definition: GUIAppEnum.h:323
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:399
void storeWindowSizeAndPos()
record window position and size in registry
void hotkeyDel()
handle del keypress
Definition: GNEViewNet.cpp:812
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:240
compute junctions with volatile options
Definition: GUIAppEnum.h:183
Network mode (Edges, junctions, etc..)
hot key <F3> set network mode in NETEDIT
Definition: GUIAppEnum.h:162
FXMenuCommand * prohibitionMode
menu command for prohibition mode
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
std::string myUndoRedoListEnabled
string to check if undo/redo list is enabled (a String is used to keep the disabling reason) ...
GUISelectedStorage gSelected
A global holder of selected objects.
void hotkeyEnter()
handle enter keypress
Definition: GNEViewNet.cpp:839
long onCmdSaveAsNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
A logging window for the gui.
hot key <F2> open about dialog
Definition: GUIAppEnum.h:160
long onCmdToogleWarnAboutMerge(FXObject *, FXSelector, void *)
toogle warn for merge
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void buildRecentFiles(FXMenuPane *fileMenu)
build recent files
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
FXMenuCommand * networkMode
FXMenuCommand for network supermode.
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2205
FXMenuCommand * vehicleMode
menu command for vehicle mode
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:961
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
FXMenuPane * myFileMenu
the submenus
FXMenuCommand * personMode
menu command for person mode
void buildEditMenuCommands(FXMenuPane *editMenu)
build edit menu commands
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:945
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onCmdToogleExtendSelection(FXObject *, FXSelector, void *)
toogle extend selection
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
void showNetworkProcessingMenuCommands()
show network processing menu commands
FXMenuBar * navigation
The application menu bar for navigation (zoom, coloring...)
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2067
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
void hideNetworkProcessingMenuCommands()
show network processing menu commands
long p_onUpdUndo(FXObject *, FXSelector, void *)
save demand elements as
Definition: GUIAppEnum.h:560