Entity Type Determination

Functions

A3DStatus

A3DEntityGetType

A3DBool

A3DEntityIsBaseWithGraphicsType

A3DBool

A3DEntityIsBaseType

Detailed Description

group a3d_entitytype_functions

Determines the type of a PRC entity.

Function Documentation

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.

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;
    }
}

See also

A3DEntity

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.