FUDaeWriter Namespace Reference
[Utility Classes.]

Common COLLADA XML writing functions. More...


Classes

struct  FUDaeAccessor
 Common accessor type string arrays. More...

Functions

FCOLLADA_EXPORT xmlNode * AddExtraTechniqueChild (xmlNode *parent, const char *profile)
 Writes out the <extra><technique> element unto the given parent xml tree node.
FCOLLADA_EXPORT xmlNode * AddTechniqueChild (xmlNode *parent, const char *profile)
 Writes out the <technique> element unto the given parent xml tree node.
FCOLLADA_EXPORT xmlNode * AddParameter (xmlNode *parent, const char *name, const char *type)
 Writes out a COLLADA parameter element.
FCOLLADA_EXPORT xmlNode * AddInput (xmlNode *parent, const char *sourceId, const char *semantic, int32 offset=-1, int32 set=-1)
 Writes out a COLLADA input element.
xmlNode * AddInput (xmlNode *parent, const string &sourceId, const char *semantic, int32 offset=-1, int32 set=-1)
 See above.
FCOLLADA_EXPORT xmlNode * AddArray (xmlNode *parent, const char *id, const char *arrayType, const char *content, size_t count)
 Writes out a COLLADA strongly-typed data array.
FCOLLADA_EXPORT xmlNode * AddArray (xmlNode *parent, const char *id, const FMMatrix44List &values, float lengthFactor=1.0f)
 Writes out a COLLADA array of matrices.
FCOLLADA_EXPORT xmlNode * AddArray (xmlNode *parent, const char *id, const FMVector3List &values, float lengthFactor=1.0f)
 Writes out a COLLADA array of 3D vectors.
FCOLLADA_EXPORT xmlNode * AddArray (xmlNode *parent, const char *id, const FloatList &values, float lengthFactor=1.0f)
 Writes out a COLLADA array of floating-point values.
FCOLLADA_EXPORT xmlNode * AddArray (xmlNode *parent, const char *id, const StringList &values, const char *arrayType=DAE_NAME_ARRAY_ELEMENT)
 Writes out a COLLADA array of UTF-8 tokens.
FCOLLADA_EXPORT xmlNode * AddAccessor (xmlNode *parent, const char *arrayId, size_t count, size_t stride=1, const char **parameters=NULL, const char *type=NULL)
 Writes out a COLLADA accessor to be used within a source.
xmlNode * AddAccessor (xmlNode *parent, const string &arrayId, size_t count, size_t stride=1, const char **parameters=NULL, const char *type=NULL)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceFloat (xmlNode *parent, const char *id, const FloatList &values, size_t stride=1, const char **parameters=NULL, float lengthFactor=1.0f)
 Writes out a COLLADA multi-dimensional source of floating-point values.
xmlNode * AddSourceFloat (xmlNode *parent, const string &id, const FloatList &values, size_t stride=1, const char **parameters=NULL, float lengthFactor=1.0f)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceFloat (xmlNode *parent, const char *id, const FloatList &values, const char *parameter=NULL, float lengthFactor=1.0f)
 Writes out a COLLADA source of floating-point values.
xmlNode * AddSourceFloat (xmlNode *parent, const string &id, const FloatList &values, const char *parameter=NULL, float lengthFactor=1.0f)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceMatrix (xmlNode *parent, const char *id, const FMMatrix44List &values, float lengthFactor=1.0f)
 Writes out a COLLADA source of matrices.
xmlNode * AddSourceMatrix (xmlNode *parent, const string &id, const FMMatrix44List &values, float lengthFactor=1.0f)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceColor (xmlNode *parent, const char *id, const FMVector3List &values)
 Writes out a COLLADA source of matrices.
xmlNode * AddSourceColor (xmlNode *parent, const string &id, const FMVector3List &values)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceTexcoord (xmlNode *parent, const char *id, const FMVector3List &values)
 Writes out a COLLADA source of texture coordinates.
xmlNode * AddSourceTexcoord (xmlNode *parent, const string &id, const FMVector3List &values)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourcePosition (xmlNode *parent, const char *id, const FMVector3List &values, float lengthFactor=1.0f)
 Writes out a COLLADA source of 3D positions or vectors.
xmlNode * AddSourcePosition (xmlNode *parent, const string &id, const FMVector3List &values, float lengthFactor=1.0f)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceString (xmlNode *parent, const char *id, const StringList &values, const char *parameter=NULL)
 Writes out a COLLADA source of UTF-8 tokens.
xmlNode * AddSourceString (xmlNode *parent, const string &id, const StringList &values, const char *parameter=NULL)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceIDRef (xmlNode *parent, const char *id, const StringList &values, const char *parameter=NULL)
 Writes out a COLLADA source of COLLADA references.
xmlNode * AddSourceIDRef (xmlNode *parent, const string &id, const StringList &values, const char *parameter=NULL)
 See above.
FCOLLADA_EXPORT xmlNode * AddSourceInterpolation (xmlNode *parent, const char *id, const FUDaeInterpolationList &interpolations)
 Writes out a COLLADA source of interpolation tokens.
xmlNode * AddSourceInterpolation (xmlNode *parent, const string &id, const FUDaeInterpolationList &values)
 See above.
FCOLLADA_EXPORT string CleanId (const char *id)
 Cleans up a given name into a valid COLLADA id.
string CleanId (const string &id)
 See above.
FCOLLADA_EXPORT fstring CleanName (const fchar *name)
 Cleans up a given name into a valid COLLADA name.
fstring CleanName (const fstring &name)
 See above.
FCOLLADA_EXPORT string AddNodeSid (xmlNode *node, const char *wantedSid)
 Adds the 'sid' attribute to a given XML tree node.


Detailed Description

Common COLLADA XML writing functions.

Based on top of the FUXmlWriter namespace and the LibXML2 library. This whole namespace is considered external and should only be used by the FCollada library.


Function Documentation

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddAccessor xmlNode *  parent,
const char *  arrayId,
size_t  count,
size_t  stride = 1,
const char **  parameters = NULL,
const char *  type = NULL
 

Writes out a COLLADA accessor to be used within a source.

This function should really be called only from within AddSourceX functions.

Parameters:
parent The parent XML tree node.
arrayId The COLLADA id of the array.
count The number of complete elements within the array.
stride The number of values that should be used together to create one array element.
parameters The list of parameter names. Some valid parameter names are available in the FUDaeAccessor class.
type The type name of the parameters. Examples: float, float4x4, Name or IDRef.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddArray xmlNode *  parent,
const char *  id,
const StringList values,
const char *  arrayType = DAE_NAME_ARRAY_ELEMENT
 

Writes out a COLLADA array of UTF-8 tokens.

To write out data values, it is preferable to use the AddSourceX functions.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the array. This id is used only by the accessor of a source.
values A list of UTF-8 tokens. The members of this list will appear space-separated within the COLLADA document.
arrayType The COLLADA element name for the output array. Defaults to <Name_array>. This might also be <IDRef_array>.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddArray xmlNode *  parent,
const char *  id,
const FloatList values,
float  lengthFactor = 1.0f
 

Writes out a COLLADA array of floating-point values.

To write out data values, it is preferable to use the AddSourceX functions.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the array. This id is used only by the accessor of a source.
values A list of floating-point values.
lengthFactor An optional scale factor for all the floating-point values.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddArray xmlNode *  parent,
const char *  id,
const FMVector3List values,
float  lengthFactor = 1.0f
 

Writes out a COLLADA array of 3D vectors.

To write out data values, it is preferable to use the AddSourceX functions.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the array. This id is used only by the accessor of a source.
values A list of 3D vectors.
lengthFactor An optional scale factor for all the 3D vectors.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddArray xmlNode *  parent,
const char *  id,
const FMMatrix44List values,
float  lengthFactor = 1.0f
 

Writes out a COLLADA array of matrices.

To write out data values, it is preferable to use the AddSourceX functions.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the array. This id is used only by the accessor of a source.
values A list of matrices.
lengthFactor An optional scale factor for the translation column of the matrices.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddArray xmlNode *  parent,
const char *  id,
const char *  arrayType,
const char *  content,
size_t  count
 

Writes out a COLLADA strongly-typed data array.

To write out data values, it is preferable to use the AddSourceX functions.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the array. This id is used only by the accessor of a source.
arrayType The strongly-typed name of the array. For example: <float_array>, <Name_array>.
content The array content.
count The number of entries within the content of the array.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddExtraTechniqueChild xmlNode *  parent,
const char *  profile
 

Writes out the <extra><technique> element unto the given parent xml tree node.

This function ensures that only one <extra> element exists and that only one <technique> element exists for the given profile.

Parameters:
parent The parent XML tree node.
profile The application-specific profile name.
Returns:
The <technique> XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddInput xmlNode *  parent,
const char *  sourceId,
const char *  semantic,
int32  offset = -1,
int32  set = -1
 

Writes out a COLLADA input element.

This is a very common element. For example, it is used in the <polygons>, <sampler> and <joints> elements. A COLLADA input has the form: <input source='#source_id' semantic='' offset='' set=''/>.

Parameters:
parent The parent XML tree node.
sourceId The source attribute value. This is the COLLADA id of a valid <source> element.
semantic The semantic attribute value. This is a valid COLLADA semantic. For example: POSITION, TEXCOORD, WEIGHT, IN_TANGENT.
offset The optional offset attribute value. When used in conjunction with the <v> or the <p> elements, this is the offset for the input data indices within the interleaved indices.
set The optional set attribute value. This unsigned integer is used to tied together multiple inputs.
Returns:
The created <input> XML tree node.

FCOLLADA_EXPORT string FUDaeWriter::AddNodeSid xmlNode *  node,
const char *  wantedSid
 

Adds the 'sid' attribute to a given XML tree node.

The sub-id is verified to ensure uniqueness within the scope.

Parameters:
node The XML tree node.
wantedSid The wanted sub-id.
Returns:
The actual sub-id written to the XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddParameter xmlNode *  parent,
const char *  name,
const char *  type
 

Writes out a COLLADA parameter element.

This is used for the source accessors. A COLLADA parameter has the form: <param name='' type=''>value</param>.

Parameters:
parent The parent XML tree node.
name The name attribute value.
type The type attribute value.
Returns:
The created <param> XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceColor xmlNode *  parent,
const char *  id,
const FMVector3List values
 

Writes out a COLLADA source of matrices.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of matrices.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceFloat xmlNode *  parent,
const char *  id,
const FloatList values,
const char *  parameter = NULL,
float  lengthFactor = 1.0f
 

Writes out a COLLADA source of floating-point values.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of floating-point values.
parameter The accessor parameter name. Some valid parameter names are available in the FUDaeAccessor class.
lengthFactor An optional scale factor for all the floating-point values.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceFloat xmlNode *  parent,
const char *  id,
const FloatList values,
size_t  stride = 1,
const char **  parameters = NULL,
float  lengthFactor = 1.0f
 

Writes out a COLLADA multi-dimensional source of floating-point values.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of floating-point values.
stride The number of dimensions. This is the number of floating-point values that should be used together to create one element.
parameters The list of accessor parameter names. Some valid parameter names are available in the FUDaeAccessor class.
lengthFactor An optional scale factor for all the floating-point values.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceIDRef xmlNode *  parent,
const char *  id,
const StringList values,
const char *  parameter = NULL
 

Writes out a COLLADA source of COLLADA references.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of COLLADA references.
parameter The name of the accessor parameter.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceInterpolation xmlNode *  parent,
const char *  id,
const FUDaeInterpolationList interpolations
 

Writes out a COLLADA source of interpolation tokens.

This function is used within the export of animation curves.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
interpolations The list of interpolation tokens.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceMatrix xmlNode *  parent,
const char *  id,
const FMMatrix44List values,
float  lengthFactor = 1.0f
 

Writes out a COLLADA source of matrices.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of matrices.
lengthFactor An optional scale factor for all the floating-point values.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourcePosition xmlNode *  parent,
const char *  id,
const FMVector3List values,
float  lengthFactor = 1.0f
 

Writes out a COLLADA source of 3D positions or vectors.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of 3D vectors.
lengthFactor An optional scale factor for all the 3D vectors.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceString xmlNode *  parent,
const char *  id,
const StringList values,
const char *  parameter = NULL
 

Writes out a COLLADA source of UTF-8 tokens.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of UTF-8 tokens. This list will be space- separated within the COLLADA document, so you none of the token should have spaces in them.
parameter The name of the accessor parameter.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddSourceTexcoord xmlNode *  parent,
const char *  id,
const FMVector3List values
 

Writes out a COLLADA source of texture coordinates.

Parameters:
parent The parent XML tree node.
id The COLLADA id of the source.
values The list of 3D texture coordinates.
Returns:
The created XML tree node.

FCOLLADA_EXPORT xmlNode* FUDaeWriter::AddTechniqueChild xmlNode *  parent,
const char *  profile
 

Writes out the <technique> element unto the given parent xml tree node.

This function ensures that only one <technique> element exists for the given profile.

Parameters:
parent The parent XML tree node.
profile The application-specific profile name.
Returns:
The <technique> XML tree node.

FCOLLADA_EXPORT string FUDaeWriter::CleanId const char *  id  ) 
 

Cleans up a given name into a valid COLLADA id.

This function does no check for uniqueness.

Parameters:
id A name.
Returns:
A valid COLLADA id.

FCOLLADA_EXPORT fstring FUDaeWriter::CleanName const fchar *  name  ) 
 

Cleans up a given name into a valid COLLADA name.

Parameters:
name A name.
Returns:
A valid COLLADA name.


Generated on Fri May 12 16:44:45 2006 for FCollada by  doxygen 1.4.6-NO