MainWindow.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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. bool isRenderingPopup();
  36. Ui::MainWindow* ui;
  37. OSGWidget* osgWidget;
  38. NoMeshWidget* noMeshWidget;
  39. EditWidget* editWidget;
  40. ProjectStore* projectStore;
  41. QMenu* fileMenu;
  42. QAction* newAct;
  43. QAction* loadAct;
  44. QAction* saveAct;
  45. QAction* saveAsAct;
  46. QAction* closeAct;
  47. };