[cgma-dev] r6071 - cgm/trunk/geom/OCC

janehu at mcs.anl.gov janehu at mcs.anl.gov
Mon Oct 7 11:12:58 CDT 2013


Author: janehu
Date: 2013-10-07 11:12:57 -0500 (Mon, 07 Oct 2013)
New Revision: 6071

Modified:
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCQueryEngine.cpp
Log:
Fixed multi-volume body's boolean operation problem exposed through new testcase spheres, passed make check for both occ and cubit build.

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2013-09-12 15:40:11 UTC (rev 6070)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2013-10-07 16:12:57 UTC (rev 6071)
@@ -6294,12 +6294,6 @@
     return rsl;
   }
 
-  else if(lumps.size() + shells.size() + surfaces.size() > 1)
-  {
-    PRINT_ERROR("Can't webcut with multi-volume-shell-surface body.\n");
-    return CUBIT_FAILURE;
-  }
-
   stat = intersect(body, webcut_body_list, results_list,
                                CUBIT_TRUE);
  
@@ -6671,6 +6665,9 @@
     Lump* lump = lumps.get_and_step();
     OCCLump* occ_lump = CAST_TO(lump, OCCLump);
     OCCSurface* occ_surface = occ_lump->my_sheet_surface();
+    //first delete the body which bounds all the stuff.
+    if (i == 0)
+      OCCQueryEngine::instance()->unhook_BodySM_from_OCC(body_ptr, CUBIT_FALSE);
     if(occ_surface) 
     {
       TopoDS_Face* face = occ_surface->get_TopoDS_Face();
@@ -6700,6 +6697,9 @@
       continue;
     }
   }
+  
+  if(lumps.size() > 1)
+    delete body_ptr;
   return CUBIT_SUCCESS;
 }
 

Modified: cgm/trunk/geom/OCC/OCCQueryEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2013-09-12 15:40:11 UTC (rev 6070)
+++ cgm/trunk/geom/OCC/OCCQueryEngine.cpp	2013-10-07 16:12:57 UTC (rev 6071)
@@ -1871,7 +1871,18 @@
     int k = OCCMap->Find(aShape);
     lump = (OCCLump*)(OccToCGM->find(k))->second;
     lump->set_TopoDS_Solid(aShape);
-    body = CAST_TO(lump->get_body(), OCCBody);
+    body = static_cast<OCCBody*>(lump->get_body());
+    TopoDS_Shape *b_shape = NULL;
+    if(body)
+      body->get_TopoDS_Shape(b_shape);


More information about the cgma-dev mailing list