FCDSceneNode Class Reference
[COLLADA Document Object Model.]

A COLLADA visual scene node. More...

#include <FCDSceneNode.h>

Inheritance diagram for FCDSceneNode:

FCDEntity FCDObjectWithId FCDObject FUObject List of all members.

Public Member Functions

 FCDSceneNode (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDSceneNode ()
 Destructor: do not use directly.
virtual Type GetType () const
 Retrieves the type of the entity class.
size_t GetParentCount () const
 Retrieves the number of parent nodes for this visual scene node.
FCDSceneNodeGetParent (size_t index=0)
 Retrieves a specific parent of the visual scene node.
const FCDSceneNodeGetParent (size_t index=0) const
 See above.
size_t GetChildrenCount () const
 Retrieves the number of child nodes for this visual scene node.
FCDSceneNodeGetChild (size_t index)
 Retrieves a specific child of the visual scene node.
const FCDSceneNodeGetChild (size_t index) const
 See above.
FCDSceneNodeListGetChildren ()
 Retrieves the list of children of the visual scene node.
const FCDSceneNodeListGetChildren () const
 See above.
FCDSceneNodeAddChildNode ()
 Creates a new child scene node.
bool AddChildNode (FCDSceneNode *sceneNode)
 Attaches a existing scene node to this visual scene node.
size_t GetInstanceCount () const
 Retrieves the number of entity instances at this node of the scene graph.
FCDEntityInstanceGetInstance (size_t index)
 Retrieves a specific entity instance.
const FCDEntityInstanceGetInstance (size_t index) const
 See above.
FCDEntityInstanceListGetInstances ()
 Retrieves the list of entity instances at this node of the scene graph.
const FCDEntityInstanceListGetInstances () const
 See above.
FCDEntityInstanceAddInstance (FCDEntity *entity)
 Creates a new entity instance.
void ReleaseInstance (FCDEntityInstance *instance)
 Releases an entity instance.
size_t GetTransformCount () const
 Retrieves the number of transforms for this node of the scene graph.
FCDTransformGetTransform (size_t index)
 Retrieves a specific transform.
const FCDTransformGetTransform (size_t index) const
 See above.
FCDTransformListGetTransforms ()
 Retrieves the list of transforms for this node of the scene graph.
const FCDTransformListGetTransforms () const
 See above.
FCDTransformAddTransform (FCDTransform::Type type, size_t index=(size_t)-1)
 Creates a new transform for this visual scene node.
void ReleaseTransform (FCDTransform *transform)
 Releases a transform affecting this visual scene node.
virtual FCDEntityFindDaeId (const string &daeId)
 Retrieves the visual scene node with the given id.
float & GetVisibility ()
 Retrieves whether the visual scene node is visible.
const float & GetVisibility () const
 See above.
void SetVisibility (bool isVisible)
 Sets the visibility of the visual scene node.
bool IsTarget () const
 Retrieves whether this visual scene node is the target of an entity.
bool IsJoint () const
 Retrieves whether this visual scene node is a joint.
void SetJointFlag (bool _isJoint)
 Sets whether a visual scene node is a joint.
FMMatrix44 ToMatrix () const
 Retrieves the local transform for this visual scene node.
void GenerateSampledMatrixAnimation (FloatList &keys, FMMatrix44List &values)
 Generates a list of local transform samples for this visual scene node.
void IncrementTargetCount ()
 [INTERNAL] Increments the number of entities target this node.
void DecrementTargetCount ()
 [INTERNAL] Decrements the number of entities target this node.
virtual FUStatus LoadFromXML (xmlNode *sceneNode)
 [INTERNAL] Reads in the visual scene node from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the visual scene node to the given COLLADA XML tree node.

Detailed Description

A COLLADA visual scene node.

This class is also used to represent COLLADA visual scene entities.

A visual scene node contains child scene nodes to make a tree. A visual scene node may appear multiple times within the scene graph, but checks are made to verify that there are no cycles within the graph.

A visual scene node also contained an ordered list of transformations and a list of entity instances.


Constructor & Destructor Documentation

FCDSceneNode::FCDSceneNode FCDocument document  ) 
 

Constructor: do not use directly.

Instead, use the FCDSceneNode::AddChild function for child visual scene nodes or the FCDLibrary::AddEntity function for visual scenes.

Parameters:
document The COLLADA document that owns the scene node.

virtual FCDSceneNode::~FCDSceneNode  )  [virtual]
 

Destructor: do not use directly.

Instead, use the FCDSceneNode::ReleaseChild function for visual scene nodes or the FCDLibrary::ReleaseEntity function for visual scenes.


Member Function Documentation

bool FCDSceneNode::AddChildNode FCDSceneNode sceneNode  ) 
 

Attaches a existing scene node to this visual scene node.

This function will fail if attaching the given scene node to this visual scene node creates a cycle within the scene graph.

Parameters:
sceneNode The scene node to attach.
Returns:
Whether the given scene node was attached to this scene node.

FCDSceneNode* FCDSceneNode::AddChildNode  ) 
 

Creates a new child scene node.

Returns:
The new child scene node.

FCDEntityInstance* FCDSceneNode::AddInstance FCDEntity entity  ) 
 

Creates a new entity instance.

Only geometric entities, controllers, light and cameras can be instantiated in the scene graph. To instantiate visual scene nodes, use the AddChildNode function.

Parameters:
entity The entity to instantiate. Set this pointer to NULL to instantiate an external entity.
Returns:
The entity instance structure. This pointer will be NULL if the entity cannot be instantiated here.

FCDTransform* FCDSceneNode::AddTransform FCDTransform::Type  type,
size_t  index = (size_t)-1
 

Creates a new transform for this visual scene node.

The transforms are processed in order and COLLADA is column-major. For row-major matrix stacks, such as DirectX, this implies that the transformations will be processed in reverse order. By default, a transform is added at the end of the list.

Parameters:
type The type of transform to create.
index The index at which to insert the transform. Set this value to -1 to indicate that you want this transform at the end of the stack.
Returns:
The created transform.

void FCDSceneNode::DecrementTargetCount  )  [inline]
 

[INTERNAL] Decrements the number of entities target this node.

To set targets, use the FCDTargetedEntity::SetTarget function.

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

Retrieves the visual scene node with the given id.

This function looks through the whole tree of visual scene nodes for the wanted COLLADA id.

Parameters:
daeId The COLLADA id to look for.
Returns:
The visual scene node which has the given COLLADA id. This pointer will be NULL if no visual scene node can be found with the given COLLADA id.

Reimplemented from FCDEntity.

void FCDSceneNode::GenerateSampledMatrixAnimation FloatList keys,
FMMatrix44List values
 

Generates a list of local transform samples for this visual scene node.

This function will permanently modify the transforms of this visual scene node.

Parameters:
keys A list of key inputs that will be filled in with the sample times.
values A list of matrices that will be filled in with the sampled local transforms.

FCDSceneNode* FCDSceneNode::GetChild size_t  index  )  [inline]
 

Retrieves a specific child of the visual scene node.

Parameters:
index The index of the child.
Returns:
The child scene node. This pointer will be NULL if the index is out-of-bounds.

FCDSceneNodeList& FCDSceneNode::GetChildren  )  [inline]
 

Retrieves the list of children of the visual scene node.

Returns:
The list of child scene nodes.

size_t FCDSceneNode::GetChildrenCount  )  const [inline]
 

Retrieves the number of child nodes for this visual scene node.

Returns:
The number of children.

FCDEntityInstance* FCDSceneNode::GetInstance size_t  index  )  [inline]
 

Retrieves a specific entity instance.

Parameters:
index The index of the instance.
Returns:
The entity instance at the given index. This pointer will be NULL if the index is out-of-bounds.

size_t FCDSceneNode::GetInstanceCount  )  const [inline]
 

Retrieves the number of entity instances at this node of the scene graph.

Returns:
The number of entity instances.

FCDEntityInstanceList& FCDSceneNode::GetInstances  )  [inline]
 

Retrieves the list of entity instances at this node of the scene graph.

Returns:
The list of entity instances.

FCDSceneNode* FCDSceneNode::GetParent size_t  index = 0  )  [inline]
 

Retrieves a specific parent of the visual scene node.

Parameters:
index The index of the parent.
Returns:
The parent visual scene node. This pointer will be NULL if the scene node has no parents or if the index is out-of-bounds.

size_t FCDSceneNode::GetParentCount  )  const [inline]
 

Retrieves the number of parent nodes for this visual scene node.

Returns:
The number of parents.

FCDTransform* FCDSceneNode::GetTransform size_t  index  )  [inline]
 

Retrieves a specific transform.

Parameters:
index The index of the transform.
Returns:
The transform at the given index. This pointer will be NULL if the index is out-of-bounds.

size_t FCDSceneNode::GetTransformCount  )  const [inline]
 

Retrieves the number of transforms for this node of the scene graph.

Returns:
The number of transforms.

FCDTransformList& FCDSceneNode::GetTransforms  )  [inline]
 

Retrieves the list of transforms for this node of the scene graph.

Returns:
The list of transforms.

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

Retrieves the type of the entity class.

Returns:
The type of entity class: SCENE_NODE.

Reimplemented from FCDEntity.

float& FCDSceneNode::GetVisibility  )  [inline]
 

Retrieves whether the visual scene node is visible.

A hidden visual scene node will not be rendered but will still affect the world. This parameter is a floating-point value because it is animated. It should be intepreted as a Boolean value.

Returns:
Whether the scene node is visible.

void FCDSceneNode::IncrementTargetCount  )  [inline]
 

[INTERNAL] Increments the number of entities target this node.

To set targets, use the FCDTargetedEntity::SetTarget function.

bool FCDSceneNode::IsJoint  )  const [inline]
 

Retrieves whether this visual scene node is a joint.

Joints are called bones in 3dsMax. A joint is a scene node that is used in skinning.

Returns:
Whether this node is a joint.

bool FCDSceneNode::IsTarget  )  const [inline]
 

Retrieves whether this visual scene node is the target of an entity.

Returns:
Whether this is an entity target.

virtual FUStatus FCDSceneNode::LoadFromXML xmlNode *  sceneNode  )  [virtual]
 

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

Parameters:
sceneNode 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 node.

Reimplemented from FCDEntity.

void FCDSceneNode::ReleaseInstance FCDEntityInstance instance  ) 
 

Releases an entity instance.

Parameters:
instance The entity instance to release.

void FCDSceneNode::ReleaseTransform FCDTransform transform  ) 
 

Releases a transform affecting this visual scene node.

Parameters:
transform The transform to release.

void FCDSceneNode::SetJointFlag bool  _isJoint  )  [inline]
 

Sets whether a visual scene node is a joint.

Joints are called bones in 3dsMax. A joint is a scene node that is used in skinning.

Parameters:
_isJoint Whether this node is a joint.

void FCDSceneNode::SetVisibility bool  isVisible  )  [inline]
 

Sets the visibility of the visual scene node.

A hidden visual scene node will not be rendered but will still affect the world.

Parameters:
isVisible Whether the visual scene node is visible.

FMMatrix44 FCDSceneNode::ToMatrix  )  const
 

Retrieves the local transform for this visual scene node.

This function does not handle or apply animations.

Returns:
The local transform.

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

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

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

Reimplemented from FCDEntity.


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