Kuesa Runtime

AbstractAssetCollection Class

class Kuesa::AbstractAssetCollection

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

Header: #include <Kuesa/AbstractAssetCollection>
Since: Kuesa 1.0
Inherited By:

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

This class was introduced in Kuesa 1.0.

Properties

Public Functions

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

Signals

void namesChanged()
void sizeChanged()

Detailed Description

Kuesa::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.

Property Documentation

names : const QStringList

Holds the list of names for the currently managed assets.

Access functions:

QStringList names()

Notifier signal:

void namesChanged()

Member Function Documentation

void AbstractAssetCollection::clear()

Removes all assets from the collection

bool AbstractAssetCollection::contains(const QString &name) const

Returns true if the name name exists in the collection

bool AbstractAssetCollection::contains(Qt3DCore::QNode *asset) const

Returns true if the asset asset exists in the collection

void AbstractAssetCollection::remove(const QString &name)

Removes the asset corresponding to name, if it exists