X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtk3DBaseView.cxx;h=9d92c225526295afd8d36d392e09c339d3e1f7df;hb=3d1c0689f4e1844c8f170d9c20f8ad38b34d98b6;hp=699750d2b6fcf01a33da8f9fa6c73e45662b0e14;hpb=e4ef2b5df5aac431ff3b806f83b7dd5e55e89d86;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx index 699750d..9d92c22 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk3DBaseView.cxx @@ -73,6 +73,42 @@ void wxVtk3DBaseView::Refresh() vri->vtkRenderWindowInteractor::Render(); } +//------------------------------------------------------------------- +// EED 27/05/2013 +void wxVtk3DBaseView::ResetCamera(int* ext, double* spc) +{ + + GetRenderer()->ResetCameraClippingRange(); + + if(ext == NULL) + { + + GetRenderer()->ResetCamera (); + GetCamera()->Dolly(1.2); + }else{ + + /*double x = (spc[0])*(origin[0]+(((double)ext[1]-(double)ext[0])/2.0)); + double y = (spc[1])*(origin[1]+(double)ext[3]); + double z = (spc[2])*(origin[2]+(((double)ext[5]-(double)ext[4])/2.0));*/ + /*double x0=(spc[0])*((double)ext[0]+origin[0]); + double x1=(spc[0])*((double)ext[1]+origin[0]); + double y0=(spc[1])*((double)ext[2]+origin[1]); + double y1=(spc[1])*((double)ext[3]+origin[1]); + double z0=(spc[2])*((double)ext[4]+origin[2]); + double z1=(spc[2])*((double)ext[5]+origin[2]);*/ + + double x0=(spc[0])*((double)ext[0]); + double x1=(spc[0])*((double)ext[1]); + double y0=(spc[1])*((double)ext[2]); + double y1=(spc[1])*((double)ext[3]); + double z0=(spc[2])*((double)ext[4]); + double z1=(spc[2])*((double)ext[5]); + + GetRenderer()->ResetCamera(x0,x1,y0,y1,z0,z1); + //_wxvtk3Dbaseview->GetCamera()->SetPosition(x,y,z); + GetCamera()->Dolly(1.5); + } +} //------------------------------------------------------------------- void wxVtk3DBaseView::SetStereo(int type) @@ -148,6 +184,16 @@ void wxVtk3DBaseView::Configure() _aCamera->SetFocalPoint (0, 0, 0); _aCamera->ComputeViewPlaneNormal(); +//EED 27/05/2013 + GetRenderer()->SetActiveCamera(GetCamera()); + +//EED 21 mars 2012 FLIP probleme ..PLOP.. +//EED 13 may 2013 FLIP probleme ..PLOP.. + GetCamera()->Roll(180); + GetCamera()->Yaw(180+30); + GetCamera()->Pitch(-22); + + } } //-------------------------------------------------------------------