SPH
MainWindow.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "gui/Project.h"
4 #include "gui/Settings.h"
5 #include "io/Path.h"
7 #include <wx/frame.h>
8 
9 class wxMenu;
10 class wxAuiManager;
11 class wxAuiNotebook;
12 
14 
15 class Controller;
16 class IPluginControls;
17 class RunPage;
18 class NodeWindow;
19 class INode;
20 
21 wxAuiNotebook* findNotebook();
22 
23 class MainWindow : public wxFrame {
24  friend class NodeManagerCallbacks;
25 
26 private:
27  wxAuiNotebook* notebook;
28  NodeWindow* nodePage;
29 
30  struct RunData {
31  AutoPtr<Controller> controller;
32  bool isRun;
33  };
34 
36 
37  Path projectPath;
38  bool savedFlag = true;
39  wxMenu* runMenu;
40 
41 public:
42  MainWindow(const Path& openPath = Path());
43 
44 private:
45  wxMenu* createProjectMenu();
46 
47  wxMenu* createRunMenu();
48 
49  wxMenu* createAnalysisMenu();
50 
51  wxMenu* createResultMenu();
52 
53  void addPage(SharedPtr<INode> node, const RunSettings& globals, const std::string pageName);
54 
55  bool removeAll();
56 
57  void saveAs();
58 
59  void save();
60 
61  void open(const Path& openPath, const bool setDefaults);
62 
63  void load(const Path& openPath = Path(""));
64 
65  void setProjectPath(const Path& newPath);
66 
67  void markSaved(const bool saved);
68 
69  void onClose(wxCloseEvent& evt);
70 
71  void enableMenus(const Size id);
72 
73  void enableRunMenu(const bool enableControls, const bool enableCamera);
74 
75  bool closeRun(const Size id);
76 
77  int checkUnsavedSession();
78 };
79 
NAMESPACE_SPH_BEGIN
Definition: BarnesHut.cpp:13
uint32_t Size
Integral type used to index arrays (by default).
Definition: Globals.h:16
wxAuiNotebook * findNotebook()
Definition: MainWindow.cpp:28
#define NAMESPACE_SPH_END
Definition: Object.h:12
Object representing a path on a filesystem, similar to std::filesystem::path in c++17.
Simple non-owning wrapper of pointer.
Main GUI class connection the simulation with UI controls.
Definition: Controller.h:42
Provides an interface for running a simulation.
Definition: Node.h:53
MainWindow(const Path &openPath=Path())
Definition: MainWindow.cpp:112
Object representing a path on a filesystem.
Definition: Path.h:17
Main frame of the application.
Definition: RunPage.h:44