[vtkusers] Vtk interactor

R K Shyam Prakash ramakrishna.prakash at quest-global.com
Wed Jun 9 14:05:41 EDT 2004


Hello,

	I am using vtk4.2.2 with MFC (VC++6.0). I am trying to animate
rotation of a cylinder in a separate thread. However, if any mouse
events are fired during animation, program crashes as two threads are
accessing simultaneously. So I would like to block my interactor until
the animation is complete. How can I achieve this. I tried overriding
vtkWin32RenderWindowInteractor. Following is the code. 

void CustomInteractor::OnLButtonDown(HWND wnd,UINT nFlags,int X,int Y){
	if(model->IsAnimating()){
		return;
	}

	
this->vtkWin32RenderWindowInteractor::OnLButtonDown(wnd,nFlags,X,Y);
}

Initially it works fine. When the animation starts, it successfully
blocks the mouse events. However, even after animation is completed
(model->IsAnimating() returns false), the interactor (super class) does
not process the mouse events. Am I doing some thing wrong here? Please
suggest.

Thanks
Shyam




More information about the vtkusers mailing list