[MOAB-dev] r2203 - MOAB/trunk/tools/iMesh

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Mon Nov 3 16:04:42 CST 2008


Author: kraftche
Date: 2008-11-03 16:04:42 -0600 (Mon, 03 Nov 2008)
New Revision: 2203

Modified:
   MOAB/trunk/tools/iMesh/iMesh.h
   MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
Log:
Add iMesh_isEntArrContained as proposed in ITAPS mailing list. (Adding it
now because I want to call it from elsewhere.)


Modified: MOAB/trunk/tools/iMesh/iMesh.h
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh.h	2008-11-03 19:59:36 UTC (rev 2202)
+++ MOAB/trunk/tools/iMesh/iMesh.h	2008-11-03 22:04:42 UTC (rev 2203)
@@ -904,6 +904,15 @@
                             /*in*/ const iBase_EntitySetHandle contained_entity,
                             /*out*/ int *is_contained,
                             /*out*/ int *err);
+                            
+  void iMesh_isEntArrContained( iMesh_Instance instance,
+                            /*in*/ iBase_EntitySetHandle containing_set,
+                            /*in*/ const iBase_EntitySetHandle* entity_handles,
+                            /*in*/ int num_entity_handles,
+                         /*inout*/ int** is_contained,
+                         /*inout*/ int* is_contained_allocated,
+                           /*out*/ int* is_contained_size,
+                           /*out*/ int* err );
 
     /**\brief  Return whether an entity set is contained in another set
      *

Modified: MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp
===================================================================
--- MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp	2008-11-03 19:59:36 UTC (rev 2202)
+++ MOAB/trunk/tools/iMesh/iMesh_MOAB.cpp	2008-11-03 22:04:42 UTC (rev 2203)
@@ -1302,6 +1302,28 @@
     RETURN(iBase_ERROR_MAP[result]);
   }
 
+  void iMesh_isEntArrContained( iMesh_Instance instance,
+                            /*in*/ iBase_EntitySetHandle containing_set,
+                            /*in*/ const iBase_EntitySetHandle* entity_handles,
+                            /*in*/ int num_entity_handles,
+                         /*inout*/ int** is_contained,
+                         /*inout*/ int* is_contained_allocated,
+                           /*out*/ int* is_contained_size,
+                           /*out*/ int* err )
+
+  {
+    MBEntityHandle set = ENTITY_HANDLE(containing_set);
+    CHECK_SIZE(*is_contained, *is_contained_allocated,
+               (int)num_entity_handles, int, iBase_MEMORY_ALLOCATION_FAILED);
+    *is_contained_size = num_entity_handles;
+    
+    for (int i = 0; i < num_entity_handles; ++i) {
+      MBEntityHandle h = ENTITY_HANDLE(entity_handles[i]);
+      (*is_contained)[i] = MBI->contains_entities( set, &h, 1 );
+    }
+    RETURN(iBase_SUCCESS);
+  }
+
   void iMesh_isEntSetContained (iMesh_Instance instance,
                                 /*in*/ const iBase_EntitySetHandle containing_entity_set,
                                 /*in*/ const iBase_EntitySetHandle contained_entity_set,




More information about the moab-dev mailing list