From 1484229c7f3dab0bc65f08edc2e8d477f92424ff Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Tue, 12 Dec 2017 23:14:17 +0100 Subject: [PATCH] #3155 creaMaracasVisu Feature New Normal - ViewerPlane ComplexBox --- .../wxWindows/widgets/vtkImageViewer2_XYZ.cxx | 10 ++++----- .../widgets/wxMaracas_ViewerWidget.cxx | 21 ++++++++++++------- .../wxWindows/widgets/wxVtk2DBaseView.cxx | 4 +++- .../wxWindows/widgets/wxVtkBaseView.cxx | 2 -- .../wxWindows/widgets/wxVtkMPR2DView.cxx | 3 ++- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkImageViewer2_XYZ.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkImageViewer2_XYZ.cxx index 479db77..69a183f 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkImageViewer2_XYZ.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkImageViewer2_XYZ.cxx @@ -113,14 +113,12 @@ vtkImageViewer2 *vtkImageViewer2_XYZ::GetVtkImageViewer2() return _vtkimageviewer2; } //------------------------------------------------------------------- -void vtkImageViewer2_XYZ::setColorTransferFunction(vtkColorTransferFunction* colortable){ - - +void vtkImageViewer2_XYZ::setColorTransferFunction(vtkColorTransferFunction* colortable) +{ vtkImageMapToWindowLevelColors* imagemaptowindowlevel = _vtkimageviewer2->GetWindowLevel(); - - if(colortable!=NULL&&colortable->GetSize()>0 && _colortable != colortable){ + if(colortable!=NULL&&colortable->GetSize()>0 && _colortable != colortable) + { _colortable = colortable; imagemaptowindowlevel->SetLookupTable(colortable); } - } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx index 8f47f97..b90dbaf 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMaracas_ViewerWidget.cxx @@ -376,25 +376,32 @@ void wxMaracas_ViewerWidget::Refresh(bool eraseBackground ,const wxRect* rect ) wxVtkBaseView *wxMaracas_ViewerWidget::GetwxVtkBaseView() { wxVtkBaseView *wxvtkbaseview=NULL; - if (mvtk2Dbaseview!=NULL){ + if (mvtk2Dbaseview!=NULL) + { wxvtkbaseview = mvtk2Dbaseview; } - if (mvtkmpr2Dview_X!=NULL){ + if (mvtkmpr2Dview_X!=NULL) + { wxvtkbaseview = mvtkmpr2Dview_X; } - if (mvtkmpr2Dview_Y!=NULL){ + if (mvtkmpr2Dview_Y!=NULL) + { wxvtkbaseview = mvtkmpr2Dview_Y; } - if (mvtkmpr2Dview_Z!=NULL){ + if (mvtkmpr2Dview_Z!=NULL) + { wxvtkbaseview = mvtkmpr2Dview_Z; } - if (mvtkplane2Dview!=NULL){ + if (mvtkplane2Dview!=NULL) + { wxvtkbaseview = mvtkplane2Dview; } - if (mwxsphereview!=NULL){ + if (mwxsphereview!=NULL) + { wxvtkbaseview = mwxsphereview; } - if (mwxvtk3Dbaseview_Clipping3D!=NULL){ + if (mwxvtk3Dbaseview_Clipping3D!=NULL) + { wxvtkbaseview = mwxvtk3Dbaseview_Clipping3D; } return wxvtkbaseview ; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx index af726f1..1110fc1 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtk2DBaseView.cxx @@ -112,6 +112,7 @@ void wxVtk2DBaseView::ResetView() imageData->GetSpacing (spx,spy,spz); imageData->GetExtent (x1,x2,y1,y2,z1,z2); } +printf("//EED wxVtk2DBaseView::ResetView %d %d %d %d %d %d \n",x1,x2,y1,y2,z1,z2); _imageViewer2XYZ -> SetExtentDimension(x1,x2,y1,y2,z1,z2); _imageViewer2XYZ -> GetVtkImageViewer2()->SetupInteractor ( iren ); @@ -146,10 +147,11 @@ void wxVtk2DBaseView::ResetView() void wxVtk2DBaseView::SetImageToVtkViewer(vtkImageData *imageData) { int ext[6]; + imageData->Update(); imageData->GetWholeExtent(ext); - _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] ); if (_imageViewer2XYZ!=NULL) { + _imageViewer2XYZ->SetExtentDimension( ext[0],ext[1],ext[2],ext[3],ext[4],ext[5] ); _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( imageData ); } // if _imageViewer2XYZ diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx index 88ce1ac..eb454c9 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkBaseView.cxx @@ -90,9 +90,7 @@ void wxVtkBaseView::Refresh() // virtual //------------------------------------------------------------------- void wxVtkBaseView::RefreshView() // virtual { - printf("EED wxVtkBaseView::RefreshView() \n"); // EED 10 Oct 2007 - #if defined(WIN32) GetRenWin()->Render(); #else diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx index 69a58bb..bf82364 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkMPR2DView.cxx @@ -84,7 +84,8 @@ void wxVtkMPR2DView::Configure() ((vtkInteractorStyleBaseView*)GetInteractorStyleBaseView())->AddInteractorStyleMaracas( _interactorstylemprview ); } - if(img!=NULL){ + if(img!=NULL) + { double* origin = img->GetOrigin(); img->GetExtent(x1,x2,y1,y2,z1,z2); img->GetSpacing(spc); -- 2.47.1