[vtkusers] vtkPolyDataMapper error

hiba chelbi chelbi.hibatollah at yahoo.fr
Sat Mar 1 15:25:35 EST 2008


Good evening.
I wrote a main file which should show a bitmap image.

int main(int argc, char **argv)
{
    // a renderer and and render window
    vtkRenderer *renderer = vtkRenderer ::New() ;
    vtkRenderWindow *renderWindow = vtkRenderWindow ::New() ;
    renderWindow->AddRenderer(renderer) ;

    // an interactor 
    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor ::New() ;
    iren->SetRenderWindow(renderWindow) ;
    
    // render an image (lights and cameras are created automatically)
    renderWindow->Render() ;

    // charger une image bmp
    vtkImageReader *reader = vtkImageReader ::New();
    reader->SetFileName("C:\Documents and Settings\Hibatollah Chelbi\Mes documents\2.Mes images\Temple.bmp");
    
    vtkTexture *texture = vtkTexture ::New();
    texture->SetInput(reader->GetOutput());

    // map to graphics library
    vtkPolyDataMapper *map = vtkPolyDataMapper :: New();
    map->SetInput(reader->GetOutput()) ;

    // actor coordinates geometry, properties, transformation
    vtkActor *aReader = vtkActor ::New() ; 
    aReader->SetMapper(map) ;

    // add the actor to the scene
    renderer->AddActor(aReader) ;

    // render an image (lights and cameras are created automatically)
    renderWindow->Render() ;

    //begin mouse action
    iren->Start() ;
    
    return 0 ;
}

When i compile it, i have this message:
"'SetInput' : cannot convert parameter 1 from 'class vtkImageData *' to 'class vtkPolyData *'

Is it false what i wrote?? and how can i correct the error?

       
---------------------------------
 Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080301/27d43806/attachment.htm>


More information about the vtkusers mailing list