[vtkusers] How to make a filter operate on either mutable directed or mutable undirected graph

Jeff Baumes jeff.baumes at kitware.com
Wed Mar 31 14:13:42 EDT 2010


I see. Yes, in this case you need to specify the output type (directed
or undirected graph) since the input is not a graph. I think you
should override FillOutputPortInformation() to specify this, rather
than overriding RequestDataObject(), although perhaps you should
override both in this case.

Jeff

On Wed, Mar 31, 2010 at 1:42 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
>> vtkGraphAlgorithm already implements RequestDataObject to do just what
>> you want. It will create the same type of graph on output as in the
>> input. The NewInstance() call in
>> vtkGraphAlgorithm::RequestDataObject() accomplishes this.
>>
>> Jeff
>>
>
> Jeff,
>
> The problem is that if I don't implement my own RequestDataObject
> function, I get
>
> vtkStreamingDemandDrivenPipeline (0x9bd97f8): Algorithm
> vtkMeshToGraph(0x9bd92d8) returned failure for request: vtkInformation
> (0x9bd9298)
>
> Here is a demo:
> http://www.rpi.edu/~doriad/VTK_List/GraphAlgorithm/
>
> If you leave the RequestDataObject code commented, it produces the
> above error. If you uncomment it, everything works fine.
>
> Thanks,
>
> David
>



More information about the vtkusers mailing list