diff --git a/src/ShapeFix/FILES b/src/ShapeFix/FILES index a66dc6c143..09f64a69bb 100755 --- a/src/ShapeFix/FILES +++ b/src/ShapeFix/FILES @@ -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 diff --git a/src/ShapeFix/ShapeFix_Solid.cxx b/src/ShapeFix/ShapeFix_Solid.cxx index eb901c57e6..db2a1bf1e6 100644 --- a/src/ShapeFix/ShapeFix_Solid.cxx +++ b/src/ShapeFix/ShapeFix_Solid.cxx @@ -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); diff --git a/src/ShapeFix/ShapeFix_Solid.hxx b/src/ShapeFix/ShapeFix_Solid.hxx index e9d1123842..9a2f314451 100644 --- a/src/ShapeFix/ShapeFix_Solid.hxx +++ b/src/ShapeFix/ShapeFix_Solid.hxx @@ -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 - - - - - #endif // _ShapeFix_Solid_HeaderFile diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx index 3778c29230..c3d348c406 100644 --- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx +++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx @@ -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 ); diff --git a/src/XSTEPResource/IGES b/src/XSTEPResource/IGES index 40f929d8d8..0fabff3a54 100755 --- a/src/XSTEPResource/IGES +++ b/src/XSTEPResource/IGES @@ -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 diff --git a/src/XSTEPResource/STEP b/src/XSTEPResource/STEP index 15858bbebf..2329bd288d 100755 --- a/src/XSTEPResource/STEP +++ b/src/XSTEPResource/STEP @@ -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