From: jfa Date: Fri, 8 May 2009 11:33:57 +0000 (+0000) Subject: Bug 0020329: EDF 1016 GEOM : Error GetShapesOnShapeIDs. Simplify resulting compound... X-Git-Tag: V5_1_2rc1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0b444248458c5f8553ffec8ee42ca45f9acc5aaa;p=modules%2Fgeom.git Bug 0020329: EDF 1016 GEOM : Error GetShapesOnShapeIDs. Simplify resulting compound, if there is only one sub-shape. --- diff --git a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx index bf82f5136..4cf212312 100644 --- a/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_BooleanDriver.cxx @@ -18,7 +18,7 @@ // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// + #include #include #include @@ -56,7 +56,6 @@ const Standard_GUID& GEOMImpl_BooleanDriver::GetID() return aBooleanDriver; } - //======================================================================= //function : GEOMImpl_BooleanDriver //purpose : @@ -410,6 +409,15 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute(TFunction_Logbook& log) const if (aShape.IsNull()) return 0; + // as boolean operations always produce compound, lets simplify it + // for the case, if it contans only one sub-shape + TopTools_ListOfShape listShapeRes; + AddSimpleShapes(aShape, listShapeRes); + if (listShapeRes.Extent() == 1) { + aShape = listShapeRes.First(); + if (aShape.IsNull()) return 0; + } + // 08.07.2008 skl for bug 19761 from Mantis BRepCheck_Analyzer ana (aShape, Standard_True); ana.Init(aShape);