Share

Run-Time Type Information (RTTI)

Product Documentation

Run-Time Type Information (RTTI)

Mudbox uses its own run-time type information system. An instance of the class ClassDesc is assigned to each class derived from Node and holds information such as:

  • Name of the class
  • Name of the class as it appears in the source code
  • Pointer to a function which can create instances of the class
  • Pointer to the ClassDesc instance describing the parent class(es)

These ClassDesc instances are linked in a list so it's possible to enumerate the class and search for a class with a given name or given parent, and create instances of the class.

There are two macros defined in the SDK for creating a ClassDesc instance for a given class, these are:

  • DECLARE_CLASS - This must be used in the header file of the class and doesn’t need any parameter
  • IMPLEMENT_CLASS - Used in the implementation file. Requires the name of the class, the name of the parent class and a display name of the class as parameters.


Run-Time Type Information (RTTI)

Mudbox uses its own run-time type information system. An instance of the class ClassDesc is assigned to each class derived from Node and holds information such as:

  • Name of the class
  • Name of the class as it appears in the source code
  • Pointer to a function which can create instances of the class
  • Pointer to the ClassDesc instance describing the parent class(es)

These ClassDesc instances are linked in a list so it's possible to enumerate the class and search for a class with a given name or given parent, and create instances of the class.

There are two macros defined in the SDK for creating a ClassDesc instance for a given class, these are:

  • DECLARE_CLASS - This must be used in the header file of the class and doesn’t need any parameter
  • IMPLEMENT_CLASS - Used in the implementation file. Requires the name of the class, the name of the parent class and a display name of the class as parameters.


Was this information helpful?