[vtkusers] VTK in a MultiTouch Environment
David Gobbi
david.gobbi at gmail.com
Tue Oct 20 15:11:02 EDT 2009
I have just a little bit to add to what Clinton said, since you're working
from within Python. The only way you can use SetWindowInfo() is
if you can get the address of the HIView as a string. If you only have
the pointer to the Carbon window, then you would have to use the
vtkCarbonWindow::SetRootWindow() method which is only useful
from C++ (it could be easily made useful in Python, though).
You can't work things out with just the framebuffer, unfortunately.
You have to give VTK either the HIView or Window associated with
the framebuffer.
David
On Tue, Oct 20, 2009 at 12:54 PM, Clinton Stimpson <clinton at elemtech.com> wrote:
>
> In Carbon a Window is the outer most container that contains the minimize,
> maximize, buttons and such. Within that Window, you may have a hierarchy of
> HIViews. You'll want to give VTK the HIView you want it to draw in.
> Getting the content view from the Window is giving you the top most HIView in
> the hierarchy, which might not be the one you want.
>
> If PyMT gives a pretty dynamic GUI and the VTK Window has a hard time
> following it, there is a vtkCarbonRenderWindow::UpdateGLRegion() to fix that.
>
> So basically an X11 Window = Carbon HIView
> The X11 window manager has something equivalent to a Carbon Window.
> In Windows, both the container and views within the container are called
> Windows.
>
> You should be able to make it work without offscreen.
>
> Clint
>
> On Tuesday 20 October 2009 12:37:03 pm Christopher Denter wrote:
>> Hello again,
>>
>> after your last helpful reply we (that includes the two PyMT main
>> developers and me) tried to integrate VTK with PyMT somehow. We made
>> some progress, but now we need your help again.
>>
>> First we just tried to do what you, David, pointed out: See
>> http://paste.pocoo.org/show/146039/ Now this always fills the entire PyMT
>> window. We only got that working on linux and windows. Pymt uses Pyglet,
>> which in turn uses Carbon on OSX. (Here we could not find a proper method
>> to extract the window ID. See [0] for a more detailed description of this
>> problem.)
>> While I could somehow live without OSX support and work around the
>> problem that arises from VTK's full-window filling habit (by zooming
>> out and drawing the UI elements with PyMT 'above' the VTK rendering),
>> we were unable to draw anything above the VTK renderings.
>>
>> So what we tried next was to render VTK into a framebuffer object,
>> which would even allow us to rotate and resize the VTK rendering
>> inside the PyMT window and draw other GUI elements above the VTK
>> rendering.
>> Unfortunately we were unable to make VTK render into a FBO. We tried
>> transforming the Cone example into something like this:
>> http://paste.pocoo.org/show/146030/ (Scroll down)
>> The result of that code is a segmentation fault.
>>
>> So the main question is: How can we make VTK render into a FBO?
>>
>> Berk, I will keep you updated if this project works out.
>>
>>
>> In the hope that you can again help me out,
>> Christopher
>>
>> [0]
>> http://groups.google.com/group/pyglet-users/browse_thread/thread/968f235b70
>>efb8b7
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at:
>> http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK 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