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

#pragma once

#include "glmSDKAPI.h"

#include "glmGeometry3.h"
#include "glmProgress.h"

namespace glm
{
	class SpatialEnvironment;
	class Geometry3;
	class NavigationMesh3;
	class Roadmap;

	/** 
	* \brief An abstract class defining Spatial Environment creators.
	*
	* \ingroup SpatialEnvironment
	*
	* \author Golaem <dev@golaem.com>
	*/
	class GLM_SDK_API AbstractSpatialEnvironmentCreator
	{
	public:

		AbstractSpatialEnvironmentCreator() ;
		virtual ~AbstractSpatialEnvironmentCreator() ;

		/**
		* \brief Create a new spatial environment.
		*/
		virtual GseComputationErrorCode::Value operator()(bool& cancel);

		/**
		* \brief Returns the process progress
		* \return the process progress
		*/
		const Progress::SP getProgress() const;

		/**
		* \brief Returns a reference to the process progress
		* \return a reference to the process progress
		*/
		Progress::SP touchProgress();

		/**
		* \brief The spatial environment that is created.
		*/
		SpatialEnvironment* _spatialEnvironment;

		/**
		* \brief The geometry from which the spatial environment is computed
		*/
		Geometry3 _geometry;

	protected:

		/**
		* \brief Computes the spatial environment
		*/
		virtual GseComputationErrorCode::Value doComputation(bool& cancel) = 0;

		/**
		* \brief The progress process.
		*/
		Progress::SP _progress;
		
	private:

		GLM_DISALLOW_COPY_AND_ASSIGN(AbstractSpatialEnvironmentCreator);

	} ;
}
