[vtkusers] VTK 6 Migration - GetProducerPort in SetNthInputConnection replacement

Berk Geveci berk.geveci at kitware.com
Tue Jun 9 14:20:39 EDT 2015


Sorry my bad. A typo. You _can't_ pass data objects around if your intent
is to connect pipelines anymore. Instead, you need to pass the (algorithm,
output port) pair for the producer of the data around now. You could use
something simple like

struct
{
vtkSmartPointer<vtkAlgorithms> Algorithm;
int OutputPort;
};

Here the (Algorithm, OutputPort) represent the port the data come from.

Best,
-berk

On Fri, Jun 5, 2015 at 2:33 PM, Nicole Kovacs <nkovac2 at uwo.ca> wrote:

>  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?
>
>
>  Nicole
>  ------------------------------
> *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.
>
>  Best,
> -berk
>
> On Fri, May 29, 2015 at 9:47 AM, Nicole Kovacs <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
>>
>> 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:
>> http://public.kitware.com/mailman/listinfo/vtkusers
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150609/2f4c8755/attachment.html>


More information about the vtkusers mailing list