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

		I3DViewModule.h

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

		Author:	Brice
		Date:	11/8/99
		

		Revision History

		when		who			what & why
		==========	==========	======================================================

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

#ifndef __I3DVIEWMODULE__
#define __I3DVIEWMODULE__

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "MCCompObj.h"
#include "APITypes.h"
#include "InterfaceIDs.h"
#include "I3DShRenderable.h"


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

MCDEFINE_GUID(IID_I3DViewModule,			0xd5e5cbe1, 0x95e6, 0x11d3, 0xb9, 0x9b, 0x0, 0xa0, 0xc9, 0xd6, 0x65, 0x53);
MCDEFINE_GUID(IID_I3DExSub3DViewModule,		0x6e3b0c9e, 0xb801, 0x463a, 0xac, 0xaa, 0xd8, 0xff, 0x50, 0xae, 0xcd, 0xe3);
MCDEFINE_GUID(IID_I3DEx3DViewModelingTool,	0x169a00cb, 0x44a9, 0x4a33, 0x9b, 0x1f, 0xe7, 0x7d, 0x3e, 0x4a, 0x9f, 0xd8);

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

struct I3DEditorHostPart;
struct IEx3DEditorHostPanePart;
struct IEx3DEditorHostPanePart2;
struct IMFPart;
struct TToolBarInfo;
struct TPropertyTab;
struct IMFDropArea;

/// \addtogroup ShellInterface
/// \{


/// This is the interface of the 3D view module.
///
struct I3DViewModule: public IMCUnknown
{
	// 
	// ****************************************************************************
	//								Get3DEditorHostPart
	// 
	/// Call this to get the 3DEditorHostPart of the 3DView Module.
	/// 
	/// \param out3DEditorHostPart  
	/// 
	virtual void MCCOMAPI Get3DEditorHostPart(I3DEditorHostPart** out3DEditorHostPart) = 0;

	// ****************************************************************************
	//								Set3DViewTopPart
	// 
	/// To call only if you do not want the module to create its own window
	/// must be called before Initialize
	//. inTopPart: part that contains the 3dview
	/// 
	/// \param inTopPart  
	/// 
	virtual void MCCOMAPI Set3DViewTopPart(IMFPart* inTopPart) = 0;

	// ****************************************************************************
	//								SetWorkingBoxFromPMap
	// 
	/// Updates the working box in all panes from the current contents
	/// of the Parameter map
	/// 
	virtual void	MCCOMAPI	SetWorkingBoxFromPMap() = 0;

	// ****************************************************************************
	//								InvalidateAllPanes
	// 
	/// Invalidates all panes.
	/// 
	virtual void	MCCOMAPI	InvalidateAllPanes() = 0;

	virtual void	MCCOMAPI	ActivateSubModule(I3DShModule* module) = 0;
	virtual void	MCCOMAPI	DeactivateSubModule() = 0;
	virtual void	MCCOMAPI	AddInstancesRenderables(IEx3DEditorHostPanePart* panePart, TRenderableAndTfmArray& renderables3D, I3DShInstance* editedInstance) = 0;
	virtual void	MCCOMAPI	GetPreferedSplit(int32& outPreferedSize, boolean& outForTopPart) = 0;
	virtual void	MCCOMAPI	StorePreferedSplit(int32 inPreferedSize) = 0;
	virtual void	MCCOMAPI	GetExtraTabs(TMCClassArray<TPropertyTab>& extraTabs) = 0;
	virtual void	MCCOMAPI	BeginImmediateUpdate() = 0;
	virtual void	MCCOMAPI	PostImmediateUpdate() = 0;
	virtual void	MCCOMAPI	EndImmediateUpdate() = 0;
	virtual void	MCCOMAPI	SetImmediateUpdateModeWhenMouseOverPaneParts(boolean enable) = 0;
	virtual boolean MCCOMAPI	IsImmediateUpdateMode() = 0;
	virtual void	MCCOMAPI	AddDefaultMenuBar(IMCMenuBar* theBar) = 0;
	virtual I3DShModule*	MCCOMAPI	ActivateSubModule(IDType moduleId) = 0;
	virtual void	MCCOMAPI	AddInstancesRenderables(IEx3DEditorHostPanePart* panePart, TRenderableAndTfmArray& renderables3D, I3DShTreeElement* editedTree = NULL) = 0;
	virtual I3DShModule*	MCCOMAPI	GetActiveSubModule() = 0;
};

/// \}


/// \addtogroup ExternalInterface
/// \{

struct I3DExSub3DViewModule : public IMCUnknown
{
	virtual void			MCCOMAPI AddRenderables(IEx3DEditorHostPanePart* panePart, TRenderableAndTfmArray& renderable3d, TRenderable2DArray& renderable2d) = 0;
	virtual void			MCCOMAPI GetSubToolBarsInfo(TMCArray<TToolBarInfo>& toolbarList) = 0;
	virtual void			MCCOMAPI AddSubTools(int32 toolbarIndex, IMFToolGroup* inToolGroup) = 0;
	virtual boolean			MCCOMAPI PanePartMouseMoved(IEx3DEditorHostPanePart* panePart, const TMCPoint& inWhere, const TMCModifiers& inModifiers) = 0;
	virtual void			MCCOMAPI PanePartMouseEntering(IEx3DEditorHostPanePart* panePart, const TMCPoint& inWhere, const TMCModifiers& inModifiers) = 0;
	virtual void			MCCOMAPI PanePartMouseStillInside(IEx3DEditorHostPanePart* panePart, const TMCPoint& inWhere, const TMCModifiers& inModifiers) = 0;
	virtual void			MCCOMAPI PanePartMouseLeaving(IEx3DEditorHostPanePart* panePart, const TMCModifiers& inModifiers) = 0;
	virtual TMFEventResult	MCCOMAPI PanePartMouseDown(IEx3DEditorHostPanePart* panePart, const TMCPoint& inWhere, const TMCPlatformEvent& inEvent) = 0;
	virtual boolean			MCCOMAPI GetLocationOfSelectionInGlobal(TVector3& outGlobalLocation) = 0;
	virtual boolean			MCCOMAPI CanBeActivated()=0;
	virtual MFCursorID		MCCOMAPI PanePartGetCursorID(IEx3DEditorHostPanePart* panePart, const TMCPoint& inWhere) = 0;
	virtual void			MCCOMAPI GetDropArea(	const TMCPoint& inWhere,IMFDropCandidate& inCandidate,
													IMFPart*	part,IEx3DEditorHostPanePart* panePart,
													IDType& outAcceptedFlavor,IMFDropArea** outDropArea,boolean& outDrawDropCandidate)=0;
	virtual boolean			MCCOMAPI KeyDownFromPane(IEx3DEditorHostPanePart* pane,const TMCPlatformEvent& inEvent)=0;
	virtual void			MCCOMAPI CameraMoved()=0;
	virtual boolean			MCCOMAPI IsModeler(IDType classID) = 0;
	virtual void			MCCOMAPI PanePartPreRender(IEx3DEditorHostPanePart* panePart) = 0;
};


/// Base interface for the modeling tools (3DPaint and vertex Modeler)
struct I3DEx3DViewModelingTool : public IMCUnknown
{
	virtual void				MCCOMAPI Activate() = 0;
	virtual void				MCCOMAPI Deactivate() = 0;
	virtual boolean				MCCOMAPI IsActive() = 0;
	virtual boolean				MCCOMAPI NeedImmediateUpdate() = 0;	// need immediate update when mouse over pane part
	virtual boolean				MCCOMAPI IsPressed() = 0;
	virtual boolean				MCCOMAPI GetPressedImageResId(int32& resID)=0;
	virtual int32				MCCOMAPI GetActionNumber()=0;
};

/// \}


#endif