FCDENode Class Reference

A COLLADA extra tree node. More...

#include <FCDExtra.h>

Inheritance diagram for FCDENode:

FCDObject FUParameterizable FUTrackable FUObject FCDETechnique List of all members.

Public Member Functions

 FCDENode (FCDocument *document, FCDENode *parent)
 Constructor: do not use directly.
virtual ~FCDENode ()
 Destructor.
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 fm::string &_name)
 See above.
void SetName (fm::string &_name)
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.
void SetContentDirect (const fstring &_content)
 [INTERNAL] Set the content directly.
FCDAnimatedCustomGetAnimated ()
 Retrieves the animated values associated with this extra tree node.
const FCDAnimatedCustomGetAnimated () const
 See above.
void SetAnimated (FCDAnimatedCustom *animatedCustom)
 [INTERNAL] Set the customized animated.
FCDENodeGetParent ()
 Retrieves the parent of an extra tree node.
const FCDENodeGetParent () const
 See above.
 DEPRECATED (3.05A, GetChildNodeCount and GetChildNode(index)) void GetChildNodes() const
 Retrieves the children of an extra tree node.
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.
FCDENodeAddChildNode (const char *name)
 Adds a new, named, child extra tree to this extra tree node.
FCDENodeAddChildNode (const fm::string &name)
 See above.
FCDENodeFindChildNode (const char *name)
 Retrieves the child extra tree node with the given name.
const FCDENodeFindChildNode (const char *name) const
 See above.
FCDENodeFindChildNode (const fm::string &name)
 See above.
const FCDENodeFindChildNode (const fm::string &name) const
 See above.
void FindChildrenNodes (const char *name, FCDENodeList &nodes) const
 Retrieves the child extra tree nodes with the given name.
void FindChildrenNodes (const fm::string &name, FCDENodeList &nodes) const
 See above.
const FCDENodeFindParameter (const char *name) const
 Retrieves the child extra tree node with the given name.
FCDENodeFindParameter (const char *name)
 See above.
void FindParameters (FCDENodeList &nodes, StringList &names)
 Retrieves a list of all the parameters contained within the hierarchy.
 DEPRECATED (3.05A, GetAttributeCount and GetAttribute(index)) void GetAttributes() const
 Retrieves the list of attributes for this extra tree node.
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 (fm::string &_name, const fchar *_value)
 Adds a new attribute to this extra tree node.
FCDEAttributeAddAttribute (const char *_name, const fchar *_value)
 See above.
FCDEAttributeAddAttribute (const fm::string &_name, const fchar *_value)
 See above.
FCDEAttributeAddAttribute (const char *_name, const fstring &_value)
 See above.
FCDEAttributeAddAttribute (fm::string &_name, const fstring &_value)
 See above.
FCDEAttributeAddAttribute (const fm::string &_name, const fstring &_value)
 See above.
template<typename T>
FCDEAttributeAddAttribute (const char *_name, const T &_value)
 See above.
template<typename T>
FCDEAttributeAddAttribute (fm::string &_name, const T &_value)
 See above.
template<typename T>
FCDEAttributeAddAttribute (const fm::string &_name, const T &_value)
 See above.
FCDEAttributeFindAttribute (const char *name)
 Retrieve the attribute of this extra tree node with the given name.
const FCDEAttributeFindAttribute (const char *name) const
 See above.
const fstringReadAttribute (const char *name) const
 Retrieves the value of an attribute on this extra tree node.
FCDENodeAddParameter (const char *name, const fchar *value)
 Adds a parameter as the child node.
FCDENodeAddParameter (const fm::string &name, const fchar *value)
 See above.
FCDENodeAddParameter (const char *name, const fstring &value)
 See above.
FCDENodeAddParameter (const fm::string &name, const fstring &value)
 See above.
template<class T>
FCDENodeAddParameter (const char *name, const T &value)
 See above.
template<class T>
FCDENodeAddParameter (const fm::string &name, const T &value)
 See above.
virtual FCDENodeClone (FCDENode *clone) const
 Clones the extra tree node.

Static Public Member Functions

static void CleanName (fm::string &n)
 Cleans up extra tree node names and extra tree attribute names in order to always start with an alphabetic character or an underscore, as well as contain only alphanumeric characters or underscore.

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.


Member Function Documentation

FCDEAttribute* FCDENode::AddAttribute fm::string _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. If this parameter is a non-constant fm::string reference, it will be updated with the cleaned name.
_value The value of the attribute.
Returns:
The new attribute.

FCDENode* FCDENode::AddChildNode const char *  name  ) 
 

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

See also:
AddParameter
Parameters:
name The name of the child node.
Returns:
The new child extra tree node.

FCDENode* FCDENode::AddChildNode  ) 
 

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

See also:
AddParameter
Returns:
The new child extra tree node.

FCDENode* FCDENode::AddParameter const char *  name,
const fchar *  value
 

Adds a parameter as the child node.

A parameter is the simplest child node possible: with a name and a value, represented as the node's content.

See also:
AddChildNode
Parameters:
name The parameter name.
value The parameter value.

static void FCDENode::CleanName fm::string n  )  [static]
 

Cleans up extra tree node names and extra tree attribute names in order to always start with an alphabetic character or an underscore, as well as contain only alphanumeric characters or underscore.

Parameters:
n The string to clean. This reference will be updated with the cleaned name.

virtual FCDENode* FCDENode::Clone FCDENode clone  )  const [virtual]
 

Clones the extra tree node.

Parameters:
clone The extra tree node that will receive the clone information. This pointer cannot be NULL.
Returns:
The clone. You will need to release the returned pointer manually.

Reimplemented in FCDETechnique.

FCDENode::DEPRECATED 3.  05A,
GetAttributeCount and   GetAttribute(index)
const [inline]
 

Retrieves the list of attributes for this extra tree node.

Returns:
The list of attributes.

FCDENode::DEPRECATED 3.  05A,
GetChildNodeCount and   GetChildNode(index)
const [inline]
 

Retrieves the children of an extra tree node.

Returns:
The list of child extra tree nodes.

FCDEAttribute* FCDENode::FindAttribute const char *  name  )  [inline]
 

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  )  [inline]
 

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.

void FCDENode::FindChildrenNodes const char *  name,
FCDENodeList nodes
const
 

Retrieves the child extra tree nodes with the given name.

Parameters:
name A name.
nodes A list of nodes to fill in with the nodes that match a given name.

const FCDENode* FCDENode::FindParameter const char *  name  )  const
 

Retrieves the child extra tree node with the given name.

A parameter has no child nodes and is described as: <X>value</X>. The first child extra tree node where the name matches 'X' 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.

A parameter has no child nodes and is described as: <X>value</X>. Using this function, The parameter 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.

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.

const fchar* FCDENode::GetContent  )  const
 

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.

const fstring& FCDENode::ReadAttribute const char *  name  )  const
 

Retrieves the value of an attribute on this extra tree node.

Attributes names are unique within an extra tree node.

Parameters:
name The attribute name.
Returns:
The value attached to the attribute with the given name. This value will be the empty string when no attribute exists with the given name.

void FCDENode::SetAnimated FCDAnimatedCustom animatedCustom  ) 
 

[INTERNAL] Set the customized animated.

The old pointer is released first. The new animated.

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::SetContentDirect const fstring _content  )  [inline]
 

[INTERNAL] Set the content directly.

Parameters:
_content The new content to set.

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.


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