1// Copyright (C) 2015 Paul Lemire paul.lemire350@gmail.com
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DRENDER_RENDER_OBJECTPICKER_P_H
5#define QT3DRENDER_RENDER_OBJECTPICKER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DRender/private/backendnode_p.h>
19
20QT_BEGIN_NAMESPACE
21
22namespace Qt3DRender {
23
24class QPickEvent;
25typedef QSharedPointer<QPickEvent> QPickEventPtr;
26
27namespace Render {
28
29class Q_3DRENDERSHARED_PRIVATE_EXPORT ObjectPicker : public BackendNode
30{
31public:
32 ObjectPicker();
33 ~ObjectPicker();
34
35 void cleanup();
36 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
37 bool isPressed() const;
38 bool isHoverEnabled() const;
39 bool isDragEnabled() const;
40
41 void setPressed(bool pressed);
42
43 // Needed for unit tests
44 void setPriority(int priority);
45 int priority() const;
46
47private:
48 void notifyJob();
49
50 int m_priority;
51 bool m_isPressed;
52 bool m_hoverEnabled;
53 bool m_dragEnabled;
54};
55
56} // Render
57
58} // Qt3DRender
59
60QT_END_NAMESPACE
61
62#endif // QT3DRENDER_RENDER_OBJECTPICKER_H
63

source code of qt3d/src/render/picking/objectpicker_p.h