////////////////////////////////////////////////////////////////////////////////////////
| 189 | |
| 190 | ///////////////////////////////////////////////////////////////////////////////////////////// |
| 191 | boost::signals2::connection |
| 192 | pcl::visualization::Window::registerMouseCallback (std::function<void (const pcl::visualization::MouseEvent&)> callback) |
| 193 | { |
| 194 | // just add observer at first time when a callback is registered |
| 195 | if (mouse_signal_.empty ()) |
| 196 | { |
| 197 | interactor_->AddObserver (vtkCommand::MouseMoveEvent, mouse_command_); |
| 198 | interactor_->AddObserver (vtkCommand::MiddleButtonPressEvent, mouse_command_); |
| 199 | interactor_->AddObserver (vtkCommand::MiddleButtonReleaseEvent, mouse_command_); |
| 200 | interactor_->AddObserver (vtkCommand::MouseWheelBackwardEvent, mouse_command_); |
| 201 | interactor_->AddObserver (vtkCommand::MouseWheelForwardEvent, mouse_command_); |
| 202 | interactor_->AddObserver (vtkCommand::LeftButtonPressEvent, mouse_command_); |
| 203 | interactor_->AddObserver (vtkCommand::LeftButtonReleaseEvent, mouse_command_); |
| 204 | interactor_->AddObserver (vtkCommand::RightButtonPressEvent, mouse_command_); |
| 205 | interactor_->AddObserver (vtkCommand::RightButtonReleaseEvent, mouse_command_); |
| 206 | } |
| 207 | return (mouse_signal_.connect (callback)); |
| 208 | } |
| 209 | |
| 210 | ///////////////////////////////////////////////////////////////////////////////////////////// |
| 211 | boost::signals2::connection |