[vtkusers] Get PolyDataObject from a MultiBlockDataSet

Matthew Cragun mcragun at totalsim.us
Fri Oct 8 08:32:24 EDT 2010


Solved my own problem as follows:

1. To get the children of a multiBlockDataSet, I used the
compositeDataIterator.

#Load .vtm
vtmReader = vtkXMLMultiBlockDataReader()
vtmReader.SetFileName("grp_fw.vtm")
vtmReader.Update()
vtm = vtmReader.GetOutput()

#Create composite iterator
it = vtkCompositeDataIterator()
it.SetDataSet(vtm)

#Start the iterator moving through the data (if leaves are 'on' it will only
return actual data objects and not compositeDataSets)
it.InitTraversal()
child = it.GetCurrentDataObject()
it.GoToNextIem()
...

2.  I used the vtkCompositeDataObjectGeometryFilter() to combine all of the
polyDataObjects from the MultiBlockDataSet.


This is probably pretty basic stuff, but it had me stumped for a while, so
hopefully someone else will find it useful.

-- 
Matt Cragun

Engineer
TotalSim LLC
7003 Post Road,
Suite 415
Dublin, Ohio 43016
O: (614) 255-7426
M: (801) 404-6021
E: mcragun at totalsim.us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101008/141b0b73/attachment.htm>


More information about the vtkusers mailing list