]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR3DView.cxx
BUG 1396 ViewerNV ntype 6 the image 3D is not in the center of the screen
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / wxVtkMPR3DView.cxx
index ba470de5dbb039e7aba41c4190e5417975c26c5b..f97208ad6349cf9f34c76ce52d8602453ed6e516 100644 (file)
@@ -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);
+
 }
 
 //-------------------------------------------------------------------