[vtkusers] Turn off Observers "MouseMoveEvent" in vtkInteractorStyleImage

David Cole DLRdave at aol.com
Thu Dec 10 14:35:18 EST 2015


If your goal is simply not to have any mouse activity do anything in
the window, you could just use an instance of vtkInteractorStyle
itself instead of vtkInteractorStyleImage.

The base class vtkInteractorStyle does not have any mouse handling
code in it, but it does implement the standard VTK keyboard shortcuts.


HTH,
David C.



On Thu, Dec 10, 2015 at 8:22 AM, Cory Quammen <cory.quammen at kitware.com> wrote:
> 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.
>
> _______________________________________________
> 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
>


More information about the vtkusers mailing list