VR-Forces 5.0.3 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes
makVrv::DtCigiObjectFactory Class Reference

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.

Inheritance diagram for makVrv::DtCigiObjectFactory:
Inheritance graph
[legend]

Public Types

typedef boost::unordered_map
< std::string,
DtCigiObjectCreator * > 
CreatorMap
 

Public Member Functions

 DtCigiObjectFactory ()
 
virtual ~DtCigiObjectFactory ()
 
 DtCigiObjectFactory (const DtCigiObjectFactory &rhs)
 
DtCigiObjectFactoryoperator= (const DtCigiObjectFactory &rhs)
 
virtual DtCigiObjectFactoryclone ()
 
virtual void addCigiObjectCreator (const std::string &schema, DtCigiObjectCreator *creator)
 
virtual void addDefaultCigiObjectCreator (DtCigiObjectCreator *creator)
 
DtCigiBaseEntitycreateCigiObject (const std::string &schema, DtCigiConnection &connection, DtAgentManagerInterface &sceneInterface, int entityId, int entityType) const
 
const CreatorMapcreators () const
 
const DtCigiObjectCreatorfindCreator (const std::string &schema) const
 
std::vector< std::string > listRegisteredSchemas () const
 
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 
virtual ~DtVirtualBaseClass ()
 

Static Public Member Functions

static DtCigiObjectFactoryinstance (DtDe &de)
 
static DtCigiObjectFactoryinstance (DtCigiConnection &con)
 
static void copyInstance (DtCigiConnection &con, DtDe &de)
 

Protected Attributes

CreatorMap myCreators
 
DtCigiObjectCreatormyDefaultCigiObjectCreator
 

Member Typedef Documentation

typedef boost::unordered_map<std::string, DtCigiObjectCreator*> makVrv::DtCigiObjectFactory::CreatorMap

Maps model definition schemas to creators.

Constructor & Destructor Documentation

makVrv::DtCigiObjectFactory::DtCigiObjectFactory ( )

Default CTOR.

virtual makVrv::DtCigiObjectFactory::~DtCigiObjectFactory ( )
virtual

DTOR.

makVrv::DtCigiObjectFactory::DtCigiObjectFactory ( const DtCigiObjectFactory rhs)

Copy CTOR; deep copies contents.

Member Function Documentation

DtCigiObjectFactory& makVrv::DtCigiObjectFactory::operator= ( const DtCigiObjectFactory rhs)

Assignment; deep copies contents.

static DtCigiObjectFactory& makVrv::DtCigiObjectFactory::instance ( DtDe de)
static

Get the instance of the factory from its owner de.

static DtCigiObjectFactory& makVrv::DtCigiObjectFactory::instance ( DtCigiConnection con)
static

Get the instance of the factory from its owner CIGI connection.

virtual DtCigiObjectFactory* makVrv::DtCigiObjectFactory::clone ( )
virtual

Clone function so derived classes can be used with copyInstance.

static void makVrv::DtCigiObjectFactory::copyInstance ( DtCigiConnection con,
DtDe de 
)
static

Create a new instance for the DtCigiConnection which is a copy of the DtDe instance.

virtual void makVrv::DtCigiObjectFactory::addCigiObjectCreator ( const std::string &  schema,
DtCigiObjectCreator creator 
)
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 void makVrv::DtCigiObjectFactory::addDefaultCigiObjectCreator ( DtCigiObjectCreator creator)
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.

Member Data Documentation

CreatorMap makVrv::DtCigiObjectFactory::myCreators
protected
DtCigiObjectCreator* makVrv::DtCigiObjectFactory::myDefaultCigiObjectCreator
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Jun 1 17:58:13 EDT 2023 from SVN revision 255404
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)