]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Mantis issue 0020859: Partition operation fails on first try.
authorjfa <jfa@opencascade.com>
Wed, 12 May 2010 11:32:41 +0000 (11:32 +0000)
committerjfa <jfa@opencascade.com>
Wed, 12 May 2010 11:32:41 +0000 (11:32 +0000)
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx

index e6ff34fea83afac55a7c23b58041841e046fdd71..0766ea2ef1669ddc2007977bef1e7d610714742f 100644 (file)
@@ -35,6 +35,7 @@
 
 #include <TDataStd_IntegerArray.hxx>
 
+#include <BRepBuilderAPI_Copy.hxx>
 #include <BRep_Tool.hxx>
 #include <BRepAlgo.hxx>
 
@@ -141,6 +142,12 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise("In Partition a shape is null");
       }
       //
+      BRepBuilderAPI_Copy aCopyTool (aShape_i);
+      if (aCopyTool.IsDone())
+        aShape_i = aCopyTool.Shape();
+      else
+        Standard_NullObject::Raise("Bad shape detected");
+      //
       TopTools_ListOfShape aSimpleShapes;
       PrepareShapes(aShape_i, aType, aSimpleShapes);
       TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes);
@@ -164,6 +171,12 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise("In Partition a tool shape is null");
       }
       //
+      BRepBuilderAPI_Copy aCopyTool (aShape_i);
+      if (aCopyTool.IsDone())
+        aShape_i = aCopyTool.Shape();
+      else
+        Standard_NullObject::Raise("Bad shape detected");
+      //
       TopTools_ListOfShape aSimpleShapes;
       PrepareShapes(aShape_i, aType, aSimpleShapes);
       TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes);
@@ -183,6 +196,12 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise("In Partition a Keep Inside shape is null");
       }
       //
+      BRepBuilderAPI_Copy aCopyTool (aShape_i);
+      if (aCopyTool.IsDone())
+        aShape_i = aCopyTool.Shape();
+      else
+        Standard_NullObject::Raise("Bad shape detected");
+      //
       TopTools_ListOfShape aSimpleShapes;
       PrepareShapes(aShape_i, aType, aSimpleShapes);
       TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes);
@@ -201,6 +220,12 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise("In Partition a Remove Inside shape is null");
       }
       //
+      BRepBuilderAPI_Copy aCopyTool (aShape_i);
+      if (aCopyTool.IsDone())
+        aShape_i = aCopyTool.Shape();
+      else
+        Standard_NullObject::Raise("Bad shape detected");
+      //
       TopTools_ListOfShape aSimpleShapes;
       PrepareShapes(aShape_i, aType, aSimpleShapes);
       TopTools_ListIteratorOfListOfShape aSimpleIter (aSimpleShapes);