Salome HOME
Fix error in creation information - wrong operation type in case of MakeEdge
[modules/geom.git] / src / GEOMImpl / GEOMImpl_HealingDriver.cxx
index 644b8a835e4d51f754ceac6d93a77a738e843e90..09441ab23dd683491d274f440846ee1e0f7c035e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -458,18 +458,21 @@ Standard_Boolean GEOMImpl_HealingDriver::RemoveInternalFaces (const TopoDS_Shape
   aTool.SetShape(theOriginalShape);
   aTool.Perform();
 
-  if (aTool.ErrorStatus() != 0)
-    StdFail_NotDone::Raise("GEOMAlgo_RemoverWebs failed!");
-
-  theOutShape = aTool.Result();
+  if (aTool.ErrorStatus() == 0) { // OK
+    theOutShape = aTool.Result();
 
-  // as GEOMAlgo_RemoverWebs always produces compound, lets simplify it
-  // for the case, if it contains only one sub-shape
-  TopTools_ListOfShape listShapeRes;
-  GEOMUtils::AddSimpleShapes(theOutShape, listShapeRes);
-  if (listShapeRes.Extent() == 1) {
-    theOutShape = listShapeRes.First();
+    // as GEOMAlgo_RemoverWebs always produces compound, lets simplify it
+    // for the case, if it contains only one sub-shape
+    TopTools_ListOfShape listShapeRes;
+    GEOMUtils::AddSimpleShapes(theOutShape, listShapeRes);
+    if (listShapeRes.Extent() == 1) {
+      theOutShape = listShapeRes.First();
+    }
   }
+  else if (aTool.ErrorStatus() == 11) // invalid argument (contains non-solids), do nothing
+    theOutShape = theOriginalShape;
+  else // error
+    StdFail_NotDone::Raise("GEOMAlgo_RemoverWebs failed!");
 
   return Standard_True;
 }
@@ -905,6 +908,10 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Wire", aCI.GetOriginal() );
     AddParam( theParams, "Vertexes", aCI.GetShapes() );
     break;
+  case REMOVE_INTERNAL_FACES:
+    theOperationName = "REMOVE_WEBS";
+    AddParam( theParams, "Selected shape", aCI.GetOriginal() );
+    break;
   default:
     return false;
   }