[vtkusers] SmartPointer reference?

Dan Lipsa dan.lipsa at kitware.com
Mon May 16 10:18:30 EDT 2016


Does this help?
http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers

What exactly is the problem you are seeing?
Dan


On Fri, May 13, 2016 at 7:22 PM, Richard Frank <rickfrank at me.com> wrote:

>
> Hi,
>
> Is it possible to return a smart pointer by reference?
>
> I'd like to return an image as a parameter, rather than a return type but
> nothing seems to be happy.
>
> for instance
>
> bool SomeFunction(vtkSmartPointer<vtkImageData> & outImage)
> {
> vtkSmartPointer<vtkImageReader> r =
> vtkSmartPointer<vtkImageReader>::New();
> r->SetFileName("Path");
> r->Update();
> // What next?
>
> return true;
> }
>
> I though Take was a possible choice
>
> outImage = vtkSmartPointer<vtkImageData>::Take(r->GetOutput());
>
> but no happiness there.
>
> Any solution?
>
> Thanks
>
> Rick
>
>
>
> _______________________________________________
> 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/20160516/2787da74/attachment.html>


More information about the vtkusers mailing list