/*======================================================================================

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkSynchronizedQVTKWidget.cxx
	Version:		$Revision: 1821 $
	Date:			$Date: 2011-10-02 15:41:17 +0200 (So, 02 Okt 2011) $

	Copyright (c) 2010-2011
	Pattern Recognition Lab, 
    University Erlangen-Nuremberg, Germany
    All rights reserved.

	This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
	See RITKCopyright.txt for more information.

	http://www5.informatik.uni-erlangen.de/research/software/ritk

========================================================================================*/

#include "ritkSynchronizedQVTKWidget.h"

#include <vtkRenderWindow.h>
#include <itkRescaleIntensityImageFilter.h>
#include <itkImageFileWriter.h>

namespace ritk
{

SynchronizedQVTKWidget::SynchronizedQVTKWidget(QWidget* parent, Qt::WFlags f) 
	: QVTKWidget(parent, f)
{
}

SynchronizedQVTKWidget::~SynchronizedQVTKWidget()
{
}

void
SynchronizedQVTKWidget::Lock()
{
	m_Mutex.lock();
}

void
SynchronizedQVTKWidget::Unlock()
{
	m_Mutex.unlock();
}


void 
SynchronizedQVTKWidget::paintEvent(QPaintEvent* event)
{
	Lock();
	QVTKWidget::paintEvent(event);
	
	emit PaintEventInvoked();

	Unlock();
}


} // end namespace ritk
