0028392: Shape Processing - some checks have no option to switch off
[occt.git] / src / ShapeFix / ShapeFix_Solid.cxx
index eb901c5..db2a1bf 100644 (file)
@@ -70,6 +70,7 @@ ShapeFix_Solid::ShapeFix_Solid()
 {
   myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
   myFixShellMode = -1;
+  myFixShellOrientationMode = -1;
   myFixShell = new ShapeFix_Shell;
   myCreateOpenSolidMode = Standard_False;
 }
@@ -83,6 +84,7 @@ ShapeFix_Solid::ShapeFix_Solid(const TopoDS_Solid& solid)
 {
   myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
   myFixShellMode = -1;
+  myFixShellOrientationMode = -1;
   myFixShell = new ShapeFix_Shell;
   myCreateOpenSolidMode = Standard_False;
   Init(solid);
@@ -419,13 +421,13 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
         status = Standard_True;
         myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
       }
-      NbShells+= myFixShell->NbShells();
+      NbShells += myFixShell->NbShells();
     }
 
     // Halt algorithm in case of user's abort
     if ( !aPSentryFixShell.More() )
       return Standard_False;
-  }
+    }
   else 
   {
     NbShells = aNbShells;
@@ -433,7 +435,13 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
 
   // Switch to the second stage
   aPSentry.Next();
-    
+
+  if (!NeedFix(myFixShellOrientationMode))
+  {
+    myShape = Context()->Apply(myShape);
+    return status;
+  }
+
   if(NbShells ==1) {
     TopoDS_Shape tmpShape = Context()->Apply(myShape);
     TopExp_Explorer aExp(tmpShape,TopAbs_SHELL);