<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body 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!!<br>
Miro
<div style="font-size:75%"><br>
</div>
<div class="moz-signature">
</div>
</body>
</html>