[vtk-developers] More (fundamental) nastiness in vtkImageMultipleInputFilter
dgobbi at imaging.robarts.ca
Mon Mar 15 18:28:03 EST 2004
On Tue, 16 Mar 2004, Charl P. Botha wrote:
> Dear developers,
> When vtkImageMultipleInputFilter calls ThreadedExecute, it's called with
> "this->GetInputs()" as one of its parameters, the idea being that the
> child class will know how many inputs to use.
> The fundamental problem with this is that the Inputs array is only valid
> for an index < GetNumberOfInputs(), but that the child's implementation
> of ThreadedExecute has no access to this call. NumberOfInputs starts at
> 0 and grows as new inputs are added.
Are you sure this is the case? ThreadedExecute is a member function of
the class, it therefore has 'this' and can do a call to
this->GetNumberOfInputs() or it can simply look at this->NumberOfInputs.
For example, vtkImageBlend.cxx accepts an arbitrary number of inputs, and
does a check of this->NumberOfInputs inside its ThreadedExecute method.
More information about the vtk-developers