Deprecated GetProducerPort

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Deprecated GetProducerPort

filez41
Hey all, I posted this a week ago but in the email blast the code was left out.  I'm hoping including the code and rephrasing the question will help.

I'm upgrading some code from 5.6 to 6.1, and the GetProducerPort has been deprecated.  We were using it in a few places, and I've been trying to repeat the results we were getting with 5.6 following this deprecated code guide:
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_GetProducerPort
It hasn't been helpful because that's not how it was being used.

Old Code:
        vtkImageData * pImageData = aTexture->GetImageDataInput(0);
        vtkAlgorithmOutput * pAlgorithmOutput = pImageData->GetProducerPort();
        vtkAlgorithm * pAlgorithm = pAlgorithmOutput->GetProducer()

New Code (not working):
        vtkImageData * pImageData = aTexture->GetImageDataInput(0);
        vtkAlgorithm * pAlgorithm = vtkAlgorithm::New();
        pAlgorithm->SetInputDataObject(pImageData);

Reading the code more closely I can understand why the attempted code is not working, but I can't figure out how to replicate the old results without that function.

The goal is to get a vtkAlgorithm out of a vtkDataObject (in this case a vtkImageData).  Before we were getting the producer port (a vtkAlgorithmOutput) and passing it's producer off to a vtkAlgorithm.  

Reply | Threaded
Open this post in threaded view
|

Re: Deprecated GetProducerPort

Berk Geveci-2
vtkAlgorithm* pAlgorithm = aTexture->GetInputAlgorithm();

-berk


On Wed, Oct 22, 2014 at 12:53 PM, filez41 <[hidden email]> wrote:
Hey all, I posted this a week ago but in the email blast the code was left
out.  I'm hoping including the code and rephrasing the question will help.

I'm upgrading some code from 5.6 to 6.1, and the GetProducerPort has been
deprecated.  We were using it in a few places, and I've been trying to
repeat the results we were getting with 5.6 following this deprecated code
guide:
http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Removal_of_GetProducerPort
It hasn't been helpful because that's not how it was being used.

Old Code:
        vtkImageData * pImageData = aTexture->GetImageDataInput(0);
        vtkAlgorithmOutput * pAlgorithmOutput =
pImageData->GetProducerPort();
        vtkAlgorithm * pAlgorithm = pAlgorithmOutput->GetProducer()

New Code (*not working*):
        vtkImageData * pImageData = aTexture->GetImageDataInput(0);
        vtkAlgorithm * pAlgorithm = vtkAlgorithm::New();
        pAlgorithm->SetInputDataObject(pImageData);

Reading the code more closely I can understand why the attempted code is not
working, but I can't figure out how to replicate the old results without
that function.

The goal is to get a vtkAlgorithm out of a vtkDataObject (in this case a
vtkImageData).  Before we were getting the producer port (a
vtkAlgorithmOutput) and passing it's producer off to a vtkAlgorithm.





--
View this message in context: http://vtk.1045678.n5.nabble.com/Deprecated-GetProducerPort-tp5729205.html
Sent from the VTK - Dev mailing list archive at Nabble.com.
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtk-developers



_______________________________________________
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://public.kitware.com/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: Deprecated GetProducerPort

filez41
Oh my goodness, how did I not go back that far.  

It works, thank you!
Reply | Threaded
Open this post in threaded view
|

Re: Deprecated GetProducerPort

Berk Geveci-2
:-)

On Wed, Oct 22, 2014 at 2:27 PM, filez41 <[hidden email]> wrote:
Oh my goodness, how did I not go back that far.

It works, thank you!



--
View this message in context: http://vtk.1045678.n5.nabble.com/Deprecated-GetProducerPort-tp5729205p5729209.html
Sent from the VTK - Dev mailing list archive at Nabble.com.
_______________________________________________
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://public.kitware.com/mailman/listinfo/vtk-developers



_______________________________________________
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://public.kitware.com/mailman/listinfo/vtk-developers