-
Notifications
You must be signed in to change notification settings - Fork 7
/
glwidget.h
108 lines (87 loc) · 2.27 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#ifndef GLWIDGET_H
#define GLWIDGET_H
#include <QOpenGLWidget>
#include <sbs2common.h>
#include "mycallback.h"
#include "scalpmap.h"
class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit GLWidget(MyCallback* myCallback_, QWidget *parent = 0);
private:
QBasicTimer *timer;
QVector<QPainterPath> channels;
QVector<QPainterPath> channelsSpectro;
QVector<QLine> gridLines;
QVector<QLine> gridLinesSpectro;
int w;
int h;
double aspectRatio;
int values;
int valuesSpectro;
int valueToValueDistance;
int valueToValueSpectroDistance;
int currentPosition;
int pathGenerated;
int pathSpectroGenerated;
double gyroX;
double gyroY;
double gyroPosX;
double gyroPosY;
double gyroGravity;
QVector<QList<int> > rawValues;
QVector<QList<double> > rawValuesSpectro;
int startY;
double scale;
double lastD;
double startX;
double currentX;
MyCallback* myCallback;
int paused;
int timeSeries;
int filterSetting;
int scalpmapVisible;
QRect toggleFilterRect;
QRect toggleTimeSeriesRect;
QRect togglePlayRect;
QRect quitRect;
QRect toggleHardwareRect;
QRect toggleScalpmapRect;
QString filterText;
QString timeSeriesText;
QString playText;
QString scalpmapText;
ScalpMap* scalpmap;
private:
void paintGL ();
void generatePaths();
void generateGrid();
void generatePathsSpectro();
void generateGridSpectro();
void generateUI();
void initializeGL();
void resizeGL(int w, int h);
void timerEvent(QTimerEvent *);
void toggleFilter();
void toggleTimeSeries();
void togglePlay();
void toggleHardware();
void toggleScalpmap();
//Interaction
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent *event);
signals:
void turnFilterOn(int fbandLow, int fbandHigh);
void turnSpectrogramOn(int samples, int length, int delta);
void turnFilterOff();
void turnSpectrogramOff();
public slots:
//void update(QVector<QList<int> > vs);
void update(int index);
void updateSpectro();
void gyroSlot(int gyroX_, int gyroY_);
void kill();
};
#endif // GLWIDGET_H