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

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

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

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

#ifndef __I3DShGlobalDeformerHelper__
#define __I3DShGlobalDeformerHelper__

#if CP_PRAGMA_ONCE
#pragma once
#endif


struct I3DShTreeElement;
struct I3DShPrimitive;
template<class T> class TMCPtrArray;


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

MCDEFINE_GUID_H(IID_I3DShGlobalDeformerHelper);
MCDEFINE_GUID_H(CLSID_GlobalDeformerHelper);



/// \addtogroup ShellInterface
/// \{

// ****************************************************************************
//								I3DShGlobalDeformerHelper
// 
/// <P>The interface for the global deformer helper object that is used to build
/// magnets for instance.</P>
///
/// <P>I3DShGlobalDeformerHelper always implements I3DShTreeElement</P>
///
struct I3DShGlobalDeformerHelper : public IMCUnknown
{
	// ****************************************************************************
	//								GetTreeElement
	// 
	/// Returns a pointer to the I3DShTreeElement interface. This is equivalent to
	/// call QueryInterface with IID_I3DShTreeElement.
	/// 
	virtual	I3DShTreeElement*	MCCOMAPI GetTreeElement() = 0;

	// ****************************************************************************
	//								IsAttached
	// 
	/// Tells if the tree is notifying primitives of its movements	
	/// 
	/// \return true if the tree is linked to some primitives.
	///
	virtual boolean				MCCOMAPI IsAttached() = 0;

	// ****************************************************************************
	//								Attach
	// 
	/// Adds the given primitives to the list of primitives to notify of movement
	/// 
	/// \param primitives  The list of the primitives to attach to this tree
	/// 
	virtual void				MCCOMAPI AttachPrimitives(const TMCPtrArray<I3DShPrimitive>& primitives) = 0;

	// ****************************************************************************
	//								AttachPrimitive
	// 
	/// Adds the given primitive to the list of primitives notified when the tree moves.
	/// 
	/// \param primitive  The primitive that should be notified of tree movements.
	/// 
	virtual void				MCCOMAPI AttachPrimitive(I3DShPrimitive* primitive) = 0;

	// ****************************************************************************
	//								GetAttachedPrimitives
	// 
	/// Returns the list of primitives notified when the tree moves.
	/// 
	/// \param primitives  The list of primtives that are attached to this tree.
	/// 
	virtual void				MCCOMAPI GetAttachedPrimitives(TMCPtrArray<I3DShPrimitive>& primitives) = 0;


	// ****************************************************************************
	//								DetachPrimitives
	// 
	/// Clears the list of primitives to notify of tree movements if inPrimitives is NULL
	/// otherwise removes them from the internal list
	/// 
	virtual void				MCCOMAPI DetachPrimitives(const TMCPtrArray<I3DShPrimitive>* inPrimitives) = 0;

	// ****************************************************************************
	//								DetachPrimitive
	// 
	/// Removes from the list of primitives to notify of tree movements the given primitive
	///
	/// \param primitive  the primitive that should not be notified anymore of tree movements
	/// 
	virtual void				MCCOMAPI DetachPrimitive(I3DShPrimitive* primitive) = 0;
};

/// \}


#endif
