[vtkusers] Re: How to write multiple vtkPolyData into on single XML file

Goodwin Lawlor goodwin.lawlor at ucd.ie
Mon Nov 1 13:53:19 EST 2004


Hi Patrick,

Do you want each line to have its own mapper and actor? You may not need
to... cells can be picked and colored individually. Do you need to be able
to transform each line?

You can try to use vtkPolyDataConnectivityFilter for a start... get the
number of connected regions, then specifiy by region number one at a time
and then DeepCopy each output into a new vtkPolyData (haven't tried this but
its a suggestion).

If you want each cell (be it a line or polyline) to have its own
mapper/actor, then you can loop through the appended polydata's cells,
copying each cell's topology (vtkCellArray) and geometry (vtkPoints) into
its own vtkPolyData.

hth

Goodwin

ps Q's are best kept on the mailing list for posterity

----- Original Message ----- 
From: "Peng (Patrick) Cheng" <peng-cheng at uiowa.edu>
To: "Goodwin Lawlor" <goodwin.lawlor at ucd.ie>
Sent: Monday, November 01, 2004 5:46 PM
Subject: Re: [vtkusers] Re: How to write multiple vtkPolyData into on single
XML file


> Hi Goodwin,
> I have another question, I did as you told me, append the data and write
> to a single file. and then I can read them back, but it only gives me
> one dataset, How can I extract the original lines out of the vtkXMLReader?
> thanks
> Patrick
>
> Goodwin Lawlor wrote:
> > Hi Patrick,
> >
> > Use vtkAppendPolyData to append all your polydatas into one, then write
this
> > appended polydata out using vtkXMLWriter.
> >
> > hth
> >
> > Goodwin
> >
> > "Peng (Patrick) Cheng" <peng-cheng at uiowa.edu> wrote in message
> > news:418177F6.8050800 at uiowa.edu...
> >
> >>hi all,
> >>
> >>I have hundreds of vtkPolyData in a list need to be output to a XML
> >>file, and later on read back. each of them is a line with a points and a
> >>scalars. I was just wondering is it possible to write all these data
> >>into  one XML file with current vtkXMLWriter? or do I have to output one
> >>file for each vtkPolyData?
> >>
> >>Patrick
> >>-- 
> >>
> >>Peng (Patrick) Cheng
> >>Research Assistant
> >>Radiology, Magnetic Resonance Imaging (MRI) Center
> >>University of Iowa Hospital and Clinics
> >>Iowa City, IA 52246
> >>
> >>Office:  0453-E JCP
> >>Phone:   (319)356-7808 (O)
> >>          (319)400-7442 (C)
> >>Email:   peng-cheng at uiowa.edu
> >>Website: http://css.engineering.uiowa.edu/~pcheng/
> >>
> >>
> >>
> >>_______________________________________________
> >>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
> >>
> >
> >
> >
> >
> > _______________________________________________
> > 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
> >
>
> -- 
>
> Peng (Patrick) Cheng
> Research Assistant
> Radiology, Magnetic Resonance Imaging (MRI) Center
> University of Iowa Hospital and Clinics
> Iowa City, IA 52246
>
> Office:  0453-E JCP
> Phone:   (319)356-7808 (O)
>           (319)400-7442 (C)
> Email:   peng-cheng at uiowa.edu
> Website: http://css.engineering.uiowa.edu/~pcheng/
>
>
>
>




More information about the vtkusers mailing list