[vtk-developers] Variable output type
David Doria
daviddoria+vtk at gmail.com
Sat May 29 10:38:27 EDT 2010
On Sat, May 29, 2010 at 8:50 AM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> On Sat, May 29, 2010 at 1:10 AM, David Doria <daviddoria+vtk at gmail.com>
> wrote:
>>
>> I want to make a filter in which I can specify the output type.
>
> You would provide the method :
>
> FillOutputPortInformation( int port, vtkInformation *info )
> {
> if (.... && port == 0)
> {
> info->Set(vtkDataObject::DATA_TYPE_NAME(),
> "vtkMutableUndirectedGraph");
> }
> if (....&& port == 0)
> {
> info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMutableDirectedGraph");
> }
> }
Hm, I tried that:
http://www.rpi.edu/~doriad/VTK_List/OutputType/
but it seems to still force the output type to match the input type.
(even though I specify "ug", the output says "Output is type:
vtkMutableUndirectedGraph" (where it should now be
vtkUndirectedGraph)).
Also, is it then acceptable to in RequestData SafeDownCast the output
to a vtkGraph but assume you can still use functions from the subclass
that was selected?
Thanks,
David
More information about the vtk-developers
mailing list