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

#pragma once

#include "glmSDKAPI.h"
#include "glmAbstractSpatialEnvironmentCreator.h"
#include "glmGseOStream.h"

//golaem core includes
#include <glmProgress.h>

namespace glm
{
	class SpatialEnvironment;
	/**
	* \brief SpatialEnvironmentGseSaver comments
	*/
	class GLM_SDK_API SpatialEnvironmentGseSaver : public AbstractSpatialEnvironmentCreator
	{
	public:

		SpatialEnvironmentGseSaver(std::ostream & stream);
		SpatialEnvironmentGseSaver(const glm::GlmString & filename);
		virtual ~SpatialEnvironmentGseSaver() ;

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

        GseComputationErrorCode::Value saveSpatialEnvironment(const SpatialEnvironment& spatialEnvironment);

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

		Progress::SP _progress;

		GseOStream _stream;

	private:
		GLM_DISALLOW_COPY_AND_ASSIGN(SpatialEnvironmentGseSaver);
	} ;
}
