[vtkusers] Deleting a widget

David Doria daviddoria at gmail.com
Mon Sep 20 16:16:41 EDT 2010


On Mon, Sep 20, 2010 at 4:07 PM, Leonardo M. Ramé <l.rame at griensu.com> wrote:
> To set an interactor observer for a vtkWidget, one have to do this:
>
> myWidget->SetInteractor(myInteractor);
>
> Now, how can I get the list of widgets associated to this interactor?.
>
> I need this, because I want to select a widget (for example a
> vtkDistanceWidget) using the mouse, then traverse the list of widgets
> associated with an interactor, and ask if the nth element of the widget
> list is the one currently selected, then just delete it.
>
> If you know an easier way, please let me know.

You can always subclass the interactor and add member variables where
you store the widget pointers so you can access them from the
interactor functions.

David



More information about the vtkusers mailing list