[vtkusers] SmartPointer reference?

Richard Frank rickfrank at me.com
Fri May 13 19:22:41 EDT 2016


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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160513/406cdc02/attachment.html>


More information about the vtkusers mailing list