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

source code of qtdatavis3d/src/datavisualization/engine/selectionpointer_p.h