Salome HOME
Fix for bug Bug IPAL20288 (4x: CRASH after trying to build a sketch).
[modules/geom.git] / src / GEOMImpl / GEOMImpl_HealingDriver.cxx
index ffe05748ebe074dcf35834a56800ff4f5a13883f..d4921d6483da67d0f96adb11f2a521ca319f988b 100644 (file)
@@ -32,6 +32,7 @@
 #include <ShHealOper_FillHoles.hxx>
 #include <ShHealOper_Sewing.hxx>
 #include <ShHealOper_EdgeDivide.hxx>
+#include <ShHealOper_ChangeOrientation.hxx>
 
 #include <TopoDS.hxx>
 #include <TopExp.hxx>
@@ -115,6 +116,9 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const
   case DIVIDE_EDGE:
     AddPointOnEdge(&HI, anOriginalShape, aShape);
     break;
+  case CHANGE_ORIENTATION:
+    ChangeOrientation(&HI, anOriginalShape, aShape);
+    break;
   default:
     return 0;
   }
@@ -379,6 +383,27 @@ Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* theH
 }
 
 
+//=======================================================================
+//function :  ChangeOrientation
+//purpose  :
+//=======================================================================
+Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* theHI,
+                                                            const TopoDS_Shape& theOriginalShape,
+                                                            TopoDS_Shape& theOutShape) const
+{
+  ShHealOper_ChangeOrientation aHealer (theOriginalShape);
+
+  Standard_Boolean aResult = aHealer.Perform();
+
+  if (aResult)
+    theOutShape = aHealer.GetResultShape();
+  else
+    raiseNotDoneExeption( aHealer.GetErrorStatus() );
+
+  return aResult;
+}
+
+
 //=======================================================================
 //function :  GEOMImpl_HealingDriver_Type_
 //purpose  :