Salome HOME
Profile object realization. OCC Viewer embeded into the profile dialog box.
[modules/hydro.git] / src / HYDROCurveCreator / CurveCreator_Utils.cxx
index 30779616cf2d7830e0c04fa8af3256aa9d90f765..ec27ddb04599b9e6b98e1d18155032b308876f3e 100644 (file)
 
 #include "CurveCreator_Utils.h"
 
+#include <GEOMUtils.hxx>
+
 #include <gp_Pln.hxx>
 #include <ProjLib.hxx>
 #include <ElSLib.hxx>
 
+//=======================================================================
+// function : ConvertClickToPoint()
+// purpose  : Returns the point clicked in 3D view
+//=======================================================================
+void CurveCreator_Utils::ConvertPointToClick( const gp_Pnt& thePoint,
+                                              Handle(V3d_View) theView,
+                                              int& x, int& y )
+{
+  theView->Convert(thePoint.X(), thePoint.Y(), thePoint.Z(), x, y );
+}
+
 
 //=======================================================================
 // function : ConvertClickToPoint()
@@ -30,6 +43,8 @@
 //=======================================================================
 gp_Pnt CurveCreator_Utils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
 {
+  return GEOMUtils::ConvertClickToPoint( x, y, aView );
+  /*
   V3d_Coordinate XEye, YEye, ZEye, XAt, YAt, ZAt;
   aView->Eye( XEye, YEye, ZEye );
 
@@ -48,4 +63,5 @@ gp_Pnt CurveCreator_Utils::ConvertClickToPoint( int x, int y, Handle(V3d_View) a
   gp_Pnt2d ConvertedPointOnPlane = ProjLib::Project( PlaneOfTheView, ConvertedPoint );
   gp_Pnt ResultPoint = ElSLib::Value( ConvertedPointOnPlane.X(), ConvertedPointOnPlane.Y(), PlaneOfTheView );
   return ResultPoint;
+  */
 }