Factory for Nori objects. More...
#include <object.h>
Public Types | |
typedef std::function< NoriObject *(const PropertyList &)> | Constructor |
Static Public Member Functions | |
static void | registerClass (const std::string &name, const Constructor &constr) |
Register an object constructor with the object factory. More... | |
static NoriObject * | createInstance (const std::string &name, const PropertyList &propList) |
Construct an instance from the class of the given name. More... | |
static void | printRegisteredClasses () |
Factory for Nori objects.
This utility class is part of a mini-RTTI framework and can instantiate arbitrary Nori objects by their name.
|
inlinestatic |
Construct an instance from the class of the given name.
name | An internal name that is associated with this class. This is the 'type' field found in the scene description XML files |
propList | A list of properties that will be passed to the constructor of the class. |
|
static |
Register an object constructor with the object factory.
This function is called by the macro NORI_REGISTER_CLASS
name | An internal name that is associated with this class. This is the 'type' field found in the scene description XML files |
constr | A function pointer to an anonymous function that is able to call the constructor of the class. |
Definition at line 25 of file object.cpp.