home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Shape.h
-
- Contains: Definition of class XMPAbsShape
-
- Written by: Joshua Susser & Sepp Friedrich & Jens Alfke
-
- Copyright: ⌐ 1992-1994 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <14> 2/17/94 JA Declare XMPPolygon as struct, not class.
- <13> 2/16/94 JA Stop including Point.h.
- <12> 2/3/94 JA Tiger Team Makeover!
- <11> 2/1/94 JA Added InitShape, removed comments.
- <10> 1/31/94 JA Added GeometryMode stuff. Changed XMPShape*
- return types.
- <9> 11/23/93 JA New Shape API (big changes!)
- <8> 10/14/93 JA Updated some comments for clarity.
- <7> 10/14/93 JA Rewrote theory (copying now optional.)
- <6> 10/6/93 JA Include new "Point.h"
- <5> 9/16/93 JA Removed ExtractPlatformShape. Added IsEmpty
- and Read/WritePlatformShape. Removed
- constructor w/params (it could fail).
- <4> 7/6/93 JBS separate into abstract/concrete
- <3> 4/30/93 JBS 8.3 file names
- <2> 4/14/93 JBS clean up; add ExtractPlatformShape()
- <1> 4/14/93 JBS first checked in
- */
-
- #ifndef _SHAPE_
- #define _SHAPE_
-
- #ifndef _XMPTYPES_
- #include "XMPTypes.h"
- #endif
-
- #ifndef _XMPOBJ_
- #include "XMPObj.h" // base class
- #endif
-
- //==============================================================================
- // Classes used in this interface
- //==============================================================================
-
- class XMPTransform;
- class XMPShape;
- struct XMPRect;
- struct XMPPolygon;
- class XMPStorageUnit;
-
- //==============================================================================
- // Classes defined in this interface
- //==============================================================================
-
- class XMPAbsShape;
-
- //==============================================================================
- // Enumeration defined in this interface
- //==============================================================================
-
- enum {
- kXMPLoseGeometry, // Toss out geometric info to save time or space.
- kXMPPreserveGeometry, // Preserve geometric info as long as possible
- kXMPNeedsGeometry // Must keep geometric info.
- };
- typedef short XMPGeometryMode;
-
- //==============================================================================
- // XMPShape
- //==============================================================================
-
- class XMPAbsShape : public XMPObject
- {
-
- public:
-
- //---------------------------------
- // overrides
-
- // XMPVMethod XMPSize Purge(XMPSize size); // override from XMPObject
-
- //---------------------------------
- // constructor/destructor
-
- XMPAbsShape( ) { }
-
- XMPVMethod ~XMPAbsShape() { }
-
- XMPVMethod void InitShape( )
- = 0;
-
- //---------------------------------
- // getters/setters
-
- XMPMethod void SetGeometryMode( XMPGeometryMode mode )
- = 0;
- XMPMethod XMPGeometryMode GetGeometryMode( )
- = 0;
- XMPMethod void GetBoundingBox( XMPRect *bounds )
- = 0;
- XMPMethod XMPShape* SetRectangle( XMPRect *rect )
- = 0;
- XMPMethod XMPPolygon* CopyPolygon( )
- = 0;
- XMPMethod XMPShape* SetPolygon( XMPPolygon* )
- = 0;
- XMPMethod XMPPlatformShape GetPlatformShape( XMPGraphicsSystem )
- = 0;
- XMPMethod void SetPlatformShape( XMPGraphicsSystem, XMPPlatformShape )
- = 0;
-
- //---------------------------------
- // input / output:
-
- XMPMethod void WriteShape( XMPStorageUnit* )
- = 0;
- XMPMethod XMPShape* ReadShape( XMPStorageUnit* )
- = 0;
-
- //---------------------------------
- // comparison/testing functions
-
- XMPMethod XMPBoolean IsSameAs(XMPShape* compareShape)
- = 0;
- XMPMethod XMPBoolean IsEmpty( )
- = 0;
- XMPMethod XMPBoolean ContainsPoint(XMPPoint point)
- = 0;
- XMPMethod XMPBoolean IsRectangular( )
- = 0;
- XMPMethod XMPBoolean HasGeometry( )
- = 0;
-
- //---------------------------------
- // geometry operations
-
- XMPMethod XMPShape* Copy( )
- = 0;
- XMPMethod void CopyFrom(XMPShape* sourceShape)
- = 0;
- XMPMethod XMPShape* Transform(XMPTransform* transform)
- = 0;
- XMPMethod XMPShape* InverseTransform(XMPTransform* transform)
- = 0;
- XMPMethod XMPShape* Subtract(XMPShape* diffShape)
- = 0;
- XMPMethod XMPShape* Intersect(XMPShape* sectShape)
- = 0;
- XMPMethod XMPShape* Union(XMPShape* unionShape)
- = 0;
- };
-
- #if PLATFORM_MACINTOSH
- #ifndef _SHAPEM_
- #include "ShapeM.h"
- #endif
- #endif
-
- #endif // _SHAPE_
-