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
25QT_BEGIN_NAMESPACE
26
27namespace Qt3DAnimation {
28namespace Animation {
29
30class Handler;
31
32class Q_AUTOTEST_EXPORT ChannelMapper : public BackendNode
33{
34public:
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
51private:
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
65QT_END_NAMESPACE
66
67#endif // QT3DANIMATION_ANIMATION_CHANNELMAPPER_P_H
68

source code of qt3d/src/animation/backend/channelmapper_p.h