1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLEABSTRACTSHAPE_H
5#define QQUICK3DPARTICLEABSTRACTSHAPE_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 <QObject>
19#include <QtQml/qqmlparserstatus.h>
20#include <QtQml/qqml.h>
21#include <QtQuick3DParticles/qtquick3dparticlesglobal.h>
22#include <private/qglobal_p.h>
23
24QT_BEGIN_NAMESPACE
25
26class QQuick3DParticleSystem;
27class QQuick3DNode;
28
29class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleAbstractShape : public QObject, public QQmlParserStatus
30{
31 Q_OBJECT
32 QML_ANONYMOUS
33 Q_INTERFACES(QQmlParserStatus)
34 QML_ADDED_IN_VERSION(6, 2)
35
36public:
37 explicit QQuick3DParticleAbstractShape(QObject *parent = nullptr);
38 // Returns position inside the shape
39 virtual QVector3D getPosition(int particleIndex) = 0;
40
41protected:
42 // These need access to m_system
43 friend class QQuick3DParticleEmitter;
44 friend class QQuick3DParticleAttractor;
45
46 // From QQmlParserStatus
47 void componentComplete() override;
48 void classBegin() override {}
49 QQuick3DNode *parentNode();
50
51 QQuick3DNode *m_parentNode = nullptr;
52 QQuick3DParticleSystem *m_system = nullptr;
53};
54
55QT_END_NAMESPACE
56
57#endif // QQUICK3DPARTICLEABSTRACTSHAPE_H
58

source code of qtquick3d/src/quick3dparticles/qquick3dparticleabstractshape_p.h