ReactOS  0.4.14-dev-1115-gebeeb9d
sweep.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ActiveRegion
 

Macros

#define RegionBelow(r)   ((ActiveRegion *) dictKey(dictPred((r)->nodeUp)))
 
#define RegionAbove(r)   ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp)))
 

Functions

int __gl_computeInterior (GLUtesselator *tess)
 

Macro Definition Documentation

◆ RegionAbove

#define RegionAbove (   r)    ((ActiveRegion *) dictKey(dictSucc((r)->nodeUp)))

Definition at line 75 of file sweep.h.

◆ RegionBelow

#define RegionBelow (   r)    ((ActiveRegion *) dictKey(dictPred((r)->nodeUp)))

Definition at line 74 of file sweep.h.

Function Documentation

◆ __gl_computeInterior()

int __gl_computeInterior ( GLUtesselator tess)

Definition at line 1301 of file sweep.c.

1309 {
1310  GLUvertex *v, *vNext;
1311 
1312  tess->fatalError = FALSE;
1313 
1314  /* Each vertex defines an event for our sweep line. Start by inserting
1315  * all the vertices in a priority queue. Events are processed in
1316  * lexicographic order, ie.
1317  *
1318  * e1 < e2 iff e1.x < e2.x || (e1.x == e2.x && e1.y < e2.y)
1319  */
1320  RemoveDegenerateEdges( tess );
1321  if ( !InitPriorityQ( tess ) ) return 0; /* if error */
1322  InitEdgeDict( tess );
1323 
1324  /* __gl_pqSortExtractMin */
1325  while( (v = (GLUvertex *)pqExtractMin( tess->pq )) != NULL ) {
1326  for( ;; ) {
1327  vNext = (GLUvertex *)pqMinimum( tess->pq ); /* __gl_pqSortMinimum */
1328  if( vNext == NULL || ! VertEq( vNext, v )) break;
1329 
1330  /* Merge together all vertices at exactly the same location.
1331  * This is more efficient than processing them one at a time,
1332  * simplifies the code (see ConnectLeftDegenerate), and is also
1333  * important for correct handling of certain degenerate cases.
1334  * For example, suppose there are two identical edges A and B
1335  * that belong to different contours (so without this code they would
1336  * be processed by separate sweep events). Suppose another edge C
1337  * crosses A and B from above. When A is processed, we split it
1338  * at its intersection point with C. However this also splits C,
1339  * so when we insert B we may compute a slightly different
1340  * intersection point. This might leave two edges with a small
1341  * gap between them. This kind of error is especially obvious
1342  * when using boundary extraction (GLU_TESS_BOUNDARY_ONLY).
1343  */
1344  vNext = (GLUvertex *)pqExtractMin( tess->pq ); /* __gl_pqSortExtractMin*/
1345  SpliceMergeVertices( tess, v->anEdge, vNext->anEdge );
1346  }
1347  SweepEvent( tess, v );
1348  }
1349 
1350  /* Set tess->event for debugging purposes */
1351  /* __GL_DICTLISTKEY */ /* __GL_DICTLISTMIN */
1352  tess->event = ((ActiveRegion *) dictKey( dictMin( tess->dict )))->eUp->Org;
1353  DebugEvent( tess );
1354  DoneEdgeDict( tess );
1355  DonePriorityQ( tess );
1356 
1357  if ( !RemoveDegenerateFaces( tess->mesh ) ) return 0;
1358  __gl_meshCheckMesh( tess->mesh );
1359 
1360  return 1;
1361 }
#define pqMinimum(pq)
#define DebugEvent(tess)
Definition: sweep.c:59
static void DoneEdgeDict(GLUtesselator *tess)
Definition: sweep.c:1173
static void SpliceMergeVertices(GLUtesselator *tess, GLUhalfEdge *e1, GLUhalfEdge *e2)
Definition: sweep.c:438
smooth NULL
Definition: ftsmooth.c:416
static void DonePriorityQ(GLUtesselator *tess)
Definition: sweep.c:1261
GLboolean fatalError
Definition: tess.h:81
#define pqExtractMin(pq)
static int InitPriorityQ(GLUtesselator *tess)
Definition: sweep.c:1233
GLUvertex * event
Definition: tess.h:85
Dict * dict
Definition: tess.h:83
GLUmesh * mesh
Definition: tess.h:66
static int RemoveDegenerateFaces(GLUmesh *mesh)
Definition: sweep.c:1267
#define FALSE
Definition: sweep.c:53
const GLdouble * v
Definition: gl.h:2040
static void SweepEvent(GLUtesselator *tess, GLUvertex *vEvent)
Definition: sweep.c:1068
#define VertEq(u, v)
Definition: geom.h:49
PriorityQ * pq
Definition: tess.h:84
#define dictMin(d)
Definition: dict-list.h:55
void __gl_meshCheckMesh(GLUmesh *mesh)
Definition: mesh.c:742
#define dictKey(n)
Definition: dict-list.h:52
GLUhalfEdge * anEdge
Definition: mesh.h:117
static void InitEdgeDict(GLUtesselator *tess)
Definition: sweep.c:1158
static void RemoveDegenerateEdges(GLUtesselator *tess)
Definition: sweep.c:1199

Referenced by gluTessEndPolygon().