-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQGLMitkWidget.h
53 lines (45 loc) · 1.22 KB
/
QGLMitkWidget.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
#ifndef QGLMITKWIDGET_H
#define QGLMITKWIDGET_H
#include <QGLWidget>
class mitkSceneBase;
class mitkScene;
class mitkImageScene;
class QGLMitkWidget : public QGLWidget
{
Q_OBJECT
public:
QGLMitkWidget(QWidget *parent);
virtual ~QGLMitkWidget();
//传入MITK场景
void SetMitkScene(mitkSceneBase *scene);
//取得当前内部的MITK场景
mitkSceneBase* GetMitkScene();
//在内部创建一个标准的mitkScene
mitkScene* CreateMitkScene();
//在内部创建一个标准的mitkImageScene
mitkImageScene* CreateMitkImageScene();
//显示帧率开关
void ShowFrameRate(bool show = true){ m_showFrameRate = show; }
protected:
//消息响应
virtual void initializeGL();
virtual void resizeGL(int width, int height);
virtual void glDraw();
virtual void paintGL();
virtual void mouseMoveEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
virtual void mouseReleaseEvent(QMouseEvent *event);
virtual void wheelEvent(QWheelEvent *event);
private:
void _initScene();
void _removeScene();
//真正的容器,声明为widget的一个成员,避免多继承
class _MitkSceneContainer;
_MitkSceneContainer *m_SceneContainer;
//内部的场景
mitkSceneBase *m_MitkScene;
//当前显示帧率的状态
bool m_showFrameRate;
double m_fps;
};
#endif // QGLMITKWIDGET_H