[vtkusers] vtkBoxWidget2 Mouse Interaction Modification

imran khan khan.imranh at gmail.com
Tue Jan 4 10:26:32 EST 2011


I would like to be able to move the vtkBoxWidget2 using the left mouse
button instead of the middle mouse button.
The left mouse button should still reshape the widget if the mouse is on a
handle.

Changing the code from

this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent,
                                          vtkWidgetEvent::Translate,
                                          this,
vtkBoxWidget2::TranslateAction);

this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent,
                                          vtkWidgetEvent::EndTranslate,
                                          this,
vtkBoxWidget2::EndSelectAction);
To this

  this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent,
                                          vtkWidgetEvent::Translate,
                                          this,
vtkBoxWidget2::TranslateAction);

this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent,
                                          vtkWidgetEvent::EndTranslate,
                                          this,
vtkBoxWidget2::EndSelectAction);

Did not have the desired results. Basically the widget just highlights when
I press the left mouse
button.

Clearly I am missing something.

-- 
Imran <http://www.linkedin.com/in/imranhkhan>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20110104/78a067c4/attachment.htm>


More information about the vtkusers mailing list