-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathline.h
90 lines (65 loc) · 1.55 KB
/
line.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
#ifndef LINE_H
#define LINE_H
#include <QObject>
#include <QVector>
#include <QPointF>
#include <QPainter>
#include <QPalette>
#include <QDebug>
#include <QTime>
#include <QPen>
class Line : public QObject
{
Q_OBJECT
public:
explicit Line(int x, int y, int w, int h, QObject *parent = 0);
void DrawLine(QPainter *painter);
void getXminMax();
void getYminMax();
void SetColor(QColor col);
void SetLineWidth(int width);
void SetLineStyle(Qt::PenStyle style);
void MoveLine(int x, int y);
void SetDefaultScale();
void RedrawLine();
void SetScale(float scaleX, float scaleY);
float GetXscale(void);
float GetYscale(void);
private:
QVector<long long int> x_data_list;
QVector<QVector<float> > y_data_list;
QPainterPath path;
QPainterPathStroker stroker;
QPainterPath stroke;
//Line properties
QPen linePen;
QColor lineColor;
Qt::PenStyle lineStyle;
Qt::PenCapStyle lineCapStyle;
Qt::PenJoinStyle lineJoinStyle;
int lineWidth;
QBrush lineBrush;
QTransform m;
bool ready;
int graph_x;
int graph_y;
int graph_w;
int graph_h;
double min_x;
double max_x;
double min_y;
double max_y;
double ax;
double ay;
int x_interval;
int dx;
float y_interval;
float dy;
float scaleX;
float scaleY;
protected slots:
void setLineData(QVector<long long int> x_data, QVector<QVector<float> > y_data);
signals:
void minMaxValues(double x_min, double x_max, double y_min, double y_max);
};
#endif // LINE_H