Re: [Pyobjc-dev] VTK bindings (Modified by Carlos Phillips)
Brought to you by:
ronaldoussoren
From: Carlos P. <ca...@ci...> - 2003-12-04 04:39:19
|
On Dec 3, 2003, at 6:34 AM, Carlos Phillips wrote: > On Dec 3, 2003, at 4:59 AM, Jack Jansen wrote: > >> >> On 2 Dec 2003, at 18:38, Ronald Oussoren wrote: >>> The problem is that PyObjCPointer is a not really a wrapped pointer, >>> when the PyObjCPointer object is created the value pointed-to is >>> copied into an internal buffer. Most of the time that doesn't work, >>> vtkRenderer is probably a C++ class and the copied value is invalid. >>> >>> I'll put creation of a real pointer wrapper on my todo-list, a >>> generic version of the types used to wrapped some other pointer >>> types (see pointer-support.m). >> >> Isn't cobject what you want here? It just gives you an opaque Python >> wrapper around a C pointer, but it looks like that could be good >> engouh. > > Actually, ideally I would be able to interact with the C++ objects > pointed to using the already existing python wrappers. I'm not sure > how this could be done though. > > What I have are objective-c++ files containing objective-c classes > with methods which take and return pointers to c++ classes. VTK has > its own python wrappers for these c++ classes. This allows for easy > construction of rendering pipelines. I could wrap the c++ classes in > objective-c and then wrap the new objective-c classes in python > through PyObjC. However, this would not allow me to interact with the > c++ classes directly in python using VTK python classes which is what > I want to do. > > So ideally I would like to be able to see the c++ classes taken and > returned by my objective-c classes as VTK python wrapper objects. > > Example: > An unwrapped objective-c++ class VTKView has the following method. > -(vtkRenderer *)renderer; > > vtkRenderer is a c++ class. There is python wrapper class by the same > name. I would like to wrap and/or alter VTKView so that I can do the > following in Python: > > v = VTKView.alloc().init() > v.renderer().AddActor(...) > > or be able to use v.renderer() as an argument to some python wrapped > VTK method. Actually, if I can't do this, I would settle for simply hiding the c++ pointer attributes and c++ related methods from PyObjC. Can I do that? Carlos |