-
Notifications
You must be signed in to change notification settings - Fork 0
/
seedglwidget.h
69 lines (53 loc) · 1.33 KB
/
seedglwidget.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
#ifndef SEEDGLWIDGET_H
#define SEEDGLWIDGET_H
#include <Windows.h>
#include "glwidget.h"
#include <QMouseEvent>
#include <vector>
#include "TensorData.h"
#include "SeedData.h"
using namespace std;
typedef double * Point;
class SeedGLWidget : public GLWidget
{
Q_OBJECT
public:
SeedGLWidget(QWidget *parent);
~SeedGLWidget();
private:
static const int _MaxSeedCount;
TensorData * _tensorData;
SeedData * _seedData;
int _viewportHeight;
vector<Point> _penTrack;
bool _bDrawing;
bool _bAddRegion;
int _minDrawX, _maxDrawX;
int _minDrawY, _maxDrawY;
GLuint _fboId;
GLuint _texId;
int _currentSeedIndex;
uchar _currentSeedColor [3];
void drawPenTrack ();
void drawSeedRegion ();
void selectRegion ();
bool initFBO ();
protected:
void initializeGL();
void resizeGL(int width, int height);
void paintGL();
void mousePressEvent (QMouseEvent *e);
void mouseMoveEvent (QMouseEvent* e);
void mouseReleaseEvent(QMouseEvent *e);
void wheelEvent( QWheelEvent * e);
virtual void setRotationMatrix();
public:
void setVolumeData (VolumeData * volData);
void setSeedData (SeedData * seedData);
public slots:
void setViewpoint(int v);
void setCurrentSeed (int index, unsigned color);
void zoomIn ();
void zoomOut ();
};
#endif // SEEDGLWIDGET_H