[Paraview] How to get the name of a block in a programmable filter
LB
bravo.loic at gmail.com
Thu Dec 18 08:44:43 EST 2014
Hi,
I would like to define a custom programmable filter to work with
MultiBlockDatasets. In that filter, I need to access to the name of each
block being processed. By "name", I mean the information given in the
"Information>Data Hierarchy" tree.
Could you explain me how to access to that information in a programmable
filter?
Fort information, here is a code example of what I would like to do:
[code]
from paraview.vtk import dataset_adapter as DA
input = self.GetInputDataObject(0, 0)
output = self.GetOutputDataObject(0)
def process_block(input_block, output_block) :
data = input_block.PointData['data']
if data is None :
print 'data is None'
else :
# <<<< get the name of input_block >>>>
print 'do something with data'
iter = DA.MultiCompositeDataIterator([input, output])
for input_block, output_block in iter:
process_block(input_block, output_block)
[/code]
B. L.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20141218/bfdc71f5/attachment.html>
More information about the ParaView
mailing list