Salome HOME
Make Filling user friendly when reporting errors
authorazv <azv@opencascade.com>
Thu, 7 Jun 2018 12:30:25 +0000 (15:30 +0300)
committerazv <azv@opencascade.com>
Thu, 7 Jun 2018 12:30:25 +0000 (15:30 +0300)
src/BuildPlugin/BuildPlugin_Filling.cpp
src/GeomAlgoAPI/GeomAlgoAPI_Filling.cpp

index 7e2c884ced1522ec4055a6248901b5cd83984dc0..4aff9c942bdca78ac2c1f54fc59be893f3fc0845 100644 (file)
@@ -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()) {
index 0dc3861f5af0ea5185352ed099e0bfb53d9a87a8..f08f44a4f7b8dcfb877394bd6510ef3e03ae8aff 100644 (file)
@@ -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;