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

Elvis Dowson elvis.dowson at mac.com
Sun Oct 26 06:45:26 EDT 2008


Hi Clint,
                      I've managed to get the interactor working with  
the QGraphicsView. The only thing is as the moment, If I click on the  
QDialog and move it around, the vtk actor moves along with the dialog.  
The interaction rate appears to be quite good, but this is a very  
simple scene.


Now, if I don't click on the QDialog and click somewhere else, the VTK  
scene doesn't update itself.

This probably has something to do with the hit-test that you were  
mentioning about.

I think once I finish handling the hit test, then it should be ready.

I also managed to hide the un-wanted off-screen rendering window with  
the following code fragment.

	// Setup off VTK for off-screen rendering
	if(VTK_OFFSCREEN_RENDER)
	{
		renWin->OffScreenRenderingOn();
		
		#if defined(QVTK_USE_CARBON) || (QVTK_USE_COCOA) && (QT_VERSION >=  
0x040000)
		// Mac OS X 10.5 compatibility fix to remove redundant window, when  
performing off-screen rendering.
		renWin->SetWindowId(NULL); // Set the window id to NULL
		static_cast<vtkCarbonRenderWindow*> (renWin)- 
 >SetRootWindow(reinterpret_cast<WindowPtr> (view->winId())); // Set  
the root window to the view window
		#endif				
	}



Best regards,

Elvis Dowson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081026/0a255fee/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: QVTKInteractor Error 01.jpg
Type: image/jpeg
Size: 27488 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20081026/0a255fee/attachment.jpg>


More information about the vtkusers mailing list