[vtkusers] Find out which qVtkWidget the mouse is over

David Doria daviddoria at gmail.com
Wed May 29 07:56:39 EDT 2013


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



More information about the vtkusers mailing list