[vtkusers] Export several vtkActor in a file which will be read in Paraview ?

Ka Lo kalogr at gmail.com
Wed Nov 23 08:40:38 EST 2011


Thanks David,

Now I understand logical use for create data with transformation.

I use a vtkTransform then vtkTransformPolyDataFilter on each data before
create a vtkActor, therefore I can apply rotation or translation.
And, finally, I create a vtkAppendPolyData with all data. Then it's very
easy to create a vtkXMLPolyDataWriter with vtkAppendPolyData output!

=> My generated vtp file work very well in Paraview!


2011/11/22 David Doria <daviddoria at gmail.com>

> On Tue, Nov 22, 2011 at 10:27 AM, Ka Lo <kalogr at gmail.com> wrote:
> > Hello,
> >
> > I'm trying to write some code to export a set of vtkActor build in a
> > vtkRenderer to Paraview.
> > I think there is something I don't understand for export in a compatible
> way
> > to Paraview.
> >
> > For example, I have 300 vtkActor, each vtkActor have a vtkMapper with an
> > input of vtkCubeSource type.
> > And all vtkActor are in the space with size, position, orientation...
> > I wish export my complete space (all vtkActor and theirs positions, size
> and
> > orientation) in a file then open this file in Paraview for visualise all
> > vtkActor in the space.
> >
> > I found several classes for export to output VTK files but it's only for
> one
> > vtkActor. For example, ".vtu" file with vtkXMLUnstructuredGridWriter or
> > ".vtp" file with vtkXMLPolyDataWriter...
> > I have no constraint with output file, only that the file must be read by
> > Paraview.
> >
> > Thanks a lot.
> >
> > Any help would be appreciated.
> >
> > PS: sorry for my english, if you don't understand, I will try to rewrite
> > sentences.
> > --
> > Gregory
>
> As far as I know, you cannot export vtkActor's at all. As you've seen,
> an actor is the result of passing some data (vtkPolyData, for example)
> through a mapper. You can only output the data, which can then be
> viewed in Paraview. If you want to position things in the scene in VTK
> and have them be in the same place in Paraview, you'll have to apply
> transforms to the data itself rather than to the actors.
>
> You can use vtkAppendPolyDataFilter to concatenate all of the data
> before exporting it to a single vtp file.
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20111123/099ce772/attachment.htm>


More information about the vtkusers mailing list