0023182: During STEP translation isn't checked for validity flag IsClosed
authorama <ama@opencascade.com>
Fri, 8 Jun 2012 08:37:19 +0000 (12:37 +0400)
committerama <ama@opencascade.com>
Fri, 8 Jun 2012 08:37:19 +0000 (12:37 +0400)
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
src/ShapeFix/ShapeFix_Shell.cxx

index ff4a0bb..dfb175a 100755 (executable)
@@ -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
 !
index f417091..59b9e02 100755 (executable)
@@ -46,6 +46,7 @@
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 
+#include <ShapeAnalysis_Shell.hxx>
 #include <ShapeExtend.hxx>
 #include <ShapeBuild_ReShape.hxx> 
 #include <Message_Msg.hxx>
@@ -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))