From: Eduardo DAVILA Date: Thu, 3 Aug 2017 15:14:33 +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=5634a5c573f547422027d38e0da591feafc3460e;p=creaMaracasVisu.git #3109 creaMaracasVisu Bug New Normal - branch vtk7itk4 compilation with vtk7 --- diff --git a/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.cxx b/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.cxx index 0042474..a8a27e1 100644 --- a/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.cxx +++ b/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.cxx @@ -153,12 +153,16 @@ int SurfaceRenderingImageStencilExport::RequestData( vtkInformation *vtkNotUsed stencil->SetBackgroundValue(128); stencil->Update(); - if(ImageOutput) - { - ImageOutput->Delete(); - } - ImageOutput = vtkImageData::New(); - ImageOutput->DeepCopy(stencil->GetOutput()); +// if(ImageOutput) +// { +// ImageOutput->Delete(); +// } +// ImageOutput = vtkImageData::New(); +// ImageOutput->DeepCopy(stencil->GetOutput()); + + output->ShallowCopy( stencil->GetOutput() ); + stencil->Delete(); + return 1; } @@ -173,7 +177,13 @@ int SurfaceRenderingImageStencilExport::RequestData( vtkInformation *vtkNotUsed //------------------------------------------------------------------------------------------- -vtkImageData* SurfaceRenderingImageStencilExport::GetOutputData() -{ - return ImageOutput; -} +//EED 2017-01-01 Migration VTK7 +#if VTK_MAJOR_VERSION <= 5 + vtkImageData* SurfaceRenderingImageStencilExport::GetOutputData() + { + return ImageOutput; + } +#else + // .. +#endif + diff --git a/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.h b/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.h index 5548f52..249c000 100644 --- a/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.h +++ b/lib/Kernel/VTKObjects/SurfaceRenderer/surfacerenderingimagestencilexport.h @@ -32,7 +32,7 @@ #if VTK_MAJOR_VERSION <= 5 #include #else - #include "vtkPolyDataAlgorithm.h" + #include "vtkImageAlgorithm.h" #include "vtkDataObject.h" #include "vtkInformation.h" #include "vtkDemandDrivenPipeline.h" @@ -49,22 +49,21 @@ #if VTK_MAJOR_VERSION <= 5 class SurfaceRenderingImageStencilExport : public vtkDataSetToImageFilter #else -class SurfaceRenderingImageStencilExport : public vtkPolyDataAlgorithm +class SurfaceRenderingImageStencilExport : public vtkImageAlgorithm #endif { public: static SurfaceRenderingImageStencilExport *New(); - vtkTypeMacro(SurfaceRenderingImageStencilExport,vtkPolyDataAlgorithm) - #if VTK_MAJOR_VERSION <= 5 + vtkTypeMacro(SurfaceRenderingImageStencilExport,vtkDataSetToImageFilter) virtual void Update(); + virtual vtkImageData* GetOutputData(); #else - // .. + vtkTypeMacro(SurfaceRenderingImageStencilExport,vtkImageAlgorithm) #endif - virtual vtkImageData* GetOutputData(); protected: //EED 2017-01-01 Migration VTK7 diff --git a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.cxx b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.cxx index bb24468..3ef680a 100644 --- a/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.cxx +++ b/lib/maracasVisuLib/src/interface/wxWindows/widgets/vtkClosePolyData.cxx @@ -126,23 +126,6 @@ vtkClosePolyData::~vtkClosePolyData() } #else -/* - int vtkClosePolyData::ProcessRequest( vtkInformation *request, - vtkInformationVector **inputVector, - vtkInformationVector *outputVector) - { -printf("EED Warning ERROR ! vtkClosePolyData::ProcessRequest not implemented VTK7 migration"); - // generate the data - if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION())) - { - // specify that the output (only one for this filter) will be double - vtkInformation* outInfo = outputVector->GetInformationObject(0); - outInfo->Set(vtkDataObject::SCALAR_TYPE(),VTK_DOUBLE); - return 1; - } - return this->Superclass::ProcessRequest(request,inputVector,outputVector); - } -*/ int vtkClosePolyData::RequestData( vtkInformation *vtkNotUsed(request), vtkInformationVector **inputVector, vtkInformationVector *outputVector) {