From a52c06d5f6f28f0c48ec2ffa62ffd31ab2d24dcc Mon Sep 17 00:00:00 2001 From: vpa Date: Thu, 2 Jul 2015 20:00:32 +0300 Subject: [PATCH] 0026394: Visualization - eliminate unused variable in SelectMgr_RectangularFrustum Unnecessary calculations were removed --- .../SelectMgr_RectangularFrustum.cxx | 25 ++----------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx index b0867e21b7..8cbde2a460 100644 --- a/src/SelectMgr/SelectMgr_RectangularFrustum.cxx +++ b/src/SelectMgr/SelectMgr_RectangularFrustum.cxx @@ -44,13 +44,11 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance (const gp_Pnt& theSegP Standard_Real aD = DOT (anU, aW); Standard_Real anE = DOT (aV, aW); Standard_Real aCoef = anA * aC - aB * aB; - Standard_Real aSc, aSn, aSd = aCoef; + Standard_Real aSn = aCoef; Standard_Real aTc, aTn, aTd = aCoef; if (aCoef < Precision::Confusion()) { - aSn = 0.0; - aSd = 1.0; aTn = anE; aTd = aC; } @@ -60,13 +58,11 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance (const gp_Pnt& theSegP aTn = (anA * anE - aB * aD); if (aSn < 0.0) { - aSn = 0.0; aTn = anE; aTd = aC; } - else if (aSn > aSd) + else if (aSn > aCoef) { - aSn = aSd; aTn = anE + aB; aTd = aC; } @@ -75,28 +71,11 @@ void SelectMgr_RectangularFrustum::segmentSegmentDistance (const gp_Pnt& theSegP if (aTn < 0.0) { aTn = 0.0; - if (-aD < 0.0) - aSn = 0.0; - else if (-aD > anA) - aSn = aSd; - else { - aSn = -aD; - aSd = anA; - } } else if (aTn > aTd) { aTn = aTd; - if ((-aD + aB) < 0.0) - aSn = 0; - else if ((-aD + aB) > anA) - aSn = aSd; - else { - aSn = (-aD + aB); - aSd = anA; - } } - aSc = (Abs (aSn) < Precision::Confusion() ? 0.0 : aSn / aSd); aTc = (Abs (aTn) < Precision::Confusion() ? 0.0 : aTn / aTd); SelectMgr_Vec3 aClosestPnt = myNearPickedPnt + myViewRayDir * aTc; -- 2.20.1