MOAB: Mesh Oriented datABase  (version 5.1.1)
Entity Sets
+ Collaboration diagram for Entity Sets:

Modules

 Entity Set Operators

Functions

void iMesh_getNumOfType (iMesh_Instance instance, const iBase_EntitySetHandle entity_set_handle, const int entity_type, int *num_type, int *err)
 Get the number of entities of specified type in the instance or set.
void iMesh_getNumOfTopo (iMesh_Instance instance, const iBase_EntitySetHandle entity_set_handle, const int entity_topology, int *num_topo, int *err)
 Get the number of entities of specified topology in instance or set.
void iMesh_createEntSet (iMesh_Instance instance, const int isList, iBase_EntitySetHandle *entity_set_created, int *err)
 Create an entity set.
void iMesh_destroyEntSet (iMesh_Instance instance, iBase_EntitySetHandle entity_set, int *err)
 Destroy an entity set.
void iMesh_isList (iMesh_Instance instance, const iBase_EntitySetHandle entity_set, int *is_list, int *err)
 Return whether a specified set is ordered or unordered.
void iMesh_getNumEntSets (iMesh_Instance instance, const iBase_EntitySetHandle entity_set_handle, const int num_hops, int *num_sets, int *err)
void iMesh_getEntSets (iMesh_Instance instance, const iBase_EntitySetHandle entity_set_handle, const int num_hops, iBase_EntitySetHandle **contained_set_handles, int *contained_set_handles_allocated, int *contained_set_handles_size, int *err)
void iMesh_addEntToSet (iMesh_Instance instance, iBase_EntityHandle entity_handle, iBase_EntitySetHandle entity_set, int *err)
 Add an entity to a set.
void iMesh_rmvEntFromSet (iMesh_Instance instance, iBase_EntityHandle entity_handle, iBase_EntitySetHandle entity_set, int *err)
 Remove an entity from a set.
void iMesh_addEntArrToSet (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_EntitySetHandle entity_set, int *err)
 Add an array of entities to a set.
void iMesh_rmvEntArrFromSet (iMesh_Instance instance, const iBase_EntityHandle *entity_handles, int entity_handles_size, iBase_EntitySetHandle entity_set, int *err)
 Remove an array of entities from a set.
void iMesh_addEntSet (iMesh_Instance instance, iBase_EntitySetHandle entity_set_to_add, iBase_EntitySetHandle entity_set_handle, int *err)
 Add an entity set to a set.
void iMesh_rmvEntSet (iMesh_Instance instance, iBase_EntitySetHandle entity_set_to_remove, iBase_EntitySetHandle entity_set_handle, int *err)
 Remove an entity set from a set.
void iMesh_isEntContained (iMesh_Instance instance, iBase_EntitySetHandle containing_entity_set, iBase_EntityHandle contained_entity, int *is_contained, int *err)
 Return whether an entity is contained in another set.
void iMesh_isEntArrContained (iMesh_Instance instance, iBase_EntitySetHandle containing_entity_set, const iBase_EntityHandle *entity_handles, int num_entity_handles, int **is_contained, int *is_contained_allocated, int *is_contained_size, int *err)
 Return whether entities are contained in a set.
void iMesh_isEntSetContained (iMesh_Instance instance, const iBase_EntitySetHandle containing_entity_set, const iBase_EntitySetHandle contained_entity_set, int *is_contained, int *err)
 Return whether an entity set is contained in another set.

Function Documentation

void iMesh_addEntArrToSet ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
int  entity_handles_size,
iBase_EntitySetHandle  entity_set,
int *  err 
)

Add an array of entities to a set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesArray of entities being added
[in]entity_handles_sizeNumber of entities in entity_handles array
[in]entity_setPointer to the set being added to
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1050 of file iMesh_MOAB.cpp.

References CHKERR, CONST_HANDLE_ARRAY_PTR, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    const EntityHandle *ents = CONST_HANDLE_ARRAY_PTR(entity_handles);
    ErrorCode result = MOABI->add_entities(ENTITY_HANDLE(entity_set),
                                           ents, entity_handles_size);

    CHKERR(result,"iMesh_addEntArrToSet:ERROR adding entities in EntitySet.");
    RETURN(iBase_SUCCESS);
  }
void iMesh_addEntSet ( iMesh_Instance  instance,
iBase_EntitySetHandle  entity_set_to_add,
iBase_EntitySetHandle  entity_set_handle,
int *  err 
)

Add an entity set to a set.

Add an entity set to a set (Cycles in Set-Inclusion and Parent-Child structures.)

Parameters:
[in]instanceiMesh instance handle
[in]entity_set_to_addThe entity set being added
[in]entity_set_handlePointer to the set being added to
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1093 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ARGUMENT, iBase_SUCCESS, MOABI, and RETURN.

  {
    if (!entity_set_to_add || !entity_set_handle)
      ERROR(iBase_INVALID_ARGUMENT, "iMesh_addEntSet: ERROR invalid argument");

    EntityHandle to_add = ENTITY_HANDLE(entity_set_to_add);
    ErrorCode result = MOABI->add_entities(ENTITY_HANDLE(entity_set_handle), &to_add, 1);

    CHKERR(result,"iMesh_addEntSet:ERROR adding entitysets.");
    RETURN(iBase_SUCCESS);
  }
void iMesh_addEntToSet ( iMesh_Instance  instance,
iBase_EntityHandle  entity_handle,
iBase_EntitySetHandle  entity_set,
int *  err 
)

Add an entity to a set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handleThe entity being added
[in]entity_setPointer to the set being added to
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1064 of file iMesh_MOAB.cpp.

References iMesh_addEntArrToSet.

  {
    iMesh_addEntArrToSet(instance, &entity_handle, 1, entity_set, err);
  }
void iMesh_createEntSet ( iMesh_Instance  instance,
const int  isList,
iBase_EntitySetHandle entity_set_created,
int *  err 
)

Create an entity set.

Create an entity set, either ordered (isList=1) or unordered (isList=0). Unordered entity sets can contain a given entity or set only once.

An entity set in iMesh supports managing its contained members in one of two modes. When an entitiy set is first created, the caller is required to indicate which mode of membership the set will support. The two modes that are supported are a) order-preserving (isList=1) or b) duplicate-preventing (isList=0).

For order-preserving membership, the implementation will permit duplicate entities. However, the implementation will guarantee that the order in which entities are added to the set will be the same as the order in which they are queried by the various methods that return the entities of a set. This order preserving guarantee holds across removals. However, it does not hold across removals followed by re-additions of the previously removed entities. This kind of an entity set behaves like an STL vector or STL list and is created by setting isList=1 when creating an entity set.

For duplicate-preventing membership, the implementation will guarantee that duplicate entities are prevented. Any attempts to add duplicate entities to such a set will be detected, prevented and silently ignored by the implementation. This kind of entity set behaves like an STL set and is created by setting isList=0 when creating an entity set.

Finally, all of the above comments apply only to entity members of an entity set and do not apply to the entity set members. Order-preserving and duplicate preventing behavior for entity set members is unspecified. Each implementation may behave differently for entity set members. This design was chosen because we could not identify any use cases where order-preserving behavior for set members was necessary. However, if users encounter situations where such behavior is desirable or necessary, then the ITAPS development team can certainly consider adjusting the interface specification to support it.

Parameters:
[in]instanceiMesh instance handle
[in]isListIf non-zero, an ordered list is created, otherwise an unordered set is created.
[out]entity_set_createdEntity set created by function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 974 of file iMesh_MOAB.cpp.

References CHKERR, iBase_SUCCESS, MESHSET_ORDERED, MESHSET_SET, MOABI, and RETURN.

  {
      // create the entity set
    EntityHandle meshset;
    ErrorCode result;

    if (isList)
      result = MOABI->create_meshset(MESHSET_ORDERED, meshset);
    else
      result = MOABI->create_meshset(MESHSET_SET, meshset);

    CHKERR(result,"iMesh_createEntSet: ERROR creating a entityset instance");

      // return EntitySet_Handle
    *entity_set_created = (iBase_EntitySetHandle)meshset;
    RETURN(iBase_SUCCESS);
  }
void iMesh_destroyEntSet ( iMesh_Instance  instance,
iBase_EntitySetHandle  entity_set,
int *  err 
)

Destroy an entity set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_setEntity set to be destroyed
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 994 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    EntityHandle set = ENTITY_HANDLE(entity_set);
    ErrorCode result = MOABI->delete_entities(&set, 1);
    CHKERR(result, "iMesh_destroyEntSet: couldn't delete the set.");

    RETURN(iBase_SUCCESS);
  }
void iMesh_getEntSets ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set_handle,
const int  num_hops,
iBase_EntitySetHandle **  contained_set_handles,
int *  contained_set_handles_allocated,
int *  contained_set_handles_size,
int *  err 
)

Get the entity sets contained in a set or interface.

Parameters:
[in]instanceiMesh instance handle
[in]entity_set_handleEntity set being queried
[in]num_hopsMaximum hops from entity_set_handle to contained set, not inclusive of the contained set Indirection in Set-Inclusion and Parent-Child structures)
[in,out]contained_set_handlesPointer to array of set handles returned Array pointer, allocated and occupied sizes argument trio)
[in,out]contained_set_handles_allocatedPointer to allocated length of
[out]contained_set_handles_sizePointer to occupied length of
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1031 of file iMesh_MOAB.cpp.

References ALLOC_CHECK_ARRAY_NOFAIL, CHKERR, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    std::vector<EntityHandle> sets;
    ErrorCode rval = MOABI->get_contained_meshsets( ENTITY_HANDLE(entity_set_handle),
                                                    sets,
                                                    std::max( num_hops+1, 0 ) );
    CHKERR(rval, "iMesh_entitysetGetEntitySets: problem getting entities by type.");
    ALLOC_CHECK_ARRAY_NOFAIL(contained_entset_handles, sets.size() );

    std::copy( sets.begin(), sets.end(), (EntityHandle*)*contained_entset_handles );
    *contained_entset_handles_size = sets.size();
    RETURN(iBase_SUCCESS);
  }
void iMesh_getNumEntSets ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set_handle,
const int  num_hops,
int *  num_sets,
int *  err 
)

Get the number of entity sets contained in a set or interface.

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

Definition at line 1018 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    ErrorCode rval = MOABI->num_contained_meshsets( ENTITY_HANDLE(entity_set_handle),
                                                    num_sets,
                                                    std::max(0,num_hops+1) );
    CHKERR(rval, "iMesh_entitysetGetNumberEntitySets:ERROR getting number of entitysets.");

    RETURN(iBase_SUCCESS);
  }
void iMesh_getNumOfTopo ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set_handle,
const int  entity_topology,
int *  num_topo,
int *  err 
)

Get the number of entities of specified topology in instance or set.

Get the number of entities with the specified topology in the instance or set. If entity set handle is root set, return information for instance, otherwise for set. Value of entity topology must be from the iMesh_EntityTopology enumeration. If iMesh_ALL_TOPOLOGIES is specified, total number of entities (excluding entity sets) is returned.

Parameters:
[in]instanceiMesh instance handle
[in]entity_set_handleEntity set being queried
[in]entity_topologyTopology of entity requested
[out]num_topoPointer to number of entities, returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 451 of file iMesh_MOAB.cpp.

References iMesh_getNumOfTopoRec.

  {
    iMesh_getNumOfTopoRec(instance, entity_set_handle, entity_topology,
                          false, num_topo, err);
  }
void iMesh_getNumOfType ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set_handle,
const int  entity_type,
int *  num_type,
int *  err 
)

Get the number of entities of specified type in the instance or set.

Get the number of entities with the specified type in the instance or set. If entity set handle is root set, return information for instance, otherwise for set. Value of entity type must be from the iBase_EntityType enumeration. If iBase_ALL_TYPES is specified, total number of entities (excluding entity sets) is returned.

Parameters:
[in]instanceiMesh instance handle
[in]entity_set_handleEntity set being queried
[in]entity_typeType of entity requested
[out]num_typePointer to number of entities, returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 442 of file iMesh_MOAB.cpp.

References iMesh_getNumOfTypeRec.

  {
    iMesh_getNumOfTypeRec(instance, entity_set_handle, entity_type, false,
                          num_type, err);
  }
void iMesh_isEntArrContained ( iMesh_Instance  instance,
iBase_EntitySetHandle  containing_entity_set,
const iBase_EntityHandle entity_handles,
int  num_entity_handles,
int **  is_contained,
int *  is_contained_allocated,
int *  is_contained_size,
int *  err 
)

Return whether entities are contained in a set.

Parameters:
[in]instanceiMesh instance handle
[in]containing_entity_setEntity set being queried
[in]entity_handlesList of entities for which to check containment.
[in]num_entity_handlesSize of entity_handles array of entities to be checked.
[in,out]is_containedOne value for each input entity, 1 if contained in set, zero otherwise. Array pointer, allocated and occupied sizes argument trio)
[in,out]is_contained_allocatedAllocated size of is_contained array
[out]is_contained_sizeOccupied size of is_contained array
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1135 of file iMesh_MOAB.cpp.

References ALLOC_CHECK_ARRAY_NOFAIL, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    EntityHandle set = ENTITY_HANDLE(containing_set);
    ALLOC_CHECK_ARRAY_NOFAIL(is_contained, num_entity_handles);
    *is_contained_size = num_entity_handles;

    if (containing_set) {
      for (int i = 0; i < num_entity_handles; ++i) {
        EntityHandle h = ENTITY_HANDLE(entity_handles[i]);
        (*is_contained)[i] = MOABI->contains_entities( set, &h, 1 );
      }
    }
    else {
      std::fill( *is_contained, (*is_contained)+num_entity_handles, 1 );
    }
    RETURN(iBase_SUCCESS);
  }
void iMesh_isEntContained ( iMesh_Instance  instance,
iBase_EntitySetHandle  containing_entity_set,
iBase_EntityHandle  contained_entity,
int *  is_contained,
int *  err 
)

Return whether an entity is contained in another set.

Return whether an entity is contained (*is_contained=1) or not contained (*is_contained=0) in another set

Parameters:
[in]instanceiMesh instance handle
[in]containing_entity_setEntity set being queried
[in]contained_entityEntity potentially contained in containing_entity_set
[out]is_containedPointer to flag returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1124 of file iMesh_MOAB.cpp.

References iMesh_isEntArrContained.

  {
    int junk1 = 1, junk2 = 1;
    iMesh_isEntArrContained( instance, containing_entity_set,
                             &contained_entity, 1, &is_contained,
                             &junk1, &junk2, err );
  }
void iMesh_isEntSetContained ( iMesh_Instance  instance,
const iBase_EntitySetHandle  containing_entity_set,
const iBase_EntitySetHandle  contained_entity_set,
int *  is_contained,
int *  err 
)

Return whether an entity set is contained in another set.

Return whether a set is contained (*is_contained=1) or not contained (*is_contained=0) in another set

Parameters:
[in]instanceiMesh instance handle
[in]containing_entity_setEntity set being queried
[in]contained_entity_setEntity set potentially contained in containing_entity_set
[out]is_containedPointer to flag returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1161 of file iMesh_MOAB.cpp.

References iMesh_isEntContained.

  {
    iMesh_isEntContained(instance, containing_entity_set,
                         reinterpret_cast<iBase_EntityHandle>(contained_entity_set),
                         is_contained, err);
  }
void iMesh_isList ( iMesh_Instance  instance,
const iBase_EntitySetHandle  entity_set,
int *  is_list,
int *  err 
)

Return whether a specified set is ordered or unordered.

Return whether a specified set is ordered (*is_list=1) or unordered (*is_list=0)

Parameters:
[in]instanceiMesh instance handle
[in]entity_setEntity set being queried
[out]is_listPointer to flag returned from function
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1004 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, iBase_SUCCESS, MESHSET_ORDERED, MOABI, and RETURN.

  {
    unsigned int options;
    ErrorCode result = MOABI->get_meshset_options(ENTITY_HANDLE(entity_set), options);
    CHKERR(result,"iMesh_isList: couldn't query set.");
    if (options & MESHSET_ORDERED)
      *is_list = true;
    else *is_list = false;

    RETURN(iBase_SUCCESS);
  }
void iMesh_rmvEntArrFromSet ( iMesh_Instance  instance,
const iBase_EntityHandle entity_handles,
int  entity_handles_size,
iBase_EntitySetHandle  entity_set,
int *  err 
)

Remove an array of entities from a set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handlesArray of entities being remove
[in]entity_handles_sizeNumber of entities in entity_handles array
[in]entity_setPointer to the set being removed from
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1071 of file iMesh_MOAB.cpp.

References CHKERR, CONST_HANDLE_ARRAY_PTR, ENTITY_HANDLE, iBase_SUCCESS, MOABI, and RETURN.

  {
    const EntityHandle *ents = CONST_HANDLE_ARRAY_PTR(entity_handles);

    ErrorCode result = MOABI->remove_entities
      (ENTITY_HANDLE(entity_set), ents, entity_handles_size);

    CHKERR(result,"iMesh_rmvEntArrFromSet:ERROR removing entities in EntitySet.");
    RETURN(iBase_SUCCESS);
  }
void iMesh_rmvEntFromSet ( iMesh_Instance  instance,
iBase_EntityHandle  entity_handle,
iBase_EntitySetHandle  entity_set,
int *  err 
)

Remove an entity from a set.

Parameters:
[in]instanceiMesh instance handle
[in]entity_handleThe entity being removed
[in]entity_setPointer to the set being removed from
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1085 of file iMesh_MOAB.cpp.

References iMesh_rmvEntArrFromSet.

  {
    iMesh_rmvEntArrFromSet(instance, &entity_handle, 1, entity_set, err);
  }
void iMesh_rmvEntSet ( iMesh_Instance  instance,
iBase_EntitySetHandle  entity_set_to_remove,
iBase_EntitySetHandle  entity_set_handle,
int *  err 
)

Remove an entity set from a set.

Remove an entity set from a set

Parameters:
[in]instanceiMesh instance handle
[in]entity_set_to_removeThe entity set being removed
[in]entity_set_handlePointer to the set being removed from
[out]errReturned Error status (see iBase_ErrorType)

Definition at line 1108 of file iMesh_MOAB.cpp.

References CHKERR, ENTITY_HANDLE, ERROR, iBase_INVALID_ARGUMENT, iBase_SUCCESS, MOABI, and RETURN.

  {
    if (!entity_set_to_remove || !entity_set_handle)
      ERROR(iBase_INVALID_ARGUMENT, "iMesh_rmvEntSet: ERROR invalid argument");

    EntityHandle to_remove = ENTITY_HANDLE(entity_set_to_remove);
    ErrorCode result = MOABI->remove_entities
      (ENTITY_HANDLE(entity_set_handle), &to_remove, 1);

    CHKERR(result,"iMesh_rmvEntSet:ERROR removing entitysets in EntitySet.");
    RETURN(iBase_SUCCESS);
  }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines