IUserData

Functions

CID

GetClassID

void

SetUserData

UserData *

GetUserData

Detailed Description

class IUserData : public RED::IREDObject

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

@related class RED::UserData, class RED::UserDataRaw, Saving and Reloading a Custom Container

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.

Public Functions

virtual void SetUserData(RED::UserData *iUserData, bool iOwner) = 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.

Parameters
  • 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).

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

Gets the user data linked to the object.

Returns

A pointer to the user data linked to the object.

Public Static Functions

static inline RED::CID GetClassID()