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
qquick3dparticleshape_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 QQUICK3DPARTICLESHAPE_H
5#define QQUICK3DPARTICLESHAPE_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
24class QQuick3DModel;
25
26class Q_QUICK3DPARTICLES_EXPORT QQuick3DParticleShape : public QQuick3DParticleAbstractShape
27{
29 Q_PROPERTY(bool fill READ fill WRITE setFill NOTIFY fillChanged)
30 Q_PROPERTY(ShapeType type READ type WRITE setType NOTIFY typeChanged)
31 Q_PROPERTY(QVector3D extents READ extents WRITE setExtents NOTIFY extentsChanged)
32
33 QML_NAMED_ELEMENT(ParticleShape3D)
35
36public:
38 {
39 Cube = 0,
41 Cylinder
42 };
43 Q_ENUM(ShapeType)
44
45 QQuick3DParticleShape(QObject *parent = nullptr);
46
47 bool fill() const;
48 ShapeType type() const;
49 QVector3D extents() const;
50
51 // Returns point inside this shape
52 QVector3D getPosition(int particleIndex) override;
53
54public Q_SLOTS:
55 void setFill(bool fill);
57 void setExtents(QVector3D extends);
58
63
64private:
65 QVector3D randomPositionCube(int particleIndex) const;
66 QVector3D randomPositionSphere(int particleIndex) const;
67 QVector3D randomPositionCylinder(int particleIndex) const;
68
69 bool m_fill = true;
70 ShapeType m_type = ShapeType::Cube;
71 QVector3D m_extents = QVector3D(50, 50, 50);
72};
73
75
76#endif // QQUICK3DPARTICLESHAPE_H
\inmodule QtCore
Definition qobject.h:103
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLenum type
#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_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
ba fill(true)
proxy setType(QNetworkProxy::Socks5Proxy)