From: srn Date: Fri, 26 Aug 2005 07:31:00 +0000 (+0000) Subject: Placed a check if any function is added in GetFreeBoundaries operation X-Git-Tag: T_3_0_2a1~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3a675cc5c05dd6d74d9b371b2db3b0e0c8ff53e3;p=modules%2Fgeom.git Placed a check if any function is added in GetFreeBoundaries operation --- diff --git a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx index 08e0c3757..5e86fbacc 100644 --- a/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IHealingOperations.cxx @@ -719,34 +719,37 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject theOpen->Append(anObj); } - //Make a Python command - GEOM::TPythonDump pd (aFunction); + if(!aFunction.IsNull()) { + + //Make a Python command + GEOM::TPythonDump pd (aFunction); - Standard_Integer i, aLen = theClosed->Length(); - if (aLen > 0) { - pd << "(isDone, ["; - for (i = 1; i <= aLen; i++) { - Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theClosed->Value(i)); - pd << anObj_i << ((i < aLen) ? ", " : ""); + Standard_Integer i, aLen = theClosed->Length(); + if (aLen > 0) { + pd << "(isDone, ["; + for (i = 1; i <= aLen; i++) { + Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theClosed->Value(i)); + pd << anObj_i << ((i < aLen) ? ", " : ""); + } + pd << "], "; + } else { + pd << "(isDone, empty_list, "; } - pd << "], "; - } else { - pd << "(isDone, empty_list, "; - } - aLen = theOpen->Length(); - if (aLen > 0) { - pd << "["; - for (i = 1; i <= aLen; i++) { - Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theOpen->Value(i)); - pd << anObj_i << ((i < aLen) ? ", " : ""); + aLen = theOpen->Length(); + if (aLen > 0) { + pd << "["; + for (i = 1; i <= aLen; i++) { + Handle(GEOM_Object) anObj_i = Handle(GEOM_Object)::DownCast(theOpen->Value(i)); + pd << anObj_i << ((i < aLen) ? ", " : ""); + } + pd << "]"; + } else { + pd << "empty_list"; } - pd << "]"; - } else { - pd << "empty_list"; - } - pd << ") = geompy.GetFreeBoundary(" << theObject << ")"; + pd << ") = geompy.GetFreeBoundary(" << theObject << ")"; + } SetErrorCode(OK); return true;