From a929ed86fbff15a53cad01dce374501cfb57ab7b Mon Sep 17 00:00:00 2001 From: ama Date: Fri, 8 Jun 2012 12:37:19 +0400 Subject: [PATCH] 0023182: During STEP translation isn't checked for validity flag IsClosed Added check for consistency properties of closure and existence of free boundaries in shell (modified ShapeFix_Shell::Perform() Added new message in SHMessage/SHAPE.us) --- src/SHMessage/SHAPE.us | 3 ++- src/ShapeFix/ShapeFix_Shell.cxx | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/SHMessage/SHAPE.us b/src/SHMessage/SHAPE.us index ff4a0bbb67..dfb175a848 100755 --- a/src/SHMessage/SHAPE.us +++ b/src/SHMessage/SHAPE.us @@ -160,7 +160,8 @@ Faces were incorrectly oriented in the shell, corrected .FixAdvShell.FixOrientation.MSG5 Faces were incorrectly oriented in the shell, not corrected ! -.FixAdvShell..MSG0 +.FixAdvShell.FixClosedFlag.MSG0 +Shell has incorrect flag isClosed ! .FixAdvShell..MSG5 ! diff --git a/src/ShapeFix/ShapeFix_Shell.cxx b/src/ShapeFix/ShapeFix_Shell.cxx index f41709162c..59b9e02a4d 100755 --- a/src/ShapeFix/ShapeFix_Shell.cxx +++ b/src/ShapeFix/ShapeFix_Shell.cxx @@ -46,6 +46,7 @@ #include #include +#include #include #include #include @@ -148,6 +149,25 @@ Standard_Boolean ShapeFix_Shell::Perform(const Handle(Message_ProgressIndicator) TopoDS_Shape newsh = Context()->Apply(myShell); if ( NeedFix ( myFixOrientationMode) ) FixFaceOrientation(TopoDS::Shell(newsh)); + + TopoDS_Shape aNewsh = Context()->Apply (newsh); + ShapeAnalysis_Shell aSas; + for (TopExp_Explorer aShellExp (aNewsh, TopAbs_SHELL); aShellExp.More(); aShellExp.Next()) + { + TopoDS_Shell aCurShell = TopoDS::Shell (aShellExp.Current()); + if (aCurShell.Closed()) + { + aSas.LoadShells (aCurShell); + aSas.CheckOrientedShells (aCurShell, Standard_True); + if (aSas.HasFreeEdges()) + { + aCurShell.Closed (Standard_False); + SendWarning (Message_Msg ("FixAdvShell.FixClosedFlag.MSG0"));//Shell has incorrect flag isClosed + } + aSas.Clear(); + } + } + if ( status ) myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 ); if(Status(ShapeExtend_DONE2)) -- 2.20.1