Re: [Pyobjc-dev] VTK bindings
Brought to you by:
ronaldoussoren
From: Carlos P. <ca...@ci...> - 2003-12-02 23:03:51
|
On Dec 2, 2003, at 1:13 PM, Bob Ippolito wrote: > > On Dec 2, 2003, at 12:38 PM, Ronald Oussoren wrote: > >> >> On 2 dec 2003, at 16:23, b.bum wrote: >> >>> On Dec 2, 2003, at 1:12 AM, Carlos Phillips wrote: >>>> 2003-12-02 03:30:46.165 Simple1[1541] PyObjCPointer created: at >>>> 0x6d16080 of type >>>> {vtkRenderer={?={?={?=^^?i}C{vtkTimeStamp=^^? >>>> L}^{vtkSubjectHelper}}^{vtkAssemblyPath}^{vtkPropCollection}iIff^{vt >>>> kPropCollection}^{vtkActor2DCollection}^{vtkWindow}[3f][4f][2f][2f][ >>>> 2f][2i][2i][3f][3f][4f]}^{vtkCamera}^{vtkLight}^{vtkLightCollection} >>>> ^{vtkCullerCollection}^{vtkActorCollection}^{vtkVolumeCollection}[3f >>>> ]^{vtkRenderWindow}ffiii*{vtkTimeStamp=^^? >>>> L}fii^^{vtkProp}i^^{vtkAssemblyPath}iii[6f]f}8@0:4 >>> >>> Like Bob said, once a PyObjCPointer is created, you are generally >>> out of luck. PyObjC transparently bridged Objective-C. In this >>> case, you are asking it to transparently bridge a relatively complex >>> C data type. >> >> 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). >> >> Is VTK itself wrapped? If so, you could use the functions in >> pointer-support.m to convert vtkRenderer* to the Python wrapper from >> the VTK wrapper. > > VTK itself does have python wrappers.. they probably work on OS X by > now, but there were problems last time I tried (a long while ago, due > to linking issues). > > -bob The VTK python wrapper now works quite well. In fact I have quite a bit of python VTK code which runs from the command line. I looked through pointer-support.m but was unable to determine how I should use it to leverage this fact. All the C++ classes which show up in the interface have a wrapped python equivalent. Carlos |