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 >:
ElementContentAccessor

List of all members.

Public Member Functions

  SourceElementContentAccessor (xmlNode *pSourceElement)

Public Attributes

int  mCount
int  mStride
int  mOffset

Constructor & Destructor Documentation

SourceElementContentAccessor ( xmlNode *  pSourceElement ) [inline]

Definition at line 112 of file fbxcolladaelement.h.

        : mCount(0), mStride(1), mOffset(0)
    {
        bool lReadCount = true;
        xmlNode* lTechniqueElement = DAE_FindChildElementByTag(pSourceElement, COLLADA_TECHNIQUE_COMMON_ELEMENT);
        if (lTechniqueElement)
        {
            xmlNode* lAccessorElement = DAE_FindChildElementByTag(lTechniqueElement, COLLADA_ACCESSOR_STRUCTURE);
            FBX_ASSERT(lAccessorElement);
            if (!lAccessorElement)
                return;

            DAE_GetElementAttributeValue(lAccessorElement, COLLADA_COUNT_PROPERTY, mCount);
            DAE_GetElementAttributeValue(lAccessorElement, COLLADA_STRIDE_PROPERTY, mStride);
            DAE_GetElementAttributeValue(lAccessorElement, COLLADA_OFFSET_PROPERTY, mOffset);
            lReadCount = false;
        }

        xmlNode * lDataArrayElement = DAE_FindChildElementByTag(pSourceElement,
            TypeToArrayTag<TYPE>());
        // Some COLLADA exporters use IDREF_array instead of Name_array
        if (!lDataArrayElement && TypeToArrayTag<TYPE>() == COLLADA_NAME_ARRAY_STRUCTURE)
            lDataArrayElement = DAE_FindChildElementByTag(pSourceElement, COLLADA_IDREF_ARRAY_STRUCTURE);
        FBX_ASSERT(lDataArrayElement);

        if (lDataArrayElement && lReadCount)
            DAE_GetElementAttributeValue(lDataArrayElement, COLLADA_COUNT_PROPERTY, mCount);

        mContent = xmlNodeGetContent(lDataArrayElement);
        mPointer = (const char *)mContent;
    }

Member Data Documentation


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