[vtkusers] about example on page 126(VTK user's guide)
Amy Squillacote
amy.squillacote at kitware.com
Tue Dec 5 08:57:04 EST 2006
Please keep the discussion on the mailing list. That way other people
can contribute to the discussion, and the solutions are archived for
future reference.
In the example listed in the VTK FAQ, the compiler could not convert
from vtkDataSet to vtkImageData, so to resolve this, vtkImageData.h
needed to be included. In your case, the compiler does not know that a
vtkPolyData is a vtkPointSet; to resolve this, you should include
vtkPolyData.h.
- Amy
jere ju wrote:
> i tried to add the file "vtkImageData.h", but it's still wrong?
> my code:
> vtkImageReader *reader = vtkImageReader::New();
> reader->SetDataByteOrderToLittleEndian();
> reader->SetDataExtent(0,63,0,63,40,40);
> reader->SetFilePrefix("H:\\vtk40Data\\VTKData\\Data\\headsq\\quarter");
> reader->SetDataMask(0x7fff);
>
> vtkImageDataGeometryFilter *geometry = vtkImageDataGeometryFilter::New();
> geometry->SetInput(reader->GetOutput());
>
> vtkWarpScalar *warp = vtkWarpScalar::New();
> warp->SetInput(geometry->GetOutput());
> warp->SetScaleFactor(0.005);
>
>
> error C2664: 'SetInput' : cannot convert parameter 1 from 'class
> vtkPolyData *' to 'class vtkPointSet *'
> Types pointed to are unrelated; conversion requires
> reinterpret_cast, C-style cast or function-style cast
More information about the vtkusers
mailing list