-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmainwindow.h
95 lines (83 loc) · 1.99 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
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
class QMenu;
class QAction;
class QActionGroup;
class CAccessObj;
class CScanLine;
class QDoubleSpinBox;
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 drawCubeTest();
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);
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 *mShadeFlatAct;
QAction *mShadeSmoothAct;
QAction *mToggleLightingAct;
QAction *mRandomColorAct;
QAction *mPointLightAct;
QAction *mDirLightAct;
QActionGroup *mViewActGroup;
QAction *mViewToolBarAct;
QAction *mAboutAct;
QAction *mAboutQtAct;
QAction *mMouseOpAct;
QDoubleSpinBox *mSpinEyeX;
QDoubleSpinBox *mSpinEyeY;
QDoubleSpinBox *mSpinEyeZ;
QDoubleSpinBox *mSpinLightX;
QDoubleSpinBox *mSpinLightY;
QDoubleSpinBox *mSpinLightZ;
CAccessObj *mpAccessObj;
CScanLine *mpRenderSystem;
// mouse operations
QPoint lastPos;
int xRot;
int yRot;
int zRot;
};
#endif // MAINWINDOW_H