[vtkusers] Using a C++ vtk object from Python

Scott Harris scottrharris at gmail.com
Thu Dec 22 13:44:25 EST 2005


Thanks for the "pointer." Once I had a name, I  found this:

http://www.vtk.org/doc/release/3.2/html/vtkPythonUtil_8h.html

So I should be able to get this working.

-Scott

On 12/22/05, Burlen <burlen at apollo.sr.unh.edu> wrote:
> if you use swig you can return vtk objects to python from c++:
>
> return (PyObject *) vtkPythonGetObjectFromPointer(...)
>
> might also work if not using swig but that's the only way I ever tried it.
>
> see:
> http://quaoar.sr.unh.edu/Python/HOWTO_wrapping_vtk.html
>
> On Thursday 22 December 2005 12:39 pm, Scott Harris wrote:
> > I'm trying to build an application on Mac OS X that uses Python,
> > Objective-C, and C++ and I'm having issues since some of my vtk
> > objects are built by C++ and some are built by Python. How can I make
> > these objects talk to each other?
> >
> > I'm using C++ to build my vtkRenderer, but I'd like to use Python to
> > build all my actors so I can play around interactively. How do I add a
> > vtkActor that I built in Python to a vtkRenderer that was built in C++
> > if all I have is a pointer to the C++ object? Or how can I get the
> > pointer to the C++ vtkRender that's inside the python object created
> > with r=vtk.vtkRenderer()? If I could get that, I could replace the
> > vtkRenderer on the C++ side with the one inside the Python object and
> > then I could just do all my work on the python side (maybe?).
> >
> > In general, how can I set up object in Python that shadows objects in
> > C++? I'd like to take the C++ pointer and generate a Python object
> > that I can then just call methods on like it was an ordinary Python
> > object.
> >
> > Thanks,
> > -Scott
> > _______________________________________________
> > This is the private VTK discussion list.
> > Please keep messages on-topic. Check the FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
>
> --
>
> Burlen Loring
> Space Science Center
> Institute for the Study of Earth, Oceans, and Space
> University of New Hampshire
> 39 College Road, Durham, NH 03824
> Phone: 603-862-1140
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



More information about the vtkusers mailing list