[vtkusers] Interactor on vtkWidget

Leonardo M. Ramé l.rame at griensu.com
Wed Sep 22 08:17:15 EDT 2010


On 2010-09-22 09:44:08 +0530, rakesh patil wrote:
> Well,
> 
> This is what I have done. I subclassed contourWidget, and added one memder,
> ID for it. And in the mouse click event, i added shift click to pick the
> object. i.e. i maintain a separate list to store ids of selected widgets.
> And on shift click, id of that object is pushed on to this list. In this
> way, multiple widgets can also be picked.
> 
> Then when i delete, i traverse the list of picked ids, and delete those
> widgets.
> 
> Hope this may help.
> 
> Good luck
> 
> Thanks
> 
> Regards
> 
> Rakesh Patil
> 


Thanks Rakesh, thanks for commenting this out. 

I was thinking on using a similar solution to my problem, but I just
can't find the way to trigger the Mouse Click event on a
vtkDistanceWidget or vtkAngleWidget.

I tried adding observers with myDistanceWidget->AddObserver(...) but the
event wasn't fired. I also used
myDistanceWidget->GetInteractos()->AddObserver(...), in this case the
event is fired, but not for my widget, but for the whole interactor.

Could you show me the code to handle the mouse click event on the
widget?.

-- 
Leonardo M. Ramé
http://leonardorame.blogspot.com



More information about the vtkusers mailing list