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

clinton at elemtech.com clinton at elemtech.com
Wed Oct 22 12:19:48 EDT 2008


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