1 | // Copyright (C) 2020 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QSSGJOINT_H |
5 | #define QSSGJOINT_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 <QtQuick3D/private/qquick3dnode_p.h> |
19 | #include <QtQuick3D/private/qquick3dskeleton_p.h> |
20 | |
21 | #include <QtQuick3DRuntimeRender/private/qssgrenderskeleton_p.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class Q_QUICK3D_EXPORT QQuick3DJoint : public QQuick3DNode |
26 | { |
27 | Q_OBJECT |
28 | Q_PROPERTY(qint32 index READ index WRITE setIndex NOTIFY indexChanged) |
29 | Q_PROPERTY(QQuick3DSkeleton *skeletonRoot READ skeletonRoot WRITE setSkeletonRoot NOTIFY skeletonRootChanged) |
30 | |
31 | QML_NAMED_ELEMENT(Joint) |
32 | |
33 | public: |
34 | explicit QQuick3DJoint(QQuick3DNode *parent = nullptr); |
35 | ~QQuick3DJoint() override; |
36 | |
37 | qint32 index() const; |
38 | QQuick3DSkeleton *skeletonRoot() const; |
39 | |
40 | public Q_SLOTS: |
41 | void setIndex(qint32 index); |
42 | void setSkeletonRoot(QQuick3DSkeleton *skeleton); |
43 | |
44 | Q_SIGNALS: |
45 | void indexChanged(); |
46 | void skeletonRootChanged(); |
47 | |
48 | protected: |
49 | QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override; |
50 | void markAllDirty() override; |
51 | |
52 | private Q_SLOTS: |
53 | |
54 | private: |
55 | bool m_indexDirty = true; |
56 | bool m_skeletonRootDirty = true; |
57 | int m_index = 0; |
58 | |
59 | QQuick3DSkeleton *m_skeletonRoot = nullptr; |
60 | |
61 | QMetaObject::Connection m_skeletonConnection; |
62 | }; |
63 | |
64 | QT_END_NAMESPACE |
65 | |
66 | #endif // QSSGJOINT_H |
67 | |