-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglwidget.h
52 lines (41 loc) · 977 Bytes
/
glwidget.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
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QtOpenGL/QGLWidget>
#include <QWidget>
#include <QTimer>
class GLWidget : public QGLWidget
{
Q_OBJECT
public:
explicit GLWidget(QWidget *parent = 0);
~GLWidget();
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
QSize minimumSizeHint() const;
QSize sizeHint() const;
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
//void keyPressEvent(QKeyEvent *event);
void displaylatest();
void displayolder();
signals:
// signaling rotation from mouse movement
void xRotationChanged(int angle);
void yRotationChanged(int angle);
void zRotationChanged(int angle);
public slots:
// slots for xyz-rotation slider
void setXRotation(int angle);
void setYRotation(int angle);
void setZRotation(int angle);
private:
void draw();
int xRot;
int yRot;
int zRot;
QTimer timer;
QPoint lastPos;
};
#endif // GLWIDGET_H