Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dparticlemodelparticle_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DPARTICLEMODELPARTICLE_H
5#define QQUICK3DPARTICLEMODELPARTICLE_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 <QColor>
19#include <QVector4D>
20#include <QtQuick3D/private/qquick3dnode_p.h>
21#include <QtQuick3D/private/qquick3dmodel_p.h>
22#include <QtQuick3D/qquick3dinstancing.h>
23
24#include <QtQuick3DParticles/private/qquick3dparticle_p.h>
25#include <QtQuick3DParticles/private/qquick3dparticlesystem_p.h>
26#include <QtQuick3DParticles/private/qquick3dparticledata_p.h>
27
28#include <QtCore/qpointer.h>
29
31
33class QQmlChangeSet;
35
36class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleModelParticle : public QQuick3DParticle
37{
39 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
40 Q_PROPERTY(QQuick3DInstancing *instanceTable READ instanceTable NOTIFY instanceTableChanged)
41
42 QML_NAMED_ELEMENT(ModelParticle3D)
43 Q_CLASSINFO("DefaultProperty", "delegate")
45
46public:
48
49 QQmlComponent *delegate() const;
50 QQuick3DInstancing *instanceTable() const;
51
52public Q_SLOTS:
53 void setDelegate(QQmlComponent *delegate);
54
56 void delegateChanged();
57 void instanceTableChanged();
58
59protected:
60 void componentComplete() override;
61 void itemChange(ItemChange change, const ItemChangeData &value) override;
62
63 void setDepthBias(float bias) override
64 {
66 if (m_node)
67 updateDepthBias(bias);
68 }
69private:
70 void regenerate();
71 void handleMaxAmountChanged(int amount);
72 void handleSortModeChanged(QQuick3DParticle::SortMode mode);
73
76
77 void clearInstanceTable();
78 void addInstance(const QVector3D &position, const QVector3D &scale,
79 const QVector3D &eulerRotation, const QColor &color,
80 float age);
81 void commitInstance();
82 void updateDepthBias(float bias);
83
84 QPointer<QQmlComponent> m_delegate;
85 QPointer<QQuick3DNode> m_node;
86 QQuick3DParticleInstanceTable *m_instanceTable = nullptr;
87
88 QVector3D m_initialScale;
89};
90
92
93#endif // QQUICK3DPARTICLEMODELPARTICLE_H
DarwinBluetooth::DeviceInquiryDelegate * m_delegate
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QQmlChangeSet class stores an ordered list of notifications about changes to a linear data set.
The QQmlComponent class encapsulates a QML component definition.
\inmodule QtQuick3D \inherits QQuick3DObject
virtual void setDepthBias(float bias)
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLenum mode
GLuint color
[2]
GLfloat bias
GLenum GLenum GLenum GLenum GLenum scale
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_CLASSINFO(name, value)
#define Q_SLOTS
#define Q_SIGNALS