A3DMiscAttributeData

Fields

A3DBool

m_bTitleIsInt

A3DUTF8Char *

m_pcTitle

A3DUns32

m_uiSize

A3DMiscSingleAttributeData *

m_asSingleAttributesData

Detailed Description

struct A3DMiscAttributeData

A structure that specifies descriptive names and modeller data.

The A3DMiscAttributeData structure specifies a descriptive name as a character string or integer. It can also reference an array of A3DMiscSingleAttributeData structure, which specifies modeler data.

Version

2.0

If m_bTitleIsInt is A3DTrue, m_pcTitle will be parsed as an A3DUns32.

A3DVoid setAttributesSample(A3DEntity* pEntity)
{
    A3DMiscAttribute* pAttributes[2];

    // ----------------------------------------------------------------
    // creation of the first A3DMiscAttributeData

    A3DMiscSingleAttributeData pSingleAttributes[2];
    // creation of the first A3DMiscSingleAttribute
    A3DMiscSingleAttributeData sSingleAttributeData1;
    A3D_INITIALIZE_DATA(A3DMiscSingleAttributeData, sSingleAttributeData1);
    sSingleAttributeData1.m_eType = kA3DModellerAttributeTypeString;
    sSingleAttributeData1.m_pcTitle = (char*) "First single attribute";
    sSingleAttributeData1.m_pcData = (char*) "Simple attribute 1 demonstration";
    pSingleAttributes[0] = sSingleAttributeData1;
    // creation of the second A3DMiscSingleAttribute
    A3DMiscSingleAttributeData sSingleAttributeData2;
    A3D_INITIALIZE_DATA(A3DMiscSingleAttributeData, sSingleAttributeData2);
    sSingleAttributeData2.m_eType = kA3DModellerAttributeTypeString;
    sSingleAttributeData2.m_pcTitle = (char*) "Second single attribute";
    sSingleAttributeData2.m_pcData = (char*) "Simple attribute 2 demonstration";
    pSingleAttributes[1] = sSingleAttributeData2;

    // creation of the first A3DMiscAttribute
    A3DMiscAttributeData sAttributeData1;
    A3D_INITIALIZE_DATA(A3DMiscAttributeData, sAttributeData1);
    sAttributeData1.m_pcTitle = "First attribute";
    sAttributeData1.m_bTitleIsInt = false;
    sAttributeData1.m_pSingleAttributesData = pSingleAttributes;
    sAttributeData1.m_uiSize = 2;
    A3DMiscAttributeCreate(&sAttributeData1, &pAttributes[0]);

    // ----------------------------------------------------------------
    // creation of the second A3DMiscAttribute
    A3DMiscAttributeData sAttributeData2;
    A3D_INITIALIZE_DATA(A3DMiscAttributeData, sAttributeData2);
    A3DUns32 uiTitleAsInt = 12345;
    sAttributeData2.m_pcTitle = (A3DUTF8Char*)(&uiTitleAsInt);
    sAttributeData2.m_bTitleIsInt = true;
    sAttributeData2.m_uiSize = 0;
    A3DMiscAttributeCreate(&sAttributeData2, &pAttributes[1]);


    // ----------------------------------------------------------------
    // creation of the A3DRootBase
    A3DRootBaseData sRootData;
    A3D_INITIALIZE_DATA(A3DRootBaseData, sRootData);
    sRootData.m_pcName = (char*) "Root base information";
    sRootData.m_ppAttributes = pAttributes;
    sRootData.m_uiSize = 2;
    A3DRootBaseSet(pEntity, &sRootData);

    for(A3DUns32 i = 0; i < sRootData.m_uiSize; ++i)
    {
        A3DEntityDelete(sRootData.m_ppAttributes[i]);
    }
}

Public Members

A3DBool m_bTitleIsInt

A value of A3DTrue indicates that m_pcTitle member represents an integer.

A3DUTF8Char *m_pcTitle

Title as string.

A3DUns32 m_uiSize

Size of m_asSingleAttributesData.

A3DMiscSingleAttributeData *m_asSingleAttributesData

Pointer to an array of single attribute structures.