[vtk-developers] Image multiple input filters, VTK 5 vs VTK 4

David Gobbi dgobbi at atamai.com
Wed Apr 5 15:03:43 EDT 2006


Mathieu Malaterre wrote:
>
>> If anyone thinks there will be any issues with
>> this change, or if there are other VTK classes
>> that need this change, please email me.
>
> Please go ahead and do the changes, it will make the life of people 
> porting VTK44 app to VTK5 much easier !
>
> As a side note, I would like to move the protected function to the 
> public ones:
>
> vtkAlgorithm:
> virtual void SetNthInputConnection(int port, int index, 
>                   vtkAlgorithmOutput* input);

I agree that this method is useful enough that it should be
public (and said why in my email to Berk).

> So that VTK44 code:
>
> vtkImageBlend blend
> blend SetInput 0 background
> blend SetInput 1 foreground
>
> becomes:
>
> vtkImageBlend blend
> blend SetNthInputConnection 0 0 background
> blend SetNthInputConnection 0 1 foreground
>
> Comments ?
> Mathieu

Except for the fact that your example is in Tcl, I think it's fine ;)

Really, though, I'm curious about why so many of the
methods in vtkAlgorithm are public... does the executive
need access to them?  It seems to me that it would be
cleaner if they were protected, and that the derived
filter classes only made certain methods public.

Also, I don't really understand why e.g. both of these
methods are needed:

void SetInputConnection(int port, vtkAlgorithmOutput* input);
void SetInputConnection(vtkAlgorithmOutput* input);

Isn't it enough just to have the first method, but not the
second?  I think that making the port number more explicit
helps people understand the "port" concept better.

 - David







More information about the vtk-developers mailing list