MobileRT  1.0
A multi platform C++ CPU progressive Ray Tracer.
mainwindow.h
Go to the documentation of this file.
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include "config.h"
5 #include "MobileRT/Config.hpp"
6 
7 #include <QGraphicsScene>
8 #include <QKeyEvent>
9 #include <QMainWindow>
10 #include <vector>
11 
12 namespace Ui {
13  class MainWindow;
14 }
15 
16 class MainWindow : public QMainWindow {
17  Q_OBJECT
18 
19 public:
20  explicit MainWindow(QWidget *parent = nullptr);
21  ~MainWindow() override;
22  void draw(const ::std::vector<::std::int32_t> &bitmap, ::std::int32_t width, ::std::int32_t height);
23  void setImage(const ::MobileRT::Config &config, const bool async);
24 
25 private:
26  void restart();
27 
28 private:
29  void keyPressEvent(QKeyEvent *keyEvent) override;
30 
31 private:
33  QGraphicsScene *const m_graphicsScene {new QGraphicsScene {}};
34  QPixmap m_pixmap {};
35  QGraphicsPixmapItem *m_graphicsPixmapItem {};
36  QTimer *m_timer {};
37  bool m_async {};
38  ::MobileRT::Config m_config {};
39 
40 public slots:
41  void update_image();
42  void on_actionRender_triggered();
43 
44 private slots:
45  void select_obj();
46  void select_config();
47  void exit_app();
48  void about();
49  void stop_render();
50 };
51 
52 #endif // MAINWINDOW_H
Definition: Config.hpp:12
Definition: ui_about.h:63
Ui::MainWindow * m_ui
Definition: mainwindow.h:32
Definition: ui_mainwindow.h:123
Definition: mainwindow.h:16