[vtkusers] How to add vtkRenderWindowInteractor to a native Cocoa window

Elvis Dowson elvis.dowson at mac.com
Wed Oct 22 12:25:21 EDT 2008


Wow, okay, I'll take a look into it. :-)

I had gone through the QVTKWidget code earlier, I will take a look at  
it more closely now. Whew, this is something! :-)

Once this is also added, and I can suppress the off-screen cocoa  
render window from popping, up, we would have an initial prototype of  
adding Qt Widgets on top of a VTK rendered image in an OpenGL context,  
using image data copy, just like QVTKWidget.

Best regards,

Elvis Dowson

On Oct 22, 2008, at 8:19 PM, clinton at elemtech.com wrote:

>
> I'm guessing you should be able to set up an interactor like you  
> normally
> would.  The only missing piece is taking mouse events from the  
> QGraphicsView
> and passing them off to the interactor.  You can look at  
> QVTKWidget.cxx for
> how to pass them off to the interactor.  Getting mouse events from the
> QGraphicsView is another part of the issue.
>
> If you'd like to experiment, you can try modifying the  
> QVTKInteractor to do
> event filtering on the QVTKWidget and pass events to the  
> interactor.  That
> would mean moving all the handing of mouse and key events from  
> QVTKWidget
> into QVTKInteractor.  Then you might be able to use that new  
> QVTKInteractor
> with the QGraphicsView.  If it works well, then this is something  
> that can go
> into VTK.
>
> Clint
>
> On Wednesday 22 October 2008 10:11:40 am Elvis Dowson wrote:
>> Hi Clint,
>>                  Is there a way to add a vtkRenderWindowInteractor,
>> to a native Cocoa window?
>>
>> vtk is currently rendering on an off-screen vtk render widow, but I
>> would like the vtkRenderWindowInteractor to be set to a  
>> QGraphicsView,
>> and pipe the commands back to the off screen vtk render window.
>>
>> Is this possible?
>>
>> Best regards,
>>
>> Elvis Dowson
>
>




More information about the vtkusers mailing list