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

  1. #ifndef _IGPYLINE_
  2. #define _IGPYLINE_
  3. /*******************************************************************************
  4. * FILE NAME: IPLYLINE.HPP                                                      *
  5. *                                                                              *
  6. * DESCRIPTION:                                                                 *
  7. *   Declaration of the classes:                                                *
  8. *     IGPolyline                                                               *
  9. *     IGPolygon                                                                *
  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 <iptarray.hpp>
  22.  
  23.  
  24. #pragma pack(4)
  25.  
  26. class IGraphicContext;
  27.  
  28. class IGPolyline : public IGraphic {
  29. typedef IGraphic
  30.   Inherited;
  31. public:
  32. /*------------------------------- Constructors -------------------------------*/
  33.   IGPolyline  ( const IPointArray& pointArray );
  34.  
  35.   IGPolyline  ( const IGPolyline&  polyline   );
  36.  
  37. IGPolyline
  38.   &operator=  ( const IGPolyline&  polyline   );
  39.  
  40. virtual
  41.   ~IGPolyline ( );
  42.  
  43. /*-------------------------------- Drawing -----------------------------------*/
  44. virtual IGPolyline
  45.   &drawOn             ( IGraphicContext& graphicContext );
  46.  
  47. /*------------------------------- Data Points --------------------------------*/
  48. virtual unsigned long
  49.   numberOfPoints      ( ) const;
  50.  
  51. const IPointArray
  52.   &pointArray         ( ) const;
  53. const IPoint
  54.   &point              ( unsigned long      index      ) const;
  55.  
  56. virtual IGPolyline
  57.   &setPoints          ( const IPointArray& pointArray ),
  58.   &setPoint           ( unsigned long      index,
  59.                         const IPoint&      point      ),
  60.   &insertPoint        ( unsigned long      index,
  61.                         const IPoint&      point      ),
  62.   &addPoint           ( const IPoint&      point      ),
  63.   &removePoint        ( unsigned long      index      ),
  64.   &reversePoints      ( );
  65.  
  66. /*-------------------------------- Comparison --------------------------------*/
  67. IBase::Boolean
  68.   operator== ( const IGPolyline& polyline ) const,
  69.   operator!= ( const IGPolyline& polyline ) const;
  70.  
  71. private:
  72. /*-------------------------------- Private -----------------------------------*/
  73. IPointArray
  74.   fPtArray;
  75. }; // IGPolyline
  76.  
  77.  
  78. class IGPolygon : public IGPolyline {
  79. typedef IGPolyline
  80.   Inherited;
  81. public:
  82. /*------------------------------- Constructors -------------------------------*/
  83.   IGPolygon  ( const IPointArray& pointArray );
  84.  
  85.   IGPolygon  ( const IGPolygon&   polygon    );
  86.  
  87. IGPolygon&
  88.   operator=  ( const IGPolygon&   polygon    );
  89.  
  90. virtual
  91.   ~IGPolygon ( );
  92.  
  93. /*-------------------------------- Drawing -----------------------------------*/
  94. virtual IGPolygon
  95.   &drawOn           ( IGraphicContext& graphicContext );
  96.  
  97. /*--------------------------------- Fill Mode --------------------------------*/
  98. enum FillMode {
  99.   alternate,
  100.   winding
  101.   };
  102.  
  103. virtual IGPolygon
  104.   &setFillMode      ( FillMode fillmode );
  105.  
  106. virtual FillMode
  107.   fillMode          ( ) const;
  108.  
  109. /*-------------------------------- Comparison --------------------------------*/
  110. Boolean
  111.   operator== ( const IGPolygon& polygon ) const,
  112.   operator!= ( const IGPolygon& polygon ) const;
  113.  
  114. private:
  115. /*-------------------------------- Private -----------------------------------*/
  116. FillMode
  117.   fFm;
  118. }; // IGPolygon
  119.  
  120. #pragma pack()
  121. #endif // _IGPYLINE_
  122.