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

janehu at mcs.anl.gov janehu at mcs.anl.gov
Wed Nov 26 17:36:07 CST 2008


Author: janehu
Date: 2008-11-26 17:36:07 -0600 (Wed, 26 Nov 2008)
New Revision: 2290

Modified:
   cgm/trunk/geom/OCC/OCCLump.cpp
   cgm/trunk/geom/OCC/OCCSurface.cpp
Log:
Partitially fixed the hollow operation to left free-entities after deletion problem, now there's still one coedge extra there.

Modified: cgm/trunk/geom/OCC/OCCLump.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCLump.cpp	2008-11-26 19:22:03 UTC (rev 2289)
+++ cgm/trunk/geom/OCC/OCCLump.cpp	2008-11-26 23:36:07 UTC (rev 2290)
@@ -412,7 +412,7 @@
 {
   //set the Shells
   TopTools_IndexedMapOfShape M;
-  TopoDS_Shape shape;
+  TopoDS_Shape shape, shape2;
   TopExp::MapShapes(new_shape, TopAbs_SOLID,M);
   TopoDS_Solid new_solid;
   if(M.Extent() > 1)
@@ -436,17 +436,29 @@
     TopoDS_Shell shell = TopoDS::Shell(M(ii));
 
     TopTools_ListOfShape shapes;
+    TopTools_IndexedMapOfShape M2;
     if (op)
     {
       shapes.Assign(op->Modified(shell));
       if(shapes.Extent() == 0)
          shapes.Assign(op->Generated(shell));
+      // bug fix for hollow operation, in which a new shell is genearted
+      // but the shapes we get from old_shell->Generated() is still old_shell
+      // not the new one.
+      if(!new_solid.IsNull())  
+         TopExp::MapShapes(new_solid, TopAbs_SHELL, M2);
     }
     else if(sp)
       shapes.Assign(sp->DescendantShapes(shell));
 
     if (shapes.Extent() == 1)
-      shape = shapes.First();
+    {
+      shape = shapes.First(); 
+      if(M2.Extent() > 0)
+        shape2 = TopoDS::Shell(M2(1)); 
+      if(M2.Extent() == 1 && !shape.IsSame(shape2))
+         shape = shape2;
+    }
 
     else if(shapes.Extent() > 1)
     {

Modified: cgm/trunk/geom/OCC/OCCSurface.cpp
===================================================================
--- cgm/trunk/geom/OCC/OCCSurface.cpp	2008-11-26 19:22:03 UTC (rev 2289)
+++ cgm/trunk/geom/OCC/OCCSurface.cpp	2008-11-26 23:36:07 UTC (rev 2290)
@@ -849,8 +849,8 @@
                                           LocOpe_SplitShape* sp) 
 {
   //set the Wires
-  TopTools_IndexedMapOfShape M;
-  TopoDS_Shape shape, shape_edge, shape_vertex;
+  TopTools_IndexedMapOfShape M, M2;
+  TopoDS_Shape shape, shape2, shape_edge, shape_vertex;
   TopExp::MapShapes(old_surface, TopAbs_WIRE, M);
 
   TopTools_ListOfShape shapes;  
@@ -864,12 +864,22 @@
        shapes.Assign(op->Modified(wire));
        if(shapes.Extent() == 0)
          shapes.Assign(op->Generated(wire));
+       if(!new_surface.IsNull())
+       TopExp::MapShapes(new_surface,TopAbs_WIRE, M2);
      }
      else if(sp)
        shapes.Assign(sp->DescendantShapes(wire));
 
      if (shapes.Extent() == 1)
+     {
        shape = shapes.First();
+       if(M2.Extent() == 1)
+       {
+         shape2 = TopoDS::Wire(M2(1));
+         if(!shape.IsSame(shape2))
+           shape = shape2;
+       }
+     }
      else if(shapes.Extent() > 1)
        shape.Nullify();
      else if(op->IsDeleted(wire))




More information about the cgma-dev mailing list