[vtk-developers] SetStencilConnection() in vtkImageAlgorithm

Berk Geveci berk.geveci at kitware.com
Sat Nov 20 10:15:26 EST 2010


To be totally frank, I don't feel enough ownership of the imaging classes to
care :-) It doesn't sound like a big deal but someone that uses these
classes more regularly should also chime in.

On Fri, Nov 19, 2010 at 4:55 PM, David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Berk,
>
> Since I've caught your ear, I might as well get your opinion on one
> other matter.  It also has to do with image stencils.
>
> Right now some filters have a SetStencil() method that takes a
> vtkImageStencilData object directly.  I'm converting these to
> SetStencilConnection() methods.  But I'm thinking of adding the
> SetStencilConnection() method directly to vtkImageAlgorithm, and
> here is why: I want to be able to probe any ImageAlgorithm to see
> if that algorithm accepts a stencil as an input (and I want to make
> more of the existing image filters use stencils, I've written an iterator
> to simplify this.)
>
> In my proposal, an image algorithm that uses a stencil will do this in
> its constructor:
>
> vtkSomeFilter::vtkSomeFilter()
> {
>  this->SetNumberOfInputs(2);
>  this->SetStencilPortNumber(1);
> }
>
> The default value of StencilPortNumber set to -1 by vtkImageAlgorithm
> (i.e. no stencil input), so the existence of a stencil port can be
> checked.  The vtkImageAlgorithm::SetStencilConnection() method
> will connect its argument to the port, or do nothing if the port is -1.
> You can see the new vtkImageAlgorithm code on Gerrit:
>
> http://review.source.kitware.com/388
>
> If you think that SetStencilConnection() belongs in the individual
> filters (e.g. like SetSelectionConnection()) then that is fine. The
> only answer I will not accept is "derive a new base class from
> vtkImageAlgorithm". ;)
>
>  David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20101120/49ee8714/attachment.htm>


More information about the vtk-developers mailing list