![]() |
VR-Forces 4.5 Class Documentation
|
A factory for DtCigiObject's. More...

Public Types | |
| typedef boost::unordered_map < std::string, DtCigiObjectCreator * > | CreatorMap |
| Maps model definition schemas to creators. | |
Public Member Functions | |
| DtCigiObjectFactory () | |
| Default CTOR. | |
| virtual | ~DtCigiObjectFactory () |
| DTOR. | |
| DtCigiObjectFactory (const DtCigiObjectFactory &rhs) | |
| Copy CTOR; deep copies contents. | |
| DtCigiObjectFactory & | operator= (const DtCigiObjectFactory &rhs) |
| Assignment; deep copies contents. | |
| virtual void | addCigiObjectCreator (const std::string &schema, DtCigiObjectCreator *creator) |
| Add a cigi object creator. | |
| virtual void | addDefaultCigiObjectCreator (DtCigiObjectCreator *creator) |
| If an unrecognized schema is passed in to createCigiObject, this creator will be used. | |
| DtCigiBaseEntity * | createCigiObject (const std::string &schema, DtCigiConnection &connection, DtAgentManagerInterface &sceneInterface, int entityId, int entityType) const |
| Create a CIGI object. | |
| const CreatorMap & | creators () const |
| Get the creators. | |
| const DtCigiObjectCreator * | findCreator (const std::string &schema) const |
| Find the specified creator; returns 0 if not found. | |
| std::vector< std::string > | listRegisteredSchemas () const |
| Get a list of registered registered schemas. | |
Public Member Functions inherited from makVrv::DtVirtualBaseClass | |
| DtVirtualBaseClass () | |
| Do nothing constructor. | |
| virtual | ~DtVirtualBaseClass () |
| Virtual do nothing destructor. | |
Static Public Member Functions | |
| static DtCigiObjectFactory & | instance (DtDe &de) |
| Get the instance of the factory from its owner de. | |
| static DtCigiObjectFactory & | instance (DtCigiConnection &con) |
| Get the instance of the factory from its owner CIGI connection. | |
| static void | copyInstance (DtCigiConnection &con, DtDe &de) |
| Create a new instance for the DtCigiConnection which is a copy of the DtDe instance. | |
Protected Attributes | |
| CreatorMap | myCreators |
| DtCigiObjectCreator * | myDefaultCigiObjectCreator |
A factory for DtCigiObject's.
The DtCigiObjectFactory is a singleton registered on the display engine. Creators are registered for CIGI objects by the CIGI plug-in during the plugin's init(). Creators may be overridden (or new ones created) using addCigiObjectCreator BEFORE the cigi driver is started. In the CIGI driver's onStart, the CIGI connection is created, a COPY of the factory is made, and registered as a singleton on the connection.
| typedef boost::unordered_map<std::string, DtCigiObjectCreator*> makVrv::DtCigiObjectFactory::CreatorMap |
Maps model definition schemas to creators.
| makVrv::DtCigiObjectFactory::DtCigiObjectFactory | ( | ) |
Default CTOR.
|
virtual |
DTOR.
| makVrv::DtCigiObjectFactory::DtCigiObjectFactory | ( | const DtCigiObjectFactory & | rhs | ) |
Copy CTOR; deep copies contents.
| DtCigiObjectFactory& makVrv::DtCigiObjectFactory::operator= | ( | const DtCigiObjectFactory & | rhs | ) |
Assignment; deep copies contents.
|
static |
Get the instance of the factory from its owner de.
|
static |
Get the instance of the factory from its owner CIGI connection.
|
static |
Create a new instance for the DtCigiConnection which is a copy of the DtDe instance.
|
virtual |
Add a cigi object creator.
Schema is the schema of the model definition that the CIGI entity has been mapped to. Currently recognized schemas are: "Entity" "DiGuyCharacter" "ParticleSystem" "Ribbon" "Decal" "Animation" The factory is initialized with the default creator for each of these model definition schema types in the CIGI plugin init()
|
virtual |
If an unrecognized schema is passed in to createCigiObject, this creator will be used.
It is initialized to DtCigiEntityCreator
| DtCigiBaseEntity* makVrv::DtCigiObjectFactory::createCigiObject | ( | const std::string & | schema, |
| DtCigiConnection & | connection, | ||
| DtAgentManagerInterface & | sceneInterface, | ||
| int | entityId, | ||
| int | entityType | ||
| ) | const |
Create a CIGI object.
Schema will determine which creator is used. The remaining parameters are passed to the created entities' constructors N.B. If the schema passed is not recognized and no valid default creator has been specified, the method THROWS DtException; so it should be called within a try/catch block
| const CreatorMap& makVrv::DtCigiObjectFactory::creators | ( | ) | const |
Get the creators.
| const DtCigiObjectCreator* makVrv::DtCigiObjectFactory::findCreator | ( | const std::string & | schema | ) | const |
Find the specified creator; returns 0 if not found.
| std::vector<std::string> makVrv::DtCigiObjectFactory::listRegisteredSchemas | ( | ) | const |
Get a list of registered registered schemas.
|
protected |
|
protected |