g4tools  5.4.0
Macros | Functions
glutess File Reference
#include "_tess"
#include "mesh"
#include "normal"
#include "sweep"
#include "tessmono"
#include "render"
#include "undef"
Include dependency graph for glutess:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define tools_glutess_glutess
 
#define GLU_TESS_DEFAULT_TOLERANCE   0.0
 
#define GLU_TESS_MESH   100112 /* void (*)(GLUmesh *mesh) */
 
#define RequireState(tess, s)   if( tess->state != s ) static_GotoState(tess,s)
 

Functions

GLUAPI GLUtesselator *GLUAPIENTRY gluNewTess (void)
 
GLUAPI void GLUAPIENTRY gluDeleteTess (GLUtesselator *tess)
 
GLUAPI void GLUAPIENTRY gluTessBeginContour (GLUtesselator *tess)
 
GLUAPI void GLUAPIENTRY gluTessBeginPolygon (GLUtesselator *tess, GLUvoid *data)
 
GLUAPI void GLUAPIENTRY gluTessCallback (GLUtesselator *tess, GLUenum which, _GLUfuncptr CallBackFunc)
 
GLUAPI void GLUAPIENTRY gluTessEndContour (GLUtesselator *tess)
 
GLUAPI void GLUAPIENTRY gluTessEndPolygon (GLUtesselator *tess)
 
GLUAPI void GLUAPIENTRY gluTessNormal (GLUtesselator *tess, GLUdouble valueX, GLUdouble valueY, GLUdouble valueZ)
 
GLUAPI void GLUAPIENTRY gluTessProperty (GLUtesselator *tess, GLUenum which, GLUdouble data)
 
GLUAPI void GLUAPIENTRY gluTessVertex (GLUtesselator *tess, GLUdouble *location, GLUvoid *data)
 
inline void GLUAPIENTRY static_noBegin (GLUenum)
 
inline void GLUAPIENTRY static_noEdgeFlag (GLUboolean)
 
inline void GLUAPIENTRY static_noVertex (void *)
 
inline void GLUAPIENTRY static_noEnd (void)
 
inline void GLUAPIENTRY static_noError (GLUenum)
 
inline void GLUAPIENTRY static_noCombine (GLUdouble[3], void *[4], GLUfloat[4], void **)
 
inline void GLUAPIENTRY static_noMesh (GLUmesh *)
 
void GLUAPIENTRY __gl_noBeginData (GLUenum, void *)
 
void GLUAPIENTRY __gl_noEdgeFlagData (GLUboolean, void *)
 
void GLUAPIENTRY __gl_noVertexData (void *, void *)
 
void GLUAPIENTRY __gl_noEndData (void *)
 
void GLUAPIENTRY __gl_noErrorData (GLUenum, void *)
 
void GLUAPIENTRY __gl_noCombineData (GLUdouble[3], void *[4], GLUfloat[4], void **, void *)
 
size_t MAX_FAST_ALLOC ()
 
inline void static_MakeDormant (GLUtesselator *tess)
 
inline void static_GotoState (GLUtesselator *tess, enum TessState newState)
 
void GLUAPIENTRY gluGetTessProperty (GLUtesselator *tess, GLUenum which, GLUdouble *value)
 
void GLUAPIENTRY gluTessCallback_GLU_TESS_VERTEX_DATA (GLUtesselator *tess, void(GLUAPIENTRY *a_fn)(void *, void *))
 
void GLUAPIENTRY gluTessCallback_GLU_TESS_BEGIN_DATA (GLUtesselator *tess, void(GLUAPIENTRY *a_fn)(GLUenum, void *))
 
void GLUAPIENTRY gluTessCallback_GLU_TESS_END_DATA (GLUtesselator *tess, void(GLUAPIENTRY *a_fn)(void *))
 
void GLUAPIENTRY gluTessCallback_GLU_TESS_ERROR_DATA (GLUtesselator *tess, void(GLUAPIENTRY *a_fn)(GLUenum, void *))
 
void GLUAPIENTRY gluTessCallback_GLU_TESS_COMBINE_DATA (GLUtesselator *tess, void(GLUAPIENTRY *a_fn)(GLUdouble[3], void *[4], GLUfloat[4], void **, void *))
 
inline int static_AddVertex (GLUtesselator *tess, GLUdouble coords[3], void *data)
 
inline void static_CacheVertex (GLUtesselator *tess, GLUdouble coords[3], void *data)
 
inline int static_EmptyCache (GLUtesselator *tess)
 
void GLUAPIENTRY gluTessVertex (GLUtesselator *tess, GLUdouble coords[3], void *data)
 

Macro Definition Documentation

◆ GLU_TESS_DEFAULT_TOLERANCE

#define GLU_TESS_DEFAULT_TOLERANCE   0.0

Definition at line 26 of file glutess.

◆ GLU_TESS_MESH

#define GLU_TESS_MESH   100112 /* void (*)(GLUmesh *mesh) */

Definition at line 27 of file glutess.

◆ RequireState

#define RequireState (   tess,
 
)    if( tess->state != s ) static_GotoState(tess,s)

Definition at line 119 of file glutess.

◆ tools_glutess_glutess

#define tools_glutess_glutess

Definition at line 4 of file glutess.

Function Documentation

◆ __gl_noBeginData()

void GLUAPIENTRY __gl_noBeginData ( GLUenum  ,
void *   
)
inline

Definition at line 39 of file glutess.

39 {}

◆ __gl_noCombineData()

void GLUAPIENTRY __gl_noCombineData ( GLUdouble  [3],
void *  [4],
GLUfloat  [4],
void **  ,
void *   
)
inline

Definition at line 44 of file glutess.

48  {}

◆ __gl_noEdgeFlagData()

void GLUAPIENTRY __gl_noEdgeFlagData ( GLUboolean  ,
void *   
)
inline

Definition at line 40 of file glutess.

40 {}

◆ __gl_noEndData()

void GLUAPIENTRY __gl_noEndData ( void *  )
inline

Definition at line 42 of file glutess.

42 {}

◆ __gl_noErrorData()

void GLUAPIENTRY __gl_noErrorData ( GLUenum  ,
void *   
)
inline

Definition at line 43 of file glutess.

43 {}

◆ __gl_noVertexData()

void GLUAPIENTRY __gl_noVertexData ( void *  ,
void *   
)
inline

Definition at line 41 of file glutess.

41 {}

◆ gluDeleteTess()

void GLUAPIENTRY gluDeleteTess ( GLUtesselator tess)
inline

Definition at line 160 of file glutess.

161 {
162  RequireState( tess, T_DORMANT );
163  memFree( tess );
164 }

◆ gluGetTessProperty()

void GLUAPIENTRY gluGetTessProperty ( GLUtesselator tess,
GLUenum  which,
GLUdouble value 
)
inline

Definition at line 208 of file glutess.

209 {
210  switch (which) {
211  case GLU_TESS_TOLERANCE:
212  /* tolerance should be in range [0..1] */
213  assert(0.0 <= tess->relTolerance && tess->relTolerance <= 1.0);
214  *value= tess->relTolerance;
215  break;
217  assert(tess->windingRule == GLU_TESS_WINDING_ODD ||
222  *value= tess->windingRule;
223  break;
225  assert(tess->boundaryOnly == TOOLS_GLU_TRUE || tess->boundaryOnly == TOOLS_GLU_FALSE);
226  *value= tess->boundaryOnly;
227  break;
228  default:
229  *value= 0.0;
231  break;
232  }
233 } /* gluGetTessProperty() */

◆ gluNewTess()

GLUAPI GLUtesselator* GLUAPIENTRY gluNewTess ( void  )

Definition at line 59 of file glutess.

60 {
61  GLUtesselator *tess;
62 
63  /* Only initialize fields which can be changed by the api. Other fields
64  * are initialized where they are used.
65  */
66 
67  if (memInit( MAX_FAST_ALLOC() ) == 0) {
68  return 0; /* out of memory */
69  }
70  tess = (GLUtesselator *)memAlloc( sizeof( GLUtesselator ));
71  if (tess == NULL) {
72  return 0; /* out of memory */
73  }
74 
75  tess->state = T_DORMANT;
76 
77  tess->normal[0] = 0;
78  tess->normal[1] = 0;
79  tess->normal[2] = 0;
80 
85 
86  tess->callBegin = &static_noBegin;
87  tess->callEdgeFlag = &static_noEdgeFlag;
88  tess->callVertex = &static_noVertex;
89  tess->callEnd = &static_noEnd;
90 
91  tess->callError = &static_noError;
92  tess->callCombine = &static_noCombine;
93  tess->callMesh = &static_noMesh;
94 
95  tess->callBeginData= &__gl_noBeginData;
96  tess->callEdgeFlagData= &__gl_noEdgeFlagData;
97  tess->callVertexData= &__gl_noVertexData;
98  tess->callEndData= &__gl_noEndData;
99  tess->callErrorData= &__gl_noErrorData;
100  tess->callCombineData= &__gl_noCombineData;
101 
102  tess->polygonData= NULL;
103 
104  return tess;
105 }

◆ gluTessBeginContour()

void GLUAPIENTRY gluTessBeginContour ( GLUtesselator tess)
inline

Definition at line 469 of file glutess.

470 {
471  RequireState( tess, T_IN_POLYGON );
472 
473  tess->state = T_IN_CONTOUR;
474  tess->lastEdge = NULL;
475  if( tess->cacheCount > 0 ) {
476  /* Just set a flag so we don't get confused by empty contours
477  * -- these can be generated accidentally with the obsolete
478  * NextContour() interface.
479  */
480  tess->emptyCache = TOOLS_GLU_TRUE;
481  }
482 }

◆ gluTessBeginPolygon()

void GLUAPIENTRY gluTessBeginPolygon ( GLUtesselator tess,
GLUvoid data 
)
inline

Definition at line 455 of file glutess.

456 {
457  RequireState( tess, T_DORMANT );
458 
459  tess->state = T_IN_POLYGON;
460  tess->cacheCount = 0;
461  tess->emptyCache = TOOLS_GLU_FALSE;
462  tess->mesh = NULL;
463 
464  tess->polygonData= data;
465 }

◆ gluTessCallback()

void GLUAPIENTRY gluTessCallback ( GLUtesselator tess,
GLUenum  which,
_GLUfuncptr  CallBackFunc 
)
inline

Definition at line 269 of file glutess.

270 {
271  switch( which ) {
272  case GLU_TESS_BEGIN:
273  tess->callBegin = (fn == NULL) ? &static_noBegin : (void (GLUAPIENTRY *)(GLUenum)) fn;
274  return;
275  case GLU_TESS_BEGIN_DATA:
276  tess->callBeginData = (fn == NULL) ?
277  &__gl_noBeginData : (void (GLUAPIENTRY *)(GLUenum, void *)) fn;
278  return;
279  case GLU_TESS_EDGE_FLAG:
280  tess->callEdgeFlag = (fn == NULL) ? &static_noEdgeFlag :
281  (void (GLUAPIENTRY *)(GLUboolean)) fn;
282  /* If the client wants boundary edges to be flagged,
283  * we render everything as separate triangles (no strips or fans).
284  */
285  tess->flagBoundary = (fn != NULL);
286  return;
288  tess->callEdgeFlagData= (fn == NULL) ?
289  &__gl_noEdgeFlagData : (void (GLUAPIENTRY *)(GLUboolean, void *)) fn;
290  /* If the client wants boundary edges to be flagged,
291  * we render everything as separate triangles (no strips or fans).
292  */
293  tess->flagBoundary = (fn != NULL);
294  return;
295  case GLU_TESS_VERTEX:
296  tess->callVertex = (fn == NULL) ? &static_noVertex :
297  (void (GLUAPIENTRY *)(void *)) fn;
298  return;
300  tess->callVertexData = (fn == NULL) ?
301  &__gl_noVertexData : (void (GLUAPIENTRY *)(void *, void *)) fn;
302  return;
303  case GLU_TESS_END:
304  tess->callEnd = (fn == NULL) ? &static_noEnd : (void (GLUAPIENTRY *)(void)) fn;
305  return;
306  case GLU_TESS_END_DATA:
307  tess->callEndData = (fn == NULL) ? &__gl_noEndData :
308  (void (GLUAPIENTRY *)(void *)) fn;
309  return;
310  case GLU_TESS_ERROR:
311  tess->callError = (fn == NULL) ? &static_noError : (void (GLUAPIENTRY *)(GLUenum)) fn;
312  return;
313  case GLU_TESS_ERROR_DATA:
314  tess->callErrorData = (fn == NULL) ?
315  &__gl_noErrorData : (void (GLUAPIENTRY *)(GLUenum, void *)) fn;
316  return;
317  case GLU_TESS_COMBINE:
318  tess->callCombine = (fn == NULL) ? &static_noCombine :
319  (void (GLUAPIENTRY *)(GLUdouble [3],void *[4], GLUfloat [4], void ** )) fn;
320  return;
322  tess->callCombineData = (fn == NULL) ? &__gl_noCombineData :
323  (void (GLUAPIENTRY *)(GLUdouble [3],
324  void *[4],
325  GLUfloat [4],
326  void **,
327  void *)) fn;
328  return;
329  case GLU_TESS_MESH:
330  tess->callMesh = (fn == NULL) ? &static_noMesh : (void (GLUAPIENTRY *)(GLUmesh *)) fn;
331  return;
332  default:
334  return;
335  }
336 }

◆ gluTessCallback_GLU_TESS_BEGIN_DATA()

void GLUAPIENTRY gluTessCallback_GLU_TESS_BEGIN_DATA ( GLUtesselator tess,
void(GLUAPIENTRY *a_fn)(GLUenum, void *)   
)
inline

Definition at line 250 of file glutess.

250  {
251  tess->callBeginData = (a_fn == NULL) ? &__gl_noBeginData : a_fn;
252 }

◆ gluTessCallback_GLU_TESS_COMBINE_DATA()

void GLUAPIENTRY gluTessCallback_GLU_TESS_COMBINE_DATA ( GLUtesselator tess,
void(GLUAPIENTRY *a_fn)(GLUdouble[3], void *[4], GLUfloat[4], void **, void *)   
)
inline

Definition at line 262 of file glutess.

263  {
264  tess->callCombineData = (a_fn == NULL) ? &__gl_noCombineData : a_fn;
265 }

◆ gluTessCallback_GLU_TESS_END_DATA()

void GLUAPIENTRY gluTessCallback_GLU_TESS_END_DATA ( GLUtesselator tess,
void(GLUAPIENTRY *a_fn)(void *)   
)
inline

Definition at line 254 of file glutess.

254  {
255  tess->callEndData = (a_fn == NULL) ? &__gl_noEndData : a_fn;
256 }

◆ gluTessCallback_GLU_TESS_ERROR_DATA()

void GLUAPIENTRY gluTessCallback_GLU_TESS_ERROR_DATA ( GLUtesselator tess,
void(GLUAPIENTRY *a_fn)(GLUenum, void *)   
)
inline

Definition at line 258 of file glutess.

258  {
259  tess->callErrorData = (a_fn == NULL) ? &__gl_noErrorData : a_fn;
260 }

◆ gluTessCallback_GLU_TESS_VERTEX_DATA()

void GLUAPIENTRY gluTessCallback_GLU_TESS_VERTEX_DATA ( GLUtesselator tess,
void(GLUAPIENTRY *a_fn)(void *, void *)   
)
inline

Definition at line 246 of file glutess.

246  {
247  tess->callVertexData = (a_fn == NULL) ? &__gl_noVertexData : a_fn;
248 }

◆ gluTessEndContour()

void GLUAPIENTRY gluTessEndContour ( GLUtesselator tess)
inline

Definition at line 486 of file glutess.

487 {
488  RequireState( tess, T_IN_CONTOUR );
489  tess->state = T_IN_POLYGON;
490 }

◆ gluTessEndPolygon()

void GLUAPIENTRY gluTessEndPolygon ( GLUtesselator tess)
inline

Definition at line 493 of file glutess.

494 {
495  GLUmesh *mesh;
496 
497  if (setjmp(tess->env) != 0) {
498  /* come back here if out of memory */
500  return;
501  }
502 
503  RequireState( tess, T_IN_POLYGON );
504  tess->state = T_DORMANT;
505 
506  if( tess->mesh == NULL ) {
507  if( ! tess->flagBoundary && tess->callMesh == &static_noMesh ) {
508 
509  /* Try some special code to make the easy cases go quickly
510  * (eg. convex polygons). This code does NOT handle multiple contours,
511  * intersections, edge flags, and of course it does not generate
512  * an explicit mesh either.
513  */
514  if( __gl_renderCache( tess )) {
515  tess->polygonData= NULL;
516  return;
517  }
518  }
519  if ( !static_EmptyCache( tess ) ) longjmp(tess->env,1); /* could've used a label*/
520  }
521 
522  /* Determine the polygon normal and project vertices onto the plane
523  * of the polygon.
524  */
525  __gl_projectPolygon( tess );
526 
527  /* __gl_computeInterior( tess ) computes the planar arrangement specified
528  * by the given contours, and further subdivides this arrangement
529  * into regions. Each region is marked "inside" if it belongs
530  * to the polygon, according to the rule given by tess->windingRule.
531  * Each interior region is guaranteed be monotone.
532  */
533  if ( !__gl_computeInterior( tess ) ) {
534  longjmp(tess->env,1); /* could've used a label */
535  }
536 
537  mesh = tess->mesh;
538  if( ! tess->fatalError ) {
539  int rc = 1;
540 
541  /* If the user wants only the boundary contours, we throw away all edges
542  * except those which separate the interior from the exterior.
543  * Otherwise we tessellate all the regions marked "inside".
544  */
545  if( tess->boundaryOnly ) {
546  rc = __gl_meshSetWindingNumber( mesh, 1, TOOLS_GLU_TRUE );
547  } else {
548  rc = __gl_meshTessellateInterior( mesh );
549  }
550  if (rc == 0) longjmp(tess->env,1); /* could've used a label */
551 
552  __gl_meshCheckMesh( mesh );
553 
554  if( tess->callBegin != &static_noBegin || tess->callEnd != &static_noEnd
555  || tess->callVertex != &static_noVertex || tess->callEdgeFlag != &static_noEdgeFlag
556  || tess->callBeginData != &__gl_noBeginData
557  || tess->callEndData != &__gl_noEndData
558  || tess->callVertexData != &__gl_noVertexData
559  || tess->callEdgeFlagData != &__gl_noEdgeFlagData )
560  {
561  if( tess->boundaryOnly ) {
562  __gl_renderBoundary( tess, mesh ); /* output boundary contours */
563  } else {
564  __gl_renderMesh( tess, mesh ); /* output strips and fans */
565  }
566  }
567  if( tess->callMesh != &static_noMesh ) {
568 
569  /* Throw away the exterior faces, so that all faces are interior.
570  * This way the user doesn't have to check the "inside" flag,
571  * and we don't need to even reveal its existence. It also leaves
572  * the freedom for an implementation to not generate the exterior
573  * faces in the first place.
574  */
575  __gl_meshDiscardExterior( mesh );
576  (*tess->callMesh)( mesh ); /* user wants the mesh itself */
577  tess->mesh = NULL;
578  tess->polygonData= NULL;
579  return;
580  }
581  }
582  __gl_meshDeleteMesh( mesh );
583  tess->polygonData= NULL;
584  tess->mesh = NULL;
585 }

◆ gluTessNormal()

void GLUAPIENTRY gluTessNormal ( GLUtesselator tess,
GLUdouble  valueX,
GLUdouble  valueY,
GLUdouble  valueZ 
)
inline

Definition at line 236 of file glutess.

237 {
238  tess->normal[0] = x;
239  tess->normal[1] = y;
240  tess->normal[2] = z;
241 }

◆ gluTessProperty()

void GLUAPIENTRY gluTessProperty ( GLUtesselator tess,
GLUenum  which,
GLUdouble  data 
)
inline

Definition at line 168 of file glutess.

169 {
170  GLUenum windingRule;
171 
172  switch( which ) {
173  case GLU_TESS_TOLERANCE:
174  if( value < 0.0 || value > 1.0 ) break;
175  tess->relTolerance = value;
176  return;
177 
179  windingRule = (GLUenum) value;
180  if( windingRule != value ) break; /* not an integer */
181 
182  switch( windingRule ) {
188  tess->windingRule = windingRule;
189  return;
190  default:
191  break;
192  }
193  return; //G.Barrand : add : seen with g++-8.1.0.
194 
196  tess->boundaryOnly = (value != 0);
197  return;
198 
199  default:
201  return;
202  }
204 }

◆ gluTessVertex() [1/2]

GLUAPI void GLUAPIENTRY gluTessVertex ( GLUtesselator tess,
GLUdouble location,
GLUvoid data 
)

◆ gluTessVertex() [2/2]

void GLUAPIENTRY gluTessVertex ( GLUtesselator tess,
GLUdouble  coords[3],
void *  data 
)
inline

Definition at line 408 of file glutess.

409 {
410  int i, tooLarge = TOOLS_GLU_FALSE;
411  GLUdouble x, clamped[3];
412 
413  RequireState( tess, T_IN_CONTOUR );
414 
415  if( tess->emptyCache ) {
416  if ( !static_EmptyCache( tess ) ) {
418  return;
419  }
420  tess->lastEdge = NULL;
421  }
422  for( i = 0; i < 3; ++i ) {
423  x = coords[i];
424  if( x < - GLU_TESS_MAX_COORD ) {
425  x = - GLU_TESS_MAX_COORD;
426  tooLarge = TOOLS_GLU_TRUE;
427  }
428  if( x > GLU_TESS_MAX_COORD ) {
429  x = GLU_TESS_MAX_COORD;
430  tooLarge = TOOLS_GLU_TRUE;
431  }
432  clamped[i] = x;
433  }
434  if( tooLarge ) {
436  }
437 
438  if( tess->mesh == NULL ) {
439  if( tess->cacheCount < GLU_TESS_MAX_CACHE ) {
440  static_CacheVertex( tess, clamped, data );
441  return;
442  }
443  if ( !static_EmptyCache( tess ) ) {
445  return;
446  }
447  }
448  if ( !static_AddVertex( tess, clamped, data ) ) {
450  }
451 }

◆ MAX_FAST_ALLOC()

size_t MAX_FAST_ALLOC ( )
inline

Definition at line 53 of file glutess.

53  {
54  static const size_t s_value = (GLU_MAX(sizeof(EdgePair),GLU_MAX(sizeof(GLUvertex),sizeof(GLUface))));
55  return s_value;
56 }

◆ static_AddVertex()

inline int static_AddVertex ( GLUtesselator tess,
GLUdouble  coords[3],
void *  data 
)

Definition at line 338 of file glutess.

339 {
340  GLUhalfEdge *e;
341 
342  e = tess->lastEdge;
343  if( e == NULL ) {
344  /* Make a self-loop (one vertex, one edge). */
345 
346  e = __gl_meshMakeEdge( tess->mesh );
347  if (e == NULL) return 0;
348  if ( !__gl_meshSplice( e, e->Sym ) ) return 0;
349  } else {
350  /* Create a new vertex and edge which immediately follow e
351  * in the ordering around the left face.
352  */
353  if (__gl_meshSplitEdge( e ) == NULL) return 0;
354  e = e->Lnext;
355  }
356 
357  /* The new vertex is now e->Org. */
358  e->Org->data = data;
359  e->Org->coords[0] = coords[0];
360  e->Org->coords[1] = coords[1];
361  e->Org->coords[2] = coords[2];
362 
363  /* The winding of an edge says how the winding number changes as we
364  * cross from the edge''s right face to its left face. We add the
365  * vertices in such an order that a CCW contour will add +1 to
366  * the winding number of the region inside the contour.
367  */
368  e->winding = 1;
369  e->Sym->winding = -1;
370 
371  tess->lastEdge = e;
372 
373  return 1;
374 }

◆ static_CacheVertex()

inline void static_CacheVertex ( GLUtesselator tess,
GLUdouble  coords[3],
void *  data 
)

Definition at line 377 of file glutess.

378 {
379  CachedVertex *v = &tess->cache[tess->cacheCount];
380 
381  v->data = data;
382  v->coords[0] = coords[0];
383  v->coords[1] = coords[1];
384  v->coords[2] = coords[2];
385  ++tess->cacheCount;
386 }

◆ static_EmptyCache()

inline int static_EmptyCache ( GLUtesselator tess)

Definition at line 389 of file glutess.

390 {
391  CachedVertex *v = tess->cache;
392  CachedVertex *vLast;
393 
394  tess->mesh = __gl_meshNewMesh();
395  if (tess->mesh == NULL) return 0;
396 
397  for( vLast = v + tess->cacheCount; v < vLast; ++v ) {
398  if ( !static_AddVertex( tess, v->coords, v->data ) ) return 0;
399  }
400  tess->cacheCount = 0;
401  tess->emptyCache = TOOLS_GLU_FALSE;
402 
403  return 1;
404 }

◆ static_GotoState()

inline void static_GotoState ( GLUtesselator tess,
enum TessState  newState 
)

Definition at line 121 of file glutess.

122 {
123  while( tess->state != newState ) {
124  /* We change the current state one level at a time, to get to
125  * the desired state.
126  */
127  if( tess->state < newState ) {
128  switch( tess->state ) {
129  case T_DORMANT:
131  gluTessBeginPolygon( tess, NULL );
132  break;
133  case T_IN_POLYGON:
135  gluTessBeginContour( tess );
136  break;
137  default:
138  ;
139  }
140  } else {
141  switch( tess->state ) {
142  case T_IN_CONTOUR:
144  gluTessEndContour( tess );
145  break;
146  case T_IN_POLYGON:
148  /* gluTessEndPolygon( tess ) is too much work! */
149  static_MakeDormant( tess );
150  break;
151  default:
152  ;
153  }
154  }
155  }
156 }

◆ static_MakeDormant()

inline void static_MakeDormant ( GLUtesselator tess)

Definition at line 107 of file glutess.

108 {
109  /* Return the tessellator to its original dormant state. */
110 
111  if( tess->mesh != NULL ) {
112  __gl_meshDeleteMesh( tess->mesh );
113  }
114  tess->state = T_DORMANT;
115  tess->lastEdge = NULL;
116  tess->mesh = NULL;
117 }

◆ static_noBegin()

inline void GLUAPIENTRY static_noBegin ( GLUenum  )

Definition at line 29 of file glutess.

29 {}

◆ static_noCombine()

inline void GLUAPIENTRY static_noCombine ( GLUdouble  [3],
void *  [4],
GLUfloat  [4],
void **   
)

Definition at line 34 of file glutess.

35  {}

◆ static_noEdgeFlag()

inline void GLUAPIENTRY static_noEdgeFlag ( GLUboolean  )

Definition at line 30 of file glutess.

30 {}

◆ static_noEnd()

inline void GLUAPIENTRY static_noEnd ( void  )

Definition at line 32 of file glutess.

32 {}

◆ static_noError()

inline void GLUAPIENTRY static_noError ( GLUenum  )

Definition at line 33 of file glutess.

33 {}

◆ static_noMesh()

inline void GLUAPIENTRY static_noMesh ( GLUmesh )

Definition at line 36 of file glutess.

36 {}

◆ static_noVertex()

inline void GLUAPIENTRY static_noVertex ( void *  )

Definition at line 31 of file glutess.

31 {}
GLUtesselator::state
enum TessState state
Definition: _tess:31
GLU_TESS_MISSING_END_POLYGON
#define GLU_TESS_MISSING_END_POLYGON
Definition: _glu:131
static_noCombine
inline void GLUAPIENTRY static_noCombine(GLUdouble[3], void *[4], GLUfloat[4], void **)
Definition: glutess:34
__gl_meshSplitEdge
GLUhalfEdge * __gl_meshSplitEdge(GLUhalfEdge *eOrg)
Definition: mesh:654
__gl_noBeginData
void GLUAPIENTRY __gl_noBeginData(GLUenum, void *)
Definition: glutess:39
memFree
#define memFree
Definition: memalloc:42
GLU_TESS_WINDING_POSITIVE
#define GLU_TESS_WINDING_POSITIVE
Definition: _glu:39
GLU_TESS_DEFAULT_TOLERANCE
#define GLU_TESS_DEFAULT_TOLERANCE
Definition: glutess:26
GLU_TESS_TOLERANCE
#define GLU_TESS_TOLERANCE
Definition: _glu:118
GLU_TESS_BOUNDARY_ONLY
#define GLU_TESS_BOUNDARY_ONLY
Definition: _glu:117
__gl_noEdgeFlagData
void GLUAPIENTRY __gl_noEdgeFlagData(GLUboolean, void *)
Definition: glutess:40
GLUtesselator::cache
CachedVertex cache[GLU_TESS_MAX_CACHE]
Definition: _tess:76
GLU_TESS_MISSING_END_CONTOUR
#define GLU_TESS_MISSING_END_CONTOUR
Definition: _glu:132
GLU_MAX
#define GLU_MAX(x, y)
Definition: _glu:73
__gl_computeInterior
int __gl_computeInterior(GLUtesselator *tess)
Definition: sweep:1287
GLUmesh
Definition: mesh:131
GLU_TESS_COMBINE_DATA
#define GLU_TESS_COMBINE_DATA
Definition: _glu:31
CachedVertex
Definition: _tess:22
GLU_TESS_BEGIN
#define GLU_TESS_BEGIN
Definition: _glu:100
GLUtesselator::normal
GLUdouble normal[3]
Definition: _tess:41
__gl_meshSplice
int __gl_meshSplice(GLUhalfEdge *eOrg, GLUhalfEdge *eDst)
Definition: mesh:504
T_IN_POLYGON
@ T_IN_POLYGON
Definition: _tess:15
GLUtesselator::lastEdge
GLUhalfEdge * lastEdge
Definition: _tess:33
GLUhalfEdge::Lnext
GLUhalfEdge * Lnext
Definition: mesh:110
MAX_FAST_ALLOC
size_t MAX_FAST_ALLOC()
Definition: glutess:53
GLU_TESS_MESH
#define GLU_TESS_MESH
Definition: glutess:27
GLU_TESS_MISSING_BEGIN_CONTOUR
#define GLU_TESS_MISSING_BEGIN_CONTOUR
Definition: _glu:130
GLUtesselator::cacheCount
int cacheCount
Definition: _tess:75
__gl_projectPolygon
void __gl_projectPolygon(GLUtesselator *tess)
Definition: normal:148
memAlloc
#define memAlloc
Definition: memalloc:40
GLUtesselator::emptyCache
GLUboolean emptyCache
Definition: _tess:74
GLU_TESS_ERROR
#define GLU_TESS_ERROR
Definition: _glu:103
GLU_TESS_END
#define GLU_TESS_END
Definition: _glu:102
__gl_noErrorData
void GLUAPIENTRY __gl_noErrorData(GLUenum, void *)
Definition: glutess:43
__gl_meshDeleteMesh
void __gl_meshDeleteMesh(GLUmesh *mesh)
Definition: mesh:890
GLUhalfEdge
Definition: mesh:106
GLUvertex::data
void * data
Definition: mesh:86
gluTessBeginPolygon
GLUAPI void GLUAPIENTRY gluTessBeginPolygon(GLUtesselator *tess, GLUvoid *data)
Definition: glutess:455
GLUAPIENTRY
#define GLUAPIENTRY
Definition: _glu:48
GLUhalfEdge::Sym
GLUhalfEdge * Sym
Definition: mesh:108
static_noEdgeFlag
inline void GLUAPIENTRY static_noEdgeFlag(GLUboolean)
Definition: glutess:30
static_CacheVertex
inline void static_CacheVertex(GLUtesselator *tess, GLUdouble coords[3], void *data)
Definition: glutess:377
GLU_TESS_WINDING_ABS_GEQ_TWO
#define GLU_TESS_WINDING_ABS_GEQ_TWO
Definition: _glu:138
GLUtesselator::polygonData
void * polygonData
Definition: _tess:79
CachedVertex::coords
GLUdouble coords[3]
Definition: _tess:23
GLUhalfEdge::winding
int winding
Definition: mesh:116
GLUtesselator::boundaryOnly
GLUboolean boundaryOnly
Definition: _tess:61
TOOLS_GLU_TRUE
#define TOOLS_GLU_TRUE
Definition: _glu:82
__gl_noEndData
void GLUAPIENTRY __gl_noEndData(void *)
Definition: glutess:42
GLUdouble
double GLUdouble
Definition: _glu:16
__gl_meshTessellateInterior
int __gl_meshTessellateInterior(GLUmesh *mesh)
Definition: tessmono:133
__gl_renderCache
GLUboolean __gl_renderCache(GLUtesselator *tess)
Definition: render:418
GLUtesselator::mesh
GLUmesh * mesh
Definition: _tess:34
GLU_TESS_WINDING_NEGATIVE
#define GLU_TESS_WINDING_NEGATIVE
Definition: _glu:40
GLUfloat
float GLUfloat
Definition: _glu:19
__gl_renderMesh
void __gl_renderMesh(GLUtesselator *tess, GLUmesh *mesh)
Definition: render:59
static_MakeDormant
inline void static_MakeDormant(GLUtesselator *tess)
Definition: glutess:107
GLU_TESS_MISSING_BEGIN_POLYGON
#define GLU_TESS_MISSING_BEGIN_POLYGON
Definition: _glu:129
static_noError
inline void GLUAPIENTRY static_noError(GLUenum)
Definition: glutess:33
RequireState
#define RequireState(tess, s)
Definition: glutess:119
CALL_ERROR_OR_ERROR_DATA
#define CALL_ERROR_OR_ERROR_DATA(a)
Definition: _tess:128
static_noEnd
inline void GLUAPIENTRY static_noEnd(void)
Definition: glutess:32
gluTessBeginContour
GLUAPI void GLUAPIENTRY gluTessBeginContour(GLUtesselator *tess)
Definition: glutess:469
GLU_TESS_ERROR_DATA
#define GLU_TESS_ERROR_DATA
Definition: _glu:30
TOOLS_GLU_FALSE
#define TOOLS_GLU_FALSE
Definition: _glu:81
GLU_TESS_WINDING_ODD
#define GLU_TESS_WINDING_ODD
Definition: _glu:38
GLU_TESS_VERTEX
#define GLU_TESS_VERTEX
Definition: _glu:101
memInit
#define memInit
Definition: memalloc:43
GLUtesselator::env
jmp_buf env
Definition: _tess:89
GLU_TESS_MAX_CACHE
#define GLU_TESS_MAX_CACHE
Definition: _tess:20
GLU_OUT_OF_MEMORY
#define GLU_OUT_OF_MEMORY
Definition: _glu:95
GLUtesselator
Definition: _tess:27
GLUtesselator::windingRule
GLUenum windingRule
Definition: _tess:48
T_DORMANT
@ T_DORMANT
Definition: _tess:15
__gl_meshDiscardExterior
void __gl_meshDiscardExterior(GLUmesh *mesh)
Definition: tessmono:155
GLUtesselator::relTolerance
GLUdouble relTolerance
Definition: _tess:47
GLUvertex
Definition: mesh:82
GLUboolean
unsigned char GLUboolean
Definition: _glu:18
GLU_TESS_END_DATA
#define GLU_TESS_END_DATA
Definition: _glu:29
GLUvertex::coords
GLUdouble coords[3]
Definition: mesh:89
GLU_TESS_COORD_TOO_LARGE
#define GLU_TESS_COORD_TOO_LARGE
Definition: _glu:133
GLUtesselator::fatalError
GLUboolean fatalError
Definition: _tess:49
gluTessEndContour
GLUAPI void GLUAPIENTRY gluTessEndContour(GLUtesselator *tess)
Definition: glutess:486
__gl_meshMakeEdge
GLUhalfEdge * __gl_meshMakeEdge(GLUmesh *mesh)
Definition: mesh:451
GLU_TESS_BEGIN_DATA
#define GLU_TESS_BEGIN_DATA
Definition: _glu:27
GLU_INVALID_VALUE
#define GLU_INVALID_VALUE
Definition: _glu:94
GLU_TESS_EDGE_FLAG
#define GLU_TESS_EDGE_FLAG
Definition: _glu:104
GLUface
Definition: mesh:94
GLU_TESS_EDGE_FLAG_DATA
#define GLU_TESS_EDGE_FLAG_DATA
Definition: _glu:107
GLUhalfEdge::Org
GLUvertex * Org
Definition: mesh:111
static_EmptyCache
inline int static_EmptyCache(GLUtesselator *tess)
Definition: glutess:389
GLU_TESS_COMBINE
#define GLU_TESS_COMBINE
Definition: _glu:106
static_noVertex
inline void GLUAPIENTRY static_noVertex(void *)
Definition: glutess:31
__gl_noVertexData
void GLUAPIENTRY __gl_noVertexData(void *, void *)
Definition: glutess:41
__gl_meshNewMesh
GLUmesh * __gl_meshNewMesh(void)
Definition: mesh:782
__gl_noCombineData
void GLUAPIENTRY __gl_noCombineData(GLUdouble[3], void *[4], GLUfloat[4], void **, void *)
Definition: glutess:44
static_AddVertex
inline int static_AddVertex(GLUtesselator *tess, GLUdouble coords[3], void *data)
Definition: glutess:338
GLUtesselator::flagBoundary
GLUboolean flagBoundary
Definition: _tess:60
GLU_TESS_WINDING_NONZERO
#define GLU_TESS_WINDING_NONZERO
Definition: _glu:137
static_noBegin
inline void GLUAPIENTRY static_noBegin(GLUenum)
Definition: glutess:29
CachedVertex::data
void * data
Definition: _tess:24
__gl_meshCheckMesh
void __gl_meshCheckMesh(GLUmesh *mesh)
Definition: mesh:917
__gl_renderBoundary
void __gl_renderBoundary(GLUtesselator *tess, GLUmesh *mesh)
Definition: render:312
EdgePair
Definition: mesh:239
GLU_TESS_VERTEX_DATA
#define GLU_TESS_VERTEX_DATA
Definition: _glu:28
__gl_meshSetWindingNumber
int __gl_meshSetWindingNumber(GLUmesh *mesh, int value, GLUboolean keepOnlyBoundary)
Definition: tessmono:179
GLU_TESS_WINDING_RULE
#define GLU_TESS_WINDING_RULE
Definition: _glu:34
T_IN_CONTOUR
@ T_IN_CONTOUR
Definition: _tess:15
GLUenum
unsigned int GLUenum
Definition: _glu:14
GLU_INVALID_ENUM
#define GLU_INVALID_ENUM
Definition: _glu:93
GLU_TESS_MAX_COORD
#define GLU_TESS_MAX_COORD
Definition: _glu:90
static_noMesh
inline void GLUAPIENTRY static_noMesh(GLUmesh *)
Definition: glutess:36