From: Eduardo DAVILA Date: Fri, 3 May 2013 21:41:51 +0000 (+0200) Subject: BUG 1396 ViewerNV ntype 6 the image 3D is not in the center of the screen X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=251e3a687d15774b15e35a33ad10b45216d08dc7;p=creaMaracasVisu.git BUG 1396 ViewerNV ntype 6 the image 3D is not in the center of the screen --- diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx index 29a97c7..91cfbc2 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx @@ -40,7 +40,8 @@ wxVtkClipping3DView::wxVtkClipping3DView(wxVtk3DBaseView* wxvtk3Dbaseview) } //------------------------------------------------------------------- -wxVtkClipping3DView::~wxVtkClipping3DView(){ +wxVtkClipping3DView::~wxVtkClipping3DView() +{ if (_boxWidgetVolume!=NULL) { _boxWidgetVolume -> Delete(); } if (_boxWidgetS1!=NULL) { _boxWidgetS1 -> Delete(); } if (_vtkclipping3Ddataviewer!=NULL) { delete _vtkclipping3Ddataviewer; } @@ -153,7 +154,9 @@ wxVtk3DBaseView* wxVtkClipping3DView::GetWxvtk3Dbaseview()throw(char*) return _wxvtk3Dbaseview; } //------------------------------------------------------------------- -void wxVtkClipping3DView::Configure(){ +void wxVtkClipping3DView::Configure() +{ + _wxvtk3Dbaseview->Configure(); // Actors are added to the renderer. @@ -228,7 +231,8 @@ void wxVtkClipping3DView::Configure(){ // the camera towards the FocalPoint, thereby enlarging the image. _wxvtk3Dbaseview->GetRenderer()->SetActiveCamera(_wxvtk3Dbaseview->GetCamera()); _wxvtk3Dbaseview->GetRenderer()->ResetCamera (); - _wxvtk3Dbaseview->GetCamera()->Dolly(1.5); + _wxvtk3Dbaseview->GetCamera()->Dolly(2); + // Set a background color for the renderer and set the size of the // render window (expressed in pixels). @@ -241,11 +245,12 @@ void wxVtkClipping3DView::Configure(){ // near plane clips out objects in front of the plane; the far plane // clips out objects behind the plane. This way only what is drawn // between the planes is actually rendered. - _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); +//EEDUPS _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); _vtkclipping3Ddataviewer->SetRenderer(this->GetWxvtk3Dbaseview()->GetRenderer()); _vtkclipping3Ddataviewer->SetInteractor(this->GetWxvtk3Dbaseview()->GetWxVTKRenderWindowInteractor()); + } //------------------------------------------------------------------- void wxVtkClipping3DView::SetVtkClipping3DDataViewer(vtkClipping3DDataViewer *vtkclipping3Ddataviewer) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx index ba470de..f97208a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx @@ -183,14 +183,17 @@ void wxVtkMPR3DView::RemoveActor(vtkActor* actor) //------------------------------------------------------------------- void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc) { - if(ext == NULL){ - _wxvtk3Dbaseview->GetRenderer()->ResetCamera (); - _wxvtk3Dbaseview->GetCamera()->Dolly(2.0); + if(ext == NULL) + { //EED 21 mars 2012 FLIP probleme ..PLOP.. +//EED 13 may 2013 FLIP probleme ..PLOP.. _wxvtk3Dbaseview->GetCamera()->Roll(180); _wxvtk3Dbaseview->GetCamera()->Yaw(180+30); _wxvtk3Dbaseview->GetCamera()->Pitch(-22); + + _wxvtk3Dbaseview->GetRenderer()->ResetCamera (); + _wxvtk3Dbaseview->GetCamera()->Dolly(2.0); }else{ @@ -213,10 +216,8 @@ void wxVtkMPR3DView::ResetCamera(int* ext, double* origin,double* spc) _wxvtk3Dbaseview->GetRenderer()->ResetCamera(x0,x1,y0,y1,z0,z1); //_wxvtk3Dbaseview->GetCamera()->SetPosition(x,y,z); - _wxvtk3Dbaseview->GetCamera()->Dolly(1.5); - - } - + _wxvtk3Dbaseview->GetCamera()->Dolly(1.5); + } } //------------------------------------------------------------------- @@ -238,26 +239,7 @@ void wxVtkMPR3DView::Configure() // _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkmpr3Ddataviewer->GetImageActor(2) ); // _coronal - // An initial camera view is created. The Dolly() method moves - // the camera towards the FocalPoint, thereby enlarging the image. - _wxvtk3Dbaseview->GetRenderer()->SetActiveCamera(_wxvtk3Dbaseview->GetCamera()); - this->ResetCamera(); - - - // Set a background color for the renderer and set the size of the - // render window (expressed in pixels). - _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 ); -//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400); - - // Note that when camera movement occurs (as it does in the Dolly() - // method), the clipping planes often need adjusting. Clipping planes - // consist of two planes: near and far along the view direction. The - // near plane clips out objects in front of the plane; the far plane - // clips out objects behind the plane. This way only what is drawn - // between the planes is actually rendered. - _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); - - + // vtkPointWidget //if(_myCallback!=NULL){ //_myCallback->Delete(); @@ -338,6 +320,27 @@ void wxVtkMPR3DView::Configure() // PlaneWidget + +// An initial camera view is created. The Dolly() method moves + // the camera towards the FocalPoint, thereby enlarging the image. + _wxvtk3Dbaseview->GetRenderer()->SetActiveCamera(_wxvtk3Dbaseview->GetCamera()); + + // Note that when camera movement occurs (as it does in the Dolly() + // method), the clipping planes often need adjusting. Clipping planes + // consist of two planes: near and far along the view direction. The + // near plane clips out objects in front of the plane; the far plane + // clips out objects behind the plane. This way only what is drawn + // between the planes is actually rendered. + _wxvtk3Dbaseview->GetRenderer()->ResetCameraClippingRange(); + + this->ResetCamera(); + + + // Set a background color for the renderer and set the size of the + // render window (expressed in pixels). + _wxvtk3Dbaseview->GetRenderer()->SetBackground( 0.36 , 0.36 , 0.36 ); +//EED 23oct2010 _wxvtk3Dbaseview->GetRenWin()->SetSize(400, 400); + } //-------------------------------------------------------------------