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
qquick3dextensionhelpers.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#include "qquick3dobject_p.h"
6
7#include <QtQuick3DUtils/private/qssgassert_p.h>
8
10
58
64
66{
67 auto *po = QQuick3DObjectPrivate::get(&node);
68 QSSG_ASSERT_X(QSSGRenderGraphObject::isNodeType(po->type), "Type is not a node", return QSSGNodeId::Invalid);
69 // NOTE: Implementation detail (don't rely on this in user code).
70 return static_cast<QSSGNodeId>(quintptr(QQuick3DObjectPrivate::get(&node)->spatialNode));
71}
72
78
80{
81 auto *po = QQuick3DObjectPrivate::get(&resource);
82 QSSG_ASSERT_X(QSSGRenderGraphObject::isResource(po->type), "Type is not a resource", return QSSGResourceId::Invalid);
83 // NOTE: Implementation detail (don't rely on this in user code).
84 return static_cast<QSSGResourceId>(quintptr(QQuick3DObjectPrivate::get(&resource)->spatialNode));
85}
86
92
94{
96 QSSG_ASSERT_X(QSSGRenderGraphObject::isCamera(po->type), "Type is not a camera", return QSSGCameraId::Invalid);
97 // NOTE: Implementation detail (don't rely on this in user code).
98 return static_cast<QSSGCameraId>(quintptr(po->spatialNode));
99}
100
102{
104 QSSG_ASSERT_X(QSSGRenderGraphObject::isExtension(po->type), "Type is not an extension", return QSSGExtensionId::Invalid);
105 // NOTE: Implementation detail (don't rely on this in user code).
106 return static_cast<QSSGExtensionId>(quintptr(po->spatialNode));
107}
108
static QSSGCameraId getCameraId(const QQuick3DObject &camera)
static QSSGExtensionId getExtensionId(const QQuick3DObject &extension)
static QSSGResourceId getResourceId(const QQuick3DObject &resource)
static QSSGNodeId getNodeId(const QQuick3DObject &node)
static QQuick3DObjectPrivate * get(QQuick3DObject *item)
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
static constexpr bool isCamera(Type type) noexcept
static constexpr bool isNodeType(Type type) noexcept
static constexpr bool isExtension(Type type) noexcept
static constexpr bool isResource(Type type) noexcept
void extension()
[6]
Definition dialogs.cpp:230
QCamera * camera
Definition camera.cpp:19
Combined button and popup list for selecting options.
#define QSSG_ASSERT_X(cond, msg, action)
QSSGExtensionId
size_t quintptr
Definition qtypes.h:167