| 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 SERIESRENDERCACHE_P_H |
| 15 | #define SERIESRENDERCACHE_P_H |
| 16 | |
| 17 | #include "datavisualizationglobal_p.h" |
| 18 | #include "qabstract3dseries_p.h" |
| 19 | |
| 20 | #include <QtGui/qquaternion.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class Abstract3DRenderer; |
| 25 | class ObjectHelper; |
| 26 | class TextureHelper; |
| 27 | |
| 28 | class SeriesRenderCache |
| 29 | { |
| 30 | public: |
| 31 | SeriesRenderCache(QAbstract3DSeries *series, Abstract3DRenderer *renderer); |
| 32 | virtual ~SeriesRenderCache(); |
| 33 | |
| 34 | virtual void populate(bool newSeries); |
| 35 | virtual void cleanup(TextureHelper *texHelper); |
| 36 | |
| 37 | // NOTE: Series pointer can only be used to access the series when syncing with controller. |
| 38 | // It is not guaranteed to be valid while rendering and should only be used as an identifier. |
| 39 | inline QAbstract3DSeries *series() const { return m_series; } |
| 40 | |
| 41 | inline const QAbstract3DSeries::Mesh &mesh() const { return m_mesh; } |
| 42 | inline const QQuaternion &meshRotation() const { return m_meshRotation; } |
| 43 | inline void setMeshRotation(const QQuaternion &rotation) { m_meshRotation = rotation; } |
| 44 | inline ObjectHelper *object() const { return m_object; } |
| 45 | inline const Q3DTheme::ColorStyle &colorStyle() const { return m_colorStyle; } |
| 46 | inline const QVector4D &baseColor() const { return m_baseColor; } |
| 47 | inline const GLuint &baseUniformTexture() const { return m_baseUniformTexture; } |
| 48 | inline const GLuint &baseGradientTexture() const { return m_baseGradientTexture; } |
| 49 | inline const QImage &gradientImage() const { return m_gradientImage; } |
| 50 | inline const QVector4D &singleHighlightColor() const { return m_singleHighlightColor; } |
| 51 | inline const GLuint &singleHighlightGradientTexture() const { return m_singleHighlightGradientTexture; } |
| 52 | inline const QVector4D &multiHighlightColor() const { return m_multiHighlightColor; } |
| 53 | inline const GLuint &multiHighlightGradientTexture() const { return m_multiHighlightGradientTexture; } |
| 54 | inline const QString &name() const { return m_name; } |
| 55 | inline const QString &itemLabel() const { return m_itemLabel; } |
| 56 | inline void setValid(bool valid) { m_valid = valid; } |
| 57 | inline bool isValid() const { return m_valid; } |
| 58 | inline bool isVisible() const { return m_visible; } |
| 59 | inline void setDataDirty(bool state) { m_objectDirty = state; } |
| 60 | inline bool dataDirty() const { return m_objectDirty; } |
| 61 | inline void setStaticObjectUVDirty(bool state) { m_staticObjectUVDirty = state; } |
| 62 | inline bool staticObjectUVDirty() { return m_staticObjectUVDirty; } |
| 63 | |
| 64 | protected: |
| 65 | QAbstract3DSeries *m_series; |
| 66 | ObjectHelper *m_object; // Shared reference |
| 67 | QAbstract3DSeries::Mesh m_mesh; |
| 68 | QQuaternion m_meshRotation; |
| 69 | |
| 70 | Q3DTheme::ColorStyle m_colorStyle; |
| 71 | QVector4D m_baseColor; |
| 72 | GLuint m_baseUniformTexture; |
| 73 | GLuint m_baseGradientTexture; |
| 74 | QImage m_gradientImage; |
| 75 | QVector4D m_singleHighlightColor; |
| 76 | GLuint m_singleHighlightGradientTexture; |
| 77 | QVector4D m_multiHighlightColor; |
| 78 | GLuint m_multiHighlightGradientTexture; |
| 79 | |
| 80 | QString m_name; |
| 81 | QString m_itemLabel; |
| 82 | bool m_valid; |
| 83 | bool m_visible; |
| 84 | Abstract3DRenderer *m_renderer; |
| 85 | bool m_objectDirty; |
| 86 | bool m_staticObjectUVDirty; |
| 87 | }; |
| 88 | |
| 89 | QT_END_NAMESPACE |
| 90 | |
| 91 | #endif |
| 92 | |
| 93 |
