MOAB: Mesh Oriented datABase  (version 5.1.1)
Parent Child Links
+ Collaboration diagram for Parent Child Links:

Functions

void iMesh_addPrntChld (iMesh_Instance instance, iBase_EntitySetHandle parent_entity_set, iBase_EntitySetHandle child_entity_set, int *err)
 Add parent/child links between two sets.
void iMesh_rmvPrntChld (iMesh_Instance instance, iBase_EntitySetHandle parent_entity_set, iBase_EntitySetHandle child_entity_set, int *err)
void iMesh_isChildOf (iMesh_Instance instance, const iBase_EntitySetHandle parent_entity_set, const iBase_EntitySetHandle child_entity_set, int *is_child, int *err)
 Return whether two sets are related by parent/child links.
void iMesh_getNumChld (iMesh_Instance instance, const iBase_EntitySetHandle entity_set, const int num_hops, int *num_child, int *err)
void iMesh_getNumPrnt (iMesh_Instance instance, const iBase_EntitySetHandle entity_set, const int num_hops, int *num_parent, int *err)
void iMesh_getChldn (iMesh_Instance instance, const iBase_EntitySetHandle from_entity_set, const int num_hops, iBase_EntitySetHandle **entity_set_handles, int *entity_set_handles_allocated, int *entity_set_handles_size, int *err)
void iMesh_getPrnts (iMesh_Instance instance, const iBase_EntitySetHandle from_entity_set, const int num_hops, iBase_EntitySetHandle **entity_set_handles, int *entity_set_handles_allocated, int *entity_set_handles_size, int *err)

Function Documentation

void iMesh_addPrntChld ( iMesh_Instance  instance,
iBase_EntitySetHandle  parent_entity_set,
iBase_EntitySetHandle  child_entity_set,
int *  err 
)

Add parent/child links between two sets.

Add parent/child links between two sets. Makes parent point to child and child point to parent. (Cycles in Set-Inclusion and Parent-Child structures.)

Parameters:
[in]instanceiMesh instance handle
[in]parent_entity_setPointer to parent set
[in]child_entity_setPointer to child set
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1171 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    ErrorCode result = MOABI->add_parent_child
      (ENTITY_HANDLE(parent_entity_set),
       ENTITY_HANDLE(child_entity_set));

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_addPrntChld: ERROR invalid entity set.");
    CHKERR(result, "iMesh_addPrntChld: ERROR addParentChild failed.");
    RETURN(iBase_SUCCESS);
  }
void iMesh_getChldn ( iMesh_Instance  instance,
const iBase_EntitySetHandle  from_entity_set,
const int  num_hops,
iBase_EntitySetHandle **  entity_set_handles,
int *  entity_set_handles_allocated,
int *  entity_set_handles_size,
int *  err 
)

Get the child sets linked from a specified set.

Parameters:
[in]instanceiMesh instance handle
[in]from_entity_setEntity set being queried
[in]num_hopsMaximum hops from entity_set_handle to child set, Indirection in Set-Inclusion and Parent-Child structures)
[in,out]entity_set_handlesPointer to array of child sets Array pointer, allocated and occupied sizes argument trio)
[in,out]entity_set_handles_allocatedPointer to allocated size of
[out]entity_set_handles_sizePointer to occupied size of
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1265 of file iMesh_MOAB.cpp.

References ALLOC_CHECK_ARRAY_NOFAIL, children, CHKERR, ENTITY_HANDLE, ERROR, HANDLE_ARRAY_PTR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    std::vector<EntityHandle> children;

    ErrorCode result = MOABI->get_child_meshsets
      (ENTITY_HANDLE(from_entity_set), children, num_hops+1);

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_getChldn: ERROR invalid entity set.");
    CHKERR(result,"ERROR getChildren failed.");
    ALLOC_CHECK_ARRAY_NOFAIL(entity_set_handles, children.size());

    EntityHandle *ents = HANDLE_ARRAY_PTR(*entity_set_handles);
      // use a memcpy for efficiency
    memcpy(ents, &children[0], children.size()*sizeof(EntityHandle));

    RETURN(iBase_SUCCESS);
  }
void iMesh_getNumChld ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set,
const int  num_hops,
int *  num_child,
int *  err 
)

Get the number of child sets linked from a specified set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_setEntity set being queried
[in]num_hopsMaximum hops from entity_set_handle to child set, not inclusive of the child set. Indirection in Set-Inclusion and Parent-Child structures)
[out]num_childPointer to number of children returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1232 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    *num_child = 0;
    ErrorCode result = MOABI->num_child_meshsets
      (ENTITY_HANDLE(entity_set), num_child, num_hops+1);

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_getNumChld: ERROR invalid entity set.");
    CHKERR(result,"iMesh_getNumChld: ERROR GetNumChildren failed.");

    RETURN(iBase_SUCCESS);
  }
void iMesh_getNumPrnt ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set,
const int  num_hops,
int *  num_parent,
int *  err 
)

Get the number of parent sets linked from a specified set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_setEntity set being queried
[in]num_hopsMaximum hops from entity_set_handle to parent set, not inclusive of the parent set. Indirection in Set-Inclusion and Parent-Child structures)
[out]num_parentPointer to number of parents returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1249 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    *num_parent = 0;
    ErrorCode result = MOABI->num_parent_meshsets
      (ENTITY_HANDLE(entity_set), num_parent, num_hops+1);

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_getNumPrnt: ERROR invalid entity set.");
    CHKERR(result,"iMesh_getNumPrnt: ERROR GetNumParents failed.");
    RETURN(iBase_SUCCESS);
  }
void iMesh_getPrnts ( iMesh_Instance  instance,
const iBase_EntitySetHandle  from_entity_set,
const int  num_hops,
iBase_EntitySetHandle **  entity_set_handles,
int *  entity_set_handles_allocated,
int *  entity_set_handles_size,
int *  err 
)

Get the parent sets linked from a specified set.

Parameters:
[in]instanceiMesh instance handle
[in]from_entity_setEntity set being queried
[in]num_hopsMaximum hops from entity_set_handle to parent set, Indirection in Set-Inclusion and Parent-Child structures)
[in,out]entity_set_handlesPointer to array of parent sets Array pointer, allocated and occupied sizes argument trio)
[in,out]entity_set_handles_allocatedPointer to allocated size of
[out]entity_set_handles_sizePointer to occupied size of
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1290 of file iMesh_MOAB.cpp.

References ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ENTITY_HANDLE, ERROR, HANDLE_ARRAY_PTR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    std::vector<EntityHandle> parents;

    ErrorCode result = MOABI->get_parent_meshsets
      (ENTITY_HANDLE(from_entity_set), parents, num_hops+1);

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_getPrnts: ERROR invalid entity set.");
    CHKERR(result,"ERROR getParents failed.");

    ALLOC_CHECK_ARRAY_NOFAIL(entity_set_handles, parents.size());

    EntityHandle *ents = HANDLE_ARRAY_PTR(*entity_set_handles);
      // use a memcpy for efficiency
    memcpy(ents, &parents[0], parents.size()*sizeof(EntityHandle));

    RETURN(iBase_SUCCESS);
  }
void iMesh_isChildOf ( iMesh_Instance  instance,
const iBase_EntitySetHandle  parent_entity_set,
const iBase_EntitySetHandle  child_entity_set,
int *  is_child,
int *  err 
)

Return whether two sets are related by parent/child links.

Return whether two sets are related (*is_child=1) or not (*is_child=0) by parent/child links

Parameters:
[in]instanceiMesh instance handle
[in]parent_entity_setPointer to parent set
[in]child_entity_setPointer to child set
[out]is_childPointer to flag returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1203 of file iMesh_MOAB.cpp.

References children, CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    if (!child_entity_set)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_isChildOf: ERROR invalid entity set.");

    std::vector<EntityHandle> children;

    ErrorCode result = MOABI->get_child_meshsets
      (ENTITY_HANDLE(parent_entity_set), children);

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_rmvPrntChld: ERROR invalid entity set.");
    CHKERR(result,"iMesh_isChildOf: ERROR IsParentChildRelated failed.");

    if (std::find(children.begin(), children.end(), ENTITY_HANDLE(child_entity_set))
        != children.end())
      *is_child = true;

    else
      *is_child = false;

    RETURN(iBase_SUCCESS);
  }
void iMesh_rmvPrntChld ( iMesh_Instance  instance,
iBase_EntitySetHandle  parent_entity_set,
iBase_EntitySetHandle  child_entity_set,
int *  err 
)

Remove parent/child links between two sets.

Parameters:
[in]instanceiMesh instance handle
[in]parent_entity_setPointer to parent set
[in]child_entity_setPointer to child set
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1187 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ENTITYSET_HANDLE, iBase_SUCCESS, MB_ENTITY_NOT_FOUND, MOABI, and RETURN.

  {
    ErrorCode result = MOABI->remove_parent_child
      (ENTITY_HANDLE(parent_entity_set),
       ENTITY_HANDLE(child_entity_set));

    if (result == MB_ENTITY_NOT_FOUND)
      ERROR(iBase_INVALID_ENTITYSET_HANDLE,
            "iMesh_rmvPrntChld: ERROR invalid entity set.");
    CHKERR(result,"iMesh_rmvPrntChld: ERROR RemoveParentChild failed.");
    RETURN(iBase_SUCCESS);
  }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines