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