MainWindow.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. void showErrorMessage(std::string message, std::string title = "Error");
  25. protected:
  26. virtual void closeEvent(QCloseEvent *event);
  27. private:
  28. void newFile();
  29. void load();
  30. bool save();
  31. bool saveAs();
  32. void close();
  33. void cleanup();
  34. bool saveChangesPopup();
  35. Ui::MainWindow* ui;
  36. OSGWidget* osgWidget;
  37. NoMeshWidget* noMeshWidget;
  38. EditWidget* editWidget;
  39. ProjectStore* projectStore;
  40. QMenu* fileMenu;
  41. QAction* newAct;
  42. QAction* loadAct;
  43. QAction* saveAct;
  44. QAction* saveAsAct;
  45. QAction* closeAct;
  46. };