home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 3.3 KB | 117 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWArcShp.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWARCSHP_H
- #define FWARCSHP_H
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include <FWStdDef.h>
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CGraphicContext;
-
- //========================================================================================
- // class FW_CArcShape
- //========================================================================================
-
- class FW_CArcShape : public FW_CBoundedShape
- {
- public:
- FW_DECLARE_CLASS
- FW_DECLARE_AUTO(FW_CArcShape)
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CArcShape(const FW_CRect& rect,
- short startAngle, short arcAngle,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- FW_CArcShape(const FW_CArcShape& other);
- FW_CArcShape(FW_CReadableStream& stream);
-
- virtual ~ FW_CArcShape();
-
- //----------------------------------------------------------------------------------------
- // Operators
- //
- public:
- FW_CArcShape& operator=(const FW_CArcShape& other);
-
- //----------------------------------------------------------------------------------------
- // 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;
-
- // ----- Flatten -----
- virtual void Flatten(FW_CWritableStream& stream) const;
- static void* Read(FW_CReadableStream& stream, FW_ClassTypeConstant type);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Rendering -----
- static void RenderArc(FW_CGraphicContext& gc,
- const FW_CRect& rect,
- short startAngle, short arcAngle,
- FW_ERenderVerbs renderVerb,
- const FW_CInk& ink = FW_kNormalInk,
- const FW_CStyle& style = FW_kNormalStyle);
-
- // ----- Geometry -----
- void GetGeometry(FW_CRect& rect, short& startAngle, short& arcAngle) const;
- void SetGeometry(const FW_CRect& rect, short startAngle, short arcAngle);
-
- short GetStartAngle() const
- {return fStartAngle;}
- void SetStartAngle(short angle)
- {fStartAngle = angle;}
-
- short GetArcAngle() const
- {return fArcAngle;}
- void SetArcAngle(short angle)
- {fArcAngle = angle;}
-
- private:
- short CalcAngle(const FW_CPoint& test) const;
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- short fStartAngle;
- short fArcAngle;
- };
-
- #endif
-