0024606: DepthFitAll and ZFitAll do not eliminate z-clipping
authorapl <apl@opencascade.com>
Thu, 9 Oct 2014 12:23:54 +0000 (16:23 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 9 Oct 2014 12:25:20 +0000 (16:25 +0400)
Test case for non-regression verification

Correction of test case for issue CR24606

src/QABugs/QABugs_19.cxx
tests/bugs/vis/bug24606 [new file with mode: 0644]

index 448577f..f324843 100755 (executable)
@@ -19,6 +19,7 @@
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
 #include <ViewerTest.hxx>
 #include <DBRep.hxx>
 #include <DrawTrSurf.hxx>
 #include <ViewerTest.hxx>
+#include <V3d_View.hxx>
 #include <TopoDS_Shape.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_TexturedShape.hxx>
 #include <TopoDS_Shape.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_TexturedShape.hxx>
@@ -2709,6 +2710,34 @@ static Standard_Integer OCC25043 (Draw_Interpretor& theDI,
   return 0;
 }
 
   return 0;
 }
 
+//=======================================================================
+//function : OCC24606
+//purpose  :
+//=======================================================================
+static Standard_Integer OCC24606 (Draw_Interpretor& theDI,
+                                  Standard_Integer  theArgNb,
+                                  const char**      theArgVec)
+{
+  if (theArgNb > 1)
+  {
+    std::cerr << "Error: incorrect number of arguments.\n";
+    theDI << "Usage : " << theArgVec[0] << "\n";
+    return 1;
+  }
+
+  Handle(V3d_View) aView = ViewerTest::CurrentView();
+  if (aView.IsNull())
+  {
+    std::cerr << "Errro: no active view, please call 'vinit'.\n";
+    return 1;
+  }
+
+  aView->DepthFitAll();
+  aView->FitAll();
+
+  return 0;
+}
+
 //=======================================================================
 //function : OCC23010
 //purpose  :
 //=======================================================================
 //function : OCC23010
 //purpose  :
@@ -2804,5 +2833,6 @@ void QABugs::Commands_19(Draw_Interpretor& theCommands) {
                    __FILE__, OCC24925, group);
   theCommands.Add ("OCC23010", "OCC23010 STEP_file", __FILE__, OCC23010, group);
   theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
                    __FILE__, OCC24925, group);
   theCommands.Add ("OCC23010", "OCC23010 STEP_file", __FILE__, OCC23010, group);
   theCommands.Add ("OCC25043", "OCC25043 shape", __FILE__, OCC25043, group);
+  theCommands.Add ("OCC24606", "OCC24606 : Tests ::FitAll for V3d view ('vfit' is for NIS view)", __FILE__, OCC24606, group);
   return;
 }
   return;
 }
diff --git a/tests/bugs/vis/bug24606 b/tests/bugs/vis/bug24606
new file mode 100644 (file)
index 0000000..8e26167
--- /dev/null
@@ -0,0 +1,40 @@
+puts "============"
+puts "OCC24606"
+puts "============"
+puts ""
+####################################################################################
+# Tests ::FitDepth and ::FitAll implementation of V3d_View.
+####################################################################################
+
+set check_x 402
+set check_y 320
+
+restore [locate_data_file bug24606.brep] shape
+
+vinit View1
+vautozfit 0
+vsetdispmode 1
+vdisplay shape
+OCC24606
+vmoveto $check_x $check_y
+
+checkcolor $check_x $check_y 0 1 1
+
+if {$stat != 1} {
+    puts "Error : V3d view ::FitAll is broken."
+}
+vdump ${imagedir}/${casename}_1.png
+
+vinit View2
+vautozfit 1
+vsetdispmode 1
+vdisplay shape
+OCC24606
+vmoveto $check_x $check_y
+
+checkcolor $check_x $check_y 0 1 1
+
+if {$stat != 1} {
+    puts "Error : V3d view ::FitAll is broken."
+}
+vdump ${imagedir}/${casename}_2.png