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

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

		Author:	Arnaud
		Date:	10/14/2002

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

#ifndef __IPostRendererPreviewPart__
#define __IPostRendererPreviewPart__

#if CP_PRAGMA_ONCE
#pragma once
#endif


#include "APITypes.h"
#include "MCCompObj.h"

struct IMFPart;
struct IShChannel;
struct IShRasterLayer;
struct I3DShPostRenderer;

MCDEFINE_GUID(IID_IPostRendererPreviewPart, 0x20c1e6bf, 0xbbbb, 0x422a, 0x86, 0xd3, 0xaf, 0x2f, 0xe4, 0xa, 0xe7, 0xe0);

/// \addtogroup ShellInterface
/// \{

/// Interface to access the "zoomable" postrenderer preview
/// \see IMFPreviewPart
struct IPostRendererPreviewPart: public IMCUnknown
{
	// -Description:
	//		IPostRendererPreviewPart is always an IMFPart
	virtual IMFPart*			MCCOMAPI GetThisPart() = 0;

	// ****************************************************************************
	//								GetGBuffer
	// 
	/// Returns one of the g buffers of the post render preview
	/// 
	/// \param inBufferID  ID of the gbuffer you need (as defined in I3DExPostRenderer.h, eg k32Distance)
	/// \return A pointer to the buffer, or NULL if not found or not calculated.
	/// 
	virtual IShChannel*			MCCOMAPI GetGBuffer(const uint32 inBufferID) = 0;


	// -Description:
	//		returns the output of the renderer
	// -Returns:
	//		the output of the renderer
	virtual IShRasterLayer*		MCCOMAPI GetRendererOutput() = 0;


	// -Description:
	//		returns the post renderer we are previewing	
	virtual I3DShPostRenderer*	MCCOMAPI GetPostRenderer() = 0;


	// ****************************************************************************
	// -Description:
	//		Converts a point in the local coordinates of the part 
	//		into the coordinates of the (current)rendered image/buffers
	// -Parameters:
	//		ioPoint: point to convert
	virtual void				MCCOMAPI LocalPosToImagePos(TMCPoint& ioPoint) const = 0;


	// ****************************************************************************
	// -Description:
	//		Converts a point in the coordinates of the (current) rendered image/buffers 
	//		into the local coordinates of the part 
	// -Parameters:
	//		ioPoint: point to convert
	virtual void				MCCOMAPI ImagePosToLocalPos(TMCPoint& ioPoint) const = 0;

	// ****************************************************************************
	//								ImagePosToInitialImageRelativeUVPos
	// 
	/// Converts a point in the coordinates of the (current) rendered image/buffers
	/// into its relative position in the original (not zoomed/paned) image (relative to the original image size)
	/// 
	/// \param inCurImgPos  Coordinates of the current rendered image
	/// \param outUVRelPos  Output position relative to original image size.
	/// \return true if the conversion could be performed, false otherwise.
	///
	virtual boolean				MCCOMAPI ImagePosToInitialImageRelativeUVPos(const TMCPoint& inCurImgPos, TVector2& outUVRelPos) const = 0;

	// ****************************************************************************
	//								InitialImageRelativeUVPosToImagePos
	// 
	/// Converts the relative position of a point in the original (not zoomed/paned) image (relative to the original image size)
	/// into the coordinates of the (current) rendered image/buffers
	/// 
	/// \param inUVRelPos    Input position relative to original image size.
	/// \param outCurImgPos  Output coordinates
	/// 
	virtual boolean				MCCOMAPI InitialImageRelativeUVPosToImagePos(const TVector2& inUVRelPos, TMCPoint& outCurImgPos) const = 0;

};

/// \}

#endif