[vtk-developers] Templated filters

Bill Lorensen bill.lorensen at gmail.com
Sat Feb 6 11:32:10 EST 2010


I'm pretty sure that vtk's wrapping does not support templates.

On Sat, Feb 6, 2010 at 11:07 AM, David Doria <daviddoria+vtk at gmail.com> wrote:
> Is there any reason we can't have a templated single input, single output
> filter?
> Currently, it looks like the preferred method is to derive from the class
> *Algorithm of the intended output type and change the input type in the
> FillInputPortInformation function.
> Lets take an example of a filter which takes as input a vtkPointSet and
> produces a vtkPolyData:
> Current method:
> class MyFilter : vtkPolyDataAlgorithm
> int MyFilter::FillInputPortInformation( int port, vtkInformation* info )
> {
>   if (port == 0)
>     {
>     info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet" );
>     return 1;
>     }
>   return 0;
> }
> Proposed method:
> class MyFilter : vtkFilter<vtkPointSet, vtkPolyData>
>
> Thoughts? I may be over my head in template programming and pipeline stuff,
> but maybe the experts can discuss/comment?
> Thanks,
>
> David
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>



More information about the vtk-developers mailing list