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 SELECTIONPOINTER_P_H |
15 | #define SELECTIONPOINTER_P_H |
16 | |
17 | #include "datavisualizationglobal_p.h" |
18 | #include "surface3dcontroller_p.h" |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class ShaderHelper; |
23 | class ObjectHelper; |
24 | class TextureHelper; |
25 | class Drawer; |
26 | |
27 | class SelectionPointer : public QObject, protected QOpenGLFunctions |
28 | { |
29 | Q_OBJECT |
30 | |
31 | public: |
32 | explicit SelectionPointer(Drawer *drawer); |
33 | ~SelectionPointer(); |
34 | |
35 | void renderSelectionPointer(GLuint defaultFboHandle = 0, bool useOrtho = false); |
36 | void renderSelectionLabel(GLuint defaultFboHandle = 0, bool useOrtho = false); |
37 | void setPosition(const QVector3D &position); |
38 | void setLabel(const QString &label, bool themeChange = false); |
39 | void setPointerObject(ObjectHelper *object); |
40 | void setLabelObject(ObjectHelper *object); |
41 | void handleDrawerChange(); |
42 | void updateBoundingRect(const QRect &rect); |
43 | void updateScene(Q3DScene *scene); |
44 | void updateSliceData(bool sliceActivated, GLfloat autoScaleAdjustment); |
45 | void setHighlightColor(const QVector4D &colorVector); |
46 | void setRotation(const QQuaternion &rotation); |
47 | |
48 | private: |
49 | void initializeOpenGL(); |
50 | void initShaders(); |
51 | |
52 | private: |
53 | ShaderHelper *m_labelShader; |
54 | ShaderHelper *m_pointShader; |
55 | ObjectHelper *m_labelObj; // Not owned |
56 | ObjectHelper *m_pointObj; // Not owned |
57 | TextureHelper *m_textureHelper; |
58 | Q3DTheme *m_cachedTheme; |
59 | bool m_labelBackground; |
60 | LabelItem m_labelItem; |
61 | Drawer *m_drawer; |
62 | QRect m_mainViewPort; |
63 | QVector3D m_position; |
64 | Q3DScene *m_cachedScene; |
65 | QString m_label; |
66 | bool m_cachedIsSlicingActivated; |
67 | GLfloat m_autoScaleAdjustment; |
68 | QVector4D m_highlightColor; |
69 | QQuaternion m_rotation; |
70 | }; |
71 | |
72 | QT_END_NAMESPACE |
73 | |
74 | #endif |
75 | |