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

  1. /* @(#)Z 1.9 com/src/imaging/realshps/RgnShpe.h, odimaging, od96os2, odos29646d 96/11/15 15:29:18 (96/10/29 09:27:28) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odimaging
  6.  *
  7.  *   CLASSES:   RgnShape
  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:        RgnShpe.h
  31.  
  32.     Contains:    RgnShape 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.          <3>     12/5/94    jpa        Code review cleanup. [1203923]
  41.          <2>      8/8/94    jpa        Added Outset method [1178690]
  42.          <1>     6/15/94    jpa        first checked in
  43.                             --------Moved to SOM project and rearranged-----
  44.          <7>      5/9/94    jpa        Enable polygon clipper and GX support
  45.                                     [1162090]
  46.          <6>     3/15/94    MB        Changes to support SCpp/ASLM builds,
  47.                                     #1150864.
  48.          <5>     2/17/94    JA        Declare XMPPolygon as struct, not class.
  49.          <4>     2/16/94    JA        Include new AltPoint.h.
  50.          <3>     2/10/94    JA        Stop using ptrs to member fns.
  51.          <2>      2/9/94    JA        Renamed from ShapePrv.h --> ShapePvM.h
  52.          <6>      2/7/94    JA        Further tigerings.
  53.          <5>      2/3/94    JA        Tiger Team Makeover!
  54.          <4>     1/31/94    JA        XMPRealShape no longer derives from
  55.                                     XMPAbsShape. Other API improvements.
  56.          <3>    11/24/93    VL        Rolled back changes as ASLM build breaks
  57.                                     the THINK build.
  58.          <2>    11/23/93    VL        Made this work with ASLM.
  59.          <1>    11/23/93    JA        first checked in
  60. */
  61.  
  62.  
  63. #ifndef _RGNSHPE_
  64. #define _RGNSHPE_
  65.  
  66. #ifndef _ODTYPES_
  67. #include "ODTypes.h"
  68. #endif
  69.  
  70. #ifndef _PLFMDEF_
  71. #include "PlfmDef.h"
  72. #endif
  73.  
  74. #ifndef _REALSHPE_
  75. #include "RealShpe.h"        /* Base class*/
  76. #endif
  77.  
  78.  
  79. //==============================================================================
  80. // RgnShape
  81. //==============================================================================
  82.  
  83. class RgnShape :public RealShape {
  84.   public:
  85.  
  86.     RgnShape( ODGeometryMode mode );
  87.     virtual ~RgnShape( );
  88.  
  89.     ODVMethod ODSize     Purge(ODSize size);    // Can't purge rgn!
  90.     ODVMethod RealShape* SetRectangle( const ODRect *rect );
  91.     ODVMethod RealShape* SetPolygon( const ODPolygon& );
  92.     ODVMethod ODBoolean  HasGeometry( );
  93.     ODVMethod void       SetPlatformShape( ODGraphicsSystem, ODPlatformShape );
  94.     ODVMethod RealShape* Transform(Environment*, ODTransform* transform);
  95.  
  96. //
  97. // IBM Platforms
  98. //
  99. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  100.  
  101.     ODVMethod void       GetBoundingBox( Environment*, ODRect *bounds );
  102.     ODVMethod void       GetPesimisticBoundingBox( Environment*, ODRect *bounds );
  103.     ODVMethod void       CopyPolygon( Environment*, ODPolygon& );
  104.     ODVMethod ODBoolean  IsSameAs( Environment*, RealShape * compareShape);
  105.     ODVMethod ODBoolean  IsEmpty( Environment* );
  106.     ODVMethod ODBoolean  ContainsPoint( Environment*, ODPoint point);
  107.     ODVMethod ODBoolean  IsRectangular( Environment* );
  108.     ODVMethod RealShape* Copy( Environment* );    // Really returns an ODRgnShape*
  109.     ODVMethod RealShape* Outset( Environment* ev, ODCoordinate distance);
  110.     ODVMethod RealShape* Subtract( Environment*, RealShape * diffShape);
  111.     ODVMethod RealShape* Intersect( Environment*, RealShape * sectShape);
  112.     ODVMethod RealShape* Union( Environment*, RealShape * sectShape);
  113.  
  114. #else
  115.  
  116.     ODVMethod void       GetBoundingBox( ODRect *bounds );
  117.     ODVMethod void       CopyPolygon( ODPolygon& );
  118.     ODVMethod ODBoolean  IsSameAs(RealShape* compareShape);
  119.     ODVMethod ODBoolean  IsEmpty( );
  120.     ODVMethod ODBoolean  ContainsPoint(ODPoint point);
  121.     ODVMethod ODBoolean  IsRectangular( );
  122.     ODVMethod RealShape* Copy( );    // Really returns an ODRgnShape*
  123.     ODVMethod RealShape* Outset(ODCoordinate distance);
  124.     ODVMethod RealShape* Subtract(RealShape* diffShape);
  125.     ODVMethod RealShape* Intersect(RealShape* sectShape);
  126.     ODVMethod RealShape* Union(RealShape* sectShape);
  127.  
  128. #endif  // IBM Platforms
  129.  
  130.  
  131.   protected:
  132.  
  133. //
  134. // IBM Platforms
  135. //
  136. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  137.  
  138.     ODVMethod void      InitQDRegion( Environment* );
  139.     ODMethod ODPlatformShape GetPlatformShape( Environment*, ODGraphicsSystem);
  140.  
  141. #else
  142.  
  143.     ODVMethod void      InitQDRegion( );
  144.     ODVMethod gxShape    CopyGXShape( );
  145.  
  146. #endif  // IBM Platforms
  147.  
  148.  
  149.     virtual RealShape*    Clear( );      // Just clear w/o replacing
  150.  
  151.     ODPolygon        fPolygon;      // Cached equivalent polygon
  152.  
  153.  
  154. //
  155. // IBM Platforms
  156. //
  157. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  158.  
  159.     ODTransform* fTransform;
  160.     ODBoolean bboxValid;
  161.     ODRect bbox;
  162.  
  163. #endif // IBM Platforms 
  164.  
  165. };
  166.  
  167.  
  168. #endif /*_RGNSHPE_*/
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.