| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). | 
| 4 | ** Contact: https://www.qt.io/licensing/ | 
| 5 | ** | 
| 6 | ** This file is part of the Qt3D module of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at https://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU Lesser General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
| 19 | ** General Public License version 3 as published by the Free Software | 
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | 
| 21 | ** packaging of this file. Please review the following information to | 
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements | 
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | 
| 24 | ** | 
| 25 | ** GNU General Public License Usage | 
| 26 | ** Alternatively, this file may be used under the terms of the GNU | 
| 27 | ** General Public License version 2.0 or (at your option) the GNU General | 
| 28 | ** Public license version 3 or any later version approved by the KDE Free | 
| 29 | ** Qt Foundation. The licenses are as published by the Free Software | 
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | 
| 31 | ** included in the packaging of this file. Please review the following | 
| 32 | ** information to ensure the GNU General Public License requirements will | 
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | 
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | 
| 35 | ** | 
| 36 | ** $QT_END_LICENSE$ | 
| 37 | ** | 
| 38 | ****************************************************************************/ | 
| 39 |  | 
| 40 | #include "qpickpointevent.h" | 
| 41 | #include "qpickevent_p.h" | 
| 42 | #include <private/qobject_p.h> | 
| 43 |  | 
| 44 | QT_BEGIN_NAMESPACE | 
| 45 |  | 
| 46 | namespace Qt3DRender { | 
| 47 |  | 
| 48 | class QPickPointEventPrivate : public QPickEventPrivate | 
| 49 | { | 
| 50 | public: | 
| 51 |     QPickPointEventPrivate() | 
| 52 |         : QPickEventPrivate() | 
| 53 |         , m_pointIndex(0) | 
| 54 |     { | 
| 55 |     } | 
| 56 |  | 
| 57 |     uint m_pointIndex; | 
| 58 | }; | 
| 59 |  | 
| 60 | /*! | 
| 61 |     \class Qt3DRender::QPickPointEvent | 
| 62 |     \inmodule Qt3DRender | 
| 63 |  | 
| 64 |     \brief The QPickPointEvent class holds information when a segment of a point cloud is picked. | 
| 65 |  | 
| 66 |     \sa QPickEvent | 
| 67 |     \since 5.10 | 
| 68 | */ | 
| 69 |  | 
| 70 | /*! | 
| 71 |  * \qmltype PickPointEvent | 
| 72 |  * \instantiates Qt3DRender::QPickPointEvent | 
| 73 |  * \inqmlmodule Qt3D.Render | 
| 74 |  * \brief PickPointEvent holds information when a segment of a point cloud is picked. | 
| 75 |  * \sa ObjectPicker | 
| 76 |  */ | 
| 77 |  | 
| 78 |  | 
| 79 | /*! | 
| 80 |   \fn Qt3DRender::QPickPointEvent::QPickPointEvent() | 
| 81 |   Constructs a new QPickPointEvent. | 
| 82 |  */ | 
| 83 | QPickPointEvent::QPickPointEvent() | 
| 84 |     : QPickEvent(*new QPickPointEventPrivate()) | 
| 85 | { | 
| 86 | } | 
| 87 |  | 
| 88 | QPickPointEvent::QPickPointEvent(const QPointF &position, const QVector3D &worldIntersection, | 
| 89 |                                  const QVector3D &localIntersection, float distance, | 
| 90 |                                  uint pointIndex, | 
| 91 |                                  QPickEvent::Buttons button, int buttons, int modifiers) | 
| 92 |     : QPickEvent(*new QPickPointEventPrivate()) | 
| 93 | { | 
| 94 |     Q_D(QPickPointEvent); | 
| 95 |     d->m_position = position; | 
| 96 |     d->m_distance = distance; | 
| 97 |     d->m_worldIntersection = worldIntersection; | 
| 98 |     d->m_localIntersection = localIntersection; | 
| 99 |     d->m_pointIndex = pointIndex; | 
| 100 |     d->m_button = button; | 
| 101 |     d->m_buttons = buttons; | 
| 102 |     d->m_modifiers = modifiers; | 
| 103 | } | 
| 104 |  | 
| 105 | /*! \internal */ | 
| 106 | QPickPointEvent::~QPickPointEvent() | 
| 107 | { | 
| 108 | } | 
| 109 |  | 
| 110 | /*! | 
| 111 |     \qmlproperty uint Qt3D.Render::PickPointEvent::pointIndex | 
| 112 |     Specifies the index of the point that was picked | 
| 113 | */ | 
| 114 | /*! | 
| 115 |   \property Qt3DRender::QPickPointEvent::pointIndex | 
| 116 |     Specifies the index of the point that was picked | 
| 117 |  */ | 
| 118 | /*! | 
| 119 |  * \brief QPickPointEvent::pointIndex | 
| 120 |  * Returns the index of the picked point | 
| 121 |  */ | 
| 122 | uint QPickPointEvent::pointIndex() const | 
| 123 | { | 
| 124 |     Q_D(const QPickPointEvent); | 
| 125 |     return d->m_pointIndex; | 
| 126 | } | 
| 127 |  | 
| 128 | } // Qt3DRender | 
| 129 |  | 
| 130 | QT_END_NAMESPACE | 
| 131 |  | 
| 132 |  |