[vtkusers] Enable/Disable a vtkSphereWidget

Jochen jochen.kling at email.de
Thu May 24 10:14:37 EDT 2012


Hi Chavdar,

this is what a comment in the vtkInteractorObserver (vtkInteractorObserver
is a superclass of vtkSphereWidget, which actually handles the
Enable/Disable-stuff) says:
 
 // WARNING: see .h, if the DefaultRenderer is set, whatever the value
  // of _arg (except NULL), we are going to use DefaultRenderer
  // Normally when the widget is activated (SetEnabled(1) or when 
  // keypress activation takes place), the renderer over which the mouse
  // pointer is positioned is used to call SetCurrentRenderer(). 
  // Alternatively, we may want to specify a user-defined renderer to bind
the 
  // interactor to when the interactor observer is activated.
  // The problem is that in many 3D widgets, when SetEnabled(0) is called,
  // the CurrentRender is set to NULL. In that case, the next time
  // SetEnabled(1) is called, the widget will try to set CurrentRenderer
  // to the renderer over which the mouse pointer is positioned, and we 
  // will use our user-defined renderer. To solve that, we introduced the
  // DefaultRenderer ivar, which will be used to force the value of 
  // CurrentRenderer each time SetCurrentRenderer is called (i.e., no matter
  // if SetCurrentRenderer is called with the renderer that was poked at
  // the mouse coords, the DefaultRenderer will be used).


I would try to use 
   _SphereWidget.SetDefaultRenderer(<theRenderer>)
instead of 
   _SphereWidget.SetCurrentRenderer(<theRenderer>)

during the initialization steps.

<theRenderer> is a placeholder for your vtkRenderer object.


best regards
Jochen

--
View this message in context: http://vtk.1045678.n5.nabble.com/Enable-Disable-a-vtkSphereWidget-tp5713361p5713367.html
Sent from the VTK - Users mailing list archive at Nabble.com.



More information about the vtkusers mailing list