Dear all
I want to add an observer of mousewheelforward but it does not work. If i change it for another one like InteractionEvent it works but not with the wheel. I even tried to get the event when there is a mouse interaction but nothing. It is like it does not get the wheel information at all. I use vtkResliceImageViewer. I have used many ways, interator style, and others as you can see it commented. They work but without the wheel of the mouse.
Thanks in advance
My code is the following:
¨
image_viewer_->SetRenderWindow(renderWindow);
image_viewer_->SetupInteractor(renderWindow->GetInteractor());
vtkSmartPointer<vtkImageData> image_data = vtkImageData::SafeDownCast(
scene.get_volume()->GetMapper()->GetInputDataObject(0, 0));
image_viewer_->SetInputData(image_data);
image_viewer_->SetSliceOrientationToXY();
image_viewer_->SetSlice(261);
image_viewer_->SetResliceModeToAxisAligned();
/*vtkSmartPointer<vtkCallbackCommand> MyEventCallbackCommand = vtkSmartPointer<vtkCallbackCommand>::New();
MyEventCallbackCommand->SetCallback(KeypressCallbackFunction);
renderWindow->GetInteractor()->AddObserver(vtkCommand::MouseWheelForwardEvent,
MyEventCallbackCommand);*/
vtkNew<vtkAxialInteractionCallback> callback;
renderWindow->GetInteractor()->AddObserver(vtkCommand::MouseWheelForwardEvent, callback);
}
vtkNew<vtkResliceImageViewer> image_viewer_;
};