[vtk-developers] Error message in GetInputConnection()

David Gobbi david.gobbi at gmail.com
Mon May 5 11:55:49 EDT 2014


Note that if this problem occurs for vtkGridTransform, it probably
also occurs for vtkBSplineTransform since the two classes have
similar implementations.  Any fixes should be applied to both
classes.

   David


On Mon, May 5, 2014 at 9:25 AM, Berk Geveci <berk.geveci at kitware.com> wrote:
> I'd rather we did the error check. That error helped me debug many problems
> in the past. We could make it condition on compilation in debug mode
> though...
>
> -berk
>
>
> On Mon, May 5, 2014 at 8:56 AM, Julien Finet <julien.finet at kitware.com>
> wrote:
>>
>> Hi,
>>
>> The following code currently produces an error message:
>>   vtkGridTransform* a = vtkGridTransform::New();
>>   vtkGridTransform* b = vtkGridTransform::New();
>>   a->DeepCopy(b);
>>
>>  34: ERROR: In
>> /Users/exxos/Work/Slicer/Slicer4/Slicer-R64-Qt4.7.4-VTKv6/VTKv6/Common/ExecutionModel/vtkAlgorithm.cxx,
>> line 1421
>> 34: vtkGridTransformConnectionHolder (0x7fe2fa11a730): Attempt to get
>> connection index 0 for input port 0, which has 0 connections.
>>
>> This is due to vtkGridTransform::InternalDeepCopy(vtkAbstractTransform*):
>>   ...
>>   this->ConnectionHolder->SetInputConnection(
>>     0, gridTransform->ConnectionHolder->GetInputConnection(0, 0));
>>   ...
>>
>> Do we really consider GetInputConnection(0,0) as an error if there is no
>> connection yet(or the connection has been removed)  ?
>>
>> When porting code from VTK5 to VTK6, I had to wrap every
>> GetInputConnection(0,0) call with a test on the number of input connections:
>>   return myFilter->GetNumberOfInputConnections(0) ?
>> myFilter->GetInputConnection(0,0) : 0;
>>
>> Isn't it a bit too much verbose ?
>> I would suggest to remove the error. What do you think ?
>>
>> Thanks,
>> Julien.



More information about the vtk-developers mailing list