<div dir="ltr">Hi Miro,<div><br></div><div>Most of your questions about vtkSmartPointer are answered in this tutorial:</div><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>I'll let someone else handle the Qt signal/slots questions since I haven't tried to do that. But I would point out that VTK is not thread-safe, so if you are trying to use this mechanism to communicate between threads make sure you know what you are getting into first.</div>
<div><br></div><div>HTH,</div><div>Shawn</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 14, 2013 at 12:45 PM, Miro Drahos <span dir="ltr"><<a href="mailto:mdrahos@robodoc.com" target="_blank">mdrahos@robodoc.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
Hi all,<br>
I am having really hard times passing on reference to the objects
that are stored as vtkSmartPointer<T> as private data within a
class. E.g.:<br>
<tt>class MyClass </tt><tt><br>
</tt><tt>{</tt><tt><br>
</tt><tt> public:</tt><tt><br>
</tt><tt> ...</tt><tt><br>
</tt><tt> private:</tt><tt><br>
</tt><tt> vtkSmartPointer<vtkPolyData> surface;</tt><tt><br>
</tt><tt>};</tt><tt><br>
</tt><br>
What is the best way to pass 'surface' via signal/slot mechanism of
Qt? <br>
I thought I'd create a public method<br>
<tt>vtkPolyData * MyClass::getSurface() { return
surface.GetPointer(); }</tt><br>
The problem is that GetPointer() returns <b>const</b> T* which the
compiler complains about when I later want to use it. As a matter of
fact, all vtkSmartPointer's public methods return const something. <br>
<br>
What would be the preferred way to pass objects stored as
vtkSmartPointer<T> object?<br>
1.) T* MyClass::getT() const { return object.GetPointer(); }<br>
2.) vtkSmartPointer<T> MyClass::getT() { return object; }<br>
3.) something else?<br>
<br>
I want to pass the object via signal/slot mechanism. What would be
the best way?<br>
A.) signal doneSurfaceProcessing(vtkPolyData &); <br>
B.) signal doneSurfaceProcessing(vtkPolyData *);<br>
C.) signal
doneSurfaceProcessing(vtkSmartPointer<vtkPolyData>);<br>
<br>
The idea is to send off the signal with something like<br>
emit doneSurfaceProcessing(myclass->getSurface());<br>
<br>
then the slot would be<br>
setSurface(???) //vtkSmartPointer<T> or T* or T& ?<br>
<br>
Thank you!!<span class="HOEnZb"><font color="#888888"><br>
Miro
<div style="font-size:75%"><br>
</div>
<div>
</div>
</font></span></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" 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" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Shawn Waldon<div>Graduate Research Assistant</div><div>Department of Computer Science</div><div>University of North Carolina at Chapel Hill</div>
<div><a href="mailto:swaldon@cs.unc.edu" target="_blank">swaldon@cs.unc.edu</a></div></div>
</div>