-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglwidget.h
87 lines (63 loc) · 1.95 KB
/
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
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
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QGLWidget>
#include "afnisurface.h"
#include "surface.h"
#include <QGLFramebufferObject>
#include "surfaceset.h"
#include "data.h"
#include "qprocess.h"
#include "displayparameters.h"
//#include "sumainterface.cpp"
#include "qmutex.h"
class GLWidget : public QGLWidget
{
Q_OBJECT
public:
GLWidget(QWidget *parent = 0, const QGLWidget * shareWidget = 0, Qt::WindowFlags f = 0);
~GLWidget();
void loadData(QString ssl, QString ssr, QString scons, QString overlayl, QString overlayr, float clipthr);
void setData(GLWidget* glw);
void setData(Data* data);
void setDisplayParameters(DisplayParameters* dp);
Data* data;
GLfloat* view;
void saveView(QString filename);
void loadView(QString filename);
//SUMAInterface* si;
void orient(QString ori);
float bg;
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void wheelEvent (QWheelEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void keyPressEvent(QKeyEvent *event);
void setView();
void render(bool shift, bool allNodes=false);
QMatrix4x4* modelMatrix();
QMatrix4x4* projectionMatrix();
QVector3D world; //world coordinates of selected point
QProcess* process; //System process for calling DriveSuma after selecting a point
private:
QPoint lastPos;
float ar;
float brainAlpha, stuffAlpha, glyphAlpha, glyphRadius;
DisplayParameters* dp;
double scale;
bool select(QMouseEvent *event);
bool screen, cursor;
mutable QMutex mutex;
QString o; //for the command line orientation (iaplr, with s being the default)
public slots:
void screenshot(QString name, double resolution=1);
void updateParameters();
void updateNode(int i);
signals:
void dataChanged();
void selected();
};
#endif