[vtkusers] Problems trying to remove observers

代亮 dailiangde at 163.com
Sat Feb 2 00:44:07 EST 2008


Hi,  jspinola,
  I saw your message in vtk user list :Problems trying to remove observers. I have the same problem, can you help me to solve it? Thank you.

----------------------------------------------------------------
Hi,

I want to remove the observers on the window level events on the
vtkImageViewer2 class. First I've got the intercator with the
GetInteractorStyle() method and then call RemoveObserver() eg

vtkImageViewer2 *viewer = vtkImageViewer2::New();
..
if( viewer->GetInteractorStyle()->HasObserver(
vtkCommand::StartWindowLevelEvent )
{
   viewer->GetInteractorStyle()->RemoveObserver(
vtkCommand::StartWindowLevelEvent )
}

but with no success... what I'm doing wrong?

A second question i have is: is it possible to get the vtkCommand from
vtkImageViewer, remove it or disable it for a while and then add it or
enable it again later ? If yes, what's the suitable way to do it

thanks

2007-11-14 



Dai Liang 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080202/bcf1f68b/attachment.htm>


More information about the vtkusers mailing list