[MOAB-dev] r5290 - in MOAB/trunk: src src/moab test

iulian at mcs.anl.gov iulian at mcs.anl.gov
Fri Jan 6 11:58:53 CST 2012


Author: iulian
Date: 2012-01-06 11:58:53 -0600 (Fri, 06 Jan 2012)
New Revision: 5290

Modified:
   MOAB/trunk/src/GeomTopoTool.cpp
   MOAB/trunk/src/moab/GeomTopoTool.hpp
   MOAB/trunk/test/crop_vol_test.cpp
   MOAB/trunk/test/mbfacet_test.cpp
Log:
the duplicate_model in GTT will accept as input a vector of parent gents, 
not only one (or none)


Modified: MOAB/trunk/src/GeomTopoTool.cpp
===================================================================
--- MOAB/trunk/src/GeomTopoTool.cpp	2012-01-06 15:26:29 UTC (rev 5289)
+++ MOAB/trunk/src/GeomTopoTool.cpp	2012-01-06 17:58:53 UTC (rev 5290)
@@ -1120,7 +1120,7 @@
 
 
 /*
- *  This would create a deep copy, into a new geom topo tool
+ *  This would create a deep copy of the geom topo model, into a new geom topo tool
  * sets will be duplicated, but entities not
  * modelSet will be a new one
  * if the original set was null (root), a new model set will be created for
@@ -1135,7 +1135,7 @@
  *   the right size.
  *
  */
-ErrorCode GeomTopoTool::duplicate_model(GeomTopoTool *& duplicate, EntityHandle geomSet)
+ErrorCode GeomTopoTool::duplicate_model(GeomTopoTool *& duplicate, std::vector<EntityHandle> * pvGEnts)
 {
   // will
   EntityHandle rootModelSet;
@@ -1156,13 +1156,20 @@
   Range depSets;// dependents of the geomSet, including the geomSet
   // add in this range all the dependents of this, to filter the ones that need to be deep copied
 
-  if (geomSet)
+  if (pvGEnts!=NULL)
   {
-    rval = mdbImpl->get_child_meshsets(geomSet, depSets, 0); // 0 for numHops means that all
-    // dependents are returned, not only the direct children.
-    if (MB_SUCCESS != rval)
-      return rval;
-    depSets.insert(geomSet);
+    unsigned int numGents = pvGEnts->size();
+    for (unsigned int k = 0; k<numGents; k++)
+    {
+      EntityHandle geomSet=(*pvGEnts)[k];
+      // will keep accumulating to the depSets range
+      rval = mdbImpl->get_child_meshsets(geomSet, depSets, 0); // 0 for numHops means that all
+      // dependents are returned, not only the direct children.
+      if (MB_SUCCESS != rval)
+        return rval;
+      depSets.insert(geomSet);
+    }
+
   }
 
   // add to the root model set copies of the gsets, with correct sets
@@ -1176,7 +1183,7 @@
     for (Range::iterator it=geomRanges[dim].begin(); it!=geomRanges[dim].end(); it++)


More information about the moab-dev mailing list