| 1 | // Copyright (C) 2018 Klaralvdalens Datakonsult AB (KDAB). |
| 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_QSCREENRAYCASTER_H |
| 5 | #define QT3DRENDER_QSCREENRAYCASTER_H |
| 6 | |
| 7 | #include <Qt3DRender/qt3drender_global.h> |
| 8 | #include <Qt3DRender/QAbstractRayCaster> |
| 9 | |
| 10 | #include <QtGui/QVector3D> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | namespace Qt3DRender { |
| 15 | |
| 16 | class Q_3DRENDERSHARED_EXPORT QScreenRayCaster : public QAbstractRayCaster |
| 17 | { |
| 18 | Q_OBJECT |
| 19 | Q_PROPERTY(QPoint position READ position WRITE setPosition NOTIFY positionChanged) |
| 20 | public: |
| 21 | explicit QScreenRayCaster(QNode *parent = nullptr); |
| 22 | ~QScreenRayCaster(); |
| 23 | |
| 24 | QPoint position() const; |
| 25 | |
| 26 | public Q_SLOTS: |
| 27 | void setPosition(const QPoint &position); |
| 28 | |
| 29 | void trigger(); |
| 30 | void trigger(const QPoint &position); |
| 31 | Qt3DRender::QAbstractRayCaster::Hits pick(const QPoint &position); |
| 32 | |
| 33 | Q_SIGNALS: |
| 34 | void positionChanged(const QPoint &position); |
| 35 | |
| 36 | protected: |
| 37 | explicit QScreenRayCaster(QAbstractRayCasterPrivate &dd, QNode *parent = nullptr); |
| 38 | }; |
| 39 | |
| 40 | } // Qt3D |
| 41 | |
| 42 | QT_END_NAMESPACE |
| 43 | |
| 44 | #endif // QT3DRENDER_QSCREENRAYCASTER_H |
| 45 | |