9#include <QtQml/qqmlcontext.h>
10#include <QtQml/qqmlfile.h>
11#include <QtCore/qfile.h>
95 if (m_random == random)
100 m_randomizeDirty =
true;
104void QQuick3DParticleCustomShape::loadFromSource()
112 QFile dataFile(dataFilePath);
115 qWarning() <<
"Unable to open file:" << dataFilePath;
125 qWarning() <<
"Invalid shape data version:" << version;
144 m_randomizeDirty =
true;
147void QQuick3DParticleCustomShape::doRandomizeData()
154 std::shuffle(m_positions.
begin(), m_positions.
end(), std::default_random_engine(
seed));
156 m_randomizeDirty =
false;
165 if (m_randomizeDirty)
168 int index = particleIndex % m_positions.
size();
\inmodule QtCore\reentrant
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
QObject * parent() const
Returns a pointer to the parent object.
The QQmlContext class defines a context within a QML engine.
static QString urlToLocalFileOrQrc(const QString &)
If url is a local file returns a path suitable for passing to QFile.
QQuick3DNode * parentNode()
QQuick3DParticleSystem * m_system
void setSource(const QUrl &source)
void randomizeDataChanged()
void setRandomizeData(bool random)
QQuick3DParticleCustomShape(QObject *parent=nullptr)
\qmltype ParticleCustomShape3D \inherits ParticleAbtractShape3D \inqmlmodule QtQuick3D....
QVector3D getPosition(int particleIndex) override
static int readShapeHeader(QCborStreamReader &reader)
static QVariant readValue(QCborStreamReader &reader, QMetaType::Type type)
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QVector3D class represents a vector or vertex in 3D space.
Combined button and popup list for selecting options.
QImageReader reader("image.png")
[1]
GLsizei GLsizei GLchar * source
QQmlContext * qmlContext(const QObject *obj)
static Q_CONSTINIT QBasicAtomicInteger< unsigned > seed
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent