]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx
Changing method to transform coordinates
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtkBaseView.cxx
index 128a8446e16a65f50e84c0647f0e54233ba1ff8a..c2be59111ba4abc2bda1004f1806f2f3f53aae4f 100644 (file)
@@ -90,9 +90,9 @@ vtkRenderWindow* wxVtkBaseView::GetRenWin()           // virtual
 }
 
 //----------------------------------------------------------------------------
-                                       
-void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2
-{  
+
+void wxVtkBaseView::TransCoordScreenToWorld(double &X, double &Y, double &Z)
+{
        GetRenderer()->SetDisplayPoint((int)X, (int)Y, (int)Z);
        GetRenderer()->DisplayToWorld();
        double fP[4];
@@ -103,10 +103,28 @@ void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z,
                fP[2] /= fP[3];
        }
 
+       X = fP[0];
+       Y = fP[1];
+       Z = fP[2];
+}
+//----------------------------------------------------------------------------
+                                       
+void wxVtkBaseView::TransFromCoordScreenToWorld(double &X, double &Y, double &Z, bool keepNormalDirection, int type) //virtual //keepNormalDirection=false, type=2
+{  
+
+       //RaC 03-2010
+       TransCoordScreenToWorld(X,Y,Z);
+
 // EEDx5
        //JCP 13/05/2009
        vtkInteractorStyleBaseView* interactorstyle = (vtkInteractorStyleBaseView*)this->GetInteractorStyleBaseView();
        wxVtk2DBaseView* baseview = (wxVtk2DBaseView*)interactorstyle->GetWxVtk2DBaseView();
+
+       double fP[3];
+       fP[0] = X;
+       fP[1] = Y;
+       fP[2] = Z;
+
        baseview->TransformCoordinate_spacing_ViewToModel( fP[0] , fP[1] , fP[2] );
        //JCP 13/05/2009