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

		ModelerActions.h

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

		Author:	Jerome Bignon
		Date:	05/26/99

		Revision History

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

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

#ifndef __ModelerACTIONS__
#define __ModelerACTIONS__  

#if CP_PRAGMA_ONCE
#pragma once
#endif

#include "BasicMCFCOMImplementations.h"
#include "TreePrim.h"
#include "Modeler.h"
#include "ModelerView.h"

struct IShAction;

class ModelerAction : public TBasicAction
{

	protected:

		ModelerAction(TreeData* treedata, Modeler* modeler);

	public:

		static void Create(	IShAction**, TreeData* treedata, Modeler* modeler);
		STANDARD_RELEASE;

		virtual MCCOMErr MCCOMAPI Do();
		virtual MCCOMErr MCCOMAPI Undo();
		virtual MCCOMErr MCCOMAPI Redo();
		virtual boolean  MCCOMAPI WillCauseChange();
		virtual boolean  MCCOMAPI CanUndo();
		virtual MCCOMErr MCCOMAPI GetName(TMCString& name);
		virtual void	 MCCOMAPI GetPartToRedraw(IMFPart** outPart, int32 stage);

	protected:
		TMCCountedPtr<TreeData>		fOldTreeData;
		TMCCountedPtr<TreeData>		fNewTreeData;
		Modeler*		fModeler;
};

class ModelerMouseAction : public TBasicMouseAction
{
	protected:		

		ModelerMouseAction(TreeData* treedata ,Modeler* modeler );

	public:

		static void Create(	IShMouseAction** outAction, TreeData* treedata, Modeler* modeler);
		STANDARD_RELEASE;
				
		virtual MCCOMErr MCCOMAPI Do();
		virtual MCCOMErr MCCOMAPI Undo();
		virtual MCCOMErr MCCOMAPI Redo();
		virtual boolean  MCCOMAPI WillCauseChange();

		virtual boolean  MCCOMAPI CanUndo();
		virtual void	 MCCOMAPI GetPartToRedraw(IMFPart** outPart, int32 stage);

		virtual void		MCCOMAPI Track(IMCGraphicContext* gc, int16 stage, TMCPoint& first, TMCPoint &prev, TMCPoint &cur,boolean moved, IShMouseAction**	nextAction);
		virtual MCCOMErr	MCCOMAPI Feedback(IMCGraphicContext* gc, int16 stage,const TMCPoint& first,const TMCPoint &prev,const TMCPoint &cur,boolean moved,boolean show);
		virtual MCCOMErr	MCCOMAPI Constrain(IMCGraphicContext* gc, int16 stage,const TMCPoint& first,const TMCPoint &prev,TMCPoint &cur,boolean moved); 
		virtual	Modeler*	MCCOMAPI GetModelerNoAddRef(){ return fModeler;};

	protected:
		TMCCountedPtr<TreeData>		fOldTreeData;
		TMCCountedPtr<TreeData>		fNewTreeData;
		Modeler*		fModeler;
		
		int16			fActionNumber;
		int16			fNumView;		
		real			fZoom;
		real			fSignAngle;
		TMCPoint		fContactPoint;
		TMCPoint		fCurrentPoint; 
		boolean			fDataChanged;
		
};


#endif