[vtk-developers] vtkMathTextUtilities and otherPrint test

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Wed Jul 11 09:43:51 EDT 2012


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

Hth
Jc

On Tue, Jul 10, 2012 at 3:51 PM, David Lonie <david.lonie at kitware.com>wrote:

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


-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20120711/8b2af09a/attachment.htm>


More information about the vtk-developers mailing list