Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
render.h File Reference
#include "mesh.h"
+ Include dependency graph for render.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void __gl_renderMesh (GLUtesselator *tess, GLUmesh *mesh)
 
void __gl_renderBoundary (GLUtesselator *tess, GLUmesh *mesh)
 
GLboolean __gl_renderCache (GLUtesselator *tess)
 

Function Documentation

◆ __gl_renderBoundary()

void __gl_renderBoundary ( GLUtesselator tess,
GLUmesh mesh 
)
340{
341 GLUface *f;
342 GLUhalfEdge *e;
343
344 for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
345 if( f->inside ) {
347 e = f->anEdge;
348 do {
350 e = e->Lnext;
351 } while( e != f->anEdge );
353 }
354 }
355}
#define GL_LINE_LOOP
Definition glu-libtess.h:74
GLUhalfEdge * anEdge
Definition mesh.h:129
GLUhalfEdge * Lnext
Definition mesh.h:142
GLUvertex * Org
Definition mesh.h:143
GLUface fHead
Definition mesh.h:165
void * data
Definition mesh.h:118
GLboolean inside
Definition mesh.h:135
GLUface * next
Definition mesh.h:127
Definition mesh.h:138
Definition mesh.h:126
#define CALL_BEGIN_OR_BEGIN_DATA(a)
Definition tess.h:135
#define CALL_VERTEX_OR_VERTEX_DATA(a)
Definition tess.h:140
#define CALL_END_OR_END_DATA()
Definition tess.h:150

References GLUface::anEdge, CALL_BEGIN_OR_BEGIN_DATA, CALL_END_OR_END_DATA, CALL_VERTEX_OR_VERTEX_DATA, GLUvertex::data, GLUmesh::fHead, GL_LINE_LOOP, GLUface::inside, GLUhalfEdge::Lnext, GLUface::next, and GLUhalfEdge::Org.

Referenced by gluTessEndPolygon().

+ Here is the caller graph for this function:

◆ __gl_renderCache()

GLboolean __gl_renderCache ( GLUtesselator tess)
442{
443 CachedVertex *v0 = tess->cache;
444 CachedVertex *vn = v0 + tess->cacheCount;
445 CachedVertex *vc;
446 GLdouble norm[3];
447 int sign;
448
449 if( tess->cacheCount < 3 ) {
450 /* Degenerate contour -- no output */
451 return TRUE;
452 }
453
454 norm[0] = tess->normal[0];
455 norm[1] = tess->normal[1];
456 norm[2] = tess->normal[2];
457 if( norm[0] == 0 && norm[1] == 0 && norm[2] == 0 ) {
458 ComputeNormal( tess, norm, FALSE );
459 }
460
461 sign = ComputeNormal( tess, norm, TRUE );
462 if( sign == SIGN_INCONSISTENT ) {
463 /* Fan triangles did not have a consistent orientation */
464 return FALSE;
465 }
466 if( sign == 0 ) {
467 /* All triangles were degenerate */
468 return TRUE;
469 }
470
471 /* Make sure we do the right thing for each winding rule */
472 switch( tess->windingRule ) {
475 break;
477 if( sign < 0 ) return TRUE;
478 break;
480 if( sign > 0 ) return TRUE;
481 break;
483 return TRUE;
484 }
485
487 : (tess->cacheCount > 3) ? GL_TRIANGLE_FAN
488 : GL_TRIANGLES );
489
491 if( sign > 0 ) {
492 for( vc = v0+1; vc < vn; ++vc ) {
494 }
495 } else {
496 for( vc = vn-1; vc > v0; --vc ) {
498 }
499 }
501 return TRUE;
502}
EIGEN_DEVICE_FUNC const SignReturnType sign() const
Definition ArrayCwiseUnaryOps.h:184
#define GLU_TESS_WINDING_NONZERO
Definition glu-libtess.h:156
#define GLU_TESS_WINDING_POSITIVE
Definition glu-libtess.h:157
#define GL_TRIANGLE_FAN
Definition glu-libtess.h:77
#define GLU_TESS_WINDING_NEGATIVE
Definition glu-libtess.h:158
double GLdouble
Definition glu-libtess.h:65
#define GL_TRIANGLES
Definition glu-libtess.h:75
#define GLU_TESS_WINDING_ODD
Definition glu-libtess.h:155
#define GLU_TESS_WINDING_ABS_GEQ_TWO
Definition glu-libtess.h:159
#define SIGN_INCONSISTENT
Definition render.c:360
#define TRUE
Definition render.c:43
#define FALSE
Definition render.c:46
static int ComputeNormal(GLUtesselator *tess, GLdouble norm[3], int check)
Definition render.c:362
int cacheCount
Definition tess.h:107
GLdouble normal[3]
Definition tess.h:73
GLboolean boundaryOnly
Definition tess.h:93
GLenum windingRule
Definition tess.h:80
CachedVertex cache[TESS_MAX_CACHE]
Definition tess.h:108
void * data
Definition tess.h:56
Definition tess.h:54

References GLUtesselator::boundaryOnly, GLUtesselator::cache, GLUtesselator::cacheCount, CALL_BEGIN_OR_BEGIN_DATA, CALL_END_OR_END_DATA, CALL_VERTEX_OR_VERTEX_DATA, ComputeNormal(), CachedVertex::data, FALSE, GL_LINE_LOOP, GL_TRIANGLE_FAN, GL_TRIANGLES, GLU_TESS_WINDING_ABS_GEQ_TWO, GLU_TESS_WINDING_NEGATIVE, GLU_TESS_WINDING_NONZERO, GLU_TESS_WINDING_ODD, GLU_TESS_WINDING_POSITIVE, GLUtesselator::normal, sign(), SIGN_INCONSISTENT, TRUE, and GLUtesselator::windingRule.

Referenced by gluTessEndPolygon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __gl_renderMesh()

void __gl_renderMesh ( GLUtesselator tess,
GLUmesh mesh 
)
83{
84 GLUface *f;
85
86 /* Make a list of separate triangles so we can render them all at once */
87 tess->lonelyTriList = NULL;
88
89 for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
90 f->marked = FALSE;
91 }
92 for( f = mesh->fHead.next; f != &mesh->fHead; f = f->next ) {
93
94 /* We examine all faces in an arbitrary order. Whenever we find
95 * an unprocessed face F, we output a group of faces including F
96 * whose size is maximum.
97 */
98 if( f->inside && ! f->marked ) {
99 RenderMaximumFaceGroup( tess, f );
100 assert( f->marked );
101 }
102 }
103 if( tess->lonelyTriList != NULL ) {
105 tess->lonelyTriList = NULL;
106 }
107}
GLboolean marked
Definition mesh.h:134
static void RenderMaximumFaceGroup(GLUtesselator *tess, GLUface *fOrig)
Definition render.c:110
static void RenderLonelyTriangles(GLUtesselator *tess, GLUface *head)
Definition render.c:248
GLUface * lonelyTriList
Definition tess.h:94

References FALSE, GLUmesh::fHead, GLUface::inside, GLUtesselator::lonelyTriList, GLUface::marked, GLUface::next, RenderLonelyTriangles(), and RenderMaximumFaceGroup().

Referenced by gluTessEndPolygon().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: