/***************************************************************************
*                                                                          *
*  Copyright (C) Golaem S.A.  All Rights Reserved.                         *
*                                                                          *
***************************************************************************/

#pragma once

#include "glmSDKAPI.h"
#include "glmGeometry3.h"
#include <glmProgress.h>

namespace glm
{
	/**
	* \brief This abstract class handles loading geometries.
	*
	* \ingroup Geometry
	*
	* \author Golaem <dev@golaem.com>
	*/
	class GLM_SDK_API AbstractLoadGeometryFunctor
	{
	public:
		/**
		* \brief Default constructor
		* \param fileType The type of file.
		*/ 
		AbstractLoadGeometryFunctor(const glm::GlmString& fileType);

		/**
		* \name Progress
		*/
		//@{
		inline const Progress::SP getProgress() const;
		inline Progress::SP touchProgress();
		//@}

		/**
		* \brief Virtual destructor
		*/
		virtual ~AbstractLoadGeometryFunctor();

		/**
		* \brief The operator loading the file.
		*/
        virtual glm::Array<Geometry3*>* operator()(const glm::GlmString& filePath) = 0;

    protected: 
		Progress::SP _progress;
	};

	//*****************************************************************************
	// AbstractLoadGeometryFunctor inline definitions
	//*****************************************************************************

	//-----------------------------------------------------------------------------
	// getProgress
	//-----------------------------------------------------------------------------
	const Progress::SP AbstractLoadGeometryFunctor::getProgress() const
	{
		return _progress;
	}

	//-----------------------------------------------------------------------------
	// touchProgress
	//-----------------------------------------------------------------------------
	Progress::SP AbstractLoadGeometryFunctor::touchProgress()
	{
		return _progress;
	}
}
