1 | // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DANIMATION_ANIMATION_CHANNELMAPPER_P_H |
5 | #define QT3DANIMATION_ANIMATION_CHANNELMAPPER_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 for the convenience |
12 | // of other Qt classes. 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 <Qt3DAnimation/private/backendnode_p.h> |
19 | #include <Qt3DAnimation/private/fcurve_p.h> |
20 | |
21 | #include <Qt3DCore/qnodeid.h> |
22 | |
23 | #include <QtCore/qlist.h> |
24 | |
25 | QT_BEGIN_NAMESPACE |
26 | |
27 | namespace Qt3DAnimation { |
28 | namespace Animation { |
29 | |
30 | class Handler; |
31 | |
32 | class Q_AUTOTEST_EXPORT ChannelMapper : public BackendNode |
33 | { |
34 | public: |
35 | ChannelMapper(); |
36 | |
37 | void cleanup(); |
38 | |
39 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
40 | |
41 | void setMappingIds(const Qt3DCore::QNodeIdVector &mappingIds) { m_mappingIds = mappingIds; } |
42 | Qt3DCore::QNodeIdVector mappingIds() const { return m_mappingIds; } |
43 | |
44 | QVector<ChannelMapping*> mappings() const |
45 | { |
46 | if (m_isDirty) |
47 | updateMappings(); |
48 | return m_mappings; |
49 | } |
50 | |
51 | private: |
52 | void updateMappings() const; |
53 | |
54 | Qt3DCore::QNodeIdVector m_mappingIds; |
55 | |
56 | // Cached data |
57 | mutable QVector<ChannelMapping*> m_mappings; |
58 | mutable bool m_isDirty; |
59 | }; |
60 | |
61 | } // namespace Animation |
62 | } // namespace Qt3DAnimation |
63 | |
64 | |
65 | QT_END_NAMESPACE |
66 | |
67 | #endif // QT3DANIMATION_ANIMATION_CHANNELMAPPER_P_H |
68 | |