home *** CD-ROM | disk | FTP | other *** search
/ The Developer Connection…ice Driver Kit for OS/2 3 / DEV3-D1.ISO / source / bento / headers / shape.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-02  |  4.3 KB  |  161 lines

  1. /*
  2.     File:        Shape.h
  3.  
  4.     Contains:    Definition of class XMPAbsShape
  5.  
  6.     Written by:    Joshua Susser & Sepp Friedrich & Jens Alfke
  7.  
  8.     Copyright:    ⌐ 1992-1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.         <14>     2/17/94    JA        Declare XMPPolygon as struct, not class.
  13.         <13>     2/16/94    JA        Stop including Point.h.
  14.         <12>      2/3/94    JA        Tiger Team Makeover!
  15.         <11>      2/1/94    JA        Added InitShape, removed comments.
  16.         <10>     1/31/94    JA        Added GeometryMode stuff. Changed XMPShape*
  17.                                     return types.
  18.          <9>    11/23/93    JA        New Shape API (big changes!)
  19.          <8>    10/14/93    JA        Updated some comments for clarity.
  20.          <7>    10/14/93    JA        Rewrote theory (copying now optional.)
  21.          <6>     10/6/93    JA        Include new "Point.h"
  22.          <5>     9/16/93    JA        Removed ExtractPlatformShape. Added IsEmpty
  23.                                     and Read/WritePlatformShape. Removed
  24.                                     constructor w/params (it could fail).
  25.          <4>      7/6/93    JBS        separate into abstract/concrete
  26.          <3>     4/30/93    JBS        8.3 file names
  27.          <2>     4/14/93    JBS        clean up; add ExtractPlatformShape()
  28.          <1>     4/14/93    JBS        first checked in
  29. */
  30.  
  31. #ifndef _SHAPE_
  32. #define _SHAPE_
  33.  
  34. #ifndef _XMPTYPES_
  35. #include "XMPTypes.h"
  36. #endif
  37.  
  38. #ifndef _XMPOBJ_
  39. #include "XMPObj.h"            // base class
  40. #endif
  41.  
  42. //==============================================================================
  43. // Classes used in this interface
  44. //==============================================================================
  45.  
  46. class XMPTransform;
  47. class XMPShape;
  48. struct XMPRect;
  49. struct XMPPolygon;
  50. class XMPStorageUnit;
  51.  
  52. //==============================================================================
  53. // Classes defined in this interface
  54. //==============================================================================
  55.  
  56. class XMPAbsShape;
  57.  
  58. //==============================================================================
  59. // Enumeration defined in this interface
  60. //==============================================================================
  61.  
  62. enum {
  63.     kXMPLoseGeometry,            // Toss out geometric info to save time or space.
  64.     kXMPPreserveGeometry,        // Preserve geometric info as long as possible
  65.     kXMPNeedsGeometry            // Must keep geometric info.
  66. };
  67. typedef short XMPGeometryMode;
  68.  
  69. //==============================================================================
  70. // XMPShape
  71. //==============================================================================
  72.  
  73. class XMPAbsShape : public XMPObject
  74. {
  75.  
  76. public:
  77.  
  78.     //---------------------------------
  79.     // overrides
  80.  
  81. //    XMPVMethod XMPSize Purge(XMPSize size);        // override from XMPObject
  82.  
  83.     //---------------------------------
  84.     // constructor/destructor
  85.  
  86.     XMPAbsShape( )                { }
  87.     
  88.     XMPVMethod ~XMPAbsShape()    { }
  89.     
  90.     XMPVMethod void InitShape( )
  91.         = 0;
  92.  
  93.     //---------------------------------
  94.     // getters/setters
  95.     
  96.     XMPMethod void SetGeometryMode( XMPGeometryMode mode )
  97.         = 0;
  98.     XMPMethod XMPGeometryMode GetGeometryMode( )
  99.         = 0;
  100.     XMPMethod void GetBoundingBox( XMPRect *bounds )
  101.         = 0;
  102.     XMPMethod XMPShape* SetRectangle( XMPRect *rect )
  103.         = 0;
  104.     XMPMethod XMPPolygon* CopyPolygon( )
  105.         = 0;
  106.     XMPMethod XMPShape* SetPolygon( XMPPolygon* )
  107.         = 0;
  108.     XMPMethod XMPPlatformShape GetPlatformShape( XMPGraphicsSystem )
  109.         = 0;
  110.     XMPMethod void SetPlatformShape( XMPGraphicsSystem, XMPPlatformShape )
  111.         = 0;
  112.  
  113.     //---------------------------------
  114.     // input / output:
  115.     
  116.     XMPMethod void WriteShape( XMPStorageUnit* )
  117.         = 0;
  118.     XMPMethod XMPShape* ReadShape( XMPStorageUnit* )
  119.         = 0;
  120.  
  121.     //---------------------------------
  122.     // comparison/testing functions
  123.  
  124.     XMPMethod XMPBoolean IsSameAs(XMPShape* compareShape)
  125.         = 0;
  126.     XMPMethod XMPBoolean IsEmpty( )
  127.         = 0;
  128.     XMPMethod XMPBoolean ContainsPoint(XMPPoint point)
  129.         = 0;
  130.     XMPMethod XMPBoolean IsRectangular( )
  131.         = 0;
  132.     XMPMethod XMPBoolean HasGeometry( )
  133.         = 0;
  134.  
  135.     //---------------------------------
  136.     // geometry operations
  137.     
  138.     XMPMethod XMPShape* Copy( )
  139.         = 0;
  140.     XMPMethod void CopyFrom(XMPShape* sourceShape)
  141.         = 0;
  142.     XMPMethod XMPShape* Transform(XMPTransform* transform)
  143.         = 0;
  144.     XMPMethod XMPShape* InverseTransform(XMPTransform* transform)
  145.         = 0;
  146.     XMPMethod XMPShape* Subtract(XMPShape* diffShape)
  147.         = 0;
  148.     XMPMethod XMPShape* Intersect(XMPShape* sectShape)
  149.         = 0;
  150.     XMPMethod XMPShape* Union(XMPShape* unionShape)
  151.         = 0;
  152. };
  153.  
  154. #if PLATFORM_MACINTOSH
  155. #ifndef _SHAPEM_
  156. #include "ShapeM.h"
  157. #endif
  158. #endif
  159.  
  160. #endif // _SHAPE_
  161.