SourceElementContentAccessor< TYPE > Struct Template Reference

SourceElementContentAccessor< TYPE > Struct Template Reference

#include <fbxcolladaelement.h>

Class Description

template<typename TYPE>
struct SourceElementContentAccessor< TYPE >

A struct for convenient access to the content of COLLADA source element.

Definition at line 110 of file fbxcolladaelement.h.

+ Inheritance diagram for SourceElementContentAccessor< TYPE >:

Public Member Functions

 SourceElementContentAccessor (xmlNode *pSourceElement)
 
- Public Member Functions inherited from ElementContentAccessor
 ElementContentAccessor ()
 
 ElementContentAccessor (xmlNode *pElement)
 
virtual ~ElementContentAccessor ()
 
template<typename TYPE >
bool GetNext (TYPE *pData)
 
template<typename TYPE >
int GetArray (TYPE *pArray, int pSourceUnitOffset=0, int pSourceUnitValidCount=1, int pSourceUnitSize=1, int pDestUnitOffset=0, int pDestUnitValidCount=1, int pDestUnitSize=1, TYPE pDefaultValue=TYPE())
 

Public Attributes

int mCount
 
int mStride
 
int mOffset
 
- Public Attributes inherited from ElementContentAccessor
xmlChar * mContent
 
const char * mPointer
 

Constructor & Destructor Documentation

SourceElementContentAccessor ( xmlNode *  pSourceElement)
inline

Definition at line 112 of file fbxcolladaelement.h.

113  : mCount(0), mStride(1), mOffset(0)
114  {
115  bool lReadCount = true;
116  xmlNode* lTechniqueElement = DAE_FindChildElementByTag(pSourceElement, COLLADA_TECHNIQUE_COMMON_ELEMENT);
117  if (lTechniqueElement)
118  {
119  xmlNode* lAccessorElement = DAE_FindChildElementByTag(lTechniqueElement, COLLADA_ACCESSOR_STRUCTURE);
120  FBX_ASSERT(lAccessorElement);
121  if (!lAccessorElement)
122  return;
123 
127  lReadCount = false;
128  }
129 
130  xmlNode * lDataArrayElement = DAE_FindChildElementByTag(pSourceElement,
131  TypeToArrayTag<TYPE>());
132  // Some COLLADA exporters use IDREF_array instead of Name_array
133  if (!lDataArrayElement && TypeToArrayTag<TYPE>() == COLLADA_NAME_ARRAY_STRUCTURE)
134  lDataArrayElement = DAE_FindChildElementByTag(pSourceElement, COLLADA_IDREF_ARRAY_STRUCTURE);
135  FBX_ASSERT(lDataArrayElement);
136 
137  if (lDataArrayElement && lReadCount)
139 
140  mContent = xmlNodeGetContent(lDataArrayElement);
141  mPointer = (const char *)mContent;
142  }
#define COLLADA_ACCESSOR_STRUCTURE
#define COLLADA_COUNT_PROPERTY
#define COLLADA_STRIDE_PROPERTY
#define COLLADA_OFFSET_PROPERTY
#define COLLADA_IDREF_ARRAY_STRUCTURE
#define COLLADA_NAME_ARRAY_STRUCTURE
const FbxString DAE_GetElementAttributeValue(xmlNode *pElement, const char *pAttributeName)
Get the value of an attribute of an element.
#define COLLADA_TECHNIQUE_COMMON_ELEMENT
xmlNode * DAE_FindChildElementByTag(xmlNode *pParentElement, const char *pTag, xmlNode *pFindFrom=((void *) 0))
Find a child element with a given tag.

Member Data Documentation

int mCount

Definition at line 144 of file fbxcolladaelement.h.

int mStride

Definition at line 145 of file fbxcolladaelement.h.

int mOffset

Definition at line 146 of file fbxcolladaelement.h.


The documentation for this struct was generated from the following file: