home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.4 KB | 156 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPoly.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPOLY_H
- #define FWPOLY_H
-
- #ifndef FWGROBJ_H
- #include "FWGrObj.h"
- #endif
-
- #ifndef FWFXMATH_H
- #include "FWFxMath.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPoint;
- class FW_CLASS_ATTR FW_CRect;
- class FW_CLASS_ATTR FW_CPolygonRep;
-
- class FW_CLASS_ATTR ODTransform;
-
- //========================================================================================
- // class FW_PPolygon
- //========================================================================================
-
- class FW_CLASS_ATTR FW_PPolygon : public FW_CGraphicCountedPtr
- {
- public:
- FW_DECLARE_CLASS
-
- public:
- FW_PPolygon();
- FW_PPolygon(FW_CReadableStream& archive);
- FW_PPolygon(unsigned long count, const FW_CPoint* points);
- virtual ~ FW_PPolygon();
-
- FW_PPolygon(const FW_PPolygon& other);
- FW_PPolygon& operator=(const FW_PPolygon& other);
-
- FW_CPolygonRep* operator->();
- const FW_CPolygonRep* operator->() const;
- };
-
- //========================================================================================
- // class FW_CPolygonRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CPolygonRep : public FW_CGraphicCountedPtrRep
- {
- friend class FW_CLASS_ATTR FW_PPolygon;
-
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- protected:
- FW_CPolygonRep(unsigned long count, const FW_CPoint* points);
- FW_CPolygonRep(FW_CReadableStream& archive);
-
- virtual ~FW_CPolygonRep();
-
- //----------------------------------------------------------------------------------------
- // Operations
- //
- public:
- void Transform(Environment *ev, ODTransform* transform);
- void InverseTransform(Environment *ev, ODTransform* transform);
-
- void Move(FW_CFixed deltaX, FW_CFixed deltaY);
- void MoveTo(FW_CFixed x, FW_CFixed y);
-
- void Inset(FW_CFixed x, FW_CFixed y);
-
- void GetBounds(FW_CRect& rect) const;
-
- void SetPoints(const FW_CPoint* points,
- unsigned long startIndex,
- unsigned long pointCount);
-
- void GetPoints(FW_CPoint* points,
- unsigned long startIndex,
- unsigned long pointCount) const;
-
- //----------------------------------------------------------------------------------------
- // Attributes
- //
- public:
- unsigned long GetCount() const;
- const FW_CPoint* GetPoints() const;
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void Flatten(FW_CWritableStream& archive) const;
- virtual FW_Boolean IsEqual(const FW_CGraphicCountedPtrRep* other) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Copying -----
- FW_PPolygon Copy() const;
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- unsigned long fCount;
- FW_CPoint* fPoints;
- };
-
- //========================================================================================
- // Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // FW_PPolygon::operator->
- //----------------------------------------------------------------------------------------
- inline FW_CPolygonRep* FW_PPolygon::operator->()
- {
- return (FW_CPolygonRep*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PPolygon::operator->
- //----------------------------------------------------------------------------------------
- inline const FW_CPolygonRep* FW_PPolygon::operator->() const
- {
- return (const FW_CPolygonRep*)GetRep();
- }
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-