[vtk-developers] Error message in GetInputConnection()

Julien Finet julien.finet at kitware.com
Mon May 5 08:56:06 EDT 2014


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20140505/3364d621/attachment.html>


More information about the vtk-developers mailing list