From: vsr Date: Fri, 15 May 2009 12:47:01 +0000 (+0000) Subject: Issue 0020356: [windows] a fix for VTKViewer_Trihedron.cxx X-Git-Tag: V5_1_2rc1~14 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4e1b617289ccb541c3ebce89d641378208791193;p=modules%2Fgui.git Issue 0020356: [windows] a fix for VTKViewer_Trihedron.cxx --- diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index 90e832a70..0cd2f1f22 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -37,6 +37,9 @@ #include #include +// QT includes +#include + vtkStandardNewMacro(VTKViewer_UnScaledActor); /*!Constructor*/ @@ -85,10 +88,10 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) vtkFloatingPointType aZeroTol = 1.0E-12; vtkFloatingPointType anOldScale = GetScale()[0]; vtkFloatingPointType aScale = anOldScale; - vtkFloatingPointType aMaxSize = (vtkFloatingPointType)fmax(aSize[1],aSize[0]); - if (fabs(aWinDiag) > aZeroTol && fabs(aLength) > aZeroTol && fabs(aMaxSize) > aZeroTol) - aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(fmin(aSize[1],aSize[0]))/aMaxSize); - if(fabs(aScale) > aZeroTol && fabs(aScale - anOldScale)/aScale > aPrecision){ + vtkFloatingPointType aMaxSize = (vtkFloatingPointType)qMax(aSize[1],aSize[0]); + if (qAbs(aWinDiag) > aZeroTol && qAbs(aLength) > aZeroTol && qAbs(aMaxSize) > aZeroTol) + aScale = mySize*aWorldDiag/aWinDiag/aLength*sqrt(vtkFloatingPointType(qMin(aSize[1],aSize[0]))/aMaxSize); + if(qAbs(aScale) > aZeroTol && qAbs(aScale - anOldScale)/aScale > aPrecision){ SetScale(aScale); } }