TASPolyUtils.c File Reference

#include "TPoint.h"

Go to the source code of this file.

Classes

struct  BRESINFO
struct  _EdgeTableEntry
struct  _ScanLineList
struct  EdgeTable
struct  _ScanLineListBlock

Defines

#define BRESINITPGON(dy, x1, x2, xStart, d, m, m1, incr1, incr2)
#define BRESINCRPGON(d, minval, m, m1, incr1, incr2)
#define BRESINITPGONSTRUCT(dmaj, min1, min2, bres)
#define BRESINCRPGONSTRUCT(bres)   BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)
#define CLOCKWISE   1
#define COUNTERCLOCKWISE   -1
#define SLLSPERBLOCK   25
#define EVALUATEEDGEWINDING(pAET, pPrevAET, y, fixWAET)
#define EVALUATEEDGEEVENODD(pAET, pPrevAET, y)
#define LARGE_COORDINATE   1000000
#define SMALL_COORDINATE   -LARGE_COORDINATE

Typedefs

typedef _EdgeTableEntry EdgeTableEntry
typedef _ScanLineList ScanLineList
typedef _ScanLineListBlock ScanLineListBlock

Functions

static void InsertEdgeInET (EdgeTable *ET, EdgeTableEntry *ETE, int scanline, ScanLineListBlock **SLLBlock, int *iSLLBlock)
static void CreateETandAET (int count, TPoint *pts, EdgeTable *ET, EdgeTableEntry *AET, EdgeTableEntry *pETEs, ScanLineListBlock *pSLLBlock)
static void loadAET (EdgeTableEntry *AET, EdgeTableEntry *ETEs)
static int InsertionSort (EdgeTableEntry *AET)
static void FreeStorage (ScanLineListBlock *pSLLBlock)


Define Documentation

#define BRESINCRPGON ( d,
minval,
m,
m1,
incr1,
incr2   ) 

Value:

{ \
    if (m1 > 0) { \
        if (d > 0) { \
            minval += m1; \
            d += incr1; \
        } \
        else { \
            minval += m; \
            d += incr2; \
        } \
    } else {\
        if (d >= 0) { \
            minval += m1; \
            d += incr1; \
        } \
        else { \
            minval += m; \
            d += incr2; \
        } \
    } \
}

Definition at line 115 of file TASPolyUtils.c.

Referenced by TASImage::GetPolygonSpans().

#define BRESINCRPGONSTRUCT ( bres   )     BRESINCRPGON(bres.d, bres.minor_axis, bres.m, bres.m1, bres.incr1, bres.incr2)

Definition at line 157 of file TASPolyUtils.c.

#define BRESINITPGON ( dy,
x1,
x2,
xStart,
d,
m,
m1,
incr1,
incr2   ) 

Value:

{ \
    int dx;\
\
    if ((dy) != 0) { \
        xStart = (x1); \
        dx = (x2) - xStart; \
        if (dx < 0) { \
            m = dx / (dy); \
            m1 = m - 1; \
            incr1 = -2 * dx + 2 * (dy) * m1; \
            incr2 = -2 * dx + 2 * (dy) * m; \
            d = 2 * m * (dy) - 2 * dx - 2 * (dy); \
        } else { \
            m = dx / (dy); \
            m1 = m + 1; \
            incr1 = 2 * dx - 2 * (dy) * m1; \
            incr2 = 2 * dx - 2 * (dy) * m; \
            d = -2 * m * (dy) + 2 * dx; \
        } \
    } \
}

Definition at line 93 of file TASPolyUtils.c.

Referenced by TASImage::GetPolygonSpans().

#define BRESINITPGONSTRUCT ( dmaj,
min1,
min2,
bres   ) 

Value:

BRESINITPGON(dmaj, min1, min2, bres.minor_axis, bres.d, \
                     bres.m, bres.m1, bres.incr1, bres.incr2)

Definition at line 153 of file TASPolyUtils.c.

Referenced by CreateETandAET().

#define CLOCKWISE   1

Definition at line 210 of file TASPolyUtils.c.

#define COUNTERCLOCKWISE   -1

Definition at line 211 of file TASPolyUtils.c.

#define EVALUATEEDGEEVENODD ( pAET,
pPrevAET,
y   ) 

Value:

{ \
   if (pAET->ymax == y) {          /* leaving this edge */ \
      pPrevAET->next = pAET->next; \
      pAET = pPrevAET->next; \
      if (pAET) \
         pAET->back = pPrevAET; \
   } \
   else { \
      BRESINCRPGONSTRUCT(pAET->bres); \
      pPrevAET = pAET; \
      pAET = pAET->next; \
   } \
}

Definition at line 287 of file TASPolyUtils.c.

Referenced by TASImage::DrawFillArea().

#define EVALUATEEDGEWINDING ( pAET,
pPrevAET,
y,
fixWAET   ) 

Value:

{ \
   if (pAET->ymax == y) {          /* leaving this edge */ \
      pPrevAET->next = pAET->next; \
      pAET = pPrevAET->next; \
      fixWAET = 1; \
      if (pAET) \
         pAET->back = pPrevAET; \
   } \
   else { \
      BRESINCRPGONSTRUCT(pAET->bres); \
      pPrevAET = pAET; \
      pAET = pAET->next; \
   } \
}

Definition at line 264 of file TASPolyUtils.c.

#define LARGE_COORDINATE   1000000

Definition at line 301 of file TASPolyUtils.c.

Referenced by CreateETandAET().

#define SLLSPERBLOCK   25

Definition at line 242 of file TASPolyUtils.c.

Referenced by InsertEdgeInET().

#define SMALL_COORDINATE   -LARGE_COORDINATE

Definition at line 302 of file TASPolyUtils.c.

Referenced by CreateETandAET().


Typedef Documentation

typedef struct _EdgeTableEntry EdgeTableEntry

typedef struct _ScanLineList ScanLineList

typedef struct _ScanLineListBlock ScanLineListBlock


Function Documentation

static void CreateETandAET ( int  count,
TPoint pts,
EdgeTable ET,
EdgeTableEntry AET,
EdgeTableEntry pETEs,
ScanLineListBlock pSLLBlock 
) [static]

Definition at line 365 of file TASPolyUtils.c.

References _EdgeTableEntry::back, _EdgeTableEntry::bres, BRESINITPGONSTRUCT, _EdgeTableEntry::ClockWise, TPoint::fX, TPoint::fY, InsertEdgeInET(), LARGE_COORDINATE, BRESINFO::minor_axis, _ScanLineListBlock::next, _ScanLineList::next, _EdgeTableEntry::next, _EdgeTableEntry::nextWETE, EdgeTable::scanlines, SMALL_COORDINATE, top(), EdgeTable::ymax, _EdgeTableEntry::ymax, and EdgeTable::ymin.

Referenced by TASImage::DrawFillArea().

static void FreeStorage ( ScanLineListBlock pSLLBlock  )  [static]

Definition at line 524 of file TASPolyUtils.c.

References _ScanLineListBlock::next.

Referenced by TASImage::DrawFillArea().

static void InsertEdgeInET ( EdgeTable ET,
EdgeTableEntry ETE,
int  scanline,
ScanLineListBlock **  SLLBlock,
int *  iSLLBlock 
) [static]

Definition at line 305 of file TASPolyUtils.c.

References _EdgeTableEntry::bres, _ScanLineList::edgelist, BRESINFO::minor_axis, _ScanLineListBlock::next, _ScanLineList::next, _EdgeTableEntry::next, _ScanLineList::scanline, EdgeTable::scanlines, SLLSPERBLOCK, and start.

Referenced by CreateETandAET().

static int InsertionSort ( EdgeTableEntry AET  )  [static]

Definition at line 485 of file TASPolyUtils.c.

References _EdgeTableEntry::back, _EdgeTableEntry::bres, BRESINFO::minor_axis, and _EdgeTableEntry::next.

Referenced by TASImage::DrawFillArea().

static void loadAET ( EdgeTableEntry AET,
EdgeTableEntry ETEs 
) [static]

Definition at line 455 of file TASPolyUtils.c.

References _EdgeTableEntry::back, _EdgeTableEntry::bres, BRESINFO::minor_axis, and _EdgeTableEntry::next.

Referenced by TASImage::DrawFillArea().


Generated on Tue Jul 5 15:58:18 2011 for ROOT_528-00b_version by  doxygen 1.5.1