-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewerwidget.h
61 lines (48 loc) · 1.62 KB
/
viewerwidget.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
#ifndef VIEWERWIDGET_H
#define VIEWERWIDGET_H
#include <QOpenGLWidget>
#include <QFileDialog>
#include <QQuaternion>
#include "meshprocessor.h"
namespace Ui {
class ViewerWidget;
}
class ViewerWidget : public QOpenGLWidget
{
Q_OBJECT // mark that this class contains slots and signals
public:
explicit ViewerWidget(QWidget *parent = 0);
~ViewerWidget();
private:
Ui::ViewerWidget *ui;
QFileDialog fileGetter;
QPoint startPos;
bool rotateMode, zoomMode, moveMode;
QQuaternion quaternion;
float rotAngle, rotX, rotY, rotZ,
zoomIn, overZoom,
moveX, moveY;
MeshProcessor meshProc;
float fovFactor; // tan(0.5*field of view), where field of view is the angle from top to bottom
float initSceneDistance; // initial distance from camera to center of main object
GLdouble left, right, top, bottom, nearVal, farVal;
GLfloat alpha; // 1 = opaque, 0 = transparent
GLfloat alpha_step;
GLint frame; // start from 0
bool reverse;
void showNextFrame();
void showPrevFrame();
void reverseFlowDirection();
void rotate(QPoint);
void zoom(QPoint);
void moveTo(QPoint);
protected:
void initializeGL() Q_DECL_OVERRIDE;
void resizeGL(int w, int h) Q_DECL_OVERRIDE;
void paintGL() Q_DECL_OVERRIDE;
void keyPressEvent(QKeyEvent*) Q_DECL_OVERRIDE;
void mousePressEvent(QMouseEvent*) Q_DECL_OVERRIDE;
void mouseMoveEvent(QMouseEvent*) Q_DECL_OVERRIDE;
void mouseReleaseEvent(QMouseEvent*) Q_DECL_OVERRIDE;
};
#endif // VIEWERWIDGET_H