Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEApplicationWindow.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
19// Functions from main window of netedit
20/****************************************************************************/
21
23#include <netbuild/NBFrame.h>
43#include <netedit/templates.h>
44#include <netimport/NIFrame.h>
47#include <netwrite/NWFrame.h>
64#include <utils/xml/XMLSubSys.h>
65
68#include "GNELoadThread.h"
69#include "GNENet.h"
70#include "GNEViewNet.h"
71#include "GNEUndoList.h"
72#include "GNEViewParent.h"
73
74#ifdef HAVE_VERSION_H
75#include <version.h>
76#endif
77
78// ===========================================================================
79// FOX-declarations
80// ===========================================================================
81
82FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[] = {
83 // quit calls
87 FXMAPFUNC(SEL_CLOSE, MID_WINDOW, GNEApplicationWindow::onCmdQuit),
88 // toolbar file
95 FXMAPFUNC(SEL_UPDATE, MID_RECENTFILE, GNEApplicationWindow::onUpdOpen),
100 // network
115 // NeteditConfig
123 // SumoConfig
131 // TLS
138 // edge types
147 // additionals
158 // demand elements
167 // data elements
176 // meanDatas
185 // other
190 // Toolbar supermode
194 // Toolbar modes
211 // Toolbar edit
220 // Network view options
253 // Demand view options
276 // Data view options
293 // view
310 /* Prepared for #6042
311 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_X_CUT, GNEApplicationWindow::onCmdCut),
312 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_C_COPY, GNEApplicationWindow::onCmdCopy),
313 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_CTRL_V_PASTE, GNEApplicationWindow::onCmdPaste),
314 */
315 // toolbar lock
321 // Toolbar processing
340 // Toolbar locate
365 // toolbar python tools
370 // toolbar windows
372 // toolbar help
375 FXMAPFUNC(SEL_COMMAND, MID_HOTKEYS, GNEApplicationWindow::onCmdHotkeys),
376 FXMAPFUNC(SEL_COMMAND, MID_TUTORIAL, GNEApplicationWindow::onCmdTutorial),
377 FXMAPFUNC(SEL_COMMAND, MID_FEEDBACK, GNEApplicationWindow::onCmdFeedback),
379 // alt + <number>
400 // key events
401 FXMAPFUNC(SEL_KEYPRESS, 0, GNEApplicationWindow::onKeyPress),
402 FXMAPFUNC(SEL_KEYRELEASE, 0, GNEApplicationWindow::onKeyRelease),
403 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ESC, GNEApplicationWindow::onCmdAbort),
404 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_DEL, GNEApplicationWindow::onCmdDel),
405 FXMAPFUNC(SEL_COMMAND, MID_HOTKEY_ENTER, GNEApplicationWindow::onCmdEnter),
407 // threads events
410 // edge template functions
414 // languages
433 // tools
436 // other
437 FXMAPFUNC(SEL_CLIPBOARD_REQUEST, 0, GNEApplicationWindow::onClipboardRequest),
444};
445
446// Object implementation
447FXIMPLEMENT(GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
448
449
450// ===========================================================================
451// GNEApplicationWindow method definitions
452// ===========================================================================
453
454GNEApplicationWindow::GNEApplicationWindow(FXApp* a, const std::string& configPattern) :
455 GUIMainWindow(a),
456 myUndoList(new GNEUndoList(this)),
457 myConfigPattern(configPattern),
458 myToolbarsGrip(this),
459 myMenuBarFile(this),
460 myFileMenuCommands(this),
461 myModesMenuCommands(this),
462 myEditMenuCommands(this),
463 myLockMenuCommands(this),
464 myProcessingMenuCommands(this),
465 myLocateMenuCommands(this),
466 myToolsMenuCommands(this),
467 myWindowsMenuCommands(this),
468 myHelpMenuCommands(this),
469 mySupermodeCommands(this),
470 myTitlePrefix("netedit " VERSION_STRING),
471 myAllowUndoRedo(getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedo", true) == TRUE),
472 myAllowUndoRedoLoading(getApp()->reg().readBoolEntry("NETEDIT", "AllowUndoRedoLoading", true) == TRUE) {
473 // init icons
475 // init Textures
477 // init cursors
479 // create undoList dialog (after initCursors)
480 myUndoListDialog = new GNEUndoListDialog(this);
481 a->setTooltipTime(1000000000);
482 a->setTooltipPause(1000000000);
483 // set SUMO Options descriptions
484 mySumoOptions.setApplicationDescription(TL("A microscopic, multi-modal traffic simulation."));
485 mySumoOptions.setApplicationName("sumo", "Eclipse SUMO sumo Version " VERSION_STRING);
486 // set default netedit options
487 GNELoadThread::fillOptions(myOriginalNeteditOptions);
488 GNELoadThread::setDefaultOptions(myOriginalNeteditOptions);
489 // parse options
490 TemplateHandler::parseTemplate(mySumoOptions, sumoTemplate);
491 TemplateHandler::parseTemplate(myOriginalSumoOptions, sumoTemplate);
492 TemplateHandler::parseTemplate(myNetgenerateOptions, netgenerateTemplate);
493 TemplateHandler::parseTemplate(myOriginalNetgenerateOptions, netgenerateTemplate);
494}
495
496void
498 // do this not twice
500 // do not translate debug messages
501 WRITE_ERROR("DEBUG: GNEApplicationWindow::dependentBuild called twice");
502 return;
503 }
504 myHadDependentBuild = true;
505 setTarget(this);
506 setSelector(MID_WINDOW);
507 // build toolbar menu
509 // build the thread - io
512 // build the status bar
513 myStatusbar = new FXStatusBar(this, GUIDesignStatusBar);
514 // build geo coordinates label
515 auto requireRecomputingFrame = new FXHorizontalFrame(myStatusbar, GUIDesignHorizontalFrameStatusBar);
517 TL("Recomputing"), nullptr, this, MID_GNE_RECOMPUTINGNEEDED, GUIDesignButtonStatusBarFixed);
518 myRequireRecomputingButton->setHelpText(TL("Recomputing is needed"));
519 // build geo coordinates label
521 myGeoCoordinate = new FXLabel(myGeoFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
522 myGeoCoordinate->setHelpText(TL("Original coordinate (before coordinate transformation in netconvert)"));
523 // build cartesian coordinates label
525 myCartesianCoordinate = new FXLabel(myCartesianFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
526 myCartesianCoordinate->setHelpText(TL("Network coordinate"));
527 // build test coordinates label (only if gui-testing is enabled)
529 myTestCoordinate = new FXLabel(myTestFrame, TL("N/A"), nullptr, GUIDesignLabelStatusBar);
530 myTestCoordinate->setHelpText(TL("Test coordinate"));
531 myTestCoordinate->setTextColor(FXRGB(255, 0, 0));
532 myTestFrame->hide();
533 // make the window a mdi-window
534 myMainSplitter = new FXSplitter(this, GUIDesignSplitter | SPLITTER_VERTICAL | SPLITTER_REVERSED);
536 myMDIMenu = new FXMDIMenu(this, myMDIClient);
537 // build the message window
539 myMainSplitter->setSplit(1, 65);
540 // fill menu and tool bar
541 fillMenuBar();
542 // build additional threads
544 // set the status bar
545 setStatusBarText(TL("Ready."));
546 // set the caption
547 setTitle(myTitlePrefix);
548 // set Netedit ICON
551 // build netedit Accelerators (hotkeys)
552 GUIShortcutsSubSys::buildAccelerators(getAccelTable(), this, false);
553}
554
555
556void
558 // set windows size and position
560 // set current folder
561 gCurrentFolder = getApp()->reg().readStringEntry("SETTINGS", "basedir", "");
562 // Create main window
563 FXMainWindow::create();
564 // get text width
565 const auto textWidth = getApp()->getNormalFont()->getTextWidth("8", 1) * 22;
566 // adjust cartesian and geo frame
567 myCartesianFrame->setWidth(textWidth);
568 myGeoFrame->setWidth(textWidth);
569 // fill online maps
570 if (myOnlineMaps.empty()) {
571 myOnlineMaps["GeoHack"] = "https://geohack.toolforge.org/geohack.php?params=%lat;%lon_scale:1000";
572 myOnlineMaps["Google Maps"] = "https://www.google.com/maps?ll=%lat,%lon&t=h&z=18";
573 myOnlineMaps["OSM"] = "https://www.openstreetmap.org/?mlat=%lat&mlon=%lon&zoom=18&layers=M";
574 }
575 // show application windows
576 show(PLACEMENT_DEFAULT);
577 // check if maximice
578 if (!OptionsCont::getOptions().isSet("window-size")) {
579 if (getApp()->reg().readIntEntry("SETTINGS", "maximized", 0) == 1) {
580 maximize();
581 }
582 }
583}
584
585
588 // Close icons
590 // Close gifs (Textures)
593 // delete visuals
594 delete myGLVisual;
595 // must delete menus to avoid segfault on removing accelerators
596 // (http://www.fox-toolkit.net/faq#TOC-What-happens-when-the-application-s)
599 delete myFileMenuTLS;
600 delete myFileMenuEdgeTypes;
607 delete myFileMenu;
608 delete myModesMenu;
609 delete myEditMenu;
610 delete myLockMenu;
611 delete myProcessingMenu;
612 delete myLocatorMenu;
613 delete myToolsMenu;
614 delete myToolsDetectorMenu;
615 delete myToolsDistrictMenu;
616 delete myToolsDRTMenu;
618 delete myToolsImportMenu;
621 delete myToolsImportVissim;
622 delete myToolsImportVisum;
623 delete myToolsNetMenu;
624 delete myToolsRouteMenu;
625 delete myToolsOutputMenu;
626 delete myToolsShapes;
627 delete myToolsTLS;
628 delete myToolsTurnDefs;
630 delete myToolsXML;
631 delete myWindowMenu;
632 delete myHelpMenu;
633 delete myLanguageMenu;
634 // Delete load thread
635 delete myLoadThread;
636 // drop all events
637 while (!myEvents.empty()) {
638 // get the next event
639 GUIEvent* e = myEvents.top();
640 myEvents.pop();
641 delete e;
642 }
643 // delete undoList and dialog
644 delete myUndoList;
645 delete myUndoListDialog;
646}
647
648
649long
650GNEApplicationWindow::onCmdQuit(FXObject*, FXSelector, void*) {
653 getApp()->reg().writeStringEntry("SETTINGS", "basedir", gCurrentFolder.text());
654 if (isMaximized()) {
655 getApp()->reg().writeIntEntry("SETTINGS", "maximized", 1);
656 } else {
657 getApp()->reg().writeIntEntry("SETTINGS", "maximized", 0);
658 }
659 getApp()->exit(0);
660 }
661 return 1;
662}
663
664
665long
666GNEApplicationWindow::onCmdEditChosen(FXObject*, FXSelector, void*) {
667 GUIDialog_GLChosenEditor* chooser =
669 chooser->create();
670 chooser->show();
671 return 1;
672}
673
674
675long
676GNEApplicationWindow::onCmdNewNetwork(FXObject*, FXSelector, void*) {
677 // check if close current simulation
678 if (onCmdClose(0, 0, 0) == 1) {
679 // create new network
681 }
682 return 1;
683}
684
685
686long
688 // get netconvert filename
689 const auto netconvertFile = GNEApplicationWindowHelper::openNetconvertFileDialog(this);
690 // continue depending of netconvertFile
691 if (!netconvertFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
692 // load configuration
693 loadConfiguration(netconvertFile);
694 }
695 return 1;
696}
697
698
699long
700GNEApplicationWindow::onCmdOpenNetwork(FXObject*, FXSelector, void*) {
701 // get netconvert filename
702 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, false);
703 // continue depending of netconvertFile
704 if (!networkFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
705 // load network
706 loadNetwork(networkFile);
707 }
708 return 0;
709}
710
711
712long
713GNEApplicationWindow::onCmdOpenForeign(FXObject*, FXSelector, void*) {
714 // get netconvert filename
715 const auto OSMFile = GNEApplicationWindowHelper::openOSMFileDialog(this);
716 // continue depending of netconvertFile
717 if (!OSMFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
718 loadOSM(OSMFile);
719 }
720 return 1;
721}
722
723
724long
725GNEApplicationWindow::onCmdOpenNeteditConfig(FXObject*, FXSelector, void*) {
726 auto& neteditOptions = OptionsCont::getOptions();
727 // get netconvert filename
728 const auto neteditConfigFile = GNEApplicationWindowHelper::openNeteditConfigFileDialog(this, false);
729 // continue depending of netconvertFile
730 if (!neteditConfigFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
731 // reset netedit options
732 myLoadThread->fillOptions(neteditOptions);
733 myLoadThread->setDefaultOptions(neteditOptions);
734 // set netedit configuration file to load
735 neteditOptions.resetWritable();
736 neteditOptions.set("configuration-file", neteditConfigFile);
737 // run load thread
739 // update view
740 update();
741 }
742 return 1;
743}
744
745
746long
747GNEApplicationWindow::onCmdOpenSumoConfig(FXObject*, FXSelector, void*) {
748 auto& neteditOptions = OptionsCont::getOptions();
749 // get netconvert filename
750 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, false);
751 // continue depending of netconvertFile
752 if (!sumoConfigFile.empty() && (onCmdClose(0, 0, 0) == 1)) {
753 // reset options
754 myLoadThread->fillOptions(neteditOptions);
755 myLoadThread->setDefaultOptions(neteditOptions);
756 // set sumo configuration file to load
757 neteditOptions.resetWritable();
758 neteditOptions.set("sumocfg-file", sumoConfigFile);
759 // run load thread
761 // update view
762 update();
763 }
764 return 1;
765}
766
767
768long
770 // check if close current simulation
771 if (onCmdClose(0, 0, 0) == 1) {
772 auto& neteditOptions = OptionsCont::getOptions();
773 // get existent configuration file
774 const auto neteditConfigFile = neteditOptions.getString("configuration-file");
775 // reset options
776 myLoadThread->fillOptions(neteditOptions);
777 myLoadThread->setDefaultOptions(neteditOptions);
778 // set configuration file to load
779 neteditOptions.resetWritable();
780 neteditOptions.set("configuration-file", neteditConfigFile);
781 // run load thread
783 // update view
784 update();
785 }
786 return 1;
787}
788
789
790long
791GNEApplicationWindow::onCmdReloadSumoConfig(FXObject*, FXSelector, void*) {
792 auto& neteditOptions = OptionsCont::getOptions();
793 // check if close current simulation
794 if (onCmdClose(0, 0, 0) == 1) {
795 const auto sumoConfigFile = neteditOptions.getString("sumocfg-file");
796 // reset options
797 myLoadThread->fillOptions(neteditOptions);
798 myLoadThread->setDefaultOptions(neteditOptions);
799 // set configuration file to load
800 neteditOptions.resetWritable();
801 neteditOptions.set("sumocfg-file", sumoConfigFile);
802 // run load thread
804 // update view
805 update();
806 }
807 return 1;
808}
809
810
811long
812GNEApplicationWindow::onUpdReloadNeteditConfig(FXObject* sender, FXSelector, void*) {
813 // check if file exist
814 if (myViewNet && !OptionsCont::getOptions().getString("configuration-file").empty()) {
815 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
816 } else {
817 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
818 }
819}
820
821
822long
823GNEApplicationWindow::onUpdReloadSumoConfig(FXObject* sender, FXSelector, void*) {
824 // check if file exist
825 if (myViewNet && !OptionsCont::getOptions().getString("sumocfg-file").empty()) {
826 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
827 } else {
828 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
829 }
830}
831
832
833long
834GNEApplicationWindow::onCmdOpenTLSPrograms(FXObject*, FXSelector, void*) {
835 auto& neteditOptions = OptionsCont::getOptions();
836 // get netconvert filename
837 const auto TLSFile = GNEApplicationWindowHelper::openTLSFileDialog(this, false);
838 // continue depending of netconvertFile
839 if (!TLSFile.empty()) {
840 // set file to load
841 neteditOptions.resetWritable();
842 neteditOptions.set("tls-file", TLSFile);
843 // Run parser
844 myUndoList->begin(Supermode::NETWORK, GUIIcon::MODETLS, TL("loading TLS Programs from '") + TLSFile + "'");
845 myNet->computeNetwork(this);
846 if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(TLSFile) == false) {
847 // Abort undo/redo
849 } else {
850 // commit undo/redo operation
851 myUndoList->end();
852 update();
853 }
854 } else {
855 // write debug information
856 WRITE_DEBUG("Cancel TLSProgram dialog");
857 }
858 return 1;
859}
860
861
862long
863GNEApplicationWindow::onCmdReloadTLSPrograms(FXObject*, FXSelector, void*) {
864 // get option container
865 auto& neteditOptions = OptionsCont::getOptions();
866 // Run parser
867 myUndoList->begin(Supermode::NETWORK, GUIIcon::MODETLS, TL("loading TLS Programs from '") + neteditOptions.getString("tls-file") + "'");
868 myNet->computeNetwork(this);
869 if (myNet->getViewNet()->getViewParent()->getTLSEditorFrame()->parseTLSPrograms(neteditOptions.getString("tls-file")) == false) {
870 // Abort undo/redo
872 } else {
873 // commit undo/redo operation
874 myUndoList->end();
875 update();
876 }
877 return 1;
878}
879
880
881long
882GNEApplicationWindow::onUpdReloadTLSPrograms(FXObject* sender, FXSelector, void*) {
883 // check if file exist
884 if (myViewNet && OptionsCont::getOptions().getString("tls-file").empty()) {
885 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
886 } else {
887 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
888 }
889}
890
891
892long
893GNEApplicationWindow::onCmdOpenEdgeTypes(FXObject*, FXSelector, void*) {
894 auto& neteditOptions = OptionsCont::getOptions();
895 // get netconvert filename
896 const auto edgeTypeFile = GNEApplicationWindowHelper::openEdgeTypeFileDialog(this, false);
897 // continue depending of netconvertFile
898 if (!edgeTypeFile.empty()) {
899 // set file to load
900 neteditOptions.resetWritable();
901 neteditOptions.set("edgetypes-file", edgeTypeFile);
902 // declare type container
903 NBTypeCont typeContainerAux;
904 // declare type handler
905 NIXMLTypesHandler handler(typeContainerAux);
906 // load edge types
907 NITypeLoader::load(handler, {edgeTypeFile}, "types");
908 // write information
909 WRITE_MESSAGE(TL("Loaded edge types from '") + toString(typeContainerAux.size()) + "'");
910 // now create GNETypes based on typeContainerAux
912 // iterate over typeContainerAux
913 for (const auto& auxEdgeType : typeContainerAux) {
914 // create new edge type
915 GNEEdgeType* edgeType = new GNEEdgeType(myNet, auxEdgeType.first, auxEdgeType.second);
916 // add lane types
917 for (const auto& laneType : auxEdgeType.second->laneTypeDefinitions) {
918 edgeType->addLaneType(new GNELaneType(edgeType, laneType));
919 }
920 // add it using undoList
921 myViewNet->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true);
922
923 }
924 // end undo list
926 // refresh edge type selector
928 }
929 return 1;
930}
931
932
933long
934GNEApplicationWindow::onCmdReloadEdgeTypes(FXObject*, FXSelector, void*) {
935 // declare type container
936 NBTypeCont typeContainerAux;
937 // declare type handler
938 NIXMLTypesHandler handler(typeContainerAux);
939 // load edge types
940 NITypeLoader::load(handler, {OptionsCont::getOptions().getString("edgetypes-file")}, "types");
941 // write information
942 WRITE_MESSAGE(TL("Reloaded edge types from '") + toString(typeContainerAux.size()) + ".");
943 // now create GNETypes based on typeContainerAux
945 // iterate over typeContainerAux
946 for (const auto& auxEdgeType : typeContainerAux) {
947 // create new edge type
948 GNEEdgeType* edgeType = new GNEEdgeType(myNet, auxEdgeType.first, auxEdgeType.second);
949 // add lane types
950 for (const auto& laneType : auxEdgeType.second->laneTypeDefinitions) {
951 edgeType->addLaneType(new GNELaneType(edgeType, laneType));
952 }
953 // add it using undoList
954 myViewNet->getUndoList()->add(new GNEChange_EdgeType(edgeType, true), true);
955
956 }
957 // end undo list
959 // refresh edge type selector
961 return 0;
962}
963
964
965long
966GNEApplicationWindow::onUpdReloadEdgeTypes(FXObject* sender, FXSelector, void*) {
967 // check if file exist
968 if (myViewNet && OptionsCont::getOptions().getString("edgetypes-file").empty()) {
969 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
970 } else {
971 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
972 }
973}
974
975
976long
977GNEApplicationWindow::onCmdSmartReload(FXObject*, FXSelector, void*) {
978 auto& neteditOptions = OptionsCont::getOptions();
979 // check if close current file
980 if (onCmdClose(0, 0, 0) == 1) {
981 // store size, position and viewport
983 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
984 // set flag
985 myAmLoading = true;
986 // get files
987 const auto neteditConfig = neteditOptions.getString("configuration-file");
988 const auto sumoConfig = neteditOptions.getString("sumocfg-file");
989 const auto networkFile = neteditOptions.getString("net-file");
990 // fill (reset) all options
991 myLoadThread->fillOptions(neteditOptions);
992 // set default options defined in GNELoadThread::setDefaultOptions(...)
993 myLoadThread->setDefaultOptions(neteditOptions);
994 // set file to load
995 neteditOptions.resetWritable();
996 if (neteditConfig.size() > 0) {
997 neteditOptions.set("configuration-file", neteditConfig);
998 // set status bar
999 setStatusBarText(TL("Reloading netedit config file '") + neteditConfig + "'");
1000 } else if (sumoConfig.size() > 0) {
1001 neteditOptions.set("sumocfg-file", sumoConfig);
1002 // set status bar
1003 setStatusBarText(TL("Reloading sumo config file '") + sumoConfig + "'");
1004 } else if (networkFile.size() > 0) {
1005 neteditOptions.set("net-file", networkFile);
1006 // set status bar
1007 setStatusBarText(TL("Reloading network file '") + networkFile + "'");
1008 } else {
1009 // nothing to load
1010 return 0;
1011 }
1012 // load network
1014 }
1015 return 1;
1016}
1017
1018
1019long
1020GNEApplicationWindow::onUpdSmartReload(FXObject* sender, FXSelector, void*) {
1021 auto& neteditOptions = OptionsCont::getOptions();
1022 // declare strings
1023 FXString neteditConfig = TL("&Reload Netedit config");
1024 FXString sumoConfig = TL("&Reload Sumo config");
1025 FXString netFile = TL("&Reload Network");
1026 FXString reload = TL("&Reload");
1027 // check options
1028 if (myNet == nullptr) {
1029 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1030 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &reload);
1031 } else if (neteditOptions.getString("configuration-file").size() > 0) {
1032 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1033 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &neteditConfig);
1034 } else if (neteditOptions.getString("sumocfg-file").size() > 0) {
1035 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1036 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &sumoConfig);
1037 } else if (neteditOptions.getString("net-file").size() > 0) {
1038 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1039 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &netFile);
1040 } else {
1041 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1042 sender->handle(this, FXSEL(SEL_COMMAND, ID_SETSTRINGVALUE), &reload);
1043 }
1044 return 1;
1045}
1046
1047
1048long
1049GNEApplicationWindow::onCmdReloadNetwork(FXObject*, FXSelector, void*) {
1050 auto& neteditOptions = OptionsCont::getOptions();
1051 // check if close current file
1052 if (onCmdClose(0, 0, 0) == 1) {
1053 // store size, position and viewport
1055 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1056 // set flag
1057 myAmLoading = true;
1058 // get network
1059 const auto networkFile = neteditOptions.getString("net-file");
1060 // fill (reset) all options
1061 myLoadThread->fillOptions(neteditOptions);
1062 // set default options defined in GNELoadThread::setDefaultOptions(...)
1063 myLoadThread->setDefaultOptions(neteditOptions);
1064 // set file to load
1065 neteditOptions.resetWritable();
1066 neteditOptions.set("net-file", networkFile);
1067 // set status bar
1068 setStatusBarText(TL("Reloading network file '") + networkFile + "'");
1069 // loaad network
1071 }
1072 return 1;
1073}
1074
1075
1076long
1077GNEApplicationWindow::onUpdReloadNetwork(FXObject* sender, FXSelector, void*) {
1078 auto& neteditOptions = OptionsCont::getOptions();
1079 if (myNet == nullptr) {
1080 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1081 sender->handle(this, FXSEL(SEL_COMMAND, ID_HIDE), nullptr);
1082 } else if ((neteditOptions.getString("net-file").size() > 0) &&
1083 ((neteditOptions.getString("configuration-file").size() > 0) || (neteditOptions.getString("sumocfg-file").size() > 0))) {
1084 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1085 sender->handle(this, FXSEL(SEL_COMMAND, ID_SHOW), nullptr);
1086 } else {
1087 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
1088 sender->handle(this, FXSEL(SEL_COMMAND, ID_HIDE), nullptr);
1089 }
1090 return 1;
1091}
1092
1093
1094long
1095GNEApplicationWindow::onCmdOpenRecent(FXObject*, FXSelector, void* fileData) {
1096 // first check that current edited Net can be closed (und therefore the undo-list cleared, see #5753)
1097 if (myAmLoading) {
1098 myStatusbar->getStatusLine()->setText(TL("Already loading!"));
1099 } else if (onCmdClose(0, 0, 0) == 1) {
1100 // get filedata
1101 const std::string recentFile = ((const char*)fileData);
1102 // check if we're loading a network o a config
1103 if ((recentFile.find(".neteditcfg") != std::string::npos) || // neteditcfg deprecated
1104 (recentFile.find(".netecfg") != std::string::npos) ||
1105 (recentFile.find(".sumocfg") != std::string::npos) ||
1106 (recentFile.find(".netccfg") != std::string::npos)) {
1107 // load config
1108 loadConfiguration(recentFile);
1109 } else {
1110 // load network
1111 loadNetwork(recentFile);
1112 }
1113 }
1114 return 1;
1115}
1116
1117
1118long
1119GNEApplicationWindow::onCmdClose(FXObject*, FXSelector, void*) {
1120 if (myViewNet == nullptr) {
1121 return 1;
1122 } else if (continueWithUnsavedChanges()) {
1124 // add a separator to the log
1126 // hide all menu commands
1130 // hide view options
1134 return 1;
1135 } else {
1136 return 0;
1137 }
1138}
1139
1140
1141long
1142GNEApplicationWindow::onCmdLocate(FXObject*, FXSelector sel, void*) {
1143 if (myMDIClient->numChildren() > 0) {
1144 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
1145 if (w != nullptr) {
1146 w->onCmdLocate(nullptr, sel, nullptr);
1147 }
1148 }
1149 return 1;
1150}
1151
1152
1153long
1154GNEApplicationWindow::onCmdOpenPythonToolDialog(FXObject* obj, FXSelector, void*) {
1155 return myToolsMenuCommands.showTool(obj);
1156}
1157
1158
1159long
1160GNEApplicationWindow::onCmdRunPythonTool(FXObject* obj, FXSelector, void*) {
1162}
1163
1164
1165long
1168}
1169
1170
1171long
1172GNEApplicationWindow::onUpdPythonTool(FXObject*, FXSelector, void*) {
1173 // currently always enabled
1174 return 1;
1175}
1176
1177
1178long
1179GNEApplicationWindow::onUpdOpen(FXObject* sender, FXSelector, void*) {
1180 sender->handle(this, myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
1181 return 1;
1182}
1183
1184
1185long
1186GNEApplicationWindow::onCmdClearMsgWindow(FXObject*, FXSelector, void*) {
1188 return 1;
1189}
1190
1191
1192long
1194 // write warning if netedit is running in testing mode
1195 WRITE_DEBUG("Toggle load additionals in sumo-gui");
1196 return 1;
1197}
1198
1199
1200long
1202 // write warning if netedit is running in testing mode
1203 WRITE_DEBUG("Toggle load demand in sumo-gui");
1204 return 1;
1205}
1206
1207
1208long
1209GNEApplicationWindow::onCmdAbout(FXObject*, FXSelector, void*) {
1210 // write warning if netedit is running in testing mode
1211 WRITE_DEBUG("Opening about dialog");
1212 // create and open about dialog
1213 GNEAbout* about = new GNEAbout(this);
1214 about->create();
1215 about->show(PLACEMENT_OWNER);
1216 // write warning if netedit is running in testing mode
1217 WRITE_DEBUG("Closed about dialog");
1218 return 1;
1219}
1220
1221
1222long GNEApplicationWindow::onClipboardRequest(FXObject*, FXSelector, void* ptr) {
1223 FXEvent* event = (FXEvent*)ptr;
1224 FXString string = GUIUserIO::clipped.c_str();
1225 setDNDData(FROM_CLIPBOARD, event->target, string);
1226 return 1;
1227}
1228
1229
1230long
1231GNEApplicationWindow::onLoadThreadEvent(FXObject*, FXSelector, void*) {
1232 eventOccurred();
1233 return 1;
1234}
1235
1236
1237void
1239 while (!myEvents.empty()) {
1240 // get the next event
1241 GUIEvent* e = myEvents.top();
1242 myEvents.pop();
1243 // process
1244 switch (e->getOwnType()) {
1247 break;
1254 break;
1255 default:
1256 break;
1257 }
1258 delete e;
1259 }
1260}
1261
1262
1263void
1265 myAmLoading = false;
1266 GNEEvent_NetworkLoaded* ec = static_cast<GNEEvent_NetworkLoaded*>(e);
1267 // check whether the loading was successfull
1268 if (ec->net == nullptr) {
1269 // report failure
1270 setStatusBarText(TL("Loading of '") + ec->file + "' failed!");
1271 } else {
1272 // set new Net
1273 myNet = ec->net;
1274 // report success
1275 setStatusBarText(TL("'") + ec->file + TL("' loaded."));
1277 // build viewparent toolbar grips before creating view parent
1279 // initialise netedit View
1280 GNEViewParent* viewParent = new GNEViewParent(myMDIClient, myMDIMenu, "netedit VIEW", this, nullptr, myNet, myUndoList, nullptr, MDI_TRACKING, 10, 10, 300, 200);
1281 // create it maximized
1282 viewParent->maximize();
1283 // mark it as Active child
1284 myMDIClient->setActiveChild(viewParent);
1285 // cast pointer myViewNet
1286 myViewNet = dynamic_cast<GNEViewNet*>(viewParent->getView());
1287 // set settings in view
1288 if (viewParent->getView() && ec->settingsFile != "") {
1289 GUISettingsHandler settings(ec->settingsFile, true, true);
1290 settings.addSettings(viewParent->getView());
1291 viewParent->getView()->addDecals(settings.getDecals());
1292 settings.applyViewport(viewParent->getView());
1293 settings.setSnapshots(viewParent->getView());
1294 }
1295 // set network name on the caption
1296 setTitle(MFXUtils::getTitleText(myTitlePrefix, ec->file.c_str()));
1297 // force supermode network
1298 if (myViewNet) {
1300 }
1301 if (myViewNet && ec->viewportFromRegistry) {
1302 Position off;
1303 off.set(getApp()->reg().readRealEntry("viewport", "x"), getApp()->reg().readRealEntry("viewport", "y"), getApp()->reg().readRealEntry("viewport", "z"));
1304 Position p(off.x(), off.y(), 0);
1305 myViewNet->setViewportFromToRot(off, p, 0);
1306 }
1307 }
1309 // load elements
1314 // load selection
1315 if (!OptionsCont::getOptions().isDefault("selection-file")) {
1317 }
1318 // after loading net shouldn't be saved
1319 if (myNet) {
1321 }
1322 // update app
1323 update();
1324 // restore focus
1325 setFocus();
1326}
1327
1328
1329void
1334
1335// ---------------------------------------------------------------------------
1336// private methods
1337// ---------------------------------------------------------------------------
1338
1339void
1341 // build file menu
1342 myFileMenu = new FXMenuPane(this, LAYOUT_FIX_HEIGHT);
1344 myFileMenuNeteditConfig = new FXMenuPane(this);
1345 myFileMenuSumoConfig = new FXMenuPane(this);
1346 myFileMenuTLS = new FXMenuPane(this);
1347 myFileMenuEdgeTypes = new FXMenuPane(this);
1348 myFileMenuAdditionals = new FXMenuPane(this);
1349 myFileMenuDemandElements = new FXMenuPane(this);
1350 myFileMenuDataElements = new FXMenuPane(this);
1351 myFileMenuMeanDataElements = new FXMenuPane(this);
1352 myFileMenuRecentNetworks = new FXMenuPane(this);
1353 myFileMenuRecentConfigs = new FXMenuPane(this);
1357 // add separator for recent files
1358 new FXMenuSeparator(myFileMenu);
1359 // build recent files
1362 new FXMenuSeparator(myFileMenu);
1364 TL("&Quit"), "Ctrl+Q", TL("Quit the Application."),
1365 nullptr, this, MID_HOTKEY_CTRL_Q_CLOSE);
1366 // build modes menu
1367 myModesMenu = new FXMenuPane(this);
1369 myModesMenuTitle->setTarget(this);
1371 // build Supermode commands and hide it
1373 // add separator
1374 new FXSeparator(myModesMenu);
1375 // build modes menu commands
1377 // build edit menu
1378 myEditMenu = new FXMenuPane(this);
1380 // build edit menu commands
1382 // build separator
1383 new FXMenuSeparator(myEditMenu);
1384 // build view options
1388 // hide view options
1392 // build view menu commands
1394 // build separator
1395 new FXMenuSeparator(myEditMenu);
1396 // build front element menu commands
1398 // build separator
1399 new FXMenuSeparator(myEditMenu);
1400 // build open in sumo menu commands
1402 // build lock menu
1403 myLockMenu = new FXMenuPane(this);
1405 myLockMenuTitle->setTarget(this);
1407 // build lock menu commands
1409 // build processing menu (trigger netbuild computations)
1410 myProcessingMenu = new FXMenuPane(this);
1413 // build locate menu
1414 myLocatorMenu = new FXMenuPane(this);
1417 // build tools menu
1418 myToolsMenu = new FXMenuPane(this);
1419 myToolsDetectorMenu = new FXMenuPane(this);
1420 myToolsDistrictMenu = new FXMenuPane(this);
1421 myToolsDRTMenu = new FXMenuPane(this);
1422 myToolsEmissionsMenu = new FXMenuPane(this);
1423 myToolsImportMenu = new FXMenuPane(this);
1424 myToolsImportCityBrainMenu = new FXMenuPane(this);
1425 myToolsImportGTFSMenu = new FXMenuPane(this);
1426 myToolsImportVissim = new FXMenuPane(this);
1427 myToolsImportVisum = new FXMenuPane(this);
1428 myToolsNetMenu = new FXMenuPane(this);
1429 myToolsRouteMenu = new FXMenuPane(this);
1430 myToolsOutputMenu = new FXMenuPane(this);
1431 myToolsShapes = new FXMenuPane(this);
1432 myToolsTLS = new FXMenuPane(this);
1433 myToolsTurnDefs = new FXMenuPane(this);
1434 myToolsVisualizationMenu = new FXMenuPane(this);
1435 myToolsXML = new FXMenuPane(this);
1437 // build tools menu cascasde
1438 new FXMenuCascade(myToolsMenu, TL("Detectors"), GUIIconSubSys::getIcon(GUIIcon::E1), myToolsDetectorMenu);
1439 new FXMenuCascade(myToolsMenu, TL("Districts"), GUIIconSubSys::getIcon(GUIIcon::TAZ), myToolsDistrictMenu);
1441 //new FXMenuCascade(myToolsMenu, TL("Emissions"), GUIIconSubSys::getIcon(GUIIcon::TOOL_EMISSIONS), myToolsEmissionsMenu);
1450 //new FXMenuCascade(myToolsMenu, TL("Shapes"), GUIIconSubSys::getIcon(GUIIcon::MODESHAPE), myToolsShapes);
1451 new FXMenuCascade(myToolsMenu, TL("TLS"), GUIIconSubSys::getIcon(GUIIcon::MODETLS), myToolsTLS);
1455 // add separators between folders
1456 new FXMenuSeparator(myToolsMenu);
1457 new FXMenuSeparator(myToolsImportMenu);
1458 // create map with tool Menu panes and their associated folder
1464 myMenuPaneToolMaps["import/citybrain"] = myToolsImportCityBrainMenu;
1466 myMenuPaneToolMaps["import/vissim"] = myToolsImportVissim;
1467 myMenuPaneToolMaps["import/visum"] = myToolsImportVisum;
1473 myMenuPaneToolMaps["turn-defs"] = myToolsTurnDefs;
1476 // build tools
1478 // build windows menu
1479 myWindowMenu = new FXMenuPane(this);
1482 // build language menu
1484 // build help menu
1485 myHelpMenu = new FXMenuPane(this);
1488}
1489
1490
1491FXGLCanvas*
1493 // netedit uses only a single View, then return nullptr
1494 return nullptr;
1495}
1496
1497
1500 return 0;
1501}
1502
1503
1504double
1506 return 1;
1507}
1508
1509
1514
1515
1520
1521
1526
1527
1532
1533
1534void
1536 if (myViewNet && myViewNet->getNet()) {
1537 // show
1539 // set label depending of recomputing
1541 myRequireRecomputingButton->setText("");
1542 myRequireRecomputingButton->setTipText(TL("Network computed"));
1544 myRequireRecomputingButton->setBackColor(FXRGBA(240, 255, 205, 255));
1545 } else {
1546 myRequireRecomputingButton->setText(TL("Press F5"));
1547 myRequireRecomputingButton->setTipText(TL("Network requires recomputing"));
1549 myRequireRecomputingButton->setBackColor(FXRGBA(253, 255, 206, 255));
1550 }
1551 } else {
1552 // hide
1554 }
1555}
1556
1557
1558void
1560 // first check if net must be deleted
1561 if (myNet != nullptr) {
1562 delete myNet;
1563 myNet = nullptr;
1565 }
1566 // check if view has to be saved
1567 if (myViewNet) {
1569 // clear decals
1570 myViewNet->getDecals().clear();
1571 }
1572 // lock tracker
1573 myTrackerLock.lock();
1574 // remove trackers and other external windows
1575 while (!myGLWindows.empty()) {
1576 delete myGLWindows.front();
1577 }
1578 myViewNet = nullptr;
1579 for (FXMainWindow* const window : myTrackerWindows) {
1580 window->destroy();
1581 delete window;
1582 }
1583 myTrackerWindows.clear();
1584 // reset the caption
1585 setTitle(myTitlePrefix);
1586 // unlock tracker
1587 myTrackerLock.unlock();
1588 // remove coordinate information
1589 myGeoCoordinate->setText(TL("N/A"));
1590 myCartesianCoordinate->setText(TL("N/A"));
1591 myTestCoordinate->setText(TL("N/A"));
1592 myTestFrame->hide();
1594 // Reset textures
1596 // reset fonts
1598}
1599
1600
1601FXCursor*
1603 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1604}
1605
1606
1607void
1609 auto& neteditOptions = OptionsCont::getOptions();
1610 if (neteditOptions.getBool("new")) {
1612 } else {
1613 // set flag
1614 myAmLoading = true;
1615 // set status bar
1616 setStatusBarText(TL("Loading console arguments"));
1617 // load console arguments
1619 // add it into recent networks and configs
1620 if (neteditOptions.getString("net-file").size() > 0) {
1621 myMenuBarFile.myRecentNetworks.appendFile(neteditOptions.getString("net-file").c_str());
1622 }
1623 if (neteditOptions.getString("configuration-file").size() > 0) {
1624 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("configuration-file").c_str());
1625 }
1626 }
1627}
1628
1629
1630void
1632 auto& neteditOptions = OptionsCont::getOptions();
1633 // save windows size and position
1635 // enable loading flag and disable reloading flag
1636 myAmLoading = true;
1637 // recenter view
1638 gSchemeStorage.saveViewport(0, 0, -1, 0);
1639 // fill (reset) all options
1640 GNELoadThread::fillOptions(neteditOptions);
1641 // set default options defined in GNELoadThread::setDefaultOptions(...)
1642 GNELoadThread::setDefaultOptions(neteditOptions);
1643 // update status bar
1644 setStatusBarText(TL("Creating new network."));
1645 // create new network
1647 // update window
1648 update();
1649}
1650
1651
1652void
1653GNEApplicationWindow::loadNetwork(const std::string& networkFile) {
1654 if (networkFile.empty()) {
1655 WRITE_ERROR(TL("Trying to load an empty network"));
1656 } else {
1657 auto& neteditOptions = OptionsCont::getOptions();
1658 // store size, position and viewport
1660 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1661 // set flag
1662 myAmLoading = true;
1663 // fill (reset) all options
1664 myLoadThread->fillOptions(neteditOptions);
1665 // set default options defined in GNELoadThread::setDefaultOptions(...)
1666 myLoadThread->setDefaultOptions(neteditOptions);
1667 // set file to load
1668 neteditOptions.resetWritable();
1669 neteditOptions.set("net-file", networkFile);
1670 // set status bar
1671 setStatusBarText(TL("Loading network file '") + networkFile + "'");
1672 // load network
1674 // add it into recent nets
1675 myMenuBarFile.myRecentNetworks.appendFile(networkFile.c_str());
1676 }
1677}
1678
1679
1680void
1681GNEApplicationWindow::loadConfiguration(const std::string& configurationFile) {
1682 if (configurationFile.empty()) {
1683 WRITE_ERROR(TL("Trying to load an empty configuration"));
1684 } else {
1685 auto& neteditOptions = OptionsCont::getOptions();
1686 // store size, position and viewport
1688 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1689 // set flag
1690 myAmLoading = true;
1691 // fill (reset) all options
1692 myLoadThread->fillOptions(neteditOptions);
1693 // set default options defined in GNELoadThread::setDefaultOptions(...)
1694 myLoadThread->setDefaultOptions(neteditOptions);
1695 // set file to load
1696 neteditOptions.resetWritable();
1697 neteditOptions.set("configuration-file", configurationFile);
1698 // set status bar
1699 setStatusBarText(TL("Loading configuration file '") + configurationFile + "'");
1700 // load config
1702 // add it into recent configs
1703 myMenuBarFile.myRecentConfigs.appendFile(configurationFile.c_str());
1704 }
1705}
1706
1707
1708void
1709GNEApplicationWindow::loadOSM(const std::string& OSMFile) {
1710 auto& neteditOptions = OptionsCont::getOptions();
1711 // store size, position and viewport
1713 gSchemeStorage.saveViewport(0, 0, -1, 0); // recenter view
1714 // set flag
1715 myAmLoading = true;
1716 // fill (reset) all options
1717 myLoadThread->fillOptions(neteditOptions);
1718 // set default options defined in GNELoadThread::setDefaultOptions(...)
1719 myLoadThread->setDefaultOptions(neteditOptions);
1720 // recommended osm options
1721 // https://sumo.dlr.de/wiki/Networks/Import/OpenStreetMap#Recommended_NETCONVERT_Options
1722 neteditOptions.set("osm-files", OSMFile);
1723 neteditOptions.set("geometry.remove", "true");
1724 neteditOptions.set("ramps.guess", "true");
1725 neteditOptions.set("junctions.join", "true");
1726 neteditOptions.set("tls.guess-signals", "true");
1727 neteditOptions.set("tls.discard-simple", "true");
1728 // open wizard dialog
1729 if (GNEOptionsDialog::Options(this, GUIIcon::SUPERMODENETWORK, OptionsCont::getOptions(), myOriginalNeteditOptions, TL("Select Import Options")).first == TRUE) {
1730 NIFrame::checkOptions(neteditOptions); // needed to set projection parameters
1731 // set file to load
1732 neteditOptions.resetWritable();
1733 neteditOptions.set("configuration-file", OSMFile);
1734 // set status bar
1735 setStatusBarText(TL("Loading OSM file '") + OSMFile + "'");
1736 // load config
1738 }
1739}
1740
1741void
1742GNEApplicationWindow::setStatusBarText(const std::string& statusBarText) {
1743 myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1744 myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1745}
1746
1747
1748long
1750 // declare variable to save FXMessageBox outputs.
1751 FXuint answer = 0;
1752 // write warning if netedit is running in testing mode
1753 WRITE_DEBUG("Opening FXMessageBox 'Volatile Recomputing'");
1754 // open question dialog box
1755 answer = FXMessageBox::question(myNet->getViewNet()->getApp(), MBOX_YES_NO, TL("Recompute with volatile options"),
1756 TL("Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?"));
1757 if (answer != 1) { //1:yes, 2:no, 4:esc
1758 // write warning if netedit is running in testing mode
1759 if (answer == 2) {
1760 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1761 } else if (answer == 4) {
1762 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1763 }
1764 // abort recompute with volatile options
1765 return 0;
1766 } else {
1767 // write warning if netedit is running in testing mode
1768 WRITE_DEBUG("Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1769 // save all elements
1770 onCmdSaveAdditionals(nullptr, 0, nullptr);
1771 onCmdSaveDemandElements(nullptr, 0, nullptr);
1772 onCmdSaveDataElements(nullptr, 0, nullptr);
1773 onCmdSaveMeanDatas(nullptr, 0, nullptr);
1774 // compute with volatile options
1775 myNet->computeNetwork(this, true, true);
1777 return 1;
1778 }
1779}
1780
1781
1782bool
1785 myConsoleOptionsLoaded = false;
1786 return true;
1787 } else {
1788 return false;
1789 }
1790}
1791
1792
1793long
1794GNEApplicationWindow::onCmdSetSuperMode(FXObject* sender, FXSelector sel, void* ptr) {
1795 // check that currently there is a View
1796 if (myViewNet) {
1797 myViewNet->onCmdSetSupermode(sender, sel, ptr);
1798 }
1799 return 1;
1800}
1801
1802
1803long
1804GNEApplicationWindow::onCmdSetMode(FXObject* sender, FXSelector sel, void* ptr) {
1805 // check that currently there is a View
1806 if (myViewNet) {
1807 myViewNet->onCmdSetMode(sender, sel, ptr);
1808 }
1809 return 1;
1810}
1811
1812
1813long
1814GNEApplicationWindow::onCmdLockElements(FXObject*, FXSelector, void*) {
1815 if (myViewNet) {
1817 }
1818 return 1;
1819}
1820
1821
1822long
1823GNEApplicationWindow::onCmdLockAllElements(FXObject*, FXSelector, void*) {
1824 // lock all
1827 return 1;
1828}
1829
1830
1831long
1833 // unlock all
1836 return 1;
1837}
1838
1839
1840long
1842 if (myViewNet) {
1843 myViewNet->update();
1844 }
1845 return 1;
1846}
1847
1848
1849long
1850GNEApplicationWindow::onUpdLockMenuTitle(FXObject*, FXSelector, void*) {
1851 if (myViewNet) {
1853 // supermode network
1859 myLockMenuTitle->enable();
1860 } else {
1861 myLockMenuTitle->disable();
1862 }
1864 // supermode demand
1869 myLockMenuTitle->enable();
1870 } else {
1871 myLockMenuTitle->disable();
1872 }
1874 // supermode data
1878 myLockMenuTitle->enable();
1879 } else {
1880 myLockMenuTitle->disable();
1881 }
1882 } else {
1883 myLockMenuTitle->disable();
1884 }
1885 } else {
1886 myLockMenuTitle->disable();
1887 }
1888 return 1;
1889}
1890
1891long
1892GNEApplicationWindow::onCmdProcessButton(FXObject*, FXSelector sel, void*) {
1893 // first check if there is a view
1894 if (myViewNet) {
1895 // process depending of supermode
1897 // check what FXMenuCommand was called
1898 switch (FXSELID(sel)) {
1900 // show extra information for tests
1901 WRITE_DEBUG("Key F5 (Compute) pressed");
1902 myNet->computeNetwork(this, true, false);
1904 break;
1906 // show extra information for tests
1907 WRITE_DEBUG("Keys Shift + F5 (Compute with volatile options) pressed");
1909 break;
1911 // show extra information for tests
1912 WRITE_DEBUG("Key F6 (Clean junction) pressed");
1914 break;
1916 // show extra information for tests
1917 WRITE_DEBUG("Key F7 (Join junctions) pressed");
1919 break;
1921 // show extra information for tests
1922 WRITE_DEBUG("Key F8 (Clean invalid crossings) pressed");
1924 break;
1925 default:
1926 break;
1927 }
1929 // check what FXMenuCommand was called
1930 switch (FXSELID(sel)) {
1932 // show extra information for tests
1933 WRITE_DEBUG("Key F5 (Compute) pressed");
1936 break;
1938 // show extra information for tests
1939 WRITE_DEBUG("Key F6 (RemoveUnusedRoutes) pressed");
1941 break;
1943 // show extra information for tests
1944 WRITE_DEBUG("Key F7 (JoinRoutes) pressed");
1946 break;
1948 // show extra information for tests
1949 WRITE_DEBUG("Key F7 (AdjustPersonPlans) pressed");
1951 break;
1953 // show extra information for tests
1954 WRITE_DEBUG("Key F8 (CleanInvalidDemandElements) pressed");
1956 break;
1957 default:
1958 break;
1959 }
1960 }
1961 }
1962 // refresh to update undo-redo button
1963 myViewNet->getViewParent()->getGNEAppWindows()->forceRefresh();
1964 return 1;
1965}
1966
1967
1968long
1969GNEApplicationWindow::onCmdNewWindow(FXObject*, FXSelector sel, void* /*ptr*/) {
1970 // get extra arguments
1971 std::string extraArg;
1973 extraArg = " -s " + myNetgenerateOptions.getValueString("output-file");
1974 }
1975 FXRegistry reg("SUMO netedit", "netedit");
1976 std::string netedit = "netedit";
1977 const char* sumoPath = getenv("SUMO_HOME");
1978 if (sumoPath != nullptr) {
1979#ifdef DEBUG
1980 std::string newPath = std::string(sumoPath) + "/bin/neteditD";
1981#else
1982 std::string newPath = std::string(sumoPath) + "/bin/netedit";
1983#endif
1984 if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
1985 netedit = "\"" + newPath + "\"";
1986 }
1987 }
1988 std::string cmd = netedit + extraArg;
1989 // start in background
1990#ifndef WIN32
1991 cmd = cmd + " &";
1992#else
1993 // see "help start" for the parameters
1994 cmd = "start /B \"\" " + cmd;
1995#endif
1996 WRITE_MESSAGE(TL("Running ") + cmd + ".");
1997 // yay! fun with dangerous commands... Never use this over the internet
1999 return 1;
2000}
2001
2002
2003long
2004GNEApplicationWindow::onCmdOpenSUMOGUI(FXObject* obj, FXSelector sel, void* ptr) {
2005 // get option container
2006 auto& neteditOptions = OptionsCont::getOptions();
2007 // input parameters
2008 std::string inputParameters;
2009 // if we have only a network, then load directly without creating a SumoConfig
2011 ((myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == FALSE) && (myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == FALSE))) {
2012 // force save network
2013 if (onCmdSaveNetwork(obj, sel, ptr) == 0) {
2014 // network wasn't saved, then stop
2015 return 0;
2016 }
2017 inputParameters = " --registry-viewport -n \"" + neteditOptions.getString("net-file") + "\"";
2018 // write info
2019 WRITE_MESSAGE(TL("Loading network '") + neteditOptions.getString("net-file") + TL("' in SUMO-GUI"));
2020 } else {
2021 // force save SumoConfig
2022 if (onCmdSaveSumoConfig(obj, sel, ptr) == 0) {
2023 // SumoConfig wasn't saved, then stop
2024 return 0;
2025 }
2026 inputParameters = " --registry-viewport -c \"" + neteditOptions.getString("sumocfg-file") + "\"";
2027 // write info
2028 WRITE_MESSAGE(TL("Loading sumo config '") + neteditOptions.getString("sumocfg-file") + TL("' in SUMO-GUI"));
2029 }
2030 // save current viewport in registry
2031 FXRegistry reg("SUMO GUI", "sumo-gui");
2032 reg.read();
2033 reg.writeRealEntry("viewport", "x", myViewNet->getChanger().getXPos());
2034 reg.writeRealEntry("viewport", "y", myViewNet->getChanger().getYPos());
2035 reg.writeRealEntry("viewport", "z", myViewNet->getChanger().getZPos());
2036 reg.write();
2037 // declare executable
2038 std::string sumoGuiExecutable = "sumo-gui";
2039 // if SUMO_HOME is defined, update executable
2040 const char* sumoHome = getenv("SUMO_HOME");
2041 if (sumoHome != nullptr) {
2042 std::string newPath = std::string(sumoHome) + "/bin/sumo-gui";
2043 if (FileHelpers::isReadable(newPath) || FileHelpers::isReadable(newPath + ".exe")) {
2044 sumoGuiExecutable = "\"" + newPath + "\"";
2045 }
2046 }
2047 // declare command
2048 std::string cmd = sumoGuiExecutable + inputParameters;
2049 // start in background
2050#ifndef WIN32
2051 cmd = cmd + " &";
2052#else
2053 // see "help start" for the parameters
2054 cmd = "start /B \"\" " + cmd;
2055#endif
2056 WRITE_MESSAGE(TL("Running ") + cmd + ".");
2057 // yay! fun with dangerous commands... Never use this over the internet
2059 return 1;
2060}
2061
2062
2063long
2064GNEApplicationWindow::onCmdAbort(FXObject*, FXSelector, void*) {
2065 // check that view exists
2066 if (myViewNet) {
2067 // show extra information for tests
2068 WRITE_DEBUG("Key ESC (abort) pressed");
2069 // first check if we're selecting a subset of edges in TAZ Frame
2071 // show extra information for tests
2072 WRITE_DEBUG("Cleaning current selected edges");
2073 // clear current selection
2075 } else if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2076 // check if stop select parent
2078 // show extra information for tests
2079 WRITE_DEBUG("Stop select new parent");
2080 // and stop select paretn
2082 } else {
2083 // show extra information for tests
2084 WRITE_DEBUG("Cleaning inspected elements");
2085 // clear inspected elements
2087 }
2088 } else {
2089 // abort current operation
2091 }
2092 }
2093 return 1;
2094}
2095
2096
2097long
2098GNEApplicationWindow::onCmdDel(FXObject*, FXSelector, void*) {
2099 // check that view exists
2100 if (myViewNet) {
2101 // show extra information for tests
2102 WRITE_DEBUG("Key DEL (delete) pressed");
2104 }
2105 return 1;
2106}
2107
2108
2109long
2110GNEApplicationWindow::onCmdEnter(FXObject*, FXSelector, void*) {
2111 // check that view exists
2112 if (myViewNet) {
2113 // show extra information for tests
2114 WRITE_DEBUG("Key ENTER pressed");
2116 }
2117 return 1;
2118}
2119
2120
2121long
2122GNEApplicationWindow::onCmdBackspace(FXObject*, FXSelector, void*) {
2123 // check that view exists
2124 if (myViewNet) {
2125 // show extra information for tests
2126 WRITE_DEBUG("Key BACKSPACE pressed");
2128 }
2129 return 1;
2130}
2131
2132
2133long
2134GNEApplicationWindow::onCmdFocusFrame(FXObject*, FXSelector, void*) {
2135 // check that view exists
2136 if (myViewNet) {
2138 }
2139 return 1;
2140}
2141
2142
2143long
2145 // check that view exists
2146 if (myViewNet) {
2148 }
2149 return 1;
2150}
2151
2152
2153long
2154GNEApplicationWindow::onCmdToggleTimeFormat(FXObject*, FXSelector, void*) {
2155 // check that view exists
2156 if (myViewNet) {
2158 // refresh flow frames
2159 if (myViewNet->getViewParent()->getVehicleFrame()->shown()) {
2161 }
2162 if (myViewNet->getViewParent()->getPersonFrame()->shown()) {
2164 }
2165 if (myViewNet->getViewParent()->getContainerFrame()->shown()) {
2167 }
2168 // refresh inspector frame
2169 if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2171 }
2172 }
2173 return 1;
2174}
2175
2176
2177long
2178GNEApplicationWindow::onUpdToggleTimeFormat(FXObject*, FXSelector, void*) {
2179 // check that view exists
2180 if (myViewNet) {
2182 }
2183 return 1;
2184}
2185
2186long
2187GNEApplicationWindow::onUpdRequireViewNet(FXObject* sender, FXSelector, void*) {
2188 // enable or disable sender element depending of viewNet
2189 return sender->handle(this, myViewNet ? FXSEL(SEL_COMMAND, ID_ENABLE) : FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2190}
2191
2192
2193long
2196 return 1;
2197}
2198
2199
2200long
2204
2205
2206long
2207GNEApplicationWindow::onCmdPostprocessingNetgenerate(FXObject* obj, FXSelector, void* ptr) {
2209}
2210
2211
2212long
2213GNEApplicationWindow::onCmdEditViewport(FXObject*, FXSelector, void*) {
2214 // check that view exists
2215 if (myViewNet) {
2217 }
2218 return 1;
2219}
2220
2221
2222long
2223GNEApplicationWindow::onCmdEditViewScheme(FXObject*, FXSelector, void*) {
2224 // check that view exists
2225 if (myViewNet) {
2227 }
2228 return 1;
2229}
2230
2231
2232long
2233GNEApplicationWindow::onCmdToggleGrid(FXObject* sender, FXSelector sel, void* ptr) {
2234 // check that view exists
2235 if (myViewNet) {
2236 // show debug info
2238 // show extra information for tests
2239 WRITE_DEBUG("Disabled grid through Ctrl+g hotkey");
2240 } else {
2241 // show extra information for tests
2242 WRITE_DEBUG("Enabled grid through Ctrl+g hotkey");
2243 }
2244 // Call manually toggle grid function
2245 myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2246 }
2247 return 1;
2248}
2249
2250
2251long
2252GNEApplicationWindow::onCmdToggleDrawJunctionShape(FXObject* sender, FXSelector sel, void* ptr) {
2253 // check that view exists
2254 if (myViewNet) {
2255 // show debug info
2257 // show extra information for tests
2258 WRITE_DEBUG("Disabled draw junction shape through Ctrl+j hotkey");
2259 } else {
2260 // show extra information for tests
2261 WRITE_DEBUG("Enabled draw junction shape through Ctrl+j hotkey");
2262 }
2263 // Call manually toggle junction shape function
2264 myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2265 }
2266 return 1;
2267}
2268
2269
2270long
2271GNEApplicationWindow::onCmdSetFrontElement(FXObject*, FXSelector, void*) {
2272 if (myViewNet) {
2273 if (myViewNet->getViewParent()->getInspectorFrame()->shown()) {
2274 // set or clear front attribute
2277 } else {
2279 }
2281 } else {
2283 }
2284 update();
2285 }
2286 return 1;
2287}
2288
2289
2290long
2291GNEApplicationWindow::onCmdToggleEditOptions(FXObject* sender, FXSelector sel, void* /* ptr */) {
2292 // first check that we have a ViewNet
2293 if (myViewNet) {
2294 // first check what selector was called
2295 int numericalKeyPressed = sel - FXSEL(SEL_COMMAND, MID_HOTKEY_ALT_0_TOGGLEEDITOPTION) - 1;
2296 // check that numericalKeyPressed is valid
2297 if ((numericalKeyPressed < 0) || (numericalKeyPressed > 10)) {
2298 return 1;
2299 }
2300 // declare a vector in which save visible menu commands
2301 std::vector<MFXCheckableButton*> visibleMenuCommands;
2302 // get common, network and demand visible menu commands
2306 // now check that numericalKeyPressed isn't greater than visible view options
2307 if (numericalKeyPressed >= (int)visibleMenuCommands.size()) {
2308 return 1;
2309 }
2310 // toggle edit options
2312 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2313 return 1;
2315 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2316 return 1;
2318 visibleMenuCommands.at(numericalKeyPressed), numericalKeyPressed, sender, sel)) {
2319 return 1;
2320 }
2321 }
2322 return 1;
2323}
2324
2325
2326long
2327GNEApplicationWindow::onCmdHelp(FXObject*, FXSelector, void*) {
2328 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/netedit.html");
2329 return 1;
2330}
2331
2332
2333long
2334GNEApplicationWindow::onCmdChangelog(FXObject*, FXSelector, void*) {
2335 // update in every version
2336 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/ChangeLog.html");
2337 return 1;
2338}
2339
2340
2341long
2342GNEApplicationWindow::onCmdHotkeys(FXObject*, FXSelector, void*) {
2343 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Netedit/shortcuts.html");
2344 return 1;
2345}
2346
2347
2348long
2351 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", true);
2352 } else {
2353 return getApp()->reg().writeBoolEntry("NETEDIT", "RecomputeData", false);
2354 }
2355}
2356
2357
2358long
2359GNEApplicationWindow::onCmdToggleUndoRedo(FXObject*, FXSelector, void*) {
2361 myAllowUndoRedo = true;
2362 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", true);
2363 } else {
2364 myAllowUndoRedo = false;
2365 // drop undo-redo list after changing flag
2366 myUndoList->clear();
2367 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedo", false);
2368 }
2369}
2370
2371
2372long
2376 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", true);
2377 } else {
2378 myAllowUndoRedoLoading = false;
2379 return getApp()->reg().writeBoolEntry("NETEDIT", "AllowUndoRedoLoading", false);
2380 }
2381}
2382
2383
2384long
2385GNEApplicationWindow::onCmdTutorial(FXObject*, FXSelector, void*) {
2386 MFXLinkLabel::fxexecute("https://sumo.dlr.de/docs/Tutorials/index.html");
2387 return 1;
2388}
2389
2390
2391long
2392GNEApplicationWindow::onCmdFeedback(FXObject*, FXSelector, void*) {
2393 // write warning if netedit is running in testing mode
2394 WRITE_DEBUG("Opening feedback dialog");
2395 // create and open feedback dialog
2396 GUIDialog_Feedback* feedback = new GUIDialog_Feedback(this);
2397 feedback->create();
2398 feedback->show(PLACEMENT_OWNER);
2399 // write warning if netedit is running in testing mode
2400 WRITE_DEBUG("Closed feedback dialog");
2401 return 1;
2402}
2403
2404
2405long
2407 auto& neteditOptions = OptionsCont::getOptions();
2408 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::OPTIONS, neteditOptions, myOriginalNeteditOptions, TL("Netedit options"));
2409 if (dialog.first == TRUE) {
2410 NIFrame::checkOptions(neteditOptions); // needed to set projection parameters
2411 NBFrame::checkOptions(neteditOptions);
2412 NWFrame::checkOptions(neteditOptions);
2413 SystemFrame::checkOptions(neteditOptions); // needed to set precision
2414 // check if mar netedit config as unsaved
2415 if (dialog.second && myNet) {
2417 }
2418 }
2419 return 1;
2420}
2421
2422
2423long
2425 const auto dialog = GNEOptionsDialog::Options(this, GUIIcon::SUMO_MINI, mySumoOptions, myOriginalSumoOptions, TL("Sumo options"));
2426 // check if mark sumoConfig as unsaved
2427 if ((dialog.first == TRUE) && dialog.second && myNet) {
2429 }
2430 return 1;
2431}
2432
2433
2434long
2438
2439
2440long
2444
2445
2446long
2447GNEApplicationWindow::onCmdUndo(FXObject*, FXSelector, void*) {
2448 WRITE_DEBUG("Keys Ctrl+Z (Undo) pressed");
2449 // Check conditions
2450 if (myViewNet == nullptr) {
2451 return 0;
2452 } else if (!myEditMenuCommands.undoLastChange->isEnabled()) {
2453 return 0;
2454 } else {
2455 // check supermode (currently ignore supermode data)
2458 // abort if user doesn't press "yes"
2460 return 0;
2461 }
2462 }
2464 // update current show frame after undo
2467 }
2468 // update manually undo/redo menu commands (see #6005)
2471 // update toolbar undo-redo buttons
2473 return 1;
2474 }
2475}
2476
2477
2478long
2479GNEApplicationWindow::onCmdRedo(FXObject*, FXSelector, void*) {
2480 WRITE_DEBUG("Keys Ctrl+Y (Redo) pressed");
2481 // Check conditions
2482 if (myViewNet == nullptr) {
2483 return 0;
2484 } else if (!myEditMenuCommands.redoLastChange->isEnabled()) {
2485 return 0;
2486 } else {
2487 // check supermode (currently ignore supermode data)
2490 // abort if user doesn't press "yes"
2492 return 0;
2493 }
2494 }
2496 // update current show frame after redo
2499 }
2500 // update manually undo/redo menu commands (see #6005)
2503 // update toolbar undo-redo buttons
2505 return 1;
2506 }
2507}
2508
2509
2510long
2512 // avoid open two dialogs
2513 if (myUndoListDialog->shown()) {
2515 } else {
2517 }
2518 return 1;
2519}
2520
2521
2522long
2523GNEApplicationWindow::onUpdOpenUndoListDialog(FXObject* sender, FXSelector, void*) {
2524 // check if net exist and there is something to undo/redo
2525 if (myNet && (myEditMenuCommands.undoLastChange->isEnabled() || myEditMenuCommands.redoLastChange->isEnabled())) {
2526 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2527 } else {
2528 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2529 if (myUndoListDialog->shown()) {
2531 }
2532 }
2533 return 1;
2534}
2535
2536
2537long
2539 // first check viewNet
2541 // update demand path calculator
2543 }
2544 return 1;
2545}
2546
2547
2548long
2549GNEApplicationWindow::onCmdCut(FXObject*, FXSelector, void*) {
2550 WRITE_DEBUG("Key Ctrl+X (Cut) pressed");
2551 // Prepared for #6042
2552 return 1;
2553}
2554
2555
2556long
2557GNEApplicationWindow::onCmdCopy(FXObject*, FXSelector, void*) {
2558 WRITE_DEBUG("Key Ctrl+C (Copy) pressed");
2559 // Prepared for #6042
2560 return 1;
2561}
2562
2563
2564long
2565GNEApplicationWindow::onCmdPaste(FXObject*, FXSelector, void*) {
2566 WRITE_DEBUG("Key Ctrl+V (Paste) pressed");
2567 // Prepared for #6042
2568 return 1;
2569}
2570
2571
2572long
2573GNEApplicationWindow::onCmdSetTemplate(FXObject*, FXSelector, void*) {
2574 WRITE_DEBUG("Key Ctrl+F1 (Set Template) pressed");
2575 // first check if myViewNet exist
2576 if (myViewNet) {
2577 // call set template in inspector frame
2579 }
2580 return 1;
2581}
2582
2583
2584long
2585GNEApplicationWindow::onCmdCopyTemplate(FXObject*, FXSelector, void*) {
2586 WRITE_DEBUG("Key Ctrl+F2 (Copy Template) pressed");
2587 // first check if myViewNet exist
2588 if (myViewNet) {
2589 // call copy template in inspector frame
2591 }
2592 return 1;
2593}
2594
2595
2596long
2597GNEApplicationWindow::onCmdClearTemplate(FXObject*, FXSelector, void*) {
2598 WRITE_DEBUG("Key Ctrl+F3 (Clear Template) pressed");
2599 // first check if myViewNet exist
2600 if (myViewNet) {
2601 // call clear template in inspector frame
2603 }
2604 return 1;
2605}
2606
2607
2608long
2609GNEApplicationWindow::onUpdNeedsNetwork(FXObject* sender, FXSelector, void*) {
2610 // check if net exist
2611 if (myNet) {
2613 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2614 } else {
2616 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2617 }
2618}
2619
2620
2621long
2622GNEApplicationWindow::onUpdNeedsNetworkElement(FXObject* sender, FXSelector, void*) {
2623 // check if at least there is one edge in the network
2624 if (myNet && (myNet->getAttributeCarriers()->getEdges().size() > 0)) {
2625 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2626 } else {
2627 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2628 }
2629}
2630
2631
2632long
2633GNEApplicationWindow::onUpdNeedsFrontElement(FXObject* sender, FXSelector, void*) {
2634 // check if net, viewnet and front attribute exist
2636 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2637 } else {
2638 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2639 }
2640}
2641
2642
2643long
2644GNEApplicationWindow::onUpdSaveNetwork(FXObject* sender, FXSelector, void*) {
2645 if (myNet == nullptr) {
2646 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2647 } else if (myNet->getSavingStatus()->isNetworkSaved()) {
2648 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2649 } else {
2650 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2651 }
2652}
2653
2654
2655long
2656GNEApplicationWindow::onUpdSaveAdditionals(FXObject* sender, FXSelector, void*) {
2657 if (myNet == nullptr) {
2658 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2660 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2661 } else {
2662 return sender->handle(this, myNet->getSavingStatus()->isAdditionalsSaved() ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2663 }
2664}
2665
2666
2667long
2668GNEApplicationWindow::onUpdSaveAdditionalsAs(FXObject* sender, FXSelector, void*) {
2669 if (myNet == nullptr) {
2670 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2671 } else if (myNet->getAttributeCarriers()->getNumberOfAdditionals() == 0) {
2672 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2673 } else {
2674 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2675 }
2676}
2677
2678
2679long
2680GNEApplicationWindow::onUpdSaveJuPedSimElementsAs(FXObject* sender, FXSelector, void*) {
2681 if (myNet == nullptr) {
2682 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2683 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_WALKABLEAREA).size() > 0) {
2684 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2685 } else if (myNet->getAttributeCarriers()->getAdditionals().at(GNE_TAG_JPS_OBSTACLE).size() > 0) {
2686 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2687 } else {
2688 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2689 }
2690}
2691
2692
2693long
2694GNEApplicationWindow::onUpdSaveDemandElements(FXObject* sender, FXSelector, void*) {
2695 if (myNet == nullptr) {
2696 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2697 } else if (myNet->getSavingStatus()->isDemandElementsSaved()) {
2698 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2699 } else {
2700 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2701 }
2702
2703}
2704
2705
2706long
2707GNEApplicationWindow::onUpdSaveDemandElementsAs(FXObject* sender, FXSelector, void*) {
2708 if (myNet == nullptr) {
2709 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2711 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2712 } else {
2713 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2714 }
2715}
2716
2717
2718long
2719GNEApplicationWindow::onUpdSaveDataElements(FXObject* sender, FXSelector, void*) {
2720 if (myNet == nullptr) {
2721 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2722 } else if (myNet->getSavingStatus()->isDataElementsSaved()) {
2723 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2724 } else {
2725 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2726 }
2727
2728}
2729
2730
2731long
2732GNEApplicationWindow::onUpdSaveDataElementsAs(FXObject* sender, FXSelector, void*) {
2733 if (myNet == nullptr) {
2734 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2735 } else if (myNet->getAttributeCarriers()->getDataSets().size() == 0) {
2736 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2737 } else {
2738 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2739 }
2740
2741}
2742
2743
2744long
2745GNEApplicationWindow::onUpdSaveMeanDatas(FXObject* sender, FXSelector, void*) {
2746 if (myNet == nullptr) {
2747 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2748 } else if (myNet->getSavingStatus()->isMeanDatasSaved()) {
2749 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2750 } else {
2751 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2752 }
2753}
2754
2755
2756long
2757GNEApplicationWindow::onUpdSaveMeanDatasAs(FXObject* sender, FXSelector, void*) {
2758 if (myNet == nullptr) {
2759 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2760 } else if (myNet->getAttributeCarriers()->getNumberOfMeanDatas() == 0) {
2761 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2762 } else {
2763 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2764 }
2765
2766}
2767
2768
2769long
2770GNEApplicationWindow::onUpdUndo(FXObject* sender, FXSelector sel, void* ptr) {
2771 return myUndoList->onUpdUndo(sender, sel, ptr);
2772}
2773
2774
2775long
2776GNEApplicationWindow::onUpdRedo(FXObject* sender, FXSelector sel, void* ptr) {
2777 return myUndoList->onUpdRedo(sender, sel, ptr);
2778}
2779
2780
2781long
2782GNEApplicationWindow::onUpdComputePathManager(FXObject* sender, FXSelector /*sel*/, void* /*ptr*/) {
2783 // first check viewNet
2784 if (myViewNet) {
2785 // check supermode network
2787 // disable
2788 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2790 // disable
2791 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2792 } else {
2793 // enable
2794 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
2795 }
2796 } else {
2797 // disable
2798 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
2799 }
2800}
2801
2802
2803long
2804GNEApplicationWindow::onCmdToggleViewOption(FXObject* sender, FXSelector sel, void* ptr) {
2805 // check viewNet
2806 if (myViewNet) {
2807 // continue depending of selector
2808 switch (FXSELID(sel)) {
2809 // Network
2811 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2813 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2815 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2817 return myViewNet->onCmdToggleShowDemandElementsNetwork(sender, sel, ptr);
2819 return myViewNet->onCmdToggleSelectEdges(sender, sel, ptr);
2821 return myViewNet->onCmdToggleShowConnections(sender, sel, ptr);
2823 return myViewNet->onCmdToggleHideConnections(sender, sel, ptr);
2825 return myViewNet->onCmdToggleShowAdditionalSubElements(sender, sel, ptr);
2827 return myViewNet->onCmdToggleShowTAZElements(sender, sel, ptr);
2829 return myViewNet->onCmdToggleExtendSelection(sender, sel, ptr);
2831 return myViewNet->onCmdToggleChangeAllPhases(sender, sel, ptr);
2833 return myViewNet->onCmdToggleWarnAboutMerge(sender, sel, ptr);
2835 return myViewNet->onCmdToggleShowJunctionBubbles(sender, sel, ptr);
2837 return myViewNet->onCmdToggleMoveElevation(sender, sel, ptr);
2839 return myViewNet->onCmdToggleChainEdges(sender, sel, ptr);
2841 return myViewNet->onCmdToggleAutoOppositeEdge(sender, sel, ptr);
2842 // Demand
2844 return myViewNet->onCmdToggleShowGrid(sender, sel, ptr);
2846 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2848 return myViewNet->onCmdToggleDrawSpreadVehicles(sender, sel, ptr);
2850 return myViewNet->onCmdToggleHideNonInspecteDemandElements(sender, sel, ptr);
2852 return myViewNet->onCmdToggleHideShapes(sender, sel, ptr);
2854 return myViewNet->onCmdToggleShowTrips(sender, sel, ptr);
2856 return myViewNet->onCmdToggleShowAllPersonPlans(sender, sel, ptr);
2858 return myViewNet->onCmdToggleLockPerson(sender, sel, ptr);
2860 return myViewNet->onCmdToggleShowAllContainerPlans(sender, sel, ptr);
2862 return myViewNet->onCmdToggleLockContainer(sender, sel, ptr);
2864 return myViewNet->onCmdToggleShowOverlappedRoutes(sender, sel, ptr);
2865 // Data
2867 return myViewNet->onCmdToggleDrawJunctionShape(sender, sel, ptr);
2869 return myViewNet->onCmdToggleShowAdditionals(sender, sel, ptr);
2871 return myViewNet->onCmdToggleShowShapes(sender, sel, ptr);
2873 return myViewNet->onCmdToggleShowDemandElementsData(sender, sel, ptr);
2875 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2877 return myViewNet->onCmdToggleTAZRelDrawing(sender, sel, ptr);
2879 return myViewNet->onCmdToggleTAZRelOnlyFrom(sender, sel, ptr);
2881 return myViewNet->onCmdToggleTAZRelOnlyTo(sender, sel, ptr);
2882 default:
2883 return 0;
2884 }
2885 } else {
2886 return 0;
2887 }
2888}
2889
2890
2891long
2892GNEApplicationWindow::onUpdToggleViewOption(FXObject* sender, FXSelector sel, void* /*ptr*/) {
2893 // get menuCheck
2894 MFXMenuCheckIcon* menuCheck = dynamic_cast<MFXMenuCheckIcon*>(sender);
2895 // check viewNet
2896 if (myViewNet && menuCheck) {
2897 // continue depending of selector
2898 switch (FXSELID(sel)) {
2899 // Network
2902 menuCheck->setCheck(TRUE);
2903 } else {
2904 menuCheck->setCheck(FALSE);
2905 }
2906 break;
2909 menuCheck->setCheck(TRUE);
2910 } else {
2911 menuCheck->setCheck(FALSE);
2912 }
2913 break;
2916 menuCheck->setCheck(TRUE);
2917 } else {
2918 menuCheck->setCheck(FALSE);
2919 }
2920 break;
2923 menuCheck->setCheck(TRUE);
2924 } else {
2925 menuCheck->setCheck(FALSE);
2926 }
2927 break;
2930 menuCheck->setCheck(TRUE);
2931 } else {
2932 menuCheck->setCheck(FALSE);
2933 }
2934 break;
2937 menuCheck->setCheck(TRUE);
2938 } else {
2939 menuCheck->setCheck(FALSE);
2940 }
2941 break;
2944 menuCheck->setCheck(TRUE);
2945 } else {
2946 menuCheck->setCheck(FALSE);
2947 }
2948 break;
2951 menuCheck->setCheck(TRUE);
2952 } else {
2953 menuCheck->setCheck(FALSE);
2954 }
2955 break;
2958 menuCheck->setCheck(TRUE);
2959 } else {
2960 menuCheck->setCheck(FALSE);
2961 }
2962 break;
2965 menuCheck->setCheck(TRUE);
2966 } else {
2967 menuCheck->setCheck(FALSE);
2968 }
2969 break;
2972 menuCheck->setCheck(TRUE);
2973 } else {
2974 menuCheck->setCheck(FALSE);
2975 }
2976 break;
2979 menuCheck->setCheck(TRUE);
2980 } else {
2981 menuCheck->setCheck(FALSE);
2982 }
2983 break;
2986 menuCheck->setCheck(TRUE);
2987 } else {
2988 menuCheck->setCheck(FALSE);
2989 }
2990 break;
2993 menuCheck->setCheck(TRUE);
2994 } else {
2995 menuCheck->setCheck(FALSE);
2996 }
2997 break;
3000 menuCheck->setCheck(TRUE);
3001 } else {
3002 menuCheck->setCheck(FALSE);
3003 }
3004 break;
3007 menuCheck->setCheck(TRUE);
3008 } else {
3009 menuCheck->setCheck(FALSE);
3010 }
3011 break;
3012 // Demand
3015 menuCheck->setCheck(TRUE);
3016 } else {
3017 menuCheck->setCheck(FALSE);
3018 }
3019 break;
3022 menuCheck->setCheck(TRUE);
3023 } else {
3024 menuCheck->setCheck(FALSE);
3025 }
3026 break;
3029 menuCheck->setCheck(TRUE);
3030 } else {
3031 menuCheck->setCheck(FALSE);
3032 }
3033 break;
3036 menuCheck->setCheck(TRUE);
3037 } else {
3038 menuCheck->setCheck(FALSE);
3039 }
3040 break;
3043 menuCheck->setCheck(TRUE);
3044 } else {
3045 menuCheck->setCheck(FALSE);
3046 }
3047 break;
3050 menuCheck->setCheck(TRUE);
3051 } else {
3052 menuCheck->setCheck(FALSE);
3053 }
3054 break;
3057 menuCheck->setCheck(TRUE);
3058 } else {
3059 menuCheck->setCheck(FALSE);
3060 }
3061 // special case for lock persons
3063 menuCheck->enable();
3064 } else {
3065 menuCheck->disable();
3066 }
3067 break;
3070 menuCheck->setCheck(TRUE);
3071 } else {
3072 menuCheck->setCheck(FALSE);
3073 }
3074 break;
3077 menuCheck->setCheck(TRUE);
3078 } else {
3079 menuCheck->setCheck(FALSE);
3080 }
3081 // special case for lock containers
3083 menuCheck->enable();
3084 } else {
3085 menuCheck->disable();
3086 }
3087 break;
3090 menuCheck->setCheck(TRUE);
3091 } else {
3092 menuCheck->setCheck(FALSE);
3093 }
3094 break;
3097 menuCheck->setCheck(TRUE);
3098 } else {
3099 menuCheck->setCheck(FALSE);
3100 }
3101 break;
3102 // Data
3105 menuCheck->setCheck(TRUE);
3106 } else {
3107 menuCheck->setCheck(FALSE);
3108 }
3109 break;
3112 menuCheck->setCheck(TRUE);
3113 } else {
3114 menuCheck->setCheck(FALSE);
3115 }
3116 break;
3119 menuCheck->setCheck(TRUE);
3120 } else {
3121 menuCheck->setCheck(FALSE);
3122 }
3123 break;
3126 menuCheck->setCheck(TRUE);
3127 } else {
3128 menuCheck->setCheck(FALSE);
3129 }
3130 break;
3133 menuCheck->setCheck(TRUE);
3134 } else {
3135 menuCheck->setCheck(FALSE);
3136 }
3137 break;
3140 menuCheck->setCheck(TRUE);
3141 } else {
3142 menuCheck->setCheck(FALSE);
3143 }
3144 break;
3145
3148 menuCheck->setCheck(TRUE);
3149 } else {
3150 menuCheck->setCheck(FALSE);
3151 }
3152 break;
3155 menuCheck->setCheck(TRUE);
3156 } else {
3157 menuCheck->setCheck(FALSE);
3158 }
3159 break;
3160 default:
3161 break;
3162 }
3163 }
3164 return 0;
3165}
3166
3167
3168long
3169GNEApplicationWindow::onCmdSaveNetwork(FXObject* sender, FXSelector sel, void* ptr) {
3170 auto& neteditOptions = OptionsCont::getOptions();
3171 // first check if we have to set the output filename
3172 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("net-file").empty()) {
3173 neteditOptions.set("net-file", *(static_cast<std::string*>(ptr)) + ".net.xml");
3174 }
3175 // function onCmdSaveNetworkAs must be executed if this is the first save
3176 if (neteditOptions.getString("net-file").empty()) {
3177 return onCmdSaveNetworkAs(sender, sel, ptr);
3178 } else {
3179 // always recompute before saving
3180 myNet->computeNetwork(this);
3181 // se net file in SUMO options
3183 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
3184 // begin save network
3185 getApp()->beginWaitCursor();
3186 bool saved = false;
3187 try {
3188 // obtain invalid networkElements (currently only edges or crossings
3189 std::vector<GNENetworkElement*> invalidNetworkElements;
3190 // iterate over crossings and edges
3191 for (const auto& edge : myViewNet->getNet()->getAttributeCarriers()->getEdges()) {
3192 if (!edge.second->isNetworkElementValid()) {
3193 invalidNetworkElements.push_back(edge.second);
3194 }
3195 }
3196 for (const auto& crossing : myViewNet->getNet()->getAttributeCarriers()->getCrossings()) {
3197 if (!crossing.second->isNetworkElementValid()) {
3198 invalidNetworkElements.push_back(crossing.second);
3199 }
3200 }
3201 // if there are invalid network elements, open GNEFixNetworkElements
3202 if (invalidNetworkElements.size() > 0) {
3203 // 0 -> Canceled Saving, with or without selecting invalid network elements
3204 // 1 -> Invalid network elements fixed, friendlyPos enabled, or saved with invalid positions
3205 GNEFixNetworkElements fixNetworkElementsDialog(myViewNet, invalidNetworkElements);
3206 if (fixNetworkElementsDialog.execute() == 0) {
3207 // show debug information
3208 WRITE_DEBUG("network elements saving aborted");
3209 // stop
3210 return 1;
3211 } else {
3212 // Save network
3213 myNet->saveNetwork();
3214 saved = true;
3215 // show debug information
3216 WRITE_DEBUG("network elements saved after dialog");
3217 }
3218 } else {
3219 // Save network
3220 myNet->saveNetwork();
3221 saved = true;
3222 // show debug information
3223 WRITE_DEBUG("network elements saved");
3224 }
3225 } catch (IOError& e) {
3226 // write warning if netedit is running in testing mode
3227 WRITE_DEBUG("Opening FXMessageBox 'error saving network'");
3228 // open error message box
3229 FXMessageBox::error(this, MBOX_OK, TL("Saving Network failed!"), "%s", e.what());
3230 // write warning if netedit is running in testing mode
3231 WRITE_DEBUG("Closed FXMessageBox 'error saving network' with 'OK'");
3232 }
3233 if (saved) {
3234 // write info
3235 WRITE_MESSAGE(TL("Network saved in '") + neteditOptions.getString("net-file") + "'.");
3236 // After saving a net successfully, add it into Recent Nets list.
3237 myMenuBarFile.myRecentNetworks.appendFile(neteditOptions.getString("net-file").c_str());
3239 } else {
3241 WRITE_ERROR(TL("Could not save network in '") + neteditOptions.getString("net-file") + "'");
3242 }
3243 // end save network
3244 getApp()->endWaitCursor();
3245 // set focus again in net
3246 myViewNet->setFocus();
3247 return 1;
3248 }
3249}
3250
3251
3252long
3253GNEApplicationWindow::onCmdSaveNetworkAs(FXObject*, FXSelector, void*) {
3254 // get network file file
3255 const auto networkFile = GNEApplicationWindowHelper::openNetworkFileDialog(this, true);
3256 if (!networkFile.empty()) {
3257 // set ouput file in netedit configs
3258 auto& neteditOptions = OptionsCont::getOptions();
3259 neteditOptions.resetWritable();
3260 neteditOptions.set("net-file", networkFile);
3261 // update netedit title with the network name
3262 setTitle(MFXUtils::getTitleText(myTitlePrefix, networkFile.c_str()));
3263 // save network
3264 onCmdSaveNetwork(nullptr, 0, nullptr);
3265 }
3266 return 1;
3267}
3268
3269
3270long
3271GNEApplicationWindow::onCmdSavePlainXMLAs(FXObject*, FXSelector, void*) {
3272 // get neteditConfig filename
3274 // Remove extension
3275 if (!plainXMLFile.empty()) {
3276 // adjust file
3277 if (plainXMLFile.back() == '.') {
3278 plainXMLFile.pop_back();
3279 } else {
3280 plainXMLFile = StringUtils::replace(plainXMLFile, ".edg.xml", "");
3281 plainXMLFile = StringUtils::replace(plainXMLFile, ".nod.xml", "");
3282 plainXMLFile = StringUtils::replace(plainXMLFile, ".con.xml", "");
3283 plainXMLFile = StringUtils::replace(plainXMLFile, ".typ.xml", "");
3284 plainXMLFile = StringUtils::replace(plainXMLFile, ".tll.xml", "");
3285 plainXMLFile = StringUtils::replace(plainXMLFile, ".xml", "");
3286 }
3287 }
3288 // continue depending of file
3289 if (!plainXMLFile.empty()) {
3290 // start saving plain XML
3291 getApp()->beginWaitCursor();
3292 try {
3293 myNet->savePlain(plainXMLFile);
3294 // write info
3295 WRITE_MESSAGE(TL("Plain XML saved with prefix '") + plainXMLFile + "'");
3296 } catch (IOError& e) {
3297 // write warning if netedit is running in testing mode
3298 WRITE_DEBUG("Opening FXMessageBox 'Error saving plainXML'");
3299 // open message box
3300 FXMessageBox::error(this, MBOX_OK, TL("Saving plain xml failed!"), "%s", e.what());
3301 // write warning if netedit is running in testing mode
3302 WRITE_DEBUG("Closed FXMessageBox 'Error saving plainXML' with 'OK'");
3303 }
3304 // end saving plain XML
3305 getApp()->endWaitCursor();
3306
3307 // restore focus
3308 setFocus();
3309 }
3310 return 1;
3311}
3312
3313
3314long
3316 // get neteditConfig filename
3317 const auto joinedJunctionsFile = GNEApplicationWindowHelper::saveJoinedJunctionsFileDialog(this);
3318 // continue depending of file
3319 if (joinedJunctionsFile.size() > 0) {
3320 getApp()->beginWaitCursor();
3321 try {
3322 myNet->saveJoined(joinedJunctionsFile);
3323 // write info
3324 WRITE_MESSAGE(TL("Joined junctions saved to '") + joinedJunctionsFile + "'");
3325 } catch (IOError& e) {
3326 // write warning if netedit is running in testing mode
3327 WRITE_DEBUG("Opening FXMessageBox 'error saving joined'");
3328 // opening error message
3329 FXMessageBox::error(this, MBOX_OK, TL("Saving joined junctions failed!"), "%s", e.what());
3330 // write warning if netedit is running in testing mode
3331 WRITE_DEBUG("Closed FXMessageBox 'error saving joined' with 'OK'");
3332 }
3333 getApp()->endWaitCursor();
3334
3335 // restore focus
3336 setFocus();
3337 }
3338 return 1;
3339}
3340
3341
3342long
3344 // obtain netedit option container
3345 auto& neteditOptions = OptionsCont::getOptions();
3346 neteditOptions.resetWritable();
3347 // Check if configuration file was already set at start of netedit or with a previous save
3348 if (neteditOptions.getString("configuration-file").empty()) {
3349 return onCmdSaveNeteditConfigAs(nullptr, 0, nullptr);
3350 } else {
3351 // get config file
3352 const auto neteditConfigFile = neteditOptions.getString("configuration-file");
3353 // get file path
3354 const auto filePath = FileHelpers::getFilePath(neteditConfigFile);
3355 // get patter file
3356 auto patterFile = StringUtils::replace(neteditConfigFile, ".netecfg", "");
3357 // save all elements giving automatic names based on patter if their file isn't defined
3358 onCmdSaveNetwork(nullptr, MID_GNE_FORCESAVE, &patterFile);
3359 onCmdSaveAdditionals(nullptr, MID_GNE_FORCESAVE, &patterFile);
3360 onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3361 onCmdSaveDataElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3362 onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, &patterFile);
3363 // configuration
3364 std::ofstream out(StringUtils::transcodeToLocal(neteditConfigFile));
3365 if (out.good()) {
3366 // write netedit config
3367 neteditOptions.writeConfiguration(out, true, false, false, filePath, true);
3368 // write info
3369 WRITE_MESSAGE(TL("Netedit configuration saved in '") + neteditConfigFile + "'");
3370 // config saved
3372 // After saving a config successfully, add it into recent configs
3373 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("configuration-file").c_str());
3374 } else {
3375 WRITE_ERROR(TL("Could not save netedit configuration in '") + neteditConfigFile + "'");
3376 }
3377 out.close();
3378 return 1;
3379 }
3380}
3381
3382
3383long
3384GNEApplicationWindow::onCmdSaveNeteditConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3385 auto& neteditOptions = OptionsCont::getOptions();
3386 // get neteditConfig filename
3387 const auto neteditConfigFile = GNEApplicationWindowHelper::openNeteditConfigFileDialog(this, true);
3388 // continue depending of file
3389 if (!neteditConfigFile.empty()) {
3390 neteditOptions.resetWritable();
3391 neteditOptions.set("configuration-file", neteditConfigFile);
3392 // continue saving netedit config
3393 return onCmdSaveNeteditConfig(sender, sel, ptr);
3394 } else {
3395 return 0;
3396 }
3397}
3398
3399
3400long
3401GNEApplicationWindow::onUpdSaveNeteditConfig(FXObject* sender, FXSelector, void*) {
3402 // check if enable or disable save netedit config button
3403 if (myNet == nullptr) {
3404 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3405 } else if (OptionsCont::getOptions().getString("configuration-file").empty()) {
3406 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3407 } else if (!myNet->getSavingStatus()->isNeteditConfigSaved()) {
3408 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3409 } else {
3410 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3411 }
3412 // check if enable/disable save individual files
3413 if (myNet) {
3417 } else {
3419 }
3420 }
3421 return 1;
3422}
3423
3424
3425long
3426GNEApplicationWindow::onCmdSaveSumoConfig(FXObject* sender, FXSelector sel, void* ptr) {
3427 // obtain netedit option container
3428 auto& neteditOptions = OptionsCont::getOptions();
3429 // reset containers
3430 neteditOptions.resetWritable();
3432 // Check if configuration file was already set at start of netedit or with a previous save
3433 if (neteditOptions.getString("sumocfg-file").empty()) {
3434 return onCmdSaveSumoConfigAs(sender, sel, ptr);
3435 } else {
3436 // check if ignore additionals and demand elements (only used open SUMO-GUI from netedit)
3437 const FXSelector openSUMO = FXSEL(SEL_COMMAND, MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO);
3438 const bool ignoreAdditionals = (sel == openSUMO) ? (myEditMenuCommands.loadAdditionalsInSUMOGUI->getCheck() == FALSE) : false;
3439 const bool ignoreDemandElements = (sel == openSUMO) ? (myEditMenuCommands.loadDemandInSUMOGUI->getCheck() == FALSE) : false;
3440 // get SumoConfig file
3441 const auto sumoConfigFile = neteditOptions.getString("sumocfg-file");
3442 // get config file without extension
3443 auto patterFile = StringUtils::replace(sumoConfigFile, ".sumocfg", "");
3444 // save all elements giving automatic names based on patter in their file isn't defined
3445 onCmdSaveNetwork(nullptr, MID_GNE_FORCESAVE, &patterFile);
3446 onCmdSaveAdditionals(nullptr, MID_GNE_FORCESAVE, &patterFile);
3447 onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, &patterFile);
3448 onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, &patterFile);
3449 // set input in sumo options
3450 setInputInSumoOptions(ignoreAdditionals, ignoreDemandElements);
3451 // if we have trips or flow over junctions, add option junction-taz
3454 mySumoOptions.set("junction-taz", "true");
3455 }
3456 std::ofstream out(StringUtils::transcodeToLocal(sumoConfigFile));
3457 if (out.good()) {
3458 // write SUMO config
3459 mySumoOptions.writeConfiguration(out, true, false, false, sumoConfigFile, true);
3460 // write info
3461 WRITE_MESSAGE(TL("SUMO configuration saved in '") + sumoConfigFile + "'");
3462 // if ignoreAdditionals or ignoreDemandElements is enabled, don't mark SumoConfig as saved
3463 if (!ignoreAdditionals && !ignoreDemandElements) {
3465 }
3466 // After saving a config successfully, add it into recent configs
3467 myMenuBarFile.myRecentConfigs.appendFile(neteditOptions.getString("sumocfg-file").c_str());
3468 } else {
3469 WRITE_MESSAGE(TL("Could not save SUMO configuration in '") + sumoConfigFile + "'");
3470 }
3471 out.close();
3472 return 1;
3473 }
3474}
3475
3476
3477long
3478GNEApplicationWindow::onCmdSaveSumoConfigAs(FXObject* sender, FXSelector sel, void* ptr) {
3479 auto& neteditOptions = OptionsCont::getOptions();
3480 // get sumoConfig filename
3481 const auto sumoConfigFile = GNEApplicationWindowHelper::openSumoConfigFileDialog(this, true);
3482 // continue depending of file
3483 if (!sumoConfigFile.empty()) {
3484 // save file in netedit options
3485 neteditOptions.resetWritable();
3486 neteditOptions.set("sumocfg-file", sumoConfigFile);
3487 // continue saving SUMO Config
3488 return onCmdSaveSumoConfig(sender, sel, ptr);
3489 } else {
3490 return 0;
3491 }
3492}
3493
3494
3495long
3496GNEApplicationWindow::onUpdSaveSumoConfig(FXObject* sender, FXSelector, void*) {
3497 if (myNet == nullptr) {
3498 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3499 } else if (OptionsCont::getOptions().getString("sumocfg-file").empty()) {
3500 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3501 } else if (!myNet->getSavingStatus()->isSumoConfigSaved()) {
3502 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3503 } else {
3504 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3505 }
3506}
3507
3508
3509long
3510GNEApplicationWindow::onCmdSaveTLSPrograms(FXObject* obj, FXSelector sel, void* ptr) {
3511 // get option container
3512 auto& neteditOptions = OptionsCont::getOptions();
3513 // Check if TLS Programs file was already set at start of netedit or with a previous save
3514 if (neteditOptions.getString("tls-file").empty()) {
3515 return onCmdSaveTLSProgramsAs(obj, sel, ptr);
3516 } else {
3517 // Start saving TLS Programs
3518 getApp()->beginWaitCursor();
3519 try {
3520 myNet->computeNetwork(this, true); // GNEChange_TLS does not triggere GNENet:requireRecompute
3521 myNet->saveTLSPrograms(neteditOptions.getString("tls-file"));
3522 // write info
3523 WRITE_MESSAGE(TL("TLS Programs saved in '") + neteditOptions.getString("tls-file") + "'");
3524 } catch (IOError& e) {
3525 // write warning if netedit is running in testing mode
3526 WRITE_DEBUG("Opening FXMessageBox 'error saving TLS Programs'");
3527 // open error message box
3528 FXMessageBox::error(this, MBOX_OK, TL("Saving TLS Programs failed!"), "%s", e.what());
3529 // write warning if netedit is running in testing mode
3530 WRITE_DEBUG("Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
3531 }
3533 getApp()->endWaitCursor();
3534 // restore focus
3535 setFocus();
3536 }
3537 return 1;
3538}
3539
3540
3541long
3542GNEApplicationWindow::onUpdSaveTLSPrograms(FXObject* sender, FXSelector, void*) {
3543 if (myNet == nullptr) {
3544 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3545 } else {
3546 // check if there is at least one TLS
3547 for (const auto& junction : myNet->getAttributeCarriers()->getJunctions()) {
3548 if (junction.second->getNBNode()->getControllingTLS().size() > 0) {
3549 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3550 }
3551 }
3552 // no TLS, then disable
3553 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3554 }
3555}
3556
3557
3558long
3559GNEApplicationWindow::onCmdSaveEdgeTypes(FXObject* obj, FXSelector sel, void* ptr) {
3560 // get option container
3561 auto& neteditOptions = OptionsCont::getOptions();
3562 // Check if edgeType file was already set at start of netedit or with a previous save
3563 if (neteditOptions.getString("edgetypes-file").empty()) {
3564 return onCmdSaveEdgeTypesAs(obj, sel, ptr);
3565 } else {
3566 // Start saving edgeTypes
3567 getApp()->beginWaitCursor();
3568 try {
3569 myNet->saveEdgeTypes(neteditOptions.getString("edgetypes-file"));
3570 // write info
3571 WRITE_MESSAGE(TL("EdgeType saved in '") + neteditOptions.getString("edgetypes-file") + "'");
3572 } catch (IOError& e) {
3573 // write warning if netedit is running in testing mode
3574 WRITE_DEBUG("Opening FXMessageBox 'error saving edgeTypes'");
3575 // open error message box
3576 FXMessageBox::error(this, MBOX_OK, TL("Saving edgeTypes failed!"), "%s", e.what());
3577 // write warning if netedit is running in testing mode
3578 WRITE_DEBUG("Closed FXMessageBox 'error saving edgeTypes' with 'OK'");
3579 }
3581 getApp()->endWaitCursor();
3582 // restore focus
3583 setFocus();
3584 }
3585 return 1;
3586}
3587
3588
3589long
3590GNEApplicationWindow::onUpdSaveEdgeTypes(FXObject* sender, FXSelector, void*) {
3591 // check if net exist and there are edge types
3592 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3593 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3594 } else {
3595 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3596 }
3597 return 1;
3598}
3599
3600
3601long
3603 // get option container
3604 auto& neteditOptions = OptionsCont::getOptions();
3605 // get TLS file
3606 const auto TLSFile = GNEApplicationWindowHelper::openTLSFileDialog(this, true);
3607 // check tat file is valid
3608 if (!TLSFile.empty()) {
3609 // change value of "tls-file"
3610 neteditOptions.resetWritable();
3611 neteditOptions.set("tls-file", TLSFile);
3612 // save TLS Programs
3613 return onCmdSaveTLSPrograms(nullptr, 0, nullptr);
3614 } else {
3615 return 1;
3616 }
3617}
3618
3619
3620long
3621GNEApplicationWindow::onCmdSaveEdgeTypesAs(FXObject*, FXSelector, void*) {
3622 // get option container
3623 auto& neteditOptions = OptionsCont::getOptions();
3624 // get network file file
3625 const auto edgeTypesFile = GNEApplicationWindowHelper::openEdgeTypeFileDialog(this, true);
3626 // check tat file is valid
3627 if (!edgeTypesFile.empty()) {
3628 // change value of "edgetypes-file"
3629 neteditOptions.resetWritable();
3630 neteditOptions.set("edgetypes-file", edgeTypesFile);
3631 // save edgeTypes
3632 return onCmdSaveEdgeTypes(nullptr, 0, nullptr);
3633 } else {
3634 return 1;
3635 }
3636}
3637
3638
3639long
3640GNEApplicationWindow::onUpdSaveEdgeTypesAs(FXObject* sender, FXSelector, void*) {
3641 // check if net exist and there are edge types
3642 if (myNet && (myNet->getAttributeCarriers()->getEdgeTypes().size() > 0)) {
3643 sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3644 } else {
3645 sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3646 }
3647 return 1;
3648}
3649
3650
3651long
3652GNEApplicationWindow::onCmdOpenAdditionals(FXObject*, FXSelector, void*) {
3653 auto& neteditOptions = OptionsCont::getOptions();
3654 // get file
3655 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, false);
3656 // check file
3657 if (!additionalFile.empty()) {
3658 // declare overwrite flag
3659 bool overwriteElements = false;
3660 // check if open question dialog box
3661 if (additionalFile == neteditOptions.getString("additional-files")) {
3662 // open overwrite dialog
3663 GNEOverwriteElementsDialog overwriteDialog(this, "additional");
3664 // continue depending of result
3665 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
3666 // abort load
3667 return 0;
3668 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
3669 // enable overwriteElements
3670 overwriteElements = true;
3671 }
3672 }
3673 // flag for save current saving status
3674 const auto previouslySaved = myNet->getSavingStatus()->isAdditionalsSaved();
3675 // disable validation for additionals
3676 XMLSubSys::setValidation("never", "auto", "auto");
3677 // Create additional handler
3678 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3679 // begin undoList operation
3680 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("load additionals from '") + additionalFile + "'");
3681 // Run parser
3682 if (!generalHandler.parse()) {
3683 // write error
3684 WRITE_ERROR(TL("Loading of additional file failed: ") + additionalFile);
3685 } else {
3686 // change value of "additional-files"
3687 neteditOptions.resetWritable();
3688 neteditOptions.set("additional-files", additionalFile);
3689 // write info
3690 WRITE_MESSAGE(TL("Loading of additional file successfully: ") + additionalFile);
3691 // enable save if there is errors loading additionals
3692 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
3694 }
3695 }
3696 // end undoList operation
3697 myUndoList->end();
3698 // restore validation for additionals
3699 XMLSubSys::setValidation("auto", "auto", "auto");
3700 // check if clear undoList
3702 myUndoList->clear();
3703 }
3704 update();
3705 }
3706 return 1;
3707}
3708
3709
3710long
3712 // get additionalFile
3713 const std::string additionalFile = OptionsCont::getOptions().getString("additional-files");
3714 // disable validation for additionals
3715 XMLSubSys::setValidation("never", "auto", "auto");
3716 // Create general handler
3717 GNEGeneralHandler generalHandler(myNet, additionalFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3718 // begin undoList operation
3719 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading additionals from '") + additionalFile + "'");
3720 // clear additionals
3722 // Run parser
3723 if (!generalHandler.parse()) {
3724 WRITE_ERROR(TL("Reloading of additional file failed: ") + additionalFile);
3725 }
3726 // end undoList operation
3727 myUndoList->end();
3728 // restore validation for additionals
3729 XMLSubSys::setValidation("auto", "auto", "auto");
3730 // check if clear undoList
3732 myUndoList->clear();
3733 }
3734 update();
3735 return 1;
3736}
3737
3738
3739long
3740GNEApplicationWindow::onUpdReloadAdditionals(FXObject* sender, FXSelector, void*) {
3741 // check if file exist
3742 if (myViewNet && OptionsCont::getOptions().getString("additional-files").empty()) {
3743 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3744 } else {
3745 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3746 }
3747}
3748
3749
3750long
3751GNEApplicationWindow::onCmdSaveAdditionals(FXObject* sender, FXSelector sel, void* ptr) {
3752 // get option container
3753 auto& neteditOptions = OptionsCont::getOptions();
3754 // check if we have to set the output filename
3755 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("additional-files").empty()) {
3756 neteditOptions.set("additional-files", *(static_cast<std::string*>(ptr)) + ".add.xml");
3757 }
3759 // nothing to save
3760 return 1;
3761 } else if (neteditOptions.getString("additional-files").empty()) {
3762 // choose file to save
3763 return onCmdSaveAdditionalsAs(sender, sel, ptr);
3764 } else {
3765 // Start saving additionals
3766 getApp()->beginWaitCursor();
3767 try {
3768 // compute before saving (for detectors positions)
3769 myNet->computeNetwork(this);
3770 // save additionals
3772 // show info
3773 WRITE_MESSAGE(TL("Additionals saved in '") + neteditOptions.getString("additional-files") + "'");
3774 // end saving additionals
3775 getApp()->endWaitCursor();
3776 // restore focus
3777 setFocus();
3778 } catch (IOError& e) {
3779 // write warning if netedit is running in testing mode
3780 WRITE_DEBUG("Opening FXMessageBox 'error saving additionals'");
3781 // open error message box
3782 FXMessageBox::error(this, MBOX_OK, TL("Saving additionals failed!"), "%s", e.what());
3783 // write warning if netedit is running in testing mode
3784 WRITE_DEBUG("Closed FXMessageBox 'error saving additionals' with 'OK'");
3785 }
3786 getApp()->endWaitCursor();
3787 return 1;
3788 }
3789}
3790
3791
3792long
3794 // get option container
3795 auto& neteditOptions = OptionsCont::getOptions();
3796 // declare current folder
3797 FXString currentFolder = gCurrentFolder;
3798 // set current folder
3799 if (neteditOptions.getString("configuration-file").size() > 0) {
3800 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
3801 } else if (neteditOptions.getString("net-file").size() > 0) {
3802 currentFolder = getFolder(neteditOptions.getString("net-file"));
3803 }
3804 // get additional file
3805 const auto additionalFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3806 // check that file is valid
3807 if (!additionalFile.empty()) {
3808 // reset writtable flag
3809 neteditOptions.resetWritable();
3810 // change value of "additional-files"
3811 neteditOptions.set("additional-files", additionalFile);
3812 // enable save additionals
3814 // save additionals
3815 return onCmdSaveAdditionals(nullptr, 0, nullptr);
3816 } else {
3817 return 1;
3818 }
3819}
3820
3821
3822long
3824 // declare current folder
3825 FXString currentFolder = gCurrentFolder;
3826 // get juPedSim file
3827 const auto juPedSimFile = GNEApplicationWindowHelper::openAdditionalFileDialog(this, true);
3828 // check that file is valid
3829 if (!juPedSimFile.empty()) {
3830 try {
3831 // Start saving additionals
3832 getApp()->beginWaitCursor();
3833 // save additionals
3834 myNet->saveJuPedSimElements(juPedSimFile);
3835 // show info
3836 WRITE_MESSAGE(TL("JuPedSim elements saved in '") + juPedSimFile + "'");
3837 // end saving additionals
3838 getApp()->endWaitCursor();
3839 // restore focus
3840 setFocus();
3841 } catch (IOError& e) {
3842 // write warning if netedit is running in testing mode
3843 WRITE_DEBUG("Opening FXMessageBox 'error saving JuPedSim elements'");
3844 // open error message box
3845 FXMessageBox::error(this, MBOX_OK, TL("Saving JuPedSim elements failed!"), "%s", e.what());
3846 // write warning if netedit is running in testing mode
3847 WRITE_DEBUG("Closed FXMessageBox 'error saving JuPedSim elements' with 'OK'");
3848 }
3849 }
3850 return 1;
3851}
3852
3853
3854long
3856 // get option container
3857 auto& neteditOptions = OptionsCont::getOptions();
3858 // get file
3859 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, false);
3860 // check file
3861 if (!routeFile.empty()) {
3862 // declare overwrite flag
3863 bool overwriteElements = false;
3864 // check if open question dialog box
3865 if (routeFile == neteditOptions.getString("route-files")) {
3866 // open overwrite dialog
3867 GNEOverwriteElementsDialog overwriteDialog(this, "route");
3868 // continue depending of result
3869 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
3870 // abort load
3871 return 0;
3872 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
3873 // enable overwriteElements
3874 overwriteElements = true;
3875 }
3876 }
3877 // save previous demand element status saving
3878 const auto previouslySaved = myNet->getSavingStatus()->isDemandElementsSaved();
3879 // disable validation for additionals
3880 XMLSubSys::setValidation("never", "auto", "auto");
3881 // Create generic handler
3882 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
3883 // begin undoList operation
3884 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + routeFile + "'");
3885 // Run parser for additionals
3886 if (!handler.parse()) {
3887 // write error
3888 WRITE_ERROR(TL("Loading of route file failed: ") + routeFile);
3889 } else {
3890 // change value of "route-files"
3891 neteditOptions.resetWritable();
3892 neteditOptions.set("route-files", routeFile);
3893 // show info
3894 WRITE_MESSAGE(TL("Loading of route file successfully: ") + routeFile);
3895 // enable demand elements if there is an error creating element
3896 if (previouslySaved && !handler.isErrorCreatingElement()) {
3898 }
3899 }
3900 // end undoList operation
3901 myUndoList->end();
3902 // restore validation
3903 XMLSubSys::setValidation("auto", "auto", "auto");
3904 // check if clear undoList
3906 myUndoList->clear();
3907 }
3908 update();
3909 }
3910 return 1;
3911}
3912
3913
3914long
3916 // get file
3917 const std::string routeFile = OptionsCont::getOptions().getString("route-files");
3918 // disable validation for additionals
3919 XMLSubSys::setValidation("never", "auto", "auto");
3920 // Create handler
3921 GNEGeneralHandler handler(myNet, routeFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
3922 // begin undoList operation
3923 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TLF("reloading demand elements from '%'", routeFile));
3924 // clear demand elements
3926 // Run parser for additionals
3927 if (!handler.parse()) {
3928 WRITE_ERROR(TL("Reloading of route file failed: ") + routeFile);
3929 }
3930 // end undoList operation and update view
3931 myUndoList->end();
3932 // restore validation for demand
3933 XMLSubSys::setValidation("auto", "auto", "auto");
3934 // check if clear undoList
3936 myUndoList->clear();
3937 }
3938 update();
3939 return 1;
3940}
3941
3942
3943long
3944GNEApplicationWindow::onUpdReloadDemandElements(FXObject* sender, FXSelector, void*) {
3945 // check if file exist
3946 if (myViewNet && OptionsCont::getOptions().getString("route-files").empty()) {
3947 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
3948 } else {
3949 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
3950 }
3951}
3952
3953
3954long
3955GNEApplicationWindow::onCmdSaveDemandElements(FXObject* sender, FXSelector sel, void* ptr) {
3956 // get option container
3957 auto& neteditOptions = OptionsCont::getOptions();
3958 // check if we have to set the output filename
3959 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("route-files").empty()) {
3960 neteditOptions.set("route-files", *(static_cast<std::string*>(ptr)) + ".rou.xml");
3961 }
3962 // check saving conditions
3964 return 1;
3965 } else if (neteditOptions.getString("route-files").empty()) {
3966 return onCmdSaveDemandElementsAs(sender, sel, ptr);
3967 } else {
3968 // Start saving demand elements
3969 getApp()->beginWaitCursor();
3970 try {
3971 // compute before saving
3972 myNet->computeNetwork(this);
3973 // save demand elements
3975 // show info
3976 WRITE_MESSAGE(TL("Demand elements saved in '") + neteditOptions.getString("route-files") + "'");
3977 // end saving demand elements
3978 getApp()->endWaitCursor();
3979 // restore focus
3980 setFocus();
3981 } catch (IOError& e) {
3982 // write warning if netedit is running in testing mode
3983 WRITE_DEBUG("Opening FXMessageBox 'error saving demand elements'");
3984 // open error message box
3985 FXMessageBox::error(this, MBOX_OK, TL("Saving demand elements failed!"), "%s", e.what());
3986 // write warning if netedit is running in testing mode
3987 WRITE_DEBUG("Closed FXMessageBox 'error saving demand elements' with 'OK'");
3988 }
3989 getApp()->endWaitCursor();
3990 return 1;
3991 }
3992}
3993
3994
3995long
3996GNEApplicationWindow::onCmdSaveDemandElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
3997 // get option container
3998 auto& neteditOptions = OptionsCont::getOptions();
3999 // declare current folder
4000 FXString currentFolder = gCurrentFolder;
4001 // set current folder
4002 if (neteditOptions.getString("configuration-file").size() > 0) {
4003 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4004 } else if (neteditOptions.getString("net-file").size() > 0) {
4005 currentFolder = getFolder(neteditOptions.getString("net-file"));
4006 }
4007 // get route file
4008 const auto routeFile = GNEApplicationWindowHelper::openRouteFileDialog(this, true);
4009 // check that file is correct
4010 if (!routeFile.empty()) {
4011 // reset writtable flag
4012 neteditOptions.resetWritable();
4013 // change value of "route-files"
4014 neteditOptions.set("route-files", routeFile);
4015 // requiere save demand elements
4017 // save demand elements
4018 return onCmdSaveDemandElements(sender, sel, ptr);
4019 } else {
4020 return 1;
4021 }
4022}
4023
4024
4025long
4026GNEApplicationWindow::onCmdOpenDataElements(FXObject*, FXSelector, void*) {
4027 // get option container
4028 auto& neteditOptions = OptionsCont::getOptions();
4029 // get file
4030 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, false);
4031 // check file
4032 if (!dataFile.empty()) {
4033 // declare overwrite flag
4034 bool overwriteElements = false;
4035 // check if open question dialog box
4036 if (dataFile == neteditOptions.getString("data-files")) {
4037 // open overwrite dialog
4038 GNEOverwriteElementsDialog overwriteDialog(this, "data");
4039 // continue depending of result
4040 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
4041 // abort load
4042 return 0;
4043 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
4044 // enable overwriteElements
4045 overwriteElements = true;
4046 }
4047 }
4048 // save previous demand element status saving
4049 const auto previouslySaved = myNet->getSavingStatus()->isDataElementsSaved();
4050 // disable update data
4052 // disable validation for data elements
4053 XMLSubSys::setValidation("never", "auto", "auto");
4054 // Create data handler
4055 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4056 // begin undoList operation
4057 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + dataFile + "'");
4058 // Run data parser
4059 if (!dataHandler.parse()) {
4060 // write error
4061 WRITE_ERROR(TL("Loading of data file failed: ") + dataFile);
4062 } else {
4063 // change value of "data-files"
4064 neteditOptions.resetWritable();
4065 neteditOptions.set("data-files", dataFile);
4066 // show info
4067 WRITE_MESSAGE(TL("Loading of data file successfully: ") + dataFile);
4068 // enable demand elements if there is an error creating element
4069 if (previouslySaved && !dataHandler.isErrorCreatingElement()) {
4071 }
4072 }
4073 // end undoList operation
4074 myUndoList->end();
4075 // enable update data
4077 // restore validation for data
4078 XMLSubSys::setValidation("auto", "auto", "auto");
4079 // check if clear undoList
4081 myUndoList->clear();
4082 }
4083 update();
4084 }
4085 return 1;
4086}
4087
4088
4089long
4091 // get file
4092 const std::string dataFile = OptionsCont::getOptions().getString("data-files");
4093 // disable update data
4095 // disable validation for additionals
4096 XMLSubSys::setValidation("never", "auto", "auto");
4097 // Create additional handler
4098 GNEDataHandler dataHandler(myNet, dataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4099 // begin undoList operation
4100 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("reloading data elements from '") + dataFile + "'");
4101 // clear data elements
4103 // Run data parser
4104 if (!dataHandler.parse()) {
4105 WRITE_ERROR(TL("Reloading of data file failed: ") + dataFile);
4106 }
4107 // restore validation for data
4108 XMLSubSys::setValidation("auto", "auto", "auto");
4109 // end undoList operation and update view
4110 myUndoList->end();
4111 // enable update data
4113 // check if clear undoList
4115 myUndoList->clear();
4116 }
4117 update();
4118 return 1;
4119}
4120
4121
4122long
4123GNEApplicationWindow::onUpdReloadDataElements(FXObject* sender, FXSelector, void*) {
4124 // check if file exist
4125 if (myViewNet && OptionsCont::getOptions().getString("data-files").empty()) {
4126 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4127 } else {
4128 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4129 }
4130}
4131
4132
4133long
4134GNEApplicationWindow::onCmdSaveDataElements(FXObject* sender, FXSelector sel, void* ptr) {
4135 // get option container
4136 auto& neteditOptions = OptionsCont::getOptions();
4137 // check if we have to set the output filename
4138 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("data-files").empty()) {
4139 neteditOptions.set("data-files", *(static_cast<std::string*>(ptr)) + ".dat.xml");
4140 }
4142 // nothing to save
4143 return 1;
4144 } else if (neteditOptions.getString("data-files").empty()) {
4145 return onCmdSaveDataElementsAs(sender, sel, ptr);
4146 } else {
4147 // Start saving data elements
4148 getApp()->beginWaitCursor();
4149 try {
4150 // save data elements
4152 // write einfo
4153 WRITE_MESSAGE(TL("Data elements saved in '") + neteditOptions.getString("data-files") + "'");
4154 } catch (IOError& e) {
4155 // write warning if netedit is running in testing mode
4156 WRITE_DEBUG("Opening FXMessageBox 'error saving data elements'");
4157 // open error message box
4158 FXMessageBox::error(this, MBOX_OK, TL("Saving data elements failed!"), "%s", e.what());
4159 // write warning if netedit is running in testing mode
4160 WRITE_DEBUG("Closed FXMessageBox 'error saving data elements' with 'OK'");
4161 }
4162 // end saving
4163 getApp()->endWaitCursor();
4164 // restore focus
4165 setFocus();
4166 return 1;
4167 }
4168}
4169
4170
4171long
4172GNEApplicationWindow::onCmdSaveDataElementsAs(FXObject* sender, FXSelector sel, void* ptr) {
4173 // get option container
4174 auto& neteditOptions = OptionsCont::getOptions();
4175 // declare current folder
4176 FXString currentFolder = gCurrentFolder;
4177 // set current folder
4178 if (neteditOptions.getString("configuration-file").size() > 0) {
4179 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4180 } else if (neteditOptions.getString("net-file").size() > 0) {
4181 currentFolder = getFolder(neteditOptions.getString("net-file"));
4182 }
4183 // get data file
4184 const auto dataFile = GNEApplicationWindowHelper::openDataFileDialog(this, true);
4185 // check that file is correct
4186 if (!dataFile.empty()) {
4187 // reset writtable flag
4188 neteditOptions.resetWritable();
4189 // change value of "data-files"
4190 neteditOptions.set("data-files", dataFile);
4191 // mark data elements as unsaved
4193 // save data elements
4194 return onCmdSaveDataElements(sender, sel, ptr);
4195 } else {
4196 return 1;
4197 }
4198}
4199
4200
4201long
4202GNEApplicationWindow::onCmdOpenMeanDatas(FXObject*, FXSelector, void*) {
4203 auto& neteditOptions = OptionsCont::getOptions();
4204 // get file
4205 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, false);
4206 // check file
4207 if (!meanDataFile.empty()) {
4208 // declare overwrite flag
4209 bool overwriteElements = false;
4210 // check if open question dialog box
4211 if (meanDataFile == neteditOptions.getString("meandata-files")) {
4212 // open overwrite dialog
4213 GNEOverwriteElementsDialog overwriteDialog(this, "meanData");
4214 // continue depending of result
4215 if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::CANCEL) {
4216 // abort load
4217 return 0;
4218 } else if (overwriteDialog.getResult() == GNEOverwriteElementsDialog::Result::OVERWRITE) {
4219 // enable overwriteElements
4220 overwriteElements = true;
4221 }
4222 }
4223 // save previous demand element status saving
4224 const auto previouslySaved = myNet->getSavingStatus()->isMeanDatasSaved();
4225 // disable validation for meanDatas
4226 XMLSubSys::setValidation("never", "auto", "auto");
4227 // Create meanData handler
4228 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, overwriteElements);
4229 // begin undoList operation
4230 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("load meanDatas from '") + meanDataFile + "'");
4231 // Run parser
4232 if (!generalHandler.parse()) {
4233 // write error
4234 WRITE_ERROR(TL("Loading of meandata file failed: ") + meanDataFile);
4235 } else {
4236 // change value of "meandata-files"
4237 neteditOptions.resetWritable();
4238 neteditOptions.set("meandata-files", meanDataFile);
4239 // show info
4240 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4241 // enable demand elements if there is an error creating element
4242 if (previouslySaved && !generalHandler.isErrorCreatingElement()) {
4244 }
4245 }
4246 // end undoList operation
4247 myUndoList->end();
4248 // restore validation for meanDatas
4249 XMLSubSys::setValidation("auto", "auto", "auto");
4250 // check if clear undoList
4252 myUndoList->clear();
4253 }
4254 update();
4255 }
4256 return 1;
4257}
4258
4259
4260long
4261GNEApplicationWindow::onCmdReloadMeanDatas(FXObject*, FXSelector, void*) {
4262 // get file
4263 const std::string meanDataFile = OptionsCont::getOptions().getString("meandata-files");
4264 // disable validation for meanDatas
4265 XMLSubSys::setValidation("never", "auto", "auto");
4266 // Create general handler
4267 GNEGeneralHandler generalHandler(myNet, meanDataFile, myAllowUndoRedoLoading ? myAllowUndoRedo : false, true);
4268 // begin undoList operation
4269 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODENETWORK, TL("reloading meanDatas from '") + meanDataFile + "'");
4270 // clear meanDatas
4272 // Run parser
4273 if (!generalHandler.parse()) {
4274 WRITE_MESSAGE(TL("Loading of meandata file successfully: ") + meanDataFile);
4275 }
4276 // end undoList operation and update view
4277 myUndoList->end();
4278 // restore validation for meanDatas
4279 XMLSubSys::setValidation("auto", "auto", "auto");
4280 // check if clear undoList
4282 myUndoList->clear();
4283 }
4284 update();
4285 return 1;
4286}
4287
4288
4289long
4290GNEApplicationWindow::onUpdReloadMeanDatas(FXObject* sender, FXSelector, void*) {
4291 // check if file exist
4292 if (myViewNet && OptionsCont::getOptions().getString("meandata-files").empty()) {
4293 return sender->handle(this, FXSEL(SEL_COMMAND, ID_DISABLE), nullptr);
4294 } else {
4295 return sender->handle(this, FXSEL(SEL_COMMAND, ID_ENABLE), nullptr);
4296 }
4297}
4298
4299
4300long
4301GNEApplicationWindow::onCmdSaveMeanDatas(FXObject* sender, FXSelector sel, void* ptr) {
4302 // get option container
4303 auto& neteditOptions = OptionsCont::getOptions();
4304 // check saving conditions
4306 // nothing to save
4307 return 1;
4308 } else {
4309 // first check if we have to set the output filename
4310 if ((sel == MID_GNE_FORCESAVE) && neteditOptions.getString("meandata-files").empty()) {
4311 neteditOptions.set("meandata-files", *(static_cast<std::string*>(ptr)) + ".med.add.xml");
4312 }
4314 // nothing to save
4315 return 1;
4316 } else if (neteditOptions.getString("meandata-files").empty()) {
4317 return onCmdSaveMeanDatasAs(sender, sel, ptr);
4318 } else {
4319 // Start saving meanDatas
4320 getApp()->beginWaitCursor();
4321 try {
4322 // save mean datas
4324 // write info
4325 WRITE_MESSAGE(TL("MeanDatas saved in '") + neteditOptions.getString("meandata-files") + "'");
4326 } catch (IOError& e) {
4327 // write warning if netedit is running in testing mode
4328 WRITE_DEBUG("Opening FXMessageBox 'error saving meanData'");
4329 // open error message box
4330 FXMessageBox::error(this, MBOX_OK, TL("Saving meanData failed!"), "%s", e.what());
4331 // write warning if netedit is running in testing mode
4332 WRITE_DEBUG("Closed FXMessageBox 'error saving meanDara' with 'OK'");
4333 }
4334 // end saving
4335 getApp()->endWaitCursor();
4336 // restore focus
4337 setFocus();
4338 return 1;
4339 }
4340 }
4341}
4342
4343
4344long
4345GNEApplicationWindow::onCmdSaveMeanDatasAs(FXObject* sender, FXSelector sel, void* ptr) {
4346 // get option container
4347 auto& neteditOptions = OptionsCont::getOptions();
4348 // declare current folder
4349 FXString currentFolder = gCurrentFolder;
4350 // set current folder
4351 if (neteditOptions.getString("configuration-file").size() > 0) {
4352 currentFolder = getFolder(neteditOptions.getString("configuration-file"));
4353 } else if (neteditOptions.getString("net-file").size() > 0) {
4354 currentFolder = getFolder(neteditOptions.getString("net-file"));
4355 }
4356 // get meanData file
4357 const auto meanDataFile = GNEApplicationWindowHelper::openMeanDataDialog(this, true);
4358 // check that file is valid
4359 if (!meanDataFile.empty()) {
4360 // reset writtable flag
4361 neteditOptions.resetWritable();
4362 // change value of "meandata-files"
4363 neteditOptions.set("meandata-files", meanDataFile);
4364 // mark mean datas as unsaved
4366 // save meanDatas
4367 return onCmdSaveMeanDatas(sender, sel, ptr);
4368 } else {
4369 return 1;
4370 }
4371}
4372
4373
4374bool
4376 if (myNet && !myNet->getSavingStatus()->isNetworkSaved()) {
4377 // write warning if netedit is running in testing mode
4378 WRITE_DEBUG("Opening FXMessageBox 'Confirm close network'");
4379 // open question box
4380 const std::string header = TL("Confirm close Network");
4381 const std::string contentsA = TL("You have unsaved changes in the network.");
4382 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4383 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4384 // restore focus to view net
4385 myViewNet->setFocus();
4386 // if user close dialog box, check additionals and demand elements
4387 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4388 // write warning if netedit is running in testing mode
4389 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'Quit'");
4394 // clear undo list
4395 clearUndoList();
4396 return true;
4397 } else {
4398 return false;
4399 }
4400 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4401 // save network
4402 onCmdSaveNetwork(nullptr, 0, nullptr);
4403 // check
4408 // clear undo list
4409 clearUndoList();
4410 return true;
4411 } else {
4412 return false;
4413 }
4414 } else {
4415 // write warning if netedit is running in testing mode
4416 if (answer == 2) {
4417 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'No'");
4418 } else if (answer == 4) {
4419 WRITE_DEBUG("Closed FXMessageBox 'Confirm close network' with 'ESC'");
4420 }
4421 // return false to stop closing/reloading
4422 return false;
4423 }
4424 } else {
4429 // clear undo list
4430 clearUndoList();
4431 return true;
4432 } else {
4433 // return false to stop closing/reloading
4434 return false;
4435 }
4436 }
4437}
4438
4439
4440bool
4442 // Check if there are non saved additionals
4444 WRITE_DEBUG("Opening FXMessageBox 'Save additionals before close'");
4445 // open question box
4446 const std::string header = TL("Save additional elements before close");
4447 const std::string contentsA = TL("You have unsaved additional elements.");
4448 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4449 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4450 // restore focus to view net
4451 myViewNet->setFocus();
4452 // if answer was affirmative, but there was an error during saving additionals, return false to stop closing/reloading
4453 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4454 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Quit'");
4455 // nothing to save, return true
4456 return true;
4457 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4458 // write warning if netedit is running in testing mode
4459 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'Yes'");
4460 if (onCmdSaveAdditionals(nullptr, 0, nullptr) == 1) {
4461 // additionals successfully saved
4462 return true;
4463 } else {
4464 // error saving additionals, abort saving
4465 return false;
4466 }
4467 } else {
4468 // write warning if netedit is running in testing mode
4469 if (answer == 2) {
4470 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'No'");
4471 } else if (answer == 4) {
4472 WRITE_DEBUG("Closed FXMessageBox 'Save additionals before close' with 'ESC'");
4473 }
4474 // abort saving
4475 return false;
4476 }
4477 } else {
4478 // nothing to save, return true
4479 return true;
4480 }
4481}
4482
4483
4484bool
4486 // Check if there are non saved demand elements
4488 WRITE_DEBUG("Opening FXMessageBox 'Save demand elements before close'");
4489 // open question box
4490 const std::string header = TL("Save demand elements before close");
4491 const std::string contentsA = TL("You have unsaved demand elements.");
4492 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4493 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4494 // restore focus to view net
4495 myViewNet->setFocus();
4496 // if answer was affirmative, but there was an error during saving demand elements, return false to stop closing/reloading
4497 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4498 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Quit'");
4499 // nothing to save, return true
4500 return true;
4501 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4502 // write warning if netedit is running in testing mode
4503 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'Yes'");
4504 if (onCmdSaveDemandElements(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4505 // demand elements successfully saved
4506 return true;
4507 } else {
4508 // error saving demand elements, abort saving
4509 return false;
4510 }
4511 } else {
4512 // write warning if netedit is running in testing mode
4513 if (answer == 2) {
4514 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'No'");
4515 } else if (answer == 4) {
4516 WRITE_DEBUG("Closed FXMessageBox 'Save demand elements before close' with 'ESC'");
4517 }
4518 // abort saving
4519 return false;
4520 }
4521 } else {
4522 // nothing to save, return true
4523 return true;
4524 }
4525}
4526
4527
4528bool
4530 // Check if there are non saved data elements
4532 WRITE_DEBUG("Opening FXMessageBox 'Save data elements before close'");
4533 // open question box
4534 const std::string header = TL("Save data elements before close");
4535 const std::string contentsA = TL("You have unsaved data elements.");
4536 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4537 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4538 // restore focus to view net
4539 myViewNet->setFocus();
4540 // if answer was affirmative, but there was an error during saving data elements, return false to stop closing/reloading
4541 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4542 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Quit'");
4543 // nothing to save, return true
4544 return true;
4545 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4546 // write warning if netedit is running in testing mode
4547 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'Yes'");
4548 if (onCmdSaveDataElements(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4549 // data elements successfully saved
4550 return true;
4551 } else {
4552 // error saving data elements, abort saving
4553 return false;
4554 }
4555 } else {
4556 // write warning if netedit is running in testing mode
4557 if (answer == 2) {
4558 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'No'");
4559 } else if (answer == 4) {
4560 WRITE_DEBUG("Closed FXMessageBox 'Save data elements before close' with 'ESC'");
4561 }
4562 // abort saving
4563 return false;
4564 }
4565 } else {
4566 // nothing to save, return true
4567 return true;
4568 }
4569}
4570
4571
4572bool
4574 // Check if there are non saved data elements
4576 WRITE_DEBUG("Opening FXMessageBox 'Save meanData elements before close'");
4577 // open question box
4578 const std::string header = TL("Save meanData elements before close");
4579 const std::string contentsA = TL("You have unsaved meanData elements.");
4580 const std::string contentsB = TL("Do you wish to close and discard all changes?");
4581 const auto answer = GUISaveDialog::question(getApp(), header.c_str(), "%s", (contentsA + "\n" + contentsB).c_str());
4582 // restore focus to view net
4583 myViewNet->setFocus();
4584 // if answer was affirmative, but there was an error during saving meanData elements, return false to stop closing/reloading
4585 if (answer == GUISaveDialog::CLICKED_DISCARD) {
4586 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Quit'");
4587 // nothing to save, return true
4588 return true;
4589 } else if (answer == GUISaveDialog::CLICKED_SAVE) {
4590 // write warning if netedit is running in testing mode
4591 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'Yes'");
4592 if (onCmdSaveMeanDatas(nullptr, MID_GNE_FORCESAVE, nullptr) == 1) {
4593 // meanData elements successfully saved
4594 return true;
4595 } else {
4596 // error saving meanData elements, abort saving
4597 return false;
4598 }
4599 } else {
4600 // write warning if netedit is running in testing mode
4601 if (answer == 2) {
4602 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'No'");
4603 } else if (answer == 4) {
4604 WRITE_DEBUG("Closed FXMessageBox 'Save meanData elements before close' with 'ESC'");
4605 }
4606 // abort saving
4607 return false;
4608 }
4609 } else {
4610 // nothing to save, return true
4611 return true;
4612 }
4613}
4614
4615
4616void
4617GNEApplicationWindow::setInputInSumoOptions(const bool ignoreAdditionals, const bool ignoreRoutes) {
4618 // obtain netedit option container
4619 auto& neteditOptions = OptionsCont::getOptions();
4621 // set network
4622 mySumoOptions.set("net-file", neteditOptions.getString("net-file"));
4623 // set routes
4624 if (ignoreRoutes || neteditOptions.getString("route-files").empty()) {
4625 mySumoOptions.resetDefault("route-files");
4626 } else {
4627 mySumoOptions.set("route-files", neteditOptions.getString("route-files"));
4628 }
4629 // set SumoOptions depending of additionalFiles and meanData files
4630 if (ignoreAdditionals) {
4631 if (neteditOptions.getString("meandata-files").empty()) {
4632 mySumoOptions.resetDefault("additional-files");
4633 } else {
4634 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4635 }
4636 } else {
4637 if ((neteditOptions.getString("additional-files").size() > 0) && (neteditOptions.getString("meandata-files").size())) {
4638 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files") + "," + neteditOptions.getString("meandata-files"));
4639 } else if (neteditOptions.getString("additional-files").size() > 0) {
4640 mySumoOptions.set("additional-files", neteditOptions.getString("additional-files"));
4641 } else if (neteditOptions.getString("meandata-files").size() > 0) {
4642 mySumoOptions.set("additional-files", neteditOptions.getString("meandata-files"));
4643 } else {
4644 mySumoOptions.resetDefault("additional-files");
4645 }
4646 }
4647}
4648
4649
4650FXString
4651GNEApplicationWindow::getFolder(const std::string& folder) const {
4652 // declare folder
4653 std::string newFolder = folder;
4654 // declare stop flag
4655 bool stop = false;
4656 // continue while stop is false
4657 while (!stop) {
4658 if (newFolder.empty()) {
4659 // new folder empty, then stop
4660 stop = true;
4661 } else if ((newFolder.back() == '\'') || (newFolder.back() == '\\') ||
4662 (newFolder.back() == '/') /* || (newFolder.back() == '//') */) {
4663 // removed file, then stop
4664 stop = true;
4665 } else {
4666 newFolder.pop_back();
4667 }
4668 }
4669 // if is empty, return gCurrentFolder
4670 if (newFolder.empty()) {
4671 return gCurrentFolder;
4672 }
4673 return FXString(newFolder.c_str());
4674}
4675
4676
4677void
4679 // check that view exists
4680 if (myViewNet) {
4682 }
4683 // update require recomputing
4685}
4686
4687
4688void
4690 // remove lock hotkeys
4692 // check supermode
4693 if (supermode == Supermode::NETWORK) {
4694 // menu commands
4698 // lock
4702 // processing
4707 } else if (supermode == Supermode::DEMAND) {
4708 // menu commands
4712 // lock
4716 // processing
4721 } else if (supermode == Supermode::DATA) {
4722 // menu commands
4726 // lock
4730 // processing
4735 } else {
4736 // menu commands
4741 // lock
4745 // processing
4749 }
4750 // continue depending of view
4751 if (myViewNet) {
4755 } else if (myViewNet->getEditModes().isJuPedSimView()) {
4758 }
4759 }
4760}
4761
4762
4763bool
4767
4768
4769void
4773
4774
4775void
4777 myUndoRedoListEnabled = reason;
4778}
4779
4780
4781const std::string&
4785
4786
4787void
4789 if (myViewNet) {
4790 // destroy Popup (to avoid crashes)
4792 }
4793 // clear undo list and return true to continue with closing/reload
4794 myUndoList->clear();
4795}
4796
4797
4802
4803
4808
4809
4814
4815
4820
4821
4826
4827
4832
4833
4838
4839
4840void
4842 // get option container
4843 auto& neteditOptions = OptionsCont::getOptions();
4844 // get additional files
4845 const auto additionalFiles = neteditOptions.getStringVector("additional-files");
4846 // check if ignore loading of additional files
4847 const auto ignoreLoadAdditionalFiles = neteditOptions.getBool("ignore.additionalelements");
4848 // check conditions
4849 if (ignoreLoadAdditionalFiles) {
4850 // reset flag
4851 neteditOptions.resetWritable();
4852 neteditOptions.set("ignore.additionalelements", "false");
4853 } else if (myNet && (additionalFiles.size() > 0)) {
4854 // use first file as output
4855 neteditOptions.resetWritable();
4856 neteditOptions.set("additional-files", additionalFiles.front());
4857 // begin undolist
4858 myUndoList->begin(Supermode::NETWORK, GUIIcon::SUPERMODENETWORK, TL("loading additional elements from '") + toString(additionalFiles) + "'");
4859 // iterate over every additional file
4860 bool setSaved = additionalFiles.size() == 1;
4861 for (const auto& file : additionalFiles) {
4862 // check if ignore missing imputs
4863 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4864 WRITE_MESSAGE(TL("loading additionals from '") + file + "'");
4865 // declare general handler
4866 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4867 // disable validation for additionals
4868 XMLSubSys::setValidation("never", "auto", "auto");
4869 // Run parser
4870 if (!handler.parse()) {
4871 WRITE_ERRORF(TL("Loading of % failed."), file);
4872 }
4873 setSaved &= !handler.isErrorCreatingElement();
4874 // set additionals in SumoConfig
4875 setInputInSumoOptions(false, false);
4876 // disable validation for additionals
4877 XMLSubSys::setValidation("auto", "auto", "auto");
4878 }
4879 }
4880 if (setSaved) {
4882 }
4883 // end undo list
4884 myUndoList->end();
4885 // check if clear undoList
4887 myUndoList->clear();
4888 }
4889 }
4890}
4891
4892
4893void
4895 // get option container
4896 auto& neteditOptions = OptionsCont::getOptions();
4897 // get demand files
4898 const auto demandFiles = neteditOptions.getStringVector("route-files");
4899 // check if ignore loading of additional files
4900 const auto ignoreLoadDemandFiles = neteditOptions.getBool("ignore.routeelements");
4901 // check conditions
4902 if (ignoreLoadDemandFiles) {
4903 // reset flag
4904 neteditOptions.resetWritable();
4905 neteditOptions.set("ignore.routeelements", "false");
4906 } else if (myNet && (demandFiles.size() > 0)) {
4907 // use first file as output
4908 neteditOptions.resetWritable();
4909 neteditOptions.set("route-files", demandFiles.front());
4910 // begin undolist
4911 myUndoList->begin(Supermode::DEMAND, GUIIcon::SUPERMODEDEMAND, TL("loading demand elements from '") + toString(demandFiles) + "'");
4912 // iterate over every additional file
4913 for (const auto& file : demandFiles) {
4914 // check if ignore missing imputs
4915 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4916 WRITE_MESSAGE(TL("loading demand elements from '") + file + "'");
4917 // declare general handler
4918 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4919 // disable validation for additionals
4920 XMLSubSys::setValidation("never", "auto", "auto");
4921 // Run parser
4922 if (!handler.parse()) {
4923 WRITE_ERRORF(TL("Loading of % failed."), file);
4924 }
4925 // set additionals in SumoConfig
4926 setInputInSumoOptions(false, false);
4927 // disable validation for additionals
4928 XMLSubSys::setValidation("auto", "auto", "auto");
4929 }
4930 }
4931 // end undo list
4932 myUndoList->end();
4933 // check if clear undoList
4935 myUndoList->clear();
4936 }
4937 }
4938}
4939
4940
4941void
4943 // get option container
4944 auto& neteditOptions = OptionsCont::getOptions();
4945 // get meanData files
4946 const auto meanDataFiles = neteditOptions.getStringVector("meandata-files");
4947 // continue depending of network and additional files
4948 if (myNet && (meanDataFiles.size() > 0)) {
4949 // use first file as output
4950 neteditOptions.resetWritable();
4951 neteditOptions.set("meandata-files", meanDataFiles.front());
4952 // begin undolist
4953 myUndoList->begin(Supermode::DATA, GUIIcon::MODEMEANDATA, TL("loading meanDatas from '") + toString(meanDataFiles) + "'");
4954 // iterate over every additional file
4955 for (const auto& file : meanDataFiles) {
4956 // check if ignore missing imputs
4957 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4958 WRITE_MESSAGE(TL("loading meandatas from '") + file + "'");
4959 // declare general handler
4960 GNEGeneralHandler handler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
4961 // disable validation for additionals
4962 XMLSubSys::setValidation("never", "auto", "auto");
4963 // Run parser
4964 if (!handler.parse()) {
4965 WRITE_ERRORF(TL("Loading of % failed."), file);
4966 }
4967 // set additionals in sumo options
4968 setInputInSumoOptions(false, false);
4969 // disable validation for additionals
4970 XMLSubSys::setValidation("auto", "auto", "auto");
4971 }
4972 }
4973 // end undo list
4974 myUndoList->end();
4975 // check if clear undoList
4977 myUndoList->clear();
4978 }
4979 }
4980}
4981
4982
4983void
4985 // get option container
4986 auto& neteditOptions = OptionsCont::getOptions();
4987 // get data files
4988 const auto dataFiles = neteditOptions.getStringVector("data-files");
4989 // continue depending of network and data files
4990 if (myNet && (dataFiles.size() > 0)) {
4991 // disable update data
4993 // begin undolist
4994 myUndoList->begin(Supermode::DATA, GUIIcon::SUPERMODEDATA, TL("loading data elements from '") + toString(dataFiles) + "'");
4995 // iterate over every data file
4996 for (const auto& file : dataFiles) {
4997 // check if ignore missing imputs
4998 if (FileHelpers::isReadable(file) || !neteditOptions.getBool("ignore-missing-inputs")) {
4999 WRITE_MESSAGE(TL("Loading data elements from '") + file + "'");
5000 GNEDataHandler dataHandler(myNet, file, myAllowUndoRedoLoading ? myAllowUndoRedo : false, false);
5001 // disable validation for data elements
5002 XMLSubSys::setValidation("never", "auto", "auto");
5003 if (!dataHandler.parse()) {
5004 WRITE_ERRORF(TL("Loading of % failed."), file);
5005 }
5006 // set first dataElementsFiles as default file
5007 neteditOptions.resetWritable();
5008 neteditOptions.set("data-files", file);
5009 // disable validation for data elements
5010 XMLSubSys::setValidation("auto", "auto", "auto");
5011
5012 }
5013 }
5014 // end undolist
5015 myUndoList->end();
5016 // check if clear undoList
5018 myUndoList->clear();
5019 }
5020 // enable update data
5022 }
5023}
5024
5025// ---------------------------------------------------------------------------
5026// GNEApplicationWindow - protected methods
5027// ---------------------------------------------------------------------------
5028
5030 myToolbarsGrip(this),
5031 myMenuBarFile(this),
5032 myFileMenuCommands(this),
5033 myModesMenuCommands(this),
5034 myEditMenuCommands(this),
5035 myLockMenuCommands(this),
5036 myProcessingMenuCommands(this),
5037 myLocateMenuCommands(this),
5038 myToolsMenuCommands(this),
5039 myWindowsMenuCommands(this),
5040 myHelpMenuCommands(this),
5041 mySupermodeCommands(this) {
5042}
5043
5044
5045long
5046GNEApplicationWindow::onKeyPress(FXObject* o, FXSelector sel, void* eventData) {
5047 const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
5048 if (handled == 0 && myMDIClient->numChildren() > 0) {
5049 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5050 if (w != nullptr) {
5051 w->onKeyPress(nullptr, sel, eventData);
5052 }
5053 }
5054 return 0;
5055}
5056
5057
5058long
5059GNEApplicationWindow::onKeyRelease(FXObject* o, FXSelector sel, void* eventData) {
5060 const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
5061 if (handled == 0 && myMDIClient->numChildren() > 0) {
5062 GNEViewParent* w = dynamic_cast<GNEViewParent*>(myMDIClient->getActiveChild());
5063 if (w != nullptr) {
5064 w->onKeyRelease(nullptr, sel, eventData);
5065 }
5066 }
5067 return 0;
5068}
5069
5070
5071/****************************************************************************/
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
@ DATA_SELECT
mode for selecting data elements
@ DATA_INSPECT
mode for inspecting data elements
@ DATA_DELETE
mode for deleting data elements
Supermode
@brie enum for supermodes
@ NETWORK
Network mode (Edges, junctions, etc..)
@ DATA
Data mode (edgeData, LaneData etc..)
@ DEMAND
Demand mode (Routes, Vehicles etc..)
@ NETWORK_DELETE
mode for deleting network elements
@ NETWORK_MOVE
mode for moving network elements
@ NETWORK_SELECT
mode for selecting network elements
@ NETWORK_INSPECT
mode for inspecting network elements
@ NETWORK_CONNECT
mode for connecting lanes
@ DEMAND_INSPECT
mode for inspecting demand elements
@ DEMAND_DELETE
mode for deleting demand elements
@ DEMAND_SELECT
mode for selecting demand elements
@ DEMAND_MOVE
mode for moving demand elements
long long int SUMOTime
Definition GUI.h:36
@ MID_GNE_NETWORKVIEWOPTIONS_AUTOOPPOSITEEDGES
automatically create opposite edge
Definition GUIAppEnum.h:847
@ MID_GNE_NETGENERATE
netgenerate dialog
Definition GUIAppEnum.h:761
@ MID_HOTKEY_SHIFT_F10_SUMOOPTIONSMENU
open SUMO options menu (used in netedit)
Definition GUIAppEnum.h:272
@ MID_HOTKEY_SHIFT_F7_ADJUST_PERSON_PLANS
Adjust person plans (start und end positions, arrival positions, etc.)
Definition GUIAppEnum.h:270
@ MID_HOTKEY_CTRL_Q_CLOSE
Main window closes.
Definition GUIAppEnum.h:115
@ MID_HOTKEY_SHIFT_F5_COMPUTEJUNCTIONS_VOLATILE
compute junctions with volatile options
Definition GUIAppEnum.h:268
@ MID_HOTKEY_CTRL_SHIFT_B_SAVEDATAELEMENTS
save Data Elements
Definition GUIAppEnum.h:204
@ MID_HOTKEY_F3_SUPERMODE_DEMAND
select demand supermode in netedit
Definition GUIAppEnum.h:234
@ MID_GNE_UNDOLISTDIALOG
open undo list dialog
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLPERSONPLANS
show all person plans
Definition GUIAppEnum.h:879
@ MID_GNE_UNLOCK_ALLELEMENTS
unlock all element
Definition GUIAppEnum.h:857
@ MID_GNE_NETGENERATEOPTIONS
netgenerate options
Definition GUIAppEnum.h:763
@ MID_HOTKEY_SHIFT_S_LOCATESTOP
Locate stop - button.
Definition GUIAppEnum.h:188
@ MID_HOTKEY_CTRL_T_OPENNETEDIT_OPENSUMO
Open current SUMO simulation/network in netedit, or current netedit simulation/network in SUMO.
Definition GUIAppEnum.h:123
@ MID_GNE_DATAVIEWOPTIONS_TAZRELDRAWING
toggle TAZRel drawing
Definition GUIAppEnum.h:903
@ MID_GNE_TOGGLE_COMPUTE_NETWORK_DATA
enable/disable computing after switchin between supermodes
Definition GUIAppEnum.h:795
@ MID_TOOLBAREDIT_LOADADDITIONALS
load additionals in sumo-gui/netedit after press ctrl+T
Definition GUIAppEnum.h:681
@ MID_HOTKEY_U_MODE_DECAL_TYPEDISTRIBUTION
hotkey for mode decal AND type distribution
Definition GUIAppEnum.h:69
@ MID_GNE_NETWORKVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:821
@ MID_HOTKEY_CTRL_Y_REDO
Undo.
Definition GUIAppEnum.h:133
@ MID_GNE_RUNNETGENERATE
run netgenerate tool
Definition GUIAppEnum.h:773
@ MID_HOTKEY_CTRL_SHIFT_H_SAVEEDGETYPES
save Edge Types
Definition GUIAppEnum.h:212
@ MID_GNE_OPENPYTHONTOOLDIALOG
call tool
Definition GUIAppEnum.h:755
@ MID_GNE_NETWORKVIEWOPTIONS_MOVEELEVATION
move elevation instead of x,y
Definition GUIAppEnum.h:843
@ MID_HOTKEY_ALT_9_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:161
@ MID_GNE_TOOLBARFILE_RELOAD_EDGETYPES
reload edge types
Definition GUIAppEnum.h:733
@ MID_GNE_NETWORKVIEWOPTIONS_HIDECONNECTIONS
hide connections
Definition GUIAppEnum.h:829
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWCONNECTIONS
show connections
Definition GUIAppEnum.h:827
@ MID_HOTKEY_ALT_5_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:153
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYTO
toggle draw TAZRel only to
Definition GUIAppEnum.h:909
@ MID_HOTKEY_CTRL_W_CLOSESIMULATION
Close simulation - ID.
Definition GUIAppEnum.h:129
@ MID_HOTKEY_ALT_2_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:147
@ MID_GNE_LOCK_ALLELEMENTS
lock all element
Definition GUIAppEnum.h:855
@ MID_HOTKEY_F7_JOIN_SELECTEDJUNCTIONS_ROUTES
join selected junctions in network mode and normalice demand element ids in demand mode
Definition GUIAppEnum.h:242
@ MID_HOTKEY_CTRL_D_SINGLESIMULATIONSTEP_OPENDEMANDELEMENTS
Perform a single simulation step in SUMO and open Demand Elements in netedit.
Definition GUIAppEnum.h:89
@ MID_HOTKEY_F5_COMPUTE_NETWORK_DEMAND
compute Network in network mode and Demand elements in demand mode
Definition GUIAppEnum.h:238
@ MID_GNE_DATAVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:895
@ MID_HOTKEY_CTRL_O_OPENSIMULATION_OPENNETWORK
Open simulation in SUMO and open network in netedit.
Definition GUIAppEnum.h:111
@ MID_GNE_LOCK_MENUTITLE
selector for LockMenuTitle
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWTAZELEMENTS
show TAZ elements
Definition GUIAppEnum.h:833
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKPERSON
lock person
Definition GUIAppEnum.h:881
@ MID_HOTKEY_Z_MODE_TAZ_TAZREL
hotkey for mode editing TAZ and TAZRel
Definition GUIAppEnum.h:75
@ MID_HOTKEY_F9_EDIT_VIEWSCHEME
open edit scheme menu
Definition GUIAppEnum.h:246
@ MID_GNE_DEMANDVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:869
@ MID_HOTKEY_SHIFT_ESC_CLEARSELECTION
clear selection
Definition GUIAppEnum.h:276
@ MID_GNE_LOCK_SELECTEDELEMENTS
lock selected element
Definition GUIAppEnum.h:859
@ MID_HOTKEY_CTRL_J_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:101
@ MID_GNE_TOOLBARFILE_SAVESUMOCONFIG_AS
save SUMOConfig as
Definition GUIAppEnum.h:717
@ MID_GNE_TOOLBARFILE_RELOAD_TLSPROGRAMS
reload TLS Programs
Definition GUIAppEnum.h:729
@ MID_HOTKEY_DEL
hot key delete selections or elements
Definition GUIAppEnum.h:286
@ MID_HOTKEY_A_MODE_STARTSIMULATION_ADDITIONALS_STOPS
hotkey for start simulation in SUMO and set editing mode additionals AND stops in netedit
Definition GUIAppEnum.h:43
@ MID_LANGUAGE_TR
change language to turkish
@ MID_CHANGELOG
changelog button
Definition GUIAppEnum.h:655
@ MID_GNE_NETWORKVIEWOPTIONS_ASKFORMERGE
ask before merging junctions
Definition GUIAppEnum.h:839
@ MID_GNE_TOOLBARFILE_OPENFOREIGN
open foreign network
Definition GUIAppEnum.h:707
@ MID_GNE_TOGGLE_TIMEFORMAT
switch time format
Definition GUIAppEnum.h:801
@ MID_GNE_TOOLBARFILE_RELOAD_NETEDITCONFIG
reload neteditConfig
Definition GUIAppEnum.h:711
@ MID_HOTKEY_CTRL_B_EDITBREAKPOINT_OPENDATAELEMENTS
Edit simulation breakpoints in SUMO and open Data Elements in netedit.
Definition GUIAppEnum.h:85
@ MID_TOOLBAREDIT_LOADDEMAND
load demand in sumo-gui/netedit after press ctrl+T
Definition GUIAppEnum.h:683
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWGRID
show grid
Definition GUIAppEnum.h:867
@ MID_HOTKEY_ALT_3_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:149
@ MID_HOTKEY_F1_ONLINEDOCUMENTATION
open online documentation
Definition GUIAppEnum.h:230
@ MID_HOTKEY_CTRL_SHIFT_D_SAVEDEMANDELEMENTS
Save Demand Elements.
Definition GUIAppEnum.h:208
@ MID_GNE_POSTPROCESSINGPYTHONTOOL
call tool for post processing
Definition GUIAppEnum.h:759
@ MID_GNE_FORCESAVE
force save elements (using for saving netedit and sumo configs)
@ MID_HOTKEY_CTRL_R_RELOAD
Reload the previously loaded simulation.
Definition GUIAppEnum.h:119
@ MID_HOTKEY_CTRL_S_STOPSIMULATION_SAVENETWORK
Stop the simulation in SUMO and save network in netedit.
Definition GUIAppEnum.h:117
@ MID_GNE_TOOLBARFILE_RELOAD_MEANDATAS
reload meanDatas
Definition GUIAppEnum.h:747
@ MID_HOTKEY_D_MODE_SINGLESIMULATIONSTEP_DELETE
hotkey for perform a single simulation step in SUMO and set delete mode in netedit
Definition GUIAppEnum.h:49
@ MID_GNE_NETWORKVIEWOPTIONS_CHAINEDGES
create edges in chain mode
Definition GUIAppEnum.h:845
@ MID_HOTKEY_ESC
hot key <ESC> abort current edit operation
Definition GUIAppEnum.h:284
@ MID_GNE_TOOLBARFILE_SAVEDATA_AS
save data elements as
Definition GUIAppEnum.h:739
@ MID_HOTKEY_F10_OPTIONSMENU
open options menu
Definition GUIAppEnum.h:248
@ MID_HOTKEY_F11_FRONTELEMENT
set/clear front element
Definition GUIAppEnum.h:250
@ MID_HOTKEY_F8_CLEANINVALID_CROSSINGS_DEMANDELEMENTS
clean invalid crossings in network mode and demand elements in demand mode
Definition GUIAppEnum.h:244
@ MID_GNE_DATAVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:901
@ MID_HOTKEY_C_MODE_CONNECT_CONTAINER
hotkey for mode connecting lanes AND container
Definition GUIAppEnum.h:45
@ MID_HOTKEY_H_MODE_PROHIBITION_CONTAINERPLAN
hotkey for mode prohibition AND container plan
Definition GUIAppEnum.h:53
@ MID_HOTKEY_SHIFT_O_LOCATEPOI
Locate poi - button.
Definition GUIAppEnum.h:182
@ MID_HOTKEY_W_MODE_WIRE_ROUTEDISTRIBUTION
hotkey for mode editing overhead wires AND route distributions
Definition GUIAppEnum.h:73
@ MID_HOTKEY_T_MODE_TLS_TYPE
hotkey for mode editing TLS AND Vehicle Types
Definition GUIAppEnum.h:67
@ MID_GNE_DEMANDVIEWOPTIONS_HIDESHAPES
hide shapes
Definition GUIAppEnum.h:875
@ MID_GNE_TOGGLE_UNDOREDO
enable/disable undo-redo
Definition GUIAppEnum.h:797
@ MID_LANGUAGE_ZHT
change language to chinese (traditional)
@ MID_LANGUAGE_ES
change language to spanish
@ MID_HOTKEY_SHIFT_A_LOCATEADDITIONAL
Locate additional structure - button.
Definition GUIAppEnum.h:172
@ MID_HOTKEY_ALT_4_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:151
@ MID_GNE_TOOLBARFILE_SAVETLSPROGRAMS_AS
save TLS Programs as
Definition GUIAppEnum.h:727
@ MID_GNE_DATAVIEWOPTIONS_SHOWADDITIONALS
show additionals
Definition GUIAppEnum.h:897
@ MID_HOTKEY_SHIFT_R_LOCATEROUTE
Locate route - button.
Definition GUIAppEnum.h:186
@ MID_GNE_RUNPYTHONTOOL
run python
Definition GUIAppEnum.h:757
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWBUBBLES
show junctions as bubbles
Definition GUIAppEnum.h:841
@ MID_HOTKEY_SHIFT_W_LOCATEWALKINGAREA
Locate edge - button.
Definition GUIAppEnum.h:194
@ MID_GNE_TOOLBARFILE_RELOAD_DEMANDELEMENTS
reload demand elements
Definition GUIAppEnum.h:737
@ MID_GNE_NETWORKVIEWOPTIONS_EXTENDSELECTION
extend selection
Definition GUIAppEnum.h:835
@ MID_HOTKEY_CTRL_I_EDITVIEWPORT
Open viewport editor.
Definition GUIAppEnum.h:99
@ MID_RECENTFILE
Loads a file previously loaded.
Definition GUIAppEnum.h:318
@ MID_HOTKEY_S_MODE_STOPSIMULATION_SELECT
hotkey for stop simulation in SUMO and set select mode in netedit
Definition GUIAppEnum.h:63
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWSUBADDITIONALS
show sub-additionals
Definition GUIAppEnum.h:831
@ MID_HOTKEY_SHIFT_C_LOCATECONTAINER
Locate container - button.
Definition GUIAppEnum.h:174
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWALLCONTAINERPLANS
show all container plans
Definition GUIAppEnum.h:883
@ MID_HOTKEY_CTRL_SHIFT_N_NEWWINDOW
open a new window (SUMO AND netedit)
Definition GUIAppEnum.h:218
@ MID_HOTKEY_SHIFT_V_LOCATEVEHICLE
Locate vehicle - button.
Definition GUIAppEnum.h:192
@ MID_LANGUAGE_HU
change language to hungarian
@ MID_HOTKEY_F4_SUPERMODE_DATA
select data supermode in netedit
Definition GUIAppEnum.h:236
@ MID_HOTKEY_SHIFT_L_LOCATEPOLY
Locate polygons - button.
Definition GUIAppEnum.h:180
@ MID_HOTKEY_F6_CLEAN_SOLITARYJUNCTIONS_UNUSEDROUTES
clean junctions without edges in network mode and unused routes in demand mode
Definition GUIAppEnum.h:240
@ MID_HOTKEY_ALT_1_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:145
@ MID_HOTKEY_CTRL_K_OPENTLSPROGRAMS
Load file with TLS Programs.
Definition GUIAppEnum.h:103
@ MID_LANGUAGE_IT
change language to italian
@ MID_GNE_LOCK_ELEMENT
lock element
Definition GUIAppEnum.h:853
@ MID_GNE_TOOLBARFILE_SAVENETEDITCONFIG_AS
save neteditConfig as
Definition GUIAppEnum.h:713
@ MID_HOTKEY_SHIFT_E_LOCATEEDGE
Locate edge - button.
Definition GUIAppEnum.h:176
@ MID_CLEARMESSAGEWINDOW
Clear simulation output.
Definition GUIAppEnum.h:367
@ MID_GNE_TOOLBARFILE_OPENMEANDATAS
open meanData file
Definition GUIAppEnum.h:743
@ MID_HOTKEY_R_MODE_CROSSING_ROUTE_EDGERELDATA
hotkey for mode editing crossing, routes and edge rel datas
Definition GUIAppEnum.h:65
@ MID_TUTORIAL
tutorial button
Definition GUIAppEnum.h:659
@ MID_GNE_TOGGLE_UNDOREDO_LOADING
enable/disable undo-redo during loading
Definition GUIAppEnum.h:799
@ MID_HOTKEY_CTRL_G_GAMINGMODE_TOGGLEGRID
Toggle Gaming mode in SUMO and grid in netedit.
Definition GUIAppEnum.h:95
@ MID_GNE_DATAVIEWOPTIONS_TAZDRAWFILL
toggle draw TAZ fill
Definition GUIAppEnum.h:905
@ MID_HOTKEY_ALT_6_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:155
@ MID_HOTKEY_CTRL_SHIFT_M_SAVEMEANDATAS
save Mean Datas
Definition GUIAppEnum.h:216
@ ID_LOADTHREAD_EVENT
The loading thread.
Definition GUIAppEnum.h:346
@ MID_HOTKEY_L_MODE_PERSONPLAN
hotkey for mode person plan
Definition GUIAppEnum.h:57
@ MID_GNE_TOOLBARFILE_SAVEMEANDATAS_AS
save meanDatas as
Definition GUIAppEnum.h:745
@ MID_GNE_TOOLBARFILE_RELOAD_ADDITIONALS
reload additionals
Definition GUIAppEnum.h:725
@ MID_HOTKEY_V_MODE_VEHICLE
hotkey for mode create vehicles
Definition GUIAppEnum.h:71
@ MID_HOTKEY_SHIFT_P_LOCATEPERSON
Locate person - button.
Definition GUIAppEnum.h:184
@ MID_HOTKEY_I_MODE_INSPECT
hotkey for mode inspecting object attributes
Definition GUIAppEnum.h:55
@ MID_LANGUAGE_EN
change language to english
@ MID_GNE_NETWORKVIEWOPTIONS_SHOWDEMANDELEMENTS
show demand elements
Definition GUIAppEnum.h:823
@ MID_HOTKEY_SHIFT_J_LOCATEJUNCTION
Locate junction - button.
Definition GUIAppEnum.h:178
@ MID_HOTKEY_ALT_0_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:143
@ MID_HOTKEY_CTRL_SHIFT_E_SAVENETEDITCONFIG
save netedit Config
Definition GUIAppEnum.h:210
@ MID_GNE_TOOLBARFILE_SAVEADDITIONALS_AS
save additionals as
Definition GUIAppEnum.h:721
@ MID_GNE_TOOLBARFILE_SAVEEDGETYPES_AS
save edgeTypes as
Definition GUIAppEnum.h:731
@ MID_HOTKEYS
hotkeys button
Definition GUIAppEnum.h:657
@ MID_GNE_DEMANDVIEWOPTIONS_HIDENONINSPECTED
hide non-inspected demand element
Definition GUIAppEnum.h:873
@ MID_LANGUAGE_DE
change language to german
@ MID_HOTKEY_ALT_F4_CLOSE
Main window closes.
Definition GUIAppEnum.h:163
@ MID_HOTKEY_CTRL_SHIFT_A_SAVEADDITIONALS
Save Additional Elements.
Definition GUIAppEnum.h:202
@ MID_GNE_TOOLBARFILE_RELOADNETWORK
reload only network
Definition GUIAppEnum.h:705
@ MID_HOTKEY_SHIFT_F2_TEMPLATE_COPY
copy template
Definition GUIAppEnum.h:264
@ MID_GNE_NETWORKVIEWOPTIONS_CHANGEALLPHASES
change all phases
Definition GUIAppEnum.h:837
@ MID_HOTKEY_CTRL_A_STARTSIMULATION_OPENADDITIONALS
Start the simulation in SUMO and open Additionals Elements in netedit.
Definition GUIAppEnum.h:83
@ MID_GNE_DATAVIEWOPTIONS_SHOWSHAPES
show shapes
Definition GUIAppEnum.h:899
@ MID_GNE_POSTPROCESSINGNETGENERATE
postprocesing netgenerate
Definition GUIAppEnum.h:775
@ MID_HOTKEY_E_MODE_EDGE_EDGEDATA
hotkey for mode adding edges AND edgeDatas
Definition GUIAppEnum.h:51
@ MID_GNE_DATAVIEWOPTIONS_TAZRELONLYFROM
toggle draw TAZRel only from
Definition GUIAppEnum.h:907
@ MID_HOTKEY_ALT_8_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:159
@ MID_GNE_TOOLBARFILE_RELOAD_SUMOCONFIG
reload SUMOConfig
Definition GUIAppEnum.h:715
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEDRAWJUNCTIONSHAPE
toggle draw junction shape
Definition GUIAppEnum.h:819
@ MID_HOTKEY_CTRL_SHIFT_O_OPENNETCONVERTFILE
open Netconvert file
Definition GUIAppEnum.h:220
@ MID_GNE_RECOMPUTINGNEEDED
check if recomputing is needed
@ MID_HOTKEY_CTRL_M_OPENSUMOCONFIG
open sumo config
Definition GUIAppEnum.h:107
@ MID_GNE_TOOLBARFILE_SAVEDEMAND_AS
save demand elements as
Definition GUIAppEnum.h:735
@ MID_GNE_TOOLBARFILE_SAVENETWORK_AS
save network as
Definition GUIAppEnum.h:719
@ MID_GNE_DEMANDVIEWOPTIONS_DRAWSPREADVEHICLES
Draw vehicles in begin position or spread in lane.
Definition GUIAppEnum.h:871
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWOVERLAPPEDROUTES
show overlapped routes
Definition GUIAppEnum.h:887
@ MID_HOTKEY_CTRL_Z_UNDO
Redo.
Definition GUIAppEnum.h:135
@ MID_GNE_MODESMENUTITLE
selector for ModesMenuTitle
@ MID_FEEDBACK
feedback button
Definition GUIAppEnum.h:661
@ MID_HOTKEY_CTRL_H_APPSETTINGS_OPENEDGETYPES
open app setting dialog in SUMO and open edge type files in netedit
Definition GUIAppEnum.h:97
@ MID_HOTKEY_BACKSPACE
hot key <Backspace> remove last sub-operation
Definition GUIAppEnum.h:290
@ MID_HOTKEY_CTRL_SHIFT_S_SAVESUMOCONFIG
save SUMOConfig (SUMO AND netedit)
Definition GUIAppEnum.h:222
@ MID_HOTKEY_ALT_7_TOGGLEEDITOPTION
toggle edit option
Definition GUIAppEnum.h:157
@ MID_HOTKEY_F12_ABOUT
open about dialog
Definition GUIAppEnum.h:254
@ MID_HOTKEY_CTRL_E_EDITSELECTION_LOADNETEDITCONFIG
Edit selection in SUMO and load neteditConfig in netedit.
Definition GUIAppEnum.h:91
@ MID_HOTKEY_ENTER
hot key <ENTER> accept current operation
Definition GUIAppEnum.h:288
@ MID_GNE_TOOLBARFILE_RELOAD_DATAELEMENTS
reload data elements
Definition GUIAppEnum.h:741
@ MID_HOTKEY_CTRL_SHIFT_K_SAVETLS
save TLS Programs
Definition GUIAppEnum.h:214
@ MID_HOTKEY_SHIFT_F1_TEMPLATE_SET
set template
Definition GUIAppEnum.h:262
@ MID_HOTKEY_SHIFT_T_LOCATETLS
Locate TLS - button.
Definition GUIAppEnum.h:190
@ MID_HOTKEY_M_MODE_MOVE_MEANDATA
hotkey for mode moving element AND mean data
Definition GUIAppEnum.h:59
@ MID_HOTKEY_F2_SUPERMODE_NETWORK
select network supermode in netedit
Definition GUIAppEnum.h:232
@ MID_GNE_DEMANDVIEWOPTIONS_LOCKCONTAINER
lock container
Definition GUIAppEnum.h:885
@ MID_HOTKEY_SHIFT_F12_FOCUSUPPERELEMENT
focus upper element of current frame (only used in netedit)
Definition GUIAppEnum.h:274
@ MID_HOTKEY_CTRL_N_OPENNETWORK_NEWNETWORK
open network in SUMO and create new empty network in netedit
Definition GUIAppEnum.h:109
@ MID_HOTKEY_SHIFT_F3_TEMPLATE_CLEAR
clear template
Definition GUIAppEnum.h:266
@ MID_GNE_NETWORKVIEWOPTIONS_SELECTEDGES
select edges
Definition GUIAppEnum.h:825
@ MID_LANGUAGE_ZH
change language to chinese (simplified)
@ MID_GNE_SAVEJOINEDJUNCTIONS
save joined junctions
Definition GUIAppEnum.h:709
@ MID_GNE_DEMANDVIEWOPTIONS_SHOWTRIPS
show all trips
Definition GUIAppEnum.h:877
@ MID_GNE_NETWORKVIEWOPTIONS_TOGGLEGRID
show grid
Definition GUIAppEnum.h:817
@ MID_LANGUAGE_FR
change language to french
@ MID_GNE_TOOLBARFILE_SAVEJUPEDSIMELEMENTS_AS
save JuPedSim as
Definition GUIAppEnum.h:723
@ MID_HOTKEY_P_MODE_POLYGON_PERSON
hotkey for mode creating polygons
Definition GUIAppEnum.h:61
@ MID_HOTKEY_CTRL_L_SAVEASPLAINXML
save network as plain XML
Definition GUIAppEnum.h:105
@ MID_GNE_TOOLBAREDIT_COMPUTEPATHMANAGER
compute path manager
Definition GUIAppEnum.h:793
@ MID_WINDOW
Main window-ID.
Definition GUIAppEnum.h:298
GUICompleteSchemeStorage gSchemeStorage
#define GUIDesignButtonStatusBarFixed
button rectangular with thick and raise frame with a width of 100
Definition GUIDesigns.h:112
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
Definition GUIDesigns.h:346
#define GUIDesignLabelStatusBar
label used in statusBar
Definition GUIDesigns.h:288
#define GUIDesignSplitter
Definition GUIDesigns.h:477
#define GUIDesignSplitterMDI
MDI Splitter.
Definition GUIDesigns.h:480
#define GUIDesignStatusBar
design used in status bar
Definition GUIDesigns.h:449
@ MESSAGE_OCCURRED
send when a message occured
@ GLDEBUG_OCCURRED
send when a gldebug occured
@ ERROR_OCCURRED
send when a error occured
@ SIMULATION_LOADED
send when a simulation has been loaded
@ DEBUG_OCCURRED
send when a debug occured
@ WARNING_OCCURRED
send when a warning occured
GUISelectedStorage gSelected
A global holder of selected objects.
FXString gCurrentFolder
The folder used as last.
@ MODEMEANDATA
@ MODEADDITIONAL
@ SUPERMODEDEMAND
@ NETEDIT_MINI
@ VCLASS_SMALL_TAXI
@ MODECREATEEDGE
@ TOOL_TURNDEFS
@ SUPERMODENETWORK
@ SUPERMODEDATA
@ TOOL_CITYBRAIN
#define WRITE_DEBUG(msg)
Definition MsgHandler.h:306
#define WRITE_ERRORF(...)
Definition MsgHandler.h:305
#define WRITE_MESSAGE(msg)
Definition MsgHandler.h:297
#define WRITE_ERROR(msg)
Definition MsgHandler.h:304
#define TL(string)
Definition MsgHandler.h:315
#define TLF(string,...)
Definition MsgHandler.h:317
#define PROGRESS_FAILED_MESSAGE()
Definition MsgHandler.h:303
@ GNE_TAG_TRIP_JUNCTIONS
a trip between junctions
@ GNE_TAG_FLOW_JUNCTIONS
a flow between junctions
@ GNE_TAG_JPS_OBSTACLE
polygon used for draw juPedSim obstacles
@ GNE_TAG_JPS_WALKABLEAREA
polygon used for draw juPedSim walkable areas
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
bool parse()
parse
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
void setSelector(FXSelector sel)
set the selector
void setTarget(FXObject *tgt)
set the target
static bool isReadable(std::string path)
Checks whether the given file is readable.
static std::string getFilePath(const std::string &path)
Removes the file information from the given path.
static void resetFont()
to be called when the font context is invalidated
Definition GLHelper.cpp:671
The application's "About" - dialog.
Definition GNEAbout.h:33
void create()
Creates the widget.
Definition GNEAbout.cpp:86
The main window of Netedit.
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
long onCmdOpenNetgenerateDialog(FXObject *, FXSelector, void *)
called when user press "netgenerate" button
FXMenuPane * myFileMenuMeanDataElements
GNEApplicationWindowHelper::SupermodeCommands mySupermodeCommands
Supermode Commands.
long onCmdToggleUndoRedoLoading(FXObject *, FXSelector, void *)
called when toggle checkbox disable undo redo during loading (file)
FXMenuPane * myToolsImportCityBrainMenu
long onCmdSaveTLSProgramsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms as is executed
FXMenuTitle * myModesMenuTitle
menu title for modes
const std::string & isUndoRedoEnabledTemporally() const
check if undo-redo is enabled temporally
void create()
Creates the main window (required by FOX)
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + J to toggle draw junction shape
GNEApplicationWindowHelper::WindowsMenuCommands myWindowsMenuCommands
Windows Menu Commands.
GNELoadThread * myLoadThread
the thread that loads the network
void enableUndoRedoTemporally()
enable undo-redo temporally (for example, after creating an edge)
void clearUndoList()
clear undo list
GNENet * myNet
we are responsible for the net
long onCmdSaveEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall save edge types is executed
long onCmdOpenUndoListDialog(FXObject *, FXSelector, void *)
long onCmdReloadSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload SumoConfig is executed
void handleEvent_Message(GUIEvent *e)
handle event of type message
void setInputInSumoOptions(const bool ignoreAdditionals, const bool ignoreRoutes)
set input files in sumo options
long onCmdReloadDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload data elements is executed
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort
long onCmdLoadAdditionalsInSUMOGUI(FXObject *, FXSelector, void *)
called when user toggle windows checkbox "load additionals"
long onCmdOpenTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall open TLS programs is executed
bool continueWithUnsavedChanges()
warns about unsaved changes and gives the user the option to abort
long onUpdComputePathManager(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall compute path manager is executed
void updateControls()
update control contents after undo/redo or recompute
GNEApplicationWindowHelper::LockMenuCommands myLockMenuCommands
Lock Menu Commands.
long computeJunctionWithVolatileOptions()
called if the user selects Processing->compute junctions with volatile options
long onCmdFeedback(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->feedback
long onCmdNewNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall new network is executed
long onCmdSavePlainXMLAs(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
long onCmdOpenOptionsDialog(FXObject *, FXSelector, void *)
called when user press "options" button
GNEApplicationWindowHelper::HelpMenuCommands myHelpMenuCommands
Help Menu Commands.
GNEApplicationWindow()
FOX needs this for static members.
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
long onCmdToggleUndoRedo(FXObject *, FXSelector, void *)
called when toggle checkbox disable undo redo (processing)
long onCmdSaveNeteditConfigAs(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config as is executed
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
std::string myUndoRedoListEnabled
string to check if undo/redo list is enabled (a String is used to keep the disabling reason)
long onUpdSaveEdgeTypesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save edgeTypes as is updated
std::map< std::string, FXMenuPane * > myMenuPaneToolMaps
map with menu pane tools and strings
long onCmdSaveSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig is executed
long onUpdReloadDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload data elements is updated
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
long onCmdToggleViewOption(FXObject *, FXSelector, void *)
toggle viewOption
FXEX::MFXThreadEvent myLoadThreadEvent
io-event with the load-thread
OptionsCont myOriginalNetgenerateOptions
original netgenerate options container
long onCmdToggleEditOptions(FXObject *, FXSelector, void *)
called if the user press key combination Alt + <0-9>
GNEApplicationWindowHelper::MenuBarFile myMenuBarFile
MenuBarFile.
OptionsCont myOriginalNeteditOptions
original netedit options container
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
long onUpdRedo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall redo is executed
GNEApplicationWindowHelper::ModesMenuCommands & getModesMenuCommands()
get modes Menu Commands (needed for show/hide menu commands)
long onCmdToggleTimeFormat(FXObject *sender, FXSelector sel, void *ptr)
called if the user press the toggle time format button
long onCmdRunNetgenerate(FXObject *sender, FXSelector sel, void *ptr)
called when run netgenerate is called
GNEApplicationWindowHelper::ProcessingMenuCommands myProcessingMenuCommands
Processing Menu Commands.
OptionsCont & getSumoOptions()
get SUMO options container
long onUpdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals as is executed
GNEApplicationWindowHelper::EditMenuCommands & getEditMenuCommands()
get Edit Menu Commands (needed for show/hide menu commands)
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
GNEUndoList * myUndoList
the one and only undo list
FXMenuPane * myToolsVisualizationMenu
long onUpdSaveDataElements(FXObject *, FXSelector, void *)
called when the update/FXCall save data elements is executed
long onCmdSmartReload(FXObject *, FXSelector, void *)
called when the command/FXCall smart reload is executed
long onCmdPaste(FXObject *, FXSelector, void *)
long onUpdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements as is executed
long onUpdPythonTool(FXObject *, FXSelector, void *)
called when the command/FXCall python tool is updated
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
void closeAllWindows()
this method closes all windows and deletes the current simulation *‍/
long onCmdComputePathManager(FXObject *, FXSelector, void *)
long onCmdToggleComputeNetworkData(FXObject *, FXSelector, void *)
called when toggle checkbox compute network when switching between supermodes
long onCmdCopyTemplate(FXObject *, FXSelector, void *)
long onUpdReloadMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall reload meanDatas is updated
FXString getFolder(const std::string &folder) const
extract folder
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
long onUpdRequireRecomputing(FXObject *sender, FXSelector sel, void *ptr)
update label for require recomputing
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
long onCmdReloadDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload demand elements is executed
long onUpdSaveDemandElements(FXObject *, FXSelector, void *)
called when the update/FXCall save demand elements is executed
OptionsCont myOriginalSumoOptions
original sumo options container
OptionsCont myNetgenerateOptions
netgenerate options container
long onUpdReloadAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall reload additionals is updated
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don't need it)
long onCmdReloadEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall reload edge types is executed
long onCmdLockAllElements(FXObject *, FXSelector sel, void *)
called when user press lock all elements button
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
long onCmdSaveEdgeTypesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save edgeTypes as is executed
long onCmdClearSelectionShortcut(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits key combination for clear selection
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
long onCmdLockElements(FXObject *, FXSelector sel, void *)
called when user press a lock menu check
MFXButtonTooltip * myRequireRecomputingButton
Button used for show if recomputing is needed.
long onCmdClearTemplate(FXObject *, FXSelector, void *)
MFXSynchQue< GUIEvent * > myEvents
List of got requests.
GNEUndoList * getUndoList()
get pointer to undoList
long onUpdSaveNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config is updated
long onUpdNeedsFrontElement(FXObject *, FXSelector, void *)
called when the update/FXCall needs front element is executed
long onCmdProcessButton(FXObject *, FXSelector sel, void *)
called when user press a process button (or a shortcut)
FXMenuTitle * myLockMenuTitle
menu title for lock
void loadOptionOnStartup()
load net on startup
GNEViewNet * getViewNet()
get pointer to viewNet
long onUpdSaveMeanDatasAs(FXObject *, FXSelector, void *)
called when the update/FXCall save meanDatas as is executed
long onCmdOpenSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open SumoConfig is executed
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
GNEUndoListDialog * getUndoListDialog()
get pointer to undoList dialog
GNEApplicationWindowHelper::LocateMenuCommands myLocateMenuCommands
Locate Menu Commands.
long onCmdUndo(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
long onUpdReloadEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall reload edge types is updated
void disableUndoRedoTemporally(const std::string &reason)
disable undo-redo temporally giving a string with the reason (for example, if we're creating an edge)
long onCmdToggleGrid(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + G to toggle grid
void loadDataElements()
load data elements
void dependentBuild()
build dependent
long onUpdSaveDataElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save data elements as is executed
FXMenuPane * myFileMenuDemandElements
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
long onUpdReloadTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall reload TLS programs is updated
long onCmdOpenSumoOptionsDialog(FXObject *, FXSelector, void *)
called when user press "sumo options" button
GNEApplicationWindowHelper::EditMenuCommands myEditMenuCommands
Edit Menu Commands.
long onCmdSetSuperMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-supermode hotkey
long onUpdSaveSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig is updated
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
void loadDemandElements()
load demand elements
void loadAdditionalElements()
load additional elements
GNEViewNet * myViewNet
pointer to current view net
long onCmdReloadAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall reload additionals is executed
long onUpdOpenUndoListDialog(FXObject *, FXSelector, void *)
long onUpdNeedsNetworkElement(FXObject *, FXSelector, void *)
called when the update/FXCall needs at least one network element is executed
const FXString myTitlePrefix
the prefix for the window title
long onCmdSaveMeanDatasAs(FXObject *, FXSelector, void *)
called when the command/FXCall save meanDatas as is executed
long onCmdSaveNetworkAs(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
double getTrackerInterval() const
get current tracker interval (pure virtual but we don't need it)
void fillMenuBar()
Builds the menu bar.
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits key combination for focus on frame
void loadConfiguration(const std::string &configurationFile)
starts to load a configuration
GNEApplicationWindowHelper::LockMenuCommands & getLockMenuCommands()
get lock Menu Commands
long onCmdOpenMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall open meanDatas is executed
long onCmdPostprocessingNetgenerate(FXObject *sender, FXSelector sel, void *ptr)
postprocessing netgenerate
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
long onCmdSaveNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall save netedit config is executed
long onUpdRequireViewNet(FXObject *sender, FXSelector sel, void *ptr)
enable or disable sender object depending if viewNet exist
bool continueWithUnsavedDemandElementChanges()
warns about unsaved changes in demand elements and gives the user the option to abort
long onUpdReloadNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload netedit config is updated
OptionsCont & getNetgenerateOptions()
get netgenerate options container
long onCmdSaveDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements is executed
bool continueWithUnsavedDataElementChanges()
warns about unsaved changes in data elements and gives the user the option to abort
long onCmdCut(FXObject *, FXSelector, void *)
called when user press Ctrl+Z
long onCmdNewWindow(FXObject *, FXSelector, void *)
long onCmdSaveJoinedJunctionsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
long onCmdOpenEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall open edgeType is executed
long onCmdSaveJuPedSimElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save JuPedSim elements as is executed
long onCmdLoadDemandInSUMOGUI(FXObject *, FXSelector, void *)
called when user toggle windows checkbox "load demand"
long onUpdLockMenuTitle(FXObject *, FXSelector sel, void *)
enable or disable lock menu title
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out
long onUpdSaveAdditionals(FXObject *, FXSelector, void *)
called when the update/FXCall save additionals is executed
long onCmdSaveDemandElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save demand elements as is executed
long onCmdReloadTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall reload TLS programs is executed
long onCmdSaveDataElementsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save data elements as is executed
GNEApplicationWindowHelper::FileMenuCommands myFileMenuCommands
File Menu Commands.
void loadMeanDataElements()
load meanData elements
void loadOSM(const std::string &OSMFile)
starts to load a OSM File
long onCmdOpenNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open netedit config is executed
bool myAllowUndoRedoLoading
allow undo-redo loading (read from registry)
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
bool myAllowUndoRedo
allow undo-redo (read from registry)
long onCmdChangelog(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Changelog
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
bool myHadDependentBuild
check if had dependent build
long onCmdBackspace(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits backspace
void updateRecomputingLabel()
update recomputing label
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
long onCmdCopy(FXObject *, FXSelector, void *)
long onCmdSaveMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall save meanDatas is executed
long onCmdReloadMeanDatas(FXObject *, FXSelector, void *)
called when the command/FXCall reload meanDatas is executed
long onCmdOpenSUMOGUI(FXObject *sender, FXSelector sel, void *ptr)
called if the user hints ctrl + T
long onCmdOpenDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall open demand is executed
void loadNetwork(const std::string &networkFile)
load network
long onUpdToggleViewOption(FXObject *, FXSelector, void *)
update viewOption
GNEApplicationWindowHelper::ToolsMenuCommands myToolsMenuCommands
Tools Menu Commands.
long onCmdUnlockAllElements(FXObject *, FXSelector sel, void *)
called when user press unlock all elements button
long onUpdReloadSumoConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload SumoConfig is updated
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall needs network is executed
GNEApplicationWindowHelper::ToolbarsGrip & getToolbarsGrip()
get ToolbarsGrip
long onUpdSaveJuPedSimElementsAs(FXObject *, FXSelector, void *)
called when the update/FXCall save juPedSim as is executed
long onUpdReloadNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall network reload is executed
OptionsCont mySumoOptions
sumo options container
bool consoleOptionsLoaded()
check if console options was already loaded
long onCmdSaveDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall save data elements is executed
long onCmdOpenPythonToolDialog(FXObject *obj, FXSelector, void *)
called when user press over a tool dialog button
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
long onCmdHotkeys(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Hotkeys
long onCmdOpenDataElements(FXObject *, FXSelector, void *)
called when the command/FXCall open data is executed
long onCmdRunPythonTool(FXObject *obj, FXSelector, void *)
called when user run a tool
void updateSuperModeMenuCommands(const Supermode supermode)
update FXMenuCommands depending of supermode
FXMenuPane * myFileMenuRecentNetworks
bool myConsoleOptionsLoaded
flag for check if console options was already loaded
long onCmdSetFrontElement(FXObject *, FXSelector, void *)
called if the user call set front element
GNEUndoListDialog * myUndoListDialog
undoList dialog
long onUpdReloadDemandElements(FXObject *, FXSelector, void *)
called when the command/FXCall reload demand elements is updated
void createNewNetwork()
create new network
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
FXCursor * getDefaultCursor()
get default cursor
long onCmdSetTemplate(FXObject *, FXSelector, void *)
GNEApplicationWindowHelper::FileMenuCommands & getFileMenuCommands()
get file Menu Commands (needed for show/hide menu commands)
long onUpdSaveMeanDatas(FXObject *, FXSelector, void *)
called when the update/FXCall save meanDatas is executed
long onCmdTutorial(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Tutorial
long onCmdRedo(FXObject *, FXSelector, void *)
long onCmdOpenNetgenerateOptionsDialog(FXObject *, FXSelector, void *)
called when user press "netgenerate options" button
bool continueWithUnsavedMeanDataElementChanges()
warns about unsaved changes in meanData elements and gives the user the option to abort
long onUpdUndo(FXObject *obj, FXSelector sel, void *ptr)
called when the update/FXCall undo is executed
const GNEApplicationWindowHelper::ProcessingMenuCommands & getProcessingMenuCommands() const
get processing Menu Commands
long onCmdPostProcessingPythonTool(FXObject *obj, FXSelector, void *)
post processing after run tool
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
long onCmdReloadNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall network reload is executed
long onUpdSmartReload(FXObject *, FXSelector, void *)
called when the update/FXCall smart reload is executed
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
long onCmdLockSelectElements(FXObject *, FXSelector sel, void *)
called when user press lock select elements button
long onCmdOpenNetconvertConfig(FXObject *, FXSelector, void *)
called when the command/FXCall open netconvertconfiguration is executed
long onCmdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is executed
long onUpdSaveEdgeTypes(FXObject *, FXSelector, void *)
called when the command/FXCall save edge types is updated
long onCmdReloadNeteditConfig(FXObject *, FXSelector, void *)
called when the command/FXCall reload netedit config is executed
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
FXMenuPane * myFileMenu
the submenus
GNEApplicationWindowHelper::ToolbarsGrip myToolbarsGrip
Toolbars Grip.
long onUpdToggleTimeFormat(FXObject *sender, FXSelector sel, void *ptr)
update toggle time format button
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
GNEApplicationWindowHelper::ModesMenuCommands myModesMenuCommands
Modes Menu Commands.
long onUpdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is updated
FXGLCanvas * getBuildGLCanvas() const
get build GL Canvas (must be implemented in all children)
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onCmdSaveSumoConfigAs(FXObject *, FXSelector, void *)
called when the command/FXCall save SumoConfig as is executed
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
void refreshAttributesCreator()
refresh attribute creator
GNEAttributesCreator * getContainerAttributes() const
get attributes creator
void refreshEdgeTypeSelector()
refresh edge type selector
EdgeTypeSelector * getEdgeTypeSelector() const
get edgeType selector
void addLaneType(GNELaneType *laneType)
add laneType
GNENet * net
the loaded net
const bool viewportFromRegistry
whether loading viewport from registry
const std::string file
the name of the loaded file
const std::string settingsFile
the name of the settings file to load
Dialog fix network elements.
virtual void updateFrameAfterUndoRedo()
function called after undo/redo in the current frame (can be reimplemented in frame children)
Definition GNEFrame.cpp:252
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
bool isSelectingParent() const
check if we're selecting a new parent
void refreshNeteditAttributesEditor(bool forceRefresh)
refresh netedit attributes
void clearTemplate()
clear template (used by shortcut)
void setTemplate()
set template (used by shortcut)
void copyTemplate()
copy template (used by shortcut)
void inspectSingleElement(GNEAttributeCarrier *AC)
Inspect a single element.
TemplateEditor * getTemplateEditor() const
get template editor
GNEInspectorFrame::NeteditAttributesEditor * getNeteditAttributesEditor() const
get Netedit Attributes editor
void refreshInspection()
refresh current inspection
void newNetwork()
begins the creation of an empty network
static void fillOptions(OptionsCont &neteditOptions)
clears and initializes the OptionsCont
void loadNetworkOrConfig()
begins the loading of an existent network or config
static void setDefaultOptions(OptionsCont &neteditOptions)
sets required options for proper functioning
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEDemandElement * > > & getDemandElements() const
get demand elements
const std::unordered_map< SumoXMLTag, std::unordered_map< const GUIGlObject *, GNEAdditional * > > & getAdditionals() const
get additionals
const std::unordered_map< const GUIGlObject *, GNECrossing * > & getCrossings() const
get crossings
int getNumberOfMeanDatas() const
get number of meanDatas
const std::map< const std::string, GNEEdge * > & getEdges() const
map with the ID and pointer to edges of net
const std::map< const std::string, GNEDataSet * > & getDataSets() const
get demand elements
int getNumberOfDemandElements() const
get number of current demand elements saved in AttributeCarriers (default vTypes are NOT included)
int getNumberOfAdditionals() const
get number of additionals
const std::map< const std::string, GNEJunction * > & getJunctions() const
get junctions
const std::map< const std::string, GNEEdgeType * > & getEdgeTypes() const
map with the ID and pointer to edgeTypes of net
void dataElementsSaved()
mark demand elements as saved
void demandElementsSaved()
mark demand elements as saved
void SumoConfigSaved()
mark SumoConfig as saved
void additionalsSaved()
mark additionals as saved
void requireSaveNeteditConfig()
inform that netedit config has to be saved
void requireSaveSumoConfig()
inform that SumoConfig has to be saved
bool isSumoConfigSaved() const
check if SumoConfig is saved
void neteditConfigSaved()
mark netedit config as saved
void requireSaveMeanDatas()
inform that mean data elements has to be saved
void meanDatasSaved()
mark mean data elements as saved
bool isDemandElementsSaved() const
check if demand elements are saved
void requireSaveAdditionals()
inform that additionals has to be saved
bool isDataElementsSaved() const
check if data elements are saved
bool isNetworkSaved() const
check if network is saved
bool isMeanDatasSaved() const
check if mean data elements are saved
void requireSaveDataElements()
inform that data elements has to be saved
bool isNeteditConfigSaved() const
check if netedit config is saved
void networkSaved()
mark network as saved
bool isAdditionalsSaved() const
check if additionals are saved
void requireSaveDemandElements()
inform that demand elements has to be saved
void clearAdditionalElements(GNEUndoList *undoList)
clear additionals
Definition GNENet.cpp:2096
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
Definition GNENet.cpp:1745
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
Definition GNENet.cpp:1565
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Definition GNENet.cpp:2741
void saveJoined(const std::string &filename)
save log of joined junctions (and nothing else)
Definition GNENet.cpp:1360
GNENetHelper::SavingStatus * getSavingStatus() const
get saving status
Definition GNENet.cpp:133
void enableUpdateData()
Definition GNENet.cpp:2808
void saveEdgeTypes(const std::string &filename)
save edgeTypes elements of the network
Definition GNENet.cpp:2762
void saveAdditionals()
save additional elements
Definition GNENet.cpp:2185
void clearDemandElements(GNEUndoList *undoList)
clear demand elements
Definition GNENet.cpp:2109
GNEPathManager * getDemandPathManager()
get demand path manager
Definition GNENet.cpp:145
void adjustPersonPlans(GNEUndoList *undoList)
adjust person plans
Definition GNENet.cpp:1851
void computeNetwork(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false)
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
Definition GNENet.cpp:1406
void cleanInvalidDemandElements(GNEUndoList *undoList)
clean invalid demand elements
Definition GNENet.cpp:1896
void cleanUnusedRoutes(GNEUndoList *undoList)
clean unused routes
Definition GNENet.cpp:1761
GNENetHelper::AttributeCarriers * getAttributeCarriers() const
get all attribute carriers used in this net
Definition GNENet.cpp:127
void saveDemandElements()
save demand element elements of the network
Definition GNENet.cpp:2238
void clearMeanDataElements(GNEUndoList *undoList)
clear meanDatas
Definition GNENet.cpp:2133
void disableUpdateData()
disable update data elements after inserting or removing an element in net
Definition GNENet.cpp:2819
void saveDataElements()
save data set elements of the network
Definition GNENet.cpp:2278
void saveJuPedSimElements(const std::string &file)
save JuPedSim elements
Definition GNENet.cpp:2224
void saveNetwork()
save the network
Definition GNENet.cpp:1317
bool isNetRecomputed() const
check if net require recomputing
Definition GNENet.cpp:1547
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
Definition GNENet.cpp:1692
void joinRoutes(GNEUndoList *undoList)
join routes
Definition GNENet.cpp:1787
void savePlain(const std::string &prefix)
save plain xml representation of the network (and nothing else)
Definition GNENet.cpp:1351
GNEViewNet * getViewNet() const
get view net
Definition GNENet.cpp:2155
void saveMeanDatas()
save meanData elements of the network
Definition GNENet.cpp:2323
void computeDemandElements(GNEApplicationWindow *window)
compute demand elements param[in] window The window to inform about delay
Definition GNENet.cpp:1490
static std::pair< int, bool > Run(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for run dialogs.
static std::pair< int, bool > Options(GNEApplicationWindow *GNEApp, GUIIcon icon, OptionsCont &optionsContainer, const OptionsCont &originalOptionsContainer, const char *titleName)
Constructor for options dialogs.
void updatePathCalculator()
update DijkstraRouter (needed a good calculation of dijkstra path after modifying network)
bool isPathCalculatorUpdated() const
check if pathCalculator is updated
PathCalculator * getPathCalculator()
obtain instance of PathCalculator
GNEAttributesCreator * getPersonAttributes() const
get attributes creator
void loadFromFile(const std::string &file) const
load from file
void clearCurrentSelection() const
clear current selection with possibility of undo/redo
GNESelectorFrame::SelectionOperation * getSelectionOperationModul() const
get selection operation modul
bool isChangesPending() const
return true if there is changes to save
const std::vector< CurrentTAZ::TAZEdgeColor > & getEdgeAndTAZChildrenSelected() const
get map with edge and TAZChildren
void clearSelectedEdges()
clear current TAZ children
TAZSelectionStatistics * getTAZSelectionStatisticsModule() const
get TAZ Selection Statistics modul
TAZSaveChanges * getTAZSaveChangesModule() const
get TAZ Save Changes modul
bool parseTLSPrograms(const std::string &file)
parse TLS Programs from a file
Dialog for edit rerouters.
void show()
show window
bool shown() const
check if dialog is shown
void setFocus()
Move the focus to this window.
void hide()
hide window
void end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise,...
void undo()
undo the last command group
long onUpdUndo(FXObject *, FXSelector, void *)
event after Undo
void begin(GUIIcon icon, const std::string &description)
Begin undo command sub-group with current supermode. This begins a new group of commands that are tre...
void abortAllChangeGroups()
reverts and discards ALL active chained change groups
Supermode getRedoSupermode() const
get redo supermode
long onUpdRedo(FXObject *, FXSelector, void *)
event after Redo
Supermode getUndoSupermode() const
get undo supermode
void redo()
redo the last command group
void add(GNEChange *command, bool doit=false, bool merge=true)
Add new command, executing it if desired. The new command will be merged with the previous command if...
GNEAttributesCreator * getVehicleAttributes() const
get attributes creator
GNEAttributeCarrier * getFirstAC() const
long onCmdToggleShowDemandElementsNetwork(FXObject *, FXSelector, void *)
toggle show demand elements (network)
const GNEViewNetHelper::DataViewOptions & getDataViewOptions() const
get data view options
GNENet * getNet() const
get the net object
const GNEAttributeCarrier * getFrontAttributeCarrier() const
get front attributeCarrier
void hotkeyBackSpace()
handle backspace keypress
const GNEViewNetHelper::EditModes & getEditModes() const
get edit modes
void setFrontAttributeCarrier(GNEAttributeCarrier *AC)
set front attributeCarrier
long onCmdToggleShowDemandElementsData(FXObject *, FXSelector, void *)
toggle show demand elements (data)
void abortOperation(bool clearSelection=true)
abort current edition operation
GNEViewNetHelper::InspectedElements & getInspectedElements()
get inspected elements
long onCmdToggleWarnAboutMerge(FXObject *, FXSelector, void *)
toggle warn for merge
long onCmdToggleDrawSpreadVehicles(FXObject *, FXSelector, void *)
toggle draw vehicles in begin position or spread in lane
long onCmdToggleShowConnections(FXObject *, FXSelector, void *)
toggle show connections
long onCmdToggleShowTAZElements(FXObject *, FXSelector, void *)
toggle show TAZ elements
long onCmdToggleMoveElevation(FXObject *, FXSelector, void *)
toggle move elevation
long onCmdToggleShowAllPersonPlans(FXObject *, FXSelector, void *)
toggle show all person plans in super mode demand
long onCmdToggleTAZRelOnlyTo(FXObject *, FXSelector, void *)
toggle TAZRez only to
const GNEViewNetHelper::NetworkViewOptions & getNetworkViewOptions() const
get network view options
void hotkeyFocusFrame()
handle focus frame keypress
long onCmdToggleChainEdges(FXObject *, FXSelector, void *)
toggle chain edges
long onCmdToggleLockContainer(FXObject *, FXSelector, void *)
toggle lock container in super mode demand
long onCmdToggleShowGrid(FXObject *, FXSelector, void *)
toggle show grid
long onCmdToggleHideNonInspecteDemandElements(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
GNEViewParent * getViewParent() const
get the net object
long onCmdToggleDrawJunctionShape(FXObject *, FXSelector, void *)
toggle draw junction shape
long onCmdToggleShowShapes(FXObject *, FXSelector, void *)
toggle show shapes in super mode data
GNEViewNetHelper::SaveElements & getSaveElements()
get variable used to save elements
GNEUndoList * getUndoList() const
get the undoList object
void saveVisualizationSettings() const
long onCmdSetSupermode(FXObject *, FXSelector sel, void *)
long onCmdToggleExtendSelection(FXObject *, FXSelector, void *)
toggle extend selection
bool aksChangeSupermode(const std::string &operation, Supermode expectedSupermode)
ask about change supermode
long onCmdSetMode(FXObject *, FXSelector sel, void *)
called when user press a mode button (Network or demand)
void hotkeyEnter()
handle enter keypress
long onCmdToggleShowOverlappedRoutes(FXObject *, FXSelector, void *)
toggle hide non inspected demand elements
long onCmdToggleAutoOppositeEdge(FXObject *, FXSelector, void *)
toggle autoOpposite edge
GNEViewNetHelper::LockManager & getLockManager()
get lock manager
void updateControls()
update control contents after undo/redo or recompute
void hotkeyDel()
handle del keypress
long onCmdToggleChangeAllPhases(FXObject *, FXSelector, void *)
toggle change all phases
long onCmdToggleTAZRelDrawing(FXObject *, FXSelector, void *)
toggle TAZRel drawing
long onCmdToggleShowJunctionBubbles(FXObject *, FXSelector, void *)
toggle show junction bubbles
long onCmdToggleShowAdditionalSubElements(FXObject *, FXSelector, void *)
toggle show additional sub-elements
long onCmdToggleShowAllContainerPlans(FXObject *, FXSelector, void *)
toggle show all container plans in super mode demand
long onCmdToggleTAZRelOnlyFrom(FXObject *, FXSelector, void *)
toggle TAZRez only from
long onCmdToggleShowAdditionals(FXObject *, FXSelector, void *)
toggle show additionals in super mode data
long onCmdToggleLockPerson(FXObject *, FXSelector, void *)
toggle lock person in super mode demand
GNEViewNetHelper::TimeFormat & getTimeFormat()
get variable used to switch between time formats
long onCmdToggleSelectEdges(FXObject *, FXSelector, void *)
toggle select edges
long onCmdToggleShowTrips(FXObject *, FXSelector, void *)
toggle show all trips in super mode demand
long onCmdToggleHideShapes(FXObject *, FXSelector, void *)
toggle hide shapes in super mode demand
const GNEViewNetHelper::DemandViewOptions & getDemandViewOptions() const
get demand view options
long onCmdToggleHideConnections(FXObject *, FXSelector, void *)
toggle hide connections
void forceSupemodeNetwork()
force supermode network(used after load/create new network)
A single child window which contains a view of the simulation area.
void updateUndoRedoButtons()
update toolbar undo/redo buttons (called when user press Ctrl+Z/Y)
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
GNESelectorFrame * getSelectorFrame() const
get frame for select elements
GNEVehicleFrame * getVehicleFrame() const
get frame for DEMAND_VEHICLE
GNETAZFrame * getTAZFrame() const
get frame for NETWORK_TAZ
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for NETWORK_TLS
GNEApplicationWindow * getGNEAppWindows() const
get GNE Application Windows
GNEContainerFrame * getContainerFrame() const
get frame for DEMAND_CONTAINER
GNEPersonFrame * getPersonFrame() const
get frame for DEMAND_PERSON
GNEInspectorFrame * getInspectorFrame() const
get frame for inspect elements
GNECreateEdgeFrame * getCreateEdgeFrame() const
get frame for NETWORK_CREATEEDGE
GNEFrame * getCurrentShownFrame() const
get current frame (note: it can be null)
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
void saveViewport(const double x, const double y, const double z, const double rot)
Makes the given viewport the default.
static void close()
close GUICursorSubSys
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
static FXMenuTitle * buildFXMenuTitle(FXComposite *p, const std::string &text, FXIcon *icon, FXMenuPane *menuPane)
build menu title
static FXMenuCommand * buildFXMenuCommandShortcut(FXComposite *p, const std::string &text, const std::string &shortcut, const std::string &info, FXIcon *icon, FXObject *tgt, FXSelector sel)
build menu command
The application's "Feedback" dialog.
void create()
Creates the widget.
Editor for the list of chosen objects.
const std::string & getMsg() const
Returns the message.
GUIEventType getOwnType() const
returns the event type
Definition GUIEvent.h:89
GUISUMOAbstractView * getView() const
return GUISUMOAbstractView
static FXIcon * getIcon(const GUIIcon which)
returns a icon previously defined in the enum GUIIcon
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
static void close()
close GUIIconSubSys
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call
std::vector< FXMainWindow * > myTrackerWindows
list of tracker windows
FXMenuPane * myLanguageMenu
Language menu common to all applications.
FXLabel * myCartesianCoordinate
Labels for the current cartesian, geo-coordinate and test coordinates.
std::map< std::string, std::string > myOnlineMaps
online mapping services for the context menu
MFXStaticToolTip * myStaticTooltipMenu
static toolTip used in menus
FXMDIClient * myMDIClient
The multi view panel.
void buildLanguageMenu(FXMenuBar *menuBar)
long onCmdChangeLanguage(FXObject *, FXSelector, void *)
FXHorizontalFrame * myGeoFrame
FXHorizontalFrame * myTestFrame
FXHorizontalFrame * myCartesianFrame
FXLabel * myTestCoordinate
FXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
void storeWindowSizeAndPos()
record window position and size in registry
FXLabel * myGeoCoordinate
FXStatusBar * myStatusbar
The status bar.
FXGLVisual * myGLVisual
The gl-visual used.
std::vector< GUIGlChildWindow * > myGLWindows
list of GLWindows
long onUpdChangeLanguage(FXObject *, FXSelector, void *)
A logging window for the gui.
void addSeparator()
Adds a a separator to this log window.
void unregisterMsgHandlers()
unregister message handlers
void clear()
Clears the window.
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
void registerMsgHandlers()
register message handlers
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
void addDecals(const std::vector< Decal > &decals)
add decals
void showViewschemeEditor()
show viewsscheme editor
virtual void showViewportEditor()
show viewport editor
const GUIVisualizationSettings & getVisualisationSettings() const
get visualization settings (read only)
GUIPerspectiveChanger & getChanger() const
get changer
std::vector< Decal > & getDecals()
The list of decals to show.
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
void destroyPopup()
destroys the popup
static FXuint question(FXApp *app, const char *caption, const char *message,...)
Show modal question message, in free floating window.
An XML-handler for visualisation schemes.
const std::vector< std::string > & addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
static void buildAccelerators(FXAccelTable *accelTable, FXObject *target, const bool sumogui)
build accelerators
static void close()
close GUITextureSubSys
static void resetTextures()
Reset textures.
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
static std::string clipped
Definition GUIUserIO.h:58
bool drawJunctionShape
whether the shape of the junction should be drawn
bool showGrid
Information whether a grid shall be shown.
bool parse()
parse
static void resetLoaded()
resets loaded location elements
bool amChecked() const
check if this MFXCheckableButton is checked
FXbool getCheck() const
Get check state (TRUE, FALSE or MAYBE)
void setCheck(FXbool s=TRUE)
Set check state (TRUE, FALSE or MAYBE)
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependence to an optional file name.
Definition MFXUtils.cpp:60
static bool checkOptions(OptionsCont &oc)
Checks set options from the OptionsCont-singleton for being valid.
Definition NBFrame.cpp:744
A storage for available edgeTypes of edges.
Definition NBTypeCont.h:52
int size() const
Returns the number of known edgeTypes.
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
Definition NIFrame.cpp:391
static bool load(SUMOSAXHandler &handler, const std::vector< std::string > &files, const std::string &type, const bool stringParse=false)
Importer for edge type information stored in XML.
static bool checkOptions(OptionsCont &oc)
Checks set options for being valid.
Definition NWFrame.cpp:139
A storage for options typed value containers)
Definition OptionsCont.h:89
void resetDefault()
Resets all options to default.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool set(const std::string &name, const std::string &value, const bool append=false)
Sets the given value for the named option.
void writeConfiguration(std::ostream &os, const bool filled, const bool complete, const bool addComments, const std::string &relativeTo="", const bool forceRelative=false, const bool inComment=false) const
Writes the configuration.
std::string getValueString(const std::string &name) const
Returns the string-value of the named option (all options)
void resetWritable()
Resets all options to be writeable.
static OptionsCont & getOptions()
Retrieves the options.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
void set(double x, double y)
set positions x and y
Definition Position.h:85
double x() const
Returns the x-position.
Definition Position.h:55
double y() const
Returns the y-position.
Definition Position.h:60
static std::string replace(std::string str, const std::string &what, const std::string &by)
Replaces all occurrences of the second string by the third string within the first string.
static std::string transcodeToLocal(const std::string &utf8String)
convert a string from UTF-8 to the local codepage
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
Definition SysUtils.cpp:69
static bool checkOptions(OptionsCont &oc)
checks shared options and sets StdDefs
static void parseTemplate(OptionsCont &options, const std::string &templateString)
run parser
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme, const std::string &routeValidationScheme)
Enables or disables validation.
Definition XMLSubSys.cpp:83
@ SEL_THREAD_EVENT
Definition fxexdefs.h:173
@ SEL_THREAD
Definition fxexdefs.h:155
Definition json.hpp:4471
DemandViewOptions demandViewOptions
demand view options
NetworkViewOptions networkViewOptions
network view options
void buildUndoRedoMenuCommands(FXMenuPane *editMenu)
build undo-redo menu commands
void buildViewMenuCommands(FXMenuPane *editMenu)
build view menu commands
FXMenuCheck * loadAdditionalsInSUMOGUI
menu check for load additionals in SUMO GUI
FXMenuCommand * undoLastChange
FXMenuCommand for undo last change.
FXMenuCheck * loadDemandInSUMOGUI
menu check for load demand in SUMO GUI
MFXMenuCheckIcon * menuCheckAllowUndoRedo
checkBox for allow undo-redo
FXMenuCommand * redoLastChange
FXMenuCommand for redo last change.
void buildOpenSUMOMenuCommands(FXMenuPane *editMenu)
build open sumo menu commands
void buildFrontElementMenuCommand(FXMenuPane *editMenu)
build front element commands
MFXMenuCheckIcon * menuCheckAllowUndoRedoLoading
checkBox for allow undo-redo loading
void buildFileMenuCommands(FXMenuPane *fileMenu, FXMenuPane *fileMenuNEEDITConfig, FXMenuPane *fileMenuSumoConfig, FXMenuPane *fileMenuTLS, FXMenuPane *fileMenuEdgeTypes, FXMenuPane *fileMenuAdditionals, FXMenuPane *fileMenuDemandElements, FXMenuPane *fileMenuDataElements, FXMenuPane *fileMenuMeanDataElements)
build menu commands
void buildHelpMenuCommands(FXMenuPane *helpMenu)
build menu commands
void buildLocateMenuCommands(FXMenuPane *locateMenu)
build menu commands
void buildLockMenuCommands(FXMenuPane *editMenu)
build menu commands
void hideNetworkLockMenuCommands()
show network processing menu commands
void hideDemandLockMenuCommands()
show demand processing menu commands
void hideDataLockMenuCommands()
show data processing menu commands
void showDataLockMenuCommands()
show data processing menu commands
void showNetworkLockMenuCommands()
show network processing menu commands
void showDemandLockMenuCommands()
show demand processing menu commands
void buildRecentConfigFiles(FXMenuPane *fileMenu, FXMenuPane *fileMenuRecentConfigFiles)
build recent config
MFXRecentNetworks myRecentConfigs
List of recent configs.
MFXRecentNetworks myRecentNetworks
List of recent networks.
void buildRecentNetworkFiles(FXMenuPane *fileMenu, FXMenuPane *fileMenuRecentNetworkFiles)
build recent network
void buildModesMenuCommands(FXMenuPane *modesMenu)
build modes menu commands
DemandMenuCommands demandMenuCommands
Demand Menu Commands.
void setDefaultView(Supermode supermode)
set default view
void setJuPedSimView(Supermode supermode)
set JuPedSim view
NetworkMenuCommands networkMenuCommands
Network Menu Commands.
void showDataProcessingMenuCommands()
show data processing menu commands
MFXMenuCheckIcon * menuCheckRecomputeDataMode
checkBox for recomputing when changing data mode
void showDemandProcessingMenuCommands()
show demand processing menu commands
void hideDemandProcessingMenuCommands()
show demand processing menu commands
void hideDataProcessingMenuCommands()
show data processing menu commands
void buildProcessingMenuCommands(FXMenuPane *processingMenu)
build menu commands
void showNetworkProcessingMenuCommands()
show network processing menu commands
void hideNetworkProcessingMenuCommands()
show network processing menu commands
void buildSupermodeCommands(FXMenuPane *editMenu)
build menu commands
FXMenuBar * menu
The application menu bar (for file, edit, processing...)
long postProcessing(FXObject *menuCommand) const
run postprocessing
void buildTools(FXMenuPane *toolsMenu, const std::map< std::string, FXMenuPane * > &menuPaneToolMaps)
build tools (and menu commands)
long showTool(FXObject *menuCommand) const
show tool
long runNetgenerateDialog(const OptionsCont *netgenerateOptions) const
run netgenerate dialog
long runToolDialog(FXObject *menuCommand) const
run tool dialog
void buildWindowsMenuCommands(FXMenuPane *windowsMenu, FXStatusBar *statusbar, GUIMessageWindow *messageWindow)
build menu commands
static bool toggleEditOptionsData(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Data menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string openRouteFileDialog(FXWindow *window, bool save, bool multi=false)
open route file dialog
static std::string openMeanDataDialog(FXWindow *window, bool save, bool multi=false)
open meandata filename dialog
static std::string openAdditionalFileDialog(FXWindow *window, bool save, bool multi=false)
open additional dialog
static std::string openOSMFileDialog(FXWindow *window)
open OSM file dialog
static bool toggleEditOptionsDemand(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Demand menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string saveJoinedJunctionsFileDialog(FXWindow *window)
open joined junctions file dialog
static bool toggleEditOptionsNetwork(GNEViewNet *viewNet, const MFXCheckableButton *menuCheck, const int numericalKeyPressed, FXObject *obj, FXSelector sel)
toggle edit options Network menu commands (called in GNEApplicationWindow::onCmdToggleEditOptions)
static std::string openTLSFileDialog(FXWindow *window, bool save)
open TLS file dialog
static std::string openDataFileDialog(FXWindow *window, bool save, bool multi=false)
open data file dialog
static std::string openNeteditConfigFileDialog(FXWindow *window, bool save)
open netedit config file dialog
static std::string savePlainXMLFileDialog(FXWindow *window)
open plain xml file dialog
static std::string openSumoConfigFileDialog(FXWindow *window, bool save, bool multi=false)
open SUMO config file dialog
static std::string openEdgeTypeFileDialog(FXWindow *window, bool save)
open edgeType file dialog
static std::string openNetworkFileDialog(FXWindow *window, bool save, bool multi=false)
open netconvert file dialog
static std::string openNetconvertFileDialog(FXWindow *window)
open netconvert file dialog
MFXCheckableButton * menuCheckToggleTAZDrawFill
menu check to toggle TAZ draw fill
MFXCheckableButton * menuCheckShowAdditionals
menu check to show Additionals
MFXCheckableButton * menuCheckShowShapes
menu check to show Shapes
MFXCheckableButton * menuCheckToggleTAZRelOnlyFrom
menu check to toggle TAZRel only from
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
void getVisibleDataMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
MFXCheckableButton * menuCheckToggleTAZRelDrawing
menu check to toggle TAZ Rel drawing
MFXCheckableButton * menuCheckShowDemandElements
menu check to show Demand Elements
MFXCheckableButton * menuCheckToggleTAZRelOnlyTo
menu check to toggle TAZRel only to
MFXCheckableButton * menuCheckShowAllTrips
show all trips
MFXCheckableButton * menuCheckToggleGrid
menu check to show grid button
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckDrawSpreadVehicles
menu check to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowOverlappedRoutes
show overlapped routes
MFXCheckableButton * menuCheckShowAllPersonPlans
show all person plans
MFXCheckableButton * menuCheckShowAllContainerPlans
show all container plans
MFXCheckableButton * menuCheckHideNonInspectedDemandElements
Hide non inspected demand elements.
MFXCheckableButton * menuCheckHideShapes
Hide shapes (Polygons and POIs)
MFXCheckableButton * menuCheckLockPerson
Lock Person.
void getVisibleDemandMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible demand menu commands
MFXCheckableButton * menuCheckLockContainer
Lock Container.
DataEditMode dataEditMode
the current Data edit mode
bool isDefaultView() const
check if default view is enabled
DemandEditMode demandEditMode
the current Demand edit mode
Supermode currentSupermode
the current supermode
NetworkEditMode networkEditMode
the current Network edit mode
bool isCurrentSupermodeDemand() const
@check if current supermode is Demand
bool isCurrentSupermodeData() const
@check if current supermode is Data
bool isCurrentSupermodeNetwork() const
@check if current supermode is Network
bool isJuPedSimView() const
check if default view is enabled
MFXCheckableButton * menuCheckSelectEdges
checkable button to select only edges
MFXCheckableButton * menuCheckChainEdges
checkable button to the endpoint for a created edge should be set as the new source
MFXCheckableButton * menuCheckShowDemandElements
checkable button to show Demand Elements
MFXCheckableButton * menuCheckMoveElevation
checkable button to apply movement to elevation
MFXCheckableButton * menuCheckShowTAZElements
checkable button to show TAZ elements
void getVisibleNetworkMenuCommands(std::vector< MFXCheckableButton * > &commands) const
get visible network menu commands
MFXCheckableButton * menuCheckAutoOppositeEdge
check checkable to create auto create opposite edge
MFXCheckableButton * menuCheckDrawSpreadVehicles
checkable button to draw vehicles in begin position or spread in lane
MFXCheckableButton * menuCheckShowConnections
checkable button to show connections
MFXCheckableButton * menuCheckHideConnections
checkable button to hide connections in connect mode
MFXCheckableButton * menuCheckToggleDrawJunctionShape
checkable button to show junction shapes
MFXCheckableButton * menuCheckToggleGrid
checkable button to show grid button
MFXCheckableButton * menuCheckShowJunctionBubble
checkable button to show connection as bubble in "Move" mode.
MFXCheckableButton * menuCheckWarnAboutMerge
checkable button to we should warn about merging junctions
MFXCheckableButton * menuCheckShowAdditionalSubElements
checkable button to show additional sub-elements
MFXCheckableButton * menuCheckChangeAllPhases
checkable button to set change all phases
MFXCheckableButton * menuCheckExtendSelection
checkable button to extend to edge nodes
void setSaveIndividualFiles(bool value)
enable or disable save individual files
void switchTimeFormat()
switch time format
void updateButtonLabel()
update button label