Marcel
unread,Nov 24, 2010, 2:56:28 AM11/24/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to cython-users
Hello,
I am working on a C++ project that uses VTK in its interface, i.e. we
need to be able to pass VTK objects.
We want to provide Python wrappers for this project, and I am
currently investigating whether this is feasible with Cython.
VTK already comes with its own wrapping, and I would not want to redo
the work and wrapping VTK again.
I know that with SWIG it is possible to reuse the VTK wrappers, by
using PyObject* as the argument to the method and
then casting it to the corresponding VTK object:
void SomeFunction( PyObject *object ) {
vtkPolydata *pd = (vtkPolydata*) vtkPythonGetPointerFromObject(object,
"vtkPolydata" );
// work with polydata
}
and then call this function from Python as
pd = vtk.vtkPolyData()
SomeFunction(pd)
I could not figure out how to do something similar with Cython. Has
anybody experience with such task, or can point me to an example?
Thanks in advance and best regards,
Marcel