class RED::IUserData

This interface gives access to custom user data on scene graph objects. More...

#include <REDIUserData.h>

Inherits: IREDObject.

Public functions:

virtual RED::UserData *GetUserData ( ) const = 0
virtual voidSetUserData ( RED::UserData * iUserData, bool iOwner ) = 0

Public static functions:

static RED::CIDGetClassID ( )

Detailed description:

This interface gives access to custom user data on scene graph objects.

An object that implements the RED::IUserData interface may store custom application data. The data container is a derived class of the RED::UserData base class. REDsdk provides a default data container named RED::UserDataRaw for the storage of applicative data.

Note that there's no need to use user data containers if the application data is just set to a single identifier value. In this case, the RED::Object::SetID method can be used to store a unique identifier associated to any REDsdk object deriving from RED::Object.

Several objects are implementing the RED::IUserData interface. Among them we find all shapes, viewpoints, materials and fonts. These are either created using the RED::Factory::CreateInstance call or using the RED::IResourceManager interface.

Functions documentation

public virtual RED::UserData * RED::IUserData::GetUserData() const = 0

Gets the user data linked to the object.


A pointer to the user data linked to the object.
public virtual void RED::IUserData::SetUserData(RED::UserData *iUserData,
) = 0

Sets the custom user data linked to the object.

Previously linked user data will be destroyed if the object has been declared as the data owner, otherwise they are notified of the unlink action by a call to their Unlink method.


iUserData:pointer to the user data.
iOwner:true if the object is responsible of deleting the user data when its destructor is called, false otherwise (call to RED::UserData::UnlinkFrom).