A3DEntityDelete
-
A3DStatus
A3DEntityDelete(A3DEntity *pEntity) -
Recursively deletes the entity and its child entities.
This function deletes the given entity along with all it’s child entities. Usually deleting any entity of a PRC tree is implicitly done when the tree root is deleted. Indeed, when using this function on an A3DAsmModelFile, it will frees all the memory allocated for
pModelFile. It recursively deletes all entities inside the model file, thus deleting the whole PRC tree. After the call, access to the model file is no longer possible, andpModelFileis invalid.However, it is possible that some entities may not be attached to any PRC. This is usually the case when a CAD model is manipulated for modification purpose.
As a rule of thumb, you should always explicitly delete an entity that you have not attached to any other entity.
A3DFileContextDatais an API structure, and requires a specific function for deletion. Please seeA3DFileContextDelete()This function must be called only on detached entities. Using it on an attached entity will resulting in a double free error when the PRC tree is deleted.
This function must not be applied within an HOOPS Visualize context. See
embed:rst:inline :doc:`/start/getting-started`
.
Return Values
A3D_SUCCESS:Returns
A3D_SUCCESSon success, or an error code on failure