From 92cc19641aacb4ff1cacf9b10ad859bfcc5824d7 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 12 May 2010 11:32:41 +0000 Subject: [PATCH] Mantis issue 0020859: Partition operation fails on first try. --- src/GEOMImpl/GEOMImpl_PartitionDriver.cxx | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx b/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx index e6ff34fea..0766ea2ef 100644 --- a/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_PartitionDriver.cxx @@ -35,6 +35,7 @@ #include +#include #include #include @@ -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); -- 2.39.2