1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-10 18:51:21 +03:00

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.
This commit is contained in:
abv 2017-02-09 15:45:51 +03:00 committed by apn
parent d3dadd2392
commit bf961e3c29
6 changed files with 48 additions and 26 deletions

View File

@ -39,7 +39,6 @@ ShapeFix_Shell.hxx
ShapeFix_Shell.lxx ShapeFix_Shell.lxx
ShapeFix_Solid.cxx ShapeFix_Solid.cxx
ShapeFix_Solid.hxx ShapeFix_Solid.hxx
ShapeFix_Solid.lxx
ShapeFix_SplitCommonVertex.cxx ShapeFix_SplitCommonVertex.cxx
ShapeFix_SplitCommonVertex.hxx ShapeFix_SplitCommonVertex.hxx
ShapeFix_SplitTool.cxx ShapeFix_SplitTool.cxx

View File

@ -70,6 +70,7 @@ ShapeFix_Solid::ShapeFix_Solid()
{ {
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
myFixShellMode = -1; myFixShellMode = -1;
myFixShellOrientationMode = -1;
myFixShell = new ShapeFix_Shell; myFixShell = new ShapeFix_Shell;
myCreateOpenSolidMode = Standard_False; myCreateOpenSolidMode = Standard_False;
} }
@ -83,6 +84,7 @@ ShapeFix_Solid::ShapeFix_Solid(const TopoDS_Solid& solid)
{ {
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK); myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
myFixShellMode = -1; myFixShellMode = -1;
myFixShellOrientationMode = -1;
myFixShell = new ShapeFix_Shell; myFixShell = new ShapeFix_Shell;
myCreateOpenSolidMode = Standard_False; myCreateOpenSolidMode = Standard_False;
Init(solid); Init(solid);
@ -419,13 +421,13 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
status = Standard_True; status = Standard_True;
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
} }
NbShells+= myFixShell->NbShells(); NbShells += myFixShell->NbShells();
} }
// Halt algorithm in case of user's abort // Halt algorithm in case of user's abort
if ( !aPSentryFixShell.More() ) if ( !aPSentryFixShell.More() )
return Standard_False; return Standard_False;
} }
else else
{ {
NbShells = aNbShells; NbShells = aNbShells;
@ -434,6 +436,12 @@ Standard_Boolean ShapeFix_Solid::Perform(const Handle(Message_ProgressIndicator)
// Switch to the second stage // Switch to the second stage
aPSentry.Next(); aPSentry.Next();
if (!NeedFix(myFixShellOrientationMode))
{
myShape = Context()->Apply(myShape);
return status;
}
if(NbShells ==1) { if(NbShells ==1) {
TopoDS_Shape tmpShape = Context()->Apply(myShape); TopoDS_Shape tmpShape = Context()->Apply(myShape);
TopExp_Explorer aExp(tmpShape,TopAbs_SHELL); TopExp_Explorer aExp(tmpShape,TopAbs_SHELL);

View File

@ -70,7 +70,10 @@ public:
Standard_EXPORT TopoDS_Shape Solid() const; Standard_EXPORT TopoDS_Shape Solid() const;
//! Returns tool for fixing shells. //! Returns tool for fixing shells.
Handle(ShapeFix_Shell) FixShellTool() const; Handle(ShapeFix_Shell) FixShellTool() const
{
return myFixShell;
}
//! Sets message registrator //! Sets message registrator
Standard_EXPORT virtual void SetMsgRegistrator (const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg) Standard_OVERRIDE; 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 //! Returns (modifiable) the mode for applying fixes of
//! ShapeFix_Shell, by default True. //! 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. //! Returns (modifiable) the mode for creation of solids.
//! If mode myCreateOpenSolidMode is equal to true //! If mode myCreateOpenSolidMode is equal to true
//! solids are created from open shells //! solids are created from open shells
//! else solids are created from closed shells only. //! else solids are created from closed shells only.
//! ShapeFix_Shell, by default False. //! ShapeFix_Shell, by default False.
Standard_Boolean& CreateOpenSolidMode(); Standard_Boolean& CreateOpenSolidMode()
{
return myCreateOpenSolidMode;
}
//! In case of multiconnexity returns compound of fixed solids //! In case of multiconnexity returns compound of fixed solids
//! else returns one solid. //! else returns one solid.
Standard_EXPORT TopoDS_Shape Shape(); Standard_EXPORT TopoDS_Shape Shape();
DEFINE_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root) DEFINE_STANDARD_RTTIEXT(ShapeFix_Solid,ShapeFix_Root)
protected: protected:
TopoDS_Shape mySolid; TopoDS_Shape mySolid;
Handle(ShapeFix_Shell) myFixShell; Handle(ShapeFix_Shell) myFixShell;
Standard_Integer myStatus; Standard_Integer myStatus;
Standard_Integer myFixShellMode; Standard_Integer myFixShellMode;
Standard_Integer myFixShellOrientationMode;
private:
Standard_Boolean myCreateOpenSolidMode; Standard_Boolean myCreateOpenSolidMode;
}; };
#include <ShapeFix_Solid.lxx>
#endif // _ShapeFix_Solid_HeaderFile #endif // _ShapeFix_Solid_HeaderFile

View File

@ -709,11 +709,14 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
sfs->FixSameParameterMode() = ctx->IntegerVal ( "FixSameParameterMode", -1 ); sfs->FixSameParameterMode() = ctx->IntegerVal ( "FixSameParameterMode", -1 );
sfs->FixSolidMode() = ctx->IntegerVal ( "FixSolidMode", -1 ); sfs->FixSolidMode() = ctx->IntegerVal ( "FixSolidMode", -1 );
sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 ); sfs->FixVertexPositionMode() = ctx->IntegerVal ( "FixVertexPositionMode", 0 );
sfs->FixVertexTolMode() = ctx->IntegerVal ( "FixVertexToleranceMode", -1 );
sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 ); sfs->FixSolidTool()->FixShellMode() = ctx->IntegerVal ( "FixShellMode", -1 );
sfs->FixSolidTool()->FixShellOrientationMode() = ctx->IntegerVal ( "FixShellOrientationMode", -1 );
sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True ); sfs->FixSolidTool()->CreateOpenSolidMode() = ctx->BooleanVal ( "CreateOpenSolidMode", Standard_True );
sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 ); sfs->FixShellTool()->FixFaceMode() = ctx->IntegerVal ( "FixFaceMode", -1 );
sfs->FixShellTool()->FixOrientationMode() = ctx->IntegerVal ( "FixFaceOrientationMode", -1 );
//parameters for ShapeFix_Face //parameters for ShapeFix_Face
sff->FixWireMode() = ctx->IntegerVal ( "FixWireMode", -1 ); sff->FixWireMode() = ctx->IntegerVal ( "FixWireMode", -1 );

View File

@ -17,9 +17,14 @@ FromIGES.FixShape.FixFreeShellMode : -1
FromIGES.FixShape.FixFreeFaceMode : -1 FromIGES.FixShape.FixFreeFaceMode : -1
FromIGES.FixShape.FixFreeWireMode : -1 FromIGES.FixShape.FixFreeWireMode : -1
FromIGES.FixShape.FixSameParameterMode : -1 FromIGES.FixShape.FixSameParameterMode : -1
FromIGES.FixShape.FixSolidMode : -1 FromIGES.FixShape.FixSolidMode : -1
FromSTEP.FixShape.FixShellOrientationMode : -1
FromIGES.FixShape.CreateOpenSolidMode : 1 FromIGES.FixShape.CreateOpenSolidMode : 1
FromIGES.FixShape.FixShellMode : -1 FromIGES.FixShape.FixShellMode : -1
FromSTEP.FixShape.FixFaceOrientationMode : -1
FromIGES.FixShape.FixFaceMode : -1 FromIGES.FixShape.FixFaceMode : -1
FromIGES.FixShape.FixWireMode : -1 FromIGES.FixShape.FixWireMode : -1
FromIGES.FixShape.FixOrientationMode : -1 FromIGES.FixShape.FixOrientationMode : -1
@ -55,4 +60,6 @@ FromIGES.FixShape.FixNotchedEdgesMode : -1
FromIGES.FixShape.FixSelfIntersectingEdgeMode : -1 FromIGES.FixShape.FixSelfIntersectingEdgeMode : -1
FromIGES.FixShape.FixIntersectingEdgesMode : -1 FromIGES.FixShape.FixIntersectingEdgesMode : -1
FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode : -1 FromIGES.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
FromIGES.FixShape.FixVertexPositionMode : 0 FromIGES.FixShape.FixVertexPositionMode : 0
FromIGES.FixShape.FixVertexToleranceMode : -1

View File

@ -17,9 +17,14 @@ FromSTEP.FixShape.FixFreeShellMode : -1
FromSTEP.FixShape.FixFreeFaceMode : -1 FromSTEP.FixShape.FixFreeFaceMode : -1
FromSTEP.FixShape.FixFreeWireMode : -1 FromSTEP.FixShape.FixFreeWireMode : -1
FromSTEP.FixShape.FixSameParameterMode : -1 FromSTEP.FixShape.FixSameParameterMode : -1
FromSTEP.FixShape.FixSolidMode : -1 FromSTEP.FixShape.FixSolidMode : -1
FromSTEP.FixShape.FixShellOrientationMode : -1
FromSTEP.FixShape.CreateOpenSolidMode : 0 FromSTEP.FixShape.CreateOpenSolidMode : 0
FromSTEP.FixShape.FixShellMode : -1 FromSTEP.FixShape.FixShellMode : -1
FromSTEP.FixShape.FixFaceOrientationMode : -1
FromSTEP.FixShape.FixFaceMode : -1 FromSTEP.FixShape.FixFaceMode : -1
FromSTEP.FixShape.FixWireMode : -1 FromSTEP.FixShape.FixWireMode : -1
FromSTEP.FixShape.FixOrientationMode : -1 FromSTEP.FixShape.FixOrientationMode : -1
@ -58,4 +63,6 @@ FromSTEP.FixShape.MaxTailWidth : -1
FromSTEP.FixShape.FixSelfIntersectingEdgeMode : -1 FromSTEP.FixShape.FixSelfIntersectingEdgeMode : -1
FromSTEP.FixShape.FixIntersectingEdgesMode : -1 FromSTEP.FixShape.FixIntersectingEdgesMode : -1
FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode : -1 FromSTEP.FixShape.FixNonAdjacentIntersectingEdgesMode : -1
FromSTEP.FixShape.FixVertexPositionMode : 0 FromSTEP.FixShape.FixVertexPositionMode : 0
FromSTEP.FixShape.FixVertexToleranceMode : -1