-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirtglobject.h
112 lines (104 loc) · 1.75 KB
/
virtglobject.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
110
111
112
#ifndef VIRTGLOBJECT_H
#define VIRTGLOBJECT_H
#include <QObject>
#include <QVector3D>
class VirtGLObject: public QObject{
public:
enum {
TYPE_VGL = 0
};
VirtGLObject(QObject *parent = NULL):
QObject(parent),
m_is_watchXY(false),
m_is_watch(false)
, m_is_enable(true)
, m_type(TYPE_VGL)
{
}
/**
* @brief init
* init object
*/
virtual void init() = 0;
/**
* @brief draw
* draw primitives
*/
virtual void draw() = 0;
/**
* @brief tick
* for timer tick
*/
virtual void tick() = 0;
/**
* @brief position
* return object's position
* @return
*/
virtual QVector3D position() const = 0;
/**
* @brief is_watchXY
* watch in XY plane
* @return
*/
bool is_watchXY() const { return m_is_watchXY; }
/**
* @brief set_is_watchXY
* set watcher for XY plane
* @param value
*/
void set_is_watchXY(bool value) {
m_is_watchXY = value;
if(m_is_watch && value)
m_is_watch = false;
}
/**
* @brief is_watch
* @return
*/
bool is_watch() const { return m_is_watch; }
/**
* @brief set_watch
* @param value
*/
void set_is_watch(bool value){
m_is_watch = value;
if(m_is_watchXY && value)
m_is_watchXY = false;
}
/**
* @brief is_enable
* @return
*/
bool is_enable() const {
return m_is_enable;
}
/**
* @brief set_is_enable
* @param value
*/
void set_enable(bool value){
m_is_enable = value;
}
/**
* @brief type
* @return
*/
int type() const{
return m_type;
}
protected:
/**
* @brief setType
* @param value
*/
void setType(int value){
m_type = value;
}
private:
bool m_is_watchXY;
bool m_is_watch;
bool m_is_enable;
int m_type;
};
#endif // VIRTGLOBJECT_H