From 0e308036afd593ca08f42b4ba15489c7443e52d3 Mon Sep 17 00:00:00 2001 From: skv Date: Thu, 8 May 2014 11:51:17 +0400 Subject: [PATCH] 0021835: Report detected errors in GUI even if there were errors during the operation --- src/GEOMGUI/GEOM_msg_en.ts | 4 ++++ src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx | 15 ++++----------- .../MeasureGUI_CheckSelfIntersectionsDlg.cxx | 8 +++++++- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index a6858a9a2..30942dd61 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -427,6 +427,10 @@ Please, select face, shell or solid and try again GEOM_SELF_INTERSECTIONS_FOUND Some self-intersections detected + + GEOM_CHECK_SELF_INTERSECTIONS_ERRORS + Warning: there were errors during the operation, so the list may be incomplete. + GEOM_CIRCLE Circle diff --git a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx index bc7111cb2..31233a94f 100644 --- a/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include @@ -65,7 +64,6 @@ #include #include #include -#include #include #include #include @@ -1543,8 +1541,6 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections if (aShape.IsNull()) return isGood; // 0. Prepare data - BRep_Builder aBB; - TopoDS_Compound aCS; TopoDS_Shape aScopy; // GEOMAlgo_AlgoTools::CopyShape(aShape, aScopy); @@ -1553,9 +1549,6 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections TopTools_IndexedMapOfShape anIndices; TopExp::MapShapes(aScopy, anIndices); - aBB.MakeCompound(aCS); - aBB.Add(aCS, aScopy); - BOPCol_ListOfShape aLCS; aLCS.Append(aScopy); // @@ -1565,9 +1558,6 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections // 1. Launch the checker aCSI.Perform(); Standard_Integer iErr = aCSI.ErrorStatus(); - if (iErr) { - return false; // Error - } isGood = true; // @@ -1596,7 +1586,10 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections isGood = false; } - SetErrorCode(OK); + if (!iErr) { + SetErrorCode(OK); + } + return isGood; } diff --git a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx index db59531a6..8debf294c 100644 --- a/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx +++ b/src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx @@ -144,7 +144,7 @@ void MeasureGUI_CheckSelfIntersectionsDlg::processObject() isFailed = true; } - if (!anOper->IsDone()) { + if (!anOper->IsDone() && myInters->length() == 0) { aMsg += tr(anOper->GetErrorCode()); myGrp->TextView1->setText(aMsg); return; @@ -162,6 +162,12 @@ void MeasureGUI_CheckSelfIntersectionsDlg::processObject() else { aMsg += tr("GEOM_SELF_INTERSECTIONS_FOUND"); } + + if (!anOper->IsDone()) { + aMsg += "\n\n"; + aMsg += tr("GEOM_CHECK_SELF_INTERSECTIONS_ERRORS"); + } + myGrp->TextView1->setText(aMsg); // Pairs -- 2.39.2