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

janehu at mcs.anl.gov janehu at mcs.anl.gov
Mon Apr 14 13:18:46 CDT 2008


Author: janehu
Date: 2008-04-14 13:18:46 -0500 (Mon, 14 Apr 2008)
New Revision: 1762

Modified:
   cgm/trunk/geom/OCC/OCCBody.cpp
   cgm/trunk/geom/OCC/OCCCurve.cpp
   cgm/trunk/geom/OCC/OCCLoop.cpp
   cgm/trunk/geom/OCC/OCCLump.cpp
   cgm/trunk/geom/OCC/OCCModifyEngine.cpp
   cgm/trunk/geom/OCC/OCCPoint.cpp
   cgm/trunk/geom/OCC/OCCShell.cpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
Log:
Added for update_OCC_entity for boolean operation, now stitch_surfs makes simple sheet-face bodies into a shell body, so update needs to walk one level higher, working on it.

Modified: cgm/trunk/geom/OCC/OCCBody.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCBody.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCBody.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -348,7 +348,7 @@
      lump->update_OCC_entity(aBRepTrsf, op);
   }
 
-  if (aBRepTrsf)
+  if (aBRepTrsf && !compsolid.IsNull())
     set_TopoDS_Shape(compsolid);
 
   update_bounding_box(); 

Modified: cgm/trunk/geom/OCC/OCCCurve.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCCurve.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCCurve.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -915,7 +915,10 @@
   {
     TopTools_ListOfShape shapes;
     shapes.Assign(op->Modified(*get_TopoDS_Edge()));
-    shape = shapes.First();
+    if(shapes.Extent())
+      shape = shapes.First();
+    else
+      return ;
   }
   TopoDS_Edge curve = TopoDS::Edge(shape);
 

Modified: cgm/trunk/geom/OCC/OCCLoop.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLoop.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCLoop.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -233,7 +233,10 @@
   {
     TopTools_ListOfShape shapes; 
     shapes.Assign(op->Modified(*get_TopoDS_Wire()));
-    shape = shapes.First();
+    if(shapes.Extent())
+      shape = shapes.First();
+    else
+      return CUBIT_SUCCESS;
   }
   TopoDS_Wire loop = TopoDS::Wire(shape);
 

Modified: cgm/trunk/geom/OCC/OCCLump.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLump.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCLump.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -310,7 +310,10 @@
   {
     TopTools_ListOfShape shapes;
     shapes.Assign(op->Modified(*get_TopoDS_Solid()));
-    shape = shapes.First();
+    if(shapes.Extent() > 0)
+      shape = shapes.First();
+    else
+      return CUBIT_SUCCESS;
   }
   TopoDS_Solid solid = TopoDS::Solid(shape);
 

Modified: cgm/trunk/geom/OCC/OCCModifyEngine.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCModifyEngine.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -1542,7 +1542,7 @@
      BRepAlgoAPI_Fuse fuser(*second_face, *first_face);
      fuse = fuser.Shape();
      first_face = &fuse;
-     CAST_TO(surf_bodies[i], OCCBody)->my_sheet_surface()->update_OCC_entity(NULL, &fuser);      
+     CAST_TO(surf_bodies[i], OCCBody)->my_sheet_surface()->my_shell()->update_OCC_entity(NULL, &fuser);      
   }
 
   TopExp_Explorer Ex;

Modified: cgm/trunk/geom/OCC/OCCPoint.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCPoint.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCPoint.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -274,7 +274,10 @@
   {
     TopTools_ListOfShape shapes;
     shapes.Assign(op->Modified(*get_TopoDS_Vertex()));
-    shape = shapes.First();
+    if(shapes.Extent())
+      shape = shapes.First();
+    else
+      return ;
   }
   TopoDS_Vertex vertex = TopoDS::Vertex(shape);
 

Modified: cgm/trunk/geom/OCC/OCCShell.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCShell.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCShell.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -181,7 +181,10 @@
   {
     TopTools_ListOfShape shapes;
     shapes.Assign(op->Modified(*get_TopoDS_Shell()));
-    shape = shapes.First();
+    if (shapes.Extent())
+      shape = shapes.First();
+    else
+      return CUBIT_SUCCESS;
   } 
   TopoDS_Shell shell = TopoDS::Shell(shape);
 

Modified: cgm/trunk/geom/OCC/OCCSurface.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCSurface.cpp	2008-04-11 19:47:30 UTC (rev 1761)
+++ cgm/trunk/geom/OCC/OCCSurface.cpp	2008-04-14 18:18:46 UTC (rev 1762)
@@ -783,16 +783,14 @@
     if (shapes.Extent() > 0)
       shape = shapes.First();
     else
-      need_update = CUBIT_FALSE;
+      return CUBIT_SUCCESS;
   }
  
   TopoDS_Face surface; 
-  if(need_update)
-  {
-    surface = TopoDS::Face(shape);
+  surface = TopoDS::Face(shape);
 
-    OCCQueryEngine::instance()->update_OCC_map(*myTopoDSFace, surface);
-  }
+  OCCQueryEngine::instance()->update_OCC_map(*myTopoDSFace, surface);
+
   //set the loops
   DLIList<OCCLoop *> loops;
   this->get_loops(loops);
@@ -801,8 +799,7 @@
      OCCLoop *loop = loops.get_and_step();
      loop->update_OCC_entity(aBRepTrsf, op);
   }
-  if (need_update)
-    set_TopoDS_Face(surface);
+  set_TopoDS_Face(surface);
 
   return CUBIT_SUCCESS;
 }




More information about the cgma-dev mailing list