[vtkusers] Constructing closed surface (please help!)

Brad King brad.king at kitware.com
Tue Mar 29 15:23:18 EST 2005


yfl at doc.ic.ac.uk wrote:
> Dear All,
> 
> I have a set of points used to construct a closed surface.
> 
> vtkPolyData *point_data = vtkPolyData::New();
> 	point_data->SetPoints(points);
> 	point_data->Modified();
> 	point_data->Update();
> 
> 	vtkSurfaceReconstructionFilter *reconstruct = 
> vtkSurfaceReconstructionFilter::New();
> 	reconstruct->SetInput(point_data);
> 
> 	vtkContourFilter *contour = vtkContourFilter::New();
> ->	contour->SetInput(reconstruct->GetOutput());
> 	contour->SetValue(0, 1);
> 
> but I got error saying "cannot convert parameter 1 from 'class vtkImageData *' 
> to 'class vtkDataSet *' " (arrow sign)
> 
> So what can I do to pass output of vtkSurfaceReconstructionFilter to 
> vtkContourFilter? Thanks

Add

#include "vtkImageData.h"

so that the compiler knows it can upcast the vtkImageData output of the 
reconstruction filter to the contour filter's vtkDataSet input.

-Brad



More information about the vtkusers mailing list