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

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

		Author:	Pierre-Sylvain
		Date:	03/19/2007

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

#ifndef __I3DExGlobalDeformer__
#define __I3DExGlobalDeformer__

#if CP_PRAGMA_ONCE
#pragma once
#endif


struct I3DShGlobalDeformerHelper;
struct I3DExGlobalDeformerInstance;


//****** Globally Unique Ids *************************************************

MCDEFINE_GUID_H(IID_I3DExGlobalDeformer);
MCDEFINE_GUID_H(IID_I3DExGlobalDeformerInstance);



/// \addtogroup ExternalInterface
/// \{

// ****************************************************************************
//								I3DExGlobalDeformer
// 
/// <P>The interface for the global deformer. This interface should be implemented
/// on one of the data component of a global deformer helper.</P>
///
struct I3DExGlobalDeformer : public IMCUnknown
{
	virtual void		MCCOMAPI CreateGlobalDeformerInstance(I3DShGlobalDeformerHelper* tree, I3DExGlobalDeformerInstance** out) = 0;
};


// ****************************************************************************
//								I3DExGlobalDeformerInstance
// 
/// <P>The interface for an instance of a global deformer.</P>
///
struct I3DExGlobalDeformerInstance : public IMCUnknown
{
	// ****************************************************************************
	//								GetSubGlobalDeformerHelperCount
	// 
	/// Returns the number of deformer helper.
	/// 
	virtual	int32		MCCOMAPI GetSubGlobalDeformerHelperCount() = 0;

	// ****************************************************************************
	//								GetSubGlobalDeformerHelper
	// 
	/// Returns on of the sub global deformer helper.
	/// 
	/// \param index	The index of the helper.
	///
	virtual I3DShGlobalDeformerHelper*		MCCOMAPI GetSubGlobalDeformerHelper(int32 index) = 0;

	// ****************************************************************************
	//								IsContextValid
	// 
	/// Returns true if the context is valid.
	//
	virtual boolean		MCCOMAPI IsContextValid() = 0;

	// ****************************************************************************
	//								InvalidateContext
	// 
	/// Invalidates the context.
	//
	virtual void		MCCOMAPI InvalidateContext() = 0;

	// ****************************************************************************
	//								ValidateContext
	// 
	/// Validates the context. This function should be called before calling
	/// DeformPoint().
	//
	virtual void		MCCOMAPI ValidateContext() = 0;

	// ****************************************************************************
	//								DeformPoint
	// 
	/// Apply the deformer on a point.
	//
	/// /param point		[in, out] The point in global coordinates.
	/// /param strength		The strength of the modifier
	//
	virtual void		MCCOMAPI DeformPoint(TVector3& point, real32 strength) = 0;
};

/// \}


#endif
