Qt 6.x
The Qt SDK
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
29
31class QQmlChangeSet;
33
34class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleModelParticle : public QQuick3DParticle
35{
37 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
38 Q_PROPERTY(QQuick3DInstancing *instanceTable READ instanceTable NOTIFY instanceTableChanged)
39
40 QML_NAMED_ELEMENT(ModelParticle3D)
41 Q_CLASSINFO("DefaultProperty", "delegate")
43
44public:
46
47 QQmlComponent *delegate() const;
48 QQuick3DInstancing *instanceTable() const;
49
50public Q_SLOTS:
51 void setDelegate(QQmlComponent *delegate);
52
56
57protected:
58 void componentComplete() override;
59 void itemChange(ItemChange change, const ItemChangeData &value) override;
60
61 void setDepthBias(float bias) override
62 {
64 if (m_node)
65 updateDepthBias(bias);
66 }
67private:
68 void regenerate();
69 void handleMaxAmountChanged(int amount);
70 void handleSortModeChanged(QQuick3DParticle::SortMode mode);
71
74
75 void clearInstanceTable();
76 void addInstance(const QVector3D &position, const QVector3D &scale,
77 const QVector3D &eulerRotation, const QColor &color,
78 float age);
79 void commitInstance();
80 void updateDepthBias(float bias);
81
84 QQuick3DParticleInstanceTable *m_instanceTable = nullptr;
85
86 QVector3D m_initialScale;
87 float m_initialOpacity = 1.0f;
88 bool m_explicitColor;
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
\inmodule QtCore
Definition qpointer.h:18
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 itemChange(ItemChange, const ItemChangeData &)
virtual void setDepthBias(float bias)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
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
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
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent