[vtkusers] How to subclass vtkInteractorStyle to manage vtk mouse picking

David Doria daviddoria+vtk at gmail.com
Thu Feb 18 08:18:02 EST 2010


On Thu, Feb 18, 2010 at 6:29 AM, Malsoaz James <jmalsoaz at yahoo.fr> wrote:

> Hello,
>
> 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 ?
> 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: http://www.itk.org/Wiki/VTK_Mouse_Picking).
>
> I hope that someone will be able to help me.
> Thank you
> Best
> James
>
>
>
Hi James,

The place you should be looking for examples is:
 http://www.vtk.org/Wiki/VTK/Examples

You need to subclass the interactor style OR create observers, not both.

Here is an example of how to subclass the interactor style:
http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents

<http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents>Here is an
example of how to use an observer:
http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEventsObserver

Good luck!
<http://www.vtk.org/Wiki/VTK/Examples/Interaction/MouseEvents>
Thanks,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100218/4eec502b/attachment.htm>


More information about the vtkusers mailing list