MainWindow.hpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. // Include modules
  3. #include "OSGWidget.hpp"
  4. #include "NoMeshWidget.hpp"
  5. #include "EditWidget.hpp"
  6. #include "ProjectStore.hpp"
  7. #include "enums.hpp"
  8. // Include dependencies
  9. #include <QMainWindow>
  10. #include <QCloseEvent>
  11. QT_BEGIN_NAMESPACE
  12. namespace Ui { class MainWindow; }
  13. QT_END_NAMESPACE
  14. class MainWindow: public QMainWindow {
  15. Q_OBJECT
  16. public:
  17. static MainWindow* getInstance();
  18. MainWindow(QWidget* parent = nullptr);
  19. ~MainWindow();
  20. void renderView(GuiView view);
  21. OSGWidget* getOsgWidget();
  22. ProjectStore* getStore();
  23. EditWidget* getEditWiget();
  24. protected:
  25. virtual void closeEvent(QCloseEvent *event);
  26. private:
  27. void newFile();
  28. void load();
  29. bool save();
  30. bool saveAs();
  31. void close();
  32. void cleanup();
  33. bool saveChangesPopup();
  34. Ui::MainWindow* ui;
  35. OSGWidget* osgWidget;
  36. NoMeshWidget* noMeshWidget;
  37. EditWidget* editWidget;
  38. ProjectStore* projectStore;
  39. QMenu* fileMenu;
  40. QAction* newAct;
  41. QAction* loadAct;
  42. QAction* saveAct;
  43. QAction* saveAsAct;
  44. QAction* closeAct;
  45. };