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
qopenxrspatialanchor.cpp
Go to the documentation of this file.
1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
5
7
9
11 : QObject(parent)
12 , m_space(space)
13 , m_uuid(uuid)
14{
15 auto spaceExt = QOpenXRSpaceExtension::instance();
16 m_has2DBounds = spaceExt->getBoundingBox2D(m_space, m_offset2D, m_extent2D);
17 m_has3DBounds = spaceExt->getBoundingBox3D(m_space, m_offset3D, m_extent3D);
18 if (spaceExt->isComponentSupported(m_space, XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB) &&
19 spaceExt->isComponentEnabled(m_space, XR_SPACE_COMPONENT_TYPE_SPACE_CONTAINER_FB)) {
20 // Get the space container UUIDs
21 m_spaceContainerUuids = spaceExt->collectSpaceContainerUuids(m_space);
22 } else if (spaceExt->isComponentSupported(m_space, XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB) &&
23 spaceExt->isComponentEnabled(m_space, XR_SPACE_COMPONENT_TYPE_ROOM_LAYOUT_FB)) {
24 m_roomLayoutUuids = spaceExt->collectRoomLayoutUuids(m_space);
25 }
26 m_semanticLabels = spaceExt->getSemanticLabels(m_space);
27}
28
33
35{
36 return m_space;
37}
38
40{
41 return m_offset3D;
42}
43
45{
46 if (m_offset3D == newOffset)
47 return;
48 m_offset3D = newOffset;
50}
51
53{
54 return m_extent3D;
55}
56
58{
59 if (m_extent3D == newExtent)
60 return;
61 m_extent3D = newExtent;
63}
64
66{
67 return m_position;
68}
69
71{
72 if (m_position == newPosition)
73 return;
74 m_position = newPosition;
76}
77
79{
80 return m_rotation;
81}
82
84{
85 if (m_rotation == newRotation)
86 return;
87 m_rotation = newRotation;
89}
90
92{
93 return m_semanticLabels;
94}
95
97{
98 if (m_semanticLabels == newSemanticLabels)
99 return;
100 m_semanticLabels = newSemanticLabels;
102}
103
105{
106 return m_has2DBounds;
107}
108
110{
111 return m_has3DBounds;
112}
113
115{
116 return m_offset2D;
117}
118
120{
121 return m_extent2D;
122}
123
125{
126 return m_uuid;
127}
128
\inmodule QtCore
Definition qobject.h:103
static QOpenXRSpaceExtension * instance()
void setExtent3D(const QVector3D &newExtent)
QOpenXRSpatialAnchor(XrSpace space, QUuid &uuid, QObject *parent=nullptr)
void setSemanticLabels(const QString &newSemanticLabels)
void setOffset3D(const QVector3D &newOffset)
void setRotation(const QQuaternion &newRotation)
void setPosition(const QVector3D &newPosition)
The QQuaternion class represents a quaternion consisting of a vector and scalar.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition quuid.h:31
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.
#define emit