<div><div class="gmail_quote">On Thu, Feb 18, 2010 at 6:29 AM, Malsoaz James <span dir="ltr"><<a href="mailto:jmalsoaz@yahoo.fr" target="_blank">jmalsoaz@yahoo.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font:inherit">Hello,<br><br>I would like to create a subclass of vtkInteractorStyle to enable a picking on a mouse event (middle button for example). Indeed, the default way to pick a cell is to press the key "p" but I don't like this way and I would like to use the mouse. Can someone help me to do this ?<br>
I guess I need to subclass vtkInteractorStyle and to add observers but I don't know how to do this in C++ and the sample I found are written in Tcl (ie: <a href="http://www.itk.org/Wiki/VTK_Mouse_Picking" target="_blank">http://www.itk.org/Wiki/VTK_Mouse_Picking</a>).<br>
<br>I hope that someone will be able to help me.<br>Thank you<br>Best<br>James<br></td></tr></tbody></table><br><br></blockquote><div><br></div><div>Hi James,</div><div><br></div><div>The place you should be looking for examples is:</div>
<div> <a href="http://www.vtk.org/Wiki/VTK/Examples" target="_blank">http://www.vtk.org/Wiki/VTK/Examples</a></div><div><br></div><div>You need to subclass the interactor style OR create observers, not both.</div><div><br>
</div><div>Here is an example of how to subclass the interactor style:</div>
<a href="http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents</a></div><div class="gmail_quote"><br></div><div class="gmail_quote"><a href="http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents" target="_blank"></a>Here is an example of how to use an observer:</div>
<div class="gmail_quote"><a href="http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEventsObserver">http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEventsObserver</a></div><div class="gmail_quote"><br></div><div class="gmail_quote">
Good luck!<br><div><a href="http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents" target="_blank"></a><br clear="all">
Thanks,<br><br></div><div>David </div></div></div>