[vtkusers] Converting vtkPolyData to vtkStructuredPoints

Dimitris Perperidis dimitrios at perperidis.net
Thu Jul 16 16:50:18 EDT 2009


Hi,

I am very new with VTK. I want to convert vtkPolyData to 
vtkStructurePoints. I have written the following code (which I am not 
sure will do the trick).
vtkPolyData* input;
vtkPolyDataReader* reader;
vtkStructuredPoints* output_sd;
vtkDataSetToDataSetFilter* filter;

input = vtkPolyData::New();
reader = vtkPolyDataReader::New();
filter = vtkDataSetToDataSetFilter::New();

reader->SetFileName(argv[1]);
reader->Modified();


input = reader->GetOutput();
input->Modified();
input->Update();

filter->SetInput(input);

filter->Modified();
filter->Update();

output_sd = filter->GetStructuredPointsOutput();
output_sd->Modified()

<http://davis.lbl.gov/Manuals/VTK-4.5/classvtkDataSetToDataSetFilter.html#a5>i 
get the following compiling error:
44: error: invalid conversion from ‘vtkAlgorithm*’ to 
‘vtkDataSetToDataSetFilter*’ in the statement filter = 
vtkDataSetToDataSetFilter::New();


Any hints on the error and if I am in the right path will be greatly 
appreciated.



More information about the vtkusers mailing list