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_QCHANNEL_H |
5 | #define QT3DANIMATION_QCHANNEL_H |
6 | |
7 | #include <QtCore/qscopedpointer.h> |
8 | #include <QtCore/qstring.h> |
9 | #include <Qt3DAnimation/qt3danimation_global.h> |
10 | #include <Qt3DAnimation/qchannelcomponent.h> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | namespace Qt3DAnimation { |
15 | |
16 | class QChannelPrivate; |
17 | |
18 | class Q_3DANIMATIONSHARED_EXPORT QChannel |
19 | { |
20 | public: |
21 | QChannel(); |
22 | explicit QChannel(const QString &name); |
23 | QChannel(const QChannel &); |
24 | QChannel &operator=(const QChannel &); |
25 | ~QChannel(); |
26 | |
27 | void setName(const QString &name); |
28 | QString name() const; |
29 | |
30 | void setJointIndex(int jointIndex); |
31 | int jointIndex() const; |
32 | |
33 | int channelComponentCount() const; |
34 | void appendChannelComponent(const QChannelComponent &component); |
35 | void insertChannelComponent(int index, const QChannelComponent &component); |
36 | void removeChannelComponent(int index); |
37 | void clearChannelComponents(); |
38 | |
39 | // Iterator API |
40 | typedef const QChannelComponent *const_iterator; |
41 | typedef std::reverse_iterator<const_iterator> const_reverse_iterator; |
42 | |
43 | const_iterator begin() const noexcept; |
44 | const_iterator cbegin() const noexcept { return begin(); } |
45 | const_iterator end() const noexcept; |
46 | const_iterator cend() const noexcept { return end(); } |
47 | const_reverse_iterator rbegin() const noexcept { return const_reverse_iterator(end()); } |
48 | const_reverse_iterator crbegin() const noexcept { return rbegin(); } |
49 | const_reverse_iterator rend() const noexcept { return const_reverse_iterator(begin()); } |
50 | const_reverse_iterator crend() const noexcept { return rend(); } |
51 | |
52 | friend Q_3DANIMATIONSHARED_EXPORT bool operator==(const QChannel &, |
53 | const QChannel &) noexcept; |
54 | friend Q_3DANIMATIONSHARED_EXPORT bool operator!=(const QChannel &, |
55 | const QChannel &) noexcept; |
56 | |
57 | private: |
58 | QScopedPointer<QChannelPrivate> d; |
59 | }; |
60 | |
61 | } // namespace Qt3DAnimation |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QT3DANIMATION_QCHANNEL_H |
66 |