home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / FWPoly.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  2.8 KB  |  101 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWPoly.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWPOLY_H
  11. #define FWPOLY_H
  12.  
  13. #ifndef FWFXMATH_H
  14. #include "FWFxMath.h"
  15. #endif
  16.  
  17. #ifndef SLPOLY_H
  18. #include "SLPoly.h"
  19. #endif
  20.  
  21. #ifndef FWGRREF_H
  22. #include "FWGrRef.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Class Declarations
  27. //========================================================================================
  28.  
  29. class FW_CReadableStream;
  30. class FW_CWritableStream;
  31.  
  32. //========================================================================================
  33. //    class FW_CPolygon
  34. //========================================================================================
  35.  
  36. class FW_CPolygon : public FW_TGrRefPtr<FW_HPolygon>
  37. {
  38. public:
  39.     FW_DECLARE_AUTO(FW_CPolygon)
  40.  
  41.                         FW_CPolygon();
  42.                         FW_CPolygon(long count, const FW_SPoint* points);
  43.                         FW_CPolygon(FW_CReadableStream& stream);
  44.                         
  45.     FW_CPolygon            Copy() const;
  46.  
  47.                         ~FW_CPolygon();
  48.  
  49.                         FW_CPolygon(const FW_CPolygon& other);
  50.     FW_CPolygon&        operator=(const FW_CPolygon& other);
  51.  
  52.     friend FW_CWritableStream& operator << (FW_CWritableStream& stream, const FW_CPolygon& poly);
  53.     friend FW_CReadableStream& operator >> (FW_CReadableStream& stream, FW_CPolygon& poly);
  54.  
  55.     // Delegation
  56.     
  57.     void Transform(Environment *ev, ODTransform* transform)
  58.         { FW_PrivPolygon_Transform(fRep, ev, transform); FW_FailOnEvError(ev); }
  59.         
  60.     void InverseTransform(Environment *ev, ODTransform* transform)
  61.         { FW_PrivPolygon_InverseTransform(fRep, ev, transform); FW_FailOnEvError(ev); }
  62.         
  63.     void Move(FW_Fixed deltaX, FW_Fixed deltaY)
  64.         { FW_PrivPolygon_Move(fRep, deltaX, deltaY); }
  65.         
  66.     void MoveTo(FW_Fixed x, FW_Fixed y)
  67.         { FW_PrivPolygon_MoveTo(fRep, x, y); }
  68.         
  69.     void Inset(FW_Fixed x, FW_Fixed y)
  70.         { FW_PrivPolygon_Inset(fRep, x, y); }
  71.         
  72.     void GetBounds(FW_SRect& rect) const
  73.         { FW_PrivPolygon_GetBounds(fRep, rect); }
  74.         
  75.     void SetPoints(
  76.             const FW_SPoint*     points,
  77.             long                 startIndex,
  78.             long                 pointCount)
  79.         {FW_FailOnError(FW_PrivPolygon_SetPoints(fRep, points, startIndex, pointCount)); }
  80.  
  81.     void GetPoints(
  82.             FW_SPoint*             points,
  83.             long                 startIndex,
  84.             long                 pointCount) const
  85.         { FW_FailOnError(FW_PrivPolygon_GetPoints(fRep, points, startIndex, pointCount)); }
  86.  
  87.     long GetCount() const
  88.         { return FW_PrivPolygon_GetCount(fRep); }
  89.         
  90.     const FW_SPoint* GetPoints() const
  91.         { return FW_PrivPolygon_GetPointArray(fRep); }
  92.  
  93.     FW_SPoint* GetPoints()
  94.         { return FW_PrivPolygon_GetPointArray(fRep); }
  95.  
  96.     FW_Boolean    IsEqual(const FW_CPolygon& other) const
  97.         { return FW_PrivPolygon_IsEqual(fRep, other.fRep); }
  98. };
  99.  
  100. #endif
  101.