[vtkusers] Disabling middle mouse button for	vtkImageTracerWidget
    David Doria 
    daviddoria at gmail.com
       
    Tue Nov 23 08:55:36 EST 2010
    
    
  
> David,
>
> vtkImageTracerWidget is written in the old style of widgets (inherit from
> vtk3DWidget)
> and so ProcessEvents has this method signature common to most/all(?)
> vtk3DWidget subclasses.
> You could subclass the widget's AddObservers method or set the widget's
> interactor,
> and after the SetEnabled call, you could remove the command from the
> interactor with
> RemoveObservers.
>
> Dean
Hmm, even with this:
void vtkSimpleImageTracerWidget::AddObservers(void)
{
  // Listen for the following events
  vtkRenderWindowInteractor *i = this->Interactor;
  if (i)
    {
    i->AddObserver(vtkCommand::MouseMoveEvent, this->EventCallbackCommand,
                   this->Priority);
    i->AddObserver(vtkCommand::LeftButtonPressEvent,
                   this->EventCallbackCommand, this->Priority);
    i->AddObserver(vtkCommand::LeftButtonReleaseEvent,
                   this->EventCallbackCommand, this->Priority);
    i->AddObserver(vtkCommand::RightButtonPressEvent,
                   this->EventCallbackCommand, this->Priority);
    i->AddObserver(vtkCommand::RightButtonReleaseEvent,
                   this->EventCallbackCommand, this->Priority);
    }
}
it still keeps the middle click line segment functionality.
I also tried:
void MyInteractorStyle::InitializeTracer()
{
...
  this->Tracer->On();
  this->Interactor->RemoveObserver(vtkCommand::MiddleButtonPressEvent);
  this->Interactor->RemoveObserver(vtkCommand::MiddleButtonReleaseEvent);
...
}
and the line segments STILL appear!
David
    
    
More information about the vtkusers
mailing list