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

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

		Author:	Pierre-Sylvain
		Date:	10/21/2003

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

#ifndef __I3DExTerrainFilter__
#define __I3DExTerrainFilter__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "APITypes.h"
#include "Index.h"
#include "InterfaceIDs.h"
#include "MCArray.h"

//****** Globally Unique Id **************************************************
MCDEFINE_GUID2(IID_I3DExTerrainFilter, R_IID_I3DExTerrainFilter);

//****** Family Id ***********************************************************
const FourCharT kTerrainFilterFamilyID = kRID_TerrainFilterFamilyID;


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

/// \addtogroup ExternalInterface
///
/// \{

/// A Terrain filter is a filter that can be used in the terrain editor to
/// generate or modify a height field.
///
struct I3DExTerrainFilter : public IMCUnknown
{
	// ****************************************************************************
	//								Shuffle
	//
	/// Should change the seed of the random generator used by this filter (if the
	/// filter has a random component).
	///
	virtual void MCCOMAPI Shuffle() = 0;

	// ****************************************************************************
	//								Filter
	//
	/// Filter the height field. This is where the real work is done.
	///
	/// \param heightField	Array of real that defines the height field.
	/// \param heightBound	Height min and max of the terrain (must be updated
	///						by this function if the height bounds changed)
	/// \param size			size of the array
	/// \param cellSize		size of a cell of the grid
	///
	virtual void MCCOMAPI Filter(TMCArray<real>& heightField, TVector2& heightBound,
								 const TIndex2& size, const TVector2& cellSize) = 0;

	// ****************************************************************************
	//								CanBuildPreview
	//
	///	Returns true if the filter is able to make a preview
	///	of the final map working on a smaller map
	///
	virtual boolean MCCOMAPI CanBuildPreview() = 0;

	// ****************************************************************************
	//								SetDefaultSizes
	//
	///	Sets the default sizes for terrain features
	///	
	/// \param sizex the size of the terrain to which the filter is to be applied
	/// \param sizey the size of the terrain to which the filter is to be applied
	///
	virtual void MCCOMAPI SetDefaultSizes(real &sizex, real &sizey) = 0;

};

/// \}
#endif
