From: Eduardo DAVILA Date: Fri, 4 Aug 2017 08:19:26 +0000 (+0200) Subject: #3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5d9da84b1d89ea1ab065d3d33c7001f9d9272968;p=creaMaracasVisu.git #3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7 --- diff --git a/bbtk/src/bbmaracasvisuAnimationSphere.cxx b/bbtk/src/bbmaracasvisuAnimationSphere.cxx index dba7dcd..887cd0e 100644 --- a/bbtk/src/bbmaracasvisuAnimationSphere.cxx +++ b/bbtk/src/bbmaracasvisuAnimationSphere.cxx @@ -60,7 +60,12 @@ void AnimationSphere::Process() vtksphere->SetRadius( 1 ); vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 sphereMapper->SetInput( vtksphere->GetOutput() ); +#else + sphereMapper->SetInputData( vtksphere->GetOutput() ); +#endif sphereActor = vtkActor::New(); sphereActor->SetMapper(sphereMapper); @@ -144,7 +149,14 @@ void AnimationSphere::Process() w2i = vtkWindowToImageFilter::New(); png = vtkPNGWriter::New(); w2i->SetInput( bbGetInputRenderer()->GetRenderWindow() ); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 png->SetInput( w2i->GetOutput() ); +#else + png->SetInputData( w2i->GetOutput() ); +#endif + png->SetFileName( newFileName.c_str() ); png->Write(); png->Delete(); diff --git a/bbtk/src/bbmaracasvisuAxeVolume.cxx b/bbtk/src/bbmaracasvisuAxeVolume.cxx index 24d2ef0..1a72bb5 100644 --- a/bbtk/src/bbmaracasvisuAxeVolume.cxx +++ b/bbtk/src/bbmaracasvisuAxeVolume.cxx @@ -91,8 +91,13 @@ void AxeVolume::Process() mimage->SetDimensions(bbGetInputIn()->GetDimensions()); mimage->SetExtent(bbGetInputIn()->GetExtent()); mimage->SetOrigin(bbGetInputIn()->GetOrigin()); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 mimage->SetScalarType( outputformat ); mimage->AllocateScalars(); +#else + mimage->AllocateScalars( outputformat , 1); +#endif int sizeLstPointR = bbGetInputlstPointR().size(); int iAxe,sizeAxe = bbGetInputlstPointX().size(); diff --git a/bbtk/src/bbmaracasvisuDrawAxe3D.cxx b/bbtk/src/bbmaracasvisuDrawAxe3D.cxx index fa7a0cf..f7be326 100644 --- a/bbtk/src/bbmaracasvisuDrawAxe3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxe3D.cxx @@ -120,7 +120,13 @@ void DrawAxe3D::bbUserSetDefaultValues() polydatamapper = vtkPolyDataMapper::New(); mvtkactor = vtkActor::New(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 polydatamapper->SetInput(mallData); +#else + polydatamapper->SetInputData(mallData); +#endif + mvtkactor->SetMapper(polydatamapper); bbSetOutputOut(mvtkactor); } diff --git a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx index fec8240..33bb1d7 100644 --- a/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx +++ b/bbtk/src/bbmaracasvisuDrawAxisTree3D.cxx @@ -49,7 +49,12 @@ void DrawAxisTree3D::DrawOneAxis(int iGeneral,int numPoints, int iAxis) vtkActor *vtkactor = vtkActor::New(); // polydatamapper->ScalarVisibilityOff(); +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 polydatamapper->SetInput(polydata); +#else + polydatamapper->SetInputData(polydata); +#endif vtkactor->SetMapper(polydatamapper); vecVtkPolyData.push_back( polydata ); diff --git a/bbtk/src/bbmaracasvisuImageActor.cxx b/bbtk/src/bbmaracasvisuImageActor.cxx index dcbac34..ad6c30c 100644 --- a/bbtk/src/bbmaracasvisuImageActor.cxx +++ b/bbtk/src/bbmaracasvisuImageActor.cxx @@ -43,9 +43,20 @@ void ImageActor::Process() if(img != NULL){ +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 imageshiftscale->SetInput( img ); +#else + imageshiftscale->SetInputData( img ); +#endif imageshiftscale->SetOutputScalarTypeToUnsignedChar(); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 imageactor->SetInput( imageshiftscale->GetOutput() ); +#else + imageactor->SetInputData( imageshiftscale->GetOutput() ); +#endif if (transform!=NULL){ imageactor->SetUserTransform( transform ); } // transform diff --git a/bbtk/src/bbmaracasvisuImageChangeInformation.cxx b/bbtk/src/bbmaracasvisuImageChangeInformation.cxx index 2c0e510..a0de9ce 100644 --- a/bbtk/src/bbmaracasvisuImageChangeInformation.cxx +++ b/bbtk/src/bbmaracasvisuImageChangeInformation.cxx @@ -47,7 +47,14 @@ void ImageChangeInformation::Process() origin[1]=0.0; origin[2]=0.0; img->SetOrigin(origin); + +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 mchange->SetInput( img ); +#else + mchange->SetInputData( img ); +#endif + //EED 2016 15 06 // mchange->SetExtentTranslation( -ext[0], -ext[2], -ext[4] ); mchange->SetOutputOrigin (0, 0, 0); diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx index ca7fa29..640d4f0 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.cxx +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.cxx @@ -106,8 +106,12 @@ void TransferFunctionView::onColorChange() _ctfun->AddRGBPoint( greylevelcolors[i] , red[i],green[i], blue[i]); } - +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 _tfun->Update(); +#else + //... +#endif bbSetOutputOpacityFunction(_tfun); bbSetOutputColorFunction(_ctfun ); bbSetOutputActive( mwxwidget->GetActive() ); diff --git a/bbtk/src/bbmaracasvisuTransferFunctionView.h b/bbtk/src/bbmaracasvisuTransferFunctionView.h index 6658585..3bbcf89 100644 --- a/bbtk/src/bbmaracasvisuTransferFunctionView.h +++ b/bbtk/src/bbmaracasvisuTransferFunctionView.h @@ -70,11 +70,11 @@ class /*BBTK_EXPORT*/ TransferFunctionView private: //HistogramWidget *mwxwidget; - HistogramDialogComboBox *mwxwidget; - vtkImageData* _currentimg; + HistogramDialogComboBox *mwxwidget; + vtkImageData* _currentimg; - vtkPiecewiseFunction* _tfun; - vtkColorTransferFunction* _ctfun; + vtkPiecewiseFunction* _tfun; + vtkColorTransferFunction* _ctfun; };