63static int STAT_num_of_triangles=0;
64static int STAT_num_of_eval_vertices=0;
65static int STAT_num_of_quad_strips=0;
74extern "C" {
void evalUStripExt(
int n_upper,
REAL v_upper,
REAL* upper_val,
75 int n_lower,
REAL v_lower,
REAL* lower_val);}
77extern "C" {
void evalVStripExt(
int n_left,
REAL u_left,
REAL* left_val,
78 int n_right,
REAL u_right,
REAL* right_val);
126 beginCallBackN =
NULL;
128 vertexCallBackN =
NULL;
129 normalCallBackN =
NULL;
130 colorCallBackN =
NULL;
131 texcoordCallBackN =
NULL;
132 beginCallBackData =
NULL;
133 endCallBackData =
NULL;
134 vertexCallBackData =
NULL;
135 normalCallBackData =
NULL;
136 colorCallBackData =
NULL;
137 texcoordCallBackData =
NULL;
197#ifdef USE_INTERNAL_EVAL
345#ifdef USE_INTERNAL_EVAL
347 n_lower, v_lower, lower_val);
351 evalUStripExt(n_upper, v_upper, upper_val,
352 n_lower, v_lower, lower_val);
369 if(upper_val[0] <= lower_val[0])
374 leftMostV[0] = upper_val[0];
375 leftMostV[1] = v_upper;
382 leftMostV[0] = lower_val[0];
383 leftMostV[1] = v_lower;
399 coord2f(leftMostV[0], leftMostV[1]);
419 coord2f(leftMostV[0], leftMostV[1]);
423 for(
k=n_upper-1;
k>=
i;
k--)
436 if(upper_val[
i] <= lower_val[
j])
450 if(upper_val[
k] > lower_val[
j])
465 coord2f(leftMostV[0], leftMostV[1]);
475 leftMostV[0] = upper_val[
k];
476 leftMostV[1] = v_upper;
487 coord2f(leftMostV[0], leftMostV[1]);
498 if(lower_val[
k] >= upper_val[
i])
511 leftMostV[0] = lower_val[
j-1];
512 leftMostV[1] = v_lower;
532#ifdef USE_INTERNAL_EVAL
534 n_right, u_right, right_val);
538 evalVStripExt(n_left, u_left, left_val,
539 n_right, u_right, right_val);
556 if(left_val[0] <= right_val[0])
561 botMostV[0] = u_left;
562 botMostV[1] = left_val[0];
569 botMostV[0] = u_right;
570 botMostV[1] = right_val[0];
585 coord2f(botMostV[0], botMostV[1]);
602 coord2f(botMostV[0], botMostV[1]);
606 for(
k=n_left-1;
k>=
i;
k--)
619 if(left_val[
i] <= right_val[
j])
633 if(left_val[
k] > right_val[
j])
648 coord2f(botMostV[0], botMostV[1]);
658 botMostV[0] = u_left;
659 botMostV[1] = left_val[
k];
670 coord2f(botMostV[0], botMostV[1]);
681 if(right_val[
k] >= left_val[
i])
694 botMostV[0] = u_right;
695 botMostV[1] = right_val[
j-1];
720 STAT_num_of_quad_strips++;
762 if(normalCallBackN !=
NULL ||
763 normalCallBackData !=
NULL)
854 fprintf(
stderr,
"num_vertices=%i,num_triangles=%i,num_quads_strips=%i\n", STAT_num_of_eval_vertices,STAT_num_of_triangles,STAT_num_of_quad_strips);
884#ifdef USE_INTERNAL_EVAL
886 (
int) _ustride, (
int) _uorder, (
REAL) _vlower,
887 (
REAL) _vupper, (
int) _vstride, (
int) _vorder,
914 bezierPatchMeshPutPatch(
global_bpm, (
int) _type, _ulower, _uupper,(
int) _ustride,(
int) _uorder,_vlower, _vupper, (
int) _vstride, (
int) _vorder, pts);
919 bezierPatchMeshPutPatch(
temp, (
int) _type, _ulower, _uupper,(
int) _ustride,(
int) _uorder,_vlower, _vupper, (
int) _vstride, (
int) _vorder, pts);
952#ifdef USE_INTERNAL_EVAL
953 inEvalMesh2((
int)umin, (
int)vmin, (
int)umax, (
int)vmax);
980 for(
i=umin;
i<umax;
i++){
985 for(
j=vmax;
j>=vmin;
j--){
996 for(
i=vmin;
i<vmax;
i++){
1001 for(
j=umax;
j>=umin;
j--){
1033 STAT_num_of_quad_strips += (umax-umin)*(vmax-vmin);
1075#ifdef USE_INTERNAL_EVAL
1098 STAT_num_of_eval_vertices++;
1112#ifdef USE_INTERNAL_EVAL
1127 STAT_num_of_eval_vertices++;
1239 if(beginCallBackData)
1241 else if(beginCallBackN)
1242 beginCallBackN(
which);
1249 endCallBackData(
data);
1250 else if(endCallBackN)
1257 if(vertexCallBackData)
1258 vertexCallBackData(vert,
data);
1259 else if(vertexCallBackN)
1260 vertexCallBackN(vert);
1267 if(normalCallBackData)
1269 else if(normalCallBackN)
1276 if(colorCallBackData)
1278 else if(colorCallBackN)
1279 colorCallBackN(
color);
1285 if(texcoordCallBackData)
1286 texcoordCallBackData(texcoord,
data);
1287 else if(texcoordCallBackN)
1288 texcoordCallBackN(texcoord);
void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v)
void bezierPatchMeshEndStrip(bezierPatchMesh *bpm)
void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints)
void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type)
void bezierPatchMeshListDelete(bezierPatchMesh *list)
bezierPatchMesh * bezierPatchMeshListInsert(bezierPatchMesh *list, bezierPatchMesh *bpm)
bezierPatchMesh * bezierPatchMeshMake2(int size_UVarray, int size_length_array)
void range2f(long, REAL *, REAL *)
void newtmeshvert(REAL, REAL)
surfEvalMachine em_normal
void inBPMListEvalEM(bezierPatchMesh *list)
void evalVStrip(int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)
void vertexCallBack(const GLfloat *vert, void *data)
void texcoordCallBack(const GLfloat *texcoord, void *data)
bezierPatchMesh * global_bpm
void domain2f(REAL, REAL, REAL, REAL)
void inEvalCoord2f(REAL u, REAL v)
void endCallBack(void *data)
void putCallBack(GLenum which, _GLUfuncptr fn)
void LOD_eval_list(int level)
void beginCallBack(GLenum type, void *data)
void inEvalUStrip(int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
void mapmesh2f(long, long, long, long, long)
surfEvalMachine em_vertex
void evalcoord2f(long, REAL, REAL)
void evalpoint2i(long, long)
void colorCallBack(const GLfloat *color, void *data)
void inEvalVStrip(int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)
void normalCallBack(const GLfloat *normal, void *data)
void inMap2f(int k, REAL ulower, REAL uupper, int ustride, int uorder, REAL vlower, REAL vupper, int vstride, int vorder, REAL *ctlPoints)
void inMapGrid2f(int nu, REAL u0, REAL u1, int nv, REAL v0, REAL v1)
void map2f(long, REAL, REAL, long, long, REAL, REAL, long, long, REAL *)
virtual ~OpenGLSurfaceEvaluator(void)
void inEvalPoint2(int i, int j)
void mapgrid2f(long, REAL, REAL, long, REAL, REAL)
void polymode(long style)
StoredVertex * vertexCache[VERTEX_CACHE_SIZE]
surfEvalMachine em_texcoord
void evalUStrip(int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
void inEvalMesh2(int lowU, int lowV, int highU, int highV)
void saveEvalPoint(long x, long y)
void invoke(OpenGLSurfaceEvaluator *eval)
void saveEvalCoord(REAL x, REAL y)
#define GLU_NURBS_TEXTURE_COORD
#define GLU_NURBS_VERTEX_DATA
#define GLU_NURBS_TEXTURE_COORD_DATA
#define GLU_NURBS_COLOR_DATA
#define GLU_NURBS_BEGIN_DATA
#define GLU_NURBS_END_DATA
#define GLU_NURBS_NORMAL_DATA
GLAPI void GLAPIENTRY glEvalCoord2f(GLfloat u, GLfloat v)
GLAPI void GLAPIENTRY glEnable(GLenum cap)
GLAPI void GLAPIENTRY glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
#define GL_MAP2_TEXTURE_COORD_2
#define GL_FRONT_AND_BACK
#define GL_MAP2_TEXTURE_COORD_4
GLAPI void GLAPIENTRY glMap2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points)
GLuint GLuint GLsizei GLenum type
GLAPI void GLAPIENTRY glPolygonMode(GLenum face, GLenum mode)
GLAPI void GLAPIENTRY glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
GLAPI void GLAPIENTRY glBegin(GLenum mode)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLAPI void GLAPIENTRY glEvalPoint2(GLint i, GLint j)
GLAPI void GLAPIENTRY glEnd(void)
#define GL_MAP2_TEXTURE_COORD_1
#define GL_MAP2_TEXTURE_COORD_3
GLAPI void GLAPIENTRY glPopAttrib(void)
GLAPI void GLAPIENTRY glDisable(GLenum cap)
GLAPI void GLAPIENTRY glGetIntegerv(GLenum pname, GLint *params)
GLAPI void GLAPIENTRY glPushAttrib(GLbitfield mask)
GLfloat GLfloat GLfloat v2
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define VERTEX_CACHE_SIZE
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
bezierPatch * bpatch_color
bezierPatch * bpatch_texcoord
bezierPatch * bpatch_normal
static GLenum _GLUfuncptr fn
void(WINAPI * _GLUfuncptr)(void)