]> OCCT Git - occt-copy.git/commitdiff
0028392: Shape Processing - some checks have no option to switch off V7_1_0p1
authorabv <abv@opencascade.com>
Thu, 9 Feb 2017 12:45:51 +0000 (15:45 +0300)
committerrnv <rnv@opencascade.com>
Mon, 13 Mar 2017 08:40:17 +0000 (11:40 +0300)
Added option ShapeFix_Solid::FixShellOrientationMode allowing to switch off analysis and fixing of orientations of shell(s) in solid.
Options FixVertexToleranceMode, FixShellOrientationMode, FixFaceOrientationMode are added to Shepe Processing resource file so that they can be manipulated.

src/ShapeFix/FILES
src/ShapeFix/ShapeFix_Solid.cxx
src/ShapeFix/ShapeFix_Solid.hxx
src/ShapeProcess/ShapeProcess_OperLibrary.cxx
src/XSTEPResource/IGES
src/XSTEPResource/STEP

index a66dc6c143e1ed87c88a7b67eb0bdc2df3bad04c..09f64a69bb371708afff3c55b0d012375d22575b 100755 (executable)
@@ -39,7 +39,6 @@ ShapeFix_Shell.hxx
 ShapeFix_Shell.lxx
 ShapeFix_Solid.cxx
 ShapeFix_Solid.hxx
-ShapeFix_Solid.lxx
 ShapeFix_SplitCommonVertex.cxx
 ShapeFix_SplitCommonVertex.hxx
 ShapeFix_SplitTool.cxx
index dbeacee53e36c0043af0bebfaf23566ee0d400fa..3c0a8e92488532a8e6bf5891fc97acd6d59455c1 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);
@@ -417,13 +419,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;
@@ -431,7 +433,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);
index e9d1123842cab384f237053ee6c31e42e5f7b042..9a2f314451bb608bd65068b481ab4ea9c6676a3b 100644 (file)
@@ -70,7 +70,10 @@ public:
   Standard_EXPORT TopoDS_Shape Solid() const;
   
   //! Returns tool for fixing shells.
-    Handle(ShapeFix_Shell) FixShellTool() const;
+  Handle(ShapeFix_Shell) FixShellTool() const
+  {
+    return myFixShell;
+  }
   
   //! Sets message registrator
   Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE;
@@ -86,46 +89,41 @@ public:
   
   //! Returns (modifiable) the mode for applying fixes of
   //! ShapeFix_Shell, by default True.
-    Standard_Integer& FixShellMode();
+  Standard_Integer& FixShellMode()
+  {
+    return myFixShellMode;
+  }
+  
+  //! Returns (modifiable) the mode for applying analysis and fixes of
+  //! orientation of shells in the solid; by default True.
+  Standard_Integer& FixShellOrientationMode()
+  {
+    return myFixShellOrientationMode;
+  }
   
   //! Returns (modifiable) the mode for creation of solids.
   //! If mode myCreateOpenSolidMode is equal to true
   //! solids are created from open shells
   //! else solids are created  from closed shells only.
   //! ShapeFix_Shell, by default False.
-    Standard_Boolean& CreateOpenSolidMode();
+  Standard_Boolean& CreateOpenSolidMode()
+  {
+    return myCreateOpenSolidMode;
+  }
   
   //! In case of multiconnexity returns compound of fixed solids
   //! else returns one solid.
   Standard_EXPORT TopoDS_Shape Shape();
 
-
-
-
   DEFINE_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root)
 
 protected:
-
-
   TopoDS_Shape mySolid;
   Handle(ShapeFix_Shell) myFixShell;
   Standard_Integer myStatus;
   Standard_Integer myFixShellMode;
-
-
-private:
-
-
+  Standard_Integer myFixShellOrientationMode;
   Standard_Boolean myCreateOpenSolidMode;
-
-
 };
 
-
-#include <ShapeFix_Solid.lxx>
-
-
-
-
-
 #endif // _ShapeFix_Solid_HeaderFile
index 3778c2923080b317615a049e84a69c5945b1fd46..c3d348c40617c79bd24bc5ca26b90051ffdd432b 100644 (file)
@@ -709,11 +709,14 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
   sfs->FixSameParameterMode() = ctx->IntegerVal ( "FixSameParameterMode", -1 );
   sfs->FixSolidMode()         = ctx->IntegerVal ( "FixSolidMode", -1 );
   sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 );
+  sfs->FixVertexTolMode()      = ctx->IntegerVal ( "FixVertexToleranceMode", -1 );
 
   sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 );
+  sfs->FixSolidTool()->FixShellOrientationMode() = ctx->IntegerVal ( "FixShellOrientationMode", -1 );
   sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
 
   sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );
+  sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal ( "FixFaceOrientationMode", -1 );
 
   //parameters for ShapeFix_Face
   sff->FixWireMode()              = ctx->IntegerVal ( "FixWireMode", -1 );
index 40f929d8d8a40e493e8643d8e969677e3b2d4bcb..0fabff3a54cefce287a3d9ec2ff455eafb30bfab 100755 (executable)
@@ -17,9 +17,14 @@ FromIGES.FixShape.FixFreeShellMode           : -1
 FromIGES.FixShape.FixFreeFaceMode              : -1
 FromIGES.FixShape.FixFreeWireMode              : -1
 FromIGES.FixShape.FixSameParameterMode         : -1
+
 FromIGES.FixShape.FixSolidMode                 : -1
+FromSTEP.FixShape.FixShellOrientationMode      : -1
 FromIGES.FixShape.CreateOpenSolidMode           :  1
+
 FromIGES.FixShape.FixShellMode                 : -1
+FromSTEP.FixShape.FixFaceOrientationMode       : -1
+
 FromIGES.FixShape.FixFaceMode                  : -1
 FromIGES.FixShape.FixWireMode                  : -1
 FromIGES.FixShape.FixOrientationMode           : -1
@@ -55,4 +60,6 @@ FromIGES.FixShape.FixNotchedEdgesMode                 : -1
 FromIGES.FixShape.FixSelfIntersectingEdgeMode  : -1
 FromIGES.FixShape.FixIntersectingEdgesMode     : -1
 FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
+
 FromIGES.FixShape.FixVertexPositionMode : 0
+FromIGES.FixShape.FixVertexToleranceMode : -1
index 15858bbebf5c888d9c6a378dfed0a31752e53ef9..2329bd288daab63393bfbe79f52bde1c4b010e90 100755 (executable)
@@ -17,9 +17,14 @@ FromSTEP.FixShape.FixFreeShellMode           : -1
 FromSTEP.FixShape.FixFreeFaceMode              : -1
 FromSTEP.FixShape.FixFreeWireMode              : -1
 FromSTEP.FixShape.FixSameParameterMode         : -1
+
 FromSTEP.FixShape.FixSolidMode                 : -1
+FromSTEP.FixShape.FixShellOrientationMode      : -1
 FromSTEP.FixShape.CreateOpenSolidMode           :  0
+
 FromSTEP.FixShape.FixShellMode                 : -1
+FromSTEP.FixShape.FixFaceOrientationMode       : -1
+
 FromSTEP.FixShape.FixFaceMode                  : -1
 FromSTEP.FixShape.FixWireMode                  : -1
 FromSTEP.FixShape.FixOrientationMode           : -1
@@ -58,4 +63,6 @@ FromSTEP.FixShape.MaxTailWidth : -1
 FromSTEP.FixShape.FixSelfIntersectingEdgeMode  : -1
 FromSTEP.FixShape.FixIntersectingEdgesMode     : -1
 FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
+
 FromSTEP.FixShape.FixVertexPositionMode : 0
+FromSTEP.FixShape.FixVertexToleranceMode : -1