| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. | 
| 4 | ** Contact: https://www.qt.io/licensing/ | 
| 5 | ** | 
| 6 | ** This file is part of the Qt Data Visualization module of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:GPL$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU | 
| 19 | ** General Public License version 3 or (at your option) any later version | 
| 20 | ** approved by the KDE Free Qt Foundation. The licenses are as published by | 
| 21 | ** the Free Software Foundation and appearing in the file LICENSE.GPL3 | 
| 22 | ** included in the packaging of this file. Please review the following | 
| 23 | ** information to ensure the GNU General Public License requirements will | 
| 24 | ** be met: https://www.gnu.org/licenses/gpl-3.0.html. | 
| 25 | ** | 
| 26 | ** $QT_END_LICENSE$ | 
| 27 | ** | 
| 28 | ****************************************************************************/ | 
| 29 |  | 
| 30 | // | 
| 31 | //  W A R N I N G | 
| 32 | //  ------------- | 
| 33 | // | 
| 34 | // This file is not part of the QtDataVisualization API.  It exists purely as an | 
| 35 | // implementation detail.  This header file may change from version to | 
| 36 | // version without notice, or even be removed. | 
| 37 | // | 
| 38 | // We mean it. | 
| 39 |  | 
| 40 | #ifndef QABSTRACT3DSERIES_P_H | 
| 41 | #define QABSTRACT3DSERIES_P_H | 
| 42 |  | 
| 43 | #include "datavisualizationglobal_p.h" | 
| 44 | #include "qabstract3dseries.h" | 
| 45 |  | 
| 46 | QT_BEGIN_NAMESPACE_DATAVISUALIZATION | 
| 47 |  | 
| 48 | class QAbstractDataProxy; | 
| 49 | class Abstract3DController; | 
| 50 |  | 
| 51 | struct QAbstract3DSeriesChangeBitField { | 
| 52 |     bool meshChanged                    : 1; | 
| 53 |     bool meshSmoothChanged              : 1; | 
| 54 |     bool meshRotationChanged            : 1; | 
| 55 |     bool userDefinedMeshChanged         : 1; | 
| 56 |     bool colorStyleChanged              : 1; | 
| 57 |     bool baseColorChanged               : 1; | 
| 58 |     bool baseGradientChanged            : 1; | 
| 59 |     bool singleHighlightColorChanged    : 1; | 
| 60 |     bool singleHighlightGradientChanged : 1; | 
| 61 |     bool multiHighlightColorChanged     : 1; | 
| 62 |     bool multiHighlightGradientChanged  : 1; | 
| 63 |     bool nameChanged                    : 1; | 
| 64 |     bool itemLabelChanged               : 1; | 
| 65 |     bool itemLabelVisibilityChanged     : 1; | 
| 66 |     bool visibilityChanged              : 1; | 
| 67 |  | 
| 68 |     QAbstract3DSeriesChangeBitField() | 
| 69 |         : meshChanged(true), | 
| 70 |           meshSmoothChanged(true), | 
| 71 |           meshRotationChanged(true), | 
| 72 |           userDefinedMeshChanged(true), | 
| 73 |           colorStyleChanged(true), | 
| 74 |           baseColorChanged(true), | 
| 75 |           baseGradientChanged(true), | 
| 76 |           singleHighlightColorChanged(true), | 
| 77 |           singleHighlightGradientChanged(true), | 
| 78 |           multiHighlightColorChanged(true), | 
| 79 |           multiHighlightGradientChanged(true), | 
| 80 |           nameChanged(true), | 
| 81 |           itemLabelChanged(true), | 
| 82 |           itemLabelVisibilityChanged(true), | 
| 83 |           visibilityChanged(true) | 
| 84 |     { | 
| 85 |     } | 
| 86 | }; | 
| 87 |  | 
| 88 | struct QAbstract3DSeriesThemeOverrideBitField { | 
| 89 |     bool colorStyleOverride              : 1; | 
| 90 |     bool baseColorOverride               : 1; | 
| 91 |     bool baseGradientOverride            : 1; | 
| 92 |     bool singleHighlightColorOverride    : 1; | 
| 93 |     bool singleHighlightGradientOverride : 1; | 
| 94 |     bool multiHighlightColorOverride     : 1; | 
| 95 |     bool multiHighlightGradientOverride  : 1; | 
| 96 |  | 
| 97 |     QAbstract3DSeriesThemeOverrideBitField() | 
| 98 |         : colorStyleOverride(false), | 
| 99 |           baseColorOverride(false), | 
| 100 |           baseGradientOverride(false), | 
| 101 |           singleHighlightColorOverride(false), | 
| 102 |           singleHighlightGradientOverride(false), | 
| 103 |           multiHighlightColorOverride(false), | 
| 104 |           multiHighlightGradientOverride(false) | 
| 105 |     { | 
| 106 |     } | 
| 107 | }; | 
| 108 |  | 
| 109 | class QAbstract3DSeriesPrivate : public QObject | 
| 110 | { | 
| 111 |     Q_OBJECT | 
| 112 | public: | 
| 113 |     QAbstract3DSeriesPrivate(QAbstract3DSeries *q, QAbstract3DSeries::SeriesType type); | 
| 114 |     virtual ~QAbstract3DSeriesPrivate(); | 
| 115 |  | 
| 116 |     QAbstractDataProxy *dataProxy() const; | 
| 117 |     virtual void setDataProxy(QAbstractDataProxy *proxy); | 
| 118 |     virtual void setController(Abstract3DController *controller); | 
| 119 |     virtual void connectControllerAndProxy(Abstract3DController *newController) = 0; | 
| 120 |     virtual void createItemLabel() = 0; | 
| 121 |  | 
| 122 |     void setItemLabelFormat(const QString &format); | 
| 123 |     void setVisible(bool visible); | 
| 124 |     void setMesh(QAbstract3DSeries::Mesh mesh); | 
| 125 |     void setMeshSmooth(bool enable); | 
| 126 |     void setMeshRotation(const QQuaternion &rotation); | 
| 127 |     void setUserDefinedMesh(const QString &meshFile); | 
| 128 |  | 
| 129 |     void setColorStyle(Q3DTheme::ColorStyle style); | 
| 130 |     void setBaseColor(const QColor &color); | 
| 131 |     void setBaseGradient(const QLinearGradient &gradient); | 
| 132 |     void setSingleHighlightColor(const QColor &color); | 
| 133 |     void setSingleHighlightGradient(const QLinearGradient &gradient); | 
| 134 |     void setMultiHighlightColor(const QColor &color); | 
| 135 |     void setMultiHighlightGradient(const QLinearGradient &gradient); | 
| 136 |     void setName(const QString &name); | 
| 137 |  | 
| 138 |     void resetToTheme(const Q3DTheme &theme, int seriesIndex, bool force); | 
| 139 |     QString itemLabel(); | 
| 140 |     void markItemLabelDirty(); | 
| 141 |     inline bool itemLabelDirty() const { return m_itemLabelDirty; } | 
| 142 |     void setItemLabelVisible(bool visible); | 
| 143 |  | 
| 144 |     QAbstract3DSeriesChangeBitField m_changeTracker; | 
| 145 |     QAbstract3DSeriesThemeOverrideBitField m_themeTracker; | 
| 146 |     QAbstract3DSeries *q_ptr; | 
| 147 |     QAbstract3DSeries::SeriesType m_type; | 
| 148 |     QString m_itemLabelFormat; | 
| 149 |     QAbstractDataProxy *m_dataProxy; | 
| 150 |     bool m_visible; | 
| 151 |     Abstract3DController *m_controller; | 
| 152 |     QAbstract3DSeries::Mesh m_mesh; | 
| 153 |     bool m_meshSmooth; | 
| 154 |     QQuaternion m_meshRotation; | 
| 155 |     QString m_userDefinedMesh; | 
| 156 |  | 
| 157 |     Q3DTheme::ColorStyle m_colorStyle; | 
| 158 |     QColor m_baseColor; | 
| 159 |     QLinearGradient m_baseGradient; | 
| 160 |     QColor m_singleHighlightColor; | 
| 161 |     QLinearGradient m_singleHighlightGradient; | 
| 162 |     QColor m_multiHighlightColor; | 
| 163 |     QLinearGradient m_multiHighlightGradient; | 
| 164 |  | 
| 165 |     QString m_name; | 
| 166 |     QString m_itemLabel; | 
| 167 |     bool m_itemLabelDirty; | 
| 168 |     bool m_itemLabelVisible; | 
| 169 | }; | 
| 170 |  | 
| 171 | QT_END_NAMESPACE_DATAVISUALIZATION | 
| 172 |  | 
| 173 | #endif | 
| 174 |  |