From 388c128b0ad9005041c29d9e7c7426ec3470c17b Mon Sep 17 00:00:00 2001 From: Eduardo DAVILA Date: Thu, 10 Aug 2017 12:01:35 +0200 Subject: [PATCH] #3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7 --- CMakeLists.txt | 4 +- .../widgets/vtkClipping3DDataViewer.cxx | 36 +++------------ .../widgets/vtkClipping3DDataViewer.h | 8 +--- .../wxWindows/widgets/vtkMPR3DDataViewer.cxx | 17 ++++--- .../wxWindows/widgets/wxMPRWidget.cxx | 44 ++++++++----------- .../wxWindows/widgets/wxVtkClipping3DView.cxx | 1 - 6 files changed, 40 insertions(+), 70 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d699297..4b8e3d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,8 +52,8 @@ ENDIF(BUILD_TESTING) #----------------------------------------------------------------------------- SET(PROJECT_MAJOR_VERSION 1) -SET(PROJECT_MINOR_VERSION 1) -SET(PROJECT_BUILD_VERSION 1) +SET(PROJECT_MINOR_VERSION 2) +SET(PROJECT_BUILD_VERSION 0) #================================== diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx index 1e723a1..68f8c2b 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.cxx @@ -60,9 +60,7 @@ vtkClipping3DDataViewer::~vtkClipping3DDataViewer() _tissuePlanes[i]->Delete(); _tissueClipper[i]->Delete(); } - _outlineData->Delete(); - _mapOutline->Delete(); - _outline->Delete(); + // Volume _tfun->Delete(); _ctfun->Delete(); @@ -78,11 +76,7 @@ vtkClipping3DDataViewer::~vtkClipping3DDataViewer() } _observerV-> Delete(); } -//------------------------------------------------------------------- -vtkActor* vtkClipping3DDataViewer::GetOutlineActor() -{ - return _outline; -} + //------------------------------------------------------------------- vtkClipPolyData* vtkClipping3DDataViewer::GetTissueClipper(int id) { @@ -260,16 +254,18 @@ void vtkClipping3DDataViewer::Configure_Tissue() imagedata->GetExtent(x1,x2,y1,y2,z1,z2); _tissuePlanes[i]->SetBounds (x1,x2,y1,y2,z1,z2); _tissueClipper[i] = vtkClipPolyData::New(); + _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] ); + _tissueClipper[i]->InsideOutOn( ); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _tissueClipper[i]->SetInput( _tissueStripper[i]->GetOutput() ); #else _tissueClipper[i]->SetInputData( _tissueStripper[i]->GetOutput() ); + printf("EED vtkClipping3DDataViewer::Configure_Tissue Update\n"); + _tissueClipper[i]->Update(); #endif - _tissueClipper[i]->SetClipFunction( _tissuePlanes[i] ); - _tissueClipper[i]->InsideOutOn( ); _tissueMapper[i] = vtkPolyDataMapper::New( ); //EED 2017-01-01 Migration VTK7 @@ -277,6 +273,7 @@ void vtkClipping3DDataViewer::Configure_Tissue() _tissueMapper[i]->SetInput( _tissueClipper[i]->GetOutput() ); #else _tissueMapper[i]->SetInputData( _tissueClipper[i]->GetOutput() ); + _tissueMapper[i]->Update(); #endif @@ -529,25 +526,6 @@ void vtkClipping3DDataViewer::Configure() Configure_Tissue(); Configure_Volume(); Configure_VolumeBox(); - // An outline provides context around the data. - // - _outlineData = vtkOutlineFilter::New(); - -//EED 2017-01-01 Migration VTK7 -#if VTK_MAJOR_VERSION <= 5 - _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); -#else - _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() ); -#endif - - _mapOutline = vtkPolyDataMapper::New(); - -//EED 4 nov 2015 Estelle -// _mapOutline->SetInput(_outlineData->GetOutput()); - - _outline = vtkActor::New(); - _outline->SetMapper(_mapOutline); - _outline->GetProperty()->SetColor(0,0,0); } diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h index 2822ca3..0c998de 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClipping3DDataViewer.h @@ -57,7 +57,8 @@ public: virtual ~vtkClipping3DDataViewer(); // vtkImageActor* GetImageActor(int id); - vtkActor* GetOutlineActor(); + + vtkClipPolyData* GetTissueClipper(int id); vtkPolyDataMapper* GetTissueMapper(int id); vtkPlanes* GetTissuePlanes(int id); @@ -146,11 +147,6 @@ private: vtkPlanes *_tissuePlanes[ VTKMPRDATA_MAXTISSUE ]; vtkClipPolyData *_tissueClipper[ VTKMPRDATA_MAXTISSUE ]; - // outline - vtkOutlineFilter *_outlineData; - vtkPolyDataMapper *_mapOutline; - vtkActor *_outline; - /// Volume vtkPiecewiseFunction *_tfun; vtkColorTransferFunction *_ctfun; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx index e43df9a..f352067 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkMPR3DDataViewer.cxx @@ -281,16 +281,16 @@ void vtkMPR3DDataViewer::Configure() _saggitalColors = vtkImageMapToColors::New(); } _saggitalColors->RemoveAllInputs(); + // _saggitalColors->SetLookupTable(_bwLut); + _saggitalColors->SetLookupTable(_ctfun); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _saggitalColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _saggitalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _saggitalColors->Update(); #endif - // _saggitalColors->SetLookupTable(_bwLut); - - _saggitalColors->SetLookupTable(_ctfun); if(_saggital==NULL) @@ -317,16 +317,17 @@ void vtkMPR3DDataViewer::Configure() } _axialColors->RemoveAllInputs(); + // _axialColors->SetLookupTable(_hueLut); + _axialColors->SetLookupTable(_ctfun); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _axialColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _axialColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _axialColors->Update(); #endif - // _axialColors->SetLookupTable(_hueLut); - _axialColors->SetLookupTable(_ctfun); if(_axial==NULL) { @@ -351,16 +352,17 @@ void vtkMPR3DDataViewer::Configure() _coronalColors = vtkImageMapToColors::New(); } _coronalColors->RemoveAllInputs(); + // _coronalColors->SetLookupTable(_satLut); + _coronalColors->SetLookupTable(_ctfun); //EED 2017-01-01 Migration VTK7 #if VTK_MAJOR_VERSION <= 5 _coronalColors->SetInput( _vtkmprbasedata->GetImageData() ); #else _coronalColors->SetInputData( _vtkmprbasedata->GetImageData() ); + _coronalColors->Update(); #endif - // _coronalColors->SetLookupTable(_satLut); - _coronalColors->SetLookupTable(_ctfun); if(_coronal==NULL) { @@ -391,6 +393,7 @@ void vtkMPR3DDataViewer::Configure() _outlineData->SetInput((vtkDataSet *) _vtkmprbasedata->GetImageData() ); #else _outlineData->SetInputData((vtkDataSet *) _vtkmprbasedata->GetImageData() ); + _outlineData->Update(); #endif } // if _image diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx index 99fad9d..bdbf0b5 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxMPRWidget.cxx @@ -655,41 +655,35 @@ void wxMPRWidget::ConfigureVTK(){ if (_vtkmprbasedata!=NULL) { _vtkmprbasedata->Configure(); - x=_vtkmprbasedata -> GetMaxPositionX()/2; - y=_vtkmprbasedata -> GetMaxPositionY()/2; - z=_vtkmprbasedata -> GetMaxPositionZ()/2; + x = _vtkmprbasedata->GetMaxPositionX()/2; + y = _vtkmprbasedata->GetMaxPositionY()/2; + z = _vtkmprbasedata->GetMaxPositionZ()/2; _vtkmprbasedata->SetX( x ); _vtkmprbasedata->SetY( y ); _vtkmprbasedata->SetZ( z ); } - if(_vtkmpr2Dview[0]!=NULL) {_vtkmpr2Dview[0] -> Configure();} - if(_vtkmpr2Dview[1]!=NULL) {_vtkmpr2Dview[1] -> Configure();} - if(_vtkmpr2Dview[2]!=NULL) {_vtkmpr2Dview[2] -> Configure();} + if(_vtkmpr2Dview[0]!=NULL) { _vtkmpr2Dview[0]->Configure(); } + if(_vtkmpr2Dview[1]!=NULL) { _vtkmpr2Dview[1]->Configure(); } + if(_vtkmpr2Dview[2]!=NULL) { _vtkmpr2Dview[2]->Configure(); } + if (_vtkmpr2Dview_B[0]!=NULL) { _vtkmpr2Dview_B[0]->Configure(); } + if (_vtkmpr2Dview_B[1]!=NULL) { _vtkmpr2Dview_B[1]->Configure(); } + if (_vtkmpr2Dview_B[2]!=NULL) { _vtkmpr2Dview_B[2]->Configure(); } - if (_vtkmpr2Dview_B[0]!=NULL) { _vtkmpr2Dview_B[0] -> Configure(); } - if (_vtkmpr2Dview_B[1]!=NULL) { _vtkmpr2Dview_B[1] -> Configure(); } - if (_vtkmpr2Dview_B[2]!=NULL) { _vtkmpr2Dview_B[2] -> Configure(); } + if (_vtkplane2Dview!=NULL) { _vtkplane2Dview->Configure(); } + if (_widgetMesure!=NULL) { _widgetMesure->ConfigureA(_vtkplane2Dview); } + if (_widgetMesure!=NULL) { _widgetMesure->SetActiveLink(true); } + if (_wxsphereview!=NULL) { _wxsphereview->Configure(); } + if (_wxvtk3Dbaseview_MPRClipping3D!=NULL){_wxvtk3Dbaseview_MPRClipping3D->Configure();} + if (_wxvtkmpr3Dview!=NULL) { _wxvtkmpr3Dview->Configure(); } + if (_wxvtkclipping3Dview!=NULL) { _wxvtkclipping3Dview->Configure(); } - - - if (_vtkplane2Dview!=NULL){_vtkplane2Dview -> Configure();} - if (_widgetMesure!=NULL){_widgetMesure -> ConfigureA(_vtkplane2Dview);} - if (_widgetMesure!=NULL){_widgetMesure -> SetActiveLink(true);} - if (_wxsphereview!=NULL){_wxsphereview -> Configure();} - - if (_wxvtk3Dbaseview_MPRClipping3D!=NULL){_wxvtk3Dbaseview_MPRClipping3D -> Configure();} - if (_wxvtkmpr3Dview!=NULL){ - _wxvtkmpr3Dview -> Configure(); - } - if (_wxvtkclipping3Dview!=NULL){_wxvtkclipping3Dview -> Configure();} - - if (_vtkplane2Dview_B!=NULL){ _vtkplane2Dview_B -> Configure(); } - if (_widgetMesure_B!=NULL){ _widgetMesure_B -> ConfigureA( _vtkplane2Dview_B ); } - if (_widgetMesure_B!=NULL){ _widgetMesure_B -> SetActiveLink(true); } + if (_vtkplane2Dview_B!=NULL) { _vtkplane2Dview_B->Configure(); } + if (_widgetMesure_B!=NULL) { _widgetMesure_B->ConfigureA( _vtkplane2Dview_B ); } + if (_widgetMesure_B!=NULL) { _widgetMesure_B->SetActiveLink(true); } //EEDx3 // double spc[3]; diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx index 6172e1d..4fd2218 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/wxVtkClipping3DView.cxx @@ -168,7 +168,6 @@ void wxVtkClipping3DView::Configure() _wxvtk3Dbaseview->Configure(); // Actors are added to the renderer. - _wxvtk3Dbaseview->GetRenderer()->AddActor( _vtkclipping3Ddataviewer->GetOutlineActor() ); _boxWidgetS1 = vtkBoxWidget::New(); _boxWidgetS1->SetInteractor( _wxvtk3Dbaseview->GetWxVTKRenderWindowInteractor() ); -- 2.47.1