[vtkusers] VTK 6 Migration - GetProducerPort in SetNthInputConnection replacement

Nicole Kovacs nkovac2 at uwo.ca
Fri Jun 5 14:33:10 EDT 2015

It is actually supposed to make a pipeline connection. You're right, my mistake to think SetInputData() would work.

What do you mean by "you can simply pass data objects if you want to connect pipelines anymore"? I tried doing:

someAlgorithm->SetNthInputConnection(port, index, *someDataObject);

but it didn't work.

Also, by "refactored" do you mean using just SetInputConnection?


From: Berk Geveci <berk.geveci at kitware.com>
Sent: Monday, June 1, 2015 1:14 PM
To: Nicole Kovacs
Cc: vtkusers at vtk.org
Subject: Re: [vtkusers] VTK 6 Migration - GetProducerPort in SetNthInputConnection replacement

Is this call supposed make a pipeline connection? Note that SetNthInputConnection() makes a pipeline connection whereas SetInputData() and variants do not. Once you figure it out, if SetInputData() is still good, I can share a way of doing what you want. If not, this code will have to be refactored. You can simply pass data objects if you want to connect pipelines anymore.


On Fri, May 29, 2015 at 9:47 AM, Nicole Kovacs <nkovac2 at uwo.ca<mailto:nkovac2 at uwo.ca>> wrote:

Hi guys,

I apologize if this is a basic question, I'm new to VTK and I'm trying to port some VTK code from version 5.x to version 6.x

I'm facing various errors regarding GetProducerPort's removal from vtkDataObject. I know that I should be replacing someAlgorithm->SetInputConnection(someDataObject->GetProducerPort());
by someAlgorithm->SetInputData(someDataObject);

but the code I have is a bit different, such as:
someAlgorithm->SetNthInputConnection(port, index, someDataObject->GetProducerPort());

I thought about looking for some SetNthInputData method that takes as arguments a port and an index and could solve my problem, but haven't found anything that useful. I did find a method called SetInputDataObject(int port, vtkDataObject *data) that has the port, but not the index.

Is there a way that I can port this part of my code? Is there a reason that SetInputData methods don't have indices as arguments?

I have talked to the author of the code I'm porting and I know that in some cases I don't need to specify the port, only the input index. Is there a method that does that?

Thank you for your attention!

Powered by www.kitware.com<http://www.kitware.com>

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150605/9bad0fe3/attachment.html>

More information about the vtkusers mailing list