[vtkusers] vtkPolyDataWriter

Luca Pallozzi Lavorante lucapl at rc.unesp.br
Wed Oct 13 08:39:36 EDT 2004


alletto at dei.unipd.it wrote:

>Hi all vtkusers,
>
>I tried to modify an actor  (a simple cube) translating and rotating it. I want 
>to keep this information into a file (.vtk) that I write by vtkPolyDataWriter 
>class, but I can't manage to do it.
>I can't save the changes of the actor, and the file contains always the same 
>cube...
>
>Can someone help me?
>
>Thank you in advance for your help.
>
>Michele Alletto
>
>
>
>-------------------------------------------------
>This mail sent through IMP: http://horde.org/imp/
>_______________________________________________
>This is the private VTK discussion list. 
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
>
>  
>
Hi Michele,

you have to modify the geometry of your source object via the following 
pipeline:

vtkCubeSource
         |
 vtkTransformPolyDataFilter-vtkTransform
        |
 vtkPolyDataWriter

You will define translations and rotations using proper methods from the 
vtkTransform class. See vtkTransformPolyDataFilter and vtkTransform´s 
documentation.
The modifications you performed at the actor level didn´t affect its 
geometry in the pipeline. Therefore, when you tried to save it with 
vtkPolyDataWriter the object was not modified.


Hope this help

       Luca




More information about the vtkusers mailing list