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 /****************************************************************************/
14 // The main window of Netedit (adapted from GUIApplicationWindow)
15 /****************************************************************************/
16 
17 
18 // ===========================================================================
19 // included modules
20 // ===========================================================================
21 
22 #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
154  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_X_CUT, GNEApplicationWindow::onCmdCut),
157 
158  // Toolbar processing
170 
171  // Toolbar locate
172  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GNEApplicationWindow::onCmdLocate),
174  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GNEApplicationWindow::onCmdLocate),
176  FXMAPFUNC(SEL_COMMAND, MID_LOCATEVEHICLE, GNEApplicationWindow::onCmdLocate),
178  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPERSON, GNEApplicationWindow::onCmdLocate),
180  FXMAPFUNC(SEL_COMMAND, MID_LOCATEROUTE, GNEApplicationWindow::onCmdLocate),
182  FXMAPFUNC(SEL_COMMAND, MID_LOCATESTOP, GNEApplicationWindow::onCmdLocate),
184  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GNEApplicationWindow::onCmdLocate),
186  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GNEApplicationWindow::onCmdLocate),
188  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GNEApplicationWindow::onCmdLocate),
190  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GNEApplicationWindow::onCmdLocate),
192 
193  // toolbar windows
195 
196  // toolbar help
198  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_F2_ABOUT, GNEApplicationWindow::onCmdAbout),
199 
200  // alt + <number>
221 
222  // key events
223  FXMAPFUNC(SEL_KEYPRESS, 0, GNEApplicationWindow::onKeyPress),
224  FXMAPFUNC(SEL_KEYRELEASE, 0, GNEApplicationWindow::onKeyRelease),
225  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ESC, GNEApplicationWindow::onCmdAbort),
226  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_DEL, GNEApplicationWindow::onCmdDel),
227  FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ENTER, GNEApplicationWindow::onCmdEnter),
229 
230  // threads events
233 
234  // Edge template functions
238 
239  // Other
240  FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest),
242 };
243 
244 // Object implementation
245 FXIMPLEMENT(GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
246 
247 
248 // ===========================================================================
249 // GNEApplicationWindow::ToolbarsGrip method definitions
250 // ===========================================================================
251 
253  menu(nullptr),
254  superModes(nullptr),
255  saveElements(nullptr),
256  navigation(nullptr),
257  modes(nullptr),
258  modeOptions(nullptr),
259  myGNEApp(GNEApp),
260  myToolBarShellMenu(nullptr),
261  myToolBarShellSuperModes(nullptr),
262  myToolBarShellSaveElements(nullptr),
263  myToolBarShellNavigation(nullptr),
264  myToolBarShellModes(nullptr),
265  myToolBarShellModeOptions(nullptr) {
266 }
267 
268 
269 void
271  // build menu bar (for File, edit, processing...) using specify design
272  myToolBarShellMenu = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
274  // declare toolbar grip for menu bar
275  new FXToolBarGrip(menu, menu, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
276 }
277 
278 
279 void
281  // build menu bar for supermodes (next to menu bar)
282  myToolBarShellSuperModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
283  superModes = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellSuperModes, GUIDesignToolBarRaisedSame);
284  // declare toolbar grip for menu bar Supermodes
285  new FXToolBarGrip(superModes, superModes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
286  // build menu bar for save elements (bot to menu bar)
287  myToolBarShellSaveElements = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
288  saveElements = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellSaveElements, GUIDesignToolBarRaisedNext);
289  // build menu bar for navigation
290  myToolBarShellNavigation = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
291  navigation = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellNavigation, GUIDesignToolBarRaisedSame);
292  // declare toolbar grip for menu bar Navigation
293  new FXToolBarGrip(navigation, navigation, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
294  // build menu bar for modes
295  myToolBarShellModes = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
296  modes = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellModes, GUIDesignToolBarRaisedSame);
297  // declare toolbar grip for menu bar modes
298  new FXToolBarGrip(modes, modes, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
299  // build menu bar for mode Options
300  myToolBarShellModeOptions = new FXToolBarShell(myGNEApp, GUIDesignToolBar);
301  modeOptions = new FXMenuBar(myGNEApp->myTopDock, myToolBarShellModeOptions, GUIDesignToolBarRaisedSame);
302  // declare toolbar grip for menu bar modes
303  new FXToolBarGrip(modeOptions, modeOptions, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
304  // create menu bars
305  superModes->create();
306  saveElements->create();
307  navigation->create();
308  modes->create();
309  modeOptions->create();
310  // create toolbar shells
311  myToolBarShellSuperModes->create();
312  myToolBarShellSaveElements->create();
313  myToolBarShellNavigation->create();
314  myToolBarShellModes->create();
315  myToolBarShellModeOptions->create();
316  // recalc top dop after creating elements
317  myGNEApp->myTopDock->recalc();
318 }
319 
320 
321 void
323  // delete Menu bars
324  delete superModes;
325  delete saveElements;
326  delete navigation;
327  delete modes;
328  delete modeOptions;
329  // also delete toolbar shells to avoid floating windows
330  delete myToolBarShellSuperModes;
331  delete myToolBarShellSaveElements;
332  delete myToolBarShellNavigation;
333  delete myToolBarShellModes;
334  delete myToolBarShellModeOptions;
335  // recalc top dop after deleting elements
336  myGNEApp->myTopDock->recalc();
337 }
338 
339 // ===========================================================================
340 // GNEApplicationWindow method definitions
341 // ===========================================================================
342 
343 GNEApplicationWindow::GNEApplicationWindow(FXApp* a, const std::string& configPattern) :
344  GUIMainWindow(a),
345  myLoadThread(nullptr),
346  myAmLoading(false),
347  myFileMenu(nullptr),
348  myFileMenuAdditionals(nullptr),
349  myFileMenuTLS(nullptr),
350  myFileMenuDemandElements(nullptr),
351  myEditMenu(nullptr),
352  myProcessingMenu(nullptr),
353  myLocatorMenu(nullptr),
354  myWindowsMenu(nullptr),
355  myHelpMenu(nullptr),
356  myMessageWindow(nullptr),
357  myMainSplitter(nullptr),
358  hadDependentBuild(false),
359  myNet(nullptr),
360  myUndoList(new GNEUndoList(this)),
361  myConfigPattern(configPattern),
362  myToolbarsGrip(this),
363  myMenuBarFile(this),
364  myFileMenuCommands(this),
365  myEditMenuCommands(this),
367  myLocateMenuCommands(this),
368  myWindowsMenuCommands(this),
369  mySupermodeCommands(this),
370  myViewNet(nullptr),
371  myTitlePrefix("NETEDIT " VERSION_STRING),
372  myMDIMenu(nullptr)
373 
374 {
375  // init icons
377  // init Textures
379  // init cursors
381 }
382 
383 
384 void
386  // do this not twice
387  if (hadDependentBuild) {
388  WRITE_ERROR("DEBUG: GNEApplicationWindow::dependentBuild called twice");
389  return;
390  }
391  hadDependentBuild = true;
392  setTarget(this);
393  setSelector(MID_WINDOW);
394  // build toolbar menu
396  // build the thread - io
398  // build the status bar
399  myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
400  {
401  myGeoFrame =
402  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
403  myGeoCoordinate = new FXLabel(myGeoFrame, "N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", nullptr, LAYOUT_CENTER_Y);
405  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
406  myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A\t\tNetwork coordinate", nullptr, LAYOUT_CENTER_Y);
407  }
408  // make the window a mdi-window
409  myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
410  myMDIClient = new FXMDIClient(myMainSplitter, GUIDesignSplitterMDI);
411  myMDIMenu = new FXMDIMenu(this, myMDIClient);
412  // build the message window
414  myMainSplitter->setSplit(1, 65);
415  // fill menu and tool bar
416  fillMenuBar();
417  // build additional threads
418  myLoadThread = new GNELoadThread(getApp(), this, myEvents, myLoadThreadEvent);
419  // set the status bar
420  myStatusbar->getStatusLine()->setText("Ready.");
421  // set the caption
422  setTitle(myTitlePrefix);
423  // set Netedit ICON
425  // build NETEDIT Accelerators (hotkeys)
427 }
428 
429 
430 void
433  gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
434  FXMainWindow::create();
435  myFileMenu->create();
436  myEditMenu->create();
437  myFileMenuAdditionals->create();
438  myFileMenuTLS->create();
439  myFileMenuDemandElements->create();
440  //mySettingsMenu->create();
441  myWindowsMenu->create();
442  myHelpMenu->create();
443 
444  FXint textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 22;
445  myCartesianFrame->setWidth(textWidth);
446  myGeoFrame->setWidth(textWidth);
447 
448  show(PLACEMENT_DEFAULT);
449  if (!OptionsCont::getOptions().isSet("window-size")) {
450  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
451  maximize();
452  }
453  }
454 
455 }
456 
457 
459  closeAllWindows();
460  // Close icons
462  // Close gifs (Textures)
464  // delete visuals
465  delete myGLVisual;
466  // must delete menus to avoid segfault on removing accelerators
467  // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s)
468  delete myFileMenuAdditionals,
469  delete myFileMenuTLS,
471  delete myFileMenu;
472  delete myEditMenu;
473  delete myLocatorMenu;
474  delete myProcessingMenu;
475  delete myWindowsMenu;
476  delete myHelpMenu;
477  // Delete load thread
478  delete myLoadThread;
479  // drop all events
480  while (!myEvents.empty()) {
481  // get the next event
482  GUIEvent* e = myEvents.top();
483  myEvents.pop();
484  delete e;
485  }
486  // delte undo list
487  delete myUndoList;
488 }
489 
490 
491 long
492 GNEApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
493  if (continueWithUnsavedChanges("quit")) {
495  getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
496  if (isMaximized()) {
497  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 1);
498  } else {
499  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 0);
500  }
501  getApp()->exit(0);
502  }
503  return 1;
504 }
505 
506 
507 long
508 GNEApplicationWindow::onCmdEditChosen(FXObject*, FXSelector, void*) {
509  GUIDialog_GLChosenEditor* chooser =
511  chooser->create();
512  chooser->show();
513  return 1;
514 }
515 
516 
517 long
518 GNEApplicationWindow::onCmdNewNetwork(FXObject*, FXSelector, void*) {
519  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
520  if (myViewNet && !onCmdClose(0, 0, 0)) {
521  return 1;
522  } else {
526  loadConfigOrNet("", true, false, true, true);
527  return 1;
528  }
529 }
530 
531 
532 long
533 GNEApplicationWindow::onCmdOpenConfiguration(FXObject*, FXSelector, void*) {
534  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
535  if (myViewNet && !onCmdClose(0, 0, 0)) {
536  return 1;
537  } else {
538  // get the new file name
539  FXFileDialog opendialog(this, "Open Netconvert Configuration");
540  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_CONFIG));
541  opendialog.setSelectMode(SELECTFILE_EXISTING);
542  opendialog.setPatternList(myConfigPattern.c_str());
543  if (gCurrentFolder.length() != 0) {
544  opendialog.setDirectory(gCurrentFolder);
545  }
546  if (opendialog.execute()) {
547  gCurrentFolder = opendialog.getDirectory();
548  std::string file = opendialog.getFilename().text();
549  loadConfigOrNet(file, false);
550  // add it into recent configs
551  myMenuBarFile.myRecentConfigs.appendFile(file.c_str());
552  }
553  return 1;
554  }
555 }
556 
557 
558 long
559 GNEApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
560  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
561  if (myViewNet && !onCmdClose(0, 0, 0)) {
562  return 1;
563  } else {
564  // get the new file name
565  FXFileDialog opendialog(this, "Open Network");
566  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_NET));
567  opendialog.setSelectMode(SELECTFILE_EXISTING);
568  opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)");
569  if (gCurrentFolder.length() != 0) {
570  opendialog.setDirectory(gCurrentFolder);
571  }
572  if (opendialog.execute()) {
573  gCurrentFolder = opendialog.getDirectory();
574  std::string file = opendialog.getFilename().text();
575  loadConfigOrNet(file, true);
576  // add it into recent nets
577  myMenuBarFile.myRecentNets.appendFile(file.c_str());
578  // when a net is loaded, save additionals and TLSPrograms are disabled
581  }
582  return 1;
583  }
584 }
585 
586 
587 long
588 GNEApplicationWindow::onCmdOpenForeign(FXObject*, FXSelector, void*) {
589  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
590  if (myViewNet && !onCmdClose(0, 0, 0)) {
591  return 1;
592  } else {
593  // get the new file name
594  FXFileDialog opendialog(this, "Import Foreign Network");
595  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_OPEN_NET));
596  opendialog.setSelectMode(SELECTFILE_EXISTING);
597  FXString osmPattern("OSM net (*.osm.xml,*.osm)");
598  opendialog.setPatternText(0, osmPattern);
599  if (gCurrentFolder.length() != 0) {
600  opendialog.setDirectory(gCurrentFolder);
601  }
602  if (opendialog.execute()) {
603  gCurrentFolder = opendialog.getDirectory();
604  std::string file = opendialog.getFilename().text();
605 
608  if (osmPattern.contains(opendialog.getPattern())) {
609  // recommended osm options
610  // https://sumo.dlr.de/wiki/Networks/Import/OpenStreetMap#Recommended_NETCONVERT_Options
611  oc.set("osm-files", file);
612  oc.set("geometry.remove", "true");
613  oc.set("ramps.guess", "true");
614  oc.set("junctions.join", "true");
615  oc.set("tls.guess-signals", "true");
616  oc.set("tls.discard-simple", "true");
617  } else {
618  throw ProcessError("Attempted to import unknown file format '" + file + "'.");
619  }
620 
621  GUIDialog_Options* wizard =
622  new GUIDialog_Options(this, "Select Import Options", getWidth(), getHeight());
623 
624  if (wizard->execute()) {
625  NIFrame::checkOptions(); // needed to set projection parameters
626  loadConfigOrNet("", false, false, false);
627  }
628  }
629  return 1;
630  }
631 }
632 
633 
634 long
635 GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
636  // write debug information
637  WRITE_DEBUG("Open additional dialog");
638  // get the Additional file name
639  FXFileDialog opendialog(this, "Open Additionals file");
640  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODEADDITIONAL));
641  opendialog.setSelectMode(SELECTFILE_EXISTING);
642  opendialog.setPatternList("Additional files (*.add.xml)\nAll files (*)");
643  if (gCurrentFolder.length() != 0) {
644  opendialog.setDirectory(gCurrentFolder);
645  }
646  if (opendialog.execute()) {
647  // close additional dialog
648  WRITE_DEBUG("Close additional dialog");
649  // udpate current folder
650  gCurrentFolder = opendialog.getDirectory();
651  std::string file = opendialog.getFilename().text();
652  // disable validation for additionals
653  XMLSubSys::setValidation("never", "auto");
654  // Create additional handler
655  GNEAdditionalHandler additionalHandler(file, myNet->getViewNet());
656  // begin undoList operation
657  myUndoList->p_begin("Loading additionals from '" + file + "'");
658  // Run parser for additionals
659  if (!XMLSubSys::runParser(additionalHandler, file, false)) {
660  WRITE_ERROR("Loading of " + file + " failed.");
661  }
662  // end undoList operation and update view
663  myUndoList->p_end();
664  update();
665  // restore validation for additionals
666  XMLSubSys::setValidation("auto", "auto");
667  } else {
668  // write debug information
669  WRITE_DEBUG("Cancel additional dialog");
670  }
671  return 1;
672 }
673 
674 
675 long
676 GNEApplicationWindow::onCmdOpenTLSPrograms(FXObject*, FXSelector, void*) {
677  // write debug information
678  WRITE_DEBUG("Open TLSProgram dialog");
679  // get the shape file name
680  FXFileDialog opendialog(this, "Open TLSPrograms file");
681  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_MODETLS));
682  opendialog.setSelectMode(SELECTFILE_EXISTING);
683  opendialog.setPatternList("TLSProgram files (*.xml)\nAll files (*)");
684  if (gCurrentFolder.length() != 0) {
685  opendialog.setDirectory(gCurrentFolder);
686  }
687  if (opendialog.execute()) {
688  // close additional dialog
689  WRITE_DEBUG("Close TLSProgram dialog");
690  gCurrentFolder = opendialog.getDirectory();
691  std::string file = opendialog.getFilename().text();
692  // Run parser
693  myUndoList->p_begin("Loading TLS Programs from '" + file + "'");
694  myNet->computeNetwork(this);
695  if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(file) == false) {
696  // Abort undo/redo
697  myUndoList->abort();
698  } else {
699  // commit undo/redo operation
700  myUndoList->p_end();
701  update();
702  }
703  } else {
704  // write debug information
705  WRITE_DEBUG("Cancel TLSProgram dialog");
706  }
707  return 1;
708 }
709 
710 
711 long
712 GNEApplicationWindow::onCmdOpenDemandElements(FXObject*, FXSelector, void*) {
713  // write debug information
714  WRITE_DEBUG("Open demand element dialog");
715  // get the demand element file name
716  FXFileDialog opendialog(this, "Open demand element file");
717  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND));
718  opendialog.setSelectMode(SELECTFILE_EXISTING);
719  opendialog.setPatternList("Demand element files (*.rou.xml)\nAll files (*)");
720  if (gCurrentFolder.length() != 0) {
721  opendialog.setDirectory(gCurrentFolder);
722  }
723  if (opendialog.execute()) {
724  // close additional dialog
725  WRITE_DEBUG("Close demand element dialog");
726  // udpate current folder
727  gCurrentFolder = opendialog.getDirectory();
728  std::string file = opendialog.getFilename().text();
729  // disable validation for additionals
730  XMLSubSys::setValidation("never", "auto");
731  // Create additional handler
732  GNERouteHandler demandHandler(file, myNet->getViewNet());
733  // begin undoList operation
734  myUndoList->p_begin("Loading demand elements from '" + file + "'");
735  // Run parser for additionals
736  if (!XMLSubSys::runParser(demandHandler, file, false)) {
737  WRITE_ERROR("Loading of " + file + " failed.");
738  }
739  // end undoList operation and update view
740  myUndoList->p_end();
741  update();
742  // restore validation for demand
743  XMLSubSys::setValidation("auto", "auto");
744  } else {
745  // write debug information
746  WRITE_DEBUG("Cancel demand element dialog");
747  }
748  return 1;
749 }
750 
751 
752 long
753 GNEApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* fileData) {
754  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
755  if (myViewNet && !onCmdClose(0, 0, 0)) {
756  return 1;
757  } else if (myAmLoading) {
758  myStatusbar->getStatusLine()->setText("Already loading!");
759  return 1;
760  } else {
761  std::string file((const char*)fileData);
762  loadConfigOrNet(file, sender == &myMenuBarFile.myRecentNets);
763  return 1;
764  }
765 }
766 
767 
768 long
769 GNEApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) {
770  // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
771  if (myViewNet) {
772  // check if current network can be closed
773  if (continueWithUnsavedChanges("reload")) {
774  closeAllWindows();
775  // disable save additionals and TLS menu
778  // hide all Supermode, Network and demand commands
782  } else {
783  // abort reloading (because "cancel button" was pressed)
784  return 1;
785  }
786  }
787  // @note. If another network has been load during this session, it might not be desirable to set useStartupOptions
788  loadConfigOrNet(OptionsCont::getOptions().getString("sumo-net-file"), true, true);
789  return 1;
790 }
791 
792 
793 long
794 GNEApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
795  if (continueWithUnsavedChanges("close")) {
796  closeAllWindows();
797  // disable save additionals and TLS menu
800  // hide all Supermode, Network and demand commands
804  }
805  return 1;
806 }
807 
808 
809 long
810 GNEApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
811  if (myMDIClient->numChildren() > 0) {
812  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
813  if (w != nullptr) {
814  w->onCmdLocate(nullptr, sel, nullptr);
815  }
816  }
817  return 1;
818 }
819 
820 long
821 GNEApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void*) {
822  sender->handle(this, myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
823  return 1;
824 }
825 
826 
827 long
828 GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
830  return 1;
831 }
832 
833 
834 long
836  // write warning if netedit is running in testing mode
837  WRITE_DEBUG("Toogle load additionals in SUMO-GUI");
838  return 1;
839 }
840 
841 
842 long
843 GNEApplicationWindow::onCmdLoadDemandInSUMOGUI(FXObject*, FXSelector, void*) {
844  // write warning if netedit is running in testing mode
845  WRITE_DEBUG("Toogle load demand in SUMO-GUI");
846  return 1;
847 }
848 
849 
850 long
851 GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
852  // write warning if netedit is running in testing mode
853  WRITE_DEBUG("Opening about dialog");
854  // create and open about dialog
855  GNEAbout* about = new GNEAbout(this);
856  about->create();
857  about->show(PLACEMENT_OWNER);
858  // write warning if netedit is running in testing mode
859  WRITE_DEBUG("Closed about dialog");
860  return 1;
861 }
862 
863 
864 long GNEApplicationWindow::onClipboardRequest(FXObject*, FXSelector, void* ptr) {
865  FXEvent* event = (FXEvent*)ptr;
866  FXString string = GUIUserIO::clipped.c_str();
867  setDNDData(FROM_CLIPBOARD, event->target, string);
868  return 1;
869 }
870 
871 
872 long
873 GNEApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
874  eventOccurred();
875  return 1;
876 }
877 
878 
879 void
881  while (!myEvents.empty()) {
882  // get the next event
883  GUIEvent* e = myEvents.top();
884  myEvents.pop();
885  // process
886  switch (e->getOwnType()) {
889  break;
896  break;
897  default:
898  break;
899  }
900  delete e;
901  }
902 }
903 
904 
905 void
908  myAmLoading = false;
909  GNEEvent_NetworkLoaded* ec = static_cast<GNEEvent_NetworkLoaded*>(e);
910  // check whether the loading was successfull
911  if (ec->myNet == nullptr) {
912  // report failure
913  setStatusBarText("Loading of '" + ec->myFile + "' failed!");
914  } else {
915  // set new Net
916  myNet = ec->myNet;
917  // report success
918  setStatusBarText("'" + ec->myFile + "' loaded.");
920  // build viewparent toolbar grips before creating view parent
922  // initialise NETEDIT View
923  GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, "NETEDIT VIEW", this, nullptr, myNet, myUndoList, nullptr, MDI_TRACKING, 10, 10, 300, 200);
924  // create it maximized
925  viewParent->maximize();
926  // mark it as Active child
927  myMDIClient->setActiveChild(viewParent);
928  // cast pointer myViewNet
929  myViewNet = dynamic_cast<GNEViewNet*>(viewParent->getView());
930  // set settings in view
931  if (viewParent->getView() && ec->mySettingsFile != "") {
932  GUISettingsHandler settings(ec->mySettingsFile, true, true);
933  std::string settingsName = settings.addSettings(viewParent->getView());
934  viewParent->getView()->addDecals(settings.getDecals());
935  settings.applyViewport(viewParent->getView());
936  settings.setSnapshots(viewParent->getView());
937  }
938  // set network name on the caption
939  setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->myFile.c_str()));
940  // set supermode network
941  if (myViewNet) {
943  }
944  if (myViewNet && ec->myViewportFromRegistry) {
945  Position off;
946  off.set(getApp()->reg().readRealEntry("viewport", "x"), getApp()->reg().readRealEntry("viewport", "y"), getApp()->reg().readRealEntry("viewport", "z"));
947  Position p(off.x(), off.y(), 0);
948  myViewNet->setViewportFromToRot(off, p, 0);
949  }
950  }
951  getApp()->endWaitCursor();
953  // check if additionals/shapes has to be loaded at start
954  if (oc.isSet("additional-files") && !oc.getString("additional-files").empty() && myNet) {
955  // obtain vector of additional files
956  std::vector<std::string> additionalFiles = oc.getStringVector("additional-files");
957  // begin undolist
958  myUndoList->p_begin("Loading additionals and shapes from '" + toString(additionalFiles) + "'");
959  // iterate over every additional file
960  for (const auto& additionalFile : additionalFiles) {
961  WRITE_MESSAGE("Loading additionals and shapes from '" + additionalFile + "'");
962  GNEAdditionalHandler additionalHandler(additionalFile, myNet->getViewNet());
963  // disable validation for additionals
964  XMLSubSys::setValidation("never", "auto");
965  // Run parser
966  if (!XMLSubSys::runParser(additionalHandler, additionalFile, false)) {
967  WRITE_ERROR("Loading of " + additionalFile + " failed.");
968  }
969  // disable validation for additionals
970  XMLSubSys::setValidation("auto", "auto");
971  }
972 
973  myUndoList->p_end();
974  }
975  // check if demand elements has to be loaded at start
976  if (oc.isSet("route-files") && !oc.getString("route-files").empty() && myNet) {
977  // obtain vector of route files
978  std::vector<std::string> demandElementsFiles = oc.getStringVector("route-files");
979  // begin undolist
980  myUndoList->p_begin("Loading demand elements from '" + toString(demandElementsFiles) + "'");
981  // iterate over every route file
982  for (const auto& demandElementsFile : demandElementsFiles) {
983  WRITE_MESSAGE("Loading demand elements from '" + demandElementsFile + "'");
984  GNERouteHandler routeHandler(demandElementsFile, myNet->getViewNet());
985  // disable validation for demand elements
986  XMLSubSys::setValidation("never", "auto");
987  if (!XMLSubSys::runParser(routeHandler, demandElementsFile, false)) {
988  WRITE_ERROR("Loading of " + demandElementsFile + " failed.");
989  }
990  // disable validation for demand elements
991  XMLSubSys::setValidation("auto", "auto");
992  }
993 
994  myUndoList->p_end();
995  }
996  // check if additionals output must be changed
997  if (oc.isSet("additionals-output")) {
998  // overwrite "additional-files" with value "additionals-output"
999  oc.resetWritable();
1000  oc.set("additional-files", oc.getString("additionals-output"));
1001  }
1002  // check if demand elements output must be changed
1003  if (oc.isSet("demandelements-output")) {
1004  // overwrite "route-files" with value "demandelements-output"
1005  oc.resetWritable();
1006  oc.set("route-files", oc.getString("demandelements-output"));
1007  }
1008  // after loading net shouldn't be saved
1009  if (myNet) {
1010  myNet->requireSaveNet(false);
1011  }
1012  // update app
1013  update();
1014 }
1015 
1016 
1017 void
1019  GUIEvent_Message* ec = static_cast<GUIEvent_Message*>(e);
1020  myMessageWindow->appendMsg(ec->getOwnType(), ec->getMsg());
1021 }
1022 
1023 // ===========================================================================
1024 // GNEApplicationWindow::MenuBarFile method definitions
1025 // ===========================================================================
1026 
1028  myRecentNets(GNEApp->getApp(), "nets"),
1029  myGNEApp(GNEApp)
1030 { }
1031 
1032 
1033 void
1035  FXMenuSeparator* sep1 = new FXMenuSeparator(fileMenu);
1036  sep1->setTarget(&myRecentConfigs);
1037  sep1->setSelector(FXRecentFiles::ID_ANYFILES);
1038  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_1);
1039  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_2);
1040  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_3);
1041  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_4);
1042  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_5);
1043  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_6);
1044  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_7);
1045  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_8);
1046  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_9);
1047  new FXMenuCommand(fileMenu, "", nullptr, &myRecentConfigs, FXRecentFiles::ID_FILE_10);
1048  new FXMenuCommand(fileMenu, "Clear Recent Configurat&ions", nullptr, &myRecentConfigs, FXRecentFiles::ID_CLEAR);
1049  myRecentConfigs.setTarget(myGNEApp);
1050  myRecentConfigs.setSelector(MID_RECENTFILE);
1051  FXMenuSeparator* sep2 = new FXMenuSeparator(fileMenu);
1052  sep2->setTarget(&myRecentNets);
1053  sep2->setSelector(FXRecentFiles::ID_ANYFILES);
1054  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_1);
1055  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_2);
1056  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_3);
1057  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_4);
1058  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_5);
1059  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_6);
1060  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_7);
1061  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_8);
1062  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_9);
1063  new FXMenuCommand(fileMenu, "", nullptr, &myRecentNets, FXRecentFiles::ID_FILE_10);
1064  new FXMenuCommand(fileMenu, "Cl&ear Recent Networks", nullptr, &myRecentNets, FXRecentFiles::ID_CLEAR);
1065  myRecentNets.setTarget(myGNEApp);
1066  myRecentNets.setSelector(MID_RECENTFILE);
1067 }
1068 
1069 // ---------------------------------------------------------------------------
1070 // GNEViewNet::FileMenuCommands - methods
1071 // ---------------------------------------------------------------------------
1072 
1074  saveAdditionals(nullptr),
1075  saveAdditionalsAs(nullptr),
1076  saveTLSPrograms(nullptr),
1077  saveDemandElements(nullptr),
1078  saveDemandElementsAs(nullptr),
1079  myGNEApp(GNEApp) {
1080 }
1081 
1082 
1083 void
1085  new FXMenuCommand(fileMenu,
1086  "&New Network...\tCtrl+N\tCreate a new network.",
1088  new FXMenuCommand(fileMenu,
1089  "&Open Network...\tCtrl+O\tOpen a SUMO network.",
1091  new FXMenuCommand(fileMenu,
1092  "Open Netconvert Configura&tion...\tCtrl+Shift+O\tOpen a configuration file with NETCONVERT options.",
1094  new FXMenuCommand(fileMenu,
1095  "Import &Foreign Network...\t\tImport a foreign network such as OSM.",
1097  new FXMenuCommand(fileMenu,
1098  "&Reload\tCtrl+R\tReloads the network.",
1100  new FXMenuCommand(fileMenu,
1101  "&Save Network...\tCtrl+S\tSave the network.",
1103  new FXMenuCommand(fileMenu,
1104  "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.",
1106  new FXMenuCommand(fileMenu,
1107  "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.",
1109  new FXMenuCommand(fileMenu,
1110  "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).",
1112  // create Additionals menu options
1113  myGNEApp->myFileMenuAdditionals = new FXMenuPane(myGNEApp);
1114  new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1115  "Load A&dditionals...\tCtrl+A\tLoad additionals and shapes.",
1117  saveAdditionals = new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1118  "Save Additionals\tCtrl+Shift+A\tSave additionals and shapes.",
1120  saveAdditionals->disable();
1121  saveAdditionalsAs = new FXMenuCommand(myGNEApp->myFileMenuAdditionals,
1122  "Save Additionals As...\t\tSave additional elements in another file.",
1124  saveAdditionalsAs->disable();
1125  new FXMenuCascade(fileMenu, "Additionals and shapes", GUIIconSubSys::getIcon(ICON_MODEADDITIONAL), myGNEApp->myFileMenuAdditionals);
1126  // create TLS menu options
1127  myGNEApp->myFileMenuTLS = new FXMenuPane(myGNEApp);
1128  new FXMenuCommand(myGNEApp->myFileMenuTLS,
1129  "load TLS Programs...\tCtrl+K\tload TLS Programs in all Traffic Lights of the net.",
1131  saveTLSPrograms = new FXMenuCommand(myGNEApp->myFileMenuTLS,
1132  "Save TLS Programs \tCtrl+Shift+K\tSave TLS Programs of all Traffic Lights of the current net.",
1134  saveTLSPrograms->disable();
1135  new FXMenuCommand(myGNEApp->myFileMenuTLS,
1136  "Save TLS Programs As...\t\tSave TLS Programs of all Traffic Lights of the current net in another file.",
1138  new FXMenuCascade(fileMenu, "Traffic Lights", GUIIconSubSys::getIcon(ICON_MODETLS), myGNEApp->myFileMenuTLS);
1139  // create DemandElements menu options
1140  myGNEApp->myFileMenuDemandElements = new FXMenuPane(myGNEApp);
1141  new FXMenuCommand(myGNEApp->myFileMenuDemandElements,
1142  "Load demand elements...\tCtrl+D\tLoad demand elements.",
1144  saveDemandElements = new FXMenuCommand(myGNEApp->myFileMenuDemandElements,
1145  "Save demand elements\tCtrl+Shift+D\tSave demand elements.",
1147  saveDemandElements->disable();
1148  saveDemandElementsAs = new FXMenuCommand(myGNEApp->myFileMenuDemandElements,
1149  "Save demand elements as...\t\tSave demand elements in another file.",
1151  saveDemandElementsAs->disable();
1152  new FXMenuCascade(fileMenu, "Demand elements", GUIIconSubSys::getIcon(ICON_SUPERMODEDEMAND), myGNEApp->myFileMenuDemandElements);
1153  // close network
1154  new FXMenuSeparator(fileMenu);
1155  new FXMenuCommand(fileMenu,
1156  "Close\tCtrl+W\tClose the net&work.",
1158  // build recent files
1159  myGNEApp->myMenuBarFile.buildRecentFiles(fileMenu);
1160  new FXMenuSeparator(fileMenu);
1161  new FXMenuCommand(fileMenu, "&Quit\tCtrl+Q\tQuit the Application.", nullptr, myGNEApp, MID_HOTKEY_CTRL_Q_CLOSE, 0);
1162 }
1163 
1164 // ---------------------------------------------------------------------------
1165 // GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands - methods
1166 // ---------------------------------------------------------------------------
1167 
1169  createEdgeMode(nullptr),
1170  moveMode(nullptr),
1171  deleteMode(nullptr),
1172  inspectMode(nullptr),
1173  selectMode(nullptr),
1174  connectMode(nullptr),
1175  prohibitionMode(nullptr),
1176  TLSMode(nullptr),
1177  additionalMode(nullptr),
1178  crossingMode(nullptr),
1179  TAZMode(nullptr),
1180  shapeMode(nullptr),
1181  myEditMenuCommandsParent(editMenuCommandsParent),
1182  myHorizontalSeparator(nullptr) {
1183 }
1184 
1185 
1186 void
1188  createEdgeMode->show();
1189  moveMode->show();
1190  deleteMode->show();
1191  inspectMode->show();
1192  selectMode->show();
1193  connectMode->show();
1194  prohibitionMode->show();
1195  TLSMode->show();
1196  additionalMode->show();
1197  crossingMode->show();
1198  TAZMode->show();
1199  shapeMode->show();
1200  // also show separator
1201  myHorizontalSeparator->show();
1202 }
1203 
1204 
1205 void
1207  createEdgeMode->hide();
1208  moveMode->hide();
1209  deleteMode->hide();
1210  inspectMode->hide();
1211  selectMode->hide();
1212  connectMode->hide();
1213  prohibitionMode->hide();
1214  TLSMode->hide();
1215  additionalMode->hide();
1216  crossingMode->hide();
1217  TAZMode->hide();
1218  shapeMode->hide();
1219  // also hide separator
1220  myHorizontalSeparator->hide();
1221 }
1222 
1223 
1224 void
1226  // build every FXMenuCommand giving it a shortcut
1227  createEdgeMode = new FXMenuCommand(editMenu,
1228  "&Edge mode\tE\tCreate junction and edges.",
1229  GUIIconSubSys::getIcon(ICON_MODECREATEEDGE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_E_EDGEMODE);
1230  moveMode = new FXMenuCommand(editMenu,
1231  "&Move mode\tM\tMove elements.",
1232  GUIIconSubSys::getIcon(ICON_MODEMOVE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_M_MOVEMODE);
1233  deleteMode = new FXMenuCommand(editMenu,
1234  "&Delete mode\tD\tDelete elements.",
1235  GUIIconSubSys::getIcon(ICON_MODEDELETE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_D_DELETEMODE);
1236  inspectMode = new FXMenuCommand(editMenu,
1237  "&Inspect mode\tI\tInspect elements and change their attributes.",
1238  GUIIconSubSys::getIcon(ICON_MODEINSPECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_I_INSPECTMODE);
1239  selectMode = new FXMenuCommand(editMenu,
1240  "&Select mode\tS\tSelect elements.",
1241  GUIIconSubSys::getIcon(ICON_MODESELECT), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_S_SELECTMODE);
1242  connectMode = new FXMenuCommand(editMenu,
1243  "&Connection mode\tC\tEdit connections between lanes.",
1245  prohibitionMode = new FXMenuCommand(editMenu,
1246  "Pro&hibition mode\tW\tEdit connection prohibitions.",
1248  TLSMode = new FXMenuCommand(editMenu,
1249  "&Traffic light mode\tT\tEdit traffic lights over junctions.",
1250  GUIIconSubSys::getIcon(ICON_MODETLS), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_TLSMODE_VTYPEMODE);
1251  additionalMode = new FXMenuCommand(editMenu,
1252  "&Additional mode\tA\tCreate additional elements.",
1254  crossingMode = new FXMenuCommand(editMenu,
1255  "C&rossing mode\tR\tCreate crossings between edges.",
1256  GUIIconSubSys::getIcon(ICON_MODECROSSING), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE);
1257  TAZMode = new FXMenuCommand(editMenu,
1258  "TA&Z mode\tZ\tCreate Traffic Assignment Zones.",
1259  GUIIconSubSys::getIcon(ICON_MODETAZ), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_Z_TAZMODE);
1260  shapeMode = new FXMenuCommand(editMenu,
1261  "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.",
1262  GUIIconSubSys::getIcon(ICON_MODEPOLYGON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_POLYGONMODE_PERSONMODE);
1263  // build separator
1264  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1265 }
1266 
1267 // ---------------------------------------------------------------------------
1268 // GNEApplicationWindow::EditMenuCommands::DemandMenuCommands - methods
1269 // ---------------------------------------------------------------------------
1270 
1272  routeMode(nullptr),
1273  vehicleMode(nullptr),
1274  vehicleTypeMode(nullptr),
1275  stopMode(nullptr),
1276  personTypeMode(nullptr),
1277  personMode(nullptr),
1278  personPlanMode(nullptr),
1279  myEditMenuCommandsParent(editMenuCommandsParent),
1280  myHorizontalSeparator(nullptr) {
1281 }
1282 
1283 
1284 void
1286  routeMode->show();
1287  vehicleMode->show();
1288  vehicleTypeMode->show();
1289  stopMode->show();
1290  personTypeMode->show();
1291  personMode->show();
1292  personPlanMode->show();
1293  // also show separator
1294  myHorizontalSeparator->show();
1295 }
1296 
1297 
1298 void
1300  routeMode->hide();
1301  vehicleMode->hide();
1302  vehicleTypeMode->hide();
1303  stopMode->hide();
1304  personTypeMode->hide();
1305  personMode->hide();
1306  personPlanMode->hide();
1307  // also hide separator
1308  myHorizontalSeparator->hide();
1309 }
1310 
1311 
1312 void
1314  // build every FXMenuCommand giving it a shortcut
1315  routeMode = new FXMenuCommand(editMenu,
1316  "Route mode\tR\tCreate Routes.",
1317  GUIIconSubSys::getIcon(ICON_MODEROUTE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE);
1318  vehicleMode = new FXMenuCommand(editMenu,
1319  "Vehicle mode\tV\tCreate vehicles.",
1320  GUIIconSubSys::getIcon(ICON_MODEVEHICLE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_V_VEHICLEMODE);
1321  vehicleTypeMode = new FXMenuCommand(editMenu,
1322  "Vehicle type mode\tT\tCreate vehicle types.",
1323  GUIIconSubSys::getIcon(ICON_MODEVEHICLETYPE), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_T_TLSMODE_VTYPEMODE);
1324  stopMode = new FXMenuCommand(editMenu,
1325  "Stop mode\tA\tCreate stops.",
1326  GUIIconSubSys::getIcon(ICON_MODESTOP), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_A_ADDITIONALMODE_STOPMODE);
1327  personTypeMode = new FXMenuCommand(editMenu,
1328  "Person type mode\tW\tCreate person types.",
1330  personMode = new FXMenuCommand(editMenu,
1331  "Person mode\tP\tCreate persons.",
1332  GUIIconSubSys::getIcon(ICON_MODEPERSON), myEditMenuCommandsParent->myGNEApp, MID_HOTKEY_P_POLYGONMODE_PERSONMODE);
1333  personPlanMode = new FXMenuCommand(editMenu,
1334  "Person plan mode\tC\tCreate person plans.",
1336  // build separator
1337  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1338 }
1339 
1340 // ---------------------------------------------------------------------------
1341 // GNEApplicationWindow::EditMenuCommands - methods
1342 // ---------------------------------------------------------------------------
1343 
1345  myGNEApp(GNEApp),
1346  networkMenuCommands(this),
1347  demandMenuCommands(this),
1348  undoLastChange(nullptr),
1349  redoLastChange(nullptr),
1350  editViewScheme(nullptr),
1351  editViewPort(nullptr),
1352  toogleGrid(nullptr),
1353  loadAdditionalsInSUMOGUI(nullptr),
1354  loadDemandInSUMOGUI(nullptr),
1355  openInSUMOGUI(nullptr) {
1356 }
1357 
1358 
1359 void
1361  // build undo/redo command
1362  undoLastChange = new FXMenuCommand(editMenu,
1363  "&Undo\tCtrl+Z\tUndo the last change.",
1365  redoLastChange = new FXMenuCommand(editMenu,
1366  "&Redo\tCtrl+Y\tRedo the last change.",
1368  // build separator
1369  new FXMenuSeparator(editMenu);
1370  // build Supermode commands and hide it
1371  myGNEApp->mySupermodeCommands.buildSupermodeCommands(editMenu);
1372  myGNEApp->mySupermodeCommands.hideSupermodeCommands();
1373  // build Network modes commands and hide it
1374  networkMenuCommands.buildNetworkMenuCommands(editMenu);
1375  networkMenuCommands.hideNetworkMenuCommands();
1376  // build Demand Modes commands
1377  demandMenuCommands.buildDemandMenuCommands(editMenu);
1378  demandMenuCommands.hideDemandMenuCommands();
1379  editViewScheme = new FXMenuCommand(editMenu,
1380  "Edit Visualisation\tF9\tOpens a dialog for editing visualization settings.",
1381  nullptr, myGNEApp, MID_HOTKEY_F9_EDIT_VIEWSCHEME);
1382  editViewPort = new FXMenuCommand(editMenu,
1383  "Edit Viewport\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.",
1384  nullptr, myGNEApp, MID_HOTKEY_CTRL_I_EDITVIEWPORT);
1385  toogleGrid = new FXMenuCommand(editMenu,
1386  "Toggle Grid\tCtrl+G\tToggles background grid (and snap-to-grid functionality).",
1387  nullptr, myGNEApp, MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID);
1388  // add open in sumo options
1389  new FXMenuSeparator(editMenu);
1390  loadAdditionalsInSUMOGUI = new FXMenuCheck(editMenu,
1391  "Load additionals in SUMO-GUI\t\tLoad additionals in SUMO-GUI.",
1393  loadAdditionalsInSUMOGUI->setCheck(TRUE);
1394  loadDemandInSUMOGUI = new FXMenuCheck(editMenu,
1395  "Load demand in SUMO-GUI\t\tLoad demand in SUMO-GUI.",
1396  myGNEApp, MID_GNE_TOOLBAREDIT_LOADDEMAND);
1397  loadDemandInSUMOGUI->setCheck(TRUE);
1398  openInSUMOGUI = new FXMenuCommand(editMenu,
1399  "Open in SUMO-GUI\tCtrl+T\tOpens the SUMO-GUI application with the current network.",
1401 }
1402 
1403 // ---------------------------------------------------------------------------
1404 // GNEViewNet::ProcessingMenuCommands - methods
1405 // ---------------------------------------------------------------------------
1406 
1408  computeNetwork(nullptr),
1409  computeNetworkVolatile(nullptr),
1410  cleanJunctions(nullptr),
1411  joinJunctions(nullptr),
1412  clearInvalidCrossings(nullptr),
1413  computeDemand(nullptr),
1414  cleanRoutes(nullptr),
1415  joinRoutes(nullptr),
1416  clearInvalidDemandElements(nullptr),
1417  optionMenus(nullptr),
1418  myGNEApp(GNEApp) {
1419 }
1420 
1421 
1422 void
1424  // build network processing menu commands
1425  computeNetwork = new FXMenuCommand(fileMenu,
1426  "Compute Junctions\tF5\tComputes junction shape and logic.",
1428  computeNetworkVolatile = new FXMenuCommand(fileMenu,
1429  "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.",
1431  cleanJunctions = new FXMenuCommand(fileMenu,
1432  "Clean Junctions\tF6\tRemoves solitary junctions.",
1434  joinJunctions = new FXMenuCommand(fileMenu,
1435  "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.",
1437  clearInvalidCrossings = new FXMenuCommand(fileMenu,
1438  "Clean invalid crossings\tF8\tClear invalid crossings.",
1440  // build demand processing menu commands
1441  computeDemand = new FXMenuCommand(fileMenu,
1442  "Compute demand\tF5\tComputes demand elements.",
1444  cleanRoutes = new FXMenuCommand(fileMenu,
1445  "Clean routes\tF6\tRemoves routes without vehicles.",
1447  joinRoutes = new FXMenuCommand(fileMenu,
1448  "Join routes\tF7\tJoins routes with the same edges.",
1450  clearInvalidDemandElements = new FXMenuCommand(fileMenu,
1451  "Clean invalid route elements\tF8\tClear elements with an invalid path (routes, Trips, Flows...).",
1453  // add separator (because optionsmenu is commmon for Network and Demand modes
1454  new FXMenuSeparator(fileMenu);
1455  optionMenus = new FXMenuCommand(fileMenu,
1456  "Options\tF10\t\tConfigure Processing Options.",
1458 }
1459 
1460 
1461 void
1463  // first enable menu commands
1464  computeNetwork->enable();
1465  computeNetworkVolatile->enable();
1466  cleanJunctions->enable();
1467  joinJunctions->enable();
1468  clearInvalidCrossings->enable();
1469  // now show it
1470  computeNetwork->show();
1471  computeNetworkVolatile->show();
1472  cleanJunctions->show();
1473  joinJunctions->show();
1474  clearInvalidCrossings->show();
1475 }
1476 
1477 
1478 void
1480  // first disable menu commands
1481  computeNetwork->disable();
1482  computeNetworkVolatile->disable();
1483  cleanJunctions->disable();
1484  joinJunctions->disable();
1485  clearInvalidCrossings->disable();
1486  // now hide it
1487  computeNetwork->hide();
1488  computeNetworkVolatile->hide();
1489  cleanJunctions->hide();
1490  joinJunctions->hide();
1491  clearInvalidCrossings->hide();
1492 }
1493 
1494 
1495 void
1497  // first enable menu commands
1498  computeDemand->enable();
1499  cleanRoutes->enable();
1500  joinRoutes->enable();
1501  clearInvalidDemandElements->enable();
1502  // now show it
1503  computeDemand->show();
1504  cleanRoutes->show();
1505  joinRoutes->show();
1506  clearInvalidDemandElements->show();
1507 }
1508 
1509 
1510 void
1512  // first disable menu commands
1513  computeDemand->disable();
1514  cleanRoutes->disable();
1515  joinRoutes->disable();
1516  clearInvalidDemandElements->disable();
1517  // now hide it
1518  computeDemand->hide();
1519  cleanRoutes->hide();
1520  joinRoutes->hide();
1521  clearInvalidDemandElements->hide();
1522 }
1523 
1524 // ---------------------------------------------------------------------------
1525 // GNEViewNet::LocateMenuCommands - methods
1526 // ---------------------------------------------------------------------------
1527 
1529  myGNEApp(GNEApp) {
1530 }
1531 
1532 
1533 void
1535  // build locate menu commands
1536  new FXMenuCommand(locateMenu,
1537  "Locate &Junctions\tShift+J\tOpen a dialog for locating a Junction.",
1539  new FXMenuCommand(locateMenu,
1540  "Locate &Edges\tShift+E\tOpen a dialog for locating an Edge.",
1542  new FXMenuCommand(locateMenu,
1543  "Locate &Vehicles\tShift+V\tOpen a dialog for locating a Vehicle.",
1545  new FXMenuCommand(locateMenu,
1546  "Locate &Person\tShift+P\tOpen a dialog for locating a Person.",
1548  new FXMenuCommand(locateMenu,
1549  "Locate &Route\tShift+R\tOpen a dialog for locating a Route.",
1551  new FXMenuCommand(locateMenu,
1552  "Locate &Stops\tShift+S\tOpen a dialog for locating a Stop.",
1554  new FXMenuCommand(locateMenu,
1555  "Locate &TLS\tShift+T\tOpen a dialog for locating a Traffic Light.",
1557  new FXMenuCommand(locateMenu,
1558  "Locate &Additional\tShift+A\tOpen a dialog for locating an Additional Structure.",
1560  new FXMenuCommand(locateMenu,
1561  "Locate P&oI\tShift+O\tOpen a dialog for locating a Point of Interest.",
1563  new FXMenuCommand(locateMenu,
1564  "Locate Po&lygon\tShift+L\tOpen a dialog for locating a Polygon.",
1566 }
1567 
1568 // ---------------------------------------------------------------------------
1569 // GNEViewNet::WindowsMenuCommands - methods
1570 // ---------------------------------------------------------------------------
1571 
1573  myGNEApp(GNEApp) {
1574 }
1575 
1576 
1577 void
1579  // build windows menu commands
1580  new FXMenuCheck(windowsMenu,
1581  "&Show Status Line\t\tToggle this Status Bar on/off.",
1582  myGNEApp->myStatusbar, FXWindow::ID_TOGGLESHOWN);
1583  new FXMenuCheck(windowsMenu,
1584  "Show &Message Window\t\tToggle the Message Window on/off.",
1585  myGNEApp->myMessageWindow, FXWindow::ID_TOGGLESHOWN);
1586  new FXMenuCommand(windowsMenu,
1587  "&Clear Message Window\t\tClear the message window.",
1588  nullptr, myGNEApp, MID_CLEARMESSAGEWINDOW);
1589 }
1590 
1591 // ---------------------------------------------------------------------------
1592 // GNEViewNet::NetworkCheckableButtons - methods
1593 // ---------------------------------------------------------------------------
1594 
1596  networkMode(nullptr),
1597  demandMode(nullptr),
1598  myGNEApp(GNEApp),
1599  myHorizontalSeparator(nullptr) {
1600 }
1601 
1602 
1603 void
1605  networkMode->show();
1606  demandMode->show();
1607  // also show separator
1608  myHorizontalSeparator->show();
1609 }
1610 
1611 
1612 void
1614  networkMode->hide();
1615  demandMode->hide();
1616  // also hide separator
1617  myHorizontalSeparator->hide();
1618 }
1619 
1620 
1621 void
1623  // build supermode menu commands
1624  networkMode = new FXMenuCommand(editMenu, "&Network mode\tF3\tSelect network mode.",
1626  demandMode = new FXMenuCommand(editMenu, "&Demand mode\tF4\tSelect demand mode.",
1628  // build separator
1629  myHorizontalSeparator = new FXMenuSeparator(editMenu);
1630 }
1631 
1632 // ---------------------------------------------------------------------------
1633 // private methods
1634 // ---------------------------------------------------------------------------
1635 
1636 void
1638  // declare a FXMenuTitle needed to set height in all menu titles
1639  FXMenuTitle* menuTitle;
1640  // build file menu
1641  myFileMenu = new FXMenuPane(this, LAYOUT_FIX_HEIGHT);
1642  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&File", nullptr, myFileMenu, LAYOUT_FIX_HEIGHT);
1643  menuTitle->setHeight(23);
1645  // build edit menu
1646  myEditMenu = new FXMenuPane(this);
1647  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Edit", nullptr, myEditMenu, LAYOUT_FIX_HEIGHT);
1648  menuTitle->setHeight(23);
1650  // build processing menu (trigger netbuild computations)
1651  myProcessingMenu = new FXMenuPane(this);
1652  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Processing", nullptr, myProcessingMenu, LAYOUT_FIX_HEIGHT);
1653  menuTitle->setHeight(23);
1655  // build locate menu
1656  myLocatorMenu = new FXMenuPane(this);
1657  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Locate", nullptr, myLocatorMenu, LAYOUT_FIX_HEIGHT);
1658  menuTitle->setHeight(23);
1660  // build windows menu
1661  myWindowsMenu = new FXMenuPane(this);
1662  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Windows", nullptr, myWindowsMenu, LAYOUT_FIX_HEIGHT);
1663  menuTitle->setHeight(23);
1665  // build help menu
1666  myHelpMenu = new FXMenuPane(this);
1667  menuTitle = new FXMenuTitle(myToolbarsGrip.menu, "&Help", nullptr, myHelpMenu, LAYOUT_FIX_HEIGHT);
1668  menuTitle->setHeight(23);
1669  // build help menu commands
1670  new FXMenuCommand(myHelpMenu,
1671  "&Online Documentation\tF1\tOpen Online documentation.",
1672  nullptr, this, MID_HOTKEY_F1_ONLINEDOCUMENTATION);
1673  new FXMenuCommand(myHelpMenu,
1674  "&About\tF2\tAbout netedit.",
1676 }
1677 
1678 
1679 void
1680 GNEApplicationWindow::loadConfigOrNet(const std::string file, bool isNet, bool isReload, bool useStartupOptions, bool newNet) {
1682  getApp()->beginWaitCursor();
1683  myAmLoading = true;
1684  closeAllWindows();
1685  if (isReload) {
1686  myLoadThread->start();
1687  setStatusBarText("Reloading.");
1688  } else {
1689  gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1690  myLoadThread->loadConfigOrNet(file, isNet, useStartupOptions, newNet);
1691  setStatusBarText("Loading '" + file + "'.");
1692  }
1693  // show supermode commands menu
1695  // show Network command menus (because Network is the default supermode)
1697  // update window
1698  update();
1699 }
1700 
1701 
1702 FXGLCanvas*
1704  // NETEDIT uses only a single View, then return nullptr
1705  return nullptr;
1706 }
1707 
1708 
1709 SUMOTime
1711  return 0;
1712 }
1713 
1714 
1715 double
1717  return 1;
1718 }
1719 
1720 
1721 GNEUndoList*
1723  return myUndoList;
1724 }
1725 
1726 
1729  return myToolbarsGrip;
1730 }
1731 
1732 
1733 void
1735  // check if view has to be saved
1736  if (myViewNet) {
1738  }
1739  // lock tracker
1740  myTrackerLock.lock();
1741  // remove trackers and other external windows
1742  while (!myGLWindows.empty()) {
1743  delete myGLWindows.front();
1744  }
1745  myViewNet = nullptr;
1746  for (FXMainWindow* const window : myTrackerWindows) {
1747  window->destroy();
1748  delete window;
1749  }
1750  myTrackerWindows.clear();
1751  // reset the caption
1752  setTitle(myTitlePrefix);
1753  // add a separator to the log
1755  // unlock tracker
1756  myTrackerLock.unlock();
1757  // remove coordinate information
1758  myGeoCoordinate->setText("N/A");
1759  myCartesianCoordinate->setText("N/A");
1760  // check if net can be deleted
1761  if (myNet != nullptr) {
1762  delete myNet;
1763  myNet = nullptr;
1765  }
1767  // Reset textures
1769  // reset fonts
1771  // disable saving commmand
1773 }
1774 
1775 
1776 FXCursor*
1778  return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1779 }
1780 
1781 
1782 void
1785  // Disable normalization preserve the given network as far as possible
1786  oc.set("offset.disable-normalization", "true");
1787  loadConfigOrNet("", true, false, true, oc.getBool("new"));
1788 }
1789 
1790 
1791 void
1792 GNEApplicationWindow::setStatusBarText(const std::string& statusBarText) {
1793  myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1794  myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1795 }
1796 
1797 
1798 long
1800  // obtain option container
1802  // declare variable to save FXMessageBox outputs.
1803  FXuint answer = 0;
1804  // declare string to save paths in wich additionals, shapes and demand will be saved
1805  std::string additionalsSavePath = oc.getString("additional-files");
1806  std::string demandElementsSavePath = oc.getString("route-files");
1807  // write warning if netedit is running in testing mode
1808  WRITE_DEBUG("Opening FXMessageBox 'Volatile Recomputing'");
1809  // open question dialog box
1810  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Recompute with volatile options",
1811  "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?");
1812  if (answer != 1) { //1:yes, 2:no, 4:esc
1813  // write warning if netedit is running in testing mode
1814  if (answer == 2) {
1815  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1816  } else if (answer == 4) {
1817  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1818  }
1819  // abort recompute with volatile options
1820  return 0;
1821  } else {
1822  // write warning if netedit is running in testing mode
1823  WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1824  // Check if there are additionals in our net
1825  if (myNet->getNumberOfAdditionals() > 0) {
1826  // ask user if want to save additionals if weren't saved previously
1827  if (oc.getString("additional-files") == "") {
1828  // write warning if netedit is running in testing mode
1829  WRITE_DEBUG("Opening FXMessageBox 'Save additionals before recomputing'");
1830  // open question dialog box
1831  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save additionals before recomputing with volatile options",
1832  "Would you like to save additionals before recomputing?");
1833  if (answer != 1) { //1:yes, 2:no, 4:esc
1834  // write warning if netedit is running in testing mode
1835  if (answer == 2) {
1836  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'No'");
1837  } else if (answer == 4) {
1838  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'ESC'");
1839  }
1840  } else {
1841  // write warning if netedit is running in testing mode
1842  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before recomputing' with 'Yes'");
1843  // Open a dialog to set filename output
1844  FXString file = MFXUtils::getFilename2Write(this,
1845  "Select name of the demand element file", ".xml",
1847  gCurrentFolder).text();
1848  // add xml extension
1849  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml");
1850  // check that file is valid
1851  if (fileWithExtension != "") {
1852  // update additional files
1853  oc.resetWritable();
1854  oc.set("additional-files", fileWithExtension);
1855  // set obtanied filename output into additionalsSavePath (can be "")
1856  additionalsSavePath = oc.getString("additional-files");
1857  }
1858  }
1859  }
1860  // Check if additional must be saved in a temporal directory, if user didn't define a directory for additionals
1861  if (oc.getString("additional-files") == "") {
1862  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1863  additionalsSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpAdditionalsNetedit.xml");
1864  }
1865  // Start saving additionals
1866  getApp()->beginWaitCursor();
1867  try {
1868  myNet->saveAdditionals(additionalsSavePath);
1869  } catch (IOError& e) {
1870  // write warning if netedit is running in testing mode
1871  WRITE_DEBUG("Opening FXMessageBox 'Error saving additionals before recomputing'");
1872  // open error message box
1873  FXMessageBox::error(this, MBOX_OK, "Saving additionals in temporal folder failed!", "%s", e.what());
1874  // write warning if netedit is running in testing mode
1875  WRITE_DEBUG("Closed FXMessageBox 'Error saving additionals before recomputing' with 'OK'");
1876  }
1877  // end saving additionals
1879  getApp()->endWaitCursor();
1880  } else {
1881  // clear additional path
1882  additionalsSavePath = "";
1883  }
1884  // Check if there are demand elements in our net
1885  if (myNet->getNumberOfDemandElements() > 0) {
1886  // ask user if want to save demand elements if weren't saved previously
1887  if (oc.getString("route-files") == "") {
1888  // write warning if netedit is running in testing mode
1889  WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before recomputing'");
1890  // open question dialog box
1891  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save demand elements before recomputing with volatile options",
1892  "Would you like to save demand elements before recomputing?");
1893  if (answer != 1) { //1:yes, 2:no, 4:esc
1894  // write warning if netedit is running in testing mode
1895  if (answer == 2) {
1896  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'No'");
1897  } else if (answer == 4) {
1898  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'ESC'");
1899  }
1900  } else {
1901  // write warning if netedit is running in testing mode
1902  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before recomputing' with 'Yes'");
1903  // Open a dialog to set filename output
1904  FXString file = MFXUtils::getFilename2Write(this,
1905  "Select name of the demand element file", ".rou.xml",
1907  gCurrentFolder).text();
1908  // add xml extension
1909  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml");
1910  // check that file is valid
1911  if (fileWithExtension != "") {
1912  // update route files
1913  oc.resetWritable();
1914  oc.set("route-files", fileWithExtension);
1915  // set obtanied filename output into demand elementSavePath (can be "")
1916  demandElementsSavePath = oc.getString("route-files");
1917  }
1918  }
1919  }
1920  // Check if demand element must be saved in a temporal directory, if user didn't define a directory for demand elements
1921  if (oc.getString("route-files") == "") {
1922  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1923  demandElementsSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpDemandElementsNetedit.xml");
1924  }
1925  // Start saving demand elements
1926  getApp()->beginWaitCursor();
1927  try {
1928  myNet->saveDemandElements(demandElementsSavePath);
1929  } catch (IOError& e) {
1930  // write warning if netedit is running in testing mode
1931  WRITE_DEBUG("Opening FXMessageBox 'Error saving demand elements before recomputing'");
1932  // open error message box
1933  FXMessageBox::error(this, MBOX_OK, "Saving demand elements in temporal folder failed!", "%s", e.what());
1934  // write warning if netedit is running in testing mode
1935  WRITE_DEBUG("Closed FXMessageBox 'Error saving demand elements before recomputing' with 'OK'");
1936  }
1937  // end saving demand elements
1939  getApp()->endWaitCursor();
1940  } else {
1941  // clear demand element path
1942  demandElementsSavePath = "";
1943  }
1944  // compute with volatile options
1945  myNet->computeNetwork(this, true, true, additionalsSavePath, demandElementsSavePath);
1946  updateControls();
1947  return 1;
1948  }
1949 }
1950 
1951 
1952 void
1956 }
1957 
1958 
1959 void
1963 }
1964 
1965 
1966 void
1969 }
1970 
1971 
1972 void
1976 }
1977 
1978 
1979 void
1983 }
1984 
1985 
1986 long
1987 GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) {
1988  // check that currently there is a View
1989  if (myViewNet) {
1990  myViewNet->onCmdSetSupermode(sender, sel, ptr);
1991  }
1992  return 1;
1993 }
1994 
1995 
1996 long
1997 GNEApplicationWindow::onCmdSetMode(FXObject* sender, FXSelector sel, void* ptr) {
1998  // check that currently there is a View
1999  if (myViewNet) {
2000  myViewNet->onCmdSetMode(sender, sel, ptr);
2001  }
2002  return 1;
2003 }
2004 
2005 
2006 long
2007 GNEApplicationWindow::onCmdProcessButton(FXObject*, FXSelector sel, void*) {
2008  // first check if there is a view
2009  if (myViewNet) {
2010  // process depending of supermode
2012  // check what FXMenuCommand was called
2013  switch (FXSELID(sel)) {
2015  // show extra information for tests
2016  WRITE_DEBUG("Key F5 (Compute) pressed");
2017  myNet->computeNetwork(this, true, false);
2018  updateControls();
2019  break;
2021  // show extra information for tests
2022  WRITE_DEBUG("Keys Shift + F5 (Compute with volatile options) pressed");
2024  break;
2026  // show extra information for tests
2027  WRITE_DEBUG("Key F6 (Clean junction) pressed");
2029  break;
2031  // show extra information for tests
2032  WRITE_DEBUG("Key F7 (Join junctions) pressed");
2034  break;
2036  // show extra information for tests
2037  WRITE_DEBUG("Key F8 (Clean invalid crossings) pressed");
2039  break;
2040  default:
2041  break;
2042  }
2043  } else {
2044  // check what FXMenuCommand was called
2045  switch (FXSELID(sel)) {
2047  // show extra information for tests
2048  WRITE_DEBUG("Key F5 (Compute) pressed");
2050  updateControls();
2051  break;
2053  // show extra information for tests
2054  WRITE_DEBUG("Key F6 (RemoveUnusedRoutes) pressed");
2056  break;
2058  // show extra information for tests
2059  WRITE_DEBUG("Key F7 (JoinRoutes) pressed");
2061  break;
2063  // show extra information for tests
2064  WRITE_DEBUG("Key F8 (CleanInvalidDemandElements) pressed");
2066  break;
2067  default:
2068  break;
2069  }
2070  }
2071  }
2072  return 1;
2073 }
2074 
2075 
2076 long
2077 GNEApplicationWindow::onCmdOpenSUMOGUI(FXObject*, FXSelector, void*) {
2078  // check that currently there is a View
2079  if (myViewNet) {
2080  // first check if network is saved
2081  if (!myViewNet->getNet()->isNetSaved()) {
2082  // save network
2083  onCmdSaveNetwork(nullptr, 0, nullptr);
2084  if (!myViewNet->getNet()->isNetSaved()) {
2085  return 0;
2086  }
2087  }
2088  // now check if additionals must be loaded and are saved
2089  if ((myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == TRUE) &&
2090  (myViewNet->getNet()->getNumberOfAdditionals() > 0) &&
2091  (myViewNet->getNet()->isAdditionalsSaved() == false)) {
2092  // save additionals
2093  onCmdSaveAdditionals(nullptr, 0, nullptr);
2094  // check if additionals were sucesfully saved. If not, abort
2095  if (!myViewNet->getNet()->isAdditionalsSaved()) {
2096  return 0;
2097  }
2098  }
2099  // finally check if demand elements must be loaded and are saved
2100  if ((myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == TRUE) &&
2102  (myViewNet->getNet()->isDemandElementsSaved() == false)) {
2103  // save additionals
2104  onCmdSaveDemandElements(nullptr, 0, nullptr);
2105  // check if demand elements were sucesfully saved. If not, abort
2106  if (!myViewNet->getNet()->isDemandElementsSaved()) {
2107  return 0;
2108  }
2109  }
2110  // obtain viewport
2111  FXRegistry reg("SUMO GUI", "Eclipse");
2112  reg.read();
2113  reg.writeRealEntry("viewport", "x", myViewNet->getChanger().getXPos());
2114  reg.writeRealEntry("viewport", "y", myViewNet->getChanger().getYPos());
2115  reg.writeRealEntry("viewport", "z", myViewNet->getChanger().getZPos());
2116  reg.write();
2117  std::string sumogui = "sumo-gui";
2118  const char* sumoPath = getenv("SUMO_HOME");
2119  if (sumoPath != nullptr) {
2120  std::string newPath = std::string(sumoPath) + "/bin/sumo-gui";
2121  if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
2122  sumogui = "\"" + newPath + "\"";
2123  }
2124  }
2125  std::string cmd = sumogui + " --registry-viewport" + " -n " + "\"" + OptionsCont::getOptions().getString("output-file") + "\"";
2126  // obtainer options container
2128  // if load additionals is enabled, add it to command
2129  if ((myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == TRUE) && (oc.getString("additional-files").size() > 0)) {
2130  cmd += " -a \"" + oc.getString("additional-files") + "\"";
2131  }
2132  // if load demand is enabled, add it to command
2133  if ((myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == TRUE) && (oc.getString("route-files").size() > 0)) {
2134  cmd += " -r \"" + oc.getString("route-files") + "\"";
2135  }
2136  // start in background
2137 #ifndef WIN32
2138  cmd = cmd + " &";
2139 #else
2140  // see "help start" for the parameters
2141  cmd = "start /B \"\" " + cmd;
2142 #endif
2143  WRITE_MESSAGE("Running " + cmd + ".");
2144  // yay! fun with dangerous commands... Never use this over the internet
2146  }
2147  return 1;
2148 }
2149 
2150 
2151 long
2152 GNEApplicationWindow::onCmdAbort(FXObject*, FXSelector, void*) {
2153  // check that view exists
2154  if (myViewNet) {
2155  // show extra information for tests
2156  WRITE_DEBUG("Key ESC (abort) pressed");
2157  // first check if we're selecting a subset of edges in TAZ Frame
2159  // show extra information for tests
2160  WRITE_DEBUG("Cleaning current selected edges");
2161  // clear current selection
2163  } else if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2164  // show extra information for tests
2165  WRITE_DEBUG("Cleaning inspected elements");
2166  // clear inspected elements
2168  } else {
2169  // abort current operation
2171  myViewNet->update();
2172  }
2173  }
2174  return 1;
2175 }
2176 
2177 
2178 long
2179 GNEApplicationWindow::onCmdDel(FXObject*, FXSelector, void*) {
2180  // check that view exists
2181  if (myViewNet) {
2182  // show extra information for tests
2183  WRITE_DEBUG("Key DEL (delete) pressed");
2184  myViewNet->hotkeyDel();
2185  }
2186  return 1;
2187 }
2188 
2189 
2190 long
2191 GNEApplicationWindow::onCmdEnter(FXObject*, FXSelector, void*) {
2192  // check that view exists
2193  if (myViewNet) {
2194  // show extra information for tests
2195  WRITE_DEBUG("Key ENTER pressed");
2197  }
2198  return 1;
2199 }
2200 
2201 
2202 long
2203 GNEApplicationWindow::onCmdBackspace(FXObject*, FXSelector, void*) {
2204  // check that view exists
2205  if (myViewNet) {
2206  // show extra information for tests
2207  WRITE_DEBUG("Key BACKSPACE pressed");
2209  }
2210  return 1;
2211 }
2212 
2213 
2214 long
2215 GNEApplicationWindow::onCmdFocusFrame(FXObject*, FXSelector, void*) {
2216  // check that view exists
2217  if (myViewNet) {
2219  }
2220  return 1;
2221 }
2222 
2223 
2224 long
2225 GNEApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
2226  // check that view exists
2227  if (myViewNet) {
2229  }
2230  return 1;
2231 }
2232 
2233 
2234 long
2235 GNEApplicationWindow::onCmdEditViewScheme(FXObject*, FXSelector, void*) {
2236  // check that view exists
2237  if (myViewNet) {
2239  }
2240  return 1;
2241 }
2242 
2243 
2244 long
2245 GNEApplicationWindow::onCmdToogleGrid(FXObject* obj, FXSelector sel, void* ptr) {
2246  // check that view exists
2247  if (myViewNet) {
2248  // Toogle getMenuCheckShowGrid of GNEViewNet
2249  if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) {
2250  myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE);
2251  // show extra information for tests
2252  WRITE_DEBUG("Disabled grid throught Ctrl+g hotkey");
2253  } else {
2255  // show extra information for tests
2256  WRITE_WARNING("Enabled grid throught Ctrl+g hotkey");
2257  }
2258  // Call manually show grid function
2259  myViewNet->onCmdToogleShowGrid(obj, sel, ptr);
2260  }
2261  return 1;
2262 }
2263 
2264 
2265 long
2266 GNEApplicationWindow::onCmdToogleEditOptions(FXObject* obj, FXSelector sel, void* ptr) {
2267  // first check that we have a ViewNet
2268  if (myViewNet) {
2269  // first check what selector was called
2270  int numericalKeyPressed = sel - FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOOGLEEDITOPTION) - 1;
2271  // check that numericalKeyPressed is valid
2272  if ((numericalKeyPressed < 0) || (numericalKeyPressed > 10)) {
2273  return 1;
2274  }
2275  // declare a vector in which save visible menu commands
2276  std::vector<FXMenuCheck*> visibleMenuCommands;
2277  // get common, network and demand visible menu commands
2281  // now check that numericalKeyPressed isn't greather than visible view options
2282  if (numericalKeyPressed >= (int)visibleMenuCommands.size()) {
2283  return 1;
2284  }
2285  // finally function correspond to visibleMenuCommands[numericalKeyPressed]
2286  if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getCommonViewOptions().menuCheckShowGrid) {
2287  // Toogle menuCheckShowGrid
2288  if (myViewNet->getCommonViewOptions().menuCheckShowGrid->getCheck() == TRUE) {
2289  myViewNet->getCommonViewOptions().menuCheckShowGrid->setCheck(FALSE);
2290  // show extra information for tests
2291  WRITE_DEBUG("Disabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1));
2292  } else {
2294  // show extra information for tests
2295  WRITE_DEBUG("Enabled toogle show grid throught alt + " + toString(numericalKeyPressed + 1));
2296  }
2297  // Call manually onCmdToogleShowGrid
2298  return myViewNet->onCmdToogleShowGrid(obj, sel, ptr);
2299  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowDemandElements) {
2300  // Toogle menuCheckShowDemandElements
2301  if (myViewNet->getNetworkViewOptions().menuCheckShowDemandElements->getCheck() == TRUE) {
2303  // show extra information for tests
2304  WRITE_DEBUG("Disabled show demand elements throught alt + " + toString(numericalKeyPressed + 1));
2305  } else {
2307  // show extra information for tests
2308  WRITE_DEBUG("Enabled show demand elements throught alt + " + toString(numericalKeyPressed + 1));
2309  }
2310  // Call manually onCmdToogleShowDemandElements
2311  return myViewNet->onCmdToogleShowDemandElements(obj, sel, ptr);
2312  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckSelectEdges) {
2313  // Toogle menuCheckSelectEdges
2314  if (myViewNet->getNetworkViewOptions().menuCheckSelectEdges->getCheck() == TRUE) {
2316  // show extra information for tests
2317  WRITE_DEBUG("Disabled select edges throught alt + " + toString(numericalKeyPressed + 1));
2318  } else {
2320  // show extra information for tests
2321  WRITE_DEBUG("Enabled select edges throught alt + " + toString(numericalKeyPressed + 1));
2322  }
2323  // Call manually onCmdToogleSelectEdges
2324  return myViewNet->onCmdToogleSelectEdges(obj, sel, ptr);
2325  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowConnections) {
2326  // Toogle menuCheckShowConnections
2327  if (myViewNet->getNetworkViewOptions().menuCheckShowConnections->getCheck() == TRUE) {
2329  // show extra information for tests
2330  WRITE_DEBUG("Disabled show connections throught alt + " + toString(numericalKeyPressed + 1));
2331  } else {
2333  // show extra information for tests
2334  WRITE_DEBUG("Enabled show connections throught alt + " + toString(numericalKeyPressed + 1));
2335  }
2336  // Call manually onCmdToogleShowConnections
2337  return myViewNet->onCmdToogleShowConnections(obj, sel, ptr);
2338  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckHideConnections) {
2339  // Toogle menuCheckHideConnections
2340  if (myViewNet->getNetworkViewOptions().menuCheckHideConnections->getCheck() == TRUE) {
2342  // show extra information for tests
2343  WRITE_DEBUG("Disabled hide connections throught alt + " + toString(numericalKeyPressed + 1));
2344  } else {
2346  // show extra information for tests
2347  WRITE_DEBUG("Enabled hide connections throught alt + " + toString(numericalKeyPressed + 1));
2348  }
2349  // Call manually onCmdToogleHideConnections
2350  return myViewNet->onCmdToogleHideConnections(obj, sel, ptr);
2351  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckExtendSelection) {
2352  // Toogle menuCheckExtendSelection
2353  if (myViewNet->getNetworkViewOptions().menuCheckExtendSelection->getCheck() == TRUE) {
2355  // show extra information for tests
2356  WRITE_DEBUG("Disabled extend selection throught alt + " + toString(numericalKeyPressed + 1));
2357  } else {
2359  // show extra information for tests
2360  WRITE_DEBUG("Enabled extend selection throught alt + " + toString(numericalKeyPressed + 1));
2361  }
2362  // Call manually onCmdToogleExtendSelection
2363  return myViewNet->onCmdToogleExtendSelection(obj, sel, ptr);
2364  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases) {
2365  // Toogle menuCheckChangeAllPhases
2366  if (myViewNet->getNetworkViewOptions().menuCheckChangeAllPhases->getCheck() == TRUE) {
2368  // show extra information for tests
2369  WRITE_DEBUG("Disabled change all phases throught alt + " + toString(numericalKeyPressed + 1));
2370  } else {
2372  // show extra information for tests
2373  WRITE_DEBUG("Enabled change all phases throught alt + " + toString(numericalKeyPressed + 1));
2374  }
2375  // Call manually onCmdToogleChangeAllPhases
2376  return myViewNet->onCmdToogleChangeAllPhases(obj, sel, ptr);
2377  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge) {
2378  // Toogle menuCheckWarnAboutMerge
2379  if (myViewNet->getNetworkViewOptions().menuCheckWarnAboutMerge->getCheck() == TRUE) {
2381  // show extra information for tests
2382  WRITE_DEBUG("Disabled warn about merge throught alt + " + toString(numericalKeyPressed + 1));
2383  } else {
2385  // show extra information for tests
2386  WRITE_DEBUG("Enabled warn about merge throught alt + " + toString(numericalKeyPressed + 1));
2387  }
2388  // Call manually onCmdToogleWarnAboutMerge
2389  return myViewNet->onCmdToogleWarnAboutMerge(obj, sel, ptr);
2390  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble) {
2391  // Toogle menuCheckShowJunctionBubble
2392  if (myViewNet->getNetworkViewOptions().menuCheckShowJunctionBubble->getCheck() == TRUE) {
2394  // show extra information for tests
2395  WRITE_DEBUG("Disabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1));
2396  } else {
2398  // show extra information for tests
2399  WRITE_DEBUG("Enabled show junction as bubble throught alt + " + toString(numericalKeyPressed + 1));
2400  }
2401  // Call manually onCmdToogleShowJunctionBubble
2402  return myViewNet->onCmdToogleShowJunctionBubbles(obj, sel, ptr);
2403  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckMoveElevation) {
2404  // Toogle menuCheckMoveElevation
2405  if (myViewNet->getNetworkViewOptions().menuCheckMoveElevation->getCheck() == TRUE) {
2407  // show extra information for tests
2408  WRITE_DEBUG("Disabled move elevation throught alt + " + toString(numericalKeyPressed + 1));
2409  } else {
2411  // show extra information for tests
2412  WRITE_DEBUG("Enabled move elevation throught alt + " + toString(numericalKeyPressed + 1));
2413  }
2414  // Call manually onCmdToogleMoveElevation
2415  return myViewNet->onCmdToogleMoveElevation(obj, sel, ptr);
2416  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckChainEdges) {
2417  // Toogle menuCheckChainEdges
2418  if (myViewNet->getNetworkViewOptions().menuCheckChainEdges->getCheck() == TRUE) {
2420  // show extra information for tests
2421  WRITE_DEBUG("Disabled chain edges throught alt + " + toString(numericalKeyPressed + 1));
2422  } else {
2424  // show extra information for tests
2425  WRITE_DEBUG("Enabled chain edges throught alt + " + toString(numericalKeyPressed + 1));
2426  }
2427  // Call manually onCmdToogleChainEdges
2428  return myViewNet->onCmdToogleChainEdges(obj, sel, ptr);
2429  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge) {
2430  // Toogle menuCheckAutoOppositeEdge
2431  if (myViewNet->getNetworkViewOptions().menuCheckAutoOppositeEdge->getCheck() == TRUE) {
2433  // show extra information for tests
2434  WRITE_DEBUG("Disabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1));
2435  } else {
2437  // show extra information for tests
2438  WRITE_DEBUG("Enabled auto opposite edge throught alt + " + toString(numericalKeyPressed + 1));
2439  }
2440  // Call manually onCmdToogleAutoOppositeEdge
2441  return myViewNet->onCmdToogleAutoOppositeEdge(obj, sel, ptr);
2442  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideShapes) {
2443  // Toogle menuCheckHideShapes
2444  if (myViewNet->getDemandViewOptions().menuCheckHideShapes->getCheck() == TRUE) {
2446  // show extra information for tests
2447  WRITE_DEBUG("Disabled hide shapes throught alt + " + toString(numericalKeyPressed + 1));
2448  } else {
2450  // show extra information for tests
2451  WRITE_DEBUG("Enabled hide shapes throught alt + " + toString(numericalKeyPressed + 1));
2452  }
2453  // Call manually onCmdToogleHideNonInspecteDemandElements
2454  return myViewNet->onCmdToogleHideShapes(obj, sel, ptr);
2455  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckHideNonInspectedDemandElements) {
2456  // Toogle menuCheckHideNonInspectedDemandElements
2459  // show extra information for tests
2460  WRITE_DEBUG("Disabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1));
2461  } else {
2463  // show extra information for tests
2464  WRITE_DEBUG("Enabled hide non inspected demand elements throught alt + " + toString(numericalKeyPressed + 1));
2465  }
2466  // Call manually onCmdToogleHideNonInspecteDemandElements
2467  return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr);
2468  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans) {
2469  // Toogle menuCheckShowAllPersonPlans
2470  if (myViewNet->getDemandViewOptions().menuCheckShowAllPersonPlans->getCheck() == TRUE) {
2472  // show extra information for tests
2473  WRITE_DEBUG("Disabled show all person plans throught alt + " + toString(numericalKeyPressed + 1));
2474  } else {
2476  // show extra information for tests
2477  WRITE_DEBUG("Enabled show all person plans throught alt + " + toString(numericalKeyPressed + 1));
2478  }
2479  // Call manually onCmdToogleHideNonInspecteDemandElements
2480  return myViewNet->onCmdToogleHideNonInspecteDemandElements(obj, sel, ptr);
2481  } else if (visibleMenuCommands.at(numericalKeyPressed) == myViewNet->getDemandViewOptions().menuCheckLockPerson) {
2482  // Toogle menuCheckShowAllPersonPlans
2483  if (myViewNet->getDemandViewOptions().menuCheckLockPerson->getCheck() == TRUE) {
2485  // show extra information for tests
2486  WRITE_DEBUG("Disabled lock person plan throught alt + " + toString(numericalKeyPressed + 1));
2487  } else {
2489  // show extra information for tests
2490  WRITE_DEBUG("Enabled lock person plan throught alt + " + toString(numericalKeyPressed + 1));
2491  }
2492  // Call manually onCmdToogleHideNonInspecteDemandElements
2493  return myViewNet->onCmdToogleLockPerson(obj, sel, ptr);
2494  } else {
2495  // nothing to toogle
2496  return 1;
2497  }
2498  }
2499  return 1;
2500 }
2501 
2502 
2503 long
2504 GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
2505  FXLinkLabel::fxexecute("https://sumo.dlr.de/docs/NETEDIT.html");
2506  return 1;
2507 }
2508 
2509 
2510 long
2511 GNEApplicationWindow::onCmdOptions(FXObject*, FXSelector, void*) {
2512  GUIDialog_Options* wizard =
2513  new GUIDialog_Options(this, "Configure Options", getWidth(), getHeight());
2514 
2515  if (wizard->execute()) {
2516  NIFrame::checkOptions(); // needed to set projection parameters
2519  SystemFrame::checkOptions(); // needed to set precision
2520  }
2521  return 1;
2522 }
2523 
2524 
2525 long
2526 GNEApplicationWindow::onCmdUndo(FXObject*, FXSelector, void*) {
2527  WRITE_DEBUG("Keys Ctrl+Z (Undo) pressed");
2528  // Undo needs a viewnet and a enabled undoLastChange menu command
2529  if (myViewNet && myEditMenuCommands.undoLastChange->isEnabled()) {
2530  myViewNet->getUndoList()->undo();
2531  // update current show frame after undo
2534  }
2535  // update manually undo/redo menu commands (see #6005)
2538  // update toolbar undo-redo buttons
2540  }
2541  return 1;
2542 }
2543 
2544 
2545 long
2546 GNEApplicationWindow::onCmdRedo(FXObject*, FXSelector, void*) {
2547  WRITE_DEBUG("Keys Ctrl+Y (Redo) pressed");
2548  // redo needs a viewnet and a enabled redoLastChange menu command
2549  if (myViewNet && myEditMenuCommands.redoLastChange->isEnabled()) {
2550  myViewNet->getUndoList()->redo();
2551  // update current show frame after redo
2554  }
2555  // update manually undo/redo menu commands (see #6005)
2558  // update toolbar undo-redo buttons
2560  }
2561  return 1;
2562 }
2563 
2564 
2565 
2566 long
2567 GNEApplicationWindow::onCmdCut(FXObject*, FXSelector, void*) {
2568  WRITE_DEBUG("Key Ctrl+X (Cut) pressed");
2569  // Prepared for #6042
2570  return 1;
2571 }
2572 
2573 
2574 long
2575 GNEApplicationWindow::onCmdCopy(FXObject*, FXSelector, void*) {
2576  WRITE_DEBUG("Key Ctrl+C (Copy) pressed");
2577  // Prepared for #6042
2578  return 1;
2579 }
2580 
2581 
2582 long
2583 GNEApplicationWindow::onCmdPaste(FXObject*, FXSelector, void*) {
2584  WRITE_DEBUG("Key Ctrl+V (Paste) pressed");
2585  // Prepared for #6042
2586  return 1;
2587 }
2588 
2589 
2590 long
2591 GNEApplicationWindow::onCmdSetTemplate(FXObject*, FXSelector, void*) {
2592  WRITE_DEBUG("Key Ctrl+F1 (Set Template) pressed");
2593  // first check if myViewNet exist
2594  if (myViewNet) {
2595  // call set template in inspector frame
2597  }
2598  return 1;
2599 }
2600 
2601 
2602 long
2603 GNEApplicationWindow::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
2604  WRITE_DEBUG("Key Ctrl+F2 (Copy Template) pressed");
2605  // first check if myViewNet exist
2606  if (myViewNet) {
2607  // call copy template in inspector frame
2609  }
2610  return 1;
2611 }
2612 
2613 
2614 long
2615 GNEApplicationWindow::onCmdClearTemplate(FXObject*, FXSelector, void*) {
2616  WRITE_DEBUG("Key Ctrl+F3 (Clear Template) pressed");
2617  // first check if myViewNet exist
2618  if (myViewNet) {
2619  // call clear template in inspector frame
2621  }
2622  return 1;
2623 }
2624 
2625 
2626 long
2627 GNEApplicationWindow::onCmdSaveAsNetwork(FXObject*, FXSelector, void*) {
2628  FXString file = MFXUtils::getFilename2Write(this,
2629  "Save Network as", ".net.xml",
2631  gCurrentFolder);
2632  // add xml extension
2633  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".net.xml");
2634  // check that file with extension is valid
2635  if (fileWithExtension != "") {
2637  oc.resetWritable();
2638  oc.set("output-file", fileWithExtension);
2639  setTitle(MFXUtils::getTitleText(myTitlePrefix, fileWithExtension.c_str()));
2640  onCmdSaveNetwork(nullptr, 0, nullptr);
2641  }
2642  return 1;
2643 }
2644 
2645 
2646 long
2647 GNEApplicationWindow::onCmdSaveAsPlainXML(FXObject*, FXSelector, void*) {
2648  FXString file = MFXUtils::getFilename2Write(this,
2649  "Select name of the plain-xml edge-file (other names will be deduced from this)", "",
2651  gCurrentFolder);
2652  // check that file is valid (note: in this case we don't need to use function FileHelpers::addExtension)
2653  if (file != "") {
2655  bool wasSet = oc.isSet("plain-output-prefix");
2656  std::string oldPrefix = oc.getString("plain-output-prefix");
2657  std::string prefix = file.text();
2658  // if the name of an edg.xml file was given, remove the suffix
2659  if (StringUtils::endsWith(prefix, ".edg.xml")) {
2660  prefix = prefix.substr(0, prefix.size() - 8);
2661  }
2662  if (StringUtils::endsWith(prefix, ".")) {
2663  prefix = prefix.substr(0, prefix.size() - 1);
2664  }
2665  oc.resetWritable();
2666  oc.set("plain-output-prefix", prefix);
2667  getApp()->beginWaitCursor();
2668  try {
2669  myNet->savePlain(oc);
2670  myUndoList->unmark();
2671  myUndoList->mark();
2672  } catch (IOError& e) {
2673  // write warning if netedit is running in testing mode
2674  WRITE_DEBUG("Opening FXMessageBox 'Error saving plainXML'");
2675  // open message box
2676  FXMessageBox::error(this, MBOX_OK, "Saving plain xml failed!", "%s", e.what());
2677  // write warning if netedit is running in testing mode
2678  WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
2679  }
2680  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Plain XML saved with prefix '" + prefix + "'.\n");
2682  if (wasSet) {
2683  oc.resetWritable();
2684  oc.set("plain-output-prefix", oldPrefix);
2685  } else {
2686  oc.unSet("plain-output-prefix");
2687  }
2688  getApp()->endWaitCursor();
2689  }
2690  return 1;
2691 }
2692 
2693 
2694 long
2695 GNEApplicationWindow::onCmdSaveJoined(FXObject*, FXSelector, void*) {
2696  FXString file = MFXUtils::getFilename2Write(this,
2697  "Select name of the joined-junctions file", ".nod.xml",
2699  gCurrentFolder);
2700  // add xml extension
2701  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2702  // check that file with extension is valid
2703  if (fileWithExtension != "") {
2705  bool wasSet = oc.isSet("junctions.join-output");
2706  std::string oldFile = oc.getString("junctions.join-output");
2707  oc.resetWritable();
2708  oc.set("junctions.join-output", fileWithExtension);
2709  getApp()->beginWaitCursor();
2710  try {
2711  myNet->saveJoined(oc);
2712  } catch (IOError& e) {
2713  // write warning if netedit is running in testing mode
2714  WRITE_DEBUG("Opening FXMessageBox 'error saving joined'");
2715  // opening error message
2716  FXMessageBox::error(this, MBOX_OK, "Saving joined junctions failed!", "%s", e.what());
2717  // write warning if netedit is running in testing mode
2718  WRITE_DEBUG("Closed FXMessageBox 'error saving joined' with 'OK'");
2719  }
2720  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Joined junctions saved to '" + fileWithExtension + "'.\n");
2722  if (wasSet) {
2723  oc.resetWritable();
2724  oc.set("junctions.join-output", oldFile);
2725  } else {
2726  oc.unSet("junctions.join-output");
2727  }
2728  getApp()->endWaitCursor();
2729  }
2730  return 1;
2731 }
2732 
2733 
2734 long
2735 GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
2736  sender->handle(this, myNet == nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2737  return 1;
2738 }
2739 
2740 
2741 long
2742 GNEApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void*) {
2743  sender->handle(this, ((myNet == nullptr) || !OptionsCont::getOptions().isSet("sumo-net-file")) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2744  return 1;
2745 }
2746 
2747 long
2748 GNEApplicationWindow::onUpdSaveAdditionals(FXObject* sender, FXSelector, void*) {
2749  sender->handle(this, ((myNet == nullptr) || myNet->isAdditionalsSaved()) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2750  return 1;
2751 }
2752 
2753 
2754 long
2755 GNEApplicationWindow::onUpdSaveDemandElements(FXObject* sender, FXSelector, void*) {
2756  sender->handle(this, ((myNet == nullptr) || myNet->isDemandElementsSaved()) ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2757  return 1;
2758 }
2759 
2760 
2761 long
2762 GNEApplicationWindow::onUpdUndo(FXObject* obj, FXSelector sel, void* ptr) {
2763  return myUndoList->p_onUpdUndo(obj, sel, ptr);
2764 }
2765 
2766 
2767 long
2768 GNEApplicationWindow::onUpdRedo(FXObject* obj, FXSelector sel, void* ptr) {
2769  return myUndoList->p_onUpdRedo(obj, sel, ptr);
2770 }
2771 
2772 
2773 long
2774 GNEApplicationWindow::onCmdSaveNetwork(FXObject*, FXSelector, void*) {
2776  // function onCmdSaveAsNetwork must be executed if this is the first save
2777  if (oc.getString("output-file") == "" || oc.isDefault("output-file")) {
2778  return onCmdSaveAsNetwork(nullptr, 0, nullptr);
2779  } else {
2780  getApp()->beginWaitCursor();
2781  try {
2782  myNet->save(oc);
2783  myUndoList->unmark();
2784  myUndoList->mark();
2785  } catch (IOError& e) {
2786  // write warning if netedit is running in testing mode
2787  WRITE_DEBUG("Opening FXMessageBox 'error saving network'");
2788  // open error message box
2789  FXMessageBox::error(this, MBOX_OK, "Saving Network failed!", "%s", e.what());
2790  // write warning if netedit is running in testing mode
2791  WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'");
2792  }
2793  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Network saved in " + oc.getString("output-file") + ".\n");
2794  // After saveing a net sucesfully, add it into Recent Nets list.
2795  myMenuBarFile.myRecentNets.appendFile(oc.getString("output-file").c_str());
2797  getApp()->endWaitCursor();
2798  return 1;
2799  }
2800 }
2801 
2802 
2803 long
2804 GNEApplicationWindow::onCmdSaveAdditionals(FXObject*, FXSelector, void*) {
2805  // obtain option container
2807  // check if save additional menu is enabled
2808  if (myFileMenuCommands.saveAdditionals->isEnabled()) {
2809  // Check if additionals file was already set at start of netedit or with a previous save
2810  if (oc.getString("additional-files").empty()) {
2811  FXString file = MFXUtils::getFilename2Write(this,
2812  "Select name of the additional file", ".add.xml",
2814  gCurrentFolder);
2815  // add xml extension
2816  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".add.xml");
2817  // check tat file is valid
2818  if (fileWithExtension != "") {
2819  // change value of "additional-files"
2820  oc.resetWritable();
2821  oc.set("additional-files", fileWithExtension);
2822  } else {
2823  // None additionals file was selected, then stop function
2824  return 0;
2825  }
2826  }
2827  // Start saving additionals
2828  getApp()->beginWaitCursor();
2829  try {
2830  myNet->saveAdditionals(oc.getString("additional-files"));
2831  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Additionals saved in " + oc.getString("additional-files") + ".\n");
2833  } catch (IOError& e) {
2834  // write warning if netedit is running in testing mode
2835  WRITE_DEBUG("Opening FXMessageBox 'error saving additionals'");
2836  // open error message box
2837  FXMessageBox::error(this, MBOX_OK, "Saving additionals failed!", "%s", e.what());
2838  // write warning if netedit is running in testing mode
2839  WRITE_DEBUG("Closed FXMessageBox 'error saving additionals' with 'OK'");
2840  }
2842  getApp()->endWaitCursor();
2843  return 1;
2844  } else {
2845  return 0;
2846  }
2847 }
2848 
2849 
2850 long
2851 GNEApplicationWindow::onCmdSaveAdditionalsAs(FXObject*, FXSelector, void*) {
2852  // Open window to select additional file
2853  FXString file = MFXUtils::getFilename2Write(this,
2854  "Select name of the additional file", ".add.xml",
2856  gCurrentFolder);
2857  // add xml extension
2858  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".add.xml");
2859  // check tat file is valid
2860  if (fileWithExtension != "") {
2861  // reset writtable flag
2863  // change value of "additional-files"
2864  OptionsCont::getOptions().set("additional-files", fileWithExtension);
2865  // change flag of menu command for save additionals
2867  // save additionals
2868  return onCmdSaveAdditionals(nullptr, 0, nullptr);
2869  } else {
2870  return 1;
2871  }
2872 }
2873 
2874 
2875 long
2876 GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject*, FXSelector, void*) {
2877  // obtain option container
2879  // check if save additional menu is enabled
2880  if (myFileMenuCommands.saveTLSPrograms->isEnabled()) {
2881  // Check if TLS Programs file was already set at start of netedit or with a previous save
2882  if (oc.getString("TLSPrograms-output").empty()) {
2883  FXString file = MFXUtils::getFilename2Write(this,
2884  "Select name of the TLS file", ".xml",
2886  gCurrentFolder);
2887  // add xml extension
2888  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2889  // check tat file is valid
2890  if (file == "") {
2891  // None TLS Programs file was selected, then stop function
2892  return 0;
2893  } else {
2894  // change value of "TLSPrograms-output"
2895  oc.resetWritable();
2896  oc.set("TLSPrograms-output", fileWithExtension);
2897  }
2898  }
2899  // Start saving TLS Programs
2900  getApp()->beginWaitCursor();
2901  try {
2902  myNet->saveTLSPrograms(oc.getString("TLSPrograms-output"));
2903  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "TLS Programs saved in " + oc.getString("TLSPrograms-output") + ".\n");
2905  } catch (IOError& e) {
2906  // write warning if netedit is running in testing mode
2907  WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'");
2908  // open error message box
2909  FXMessageBox::error(this, MBOX_OK, "Saving TLS Programs failed!", "%s", e.what());
2910  // write warning if netedit is running in testing mode
2911  WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
2912  }
2914  getApp()->endWaitCursor();
2915  return 1;
2916  } else {
2917  return 0;
2918  }
2919 }
2920 
2921 
2922 long
2923 GNEApplicationWindow::onCmdSaveTLSProgramsAs(FXObject*, FXSelector, void*) {
2924  // Open window to select TLS Programs file
2925  FXString file = MFXUtils::getFilename2Write(this,
2926  "Select name of the TLS Progarm file", ".xml",
2928  gCurrentFolder);
2929  // add xml extension
2930  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".xml");
2931  // check tat file is valid
2932  if (fileWithExtension != "") {
2933  // change value of "TLSPrograms-files"
2934  OptionsCont::getOptions().set("TLSPrograms-output", fileWithExtension);
2935  // save TLS Programs
2936  return onCmdSaveTLSPrograms(nullptr, 0, nullptr);
2937  } else {
2938  return 1;
2939  }
2940 }
2941 
2942 
2943 long
2944 GNEApplicationWindow::onCmdSaveDemandElements(FXObject*, FXSelector, void*) {
2945  // obtain option container
2947  // check if save demand element menu is enabled
2948  if (myFileMenuCommands.saveDemandElements->isEnabled()) {
2949  // Check if demand elements file was already set at start of netedit or with a previous save
2950  if (oc.getString("route-files").empty()) {
2951  FXString file = MFXUtils::getFilename2Write(this,
2952  "Select name of the demand element file", ".rou.xml",
2954  gCurrentFolder);
2955  // add xml extension
2956  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml");
2957  // check tat file is valid
2958  if (fileWithExtension != "") {
2959  // change value of "route-files"
2960  oc.resetWritable();
2961  oc.set("route-files", fileWithExtension);
2962  } else {
2963  // None demand elements file was selected, then stop function
2964  return 0;
2965  }
2966  }
2967  // Start saving demand elements
2968  getApp()->beginWaitCursor();
2969  try {
2970  myNet->saveDemandElements(oc.getString("route-files"));
2971  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURRED, "Demand elements saved in " + oc.getString("route-files") + ".\n");
2973  } catch (IOError& e) {
2974  // write warning if netedit is running in testing mode
2975  WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
2976  // open error message box
2977  FXMessageBox::error(this, MBOX_OK, "Saving demand elements failed!", "%s", e.what());
2978  // write warning if netedit is running in testing mode
2979  WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
2980  }
2982  getApp()->endWaitCursor();
2983  return 1;
2984  } else {
2985  return 0;
2986  }
2987 }
2988 
2989 
2990 long
2992  // Open window to select additionasl file
2993  FXString file = MFXUtils::getFilename2Write(this,
2994  "Select name of the demand element file", ".rou.xml",
2996  gCurrentFolder);
2997  // add xml extension
2998  std::string fileWithExtension = FileHelpers::addExtension(file.text(), ".rou.xml");
2999  // check that file is correct
3000  if (fileWithExtension != "") {
3001  // reset writtable flag
3003  // change value of "route-files"
3004  OptionsCont::getOptions().set("route-files", fileWithExtension);
3005  // change flag of menu command for save demand elements
3007  // save demand elements
3008  return onCmdSaveDemandElements(nullptr, 0, nullptr);
3009  } else {
3010  return 1;
3011  }
3012 }
3013 
3014 
3015 long
3016 GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
3018  bool enable = myNet != nullptr && oc.isSet("output-file");
3019  sender->handle(this, FXSEL(SEL_COMMAND, enable ? ID_ENABLE : ID_DISABLE), nullptr);
3020  if (enable) {
3021  FXString caption = ("Save " + oc.getString("output-file")).c_str();
3022  sender->handle(this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (void*)&caption);
3023  }
3024  return 1;
3025 }
3026 
3027 
3028 bool
3030  FXuint answer = 0;
3031  if (myViewNet && myNet && !myNet->isNetSaved()) {
3032  // write warning if netedit is running in testing mode
3033  WRITE_DEBUG("Opening FXMessageBox 'Confirm " + operation + " network'");
3034  // open question box
3035  answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
3036  ("Confirm " + operation + " Network").c_str(), "%s",
3037  ("You have unsaved changes in the network. Do you wish to " + operation + " and discard all changes?").c_str());
3038  // restore focus to view net
3039  myViewNet->setFocus();
3040  // if user close dialog box, check additionals and demand elements
3041  if (answer == MBOX_CLICKED_QUIT) {
3042  // write warning if netedit is running in testing mode
3043  WRITE_DEBUG("Closed FXMessageBox 'Confirm " + operation + " network' with 'Quit'");
3045  // clear undo list and return true to continue with closing/reload
3046  myUndoList->p_clear();
3047  return true;
3048  } else {
3049  return false;
3050  }
3051  } else if (answer == MBOX_CLICKED_SAVE) {
3052  // save newtork
3053  onCmdSaveNetwork(nullptr, 0, nullptr);
3054  if (!myUndoList->marked()) {
3055  // saving failed
3056  return false;
3057  }
3059  // clear undo list and return true to continue with closing/reload
3060  myUndoList->p_clear();
3061  return true;
3062  } else {
3063  return false;
3064  }
3065  } else {
3066  // write warning if netedit is running in testing mode
3067  if (answer == 2) {
3068  WRITE_DEBUG("Closed FXMessageBox 'Confirm " + operation + " network' with 'No'");
3069  } else if (answer == 4) {
3070  WRITE_DEBUG("Closed FXMessageBox 'Confirm " + operation + " network' with 'ESC'");
3071  }
3072  // return false to stop closing/reloading
3073  return false;
3074  }
3075  } else {
3077  // clear undo list and return true to continue with closing/reload
3078  myUndoList->p_clear(); //only ask once
3079  return true;
3080  } else {
3081  // return false to stop closing/reloading
3082  return false;
3083  }
3084  }
3085 }
3086 
3087 
3088 bool
3090  // Check if there are non saved additionals
3091  if (myViewNet && myFileMenuCommands.saveAdditionals->isEnabled()) {
3092  WRITE_DEBUG("Opening FXMessageBox 'Save additionals before " + operation + "'");
3093  // open question box
3094  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
3095  ("Save additionals before " + operation).c_str(), "%s",
3096  ("You have unsaved additionals. Do you wish to " + operation + " and discard all changes?").c_str());
3097  // restore focus to view net
3098  myViewNet->setFocus();
3099  // if answer was affirmative, but there was an error during saving additionals, return false to stop closing/reloading
3100  if (answer == MBOX_CLICKED_QUIT) {
3101  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before " + operation + "' with 'Quit'");
3102  // nothing to save, return true
3103  return true;
3104  } else if (answer == MBOX_CLICKED_SAVE) {
3105  // write warning if netedit is running in testing mode
3106  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before " + operation + "' with 'Yes'");
3107  if (onCmdSaveAdditionals(nullptr, 0, nullptr) == 1) {
3108  // additionals sucesfully saved
3109  return true;
3110  } else {
3111  // error saving additionals, abort saving
3112  return false;
3113  }
3114  } else {
3115  // write warning if netedit is running in testing mode
3116  if (answer == 2) {
3117  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before " + operation + "' with 'No'");
3118  } else if (answer == 4) {
3119  WRITE_DEBUG("Closed FXMessageBox 'Save additionals before " + operation + "' with 'ESC'");
3120  }
3121  // abort saving
3122  return false;
3123  }
3124  } else {
3125  // nothing to save, return true
3126  return true;
3127  }
3128 }
3129 
3130 
3131 bool
3133  // Check if there are non saved demand elements
3134  if (myViewNet && myFileMenuCommands.saveDemandElements->isEnabled()) {
3135  WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before " + operation + "'");
3136  // open question box
3137  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
3138  ("Save demand elements before " + operation).c_str(), "%s",
3139  ("You have unsaved demand elements. Do you wish to " + operation + " and discard all changes?").c_str());
3140  // restore focus to view net
3141  myViewNet->setFocus();
3142  // if answer was affirmative, but there was an error during saving demand elements, return false to stop closing/reloading
3143  if (answer == MBOX_CLICKED_QUIT) {
3144  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before " + operation + "' with 'Quit'");
3145  // nothing to save, return true
3146  return true;
3147  } else if (answer == MBOX_CLICKED_SAVE) {
3148  // write warning if netedit is running in testing mode
3149  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before " + operation + "' with 'Yes'");
3150  if (onCmdSaveDemandElements(nullptr, 0, nullptr) == 1) {
3151  // demand elements sucesfully saved
3152  return true;
3153  } else {
3154  // error saving demand elements, abort saving
3155  return false;
3156  }
3157  } else {
3158  // write warning if netedit is running in testing mode
3159  if (answer == 2) {
3160  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before " + operation + "' with 'No'");
3161  } else if (answer == 4) {
3162  WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before " + operation + "' with 'ESC'");
3163  }
3164  // abort saving
3165  return false;
3166  }
3167  } else {
3168  // nothing to save, return true
3169  return true;
3170  }
3171 }
3172 
3173 
3174 void
3176  // check that view exists
3177  if (myViewNet) {
3179  }
3180 }
3181 
3182 
3183 void
3185  // cast supermode
3186  Supermode currentSupermode = static_cast<Supermode>(supermode);
3187  if (currentSupermode == Supermode::GNE_SUPERMODE_NETWORK) {
3192  } else if (currentSupermode == Supermode::GNE_SUPERMODE_DEMAND) {
3197  } else {
3202  }
3203 }
3204 
3205 
3206 void
3207 GNEApplicationWindow::disableUndoRedo(const std::string& reason) {
3208  myUndoRedoListEnabled = reason;
3209 }
3210 
3211 
3212 void
3214  myUndoRedoListEnabled.clear();
3215 }
3216 
3217 
3218 const std::string&
3220  return myUndoRedoListEnabled;
3221 }
3222 
3223 // ---------------------------------------------------------------------------
3224 // GNEApplicationWindow - protected methods
3225 // ---------------------------------------------------------------------------
3226 
3228  myToolbarsGrip(this),
3229  myMenuBarFile(this),
3230  myFileMenuCommands(this),
3231  myEditMenuCommands(this),
3233  myLocateMenuCommands(this),
3234  myWindowsMenuCommands(this),
3235  mySupermodeCommands(this) {
3236 }
3237 
3238 
3239 long
3240 GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
3241  const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
3242  if (handled == 0 && myMDIClient->numChildren() > 0) {
3243  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
3244  if (w != nullptr) {
3245  w->onKeyPress(nullptr, sel, eventData);
3246  }
3247  }
3248  return 0;
3249 }
3250 
3251 
3252 long
3253 GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
3254  const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
3255  if (handled == 0 && myMDIClient->numChildren() > 0) {
3256  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
3257  if (w != nullptr) {
3258  w->onKeyRelease(nullptr, sel, eventData);
3259  }
3260  }
3261  return 0;
3262 }
3263 
3264 /****************************************************************************/
MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS
@ MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS
save TLS Programs as
Definition: GUIAppEnum.h:575
MID_HOTKEY_ALT_2_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_2_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:127
MID_LOCATEPOI
@ MID_LOCATEPOI
Locate poi - button.
Definition: GUIAppEnum.h:338
ICON_REDO
@ ICON_REDO
Definition: GUIIcons.h:179
GUICompleteSchemeStorage.h
GNEApplicationWindow::onCmdQuit
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
Definition: GNEApplicationWindow.cpp:492
GNENet::requireSaveNet
void requireSaveNet(bool value)
inform that net has to be saved
Definition: GNENet.cpp:982
GUIPerspectiveChanger::getYPos
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
GNEApplicationWindow::MenuBarFile::MenuBarFile
MenuBarFile(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1027
GNEApplicationWindow::myToolbarsGrip
ToolbarsGrip myToolbarsGrip
Toolbars Grip.
Definition: GNEApplicationWindow.h:764
OptionsCont::isSet
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
Definition: OptionsCont.cpp:135
MID_LOCATETLS
@ MID_LOCATETLS
Locate TLS - button.
Definition: GUIAppEnum.h:334
GNEUndoList::p_clear
void p_clear()
clears the undo list (implies abort)
Definition: GNEUndoList.cpp:86
SysUtils::runHiddenCommand
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition: SysUtils.cpp:63
MID_HOTKEY_F4_SUPERMODE_DEMAND
@ MID_HOTKEY_F4_SUPERMODE_DEMAND
hot key <F4> set demand mode in NETEDIT
Definition: GUIAppEnum.h:171
GNEApplicationWindow::onCmdHelp
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
Definition: GNEApplicationWindow.cpp:2504
FXEX::SEL_THREAD
@ SEL_THREAD
Definition: fxexdefs.h:165
MID_LOCATEROUTE
@ MID_LOCATEROUTE
Locate route - button.
Definition: GUIAppEnum.h:328
MID_GNE_TOOLBAREDIT_LOADADDITIONALS
@ MID_GNE_TOOLBAREDIT_LOADADDITIONALS
load additionals in SUMO-GUI after press ctrl+T
Definition: GUIAppEnum.h:585
MID_HOTKEY_CTRL_I_EDITVIEWPORT
@ MID_HOTKEY_CTRL_I_EDITVIEWPORT
Open viewport editor.
Definition: GUIAppEnum.h:87
GUISUMOAbstractView::setViewportFromToRot
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
Definition: GUISUMOAbstractView.cpp:1366
GNEViewNetHelper::CommonViewOptions::menuCheckShowGrid
FXMenuCheck * menuCheckShowGrid
menu check to show grid button
Definition: GNEViewNetHelper.h:346
XMLSubSys::runParser
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
Definition: XMLSubSys.cpp:112
GUISUMOAbstractView::showViewportEditor
virtual void showViewportEditor()
show viewport editor
Definition: GUISUMOAbstractView.cpp:1357
ICON_MODEPERSONPLAN
@ ICON_MODEPERSONPLAN
Definition: GUIIcons.h:242
GNEApplicationWindow::myWindowsMenuCommands
WindowsMenuCommands myWindowsMenuCommands
Windows Menu Commands.
Definition: GNEApplicationWindow.h:782
GNEApplicationWindow::EditMenuCommands::buildEditMenuCommands
void buildEditMenuCommands(FXMenuPane *editMenu)
build edit menu commands
Definition: GNEApplicationWindow.cpp:1360
GNERouteHandler
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
Definition: GNERouteHandler.h:50
ICON_MODEVEHICLETYPE
@ ICON_MODEVEHICLETYPE
Definition: GUIIcons.h:238
GUIDesignToolBarGrip
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
Definition: GUIDesigns.h:307
NWFrame.h
GNEViewNet::onCmdToogleMoveElevation
long onCmdToogleMoveElevation(FXObject *, FXSelector, void *)
toogle move elevation
Definition: GNEViewNet.cpp:2300
GNEApplicationWindow::onClipboardRequest
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
Definition: GNEApplicationWindow.cpp:864
GNEApplicationWindow::EditMenuCommands::redoLastChange
FXMenuCommand * redoLastChange
FXMenuCommand for redo last change.
Definition: GNEApplicationWindow.h:623
GUIMainWindow::myCartesianFrame
FXHorizontalFrame * myCartesianFrame
Definition: GUIMainWindow.h:162
GNEApplicationWindow::myUndoRedoListEnabled
std::string myUndoRedoListEnabled
string to check if undo/redo list is enabled (a String is used to keep the disabling reason)
Definition: GNEApplicationWindow.h:444
GUIMainWindow::myGeoFrame
FXHorizontalFrame * myGeoFrame
Definition: GUIMainWindow.h:162
GUICursorSubSys.h
GNEViewNet::hotkeyFocusFrame
void hotkeyFocusFrame()
handle focus frame keypress
Definition: GNEViewNet.cpp:997
GNEApplicationWindow::myProcessingMenu
FXMenuPane * myProcessingMenu
Definition: GNEApplicationWindow.h:414
GNEApplicationWindow::ProcessingMenuCommands::showDemandProcessingMenuCommands
void showDemandProcessingMenuCommands()
show demand processing menu commands
Definition: GNEApplicationWindow.cpp:1496
GNEFrame::updateFrameAfterUndoRedo
virtual void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
Definition: GNEFrame.cpp:150
MID_HOTKEY_CTRL_J_SAVEJOINEDJUNCTIONS
@ MID_HOTKEY_CTRL_J_SAVEJOINEDJUNCTIONS
save joined junctions
Definition: GUIAppEnum.h:91
GUIMainWindow::storeWindowSizeAndPos
void storeWindowSizeAndPos()
record window position and size in registry
Definition: GUIMainWindow.cpp:241
GNEInspectorFrame::inspectSingleElement
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
Definition: GNEInspectorFrame.cpp:202
GNEApplicationWindow::loadOptionOnStartup
void loadOptionOnStartup()
load net on startup
Definition: GNEApplicationWindow.cpp:1783
MID_LOCATEEDGE
@ MID_LOCATEEDGE
Locate edge - button.
Definition: GUIAppEnum.h:324
GNEApplicationWindow::ToolbarsGrip::myToolBarShellMenu
FXToolBarShell * myToolBarShellMenu
menu bar drag (for file, edit, processing...)
Definition: GNEApplicationWindow.h:101
MID_HOTKEY_F12_FOCUSUPPERELEMENT
@ MID_HOTKEY_F12_FOCUSUPPERELEMENT
hot key <F12> focus upper element of current frame
Definition: GUIAppEnum.h:185
EVENT_MESSAGE_OCCURRED
@ EVENT_MESSAGE_OCCURRED
send when a message occured
Definition: GUIEvent.h:42
GNENet::cleanInvalidDemandElements
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition: GNENet.cpp:1899
MID_GNE_TOOLBAREDIT_LOADDEMAND
@ MID_GNE_TOOLBAREDIT_LOADDEMAND
load demand in SUMO-GUI after press ctrl+T
Definition: GUIAppEnum.h:587
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:275
MID_HOTKEY_ALT_7_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_7_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:137
GNEViewNet::onCmdToogleShowConnections
long onCmdToogleShowConnections(FXObject *, FXSelector, void *)
toogle show connections
Definition: GNEViewNet.cpp:2202
GNEViewNet::hotkeyBackSpace
void hotkeyBackSpace()
handle backspace keypress
Definition: GNEViewNet.cpp:980
ICON_SUPERMODENETWORK
@ ICON_SUPERMODENETWORK
Definition: GUIIcons.h:214
GNEApplicationWindow::loadConfigOrNet
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 *‍/
Definition: GNEApplicationWindow.cpp:1680
GUIMainWindow::myMDIClient
FXMDIClient * myMDIClient
The multi view panel.
Definition: GUIMainWindow.h:155
ICON_MODESELECT
@ ICON_MODESELECT
Definition: GUIIcons.h:228
GUIMainWindow::myTopDock
FXDockSite * myTopDock
Definition: GUIMainWindow.h:167
GNEApplicationWindow::onCmdOptions
long onCmdOptions(FXObject *, FXSelector, void *)
called if the user selects Processing->Configure Options
Definition: GNEApplicationWindow.cpp:2511
GNEViewParent::updateUndoRedoButtons
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
Definition: GNEViewParent.cpp:352
GUIMainWindow::myStatusbar
FXStatusBar * myStatusbar
The status bar.
Definition: GUIMainWindow.h:158
GNENet::computeNetwork
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:1457
MID_HOTKEY_ALT_8_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_8_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:139
GUICursorSubSys::initCursors
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
Definition: GUICursorSubSys.cpp:68
GNEViewNetHelper::DemandViewOptions::menuCheckShowAllPersonPlans
FXMenuCheck * menuCheckShowAllPersonPlans
show all person plans
Definition: GNEViewNetHelper.h:469
GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::NetworkMenuCommands
NetworkMenuCommands(const EditMenuCommands *editMenuCommandsParent)
constructor
Definition: GNEApplicationWindow.cpp:1168
GNEApplicationWindow::onCmdClose
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
Definition: GNEApplicationWindow.cpp:794
GNEViewNet::onCmdToogleWarnAboutMerge
long onCmdToogleWarnAboutMerge(FXObject *, FXSelector, void *)
toogle warn for merge
Definition: GNEViewNet.cpp:2276
ICON_CLEANJUNCTIONS
@ ICON_CLEANJUNCTIONS
Definition: GUIIcons.h:248
GUIMessageWindow
A logging window for the gui.
Definition: GUIMessageWindow.h:53
GNEApplicationWindow::onCmdEditViewScheme
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
Definition: GNEApplicationWindow.cpp:2235
GNEApplicationWindow::onCmdUndo
long onCmdUndo(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
Definition: GNEApplicationWindow.cpp:2526
GNEApplicationWindow::ToolbarsGrip::myGNEApp
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindow
Definition: GNEApplicationWindow.h:98
GUIPerspectiveChanger::getZPos
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
GNEViewNetHelper::NetworkViewOptions::menuCheckShowDemandElements
FXMenuCheck * menuCheckShowDemandElements
menu check to show Demand Elements
Definition: GNEViewNetHelper.h:387
GNEUndoList::p_end
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
Definition: GNEUndoList.cpp:79
GNEApplicationWindow::myViewNet
GNEViewNet * myViewNet
pointer to current view net
Definition: GNEApplicationWindow.h:788
GNEApplicationWindow::myMainSplitter
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
Definition: GNEApplicationWindow.h:423
GNEApplicationWindow::eventOccurred
void eventOccurred()
Definition: GNEApplicationWindow.cpp:880
ICON_MODETAZ
@ ICON_MODETAZ
Definition: GUIIcons.h:224
OptionsCont.h
OptionsCont::resetWritable
void resetWritable()
Resets all options to be writeable.
Definition: OptionsCont.cpp:441
GUISUMOAbstractView::showViewschemeEditor
void showViewschemeEditor()
show viewsscheme editor
Definition: GUISUMOAbstractView.cpp:1321
MID_HOTKEY_ALT_5_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_5_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:133
OptionsCont::set
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
Definition: OptionsCont.cpp:241
FXEX::FXBaseObject::setTarget
void setTarget(FXObject *tgt)
set the target
Definition: FXBaseObject.h:129
GUIDesignSplitterMDI
#define GUIDesignSplitterMDI
MDI Splitter.
Definition: GUIDesigns.h:334
FileHelpers::addExtension
static std::string addExtension(const std::string &path, const std::string &extension)
Add an extension to the given file path.
Definition: FileHelpers.cpp:86
GNEApplicationWindow::onUpdUndo
long onUpdUndo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall undo is executed
Definition: GNEApplicationWindow.cpp:2762
GNEViewNet::onCmdToogleSelectEdges
long onCmdToogleSelectEdges(FXObject *, FXSelector, void *)
toogle select edges
Definition: GNEViewNet.cpp:2192
GUISettingsHandler::getDecals
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
Definition: GUISettingsHandler.cpp:410
GNEApplicationWindow::onUpdSaveAdditionals
long onUpdSaveAdditionals(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals is executed
Definition: GNEApplicationWindow.cpp:2748
GNETAZFrame::TAZSelectionStatistics::getEdgeAndTAZChildrenSelected
const std::vector< TAZCurrent::TAZEdge > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
Definition: GNETAZFrame.cpp:893
ICON_SAVE
@ ICON_SAVE
Definition: GUIIcons.h:48
GUIDesignStatusBar
#define GUIDesignStatusBar
design used in status bar
Definition: GUIDesigns.h:304
GNETAZFrame::TAZSelectionStatistics::clearSelectedEdges
void clearSelectedEdges()
clear current TAZ children
Definition: GNETAZFrame.cpp:880
GNENet::saveJoined
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:1018
GNEViewNetHelper::DemandViewOptions::getVisibleDemandMenuCommands
void getVisibleDemandMenuCommands(std::vector< FXMenuCheck * > &commands) const
get visible demand menu commands
Definition: GNEViewNetHelper.cpp:1723
GNEApplicationWindow::myTitlePrefix
const FXString myTitlePrefix
the prefix for the window title
Definition: GNEApplicationWindow.h:791
GUIDesignToolbarMenuBarNetedit
#define GUIDesignToolbarMenuBarNetedit
design for top toolbar (file, edit, processing...) used only in netedit (due supermodes buttons)
Definition: GUIDesigns.h:292
GNEApplicationWindow::onCmdSaveDemandElementsAs
long onCmdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements as is executed
Definition: GNEApplicationWindow.cpp:2991
GNEApplicationWindow::LocateMenuCommands::LocateMenuCommands
LocateMenuCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1528
GNEApplicationWindow::ToolbarsGrip::buildViewParentToolbarsGrips
void buildViewParentToolbarsGrips()
build toolbars grips
Definition: GNEApplicationWindow.cpp:280
GUISettingsHandler::setSnapshots
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
Definition: GUISettingsHandler.cpp:392
GUIGlobalSelection.h
MID_HOTKEY_F1_ONLINEDOCUMENTATION
@ MID_HOTKEY_F1_ONLINEDOCUMENTATION
hot key <F1> open online documentation
Definition: GUIAppEnum.h:165
OptionsCont::getString
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
Definition: OptionsCont.cpp:201
GNEApplicationWindow::onCmdSaveDemandElements
long onCmdSaveDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements is executed
Definition: GNEApplicationWindow.cpp:2944
GNEApplicationWindow::myLoadThreadEvent
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
Definition: GNEApplicationWindow.h:429
GNEApplicationWindow::onCmdCopyTemplate
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2603
GUIMainWindow::myGLWindows
std::vector< GUIGlChildWindow * > myGLWindows
Definition: GUIMainWindow.h:146
ICON_JOINROUTES
@ ICON_JOINROUTES
Definition: GUIIcons.h:252
GNEApplicationWindow::onCmdToogleGrid
long onCmdToogleGrid(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + G to toogle grid
Definition: GNEApplicationWindow.cpp:2245
ICON_MODECREATEEDGE
@ ICON_MODECREATEEDGE
Definition: GUIIcons.h:222
GNEApplicationWindow::continueWithUnsavedAdditionalChanges
bool continueWithUnsavedAdditionalChanges(const std::string &operation)
warns about unsaved changes in additionals and gives the user the option to abort
Definition: GNEApplicationWindow.cpp:3089
GNEApplicationWindow::onCmdCopy
long onCmdCopy(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2575
GNEApplicationWindow::continueWithUnsavedDemandElementChanges
bool continueWithUnsavedDemandElementChanges(const std::string &operation)
warns about unsaved changes in demand elements and gives the user the option to abort
Definition: GNEApplicationWindow.cpp:3132
GNEApplicationWindow::onCmdFocusFrame
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits f
Definition: GNEApplicationWindow.cpp:2215
ICON_MODEADDITIONAL
@ ICON_MODEADDITIONAL
Definition: GUIIcons.h:220
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MID_HOTKEY_CTRL_C_COPY
@ MID_HOTKEY_CTRL_C_COPY
Copy the current selection / element.
Definition: GUIAppEnum.h:81
GNEApplicationWindow::onUpdReload
long onUpdReload(FXObject *, FXSelector, void *)
called when the update/FXCall reload is executed
Definition: GNEApplicationWindow.cpp:2742
MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS
@ MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS
Load file with TLS Programs.
Definition: GUIAppEnum.h:93
ICON_OPEN_NET
@ ICON_OPEN_NET
Definition: GUIIcons.h:43
GLHelper::resetFont
static void resetFont()
to be called when the font context is invalidated
Definition: GLHelper.cpp:638
MID_CLEARMESSAGEWINDOW
@ MID_CLEARMESSAGEWINDOW
Clear simulation output.
Definition: GUIAppEnum.h:304
GNEApplicationWindow::ProcessingMenuCommands::ProcessingMenuCommands
ProcessingMenuCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1407
MID_HOTKEY_CTRL_R_RELOAD
@ MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
Definition: GUIAppEnum.h:103
MFXUtils::getTitleText
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:61
OptionsCont::getBool
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
Definition: OptionsCont.cpp:222
GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::buildDemandMenuCommands
void buildDemandMenuCommands(FXMenuPane *editMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1313
GNEViewParent::getTAZFrame
GNETAZFrame * getTAZFrame() const
get frame for GNE_NMODE_TAZ
Definition: GNEViewParent.cpp:216
GNEApplicationWindow::isUndoRedoEnabled
const std::string & isUndoRedoEnabled() const
check if undo-redo is enabled
Definition: GNEApplicationWindow.cpp:3219
OptionsCont::getOptions
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:57
GNEApplicationWindow::EditMenuCommands::demandMenuCommands
DemandMenuCommands demandMenuCommands
Demand Menu Commands.
Definition: GNEApplicationWindow.h:617
GNENet::cleanInvalidCrossings
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1736
GNEViewNet
Definition: GNEViewNet.h:42
GNEApplicationWindow
The main window of the Netedit.
Definition: GNEApplicationWindow.h:58
GUIIconSubSys::close
static void close()
close GUIIconSubSys
Definition: GUIIconSubSys.cpp:615
ICON_LOCATEEDGE
@ ICON_LOCATEEDGE
Definition: GUIIcons.h:76
GNEApplicationWindow::disableUndoRedo
void disableUndoRedo(const std::string &reason)
disable undo-redo giving a string with the reason
Definition: GNEApplicationWindow.cpp:3207
MID_HOTKEY_ESC
@ MID_HOTKEY_ESC
hot key <ESC> abort current edit operation
Definition: GUIAppEnum.h:206
GUIMessageWindow::unregisterMsgHandlers
void unregisterMsgHandlers()
unregister message handlers
Definition: GUIMessageWindow.cpp:261
GNEApplicationWindow::myEditMenuCommands
EditMenuCommands myEditMenuCommands
Edit Menu Commands.
Definition: GNEApplicationWindow.h:773
GUIEvent_Message::getMsg
const std::string & getMsg() const
Returns the message.
Definition: GUIEvent_Message.h:73
GNEApplicationWindow::computeJunctionWithVolatileOptions
long computeJunctionWithVolatileOptions()
called if the user selects Processing->compute junctions with volatile options
Definition: GNEApplicationWindow.cpp:1799
OptionsCont::unSet
void unSet(const std::string &name, bool failOnNonExistant=true) const
Marks the option as unset.
Definition: OptionsCont.cpp:149
GUIEvent_Message.h
GNEInspectorFrame::TemplateEditor::copyTemplate
void copyTemplate()
copy template (used by shortcut)
Definition: GNEInspectorFrame.cpp:944
GNEApplicationWindow::FileMenuCommands::saveDemandElements
FXMenuCommand * saveDemandElements
FXMenuCommand for enable or disable save demand elements.
Definition: GNEApplicationWindow.h:486
ICON_OPEN_CONFIG
@ ICON_OPEN_CONFIG
Definition: GUIIcons.h:42
ICON_COMPUTEJUNCTIONS
@ ICON_COMPUTEJUNCTIONS
Definition: GUIIcons.h:247
ICON_SUMO_MINI
@ ICON_SUMO_MINI
Definition: GUIIcons.h:39
GNEViewParent::onKeyPress
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
Definition: GNEViewParent.cpp:608
MID_HOTKEY_F2_ABOUT
@ MID_HOTKEY_F2_ABOUT
hot key <F2> open about dialog
Definition: GUIAppEnum.h:167
MID_LOCATEPERSON
@ MID_LOCATEPERSON
Locate person - button.
Definition: GUIAppEnum.h:332
MID_LOCATESTOP
@ MID_LOCATESTOP
Locate stop - button.
Definition: GUIAppEnum.h:330
GLHelper.h
GUIDesignSplitter
#define GUIDesignSplitter
Definition: GUIDesigns.h:331
GUIDesigns.h
MID_HOTKEY_D_DELETEMODE
@ MID_HOTKEY_D_DELETEMODE
hotkey for mode deleting things
Definition: GUIAppEnum.h:49
GUITextureSubSys::initTextures
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
Definition: GUITextureSubSys.cpp:94
MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE
@ MID_HOTKEY_C_CONNECTMODE_PERSONPLANMODE
hotkey for mode connecting lanes
Definition: GUIAppEnum.h:47
ICON_LOCATETLS
@ ICON_LOCATETLS
Definition: GUIIcons.h:81
GNEApplicationWindow::disableSaveDemandElementsMenu
void disableSaveDemandElementsMenu()
disable save demand elements
Definition: GNEApplicationWindow.cpp:1980
GNEViewNetHelper::NetworkViewOptions::menuCheckShowJunctionBubble
FXMenuCheck * menuCheckShowJunctionBubble
menu check to show connection as buuble in "Move" mode.
Definition: GNEViewNetHelper.h:408
GNEApplicationWindow::onCmdOpenTLSPrograms
long onCmdOpenTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
Definition: GNEApplicationWindow.cpp:676
GUISettingsHandler.h
GNEApplicationWindow::myFileMenu
FXMenuPane * myFileMenu
the submenus
Definition: GNEApplicationWindow.h:409
GNEViewNet::update
void update() const
Mark the entire GNEViewNet to be repainted later.
Definition: GNEViewNet.cpp:299
FXEX::FXBaseObject::setSelector
void setSelector(FXSelector sel)
set the selector
Definition: FXBaseObject.h:139
MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS
@ MID_HOTKEY_CTRL_SHIFT_S_SAVENETWORK_AS
save network as
Definition: GUIAppEnum.h:157
GNEUndoList::redo
void redo()
redo the last command group
Definition: GNEUndoList.cpp:122
GUIIconSubSys::getIcon
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
Definition: GUIIconSubSys.cpp:609
MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID
@ MID_HOTKEY_CTRL_G_GAMINGMODE_TOOGLEGRID
Toogle Gaming mode in SUMO and grid in NETEDIT.
Definition: GUIAppEnum.h:85
GNEApplicationWindow::onCmdSetTemplate
long onCmdSetTemplate(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2591
GUIIconSubSys::initIcons
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
Definition: GUIIconSubSys.cpp:602
GNEApplicationWindow::EditMenuCommands
struct for edit menu commands
Definition: GNEApplicationWindow.h:497
GNEApplicationWindow::getDefaultCursor
FXCursor * getDefaultCursor()
get default cursor
Definition: GNEApplicationWindow.cpp:1777
MID_HOTKEY_Z_TAZMODE
@ MID_HOTKEY_Z_TAZMODE
hotkey for mode editing TAZ
Definition: GUIAppEnum.h:69
GNEApplicationWindow::myProcessingMenuCommands
ProcessingMenuCommands myProcessingMenuCommands
Edit Menu Commands.
Definition: GNEApplicationWindow.h:776
GNEApplicationWindow::FileMenuCommands::FileMenuCommands
FileMenuCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1073
MFXUtils::getFilename2Write
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:83
GNEViewNet::onCmdToogleExtendSelection
long onCmdToogleExtendSelection(FXObject *, FXSelector, void *)
toogle extend selection
Definition: GNEViewNet.cpp:2234
GNEViewParent
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:71
GNEApplicationWindow::onCmdPaste
long onCmdPaste(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2583
GNEViewNet::hotkeyEnter
void hotkeyEnter()
handle enter keypress
Definition: GNEViewNet.cpp:926
ICON_MODEPOLYGON
@ ICON_MODEPOLYGON
Definition: GUIIcons.h:230
ICON_MODEMOVE
@ ICON_MODEMOVE
Definition: GUIIcons.h:227
GUIShortcutsSubSys::buildNETEDITAccelerators
static void buildNETEDITAccelerators(GNEApplicationWindow *GNEApp)
build NETEDIT Accelerators
Definition: GUIShortcutsSubSys.cpp:108
MID_HOTKEY_S_SELECTMODE
@ MID_HOTKEY_S_SELECTMODE
hotkey for mode selecting objects
Definition: GUIAppEnum.h:59
GNEViewNetHelper::NetworkViewOptions::menuCheckExtendSelection
FXMenuCheck * menuCheckExtendSelection
menu check to extend to edge nodes
Definition: GNEViewNetHelper.h:399
MID_HOTKEY_ALT_F4_CLOSE
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
Definition: GUIAppEnum.h:143
GUIAppEnum.h
OptionsCont::getStringVector
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
Definition: OptionsCont.cpp:235
NIFrame::checkOptions
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NIFrame.cpp:329
GNEApplicationWindow::onCmdOpenNetwork
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
Definition: GNEApplicationWindow.cpp:559
EVENT_DEBUG_OCCURRED
@ EVENT_DEBUG_OCCURRED
send when a debug occured
Definition: GUIEvent.h:51
ICON_LOCATEADD
@ ICON_LOCATEADD
Definition: GUIIcons.h:82
GUIMainWindow::myTrackerLock
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
Definition: GUIMainWindow.h:149
GNEApplicationWindow::WindowsMenuCommands::buildWindowsMenuCommands
void buildWindowsMenuCommands(FXMenuPane *windowsMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1578
GNEApplicationWindow::onUpdSaveDemandElements
long onUpdSaveDemandElements(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements is executed
Definition: GNEApplicationWindow.cpp:2755
GUIDesignHorizontalFrameStatusBar
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition: GUIDesigns.h:233
GNEUndoList::undo
void undo()
undo the last command group
Definition: GNEUndoList.cpp:113
GNEApplicationWindow::WindowsMenuCommands::WindowsMenuCommands
WindowsMenuCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1572
GNEApplicationWindow::myAmLoading
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
Definition: GNEApplicationWindow.h:406
GNEViewNet::getNet
GNENet * getNet() const
get the net object
Definition: GNEViewNet.cpp:1014
ICON_MODESTOP
@ ICON_MODESTOP
Definition: GUIIcons.h:239
GUIUserIO::clipped
static std::string clipped
Definition: GUIUserIO.h:60
GNENet::joinSelectedJunctions
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1598
EVENT_WARNING_OCCURRED
@ EVENT_WARNING_OCCURRED
send when a warning occured
Definition: GUIEvent.h:45
GNEApplicationWindow::myNet
GNENet * myNet
we are responsible for the net
Definition: GNEApplicationWindow.h:435
GNEViewNet::onCmdToogleShowDemandElements
long onCmdToogleShowDemandElements(FXObject *, FXSelector, void *)
Definition: GNEViewNet.cpp:2180
ICON_MODEDELETE
@ ICON_MODEDELETE
Definition: GUIIcons.h:225
GNEApplicationWindow::myLocateMenuCommands
LocateMenuCommands myLocateMenuCommands
Locate Menu Commands.
Definition: GNEApplicationWindow.h:779
GNEViewParent::onKeyRelease
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
Definition: GNEViewParent.cpp:615
GNEApplicationWindow::SupermodeCommands::SupermodeCommands
SupermodeCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1595
GNEEvent_NetworkLoaded::myFile
std::string myFile
the name of the loaded file
Definition: GNEEvent_NetworkLoaded.h:61
MID_HOTKEY_ALT_1_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_1_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:125
GUIMainWindow::myCartesianCoordinate
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
Definition: GUIMainWindow.h:161
ICON_RELOAD
@ ICON_RELOAD
Definition: GUIIcons.h:47
GUIShortcutsSubSys.h
ICON_OPEN_ADDITIONALS
@ ICON_OPEN_ADDITIONALS
Definition: GUIIcons.h:45
MID_HOTKEY_CTRL_L_SAVEASPLAINXML
@ MID_HOTKEY_CTRL_L_SAVEASPLAINXML
save network as plain XML
Definition: GUIAppEnum.h:95
GNEViewNetHelper::NetworkViewOptions::menuCheckShowConnections
FXMenuCheck * menuCheckShowConnections
menu check to show connections
Definition: GNEViewNetHelper.h:393
GNEViewNet::onCmdSetMode
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
Definition: GNEViewNet.cpp:1204
GNENet::joinRoutes
void joinRoutes(GNEUndoList *undoList)
join routes
Definition: GNENet.cpp:1833
NWFrame::checkOptions
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NWFrame.cpp:126
ICON_MODEVEHICLE
@ ICON_MODEVEHICLE
Definition: GUIIcons.h:237
MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS
@ MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS
save additionals as
Definition: GUIAppEnum.h:573
MID_OPEN_NETWORK
@ MID_OPEN_NETWORK
Open network - ID.
Definition: GUIAppEnum.h:239
GUIMessageWindow::addSeparator
void addSeparator()
Adds a a separator to this log window.
Definition: GUIMessageWindow.cpp:217
GNEEvent_NetworkLoaded.h
StringUtils::endsWith
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
Definition: StringUtils.cpp:180
NBFrame::checkOptions
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NBFrame.cpp:591
GNEApplicationWindow::enableSaveDemandElementsMenu
void enableSaveDemandElementsMenu()
enable save demand elements
Definition: GNEApplicationWindow.cpp:1973
GNEApplicationWindow::MenuBarFile::myRecentConfigs
FXRecentFiles myRecentConfigs
List of recent config files.
Definition: GNEApplicationWindow.h:457
ICON_LOCATEJUNCTION
@ ICON_LOCATEJUNCTION
Definition: GUIIcons.h:75
MID_GNE_TOOLBARFILE_SAVEDEMAND_AS
@ MID_GNE_TOOLBARFILE_SAVEDEMAND_AS
save demand elements as
Definition: GUIAppEnum.h:577
MID_HOTKEY_CTRL_X_CUT
@ MID_HOTKEY_CTRL_X_CUT
cut the current selection / element
Definition: GUIAppEnum.h:111
GUIMessageWindow::clear
void clear()
Clears the window.
Definition: GUIMessageWindow.cpp:230
GNEApplicationWindow::onCmdDel
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
Definition: GNEApplicationWindow.cpp:2179
GNEViewNetHelper::DemandViewOptions::menuCheckHideNonInspectedDemandElements
FXMenuCheck * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
Definition: GNEViewNetHelper.h:466
GUIMainWindow::setWindowSizeAndPos
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
Definition: GUIMainWindow.cpp:201
GNEApplicationWindow::myMessageWindow
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
Definition: GNEApplicationWindow.h:420
GUIMainWindow::myTrackerWindows
std::vector< FXMainWindow * > myTrackerWindows
Definition: GUIMainWindow.h:147
GNEApplicationWindow::onCmdToogleEditOptions
long onCmdToogleEditOptions(FXObject *, FXSelector, void *)
called if the user press key combination Alt + <0-9>
Definition: GNEApplicationWindow.cpp:2266
ICON_MODEPERSON
@ ICON_MODEPERSON
Definition: GUIIcons.h:241
MID_HOTKEY_CTRL_SHIFT_K_SAVETLS
@ MID_HOTKEY_CTRL_SHIFT_K_SAVETLS
save TLS Programs
Definition: GUIAppEnum.h:155
GNEEvent_NetworkLoaded::myNet
GNENet * myNet
the loaded net
Definition: GNEEvent_NetworkLoaded.h:58
SystemFrame.h
GUIPerspectiveChanger.h
XMLSubSys::setValidation
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
Definition: XMLSubSys.cpp:58
ID_LOADTHREAD_EVENT
@ ID_LOADTHREAD_EVENT
The loading thread.
Definition: GUIAppEnum.h:271
GNENet::isAdditionalsSaved
bool isAdditionalsSaved() const
check if additionals are saved
Definition: GNENet.cpp:2300
GNEApplicationWindow::mySupermodeCommands
SupermodeCommands mySupermodeCommands
Supermode Commands.
Definition: GNEApplicationWindow.h:785
GNEApplicationWindow::ProcessingMenuCommands::showNetworkProcessingMenuCommands
void showNetworkProcessingMenuCommands()
show network processing menu commands
Definition: GNEApplicationWindow.cpp:1462
ICON_MODECROSSING
@ ICON_MODECROSSING
Definition: GUIIcons.h:223
MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS
@ MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS
clean invalid crossings in network mode and demand elements in demand mode
Definition: GUIAppEnum.h:179
SysUtils.h
GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::hideDemandMenuCommands
void hideDemandMenuCommands()
hide all menu commands
Definition: GNEApplicationWindow.cpp:1299
GNEApplicationWindow::onCmdLoadDemandInSUMOGUI
long onCmdLoadDemandInSUMOGUI(FXObject *, FXSelector, void *)
called when user toogle windows checkbox "load demand"
Definition: GNEApplicationWindow.cpp:843
Position::set
void set(double x, double y)
set positions x and y
Definition: Position.h:86
GNEViewNet::abortOperation
void abortOperation(bool clearSelection=true)
abort current edition operation
Definition: GNEViewNet.cpp:836
ICON_OPTIONS
@ ICON_OPTIONS
Definition: GUIIcons.h:253
GNEAbout.h
ICON_CLEANROUTES
@ ICON_CLEANROUTES
Definition: GUIIcons.h:251
GNEViewNet::getNetworkViewOptions
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
Definition: GNEViewNet.cpp:452
GNEApplicationWindow::myFileMenuDemandElements
FXMenuPane * myFileMenuDemandElements
Definition: GNEApplicationWindow.h:412
GNEApplicationWindow::hadDependentBuild
bool hadDependentBuild
check if had dependent build
Definition: GNEApplicationWindow.h:432
GNEApplicationWindow::myLocatorMenu
FXMenuPane * myLocatorMenu
Definition: GNEApplicationWindow.h:415
GNEApplicationWindow::onCmdClearMsgWindow
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
Definition: GNEApplicationWindow.cpp:828
GNEViewNet.h
GNEAdditionalHandler.h
ICON_LOCATEPOI
@ ICON_LOCATEPOI
Definition: GUIIcons.h:83
GNEApplicationWindow::onUpdRedo
long onUpdRedo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall redo is executed
Definition: GNEApplicationWindow.cpp:2768
GNEApplicationWindow::create
void create()
Creates the main window (required by FOX)
Definition: GNEApplicationWindow.cpp:431
MID_HOTKEY_CTRL_T_OPENSUMONETEDIT
@ MID_HOTKEY_CTRL_T_OPENSUMONETEDIT
Open current network in SUMO or in NETEDIT.
Definition: GUIAppEnum.h:105
GNEApplicationWindow::ToolbarsGrip
FOX-declaration.
Definition: GNEApplicationWindow.h:64
update
GNETLSEditorFrame::parseTLSPrograms
bool parseTLSPrograms(const std::string &file)
parse TLS Programs from a file
Definition: GNETLSEditorFrame.cpp:188
GNEApplicationWindow::EditMenuCommands::toogleGrid
FXMenuCommand * toogleGrid
FXMenuCommand for toogle grid.
Definition: GNEApplicationWindow.h:632
GNEApplicationWindow::FileMenuCommands::buildFileMenuCommands
void buildFileMenuCommands(FXMenuPane *editMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1084
GNEApplicationWindow::handleEvent_Message
void handleEvent_Message(GUIEvent *e)
hanlde event of type message
Definition: GNEApplicationWindow.cpp:1018
GUIDesignToolBar
#define GUIDesignToolBar
design for default toolbar
Definition: GUIDesigns.h:295
GNENet::getNumberOfDemandElements
int getNumberOfDemandElements(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of demand elements of the net.
Definition: GNENet.cpp:2343
ICON_MODEPERSONTYPE
@ ICON_MODEPERSONTYPE
Definition: GUIIcons.h:240
GNEApplicationWindow::enableSaveTLSProgramsMenu
void enableSaveTLSProgramsMenu()
enable save TLS Programs
Definition: GNEApplicationWindow.cpp:1967
GNEApplicationWindow::FileMenuCommands::saveAdditionals
FXMenuCommand * saveAdditionals
FXMenuCommand for enable or disable save additionals.
Definition: GNEApplicationWindow.h:477
GNETLSEditorFrame.h
ICON_UNDO
@ ICON_UNDO
Definition: GUIIcons.h:178
GNE_SUPERMODE_NETWORK
@ GNE_SUPERMODE_NETWORK
Network mode (Edges, junctions, etc..)
Definition: GNEViewNetHelper.h:46
GNEApplicationWindow::onCmdAbort
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
Definition: GNEApplicationWindow.cpp:2152
ProcessError
Definition: UtilExceptions.h:39
GNEViewNetHelper::EditModes::currentSupermode
Supermode currentSupermode
the current supermode
Definition: GNEViewNetHelper.h:305
GUIDialog_GLChosenEditor.h
GNEInspectorFrame::getTemplateEditor
TemplateEditor * getTemplateEditor() const
get template editor
Definition: GNEInspectorFrame.cpp:336
ICON_LOCATEPOLY
@ ICON_LOCATEPOLY
Definition: GUIIcons.h:84
MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE
@ MID_HOTKEY_W_PROHIBITIONMODE_PERSONTYPEMODE
hotkey for mode editing connection prohibitions AND person types
Definition: GUIAppEnum.h:67
EVENT_SIMULATION_LOADED
@ EVENT_SIMULATION_LOADED
send when a simulation has been loaded
Definition: GUIEvent.h:36
MID_WINDOW
@ MID_WINDOW
Main window-ID.
Definition: GUIAppEnum.h:220
ICON_NETEDIT
@ ICON_NETEDIT
Definition: GUIIcons.h:180
MID_HOTKEY_F9_EDIT_VIEWSCHEME
@ MID_HOTKEY_F9_EDIT_VIEWSCHEME
open edit scheme menu
Definition: GUIAppEnum.h:181
GNEViewParent::getInspectorFrame
GNEInspectorFrame * getInspectorFrame() const
get frame for GNE_NMODE_INSPECT
Definition: GNEViewParent.cpp:180
ICON_LOCATEROUTE
@ ICON_LOCATEROUTE
Definition: GUIIcons.h:78
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:38
GNEApplicationWindow::FileMenuCommands::saveDemandElementsAs
FXMenuCommand * saveDemandElementsAs
FXMenuCommand for enable or disable save demand elements as.
Definition: GNEApplicationWindow.h:489
GNEApplicationWindow.h
gSchemeStorage
GUICompleteSchemeStorage gSchemeStorage
Definition: GUICompleteSchemeStorage.cpp:38
MID_HOTKEY_F10_OPTIONSMENU
@ MID_HOTKEY_F10_OPTIONSMENU
open options menu
Definition: GUIAppEnum.h:183
Position::x
double x() const
Returns the x-position.
Definition: Position.h:56
GNEApplicationWindow::onCmdClearTemplate
long onCmdClearTemplate(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2615
GNEApplicationWindow::~GNEApplicationWindow
~GNEApplicationWindow()
Destructor.
Definition: GNEApplicationWindow.cpp:458
GNEApplicationWindow::getCurrentSimTime
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don't need it)
Definition: GNEApplicationWindow.cpp:1710
GUISettingsHandler
An XML-handler for visualisation schemes.
Definition: GUISettingsHandler.h:44
GNEViewNetHelper::CommonViewOptions::getVisibleCommonMenuCommands
void getVisibleCommonMenuCommands(std::vector< FXMenuCheck * > &commands) const
get visible common menu commands
Definition: GNEViewNetHelper.cpp:1458
GNEApplicationWindow::onUpdOpen
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
Definition: GNEApplicationWindow.cpp:821
GNEApplicationWindow::myLoadThread
GNELoadThread * myLoadThread
the thread that loads the network
Definition: GNEApplicationWindow.h:403
GNEApplicationWindow::EditMenuCommands::editViewScheme
FXMenuCommand * editViewScheme
FXMenuCommand for edit view scheme.
Definition: GNEApplicationWindow.h:626
GNEViewNet::getUndoList
GNEUndoList * getUndoList() const
get the undoList object
Definition: GNEViewNet.cpp:1020
GNEApplicationWindow::myFileMenuTLS
FXMenuPane * myFileMenuTLS
Definition: GNEApplicationWindow.h:411
GNEViewNet::getDemandViewOptions
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
Definition: GNEViewNet.cpp:458
GNEApplicationWindow::ToolbarsGrip::destroyParentToolbarsGrips
void destroyParentToolbarsGrips()
build toolbars grips
Definition: GNEApplicationWindow.cpp:322
GNEApplicationWindow::onCmdEnter
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
Definition: GNEApplicationWindow.cpp:2191
GNEApplicationWindow::SupermodeCommands::hideSupermodeCommands
void hideSupermodeCommands()
hide all menu commands
Definition: GNEApplicationWindow.cpp:1613
GNENet::save
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:1000
GNEApplicationWindow::enableSaveAdditionalsMenu
void enableSaveAdditionalsMenu()
enable save additionals
Definition: GNEApplicationWindow.cpp:1953
GNEViewNetHelper::NetworkViewOptions::getVisibleNetworkMenuCommands
void getVisibleNetworkMenuCommands(std::vector< FXMenuCheck * > &commands) const
get visible network menu commands
Definition: GNEViewNetHelper.cpp:1577
ICON_OPEN_TLSPROGRAMS
@ ICON_OPEN_TLSPROGRAMS
Definition: GUIIcons.h:46
GNEApplicationWindow::onKeyRelease
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
Definition: GNEApplicationWindow.cpp:3253
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
GNEApplicationWindow::continueWithUnsavedChanges
bool continueWithUnsavedChanges(const std::string &operation)
warns about unsaved changes and gives the user the option to abort
Definition: GNEApplicationWindow.cpp:3029
ICON_MODECONNECTION
@ ICON_MODECONNECTION
Definition: GUIIcons.h:221
GNELoadThread
Definition: GNELoadThread.h:45
GUIDesignToolBarRaisedNext
#define GUIDesignToolBarRaisedNext
design for first toolbar shell positioned in the next position of dock
Definition: GUIDesigns.h:301
ICON_MODEROUTE
@ ICON_MODEROUTE
Definition: GUIIcons.h:236
GNEApplicationWindow::onCmdNewNetwork
long onCmdNewNetwork(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:518
Supermode
Supermode
@brie enum for supermodes
Definition: GNEViewNetHelper.h:42
ICON_COMPUTEDEMAND
@ ICON_COMPUTEDEMAND
Definition: GUIIcons.h:250
GNEViewNet::onCmdToogleLockPerson
long onCmdToogleLockPerson(FXObject *, FXSelector, void *)
toogle lock person in super mode demand
Definition: GNEViewNet.cpp:2372
GNEApplicationWindow::onCmdAbout
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
Definition: GNEApplicationWindow.cpp:851
GNEApplicationWindow::dependentBuild
void dependentBuild()
build dependent
Definition: GNEApplicationWindow.cpp:385
GNETAZFrame.h
GNEApplicationWindow::onCmdSaveNetwork
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
Definition: GNEApplicationWindow.cpp:2774
MID_HOTKEY_ALT_9_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_9_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:141
GNEViewNetHelper::NetworkViewOptions::menuCheckWarnAboutMerge
FXMenuCheck * menuCheckWarnAboutMerge
menu check to we should warn about merging junctions
Definition: GNEViewNetHelper.h:405
FXSynchQue::pop
void pop()
Definition: FXSynchQue.h:66
GNEApplicationWindow::FileMenuCommands::saveAdditionalsAs
FXMenuCommand * saveAdditionalsAs
FXMenuCommand for enable or disable save additionals As.
Definition: GNEApplicationWindow.h:480
GNEViewNet::onCmdToogleHideConnections
long onCmdToogleHideConnections(FXObject *, FXSelector, void *)
toogle hide connections
Definition: GNEViewNet.cpp:2222
GNETAZFrame::getTAZSelectionStatisticsModul
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
Definition: GNETAZFrame.cpp:1458
GUISettingsHandler::applyViewport
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
Definition: GUISettingsHandler.cpp:382
EVENT_GLDEBUG_OCCURRED
@ EVENT_GLDEBUG_OCCURRED
send when a gldebug occured
Definition: GUIEvent.h:54
GNEApplicationWindow::onCmdOpenDemandElements
long onCmdOpenDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall open demand is executed
Definition: GNEApplicationWindow.cpp:712
MID_GNE_TOOLBARFILE_OPENFOREIGN
@ MID_GNE_TOOLBARFILE_OPENFOREIGN
open foreign network
Definition: GUIAppEnum.h:571
GNEApplicationWindow::closeAllWindows
void closeAllWindows()
this method closes all windows and deletes the current simulation *‍/
Definition: GNEApplicationWindow.cpp:1734
MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition: GUIAppEnum.h:192
MID_HOTKEY_ALT_6_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_6_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:135
MID_HOTKEY_T_TLSMODE_VTYPEMODE
@ MID_HOTKEY_T_TLSMODE_VTYPEMODE
hotkey for mode editing TLS AND Vehicle Types
Definition: GUIAppEnum.h:63
gCurrentFolder
FXString gCurrentFolder
The folder used as last.
Definition: GUIIOGlobals.cpp:32
GNEEvent_NetworkLoaded::mySettingsFile
std::string mySettingsFile
the name of the settings file to load
Definition: GNEEvent_NetworkLoaded.h:64
GNEApplicationWindow::EditMenuCommands::loadAdditionalsInSUMOGUI
FXMenuCheck * loadAdditionalsInSUMOGUI
menu check for load additionals in SUMO GUI
Definition: GNEApplicationWindow.h:635
GNEApplicationWindow::onCmdCut
long onCmdCut(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
Definition: GNEApplicationWindow.cpp:2567
GNEApplicationWindow::ToolbarsGrip::menu
FXMenuBar * menu
The application menu bar (for file, edit, processing...)
Definition: GNEApplicationWindow.h:79
GNEApplicationWindow::onLoadThreadEvent
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
Definition: GNEApplicationWindow.cpp:873
GNEApplicationWindow::onUpdNeedsNetwork
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall needs network is executed
Definition: GNEApplicationWindow.cpp:2735
GNEApplicationWindow::onCmdSetSuperMode
long onCmdSetSuperMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-supermode hotkey
Definition: GNEApplicationWindow.cpp:1987
GNEApplicationWindow::onCmdOpenRecent
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
Definition: GNEApplicationWindow.cpp:753
MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE
@ MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE
compute junctions with volatile options
Definition: GUIAppEnum.h:198
GNEApplicationWindow::onCmdSaveAsNetwork
long onCmdSaveAsNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
Definition: GNEApplicationWindow.cpp:2627
GNENet::isDemandElementsSaved
bool isDemandElementsSaved() const
check if demand elements are saved
Definition: GNENet.cpp:2455
GUIDesignToolBarRaisedSame
#define GUIDesignToolBarRaisedSame
design for toolbar
Definition: GUIDesigns.h:298
MID_HOTKEY_CTRL_Z_UNDO
@ MID_HOTKEY_CTRL_Z_UNDO
Redo.
Definition: GUIAppEnum.h:115
GNEInspectorFrame::TemplateEditor::clearTemplate
void clearTemplate()
clear template (used by shortcut)
Definition: GNEInspectorFrame.cpp:953
ICON_SUPERMODEDEMAND
@ ICON_SUPERMODEDEMAND
Definition: GUIIcons.h:215
GNEUndoList::p_onUpdRedo
long p_onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
Definition: GNEUndoList.cpp:191
GNELoadThread::loadConfigOrNet
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
Definition: GNELoadThread.cpp:340
MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES
@ MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES
join selected junctions in network mode and normalice demand element ids in demand mode
Definition: GUIAppEnum.h:177
GUIMainWindow::myGLVisual
FXGLVisual * myGLVisual
The gl-visual used.
Definition: GUIMainWindow.h:165
OptionsCont::isDefault
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
Definition: OptionsCont.cpp:163
MID_HOTKEY_ALT_4_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_4_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:131
GNENet::getViewNet
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:2117
ICON_LOCATEPERSON
@ ICON_LOCATEPERSON
Definition: GUIIcons.h:80
MID_OPEN_CONFIG
@ MID_OPEN_CONFIG
Open configuration - ID.
Definition: GUIAppEnum.h:237
MID_HOTKEY_CTRL_V_PASTE
@ MID_HOTKEY_CTRL_V_PASTE
paste the current selection / element
Definition: GUIAppEnum.h:107
GUIMainWindow::myGeoCoordinate
FXLabel * myGeoCoordinate
Definition: GUIMainWindow.h:161
FXSynchQue::top
T top()
Definition: FXSynchQue.h:50
GNELoadThread.h
GNEApplicationWindow::onKeyPress
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
Definition: GNEApplicationWindow.cpp:3240
MID_HOTKEY_CTRL_Q_CLOSE
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
Definition: GUIAppEnum.h:99
GUIMessageWindow::appendMsg
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
Definition: GUIMessageWindow.cpp:157
GNEViewParent.h
ICON_LOCATEVEHICLE
@ ICON_LOCATEVEHICLE
Definition: GUIIcons.h:77
GNEViewNet::onCmdSetSupermode
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
Definition: GNEViewNet.cpp:1188
FXSynchQue::empty
bool empty()
Definition: FXSynchQue.h:129
GNEViewNet::onCmdToogleHideNonInspecteDemandElements
long onCmdToogleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toogle hide non inspected demand elements
Definition: GNEViewNet.cpp:2336
EVENT_ERROR_OCCURRED
@ EVENT_ERROR_OCCURRED
send when a error occured
Definition: GUIEvent.h:48
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:47
GNEViewNet::updateControls
void updateControls()
update control contents after undo/redo or recompute
Definition: GNEViewNet.cpp:3001
GNEAbout::create
void create()
Creates the widget.
Definition: GNEAbout.cpp:86
GNEApplicationWindow::onCmdSaveTLSPrograms
long onCmdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is executed
Definition: GNEApplicationWindow.cpp:2876
GNEViewParent::getCurrentShownFrame
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
Definition: GNEViewParent.cpp:174
GNEEvent_NetworkLoaded::myViewportFromRegistry
bool myViewportFromRegistry
whether loading viewport from registry
Definition: GNEEvent_NetworkLoaded.h:67
GNEApplicationWindow::disableSaveAdditionalsMenu
void disableSaveAdditionalsMenu()
disable save additionals
Definition: GNEApplicationWindow.cpp:1960
GNENet::saveAdditionals
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:2255
MID_HOTKEY_CTRL_W_CLOSESIMULATION
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
Definition: GUIAppEnum.h:109
MID_HOTKEY_V_VEHICLEMODE
@ MID_HOTKEY_V_VEHICLEMODE
hotkey for mode create vehicles
Definition: GUIAppEnum.h:65
GNEEvent_NetworkLoaded
Definition: GNEEvent_NetworkLoaded.h:43
GUIMainWindow
Definition: GUIMainWindow.h:46
Position::y
double y() const
Returns the y-position.
Definition: Position.h:61
GNENet::savePlain
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:1010
GUISUMOAbstractView::getChanger
GUIPerspectiveChanger & getChanger() const
get changer
Definition: GUISUMOAbstractView.cpp:175
GNEApplicationWindow::myMenuBarFile
MenuBarFile myMenuBarFile
MenuBarFile.
Definition: GNEApplicationWindow.h:767
GNEApplicationWindow::handleEvent_NetworkLoaded
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
Definition: GNEApplicationWindow.cpp:906
GNEViewNetHelper::NetworkViewOptions::menuCheckHideConnections
FXMenuCheck * menuCheckHideConnections
menu check to hide connections in connect mode
Definition: GNEViewNetHelper.h:396
FXEX::SEL_THREAD_EVENT
@ SEL_THREAD_EVENT
Definition: fxexdefs.h:183
MID_LOCATEJUNCTION
@ MID_LOCATEJUNCTION
Locate junction - button.
Definition: GUIAppEnum.h:322
GNEApplicationWindow::EditMenuCommands::openInSUMOGUI
FXMenuCommand * openInSUMOGUI
FXMenuCommand for open in SUMO GUI.
Definition: GNEApplicationWindow.h:641
GUIEvent::getOwnType
GUIEventType getOwnType() const
returns the event type
Definition: GUIEvent.h:79
GNEApplicationWindow::onCmdOpenSUMOGUI
long onCmdOpenSUMOGUI(FXObject *sender, FXSelector sel, void *ptr)
called if the user hints ctrl + T
Definition: GNEApplicationWindow.cpp:2077
MID_HOTKEY_DEL
@ MID_HOTKEY_DEL
hot key delete selections or elements
Definition: GUIAppEnum.h:208
MID_HOTKEY_BACKSPACE
@ MID_HOTKEY_BACKSPACE
hot key <Backspace> remove last sub-operation
Definition: GUIAppEnum.h:212
GUIUserIO.h
GNEApplicationWindow::onCmdSetMode
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
Definition: GNEApplicationWindow.cpp:1997
GNENet::saveTLSPrograms
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition: GNENet.cpp:2656
GNEApplicationWindow::myFileMenuCommands
FileMenuCommands myFileMenuCommands
File Menu Commands.
Definition: GNEApplicationWindow.h:770
GNEApplicationWindow::onCmdSaveAdditionalsAs
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
Definition: GNEApplicationWindow.cpp:2851
GNEApplicationWindow::onCmdOpenAdditionals
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
Definition: GNEApplicationWindow.cpp:635
GNEApplicationWindow::onCmdSaveJoined
long onCmdSaveJoined(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
Definition: GNEApplicationWindow.cpp:2695
GUIEvent
Definition: GUIEvent.h:76
GNENet::removeSolitaryJunctions
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1788
GNE_SUPERMODE_DEMAND
@ GNE_SUPERMODE_DEMAND
Demanding mode (Routes, Vehicles etc..)
Definition: GNEViewNetHelper.h:48
GNEApplicationWindow::ProcessingMenuCommands::hideDemandProcessingMenuCommands
void hideDemandProcessingMenuCommands()
show demand processing menu commands
Definition: GNEApplicationWindow.cpp:1511
GNEApplicationWindow::myWindowsMenu
FXMenuPane * myWindowsMenu
Definition: GNEApplicationWindow.h:416
GNEApplicationWindow::LocateMenuCommands::buildLocateMenuCommands
void buildLocateMenuCommands(FXMenuPane *locateMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1534
GNEApplicationWindow::EditMenuCommands::undoLastChange
FXMenuCommand * undoLastChange
FXMenuCommand for undo last change.
Definition: GNEApplicationWindow.h:620
ICON_MODETLS
@ ICON_MODETLS
Definition: GUIIcons.h:229
GNEViewNet::onCmdToogleChangeAllPhases
long onCmdToogleChangeAllPhases(FXObject *, FXSelector, void *)
toogle change all phases
Definition: GNEViewNet.cpp:2246
ICON_CLOSE
@ ICON_CLOSE
Definition: GUIIcons.h:49
GNEApplicationWindow::setStatusBarText
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
Definition: GNEApplicationWindow.cpp:1792
GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::hideNetworkMenuCommands
void hideNetworkMenuCommands()
hide all menu commands
Definition: GNEApplicationWindow.cpp:1206
GNEAbout
The application's "About" - dialog.
Definition: GNEAbout.h:35
GNEApplicationWindow::getUndoList
GNEUndoList * getUndoList()
get pointer to undoList
Definition: GNEApplicationWindow.cpp:1722
GUICompleteSchemeStorage::saveViewport
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
Definition: GUICompleteSchemeStorage.cpp:227
GNEApplicationWindow::onCmdReload
long onCmdReload(FXObject *, FXSelector, void *)
called when the command/FXCall reload is executed
Definition: GNEApplicationWindow.cpp:769
MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition: GUIAppEnum.h:196
GUITextureSubSys::close
static void close()
close GUITextureSubSys
Definition: GUITextureSubSys.cpp:185
IOError
Definition: UtilExceptions.h:161
GUIMessageWindow::registerMsgHandlers
void registerMsgHandlers()
register message handlers
Definition: GUIMessageWindow.cpp:243
GNEViewNetHelper::NetworkViewOptions::menuCheckAutoOppositeEdge
FXMenuCheck * menuCheckAutoOppositeEdge
menu check to create auto create opposite edge
Definition: GNEViewNetHelper.h:417
MID_HOTKEY_ENTER
@ MID_HOTKEY_ENTER
hot key <ENTER> accept current operation
Definition: GUIAppEnum.h:210
gSelected
GUISelectedStorage gSelected
A global holder of selected objects.
Definition: GUIGlobalSelection.cpp:33
MID_HOTKEY_F3_SUPERMODE_NETWORK
@ MID_HOTKEY_F3_SUPERMODE_NETWORK
hot key <F3> set network mode in NETEDIT
Definition: GUIAppEnum.h:169
GNEViewParent::getTLSEditorFrame
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_NMODE_TLS
Definition: GNEViewParent.cpp:198
GNEViewNet::onCmdToogleHideShapes
long onCmdToogleHideShapes(FXObject *, FXSelector, void *)
toogle hide shapes in super mode demand
Definition: GNEViewNet.cpp:2348
GNELoadThread::setDefaultOptions
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
Definition: GNELoadThread.cpp:297
GNEApplicationWindow::SupermodeCommands::buildSupermodeCommands
void buildSupermodeCommands(FXMenuPane *editMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1622
MID_LOCATEVEHICLE
@ MID_LOCATEVEHICLE
Locate vehicle - button.
Definition: GUIAppEnum.h:326
GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::buildNetworkMenuCommands
void buildNetworkMenuCommands(FXMenuPane *editMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1225
GNEViewParent::onCmdLocate
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
Definition: GNEViewParent.cpp:400
GNEViewNet::onCmdToogleShowGrid
long onCmdToogleShowGrid(FXObject *, FXSelector, void *)
toogle show grid
Definition: GNEViewNet.cpp:2258
GNELoadThread::fillOptions
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
Definition: GNELoadThread.cpp:200
GNEApplicationWindow::getBuildGLCanvas
FXGLCanvas * getBuildGLCanvas() const
Definition: GNEApplicationWindow.cpp:1703
GUISUMOAbstractView::addDecals
void addDecals(const std::vector< Decal > &decals)
add decals
Definition: GUISUMOAbstractView.cpp:230
FileHelpers::isReadable
static bool isReadable(std::string path)
Checks whether the given file is readable.
Definition: FileHelpers.cpp:49
GUITextureSubSys::resetTextures
static void resetTextures()
Reset textures.
Definition: GUITextureSubSys.cpp:175
ICON_MODEINSPECT
@ ICON_MODEINSPECT
Definition: GUIIcons.h:226
MID_HOTKEY_P_POLYGONMODE_PERSONMODE
@ MID_HOTKEY_P_POLYGONMODE_PERSONMODE
hotkey for mode creating polygons
Definition: GUIAppEnum.h:57
GNEApplicationWindow::MenuBarFile::myRecentNets
FXRecentFiles myRecentNets
List of recent nets.
Definition: GNEApplicationWindow.h:460
GNEApplicationWindow::fillMenuBar
void fillMenuBar()
Builds the menu bar.
Definition: GNEApplicationWindow.cpp:1637
MID_RECENTFILE
@ MID_RECENTFILE
Loads a file previously loaded.
Definition: GUIAppEnum.h:245
MID_HOTKEY_CTRL_Y_REDO
@ MID_HOTKEY_CTRL_Y_REDO
Undo.
Definition: GUIAppEnum.h:113
NBFrame.h
GUIDialog_Options
Definition: GUIDialog_Options.h:35
GNEViewNetHelper::NetworkViewOptions::menuCheckChainEdges
FXMenuCheck * menuCheckChainEdges
menu check to the endpoint for a created edge should be set as the new source
Definition: GNEViewNetHelper.h:414
MID_HOTKEY_ALT_0_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_0_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:123
GNEApplicationWindow::updateControls
void updateControls()
update control contents after undo/redo or recompute
Definition: GNEApplicationWindow.cpp:3175
GNEApplicationWindow::onUpdSaveNetwork
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
Definition: GNEApplicationWindow.cpp:3016
GNEApplicationWindow::getToolbarsGrip
ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
Definition: GNEApplicationWindow.cpp:1728
MID_HOTKEY_ALT_3_TOOGLEEDITOPTION
@ MID_HOTKEY_ALT_3_TOOGLEEDITOPTION
toogle edit option
Definition: GUIAppEnum.h:129
ICON_MODEPROHIBITION
@ ICON_MODEPROHIBITION
Definition: GUIIcons.h:231
GNEApplicationWindow::onCmdEditChosen
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
Definition: GNEApplicationWindow.cpp:508
SystemFrame::checkOptions
static bool checkOptions()
checks shared options and sets StdDefs
Definition: SystemFrame.cpp:120
GNEViewNet::getEditModes
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
Definition: GNEViewNet.cpp:434
MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS
@ MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS
Save Additional Elements.
Definition: GUIAppEnum.h:151
GNEViewNetHelper::NetworkViewOptions::menuCheckChangeAllPhases
FXMenuCheck * menuCheckChangeAllPhases
menu check to set change all phases
Definition: GNEViewNetHelper.h:402
GNEApplicationWindow::onCmdRedo
long onCmdRedo(FXObject *, FXSelector, void *)
Definition: GNEApplicationWindow.cpp:2546
GNEApplicationWindow::enableUndoRedo
void enableUndoRedo()
disable undo-redo
Definition: GNEApplicationWindow.cpp:3213
GNEApplicationWindow::myHelpMenu
FXMenuPane * myHelpMenu
Definition: GNEApplicationWindow.h:417
GNEApplicationWindow::onCmdLoadAdditionalsInSUMOGUI
long onCmdLoadAdditionalsInSUMOGUI(FXObject *, FXSelector, void *)
called when user toogle windows checkbox "load additionals"
Definition: GNEApplicationWindow.cpp:835
MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMAND
Perform a single simulation step in SUMO and open Demand Elements in NETEDIT.
Definition: GUIAppEnum.h:83
GNEApplicationWindow::myEditMenu
FXMenuPane * myEditMenu
Definition: GNEApplicationWindow.h:413
GNEApplicationWindow::EditMenuCommands::editViewPort
FXMenuCommand * editViewPort
FXMenuCommand for edit view port.
Definition: GNEApplicationWindow.h:629
GNEApplicationWindow::myUndoList
GNEUndoList * myUndoList
the one and only undo list
Definition: GNEApplicationWindow.h:438
MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elemements in NETEDIT.
Definition: GUIAppEnum.h:77
GUIPerspectiveChanger::getXPos
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
GNEViewNet::getCommonViewOptions
const GNEViewNetHelper::CommonViewOptions & getCommonViewOptions() const
get Common view options
Definition: GNEViewNet.cpp:446
MID_HOTKEY_I_INSPECTMODE
@ MID_HOTKEY_I_INSPECTMODE
hotkey for mode inspecting object attributes
Definition: GUIAppEnum.h:53
GNEUndoList::p_onUpdUndo
long p_onUpdUndo(FXObject *, FXSelector, void *)
Definition: GNEUndoList.cpp:151
GNEInspectorFrame.h
GNEApplicationWindow::EditMenuCommands::loadDemandInSUMOGUI
FXMenuCheck * loadDemandInSUMOGUI
menu check for load demand in SUMO GUI
Definition: GNEApplicationWindow.h:638
GNEViewNet::saveVisualizationSettings
void saveVisualizationSettings() const
Definition: GNEViewNet.cpp:406
GNEUndoList
Definition: GNEUndoList.h:48
GNEApplicationWindow::myConfigPattern
std::string myConfigPattern
Input file pattern.
Definition: GNEApplicationWindow.h:441
GNEViewNet::onCmdToogleShowJunctionBubbles
long onCmdToogleShowJunctionBubbles(FXObject *, FXSelector, void *)
toogle show junction bubbles
Definition: GNEViewNet.cpp:2288
GNEApplicationWindow::onCmdSaveTLSProgramsAs
long onCmdSaveTLSProgramsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms as is executed
Definition: GNEApplicationWindow.cpp:2923
GUIDialog_Options.h
GNEViewNetHelper::DemandViewOptions::menuCheckHideShapes
FXMenuCheck * menuCheckHideShapes
Hide shapes (Polygons and POIs)
Definition: GNEViewNetHelper.h:463
MID_HOTKEY_CTRL_N_NEWNETWORK
@ MID_HOTKEY_CTRL_N_NEWNETWORK
create new empty newtork
Definition: GUIAppEnum.h:97
GNEAdditionalHandler
Builds additional objects for GNENet (busStops, chargingStations, detectors, etc.....
Definition: GNEAdditionalHandler.h:47
GNEViewNet::onCmdToogleChainEdges
long onCmdToogleChainEdges(FXObject *, FXSelector, void *)
toogle chain edges
Definition: GNEViewNet.cpp:2312
MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
@ MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
Save Demand Elements.
Definition: GUIAppEnum.h:153
GNEViewNet::hotkeyDel
void hotkeyDel()
handle del keypress
Definition: GNEViewNet.cpp:899
GNEApplicationWindow::onCmdSaveAsPlainXML
long onCmdSaveAsPlainXML(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
Definition: GNEApplicationWindow.cpp:2647
GNEApplicationWindow::SupermodeCommands::showSupermodeCommands
void showSupermodeCommands()
show all menu commands
Definition: GNEApplicationWindow.cpp:1604
MID_LOCATEPOLY
@ MID_LOCATEPOLY
Locate polygons - button.
Definition: GUIAppEnum.h:340
NIFrame.h
GNEApplicationWindow::myEvents
FXSynchQue< GUIEvent * > myEvents
List of got requests.
Definition: GNEApplicationWindow.h:426
GNEApplicationWindow::onCmdOpenConfiguration
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
called when the command/FXCall open configuration is executed
Definition: GNEApplicationWindow.cpp:533
GNEApplicationWindow::ToolbarsGrip::buildMenuToolbarsGrip
void buildMenuToolbarsGrip()
build menu toolbar grips
Definition: GNEApplicationWindow.cpp:270
GNEUndoList::p_begin
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:72
GNENet::computeDemandElements
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition: GNENet.cpp:1538
GNEApplicationWindow::EditMenuCommands::NetworkMenuCommands::showNetworkMenuCommands
void showNetworkMenuCommands()
show all menu commands
Definition: GNEApplicationWindow.cpp:1187
GUISettingsHandler::addSettings
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
Definition: GUISettingsHandler.cpp:368
GNEApplicationWindow::onCmdEditViewport
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
Definition: GNEApplicationWindow.cpp:2225
GNEApplicationWindow::onCmdLocate
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
Definition: GNEApplicationWindow.cpp:810
MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in NETEDIT.
Definition: GUIAppEnum.h:101
GNEApplicationWindow::getTrackerInterval
double getTrackerInterval() const
get current tracker interval (pure virtual but we don't need it)
Definition: GNEApplicationWindow.cpp:1716
VERSION_STRING
#define VERSION_STRING
Definition: config.h:210
GNENet::getNumberOfAdditionals
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:2210
GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::DemandMenuCommands
DemandMenuCommands(const EditMenuCommands *editMenuCommandsParent)
constructor
Definition: GNEApplicationWindow.cpp:1271
GNEApplicationWindow::updateSuperModeMenuCommands
void updateSuperModeMenuCommands(int supermode)
update FXMenuCommands
Definition: GNEApplicationWindow.cpp:3184
GNEApplicationWindow::onCmdProcessButton
long onCmdProcessButton(FXObject *, FXSelector sel, void *)
called when user press a process button (or a shortcut)
Definition: GNEApplicationWindow.cpp:2007
MID_LOCATEADD
@ MID_LOCATEADD
Locate addtional structure - button.
Definition: GUIAppEnum.h:336
GNEApplicationWindow::MenuBarFile::buildRecentFiles
void buildRecentFiles(FXMenuPane *fileMenu)
build recent files
Definition: GNEApplicationWindow.cpp:1034
MID_HOTKEY_E_EDGEMODE
@ MID_HOTKEY_E_EDGEMODE
hotkey for mode adding edges
Definition: GUIAppEnum.h:51
GNEApplicationWindow::GNEApplicationWindow
GNEApplicationWindow()
FOX needs this for static members.
Definition: GNEApplicationWindow.cpp:3227
GeoConvHelper::resetLoaded
static void resetLoaded()
resets loaded location elements
Definition: GeoConvHelper.cpp:550
GNEApplicationWindow::FileMenuCommands::saveTLSPrograms
FXMenuCommand * saveTLSPrograms
FXMenuCommand for enable or disable save additionals.
Definition: GNEApplicationWindow.h:483
MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE
@ MID_HOTKEY_R_CROSSINGMODE_ROUTEMODE
hotkey for mode editing crossing AND routes
Definition: GUIAppEnum.h:61
GNEApplicationWindow::ProcessingMenuCommands::buildProcessingMenuCommands
void buildProcessingMenuCommands(FXMenuPane *editMenu)
build menu commands
Definition: GNEApplicationWindow.cpp:1423
GNEApplicationWindow::EditMenuCommands::DemandMenuCommands::showDemandMenuCommands
void showDemandMenuCommands()
show all menu commands
Definition: GNEApplicationWindow.cpp:1285
WRITE_ERROR
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:283
GNENet::isNetSaved
bool isNetSaved() const
return if net has to be saved
Definition: GNENet.cpp:994
GNENet::cleanUnusedRoutes
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition: GNENet.cpp:1805
GNEViewNet::onCmdToogleAutoOppositeEdge
long onCmdToogleAutoOppositeEdge(FXObject *, FXSelector, void *)
toogle autoOpposite edge
Definition: GNEViewNet.cpp:2324
GNEApplicationWindow::ProcessingMenuCommands::hideNetworkProcessingMenuCommands
void hideNetworkProcessingMenuCommands()
show network processing menu commands
Definition: GNEApplicationWindow.cpp:1479
GNEApplicationWindow::onCmdOpenForeign
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
Definition: GNEApplicationWindow.cpp:588
GNEApplicationWindow::EditMenuCommands::myGNEApp
GNEApplicationWindow * myGNEApp
pointer to current GNEApplicationWindows
Definition: GNEApplicationWindow.h:610
MID_HOTKEY_M_MOVEMODE
@ MID_HOTKEY_M_MOVEMODE
hotkey for mode moving element
Definition: GUIAppEnum.h:55
MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND
@ MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND
compute Network in network mode and Demand elements in demand mode
Definition: GUIAppEnum.h:173
GUIEvent_Message
Definition: GUIEvent_Message.h:38
WRITE_MESSAGE
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:277
GNEApplicationWindow::onCmdBackspace
long onCmdBackspace(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits backspace
Definition: GNEApplicationWindow.cpp:2203
WRITE_DEBUG
#define WRITE_DEBUG(msg)
Definition: MsgHandler.h:284
GUITextureSubSys.h
FXDEFMAP
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
GNEViewNetHelper::DemandViewOptions::menuCheckLockPerson
FXMenuCheck * menuCheckLockPerson
Lock Person.
Definition: GNEViewNetHelper.h:472
GNENet::saveDemandElements
void saveDemandElements(const std::string &filename)
save demand element elements of the network
Definition: GNENet.cpp:2411
ICON_NETEDIT_MINI
@ ICON_NETEDIT_MINI
Definition: GUIIcons.h:181
GNEApplicationWindow::EditMenuCommands::EditMenuCommands
EditMenuCommands(GNEApplicationWindow *GNEApp)
constructor
Definition: GNEApplicationWindow.cpp:1344
GNENet.h
MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES
@ MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES
clean junctions without edges in network mode and unused routes in demand mode
Definition: GUIAppEnum.h:175
GNEApplicationWindow::onCmdSaveAdditionals
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
Definition: GNEApplicationWindow.cpp:2804
GNEApplicationWindow::myFileMenuAdditionals
FXMenuPane * myFileMenuAdditionals
Definition: GNEApplicationWindow.h:410
GNEViewNet::getViewParent
GNEViewParent * getViewParent() const
get the net object
Definition: GNEViewNet.cpp:1008
GNERouteHandler.h
GUIGlChildWindow::getView
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
Definition: GUIGlChildWindow.cpp:99
GNEViewNetHelper::NetworkViewOptions::menuCheckMoveElevation
FXMenuCheck * menuCheckMoveElevation
menu check to apply movement to elevation
Definition: GNEViewNetHelper.h:411
MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition: GUIAppEnum.h:194
GNEInspectorFrame::TemplateEditor::setTemplate
void setTemplate()
set template (used by shortcut)
Definition: GNEInspectorFrame.cpp:935
XMLSubSys.h
GNEUndoList.h
GNEApplicationWindow::myMDIMenu
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
Definition: GNEApplicationWindow.h:794
ICON_JOINJUNCTIONS
@ ICON_JOINJUNCTIONS
Definition: GUIIcons.h:249
GUIDialog_GLChosenEditor
Editor for the list of chosen objects.
Definition: GUIDialog_GLChosenEditor.h:49
ICON_LOCATESTOP
@ ICON_LOCATESTOP
Definition: GUIIcons.h:79
GNEApplicationWindow::EditMenuCommands::networkMenuCommands
NetworkMenuCommands networkMenuCommands
Network Menu Commands.
Definition: GNEApplicationWindow.h:614
GNEViewNetHelper::NetworkViewOptions::menuCheckSelectEdges
FXMenuCheck * menuCheckSelectEdges
menu check to select only edges
Definition: GNEViewNetHelper.h:390
MID_HOTKEY_A_ADDITIONALMODE_STOPMODE
@ MID_HOTKEY_A_ADDITIONALMODE_STOPMODE
hotkey for mode editing additionals AND stops
Definition: GUIAppEnum.h:45