home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.7 KB | 134 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWPolySh.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWPOLYSH_H
- #define FWPOLYSH_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWPOLY_H
- #include "FWPoly.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CPolygonShape
- //========================================================================================
-
- class FW_CPolygonShape : public FW_CShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CPolygonShape)
-
- //---------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CPolygonShape(const FW_CPolygon& polygon,
- FW_ERenderVerbs renderVerb,
- FW_Boolean autoCloseFrame,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- FW_CPolygonShape(const FW_CPolygonShape& other);
- FW_CPolygonShape(FW_CReadableStream& stream);
-
- virtual ~FW_CPolygonShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CPolygonShape& operator=(const FW_CPolygonShape& other);
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- void SetAutoCloseFrame(FW_Boolean autoCloseFrame);
- FW_Boolean GetAutoCloseFrame() const;
-
- //---------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- // ----- Rendering -----
- virtual void Render(FW_CGraphicContext& gc) const;
-
- // ----- Hit Testing -----
- virtual FW_Boolean HitTest(FW_CGraphicContext& gc,
- const FW_CPoint& test,
- FW_Fixed tolerance) const;
-
- // ----- Copying -----
- virtual FW_CShape* Copy() const;
-
- // ----- Transform -----
- virtual void Transform(Environment *ev, ODTransform* transform);
- virtual void InverseTransform(Environment *ev, ODTransform* transform);
-
- virtual void MoveShape(FW_Fixed deltaX, FW_Fixed deltaY);
- virtual void MoveShapeTo(FW_Fixed x, FW_Fixed y);
-
- virtual void Inset(FW_Fixed x, FW_Fixed y);
-
- // ----- Geometry -----
- virtual void GetBounds(FW_CGraphicContext& gc, FW_CRect& rect) const;
-
- // ----- Anchor Point -----
- virtual FW_CPoint GetAnchorPoint() const;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& stream) const;
-
- //---------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderPolygon(FW_CGraphicContext& gc,
- const FW_CPolygon& polygon,
- FW_ERenderVerbs renderVerb,
- FW_Boolean autoCloseFrame,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- // ----- Geometry -----
- void GetGeometry(FW_CPolygon& polygon) const;
- void SetGeometry(const FW_CPolygon& polygon);
-
- //---------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CPolygon fPolygon;
- FW_Boolean fAutoCloseFrame;
- };
-
- #endif // FWPOLYSH_H
-