1 | /* |
2 | * This file is part of KQuickCharts |
3 | * SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl> |
4 | * |
5 | * SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
6 | */ |
7 | |
8 | #ifndef LINECHARTNODE_H |
9 | #define LINECHARTNODE_H |
10 | |
11 | #include <QColor> |
12 | #include <QSGNode> |
13 | |
14 | class QRectF; |
15 | class LineChartMaterial; |
16 | class LineSegmentNode; |
17 | |
18 | /** |
19 | * @todo write docs |
20 | */ |
21 | class LineChartNode : public QSGNode |
22 | { |
23 | public: |
24 | LineChartNode(); |
25 | |
26 | /** |
27 | * Destructor |
28 | */ |
29 | ~LineChartNode(); |
30 | |
31 | void setRect(const QRectF &rect, qreal devicePixelRatio); |
32 | void setLineWidth(float width); |
33 | void setLineColor(const QColor &color); |
34 | void setFillColor(const QColor &color); |
35 | void setValues(const QList<QVector2D> &values); |
36 | void updatePoints(); |
37 | |
38 | private: |
39 | QRectF m_rect; |
40 | float m_lineWidth = 0.0; |
41 | float m_aspect = 1.0; |
42 | float m_smoothing = 0.1; |
43 | QColor m_lineColor; |
44 | QColor m_fillColor; |
45 | QList<QVector2D> m_values; |
46 | }; |
47 | |
48 | #endif // LINECHARTNODE_H |
49 | |