Skip to content

Kuesa::Qt3D::AbstractAssetCollection

Module: Kuesa Qt 3D API

An abstract base class for managing collections of assets in 3d models. More...

#include <Kuesa/Qt3D/api/collections/abstractassetcollection.h>

Inherits from Qt3DCore::QNode

Inherited by Kuesa::Qt3D::AnimationClipCollection, Kuesa::Qt3D::AnimationMappingCollection, Kuesa::Qt3D::ArmatureCollection, Kuesa::Qt3D::CameraCollection, Kuesa::Qt3D::EffectCollection, Kuesa::Qt3D::EntityCollection, Kuesa::Qt3D::LayerCollection, Kuesa::Qt3D::LightCollection, Kuesa::Qt3D::MaterialCollection, Kuesa::Qt3D::MeshCollection, Kuesa::Qt3D::PlaceholderCollection, Kuesa::Qt3D::ReflectionPlaneCollection, Kuesa::Qt3D::SkeletonCollection, Kuesa::Qt3D::TextureCollection, Kuesa::Qt3D::TextureImageCollection, Kuesa::Qt3D::TransformCollection

Public Signals

Name
void namesChanged()
void sizeChanged()
void assetAdded(const QString & name)

Public Functions

Name
~AbstractAssetCollection()
QStringList names()
int size()
bool contains(const QString & name) const
bool contains(Qt3DCore::QNode * asset) const
Qt3DCore::QNode * findAsset(const QString & name)
void remove(const QString & name)
void clear()

Protected Functions

Name
AbstractAssetCollection(Qt3DCore::QNode * parent =nullptr)
void addAsset(const QString & name, Qt3DCore::QNode * asset)

Public Properties

Name
QStringList names
int size

Detailed Description

1
class Kuesa::Qt3D::AbstractAssetCollection;

An abstract base class for managing collections of assets in 3d models.

Since: Kuesa 2.0

Kuesa::Qt3D::AbstractAssetCollection is an abstract class used to implement collections of shared assets in 3d models.

It manages a set of QNode derived classes, each associated with a unique name.

Assets can be added and removed. Assets which do not have a valid parent will be reparented to the asset collection.

If no asset can be found for a given name, nullptr will be returned.

If a new asset is added with a name matching that of an already existing asset in the collection, the existing asset will be replaced with the new one, the old one will be removed.

When an asset referenced by the collection is destroyed, it will automatically be removed from the collection.

Removing an asset from the collection also results in the asset being destroyed if the asset's parent is the collection itself.

Public Signals Documentation

signal namesChanged

1
void namesChanged()

signal sizeChanged

1
void sizeChanged()

signal assetAdded

1
2
3
void assetAdded(
    const QString & name
)

Public Functions Documentation

function ~AbstractAssetCollection

1
~AbstractAssetCollection()

function names

1
QStringList names()

function size

1
int size()

function contains

1
2
3
bool contains(
    const QString & name
) const

Returns true if the name name exists in the collection

function contains

1
2
3
bool contains(
    Qt3DCore::QNode * asset
) const

Returns true if the asset asset exists in the collection

function findAsset

1
2
3
Qt3DCore::QNode * findAsset(
    const QString & name
)

function remove

1
2
3
void remove(
    const QString & name
)

Removes the asset corresponding to name, if it exists

function clear

1
void clear()

Removes all assets from the collection

Protected Functions Documentation

function AbstractAssetCollection

1
2
3
explicit AbstractAssetCollection(
    Qt3DCore::QNode * parent =nullptr
)

function addAsset

1
2
3
4
void addAsset(
    const QString & name,
    Qt3DCore::QNode * asset
)

Public Property Documentation

property names

1
QStringList names;

Holds the list of names for the currently managed assets.

property size

1
int size;

Updated on 2023-07-03 at 11:02:09 +0000