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

	Program:		Range Imaging Toolkit (RITK)
	Module:			ritkEvent.h
	Version:		$Revision: 1761 $
	Date:			$Date: 2011-09-23 17:25:41 +0200 (Fr, 23 Sep 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

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

#ifndef EVENT_H__
#define EVENT_H__

#include "ritkCore.h"

#include <QEvent>
#include <QSharedPointer>
#include "ritkRImage.h"

namespace ritk
{

/**	@ingroup	Core
 *	@class		Event
 *	@author		Jakob Wasza
 *	@brief		Base class for all RITK events
 *
 *	@details
 *	This class provides the base for all RITK events.
 */
class CORE_EXPORT Event : public QEvent
{
public:
	/// Constructor
	Event();
	/// Constructor
	Event(QEvent::Type);
	/// Destructor
	virtual ~Event();

public:
	/// QSharedPointer
	typedef QSharedPointer<Event> Pointer;
	/// Standard EventType
	static QEvent::Type EventType;
};


/**	@ingroup	Core
 *	@class		StopEvent
 *	@author		Jakob Wasza
 *	@brief		Event that signals a threaded processor to stop
 *
 *	@details
 *	This event will signal a threaded processor to stop
 */
class CORE_EXPORT StopEvent : public Event
{
public:
	/// Constructor
	StopEvent();
	/// Destructor
	virtual ~StopEvent();

public:
	/// QSharedPointer
	typedef QSharedPointer<StopEvent> Pointer;
	/// The event type
	static QEvent::Type EventType;
};


/**	@ingroup	Core
 *	@class		NewFrameEvent
 *	@author		Jakob Wasza
 *	@brief		Event that indicates availability of a new frame
 *
 *	@details
 *	This event indicates the availability of a new frame. Note
 *	that the RImage member already contains a valid WorldCoordImage.
 */
class CORE_EXPORT NewFrameEvent : public Event
{
public:
	/// Constructor
	NewFrameEvent();
	/// Destructor
	~NewFrameEvent();

public:
	typedef QSharedPointer<NewFrameEvent> Pointer;
	/// The event type
	static QEvent::Type EventType;

	/**	@name The range image */
	//@{
	typedef RImageF2 RImageType;
	typedef RImageType::Pointer RImagePointer;
	typedef RImageType::ConstPointer RImageConstPointer;
	RImageConstPointer RImage;
	//@}
};
	

/**	@ingroup	Core
 *	@class		NewFileEvent
 *	@author		Sebastian Bauer
 *	@brief		Event that indicates availability of a new file (e.g. used by dataset source plugin)
 *
 *	@details
 *	This event indicates the availability of a new file. Note
 *	that the RImage member already contains a valid WorldCoordImage.
 */
class CORE_EXPORT NewFileEvent : public Event
{
public:
	/// Constructor
	NewFileEvent();
	/// Destructor
	~NewFileEvent();

public:
	typedef QSharedPointer<NewFileEvent> Pointer;
	/// The event type
	static QEvent::Type EventType;

	/**	@name The range image */
	//@{
	typedef RImageF2 RImageType;
	typedef RImageType::Pointer RImagePointer;
	typedef RImageType::ConstPointer RImageConstPointer;
	RImageConstPointer RImage;
	//@}
};

} // end namespace ritk


#endif // EVENT_H__
