Exemplo n.º 1
0
bool Interactor2DMeasure::ProcessMouseMoveEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  if ( m_bDrawing )
  {
    UpdateCursor( event, view );
    int posX = event->x();
    int posY = event->y();

//    LayerCollection* lc = MainWindow::GetMainWindowPointer()->GetLayerCollection( m_strLayerTypeName.c_str() );
//    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();

    if ( m_region )
    {
      if ( m_nAction == MM_Line )
      {
        ((Region2DLine*)m_region)->SetPoint2( posX, posY );
      }
      else if ( m_nAction == MM_Spline || m_nAction == MM_Polyline )
      {
        ((Region2DPolyline*)m_region)->UpdatePoint( -1, posX, posY );
      }
      else if ( m_nAction == MM_Rectangle )
      {
        ((Region2DRectangle*)m_region)->SetBottomRight( posX, posY );
      }
      view->RequestRedraw();
    }

    return false;
  }
  else if ( m_bEditing )
  {
    UpdateCursor( event, view );
    int offsetX = event->x() - m_nMousePosX;
    int offsetY = event->y() - m_nMousePosY;
    if ( m_region )
    {
      m_nMousePosX = event->x();
      m_nMousePosY = event->y();
      if ( m_nPointIndex >= 0 )
      {
        m_region->UpdatePoint( m_nPointIndex, m_nMousePosX, m_nMousePosY );
      }
      else
      {
        m_region->Offset( offsetX, offsetY );
      }
      view->RequestRedraw();
    }

    return false;
  }
  else
  {
    return Interactor2D::ProcessMouseMoveEvent( event, renderview );
  }
}
bool Interactor2DVolumeEdit::ProcessKeyDownEvent( QKeyEvent* event, RenderView* renderview )
{
  UpdateCursor( event, renderview );

  RenderView2D* view = ( RenderView2D* )renderview;
  if ( event->modifiers() & Qt::AltModifier && event->key() == Qt::Key_H )
  {
    Contour2D* c2d = view->GetContour2D();
    c2d->SetVisible( !c2d->IsVisible() );
    view->RequestRedraw();
    return false;
  }
  else if (event->modifiers() & Qt::ShiftModifier && event->key() == Qt::Key_C)
  {
    m_bColorPicking = true;
    return false;
  }
  else if (event->key() == Qt::Key_Escape)
  {
    m_bColorPicking = false;
    return false;
  }

  if ( !m_bEditing )
  {
    return Interactor2D::ProcessKeyDownEvent( event, renderview );
  }
  else
  {
    return false;
  }
}
Exemplo n.º 3
0
bool Interactor2D::ProcessMouseUpEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  if ( m_bSelecting )
  {
    view->StopSelection();
    view->RequestRedraw();
  }

  m_nMousePosX = event->x();
  m_nMousePosY = event->y();
  m_bWindowLevel = false;
  m_bChangeSlice = false;
  m_bMovingCursor = false;
  m_bSelecting = false;

  view->UpdateAnnotation();
  view->Update2DOverlay();

  if ( event->button() == Qt::LeftButton )
  {
    return false;
  }
  else
  {
    return Interactor::ProcessMouseUpEvent( event, renderview );
  }
}
Exemplo n.º 4
0
void Interactor2D::ProcessPostMouseWheelEvent( QWheelEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;
  view->UpdateAnnotation();
  view->Update2DOverlay();
  view->RequestRedraw();
  view->EmitZooming();

  Interactor::ProcessPostMouseWheelEvent( event, renderview );
}
Exemplo n.º 5
0
void Interactor2D::ProcessPostMouseMoveEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;
  if ( event->buttons() & Qt::RightButton )
  {
    view->Update2DOverlay();
    view->RequestRedraw();
  }

  Interactor::ProcessPostMouseMoveEvent( event, renderview );
}
bool Interactor2DVolumeEdit::ProcessMouseDownEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  if ( !view->hasFocus() )
  {
    return Interactor2D::ProcessMouseDownEvent( event, renderview );
  }

  if ( event->button() == Qt::LeftButton ||
       ( event->button() == Qt::RightButton && (event->buttons() & Qt::LeftButton) ) )
  {
    if ( (event->modifiers() & CONTROL_MODIFIER ) && (event->modifiers() & Qt::ShiftModifier) )
    {
      return Interactor2D::ProcessMouseDownEvent( event, renderview );
    }

    LayerCollection* lc = MainWindow::GetMainWindow()->GetLayerCollection( m_strLayerTypeName );
    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();
    if ( (!mri || !mri->IsVisible()) ) //&& ( event->ControlDown() || m_nAction == EM_Polyline ) )
    {
      emit Error( "LayerNotVisible", mri );
    }
    else if ( !mri->IsEditable() ) //&& ( event->ControlDown() || m_nAction == EM_Polyline ) )
    {
      emit Error( "LayerNotEditable", mri );
    }
    else if ( m_strLayerTypeName == "MRI" && ((LayerMRI*)mri)->IsTransformed() )
    {
      emit Error( "LayerNotEditableForTransformation", mri );
    }
    else
    {
      m_nMousePosX = event->x();
      m_nMousePosY = event->y();

      double ras[3];
      view->MousePositionToRAS( m_nMousePosX, m_nMousePosY, ras );
      bool bCondition = !(event->modifiers() & Qt::ShiftModifier) && !(event->buttons() & Qt::RightButton);
      if ( m_nAction == EM_Freehand ) //&& ( event->ControlDown() ) )
      {
        mri->SaveForUndo( view->GetViewPlane() );
        if ( event->modifiers() & CONTROL_MODIFIER )
        {
          mri->FloodFillByRAS( ras, view->GetViewPlane(), bCondition );
        }
        else
        {
          m_bEditing = true;
          mri->SetVoxelByRAS( ras, view->GetViewPlane(),bCondition );
        }
      }
      else if ( m_nAction == EM_Fill ) //&& ( event->ControlDown() ) )
      {
        mri->SaveForUndo( view->GetViewPlane() );
        mri->FloodFillByRAS( ras, view->GetViewPlane(), bCondition );
      }
      else if ( m_nAction == EM_Polyline || m_nAction == EM_Livewire )
      {
        mri->SaveForUndo( view->GetViewPlane() );
        if ( event->modifiers() & CONTROL_MODIFIER )
        {
          mri->FloodFillByRAS( ras, view->GetViewPlane(), bCondition );
        }
        else
        {
          m_bEditing = true;
          double ras2[3];
          view->GetCursor2D()->ClearInterpolationPoints();
          view->GetCursor2D()->GetPosition( ras2 );
          view->GetCursor2D()->SetPosition( ras );
          view->GetCursor2D()->SetPosition2( ras );
          if ( m_dPolylinePoints.size() > 0 )
          {
            if ( m_nAction == EM_Polyline )
            {
              mri->SetVoxelByRAS( ras, ras2, view->GetViewPlane(), bCondition );
            }
            else
            {
              mri->SetLiveWireByRAS( ras, ras2, view->GetViewPlane() );
            }
          }
          else
          {
            // mri->SaveForUndo( view->GetViewPlane() );
            m_dPolylinePoints.push_back( ras[0] );
            m_dPolylinePoints.push_back( ras[1] );
            m_dPolylinePoints.push_back( ras[2] );
            view->GetCursor2D()->SetPosition( ras );
          }

          view->grabMouse();
        }
      }
      else if ( m_nAction == EM_ColorPicker && mri->IsTypeOf( "MRI" ) )
      {
        if ( event->modifiers() & CONTROL_MODIFIER )
        {
          mri->SaveForUndo( view->GetViewPlane() );
          mri->FloodFillByRAS( ras, view->GetViewPlane(), bCondition );
        }
        else
        {
          double dValue = ((LayerMRI*)mri)->GetVoxelValue( ras );
          if ( dValue != 0 )
          {
            mri->SetFillValue( (float)dValue );
          }
        }
      }
      else if ( m_nAction == EM_Contour && mri->IsTypeOf( "MRI" ) )
      {
        LayerMRI* mri_ref = (LayerMRI*)MainWindow::GetMainWindow()->GetBrushProperty()->GetReferenceLayer();
        if ( !mri_ref )
        {
          emit Error( "LayerReferenceNotSet" );
          return false;
        }

        Contour2D* c2d = view->GetContour2D();
        if ( (event->modifiers() & CONTROL_MODIFIER) && (event->modifiers() & Qt::AltModifier) )
        {
          double dValue = mri_ref->GetVoxelValue( ras );
          if ( dValue != 0 )
          {
            m_bEditing = true;
            c2d->SetInput( mri_ref->GetSliceImageData( view->GetViewPlane() ), dValue, ras[view->GetViewPlane()], mri_ref->GetActiveFrame() );
            c2d->SetVisible( true );
            view->RequestRedraw();
          }
          else if ( c2d->IsVisible() )
          {
            m_bEditing = true;
          }
        }
        else if ( (event->modifiers() & CONTROL_MODIFIER) && !(event->modifiers() & Qt::AltModifier) )
        {
          mri->SaveForUndo( view->GetViewPlane() );
          ((LayerMRI*)mri)->FloodFillByContour2D( ras, c2d );
        }
        else if ( event->modifiers() & Qt::ShiftModifier )
        {
          m_bEditing = true;
          c2d->RemoveLine( ras, ras );
          view->RequestRedraw();
        }
        else
        {
          m_bEditing = true;
          c2d->AddLine( ras, ras );
          view->RequestRedraw();
        }
      }
      else
      {
        return Interactor2D::ProcessMouseDownEvent( event, renderview );
      }
    }

    return false;
  }
  else if ( m_bEditing )
  {
    m_bEditing = false;
    if ( m_nAction == EM_Polyline || m_nAction == EM_Livewire )
    {
      if ( event->button() == Qt::MidButton )
      {
        view->GetCursor2D()->Update();
        view->RequestRedraw();
      }
      else if ( event->button() == Qt::RightButton )
      {
        if ( m_dPolylinePoints.size() > 0 && m_nAction == EM_Polyline )
        {
          LayerCollection* lc = MainWindow::GetMainWindow()->GetLayerCollection( m_strLayerTypeName );
          LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();

          double ras1[3] = { m_dPolylinePoints[0], m_dPolylinePoints[1], m_dPolylinePoints[2] };
          double ras2[3];
          view->GetCursor2D()->GetPosition( ras2 );
          view->GetCursor2D()->SetPosition2( ras2 );
          view->GetCursor2D()->SetPosition( ras1 );
          mri->SetVoxelByRAS( ras1, ras2, view->GetViewPlane(), !(event->modifiers() & Qt::ShiftModifier) );
        }
        else
        {
          // mri->SetLiveWireByRAS( ras1, ras2, view->GetViewPlane() );
          view->GetCursor2D()->Update();
          view->RequestRedraw();
        }
      }
    }

    m_dPolylinePoints.clear();
    view->releaseMouse();

    return false;
  }
  return Interactor2D::ProcessMouseDownEvent( event, renderview ); // pass down the event
}
bool Interactor2DVolumeEdit::ProcessMouseMoveEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  if ( m_bEditing )
  {
    UpdateCursor( event, view );
    int posX = event->x();
    int posY = event->y();

    LayerCollection* lc = MainWindow::GetMainWindow()->GetLayerCollection( m_strLayerTypeName );
    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();
    if ( m_nAction == EM_Freehand )
    {
      double ras1[3], ras2[3];
      view->MousePositionToRAS( m_nMousePosX, m_nMousePosY, ras1 );
      view->MousePositionToRAS( posX, posY, ras2 );

      mri->SetVoxelByRAS( ras1, ras2, view->GetViewPlane(),
                          !(event->modifiers() & Qt::ShiftModifier) && !(event->buttons() & Qt::RightButton) );
    }
    else if ( m_nAction == EM_Polyline || m_nAction == EM_Livewire )
    {
      double ras[3];
      view->MousePositionToRAS( posX, posY, ras );
      view->GetCursor2D()->SetPosition2( ras );
      if ( m_nAction == EM_Livewire )
      {
        view->GetCursor2D()->SetInterpolationPoints(
          mri->GetLiveWirePointsByRAS( ras,
                                       view->GetCursor2D()->GetPosition(),
                                       view->GetViewPlane() ) );
      }
      view->GetCursor2D()->SetPosition( view->GetCursor2D()->GetPosition(), true );
      view->RequestRedraw();
    }
    else if ( m_nAction == EM_Contour )
    {
      LayerMRI* mri_ref = (LayerMRI*)MainWindow::GetMainWindow()->GetBrushProperty()->GetReferenceLayer();
      Contour2D* c2d = view->GetContour2D();
      if ( event->modifiers() & Qt::ShiftModifier )
      {
        double ras1[3], ras2[3];
        view->MousePositionToRAS( m_nMousePosX, m_nMousePosY, ras1 );
        view->MousePositionToRAS( posX, posY, ras2 );
        c2d->RemoveLine( ras1, ras2 );
      }
      else if ( (event->modifiers() & CONTROL_MODIFIER) && (event->modifiers() & Qt::AltModifier) )
      {
        double scale = 0.2;
        if ( mri_ref )
        {
          double dMin = mri_ref->GetProperty()->GetMinValue();
          double dMax = mri_ref->GetProperty()->GetMaxValue();
          scale = ( dMax - dMin ) * 0.0005;
        }
        c2d->SetContourValue( c2d->GetContourValue() + scale * ( posY - m_nMousePosY ) );
      }
      else
      {
        double ras1[3], ras2[3];
        view->MousePositionToRAS( m_nMousePosX, m_nMousePosY, ras1 );
        view->MousePositionToRAS( posX, posY, ras2 );
        c2d->AddLine( ras1, ras2 );
      }

      view->RequestRedraw();
    }

    m_nMousePosX = posX;
    m_nMousePosY = posY;

    return false;
  }
  else
  {
    return Interactor2D::ProcessMouseMoveEvent( event, renderview );
  }
}
Exemplo n.º 8
0
bool Interactor2DMeasure::ProcessMouseDownEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;
// UpdateCursor( event, view );

  if ( m_region && !m_bDrawing && !m_bEditing )
  {
    m_region->Highlight( false );
  }

  if ( event->button() == Qt::LeftButton )
  {
    if ( ( event->modifiers() & CONTROL_MODIFIER ) && ( event->modifiers() & Qt::ShiftModifier ) )
    {
      return Interactor2D::ProcessMouseDownEvent( event, renderview );
    }

    LayerCollection* lc = MainWindow::GetMainWindow()->GetLayerCollection( "MRI" );
    LayerVolumeBase* mri = ( LayerVolumeBase* )lc->GetActiveLayer();
    if ( mri )
    {
      m_nMousePosX = event->x();
      m_nMousePosY = event->y();

      if ( m_region && m_bDrawing ) // drawing
      {
        ((Region2DPolyline*)m_region)->AddPoint( m_nMousePosX, m_nMousePosY );
      }
      else
      {
        Region2D* reg = view->GetRegion( m_nMousePosX, m_nMousePosY, &m_nPointIndex );
        if ( !reg ) // new region
        {
          if ( m_nAction == MM_Line )
          {
            Region2DLine* reg_line = new Region2DLine( view );
            reg_line->SetLine( m_nMousePosX, m_nMousePosY, m_nMousePosX, m_nMousePosY );
            view->AddRegion( reg_line );
            m_region = reg_line;
          }
          else if ( m_nAction == MM_Spline || m_nAction == MM_Polyline )
          {
            Region2DPolyline* reg_polyline = new Region2DPolyline( view, m_nAction == MM_Spline );
            reg_polyline->AddPoint( m_nMousePosX, m_nMousePosY );
            reg_polyline->AddPoint( m_nMousePosX, m_nMousePosY ); // add second point
            view->AddRegion( reg_polyline );
            m_region = reg_polyline;
          }
          else if ( m_nAction == MM_Rectangle )
          {
            Region2DRectangle* reg_rect = new Region2DRectangle( view );
            reg_rect->SetRect( m_nMousePosX, m_nMousePosY, 1, 1 );
            view->AddRegion( reg_rect );
            m_region = reg_rect;
          }
          m_bDrawing = true;
        }
        else      // editing
        {
          m_region = reg;
          m_bEditing = true;
          m_region->Highlight();
          view->EmitRegionSelected( reg );
          view->RequestRedraw();
        }
      }
      return false;
    }
  }
  else if ( event->button() == Qt::RightButton )
  {
    if ( m_bDrawing && m_region )
    {
      m_bDrawing = false;
      m_bEditing = false;
      if ( m_nAction == MM_Spline || m_nAction == MM_Polyline )
      {
        ((Region2DPolyline*)m_region)->RemoveLastPoint();
      }
      view->RequestRedraw();
      return false;
    }
  }

  return Interactor2D::ProcessMouseDownEvent( event, renderview ); // pass down the event
}
Exemplo n.º 9
0
bool Interactor2D::ProcessMouseDownEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  m_nMousePosX = event->x();
  m_nMousePosY = event->y();

  view->UpdateAnnotation();

  view->PickLineProfile(m_nMousePosX, m_nMousePosY);

  MainWindow* mainwnd = MainWindow::GetMainWindow();
  if ( ( event->modifiers() & CONTROL_MODIFIER ) &&  !( event->modifiers() & Qt::ShiftModifier ) )
  {
    if ( event->button() == Qt::LeftButton )
    {
#ifndef Q_WS_MAC
      view->ZoomAtCursor( m_nMousePosX, m_nMousePosY, 2.0 );    // zoom in
#endif
      return false;
    }
    else if ( event->button() == Qt::RightButton )
    {
#ifndef Q_WS_MAC
      view->ZoomAtCursor( m_nMousePosX, m_nMousePosY, 0.5 );    // zoom out
#endif
      return false;
    }
  }

  if ( event->button() == Qt::LeftButton )
  {
    m_nDownPosX = m_nMousePosX;
    m_nDownPosY = m_nMousePosY;

    if ( !( event->modifiers() & CONTROL_MODIFIER ) &&  ( event->modifiers() & Qt::ShiftModifier ) &&
         !mainwnd->IsRepositioningSurface())
    {
      m_bWindowLevel = true;
    }
    else
    {
      m_bMovingCursor = true;
      view->UpdateCursorRASPosition( m_nMousePosX, m_nMousePosY );
      view->RequestRedraw();
      if (mainwnd->IsRepositioningSurface())
      {
        if ( event->modifiers() & CONTROL_MODIFIER &&
          event->modifiers() & Qt::ShiftModifier)
          QTimer::singleShot(0, mainwnd, SIGNAL(SurfaceRepositionIntensityChanged()));
        else if (event->modifiers() & Qt::ShiftModifier)
          QTimer::singleShot(0, mainwnd, SIGNAL(SurfaceRepositionVertexChanged()));
      }
    }
  }
  else if ( event->button() == Qt::MidButton && ( event->modifiers() & Qt::ShiftModifier ) )
  {
    m_bSelecting = true;
    view->StartSelection( m_nMousePosX, m_nMousePosY );
  }
  else if ( event->button() == Qt::RightButton &&
            !( event->modifiers() & CONTROL_MODIFIER ) &&
            ( event->modifiers() & Qt::ShiftModifier ) )
  {
    m_bWindowLevel = true;
  }
#ifdef Q_WS_MAC
  else if ( event->button() == Qt::RightButton &&
            ( event->modifiers() & CONTROL_MODIFIER ) &&
            ( event->modifiers() & Qt::ShiftModifier ) )
  {
    m_bMovingCursor = true;
    view->UpdateCursorRASPosition( m_nMousePosX, m_nMousePosY );
    view->RequestRedraw();
  }
#endif
  else if (event->button() == Qt::MidButton && (event->modifiers() & CONTROL_MODIFIER ))
  {
    m_bChangeSlice = true;
  }
  else
  {
    return Interactor::ProcessMouseDownEvent( event, renderview ); // pass down the event
  }

  return false; // do not pass down the event
}
Exemplo n.º 10
0
bool Interactor2D::ProcessMouseMoveEvent( QMouseEvent* event, RenderView* renderview )
{
  RenderView2D* view = ( RenderView2D* )renderview;

  MainWindow* mainwnd = MainWindow::GetMainWindow();
  if ( mainwnd->IsEmpty() )
  {
    return Interactor::ProcessMouseMoveEvent( event, renderview );
  }

  int posX = event->x();
  int posY = event->y();

  if ( m_bChangeSlice )
  {
    double* voxelSize = mainwnd->GetLayerCollection( "MRI" )->GetWorldVoxelSize();
    int nPlane = view->GetViewPlane();
    double dPixelPer = -0.25;

    double dPosDiff =  ( ( (int)( dPixelPer * ( posY - m_nDownPosY ) ) ) / dPixelPer -
                         ( (int)( dPixelPer * ( m_nMousePosY - m_nDownPosY ) ) ) / dPixelPer )
                       * dPixelPer * voxelSize[nPlane];
    if ( mainwnd->OffsetSlicePosition( nPlane, dPosDiff ) )
    {
      m_nMousePosX = posX;
      m_nMousePosY = posY;
    }
  }
  else if ( m_bMovingCursor )
  {
    view->UpdateCursorRASPosition( posX, posY );
    view->RequestRedraw();
  }
  else if ( m_bWindowLevel )
  {
    QList<Layer*> layers = mainwnd->GetLayerCollection( "MRI" )->GetLayers();
    LayerMRI* layer = (LayerMRI*)mainwnd->GetActiveLayer("MRI");
    if (layer && (!layer->IsVisible() || layer->GetProperty()->GetColorMap() == LayerPropertyMRI::LUT))
    {
      layer = NULL;
    }
    if (layer == NULL)
    {
      for ( int i = 0; i < layers.size(); i++ )
      {
        layer = ( LayerMRI*)layers[i];
        if ( layer->IsVisible() && layer->GetProperty()->GetColorMap() != LayerPropertyMRI::LUT )
        {
          break;
        }
        else
        {
          layer = NULL;
        }
      }
    }
    if ( layer )
    {
      double scaleX = 0.002;
      double scaleY = 0.002;
      double w = ( posX - m_nMousePosX ) * scaleX;
      double l = ( posY - m_nMousePosY ) * scaleY;
      double scaleOverall = layer->GetProperty()->GetMaxValue() -
                            layer->GetProperty()->GetMinValue();
      w *= scaleOverall;
      l *= scaleOverall;
      switch ( layer->GetProperty()->GetColorMap() )
      {
      case LayerPropertyMRI::Grayscale:
        w += layer->GetProperty()->GetWindow();
        l += layer->GetProperty()->GetLevel();
        if ( w < 0 )
        {
          w = 0;
        }
        layer->GetProperty()->SetWindowLevel(w, l);
        break;
      case LayerPropertyMRI::Heat:
        w += layer->GetProperty()->GetHeatScaleMaxThreshold() - layer->GetProperty()->GetHeatScaleMinThreshold();
        l += (layer->GetProperty()->GetHeatScaleMaxThreshold() + layer->GetProperty()->GetHeatScaleMinThreshold())/2;
        if ( w < 0 )
        {
          w = 0;
        }
        layer->GetProperty()->SetHeatScale( l-w/2, l, l+w/2 );
        break;
      default:
        w += layer->GetProperty()->GetMaxGenericThreshold() - layer->GetProperty()->GetMinGenericThreshold();
        l += (layer->GetProperty()->GetMaxGenericThreshold() + layer->GetProperty()->GetMinGenericThreshold())/2;
        if ( w < 0 )
        {
          w = 0;
        }
        layer->GetProperty()->SetMinMaxGenericThreshold( l-w/2, l+w/2 );
        break;
      }
    }
    m_nMousePosX = posX;
    m_nMousePosY = posY;
  }
  else if ( m_bSelecting )
  {
    view->UpdateSelection( posX, posY );
    view->RequestRedraw();
  }
  else
  {
    if ( event->buttons() & Qt::MidButton || event->buttons() & Qt::RightButton )
    {
      view->UpdateAnnotation();
      view->Update2DOverlay();
      if ( event->buttons() & Qt::RightButton )
      {
        view->EmitZooming();
      }
    }
    else
    {
      view->UpdateMouseRASPosition( posX, posY );
    }

    return Interactor::ProcessMouseMoveEvent( event, renderview );
  }

  return false;
}