From 69fd2d1b533772934f8cff2a46fc3f758de1d866 Mon Sep 17 00:00:00 2001 From: apn Date: Thu, 13 Feb 2014 13:44:30 +0400 Subject: [PATCH] Added QA command OCC24086 and test case bugs/modalg_5/bug24086 for issue 24086. --- src/QABugs/QABugs_19.cxx | 41 ++++++++++++++++++++++++++++++++++++ tests/bugs/modalg_5/bug24086 | 35 ++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 tests/bugs/modalg_5/bug24086 diff --git a/src/QABugs/QABugs_19.cxx b/src/QABugs/QABugs_19.cxx index e89e6711c9..410ec9912c 100755 --- a/src/QABugs/QABugs_19.cxx +++ b/src/QABugs/QABugs_19.cxx @@ -1336,6 +1336,46 @@ static Standard_Integer OCC24051 (Draw_Interpretor& di, Standard_Integer argc, c return 0; } +#include +#include +#include +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 #include #include @@ -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 index 0000000000..49b09e3b18 --- /dev/null +++ b/tests/bugs/modalg_5/bug24086 @@ -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 + + + + + + +