1 | // Copyright (C) 2023 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICK3DEXTENSIONHELPERS_H |
5 | #define QQUICK3DEXTENSIONHELPERS_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is part of the QtQuick3D API, with limited compatibility guarantees. |
12 | // Usage of this API may make your code source and binary incompatible with |
13 | // future versions of Qt. |
14 | // |
15 | |
16 | #include <QtQuick3D/qtquick3dglobal.h> |
17 | #include <ssg/qssgrenderbasetypes.h> |
18 | |
19 | QT_BEGIN_NAMESPACE |
20 | |
21 | class QQuick3DObject; |
22 | |
23 | #ifdef Q_QDOC |
24 | typedef quint64 QSSGNodeId; |
25 | typedef quint64 QSSGResourceId; |
26 | typedef quint64 QSSGCameraId; |
27 | typedef quint64 QSSGExtensionId; |
28 | #endif |
29 | |
30 | class Q_QUICK3D_EXPORT QQuick3DExtensionHelpers |
31 | { |
32 | public: |
33 | QQuick3DExtensionHelpers(); |
34 | |
35 | [[nodiscard]] static QSSGNodeId getNodeId(const QQuick3DObject &node); |
36 | [[nodiscard]] static QSSGResourceId getResourceId(const QQuick3DObject &resource); |
37 | [[nodiscard]] static QSSGCameraId getCameraId(const QQuick3DObject &camera); |
38 | [[nodiscard]] static QSSGExtensionId getExtensionId(const QQuick3DObject &extension); |
39 | |
40 | template<typename QSSGTypeId> |
41 | [[nodiscard]] static constexpr bool isNull(QSSGTypeId id) { return (id == QSSGTypeId::Invalid); } |
42 | }; |
43 | |
44 | QT_END_NAMESPACE |
45 | |
46 | #endif // QQUICK3DEXTENSIONHELPERS_H |
47 |