1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4//
5// W A R N I N G
6// -------------
7//
8// This file is not part of the QtGraphs API. It exists purely as an
9// implementation detail. This header file may change from version to
10// version without notice, or even be removed.
11//
12// We mean it.
13
14#ifndef QABSTRACT3DSERIES_P_H
15#define QABSTRACT3DSERIES_P_H
16
17#include <private/graphsglobal_p.h>
18
19#include "qabstract3dseries.h"
20
21QT_BEGIN_NAMESPACE
22
23class QAbstractDataProxy;
24class Abstract3DController;
25
26struct QAbstract3DSeriesChangeBitField {
27 bool meshChanged : 1;
28 bool meshSmoothChanged : 1;
29 bool meshRotationChanged : 1;
30 bool userDefinedMeshChanged : 1;
31 bool colorStyleChanged : 1;
32 bool baseColorChanged : 1;
33 bool baseGradientChanged : 1;
34 bool singleHighlightColorChanged : 1;
35 bool singleHighlightGradientChanged : 1;
36 bool multiHighlightColorChanged : 1;
37 bool multiHighlightGradientChanged : 1;
38 bool nameChanged : 1;
39 bool itemLabelChanged : 1;
40 bool itemLabelVisibilityChanged : 1;
41 bool visibilityChanged : 1;
42
43 QAbstract3DSeriesChangeBitField()
44 : meshChanged(true),
45 meshSmoothChanged(true),
46 meshRotationChanged(true),
47 userDefinedMeshChanged(true),
48 colorStyleChanged(true),
49 baseColorChanged(true),
50 baseGradientChanged(true),
51 singleHighlightColorChanged(true),
52 singleHighlightGradientChanged(true),
53 multiHighlightColorChanged(true),
54 multiHighlightGradientChanged(true),
55 nameChanged(true),
56 itemLabelChanged(true),
57 itemLabelVisibilityChanged(true),
58 visibilityChanged(true)
59 {
60 }
61};
62
63struct QAbstract3DSeriesThemeOverrideBitField {
64 bool colorStyleOverride : 1;
65 bool baseColorOverride : 1;
66 bool baseGradientOverride : 1;
67 bool singleHighlightColorOverride : 1;
68 bool singleHighlightGradientOverride : 1;
69 bool multiHighlightColorOverride : 1;
70 bool multiHighlightGradientOverride : 1;
71
72 QAbstract3DSeriesThemeOverrideBitField()
73 : colorStyleOverride(false),
74 baseColorOverride(false),
75 baseGradientOverride(false),
76 singleHighlightColorOverride(false),
77 singleHighlightGradientOverride(false),
78 multiHighlightColorOverride(false),
79 multiHighlightGradientOverride(false)
80 {
81 }
82};
83
84class QAbstract3DSeriesPrivate
85{
86 Q_DECLARE_PUBLIC(QAbstract3DSeries)
87
88public:
89 QAbstract3DSeriesPrivate(QAbstract3DSeries *q, QAbstract3DSeries::SeriesType type);
90 virtual ~QAbstract3DSeriesPrivate();
91
92 QAbstractDataProxy *dataProxy() const;
93 virtual void setDataProxy(QAbstractDataProxy *proxy);
94 virtual void setController(Abstract3DController *controller);
95 virtual void connectControllerAndProxy(Abstract3DController *newController) = 0;
96 virtual void createItemLabel() = 0;
97
98 void setItemLabelFormat(const QString &format);
99 void setVisible(bool visible);
100 void setMesh(QAbstract3DSeries::Mesh mesh);
101 void setMeshSmooth(bool enable);
102 void setMeshRotation(const QQuaternion &rotation);
103 void setUserDefinedMesh(const QString &meshFile);
104
105 void setColorStyle(Q3DTheme::ColorStyle style);
106 void setBaseColor(const QColor &color);
107 void setBaseGradient(const QLinearGradient &gradient);
108 void setSingleHighlightColor(const QColor &color);
109 void setSingleHighlightGradient(const QLinearGradient &gradient);
110 void setMultiHighlightColor(const QColor &color);
111 void setMultiHighlightGradient(const QLinearGradient &gradient);
112 void setName(const QString &name);
113
114 void resetToTheme(const Q3DTheme &theme, int seriesIndex, bool force);
115 QString itemLabel();
116 void markItemLabelDirty();
117 inline bool itemLabelDirty() const { return m_itemLabelDirty; }
118 void setItemLabelVisible(bool visible);
119 bool isUsingGradient();
120
121protected:
122 QAbstract3DSeries *q_ptr;
123
124 QAbstract3DSeriesChangeBitField m_changeTracker;
125 QAbstract3DSeriesThemeOverrideBitField m_themeTracker;
126 QAbstract3DSeries::SeriesType m_type;
127 QString m_itemLabelFormat;
128 QAbstractDataProxy *m_dataProxy;
129 bool m_visible;
130 Abstract3DController *m_controller;
131 QAbstract3DSeries::Mesh m_mesh;
132 bool m_meshSmooth;
133 QQuaternion m_meshRotation;
134 QString m_userDefinedMesh;
135
136 Q3DTheme::ColorStyle m_colorStyle;
137 QColor m_baseColor;
138 QLinearGradient m_baseGradient;
139 QColor m_singleHighlightColor;
140 QLinearGradient m_singleHighlightGradient;
141 QColor m_multiHighlightColor;
142 QLinearGradient m_multiHighlightGradient;
143
144 QString m_name;
145 QString m_itemLabel;
146 bool m_itemLabelDirty;
147 bool m_itemLabelVisible;
148
149 friend class Scatter3DController;
150 friend class Surface3DController;
151 friend class Bars3DController;
152 friend class Abstract3DController;
153};
154
155QT_END_NAMESPACE
156
157#endif
158

source code of qtgraphs/src/graphs/data/qabstract3dseries_p.h