[vtk-developers] SetStencilConnection() in vtkImageAlgorithm

David Gobbi david.gobbi at gmail.com
Sat Nov 20 10:49:31 EST 2010


That's the best answer  :).  I know who to chase after to get a review or two.

  David

On Sat, Nov 20, 2010 at 8:15 AM, Berk Geveci <berk.geveci at kitware.com> wrote:
> 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
>
>



More information about the vtk-developers mailing list