| 1 | // Copyright (C) 2016 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 QtDataVisualization 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 "datavisualizationglobal_p.h" |
| 18 | #include "qabstract3dseries.h" |
| 19 | |
| 20 | QT_BEGIN_NAMESPACE |
| 21 | |
| 22 | class QAbstractDataProxy; |
| 23 | class Abstract3DController; |
| 24 | |
| 25 | struct QAbstract3DSeriesChangeBitField { |
| 26 | bool meshChanged : 1; |
| 27 | bool meshSmoothChanged : 1; |
| 28 | bool meshRotationChanged : 1; |
| 29 | bool userDefinedMeshChanged : 1; |
| 30 | bool colorStyleChanged : 1; |
| 31 | bool baseColorChanged : 1; |
| 32 | bool baseGradientChanged : 1; |
| 33 | bool singleHighlightColorChanged : 1; |
| 34 | bool singleHighlightGradientChanged : 1; |
| 35 | bool multiHighlightColorChanged : 1; |
| 36 | bool multiHighlightGradientChanged : 1; |
| 37 | bool nameChanged : 1; |
| 38 | bool itemLabelChanged : 1; |
| 39 | bool itemLabelVisibilityChanged : 1; |
| 40 | bool visibilityChanged : 1; |
| 41 | |
| 42 | QAbstract3DSeriesChangeBitField() |
| 43 | : meshChanged(true), |
| 44 | meshSmoothChanged(true), |
| 45 | meshRotationChanged(true), |
| 46 | userDefinedMeshChanged(true), |
| 47 | colorStyleChanged(true), |
| 48 | baseColorChanged(true), |
| 49 | baseGradientChanged(true), |
| 50 | singleHighlightColorChanged(true), |
| 51 | singleHighlightGradientChanged(true), |
| 52 | multiHighlightColorChanged(true), |
| 53 | multiHighlightGradientChanged(true), |
| 54 | nameChanged(true), |
| 55 | itemLabelChanged(true), |
| 56 | itemLabelVisibilityChanged(true), |
| 57 | visibilityChanged(true) |
| 58 | { |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | struct QAbstract3DSeriesThemeOverrideBitField { |
| 63 | bool colorStyleOverride : 1; |
| 64 | bool baseColorOverride : 1; |
| 65 | bool baseGradientOverride : 1; |
| 66 | bool singleHighlightColorOverride : 1; |
| 67 | bool singleHighlightGradientOverride : 1; |
| 68 | bool multiHighlightColorOverride : 1; |
| 69 | bool multiHighlightGradientOverride : 1; |
| 70 | |
| 71 | QAbstract3DSeriesThemeOverrideBitField() |
| 72 | : colorStyleOverride(false), |
| 73 | baseColorOverride(false), |
| 74 | baseGradientOverride(false), |
| 75 | singleHighlightColorOverride(false), |
| 76 | singleHighlightGradientOverride(false), |
| 77 | multiHighlightColorOverride(false), |
| 78 | multiHighlightGradientOverride(false) |
| 79 | { |
| 80 | } |
| 81 | }; |
| 82 | |
| 83 | class QAbstract3DSeriesPrivate : public QObject |
| 84 | { |
| 85 | Q_OBJECT |
| 86 | public: |
| 87 | QAbstract3DSeriesPrivate(QAbstract3DSeries *q, QAbstract3DSeries::SeriesType type); |
| 88 | virtual ~QAbstract3DSeriesPrivate(); |
| 89 | |
| 90 | QAbstractDataProxy *dataProxy() const; |
| 91 | virtual void setDataProxy(QAbstractDataProxy *proxy); |
| 92 | virtual void setController(Abstract3DController *controller); |
| 93 | virtual void connectControllerAndProxy(Abstract3DController *newController) = 0; |
| 94 | virtual void createItemLabel() = 0; |
| 95 | |
| 96 | void setItemLabelFormat(const QString &format); |
| 97 | void setVisible(bool visible); |
| 98 | void setMesh(QAbstract3DSeries::Mesh mesh); |
| 99 | void setMeshSmooth(bool enable); |
| 100 | void setMeshRotation(const QQuaternion &rotation); |
| 101 | void setUserDefinedMesh(const QString &meshFile); |
| 102 | |
| 103 | void setColorStyle(Q3DTheme::ColorStyle style); |
| 104 | void setBaseColor(const QColor &color); |
| 105 | void setBaseGradient(const QLinearGradient &gradient); |
| 106 | void setSingleHighlightColor(const QColor &color); |
| 107 | void setSingleHighlightGradient(const QLinearGradient &gradient); |
| 108 | void setMultiHighlightColor(const QColor &color); |
| 109 | void setMultiHighlightGradient(const QLinearGradient &gradient); |
| 110 | void setName(const QString &name); |
| 111 | |
| 112 | void resetToTheme(const Q3DTheme &theme, int seriesIndex, bool force); |
| 113 | QString itemLabel(); |
| 114 | void markItemLabelDirty(); |
| 115 | inline bool itemLabelDirty() const { return m_itemLabelDirty; } |
| 116 | void setItemLabelVisible(bool visible); |
| 117 | |
| 118 | QAbstract3DSeriesChangeBitField m_changeTracker; |
| 119 | QAbstract3DSeriesThemeOverrideBitField m_themeTracker; |
| 120 | QAbstract3DSeries *q_ptr; |
| 121 | QAbstract3DSeries::SeriesType m_type; |
| 122 | QString m_itemLabelFormat; |
| 123 | QAbstractDataProxy *m_dataProxy; |
| 124 | bool m_visible; |
| 125 | Abstract3DController *m_controller; |
| 126 | QAbstract3DSeries::Mesh m_mesh; |
| 127 | bool m_meshSmooth; |
| 128 | QQuaternion m_meshRotation; |
| 129 | QString m_userDefinedMesh; |
| 130 | |
| 131 | Q3DTheme::ColorStyle m_colorStyle; |
| 132 | QColor m_baseColor; |
| 133 | QLinearGradient m_baseGradient; |
| 134 | QColor m_singleHighlightColor; |
| 135 | QLinearGradient m_singleHighlightGradient; |
| 136 | QColor m_multiHighlightColor; |
| 137 | QLinearGradient m_multiHighlightGradient; |
| 138 | |
| 139 | QString m_name; |
| 140 | QString m_itemLabel; |
| 141 | bool m_itemLabelDirty; |
| 142 | bool m_itemLabelVisible; |
| 143 | }; |
| 144 | |
| 145 | QT_END_NAMESPACE |
| 146 | |
| 147 | #endif |
| 148 | |