196 FXIMPLEMENT(
GNEApplicationWindow, FXMainWindow, GNEApplicationWindowMap, ARRAYNUMBER(GNEApplicationWindowMap))
202 #pragma warning(push) 203 #pragma warning(disable: 4355) 209 myRecentNets(a,
"nets"),
210 myConfigPattern(configPattern),
211 hadDependentBuild(false),
229 WRITE_ERROR(
"DEBUG: GNEApplicationWindow::dependentBuild called twice");
250 myGeoCoordinate =
new FXLabel(
myGeoFrame,
"N/A\t\tOriginal coordinate (before coordinate transformation in NETCONVERT)", 0, LAYOUT_CENTER_Y);
290 getAccelTable()->addAccel(parseAccel(
"Esc"),
this, FXSEL(SEL_COMMAND,
MID_GNE_HOTKEY_ESC));
291 getAccelTable()->addAccel(parseAccel(
"Del"),
this, FXSEL(SEL_COMMAND,
MID_GNE_HOTKEY_DEL));
294 getAccelTable()->addAccel(parseAccel(
"v"),
this, FXSEL(SEL_COMMAND,
MID_EDITVIEWPORT));
300 gCurrentFolder = getApp()->reg().readStringEntry(
"SETTINGS",
"basedir",
"");
301 FXMainWindow::create();
309 FXint textWidth = getApp()->getNormalFont()->getTextWidth(
"8", 1) * 22;
313 show(PLACEMENT_DEFAULT);
315 if (getApp()->reg().readIntEntry(
"SETTINGS",
"maximized", 0) == 1) {
353 FXMainWindow::detach();
364 "&New Network...\tCtrl+N\tCreate a new network.",
367 "&Open Network...\tCtrl+O\tOpen a SUMO network.",
370 "Open Configura&tion...\tCtrl+T\tOpen a NETCONVERT configuration file.",
373 "Import &Foreign Network...\t\tImport a foreign network such as OSM.",
376 "Load S&hapes...\tCtrl+P\tLoad shapes into the network view.",
379 "Load A&dditionals...\tCtrl+D\tLoad additional elements.",
382 "&Reload\tCtrl+R\tReloads the network.",
385 "&Save Network...\tCtrl+S\tSave the network.",
388 "Save Net&work As...\tCtrl+Shift+S\tSave the network in another file.",
391 "Save plain XM&L...\tCtrl+L\tSave plain xml representation the network.",
394 "Save &joined junctions...\tCtrl+J\tSave log of joined junctions (allows reproduction of joins).",
397 "Save Shapes\tCtrl+Shift+P\tSave shapes elements.",
401 "Save Shapes As...\t\tSave shapes elements in another files.",
404 "Save Additionals\tCtrl+Shift+D\tSave additional elements.",
408 "Save Additionals As...\t\tSave additional elements in another file.",
412 "Close\tCtrl+W\tClose the net&work.",
415 FXMenuSeparator* sep1 =
new FXMenuSeparator(
myFileMenu);
417 sep1->setSelector(FXRecentFiles::ID_ANYFILES);
431 FXMenuSeparator* sep2 =
new FXMenuSeparator(
myFileMenu);
433 sep2->setSelector(FXRecentFiles::ID_ANYFILES);
449 "&Quit\tCtrl+Q\tQuit the Application.",
458 "&Undo\tCtrl+Z\tUndo the last change.",
461 "&Redo\tCtrl+Y\tRedo the last change.",
468 "&Edge mode\tE\tCreate junction and edges.",
471 "&Move mode\tM\tMove elements.",
474 "&Delete mode\tD\tDelete elements.",
477 "&Inspect mode\tI\tInspect elements and change their attributes.",
480 "&Select mode\tS\tSelect elements.",
483 "&Connection mode\tC\tEdit connections between lanes.",
486 "&Traffic light mode\tT\tEdit traffic lights over junctions.",
489 "&Additional mode\tA\tCreate additional elements.",
492 "C&rossing mode\tR\tCreate crossings between edges.",
495 "&POI-Poly mode\tP\tCreate Points-Of-Interest and polygons.",
509 "Compute Junctions\tF5\tComputes junction shape and logic.",
512 "Compute Junctions with volatile options\tShift+F5\tComputes junction shape and logic using volatile junctions.",
515 "Clean Junctions\tF6\tRemoves solitary junctions.",
518 "Join Selected Junctions\tF7\tJoins selected junctions into a single junction.",
521 "Clean invalid crossings\tF8\tClear invalid crossings.",
524 "Options\tF10\t\tConfigure Processing Options.",
538 "Locate &Junctions\tShift+J\tOpen a Dialog for Locating a Junction.",
541 "Locate &Edges\tShift+E\tOpen a Dialog for Locating an Edge.",
544 "Locate &TLS\tShift+T\tOpen a Dialog for Locating a Traffic Light.",
547 "Locate &Additional\tShift+A\tOpen a Dialog for Locating an Additional Structure.",
550 "Locate P&oI\tShift+O\tOpen a Dialog for Locating a Point of Intereset.",
553 "Locate Po&lygon\tShift+L\tOpen a Dialog for Locating a Polygon.",
559 "&Show Status Line\t\tToggle this Status Bar on/off.",
562 "Show &Message Window\t\tToggle the Message Window on/off.",
588 "&Clear Message Window\t\tClear the message window.",
597 "&Online Documentation\tF1\tOpen Online documentation.",
600 "&About\tF2\tAbout netedit.",
608 getApp()->reg().writeIntEntry(
"SETTINGS",
"x", getX());
609 getApp()->reg().writeIntEntry(
"SETTINGS",
"y", getY());
610 getApp()->reg().writeIntEntry(
"SETTINGS",
"width", getWidth());
611 getApp()->reg().writeIntEntry(
"SETTINGS",
"height", getHeight());
612 getApp()->reg().writeStringEntry(
"SETTINGS",
"basedir",
gCurrentFolder.text());
614 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", 1);
616 getApp()->reg().writeIntEntry(
"SETTINGS",
"maximized", 0);
651 FXFileDialog opendialog(
this,
"Open Netconvert Configuration");
653 opendialog.setSelectMode(SELECTFILE_EXISTING);
658 if (opendialog.execute()) {
660 std::string file = opendialog.getFilename().text();
671 FXFileDialog opendialog(
this,
"Open Network");
673 opendialog.setSelectMode(SELECTFILE_EXISTING);
674 opendialog.setPatternList(
"SUMO nets (*.net.xml)\nAll files (*)");
678 if (opendialog.execute()) {
680 std::string file = opendialog.getFilename().text();
698 FXFileDialog opendialog(
this,
"Import Foreign Network");
700 opendialog.setSelectMode(SELECTFILE_EXISTING);
701 FXString osmPattern(
"OSM net (*.osm.xml,*.osm)");
702 opendialog.setPatternText(0, osmPattern);
706 if (opendialog.execute()) {
708 std::string file = opendialog.getFilename().text();
712 if (osmPattern.contains(opendialog.getPattern())) {
713 oc.
set(
"osm-files", file);
714 oc.
set(
"ramps.guess",
"true");
715 oc.
set(
"tls.guess",
"true");
717 throw ProcessError(
"Attempted to import unknown file format '" + file +
"'.");
721 new GNEDialog_Wizard(
this,
"Select Import Options", getWidth(), getHeight());
723 if (wizard->execute()) {
735 FXFileDialog opendialog(
this,
"Open Shapes file");
737 opendialog.setSelectMode(SELECTFILE_EXISTING);
738 opendialog.setPatternList(
"Shape files (*.xml)\nAll files (*)");
742 if (opendialog.execute()) {
744 std::string file = opendialog.getFilename().text();
760 FXFileDialog opendialog(
this,
"Open Additionals file");
762 opendialog.setSelectMode(SELECTFILE_EXISTING);
763 opendialog.setPatternList(
"Additional files (*.xml)\nAll files (*)");
767 if (opendialog.execute()) {
769 std::string file = opendialog.getFilename().text();
794 myStatusbar->getStatusLine()->setText(
"Already loading!");
797 std::string file((
const char*)fileData);
836 sender->handle(
this,
myAmLoading ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
857 about->show(PLACEMENT_OWNER);
867 FXEvent*
event = (FXEvent*)ptr;
869 setDNDData(FROM_CLIPBOARD, event->target,
string);
910 if (ec->
myNet == 0) {
923 std::string settingsName = settings.
addSettings(view);
934 off.
set(getApp()->reg().readRealEntry(
"viewport",
"x"), getApp()->reg().readRealEntry(
"viewport",
"y"), getApp()->reg().readRealEntry(
"viewport",
"z"));
938 getApp()->endWaitCursor();
989 getApp()->beginWaitCursor();
1008 FXuint opts = MDI_TRACKING;
1012 viewParent->maximize();
1095 return getApp()->getDefaultCursor(DEF_ARROW_CURSOR);
1108 myStatusbar->getStatusLine()->setText(statusBarText.c_str());
1109 myStatusbar->getStatusLine()->setNormalText(statusBarText.c_str());
1233 WRITE_WARNING(
"Keys Shift + F5 (Compute with volatile options) pressed");
1234 WRITE_WARNING(
"Opening FXMessageBox 'Volatile Recomputing'");
1237 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Recompute with volatile options",
1238 "Changes produced in the net due a recomputing with volatile options cannot be undone. Continue?");
1242 WRITE_WARNING(
"Closed FXMessageBox 'Volatile Recomputing' with 'No'");
1244 WRITE_WARNING(
"Closed FXMessageBox 'Volatile Recomputing' with 'ESC'");
1251 WRITE_WARNING(
"Closed FXMessageBox 'Volatile Recomputing' with 'Yes'");
1258 WRITE_WARNING(
"Opening FXMessageBox 'Save additionals before recomputing'");
1260 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Save additionals before recomputing with volatile options",
1261 "Would you like to save additionals before recomputing?");
1265 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before recomputing' with 'No'");
1267 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before recomputing' with 'ESC'");
1272 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before recomputing' with 'Yes'");
1276 "Select name of the additional file",
".xml",
1286 additionalSavePath = FXSystem::getTempDirectory().text() + std::string(
"/tmpAdditionalsNetedit.xml");
1289 getApp()->beginWaitCursor();
1295 WRITE_WARNING(
"Opening FXMessageBox 'Error saving additionals before recomputing'");
1298 FXMessageBox::error(
this, MBOX_OK,
"Saving additionals in temporal folder failed!",
"%s", e.what());
1301 WRITE_WARNING(
"Closed FXMessageBox 'Error saving additionals before recomputing' with 'OK'");
1306 getApp()->endWaitCursor();
1309 additionalSavePath =
"";
1316 WRITE_WARNING(
"Opening FXMessageBox 'Save shapes before recomputing'");
1318 answer = FXMessageBox::question(
myNet->
getViewNet()->getApp(), MBOX_YES_NO,
"Save shapes before recomputing with volatile options",
1319 "Would you like to save shapes before recomputing?");
1323 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before recomputing' with 'No'");
1325 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before recomputing' with 'ESC'");
1330 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before recomputing' with 'Yes'");
1334 "Select name of the shape file",
".xml",
1344 shapeSavePath = FXSystem::getTempDirectory().text() + std::string(
"/tmpShapesNetedit.xml");
1347 getApp()->beginWaitCursor();
1353 WRITE_WARNING(
"Opening FXMessageBox 'Error saving shapes before recomputing'");
1356 FXMessageBox::error(
this, MBOX_OK,
"Saving shapes in temporal folder failed!",
"%s", e.what());
1359 WRITE_WARNING(
"Closed FXMessageBox 'Error saving shapes before recomputing' with 'OK'");
1364 getApp()->endWaitCursor();
1415 if (wizard->execute()) {
1428 "Save Network as",
".net.xml",
1436 oc.
set(
"output-file", file.text());
1446 "Select name of the plain-xml edge-file (other names will be deduced from this)",
"",
1453 bool wasSet = oc.
isSet(
"plain-output-prefix");
1454 std::string oldPrefix = oc.
getString(
"plain-output-prefix");
1456 std::string prefix = file.text();
1459 prefix = prefix.substr(0, prefix.size() - 8);
1462 prefix = prefix.substr(0, prefix.size() - 1);
1464 oc.
set(
"plain-output-prefix", prefix);
1465 getApp()->beginWaitCursor();
1473 WRITE_WARNING(
"Opening FXMessageBox 'Error saving plainXML'");
1476 FXMessageBox::error(
this, MBOX_OK,
"Saving plain xml failed!",
"%s", e.what());
1479 WRITE_WARNING(
"Closed FXMessageBox 'Error saving plainXML' with 'OK'");
1486 oc.
set(
"plain-output-prefix", oldPrefix);
1488 oc.
unSet(
"plain-output-prefix");
1490 getApp()->endWaitCursor();
1498 "Select name of the joined-junctions file",
".nod.xml",
1505 bool wasSet = oc.
isSet(
"junctions.join-output");
1506 std::string oldFile = oc.
getString(
"junctions.join-output");
1508 std::string filename = file.text();
1509 oc.
set(
"junctions.join-output", filename);
1510 getApp()->beginWaitCursor();
1516 WRITE_WARNING(
"Opening FXMessageBox 'error saving joined'");
1519 FXMessageBox::error(
this, MBOX_OK,
"Saving joined junctions failed!",
"%s", e.what());
1522 WRITE_WARNING(
"Closed FXMessageBox 'error saving joined' with 'OK'");
1529 oc.
set(
"junctions.join-output", oldFile);
1531 oc.
unSet(
"junctions.join-output");
1533 getApp()->endWaitCursor();
1545 "Select name of the shape file",
".xml",
1555 getApp()->beginWaitCursor();
1563 WRITE_WARNING(
"Opening FXMessageBox 'Error saving shapes'");
1566 FXMessageBox::error(
this, MBOX_OK,
"Saving POIs failed!",
"%s", e.what());
1569 WRITE_WARNING(
"Closed FXMessageBox 'Error saving shapes' with 'OK'");
1573 getApp()->endWaitCursor();
1584 "Select name of the shape file",
".xml",
1600 sender->handle(
this,
myNet == 0 ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
1607 sender->handle(
this,
myNet == 0 || !
OptionsCont::getOptions().isSet(
"sumo-net-file") ? FXSEL(SEL_COMMAND, ID_DISABLE) : FXSEL(SEL_COMMAND, ID_ENABLE), 0);
1616 if (oc.
getString(
"output-file") ==
"") {
1619 getApp()->beginWaitCursor();
1627 WRITE_WARNING(
"Opening FXMessageBox 'error saving network'");
1630 FXMessageBox::error(
this, MBOX_OK,
"Saving Network failed!",
"%s", e.what());
1633 WRITE_WARNING(
"Closed FXMessageBox 'error saving network' with 'OK'");
1638 getApp()->endWaitCursor();
1651 "Select name of the additional file",
".xml",
1662 getApp()->beginWaitCursor();
1670 WRITE_WARNING(
"Opening FXMessageBox 'error saving additionals'");
1673 FXMessageBox::error(
this, MBOX_OK,
"Saving additionals failed!",
"%s", e.what());
1676 WRITE_WARNING(
"Closed FXMessageBox 'error saving additionals' with 'OK'");
1680 getApp()->endWaitCursor();
1692 "Select name of the additional file",
".xml",
1709 bool enable =
myNet != 0 && oc.
isSet(
"output-file");
1710 sender->handle(
this, FXSEL(SEL_COMMAND, enable ? ID_ENABLE : ID_DISABLE), 0);
1712 FXString caption = (
"Save " + oc.
getString(
"output-file")).c_str();
1713 sender->handle(
this, FXSEL(SEL_COMMAND, FXMenuCaption::ID_SETSTRINGVALUE), (
void*)&caption);
1735 WRITE_WARNING(
"Opening FXMessageBox 'Confirm closing network'");
1738 answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1739 "Confirm closing Network",
"%s",
1740 "You have unsaved changes in the network. Do you wish to quit and discard all changes?");
1744 if (answer == MBOX_CLICKED_QUIT) {
1747 WRITE_WARNING(
"Closed FXMessageBox 'Confirm closing network' with 'Quit'");
1756 }
else if (answer == MBOX_CLICKED_SAVE) {
1773 WRITE_WARNING(
"Closed FXMessageBox 'Confirm closing network' with 'No'");
1775 WRITE_WARNING(
"Closed FXMessageBox 'Confirm closing network' with 'ESC'");
1798 WRITE_WARNING(
"Opening FXMessageBox 'Save additionals before exit'");
1801 FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1802 "Save additionals before exit",
"%s",
1803 "You have unsaved additionals. Do you wish to quit and discard all changes?");
1807 if (answer == MBOX_CLICKED_QUIT) {
1809 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before exit' with 'Quit'");
1813 }
else if (answer == MBOX_CLICKED_SAVE) {
1816 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before exit' with 'Yes'");
1828 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before exit' with 'No'");
1830 WRITE_WARNING(
"Closed FXMessageBox 'Save additionals before exit' with 'ESC'");
1847 WRITE_WARNING(
"Opening FXMessageBox 'Save shapes before exit'");
1850 FXuint answer = FXMessageBox::question(getApp(), MBOX_QUIT_SAVE_CANCEL,
1851 "Save shapes before exit",
"%s",
1852 "You have unsaved shapes. Do you wish to quit and discard all changes?");
1856 if (answer == MBOX_CLICKED_QUIT) {
1858 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before exit' with 'Quit'");
1861 }
else if (answer == MBOX_CLICKED_SAVE) {
1864 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before exit' with 'Yes'");
1876 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before exit' with 'No'");
1878 WRITE_WARNING(
"Closed FXMessageBox 'Save shapes before exit' with 'ESC'");
1901 const long handled = FXMainWindow::onKeyPress(o, sel, eventData);
1902 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1914 const long handled = FXMainWindow::onKeyRelease(o, sel, eventData);
1915 if (handled == 0 &&
myMDIClient->numChildren() > 0) {
1942 if (edge == 0 || laneIndex < 0 || edge->getNumLanes() <= laneIndex) {
1943 WRITE_ERROR(
"Lane '" + laneID +
"' to place poi '" + poiID +
"' on is not known.");
1949 if (lanePos < 0 || lanePos > edge->
getLength()) {
1952 return edge->
getLanes()[laneIndex].shape.positionAtOffset(lanePos, -lanePosLat);
std::vector< FXMainWindow * > myTrackerWindows
std::string myConfigPattern
Input file pattern.
FXLabel * myGeoCoordinate
GUISUMOAbstractView * getView() const
FXMenuBar * myMenuBar
The application menu bar.
FXMenuCommand * mySaveShapesMenuCommand
FXMenuCommand for enable or disable save shapes.
bool myAmLoading
information whether the gui is currently loading and the load-options shall be greyed out ...
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.
Load additional file with additional elements.
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
hot key <DEL> delete selections or elements
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.
void abortOperation(bool clearSelection=true)
abort current edition operation
void setStatusBarText(const std::string &statusBarText)
set text of the statusBar
void appendMsg(GUIEventType eType, const std::string &msg)
Adds new text to the window.
MFXEventQue< GUIEvent * > myEvents
List of got requests.
void resetWritable()
Resets all options to be writeable.
GNEUndoList * getUndoList()
get pointer to undoList
std::string addSettings(GUISUMOAbstractView *view=0) const
Adds the parsed settings to the global list of settings.
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 void setViewportFromTo(const Position &lookFrom, const Position &lookAt)
applies the given viewport settings
send when a message occured
FXRecentFiles myRecentConfigs
List of recent config files.
hot key <F12> focus upper element of current frame
long onCmdSaveAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals is executed
GUIMessageWindow * myMessageWindow
A window to display messages, warnings and error in.
void enableSaveShapesMenu()
enable save shapes
The main window of the Netedit.
static bool endsWith(const std::string &str, const std::string suffix)
Checks whether a given string ends with the suffix.
std::string myShapesFile
filename for load/save shapes
#define GUIDesignSplitterMDI
MDI Splitter.
void hotkeyFocusFrame()
handle focus frame keypress
hot key <ESC> abort current edit operation
long onCmdClearMsgWindow(FXObject *, FXSelector, void *)
called when the command/FXCall clear message windows is executed
mode for editing additional
void loadConfigOrNet(const std::string &file, bool isNet, bool useStartupOptions, bool newNet=false)
begins the loading of a netconvert configuration or a a network
const std::string & getMsg() const
Returns the message.
virtual void create()
Creates the main window (required by FOX)
long onCmdJoinJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->join junctions
void unSet(const std::string &name, bool failOnNonExistant=true) const
Marks the option as unset.
const std::vector< NBEdge::Lane > & getLanes() const
Returns the lane definitions.
bool hadDependentBuild
check if had dependent build
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
The representation of a single edge during network building.
double getTrackerInterval() const
get current tracker interval (pure virtual but we don't need it)
static void initIcons(FXApp *a)
Initiate GUIIconSubSys.
GNEUndoList * myUndoList
the one and only undo list
long onCmdComputeJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions
static void resetTextures()
Reset textures.
void registerMsgHandlers()
register and unregister message handlers
long onCmdSetMode(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits an edit-mode hotkey
void handleEvent_NetworkLoaded(GUIEvent *e)
handle event of type Network loaded
#define GUIDesignStatusBar
design used in status bar
GNENet * myNet
pointer of the net
bool continueWithUnsavedAdditionalChanges()
warns about unsaved changes in additionals and gives the user the option to abort ...
void loadConfigOrNet(const std::string file, bool isNet, bool isReload=false, bool useStartupOptions=false, bool newNet=false)
starts to load a netimport configuration or a network */
void setWindowSizeAndPos()
perform initial window positioning and sizing according to user options / previous call ...
#define GUIDesignToolBarGrip
design for toolbar grip (used to change the position of toolbar with mouse)
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 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...
long onCmdAbout(FXObject *, FXSelector, void *)
called when the command/FXCall show about dialog is executed
void setEditModeFromHotkey(FXushort selid)
sets edit mode (from hotkey)
bool cleanInvalidCrossings(GNEUndoList *undoList)
clear invalid crossings
FXString gCurrentFolder
The folder used as last.
long onCmdSaveShapes(FXObject *, FXSelector, void *)
called when the command/FXCall save shapes is executed
mode for editing crossing
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
virtual void eventOccured()
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()
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
mode for inspecting object attributes
static FXString getFilename2Write(FXWindow *parent, const FXString &header, const FXString &extension, FXIcon *icon, FXString ¤tFolder)
Returns the file name to write.
virtual FXGLCanvas * getBuildGLCanvas() const
long onCmdEditChosen(FXObject *, FXSelector, void *)
called when the command/FXCall edit chosen is executed
void updateControls()
update control contents after undo/redo or recompute
const std::vector< GUISUMOAbstractView::Decal > & getDecals() const
Returns the parsed decals.
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
int getNumberOfAdditionals(SumoXMLTag type=SUMO_TAG_NOTHING) const
Returns the number of additionals of the net.
long onUpdReload(FXObject *, FXSelector, void *)
called when the update/FXCall reload is executed
#define WRITE_WARNING(msg)
A single child window which contains a view of the simulation area.
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
Reload the previously loaded simulation.
The XML-Handler for network loading.
static void setDefaultOptions(OptionsCont &oc)
sets required options for proper functioning
FXHorizontalFrame * myCartesianFrame
FXDEFMAP(GNEApplicationWindow) GNEApplicationWindowMap[]
FXMenuPane * myProcessingMenu
long onCmdSaveAdditionalsAs(FXObject *, FXSelector, void *)
called when the command/FXCall save additionals as is executed
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static FXint fxexecute(FXString link)
long onCmdEditViewport(FXObject *, FXSelector, void *)
called if the user press key v to open zoom editor
std::vector< FXMDIChild * > mySubWindows
long onCmdOptions(FXObject *, FXSelector, void *)
called if the user selects Processing->Configure Options
GUIEventType getOwnType() const
returns the event type
FXMenuPane * myWindowsMenu
static void close()
close GUITextureSubSys
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)
Locate polygons - button.
void applyViewport(GUISUMOAbstractView *view) const
Sets the viewport which has been parsed.
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
SUMOTime getCurrentSimTime() const
get current simulation time (pure virtual but we don't need it)
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.
hot key <ENTER> accept current operation
bool continueWithUnsavedShapeChanges()
warns about unsaved changes in shapes and gives the user the option to abort
void setSnapshots(GUISUMOAbstractView *view) const
Makes a snapshot if it has been parsed.
long onCmdSaveAsPlainXML(FXObject *, FXSelector, void *)
called when the command/FXCall save as plain xml is executed
clean junctions without edges
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
long onCmdOpenAdditionals(FXObject *, FXSelector, void *)
called when the command/FXCall open additionals is executed
send when a error occured
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
mode for creating polygons
void setTarget(FXObject *tgt)
set the target
FXCursor * getDefaultCursor()
get default cursor
Load additional file with poi and polygons.
mode for selecting objects
Locate junction - button.
long onCmdCleanJunctions(FXObject *, FXSelector, void *)
called if the user selects Processing->clean junctions
Loads a file previously loaded.
GNEShapeHandler(const std::string &file, GNENet *net)
Constructor.
virtual ~GNEApplicationWindow()
Destructor.
long onUpdOpen(FXObject *, FXSelector, void *)
called when the command/FXCall on update open executed
GNELoadThread * myLoadThread
the thread that loads the network
FXStatusBar * myStatusbar
The status bar.
long onCmdOpenShapes(FXObject *, FXSelector, void *)
called when the command/FXCall open shapes is executed
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
save network as plain XML
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.
double getLength() const
Returns the computed length of the edge.
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
virtual void detach()
detaches the tool/menu bar
FXLabel * myCartesianCoordinate
Labels for the current cartesian and geo-coordinate.
void setViewport(GUISUMOAbstractView *view)
Sets the default viewport.
MFXMutex myTrackerLock
A lock to make the removal and addition of trackers secure.
void setSelector(FXSelector sel)
set the selector
long onCmdDel(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits del
mode for connecting lanes
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
void removeSolitaryJunctions(GNEUndoList *undoList)
removes junctions that have no edges
static void close()
close GUIIconSubSys
FXToolBarShell * myMenuBarDrag
FXHorizontalFrame * myGeoFrame
A storage for options typed value containers)
FXMenuCommand * mySaveAdditionalsMenuCommand
FXMenuCommand for enable or disable save additionals.
long onCmdClose(FXObject *, FXSelector, void *)
called when the command/FXCall close is executed
void computeEverything(GNEApplicationWindow *window, bool force=false, bool volatileOptions=false, std::string additionalPath="", std::string shapePath="")
trigger full netbuild computation param[in] window The window to inform about delay param[in] force W...
void clear()
Clears the list of selected objects.
std::string myAdditionalsFile
filename for load/save additionals
FXMDIClient * myMDIClient
The multi view panel.
send when a simulation has been loaded
void handleEvent_Message(GUIEvent *e)
hanlde event of type message
void saveJoined(OptionsCont &oc)
save log of joined junctions (and nothing else)
FXGLCanvas * getBuildGLCanvas() const
get build OpenGL Canvas
send when a warning occured
#define GUIDesignHorizontalFrameStatusBar
Horizontal frame used in status bar.
long onCmdAbort(FXObject *sender, FXSelector sel, void *ptr)
called if the user hits esc
long onCmdSaveJoined(FXObject *, FXSelector, void *)
called when the command/FXCall save joined is executed
An XML-handler for visualisation schemes.
const FXString myTitlePrefix
the prefix for the window title
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
void dependentBuild()
build dependent
void clear()
Clears the window.
NBEdge * getNBEdge()
returns the internal NBEdge
~GNEShapeHandler()
Destructor.
long onCmdComputeJunctionsVolatile(FXObject *, FXSelector, void *)
called if the user selects Processing->compute junctions with volatile options
void hotkeyDel()
handle del keypress
#define WRITE_MESSAGE(msg)
int getNumberOfShapes() const
get number of shapes
static void initTextures(FXApp *a)
Initiate GUITextureSubSys for textures.
GUISelectedStorage gSelected
A global holder of selected objects.
void hotkeyEnter()
handle enter keypress
long onCmdSaveAsNetwork(FXObject *, FXSelector, void *)
called when the command/FXCall save network as is executed
GNEViewNet * getView()
convenience method
A logging window for the gui.
GNEViewNet * getViewNet() const
get view net
static FXIcon * getIcon(GUIIcon which)
returns a icon previously defined in the enum GUIIcon
void saveAdditionals(const std::string &filename)
save additional elements of the network
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
long onKeyPress(FXObject *o, FXSelector sel, void *data)
called when a key is pressed
long onUpdSaveNetwork(FXObject *, FXSelector, void *)
called when the update/FXCall save network is executed
FXMenuPane * myLocatorMenu
static const Position INVALID
used to indicate that a position is valid
Locate addtional structure - button.
void saveShapes(const std::string &filename)
save shapes elements of the network
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
void setShapesFile(const std::string &shapesFile)
set shapes file
Open viewport editor - button.
compute junctions with volatile options