X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FBasicGUI%2FBasicGUI.cxx;h=a3ee3bf089030d9b5051f0c83beca56850f5fcbe;hb=982407874b25696ca989bf21ce96e1d309045fcf;hp=e40b013bfea4085c84181a48d9309b36b8f6b91c;hpb=5b3622aa2363853841fd5b4205c78a715bfee4a4;p=modules%2Fgeom.git diff --git a/src/BasicGUI/BasicGUI.cxx b/src/BasicGUI/BasicGUI.cxx index e40b013bf..a3ee3bf08 100644 --- a/src/BasicGUI/BasicGUI.cxx +++ b/src/BasicGUI/BasicGUI.cxx @@ -36,8 +36,9 @@ #include "BasicGUI_PlaneDlg.h" // Method PLANE #include "BasicGUI_MarkerDlg.h" // Method LOCAL COORDINATE SYSTEM -#include +#include "GeometryGUI.h" #include "GeometryGUI_Operations.h" +#include "GEOMUtils.hxx" #include #include @@ -155,7 +156,7 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin } else { OCCViewer_ViewPort3d* vp = ((OCCViewer_ViewWindow*)theViewWindow)->getViewPort(); - aPnt = ConvertClickToPoint( pe->x(), pe->y(), vp->getView() ); + aPnt = GEOMUtils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() ); } aPntDlg->OnPointSelected( aPnt ); // "feed" the point to point construction dialog @@ -165,32 +166,6 @@ bool BasicGUI::OnMousePress( QMouseEvent* pe, SUIT_Desktop* parent, SUIT_ViewWin } -//======================================================================= -// function : ConvertClickToPoint() -// purpose : Returns the point clicked in 3D view -//======================================================================= -gp_Pnt BasicGUI::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView ) -{ - V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt; - aView->Eye( XEye, YEye, ZEye ); - - aView->At( XAt, YAt, ZAt ); - gp_Pnt EyePoint( XEye, YEye, ZEye ); - gp_Pnt AtPoint( XAt, YAt, ZAt ); - - gp_Vec EyeVector( EyePoint, AtPoint ); - gp_Dir EyeDir( EyeVector ); - - gp_Pln PlaneOfTheView = gp_Pln( AtPoint, EyeDir ); - Standard_Real X, Y, Z; - aView->Convert( x, y, X, Y, Z ); - gp_Pnt ConvertedPoint( X, Y, Z ); - - gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project( PlaneOfTheView, ConvertedPoint ); - gp_Pnt ResultPoint = ElSLib::Value( ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(), PlaneOfTheView ); - return ResultPoint; -} - //===================================================================================== // EXPORTED METHODS //=====================================================================================