void SurfaceRenderingImageStencilExport::Execute(vtkImageData *data){
- vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
-
vtkSmartPointer<vtkPolyDataToImageStencil> polytostencil = vtkSmartPointer<vtkPolyDataToImageStencil>::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
+ vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
polytostencil->SetInput(polydata);
+#else
+ vtkPolyData* polydata = (vtkPolyData*)this->GetInput();
+ polytostencil->SetInputData(polydata);
+#endif
polytostencil->Update();
double *bounds = polydata->GetBounds();
vtkSmartPointer<vtkImageData> imagein = vtkSmartPointer<vtkImageData>::New();
imagein->SetExtent(bounds[0] - 1, bounds[1] + 1, bounds[2] - 1, bounds[3] + 1, bounds[4] - 1, bounds[5] + 1);
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
imagein->SetScalarTypeToUnsignedShort();
imagein->AllocateScalars();
+#else
+ imagein->AllocateScalars(VTK_UNSIGNED_SHORT,1);
+#endif
int* extent = imagein->GetExtent();
}
vtkSmartPointer<vtkImageStencil> stencil = vtkSmartPointer<vtkImageStencil>::New();
+
+//EED 2017-01-01 Migration VTK7
+#if VTK_MAJOR_VERSION <= 5
stencil->SetInput(imagein);
stencil->SetStencil(polytostencil->GetOutput());
+#else
+ stencil->SetInputData(imagein);
+ stencil->SetStencilData(polytostencil->GetOutput());
+#endif
+
stencil->ReverseStencilOn();
stencil->SetBackgroundValue(128);
stencil->Update();