[Paraview] Question on Multiple output Custom Readers

Berk Geveci berk.geveci at kitware.com
Tue May 20 14:23:09 EDT 2008


> I am writing another custom reader for our data and I had a question
> about setting the output port information. If I have my reader derive
> from PolyDataAlgorithm, and I generally know how many "data sets"
> there will be, can those datasets actually be something other than a
> vtkPolyData object? For example in our data we have 3 distinct pieces
> of data that we want to be able to display. 2 of those are vtkPolyData
> objects, but the third is a group of unknown (at compile time) number
> of vtkPolyData objects which I was thinking of grouping into a
> vtkMultiBlockDataset?

Sounds good.

> So in the FillOutputPortINformation(int port, vtkInformation* info)
> method can I do something like:
>
> if (port == 0 || port ==1)
>  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkPolyData");
> else if (port == 2)
>  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataset");
>
> Is this possible?

Yes, this is the right way of doing it (except not matching VTK coding style :-)

> and if it is, what ramifications would that have on
> other parts of the pipeline such as applying filters to only the
> port=2 datasets or the port==1 data set?

Since each output port is treated separately in ParaView (meaning, you
apply filters to them separately), this will work just fine.

Make sure to list the output ports in the XML. Search for OutputPort
in readers.xml for an example.

-berk
> Thanks for any insight into this.
> --
> Mike Jackson
> imikejackson _at_ gee-mail dot com
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
>


More information about the ParaView mailing list