FCDENode Class Reference

A COLLADA extra tree node. More...

#include <FCDExtra.h>

Inheritance diagram for FCDENode:

FCDObject FUObject FCDETechnique List of all members.

Public Member Functions

 FCDENode (FCDocument *document, FCDENode *parent)
 Constructor: do not use directly.
virtual ~FCDENode ()
 Destructor: do not use directly.
void Release ()
 Releases this extra tree node.
const char * GetName () const
 Retrieves the name of the extra tree node.
void SetName (const char *_name)
 Sets the name of the extra tree node.
void SetName (const string &_name)
 See above.
const fchar * GetContent () const
 Retrieves the textual content of the extra tree node.
void SetContent (const fchar *_content)
 Sets the textual content of the extra tree node.
void SetContent (const fstring &_content)
 See above.
FCDAnimatedCustomGetAnimated ()
 Retrieves the animated values associated with this extra tree node.
const FCDAnimatedCustomGetAnimated () const
 See above.
FCDENodeGetParent ()
 Retrieves the parent of an extra tree node.
const FCDENodeGetParent () const
 See above.
FCDENodeListGetChildNodes ()
 Retrieves the children of an extra tree node.
const FCDENodeListGetChildNodes () const
 See above.
size_t GetChildNodeCount () const
 Retrieves the number of children of an extra tree node.
FCDENodeGetChildNode (size_t index)
 Retrieves a specific child extra tree node.
const FCDENodeGetChildNode (size_t index) const
 See above.
FCDENodeAddChildNode ()
 Adds a new child extra tree to this extra tree node.
void ReleaseChildNode (FCDENode *childNode)
 Releases a child extra tree node of this extra tree node.
FCDENodeFindChildNode (const char *name)
 Retrieves the child extra tree node with the given name.
const FCDENodeFindChildNode (const char *name) const
 See above.
FCDENodeFindChildNode (const string &name)
 See above.
const FCDENodeFindChildNode (const string &name) const
 See above.
FCDENodeFindParameter (const char *name)
 Retrieves the child extra tree node with the given name.
void FindParameters (FCDENodeList &nodes, StringList &names)
 Retrieves a list of all the parameters contained within the hierarchy.
FCDEAttributeListGetAttributes ()
 Retrieves the list of attributes for this extra tree node.
const FCDEAttributeListGetAttributes () const
 See above.
size_t GetAttributeCount () const
 Retrieves the number of attributes for this extra tree node.
FCDEAttributeGetAttribute (size_t index)
 Retrieves a specific attribute of this extra tree node.
const FCDEAttributeGetAttribute (size_t index) const
 See above.
FCDEAttributeAddAttribute (const char *_name, const fchar *_value)
 Adds a new attribute to this extra tree node.
FCDEAttributeAddAttribute (const string &_name, const fchar *_value)
 See above.
FCDEAttributeAddAttribute (const char *_name, const fstring &_value)
 See above.
FCDEAttributeAddAttribute (const string &_name, const fstring &_value)
 See above.
template<typename T>
FCDEAttributeAddAttribute (const char *_name, const T &_value)
 See above.
template<typename T>
FCDEAttributeAddAttribute (const string &_name, const T &_value)
 See above.
void ReleaseAttribute (FCDEAttribute *attribute)
 Releases an attribute of this extra tree node.
FCDEAttributeFindAttribute (const char *name)
 Retrieve the attribute of this extra tree node with the given name.
const FCDEAttributeFindAttribute (const char *name) const
 See above.
virtual FUStatus LoadFromXML (xmlNode *customNode)
 [INTERNAL] Reads in the extra tree node from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the extra tree node to the given COLLADA XML tree node.

Protected Member Functions

FUStatus ReadChildrenFromXML (xmlNode *customNode)
 [INTERNAL] Reads in the children nodes of the extra tree node.
void WriteChildrenToXML (xmlNode *customNode) const
 [INTERNAL] Writes out the children nodes of extra tree node.

Detailed Description

A COLLADA extra tree node.

The extra tree node is a hierarchical structure that contains child extra tree nodes as well as attributes. If the extra tree node is a leaf of the tree, it may contain textual content.

The extra tree node leaf may be animated, if it has the 'sid' attribute.


Constructor & Destructor Documentation

FCDENode::FCDENode FCDocument document,
FCDENode parent
 

Constructor: do not use directly.

Instead, call the FCDENode::AddChild function of the parent within the hierarchy.

Parameters:
document The COLLADA document that owns the extra tree node.
parent The extra tree node that contains this extra tree node.

virtual FCDENode::~FCDENode  )  [virtual]
 

Destructor: do not use directly.

Instead, for hierarchical nodes: call the Release function or the parent's ReleaseChildNode function and for techniques: call the FCDExtra::ReleaseTechnique function.


Member Function Documentation

FCDEAttribute* FCDENode::AddAttribute const char *  _name,
const fchar *  _value
 

Adds a new attribute to this extra tree node.

If an attribute with the same name already exists, this function simply assigns the new value to the existing attribute and returns the existing attribute.

Parameters:
_name The name of the attribute.
_value The value of the attribute.
Returns:
The new attribute.

FCDENode* FCDENode::AddChildNode  ) 
 

Adds a new child extra tree to this extra tree node.

Returns:
The new child extra tree node.

FCDEAttribute* FCDENode::FindAttribute const char *  name  ) 
 

Retrieve the attribute of this extra tree node with the given name.

Attribute names are unique within an extra tree node.

Parameters:
name The attribute name.
Returns:
The attribute that matches the name. This pointer will be NULL if there is no attribute with the given name.

FCDENode* FCDENode::FindChildNode const char *  name  ) 
 

Retrieves the child extra tree node with the given name.

Parameters:
name A name.
Returns:
The child extra tree node that matches the given name. This pointer will be NULL if no child extra tree node matches the given name.

FCDENode* FCDENode::FindParameter const char *  name  ) 
 

Retrieves the child extra tree node with the given name.

This function is used for COLLADA 1.3 backward compatibility, where all parameters were described as <param name='X'>value</param>. So, if the child extra tree node with the name 'X' as searched for: both the above COLLADA 1.3 parameter and the COLLADA 1.4+ <X>value</X> parameters will be returned.

Parameters:
name The parameter name.
Returns:
The first child extra tree node holding the wanted parameter within the hierarchy. This pointer will be NULL to indicate that no parameter matches the given name.

void FCDENode::FindParameters FCDENodeList nodes,
StringList names
 

Retrieves a list of all the parameters contained within the hierarchy.

This function is used for COLLADA 1.3 backward compatibility, where all parameters were described as <param name='X'>value</param>. In COLLADA 1.4+, the same parameter should be described as: <X>value</X>. Using this function, both parameters would be returned with the name 'X'.

Parameters:
nodes The list of parameters to fill in. This list is not emptied by the function.
names The list of names of the parameters. This list is not emptied by the function.

FCDAnimatedCustom* FCDENode::GetAnimated  )  [inline]
 

Retrieves the animated values associated with this extra tree node.

Extra tree node leaves may be animated. If this extra tree node leaf is animated, this animated value will contain the animation curves.

Returns:
The animated value.

FCDEAttribute* FCDENode::GetAttribute size_t  index  )  [inline]
 

Retrieves a specific attribute of this extra tree node.

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

size_t FCDENode::GetAttributeCount  )  const [inline]
 

Retrieves the number of attributes for this extra tree node.

Returns:
The number of attributes.

FCDEAttributeList& FCDENode::GetAttributes  )  [inline]
 

Retrieves the list of attributes for this extra tree node.

Returns:
The list of attributes.

FCDENode* FCDENode::GetChildNode size_t  index  )  [inline]
 

Retrieves a specific child extra tree node.

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

size_t FCDENode::GetChildNodeCount  )  const [inline]
 

Retrieves the number of children of an extra tree node.

Returns:
The number of children.

FCDENodeList& FCDENode::GetChildNodes  )  [inline]
 

Retrieves the children of an extra tree node.

Returns:
The list of child extra tree nodes.

const fchar* FCDENode::GetContent  )  const [inline]
 

Retrieves the textual content of the extra tree node.

This value is only valid for extra tree node that have no children, as COLLADA doesn't allow for mixed-content.

Returns:
The textual content of the extra tree node.

const char* FCDENode::GetName  )  const [inline]
 

Retrieves the name of the extra tree node.

The name of the extra tree node is the name of the equivalent XML tree node.

Returns:
The name of the extra tree node.

FCDENode* FCDENode::GetParent  )  [inline]
 

Retrieves the parent of an extra tree node.

The hierarchy cannot be changed dynamically. If you to move an extra tree node, you will need to clone it manually and release the old extra tree node.

Returns:
The parent extra tree node within the hierarchy. This pointer will be NULL if the extra tree node is a extra tree technique.

virtual FUStatus FCDENode::LoadFromXML xmlNode *  customNode  )  [virtual]
 

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

Parameters:
customNode 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 extra tree node.

Reimplemented in FCDETechnique.

FUStatus FCDENode::ReadChildrenFromXML xmlNode *  customNode  )  [protected]
 

[INTERNAL] Reads in the children nodes of the extra tree node.

Used by the FCDETechnique class exclusively.

Parameters:
customNode 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 extra tree node.

void FCDENode::Release  ) 
 

Releases this extra tree node.

This function is a shortcut to the parent's FCDENode::ReleaseChildNode function.

void FCDENode::ReleaseAttribute FCDEAttribute attribute  ) 
 

Releases an attribute of this extra tree node.

Parameters:
attribute The attribute to release.

void FCDENode::ReleaseChildNode FCDENode childNode  ) 
 

Releases a child extra tree node of this extra tree node.

Parameters:
childNode The child to release.

void FCDENode::SetContent const fchar *  _content  ) 
 

Sets the textual content of the extra tree node.

This function will release all the child node of this extra tree node, as COLLADA doesn't allow for mixed-content.

Parameters:
_content The textual content.

void FCDENode::SetName const char *  _name  )  [inline]
 

Sets the name of the extra tree node.

The name of the extra tree node is the name of the equivalent XML tree node.

Parameters:
_name The name of the extra tree node.

void FCDENode::WriteChildrenToXML xmlNode *  customNode  )  const [protected]
 

[INTERNAL] Writes out the children nodes of extra tree node.

Used by the FCDETechnique class exclusively.

Parameters:
customNode The COLLADA XML node for the extra tree node.

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

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

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

Reimplemented in FCDETechnique.


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