| 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 | #include "qanimationclip.h" |
| 5 | #include "qanimationclip_p.h" |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | namespace Qt3DAnimation { |
| 10 | |
| 11 | QAnimationClipPrivate::QAnimationClipPrivate() |
| 12 | : QAbstractAnimationClipPrivate() |
| 13 | , m_clipData() |
| 14 | { |
| 15 | } |
| 16 | |
| 17 | /*! |
| 18 | \class Qt3DAnimation::QAnimationClip |
| 19 | \inherits Qt3dAnimation::QAbstractAnimationClip |
| 20 | \inmodule Qt3DAnimation |
| 21 | \brief Specifies key frame animation data. |
| 22 | */ |
| 23 | QAnimationClip::QAnimationClip(Qt3DCore::QNode *parent) |
| 24 | : QAbstractAnimationClip(*new QAnimationClipPrivate, parent) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | QAnimationClip::QAnimationClip(QAnimationClipPrivate &dd, Qt3DCore::QNode *parent) |
| 29 | : QAbstractAnimationClip(dd, parent) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | QAnimationClip::~QAnimationClip() |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | /*! |
| 38 | Returns the data describing the animation clip. |
| 39 | */ |
| 40 | QAnimationClipData QAnimationClip::clipData() const |
| 41 | { |
| 42 | Q_D(const QAnimationClip); |
| 43 | return d->m_clipData; |
| 44 | } |
| 45 | |
| 46 | /*! |
| 47 | Set the parameters of the clip according to the \a clipData provided. |
| 48 | */ |
| 49 | void QAnimationClip::setClipData(const Qt3DAnimation::QAnimationClipData &clipData) |
| 50 | { |
| 51 | Q_D(QAnimationClip); |
| 52 | if (d->m_clipData == clipData) |
| 53 | return; |
| 54 | |
| 55 | d->m_clipData = clipData; |
| 56 | emit clipDataChanged(clipData); |
| 57 | } |
| 58 | |
| 59 | } // namespace Qt3DAnimation |
| 60 | |
| 61 | QT_END_NAMESPACE |
| 62 | |
| 63 | #include "moc_qanimationclip.cpp" |
| 64 |
