[vtkusers] Find out which qVtkWidget the mouse is over

tao sun colddiesun at gmail.com
Wed May 29 10:05:04 EDT 2013


OK, you mean I can get Information from casted interactor object? Can you
point out what's member of the interactor that is to indicate which qwidget
it belongs to?
Thanks a lot.


2013/5/29 David Doria <daviddoria at gmail.com>

> On Tue, May 28, 2013 at 9:38 PM, tao sun <colddiesun at gmail.com> wrote:
> > Hi,
> >
> > Yes. I have this so far and further more I want to realize a mouseEvent
> > callback in the main class.
>
> You should be able to SafeDownCast the vtkObject in the callback to
> determine which object the event was triggered from:
>
>  void Viewer::mouseMoveCallback(vtkObject * obj, unsigned long, void *
> client_data, void *,  vtkCommand * command)
> {
>   vtkMyInteractorStyle* callingInteractorStyle =
> vtkMyInteractorStyle::SafeDownCast(obj); // Replace
> vtkMyInteractorStyle with the type of the object that is producing the
> event
> }
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130529/109ffcdc/attachment.htm>


More information about the vtkusers mailing list