forked from challinan/pmd-demo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
helper.h
68 lines (46 loc) · 1.63 KB
/
helper.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
#ifndef HELPER_H
#define HELPER_H
#include <QBrush>
#include <QFont>
#include <QPen>
#include <QWidget>
#include "data.h"
class Helper
{
public:
Helper();
public:
void initialized(const int gW, const int gH, TGraphType gType, float gXScale);
QRect animate(signed short int xGraphData);
void paintGraph(QPainter *painter);
void clearGraph(QPainter *painter);
int getGraphHeight(){ return graphHeight; }
int getGraphWidth() { return graphWidth; }
void setGraphXScale(float xScale);
float getGraphXScale();
void setGraphYScale(float yScale);
float getGraphYScale();
TGraphType getGraphType() { return graphType; }
QPointF getGraphPosition() { return graphPoint2; }
QRectF getGraphRectDirty();
QRectF getGraphRectEraser();
void resetValues();
private:
float graphXScale;
float graphYScale;
float graphXMaxUnit; /* Number of units in plug-in area on x-axis. */
float graphYMaxUnit; /* Number of units in plug-in area on y-axis. */
float graphXPerUnit; /* Calculating # of pixels in x-axis per unit. */
float graphYPerUnit; /* Calculating # of pixels in y-axis per unit. */
float graphYOffset; /* Calculating y-axis offset value needed to shift the graph to the middle of the plugin area. */
float graphCellWidth; /* Graph cell width */
TGraphType graphType;
QColor graphColor;
int graphWidth;
int graphHeight;
QPointF graphPoint1;
QPointF graphPoint2;
QImage *graphBgImage;
signed short int graphData;
};
#endif