[vtkusers] Widgets and RemoveAllProps

Nigel Nunn nNunn at ausport.gov.au
Tue Sep 6 13:57:29 EDT 2005


Hi Luca,

On Sun, 04 Sep 2005 Luca Picello <luca.picello at libero.it> wrote

> Having a renderwindow with a splinewidget and calling
> RemoveAllProps() what happen exactly?  I can see the actors are
> removed from the renderwindow and even of forcing them to appear
> they are not rendered anymore. (calling On() for splinewidget
> for example) however the referencecounter of the object is not
> modified... can somebody deeply explain to me what is expected
> to happen?


I think vtk3DWidget objects (here vtkSplineWidget) must be keeping
references to the renderer's vtkRenderWindowInteractor, and to the
vtkActor they manipulate.  To clear the pipelines, you might need
to try something like:

    mySplineWidget->SetInteractor(NULL);
    mySplineWidget->SetPriority(0.0);

I've just stared adding a whole flock of vtk3DWidgets, one for each
vtkActor that need manipulation, and breaking the above connections
has allowed me to switch widgets correctly.  I started by looking at
the documentation for vtkInteractorObserver::SetPriority:


virtual void vtkInteractorObserver::SetPriority  (float)

  Set/Get the priority at which events are processed. This is used
  when multiple interactor observers are used simultaneously. The
  default value is 0.0 (lowest priority.) Note that when multiple
  interactor observer have the same priority, then the last observer
  added will process the event first. (Note: once the SetInteractor()
  method has been called, changing the priority does not effect event
  processing. You will have to SetInteractor(NULL), change priority,
  and then SetInteractor(iren) to have the priority take effect.)

good luck!
Nigel


_____________________________________________________________________________________
This message is intended for the addressee named and may contain confidential and
privileged information. If you are not the intended recipient please note that
any form of distribution, copying or use of this communication or the information
in it is strictly prohibited and may be unlawful. If you receive this message in error,
please delete it and notify the sender. 
Keep up to date with what's happening in Australian sport. Visit www.ausport.gov.au
_____________________________________________________________________________________



More information about the vtkusers mailing list