From: azv Date: Thu, 7 Jun 2018 12:30:25 +0000 (+0300) Subject: Make Filling user friendly when reporting errors X-Git-Tag: V8_5_0~8 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a37b268611b7759d0588d74ca51107cd44f2d843;p=modules%2Fshaper.git Make Filling user friendly when reporting errors --- diff --git a/src/BuildPlugin/BuildPlugin_Filling.cpp b/src/BuildPlugin/BuildPlugin_Filling.cpp index 7e2c884ce..4aff9c942 100644 --- a/src/BuildPlugin/BuildPlugin_Filling.cpp +++ b/src/BuildPlugin/BuildPlugin_Filling.cpp @@ -137,7 +137,12 @@ bool BuildPlugin_Filling::isAlgorithmFailed( { if (!theAlgorithm->isDone()) { static const std::string aFeatureError = "Error: filling algorithm failed."; - setError(aFeatureError); + std::string anAlgoError = theAlgorithm->getError(); + if (anAlgoError.empty()) + anAlgoError = aFeatureError; + else + anAlgoError = aFeatureError + " " + anAlgoError; + setError(anAlgoError); return true; } if (theAlgorithm->shape()->isNull()) { diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp index 0dc3861f5..f08f44a4f 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp @@ -101,14 +101,18 @@ void GeomAlgoAPI_Filling::buildByEdges() Handle(GeomFill_Line) aLine = new GeomFill_Line(aNbCurves); // check myMaxDegree >= aCurves.size() - 1 to be able to interpolate a surface - if (myMaxDegree + 1 < aNbCurves) + if (myMaxDegree + 1 < aNbCurves) { + myError = "Unable to interpolate surface, Max deg + 1 should be greater or equal than number of sections."; return; + } // perform filling by sections GeomFill_AppSurf anAppSurf(myMinDegree, myMaxDegree, myTol3D, myTol2D, myNbIter); anAppSurf.Perform(aLine, aSection); - if (!anAppSurf.IsDone()) + if (!anAppSurf.IsDone()) { + myError = "Approximation algorithm failed."; return; + } // build calculated surface Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;