Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dxranchormanager_visionos_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DXRANCHORMANAGER_VISIONOS_P_H
5#define QQUICK3DXRANCHORMANAGER_VISIONOS_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 purely as an
12// implementation detail. 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 <QtQuick3DXr/private/qtquick3dxrglobal_p.h>
19
20#include <QtCore/quuid.h>
21
22#ifdef __OBJC__
23#import <ARKit/ARKit.h>
24#else
25typedef struct ar_data_providers_s *ar_data_providers_t;
26typedef struct ar_plane_detection_provider_s *ar_plane_detection_provider_t;
27typedef struct ar_plane_anchors_s *ar_plane_anchors_t;
28#endif
29
31
32class QVector2D;
33class QVector3D;
34
36
38{
40public:
42
43 // Note: There's only one "space" in the VisionOS world, so we always return 1 (0 equals invalid).
45
48
49 QList<QQuick3DXrSpatialAnchor *> anchors() const;
51
54
56
57 void addAnchor(QQuick3DXrSpatialAnchor *anchor);
58 void removeAnchor(QUuid uuid);
60
62
65 void anchorRemoved(QUuid uuid);
67
69
70private:
72
73 explicit QQuick3DXrAnchorManager(QObject *parent = nullptr);
75
76 void prepareAnchorManager(ar_data_providers_t dataProviders);
77 void initAnchorManager();
78
79 static void planeUpdateHandler(void *, ar_plane_anchors_t, ar_plane_anchors_t, ar_plane_anchors_t);
80
81 ar_plane_detection_provider_t m_planeDetectionProvider;
82
83 mutable QReadWriteLock m_anchorsLock;
84 QList<QQuick3DXrSpatialAnchor *> m_anchors;
85 QHash<QUuid, QQuick3DXrSpatialAnchor *> m_anchorsByUuid;
86
87 enum class AnchorType {
88 Plane,
89 };
90
91 AnchorType m_requestedAnchorType = AnchorType::Plane;
92
93 bool m_isInitialized = false;
94 bool m_isPlaneDetectionSupported = false;
95};
96
98
99#endif // QQUICK3DXRANCHORMANAGER_VISIONOS_P_H
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QtQuick3DXr::XrSpaceId getCurrentSpaceId() const
void updateAnchor(QQuick3DXrSpatialAnchor *anchor)
void anchorRemoved(QUuid uuid)
QList< QQuick3DXrSpatialAnchor * > anchors() const
~QQuick3DXrAnchorManager() override
void anchorAdded(QQuick3DXrSpatialAnchor *anchor)
qsizetype anchorCount() const
bool getBoundingBox2D(QtQuick3DXr::XrSpaceId space, QVector2D &offset, QVector2D &extent)
static QQuick3DXrAnchorManager * instance()
void anchorUpdated(QQuick3DXrSpatialAnchor *anchor)
bool setupSpatialAnchor(QtQuick3DXr::XrSpaceId space, QQuick3DXrSpatialAnchor &anchor)
bool getBoundingBox3D(QtQuick3DXr::XrSpaceId space, QVector3D &offset, QVector3D &extent)
\inmodule QtCore
\inmodule QtCore
Definition quuid.h:32
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLenum GLuint GLintptr offset
struct ar_data_providers_s * ar_data_providers_t
struct ar_plane_anchors_s * ar_plane_anchors_t
struct ar_plane_detection_provider_s * ar_plane_detection_provider_t
#define Q_OBJECT
#define Q_SIGNALS
ptrdiff_t qsizetype
Definition qtypes.h:165