7#include <QtQuick3DRuntimeRender/private/qssgrenderresourceloader_p.h>
79 if (m_meshSources == newMeshSources)
81 m_meshSources = newMeshSources;
83 markDirty(QQuick3DResourceLoader::MeshesDirty);
91 QQuick3DResourceLoader::qmlAppendGeometry,
92 QQuick3DResourceLoader::qmlGeometriesCount,
93 QQuick3DResourceLoader::qmlGeometryAt,
94 QQuick3DResourceLoader::qmlClearGeometries);
101 QQuick3DResourceLoader::qmlAppendTexture,
102 QQuick3DResourceLoader::qmlTexturesCount,
103 QQuick3DResourceLoader::qmlTextureAt,
104 QQuick3DResourceLoader::qmlClearTextures);
107void QQuick3DResourceLoader::onGeometryDestroyed(
QObject *
object)
110 for (
int i = 0;
i < m_geometries.
size(); ++
i) {
111 if (m_geometries[
i] ==
object) {
117 markDirty(QQuick3DResourceLoader::GeometriesDirty);
120void QQuick3DResourceLoader::onTextureDestroyed(
QObject *
object)
123 for (
int i = 0;
i < m_textures.
size(); ++
i) {
124 if (m_textures[
i] ==
object) {
130 markDirty(QQuick3DResourceLoader::TexturesDirty);
140 int dirtyAttribute = 0;
143 if (m_dirtyAttributes & MeshesDirty) {
144 resourceLoaderNode->
meshes.clear();
145 for (
const auto &mesh : std::as_const(m_meshSources))
149 if (m_dirtyAttributes & TexturesDirty) {
150 resourceLoaderNode->textures.clear();
151 for (
const auto &
texture : std::as_const(m_textures)) {
154 resourceLoaderNode->textures.push_back(graphObject);
156 dirtyAttribute |= TexturesDirty;
160 if (m_dirtyAttributes & GeometriesDirty) {
161 resourceLoaderNode->geometries.clear();
162 for (
const auto &geometry : std::as_const(m_geometries)) {
165 resourceLoaderNode->geometries.push_back(graphObject);
167 dirtyAttribute |= GeometriesDirty;
171 m_dirtyAttributes = dirtyAttribute;
172 return resourceLoaderNode;
178 m_dirtyAttributes = 0xffffffff;
184 if (change == QQuick3DObject::ItemSceneChange)
185 updateSceneManager(
value.sceneManager);
190 if (geometry ==
nullptr)
195 self->markDirty(QQuick3DResourceLoader::GeometriesDirty);
197 if (geometry->parentItem() ==
nullptr) {
220 qWarning(
"The index exceeds the range of valid geometries.");
236 for (
const auto &geometry :
std::as_const(
self->m_geometries)) {
237 if (geometry->parentItem() ==
nullptr)
243 self->markDirty(QQuick3DResourceLoader::GeometriesDirty);
253 self->markDirty(QQuick3DResourceLoader::TexturesDirty);
255 if (
texture->parentItem() ==
nullptr) {
260 texture->setParentItem(parentItem);
276 qWarning(
"The index exceeds the range of valid texture data.");
292 for (
const auto &
data :
std::as_const(
self->m_textures)) {
293 if (
data->parentItem() ==
nullptr)
298 self->markDirty(QQuick3DResourceLoader::TexturesDirty);
301void QQuick3DResourceLoader::markDirty(ResourceLoaderDirtyType
type)
312 for (
auto &geometry : m_geometries)
315 for (
auto &
texture : m_textures)
319 for (
auto &geometry : m_geometries)
321 for (
auto &
texture : m_textures)
qsizetype size() const noexcept
void removeAt(qsizetype i)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
The QQmlListProperty class allows applications to expose list-like properties of QObject-derived clas...
\qmltype Geometry \inherits Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DGeometry
static QString translateMeshSource(const QUrl &source, QObject *contextObject)
QPointer< QQuick3DSceneManager > sceneManager
void refSceneManager(QQuick3DSceneManager &)
static QQuick3DObjectPrivate * get(QQuick3DObject *item)
QSSGRenderGraphObject * spatialNode
\qmltype Object3D \inqmlmodule QtQuick3D \instantiates QQuick3DObject \inherits QtObject
QQuick3DObject * parent
\qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a...
void setParentItem(QQuick3DObject *parentItem)
virtual QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node)
virtual void markAllDirty()
void meshSourcesChanged()
QQmlListProperty< QQuick3DTexture > textures
QSSGRenderGraphObject * updateSpatialNode(QSSGRenderGraphObject *node) override
QQmlListProperty< QQuick3DGeometry > geometries
void setMeshSources(const QList< QUrl > &newMeshSources)
QList< QUrl > meshSources
void itemChange(ItemChange change, const ItemChangeData &value) override
QQuick3DResourceLoader(QQuick3DObject *parent=nullptr)
\qmltype ResourceLoader \inqmlmodule QtQuick3D \inherits Object3D
void markAllDirty() override
void clear()
Clears the contents of the string and makes it null.
qsizetype size() const
Returns the number of characters in this string.
void push_back(QChar c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const QChar at(qsizetype i) const
Returns the character at the given index position in the string.
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
if(qFloatDistance(a, b)<(1<< 7))
[0]
QVector< QSSGRenderPath > meshes
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent