1 | // Copyright (C) 2022 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICK3DPARTICLEDYNAMICBURST_H |
5 | #define QQUICK3DPARTICLEDYNAMICBURST_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 purely as an |
12 | // implementation detail. 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 <QtQuick3DParticles/private/qquick3dparticleemitburst_p.h> |
19 | |
20 | QT_BEGIN_NAMESPACE |
21 | |
22 | class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleDynamicBurst : public QQuick3DParticleEmitBurst |
23 | { |
24 | Q_OBJECT |
25 | Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) |
26 | Q_PROPERTY(int amountVariation READ amountVariation WRITE setAmountVariation NOTIFY amountVariationChanged) |
27 | Q_PROPERTY(TriggerMode triggerMode READ triggerMode WRITE setTriggerMode NOTIFY triggerModeChanged) |
28 | QML_NAMED_ELEMENT(DynamicBurst3D) |
29 | QML_ADDED_IN_VERSION(6, 3) |
30 | |
31 | public: |
32 | enum TriggerMode |
33 | { |
34 | TriggerTime = 0, |
35 | TriggerStart, |
36 | TriggerEnd |
37 | }; |
38 | Q_ENUM(TriggerMode) |
39 | |
40 | explicit QQuick3DParticleDynamicBurst(QObject *parent = nullptr); |
41 | bool enabled() const; |
42 | int amountVariation() const; |
43 | TriggerMode triggerMode() const; |
44 | |
45 | public Q_SLOTS: |
46 | void setEnabled(bool enabled); |
47 | void setAmountVariation(int value); |
48 | void setTriggerMode(TriggerMode mode); |
49 | |
50 | Q_SIGNALS: |
51 | void enabledChanged(); |
52 | void amountVariationChanged(); |
53 | void triggerModeChanged(); |
54 | |
55 | private: |
56 | friend class QQuick3DParticleEmitter; |
57 | |
58 | bool m_enabled = true; |
59 | int m_amountVariation = 0; |
60 | TriggerMode m_triggerMode = TriggerMode::TriggerTime; |
61 | }; |
62 | |
63 | QT_END_NAMESPACE |
64 | |
65 | #endif // QQUICK3DPARTICLEDYNAMICBURST_H |
66 | |