<div dir="ltr">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.<div><br></div><div>Instead, you can subclass vtkInteractorStyleImage and override the OnMouseMove() member function to avoid the change in color level.</div><div><br></div><div>Thanks,</div><div>Cory</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 10, 2015 at 3:53 AM, 时光 <span dir="ltr"><<a href="mailto:yihui.cao@qq.com" target="_blank">yihui.cao@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>When I show an image used vtkInteractorStyleImage, l<span style="font-family:'lucida Grande',Verdana,'Microsoft YaHei';line-height:23.8px">eft button down and move, the ColorLevel of image will changing. I want to turn off the observer of </span><font face="lucida Grande, Verdana, Microsoft YaHei"><span style="line-height:23.8px">"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.</span></font></div><div><font face="lucida Grande, Verdana, Microsoft YaHei"><span style="line-height:23.8px"><br></span></font></div><div><font face="lucida Grande, Verdana, Microsoft YaHei"><span style="line-height:23.8px">cpp code:</span></font></div><div><font face="lucida Grande, Verdana, Microsoft YaHei"><span style="line-height:23.8px"><div><span style="white-space:pre-wrap"> </span>vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =</div><div><span style="white-space:pre-wrap"> </span>vtkSmartPointer<vtkRenderWindowInteractor>::New();</div><div><span style="white-space:pre-wrap"> </span>vtkSmartPointer<vtkInteractorStyleImage> imagestyle =</div><div><span style="white-space:pre-wrap"> </span>vtkSmartPointer<vtkInteractorStyleImage>::New();</div><div><br></div><div><span style="white-space:pre-wrap"> </span>imagestyle->RemoveObservers(vtkCommand::MouseMoveEvent);</div><div><span style="white-space:pre-wrap"> </span>//imagestyle->RemoveAllObservers();</div><div><br></div><div><span style="white-space:pre-wrap"> </span>renderWindowInteractor->SetInteractorStyle(imagestyle);</div><div><span style="white-space:pre-wrap"> </span>renderWindowInteractor->SetRenderWindow(renderWindow);</div><div><span style="white-space:pre-wrap"> </span>renderWindowInteractor->Initialize();</div><div><span style="white-space:pre-wrap"> </span>renderWindowInteractor->Start();</div><div><br></div><div>Thanks,</div><div>Yihui Cao</div></span></font></div><br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Cory Quammen<br>R&D Engineer<br>Kitware, Inc.</div>
</div>