From 3fec5ec2cc16432fe551a03d3f350257d2eb2fac Mon Sep 17 00:00:00 2001 From: vsv Date: Mon, 6 Apr 2020 17:36:58 +0300 Subject: [PATCH] Issue #18882 (Tuleap): Improve calculation of projection point. --- src/PartSet/PartSet_Tools.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/PartSet/PartSet_Tools.cpp b/src/PartSet/PartSet_Tools.cpp index 2bb8ccb2d..e67624da0 100644 --- a/src/PartSet/PartSet_Tools.cpp +++ b/src/PartSet/PartSet_Tools.cpp @@ -115,18 +115,14 @@ gp_Pnt PartSet_Tools::convertClickToPoint(QPoint thePoint, Handle(V3d_View) theV if (theView.IsNull()) return gp_Pnt(); - V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt; - theView->Eye(XEye, YEye, ZEye); - + V3d_Coordinate XAt, YAt, ZAt; theView->At(XAt, YAt, ZAt); - gp_Pnt EyePoint(XEye, YEye, ZEye); gp_Pnt AtPoint(XAt, YAt, ZAt); - if (EyePoint.Distance(AtPoint) < Precision::Confusion()) - return gp_Pnt(); - - gp_Vec EyeVector(EyePoint, AtPoint); - gp_Dir EyeDir(EyeVector); + double aX, aY, aZ; + theView->Proj(aX, aY, aZ); + gp_Dir EyeDir(aX, aY, aZ); + EyeDir.Reverse(); gp_Pln PlaneOfTheView = gp_Pln(AtPoint, EyeDir); Standard_Real X, Y, Z; -- 2.39.2