From: jfa Date: Tue, 18 Mar 2008 10:22:32 +0000 (+0000) Subject: NPAL19230: Fix shape after RemoveExtraEdges, because sometimes it is not valid. X-Git-Tag: V4_1_2rc1~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=77f03a4d00adc1ae5c8ff0a0cb8f50a04d739f8d;p=modules%2Fgeom.git NPAL19230: Fix shape after RemoveExtraEdges, because sometimes it is not valid. --- diff --git a/src/GEOMImpl/GEOMImpl_BlockDriver.cxx b/src/GEOMImpl/GEOMImpl_BlockDriver.cxx index 2efdd7ca2..873b0a751 100644 --- a/src/GEOMImpl/GEOMImpl_BlockDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BlockDriver.cxx @@ -34,7 +34,7 @@ #include #include -//#include +#include #include #include @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -507,17 +508,28 @@ Standard_Integer GEOMImpl_BlockDriver::Execute(TFunction_Logbook& log) const aTool.SetShape(aBlockOrComp); aTool.Perform(); - if (aType == BLOCK_REMOVE_EXTRA) { + TopoDS_Shape aFixedExtra = aTool.Shape(); + + // Repair result + BRepCheck_Analyzer ana (aFixedExtra, false); + if (!ana.IsValid()) { + TopoDS_Shape aFixed; + ShHealOper_ShapeProcess aHealer; + aHealer.Perform(aFixedExtra, aFixed); + if (aHealer.isDone()) + aFixedExtra = aFixed; + } + + if (aType == BLOCK_REMOVE_EXTRA) + { + aShape = aFixedExtra; - aShape = aTool.Shape(); if (aShape == aBlockOrComp) { MESSAGE("No modifications have been done"); } - - } else { // aType == BLOCK_COMPOUND_IMPROVE - - TopoDS_Shape aFixedExtra = aTool.Shape(); - + } + else // aType == BLOCK_COMPOUND_IMPROVE + { // 2. Separate non-blocks TopTools_ListOfShape BLO; // All blocks from the given compound TopTools_ListOfShape NOT; // Not blocks