Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygentess.h
Go to the documentation of this file.
00001 /* 00002 ** License Applicability. Except to the extent portions of this file are 00003 ** made subject to an alternative license as permitted in the SGI Free 00004 ** Software License B, Version 1.1 (the "License"), the contents of this 00005 ** file are subject only to the provisions of the License. You may not use 00006 ** this file except in compliance with the License. You may obtain a copy 00007 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 00008 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: 00009 ** 00010 ** http://oss.sgi.com/projects/FreeB 00011 ** 00012 ** Note that, as provided in the License, the Software is distributed on an 00013 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS 00014 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND 00015 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A 00016 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. 00017 ** 00018 ** Original Code. The Original Code is: OpenGL Sample Implementation, 00019 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, 00020 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc. 00021 ** Copyright in any portions created by third parties is as indicated 00022 ** elsewhere herein. All Rights Reserved. 00023 ** 00024 ** Additional Notice Provisions: The application programming interfaces 00025 ** established by SGI in conjunction with the Original Code are The 00026 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released 00027 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version 00028 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X 00029 ** Window System(R) (Version 1.3), released October 19, 1998. This software 00030 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation 00031 ** published by SGI, but has not been independently verified as being 00032 ** compliant with the OpenGL(R) version 1.2.1 Specification. 00033 ** 00034 */ 00035 /* 00036 ** Author: Eric Veach, July 1994. 00037 ** 00038 ** $Date: 2007-10-19 23:21:45 +0000 (Fri, 19 Oct 2007) $ $Revision: 1.1 $ 00039 ** $Header: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/glu32/libtess/tess.h,v 1.1 2004/02/02 16:39:15 navaraf Exp $ 00040 */ 00041 00042 #ifndef __tess_h_ 00043 #define __tess_h_ 00044 00045 #include <GL/glu.h> 00046 #include <setjmp.h> 00047 #include "mesh.h" 00048 #include "dict.h" 00049 #include "priorityq.h" 00050 00051 #ifndef GLAPIENTRY 00052 #define GLAPIENTRY APIENTRY 00053 #endif 00054 00055 /* The begin/end calls must be properly nested. We keep track of 00056 * the current state to enforce the ordering. 00057 */ 00058 enum TessState { T_DORMANT, T_IN_POLYGON, T_IN_CONTOUR }; 00059 00060 /* We cache vertex data for single-contour polygons so that we can 00061 * try a quick-and-dirty decomposition first. 00062 */ 00063 #define TESS_MAX_CACHE 100 00064 00065 typedef struct CachedVertex { 00066 GLdouble coords[3]; 00067 void *data; 00068 } CachedVertex; 00069 00070 struct GLUtesselator { 00071 00072 /*** state needed for collecting the input data ***/ 00073 00074 enum TessState state; /* what begin/end calls have we seen? */ 00075 00076 GLUhalfEdge *lastEdge; /* lastEdge->Org is the most recent vertex */ 00077 GLUmesh *mesh; /* stores the input contours, and eventually 00078 the tessellation itself */ 00079 00080 void (GLAPIENTRY *callError)( GLenum errnum ); 00081 00082 /*** state needed for projecting onto the sweep plane ***/ 00083 00084 GLdouble normal[3]; /* user-specified normal (if provided) */ 00085 GLdouble sUnit[3]; /* unit vector in s-direction (debugging) */ 00086 GLdouble tUnit[3]; /* unit vector in t-direction (debugging) */ 00087 00088 /*** state needed for the line sweep ***/ 00089 00090 GLdouble relTolerance; /* tolerance for merging features */ 00091 GLenum windingRule; /* rule for determining polygon interior */ 00092 GLboolean fatalError; /* fatal error: needed combine callback */ 00093 00094 Dict *dict; /* edge dictionary for sweep line */ 00095 PriorityQ *pq; /* priority queue of vertex events */ 00096 GLUvertex *event; /* current sweep event being processed */ 00097 00098 void (GLAPIENTRY *callCombine)( GLdouble coords[3], void *data[4], 00099 GLfloat weight[4], void **outData ); 00100 00101 /*** state needed for rendering callbacks (see render.c) ***/ 00102 00103 GLboolean flagBoundary; /* mark boundary edges (use EdgeFlag) */ 00104 GLboolean boundaryOnly; /* Extract contours, not triangles */ 00105 GLUface *lonelyTriList; 00106 /* list of triangles which could not be rendered as strips or fans */ 00107 00108 void (GLAPIENTRY *callBegin)( GLenum type ); 00109 void (GLAPIENTRY *callEdgeFlag)( GLboolean boundaryEdge ); 00110 void (GLAPIENTRY *callVertex)( void *data ); 00111 void (GLAPIENTRY *callEnd)( void ); 00112 void (GLAPIENTRY *callMesh)( GLUmesh *mesh ); 00113 00114 00115 /*** state needed to cache single-contour polygons for renderCache() */ 00116 00117 GLboolean emptyCache; /* empty cache on next vertex() call */ 00118 int cacheCount; /* number of cached vertices */ 00119 CachedVertex cache[TESS_MAX_CACHE]; /* the vertex data */ 00120 00121 /*** rendering callbacks that also pass polygon data ***/ 00122 void (GLAPIENTRY *callBeginData)( GLenum type, void *polygonData ); 00123 void (GLAPIENTRY *callEdgeFlagData)( GLboolean boundaryEdge, 00124 void *polygonData ); 00125 void (GLAPIENTRY *callVertexData)( void *data, void *polygonData ); 00126 void (GLAPIENTRY *callEndData)( void *polygonData ); 00127 void (GLAPIENTRY *callErrorData)( GLenum errnum, void *polygonData ); 00128 void (GLAPIENTRY *callCombineData)( GLdouble coords[3], void *data[4], 00129 GLfloat weight[4], void **outData, 00130 void *polygonData ); 00131 00132 jmp_buf env; /* place to jump to when memAllocs fail */ 00133 00134 void *polygonData; /* client data for current polygon */ 00135 }; 00136 00137 void GLAPIENTRY __gl_noBeginData( GLenum type, void *polygonData ); 00138 void GLAPIENTRY __gl_noEdgeFlagData( GLboolean boundaryEdge, void *polygonData ); 00139 void GLAPIENTRY __gl_noVertexData( void *data, void *polygonData ); 00140 void GLAPIENTRY __gl_noEndData( void *polygonData ); 00141 void GLAPIENTRY __gl_noErrorData( GLenum errnum, void *polygonData ); 00142 void GLAPIENTRY __gl_noCombineData( GLdouble coords[3], void *data[4], 00143 GLfloat weight[4], void **outData, 00144 void *polygonData ); 00145 00146 #define CALL_BEGIN_OR_BEGIN_DATA(a) \ 00147 if (tess->callBeginData != &__gl_noBeginData) \ 00148 (*tess->callBeginData)((a),tess->polygonData); \ 00149 else (*tess->callBegin)((a)); 00150 00151 #define CALL_VERTEX_OR_VERTEX_DATA(a) \ 00152 if (tess->callVertexData != &__gl_noVertexData) \ 00153 (*tess->callVertexData)((a),tess->polygonData); \ 00154 else (*tess->callVertex)((a)); 00155 00156 #define CALL_EDGE_FLAG_OR_EDGE_FLAG_DATA(a) \ 00157 if (tess->callEdgeFlagData != &__gl_noEdgeFlagData) \ 00158 (*tess->callEdgeFlagData)((a),tess->polygonData); \ 00159 else (*tess->callEdgeFlag)((a)); 00160 00161 #define CALL_END_OR_END_DATA() \ 00162 if (tess->callEndData != &__gl_noEndData) \ 00163 (*tess->callEndData)(tess->polygonData); \ 00164 else (*tess->callEnd)(); 00165 00166 #define CALL_COMBINE_OR_COMBINE_DATA(a,b,c,d) \ 00167 if (tess->callCombineData != &__gl_noCombineData) \ 00168 (*tess->callCombineData)((a),(b),(c),(d),tess->polygonData); \ 00169 else (*tess->callCombine)((a),(b),(c),(d)); 00170 00171 #define CALL_ERROR_OR_ERROR_DATA(a) \ 00172 if (tess->callErrorData != &__gl_noErrorData) \ 00173 (*tess->callErrorData)((a),tess->polygonData); \ 00174 else (*tess->callError)((a)); 00175 00176 #endif Generated on Sat May 26 2012 04:22:21 for ReactOS by
1.7.6.1
|