[vtkusers] Turn off Observers "MouseMoveEvent" in vtkInteractorStyleImage

Cory Quammen cory.quammen at kitware.com
Thu Dec 10 08:22:02 EST 2015


That won't work. There aren't any observers registered with the interactor
style. The style does register observers with the interactor which you
theoretically selectively remove, but I wouldn't recommend that.

Instead, you can subclass vtkInteractorStyleImage and override the
OnMouseMove() member function to avoid the change in color level.

Thanks,
Cory

On Thu, Dec 10, 2015 at 3:53 AM, 时光 <yihui.cao at qq.com> wrote:

> Hi,
>
> When I show an image used vtkInteractorStyleImage, left button down and
> move, the ColorLevel of image will changing. I want to turn off the
> observer of "MouseMoveEvent" and write the follow code. But it do not
> work. So anyone can tell me how to turn off the observer or turn off this
> function.
>
> cpp code:
> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
> vtkSmartPointer<vtkRenderWindowInteractor>::New();
> vtkSmartPointer<vtkInteractorStyleImage> imagestyle =
> vtkSmartPointer<vtkInteractorStyleImage>::New();
>
> imagestyle->RemoveObservers(vtkCommand::MouseMoveEvent);
> //imagestyle->RemoveAllObservers();
>
> renderWindowInteractor->SetInteractorStyle(imagestyle);
> renderWindowInteractor->SetRenderWindow(renderWindow);
> renderWindowInteractor->Initialize();
> renderWindowInteractor->Start();
>
> Thanks,
> Yihui Cao
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>


-- 
Cory Quammen
R&D Engineer
Kitware, Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20151210/51522a74/attachment.html>


More information about the vtkusers mailing list