]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkPlane2DView.cxx
#3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / vtkPlane2DView.cxx
index 1016dd464e1fdb5b03c5483b99418953634a35ba..1f5ceee9bdbcfefc0a59f14e18dc02b7e05404b2 100644 (file)
@@ -226,17 +226,37 @@ void vtkPlane2DView::Extract_One_PlaneVTK()
 {
        vtkImageData *imagedata = GetVtkmprbasedata()->GetImageData();
        SetPSource(_sizeIma);
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _3Dslices -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
        _3Dslices -> SetSource( imagedata );
+#else
+       _3Dslices -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) );
+       _3Dslices -> SetSourceData( imagedata );
+#endif
+
        _3Dslices -> Update( );
        _stPoints -> GetPointData( )->SetScalars(  _3Dslices->GetOutput()->GetPointData()->GetScalars()  );
        _stPoints -> SetDimensions( _sizeIma, _sizeIma, 1 );
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _stPoints -> SetScalarType( imagedata->GetScalarType() );
        _stPoints -> SetScalarTypeToShort();
        _stPoints -> Update();
 //     _change   -> SetInput( _stPoints );  
 //     _change   -> Update();    //important
        _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _stPoints );
+
+#else
+       _stPoints -> SetScalarType( imagedata->GetScalarType() );
+       _stPoints -> SetScalarTypeToShort();
+       _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _stPoints );
+
+#endif
+
+
 //     _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _change->GetOutput() );
        //      vtkImageActor *imageActor = _imageViewer2XYZ->GetVtkImageViewer2()->GetImageActor();
 }
@@ -276,8 +296,14 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ )
        for ( iWidth=0 ; iWidth<sizeWidth ; iWidth++ )
        {       
                vtkProbeFilter *slice = vtkProbeFilter::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
                slice -> SetInput( ( vtkDataSet* )_pSource->GetOutput( ) );
                slice -> SetSource( imagedata );
+#else
+               slice -> SetInputData( ( vtkDataSet* )_pSource->GetOutput( ) );
+               slice -> SetSourceData( imagedata );
+#endif
                slice -> Update( );
                slicesLST.push_back( slice );
                _pSource->Push( sp );
@@ -287,11 +313,17 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ )
                _imageResult = vtkImageData::New();
                _imageResult -> SetDimensions(_sizeIma,_sizeIma,1);
                _imageResult -> SetSpacing(1,1,1);
-               _imageResult -> SetScalarType( imagedata->GetScalarType() );
                _imageResult -> SetExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+               _imageResult -> SetScalarType( imagedata->GetScalarType() );
                _imageResult -> SetWholeExtent(0,_sizeIma-1,0,_sizeIma-1,0,0);
                _imageResult -> AllocateScalars();
                _imageResult -> Update();
+#else
+               _imageResult -> AllocateScalars(imagedata->GetScalarType(),1);
+#endif
+
        }
        unsigned short *pTemp;
        unsigned short *pResult;
@@ -324,7 +356,12 @@ void vtkPlane2DView::Extract_MIP_PlaneVTK( /*double heightDefinition*/ )
                slicesLST[iWidth]->Delete();
        }
        _imageResult->Modified();
-       _imageViewer2XYZ->GetVtkImageViewer2()->SetInput ( _imageResult );
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+       _imageViewer2XYZ->GetVtkImageViewer2()->SetInput( _imageResult );
+#else
+       _imageViewer2XYZ->GetVtkImageViewer2()->SetInputData( _imageResult );
+#endif
 }
 
 //-------------------------------------------------------------------
@@ -404,7 +441,12 @@ void vtkPlane2DView::HorizontalLine()
        lines->Delete();  //do not delete lines ??
        _lineActor                                      =       vtkActor::New();
     _lineMapper                                        =       vtkPolyDataMapper::New();
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
        _lineMapper->SetInput(_pd);
+#else
+       _lineMapper->SetInputData(_pd);
+#endif
        _lineMapper->ImmediateModeRenderingOn();
        _lineActor->SetMapper(_lineMapper);
        _lineActor->GetProperty()->BackfaceCullingOn();