<div dir="ltr">Does this help?<div><a href="http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers">http://www.vtk.org/Wiki/VTK/Tutorials/SmartPointers</a><br></div><div><br></div><div>What exactly is the problem you are seeing?</div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 13, 2016 at 7:22 PM, Richard Frank <span dir="ltr"><<a href="mailto:rickfrank@me.com" target="_blank">rickfrank@me.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><br></div><div>Hi,</div><div><br></div><div>Is it possible to return a smart pointer by reference? </div><div><br></div><div>I'd like to return an image as a parameter, rather than a return type but nothing seems to be happy. </div><div><br></div><div>for instance</div><div><br></div><div>bool SomeFunction(vtkSmartPointer<vtkImageData> & outImage)</div><div>{<br>vtkSmartPointer<vtkImageReader> r = <span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">vtkSmartPointer<vtkImageReader>::New();</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">r->SetFileName("Path");</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">r->Update();</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">// What next?</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">return true; </span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">}</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">I though Take was a possible choice</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">outImage = vtkSmartPointer<vtkImageData>::Take(r->GetOutput());</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">but no happiness there.</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">Any solution?</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">Thanks</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff">Rick</span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div><div><span style="color:#000000;font-family:SFNSText,'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;font-style:normal;font-variant:normal;font-weight:300;letter-spacing:normal;line-height:22.5px;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;display:inline!important;float:none;background-color:#ffffff"><br></span></div></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br></div>