-
Notifications
You must be signed in to change notification settings - Fork 15
/
transformwidget.h
68 lines (49 loc) · 1.24 KB
/
transformwidget.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
#ifndef TRANSFORMWIDGET_H
#define TRANSFORMWIDGET_H
#include <QtOpenGL>
#include "glutils.h"
enum TransformWidgetState
{
NONE,
TRANS_X,
TRANS_Y,
TRANS_Z,
ROT_X,
ROT_Y,
ROT_Z,
SCALE_X,
SCALE_Y,
SCALE_Z,
SCALE_ALL,
NUM_STATES
};
class TransformWidget
{
public:
TransformWidget();
void DrawGL(const float cam_width, const int screen_height);
void DrawSelectionGL(const float cam_width, const int screen_height);
void SetVisible(const bool b);
bool GetVisible() const;
void SetP(const QVector3D & p);
QVector3D GetP() const;
void SetX(const QVector3D & p);
QVector3D GetX() const;
void SetY(const QVector3D & p);
QVector3D GetY() const;
void SetZ(const QVector3D & p);
QVector3D GetZ() const;
void SetState(const TransformWidgetState s);
TransformWidgetState GetState() const;
void mousePressEvent(const int dx, const int dy);
void mouseMoveEvent(const int dx, const int dy);
void mouseReleaseEvent(const int dx, const int dy);
private:
bool visible;
TransformWidgetState state;
QVector3D p; //origin
QVector3D x; //x direction
QVector3D y; //y direction
QVector3D z; //z direction
};
#endif // TRANSFORMWIDGET_H