Model tree helper

Detailed Description

group a3d_modelfile_helper

Tools and structure data to use for quick implementation of a model tree.

Version

24

Function Documentation

A3DStatus A3DTreeCompute(const A3DAsmModelFile *pModelFile, A3DTree **ppTree, const A3DTreeComputeParameters *psParameters)

From modelfile compute data necessary to build a tree.

The function will be call with null model file, in order to release the memory

Version

24

Parameters
  • pModelFile – The model file

  • ppTree – The corresponding model tree

  • psParameters – Parameters used to compute the tree. 0 for now, structure for future use.

Return values
  • A3D_INVALID_ENTITY_TYPE

  • A3D_MODELFILE_INCONSISTENT_EMPTY

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeGetRootNode(const A3DTree *pTree, A3DTreeNode **ppRootNode)

get root node of model tree

Version

24

Parameters
  • pTree – The model tree

  • ppRootNode – The root of model tree

Return values
  • A3D_SUCCESS – in case of success or an error code

  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

A3DStatus A3DTreeNodeGetChildren(const A3DTree *pTree, const A3DTreeNode *pNode, A3DUns32 *puiCount, A3DTreeNode ***pppChildNodes)

Desc.

Get child nodes of a node

Version

24.0

Parameters
  • pTree – The model tree containing the node.

  • pNode – The tree node, or 0 to clean the structure memory.

  • puiCount – Number of child nodes.

  • pppChildNodes – child nodes.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetParent(const A3DTree *pTree, const A3DTreeNode *pNode, A3DTreeNode **ppParentNode)

Desc.

Get parent node of a node or NULL if the node is the root of the model

Version

24.0

Parameters
  • pTree – The model tree containing the node.

  • pNode – The tree node, or 0 to clean the structure memory.

  • ppParentNode – parent node.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetEntity(const A3DTreeNode *pNode, A3DEntity **ppEntity)

Get regular entity.

Version

24.0

Parameters
  • pNode – The tree node.

  • ppEntity – The regular entity or NULL if not found.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

A3DStatus A3DTreeNodeGetName(const A3DTreeNode *pNode, A3DUTF8Char **ppName)

Get the name of the given node.

Version

24.0

Parameters
  • pNode – The tree node, or NULL to clean the memory.

  • ppName – The tree node name.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetTransformation(const A3DTreeNode *pNode, A3DMiscTransformation **ppTransformation)

Get the local transformation of the given node.

Version

24.0

Parameters
  • pNode – The tree node.

  • ppTransformation – The tree node local transformation.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetNetTransformation(const A3DTreeNode *pNode, A3DMiscTransformation **ppTransformation)

Get the global transformation (according to the root node) of the given node.

Version

24.0

Parameters
  • pNode – The tree node

  • ppTransformation – The tree node global transformation.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetNetVisibility(const A3DTreeNode *pNode, A3DBool *pIsVisible)

Get the net visibility of the given node.

Version

24.0

Parameters
  • pNode – The tree node

  • pIsVisible – The net visibility of the node.

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetNetStyle(const A3DTreeNode *pNode, A3DGraphStyleData *const pGraphStyleData)

Get the net style of the given node.

Version

24.0

Parameters
  • pNode – The tree node

  • pGraphStyleData – Style of the node, stored in

Return values
  • A3D_INVALID_ENTITY_NULL

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

  • A3D_SUCCESS

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTreeNodeGetGeometry(const A3DTree *pTree, const A3DTreeNode *pNode, A3DBool bApplyTreeStyle, A3DMeshData *pMeshData, const A3DRiComputeMeshDataParameters *psMeshOptionsData)

Get mesh associated to the node.

Version

24.0

Parameters
  • pTree[in] The model tree containing the node, or 0 to clean the memory.

  • pNode[in] The tree node, or 0 to clean the memory.

  • bApplyTreeStyle[in] specify the graphical information defined in the tree should be applied to compute the mesh.

  • pMeshData[inout] The A3DMeshData to store the computed mesh or release memory if pTree or pNode are null.

  • psMeshOptionsData[in] Options used to compute Mesh. 0 for now, options structure for future use.

Return values
  • A3D_INVALID_DATA_STRUCT_SIZE – Incorrect initialization size for pMeshData.

  • A3D_INVALID_DATA_STRUCT_NULL – Null pMeshData pointer.

  • A3D_INVALID_ENTITY_NULL – Null no entity is linked to the node

  • A3D_INVALID_ENTITY_TYPE – Unsupported type for the entity linked to the node

  • A3D_MESH_EMPTY – Entity linked to the node contains no coordinate data.

  • A3D_MESH_INCONSISTENT – Inconsistent tessellation information.

  • A3D_ERROR – Mesh data computation failure.

  • A3D_SUCCESS – Success.

Returns

A3D_SUCCESS in case of success or an error code