-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwindow.h
86 lines (69 loc) · 1.76 KB
/
mainwindow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//
// Created by Runze on 30/06/2023.
//
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QWidget>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QSpinBox>
#include <QComboBox>
#include <QPushButton>
#include <QTextEdit>
#include <QLabel>
#include <QScrollArea>
#include <QPixmap>
#include <QResizeEvent>
#include <QFrame>
#include <QCheckBox>
#include <QFuture>
#include <QtConcurrent/QtConcurrent>
#include <QProgressBar>
#include "RenderEngine.h"
//#include "RayTracer.h"
//#include "Scene.h"
class MainWindow : public QMainWindow {
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
void createRendererUI(QVBoxLayout *leftLayout);
virtual ~MainWindow();
protected:
void clearOutput();
void renderInBackground(const std::string &filename);
void resizeEvent(QResizeEvent* event) override;
void updateImageLabel();
private slots:
void startRendering();
void toggleOpenMP(bool checked);
void updateRenderTime(qint64 elapsedTime);
void handleProgressUpdate(int progress);
signals:
void renderTimeUpdated(qint64 elapsedTime);
void progressUpdated(int progress);
private:
QVBoxLayout *mainLayout;
QHBoxLayout *sceneLayout;
QHBoxLayout *samplesLayout;
QHBoxLayout *methodLayout;
QHBoxLayout *buttonLayout;
QLabel *sceneLabel;
QLabel *samplesLabel;
QLabel *methodLabel;
QComboBox *sceneComboBox;
QSpinBox *samplesSpinBox;
QComboBox *methodComboBox;
QPushButton *renderButton;
QPushButton *clearOutputButton;
QProgressBar *progressBar;
QTextEdit *outputTextEdit;
QLabel *imageLabel;
QPixmap originalPixmap;
private:
bool useOpenMP;
bool renderingInProgress;
RenderEngine myRender;
};
#endif