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

  1. /* @(#)Z 1.6 com/src/imaging/realshps/RectShpe.h, odimaging, od96os2, odos29646d 96/11/15 15:29:18 (96/10/29 09:27:18) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odimaging
  6.  *
  7.  *   CLASSES:   RectShape
  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:        RectShpe.h
  31.  
  32.     Contains:    RectShape 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        Cleanup from code review. [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 _RECTSHPE_
  64. #define _RECTSHPE_
  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. // RectShape
  81. //==============================================================================
  82.  
  83.  
  84. class RectShape :public RealShape {
  85.   public:
  86.  
  87.   RectShape( ODGeometryMode mode, const ODRect& );
  88.   ~RectShape() {}
  89.  
  90.   ODVMethod RealShape*  SetRectangle( const ODRect* );
  91.   ODVMethod RealShape*  Transform( Environment*, ODTransform* transform );
  92.  
  93. //
  94. // IBM Platforms
  95. //
  96. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  97.  
  98.     ODVMethod void        GetBoundingBox( Environment*,  ODRect* );
  99.     ODVMethod void        CopyPolygon( Environment*, ODPolygon& );
  100.     ODVMethod ODBoolean   IsSameAs(  Environment*, RealShape * compareShape );
  101.     ODVMethod ODBoolean   IsEmpty( Environment* );
  102.     ODVMethod ODBoolean   ContainsPoint( Environment*,  ODPoint point );
  103.     ODVMethod ODBoolean   IsRectangular( Environment* );
  104.     ODVMethod RealShape*  Copy( Environment* );      // Really returns an ODRectShape*
  105.     ODVMethod RealShape*  Outset(Environment*, ODCoordinate distance);
  106.     ODVMethod RealShape*  Subtract( Environment*, RealShape * diffShape );
  107.     ODVMethod RealShape*  Intersect( Environment*, RealShape * sectShape );
  108.     ODVMethod RealShape*  Union( Environment*, RealShape * sectShape );
  109.  
  110. #else
  111.  
  112.     ODVMethod void        GetBoundingBox( ODRect* );
  113.     ODVMethod void        CopyPolygon( ODPolygon& );
  114.     ODVMethod ODBoolean   IsSameAs( RealShape* compareShape );
  115.     ODVMethod ODBoolean   IsEmpty( );
  116.     ODVMethod ODBoolean   ContainsPoint( ODPoint point );
  117.     ODVMethod ODBoolean   IsRectangular( );
  118.     ODVMethod RealShape*  Copy( );      // Really returns an ODRectShape*
  119.     ODVMethod RealShape*  Outset(ODCoordinate distance);
  120.     ODVMethod RealShape*  Subtract( RealShape* diffShape );
  121.     ODVMethod RealShape*  Intersect( RealShape* sectShape );
  122.     ODVMethod RealShape*  Union( RealShape* sectShape );
  123.  
  124. #endif  // IBM Platforms
  125.  
  126.   protected:
  127.  
  128. //
  129. // IBM Platforms
  130. //
  131. #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
  132.  
  133.     ODVMethod void      InitQDRegion( Environment* );
  134.  
  135. #else
  136.  
  137.     ODVMethod void      InitQDRegion( );
  138.     ODVMethod gxShape    CopyGXShape( );
  139.  
  140. #endif  // IBM Platforms
  141.  
  142.     ODVMethod RealShape*  Clear( );        // Just clear w/o replacing
  143.  
  144.   private:
  145.     ODRect  fRect;
  146. };
  147.  
  148.  
  149. #endif /*_RECTSHPE_*/
  150.  
  151.  
  152.