From d44b7b7442b04918eddc93a9c53ee807da6032cb Mon Sep 17 00:00:00 2001 From: drochalo Date: Fri, 27 Oct 2023 17:18:25 +0100 Subject: [PATCH] 0027832: Visualization - Scaled zbuffer trihedron Code cleanup and test case modified. --- src/Graphic3d/Graphic3d_TransformPers.hxx | 4 ++-- tests/v3d/trihedron/bug27832 | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Graphic3d/Graphic3d_TransformPers.hxx b/src/Graphic3d/Graphic3d_TransformPers.hxx index ab444de9a5..4475599544 100644 --- a/src/Graphic3d/Graphic3d_TransformPers.hxx +++ b/src/Graphic3d/Graphic3d_TransformPers.hxx @@ -415,9 +415,9 @@ 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 > 0 && anAxialY > 0 && anAxialZ > 0) + if (anAxialX > 0.0 && anAxialY > 0.0 && anAxialZ > 0.0) { - Graphic3d_TransformUtils::Scale(aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ); + Graphic3d_TransformUtils::Scale (aWorldView, 1.0 / anAxialX, 1.0 / anAxialY, 1.0 / anAxialZ); } Graphic3d_TransformUtils::Translate (aWorldView, aCenter.X(), aCenter.Y(), aCenter.Z()); diff --git a/tests/v3d/trihedron/bug27832 b/tests/v3d/trihedron/bug27832 index 9778064a6e..174aefee8d 100644 --- a/tests/v3d/trihedron/bug27832 +++ b/tests/v3d/trihedron/bug27832 @@ -1,16 +1,22 @@ puts "========" -puts "0025340: 0027832: Visualization - Scaled zbuffer trihedron" +puts "0027832: Visualization - Scaled zbuffer trihedron" puts "========" puts "" -pload ALL +pload MODELING VISUALIZATION vinit box b 10 10 10 vdisplay b vfit vsetdispmode 1 vzbufftrihedron -on +#draw initial picture of box without visual scale +vdump $imagedir/${casename}_unscaled.png + +#draw picture of box after visual scale +#and zoomed out vscale 1 3 10 +vzoom 0.99 set color_1 [vreadpixel 55 360 -rgb -name] set color_2 [vreadpixel 50 350 -rgb -name] @@ -37,4 +43,4 @@ if {$color_3 != "GREEN3"} { puts " current color is: $color_3" } -vdump $imagedir/${casename}.png \ No newline at end of file +vdump $imagedir/${casename}_scaled.png