mitk::BaseController * mitk::RenderWindowBase::GetController()
{
  mitk::BaseRenderer * renderer = mitk::BaseRenderer::GetInstance(GetVtkRenderWindow());
  switch ( renderer->GetMapperID() )
  {
    case mitk::BaseRenderer::Standard2D:
      return GetSliceNavigationController();

    case mitk::BaseRenderer::Standard3D:
      return GetCameraRotationController();

    default:
      return GetSliceNavigationController();
  }
}
Exemplo n.º 2
0
void mitk::RenderWindowBase::wheelMitkEvent(mitk::WheelEvent *we)
{
  if ( !m_ProcessWheelEvents )
  {
    if(m_Renderer.IsNotNull()) 
      m_Renderer->WheelEvent(we);
    return;
  }
 
  if ( !GetSliceNavigationController()->GetSliceLocked() )
  {
    mitk::Stepper* stepper = GetSliceNavigationController()->GetSlice();

    if (stepper->GetSteps() <= 1)
    {
      stepper = GetSliceNavigationController()->GetTime();
    }

    // get the desired delta
    int delta = we->GetDelta();
    if ( m_InvertScrollingDirection )
      delta *= -1;  // If we want to invert the scrolling direction -> delta * -1

    if ( delta < 0 )
    {
      stepper->Next();
    }
    else
    {
      stepper->Previous();
    }

    //also send to Renderer to send if to MITK interaction mechanism
    if(m_Renderer.IsNotNull()) 
      m_Renderer->WheelEvent(we);
    
  }
}