Entity Base

Types

A3DRootBaseData

Functions

A3DStatus

A3DRootBaseGet

A3DStatus

A3DRootBaseSet

A3DStatus

A3DRootBaseAttributeRemoveAll

A3DStatus

A3DRootBaseAttributeRemove

A3DStatus

A3DRootBaseAttributeRemoveAt

A3DStatus

A3DRootBaseAttributeAppend

A3DStatus

A3DRootBaseAttributeAdd

Detailed Description

group a3d_rootbase

Creates and accesses a hierarchy of descriptive names and modeller data that can be applied to any PRC entity.

Entity type is kA3DTypeRootBase

This module lets you create a hierarchy of descriptive names and modeller data (called root-level attributes) that can be applied to any PRC entity. These attributes are packaged as an A3DRootBase entity that is referenced from the PRC entity they describe.

The following sample code shows how to create root-level attributes for any PRC entity. In this case, the attributes include modeller data. For restrictions on specifying modeller data, see A3DMiscAttributeData.

A3DVoid setAttributes(A3DEntity* p)
{
    A3DMiscAttribute* pAttr[3];

    A3DMiscSingleAttributeData Single;
    A3D_INITIALIZE_DATA(Single);

    Single.m_eType = kA3DModellerAttributeTypeString;
    Single.m_pcTitle = "Title";
    Single.m_pcData = "Simple B-rep building demonstration";

    A3DMiscAttributeData sAttribs;
    A3D_INITIALIZE_DATA(sAttribs);

    sAttribs.m_pcTitle = Single.m_pcTitle;
    sAttribs.m_asSingleAttributesData = &Single;
    sAttribs.m_uiSize = 1;
    A3DInt32 iRet = A3DMiscAttributeCreate(&sAttribs, &pAttr[0]);

    Single.m_pcTitle = "Author";
    Single.m_pcData = "HOOPS Exchange";
    sAttribs.m_pcTitle = Single.m_pcTitle;
    iRet = A3DMiscAttributeCreate(&sAttribs, &pAttr[1]);

    Single.m_pcTitle = "Company";
    Single.m_pcData = "Tech Soft 3D";
    sAttribs.m_pcTitle = Single.m_pcTitle;
    iRet = A3DMiscAttributeCreate(&sAttribs, &pAttr[2]);

    A3DRootBaseData sRootData;
    A3D_INITIALIZE_DATA(sRootData);

    sRootData.m_pcName = "Trimmed surface";
    sRootData.m_ppAttributes = pAttr;
    sRootData.m_uiSize = 3;
    iRet = A3DRootBaseSet(p, &sRootData);
    
    // cleaning up the allocated attributes
    for(A3DUns32 i = 0; i < sRootData.m_uiSize; ++i)
    {
        A3DEntityDelete(sRootData.m_ppAttributes[i]);
    }
}

The following illustration shows the result of the sample code.

The sample code creates an A3DRootBase entity that houses three A3DMiscAttribute entities, each of which reference an A3DMiscSingleAttributeData structure. Each A3DMiscSingleAttributeData structure provides modeller data of type kA3DModellerAttributeTypeString.

../_images/PRC_RootAttributes.png

Function Documentation

A3DStatus A3DRootBaseGet(const A3DRootBase *pRootBase, A3DRootBaseData *pData)

Populates an A3DRootBaseData structure with the data from a PRC entity.

Version

2.0

Return values
  • A3D_INITIALIZE_NOT_CALLED

  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseSet(A3DRootBase *pRootBase, const A3DRootBaseData *pData)

Adds an A3DRootBaseData structure to an existing PRC entity.

According to what is defined in the parameter pData, the A3DEntity will be updated.

Version

2.0

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseAttributeRemoveAll(A3DRootBase *pEntity)

Remove all attributes stored in a PRC entity.

Version

11.1

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_BASE_BAD_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseAttributeRemove(A3DRootBase *pEntity, A3DUTF8Char *pcTitle)

Remove attribute in the attribute array of PRC entity with a specific title.

Version

11.1

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_BASE_BAD_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseAttributeRemoveAt(A3DRootBase *pEntity, A3DUns32 uIndex)

Remove attribute of the current attribute array stored in a PRC entity, at a specific position.

Version

11.1

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_BASE_BAD_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseAttributeAppend(A3DRootBase *pEntity, A3DUns32 uiSize, A3DMiscAttribute **m_ppAttributes)

Append attributes to the current attribute array stored in a PRC entity.

Version

11.1

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_BASE_BAD_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DRootBaseAttributeAdd(A3DRootBase *pEntity, A3DUTF8Char *pcTitle, A3DUTF8Char *pcValue)

Add an attribute to the current attribute array stored in a PRC entity.

Version

11.1

Note

A3DRootBase is an abstract class and cannot be directly created; however, any entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBase and of type A3D.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_BASE_BAD_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code