
###########################
A3DTopoItemOwnersManagerGet
###########################

.. c:function:: A3DStatus A3DTopoItemOwnersManagerGet(const A3DRiRepresentationItem *pBrepOwner, A3DTopoItemOwnersManager **ppTopoItemOwnersManager)

   .. rst-class:: sig-pretty-signature
   
      | :c:enum:`~A3DStatus` A3DTopoItemOwnersManagerGet(*const* :c:type:`~A3DRiRepresentationItem`\ \* **pBrepOwner**\ , :c:type:`~A3DTopoItemOwnersManager`\ \*\* **ppTopoItemOwnersManager**\ )
   
   Structure for storing topology items owners.
   
   
      5.0 Methods and structures dedicated to managing the link between topology items and their owner(s).
   
   
   Creates manager of topology items fron an :c:type:`~A3DRiRepresentationItem`
   
   
      5.0
   
   
   This function creates a map, on request, between topological items and linked lists of owners. When the map is built, the function :c:func:`~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.
   
   .. code-block:: c
   
      // map creation
      A3DTopoItemOwnersManager* pTopologyOwnersManager = A3D_NULL_HANDLE;
      if(A3DTopoItemOwnersManagerGet(pBrepOwner, pTopologyOwnersManager) != A3D_SUCCESS)
          return A3D_ERROR;
      if(pTopologyOwnersManager == A3D_NULL_HANDLE)
          return A3D_ERROR;
      
      // edge owners = CoEdge
      A3DTopoItemOwner* pOwningCoEdge = A3D_NULL_HANDLE;
      A3DTopoItemOwnersGet(pTopologyOwnersManager, pEdge, pOwningCoEdge);
      while( pOwningCoEdge!=A3D_NULL_HANDLE)
      {
          // coedge owners = Loop
          A3DTopoItemOwner* pOwningLoop = A3D_NULL_HANDLE;
          A3DTopoItemOwnersGet(pTopologyOwnersManager, pOwningCoEdge->m_pTopoItem, pOwningLoop);
          while( pOwningLoop!=A3D_NULL_HANDLE)
          {
              // Loop owners = face
              A3DTopoItemOwner* pOwingFace = A3D_NULL_HANDLE;
              A3DTopoItemOwnersGet(pTopologyOwnersManager, pOwningLoop->m_pTopoItem, pOwingFace);
              while( pOwingFace!=A3D_NULL_HANDLE)
              {
                  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 A3D_NULL_HANDLE, the map is released.
   
   **Return Values**
   
   
      **A3D_SUCCESS**\ :
   
      **A3D_INVALID_ENTITY_TYPE**\ :
   
      **A3D_ERROR**\ :
   
   
   **Returns**
   
   
      ``A3D_SUCCESS`` on success, or an error code on failure
   
   




