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

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

		Author:	Benjamin
		Date:	10/30/2002

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

#ifndef __I3DShFacetMeshGenerator__
#define __I3DShFacetMeshGenerator__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "ComTypes.h"
#include "APITypes.h"

struct FacetMesh;
class TBBox3D;

MCDEFINE_GUID_H(IID_I3DShFacetMeshGenerator);

/// \addtogroup ShellInterface
/// \{


// ****************************************************************************
//								I3DShFacetMeshGenerator
// 
/// 
/// <P>An object implementing I3DShFacetMeshGenerator becomes a decorator object that 
/// encapsulates either a mesh or something which can build a mesh (like a Primitive).</P>
///
/// <P>The TFacetGrid uses a FacetMeshGenerator to handle mesh generation independently of the
/// object which actually builds the mesh</P>
///
struct I3DShFacetMeshGenerator : public IMCUnknown
{
	// ****************************************************************************
	//								GetBoundingBox
	// 
	/// Returns the bounding box of the object
	/// 
	/// \param bbox			The bounding box that is returned.
	/// \param rendering	Compute the bbox for rendering (ie. for the rendering facet mesh)
	/// 
	virtual void	 MCCOMAPI GetBoundingBox(TBBox3D& bbox, boolean rendering) = 0;

	// ****************************************************************************
	//								GetFacetMesh
	// 
	/// Returns a facet mesh according to a given LoD (level of detail)
	/// 
	/// \param lod   The level of details requested.
	/// 
	virtual FacetMesh*	MCCOMAPI GetFacetMesh(real lod) = 0;

	// ****************************************************************************
	//								GetRenderingFacetMesh
	// 
	/// Returns the facet mesh for the final rendering.
	/// 
	/// \return  A pointer to the mesh.
	/// 
	virtual FacetMesh* MCCOMAPI GetRenderingFacetMesh() = 0;

	// ****************************************************************************
	//								GetBestCachedFacetMesh
	// 
	/// Looks for an ready-to-use cached mesh
	/// 
	/// \param amesh  The facet mesh that is returned.
	/// \param lod    The level of detail (LoD) of the mesh that is returned.
	/// 
	virtual void	 MCCOMAPI GetBestCachedFacetMesh(FacetMesh** amesh,real &lod) = 0;

};

/// \}

#endif
