[vtkusers] Vtk interactor
tom fogal
tfogal at apollo.sr.unh.edu
Wed Jun 9 14:12:10 EDT 2004
Use a mutex.
Threading libraries usually provide a 'mutex_lock()' function that
will block until the mutex is acquired.
HTH,
-tom
<005a01c44e4c$6097f930$8c0aa8c0 at questtw.questglobal.com>"R K Shyam Prakash" writes:
>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
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list