Added QA command OCC24086 and test case bugs/modalg_5/bug24086 for issue 24086.
authorapn <apn@opencascade.com>
Thu, 13 Feb 2014 09:44:30 +0000 (13:44 +0400)
committerapn <apn@opencascade.com>
Thu, 13 Feb 2014 10:04:52 +0000 (14:04 +0400)
src/QABugs/QABugs_19.cxx
tests/bugs/modalg_5/bug24086 [new file with mode: 0644]

index e89e671..410ec99 100755 (executable)
@@ -1336,6 +1336,46 @@ static Standard_Integer OCC24051 (Draw_Interpretor& di, Standard_Integer argc, c
        return 0;
 }
 
+#include <BRepFeat_SplitShape.hxx>
+#include <ShapeAnalysis_ShapeContents.hxx>
+#include <BRepAlgo.hxx>
+static Standard_Integer OCC24086 (Draw_Interpretor& di, Standard_Integer argc, const char ** argv) 
+{
+       if (argc != 3) {
+               di << "Usage : " << argv[0] << " should be 2 arguments (face and wire)";
+               return 1;
+       }
+       
+       Handle(AIS_InteractiveContext) myAISContext = ViewerTest::GetAISContext();
+       if(myAISContext.IsNull()) {
+               di << "use 'vinit' command before " << argv[0] << "\n";
+               return 1;
+       }
+       
+       TopoDS_Shape result;
+       TopoDS_Face face = TopoDS::Face(DBRep::Get(argv[1]));
+       TopoDS_Wire wire = TopoDS::Wire(DBRep::Get(argv[2]));
+    
+       BRepFeat_SplitShape asplit(face);
+       asplit.Add(wire, face);
+       asplit.Build();
+    result = asplit.Shape();
+    ShapeAnalysis_ShapeContents ana;
+    ana.Perform(result);
+    ana.NbFaces();
+
+       if (!(BRepAlgo::IsValid(result))) {
+               di << "Result was checked and it is INVALID" << "\n";
+       } else {
+               di << "Result was checked and it is VALID" << "\n";
+       }
+       
+       Handle(AIS_InteractiveObject) myShape = new AIS_Shape (result);
+       myAISContext->Display(myShape, Standard_True);
+
+       return 0;
+}
+
 #include <Extrema_FuncExtPS.hxx>
 #include <math_FunctionSetRoot.hxx>
 #include <math_Vector.hxx>
@@ -1657,5 +1697,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
   theCommands.Add ("OCC24533", "OCC24533", __FILE__, OCC24533, group);
   theCommands.Add ("OCC24012", "OCC24012 face edge", __FILE__, OCC24012, group);
   theCommands.Add ("OCC24051", "OCC24051", __FILE__, OCC24051, group);
+  theCommands.Add ("OCC24086", "OCC24086 face wire", __FILE__, OCC24086, group);
   return;
 }
diff --git a/tests/bugs/modalg_5/bug24086 b/tests/bugs/modalg_5/bug24086
new file mode 100644 (file)
index 0000000..49b09e3
--- /dev/null
@@ -0,0 +1,35 @@
+puts "TODO OCC24086 Debian60-64 Windows: Error: result shape is invalid"
+
+puts "============"
+puts "OCC24086"
+puts "============"
+puts ""
+#########################################################################
+# IsValid of result-Shape of BRepFeat_SplitShape returns False
+#########################################################################
+
+pload QAcommands
+
+restore [locate_data_file bug24086_face.brep] face
+restore [locate_data_file bug24086_wire.brep] wire
+
+vinit
+set info [OCC24086 face wire]
+if { [regexp "INVALID" $info] == 1 } {
+    puts "Error: result shape is invalid"
+} else {
+    puts "OK: result shape is valid"
+}
+
+vfit
+vdisplay face
+vdisplay wire
+
+set only_screen 1
+
+
+
+
+
+
+