#ifndef VisualizationKinectWIDGET_H__
#define VisualizationKinectWIDGET_H__

#include <QWidget>
#include "ui_VisualizationKinectWidget.h"

#include "ritkRImage.h"
#include "ritkRGBRImage.h"
#include "KinectSkeleton.h"
#include "OpenGLSkeletonEntity.h"
#include "ritkOpenGLRImageEntity.h"


class VisualizationKinectWidget : public QWidget, public Ui_VisualizationKinectWidget
{
	Q_OBJECT

public:
	/// Constructor
	VisualizationKinectWidget();
	/// Destructor
	~VisualizationKinectWidget();


	/** @name Typedefs for the range image and components*/
	//@{
	typedef ritk::RImageF2 RImageType;
	typedef RImageType::Pointer RImagePointer;
	typedef RImageType::ConstPointer RImageConstPointer;


	typedef KinectSkeleton::ConstPointer SkeletonConstPointer;
	typedef KinectSkeleton::Pointer SkeletonPointer;


	//@}

public slots:
	void UpdateGUI();
	void SetRangeData(RImageConstPointer Data);
	void SetSkeletonData(SkeletonConstPointer Data);
	void LoadConfigButtonEvent();
	

signals:
	void ConfigButtonPressed();

protected:
	/// Mutex used to synchronize rendering and data update
	QMutex m_Mutex;

	/// Our RImage entiry
	ritk::OpenGLRImageEntity::Pointer m_RImageEntity;
	ritk::OpenGLSkeletonEntity::Pointer m_SkeletonEntity;
};

#endif // VisualizationKinectWIDGET_H__
