A3DSDKMisc.h
Header file for tools used with structure and geometry.
- 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
Structure that specifies a 4x4 matrix for use in the A3DMiscGeneralTransformation entity. |
|
Structure for defining an A3DMiscCartesianTransformation entity. |
|
Structure that identifies the referenced entity and that provides a new coordinate system. |
|
Structure that identifies the referenced topology entity and that specifies globally-defined attributes. |
|
Structure that identifies the referenced tesselation entity and that specifies globally-defined attributes. |
|
Reference on coordinate system item. |
|
Physical properties. |
|
Fiber physical properties. |
|
HoneyComb physical properties. |
|
Isotropic physical properties. |
|
Orthotropic2D physical properties. |
|
Orthotropic3D physical properties. |
|
Anisotropic physical properties. |
|
Material properties, like density. |
Functions
Populates the A3DMiscGeneralTransformationData structure. |
|
Creates an A3DMiscGeneralTransformation from an A3DMiscGeneralTransformationData structure. |
|
Populates the A3DMiscCartesianTransformationData structure. |
|
Creates an A3DMiscCartesianTransformation from an A3DMiscCartesianTransformationData structure. |
|
Populates the A3DMiscEntityReferenceData structure. |
|
Creates an A3DMiscEntityReference from an A3DMiscEntityReferenceData structure. |
|
Function to set the entity reference from A3DMiscEntityReferenceData structure in a previously created object. |
|
Populates the A3DMiscReferenceOnTopologyData structure. |
|
Populates the A3DMiscReferenceOnTessData structure for PolyBrepModel. |
|
Creates an A3DMiscReferenceOnTess from an A3DMiscReferenceOnTessData structure. |
|
Creates an A3DMiscReferenceOnTopology from an A3DMiscReferenceOnTopologyData structure. |
|
Populates the A3DMiscReferenceOnCsysItemData structure. |
|
Creates an A3DMiscReferenceOnCsysItem from an A3DMiscReferenceOnCsysItemData structure. |
|
Converts UTF-8 encoded characters to UTF-16 strings on Windows. |
|
Converts UTF-16 strings to an array UTF-8 encoded characters on Windows. |
|
Converts a UTF-8 string to a UTF-16 string on Windows. |
|
Converts a UTF-16 string to a UTF-8 string on Windows. |
|
Returns the text description of an error code. |
|
Returns the name of the entity type. |
|
Get density in kg/m3 read from the file. |
|
Read the axis-aligned bounding box (AABB) of the given A3DEntity directly from the CAD data. |
|
Use the tessellation to compute the axis-aligned bounding box (AABB) of the given entity. |
Functions
-
A3DStatus A3DMiscGeneralTransformationGet(const A3DMiscGeneralTransformation *pGeneralTransformation3d, A3DMiscGeneralTransformationData *pData)
Populates the A3DMiscGeneralTransformationData structure.
- 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 A3DMiscGeneralTransformationCreate(const A3DMiscGeneralTransformationData *pData, A3DMiscGeneralTransformation **ppGeneralTransformation3d)
Creates an A3DMiscGeneralTransformation from an A3DMiscGeneralTransformationData structure.
- 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 A3DMiscCartesianTransformationGet(const A3DMiscCartesianTransformation *pCartesianTransformation3d, A3DMiscCartesianTransformationData *pData)
Populates the A3DMiscCartesianTransformationData structure.
- 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 A3DMiscCartesianTransformationCreate(const A3DMiscCartesianTransformationData *pData, A3DMiscCartesianTransformation **ppCartesianTransformation3d)
Creates an A3DMiscCartesianTransformation from an A3DMiscCartesianTransformationData structure.
- Return values
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_POINTSET_BADSIZE –
A3D_TRANSFORMATION3D_INCONSISTENT –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscEntityReferenceGet(const A3DMiscEntityReference *pEntityReference, A3DMiscEntityReferenceData *pData)
Populates the A3DMiscEntityReferenceData 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 A3DMiscEntityReferenceCreate(const A3DMiscEntityReferenceData *pData, A3DMiscEntityReference **ppEntityReference)
Creates an A3DMiscEntityReference from an A3DMiscEntityReferenceData structure.
- Version
2.0
- Return values
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_ENTITYREFERENCE_INCONSISTENT_REFERENCE –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscEntityReferenceSet(A3DMiscEntityReference *pEntityReference, const A3DMiscEntityReferenceData *pData)
Function to set the entity reference from A3DMiscEntityReferenceData structure in a previously created object.
- Version
2.0
- Return values
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_ENTITYREFERENCE_INCONSISTENT_REFERENCE –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscReferenceOnTopologyGet(const A3DMiscReferenceOnTopology *pReferenceOnTopoItem, A3DMiscReferenceOnTopologyData *pData)
Populates the A3DMiscReferenceOnTopologyData 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 A3DMiscReferenceOnTessGet(const A3DMiscReferenceOnTess *pReferenceOnTess, A3DMiscReferenceOnTessData *pData)
Populates the A3DMiscReferenceOnTessData structure for PolyBrepModel.
- Version
9.2
- 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 A3DMiscReferenceOnTessCreate(const A3DMiscReferenceOnTessData *pData, A3DMiscReferenceOnTess **ppReferenceOnTess)
Creates an A3DMiscReferenceOnTess from an A3DMiscReferenceOnTessData structure.
If
m_eTopoItemType
is kA3DTypeTessEdge, m_uiSize must be 3 and:m_puiAdditionalIndexes
[0] is the face index inm_pPolyBrepModel
m_puiAdditionalIndexes
[1] is the loop index in the facem_puiAdditionalIndexes
[2] is the edge index in the loop
- Version
11.0
- Edge and Vertex references
If
m_eTopoItemType
is kA3DTypeTessVertex,m_uiSize
must be 4 andm_puiAdditionalIndexes
[0] is the face index inm_pPolyBrepModel
m_puiAdditionalIndexes
[1] is the loop index in the facem_puiAdditionalIndexes
[2] is the edge index in the loopm_puiAdditionalIndexes
[3] is the vertex index in the edge
- Parameters
pData – [in] The A3DMiscReferenceOnTessData instance to create reference from
ppReferenceOnTess – [out] A pointer to the resulting A3DMiscReferenceOnTess entity
- Return values
A3D_INVALID_DATA_STRUCT_SIZE – if
pData
is nullA3D_INVALID_DATA_STRUCT_NULL – if
pData
is incorrectly initializedA3D_ENTITYREFERENCE_INCONSISTENT_REFERENCE –
A3D_INVALID_ENTITY_NULL –
A3D_INVALID_ENTITY_TYPE –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscReferenceOnTopologyCreate(const A3DMiscReferenceOnTopologyData *pData, A3DMiscReferenceOnTopology **ppReferenceOnTopoItem)
Creates an A3DMiscReferenceOnTopology from an A3DMiscReferenceOnTopologyData structure.
- Version
2.0
- Return values
A3D_INVALID_ENTITY_NULL – if pData->m_pBrepData is NULL
A3D_INVALID_ENTITY_TYPE – if pData->m_pBrepData is not a A3DTopoBrepData
Until – version 2018 it was possible to pass A3DRiPolyBrepModel for pData->m_pBrepData which was not valid.
Use – A3DMiscReferenceOnTessCreate for that case (see CreatePRCCubes sample).
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_ENTITYREFERENCE_INCONSISTENT_REFERENCE –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscReferenceOnCsysItemGet(const A3DMiscReferenceOnCsysItem *pReferenceOnCSYSItem, A3DMiscReferenceOnCsysItemData *pData)
Populates the A3DMiscReferenceOnCsysItemData structure.
- Version
6.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 A3DMiscReferenceOnCsysItemCreate(const A3DMiscReferenceOnCsysItemData *pData, A3DMiscReferenceOnCsysItem **ppReferenceOnCSYSItem)
Creates an A3DMiscReferenceOnCsysItem from an A3DMiscReferenceOnCsysItemData structure.
- Version
6.0
- Return values
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_ENTITYREFERENCE_INCONSISTENT_REFERENCE –
A3D_SUCCESS –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscUTF8ToUnicode(const A3DUTF8Char *pcInputBuffer, A3DUTF8Char acOutputBuffer[])
Converts UTF-8 encoded characters to UTF-16 strings on Windows.
This function returns a UTF-16 string on Windows.
- Version
2.0
You must cast the string to a wide char pointer (
wchar_t*
) depending on the target computer’s characteristics.Warning
On Linux, this API simply copies the input
A3DUTF8Char*
string into the outputA3DUTF8Char*
string.- Return values
A3D_SUCCESS –
A3D_INVALID_ENTITY_NULL –
A3D_INITIALIZE_NOT_CALLED –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscUnicodeToUTF8(const A3DUTF8Char *pcInputBuffer, A3DUTF8Char acOutputBuffer[])
Converts UTF-16 strings to an array UTF-8 encoded characters on Windows.
This function returns an array of UTF-8 encoded characters.
- Version
2.0
The input buffer is cast and interpreted as a Unicode string (
wchar_t*
).Warning
On Linux, this API simply copies the input
A3DUTF8Char*
string into the outputA3DUTF8Char*
string.- Return values
A3D_SUCCESS –
A3D_INVALID_ENTITY_NULL –
A3D_INITIALIZE_NOT_CALLED –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscUTF8ToUTF16(const A3DUTF8Char *pcInputBuffer, A3DUniChar acOutputBuffer[])
Converts a UTF-8 string to a UTF-16 string on Windows.
This function returns a UTF-16 string.
- Version
7.0
Warning
On Linux, this API simply returns A3D_ERROR.
- Return values
A3D_SUCCESS –
A3D_ERROR –
A3D_INVALID_ENTITY_NULL –
A3D_INITIALIZE_NOT_CALLED –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscUTF16ToUTF8(const A3DUniChar *pcInputBuffer, A3DUTF8Char acOutputBuffer[])
Converts a UTF-16 string to a UTF-8 string on Windows.
This function returns a UTF-8 string.
- Version
7.0
Warning
On Linux, this API simply returns A3D_ERROR.
- Return values
A3D_SUCCESS –
A3D_ERROR –
A3D_INVALID_ENTITY_NULL –
A3D_INITIALIZE_NOT_CALLED –
- Returns
A3D_SUCCESS in case of success or an error code
-
const A3DUTF8Char *A3DMiscGetErrorMsg(A3DStatus)
Returns the text description of an error code.
This text is stored in a global array used also by A3DMiscGetEntityTypeMsg. This function returns a pointer to the global array and therefore it must not be desallocated. Each time the function is called, the global array is updated. For version 2.1, this method declaration was changed to use the same convention applied to all other HOOPS Exchange declarations. More specifically, the declaration was changed to
A3D_API (A3DUTF8Char*, A3DMiscGetErrorMsg,(A3DInt32));
. You will not be able to see this change because this reference simplifies all declarations to the more readable format shown in the declaration frame.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
-
const A3DUTF8Char *A3DMiscGetEntityTypeMsg(A3DEEntityType eType)
Returns the name of the entity type.
This text is stored in a global array used also by A3DMiscGetErrorMsg. This function returns a pointer to the global array and therefore it must not be desallocated. Each time the function is called, the global array is updated. For version 2.1, this method declaration was changed to use the same convention applied to all other HOOPS Exchange declarations. For more information, see the description for A3DMiscGetErrorMsg.
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
-
A3DStatus A3DMiscGetMaterialProperties(const A3DEntity *pEntity, A3DMiscMaterialPropertiesData *pMaterialPropertiesData)
Get density in kg/m3 read from the file.
Equal to -1.0 if not set \ Can call it on product occurrences, part, and representation item
- Version
8.2
-
A3DStatus A3DMiscGetBoundingBox(const A3DEntity *pEntity, A3DBoundingBoxData *pAABB)
Read the axis-aligned bounding box (AABB) of the given A3DEntity directly from the CAD data.
- Version
8.2
Warning
This function does not compute any bounding box. To do so please check A3DMiscComputeBoundingBox.
- Parameters
pEntity – [in] The Entity to get the bounding box from. It can be any of A3DAsmModelFile, A3DAsmProductOccurrence, A3DAsmPartDefinition or A3DRiSet.
pAABB – [out] A pointer to a valid A3DBoundingBoxData which will be filled in with the found bounding box. If no AABB is found in the CAD data, A3DBoundingBoxData::m_sMin and A3DBoundingBoxData::m_sMax will be set to zero vectors ({0.0, 0.0, 0.0}).
- Return values
A3D_SUCCESS –
A3D_BASE_BAD_ENTITY_TYPE –
A3D_INITIALIZE_BAD_VALUES –
- Returns
A3D_SUCCESS in case of success or an error code
-
A3DStatus A3DMiscComputeBoundingBox(const A3DEntity *pEntity, A3DDouble const *pOptPlacement, A3DBoundingBoxData *pAABB)
Use the tessellation to compute the axis-aligned bounding box (AABB) of the given entity.
An invalid bouding box corresponds to those values:
A3DBoundingBoxData::m_sMin is
{1.0, 0.0, 0.0}
A3DBoundingBoxData::m_sMax is
{-1.0, 0.0, 0.0}
- Version
11.1
It can occur under following conditions:
The computation is done on infinite elements.
The CAD data do not contain any tessellation.
pEntity
is of type A3DRiPlane.
Warning
This function computes the bounding box using tessellation data. If you want to read the actual bounding box from CAD data, see A3DMiscGetBoundingBox.
- Parameters
pEntity – [in] The Entity to get the bounding box from. It can be any of A3DAsmProductOccurrence, A3DAsmPartDefinition or A3DRiSet.
pOptPlacement – [in] Reserved for future use. Must be set to 0.
pAABB – [out] A pointer to a valid A3DBoundingBoxData which will be filled in with the computed bounding box. If not possible an invalid bounding box is filled in (see below).
- Return values
A3D_INVALID_DATA_STRUCT_SIZE –
A3D_INVALID_DATA_STRUCT_NULL –
A3D_BASE_BAD_ENTITY_TYPE –
A3D_SUCCESS – The bouding box computation is done on visible entities only. The unit used is the same as the given entity.
- Returns
A3D_SUCCESS in case of success or an error code