MainWindow.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. void showOptiTrackSanityLineError();
  26. void showOptiTrackSanityPlaneError();
  27. void showOptiTrackSanitySuccess();
  28. void showSteamVRTrackCollisionCheckError();
  29. void showSteamVRTrackCollisionCheckSuccess();
  30. protected:
  31. virtual void closeEvent(QCloseEvent *event);
  32. private:
  33. void newFile();
  34. void load();
  35. bool save();
  36. bool saveAs();
  37. void close();
  38. void cleanup();
  39. bool saveChangesPopup();
  40. bool isRenderingPopup();
  41. Ui::MainWindow* ui;
  42. OSGWidget* osgWidget;
  43. NoMeshWidget* noMeshWidget;
  44. EditWidget* editWidget;
  45. ProjectStore* projectStore;
  46. QMenu* fileMenu;
  47. QAction* newAct;
  48. QAction* loadAct;
  49. QAction* saveAct;
  50. QAction* saveAsAct;
  51. QAction* closeAct;
  52. };