[vtkusers] Creating an algorithm with a variable number of output ports

David Thompson dcthomp at sandia.gov
Wed Nov 17 21:57:02 EST 2010


> I don't believe you can make output ports repeatable, just input  
> ports. What you may want to look at using a single  
> vtkMultiBlockDataSet as your output type, which is essentially a  
> vector of vtkDataObjects (like vtkTable). That way, all of your  
> outputs can be on one port. If you need to pick off single vtkTables  
> from the output to use downstream, I believe you can use one or more  
> instances of the vtkExtractBlock filter.

Jeff,

The only problem with vtkExtractBlock is that you'll get another  
multiblock dataset out. It may only have one table in it, but I  
haven't seen a filter in VTK that will extract a "leaf" block and  
return just that dataset as a vtkDataObject (so that you might use the  
output as input to another vtkTableAlgorithm). Do you know of one?

	Thanks,
	David

> On Wed, Nov 17, 2010 at 6:33 PM, Ben Medina <ben.medina at gmail.com>  
> wrote:
> Hello all,
>
> I want to create an algorithm that:
> - takes as input a single vtkTable
> - outputs multiple tables, where each table contains all rows from the
> original table that have the same value for a particular column.
>
> I don't see anything that does exactly this, so I believe I need to
> write my own algorithm. I have a couple of questions:
>
> 1) Can an algorithm change its number of output ports during its
> lifetime? In my case, the number of output tables depends entirely on
> the input table, which is not known at construction and could
> potentially change at any time. Perhaps I should be using a repeatable
> output port?
>
> 2) If so, is there an example available to show how this is done?
>
> Thanks,
> Ben
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
> <ATT00002..txt>





More information about the vtkusers mailing list