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
qquick3dparticlemodelshape_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 QQUICK3DPARTICLEMODELSHAPE_H
5#define QQUICK3DPARTICLEMODELSHAPE_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
19#include <QVector3D>
20
22
23class QQuick3DModel;
24class QQmlComponent;
25
26class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleModelShape : public QQuick3DParticleAbstractShape
27{
29 Q_PROPERTY(bool fill READ fill WRITE setFill NOTIFY fillChanged)
30 Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged)
31 QML_NAMED_ELEMENT(ParticleModelShape3D)
33
34public:
35 QQuick3DParticleModelShape(QObject *parent = nullptr);
37
38 bool fill() const;
39 QQmlComponent *delegate() const;
40
41public Q_SLOTS:
42 void setFill(bool fill);
43 void setDelegate(QQmlComponent *delegate);
44
45 // Returns point inside this shape
46 QVector3D getPosition(int particleIndex) override;
47
49 void fillChanged();
50 void delegateChanged();
51
53 QVector3D randomPositionModel(int particleIndex);
54 void createModel();
55 void clearModelVertexPositions();
56 void calculateModelVertexPositions();
57
58 QQmlComponent *m_delegate = nullptr;
59 QQuick3DModel *m_model = nullptr;
60 QVector<QVector3D> m_vertexPositions;
61 float m_modelTriangleAreasSum = 0;
62 QVector<float> m_modelTriangleAreas;
63 QVector3D m_modelTriangleCenter;
64 bool m_fill = true;
65};
66
68
69#endif // QQUICK3DPARTICLEMODELSHAPE_H
DarwinBluetooth::DeviceInquiryDelegate * m_delegate
Definition qlist.h:75
\inmodule QtCore
Definition qobject.h:103
The QQmlComponent class encapsulates a QML component definition.
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
static QVector3D getPosition(const quint8 *srcVertices, quint32 idx, quint32 vertexStride, quint32 posOffset)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
ba fill(true)