[vtkusers] how to write the output of a filter to .vtp file ?

Salman Bhatti salmanbhatti at gmail.com
Fri Nov 25 23:53:20 EST 2005


Hi All,
I have rotated a .vtp model using
vtkActor->RotateX  and rendered it successfully. Now, I want to save this
rotated model as .vtp file .How can I save? code is as follows:


void main( int argc, char *argv[] )
{
vtkXMLPolyDataReader *reader1 = vtkXMLPolyDataReader::New();
    reader1->SetFileName("C:\\VtkProjects\\normal\\bunny_vtp_zipper.vtp");

vtkPolyDataMapper *mapper1 = vtkPolyDataMapper::New();
    mapper1->SetInput(reader1->GetOutput());

    vtkActor *actor1 = vtkActor::New();
    actor1->SetMapper(mapper1);
    //actor1->SetProperty(prop1);
    actor1->RotateX(120);


Is there any possibility to go back through the graphics pipeline as
actor->mapper->source .

We normally use vtkXMLPolyDataWriter to write .vtp model but I am bit
confused how to use it?Problem is that e vtkXMLPolydataWriter needs a
pointer to vtkDataObject while I have VTKActor, I tried to use
vtkXMLPolyDataWriter->Setinput(vtkActor->GetOutput( ))
but it doesnt work as GetOutput doesnt comeup with vtkActor.

Any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20051126/4d1eb3ec/attachment.htm>


More information about the vtkusers mailing list