[vtkusers] python wrapping local classes

Leila Baghdadi baghdadi at sickkids.ca
Thu Aug 28 14:30:32 EDT 2003


Hi Ed

you must try loading

from vtkpython import *
from libvtkLocalPython import *


hope this helps


Leila

On 28 Aug 2003, Ed Bachta wrote:

> 
> Hello vtkusers,
> 
> I'm trying to add a class to my VTK build. I was able to add it to a
> directory called Local and build a C++ .so nicely by following the
> suggestions in the VTK README. I can even create a C++ application that
> uses the class. However, I'm having trouble with the python wrapping. I
> seem to get a libvtkLocalPython.so in the bin directory, but when I try
> using my class in a script I have problems. First, it doesn't seem to be
> in the vtk module:
> 
> -----
> [ebachta at jackson Blondin]$ vtkpython
> vtk version 4.3.0, vtk source $Revision: 1.1610 $, $Date: 2003/06/23
> 01:45:05 $
> (GMT)
> Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
> [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import vtk
> >>> ren = vtk.vtkRenderer()
> >>> h = vtk.vtkHistogramColorBar()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> AttributeError: 'module' object has no attribute 'vtkHistogramColorBar'
> -----
> 
> And if I try loading from the python library for Local directly it has
> problems with undefined symbols:
> 
> -----
> >>> from libvtkLocalPython import *
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> ImportError: /usr/local/src/VTK/bin/libvtkLocalPython.so: undefined
> symbol: PyVTKClass_vtkActor2DNew
> -----
> 
> I'm suspecting that I'm missing something in my Local/CMakeLists.txt,
> but I don't know what that would be. I'm working on a Linux box.
> 
> 




More information about the vtkusers mailing list