]> OCCT Git - occt.git/commitdiff
0027832: Visualization - Scaled zbuffer trihedron
authordrochalo <diogo.lopes@opencascade.com>
Fri, 20 Oct 2023 17:40:09 +0000 (18:40 +0100)
committerdrochalo <diogo.lopes@opencascade.com>
Fri, 20 Oct 2023 17:40:09 +0000 (18:40 +0100)
Minor update on axial scale test

src/Graphic3d/Graphic3d_TransformPers.hxx
tests/v3d/trihedron/bug27832 [new file with mode: 0644]

index f9c1e2ec8d8e95cf47d66fd280725f73f5e5d3e5..ab444de9a530bb172ad512d768daf012f571dc1d 100644 (file)
@@ -415,9 +415,7 @@ void Graphic3d_TransformPers::Apply (const Handle(Graphic3d_Camera)& theCamera,
     Standard_Real anAxialX = anAxialScale.X();
     Standard_Real anAxialY = anAxialScale.Y();
     Standard_Real anAxialZ = anAxialScale.Z();
-    if ((anAxialX > Precision::Confusion() && 
-         anAxialY > Precision::Confusion() && 
-         anAxialZ > Precision::Confusion()))
+    if (anAxialX > 0 && anAxialY > 0 && anAxialZ > 0)
     {
       Graphic3d_TransformUtils::Scale(aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ);
     }
diff --git a/tests/v3d/trihedron/bug27832 b/tests/v3d/trihedron/bug27832
new file mode 100644 (file)
index 0000000..9778064
--- /dev/null
@@ -0,0 +1,40 @@
+puts "========"
+puts "0025340: 0027832: Visualization - Scaled zbuffer trihedron"
+puts "========"
+puts ""
+
+pload ALL
+vinit
+box b 10 10 10
+vdisplay b
+vfit
+vsetdispmode 1
+vzbufftrihedron -on
+vscale 1 3 10
+
+set color_1 [vreadpixel 55 360 -rgb -name]
+set color_2 [vreadpixel 50 350 -rgb -name]
+set color_3 [vreadpixel 55 355 -rgb -name]
+
+if {$color_1 != "RED3"} {
+  puts "ERROR: trihedron does not maintain position"
+  puts "       additional investigation is needed"
+  puts "       expected color is: RED3"
+  puts "       current color is:  $color_1"
+}
+
+if {$color_2 != "BLUE3"} {
+  puts "ERROR: trihedron does not maintain position"
+  puts "       additional investigation is needed"
+  puts "       expected color is: BLUE3"
+  puts "       current color is:  $color_2"
+}
+
+if {$color_3 != "GREEN3"} {
+  puts "ERROR: trihedron does not maintain position"
+  puts "       additional investigation is needed"
+  puts "       expected color is: GREEN3"
+  puts "       current color is:  $color_3"
+}
+
+vdump $imagedir/${casename}.png
\ No newline at end of file