For reference, a wrapping of PyObject has been done here: <a href="https://github.com/commontk/PythonQt/blob/patched-2/src/PythonQtObjectPtr.h">https://github.com/commontk/PythonQt/blob/patched-2/src/PythonQtObjectPtr.h</a><div>

<br></div><div>Hth</div><div>Jc<br><br><div class="gmail_quote">On Tue, Jul 10, 2012 at 3:51 PM, David Lonie <span dir="ltr">&lt;<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Jul 10, 2012 at 3:47 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>


&gt; On Tue, Jul 10, 2012 at 3:39 PM, David Lonie &lt;<a href="mailto:david.lonie@kitware.com">david.lonie@kitware.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt; On Tue, Jul 10, 2012 at 3:25 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt; Why are the static New methods of singleton objects in VTK public?<br>
&gt;&gt; &gt;   static vtkMathTextUtilities *New();<br>
&gt;&gt;<br>
&gt;&gt; That New method just returns the singleton instance after increasing<br>
&gt;&gt; its reference count. Not sure exactly why it was included (the<br>
&gt;&gt; original author of the vtkFreeTypeUtilities pattern may), but I like<br>
&gt;&gt; having it around for use with vtkNew/vtkSmartPointer. I think the VTK<br>
&gt;&gt; user guide also says that all vtkObject subclasses _must_ define it.<br>
&gt;<br>
&gt; Right, but I phrased it strangely. My real question was &quot;does static New<br>
&gt; have to be in the public section of the class&quot;?<br>
&gt;<br>
&gt; (For a singleton that is created via a call to GetInstance, isn&#39;t it a good<br>
&gt; idea to make &quot;New&quot; protected or even private?)<br>
&gt;<br>
&gt; Maybe it does need to be public for the wrappers or something, but seems<br>
&gt; like a bad idea to have a public New for a singleton.<br>
<br>
</div></div>It still needs to be public for the smart pointer classes (not a very<br>
compelling reason since singletons don&#39;t really need smart pointers,<br>
but it&#39;s the best I can come up with).<br>
<br>
Dave<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>+1 919 869 8849<br><br>
</div>