[vtk-developers] Error message in GetInputConnection()

Berk Geveci berk.geveci at kitware.com
Mon May 5 11:25:37 EDT 2014


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.
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20140505/bf43f20c/attachment-0002.html>


More information about the vtk-developers mailing list