FCDEntity Class Reference
[COLLADA Document Object Model.]

A COLLADA entity. More...

#include <FCDEntity.h>

Inheritance diagram for FCDEntity:

FCDObjectWithId FCDObject FUObject FCDAnimation FCDController FCDEffect FCDGeometry FCDImage FCDMaterial FCDSceneNode FCDTargetedEntity FCDTexture List of all members.

Public Types

enum  Type {
  ENTITY, ANIMATION, ANIMATION_CLIP, CAMERA,
  LIGHT, IMAGE, TEXTURE, MATERIAL,
  EFFECT, GEOMETRY, CONTROLLER, SCENE_NODE,
  PHYSICS_RIGID_CONSTRAINT, PHYSICS_MATERIAL, PHYSICS_RIGID_BODY, PHYSICS_SHAPE,
  PHYSICS_ANALYTICAL_GEOMETRY, PHYSICS_MODEL, PHYSICS_SCENE_NODE
}
 The types of entity classes. More...

Public Member Functions

 FCDEntity (FCDocument *document, const char *baseId="GenericEntity")
 Constructor: do not use directly.
virtual ~FCDEntity ()
 Destructor: do not use directly.
virtual Type GetType () const
 Retrieves the entity class type for an entity.
const fstring & GetName () const
 Retrieves the name of the entity.
void SetName (const fstring &_name)
 Sets the name of the entity.
FCDExtraGetExtra ()
 Retrieves the extra information tree for this entity.
const FCDExtraGetExtra () const
 See above.
bool HasNote () const
 Retrieves whether the entity has a user-defined note.
const fstring & GetNote () const
 Retrieves the user-defined note for this entity.
void SetNote (const fstring &_note)
 Sets the user-defined note for this entity.
virtual FCDEntityFindDaeId (const string &daeId)
 Retrieves the child entity that has the given COLLADA id.
virtual FUStatus LoadFromXML (xmlNode *entityNode)
 [INTERNAL] Reads in the entity from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the entity to the given COLLADA XML tree node.
StringListGetPostProcessCmds ()

Protected Member Functions

xmlNode * WriteToEntityXML (xmlNode *parentNode, const char *nodeName) const
 [INTERNAL] Writes out the top entity XML node for the entity.
void WriteToExtraXML (xmlNode *entityNode) const
 [INTERNAL] Writes out the extra information for the entity.
void Clone (FCDEntity *clone)
 [INTERNAL] Copies the entity information into a cloned entity.

Detailed Description

A COLLADA entity.

A COLLADA entity is an object contained within a COLLADA library. As such, it is based on the FCDObjectWithId class so that it can be accessed by other entities, such as the scene graph.

The entity adds to the FCDObjectWithId class: a name, an extra tree and an optional note, as well as a way to identity the type of the entity, in order to up-cast it to its correct class.


Member Enumeration Documentation

enum FCDEntity::Type
 

The types of entity classes.

Each type corresponds directly to one class that contains the FCDEntity class as a parent, so you can up-cast FCDEntity pointers.

Enumerator:
ENTITY  A generic entity (FCDEntity).

Should never be used.

ANIMATION  An animation (FCDAnimation).
ANIMATION_CLIP  An animation clip (FCDAnimationClip).
CAMERA  A camera (FCDCamera).
LIGHT  A light (FCDLight).
IMAGE  An image (FCDImage).
TEXTURE  A texture (FCDTexture).

Used for COLLADA 1.3 backward compatibility only!

MATERIAL  A visual material definition (FCDMaterial).
EFFECT  An effect definition (FCDEffect).
GEOMETRY  A geometric object (FCDGeometry).

Includes splines and meshes.

CONTROLLER  A geometric controller (FCDController).

Includes skins and morphers.

SCENE_NODE  A visual scene node (FCDSceneNode).
PHYSICS_RIGID_CONSTRAINT  A physics rigid constraint (FCDPhysicsRigidConstraint).
PHYSICS_MATERIAL  A physics material definiton (FCDPhysicsMaterial).
PHYSICS_RIGID_BODY  A physics rigid body (FCDPhysicsRigidBody).
PHYSICS_SHAPE  A physics shape (FCDPhysicsShape).
PHYSICS_ANALYTICAL_GEOMETRY  A physics analytical geometric object (FCDPhysicsAnalyticalGeometry).
PHYSICS_MODEL  A physics model (FCDPhysicsModel).
PHYSICS_SCENE_NODE  A physics scene node (FCDPhysicsSceneNode).


Constructor & Destructor Documentation

FCDEntity::FCDEntity FCDocument document,
const char *  baseId = "GenericEntity"
 

Constructor: do not use directly.

Instead, create objects of the up-classes.

Parameters:
document The COLLADA document that owns the entity.
baseId The prefix COLLADA id to be used if no COLLADA id is provided.

virtual FCDEntity::~FCDEntity  )  [virtual]
 

Destructor: do not use directly.

Instead, release objects through their libraries or their parent entities.


Member Function Documentation

void FCDEntity::Clone FCDEntity clone  )  [protected]
 

[INTERNAL] Copies the entity information into a cloned entity.

This function should be used by all up-classes when cloning an entity to copy the COLLADA id and the other entity-level information into a clone.

Parameters:
clone The cloned entity.

virtual FCDEntity* FCDEntity::FindDaeId const string &  daeId  )  [virtual]
 

Retrieves the child entity that has the given COLLADA id.

This function is only useful for entities that are hierarchical: visual/physics scene nodes and animations.

Parameters:
daeId A COLLADA id.
Returns:
The child entity with the given id. This pointer will be NULL if no child entity matches the given id.

Reimplemented in FCDAnimation, and FCDSceneNode.

FCDExtra* FCDEntity::GetExtra  )  [inline]
 

Retrieves the extra information tree for this entity.

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& FCDEntity::GetName  )  const [inline]
 

Retrieves the name of the entity.

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

Returns:
The name.

const fstring& FCDEntity::GetNote  )  const [inline]
 

Retrieves the user-defined note for this entity.

This value is a simpler way, than the extra tree, to store user-defined information that does not belong in COLLADA.

Returns:
The user-defined note.

StringList& FCDEntity::GetPostProcessCmds  )  [inline]
 

Deprecated:
Retrieves the like of post-processing commands. Used only in ColladaMaya and should be taken out.
Returns:
The list of post-processing commands.

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

Retrieves the entity class type for an entity.

You can use the entity class type of up-cast an entity pointer to the correct up-class. This function should be overwritten by all up-classes.

Returns:
The entity class type.

Reimplemented in FCDAnimation, FCDCamera, FCDController, FCDEffect, FCDGeometry, FCDImage, FCDLight, FCDMaterial, FCDSceneNode, and FCDTexture.

bool FCDEntity::HasNote  )  const [inline]
 

Retrieves whether the entity has a user-defined note.

This value is a simpler way, than the extra tree, to store user-defined information that does not belong in COLLADA.

Returns:
Whether the entity has an user-defined note.

virtual FUStatus FCDEntity::LoadFromXML xmlNode *  entityNode  )  [virtual]
 

[INTERNAL] Reads in the entity from a given COLLADA XML tree node.

This function should be overwritten by all up-classes.

Parameters:
entityNode The COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the entity.

Reimplemented in FCDAnimation, FCDCamera, FCDController, FCDEffect, FCDGeometry, FCDImage, FCDLight, FCDMaterial, FCDSceneNode, and FCDTexture.

void FCDEntity::SetName const fstring &  _name  ) 
 

Sets the name of the entity.

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

Parameters:
_name The name.

void FCDEntity::SetNote const fstring &  _note  )  [inline]
 

Sets the user-defined note for this entity.

This value is a simpler way, than the extra tree, to store user-defined information that does not belong in COLLADA.

Parameters:
_note The user-defined note.

xmlNode* FCDEntity::WriteToEntityXML xmlNode *  parentNode,
const char *  nodeName
const [protected]
 

[INTERNAL] Writes out the top entity XML node for the entity.

This function should be used by all up-classes within the WriteToXML overwritting function to create the top XML node, as it will write out the name and COLLADA id of the entity.

Parameters:
parentNode The COLLADA XML parent node in which to insert the entity.
nodeName The COLLADA XML node name for the top entity XML node.
Returns:
The created element XML tree node.

void FCDEntity::WriteToExtraXML xmlNode *  entityNode  )  const [protected]
 

[INTERNAL] Writes out the extra information for the entity.

This function should be used by all up-classes within the WriteToXML overwritting function, at the very end, to write the user-defined note and the extra tree to the COLLADA document.

Parameters:
entityNode The created element XML tree node returned by the WriteToEntityXML function.

virtual xmlNode* FCDEntity::WriteToXML xmlNode *  parentNode  )  const [virtual]
 

[INTERNAL] Writes out the entity to the given COLLADA XML tree node.

This function should be overwritten by all up-classes.

Parameters:
parentNode The COLLADA XML parent node in which to insert the entity.
Returns:
The created element XML tree node.

Reimplemented in FCDAnimation, FCDCamera, FCDController, FCDEffect, FCDGeometry, FCDImage, FCDLight, FCDMaterial, and FCDSceneNode.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:42 2006 for FCollada by  doxygen 1.4.6-NO