-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmainwindow.h
109 lines (93 loc) · 2.18 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
class QMenu;
class QLabel;
class QAction;
class QActionGroup;
class QDoubleSpinBox;
class QProgressBar;
namespace trimeshVec {
class CAccessObj;
}
namespace RayTracer {
class Engine;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow();
MainWindow(const QString &fileName);
~MainWindow();
protected:
bool eventFilter(QObject *obj, QEvent *e);
QSize sizeHint() const;
private:
void setupUi();
void createActions();
void createMenus();
void createToolBars();
void createStatusBar();
void init();
void initRenderSystem();
void openObjFile(const QString& fileName);
void renderObj();
void saveAsImageFile(const QString& fileName);
void setResolution(int width, int height);
QString strippedName(const QString& fullFileName);
void rotateBy(double xAngle, double yAngle, double zAngle);
void updateInformationBar();
private slots:
void open();
void saveAs();
void resolution();
void shadeModel(QAction* act);
void toggleView(QAction* act);
void newFrustumOrLight();
void about();
private:
QWidget *mImgView;
QImage mImage;
QMenu *mFileMenu;
QMenu *mViewMenu;
QMenu *mEditMenu;
QMenu *mHelpMenu;
QToolBar *mFileToolBar;
QToolBar *mEditToolBar;
QToolBar *mCameraLightToolBar;
QAction *mOpenAct;
QAction *mQuitAct;
QAction *mSaveAsImageAct;
QAction *mResolutionAct;
QActionGroup *mShadeActGroup;
QAction *mRenderAct;
QActionGroup *mViewActGroup;
QAction *mViewToolBarAct;
QAction *mInfoToolBarAct;
QAction *mAboutAct;
QAction *mAboutQtAct;
QDoubleSpinBox *mSpinEyeX;
QDoubleSpinBox *mSpinEyeY;
QDoubleSpinBox *mSpinEyeZ;
QDoubleSpinBox *mSpinLightX;
QDoubleSpinBox *mSpinLightY;
QDoubleSpinBox *mSpinLightZ;
// info toolbar
QToolBar *mInfoToolBar;
QLabel *mInfoLabel;
long mLastCostTime;
QAction *mTraceDepthAct;
QAction *mRegularSamplesAct;
// status bar
QLabel *mResLabel;
QProgressBar *mProgressBar;
trimeshVec::CAccessObj *mpAccessObj;
RayTracer::Engine *mEngine;
// mouse operations
QPoint lastPos;
int xRot;
int yRot;
int zRot;
};
#endif // MAINWINDOW_H