| virtual makVrv::DtModelInstanceFactory::~DtModelInstanceFactory |
( |
| ) |
|
|
virtual |
| makVrv::DtModelInstanceFactory::DtModelInstanceFactory |
( |
DtDe & |
de | ) |
|
|
protected |
Get the instance for this factory. Creates this factory if one doesn't exist (lazy creation).
| static const std::string& makVrv::DtModelInstanceFactory::modelInstanceHintParameterName |
( |
| ) |
|
|
static |
Get the string for getting the model instance hint parameter name.
| DtModelInstance* makVrv::DtModelInstanceFactory::createModelInstance |
( |
const std::string & |
objectClassName, |
|
|
DtModelDefinition & |
definition, |
|
|
bool |
ignoreDefinitionHint = false, |
|
|
const std::string & |
modelInstanceClassOverride = "", |
|
|
bool |
realize = true |
|
) |
| |
Create a model instance. The creation process is complicated with multiple levels of specification. The typical construction of a model instance is solely dependent on the objectClass. Each objectClass is written to support one or more specific model instance classes. For each Model Instance class that the Object Class supports the type should be registered with this class using the registerSceneObjectClass function. When creating a model instance for a particular object class the CreatorClassList is iterated (front to back) and each classes is attempted to be created using the provided definition. Model definitions are free to also provide hints for object construction. A hint is simply a parameter of type 'ModelInstanceHint' with a value that is an Model Instance class name. Only hints that are also in the registered CreatorClassList for an object class are tried. If ignoreDefinitionHint is set to true, all hints in the model definition are completely ignored. Alternatively modelInstanceClassOverride can be set to a particular ModelInstanceClass name and as long as the model instance can realize the definition the 'DtModelInstance' instance will be returned regardless of whether the class is in the registered CreatorClassList for the objectClass. By default all valid model instance classes will be tried until one is found that can realize the definition. However as this is not always helpful in debugging it is possible to disable this functionality and on the first failure to realize a special debug model instance class is returned.
- Parameters
-
| Input | |
| objectClassName | is the name of the type of object creating the model instance. |
| definition | is a Valid ModelDefinition to be realized by the ModelInstance. |
| ignoreDefinitionHint | controls whether the model definition hint should be listened too. |
| modelInstanceClassOverride | is an optional parameter for setting the class name to be created. |
| realize | is an optional parameter indicating that the instance should be realized as well. |
| bool makVrv::DtModelInstanceFactory::isClassRegistered |
( |
const std::string & |
objectClass | ) |
const |
Check to see if an object class has been registered.
| void makVrv::DtModelInstanceFactory::registerSceneObjectClass |
( |
const std::string & |
objectClass, |
|
|
const CreatorClassList & |
classes |
|
) |
| |
Register an object class and a list of creator classes.
| void makVrv::DtModelInstanceFactory::registerModelInstanceCreator |
( |
const std::string & |
modelInstanceClassName, |
|
|
DtModelInstanceCreator * |
|
|
) |
| |
Register a model instance creator.
| const CreatorClassList& makVrv::DtModelInstanceFactory::sceneObjectClassCreators |
( |
const std::string & |
objectClass | ) |
|
Get a list of the model instance creator classes for an object class.
| void makVrv::DtModelInstanceFactory::addObjectClassCreatorToFront |
( |
const std::string & |
objectClass, |
|
|
const std::string & |
newCreatorClass |
|
) |
| |
Register a new creator class with the object Class to the front of the list. This means that the creator class will have top priority over other creators for the object class.
| void makVrv::DtModelInstanceFactory::addObjectClassCreatorToBack |
( |
const std::string & |
objectClass, |
|
|
const std::string & |
newCreatorClass |
|
) |
| |
Register a new creator class with the object Class to the back of the list. This means that the creator class will have bottom priority under other creators for the object class.
Get the model definition hints from the model instance.
Create and realize a model definition. If the model instance class is unable to realize a model definition the model instance class instance is deallocated and a NULL pointer is returned.
- Return values
-
| 0 | Unable to create a model instance class name based upon the model definition. |
| DtDe& makVrv::DtModelInstanceFactory::myDe |
|
protected |
| bool makVrv::DtModelInstanceFactory::myEnableDebugModelInstanceFallback |
|
protected |
| std::string makVrv::DtModelInstanceFactory::myDebugModelInstanceClass |
|
protected |
| CreatorMap makVrv::DtModelInstanceFactory::myCreators |
|
protected |
The documentation for this class was generated from the following file: