From: vsr Date: Wed, 7 Oct 2015 11:16:02 +0000 (+0300) Subject: 0023180: [CEA 1602] Regression : MakePartition of a solid by an empty compound return... X-Git-Tag: V7_7_0_WIN~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0068817237ae7c33dffc7bfa9de995e219faf0fc;p=modules%2Fgeom.git 0023180: [CEA 1602] Regression : MakePartition of a solid by an empty compound returns an error - Allow creating empty compounds --- diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 46b7d1d7b..8b585f83e 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -114,14 +114,15 @@ namespace { TopoDS_Iterator it( c, Standard_True, Standard_True ); - // check that compound is not empty - bool result = it.More(); + // empty compound is OK only if we explicitly create a compound of shapes + bool result = true; // => if expected type is TopAbs_SHAPE, we allow compound consisting of any shapes, this above check is enough // => otherwise we have to check compound's content // => compound sometimes can contain enclosed compound(s), we process them recursively and rebuild initial compound if ( t != TopAbs_SHAPE ) { + result = it.More(); std::list compounds, shapes; compounds.push_back( c ); while ( !compounds.empty() && result ) {