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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The main window of Netedit (adapted from GUIApplicationWindow)
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #ifdef HAVE_VERSION_H
31 #include <version.h>
32 #endif
33 
34 #include <string>
35 #include <sstream>
36 #include <algorithm>
37 
38 #include <utils/common/ToString.h>
41 #include <utils/xml/XMLSubSys.h>
51 #include <utils/gui/div/GLHelper.h>
58 #include <netimport/NIFrame.h>
59 #include <netbuild/NBFrame.h>
60 #include <netwrite/NWFrame.h>
63 
64 #include "GNEApplicationWindow.h"
65 #include "GNELoadThread.h"
66 #include "GNEEvent_NetworkLoaded.h"
67 #include "GNEViewParent.h"
68 #include "GNEViewNet.h"
69 #include "GNEDialog_About.h"
70 #include "GNEDialog_Wizard.h"
71 #include "GNENet.h"
72 #include "GNEEdge.h"
73 #include "GNEJunction.h"
74 #include "GNEUndoList.h"
75 #include "GNEPOI.h"
76 #include "GNEAdditionalHandler.h"
77 
78 
79 // ===========================================================================
80 // FOX-declarations
81 // ===========================================================================
82 FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[] = {
83  // quit calls
84  FXMAPFUNC(SEL_COMMAND, MID_QUIT, GNEApplicationWindow::onCmdQuit),
85  FXMAPFUNC(SEL_SIGNAL, MID_QUIT, GNEApplicationWindow::onCmdQuit),
86  FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GNEApplicationWindow::onCmdQuit),
87 
88  // toolbar file
92  FXMAPFUNC(SEL_UPDATE, MID_OPEN_NETWORK, GNEApplicationWindow::onUpdOpen),
94  FXMAPFUNC(SEL_UPDATE, MID_OPEN_CONFIG, GNEApplicationWindow::onUpdOpen),
101  FXMAPFUNC(SEL_COMMAND, MID_RECENTFILE, GNEApplicationWindow::onCmdOpenRecent),
102  FXMAPFUNC(SEL_UPDATE, MID_RECENTFILE, GNEApplicationWindow::onUpdOpen),
103  FXMAPFUNC(SEL_COMMAND, MID_RELOAD, GNEApplicationWindow::onCmdReload),
104  FXMAPFUNC(SEL_UPDATE, MID_RELOAD, GNEApplicationWindow::onUpdReload),
119  FXMAPFUNC(SEL_COMMAND, MID_CLOSE, GNEApplicationWindow::onCmdClose),
120  FXMAPFUNC(SEL_UPDATE, MID_CLOSE, GNEApplicationWindow::onUpdNeedsNetwork),
121 
122  // Toolbar edit
143 
144  // Toolbar processing
156 
157  // Toolbar locate
158  FXMAPFUNC(SEL_COMMAND, MID_LOCATEJUNCTION, GNEApplicationWindow::onCmdLocate),
160  FXMAPFUNC(SEL_COMMAND, MID_LOCATEEDGE, GNEApplicationWindow::onCmdLocate),
162  FXMAPFUNC(SEL_COMMAND, MID_LOCATETLS, GNEApplicationWindow::onCmdLocate),
164  FXMAPFUNC(SEL_COMMAND, MID_LOCATEADD, GNEApplicationWindow::onCmdLocate),
166  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOI, GNEApplicationWindow::onCmdLocate),
168  FXMAPFUNC(SEL_COMMAND, MID_LOCATEPOLY, GNEApplicationWindow::onCmdLocate),
170 
171  // toolbar windows
173 
174  // toolbar help
175  FXMAPFUNC(SEL_COMMAND, MID_ABOUT, GNEApplicationWindow::onCmdAbout),
176 
177  // key events
178  FXMAPFUNC(SEL_KEYPRESS, 0, GNEApplicationWindow::onKeyPress),
179  FXMAPFUNC(SEL_KEYRELEASE, 0, GNEApplicationWindow::onKeyRelease),
180  FXMAPFUNC(SEL_COMMAND, MID_GNE_HOTKEY_ESC, GNEApplicationWindow::onCmdAbort),
181  FXMAPFUNC(SEL_COMMAND, MID_GNE_HOTKEY_DEL, GNEApplicationWindow::onCmdDel),
183 
184  // threads events
187 
188  // Other
190  FXMAPFUNC(SEL_COMMAND, MID_HELP, GNEApplicationWindow::onCmdHelp),
192  FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest),
193 };
194 
195 // Object implementation
196 FXIMPLEMENT(GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
197 
198 // ===========================================================================
199 // member method definitions
200 // ===========================================================================
201 #ifdef _MSC_VER
202 #pragma warning(push)
203 #pragma warning(disable: 4355)
204 #endif
205 GNEApplicationWindow::GNEApplicationWindow(FXApp* a, const std::string& configPattern) :
206  GUIMainWindow(a),
207  myLoadThread(0),
208  myAmLoading(false),
209  myRecentNets(a, "nets"),
210  myConfigPattern(configPattern),
211  hadDependentBuild(false),
212  myNet(0),
213  myUndoList(new GNEUndoList(this)),
214  myTitlePrefix("NETEDIT " VERSION_STRING) {
215  // init icons
217  // init Textures
219 }
220 #ifdef _MSC_VER
221 #pragma warning(pop)
222 #endif
223 
224 
225 void
227  // do this not twice
228  if (hadDependentBuild) {
229  WRITE_ERROR("DEBUG: GNEApplicationWindow::dependentBuild called twice");
230  return;
231  }
232  hadDependentBuild = true;
233 
234  setTarget(this);
235  setSelector(MID_WINDOW);
236 
237  // build menu bar
238  myMenuBarDrag = new FXToolBarShell(this, GUIDesignToolBarShell3);
239  myMenuBar = new FXMenuBar(myTopDock, myMenuBarDrag, GUIDesignBar);
240  new FXToolBarGrip(myMenuBar, myMenuBar, FXMenuBar::ID_TOOLBARGRIP, GUIDesignToolBarGrip);
241  // build the thread - io
244 
245  // build the status bar
246  myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
247  {
248  myGeoFrame =
249  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
250  myGeoCoordinate = new FXLabel(myGeoFrame, "N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", 0, LAYOUT_CENTER_Y);
252  new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
253  myCartesianCoordinate = new FXLabel(myCartesianFrame, "N/A\t\tNetwork coordinate", 0, LAYOUT_CENTER_Y);
254  }
255  // make the window a mdi-window
256  myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
257  myMDIClient = new FXMDIClient(myMainSplitter, GUIDesignSplitterMDI);
258  myMDIMenu = new FXMDIMenu(this, myMDIClient);
259  // Due netedit only have a view, this buttons must be disabled (see #2807)
260  //new FXMDIWindowButton(myMenuBar, myMDIMenu, myMDIClient, FXMDIClient::ID_MDI_MENUWINDOW, GUIDesignMDIButtonLeft);
261  //new FXMDIDeleteButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENUCLOSE, GUIDesignMDIButtonRight);
262  //new FXMDIRestoreButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENURESTORE, GUIDesignMDIButtonRight);
263  //new FXMDIMinimizeButton(myMenuBar, myMDIClient, FXMDIClient::ID_MDI_MENUMINIMIZE, GUIDesignMDIButtonRight);
264 
265  // build the message window
267  myMainSplitter->setSplit(1, 65);
268  // fill menu and tool bar
269  fillMenuBar();
270  // build additional threads
271  myLoadThread = new GNELoadThread(getApp(), this, myEvents, myLoadThreadEvent);
272  // set the status bar
273  myStatusbar->getStatusLine()->setText("Ready.");
274  // set the caption
275  setTitle(myTitlePrefix);
276 
278 
279  //initialize some hotkeys
280  getAccelTable()->addAccel(parseAccel("e"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_CREATE_EDGE));
281  getAccelTable()->addAccel(parseAccel("m"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_MOVE));
282  getAccelTable()->addAccel(parseAccel("d"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_DELETE));
283  getAccelTable()->addAccel(parseAccel("i"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_INSPECT));
284  getAccelTable()->addAccel(parseAccel("s"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_SELECT));
285  getAccelTable()->addAccel(parseAccel("c"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_CONNECT));
286  getAccelTable()->addAccel(parseAccel("t"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_TLS));
287  getAccelTable()->addAccel(parseAccel("a"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_ADDITIONAL));
288  getAccelTable()->addAccel(parseAccel("r"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_CROSSING));
289  getAccelTable()->addAccel(parseAccel("p"), this, FXSEL(SEL_COMMAND, MID_GNE_SETMODE_POLYGON));
290  getAccelTable()->addAccel(parseAccel("Esc"), this, FXSEL(SEL_COMMAND, MID_GNE_HOTKEY_ESC));
291  getAccelTable()->addAccel(parseAccel("Del"), this, FXSEL(SEL_COMMAND, MID_GNE_HOTKEY_DEL));
292  getAccelTable()->addAccel(parseAccel("Enter"), this, FXSEL(SEL_COMMAND, MID_GNE_HOTKEY_ENTER));
293  getAccelTable()->addAccel(parseAccel("F12"), this, FXSEL(SEL_COMMAND, MID_GNE_HOTKEY_FOCUSFRAME));
294  getAccelTable()->addAccel(parseAccel("v"), this, FXSEL(SEL_COMMAND, MID_EDITVIEWPORT));
295 }
296 
297 void
300  gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
301  FXMainWindow::create();
302  myMenuBarDrag->create();
303  myFileMenu->create();
304  myEditMenu->create();
305  //mySettingsMenu->create();
306  myWindowsMenu->create();
307  myHelpMenu->create();
308 
309  FXint textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 22;
310  myCartesianFrame->setWidth(textWidth);
311  myGeoFrame->setWidth(textWidth);
312 
313  show(PLACEMENT_DEFAULT);
314  if (!OptionsCont::getOptions().isSet("window-size")) {
315  if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
316  maximize();
317  }
318  }
319 
320 }
321 
322 
324  closeAllWindows();
325  // Close icons
327  // Close gifs (Textures)
329  delete myGLVisual;
330  // must delete menus to avoid segfault on removing accelerators
331  // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s)
332  delete myFileMenu;
333  delete myEditMenu;
334  delete myLocatorMenu;
335  delete myProcessingMenu;
336  delete myWindowsMenu;
337  delete myHelpMenu;
338 
339  delete myLoadThread;
340 
341  while (!myEvents.empty()) {
342  // get the next event
343  GUIEvent* e = myEvents.top();
344  myEvents.pop();
345  delete e;
346  }
347  delete myUndoList;
348 }
349 
350 
351 void
353  FXMainWindow::detach();
354  myMenuBarDrag->detach();
355 }
356 
357 
358 void
360  // build file menu
361  myFileMenu = new FXMenuPane(this);
362  new FXMenuTitle(myMenuBar, "&File", 0, myFileMenu);
363  new FXMenuCommand(myFileMenu,
364  "&New Network...\tCtrl+N\tCreate a new network.",
366  new FXMenuCommand(myFileMenu,
367  "&Open Network...\tCtrl+O\tOpen a SUMO network.",
369  new FXMenuCommand(myFileMenu,
370  "Open Configura&tion...\tCtrl+T\tOpen a NETCONVERT configuration file.",
372  new FXMenuCommand(myFileMenu,
373  "Import &Foreign Network...\t\tImport a foreign network such as OSM.",
375  new FXMenuCommand(myFileMenu,
376  "Load S&hapes...\tCtrl+P\tLoad shapes into the network view.",
378  new FXMenuCommand(myFileMenu,
379  "Load A&dditionals...\tCtrl+D\tLoad additional elements.",
381  new FXMenuCommand(myFileMenu,
382  "&Reload\tCtrl+R\tReloads the network.",
384  new FXMenuCommand(myFileMenu,
385  "&Save Network...\tCtrl+S\tSave the network.",
387  new FXMenuCommand(myFileMenu,
388  "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.",
390  new FXMenuCommand(myFileMenu,
391  "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.",
393  new FXMenuCommand(myFileMenu,
394  "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).",
396  mySaveShapesMenuCommand = new FXMenuCommand(myFileMenu,
397  "Save Shapes\tCtrl+Shift+P\tSave shapes elements.",
399  mySaveShapesMenuCommand->disable();
400  new FXMenuCommand(myFileMenu,
401  "Save Shapes As...\t\tSave shapes elements in another files.",
403  mySaveAdditionalsMenuCommand = new FXMenuCommand(myFileMenu,
404  "Save Additionals\tCtrl+Shift+D\tSave additional elements.",
406  mySaveAdditionalsMenuCommand->disable();
407  new FXMenuCommand(myFileMenu,
408  "Save Additionals As...\t\tSave additional elements in another file.",
410  new FXMenuSeparator(myFileMenu);
411  new FXMenuCommand(myFileMenu,
412  "Close\tCtrl+W\tClose the net&work.",
414  // Recent files
415  FXMenuSeparator* sep1 = new FXMenuSeparator(myFileMenu);
416  sep1->setTarget(&myRecentConfigs);
417  sep1->setSelector(FXRecentFiles::ID_ANYFILES);
418  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_1);
419  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_2);
420  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_3);
421  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_4);
422  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_5);
423  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_6);
424  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_7);
425  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_8);
426  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_9);
427  new FXMenuCommand(myFileMenu, "", 0, &myRecentConfigs, FXRecentFiles::ID_FILE_10);
428  new FXMenuCommand(myFileMenu, "Clear Recent Configurat&ions", 0, &myRecentConfigs, FXRecentFiles::ID_CLEAR);
429  myRecentConfigs.setTarget(this);
430  myRecentConfigs.setSelector(MID_RECENTFILE);
431  FXMenuSeparator* sep2 = new FXMenuSeparator(myFileMenu);
432  sep2->setTarget(&myRecentNets);
433  sep2->setSelector(FXRecentFiles::ID_ANYFILES);
434  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_1);
435  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_2);
436  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_3);
437  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_4);
438  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_5);
439  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_6);
440  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_7);
441  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_8);
442  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_9);
443  new FXMenuCommand(myFileMenu, "", 0, &myRecentNets, FXRecentFiles::ID_FILE_10);
444  new FXMenuCommand(myFileMenu, "Cl&ear Recent Networks", 0, &myRecentNets, FXRecentFiles::ID_CLEAR);
445  myRecentNets.setTarget(this);
446  myRecentNets.setSelector(MID_RECENTFILE);
447  new FXMenuSeparator(myFileMenu);
448  new FXMenuCommand(myFileMenu,
449  "&Quit\tCtrl+Q\tQuit the Application.",
450  0, this, MID_QUIT, 0);
451 
452  // build edit menu
453  myEditMenu = new FXMenuPane(this);
454  new FXMenuTitle(myMenuBar, "&Edit", 0, myEditMenu);
455 
456  // build undo/redo command
457  new FXMenuCommand(myEditMenu,
458  "&Undo\tCtrl+Z\tUndo the last change.",
459  GUIIconSubSys::getIcon(ICON_UNDO), myUndoList, FXUndoList::ID_UNDO);
460  new FXMenuCommand(myEditMenu,
461  "&Redo\tCtrl+Y\tRedo the last change.",
462  GUIIconSubSys::getIcon(ICON_REDO), myUndoList, FXUndoList::ID_REDO);
463 
464  new FXMenuSeparator(myEditMenu);
465 
466  // build modes command
467  new FXMenuCommand(myEditMenu,
468  "&Edge mode\tE\tCreate junction and edges.",
470  new FXMenuCommand(myEditMenu,
471  "&Move mode\tM\tMove elements.",
473  new FXMenuCommand(myEditMenu,
474  "&Delete mode\tD\tDelete elements.",
476  new FXMenuCommand(myEditMenu,
477  "&Inspect mode\tI\tInspect elements and change their attributes.",
479  new FXMenuCommand(myEditMenu,
480  "&Select mode\tS\tSelect elements.",
482  new FXMenuCommand(myEditMenu,
483  "&Connection mode\tC\tEdit connections between lanes.",
485  new FXMenuCommand(myEditMenu,
486  "&Traffic light mode\tT\tEdit traffic lights over junctions.",
488  new FXMenuCommand(myEditMenu,
489  "&Additional mode\tA\tCreate additional elements.",
491  new FXMenuCommand(myEditMenu,
492  "C&rossing mode\tR\tCreate crossings between edges.",
494  new FXMenuCommand(myEditMenu,
495  "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.",
497 
498  /*
499  new FXMenuSeparator(myEditMenu);
500  new FXMenuCommand(myEditMenu,
501  "Edit Breakpoints...\t\tOpens a Dialog for editing breakpoints.",
502  0, this, MID_EDIT_BREAKPOINTS);
503  */
504 
505  // processing menu (trigger netbuild computations)
506  myProcessingMenu = new FXMenuPane(this);
507  new FXMenuTitle(myMenuBar, "&Processing", 0, myProcessingMenu);
508  new FXMenuCommand(myProcessingMenu,
509  "Compute Junctions\tF5\tComputes junction shape and logic.",
511  new FXMenuCommand(myProcessingMenu,
512  "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.",
514  new FXMenuCommand(myProcessingMenu,
515  "Clean Junctions\tF6\tRemoves solitary junctions.",
517  new FXMenuCommand(myProcessingMenu,
518  "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.",
520  new FXMenuCommand(myProcessingMenu,
521  "Clean invalid crossings\tF8\tClear invalid crossings.",
523  new FXMenuCommand(myProcessingMenu,
524  "Options\tF10\t\tConfigure Processing Options.",
526  // build settings menu
527  /*
528  mySettingsMenu = new FXMenuPane(this);
529  new FXMenuTitle(myMenuBar,"&Settings",0,mySettingsMenu);
530  new FXMenuCheck(mySettingsMenu,
531  "Gaming Mode\t\tToggle gaming mode on/off.",
532  this,MID_GAMING);
533  */
534  // build Locate menu
535  myLocatorMenu = new FXMenuPane(this);
536  new FXMenuTitle(myMenuBar, "&Locate", NULL, myLocatorMenu);
537  new FXMenuCommand(myLocatorMenu,
538  "Locate &Junctions\tShift+J\tOpen a Dialog for Locating a Junction.",
540  new FXMenuCommand(myLocatorMenu,
541  "Locate &Edges\tShift+E\tOpen a Dialog for Locating an Edge.",
543  new FXMenuCommand(myLocatorMenu,
544  "Locate &TLS\tShift+T\tOpen a Dialog for Locating a Traffic Light.",
546  new FXMenuCommand(myLocatorMenu,
547  "Locate &Additional\tShift+A\tOpen a Dialog for Locating an Additional Structure.",
549  new FXMenuCommand(myLocatorMenu,
550  "Locate P&oI\tShift+O\tOpen a Dialog for Locating a Point of Intereset.",
552  new FXMenuCommand(myLocatorMenu,
553  "Locate Po&lygon\tShift+L\tOpen a Dialog for Locating a Polygon.",
555  // build windows menu
556  myWindowsMenu = new FXMenuPane(this);
557  new FXMenuTitle(myMenuBar, "&Windows", 0, myWindowsMenu);
558  new FXMenuCheck(myWindowsMenu,
559  "&Show Status Line\t\tToggle this Status Bar on/off.",
560  myStatusbar, FXWindow::ID_TOGGLESHOWN);
561  new FXMenuCheck(myWindowsMenu,
562  "Show &Message Window\t\tToggle the Message Window on/off.",
563  myMessageWindow, FXWindow::ID_TOGGLESHOWN);
564  /*
565  new FXMenuSeparator(myWindowsMenu);
566  new FXMenuCommand(myWindowsMenu,"Tile &Horizontally",
567  GUIIconSubSys::getIcon(ICON_WINDOWS_TILE_HORI),
568  myMDIClient,FXMDIClient::ID_MDI_TILEHORIZONTAL);
569  new FXMenuCommand(myWindowsMenu,"Tile &Vertically",
570  GUIIconSubSys::getIcon(ICON_WINDOWS_TILE_VERT),
571  myMDIClient,FXMDIClient::ID_MDI_TILEVERTICAL);
572  new FXMenuCommand(myWindowsMenu,"C&ascade",
573  GUIIconSubSys::getIcon(ICON_WINDOWS_CASCADE),
574  myMDIClient,FXMDIClient::ID_MDI_CASCADE);
575  new FXMenuCommand(myWindowsMenu,"&Close",0,
576  myMDIClient,FXMDIClient::ID_MDI_CLOSE);
577  sep1=new FXMenuSeparator(myWindowsMenu);
578  sep1->setTarget(myMDIClient);
579  sep1->setSelector(FXMDIClient::ID_MDI_ANY);
580  new FXMenuCommand(myWindowsMenu,"",0,myMDIClient,FXMDIClient::ID_MDI_1);
581  new FXMenuCommand(myWindowsMenu,"",0,myMDIClient,FXMDIClient::ID_MDI_2);
582  new FXMenuCommand(myWindowsMenu,"",0,myMDIClient,FXMDIClient::ID_MDI_3);
583  new FXMenuCommand(myWindowsMenu,"",0,myMDIClient,FXMDIClient::ID_MDI_4);
584  new FXMenuCommand(myWindowsMenu,"&Others...",0,myMDIClient,FXMDIClient::ID_MDI_OVER_5);
585  new FXMenuSeparator(myWindowsMenu);
586  */
587  new FXMenuCommand(myWindowsMenu,
588  "&Clear Message Window\t\tClear the message window.",
589  0, this, MID_CLEARMESSAGEWINDOW);
590 
591  // build help menu
592  myHelpMenu = new FXMenuPane(this);
593  new FXMenuTitle(myMenuBar,
594  "&Help",
595  0, myHelpMenu);
596  new FXMenuCommand(myHelpMenu,
597  "&Online Documentation\tF1\tOpen Online documentation.",
598  0, this, MID_HELP);
599  new FXMenuCommand(myHelpMenu,
600  "&About\tF2\tAbout netedit.",
601  0, this, MID_ABOUT);
602 }
603 
604 
605 long
606 GNEApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
608  getApp()->reg().writeIntEntry("SETTINGS", "x", getX());
609  getApp()->reg().writeIntEntry("SETTINGS", "y", getY());
610  getApp()->reg().writeIntEntry("SETTINGS", "width", getWidth());
611  getApp()->reg().writeIntEntry("SETTINGS", "height", getHeight());
612  getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
613  if (isMaximized()) {
614  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 1);
615  } else {
616  getApp()->reg().writeIntEntry("SETTINGS", "maximized", 0);
617  }
618  getApp()->exit(0);
619  }
620  return 1;
621 }
622 
623 
624 long
625 GNEApplicationWindow::onCmdEditChosen(FXObject*, FXSelector, void*) {
626  GUIDialog_GLChosenEditor* chooser =
628  chooser->create();
629  chooser->show();
630  return 1;
631 }
632 
633 
634 long
635 GNEApplicationWindow::onCmdNewNetwork(FXObject*, FXSelector, void*) {
636  // ask before we clobber options
638  return 1;
639  }
643  loadConfigOrNet("", true, false, true, true);
644  return 1;
645 }
646 
647 
648 long
649 GNEApplicationWindow::onCmdOpenConfiguration(FXObject*, FXSelector, void*) {
650  // get the new file name
651  FXFileDialog opendialog(this, "Open Netconvert Configuration");
652  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
653  opendialog.setSelectMode(SELECTFILE_EXISTING);
654  opendialog.setPatternList(myConfigPattern.c_str());
655  if (gCurrentFolder.length() != 0) {
656  opendialog.setDirectory(gCurrentFolder);
657  }
658  if (opendialog.execute()) {
659  gCurrentFolder = opendialog.getDirectory();
660  std::string file = opendialog.getFilename().text();
661  loadConfigOrNet(file, false);
662  myRecentConfigs.appendFile(file.c_str());
663  }
664  return 1;
665 }
666 
667 
668 long
669 GNEApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
670  // get the new file name
671  FXFileDialog opendialog(this, "Open Network");
672  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
673  opendialog.setSelectMode(SELECTFILE_EXISTING);
674  opendialog.setPatternList("SUMO nets (*.net.xml)\nAll files (*)");
675  if (gCurrentFolder.length() != 0) {
676  opendialog.setDirectory(gCurrentFolder);
677  }
678  if (opendialog.execute()) {
679  gCurrentFolder = opendialog.getDirectory();
680  std::string file = opendialog.getFilename().text();
681  loadConfigOrNet(file, true);
682  myRecentNets.appendFile(file.c_str());
683  // when a net is loaded, save additional and shapes are disabled
684  mySaveAdditionalsMenuCommand->disable();
685  mySaveShapesMenuCommand->disable();
686  }
687  return 1;
688 }
689 
690 
691 long
692 GNEApplicationWindow::onCmdOpenForeign(FXObject*, FXSelector, void*) {
693  // ask before we clobber options
695  return 1;
696  }
697  // get the new file name
698  FXFileDialog opendialog(this, "Import Foreign Network");
699  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
700  opendialog.setSelectMode(SELECTFILE_EXISTING);
701  FXString osmPattern("OSM net (*.osm.xml,*.osm)");
702  opendialog.setPatternText(0, osmPattern);
703  if (gCurrentFolder.length() != 0) {
704  opendialog.setDirectory(gCurrentFolder);
705  }
706  if (opendialog.execute()) {
707  gCurrentFolder = opendialog.getDirectory();
708  std::string file = opendialog.getFilename().text();
709 
712  if (osmPattern.contains(opendialog.getPattern())) {
713  oc.set("osm-files", file);
714  oc.set("ramps.guess", "true");
715  oc.set("tls.guess", "true");
716  } else {
717  throw ProcessError("Attempted to import unknown file format '" + file + "'.");
718  }
719 
720  GNEDialog_Wizard* wizard =
721  new GNEDialog_Wizard(this, "Select Import Options", getWidth(), getHeight());
722 
723  if (wizard->execute()) {
724  NIFrame::checkOptions(); // needed to set projection parameters
725  loadConfigOrNet(file, false, false, false);
726  }
727  }
728  return 1;
729 }
730 
731 
732 long
733 GNEApplicationWindow::onCmdOpenShapes(FXObject*, FXSelector, void*) {
734  // get the shape file name
735  FXFileDialog opendialog(this, "Open Shapes file");
736  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
737  opendialog.setSelectMode(SELECTFILE_EXISTING);
738  opendialog.setPatternList("Shape files (*.xml)\nAll files (*)");
739  if (gCurrentFolder.length() != 0) {
740  opendialog.setDirectory(gCurrentFolder);
741  }
742  if (opendialog.execute()) {
743  gCurrentFolder = opendialog.getDirectory();
744  std::string file = opendialog.getFilename().text();
745  GNEShapeHandler handler(file, myNet);
746  myUndoList->p_begin("Loading shapes from '" + file + "'");
747  if (!XMLSubSys::runParser(handler, file, false)) {
748  WRITE_MESSAGE("Loading of shapes failed.");
749  }
750  update();
751  myUndoList->p_end();
752  }
753  return 1;
754 }
755 
756 
757 long
758 GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
759  // get the shape file name
760  FXFileDialog opendialog(this, "Open Additionals file");
761  opendialog.setIcon(GUIIconSubSys::getIcon(ICON_EMPTY));
762  opendialog.setSelectMode(SELECTFILE_EXISTING);
763  opendialog.setPatternList("Additional files (*.xml)\nAll files (*)");
764  if (gCurrentFolder.length() != 0) {
765  opendialog.setDirectory(gCurrentFolder);
766  }
767  if (opendialog.execute()) {
768  gCurrentFolder = opendialog.getDirectory();
769  std::string file = opendialog.getFilename().text();
770  // Start operation for undo/redo
771  myUndoList->p_begin("load additionals");
772  // Create additional handler
773  GNEAdditionalHandler additionalHandler(file, myNet->getViewNet());
774  // Run parser
775  myUndoList->p_begin("Loading additionals from '" + file + "'");
776  if (!XMLSubSys::runParser(additionalHandler, file, false)) {
777  WRITE_MESSAGE("Loading of " + file + " failed.");
778  // Abort undo/redo
779  myUndoList->abort();
780  } else {
781  // commit undo/redo operation
782  myUndoList->p_end();
783  update();
784  }
785  myUndoList->p_end();
786  }
787  return 1;
788 }
789 
790 
791 long
792 GNEApplicationWindow::onCmdOpenRecent(FXObject* sender, FXSelector, void* fileData) {
793  if (myAmLoading) {
794  myStatusbar->getStatusLine()->setText("Already loading!");
795  return 1;
796  }
797  std::string file((const char*)fileData);
798  loadConfigOrNet(file, sender == &myRecentNets);
799  return 1;
800 }
801 
802 
803 long
804 GNEApplicationWindow::onCmdReload(FXObject*, FXSelector, void*) {
805  // @note. If another network has been load during this session, it might not be desirable to set useStartupOptions
806  loadConfigOrNet(OptionsCont::getOptions().getString("sumo-net-file"), true, true);
807  return 1;
808 }
809 
810 
811 long
812 GNEApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
814  closeAllWindows();
815  // disable save additionals and shapes menu
816  mySaveAdditionalsMenuCommand->disable();
817  mySaveShapesMenuCommand->disable();
818  }
819  return 1;
820 }
821 
822 
823 long
824 GNEApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
825  if (myMDIClient->numChildren() > 0) {
826  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
827  if (w != 0) {
828  w->onCmdLocate(0, sel, 0);
829  }
830  }
831  return 1;
832 }
833 
834 long
835 GNEApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void*) {
836  sender->handle(this, myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
837  return 1;
838 }
839 
840 
841 long
842 GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
844  return 1;
845 }
846 
847 
848 long
849 GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
850  // write warning if netedit is running in testing mode
851  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
852  WRITE_WARNING("Opening about dialog");
853  }
854  // create and open about dialog
855  GNEDialog_About* about = new GNEDialog_About(this);
856  about->create();
857  about->show(PLACEMENT_OWNER);
858  // write warning if netedit is running in testing mode
859  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
860  WRITE_WARNING("Closed about dialog");
861  }
862  return 1;
863 }
864 
865 
866 long GNEApplicationWindow::onClipboardRequest(FXObject*, FXSelector, void* ptr) {
867  FXEvent* event = (FXEvent*)ptr;
868  FXString string = GUIUserIO::clipped.c_str();
869  setDNDData(FROM_CLIPBOARD, event->target, string);
870  return 1;
871 }
872 
873 
874 long
875 GNEApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
876  eventOccured();
877  return 1;
878 }
879 
880 
881 void
883  while (!myEvents.empty()) {
884  // get the next event
885  GUIEvent* e = myEvents.top();
886  myEvents.pop();
887  // process
888  switch (e->getOwnType()) {
891  break;
894  case EVENT_ERROR_OCCURED:
896  break;
897  default:
898  break;
899  }
900  delete e;
901  }
902 }
903 
904 
905 void
907  myAmLoading = false;
908  GNEEvent_NetworkLoaded* ec = static_cast<GNEEvent_NetworkLoaded*>(e);
909  // check whether the loading was successfull
910  if (ec->myNet == 0) {
911  // report failure
912  setStatusBarText("Loading of '" + ec->myFile + "' failed!");
913  } else {
914  myNet = ec->myNet;
915  // report success
916  setStatusBarText("'" + ec->myFile + "' loaded.");
918  // initialise views
919  myViewNumber = 0;
921  if (view && ec->mySettingsFile != "") {
922  GUISettingsHandler settings(ec->mySettingsFile, true, true);
923  std::string settingsName = settings.addSettings(view);
924  view->addDecals(settings.getDecals());
925  settings.applyViewport(view);
926  settings.setSnapshots(view);
927  }
928  // set network name on the caption
929  setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->myFile.c_str()));
931  gSchemeStorage.setViewport(getView()); // refit the network to accomodate mode specific panel
932  if (ec->myViewportFromRegistry) {
933  Position off, p;
934  off.set(getApp()->reg().readRealEntry("viewport", "x"), getApp()->reg().readRealEntry("viewport", "y"), getApp()->reg().readRealEntry("viewport", "z"));
935  getView()->setViewportFromTo(off, p);
936  }
937  }
938  getApp()->endWaitCursor();
940  // check if additionals has to be loaded at start
941  if (OptionsCont::getOptions().isSet("sumo-additionals-file") && myNet) {
942  myAdditionalsFile = OptionsCont::getOptions().getString("sumo-additionals-file");
943  WRITE_MESSAGE("Loading additionals from '" + myAdditionalsFile + "'");
945  // Run parser
946  myUndoList->p_begin("Loading additionals from '" + myAdditionalsFile + "'");
947  if (!XMLSubSys::runParser(additionalHandler, myAdditionalsFile, false)) {
948  WRITE_ERROR("Loading of " + myAdditionalsFile + " failed.");
949  }
950  myUndoList->p_end();
951  }
952  // check if shapes has to be loaded at start
953  if (OptionsCont::getOptions().isSet("sumo-shapes-file") && myNet) {
954  myShapesFile = OptionsCont::getOptions().getString("sumo-shapes-file");
955  WRITE_MESSAGE("Loading shapes");
956  GNEShapeHandler shapeHandler(myShapesFile, myNet);
957  // Run parser
958  myUndoList->p_begin("Loading shapes from '" + myShapesFile + "'");
959  if (!XMLSubSys::runParser(shapeHandler, myShapesFile, false)) {
960  WRITE_ERROR("Loading of shapes failed.");
961  }
962  myUndoList->p_end();
963  }
964  // check if additionals output must be changed
965  if (OptionsCont::getOptions().isSet("additionals-output")) {
966  myAdditionalsFile = OptionsCont::getOptions().getString("additionals-output");
967  }
968  // check if shapes output must be changed
969  if (OptionsCont::getOptions().isSet("shapes-output")) {
970  myShapesFile = OptionsCont::getOptions().getString("shapes-output");
971  }
972 
973  update();
974 }
975 
976 
977 void
979  GUIEvent_Message* ec = static_cast<GUIEvent_Message*>(e);
981 }
982 
983 
984 void
985 GNEApplicationWindow::loadConfigOrNet(const std::string file, bool isNet, bool isReload, bool useStartupOptions, bool newNet) {
987  return;
988  }
989  getApp()->beginWaitCursor();
990  myAmLoading = true;
991  closeAllWindows();
992  if (isReload) {
993  myLoadThread->start();
994  setStatusBarText("Reloading.");
995  } else {
996  gSchemeStorage.saveViewport(0, 0, -1); // recenter view
997  myLoadThread->loadConfigOrNet(file, isNet, useStartupOptions, newNet);
998  setStatusBarText("Loading '" + file + "'.");
999  }
1000  update();
1001 }
1002 
1003 
1004 
1007  std::string caption = "View #" + toString(myViewNumber++);
1008  FXuint opts = MDI_TRACKING;
1009  GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, FXString(caption.c_str()), this, getBuildGLCanvas(),
1010  myNet, myUndoList, NULL, opts, 10, 10, 300, 200);
1011  if (myMDIClient->numChildren() == 1) {
1012  viewParent->maximize();
1013  } else {
1014  myMDIClient->vertical(true);
1015  }
1016  myMDIClient->setActiveChild(viewParent);
1017  //v->grabKeyboard();
1018  return viewParent->getView();
1019 }
1020 
1021 
1022 FXGLCanvas*
1024  if (myMDIClient->numChildren() == 0) {
1025  return 0;
1026  }
1027  GNEViewParent* share_tmp1 =
1028  static_cast<GNEViewParent*>(myMDIClient->childAtIndex(0));
1029  return share_tmp1->getBuildGLCanvas();
1030 }
1031 
1032 
1033 SUMOTime
1035  return 0;
1036 }
1037 
1038 
1039 double
1041  return 1;
1042 }
1043 
1044 
1045 GNEUndoList*
1047  return myUndoList;
1048 }
1049 
1050 
1051 void
1053  myTrackerLock.lock();
1054  // remove trackers and other external windows
1055  for (int i = 0; i < (int)mySubWindows.size(); ++i) {
1056  mySubWindows[i]->destroy();
1057  }
1058  for (int i = 0; i < (int)myTrackerWindows.size(); ++i) {
1059  myTrackerWindows[i]->destroy();
1060  }
1061  // reset the caption
1062  setTitle(myTitlePrefix);
1063  // delete other children
1064  while (myTrackerWindows.size() != 0) {
1065  delete myTrackerWindows[0];
1066  }
1067  while (mySubWindows.size() != 0) {
1068  delete mySubWindows[0];
1069  }
1070  mySubWindows.clear();
1071  // clear selected items
1072  gSelected.clear();
1073  // add a separator to the log
1076  // remove coordinate information
1077  myGeoCoordinate->setText("N/A");
1078  myCartesianCoordinate->setText("N/A");
1079 
1080  myUndoList->p_clear();
1081  if (myNet != 0) {
1082  delete myNet;
1083  myNet = 0;
1085  }
1087  // Reset textures
1090 }
1091 
1092 
1093 FXCursor*
1095  return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1096 }
1097 
1098 
1099 void
1101  const OptionsCont& oc = OptionsCont::getOptions();
1102  loadConfigOrNet("", true, false, true, oc.getBool("new"));
1103 }
1104 
1105 
1106 void
1107 GNEApplicationWindow::setStatusBarText(const std::string& statusBarText) {
1108  myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1109  myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1110 }
1111 
1112 
1113 void
1114 GNEApplicationWindow::setAdditionalsFile(const std::string& additionalsFile) {
1115  myAdditionalsFile = additionalsFile;
1116 }
1117 
1118 
1119 void
1120 GNEApplicationWindow::setShapesFile(const std::string& shapesFile) {
1121  myShapesFile = shapesFile;
1122 }
1123 
1124 
1125 void
1127  mySaveAdditionalsMenuCommand->enable();
1128 }
1129 
1130 
1131 void
1133  mySaveShapesMenuCommand->enable();
1134 }
1135 
1136 
1137 long
1138 GNEApplicationWindow::onCmdSetMode(FXObject*, FXSelector sel, void*) {
1139  if (getView()) {
1140  getView()->setEditModeFromHotkey(FXSELID(sel));
1141  }
1142  return 1;
1143 }
1144 
1145 
1146 long
1147 GNEApplicationWindow::onCmdAbort(FXObject*, FXSelector, void*) {
1148  if (getView()) {
1149  // show extra information for tests
1150  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1151  WRITE_WARNING("Key ESC (abort) pressed");
1152  }
1153  // abort current operation
1154  getView()->abortOperation();
1155  getView()->update();
1156  }
1157  return 1;
1158 }
1159 
1160 
1161 long
1162 GNEApplicationWindow::onCmdDel(FXObject*, FXSelector, void*) {
1163  if (getView()) {
1164  // show extra information for tests
1165  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1166  WRITE_WARNING("Key DEL (delete) pressed");
1167  }
1168  getView()->hotkeyDel();
1169  }
1170  return 1;
1171 }
1172 
1173 
1174 long
1175 GNEApplicationWindow::onCmdEnter(FXObject*, FXSelector, void*) {
1176  if (getView()) {
1177  // show extra information for tests
1178  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1179  WRITE_WARNING("Key ENTER pressed");
1180  }
1181  getView()->hotkeyEnter();
1182  }
1183  return 1;
1184 }
1185 
1186 
1187 long
1188 GNEApplicationWindow::onCmdFocusFrame(FXObject*, FXSelector, void*) {
1189  if (getView()) {
1191  }
1192  return 1;
1193 }
1194 
1195 
1196 long
1197 GNEApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
1198  if (getView()) {
1200  }
1201  return 1;
1202 }
1203 
1204 
1205 long
1206 GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
1207  FXLinkLabel::fxexecute("http://sumo.dlr.de/wiki/NETEDIT");
1208  return 1;
1209 }
1210 
1211 
1212 long
1213 GNEApplicationWindow::onCmdComputeJunctions(FXObject*, FXSelector, void*) {
1214  // show extra information for tests
1215  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1216  WRITE_WARNING("Key F5 (Compute) pressed");
1217  }
1218  myNet->computeEverything(this, true, false);
1219  updateControls();
1220  return 1;
1221 }
1222 
1223 
1224 long
1226  // declare variable to save FXMessageBox outputs.
1227  FXuint answer = 0;
1228  // declare string to save paths in wich additionals and shapes will be saved
1229  std::string additionalSavePath = myAdditionalsFile;
1230  std::string shapeSavePath = myShapesFile;
1231  // write warning if netedit is running in testing mode
1232  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1233  WRITE_WARNING("Keys Shift + F5 (Compute with volatile options) pressed");
1234  WRITE_WARNING("Opening FXMessageBox 'Volatile Recomputing'");
1235  }
1236  // open question dialog box
1237  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Recompute with volatile options",
1238  "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?");
1239  if (answer != 1) { //1:yes, 2:no, 4:esc
1240  // write warning if netedit is running in testing mode
1241  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1242  WRITE_WARNING("Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1243  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1244  WRITE_WARNING("Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1245  }
1246  // abort recompute with volatile options
1247  return 0;
1248  } else {
1249  // write warning if netedit is running in testing mode
1250  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1251  WRITE_WARNING("Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1252  }
1253  // Check if there are additionals in our net
1254  if (myNet->getNumberOfAdditionals() > 0) {
1255  // ask user if want to save additionals if weren't saved previously
1256  if (myAdditionalsFile == "") {
1257  // write warning if netedit is running in testing mode
1258  WRITE_WARNING("Opening FXMessageBox 'Save additionals before recomputing'");
1259  // open question dialog box
1260  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save additionals before recomputing with volatile options",
1261  "Would you like to save additionals before recomputing?");
1262  if (answer != 1) { //1:yes, 2:no, 4:esc
1263  // write warning if netedit is running in testing mode
1264  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1265  WRITE_WARNING("Closed FXMessageBox 'Save additionals before recomputing' with 'No'");
1266  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1267  WRITE_WARNING("Closed FXMessageBox 'Save additionals before recomputing' with 'ESC'");
1268  }
1269  } else {
1270  // write warning if netedit is running in testing mode
1271  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1272  WRITE_WARNING("Closed FXMessageBox 'Save additionals before recomputing' with 'Yes'");
1273  }
1274  // Open a dialog to set filename output
1276  "Select name of the additional file", ".xml",
1278  gCurrentFolder).text();
1279  // set obtanied filename output into additionalSavePath (can be "")
1280  additionalSavePath = myAdditionalsFile;
1281  }
1282  }
1283  // Check if additional must be saved in a temporal directory, if user didn't define a directory for additionals
1284  if (myAdditionalsFile == "") {
1285  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1286  additionalSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpAdditionalsNetedit.xml");
1287  }
1288  // Start saving additionals
1289  getApp()->beginWaitCursor();
1290  try {
1291  myNet->saveAdditionals(additionalSavePath);
1292  } catch (IOError& e) {
1293  // write warning if netedit is running in testing mode
1294  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1295  WRITE_WARNING("Opening FXMessageBox 'Error saving additionals before recomputing'");
1296  }
1297  // open error message box
1298  FXMessageBox::error(this, MBOX_OK, "Saving additionals in temporal folder failed!", "%s", e.what());
1299  // write warning if netedit is running in testing mode
1300  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1301  WRITE_WARNING("Closed FXMessageBox 'Error saving additionals before recomputing' with 'OK'");
1302  }
1303  }
1304  // end saving additionals
1306  getApp()->endWaitCursor();
1307  } else {
1308  // clear additional path
1309  additionalSavePath = "";
1310  }
1311  // Check if there are shapes in our net
1312  if (myNet->getNumberOfShapes() > 0) {
1313  // ask user if want to save shapes if weren't saved previously
1314  if (myShapesFile == "") {
1315  // write warning if netedit is running in testing mode
1316  WRITE_WARNING("Opening FXMessageBox 'Save shapes before recomputing'");
1317  // open question dialog box
1318  answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, "Save shapes before recomputing with volatile options",
1319  "Would you like to save shapes before recomputing?");
1320  if (answer != 1) { //1:yes, 2:no, 4:esc
1321  // write warning if netedit is running in testing mode
1322  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1323  WRITE_WARNING("Closed FXMessageBox 'Save shapes before recomputing' with 'No'");
1324  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1325  WRITE_WARNING("Closed FXMessageBox 'Save shapes before recomputing' with 'ESC'");
1326  }
1327  } else {
1328  // write warning if netedit is running in testing mode
1329  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1330  WRITE_WARNING("Closed FXMessageBox 'Save shapes before recomputing' with 'Yes'");
1331  }
1332  // Open a dialog to set filename output
1334  "Select name of the shape file", ".xml",
1336  gCurrentFolder).text();
1337  // set obtanied filename output into shapeSavePath (can be "")
1338  shapeSavePath = myShapesFile;
1339  }
1340  }
1341  // Check if shape must be saved in a temporal directory, if user didn't define a directory for shapes
1342  if (myShapesFile == "") {
1343  // Obtain temporal directory provided by FXSystem::getCurrentDirectory()
1344  shapeSavePath = FXSystem::getTempDirectory().text() + std::string("/tmpShapesNetedit.xml");
1345  }
1346  // Start saving shapes
1347  getApp()->beginWaitCursor();
1348  try {
1349  myNet->saveShapes(shapeSavePath);
1350  } catch (IOError& e) {
1351  // write warning if netedit is running in testing mode
1352  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1353  WRITE_WARNING("Opening FXMessageBox 'Error saving shapes before recomputing'");
1354  }
1355  // open error message box
1356  FXMessageBox::error(this, MBOX_OK, "Saving shapes in temporal folder failed!", "%s", e.what());
1357  // write warning if netedit is running in testing mode
1358  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1359  WRITE_WARNING("Closed FXMessageBox 'Error saving shapes before recomputing' with 'OK'");
1360  }
1361  }
1362  // end saving shapes
1364  getApp()->endWaitCursor();
1365  } else {
1366  // clear save path
1367  shapeSavePath = "";
1368  }
1369  // compute with volatile options
1370  myNet->computeEverything(this, true, true, additionalSavePath, shapeSavePath);
1371  updateControls();
1372  return 1;
1373  }
1374 }
1375 
1376 
1377 long
1378 GNEApplicationWindow::onCmdCleanJunctions(FXObject*, FXSelector, void*) {
1379  // show extra information for tests
1380  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1381  WRITE_WARNING("Key F6 (Clean junction) pressed");
1382  }
1384  return 1;
1385 }
1386 
1387 
1388 long
1389 GNEApplicationWindow::onCmdJoinJunctions(FXObject*, FXSelector, void*) {
1390  // show extra information for tests
1391  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1392  WRITE_WARNING("Key F7 (Join junctions) pressed");
1393  }
1395  return 1;
1396 }
1397 
1398 
1399 long
1401  // show extra information for tests
1402  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1403  WRITE_WARNING("Key F8 (Clean invalid crossings) pressed");
1404  }
1406  return 1;
1407 }
1408 
1409 
1410 long
1411 GNEApplicationWindow::onCmdOptions(FXObject*, FXSelector, void*) {
1412  GNEDialog_Wizard* wizard =
1413  new GNEDialog_Wizard(this, "Configure Options", getWidth(), getHeight());
1414 
1415  if (wizard->execute()) {
1416  NIFrame::checkOptions(); // needed to set projection parameters
1419  SystemFrame::checkOptions(); // needed to set precision
1420  }
1421  return 1;
1422 }
1423 
1424 
1425 long
1426 GNEApplicationWindow::onCmdSaveAsNetwork(FXObject*, FXSelector, void*) {
1427  FXString file = MFXUtils::getFilename2Write(this,
1428  "Save Network as", ".net.xml",
1430  gCurrentFolder);
1431  if (file == "") {
1432  return 1;
1433  }
1435  oc.resetWritable();
1436  oc.set("output-file", file.text());
1437  setTitle(MFXUtils::getTitleText(myTitlePrefix, file));
1438  onCmdSaveNetwork(0, 0, 0);
1439  return 1;
1440 }
1441 
1442 
1443 long
1444 GNEApplicationWindow::onCmdSaveAsPlainXML(FXObject*, FXSelector, void*) {
1445  FXString file = MFXUtils::getFilename2Write(this,
1446  "Select name of the plain-xml edge-file (other names will be deduced from this)", "",
1448  gCurrentFolder);
1449  if (file == "") {
1450  return 1;
1451  }
1453  bool wasSet = oc.isSet("plain-output-prefix");
1454  std::string oldPrefix = oc.getString("plain-output-prefix");
1455  oc.resetWritable();
1456  std::string prefix = file.text();
1457  // if the name of an edg.xml file was given, remove the suffix
1458  if (StringUtils::endsWith(prefix, ".edg.xml")) {
1459  prefix = prefix.substr(0, prefix.size() - 8);
1460  }
1461  if (StringUtils::endsWith(prefix, ".")) {
1462  prefix = prefix.substr(0, prefix.size() - 1);
1463  }
1464  oc.set("plain-output-prefix", prefix);
1465  getApp()->beginWaitCursor();
1466  try {
1467  myNet->savePlain(oc);
1468  myUndoList->unmark();
1469  myUndoList->mark();
1470  } catch (IOError& e) {
1471  // write warning if netedit is running in testing mode
1472  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1473  WRITE_WARNING("Opening FXMessageBox 'Error saving plainXML'");
1474  }
1475  // open message box
1476  FXMessageBox::error(this, MBOX_OK, "Saving plain xml failed!", "%s", e.what());
1477  // write warning if netedit is running in testing mode
1478  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1479  WRITE_WARNING("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
1480  }
1481  }
1482  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Plain XML saved with prefix '" + prefix + "'.\n");
1484  if (wasSet) {
1485  oc.resetWritable();
1486  oc.set("plain-output-prefix", oldPrefix);
1487  } else {
1488  oc.unSet("plain-output-prefix");
1489  }
1490  getApp()->endWaitCursor();
1491  return 1;
1492 }
1493 
1494 
1495 long
1496 GNEApplicationWindow::onCmdSaveJoined(FXObject*, FXSelector, void*) {
1497  FXString file = MFXUtils::getFilename2Write(this,
1498  "Select name of the joined-junctions file", ".nod.xml",
1500  gCurrentFolder);
1501  if (file == "") {
1502  return 1;
1503  }
1505  bool wasSet = oc.isSet("junctions.join-output");
1506  std::string oldFile = oc.getString("junctions.join-output");
1507  oc.resetWritable();
1508  std::string filename = file.text();
1509  oc.set("junctions.join-output", filename);
1510  getApp()->beginWaitCursor();
1511  try {
1512  myNet->saveJoined(oc);
1513  } catch (IOError& e) {
1514  // write warning if netedit is running in testing mode
1515  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1516  WRITE_WARNING("Opening FXMessageBox 'error saving joined'");
1517  }
1518  // opening error message
1519  FXMessageBox::error(this, MBOX_OK, "Saving joined junctions failed!", "%s", e.what());
1520  // write warning if netedit is running in testing mode
1521  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1522  WRITE_WARNING("Closed FXMessageBox 'error saving joined' with 'OK'");
1523  }
1524  }
1525  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Joined junctions saved to '" + filename + "'.\n");
1527  if (wasSet) {
1528  oc.resetWritable();
1529  oc.set("junctions.join-output", oldFile);
1530  } else {
1531  oc.unSet("junctions.join-output");
1532  }
1533  getApp()->endWaitCursor();
1534  return 1;
1535 }
1536 
1537 
1538 long
1539 GNEApplicationWindow::onCmdSaveShapes(FXObject*, FXSelector, void*) {
1540  // check if save shapes menu is enabled
1541  if (mySaveShapesMenuCommand->isEnabled()) {
1542  // Check if shapes file was already set at start of netedit or with a previous save
1543  if (myShapesFile == "") {
1544  FXString file = MFXUtils::getFilename2Write(this,
1545  "Select name of the shape file", ".xml",
1547  gCurrentFolder);
1548  if (file == "") {
1549  // None shapes file was selected, then stop function
1550  return 0;
1551  } else {
1552  myShapesFile = file.text();
1553  }
1554  }
1555  getApp()->beginWaitCursor();
1556  try {
1558  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Shapes saved in " + myShapesFile + ".\n");
1559  mySaveShapesMenuCommand->disable();
1560  } catch (IOError& e) {
1561  // write warning if netedit is running in testing mode
1562  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1563  WRITE_WARNING("Opening FXMessageBox 'Error saving shapes'");
1564  }
1565  // open error dialog box
1566  FXMessageBox::error(this, MBOX_OK, "Saving POIs failed!", "%s", e.what());
1567  // write warning if netedit is running in testing mode
1568  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1569  WRITE_WARNING("Closed FXMessageBox 'Error saving shapes' with 'OK'");
1570  }
1571  }
1573  getApp()->endWaitCursor();
1574  return 1;
1575  } else {
1576  return 0;
1577  }
1578 }
1579 
1580 
1581 long GNEApplicationWindow::onCmdSaveShapesAs(FXObject*, FXSelector, void*) {
1582  // Open window to select shape file
1583  FXString file = MFXUtils::getFilename2Write(this,
1584  "Select name of the shape file", ".xml",
1586  gCurrentFolder);
1587  if (file != "") {
1588  // Set new shape file
1589  myShapesFile = file.text();
1590  // save shapes
1591  return onCmdSaveShapes(0, 0, 0);
1592  } else {
1593  return 1;
1594  }
1595 }
1596 
1597 
1598 long
1599 GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
1600  sender->handle(this, myNet == 0 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
1601  return 1;
1602 }
1603 
1604 
1605 long
1606 GNEApplicationWindow::onUpdReload(FXObject* sender, FXSelector, void*) {
1607  sender->handle(this, myNet == 0 || !OptionsCont::getOptions().isSet("sumo-net-file") ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
1608  return 1;
1609 }
1610 
1611 
1612 long
1613 GNEApplicationWindow::onCmdSaveNetwork(FXObject*, FXSelector, void*) {
1615  // function onCmdSaveAsNetwork must be executed if this is the first save
1616  if (oc.getString("output-file") == "") {
1617  return onCmdSaveAsNetwork(0, 0, 0);
1618  } else {
1619  getApp()->beginWaitCursor();
1620  try {
1621  myNet->save(oc);
1622  myUndoList->unmark();
1623  myUndoList->mark();
1624  } catch (IOError& e) {
1625  // write warning if netedit is running in testing mode
1626  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1627  WRITE_WARNING("Opening FXMessageBox 'error saving network'");
1628  }
1629  // open error message box
1630  FXMessageBox::error(this, MBOX_OK, "Saving Network failed!", "%s", e.what());
1631  // write warning if netedit is running in testing mode
1632  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1633  WRITE_WARNING("Closed FXMessageBox 'error saving network' with 'OK'");
1634  }
1635  }
1636  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Network saved in " + oc.getString("output-file") + ".\n");
1638  getApp()->endWaitCursor();
1639  return 1;
1640  }
1641 }
1642 
1643 
1644 long
1645 GNEApplicationWindow::onCmdSaveAdditionals(FXObject*, FXSelector, void*) {
1646  // check if save additional menu is enabled
1647  if (mySaveAdditionalsMenuCommand->isEnabled()) {
1648  // Check if additionals file was already set at start of netedit or with a previous save
1649  if (myAdditionalsFile == "") {
1650  FXString file = MFXUtils::getFilename2Write(this,
1651  "Select name of the additional file", ".xml",
1653  gCurrentFolder);
1654  if (file == "") {
1655  // None additionals file was selected, then stop function
1656  return 0;
1657  } else {
1658  myAdditionalsFile = file.text();
1659  }
1660  }
1661  // Start saving additionals
1662  getApp()->beginWaitCursor();
1663  try {
1665  myMessageWindow->appendMsg(EVENT_MESSAGE_OCCURED, "Additionals saved in " + myAdditionalsFile + ".\n");
1666  mySaveAdditionalsMenuCommand->disable();
1667  } catch (IOError& e) {
1668  // write warning if netedit is running in testing mode
1669  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1670  WRITE_WARNING("Opening FXMessageBox 'error saving additionals'");
1671  }
1672  // open error message box
1673  FXMessageBox::error(this, MBOX_OK, "Saving additionals failed!", "%s", e.what());
1674  // write warning if netedit is running in testing mode
1675  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1676  WRITE_WARNING("Closed FXMessageBox 'error saving additionals' with 'OK'");
1677  }
1678  }
1680  getApp()->endWaitCursor();
1681  return 1;
1682  } else {
1683  return 0;
1684  }
1685 }
1686 
1687 
1688 long
1689 GNEApplicationWindow::onCmdSaveAdditionalsAs(FXObject*, FXSelector, void*) {
1690  // Open window to select additionasl file
1691  FXString file = MFXUtils::getFilename2Write(this,
1692  "Select name of the additional file", ".xml",
1694  gCurrentFolder);
1695  if (file != "") {
1696  // Set new additional file
1697  myAdditionalsFile = file.text();
1698  // save additionals
1699  return onCmdSaveAdditionals(0, 0, 0);
1700  } else {
1701  return 1;
1702  }
1703 }
1704 
1705 
1706 long
1707 GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
1709  bool enable = myNet != 0 && oc.isSet("output-file");
1710  sender->handle(this, FXSEL(SEL_COMMAND, enable ? ID_ENABLE : ID_DISABLE), 0);
1711  if (enable) {
1712  FXString caption = ("Save " + oc.getString("output-file")).c_str();
1713  sender->handle(this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (void*)&caption);
1714  }
1715  return 1;
1716 }
1717 
1718 
1719 GNEViewNet*
1721  if (mySubWindows.size() != 0) {
1722  return (GNEViewNet*)(((GUIGlChildWindow*)mySubWindows[0])->getView());
1723  } else {
1724  return 0;
1725  }
1726 }
1727 
1728 
1729 bool
1731  FXuint answer = 0;
1732  if (myUndoList->canUndo() && !myUndoList->marked()) {
1733  // write warning if netedit is running in testing mode
1734  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1735  WRITE_WARNING("Opening FXMessageBox 'Confirm closing network'");
1736  }
1737  // open question box
1738  answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1739  "Confirm closing Network", "%s",
1740  "You have unsaved changes in the network. Do you wish to quit and discard all changes?");
1741  // restore focus to view net
1742  getView()->setFocus();
1743  // if user close dialog box, check additionasl and shapes
1744  if (answer == MBOX_CLICKED_QUIT) {
1745  // write warning if netedit is running in testing mode
1746  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1747  WRITE_WARNING("Closed FXMessageBox 'Confirm closing network' with 'Quit'");
1748  }
1750  // clear undo list and return true to continue with closing/reload
1751  myUndoList->p_clear();
1752  return true;
1753  } else {
1754  return false;
1755  }
1756  } else if (answer == MBOX_CLICKED_SAVE) {
1757  // save newtork
1758  onCmdSaveNetwork(0, 0, 0);
1759  if (!myUndoList->marked()) {
1760  // saving failed
1761  return false;
1762  }
1764  // clear undo list and return true to continue with closing/reload
1765  myUndoList->p_clear();
1766  return true;
1767  } else {
1768  return false;
1769  }
1770  } else {
1771  // write warning if netedit is running in testing mode
1772  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1773  WRITE_WARNING("Closed FXMessageBox 'Confirm closing network' with 'No'");
1774  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1775  WRITE_WARNING("Closed FXMessageBox 'Confirm closing network' with 'ESC'");
1776  }
1777  // return false to stop closing/reloading
1778  return false;
1779  }
1780  } else {
1782  // clear undo list and return true to continue with closing/reload
1783  myUndoList->p_clear(); //only ask once
1784  return true;
1785  } else {
1786  // return false to stop closing/reloading
1787  return false;
1788  }
1789  }
1790 }
1791 
1792 
1793 bool
1795  // Check if there are non saved additionals
1796  if (mySaveAdditionalsMenuCommand->isEnabled()) {
1797  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1798  WRITE_WARNING("Opening FXMessageBox 'Save additionals before exit'");
1799  }
1800  // open question box
1801  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1802  "Save additionals before exit", "%s",
1803  "You have unsaved additionals. Do you wish to quit and discard all changes?");
1804  // restore focus to view net
1805  getView()->setFocus();
1806  // if answer was affirmative, but there was an error during saving additional, return false to stop closing/reloading
1807  if (answer == MBOX_CLICKED_QUIT) {
1808  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1809  WRITE_WARNING("Closed FXMessageBox 'Save additionals before exit' with 'Quit'");
1810  }
1811  // nothing to save, return true
1812  return true;
1813  } else if (answer == MBOX_CLICKED_SAVE) {
1814  // write warning if netedit is running in testing mode
1815  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1816  WRITE_WARNING("Closed FXMessageBox 'Save additionals before exit' with 'Yes'");
1817  }
1818  if (onCmdSaveAdditionals(0, 0, 0) == 1) {
1819  // additionals sucesfully saved
1820  return true;
1821  } else {
1822  // error saving additionals, abort saving
1823  return false;
1824  }
1825  } else {
1826  // write warning if netedit is running in testing mode
1827  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1828  WRITE_WARNING("Closed FXMessageBox 'Save additionals before exit' with 'No'");
1829  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1830  WRITE_WARNING("Closed FXMessageBox 'Save additionals before exit' with 'ESC'");
1831  }
1832  // abort saving
1833  return false;
1834  }
1835  } else {
1836  // nothing to save, return true
1837  return true;
1838  }
1839 }
1840 
1841 
1842 bool
1844  // Check if there are non saved additionals
1845  if (mySaveShapesMenuCommand->isEnabled()) {
1846  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1847  WRITE_WARNING("Opening FXMessageBox 'Save shapes before exit'");
1848  }
1849  // open question box
1850  FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1851  "Save shapes before exit", "%s",
1852  "You have unsaved shapes. Do you wish to quit and discard all changes?");
1853  // restore focus to view net
1854  getView()->setFocus();
1855  // if answer was affirmative, but there was an error during saving additional, return false to stop closing/reloading
1856  if (answer == MBOX_CLICKED_QUIT) {
1857  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1858  WRITE_WARNING("Closed FXMessageBox 'Save shapes before exit' with 'Quit'");
1859  }
1860  return true;
1861  } else if (answer == MBOX_CLICKED_SAVE) {
1862  // write warning if netedit is running in testing mode
1863  if (OptionsCont::getOptions().getBool("gui-testing-debug")) {
1864  WRITE_WARNING("Closed FXMessageBox 'Save shapes before exit' with 'Yes'");
1865  }
1866  if (onCmdSaveShapes(0, 0, 0) == 1) {
1867  // shapes sucesfully saved
1868  return true;
1869  } else {
1870  // error saving shapes, abort saving
1871  return false;
1872  }
1873  } else {
1874  // write warning if netedit is running in testing mode
1875  if (answer == 2 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1876  WRITE_WARNING("Closed FXMessageBox 'Save shapes before exit' with 'No'");
1877  } else if (answer == 4 && OptionsCont::getOptions().getBool("gui-testing-debug")) {
1878  WRITE_WARNING("Closed FXMessageBox 'Save shapes before exit' with 'ESC'");
1879  }
1880  // abort saving
1881  return false;
1882  }
1883  } else {
1884  // nothing to save, then return true
1885  return true;
1886  }
1887 }
1888 
1889 
1890 void
1892  GNEViewNet* view = getView();
1893  if (view != 0) {
1894  view->updateControls();
1895  }
1896 }
1897 
1898 
1899 long
1900 GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
1901  const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
1902  if (handled == 0 && myMDIClient->numChildren() > 0) {
1903  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
1904  if (w != 0) {
1905  w->onKeyPress(0, sel, eventData);
1906  }
1907  }
1908  return 0;
1909 }
1910 
1911 
1912 long
1913 GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
1914  const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
1915  if (handled == 0 && myMDIClient->numChildren() > 0) {
1916  GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
1917  if (w != 0) {
1918  w->onKeyRelease(0, sel, eventData);
1919  }
1920  }
1921  return 0;
1922 }
1923 
1924 // ---------------------------------------------------------------------------
1925 // GNEApplicationWindow::GNEShapeHandler - methods
1926 // ---------------------------------------------------------------------------
1927 
1929  ShapeHandler(file, *net),
1930  myNet(net) {}
1931 
1932 
1934 
1935 
1936 Position
1937 GNEApplicationWindow::GNEShapeHandler::getLanePos(const std::string& poiID, const std::string& laneID, double lanePos, double lanePosLat) {
1938  std::string edgeID;
1939  int laneIndex;
1940  NBHelpers::interpretLaneID(laneID, edgeID, laneIndex);
1941  NBEdge* edge = myNet->retrieveEdge(edgeID)->getNBEdge();
1942  if (edge == 0 || laneIndex < 0 || edge->getNumLanes() <= laneIndex) {
1943  WRITE_ERROR("Lane '" + laneID + "' to place poi '" + poiID + "' on is not known.");
1944  return Position::INVALID;
1945  }
1946  if (lanePos < 0) {
1947  lanePos = edge->getLength() + lanePos;
1948  }
1949  if (lanePos < 0 || lanePos > edge->getLength()) {
1950  WRITE_WARNING("lane position " + toString(lanePos) + " for poi '" + poiID + "' is not valid.");
1951  }
1952  return edge->getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat);
1953 }
1954 
1955 /****************************************************************************/
std::vector< FXMainWindow * > myTrackerWindows
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
std::string myConfigPattern
Input file pattern.
join selected junctions
Definition: GUIAppEnum.h:457
mode for selecting objects
Definition: GUIAppEnum.h:477
FXLabel * myGeoCoordinate
double getLength() const
Returns the computed length of the edge.
Definition: NBEdge.h:480
Locate poi - button.
Definition: GUIAppEnum.h:184
FXMenuBar * myMenuBar
The application menu bar.
FXMenuCommand * mySaveShapesMenuCommand
FXMenuCommand for enable or disable save shapes.
GUISUMOAbstractView * getView() const
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out ...
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don&#39;t need it)
Load additional file with poi and polygons.
Definition: GUIAppEnum.h:76
GUICompleteSchemeStorage gSchemeStorage
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NWFrame.cpp:131
void pop()
Definition: MFXEventQue.h:52
void enableSaveAdditionalsMenu()
enable save additionals
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
static std::string clipped
Definition: GUIUserIO.h:63
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
Definition: GNENet.cpp:902
long onCmdNewNetwork(FXObject *, FXSelector, void *)
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
void setAdditionalsFile(const std::string &additionalsFile)
set additionals file
static void resetFont()
to be called when the font context is invalidated
Definition: GLHelper.cpp:466
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NBFrame.cpp:461
void abortOperation(bool clearSelection=true)
abort current edition operation
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
MFXEventQue< GUIEvent * > myEvents
List of got requests.
void resetWritable()
Resets all options to be writeable.
GNEUndoList * getUndoList()
get pointer to undoList
long onCmdReload(FXObject *, FXSelector, void *)
called when the command/FXCall reload is executed
void create()
Creates the widget.
void closeAllWindows()
this method closes all windows and deletes the current simulation */
virtual FXGLCanvas * getBuildGLCanvas() const
mode for creating polygons
Definition: GUIAppEnum.h:487
virtual void setViewportFromTo(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
send when a message occured
Definition: GUIEvent.h:49
FXRecentFiles myRecentConfigs
List of recent config files.
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
bool empty()
Definition: MFXEventQue.h:71
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
void enableSaveShapesMenu()
enable save shapes
The main window of the Netedit.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
std::string myShapesFile
filename for load/save shapes
#define GUIDesignSplitterMDI
MDI Splitter.
Definition: GUIDesigns.h:296
void hotkeyFocusFrame()
handle focus frame keypress
clean junctions without edges
Definition: GUIAppEnum.h:455
compute junctions with volatile options
Definition: GUIAppEnum.h:453
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
mode for moving things
Definition: GUIAppEnum.h:471
Reload the previously loaded simulation.
Definition: GUIAppEnum.h:80
virtual void create()
Creates the main window (required by FOX)
long onCmdJoinJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->join junctions
bool hadDependentBuild
check if had dependent build
Locate junction - button.
Definition: GUIAppEnum.h:172
The representation of a single edge during network building.
Definition: NBEdge.h:70
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
GNEUndoList * myUndoList
the one and only undo list
long onCmdComputeJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions
static void resetTextures()
Reset textures.
void registerMsgHandlers()
register and unregister message handlers
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
#define GUIDesignStatusBar
design used in status bar
Definition: GUIDesigns.h:265
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort ...
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 */
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
Definition: GUIDesigns.h:268
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
#define GUIDesignSplitter
Definition: GUIDesigns.h:293
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
mode for deleting things
Definition: GUIAppEnum.h:473
open options menu
Definition: GUIAppEnum.h:461
Editor for the list of chosen objects.
bool continueWithUnsavedChanges()
warns about unsaved changes and gives the user the option to abort
FXGLVisual * myGLVisual
The gl-visual used.
hot key <ESC> abort current edit operation
Definition: GUIAppEnum.h:411
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
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:84
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
Definition: NBEdge.h:569
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
void setEditModeFromHotkey(FXushort selid)
sets edit mode (from hotkey)
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition: GNENet.cpp:1444
FXString gCurrentFolder
The folder used as last.
long onCmdSaveShapes(FXObject *, FXSelector, void *)
called when the command/FXCall save shapes is executed
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
Definition: GNENet.cpp:1709
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the upadte/FXCall needs network is executed
void saveViewport(const double x, const double y, const double z)
Makes the given viewport the default.
long onCmdCleanInvalidCrossings(FXObject *, FXSelector, void *)
called if the user selects Processing->clear invalid crossings
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
std::string myFile
the name of the loaded file
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
static void resetLoaded()
resets loaded location elements
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
void set(double x, double y)
set positions x and y
Definition: Position.h:92
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything&#39;s ok.
Definition: XMLSubSys.cpp:109
void updateControls()
update control contents after undo/redo or recompute
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString &currentFolder)
Returns the file name to write.
Definition: MFXUtils.cpp:90
help button
Definition: GUIAppEnum.h:396
create new empty newtork
Definition: GUIAppEnum.h:425
The loading thread.
Definition: GUIAppEnum.h:116
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
void updateControls()
update control contents after undo/redo or recompute
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
void addDecals(const std::vector< Decal > &decals)
add decals
GUISUMOAbstractView * openNewView()
opens a new simulation display
GNENet * myNet
the loaded net
long onUpdReload(FXObject *, FXSelector, void *)
called when the update/FXCall reload is executed
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:199
A single child window which contains a view of the simulation area.
Definition: GNEViewParent.h:72
Open viewport editor - button.
Definition: GUIAppEnum.h:188
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:64
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
The application&#39;s "About" - dialog.
void addSeparator()
Adds a a separator to this log window.
void p_clear()
clears the undo list (implies abort)
Definition: GNEUndoList.cpp:98
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
The XML-Handler for network loading.
Definition: ShapeHandler.h:55
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
FXHorizontalFrame * myCartesianFrame
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
const std::string & getMsg() const
Returns the message.
Load additional file with additional elements.
Definition: GUIAppEnum.h:78
long onCmdEditViewport(FXObject *, FXSelector, void *)
called if the user press key v to open zoom editor
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
std::vector< FXMDIChild * > mySubWindows
long onCmdOptions(FXObject *, FXSelector, void *)
called if the user selects Processing->Configure Options
static void close()
close GUITextureSubSys
Loads a file previously loaded.
Definition: GUIAppEnum.h:82
GNEApplicationWindow()
FOX needs this for static members.
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:55
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
FXGLCanvas * getBuildGLCanvas() const
get build OpenGL Canvas
hot key <F12> focus upper element of current frame
Definition: GUIAppEnum.h:413
int myViewNumber
The current view number.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Definition: GNEUndoList.cpp:91
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get lane position
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition: GNENet.cpp:1337
mode for editing tls
Definition: GUIAppEnum.h:481
virtual void fillMenuBar()
Builds the menu bar.
Clear simulation output.
Definition: GUIAppEnum.h:155
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool continueWithUnsavedShapeChanges()
warns about unsaved changes in shapes and gives the user the option to abort
long onCmdSaveAsPlainXML(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
long onCmdSaveShapesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save shapes as is executed
void save(OptionsCont &oc)
save the network
Definition: GNENet.cpp:858
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
called when the command/FXCall open configuration is executed
static bool checkOptions()
checks shared options and sets StdDefs
std::string mySettingsFile
the name of the settings file to load
Locate polygons - button.
Definition: GUIAppEnum.h:186
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
send when a error occured
Definition: GUIEvent.h:55
double getTrackerInterval() const
get current tracker interval (pure virtual but we don&#39;t need it)
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
Definition: NIFrame.cpp:299
save network as plain XML
Definition: GUIAppEnum.h:433
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
void setTarget(FXObject *tgt)
set the target
Definition: FXBaseObject.h:136
FXCursor * getDefaultCursor()
get default cursor
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
mode for editing crossing
Definition: GUIAppEnum.h:485
Open network - ID.
Definition: GUIAppEnum.h:74
long onCmdCleanJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->clean junctions
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
#define VERSION_STRING
Definition: config.h:210
GNEShapeHandler(const std::string &file, GNENet *net)
Constructor.
virtual ~GNEApplicationWindow()
Destructor.
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
GNELoadThread * myLoadThread
the thread that loads the network
FXStatusBar * myStatusbar
The status bar.
long onCmdOpenShapes(FXObject *, FXSelector, void *)
called when the command/FXCall open shapes is executed
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
void unlock()
release mutex lock
Definition: MFXMutex.cpp:93
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
virtual void showViewportEditor()
show viewport editor
#define GUIDesignBar
Definition: GUIDesigns.h:262
bool myViewportFromRegistry
whether loading viewport from registry
About SUMO - ID.
Definition: GUIAppEnum.h:86
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits f
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
virtual void detach()
detaches the tool/menu bar
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
void setSelector(FXSelector sel)
set the selector
Definition: FXBaseObject.h:146
open foreign network
Definition: GUIAppEnum.h:427
void unSet(const std::string &name, bool failOnNonExistant=true) const
Marks the option as unset.
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
FXRecentFiles myRecentNets
List of recent nets.
void loadOptionOnStartup()
load net on startup
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
Definition: NBHelpers.cpp:127
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition: GNENet.cpp:1500
static void close()
close GUIIconSubSys
FXToolBarShell * myMenuBarDrag
Open configuration - ID.
Definition: GUIAppEnum.h:72
FXHorizontalFrame * myGeoFrame
Locate addtional structure - button.
Definition: GUIAppEnum.h:182
Main window-ID.
Definition: GUIAppEnum.h:52
FXDockSite * myTopDock
A storage for options typed value containers)
Definition: OptionsCont.h:98
FXMenuCommand * mySaveAdditionalsMenuCommand
FXMenuCommand for enable or disable save additionals.
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
void computeEverything(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string shapePath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition: GNENet.cpp:1235
int getNumberOfShapes() const
get number of shapes
Definition: GNENet.cpp:2014
void clear()
Clears the list of selected objects.
std::string myAdditionalsFile
filename for load/save additionals
void lock()
lock mutex
Definition: MFXMutex.cpp:83
FXMDIClient * myMDIClient
The multi view panel.
Close simulation - ID.
Definition: GUIAppEnum.h:84
send when a simulation has been loaded
Definition: GUIEvent.h:43
void handleEvent_Message(GUIEvent *e)
hanlde event of type message
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
Definition: GNENet.cpp:875
send when a warning occured
Definition: GUIEvent.h:52
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition: GUIDesigns.h:215
save joined junctions
Definition: GUIAppEnum.h:435
hot key <ENTER> accept current operation
Definition: GUIAppEnum.h:417
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
long onCmdSaveJoined(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
An XML-handler for visualisation schemes.
const FXString myTitlePrefix
the prefix for the window title
GUIEventType getOwnType() const
returns the event type
Definition: GUIEvent.h:83
Locate edge - button.
Definition: GUIAppEnum.h:174
long long int SUMOTime
Definition: TraCIDefs.h:51
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
Definition: MFXUtils.cpp:68
GNENet * myNet
we are responsible for the net
Locate TLS - button.
Definition: GUIAppEnum.h:180
#define GUIDesignToolBarShell3
Definition: GUIDesigns.h:276
mode for connecting lanes
Definition: GUIAppEnum.h:479
void dependentBuild()
build dependent
void clear()
Clears the window.
NBEdge * getNBEdge()
returns the internal NBEdge
Definition: GNEEdge.cpp:412
long onCmdComputeJunctionsVolatile(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions with volatile options
void hotkeyDel()
handle del keypress
#define WRITE_MESSAGE(msg)
Definition: MsgHandler.h:200
mode for editing additional
Definition: GUIAppEnum.h:483
hot key <DEL> delete selections or elements
Definition: GUIAppEnum.h:415
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
GUISelectedStorage gSelected
A global holder of selected objects.
void hotkeyEnter()
handle enter keypress
long onCmdSaveAsNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
GNEViewNet * getView()
convenience method
A logging window for the gui.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void saveAdditionals(const std::string &filename)
save additional elements of the network
Definition: GNENet.cpp:1746
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
Definition: GNENet.cpp:867
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
FXMenuPane * myFileMenu
the submenus
mode for adding edges
Definition: GUIAppEnum.h:469
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
static const Position INVALID
used to indicate that a position is valid
Definition: Position.h:277
GNEViewNet * getViewNet() const
get view net
Definition: GNENet.cpp:1607
void saveShapes(const std::string &filename)
save shapes elements of the network
Definition: GNENet.cpp:1991
void setShapesFile(const std::string &shapesFile)
set shapes file
mode for inspecting object attributes
Definition: GUIAppEnum.h:475
Main window closes.
Definition: GUIAppEnum.h:54