#ifdef __PRIVATE__
//#
//#	File:		TrnsfrmB.idl
//#
//#	Contains:	ODBaseTransform, a coordinate transformation.
//#
//#	Written by:	Jens Alfke
//#
//#	Copyright:	c 1993-94 by Apple Computer, Inc., all rights reserved.
//#
//#	Change History (most recent first):
//#
//#		 <6>	  9/9/94	jpa		Descend from ODRefCntObject. [1185660]
//#		 <5>	 8/17/94	jpa		Added "functionprefix" directive. [1181512]
//#		 <4>	  8/8/94	jpa		Added NewTransform [1179574]
//#		 <3>	 6/30/94	jpa		Added BuildInverse method.
//#		 <2>	  6/8/94	jpa		Privatized change history.
//#		 <1>	  6/8/94	jpa		first checked in
//#		 <2>	 5/26/94	jpa		Tweaked IDL.
//#
//#	To Do:
//#
#else
//#	Copyright:	c 1993-1994 by Apple Computer, Inc., all rights reserved.
#endif

#ifndef _TRNSFRMB_
#define _TRNSFRMB_

#ifndef _REFCTOBJ_
#include "RefCtObj.idl"  
#endif

//==============================================================================
// Classes defined in this interface
//==============================================================================

interface  ODBaseTransform;

//==============================================================================
// Classes used by this interface
//==============================================================================

interface ODTransform;
interface ODShape;
interface ODStorageUnit;

//==============================================================================
// ODTransform
//==============================================================================

interface ODBaseTransform :  ODRefCntObject
{
  //#---------------------------------
  //# factories:

	ODTransform		NewTransform();
    ODTransform		Copy();

  //#---------------------------------
  //# getters:

    ODTransformType	GetType();
    void			GetOffset(out ODPoint offset);
    void			GetPreScaleOffset(out ODPoint offset);
    void			GetScale(out ODPoint scale);
    void			GetMatrix(out ODMatrix matrix);
    ODBoolean		HasMatrix();

    ODBoolean		IsSameAs(in ODTransform compareTransform);

  //#---------------------------------
  //# setters:

    ODTransform		Reset();
    ODTransform		SetMatrix(in ODMatrix matrix);
    ODTransform		CopyFrom(in ODTransform sourceTransform);
  
  //#---------------------------------
  //# geometric operations:
  
    ODTransform		SetOffset(in ODPoint point);
    ODTransform		MoveBy(in ODPoint point);
    ODTransform		ScaleBy( in ODPoint scale);
    ODTransform		ScaleDownBy( in ODPoint scale);

    ODTransform		Invert( );
    ODTransform		PreCompose(in ODTransform transform);
    ODTransform		PostCompose(in ODTransform transform);

  //#---------------------------------
  //# geometry operations with points & shapes:

    ODPoint			TransformPoint(in ODPoint point);
    ODPoint			InvertPoint(in ODPoint point);
  
    void			TransformShape(in ODShape shape);
    void			InvertShape(in ODShape shape);
  
  //#---------------------------------
  //# input / output:
  
    void			WriteTo(in ODStorageUnit storageUnit);
    void			ReadFrom(in ODStorageUnit storageUnit);

#ifdef __PRIVATE__

	void			InitBaseTransform( );
	void			BuildInverse( );
	void			ClearInverse( );
	
#endif

#ifdef __SOMIDL__
	implementation
	{
		override:
			somInit,
			somUninit,
			Purge,
			Release;
			
		releaseorder:
			GetType,
			GetOffset,
			GetPreScaleOffset,
			GetScale,
			GetMatrix,
			HasMatrix,
			IsSameAs,
			Reset,
			SetMatrix,
			Copy,
			CopyFrom,
			SetOffset,
			MoveBy,
			ScaleBy,
			ScaleDownBy,
			Invert,
			PreCompose,
			PostCompose,
			TransformPoint,
			InvertPoint,
			TransformShape,
			InvertShape,
			WriteTo,
			ReadFrom,
			NewTransform,
		#ifdef __PRIVATE__
			InitBaseTransform,
			BuildInverse,
			ClearInverse;
		#else
			reserved1,
			reserved2,
			reserved3;
		#endif

		majorversion = 1; minorversion = 0;
				
		functionprefix = ODBaseTransform;
		
    #ifdef __PRIVATE__
		ODTransformType	fType;
      	ODMatrix		fMatrix;
      	ODMatrix*		fInverseMatrix;
    #endif
  };
#endif
};

#endif //# _TRNSFRMB_

