[vtkusers] VTK in a MultiTouch Environment
Christopher Denter
dennda at the-space-station.com
Mon Nov 2 04:36:34 EST 2009
Hello!
Sorry this thread has been silent for a few days. I'm back working on
the issues.
So here is my roadmap for now:
1. Work with the hack that I already have on a linux box. (Using it
on MacOSX seems to be impossible, see below.)
This will be encapsulated in its own class so I can swap the VTK
rendering related parts
easily afterwards without affecting the rest of the application.
2. Write my program around that abstracted 'VTKWidget' (pymt
terminology).
3. Hope that either of the following happens:
a) The hack is sufficient for what I need to do with it
b) PyMT switches to PyOpengl (that's being discussed at the moment.
David said that this worked for him easily 10 years ago.)
And if both don't happen:
c) Implement that OpenGL RenderWindow we talked about. (Without the
initialization phase.)
For 1) I did the following: http://paste.pocoo.org/show/148216/
By some magic I didn't understand nor find documentation about, that
then gets wrapped and is accessible from within python.
Is that what you meant, David?
The only thing that pyglet gives me as pygletwin._window is something
like 'c_void_p(402346272)'; does that look like a valid pointer to a
carbon window?
I extracted the number and passed it to SetRootWindowInfo. After
setting the size accordingly, the rendering then shows up in the
pyglet window. However,
it is not possible to extract it as a texture because VTK seems to use
some 'overlay' approach on OSX. This seems to mean that the hack
cannot work on OSX, correct?
Hence, 2) will only be possible on linux.
As for 3b) I hope that this happens soon, but I can't know. David, do
you have any example around that illustrates how to use VTK with
PyOpenGL?
3c) will be enormously difficult for me, as I lack the experience in
both, working with VTK and such big C++-projects. What I'd do is copy-
paste vtkOpenGLRenderWindow.{cxx|h} to vtkRawOpenGLRenderWindow{.cxx|
h}, respectively, replace all vtkOpenGLRenderWindow occurrences with
vtkRawOpenGLRenderWindow and strip away everything that looks like
OpenGL initialization.
What would I then need to do in order to make it compile with the rest
of the code? (And can I somehow only recompile that file and link it
again so I don't have to wait 30 minutes after every change to the
code before I can test it, due to the lengthy compilation process?)
Thanks.
Christopher
More information about the vtkusers
mailing list