FCDEntityInstance Class Reference
[COLLADA Document Object Model.]

A COLLADA entity instance. More...

#include <FCDEntityInstance.h>

Inheritance diagram for FCDEntityInstance:

FCDObject FUTracker FUParameterizable FUTrackable FUObject FCDEmitterInstance FCDGeometryInstance FCDMaterialInstance FCDPhysicsForceFieldInstance FCDPhysicsModelInstance FCDPhysicsRigidBodyInstance FCDPhysicsRigidConstraintInstance FCDControllerInstance List of all members.

Public Types

enum  Type {
  SIMPLE,
  GEOMETRY,
  CONTROLLER,
  MATERIAL,
  PHYSICS_MODEL,
  PHYSICS_RIGID_BODY,
  PHYSICS_RIGID_CONSTRAINT,
  PHYSICS_FORCE_FIELD,
  TYPE_COUNT
}
 The class type of the entity instance class. More...

Public Member Functions

virtual ~FCDEntityInstance ()
 Destructor.
virtual Type GetType () const
 Retrieves the entity instance class type.
FCDEntity::Type GetEntityType () const
 Retrieves the instantiated entity type.
FCDEntityGetEntity ()
 Retrieves the instantiated entity.
const FCDEntityGetEntity () const
 Retrieves the instantiated entity.
const FUUri GetEntityUri () const
 Retrieves the Uri to the skin target.
void SetEntityUri (const FUUri &uri)
 Sets the URI of the target mesh.
void SetEntity (FCDEntity *entity)
 Sets the instantiated entity.
FCDEntityReferenceGetEntityReference ()
 Get the contained EntityReference object.
const FCDEntityReferenceGetEntityReference () const
 See above.
const fstringGetName () const
 Retrieves the name of the entity instance.
void SetName (const fstring &name)
 Sets the name of the entity instance.
const fm::stringGetWantedSubId () const
 Retrieves the optional sub id and is not garanteed to exist.
void SetWantedSubId (const fm::string &_wantedSubId)
 Sets the sub id for this object.
FCDExtraGetExtra ()
 Retrieves the extra information tree for this entity instance.
const FCDExtraGetExtra () const
 See above.
bool IsExternalReference () const
 Retrieves whether this entity instance points to an external entity.
FCDSceneNodeGetParent ()
 Retrieves the parent of the entity instance.
const FCDSceneNodeGetParent () const
 See above.
bool HasForParent (FCDSceneNode *node) const
 Checks whether or not this instance is below the given scene node in the scene hierarchy.
virtual void CleanSubId (FUSUniqueStringMap *parentStringMap=NULL)
 [INTERNAL] Cleans up the sub identifiers.
virtual FCDEntityInstanceClone (FCDEntityInstance *clone=NULL) const
 Clones the entity instance.

Protected Member Functions

 FCDEntityInstance (FCDocument *document, FCDSceneNode *parent, FCDEntity::Type type)
 Constructor: do not use directly.
virtual void OnObjectReleased (FUTrackable *object)
 Callback when the instantiated entity is being released.

Friends

class FCDEntityInstanceFactory

Detailed Description

A COLLADA entity instance.

COLLADA allows for quite a bit of per-instance settings for entities. This information is held by the up-classes of this class. This base class is simply meant to hold the entity that is instantiated.

The entity instance tracks the entity, so that when an entity is released, all its instances are released.


Member Enumeration Documentation

enum FCDEntityInstance::Type
 

The class type of the entity instance class.

Used this information to up-cast an entity instance.

Enumerator:
SIMPLE  A simple entity instance that has no per-instance information.

This is used for lights, cameras, physics materials and force fields: there is no up-class.

GEOMETRY  A geometry entity(FCDGeometryInstance).
CONTROLLER  A controller entity(FCDControllerInstance).
MATERIAL  A material entity(FCDMaterialInstance).
PHYSICS_MODEL  A physics model(FCDPhysicsModelInstance).
PHYSICS_RIGID_BODY  A physics rigid body(FCDPhysicsRigidBodyInstance).
PHYSICS_RIGID_CONSTRAINT  A physics rigid constraint(FCDPhysicsRigidConstraintInstance).
PHYSICS_FORCE_FIELD  A physics force field (FCDPhysicsForceFieldInstance).


Constructor & Destructor Documentation

FCDEntityInstance::FCDEntityInstance FCDocument document,
FCDSceneNode parent,
FCDEntity::Type  type
[protected]
 

Constructor: do not use directly.

Instead, use the appropriate allocation function. For scene node instance: FCDSceneNode::AddInstance.

Parameters:
document The COLLADA document that owns the entity instance.
parent The visual scene node that contains the entity instance. This pointer will be NULL for instances that are not directly under a visual scene node.
type The type of entity to instantiate.


Member Function Documentation

virtual void FCDEntityInstance::CleanSubId FUSUniqueStringMap parentStringMap = NULL  )  [virtual]
 

[INTERNAL] Cleans up the sub identifiers.

The sub identifiers must be unique with respect to its parent. This method corrects the sub ids if there are conflicts.

Parameters:
parentStringMap The string map from the parent of this instance in which the sub ids must be unique.

Reimplemented in FCDGeometryInstance, and FCDPhysicsModelInstance.

virtual FCDEntityInstance* FCDEntityInstance::Clone FCDEntityInstance clone = NULL  )  const [virtual]
 

Clones the entity instance.

Parameters:
clone The entity instance to become the clone.
Returns:
The cloned entity instance.

Reimplemented in FCDControllerInstance, FCDGeometryInstance, FCDMaterialInstance, FCDPhysicsForceFieldInstance, FCDPhysicsModelInstance, FCDPhysicsRigidBodyInstance, and FCDPhysicsRigidConstraintInstance.

const FCDEntity* FCDEntityInstance::GetEntity  )  const [inline]
 

Retrieves the instantiated entity.

If the entity is an external reference, this function will load the entity. Be careful when using this function since it will change the object.

Returns:
The instantiated entity, if loaded.

FCDEntity* FCDEntityInstance::GetEntity  ) 
 

Retrieves the instantiated entity.

If the entity is an external reference, this may load the external document and retrieve the entity.

Returns:
The instantiated entity.

FCDEntity::Type FCDEntityInstance::GetEntityType  )  const [inline]
 

Retrieves the instantiated entity type.

The instantiated entity type will never change.

Returns:
The instantiated entity type.

const FUUri FCDEntityInstance::GetEntityUri  )  const
 

Retrieves the Uri to the skin target.

This can be an internal or external link

Returns:
The uri to the target

FCDExtra* FCDEntityInstance::GetExtra  ) 
 

Retrieves the extra information tree for this entity instance.

The prefered way to save extra information in FCollada is at the entity level. Use this extra information tree to store any information you want exported and imported back.

Returns:
The extra information tree.

const fstring& FCDEntityInstance::GetName  )  const [inline]
 

Retrieves the name of the entity instance.

This value has no direct use in COLLADA but is useful to track the user-friendly name of an entity instance.

Returns:
The name.

FCDSceneNode* FCDEntityInstance::GetParent  )  [inline]
 

Retrieves the parent of the entity instance.

Returns:
the parent visual scene node. This pointer will be NULL when the instance is not created in the visual scene graph.

Reimplemented in FCDMaterialInstance, and FCDPhysicsRigidConstraintInstance.

virtual Type FCDEntityInstance::GetType  )  const [inline, virtual]
 

Retrieves the entity instance class type.

This is used to determine the up-class for the entity instance object.

Deprecated:
Instead use: FCDEntityInstance::HasType().
Returns:
The class type: SIMPLE for entity instances with no up-class.

Reimplemented in FCDControllerInstance, FCDGeometryInstance, FCDPhysicsForceFieldInstance, FCDPhysicsModelInstance, FCDPhysicsRigidBodyInstance, and FCDPhysicsRigidConstraintInstance.

const fm::string& FCDEntityInstance::GetWantedSubId  )  const [inline]
 

Retrieves the optional sub id and is not garanteed to exist.

This id is the same as that given in SetSubId or from the COLLADA document using LoadFromXML unless it clashes with another id and CleanSubId has been called.

Returns:
The set sub id of the node.

bool FCDEntityInstance::HasForParent FCDSceneNode node  )  const
 

Checks whether or not this instance is below the given scene node in the scene hierarchy.

Parameters:
node The scene node.
Returns:
True if parent is above this instance in the hierarchy, false otherwise.

bool FCDEntityInstance::IsExternalReference  )  const
 

Retrieves whether this entity instance points to an external entity.

Returns:
Whether this is an external entity instantiation.

virtual void FCDEntityInstance::OnObjectReleased FUTrackable object  )  [protected, virtual]
 

Callback when the instantiated entity is being released.

Parameters:
object A tracked object.

Implements FUTracker.

void FCDEntityInstance::SetEntity FCDEntity entity  ) 
 

Sets the instantiated entity.

The type of the entity will be verified.

Parameters:
entity The instantiated entity.

void FCDEntityInstance::SetEntityUri const FUUri uri  ) 
 

Sets the URI of the target mesh.

Parameters:
uri The Uri to a local or external controller or geometry

void FCDEntityInstance::SetName const fstring name  ) 
 

Sets the name of the entity instance.

This value has no direct use in COLLADA but is useful to track the user-friendly name of an entity instance.

Parameters:
name The name.

void FCDEntityInstance::SetWantedSubId const fm::string _wantedSubId  )  [inline]
 

Sets the sub id for this object.

This id must be unique within the scope of the parent element. If it is not, it can be corrected by calling CleanSubId.

Parameters:
_wantedSubId The new sub id of the object.


The documentation for this class was generated from the following file:
Generated on Thu Feb 14 16:58:38 2008 for FCollada by  doxygen 1.4.6-NO