[vtk-developers] Which class to derive from for filter with input: PolyData, output: Graph

David Doria daviddoria+vtk at gmail.com
Fri Nov 27 09:48:01 EST 2009


You'll have to excuse my new-ness on this one, I've never dug down

> into the real workings of the pipeline.
>
> It seems that vtkGraphAlgorithm::ProcessRequest is calling with
> REQUEST_DATA_OBJECT rather than REQUEST_DATA as is usually the case in
> filters that I have derived from vtkPolyDataAlgorithm. What is the
> difference between these?
>
> Now that I have overriden RequestDataObject (with
> vtkNearestNeighborGraph::RequestDataObject), the cast of the output to
> a vtkGraph seems to be the part that is failing:
>   vtkGraph* output = vtkGraph::SafeDownCast(
>
> outInfo->Get(vtkDataObject::DATA_OBJECT()));
>
> output is invalid after this cast. Any hints on why that would be? The
> output should be a vtkGraph by definition of vtkGraphAlgorithm, right?
>
> Here is the latest version:
> http://rpi.edu/~doriad/VTK_List/vtkNearestNeighborGraph/<http://rpi.edu/%7Edoriad/VTK_List/vtkNearestNeighborGraph/>
>
> Any pointers are much appreciated!
>
> Thanks,
>
> David
>

I found some similar things in Infovis. I stripped them down to see what was
required. Here is a barebones example for anyone interested.

http://www.vtk.org/Wiki/VTK_Examples_vtkGraphAlgorithm_Source

Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20091127/3e1b2369/attachment.html>


More information about the vtk-developers mailing list