home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / POLYSHPE.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  5KB  |  172 lines

  1. /* @(#)Z 1.6 com/src/imaging/realshps/PolyShpe.h, odimaging, od96os2, odos29646d 96/11/15 15:29:17 (96/10/29 09:27:00) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odimaging
  6.  *
  7.  *   CLASSES:   PolygonShape
  8.  *
  9.  *   ORIGINS: 82,27
  10.  *
  11.  *
  12.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13.  *   All Rights Reserved
  14.  *   Licensed Materials - Property of IBM
  15.  *   US Government Users Restricted Rights - Use, duplication or
  16.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17.  *       
  18.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24.  *   OR PERFORMANCE OF THIS SOFTWARE.
  25.  */
  26. /*====END_GENERATED_PROLOG========================================
  27.  */
  28.  
  29. /*
  30.     File:        PolyShpe.h
  31.  
  32.     Contains:    PolygonShape class, private to ODShape.
  33.  
  34.     Written by:    Jens Alfke
  35.  
  36.     Copyright:    1993-94 by Apple Computer, Inc., all rights reserved.
  37.  
  38.     Change History (most recent first):
  39.  
  40.          <4>     12/5/94    jpa        Code review cleanup [1203923]. Also
  41.                                     simplify before clipping [1196018]
  42.          <3>    10/24/94    jpa        Added fSimple flag [1191192]
  43.          <2>      8/8/94    jpa        Added Outset method [1178690]
  44.          <1>     6/15/94    jpa        first checked in
  45.                             --------Moved to SOM project and rearranged-----
  46.          <7>      5/9/94    jpa        Enable polygon clipper and GX support
  47.                                     [1162090]
  48.          <6>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  49.                                     #1150864.
  50.          <5>     2/17/94    JA        Declare XMPPolygon as struct, not class.
  51.          <4>     2/16/94    JA        Include new AltPoint.h.
  52.          <3>     2/10/94    JA        Stop using ptrs to member fns.
  53.          <2>      2/9/94    JA        Renamed from ShapePrv.h --> ShapePvM.h
  54.          <6>      2/7/94    JA        Further tigerings.
  55.          <5>      2/3/94    JA        Tiger Team Makeover!
  56.          <4>     1/31/94    JA        XMPRealShape no longer derives from
  57.                                     XMPAbsShape. Other API improvements.
  58.          <3>    11/24/93    VL        Rolled back changes as ASLM build breaks
  59.                                     the THINK build.
  60.          <2>    11/23/93    VL        Made this work with ASLM.
  61.          <1>    11/23/93    JA        first checked in
  62.  
  63.     In Progress:
  64. */
  65.  
  66.  
  67. #ifndef _POLYSHPE_
  68. #define _POLYSHPE_
  69.  
  70. #ifndef _ODTYPES_
  71. #include "ODTypes.h"
  72. #endif
  73.  
  74. #ifndef _PLFMDEF_
  75. #include "PlfmDef.h"
  76. #endif
  77.  
  78. #ifndef _REALSHPE_
  79. #include "RealShpe.h"        /* Base class*/
  80. #endif
  81.  
  82.  
  83. //==============================================================================
  84. // PolyShape
  85. //==============================================================================
  86.  
  87.  
  88. class PolygonShape :public RealShape {
  89.   public:
  90.     PolygonShape( ODGeometryMode );
  91.     virtual ~PolygonShape( );
  92.  
  93.     ODVMethod RealShape*  SetRectangle( const ODRect *rect );
  94.     ODVMethod RealShape*  SetPolygon( const ODPolygon& );
  95.     ODVMethod void        Simplify( );      // Call after SetPolygon if poly isn't simple
  96.     ODVMethod RealShape*  Transform( Environment*, ODTransform* );
  97.     ODVMethod ODSize      Purge( ODSize );
  98.  
  99. //
  100. // IBM Platforms
  101. //
  102. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  103.  
  104.     ODVMethod void        GetBoundingBox( Environment*,  ODRect *bounds );
  105.     ODVMethod void        CopyPolygon( Environment*, ODPolygon& );
  106.     ODVMethod ODBoolean   IsSameAs(  Environment*, RealShape * compareShape );
  107.     ODVMethod ODBoolean   IsEmpty( Environment* );
  108.     ODVMethod ODBoolean   ContainsPoint( Environment*, ODPoint point );
  109.     ODVMethod ODBoolean   IsRectangular( Environment* );
  110.     ODVMethod RealShape*  Copy( Environment* );              // Really returns an ODPolygonShape*
  111.     ODVMethod RealShape*  Outset(Environment*, ODCoordinate distance );
  112.     ODVMethod RealShape*  Subtract( Environment*, RealShape * diffShape );
  113.     ODVMethod RealShape*  Intersect( Environment*, RealShape * sectShape );
  114.     ODVMethod RealShape*  Union( Environment*, RealShape * sectShape );
  115.     ODVMethod RealShape*  Combine( Environment*,  ODShapeOp, RealShape * );
  116.  
  117. #else
  118.  
  119.     ODVMethod void        GetBoundingBox( ODRect *bounds );
  120.     ODVMethod void        CopyPolygon( ODPolygon& );
  121.     ODVMethod ODBoolean   IsSameAs( RealShape* compareShape );
  122.     ODVMethod ODBoolean   IsEmpty( );
  123.     ODVMethod ODBoolean   ContainsPoint(ODPoint point);
  124.     ODVMethod ODBoolean   IsRectangular( );
  125.     ODVMethod RealShape*  Copy( );  // Really returns an ODPolygonShape*
  126.     ODVMethod RealShape*  Outset(ODCoordinate distance );
  127.     ODVMethod RealShape*  Subtract(RealShape* diffShape );
  128.     ODVMethod RealShape*  Intersect(RealShape* sectShape );
  129.     ODVMethod RealShape*  Union(RealShape* sectShape );
  130.     ODVMethod RealShape*  Combine( ODShapeOp, RealShape* );
  131.  
  132. #endif  // IBM Platforms
  133.  
  134.  
  135.   protected:
  136.  
  137. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  138.  
  139.     ODVMethod void      InitQDRegion( Environment* );
  140.  
  141. #else
  142.  
  143.     ODVMethod void      InitQDRegion( );
  144.     ODVMethod gxShape    CopyGXShape( );
  145.  
  146. #endif  // IBM Platforms
  147.  
  148.   private:
  149.  
  150.   ODPolygon  fPolygon;
  151.   ODRect    fBounds;
  152.   ODBoolean  fBoundsValid;
  153. };
  154.  
  155.  
  156. #endif /*_POLYSHPE_*/
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.