[vtkusers] vtkTexture::SetInput(ImageData*) method not found
James Kyle
krunk7 at gmail.com
Tue Oct 23 14:46:07 EDT 2007
I am attempting to use a png image as a sphere texture. However, I'm
getting the following compile time error (source block at end of post):
> VTKViewController.mm:108: error: no matching function for call to
> 'vtkTexture::SetInput(vtkImageData*)'
> /usr/local/VTK/include/vtk-5.0/vtkImageAlgorithm.h:59: note:
> candidates are: void vtkImageAlgorithm::SetInput(vtkDataObject*)
> /usr/local/VTK/include/vtk-5.0/vtkImageAlgorithm.h:60:
> note: void vtkImageAlgorithm::SetInput(int,
> vtkDataObject*)
I referred to the online documentation and the method is listed as
valid (from the online header):
> 00154: void SetInput( vtkImageData *input );
> 00155: vtkImageData *GetInput();
I then looked at my local vtkTexture.h file in /usr/local/VTK/include/
vtk-5.0/vtkTexture.h and the same code block area and see:
> //BTX
> // Description:
> // This process object accepts image data as input.
> vtkImageData *GetInput();
> //ETX
A quick search of the header confirms that no vtkTexture::SetInput
(ImageData*) exists in my local header. From the path above, you can
see I have the latest release of vtk. . . am I missing something
obvious?
===code snippet below===
> vtkActor *tSphereActor = vtkActor::New();
> tSphereActor->SetMapper(pSphereMapper);
>
> vtkTexture *sphereTexture = vtkTexture::New();
> vtkPNGReader *pngReader = vtkPNGReader::New();
> pngReader->SetFileName("./Sphere.png");
> sphereTexture->SetInput(pngReader->GetOutput());
> sphereTexture->InterpolateOn();
> tSphereActor->SetTexture(sphereTexture);
> sphereActor->Delete();
>
Many thanks,
James Kyle
More information about the vtkusers
mailing list