home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / include / igarc.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-22  |  4.5 KB  |  144 lines

  1. #ifndef _IGARC_
  2. #define _IGARC_
  3. /*******************************************************************************
  4. * FILE NAME: igarc.hpp                                                         *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IGArc                                                                    *
  9. *     IG3PointArc                                                              *
  10. *                                                                              *
  11. * COPYRIGHT:                                                                   *
  12. *   IBM Open Class Library                                                     *
  13. *   (C) Copyright International Business Machines Corporation 1992, 1996       *
  14. *   Licensed Material - Program-Property of IBM - All Rights Reserved.         *
  15. *   US Government Users Restricted Rights - Use, duplication, or disclosure    *
  16. *   restricted by GSA ADP Schedule Contract with IBM Corp.                     *
  17. *                                                                              *
  18. *******************************************************************************/
  19.  
  20. #include <igraphic.hpp>
  21. #include <ipoint.hpp>
  22. #include <irect.hpp>
  23.  
  24.  
  25. class IGraphicContext;
  26.  
  27. #pragma pack(4)
  28.  
  29. class IGArc : public IGraphic {
  30. typedef IGraphic
  31.   Inherited;
  32. public:
  33. /*------------------------------- Constructors -------------------------------*/
  34.   IGArc     ( const IRectangle& rectangle,
  35.               double            startAngle,
  36.               double            sweepAngle );
  37.  
  38.   IGArc     ( const IGArc&      arc        );
  39.  
  40. IGArc&
  41.   operator= ( const IGArc&      arc        );
  42.  
  43. virtual
  44.   ~IGArc    ( );
  45.  
  46. /*-------------------------------- Drawing -----------------------------------*/
  47. virtual IGArc
  48.   &drawOn           ( IGraphicContext& graphicContext );
  49.  
  50. /*-------------------------- Enclosing Rectangle -----------------------------*/
  51. virtual IGArc
  52.   &setEnclosingRect     ( const IRectangle& rectangle );
  53.  
  54. virtual IRectangle
  55.   enclosingRect         ( ) const;
  56.  
  57. /*----------------------- Start and Sweep Angles -----------------------------*/
  58. virtual IGArc
  59.   &setStartAngle    ( double startAngle ),
  60.   &setSweepAngle    ( double sweepAngle );
  61.  
  62. virtual double
  63.   startAngle        ( ) const,
  64.   sweepAngle        ( ) const;
  65.  
  66. /*-------------------------------- Direction ---------------------------------*/
  67. enum Direction {
  68.   clockwise,
  69.   counterclockwise
  70.   };
  71.  
  72. virtual IGArc
  73.   &setDirection     ( Direction direction = counterclockwise );
  74.  
  75. virtual Direction
  76.   direction         ( ) const;
  77.  
  78. /*-------------------------------- Comparison --------------------------------*/
  79. IBase::Boolean
  80.   operator==        ( const IGArc& arc ) const,
  81.   operator!=        ( const IGArc& arc ) const;
  82.  
  83. private:
  84. /*-------------------------------- Private -----------------------------------*/
  85.  
  86. IRectangle
  87.   fRect;
  88. double
  89.   fStart,
  90.   fSweep;
  91. Direction
  92.   fAd;
  93. }; // IGArc
  94.  
  95. class IG3PointArc : public IGraphic {
  96. typedef IGraphic
  97.   Inherited;
  98. public:
  99. /*------------------------------- Constructors -------------------------------*/
  100.   IG3PointArc( const IPoint& starting,
  101.                const IPoint& intermediate,
  102.                const IPoint& ending        );
  103.  
  104.   IG3PointArc( const IG3PointArc& arc      );
  105.  
  106. IG3PointArc&
  107.   operator=  ( const IG3PointArc& arc      );
  108.  
  109. virtual
  110.   ~IG3PointArc( );
  111.  
  112. /*-------------------------------- Drawing -----------------------------------*/
  113. virtual IG3PointArc
  114.   &drawOn           ( IGraphicContext& graphicContext );
  115.  
  116. /*-------------------------------- Data Access -------------------------------*/
  117. virtual IG3PointArc
  118.   &setStartingPoint      ( const IPoint& point ),
  119.   &setIntermediatePoint  ( const IPoint& point ),
  120.   &setEndingPoint        ( const IPoint& point );
  121.  
  122. virtual IPoint
  123.   startingPoint          ( ) const,
  124.   intermediatePoint      ( ) const,
  125.   endingPoint            ( ) const;
  126.  
  127. /*-------------------------------- Comparison --------------------------------*/
  128. IBase::Boolean
  129.   operator== ( const IG3PointArc& arc ) const,
  130.   operator!= ( const IG3PointArc& arc ) const;
  131.  
  132. private:
  133. /*-------------------------------- Private -----------------------------------*/
  134.  
  135. IPoint
  136.   fStart,
  137.   fIntermediate,
  138.   fEnd;
  139. }; // IG3PointArc
  140.  
  141. #pragma pack()
  142.  
  143. #endif // _IGARC_
  144.