[vtkusers] Mouse position anytime

Benoist Laurent laurentbenoist at hotmail.com
Tue Jul 21 06:28:34 EDT 2009

Maybe an explanation of the reason why I don"t use widget.
If I understood well, widgets can localize Actors.
I'm using vtkPointSprites which allow to display many sphere like objects in an single actor.

My goal is to change the color of these sphere when the cursor is on.

Thank you by advance.


From: laurentbenoist at hotmail.com
To: karthik.krishnan at kitware.com
Date: Tue, 21 Jul 2009 10:07:22 +0000
CC: vtkusers at vtk.org
Subject: Re: [vtkusers] Mouse position anytime


Thanks for your prompt answer.
Unfortunately, the widgets doesn't seem to be the most appropriate method in this case.
However, why  my InteractorStyle OnMouseMove() method of is called only on drag events ?

For information I'm running on Mac OS X 10.5 (Cocoa).
I'm using vtkInteractorStyleTrackballCamera.

Date: Mon, 20 Jul 2009 08:24:58 -0400
Subject: Re: [vtkusers] Mouse position anytime
From: karthik.krishnan at kitware.com
To: laurentbenoist at hotmail.com
CC: vtkusers at vtk.org


The render window interactor emits an MouseMoveEvent every time the mouse cursor is moved. The display coordinates can be queried from the interactor. 

Numerous widgets in VTK use this to perform various actions such as object highlighting, annotations etc. Take a look at vtkBalloonWidget and its generic superclass vtkHoverWidget It may already perform what you need. You might be able to re-derive vtkHoverWidget to tailor it to your hover based annotation needs.

At a later stage, you may also find it worthwhile to take a look at vtkScenePicker if your annotation/interaction starts getting too slow. More on that later.


On Mon, Jul 20, 2009 at 7:40 AM, Benoist Laurent <laurentbenoist at hotmail.com> wrote:


I would like to change the color of the nearest object of the cursor, without need to click or something.
So I need to have the mouse position anytime.
But I can't find how to do that (I know how to have the position on a move click but not "on the fly").

Can someone help me ?
Thank you by advance,


Votre correspondant a choisi Hotmail et profite d'un stockage quasiment illimité.  Créez un compte Hotmail gratuitement !


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

Follow this link to subscribe/unsubscribe:


Discutez sur Messenger où que vous soyez ! Mettez Messenger sur votre mobile !
Téléphonez gratuitement à tous vos proches avec Windows Live Messenger  !  Téléchargez-le maintenant !
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090721/50b31d14/attachment.htm>

More information about the vtkusers mailing list