1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QABSTRACT3DSERIES_H |
5 | #define QABSTRACT3DSERIES_H |
6 | |
7 | #include <QtDataVisualization/q3dtheme.h> |
8 | #include <QtCore/QObject> |
9 | #include <QtCore/QScopedPointer> |
10 | #include <QtCore/QString> |
11 | #include <QtGui/QLinearGradient> |
12 | #include <QtGui/QQuaternion> |
13 | |
14 | QT_BEGIN_NAMESPACE |
15 | |
16 | class QAbstract3DSeriesPrivate; |
17 | |
18 | class Q_DATAVISUALIZATION_EXPORT QAbstract3DSeries : public QObject |
19 | { |
20 | Q_OBJECT |
21 | Q_ENUMS(SeriesType) |
22 | Q_ENUMS(Mesh) |
23 | Q_PROPERTY(SeriesType type READ type CONSTANT) |
24 | Q_PROPERTY(QString itemLabelFormat READ itemLabelFormat WRITE setItemLabelFormat NOTIFY itemLabelFormatChanged) |
25 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibilityChanged) |
26 | Q_PROPERTY(Mesh mesh READ mesh WRITE setMesh NOTIFY meshChanged) |
27 | Q_PROPERTY(bool meshSmooth READ isMeshSmooth WRITE setMeshSmooth NOTIFY meshSmoothChanged) |
28 | Q_PROPERTY(QQuaternion meshRotation READ meshRotation WRITE setMeshRotation NOTIFY meshRotationChanged) |
29 | Q_PROPERTY(QString userDefinedMesh READ userDefinedMesh WRITE setUserDefinedMesh NOTIFY userDefinedMeshChanged) |
30 | Q_PROPERTY(Q3DTheme::ColorStyle colorStyle READ colorStyle WRITE setColorStyle NOTIFY colorStyleChanged) |
31 | Q_PROPERTY(QColor baseColor READ baseColor WRITE setBaseColor NOTIFY baseColorChanged) |
32 | Q_PROPERTY(QLinearGradient baseGradient READ baseGradient WRITE setBaseGradient NOTIFY baseGradientChanged) |
33 | Q_PROPERTY(QColor singleHighlightColor READ singleHighlightColor WRITE setSingleHighlightColor NOTIFY singleHighlightColorChanged) |
34 | Q_PROPERTY(QLinearGradient singleHighlightGradient READ singleHighlightGradient WRITE setSingleHighlightGradient NOTIFY singleHighlightGradientChanged) |
35 | Q_PROPERTY(QColor multiHighlightColor READ multiHighlightColor WRITE setMultiHighlightColor NOTIFY multiHighlightColorChanged) |
36 | Q_PROPERTY(QLinearGradient multiHighlightGradient READ multiHighlightGradient WRITE setMultiHighlightGradient NOTIFY multiHighlightGradientChanged) |
37 | Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) |
38 | Q_PROPERTY(QString itemLabel READ itemLabel NOTIFY itemLabelChanged REVISION(1, 1)) |
39 | Q_PROPERTY(bool itemLabelVisible READ isItemLabelVisible WRITE setItemLabelVisible NOTIFY itemLabelVisibilityChanged REVISION(1, 1)) |
40 | |
41 | public: |
42 | enum SeriesType { |
43 | SeriesTypeNone = 0, |
44 | SeriesTypeBar = 1, |
45 | SeriesTypeScatter = 2, |
46 | SeriesTypeSurface = 4 |
47 | }; |
48 | |
49 | enum Mesh { |
50 | MeshUserDefined = 0, |
51 | MeshBar, |
52 | MeshCube, |
53 | MeshPyramid, |
54 | MeshCone, |
55 | MeshCylinder, |
56 | MeshBevelBar, |
57 | MeshBevelCube, |
58 | MeshSphere, |
59 | MeshMinimal, |
60 | MeshArrow, |
61 | MeshPoint |
62 | }; |
63 | |
64 | protected: |
65 | explicit QAbstract3DSeries(QAbstract3DSeriesPrivate *d, QObject *parent = nullptr); |
66 | |
67 | public: |
68 | virtual ~QAbstract3DSeries(); |
69 | |
70 | SeriesType type() const; |
71 | |
72 | void setItemLabelFormat(const QString &format); |
73 | QString itemLabelFormat() const; |
74 | |
75 | void setVisible(bool visible); |
76 | bool isVisible() const; |
77 | |
78 | void setMesh(Mesh mesh); |
79 | Mesh mesh() const; |
80 | |
81 | void setMeshSmooth(bool enable); |
82 | bool isMeshSmooth() const; |
83 | |
84 | void setMeshRotation(const QQuaternion &rotation); |
85 | QQuaternion meshRotation() const; |
86 | Q_INVOKABLE void setMeshAxisAndAngle(const QVector3D &axis, float angle); |
87 | |
88 | void setUserDefinedMesh(const QString &fileName); |
89 | QString userDefinedMesh() const; |
90 | |
91 | void setColorStyle(Q3DTheme::ColorStyle style); |
92 | Q3DTheme::ColorStyle colorStyle() const; |
93 | void setBaseColor(const QColor &color); |
94 | QColor baseColor() const; |
95 | void setBaseGradient(const QLinearGradient &gradient); |
96 | QLinearGradient baseGradient() const; |
97 | void setSingleHighlightColor(const QColor &color); |
98 | QColor singleHighlightColor() const; |
99 | void setSingleHighlightGradient(const QLinearGradient &gradient); |
100 | QLinearGradient singleHighlightGradient() const; |
101 | void setMultiHighlightColor(const QColor &color); |
102 | QColor multiHighlightColor() const; |
103 | void setMultiHighlightGradient(const QLinearGradient &gradient); |
104 | QLinearGradient multiHighlightGradient() const; |
105 | |
106 | void setName(const QString &name); |
107 | QString name() const; |
108 | |
109 | QString itemLabel() const; |
110 | void setItemLabelVisible(bool visible); |
111 | bool isItemLabelVisible() const; |
112 | |
113 | Q_SIGNALS: |
114 | void itemLabelFormatChanged(const QString &format); |
115 | void visibilityChanged(bool visible); |
116 | void meshChanged(QAbstract3DSeries::Mesh mesh); |
117 | void meshSmoothChanged(bool enabled); |
118 | void meshRotationChanged(const QQuaternion &rotation); |
119 | void userDefinedMeshChanged(const QString &fileName); |
120 | void colorStyleChanged(Q3DTheme::ColorStyle style); |
121 | void baseColorChanged(const QColor &color); |
122 | void baseGradientChanged(const QLinearGradient &gradient); |
123 | void singleHighlightColorChanged(const QColor &color); |
124 | void singleHighlightGradientChanged(const QLinearGradient &gradient); |
125 | void multiHighlightColorChanged(const QColor &color); |
126 | void multiHighlightGradientChanged(const QLinearGradient &gradient); |
127 | void nameChanged(const QString &name); |
128 | Q_REVISION(1, 1) void itemLabelChanged(const QString &label); |
129 | Q_REVISION(1, 1) void itemLabelVisibilityChanged(bool visible); |
130 | |
131 | protected: |
132 | QScopedPointer<QAbstract3DSeriesPrivate> d_ptr; |
133 | |
134 | private: |
135 | Q_DISABLE_COPY(QAbstract3DSeries) |
136 | |
137 | friend class Abstract3DController; |
138 | friend class Bars3DController; |
139 | friend class Surface3DController; |
140 | friend class Surface3DRenderer; |
141 | friend class Scatter3DRenderer; |
142 | friend class Scatter3DController; |
143 | friend class QBar3DSeries; |
144 | friend class SeriesRenderCache; |
145 | friend class Abstract3DRenderer; |
146 | }; |
147 | |
148 | QT_END_NAMESPACE |
149 | |
150 | #endif |
151 | |