Commit 1780d6cc authored by abv's avatar abv Committed by rnv
Browse files

0028392: Shape Processing - some checks have no option to switch off

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.
parent 5f4c2d0a
Showing with 48 additions and 26 deletions
+48 -26
......@@ -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
......
......@@ -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);
......
......@@ -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
......@@ -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 );
......
......@@ -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
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment