[vtkusers] Problems trying to remove observers

Jesús Spí­nola jspinola at gmail.com
Tue Apr 18 06:14:28 EDT 2006


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060418/43b7057f/attachment.htm>


More information about the vtkusers mailing list