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

  1. /* @(#)Z 1.6 com/src/imaging/polyclip/PGEdge.h, odimaging, od96os2, odos29646d 96/11/15 15:29:17 (96/10/29 09:26:24) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odimaging
  6.  *
  7.  *   CLASSES:   PGEdge
  8.  *        PGEdgeTable
  9.  *
  10.  *   ORIGINS: 82,27
  11.  *
  12.  *
  13.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  14.  *   All Rights Reserved
  15.  *   Licensed Materials - Property of IBM
  16.  *   US Government Users Restricted Rights - Use, duplication or
  17.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  18.  *       
  19.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  20.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  21.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  22.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  23.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  24.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  25.  *   OR PERFORMANCE OF THIS SOFTWARE.
  26.  */
  27. /*====END_GENERATED_PROLOG========================================
  28.  */
  29.  
  30. /********************************************************************/
  31. /*  Licensed Materials - Property of IBM                            */
  32. /*                                                                  */
  33. /*                                                                  */
  34. /* Copyright (C) International Business Machines Corp., 1994.       */
  35. /* Copyright (C) Apple Computer, Inc., 1994                         */
  36. /*                                                                  */
  37. /*  US Government Users Restricted Rights -                         */
  38. /*  Use, duplication, or disclosure restricted                      */
  39. /*  by GSA ADP Schedule Contract with IBM Corp.                     */
  40. /*                                                                  */
  41. /*  IBM Change History (most recent first):                         */
  42. /*          3/21/96 jab     Merge with DR4.                         */
  43. /*  <OS2>  08/22/95 aml     133968 Port DR3                         */
  44. /*                                                                  */
  45. /********************************************************************/
  46. /*
  47.   File:    PGEdge.h
  48.  
  49.   Contains:  Active-edge structure for the clipper.
  50.  
  51.   Owned by:  Jens Alfke (based on algorithm by A. C. Kilgour)
  52.  
  53.   Copyright:  ⌐ 1994 by Apple Computer, Inc., all rights reserved.
  54.  
  55.   Change History (most recent first):
  56.  
  57.      <2>   5/25/95  jpa    List.h --> LinkList.h [1253324]
  58.      <1>   6/15/94  jpa    first checked in
  59.      ---------------------------Moved to ODSOM project.
  60.      <1>    5/9/94  jpa    first checked in
  61.  
  62.   Theory of Operation:
  63.   In Progress:
  64. */
  65.  
  66. #ifndef _PGEDGE_
  67. #define _PGEDGE_
  68.  
  69. #ifndef _ODTYPES_
  70. #include "ODTypes.h"
  71. #endif
  72.  
  73. #ifndef _LINKLIST_
  74. #include "LinkList.h"
  75. #endif
  76.  
  77. #ifndef _PGCOMMON_
  78. #include "PGCommon.h"
  79. #endif
  80.  
  81.  
  82. class PGVertex;
  83. class PGOutputContour;
  84.  
  85.  
  86. // PGEdge represents an edge in the Active Edge Table.
  87. class PGEdge :public Link
  88. {
  89.   public:
  90.     PGEdge( const PGVertex *tail, const PGVertex *head );
  91.  
  92.     PGSide    TestPoint( const ODPoint& );  // Which side of line is pt on?
  93.     ODBoolean  IntersectWith( const PGEdge*, ODPoint § );
  94.     PGEdge*    ReplaceWithCopy( );        // Returns the copy
  95.  
  96.     void    StartPath( PGEdge *rightEdge, const ODPoint* );
  97.     void    ExtendPath( PGEdge *lowerEdge, const ODPoint* );
  98.     void    MergePaths( PGEdge*, const ODPoint* );
  99.  
  100.     ODSShort      fWrapNo;        // Wrap-number of my contour
  101.     PGSense    const  fSense;          // kPositive if heading downward
  102.     ODBoolean      fLowEvent;        // Has bottom been entered into event queue?
  103.     ODBoolean      fMatched;        // Temp flag used in edge-matching
  104.     ODBoolean      fLeftBundle,      // Bundled w/prev edge?
  105.               fRightBundle;      // Bundled w/next edge?
  106.     const PGVertex    *fHighVert,        // Top (min. y) vertex
  107.               *fLowVert;        // Bottom (max. y) vertex
  108.     ODPoint        fDelta;          // Dist from high to low vert. y >= 0!
  109.  
  110.     PGSide        fSide;          // Which side of output path?
  111.     PGEdge           *fOtherSide;      // Edge on other side of output contour
  112.     PGOutputContour    *fOutput;        // Output contour
  113. };
  114.  
  115.  
  116. class PGEdgeTable :public LinkedList
  117. {
  118.   public:
  119.     void  Add( PGEdge* );            // Adds sorted
  120.  
  121.     void  InsertListBefore( PGEdgeTable&, PGEdge *before );
  122.     void  AddRange( PGEdge *first, PGEdge *last, PGEdge *before );
  123.     PGEdge*  RemoveRange( PGEdge *first, PGEdge *last );
  124.  
  125.     void  Unmatch( );
  126.     PGEdge*  FirstUnmatched( );
  127.     PGEdge*  LastUnmatched( );
  128.     PGEdge*  UnmatchedBefore( const PGEdge* );
  129.     PGEdge*  UnmatchedAfter( const PGEdge* );
  130. };
  131.  
  132. #endif /*_PGEDGE_*/
  133.  
  134.  
  135.  
  136.