<div dir="ltr">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...<div><br></div><div>-berk</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Mon, May 5, 2014 at 8:56 AM, Julien Finet <span dir="ltr"><<a href="mailto:julien.finet@kitware.com" target="_blank">julien.finet@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>The following code currently produces an error message:</div><div> vtkGridTransform* a = vtkGridTransform::New();</div><div> vtkGridTransform* b = vtkGridTransform::New();</div><div>
a->DeepCopy(b);</div><div><br></div><div> 34: ERROR: In /Users/exxos/Work/Slicer/Slicer4/Slicer-R64-Qt4.7.4-VTKv6/VTKv6/Common/ExecutionModel/vtkAlgorithm.cxx, line 1421</div><div>34: vtkGridTransformConnectionHolder (0x7fe2fa11a730): Attempt to get connection index 0 for input port 0, which has 0 connections. </div>
<div><br></div><div>This is due to vtkGridTransform::InternalDeepCopy(vtkAbstractTransform*):</div><div> ...</div><div><div> this->ConnectionHolder->SetInputConnection(</div><div> 0, gridTransform->ConnectionHolder->GetInputConnection(0, 0));</div>
</div><div> ...</div><div><br></div><div>Do we really consider GetInputConnection(0,0) as an error if there is no connection yet(or the connection has been removed) ?</div><div><br></div><div>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:</div>
<div> return myFilter->GetNumberOfInputConnections(0) ? myFilter->GetInputConnection(0,0) : 0;</div><div><br></div><div>Isn't it a bit too much verbose ?</div><div>I would suggest to remove the error. What do you think ?</div>
<div><br></div><div>Thanks,</div><div>Julien.</div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>