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

		Modeler.h

		Copyright (c)1990 - 1999 MetaCreations. All rights reserved.

		Author:	Jerome Bignon
		Date:	05/18/99

		Revision History

		when		who			what & why
		==========	==========	======================================================
		05/18/99	Jerome		Creation

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

#ifndef __Modeler__
#define __Modeler__  

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "ModelerDef.h"
#include "TreePrim.h"
#include "ModelerView.h"

#include "BasicModule.h"
#include "I3DShGroup.h"
#include "I3DShObject.h"
#include "ISceneDocument.h"
#include "IMFPart.h"
#include "IMFWindow.h"
#include "IMFDocument.h"
#include "ISceneSelection.h"
#include "IMFParameterPart.h"
#include "BasicMCFCOMImplementations.h"
#include "IShComponent.h"
#include "IComponentAnim.h"

// Define the Modeler CLSID ( see the ModelerDef.h file to get R_CLSID_Modeler value )
extern const MCGUID CLSID_Modeler;


struct IModelerView;

class Modeler : public TBasicModule
{
	public :  

		Modeler();

		STANDARD_RELEASE;

		// IMCUnknown methods
		virtual MCCOMErr	MCCOMAPI QueryInterface		(const MCIID& riid, void** ppvObj);
 		virtual uint32		MCCOMAPI AddRef				();

		virtual int32		MCCOMAPI GetParamsBufferSize		() const	{ return 0;}

		virtual MCCOMErr 	MCCOMAPI Initialize			(IMCUnknown* inElement);
		virtual MCCOMErr 	MCCOMAPI Destroy			();
		virtual MCCOMErr 	MCCOMAPI Hydrate			();
		virtual MCCOMErr 	MCCOMAPI Dehydrate			();

		virtual MCCOMErr	MCCOMAPI Activate			();
		virtual MCCOMErr	MCCOMAPI Deactivate			();

		virtual MCCOMErr	MCCOMAPI AboutToCloseMainWindow	();
		virtual int32		MCCOMAPI GetPrefsBufferSize		() const { return 0; }

		I3DExGeometricPrimitive*	MCCOMAPI GetI3DExExPrimNoAddRef()	{return fExPrimitive;};
		ITreePrim*					MCCOMAPI GetTreePrimNoAddRef()		{return fCOMTreePrim;};
		virtual void MCCOMAPI GetToolBarsInfo(TMCArray<TToolBarInfo>& toolbarList){}
	protected :
		
		TMCCountedPtr<I3DShModule>					fModule;
		TMCCountedPtr<IMFDocument>					fDoc;
		TMCCountedPtr<ISceneDocument>				fSceneDoc;
		TMCCountedPtr<I3DShScene>					fScene;
		TMCCountedPtr<I3DShGroup>					fUniverse;
		TMCCountedPtr<IMFPart>						fWindow;
		TMCCountedPtr<IMFPart>						fMainPart;
		TMCCountedPtr<I3DShModule>					fHierarchyModule;

		//-- Dependencies data
		TMCCountedPtr<IChangeChannel>				fTimeChangeChannel;

		//-- Primitive Data
		TMCCountedPtr<I3DShPrimitive>				fShPrimitive;
		TMCCountedPtr<I3DExGeometricPrimitive>		fExPrimitive;
		TMCCountedPtr<ITreePrim>					fCOMTreePrim;
		TMCCountedPtr<IModelerView>					fModelerPart;

		virtual MCCOMErr	MCCOMAPI Initialize1			(I3DShGroup* universe);
		virtual MCCOMErr	MCCOMAPI Initialize2			(I3DShPrimitive* primitive);
		virtual void		MCCOMAPI CreateWindows			();
		virtual void		MCCOMAPI DestroyWindows			();

		void GetActionResponder(IMFResponder** responder);
};

#endif