UserData
Functions
|
|
void |
Detailed Description
-
class UserData : public RED::Object
Generic class for custom user data.
@related Saving and Reloading a Custom Container , class RED::UserDataRaw
The RED::UserData is a data container that can be freely associated to any scene graph object. Shapes, materials fonts and images expose the RED::IUserData interface, so that user data can be stored on them, according to the application needs.
As long as a class inheriting RED::UserData implements valid chunk writing and reading methods, instances of this class will be automatically loaded from and saved to .red files.
Subclassed by RED::UserDataRaw
Public Functions
- SET_CID (CID_class_REDUserData) IMPLEMENT_AS()
-
UserData()
Default constructor.
-
virtual ~UserData()
Default destructor.
-
virtual void UnlinkFrom(RED::Object *iObject) = 0
Method called when the user data are unlinked from a RED::Object instance.
A RED::UserData object can be linked exclusively to a RED::IUserData instance by making the latter the owner of the former (see RED::IUserData::SetUserData). In such a case, destroying the RED::IUserData instance will destroy the linked RED::UserData too. If not the owner, destroying the RED::IUserData will automatically call the UnlinkFrom method to inform the RED::UserData object of the lost of connectivity with the RED::IUserData instance.
Note that a call to UnlinkFrom can also occur when the RED::IUserData instance gets linked with another RED::UserData object, replacing the current connection.
- Parameters
iObject – Pointer to the object from which the user data are being unlinked.