13 #ifndef _FBXSDK_FILEIO_COLLADA_UTILS_H_
14 #define _FBXSDK_FILEIO_COLLADA_UTILS_H_
21 #include <components/libxml2-2.7.8/include/libxml/globals.h>
26 #define INT_MAX 0x7FFFFFFF
29 #ifndef CENTIMETERS_TO_INCHES
30 #define CENTIMETERS_TO_INCHES 2.54f
33 #ifndef RADIANS_TO_DEGREES
34 #define RADIANS_TO_DEGREES 57.295799f
42 #define COLLADA_ID_PROPERTY_NAME "COLLADA_ID"
113 xmlNode*
DAE_ExportAccessor(xmlNode* parentXmlNode,
const char*
id,
const char* arrayRef,
int count,
int stride,
const char* name,
const char* type);
114 xmlNode*
DAE_ExportAccessor14(xmlNode* parentXmlNode,
const char*
id,
const char* arrayRef,
int count,
int stride,
const char* name,
const char* type);
116 void DAE_AddXYZAccessor(xmlNode* parentXmlNode,
const char* profile,
const char* arrayName,
const char* arrayRef,
int count);
117 void DAE_AddSTAccessor(xmlNode* parentXmlNode,
const char* profile,
const char* arrayName,
const char* arrayRef,
int count);
119 void DAE_AddXYZAccessor14(xmlNode* parentXmlNode,
const char* profile,
const char* arrayName,
const char* arrayRef,
int count);
120 void DAE_AddSTAccessor14(xmlNode* parentXmlNode,
const char* profile,
const char* arrayName,
const char* arrayRef,
int count);
127 xmlNode*
DAE_AddParameter(xmlNode* parentXmlNode,
const char* name,
const char* type,
const char* value,
DAE_Flow flow);
133 xmlNode*
DAE_AddParameter(xmlNode* parentXmlNode,
const char* name,
double value);
134 xmlNode*
DAE_AddParameter(xmlNode* parentXmlNode,
const char* name,
bool value);
135 xmlNode*
DAE_AddParameter(xmlNode* parentXmlNode,
const char* name,
const char* type,
const char* value);
137 void DAE_AddInput(xmlNode* parentXmlNode,
const char* semantic,
const char* source,
int idx = -1);
138 void DAE_AddInput14(xmlNode* parentXmlNode,
const char* semantic,
const char* source,
int offset = -1,
int set=-1);
176 const char * pAttributeValue,
const char * pDefaultAttributeValue =
"");
190 template <
typename TYPE>
193 if (pElement !=
NULL)
225 template <
typename TYPE>
228 if (!pElement || !pAttributeName)
244 const char * pAttributeName,
247 if (!pElement || !pAttributeName)
253 pData = (
const char *)lPropertyValue.
Get();
266 const char * pAttributeName,
267 const char * pValue);
313 template <
typename T>
318 return xmlNewChild(pParentElement,
NULL, (xmlChar *)pTag,
319 (xmlChar *)lRepr.
Buffer());
331 return xmlNewNode(
NULL, reinterpret_cast<xmlChar*>(const_cast<char *>(pTag)));
340 template <
typename T>
342 const T & pAttributeValue)
345 return xmlNewProp(pElement, (xmlChar *)pAttributeName.
Buffer(),
346 (xmlChar *)lRepr.
Buffer());
FbxMap< FbxString, xmlNode * > SourceElementMapType
xmlNode * DAE_ExportAccessor(xmlNode *parentXmlNode, const char *id, const char *arrayRef, int count, int stride, const char *name, const char *type)
FbxAutoPtr mimics the auto_ptr class template implementation available in the C++ Standard Library...
xmlNode * DAE_ExportSource14(xmlNode *parentXmlNode, const char *id, FbxStringList &accessorParams, FbxArray< double > &arr, bool isCommonProfile=true)
void DAE_AddInput(xmlNode *parentXmlNode, const char *semantic, const char *source, int idx=-1)
void DAE_AddInput14(xmlNode *parentXmlNode, const char *semantic, const char *source, int offset=-1, int set=-1)
FbxArray< xmlNode * > CNodeList
const FbxString ToString(const T &pValue)
void DAE_AddXYZAccessor(xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
bool FromString(T *pDest, const char *pSourceBegin, const char **pSourceEnd=((void *) 0))
Convert part of the source string into destination type.
Array that stores pairs of FbxString and a pointer.
Utility class to manipulate strings.
void DAE_AddNotificationWarning(const FbxManager *pSdkManger, const FbxString &pWarningMessage)
Emit warning message.
void DAE_AddXYZAccessor14(xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
ColladaLayerTraits(FbxLayerElement::EType pType, int pLength)
void DAE_GetElementContent(xmlNode *pElement, TYPE &pData)
Get the content of a XML element.
void DAE_GetElementTag(xmlNode *pElement, FbxString &pTag)
Get the tag of the specific element.
Type * Get() const
Retrieve the pointer it holds.
Class to represent colors in RGBA format using doubles.
void DAE_AddNotificationError(const FbxManager *pSdkManger, const FbxString &pErrorMessage)
Emit error message.
double centimetersToInches(double val)
const FbxString DAE_GetIDFromUrlAttribute(xmlNode *pElement)
Get the ID of another element from the url attribute of the given element.
const FbxSystemUnit DAE_ImportUnit(xmlNode *pUnitElement)
Import a COLLADA unit element into a FBX system unit.
xmlNode * DAE_GetSourceWithSemantic(xmlNode *pConsumerElement, const char *pSemantic, const SourceElementMapType &pSourceElements)
Get the COLLADA source element with a semantic meaning and a consumer element; The COLLADA input elem...
bool DAE_CompareAttributeValue(xmlNode *pElement, const char *pAttributeName, const char *pValue)
Compare the value of specific attribute of specific element with given value.
xmlNode * DAE_ExportAccessor14(xmlNode *parentXmlNode, const char *id, const char *arrayRef, int count, int stride, const char *name, const char *type)
float FbxFloor(const float x)
xmlNode * DAE_AddChildElement(xmlNode *pParentElement, const char *pTag, const T &pContent)
Add a child element with specific content.
FbxAutoPtr< xmlNode, XmlNodeDeletionPolicy > XmlNodePtr
void DAE_SetName(FbxObject *pObject, const FbxString &pName, const FbxString &pID)
Set the name of the object with a given name.
This class implements an efficient map based on key comparison, which stores key-value pairs...
double radiansToDegrees(double val)
void RecursiveSearchElement(xmlNode *pBaseElement, const char *pTag, FbxArray< xmlNode * > &pResult)
Search the elements with given tag, push the found results to the end of the given array...
xmlNode * DAE_FindChildElementByAttribute(xmlNode *pParentElement, const char *pAttributeName, const char *pAttributeValue, const char *pDefaultAttributeValue="")
Find a child element with a given attribute value.
void DAE_ExportArray(xmlNode *parentXmlNode, const char *id, FbxArray< FbxVector4 > &arr)
The base class of most FBX objects.
#define RADIANS_TO_DEGREES
const FbxString DAE_GetIDFromTargetAttribute(xmlNode *pElement)
Get the ID of another element from the target attribute of the given element.
FbxLayerElement::EType mLayerType
xmlNode * DAE_NewElement(const char *pTag)
Represents an element in the scene graph.
xmlNode * getTechniqueNode(xmlNode *parent, const char *profile)
void DAE_AddFlow(xmlNode *node, DAE_Flow flow)
This class implements an efficient set based on value comparison, which stores values.
char * Buffer()
Non-const buffer access.
const FbxString DAE_GetIDFromSourceAttribute(xmlNode *pElement)
Get the ID of another element from the source attribute of the given element.
void DAE_ExportSourceArray(xmlNode *sourceNode, const char *id, FbxArray< FbxColor > &arr)
EType
Layer Element type identifier.
Scoped pointer for FbxMalloc allocations, which call FbxFree() to deallocate.
xmlNode * getSourceAccessor(xmlNode *sourceNode)
#define CENTIMETERS_TO_INCHES
A four double mathematic vector class.
bool DAE_CheckCompatibility(xmlNode *pNodeElement)
Check whether this node is compatible to FBX transform structure.
xmlNode * DAE_AddParameter(xmlNode *parentXmlNode, const char *name, const FbxColor &color, DAE_Flow flow)
FBX SDK affine matrix class.
void DAE_AddSTAccessor14(xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
void DAE_ExportSourceArray14(xmlNode *sourceNode, const char *id, FbxArray< FbxColor > &arr)
This class describes the units of measurement used within a particular scene.
xmlNode * DAE_AddTechnique(xmlNode *parentXmlNode, const char *technique)
const FbxString DAE_GetElementAttributeValue(xmlNode *pElement, const char *pAttributeName)
Get the value of an attribute of an element.
static const ColladaLayerTraits GetLayerTraits(const FbxString &pLabel)
Construct traits according to COLLADA layer string.
FbxMap< FbxString, xmlNode * > SkinMapType
double inchesToCentimeters(double val)
void DAE_AddSTAccessor(xmlNode *parentXmlNode, const char *profile, const char *arrayName, const char *arrayRef, int count)
double degreesToRadians(double val)
void IncreaseLclTranslationAnimation(FbxNode *pNode, FbxDouble3 &pOffset)
If the specific node has animation on its local translation, increase every key by the offset...
void findChildrenByType(xmlNode *pParentElement, const FbxSet< FbxString > &pTypes, CNodeList &pChildrenElements)
Find children elements whose type is included in a list of type.
Base class for elements of layers (FbxLayer).
Class for array of basic elements such as pointers and basic types.
static void DeleteIt(xmlNode **ptr)
xmlAttr * DAE_AddAttribute(xmlNode *pElement, const FbxString &pAttributeName, const T &pAttributeValue)
Add an attribute for a element.
FbxString matrixToString(const FbxAMatrix &mx)
xmlNode * DAE_FindChildElementByTag(xmlNode *pParentElement, const char *pTag, xmlNode *pFindFrom=((void *) 0))
Find a child element with a given tag.