From: vsv Date: Mon, 6 Apr 2020 14:36:58 +0000 (+0300) Subject: Issue #18882 (Tuleap): Improve calculation of projection point. X-Git-Tag: V9_5_0b1~61 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3fec5ec2cc16432fe551a03d3f350257d2eb2fac;p=modules%2Fshaper.git Issue #18882 (Tuleap): Improve calculation of projection point. --- 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;