A3DSDKRootEntities.h

Root entities section.

Author

Tech Soft 3D

Version

23.0

Date

January 2023

Copyright (c) 2010 - 2023 by Tech Soft 3D, Inc. All rights reserved.

Content

Data Structures

A3DRootBaseData

A structure representing a hierarchy of descriptive names and modeler data that applies to any PRC entity.

A3DRootBaseWithGraphicsData

A structure specifying root graphics data.

A3DMiscSingleAttributeData

A structure that specifies modeler data attribute.

A3DMiscAttributeData

A structure that specifies descriptive names and modeller data.

A3DMiscAttributeBasicUnitData

A structure that specifies base unit information.

A3DMiscAttributeUnitData

A structure that specifies unit information.

Functions

A3DEntityGetType()

Gets the actual type of the entity.

A3DEntityIsBaseWithGraphicsType()

Indicates whether an entity base type corresponds to the kA3DTypeRootBaseWithGraphics type enumeration.

A3DEntityIsBaseType()

Indicates whether an entity base type corresponds to the kA3DTypeRootBase type enumeration.

A3DRootBaseGet()

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

A3DRootBaseSet()

Adds an A3DRootBaseData structure to an existing PRC entity.

A3DRootBaseAttributeRemoveAll()

Remove all attributes stored in a PRC entity.

A3DRootBaseAttributeRemove()

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

A3DRootBaseAttributeRemoveAt()

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

A3DRootBaseAttributeAppend()

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

A3DRootBaseAttributeAdd()

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

A3DRootBaseWithGraphicsGet()

Populates the A3DRootBaseWithGraphicsData structure.

A3DRootBaseWithGraphicsSet()

Adds an A3DRootBaseWithGraphicsData structure to an existing A3DRootBaseWithGraphics entity.

A3DMiscAttributeGet()

Populates the A3DMiscAttributeData structure.

A3DMiscAttributeCreate()

Creates an A3DMiscAttribute from A3DMiscAttributeData structure.

A3DGlobalGetUnit()

Get unit information related to a A3DMiscSingleAttributeData structure.

A3DGlobalGetUnitData()

Get unit information related to a A3DMiscSingleAttributeData structure.

Functions

A3DStatus A3DEntityGetType(const A3DEntity *pEntity, A3DEEntityType *peEntityType)

Gets the actual type of the entity.

This function returns an integer that specifies an Entity type. The integer corresponds to one of the values described by the A3DEEntityType enumeration.

See also

A3DEntity

Version

2.0

Sample code
/* code to get data from a representation item structure */
A3DRiRepresentationItem* pRepItem; /* this is retrieved for example on a PartDefinition data */
A3DInt32 iErr = A3D_SUCCESS;
A3DEEntityType eType;

if (A3DEntityGetType(pRepItem,&eType)==A3D_SUCCESS)
{
    switch(eType)
    {
        case kA3DTypeRiPointSet:
        {
            A3DRiPointSetData sData;
            A3D_INITIALIZE_DATA( sData );
            iErr = A3DRiPointSetGet( pRepItem, &sData );
            /* work with PointSet data... */
            break;
        }

        /* treate other types of data */
        case ...:

        default:
            return ERROR;
            break;
    }
}

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DBool A3DEntityIsBaseWithGraphicsType(const A3DEntity *pEntity)

Indicates whether an entity base type corresponds to the kA3DTypeRootBaseWithGraphics type enumeration.

This function returns a value of TRUE if an entity type is based on the abstract root type for a PRC entity that can represent graphic data. Such an abstract root type is identified by the kA3DTypeRootBaseWithGraphics type enumeration.

Remark

Because this function does not return A3DStatus the internal thread safety policy is to wait for the availability of the API.

Version

2.0 You may need to use this function to sort entities for particular treatments.

A3DBool A3DEntityIsBaseType(const A3DEntity *pEntity)

Indicates whether an entity base type corresponds to the kA3DTypeRootBase type enumeration.

This function returns a value of TRUE if an entity type is based on the abstract root type for any PRC entity (with or without graphic data). Such an abstract root type is identified by the kA3DTypeRootBase type enumeration.

Remark

Because this function does not return A3DStatus the internal thread safety policy is to wait for the availability of the API.

Version

2.0 You may need to use this function to sort entities for particular treatments.

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

A3DStatus A3DRootBaseWithGraphicsGet(const A3DRootBaseWithGraphics *pRoot, A3DRootBaseWithGraphicsData *pData)

Populates the A3DRootBaseWithGraphicsData structure.

Version

11.1

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 A3DRootBaseWithGraphicsSet(A3DRootBaseWithGraphics *pRoot, const A3DRootBaseWithGraphicsData *pData)

Adds an A3DRootBaseWithGraphicsData structure to an existing A3DRootBaseWithGraphics entity.

Version

11.1

Note

The A3DRootBaseWithGraphics entity type is an abstract class and cannot be directly created; however, any graphic entity created with a function of the form A3DCreate results in the creation of a PRC entity of type A3DRootBaseWithGraphics and of type A3D. That is, a function of the form A3DCreate adds specific data to the base class, for example A3DRootBaseWithGraphicsData::m_pGraphics.

Note

When A3DRootBaseWithGraphicsSet is used to set a new A3DGraphics, its data is copied in the A3DRootBaseWithGraphics but the pointer is not kept nor freed later when the A3DRootBaseWithGraphics is deleted. It must be deleted using A3DGraphicsDelete

A3DGraphicsData sGraphicsData;
A3D_INITIALIZE_DATA(A3DGraphicsData, sGraphicsData)
// fill in sGraphicsData

A3DGraphics* pGraphics = NULL;
A3DStatus    eStatus   = A3DGraphicsCreate(&sGraphicsData, &graphics);

A3DRootBaseWithGraphicsData sRootBaseWithGraphicsData;
A3D_INITIALIZE_DATA(A3DRootBaseWithGraphicsData, sRootBaseWithGraphicsData)
sRootBaseWithGraphicsData.m_pGraphics = pGraphics;

// copy pGraphics'content to pEntity
eStatus = A3DRootBaseWithGraphicsSet(pEntity, &sRootBaseWithGraphicsData);

// free pGraphics
eStatus = A3DGraphicsDelete(pGraphics);
Never call A3DGraphicsDelete on an A3DGraphics obtained with A3DRootBaseWithGraphicsGet.

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 A3DMiscAttributeGet(const A3DMiscAttribute *pAttribute, A3DMiscAttributeData *pData)

Populates the A3DMiscAttributeData structure.

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 A3DMiscAttributeCreate(const A3DMiscAttributeData *pData, A3DMiscAttribute **ppAttribute)

Creates an A3DMiscAttribute from A3DMiscAttributeData structure.

Version

2.0

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 A3DGlobalGetUnit(const A3DUns32 uiIndexUnit, A3DMiscAttributeUnit **ppUnit)

Get unit information related to a A3DMiscSingleAttributeData structure.

Version

12.1

Return values
  • A3D_INVALID_UNIT_INDEX

  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DGlobalGetUnitData(A3DMiscAttributeUnit *const pUnit, A3DMiscAttributeUnitData *pData)

Get unit information related to a A3DMiscSingleAttributeData structure.

Version

12.1

Return values
  • A3D_INVALID_UNIT_INDEX

  • A3D_INVALID_DATA_STRUCT_SIZE

  • A3D_INVALID_DATA_STRUCT_NULL

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code