X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FmaracasVisuLib%2Fsrc%2Finterface%2FwxWindows%2Fwidgets%2FwxVtk2DBaseView.cxx;h=61607c373e2075bf13ba759877412a49b7a2f260;hb=40dfa1616e1203ecccb8163e7722c76769eddfe3;hp=90f4bf030ed1c2c62eb97a144e18465405899d39;hpb=76e2ec73c0cbddf9c9d55af7e36bc2a6a67f6fb8;p=creaMaracasVisu.git diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index 90f4bf0..61607c3 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -75,6 +75,7 @@ void wxVtk2DBaseView::TransformCoordinate_spacing_ModelToView(double &X,double & //------------------------------------------------------------------- void wxVtk2DBaseView::ResetView() { + printf("EED wxVtk2DBaseView::ResetView"); double spx = 0,spy = 0,spz = 0; int x1 = 1,x2 = 1,y1 = 1,y2 = 1,z1 = 1,z2 = 1; wxVtkBaseView::Configure(); @@ -122,6 +123,17 @@ void wxVtk2DBaseView::ResetView() } + +//------------------------------------------------------------------- +void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData) +{ + if (_imageViewer2XYZ!=NULL) + { + _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData ); + } // if _imageViewer2XYZ +} + + //------------------------------------------------------------------- void wxVtk2DBaseView::Configure(bool okimage) { @@ -159,15 +171,15 @@ void wxVtk2DBaseView::Configure(bool okimage) vtkImageData *imageData = GetVtkBaseData()->GetMarImageData()->GetImageData(); - if (imageData!=NULL){ - + if (imageData!=NULL) + { imageData->UpdateInformation(); imageData->SetUpdateExtent( imageData->GetWholeExtent()); imageData->Update(); if (okimage==true){ imageData->GetSpacing (spx,spy,spz); imageData->GetExtent (x1,x2,y1,y2,z1,z2); - _imageViewer2XYZ->GetVtkImageViewer2()->SetInput(imageData ); + SetImageToVtkViewer(imageData); _imageViewer2XYZ->SetExtentDimension(x1,x2,y1,y2,z1,z2); double range[2]; imageData->GetScalarRange(range); @@ -195,8 +207,8 @@ void wxVtk2DBaseView::Configure(bool okimage) // SetInteractorStyleImage( vtkInteractorStyleBaseView2D::New() ); - vtkImageViewer2 *IV2=_imageViewer2XYZ->GetVtkImageViewer2(); - vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); + vtkImageViewer2 *IV2 = _imageViewer2XYZ->GetVtkImageViewer2(); + vtkCamera *camera = IV2->GetRenderer()->GetActiveCamera(); //EED 17Avril2009 //EED 21 mars 2012 FLIP problem ..PLOP..