Topological item owners

Types

A3DTopoItemOwner

Type Aliases

void

A3DTopoItemOwnersManager

Functions

A3DStatus

A3DTopoItemOwnersManagerGet

A3DStatus

A3DTopoItemOwnersGet

Detailed Description

group a3d_tools_topoitemowners_module

Version

5.0

Type Alias Documentation

typedef void A3DTopoItemOwnersManager

Database used to store links between topology items and their owners.

Function Documentation

A3DStatus A3DTopoItemOwnersManagerGet(const A3DRiRepresentationItem *pBrepOwner, A3DTopoItemOwnersManager **ppTopoItemOwnersManager)

Structure for storing topology items owners.

Creates manager of topology items fron an A3DRiRepresentationItem

Version

5.0 Methods and structures dedicated to managing the link between topology items and their owner(s).

This function creates a map, on request, between topological items and linked lists of owners. When the map is built, the function A3DTopoItemOwnersGet lets you retrieve owners of specific topological item. For example, if you need the faces owner of edges, first you build your map, then you retrieve the owner list for each edge. The following code shows how to use it.

Version

5.0

// map creation
A3DTopoItemOwnersManager* pTopologyOwnersManager = NULL;
if(A3DTopoItemOwnersManagerGet(pBrepOwner, pTopologyOwnersManager) != A3D_SUCCESS)
    return A3D_ERROR;
if(pTopologyOwnersManager == NULL)
    return A3D_ERROR;

// edge owners = CoEdge
A3DTopoItemOwner* pOwningCoEdge = NULL;
A3DTopoItemOwnersGet(pTopologyOwnersManager, pEdge, pOwningCoEdge);
while( pOwningCoEdge!=NULL)
{
    // coedge owners = Loop
    A3DTopoItemOwner* pOwningLoop = NULL;
    A3DTopoItemOwnersGet(pTopologyOwnersManager, pOwningCoEdge->m_pTopoItem, pOwningLoop);
    while( pOwningLoop!=NULL)
    {
        // Loop owners = face
        A3DTopoItemOwner* pOwingFace = NULL;
        A3DTopoItemOwnersGet(pTopologyOwnersManager, pOwningLoop->m_pTopoItem, pOwingFace);
        while( pOwingFace!=NULL)
        {
            if(A3DEntityGetType(pOwingFace->m_pTopoItem, &entityType) != A3D_SUCCESS)
                return A3D_ERROR;
            if(entityType != kA3DTypeTopoFace)
                return A3D_ERROR;

            pOwingFace = pOwingFace->m_pNext;
        }
        pOwningLoop = pOwningLoop->m_pNext;
    }
    pOwningCoEdge = pOwningCoEdge->m_pNext;
}

Note that, if A3DTopoItemOwnersManagerGet is called several times with the same representation item, the map is not recomputed; and if the representation item is null, the map is released.

Return values
  • A3D_SUCCESS

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

Returns

A3D_SUCCESS in case of success or an error code

A3DStatus A3DTopoItemOwnersGet(A3DTopoItemOwnersManager *pTopoItemOwnersManager, const A3DTopoItem *pTopoItem, A3DTopoItemOwner **ppTopoItemOwner)

Gets owners of topology item.

Version

5.0

Return values
  • A3D_SUCCESS

  • A3D_INVALID_ENTITY_TYPE

  • A3D_ERROR

Returns

A3D_SUCCESS in case of success or an error code