/****************************************************************************************************

		SimpleTerrainFilter.h
		Copyright: (c) 2001 Eovia Corp. All rights reserved.

		Author:	Lionel
		Date:	10/5/2004

****************************************************************************************************/

#ifndef __SimpleTerrainFilter__
#define __SimpleTerrainFilter__


#include "SimpleTerrainFilterDef.h"

#include "BasicCOMImplementations.h"
#include "MCBasicTypes.h"

#include "BasicTerrainFilter.h"
#include "MCPtrArray.h"
#include "MCCountedPtrHelper.h"

//----------------------
// TSimpleTerrainFilter
//----------------------

// This Terrain Filter creates a conical crater at the center of the terrain.


class TSimpleTerrainFilter : public TBasicTerrainFilter
{
public:
	struct TParameterMap
	{
		TParameterMap();
		real	fRadius;
	};

public:
	static const MCGUID	sClassId;

public:
	TSimpleTerrainFilter();
	~TSimpleTerrainFilter();

	// TBasicDataExchanger
	virtual MCCOMErr	MCCOMAPI	QueryInterface			(const MCIID &riid, void** ppvObj);
	STANDARD_RELEASE;

	virtual void*		MCCOMAPI	GetExtensionDataBuffer	();
	virtual int32		MCCOMAPI	GetParamsBufferSize		() const	{ return sizeof(fParameterMap);}

	// I3DExTerrainFilter
	virtual void		MCCOMAPI	Shuffle					() {}
	virtual void		MCCOMAPI	Filter					(TMCArray<real>& heightField, TVector2& heightBound,
															 const TIndex2& size, const TVector2& cellSize);
	virtual boolean		MCCOMAPI	CanBuildPreview			() { return true; }
	virtual void MCCOMAPI SetDefaultSizes(real &sizex, real &sizey) { }

protected:
	real				GetValue(real x, real y);

protected:
	TParameterMap	fParameterMap;

};


#endif


