195 FXIMPLEMENT(
GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
201 #pragma warning(push) 202 #pragma warning(disable: 4355) 206 myLoadThread(nullptr),
208 myRecentNets(a,
"nets"),
209 myConfigPattern(configPattern),
210 hadDependentBuild(false),
230 WRITE_ERROR(
"DEBUG: GNEApplicationWindow::dependentBuild called twice");
247 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)",
nullptr, LAYOUT_CENTER_Y);
303 getAccelTable()->addAccel(262223,
this, FXSEL(SEL_COMMAND,
MID_OPEN_NETWORK));
304 getAccelTable()->addAccel(327691,
this, FXSEL(SEL_COMMAND,
MID_OPEN_CONFIG));
305 getAccelTable()->addAccel(262226,
this, FXSEL(SEL_COMMAND,
MID_RELOAD));
310 getAccelTable()->addAccel(262224,
this, FXSEL(SEL_COMMAND,
MID_OPEN_SHAPES));
316 getAccelTable()->addAccel(262230,
this, FXSEL(SEL_COMMAND,
MID_CLOSE));
317 getAccelTable()->addAccel(262225,
this, FXSEL(SEL_COMMAND,
MID_QUIT));
318 getAccelTable()->addAccel(262234,
this, FXSEL(SEL_COMMAND, FXUndoList::ID_UNDO));
319 getAccelTable()->addAccel(262233,
this, FXSEL(SEL_COMMAND, FXUndoList::ID_REDO));
321 getAccelTable()->addAccel(262217,
this, FXSEL(SEL_COMMAND,
MID_EDITVIEWPORT));
323 getAccelTable()->addAccel(262228,
this, FXSEL(SEL_COMMAND,
MID_SUMOGUI));
326 getAccelTable()->addAccel(65637,
this, FXSEL(SEL_COMMAND,
MID_LOCATEEDGE));
327 getAccelTable()->addAccel(65652,
this, FXSEL(SEL_COMMAND,
MID_LOCATETLS));
328 getAccelTable()->addAccel(65633,
this, FXSEL(SEL_COMMAND,
MID_LOCATEADD));
329 getAccelTable()->addAccel(65647,
this, FXSEL(SEL_COMMAND,
MID_LOCATEPOI));
330 getAccelTable()->addAccel(65644,
this, FXSEL(SEL_COMMAND,
MID_LOCATEPOLY));
332 getAccelTable()->addAccel(parseAccel(
"Esc"),
this, FXSEL(SEL_COMMAND,
MID_GNE_HOTKEY_ESC));
333 getAccelTable()->addAccel(parseAccel(
"Del"),
this, FXSEL(SEL_COMMAND,
MID_GNE_HOTKEY_DEL));
342 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
343 FXMainWindow::create();
354 FXint textWidth = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 22;
358 show(PLACEMENT_DEFAULT);
360 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
403 FXMainWindow::detach();
414 "&New Network...\tCtrl+N\tCreate a new network.",
417 "&Open Network...\tCtrl+O\tOpen a SUMO network.",
420 "Open Netconvert Configura&tion...\tCtrl+Shift+O\tOpen a configuration file with NETCONVERT options.",
423 "Import &Foreign Network...\t\tImport a foreign network such as OSM.",
426 "&Reload\tCtrl+R\tReloads the network.",
429 "&Save Network...\tCtrl+S\tSave the network.",
432 "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.",
435 "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.",
438 "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).",
443 "Load S&hapes...\tCtrl+P\tLoad shapes into the network view.",
446 "Save Shapes\tCtrl+Shift+P\tSave shapes elements.",
450 "Save Shapes As...\t\tSave shapes elements in another files.",
457 "Load A&dditionals...\tCtrl+D\tLoad additional elements.",
460 "Save Additionals\tCtrl+Shift+D\tSave additional elements.",
464 "Save Additionals As...\t\tSave additional elements in another file.",
471 "load TLS Programs...\tCtrl+K\tload TLS Programs in all Traffic Lights of the net.",
474 "Save TLS Programs \tCtrl+Shift+K\tSave TLS Programs of all Traffic Lights of the current net.",
478 "Save TLS Programs As...\t\tSave TLS Programs of all Traffic Lights of the current net in another file.",
484 "Close\tCtrl+W\tClose the net&work.",
487 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
489 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
503 FXMenuSeparator* sep2 =
new FXMenuSeparator(
myFileMenu);
505 sep2->setSelector(FXRecentFiles::ID_ANYFILES);
521 "&Quit\tCtrl+Q\tQuit the Application.",
530 "&Undo\tCtrl+Z\tUndo the last change.",
533 "&Redo\tCtrl+Y\tRedo the last change.",
540 "&Edge mode\tE\tCreate junction and edges.",
543 "&Move mode\tM\tMove elements.",
546 "&Delete mode\tD\tDelete elements.",
549 "&Inspect mode\tI\tInspect elements and change their attributes.",
552 "&Select mode\tS\tSelect elements.",
555 "&Connection mode\tC\tEdit connections between lanes.",
558 "Pro&hibition mode\tW\tEdit connection prohibitions.",
561 "&Traffic light mode\tT\tEdit traffic lights over junctions.",
564 "&Additional mode\tA\tCreate additional elements.",
567 "C&rossing mode\tR\tCreate crossings between edges.",
570 "TA&Z mode\tZ\tCreate Traffic Assignment Zones.",
573 "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.",
578 "Edit Visualisation ...\tCtrl+V\tOpens a dialog for editing visualization settings.",
581 "Edit Viewport...\tCtrl+I\tOpens a dialog for editing viewing are, zoom and rotation.",
584 "Toggle Grid...\tCtrl+G\tToggles background grid (and snap-to-grid functionality).",
588 "Open in SUMO GUI...\tCtrl+T\tOpens the SUMO GUI application with the current network.",
595 "Compute Junctions\tF5\tComputes junction shape and logic.",
598 "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.",
601 "Clean Junctions\tF6\tRemoves solitary junctions.",
604 "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.",
607 "Clean invalid crossings\tF8\tClear invalid crossings.",
610 "Options\tF10\t\tConfigure Processing Options.",
624 "Locate &Junctions\tShift+J\tOpen a Dialog for Locating a Junction.",
627 "Locate &Edges\tShift+E\tOpen a Dialog for Locating an Edge.",
630 "Locate &TLS\tShift+T\tOpen a Dialog for Locating a Traffic Light.",
633 "Locate &Additional\tShift+A\tOpen a Dialog for Locating an Additional Structure.",
636 "Locate P&oI\tShift+O\tOpen a Dialog for Locating a Point of Intereset.",
639 "Locate Po&lygon\tShift+L\tOpen a Dialog for Locating a Polygon.",
645 "&Show Status Line\t\tToggle this Status Bar on/off.",
648 "Show &Message Window\t\tToggle the Message Window on/off.",
674 "&Clear Message Window\t\tClear the message window.",
681 "&Online Documentation\tF1\tOpen Online documentation.",
684 "&About\tF2\tAbout netedit.",
693 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
695 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", 1);
697 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", 0);
732 FXFileDialog opendialog(
this,
"Open Netconvert Configuration");
734 opendialog.setSelectMode(SELECTFILE_EXISTING);
739 if (opendialog.execute()) {
741 std::string file = opendialog.getFilename().text();
752 FXFileDialog opendialog(
this,
"Open Network");
754 opendialog.setSelectMode(SELECTFILE_EXISTING);
755 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
759 if (opendialog.execute()) {
761 std::string file = opendialog.getFilename().text();
780 FXFileDialog opendialog(
this,
"Import Foreign Network");
782 opendialog.setSelectMode(SELECTFILE_EXISTING);
783 FXString osmPattern(
"OSM net (*.osm.xml,*.osm)");
784 opendialog.setPatternText(0, osmPattern);
788 if (opendialog.execute()) {
790 std::string file = opendialog.getFilename().text();
794 if (osmPattern.contains(opendialog.getPattern())) {
797 oc.
set(
"osm-files", file);
798 oc.
set(
"geometry.remove",
"true");
799 oc.
set(
"ramps.guess",
"true");
800 oc.
set(
"junctions.join",
"true");
801 oc.
set(
"tls.guess-signals",
"true");
802 oc.
set(
"tls.discard-simple",
"true");
804 throw ProcessError(
"Attempted to import unknown file format '" + file +
"'.");
810 if (wizard->execute()) {
822 FXFileDialog opendialog(
this,
"Open Shapes file");
824 opendialog.setSelectMode(SELECTFILE_EXISTING);
825 opendialog.setPatternList(
"Shape files (*.xml)\nAll files (*)");
829 if (opendialog.execute()) {
831 std::string file = opendialog.getFilename().text();
855 FXFileDialog opendialog(
this,
"Open Additionals file");
857 opendialog.setSelectMode(SELECTFILE_EXISTING);
858 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
862 if (opendialog.execute()) {
864 std::string file = opendialog.getFilename().text();
888 FXFileDialog opendialog(
this,
"Open TLSPrograms file");
890 opendialog.setSelectMode(SELECTFILE_EXISTING);
891 opendialog.setPatternList(
"TLSProgram files (*.xml)\nAll files (*)");
895 if (opendialog.execute()) {
897 std::string file = opendialog.getFilename().text();
917 myStatusbar->getStatusLine()->setText(
"Already loading!");
920 std::string file((
const char*)fileData);
960 sender->handle(
this,
myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
979 about->show(PLACEMENT_OWNER);
987 FXEvent*
event = (FXEvent*)ptr;
989 setDNDData(FROM_CLIPBOARD, event->target,
string);
1033 if (ec->
myNet ==
nullptr) {
1047 std::string settingsName = settings.
addSettings(view);
1057 off.
set(getApp()->reg().readRealEntry(
"viewport",
"x"), getApp()->reg().readRealEntry(
"viewport",
"y"), getApp()->reg().readRealEntry(
"viewport",
"z"));
1062 getApp()->endWaitCursor();
1065 if (oc.
isSet(
"sumo-additionals-file") && !oc.
getString(
"sumo-additionals-file").empty() &&
myNet) {
1097 if (oc.
isSet(
"additionals-output")) {
1101 if (oc.
isSet(
"shapes-output")) {
1105 if (oc.
isSet(
"TLSPrograms-output")) {
1130 getApp()->beginWaitCursor();
1149 FXuint opts = MDI_TRACKING;
1151 GNEViewParent* viewParent =
new GNEViewParent(
myMDIClient,
myMDIMenu, FXString(caption.c_str()),
this,
getBuildGLCanvas(),
myNet,
myUndoList,
nullptr, opts, 10, 10, 300, 200);
1153 viewParent->maximize();
1200 myGLWindows.clear();
1205 myTrackerWindows.clear();
1217 if (
myNet !=
nullptr) {
1235 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1248 myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1249 myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1319 FXRegistry reg(
"SUMO GUI",
"Eclipse");
1326 std::string sumogui =
"sumo-gui";
1327 const char* sumoPath = getenv(
"SUMO_HOME");
1328 if (sumoPath !=
nullptr) {
1329 std::string newPath = std::string(sumoPath) +
"/bin/sumo-gui";
1331 sumogui =
"\"" + newPath +
"\"";
1340 cmd =
"start /B \"\" " + cmd;
1427 if (
getView()->getMenuCheckShowGrid()->getCheck() == 1) {
1430 WRITE_DEBUG(
"Disabled grid throught Ctrl+g hotkey");
1468 WRITE_DEBUG(
"Keys Shift + F5 (Compute with volatile options) pressed");
1469 WRITE_DEBUG(
"Opening FXMessageBox 'Volatile Recomputing'");
1471 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Recompute with volatile options",
1472 "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?");
1476 WRITE_DEBUG(
"Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1477 }
else if (answer == 4) {
1478 WRITE_DEBUG(
"Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1484 WRITE_DEBUG(
"Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1490 WRITE_DEBUG(
"Opening FXMessageBox 'Save additionals before recomputing'");
1492 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Save additionals before recomputing with volatile options",
1493 "Would you like to save additionals before recomputing?");
1497 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before recomputing' with 'No'");
1498 }
else if (answer == 4) {
1499 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before recomputing' with 'ESC'");
1503 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before recomputing' with 'Yes'");
1506 "Select name of the additional file",
".xml",
1516 additionalSavePath = FXSystem::getTempDirectory().text() + std::string(
"/tmpAdditionalsNetedit.xml");
1519 getApp()->beginWaitCursor();
1524 WRITE_DEBUG(
"Opening FXMessageBox 'Error saving additionals before recomputing'");
1526 FXMessageBox::error(
this, MBOX_OK,
"Saving additionals in temporal folder failed!",
"%s", e.what());
1528 WRITE_DEBUG(
"Closed FXMessageBox 'Error saving additionals before recomputing' with 'OK'");
1532 getApp()->endWaitCursor();
1535 additionalSavePath =
"";
1542 WRITE_DEBUG(
"Opening FXMessageBox 'Save shapes before recomputing'");
1544 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Save shapes before recomputing with volatile options",
1545 "Would you like to save shapes before recomputing?");
1549 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before recomputing' with 'No'");
1550 }
else if (answer == 4) {
1551 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before recomputing' with 'ESC'");
1555 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before recomputing' with 'Yes'");
1558 "Select name of the shape file",
".xml",
1568 shapeSavePath = FXSystem::getTempDirectory().text() + std::string(
"/tmpShapesNetedit.xml");
1571 getApp()->beginWaitCursor();
1576 WRITE_DEBUG(
"Opening FXMessageBox 'Error saving shapes before recomputing'");
1578 FXMessageBox::error(
this, MBOX_OK,
"Saving shapes in temporal folder failed!",
"%s", e.what());
1580 WRITE_DEBUG(
"Closed FXMessageBox 'Error saving shapes before recomputing' with 'OK'");
1584 getApp()->endWaitCursor();
1618 WRITE_DEBUG(
"Key F8 (Clean invalid crossings) pressed");
1629 if (wizard->execute()) {
1642 "Save Network as",
".net.xml",
1650 oc.
set(
"output-file", file.text());
1660 "Select name of the plain-xml edge-file (other names will be deduced from this)",
"",
1667 bool wasSet = oc.
isSet(
"plain-output-prefix");
1668 std::string oldPrefix = oc.
getString(
"plain-output-prefix");
1670 std::string prefix = file.text();
1673 prefix = prefix.substr(0, prefix.size() - 8);
1676 prefix = prefix.substr(0, prefix.size() - 1);
1678 oc.
set(
"plain-output-prefix", prefix);
1679 getApp()->beginWaitCursor();
1686 WRITE_DEBUG(
"Opening FXMessageBox 'Error saving plainXML'");
1688 FXMessageBox::error(
this, MBOX_OK,
"Saving plain xml failed!",
"%s", e.what());
1690 WRITE_DEBUG(
"Closed FXMessageBox 'Error saving plainXML' with 'OK'");
1696 oc.
set(
"plain-output-prefix", oldPrefix);
1698 oc.
unSet(
"plain-output-prefix");
1700 getApp()->endWaitCursor();
1708 "Select name of the joined-junctions file",
".nod.xml",
1715 bool wasSet = oc.
isSet(
"junctions.join-output");
1716 std::string oldFile = oc.
getString(
"junctions.join-output");
1718 std::string filename = file.text();
1719 oc.
set(
"junctions.join-output", filename);
1720 getApp()->beginWaitCursor();
1725 WRITE_DEBUG(
"Opening FXMessageBox 'error saving joined'");
1727 FXMessageBox::error(
this, MBOX_OK,
"Saving joined junctions failed!",
"%s", e.what());
1729 WRITE_DEBUG(
"Closed FXMessageBox 'error saving joined' with 'OK'");
1735 oc.
set(
"junctions.join-output", oldFile);
1737 oc.
unSet(
"junctions.join-output");
1739 getApp()->endWaitCursor();
1751 "Select name of the shape file",
".xml",
1761 getApp()->beginWaitCursor();
1768 WRITE_DEBUG(
"Opening FXMessageBox 'Error saving shapes'");
1770 FXMessageBox::error(
this, MBOX_OK,
"Saving POIs failed!",
"%s", e.what());
1772 WRITE_DEBUG(
"Closed FXMessageBox 'Error saving shapes' with 'OK'");
1775 getApp()->endWaitCursor();
1786 "Select name of the shape file",
".xml",
1802 sender->handle(
this,
myNet ==
nullptr ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
1809 sender->handle(
this,
myNet ==
nullptr || !
OptionsCont::getOptions().isSet(
"sumo-net-file") ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE),
nullptr);
1818 if (oc.
getString(
"output-file") ==
"") {
1821 getApp()->beginWaitCursor();
1828 WRITE_DEBUG(
"Opening FXMessageBox 'error saving network'");
1830 FXMessageBox::error(
this, MBOX_OK,
"Saving Network failed!",
"%s", e.what());
1832 WRITE_DEBUG(
"Closed FXMessageBox 'error saving network' with 'OK'");
1838 getApp()->endWaitCursor();
1851 "Select name of the additional file",
".xml",
1862 getApp()->beginWaitCursor();
1869 WRITE_DEBUG(
"Opening FXMessageBox 'error saving additionals'");
1871 FXMessageBox::error(
this, MBOX_OK,
"Saving additionals failed!",
"%s", e.what());
1873 WRITE_DEBUG(
"Closed FXMessageBox 'error saving additionals' with 'OK'");
1876 getApp()->endWaitCursor();
1888 "Select name of the additional file",
".xml",
1909 "Select name of the additional file",
".xml",
1920 getApp()->beginWaitCursor();
1927 WRITE_DEBUG(
"Opening FXMessageBox 'error saving TLS Programs'");
1929 FXMessageBox::error(
this, MBOX_OK,
"Saving TLS Programs failed!",
"%s", e.what());
1931 WRITE_DEBUG(
"Closed FXMessageBox 'error saving TLS Programs' with 'OK'");
1934 getApp()->endWaitCursor();
1946 "Select name of the TLS Progarm file",
".xml",
1963 bool enable =
myNet !=
nullptr && oc.
isSet(
"output-file");
1964 sender->handle(
this, FXSEL(SEL_COMMAND, enable ? ID_ENABLE : ID_DISABLE),
nullptr);
1966 FXString caption = (
"Save " + oc.
getString(
"output-file")).c_str();
1967 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
1988 WRITE_DEBUG(
"Opening FXMessageBox 'Confirm closing network'");
1990 answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1991 "Confirm closing Network",
"%s",
1992 "You have unsaved changes in the network. Do you wish to quit and discard all changes?");
1996 if (answer == MBOX_CLICKED_QUIT) {
1998 WRITE_DEBUG(
"Closed FXMessageBox 'Confirm closing network' with 'Quit'");
2006 }
else if (answer == MBOX_CLICKED_SAVE) {
2023 WRITE_DEBUG(
"Closed FXMessageBox 'Confirm closing network' with 'No'");
2024 }
else if (answer == 4) {
2025 WRITE_DEBUG(
"Closed FXMessageBox 'Confirm closing network' with 'ESC'");
2047 WRITE_DEBUG(
"Opening FXMessageBox 'Save additionals before exit'");
2049 FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
2050 "Save additionals before exit",
"%s",
2051 "You have unsaved additionals. Do you wish to quit and discard all changes?");
2055 if (answer == MBOX_CLICKED_QUIT) {
2056 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before exit' with 'Quit'");
2059 }
else if (answer == MBOX_CLICKED_SAVE) {
2061 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before exit' with 'Yes'");
2072 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before exit' with 'No'");
2073 }
else if (answer == 4) {
2074 WRITE_DEBUG(
"Closed FXMessageBox 'Save additionals before exit' with 'ESC'");
2090 WRITE_DEBUG(
"Opening FXMessageBox 'Save shapes before exit'");
2092 FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
2093 "Save shapes before exit",
"%s",
2094 "You have unsaved shapes. Do you wish to quit and discard all changes?");
2098 if (answer == MBOX_CLICKED_QUIT) {
2099 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before exit' with 'Quit'");
2101 }
else if (answer == MBOX_CLICKED_SAVE) {
2103 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before exit' with 'Yes'");
2114 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before exit' with 'No'");
2115 }
else if (answer == 4) {
2116 WRITE_DEBUG(
"Closed FXMessageBox 'Save shapes before exit' with 'ESC'");
2131 if (view !=
nullptr) {
2139 const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
2140 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
2152 const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
2153 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
2180 if (edge ==
nullptr || laneIndex < 0 || edge->getNumLanes() <= laneIndex) {
2181 WRITE_ERROR(
"Lane '" + laneID +
"' to place poi '" + poiID +
"' on is not known.");
2187 if (lanePos < 0 || lanePos > edge->
getLength()) {
2190 return edge->
getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat);
Locate junction - button.
std::vector< FXMainWindow * > myTrackerWindows
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
std::string myConfigPattern
Input file pattern.
FXMenuCheck * getMenuCheckShowGrid() const
get grid button
void enableSaveTLSProgramsMenu()
enable save TLS Programs
FXLabel * myGeoCoordinate
TAZSelectionStatistics * getTAZSelectionStatisticsModul() const
get TAZ Selection Statistics modul
GNETAZFrame * getTAZFrame() const
get frame for GNE_MODE_TAZ
clean junctions without edges
double getLength() const
Returns the computed length of the edge.
FXMenuBar * myMenuBar
The application menu bar.
FXMenuCommand * mySaveShapesMenuCommand
FXMenuCommand for enable or disable save shapes.
GUISUMOAbstractView * getView() const
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out ...
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don't need it)
GUICompleteSchemeStorage gSchemeStorage
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
void enableSaveAdditionalsMenu()
enable save additionals
long onKeyPress(FXObject *o, FXSelector sel, void *data)
Called when user press a key.
send when a warning occured
static std::string clipped
GNEEdge * retrieveEdge(const std::string &id, bool failHard=true)
get edge by id
long onCmdNewNetwork(FXObject *, FXSelector, void *)
FXEX::FXThreadEvent myLoadThreadEvent
io-event with the load-thread
void setAdditionalsFile(const std::string &additionalsFile)
set additionals file
static void resetFont()
to be called when the font context is invalidated
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
long onCmdToogleGrid(FXObject *, FXSelector, void *)
called if the user press key combination Ctrl + G to toogle grid
void abortOperation(bool clearSelection=true)
abort current edition operation
bool parseTLSPrograms(const std::string &file)
parse TLS Programs from a file
hot key <F12> focus upper element of current frame
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
MFXEventQue< GUIEvent * > myEvents
List of got requests.
void resetWritable()
Resets all options to be writeable.
GNEUndoList * getUndoList()
get pointer to undoList
long onCmdReload(FXObject *, FXSelector, void *)
called when the command/FXCall reload is executed
void create()
Creates the widget.
void closeAllWindows()
this method closes all windows and deletes the current simulation */
virtual FXGLCanvas * getBuildGLCanvas() const
FXRecentFiles myRecentConfigs
List of recent config files.
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
FXMenuPane * myFileMenuAdditionals
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
static bool isReadable(std::string path)
Checks whether the given file is readable.
void enableSaveShapesMenu()
enable save shapes
The main window of the Netedit.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
std::string myShapesFile
filename for load/save shapes
#define GUIDesignSplitterMDI
MDI Splitter.
Load additional file with additional elements.
void hotkeyFocusFrame()
handle focus frame keypress
static void setValidation(const std::string &validationScheme, const std::string &netValidationScheme)
Enables or disables validation.
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
Locate addtional structure - button.
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
virtual void create()
Creates the main window (required by FOX)
long onCmdJoinJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->join junctions
bool hadDependentBuild
check if had dependent build
mode for connecting lanes
mode for inspecting object attributes
GNEViewParent * getViewParent() const
get the net object
double y() const
Returns the y-position.
long onCmdSaveTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms is executed
The representation of a single edge during network building.
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
GNEUndoList * myUndoList
the one and only undo list
long onCmdComputeJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions
static void resetTextures()
Reset textures.
long onCmdOpenSUMOGUI(FXObject *sender, FXSelector sel, void *ptr)
called if the user hints ctrl + T
void registerMsgHandlers()
register message handlers
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
save network as plain XML
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
#define GUIDesignStatusBar
design used in status bar
GNENet * myNet
pointer of the net
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort ...
static void initCursors(FXApp *a)
Initiate GUICursorSubSys.
double x() const
Returns the x-position.
send when a debug occured
void loadConfigOrNet(const std::string file, bool isNet, bool isReload=false, bool useStartupOptions=false, bool newNet=false)
starts to load a netimport configuration or a network */
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
mode for editing additional
long onCmdLocate(FXObject *, FXSelector, void *)
locator-callback
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
called when a key is released
#define GUIDesignSplitter
long onKeyRelease(FXObject *o, FXSelector sel, void *data)
Called when user releases a key.
Editor for the list of chosen objects.
bool continueWithUnsavedChanges()
warns about unsaved changes and gives the user the option to abort
FXGLVisual * myGLVisual
The gl-visual used.
long onCmdEditViewScheme(FXObject *, FXSelector, void *)
Called on menu Edit->Visualization.
long onCmdOpenForeign(FXObject *, FXSelector, void *)
called when the command/FXCall open foreign is executed
A NBNetBuilder extended by visualisation and editing capabilities.
long onCmdSaveNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network is executed
void p_begin(const std::string &description)
Begin undo command sub-group. This begins a new group of commands that are treated as a single comman...
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
hot key <DEL> delete selections or elements
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
void setEditModeFromHotkey(FXushort selid)
sets edit mode (from hotkey)
void clearSelectedEdges()
clear current TAZ childs
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
FXString gCurrentFolder
The folder used as last.
long onCmdSaveShapes(FXObject *, FXSelector, void *)
called when the command/FXCall save shapes is executed
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
long onUpdNeedsNetwork(FXObject *, FXSelector, void *)
called when the upadte/FXCall needs network is executed
void saveViewport(const double x, const double y, const double z)
Makes the given viewport the default.
long onCmdCleanInvalidCrossings(FXObject *, FXSelector, void *)
called if the user selects Processing->clear invalid crossings
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
std::string myFile
the name of the loaded file
long onLoadThreadEvent(FXObject *, FXSelector, void *)
called when the command/FXCall load thread is executed
static void resetLoaded()
resets loaded location elements
FXMDIMenu * myMDIMenu
The menu used for the MDI-windows.
void unregisterMsgHandlers()
unregister message handlers
virtual double getZPos() const =0
Returns the camera height corresponding to the current zoom factor.
void set(double x, double y)
set positions x and y
static bool runParser(GenericSAXHandler &handler, const std::string &file, const bool isNet=false)
Runs the given handler on the given file; returns if everything's ok.
void updateControls()
update control contents after undo/redo or recompute
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
std::string myTLSProgramsFile
filename for load/save TLS Programs
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
void updateControls()
update control contents after undo/redo or recompute
Builds trigger objects for GNENet (busStops, chargingStations, detectors, etc..)
void addDecals(const std::vector< Decal > &decals)
add decals
GUISUMOAbstractView * openNewView()
opens a new simulation display
GNENet * myNet
the loaded net
long onUpdReload(FXObject *, FXSelector, void *)
called when the update/FXCall reload is executed
#define WRITE_WARNING(msg)
Load additional file with poi and polygons.
A single child window which contains a view of the simulation area.
void saveTLSPrograms(const std::string &filename)
save TLS Programs elements of the network
Loads a file previously loaded.
GNETLSEditorFrame * getTLSEditorFrame() const
get frame for GNE_MODE_TLS
static OptionsCont & getOptions()
Retrieves the options.
long onCmdHelp(FXObject *sender, FXSelector sel, void *ptr)
called if the user selects help->Documentation
The application's "About" - dialog.
void addSeparator()
Adds a a separator to this log window.
void p_clear()
clears the undo list (implies abort)
long onClipboardRequest(FXObject *sender, FXSelector sel, void *ptr)
called when the command/FXCall clipboard request is executed
The XML-Handler for network loading.
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
void disableSaveAdditionalsMenu()
disable save additionals
FXHorizontalFrame * myCartesianFrame
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
long onCmdSaveTLSProgramsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save TLSPrograms as is executed
FXMenuPane * myProcessingMenu
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
const std::string & getMsg() const
Returns the message.
static FXint fxexecute(FXString link)
long onCmdEditViewport(FXObject *, FXSelector, void *)
Called on menu Edit->Viewport.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
long onCmdOptions(FXObject *, FXSelector, void *)
called if the user selects Processing->Configure Options
FXMenuPane * myFileMenuTLS
FXMenuPane * myWindowsMenu
static void close()
close GUITextureSubSys
mode for editing connection prohibitions
Locate polygons - button.
GNEApplicationWindow()
FOX needs this for static members.
FXSplitter * myMainSplitter
The splitter that divides the main window into view and the log window.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
static unsigned long runHiddenCommand(const std::string &cmd)
run a shell command without popping up any windows (particuarly on win32)
long onCmdOpenRecent(FXObject *, FXSelector, void *)
called when the command/FXCall open recent is executed
long onCmdOpenNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall open network is executed
FXGLCanvas * getBuildGLCanvas() const
get build OpenGL Canvas
int myViewNumber
The current view number.
A point in 2D or 3D with translation and scaling methods.
void p_end()
End undo command sub-group. If the sub-group is still empty, it will be deleted; otherwise, the sub-group will be added as a new command into parent group. A matching begin() must have been called previously.
Position getLanePos(const std::string &poiID, const std::string &laneID, double lanePos, double lanePosLat)
get lane position
bool joinSelectedJunctions(GNEUndoList *undoList)
join selected junctions
virtual void fillMenuBar()
Builds the menu bar.
FXMenuCommand * mySaveShapesMenuCommandAs
FXMenuCommand for enable or disable save shapes.
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
bool continueWithUnsavedShapeChanges()
warns about unsaved changes in shapes and gives the user the option to abort
Open viewport editor - button.
GUIPerspectiveChanger & getChanger() const
get changer
long onCmdSaveAsPlainXML(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
long onCmdSaveShapesAs(FXObject *, FXSelector, void *)
called when the command/FXCall save shapes as is executed
void save(OptionsCont &oc)
save the network
long onCmdOpenConfiguration(FXObject *, FXSelector, void *)
called when the command/FXCall open configuration is executed
static bool checkOptions()
checks shared options and sets StdDefs
std::string mySettingsFile
the name of the settings file to load
mode for creating polygons
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
double getTrackerInterval() const
get current tracker interval (pure virtual but we don't need it)
virtual void setViewportFromToRot(const Position &lookFrom, const Position &lookAt, double rotation)
applies the given viewport settings
static bool checkOptions()
Checks set options from the OptionsCont-singleton for being valid.
long onCmdLocate(FXObject *, FXSelector, void *)
called when the command/FXCall locate is executed
void setTarget(FXObject *tgt)
set the target
FXCursor * getDefaultCursor()
get default cursor
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
std::vector< GUIGlChildWindow * > myGLWindows
mode for editing crossing
long onCmdCleanJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->clean junctions
virtual void eventOccurred()
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
GNEShapeHandler(const std::string &file, GNENet *net)
Constructor.
Open view editor - button.
hot key <ENTER> accept current operation
compute junctions with volatile options
virtual ~GNEApplicationWindow()
Destructor.
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
GNELoadThread * myLoadThread
the thread that loads the network
FXStatusBar * myStatusbar
The status bar.
long onCmdOpenShapes(FXObject *, FXSelector, void *)
called when the command/FXCall open shapes is executed
void unlock()
release mutex lock
long onCmdEnter(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits enter
virtual void showViewportEditor()
show viewport editor
bool myViewportFromRegistry
whether loading viewport from registry
FXMenuCommand * mySaveAdditionalsMenuCommandAs
FXMenuCommand for enable or disable save additionals As.
long onCmdFocusFrame(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits f
long onCmdQuit(FXObject *, FXSelector, void *)
Called by FOX if the application shall be closed.
void setTLSProgramsFile(const std::string &TLSProgramsFile)
set TLS Programs file
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
virtual void detach()
detaches the tool/menu bar
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
send when a gldebug occured
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
void setSelector(FXSelector sel)
set the selector
void unSet(const std::string &name, bool failOnNonExistant=true) const
Marks the option as unset.
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
FXRecentFiles myRecentNets
List of recent nets.
void loadOptionOnStartup()
load net on startup
static void interpretLaneID(const std::string &lane_id, std::string &edge_id, int &index)
parses edge-id and index from lane-id
send when a message occured
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
static void close()
close GUIIconSubSys
FXToolBarShell * myMenuBarDrag
void disableSaveShapesMenu()
disable save shapes
void requiereSaveNet(bool value)
inform that net has to be saved
FXHorizontalFrame * myGeoFrame
A storage for options typed value containers)
FXMenuCommand * mySaveAdditionalsMenuCommand
FXMenuCommand for enable or disable save additionals.
const std::vector< TAZCurrent::TAZEdge > & getEdgeAndTAZChildsSelected() const
get map with edge and TAZChilds
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
long onCmdOpenTLSPrograms(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
void computeEverything(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string shapePath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
int getNumberOfShapes() const
get number of shapes
send when a error occured
std::string myAdditionalsFile
filename for load/save additionals
FXMDIClient * myMDIClient
The multi view panel.
send when a simulation has been loaded
virtual double getYPos() const =0
Returns the y-offset of the field to show stored in this changer.
void handleEvent_Message(GUIEvent *e)
hanlde event of type message
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
FXMenuCommand * mySaveTLSProgramsMenuCommand
FXMenuCommand for enable or disable save additionals.
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
Load additional file with additional elements.
long onCmdSaveJoined(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
An XML-handler for visualisation schemes.
const FXString myTitlePrefix
the prefix for the window title
Reload the previously loaded simulation.
GUIEventType getOwnType() const
returns the event type
static FXString getTitleText(const FXString &appname, FXString filename="")
Returns the title text in dependance to an optional file name.
GNENet * myNet
we are responsible for the net
#define GUIDesignToolBarShell3
hot key <ESC> abort current edit operation
void dependentBuild()
build dependent
void clear()
Clears the window.
void showViewschemeEditor()
show viewsscheme editor
NBEdge * getNBEdge()
returns the internal NBEdge
~GNEShapeHandler()
Destructor.
mode for selecting objects
long onCmdComputeJunctionsVolatile(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions with volatile options
void storeWindowSizeAndPos()
record window position and size in registry
void hotkeyDel()
handle del keypress
#define WRITE_MESSAGE(msg)
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
GUISelectedStorage gSelected
A global holder of selected objects.
hot key <Ctrl + G> for toogle grid
void hotkeyEnter()
handle enter keypress
long onCmdSaveAsNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
GNEViewNet * getView()
convenience method
A logging window for the gui.
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
virtual double getXPos() const =0
Returns the x-offset of the field to show stored in this changer.
void saveAdditionals(const std::string &filename)
save additional elements of the network
FXMenuPane * myFileMenuShapes
void savePlain(OptionsCont &oc)
save plain xml representation of the network (and nothing else)
static void fillOptions(OptionsCont &oc)
clears and initializes the OptionsCont
FXMenuPane * myFileMenu
the submenus
bool isNetSaved() const
return if net has to be saved
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onCmdShowGrid(FXObject *, FXSelector, void *)
toogle show grid
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
FXMenuPane * myLocatorMenu
static const Position INVALID
used to indicate that a position is valid
GNEViewNet * getViewNet() const
get view net
void saveShapes(const std::string &filename)
save shapes elements of the network
void setShapesFile(const std::string &shapesFile)
set shapes file