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_CHANNELMAPPING_P_H
5#define QT3DANIMATION_ANIMATION_CHANNELMAPPING_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#include <Qt3DAnimation/qanimationcallback.h>
21
22#include <Qt3DCore/qnodeid.h>
23#include <QtCore/QMetaProperty>
24
25QT_BEGIN_NAMESPACE
26
27namespace Qt3DAnimation {
28
29namespace Animation {
30
31class Handler;
32
33class Q_AUTOTEST_EXPORT ChannelMapping : public BackendNode
34{
35public:
36 enum MappingType {
37 ChannelMappingType = 0,
38 SkeletonMappingType,
39 CallbackMappingType
40 };
41
42 ChannelMapping();
43
44 void cleanup();
45
46 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
47
48 void setChannelName(const QString &channelName) { m_channelName = channelName; }
49 QString channelName() const { return m_channelName; }
50
51 void setTargetId(Qt3DCore::QNodeId targetId) { m_targetId = targetId; }
52 Qt3DCore::QNodeId targetId() const { return m_targetId; }
53
54 void setType(int type) { m_type = type; }
55 int type() const { return m_type; }
56
57 void setPropertyName(const char *propertyName) { m_propertyName = propertyName; }
58 const char *propertyName() const { return m_propertyName; }
59
60 void setComponentCount(int componentCount) { m_componentCount = componentCount; }
61 int componentCount() const { return m_componentCount; }
62
63 void setCallback(QAnimationCallback *callback) { m_callback = callback; }
64 QAnimationCallback *callback() const { return m_callback; }
65
66 void setCallbackFlags(QAnimationCallback::Flags flags) { m_callbackFlags = flags; }
67 QAnimationCallback::Flags callbackFlags() const { return m_callbackFlags; }
68
69 void setSkeletonId(Qt3DCore::QNodeId skeletonId) { m_skeletonId = skeletonId; }
70 Qt3DCore::QNodeId skeletonId() const { return m_skeletonId; }
71 Skeleton *skeleton() const;
72
73 void setMappingType(MappingType mappingType) { m_mappingType = mappingType; }
74 MappingType mappingType() const { return m_mappingType; }
75
76private:
77 // Properties from QChannelMapping
78 QString m_channelName;
79 Qt3DCore::QNodeId m_targetId;
80 int m_type;
81 int m_componentCount;
82 const char *m_propertyName;
83
84 // TODO: Properties from QCallbackMapping
85 QAnimationCallback *m_callback;
86 QAnimationCallback::Flags m_callbackFlags;
87
88 // Properties from QSkeletonMapping
89 Qt3DCore::QNodeId m_skeletonId;
90
91 MappingType m_mappingType;
92};
93
94} // namespace Animation
95} // namespace Qt3DAnimation
96
97
98QT_END_NAMESPACE
99
100#endif // QT3DANIMATION_ANIMATION_CHANNELMAPPING_P_H
101

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