ReactOS 0.4.15-dev-5669-g09dde2c
OpenGLSurfaceEvaluator Class Reference

#include <glsurfeval.h>

Inheritance diagram for OpenGLSurfaceEvaluator:
Collaboration diagram for OpenGLSurfaceEvaluator:

Public Member Functions

 OpenGLSurfaceEvaluator ()
 
virtual ~OpenGLSurfaceEvaluator (void)
 
void polymode (long style)
 
void range2f (long, REAL *, REAL *)
 
void domain2f (REAL, REAL, REAL, REAL)
 
void addMap (SurfaceMap *)
 
void enable (long)
 
void disable (long)
 
void bgnmap2f (long)
 
void map2f (long, REAL, REAL, long, long, REAL, REAL, long, long, REAL *)
 
void mapgrid2f (long, REAL, REAL, long, REAL, REAL)
 
void mapmesh2f (long, long, long, long, long)
 
void evalcoord2f (long, REAL, REAL)
 
void evalpoint2i (long, long)
 
void endmap2f (void)
 
void bgnline (void)
 
void endline (void)
 
void bgnclosedline (void)
 
void endclosedline (void)
 
void bgntmesh (void)
 
void swaptmesh (void)
 
void endtmesh (void)
 
void bgnqstrip (void)
 
void endqstrip (void)
 
void bgntfan (void)
 
void endtfan (void)
 
void evalUStrip (int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
 
void evalVStrip (int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)
 
void coord2f (REAL, REAL)
 
void point2i (long, long)
 
void newtmeshvert (REAL, REAL)
 
void newtmeshvert (long, long)
 
void putCallBack (GLenum which, _GLUfuncptr fn)
 
int get_vertices_call_back ()
 
void put_vertices_call_back (int flag)
 
void put_callback_auto_normal (int flag)
 
int get_callback_auto_normal ()
 
void set_callback_userData (void *data)
 
void LOD_eval_list (int level)
 
- Public Member Functions inherited from BasicSurfaceEvaluator
virtual ~BasicSurfaceEvaluator ()
 
virtual void range2f (long, REAL *, REAL *)
 
virtual void domain2f (REAL, REAL, REAL, REAL)
 
virtual void enable (long)
 
virtual void disable (long)
 
virtual void bgnmap2f (long)
 
virtual void map2f (long, REAL, REAL, long, long, REAL, REAL, long, long, REAL *)
 
virtual void mapgrid2f (long, REAL, REAL, long, REAL, REAL)
 
virtual void mapmesh2f (long, long, long, long, long)
 
virtual void evalcoord2f (long, REAL, REAL)
 
virtual void evalpoint2i (long, long)
 
virtual void endmap2f (void)
 
virtual void polymode (long)
 
virtual void bgnline (void)
 
virtual void endline (void)
 
virtual void bgnclosedline (void)
 
virtual void endclosedline (void)
 
virtual void bgntmesh (void)
 
virtual void swaptmesh (void)
 
virtual void endtmesh (void)
 
virtual void bgnqstrip (void)
 
virtual void endqstrip (void)
 
virtual void bgntfan (void)
 
virtual void endtfan (void)
 
virtual void evalUStrip (int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)=0
 
virtual void evalVStrip (int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)=0
 
virtual void inDoEvalCoord2NOGE (REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0
 
virtual void inDoEvalCoord2NOGE_BU (REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0
 
virtual void inDoEvalCoord2NOGE_BV (REAL u, REAL v, REAL *ret_point, REAL *ret_normal)=0
 
virtual void inPreEvaluateBV_intfac (REAL v)=0
 
virtual void inPreEvaluateBU_intfac (REAL u)=0
 
- Public Member Functions inherited from CachingEvaluator
virtual ~CachingEvaluator ()
 
virtual int canRecord (void)
 
virtual int canPlayAndRecord (void)
 
virtual int createHandle (int handle)
 
virtual void beginOutput (ServiceMode, int handle)
 
virtual void endOutput (void)
 
virtual void discardRecording (int handle)
 
virtual void playRecording (int handle)
 

Private Member Functions

 void (GLAPIENTRY *beginCallBackN)(GLenum type)
 
 void (GLAPIENTRY *endCallBackN)(void)
 
 void (GLAPIENTRY *vertexCallBackN)(const GLfloat *vert)
 
 void (GLAPIENTRY *normalCallBackN)(const GLfloat *normal)
 
 void (GLAPIENTRY *colorCallBackN)(const GLfloat *color)
 
 void (GLAPIENTRY *texcoordCallBackN)(const GLfloat *texcoord)
 
 void (GLAPIENTRY *beginCallBackData)(GLenum type
 
 void (GLAPIENTRY *endCallBackData)(void *data)
 
 void (GLAPIENTRY *vertexCallBackData)(const GLfloat *vert
 
 void (GLAPIENTRY *normalCallBackData)(const GLfloat *normal
 
 void (GLAPIENTRY *colorCallBackData)(const GLfloat *color
 
 void (GLAPIENTRY *texcoordCallBackData)(const GLfloat *texcoord
 
void beginCallBack (GLenum type, void *data)
 
void endCallBack (void *data)
 
void vertexCallBack (const GLfloat *vert, void *data)
 
void normalCallBack (const GLfloat *normal, void *data)
 
void colorCallBack (const GLfloat *color, void *data)
 
void texcoordCallBack (const GLfloat *texcoord, void *data)
 
void LOD_triangle (REAL A[2], REAL B[2], REAL C[2], int level)
 
void LOD_eval (int num_vert, REAL *verts, int type, int level)
 
void inDoDomain2WithDerivs (int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
 
void inPreEvaluate (int order, REAL vprime, REAL *coeff)
 
void inPreEvaluateWithDeriv (int order, REAL vprime, REAL *coeff, REAL *coeffDeriv)
 
void inComputeFirstPartials (REAL *p, REAL *pu, REAL *pv)
 
void inComputeNormal2 (REAL *pu, REAL *pv, REAL *n)
 
void inDoEvalCoord2 (REAL u, REAL v, REAL *retPoint, REAL *retNormal)
 
void inDoEvalCoord2NOGE (REAL u, REAL v, REAL *retPoint, REAL *retNormal)
 
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 inEvalMesh2 (int lowU, int lowV, int highU, int highV)
 
void inEvalPoint2 (int i, int j)
 
void inEvalCoord2f (REAL u, REAL v)
 
void inEvalULine (int n_points, REAL v, REAL *u_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3])
 
void inEvalVLine (int n_points, REAL u, REAL *v_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3])
 
void inEvalUStrip (int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
 
void inEvalVStrip (int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)
 
void inPreEvaluateBV (int k, int uorder, int vorder, REAL vprime, REAL *baseData)
 
void inPreEvaluateBU (int k, int uorder, int vorder, REAL uprime, REAL *baseData)
 
void inPreEvaluateBV_intfac (REAL v)
 
void inPreEvaluateBU_intfac (REAL u)
 
void inDoDomain2WithDerivsBV (int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
 
void inDoDomain2WithDerivsBU (int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
 
void inDoEvalCoord2NOGE_BV (REAL u, REAL v, REAL *retPoint, REAL *retNormal)
 
void inDoEvalCoord2NOGE_BU (REAL u, REAL v, REAL *retPoint, REAL *retNormal)
 
void inBPMEval (bezierPatchMesh *bpm)
 
void inBPMListEval (bezierPatchMesh *list)
 
void inMap2fEM (int which, int dimension, REAL ulower, REAL uupper, int ustride, int uorder, REAL vlower, REAL vupper, int vstride, int vorder, REAL *ctlPoints)
 
void inDoDomain2WithDerivsEM (surfEvalMachine *em, REAL u, REAL v, REAL *retPoint, REAL *retdu, REAL *retdv)
 
void inDoDomain2EM (surfEvalMachine *em, REAL u, REAL v, REAL *retPoint)
 
void inDoEvalCoord2EM (REAL u, REAL v)
 
void inBPMEvalEM (bezierPatchMesh *bpm)
 
void inBPMListEvalEM (bezierPatchMesh *list)
 

Private Attributes

StoredVertexvertexCache [VERTEX_CACHE_SIZE]
 
int tmeshing
 
int which
 
int vcount
 
GLint gl_polygon_mode [2]
 
bezierPatchMeshglobal_bpm
 
int output_triangles
 
voiddata
 
voiduserData
 
int LOD_eval_level
 
int global_uorder
 
int global_vorder
 
REAL global_uprime
 
REAL global_vprime
 
REAL global_vprime_BV
 
REAL global_uprime_BU
 
int global_uorder_BV
 
int global_vorder_BV
 
int global_uorder_BU
 
int global_vorder_BU
 
REAL global_ucoeff [IN_MAX_BEZIER_ORDER]
 
REAL global_vcoeff [IN_MAX_BEZIER_ORDER]
 
REAL global_ucoeffDeriv [IN_MAX_BEZIER_ORDER]
 
REAL global_vcoeffDeriv [IN_MAX_BEZIER_ORDER]
 
REAL global_BV [IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
 
REAL global_PBV [IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
 
REAL global_BU [IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
 
REAL global_PBU [IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
 
REALglobal_baseData
 
int global_ev_k
 
REAL global_ev_u1
 
REAL global_ev_u2
 
int global_ev_ustride
 
int global_ev_uorder
 
REAL global_ev_v1
 
REAL global_ev_v2
 
int global_ev_vstride
 
int global_ev_vorder
 
REAL global_ev_ctlPoints [IN_MAX_BEZIER_ORDER *IN_MAX_BEZIER_ORDER *IN_MAX_DIMENSION]
 
REAL global_grid_u0
 
REAL global_grid_u1
 
int global_grid_nu
 
REAL global_grid_v0
 
REAL global_grid_v1
 
int global_grid_nv
 
surfEvalMachine em_vertex
 
surfEvalMachine em_normal
 
surfEvalMachine em_color
 
surfEvalMachine em_texcoord
 
int auto_normal_flag
 
int callback_auto_normal
 
int vertex_flag
 
int normal_flag
 
int color_flag
 
int texcoord_flag
 

Additional Inherited Members

- Public Types inherited from CachingEvaluator
enum  ServiceMode { play , record , playAndRecord }
 

Detailed Description

Definition at line 100 of file glsurfeval.h.

Constructor & Destructor Documentation

◆ OpenGLSurfaceEvaluator()

OpenGLSurfaceEvaluator::OpenGLSurfaceEvaluator ( )

Definition at line 99 of file glsurfeval.cc.

100{
101 int i;
102
103 for (i=0; i<VERTEX_CACHE_SIZE; i++) {
105 }
106 tmeshing = 0;
107 which = 0;
108 vcount = 0;
109
110 global_uorder = 0;
111 global_vorder = 0;
112 global_uprime = -1.0;
113 global_vprime = -1.0;
114 global_vprime_BV = -1.0;
115 global_uprime_BU = -1.0;
121
123 output_triangles = 0; //don't output triangles by default
124
125 //no default callback functions
126 beginCallBackN = NULL;
127 endCallBackN = 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;
138
139 userData = NULL;
140
142 callback_auto_normal = 0; //default of GLU_CALLBACK_AUTO_NORMAL is 0
143 vertex_flag = 0;
144 normal_flag = 0;
145 color_flag = 0;
146 texcoord_flag = 0;
147
148 em_vertex.uprime = -1.0;
149 em_vertex.vprime = -1.0;
150 em_normal.uprime = -1.0;
151 em_normal.vprime = -1.0;
152 em_color.uprime = -1.0;
153 em_color.vprime = -1.0;
154 em_texcoord.uprime = -1.0;
155 em_texcoord.vprime = -1.0;
156
157#ifdef USE_LOD
158 LOD_eval_level = 1;
159#endif
160}
surfEvalMachine em_normal
Definition: glsurfeval.h:350
surfEvalMachine em_color
Definition: glsurfeval.h:351
bezierPatchMesh * global_bpm
Definition: glsurfeval.h:188
surfEvalMachine em_vertex
Definition: glsurfeval.h:349
StoredVertex * vertexCache[VERTEX_CACHE_SIZE]
Definition: glsurfeval.h:180
surfEvalMachine em_texcoord
Definition: glsurfeval.h:352
#define NULL
Definition: types.h:112
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
Definition: glfuncs.h:248
#define VERTEX_CACHE_SIZE
Definition: glsurfeval.h:52

◆ ~OpenGLSurfaceEvaluator()

OpenGLSurfaceEvaluator::~OpenGLSurfaceEvaluator ( void  )
virtual

Definition at line 162 of file glsurfeval.cc.

163{
164 for (int ii= 0; ii< VERTEX_CACHE_SIZE; ii++) {
165 delete vertexCache[ii];
166 vertexCache[ii]= 0;
167 }
168}

Member Function Documentation

◆ addMap()

void OpenGLSurfaceEvaluator::addMap ( SurfaceMap *  )
inline

Definition at line 107 of file glsurfeval.h.

107{ }

◆ beginCallBack()

void OpenGLSurfaceEvaluator::beginCallBack ( GLenum  type,
void data 
)
private

Definition at line 1237 of file glsurfeval.cc.

1238{
1239 if(beginCallBackData)
1240 beginCallBackData(which, data);
1241 else if(beginCallBackN)
1242 beginCallBackN(which);
1243}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

Referenced by inBPMEval(), and inBPMEvalEM().

◆ bgnclosedline()

void OpenGLSurfaceEvaluator::bgnclosedline ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 268 of file glsurfeval.cc.

269{
272 else
274}
void bezierPatchMeshBeginStrip(bezierPatchMesh *bpm, GLenum type)
unsigned int GLenum
Definition: gl.h:150
GLAPI void GLAPIENTRY glBegin(GLenum mode)
#define GL_LINE_LOOP
Definition: gl.h:192

◆ bgnline()

void OpenGLSurfaceEvaluator::bgnline ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 240 of file glsurfeval.cc.

241{
244 else
246}
#define GL_LINE_STRIP
Definition: gl.h:193

◆ bgnmap2f()

void OpenGLSurfaceEvaluator::bgnmap2f ( long  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 739 of file glsurfeval.cc.

740{
742 {
743 /*deallocate the space which may has been
744 *allocated by global_bpm previously
745 */
746 if(global_bpm != NULL) {
749 }
750
751
752 /*
753 auto_normal_flag = 1; //always output normal in callback mode.
754 //we could have used the following code,
755 //but Inspector doesn't have gl context
756 //before it calls tessellator.
757 //this way is temporary.
758 */
759 //NEWCALLBACK
760 //if one of the two normal callback functions are set,
761 //then set
762 if(normalCallBackN != NULL ||
763 normalCallBackData != NULL)
765 else
767
768 //initialize so that no maps initially
769 vertex_flag = 0;
770 normal_flag = 0;
771 color_flag = 0;
772 texcoord_flag = 0;
773
774 /*
775 if(glIsEnabled(GL_AUTO_NORMAL) == GL_TRUE)
776 auto_normal_flag = 1;
777 else if (callback_auto_normal == 1)
778 auto_normal_flag = 1;
779 else
780 auto_normal_flag = 0;
781 */
783
784 }
785 else
786 {
788
789 /*to avoid side effect, we restor the opengl state for GL_POLYGON_MODE
790 */
792 }
793
794}
void bezierPatchMeshListDelete(bezierPatchMesh *list)
#define GL_POLYGON_MODE
Definition: gl.h:272
unsigned int GLbitfield
Definition: gl.h:152
GLAPI void GLAPIENTRY glGetIntegerv(GLenum pname, GLint *params)
GLAPI void GLAPIENTRY glPushAttrib(GLbitfield mask)
#define GL_EVAL_BIT
Definition: gl.h:718

◆ bgnqstrip()

void OpenGLSurfaceEvaluator::bgnqstrip ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 712 of file glsurfeval.cc.

713{
716 else
718
719#ifdef STATISTICS
720 STAT_num_of_quad_strips++;
721#endif
722}
#define GL_QUAD_STRIP
Definition: gl.h:198

Referenced by inEvalMesh2(), and mapmesh2f().

◆ bgntfan()

void OpenGLSurfaceEvaluator::bgntfan ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 324 of file glsurfeval.cc.

325{
326
329 else
331
332}
#define GL_TRIANGLE_FAN
Definition: gl.h:196

Referenced by evalUStrip(), evalVStrip(), inEvalUStrip(), and inEvalVStrip().

◆ bgntmesh()

void OpenGLSurfaceEvaluator::bgntmesh ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 290 of file glsurfeval.cc.

291{
292
293 tmeshing = 1;
294 which = 0;
295 vcount = 0;
296
299 else
301
302}
#define GL_TRIANGLES
Definition: gl.h:194

◆ colorCallBack()

void OpenGLSurfaceEvaluator::colorCallBack ( const GLfloat color,
void data 
)
private

Definition at line 1274 of file glsurfeval.cc.

1275{
1276 if(colorCallBackData)
1277 colorCallBackData(color, data);
1278 else if(colorCallBackN)
1279 colorCallBackN(color);
1280}
GLuint color
Definition: glext.h:6243

Referenced by inDoEvalCoord2EM().

◆ coord2f()

void OpenGLSurfaceEvaluator::coord2f ( REAL  u,
REAL  v 
)

Definition at line 1106 of file glsurfeval.cc.

1107{
1108#ifdef NO_EVALUATION
1109return;
1110#else
1111
1112#ifdef USE_INTERNAL_EVAL
1113 inEvalCoord2f( u, v);
1114#else
1115
1116
1119else
1121
1122
1123#endif
1124
1125
1126#ifdef STATISTICS
1127 STAT_num_of_eval_vertices++;
1128#endif
1129
1130#endif
1131}
void bezierPatchMeshInsertUV(bezierPatchMesh *bpm, float u, float v)
void inEvalCoord2f(REAL u, REAL v)
Definition: insurfeval.cc:375
GLAPI void GLAPIENTRY glEvalCoord2f(GLfloat u, GLfloat v)
float GLfloat
Definition: gl.h:161
const GLdouble * v
Definition: gl.h:2040
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
Definition: glfuncs.h:240

Referenced by evalUStrip(), evalVStrip(), StoredVertex::invoke(), mapmesh2f(), newtmeshvert(), and point2i().

◆ disable()

void OpenGLSurfaceEvaluator::disable ( long  type)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 175 of file glsurfeval.cc.

176{
178}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLAPI void GLAPIENTRY glDisable(GLenum cap)

◆ domain2f()

void OpenGLSurfaceEvaluator::domain2f ( REAL  ulo,
REAL  uhi,
REAL  vlo,
REAL  vhi 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 263 of file glsurfeval.cc.

264{
265}

◆ enable()

void OpenGLSurfaceEvaluator::enable ( long  type)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 185 of file glsurfeval.cc.

186{
188}
GLAPI void GLAPIENTRY glEnable(GLenum cap)

◆ endCallBack()

void OpenGLSurfaceEvaluator::endCallBack ( void data)
private

Definition at line 1246 of file glsurfeval.cc.

1247{
1248 if(endCallBackData)
1249 endCallBackData(data);
1250 else if(endCallBackN)
1251 endCallBackN();
1252}

Referenced by inBPMEval(), and inBPMEvalEM().

◆ endclosedline()

void OpenGLSurfaceEvaluator::endclosedline ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 277 of file glsurfeval.cc.

278{
281 else
282 glEnd();
283}
void bezierPatchMeshEndStrip(bezierPatchMesh *bpm)
GLAPI void GLAPIENTRY glEnd(void)

◆ endline()

void OpenGLSurfaceEvaluator::endline ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 249 of file glsurfeval.cc.

250{
253 else
254 glEnd();
255}

◆ endmap2f()

void OpenGLSurfaceEvaluator::endmap2f ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 801 of file glsurfeval.cc.

802{
803
805 {
806 //bezierPatchMeshListDelDeg(global_bpm);
807
808 // bezierPatchMeshListEval(global_bpm);
809
810 //surfcount++;
811 //printf("surfcount=%i\n", surfcount);
812 //if(surfcount == 8) exit(0);
813
815
816
817
818/*
819 global_bpm = bezierPatchMeshListReverse(global_bpm);
820 {
821 float *vertex_array;
822 float *normal_array;
823 int *length_array;
824 int *type_array;
825 int num_strips;
826 bezierPatchMeshListCollect(global_bpm, &vertex_array, &normal_array, &length_array, &type_array, &num_strips);
827 drawStrips(vertex_array, normal_array, length_array, type_array, num_strips);
828 free(vertex_array);
829 free(normal_array);
830 free(length_array);
831 free(type_array);
832 }
833*/
834
835 //bezierPatchMeshListPrint(global_bpm);
836 //bezierPatchMeshListDraw(global_bpm);
837
838// printf("num triangles=%i\n", bezierPatchMeshListNumTriangles(global_bpm));
839
840#ifdef USE_LOD
841#else
844#endif
845 glPopAttrib();
846 }
847else
848 {
849#ifndef USE_LOD
850 glPopAttrib();
851#endif
852
853#ifdef STATISTICS
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);
855#endif
856
857 /*to restore the gl_polygon_mode
858 */
859#ifndef USE_LOD
862#endif
863}
864
865}
void inBPMListEvalEM(bezierPatchMesh *list)
Definition: insurfeval.cc:2056
GLAPI void GLAPIENTRY glPolygonMode(GLenum face, GLenum mode)
#define GL_BACK
Definition: gl.h:271
GLAPI void GLAPIENTRY glPopAttrib(void)
#define GL_FRONT
Definition: gl.h:270
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)

◆ endqstrip()

void OpenGLSurfaceEvaluator::endqstrip ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 725 of file glsurfeval.cc.

726{
729 else
730 glEnd();
731
732}

Referenced by inEvalMesh2(), and mapmesh2f().

◆ endtfan()

void OpenGLSurfaceEvaluator::endtfan ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 334 of file glsurfeval.cc.

335{
338 else
339 glEnd();
340}

Referenced by evalUStrip(), evalVStrip(), inEvalUStrip(), and inEvalVStrip().

◆ endtmesh()

void OpenGLSurfaceEvaluator::endtmesh ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 312 of file glsurfeval.cc.

313{
314 tmeshing = 0;
315
316
319 else
320 glEnd();
321}

◆ evalcoord2f()

void OpenGLSurfaceEvaluator::evalcoord2f ( long  ,
REAL  u,
REAL  v 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 1042 of file glsurfeval.cc.

1043{
1044
1045
1046#ifdef NO_EVALUATION
1047return;
1048#endif
1049
1050
1051 newtmeshvert(u, v);
1052}
void newtmeshvert(REAL, REAL)
Definition: glsurfeval.cc:1160

◆ evalpoint2i()

void OpenGLSurfaceEvaluator::evalpoint2i ( long  u,
long  v 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 1059 of file glsurfeval.cc.

1060{
1061#ifdef NO_EVALUATION
1062return;
1063#endif
1064
1065 newtmeshvert(u, v);
1066}

◆ evalUStrip()

void OpenGLSurfaceEvaluator::evalUStrip ( int  n_upper,
REAL  v_upper,
REAL upper_val,
int  n_lower,
REAL  v_lower,
REAL lower_val 
)
virtual

Implements BasicSurfaceEvaluator.

Definition at line 343 of file glsurfeval.cc.

344{
345#ifdef USE_INTERNAL_EVAL
346 inEvalUStrip(n_upper, v_upper, upper_val,
347 n_lower, v_lower, lower_val);
348#else
349
350#ifdef FOR_CHRIS
351 evalUStripExt(n_upper, v_upper, upper_val,
352 n_lower, v_lower, lower_val);
353 return;
354
355#endif
356 int i,j,k,l;
357 REAL leftMostV[2];
358
359 /*
360 *the algorithm works by scanning from left to right.
361 *leftMostV: the left most of the remaining verteces (on both upper and lower).
362 * it could an element of upperVerts or lowerVerts.
363 *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line
364 *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line
365 */
366
367 /*initialize i,j,and leftMostV
368 */
369 if(upper_val[0] <= lower_val[0])
370 {
371 i=1;
372 j=0;
373
374 leftMostV[0] = upper_val[0];
375 leftMostV[1] = v_upper;
376 }
377 else
378 {
379 i=0;
380 j=1;
381
382 leftMostV[0] = lower_val[0];
383 leftMostV[1] = v_lower;
384
385 }
386
387 /*the main loop.
388 *the invariance is that:
389 *at the beginning of each loop, the meaning of i,j,and leftMostV are
390 *maintained
391 */
392 while(1)
393 {
394 if(i >= n_upper) /*case1: no more in upper*/
395 {
396 if(j<n_lower-1) /*at least two vertices in lower*/
397 {
398 bgntfan();
399 coord2f(leftMostV[0], leftMostV[1]);
400// glNormal3fv(leftMostNormal);
401// glVertex3fv(leftMostXYZ);
402
403 while(j<n_lower){
404 coord2f(lower_val[j], v_lower);
405// glNormal3fv(lowerNormal[j]);
406// glVertex3fv(lowerXYZ[j]);
407 j++;
408
409 }
410 endtfan();
411 }
412 break; /*exit the main loop*/
413 }
414 else if(j>= n_lower) /*case2: no more in lower*/
415 {
416 if(i<n_upper-1) /*at least two vertices in upper*/
417 {
418 bgntfan();
419 coord2f(leftMostV[0], leftMostV[1]);
420// glNormal3fv(leftMostNormal);
421// glVertex3fv(leftMostXYZ);
422
423 for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/
424 {
425 coord2f(upper_val[k], v_upper);
426// glNormal3fv(upperNormal[k]);
427// glVertex3fv(upperXYZ[k]);
428 }
429
430 endtfan();
431 }
432 break; /*exit the main loop*/
433 }
434 else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/
435 {
436 if(upper_val[i] <= lower_val[j])
437 {
438 bgntfan();
439 coord2f(lower_val[j], v_lower);
440// glNormal3fv(lowerNormal[j]);
441// glVertex3fv(lowerXYZ[j]);
442
443 /*find the last k>=i such that
444 *upperverts[k][0] <= lowerverts[j][0]
445 */
446 k=i;
447
448 while(k<n_upper)
449 {
450 if(upper_val[k] > lower_val[j])
451 break;
452 k++;
453
454 }
455 k--;
456
457
458 for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
459 {
460 coord2f(upper_val[l], v_upper);
461// glNormal3fv(upperNormal[l]);
462// glVertex3fv(upperXYZ[l]);
463
464 }
465 coord2f(leftMostV[0], leftMostV[1]);
466// glNormal3fv(leftMostNormal);
467// glVertex3fv(leftMostXYZ);
468
469 endtfan();
470
471 /*update i and leftMostV for next loop
472 */
473 i = k+1;
474
475 leftMostV[0] = upper_val[k];
476 leftMostV[1] = v_upper;
477// leftMostNormal = upperNormal[k];
478// leftMostXYZ = upperXYZ[k];
479 }
480 else /*upperVerts[i][0] > lowerVerts[j][0]*/
481 {
482 bgntfan();
483 coord2f(upper_val[i], v_upper);
484// glNormal3fv(upperNormal[i]);
485// glVertex3fv(upperXYZ[i]);
486
487 coord2f(leftMostV[0], leftMostV[1]);
488// glNormal3fv(leftMostNormal);
489// glVertex3fv(leftMostXYZ);
490
491
492 /*find the last k>=j such that
493 *lowerverts[k][0] < upperverts[i][0]
494 */
495 k=j;
496 while(k< n_lower)
497 {
498 if(lower_val[k] >= upper_val[i])
499 break;
500 coord2f(lower_val[k], v_lower);
501// glNormal3fv(lowerNormal[k]);
502// glVertex3fv(lowerXYZ[k]);
503
504 k++;
505 }
506 endtfan();
507
508 /*update j and leftMostV for next loop
509 */
510 j=k;
511 leftMostV[0] = lower_val[j-1];
512 leftMostV[1] = v_lower;
513
514// leftMostNormal = lowerNormal[j-1];
515// leftMostXYZ = lowerXYZ[j-1];
516 }
517 }
518 }
519 //clean up
520// free(upperXYZ);
521// free(lowerXYZ);
522// free(upperNormal);
523// free(lowerNormal);
524#endif
525
526}
r l[0]
Definition: byte_order.h:167
void coord2f(REAL, REAL)
Definition: glsurfeval.cc:1106
void inEvalUStrip(int n_upper, REAL v_upper, REAL *upper_val, int n_lower, REAL v_lower, REAL *lower_val)
Definition: insurfeval.cc:1166
float REAL
Definition: types.h:41
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
Definition: glfuncs.h:250
int k
Definition: mpi.c:3369

◆ evalVStrip()

void OpenGLSurfaceEvaluator::evalVStrip ( int  n_left,
REAL  u_left,
REAL left_val,
int  n_right,
REAL  u_right,
REAL right_val 
)
virtual

Implements BasicSurfaceEvaluator.

Definition at line 530 of file glsurfeval.cc.

531{
532#ifdef USE_INTERNAL_EVAL
533 inEvalVStrip(n_left, u_left, left_val,
534 n_right, u_right, right_val);
535#else
536
537#ifdef FOR_CHRIS
538 evalVStripExt(n_left, u_left, left_val,
539 n_right, u_right, right_val);
540 return;
541
542#endif
543
544 int i,j,k,l;
545 REAL botMostV[2];
546 /*
547 *the algorithm works by scanning from bot to top.
548 *botMostV: the bot most of the remaining verteces (on both left and right).
549 * it could an element of leftVerts or rightVerts.
550 *i: leftVerts[i] is the first vertex to the top of botMostV on left line
551 *j: rightVerts[j] is the first vertex to the top of botMostV on rightline
552 */
553
554 /*initialize i,j,and botMostV
555 */
556 if(left_val[0] <= right_val[0])
557 {
558 i=1;
559 j=0;
560
561 botMostV[0] = u_left;
562 botMostV[1] = left_val[0];
563 }
564 else
565 {
566 i=0;
567 j=1;
568
569 botMostV[0] = u_right;
570 botMostV[1] = right_val[0];
571 }
572
573 /*the main loop.
574 *the invariance is that:
575 *at the beginning of each loop, the meaning of i,j,and botMostV are
576 *maintained
577 */
578 while(1)
579 {
580 if(i >= n_left) /*case1: no more in left*/
581 {
582 if(j<n_right-1) /*at least two vertices in right*/
583 {
584 bgntfan();
585 coord2f(botMostV[0], botMostV[1]);
586 while(j<n_right){
587 coord2f(u_right, right_val[j]);
588// glNormal3fv(rightNormal[j]);
589// glVertex3fv(rightXYZ[j]);
590 j++;
591
592 }
593 endtfan();
594 }
595 break; /*exit the main loop*/
596 }
597 else if(j>= n_right) /*case2: no more in right*/
598 {
599 if(i<n_left-1) /*at least two vertices in left*/
600 {
601 bgntfan();
602 coord2f(botMostV[0], botMostV[1]);
603// glNormal3fv(botMostNormal);
604// glVertex3fv(botMostXYZ);
605
606 for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/
607 {
608 coord2f(u_left, left_val[k]);
609// glNormal3fv(leftNormal[k]);
610// glVertex3fv(leftXYZ[k]);
611 }
612
613 endtfan();
614 }
615 break; /*exit the main loop*/
616 }
617 else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/
618 {
619 if(left_val[i] <= right_val[j])
620 {
621 bgntfan();
622 coord2f(u_right, right_val[j]);
623// glNormal3fv(rightNormal[j]);
624// glVertex3fv(rightXYZ[j]);
625
626 /*find the last k>=i such that
627 *leftverts[k][0] <= rightverts[j][0]
628 */
629 k=i;
630
631 while(k<n_left)
632 {
633 if(left_val[k] > right_val[j])
634 break;
635 k++;
636
637 }
638 k--;
639
640
641 for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
642 {
643 coord2f(u_left, left_val[l]);
644// glNormal3fv(leftNormal[l]);
645// glVertex3fv(leftXYZ[l]);
646
647 }
648 coord2f(botMostV[0], botMostV[1]);
649// glNormal3fv(botMostNormal);
650// glVertex3fv(botMostXYZ);
651
652 endtfan();
653
654 /*update i and botMostV for next loop
655 */
656 i = k+1;
657
658 botMostV[0] = u_left;
659 botMostV[1] = left_val[k];
660// botMostNormal = leftNormal[k];
661// botMostXYZ = leftXYZ[k];
662 }
663 else /*left_val[i] > right_val[j])*/
664 {
665 bgntfan();
666 coord2f(u_left, left_val[i]);
667// glNormal3fv(leftNormal[i]);
668// glVertex3fv(leftXYZ[i]);
669
670 coord2f(botMostV[0], botMostV[1]);
671// glNormal3fv(botMostNormal);
672// glVertex3fv(botMostXYZ);
673
674
675 /*find the last k>=j such that
676 *rightverts[k][0] < leftverts[i][0]
677 */
678 k=j;
679 while(k< n_right)
680 {
681 if(right_val[k] >= left_val[i])
682 break;
683 coord2f(u_right, right_val[k]);
684// glNormal3fv(rightNormal[k]);
685// glVertex3fv(rightXYZ[k]);
686
687 k++;
688 }
689 endtfan();
690
691 /*update j and botMostV for next loop
692 */
693 j=k;
694 botMostV[0] = u_right;
695 botMostV[1] = right_val[j-1];
696
697// botMostNormal = rightNormal[j-1];
698// botMostXYZ = rightXYZ[j-1];
699 }
700 }
701 }
702 //clean up
703// free(leftXYZ);
704// free(leftNormal);
705// free(rightXYZ);
706// free(rightNormal);
707#endif
708}
void inEvalVStrip(int n_left, REAL u_left, REAL *left_val, int n_right, REAL u_right, REAL *right_val)
Definition: insurfeval.cc:1355

◆ get_callback_auto_normal()

int OpenGLSurfaceEvaluator::get_callback_auto_normal ( )
inline

Definition at line 163 of file glsurfeval.h.

164 {
166 }

Referenced by GLUnurbs::get_callback_auto_normal().

◆ get_vertices_call_back()

int OpenGLSurfaceEvaluator::get_vertices_call_back ( )
inline

Definition at line 149 of file glsurfeval.h.

150 {
151 return output_triangles;
152 }

Referenced by GLUnurbs::get_vertices_call_back().

◆ inBPMEval()

void OpenGLSurfaceEvaluator::inBPMEval ( bezierPatchMesh bpm)
private

Definition at line 247 of file insurfeval.cc.

248{
249 int i,j,k,l;
250 float u,v;
251
252 int ustride = bpm->bpatch->dimension * bpm->bpatch->vorder;
253 int vstride = bpm->bpatch->dimension;
254 inMap2f(
256 bpm->bpatch->umin,
257 bpm->bpatch->umax,
258 ustride,
259 bpm->bpatch->uorder,
260 bpm->bpatch->vmin,
261 bpm->bpatch->vmax,
262 vstride,
263 bpm->bpatch->vorder,
264 bpm->bpatch->ctlpoints);
265
266 bpm->vertex_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3+1); /*in case the origional dimenion is 4, then we need 4 space to pass to evaluator.*/
267 assert(bpm->vertex_array);
268 bpm->normal_array = (float*) malloc(sizeof(float)* (bpm->index_UVarray/2) * 3);
269 assert(bpm->normal_array);
270#ifdef CRACK_TEST
271if( global_ev_u1 ==2 && global_ev_u2 == 3
272 && global_ev_v1 ==2 && global_ev_v2 == 3)
273{
274REAL vertex[4];
275REAL normal[4];
276#ifdef DEBUG
277printf("***number 1\n");
278#endif
279
281inEvalCoord2f(3.0, 3.0);
282inEvalCoord2f(2.0, 3.0);
283inEvalCoord2f(3.0, 2.7);
284inEvalCoord2f(2.0, 2.7);
285inEvalCoord2f(3.0, 2.0);
286inEvalCoord2f(2.0, 2.0);
288
289
291inEvalCoord2f(2.0, 3.0);
292inEvalCoord2f(2.0, 2.0);
293inEvalCoord2f(2.0, 2.7);
295
296}
297
298/*
299if( global_ev_u1 ==2 && global_ev_u2 == 3
300 && global_ev_v1 ==1 && global_ev_v2 == 2)
301{
302#ifdef DEBUG
303printf("***number 2\n");
304#endif
305beginCallBack(GL_QUAD_STRIP);
306inEvalCoord2f(2.0, 2.0);
307inEvalCoord2f(2.0, 1.0);
308inEvalCoord2f(3.0, 2.0);
309inEvalCoord2f(3.0, 1.0);
310endCallBack();
311}
312*/
313if( global_ev_u1 ==1 && global_ev_u2 == 2
314 && global_ev_v1 ==2 && global_ev_v2 == 3)
315{
316#ifdef DEBUG
317printf("***number 3\n");
318#endif
320inEvalCoord2f(2.0, 3.0);
321inEvalCoord2f(1.0, 3.0);
322inEvalCoord2f(2.0, 2.3);
323inEvalCoord2f(1.0, 2.3);
324inEvalCoord2f(2.0, 2.0);
325inEvalCoord2f(1.0, 2.0);
327
329inEvalCoord2f(2.0, 2.3);
330inEvalCoord2f(2.0, 2.0);
331inEvalCoord2f(2.0, 3.0);
333
334}
335return;
336#endif
337
338 k=0;
339 l=0;
340
341 for(i=0; i<bpm->index_length_array; i++)
342 {
344 for(j=0; j<bpm->length_array[i]; j++)
345 {
346 u = bpm->UVarray[k];
347 v = bpm->UVarray[k+1];
349 bpm->vertex_array+l,
350 bpm->normal_array+l);
351
354
355 k += 2;
356 l += 3;
357 }
359 }
360}
void vertexCallBack(const GLfloat *vert, void *data)
Definition: glsurfeval.cc:1255
void inDoEvalCoord2NOGE(REAL u, REAL v, REAL *retPoint, REAL *retNormal)
Definition: insurfeval.cc:749
void endCallBack(void *data)
Definition: glsurfeval.cc:1246
void beginCallBack(GLenum type, void *data)
Definition: glsurfeval.cc:1237
void normalCallBack(const GLfloat *normal, void *data)
Definition: glsurfeval.cc:1265
void inMap2f(int k, REAL ulower, REAL uupper, int ustride, int uorder, REAL vlower, REAL vupper, int vstride, int vorder, REAL *ctlPoints)
Definition: insurfeval.cc:444
#define malloc
Definition: debug_ros.c:4
#define assert(x)
Definition: debug.h:53
#define printf
Definition: freeldr.h:94
#define GL_MAP2_VERTEX_4
Definition: gl.h:568
#define GL_MAP2_VERTEX_3
Definition: gl.h:567
#define GL_TRIANGLE_STRIP
Definition: gl.h:195
GLdouble GLdouble GLint ustride
Definition: glext.h:8308
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint vstride
Definition: glext.h:8308
@ normal
Definition: optimize.h:166
bezierPatch * bpatch
float vmax
Definition: bezierPatch.h:37
float umin
Definition: bezierPatch.h:37
float vmin
Definition: bezierPatch.h:37
float * ctlpoints
Definition: bezierPatch.h:58
float umax
Definition: bezierPatch.h:37
Definition: mesh.c:4558

Referenced by inBPMListEval().

◆ inBPMEvalEM()

void OpenGLSurfaceEvaluator::inBPMEvalEM ( bezierPatchMesh bpm)
private

Definition at line 1826 of file insurfeval.cc.

1827{
1828 int i,j,k;
1829 float u,v;
1830
1831 int ustride;
1832 int vstride;
1833
1834#ifdef USE_LOD
1835 if(bpm->bpatch != NULL)
1836 {
1837 bezierPatch* p=bpm->bpatch;
1838 ustride = p->dimension * p->vorder;
1839 vstride = p->dimension;
1840
1841 glMap2f( (p->dimension == 3)? GL_MAP2_VERTEX_3 : GL_MAP2_VERTEX_4,
1842 p->umin,
1843 p->umax,
1844 ustride,
1845 p->uorder,
1846 p->vmin,
1847 p->vmax,
1848 vstride,
1849 p->vorder,
1850 p->ctlpoints);
1851
1852
1853/*
1854 inMap2fEM(0, p->dimension,
1855 p->umin,
1856 p->umax,
1857 ustride,
1858 p->uorder,
1859 p->vmin,
1860 p->vmax,
1861 vstride,
1862 p->vorder,
1863 p->ctlpoints);
1864*/
1865 }
1866#else
1867
1868 if(bpm->bpatch != NULL){
1869 bezierPatch* p = bpm->bpatch;
1870 ustride = p->dimension * p->vorder;
1871 vstride = p->dimension;
1872 inMap2fEM(0, p->dimension,
1873 p->umin,
1874 p->umax,
1875 ustride,
1876 p->uorder,
1877 p->vmin,
1878 p->vmax,
1879 vstride,
1880 p->vorder,
1881 p->ctlpoints);
1882 }
1883 if(bpm->bpatch_normal != NULL){
1884 bezierPatch* p = bpm->bpatch_normal;
1885 ustride = p->dimension * p->vorder;
1886 vstride = p->dimension;
1887 inMap2fEM(1, p->dimension,
1888 p->umin,
1889 p->umax,
1890 ustride,
1891 p->uorder,
1892 p->vmin,
1893 p->vmax,
1894 vstride,
1895 p->vorder,
1896 p->ctlpoints);
1897 }
1898 if(bpm->bpatch_color != NULL){
1899 bezierPatch* p = bpm->bpatch_color;
1900 ustride = p->dimension * p->vorder;
1901 vstride = p->dimension;
1902 inMap2fEM(2, p->dimension,
1903 p->umin,
1904 p->umax,
1905 ustride,
1906 p->uorder,
1907 p->vmin,
1908 p->vmax,
1909 vstride,
1910 p->vorder,
1911 p->ctlpoints);
1912 }
1913 if(bpm->bpatch_texcoord != NULL){
1915 ustride = p->dimension * p->vorder;
1916 vstride = p->dimension;
1917 inMap2fEM(3, p->dimension,
1918 p->umin,
1919 p->umax,
1920 ustride,
1921 p->uorder,
1922 p->vmin,
1923 p->vmax,
1924 vstride,
1925 p->vorder,
1926 p->ctlpoints);
1927 }
1928#endif
1929
1930
1931 k=0;
1932 for(i=0; i<bpm->index_length_array; i++)
1933 {
1934#ifdef USE_LOD
1935 if(bpm->type_array[i] == GL_POLYGON) //a mesh
1936 {
1937 GLfloat *temp = bpm->UVarray+k;
1938 GLfloat u0 = temp[0];
1939 GLfloat v0 = temp[1];
1940 GLfloat u1 = temp[2];
1941 GLfloat v1 = temp[3];
1942 GLint nu = (GLint) ( temp[4]);
1943 GLint nv = (GLint) ( temp[5]);
1944 GLint umin = (GLint) ( temp[6]);
1945 GLint vmin = (GLint) ( temp[7]);
1946 GLint umax = (GLint) ( temp[8]);
1947 GLint vmax = (GLint) ( temp[9]);
1948
1951 }
1952 else
1953 {
1954 LOD_eval(bpm->length_array[i], bpm->UVarray+k, bpm->type_array[i],
1955 0
1956 );
1957 }
1958 k+= 2*bpm->length_array[i];
1959
1960#else //undef USE_LOD
1961
1962#ifdef CRACK_TEST
1963if( bpm->bpatch->umin == 2 && bpm->bpatch->umax == 3
1964 && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3)
1965{
1966REAL vertex[4];
1967REAL normal[4];
1968#ifdef DEBUG
1969printf("***number ****1\n");
1970#endif
1971
1973inDoEvalCoord2EM(3.0, 3.0);
1974inDoEvalCoord2EM(2.0, 3.0);
1975inDoEvalCoord2EM(3.0, 2.7);
1976inDoEvalCoord2EM(2.0, 2.7);
1977inDoEvalCoord2EM(3.0, 2.0);
1978inDoEvalCoord2EM(2.0, 2.0);
1980
1982inDoEvalCoord2EM(2.0, 3.0);
1983inDoEvalCoord2EM(2.0, 2.0);
1984inDoEvalCoord2EM(2.0, 2.7);
1986
1987}
1988if( bpm->bpatch->umin == 1 && bpm->bpatch->umax == 2
1989 && bpm->bpatch->vmin ==2 && bpm->bpatch->vmax == 3)
1990{
1991#ifdef DEBUG
1992printf("***number 3\n");
1993#endif
1995inDoEvalCoord2EM(2.0, 3.0);
1996inDoEvalCoord2EM(1.0, 3.0);
1997inDoEvalCoord2EM(2.0, 2.3);
1998inDoEvalCoord2EM(1.0, 2.3);
1999inDoEvalCoord2EM(2.0, 2.0);
2000inDoEvalCoord2EM(1.0, 2.0);
2002
2004inDoEvalCoord2EM(2.0, 2.3);
2005inDoEvalCoord2EM(2.0, 2.0);
2006inDoEvalCoord2EM(2.0, 3.0);
2008
2009}
2010return;
2011#endif //CRACK_TEST
2012
2014
2015 for(j=0; j<bpm->length_array[i]; j++)
2016 {
2017 u = bpm->UVarray[k];
2018 v = bpm->UVarray[k+1];
2019#ifdef USE_LOD
2020 LOD_EVAL_COORD(u,v);
2021// glEvalCoord2f(u,v);
2022#else
2023
2024#ifdef GENERIC_TEST
2025 float temp_normal[3];
2026 float temp_vertex[3];
2027 if(temp_signal == 0)
2028 {
2029 gTessVertexSphere(u,v, temp_normal, temp_vertex);
2030//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]);
2031 normalCallBack(temp_normal, userData);
2032 vertexCallBack(temp_vertex, userData);
2033 }
2034 else if(temp_signal == 1)
2035 {
2036 gTessVertexCyl(u,v, temp_normal, temp_vertex);
2037//printf("normal=(%f,%f,%f)\n", temp_normal[0], temp_normal[1], temp_normal[2])//printf("veretx=(%f,%f,%f)\n", temp_vertex[0], temp_vertex[1], temp_vertex[2]);
2038 normalCallBack(temp_normal, userData);
2039 vertexCallBack(temp_vertex, userData);
2040 }
2041 else
2042#endif //GENERIC_TEST
2043
2045
2046#endif //USE_LOD
2047
2048 k += 2;
2049 }
2051
2052#endif //USE_LOD
2053 }
2054}
void LOD_eval(int num_vert, REAL *verts, int type, int level)
void inDoEvalCoord2EM(REAL u, REAL v)
Definition: insurfeval.cc:1702
void inMap2fEM(int which, int dimension, REAL ulower, REAL uupper, int ustride, int uorder, REAL vlower, REAL vupper, int vstride, int vorder, REAL *ctlPoints)
Definition: insurfeval.cc:1540
GLAPI void GLAPIENTRY glEvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
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)
GLAPI void GLAPIENTRY glMapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
#define GL_FILL
Definition: gl.h:267
#define GL_POLYGON
Definition: gl.h:199
int GLint
Definition: gl.h:156
GLfloat v0
Definition: glext.h:6061
GLfloat GLfloat p
Definition: glext.h:8902
GLfloat GLfloat v1
Definition: glext.h:6062
GLdouble u1
Definition: glext.h:8308
static calc_node_t temp
Definition: rpn_ieee.c:38
bezierPatch * bpatch_color
bezierPatch * bpatch_texcoord
bezierPatch * bpatch_normal

Referenced by inBPMListEvalEM().

◆ inBPMListEval()

void OpenGLSurfaceEvaluator::inBPMListEval ( bezierPatchMesh list)
private

Definition at line 238 of file insurfeval.cc.

239{
241 for(temp = list; temp != NULL; temp = temp->next)
242 {
244 }
245}
void inBPMEval(bezierPatchMesh *bpm)
Definition: insurfeval.cc:247
Definition: list.h:37

◆ inBPMListEvalEM()

void OpenGLSurfaceEvaluator::inBPMListEvalEM ( bezierPatchMesh list)
private

Definition at line 2056 of file insurfeval.cc.

2057{
2059 for(temp = list; temp != NULL; temp = temp->next)
2060 {
2062 }
2063}
void inBPMEvalEM(bezierPatchMesh *bpm)
Definition: insurfeval.cc:1826

Referenced by endmap2f(), and LOD_eval_list().

◆ inComputeFirstPartials()

void OpenGLSurfaceEvaluator::inComputeFirstPartials ( REAL p,
REAL pu,
REAL pv 
)
private

Definition at line 501 of file insurfeval.cc.

502{
503 pu[0] = pu[0]*p[3] - pu[3]*p[0];
504 pu[1] = pu[1]*p[3] - pu[3]*p[1];
505 pu[2] = pu[2]*p[3] - pu[3]*p[2];
506
507 pv[0] = pv[0]*p[3] - pv[3]*p[0];
508 pv[1] = pv[1]*p[3] - pv[3]*p[1];
509 pv[2] = pv[2]*p[3] - pv[3]*p[2];
510}

Referenced by inDoEvalCoord2(), inDoEvalCoord2EM(), inDoEvalCoord2NOGE(), inDoEvalCoord2NOGE_BU(), and inDoEvalCoord2NOGE_BV().

◆ inComputeNormal2()

void OpenGLSurfaceEvaluator::inComputeNormal2 ( REAL pu,
REAL pv,
REAL n 
)
private

Definition at line 518 of file insurfeval.cc.

519{
520 REAL mag;
521
522 n[0] = pu[1]*pv[2] - pu[2]*pv[1];
523 n[1] = pu[2]*pv[0] - pu[0]*pv[2];
524 n[2] = pu[0]*pv[1] - pu[1]*pv[0];
525
526 mag = sqrt(n[0]*n[0] + n[1]*n[1] + n[2]*n[2]);
527
528 if (mag > 0.0) {
529 n[0] /= mag;
530 n[1] /= mag;
531 n[2] /= mag;
532 }
533}
_STLP_DECLSPEC complex< float > _STLP_CALL sqrt(const complex< float > &)
Definition: complex.cpp:188
GLdouble n
Definition: glext.h:7729

Referenced by inDoEvalCoord2(), inDoEvalCoord2EM(), inDoEvalCoord2NOGE(), inDoEvalCoord2NOGE_BU(), and inDoEvalCoord2NOGE_BV().

◆ inDoDomain2EM()

void OpenGLSurfaceEvaluator::inDoDomain2EM ( surfEvalMachine em,
REAL  u,
REAL  v,
REAL retPoint 
)
private

Definition at line 1653 of file insurfeval.cc.

1655{
1656 int j, row, col;
1657 REAL the_uprime;
1658 REAL the_vprime;
1659 REAL p;
1660 REAL *data;
1661
1662 if((em->u2 == em->u1) || (em->v2 == em->v1))
1663 return;
1664 the_uprime = (u - em->u1) / (em->u2 - em->u1);
1665 the_vprime = (v - em->v1) / (em->v2 - em->v1);
1666
1667 /* Compute coefficients for values and derivs */
1668
1669 /* Use already cached values if possible */
1670 if(em->uprime != the_uprime) {
1671 inPreEvaluate(em->uorder, the_uprime, em->ucoeff);
1672 em->uprime = the_uprime;
1673 }
1674 if (em->vprime != the_vprime) {
1675 inPreEvaluate(em->vorder, the_vprime, em->vcoeff);
1676 em->vprime = the_vprime;
1677 }
1678
1679 for (j = 0; j < em->k; j++) {
1680 data=em->ctlPoints+j;
1681 retPoint[j] = 0.0;
1682 for (row = 0; row < em->uorder; row++) {
1683 /*
1684 ** Minor optimization.
1685 ** The col == 0 part of the loop is extracted so we don't
1686 ** have to initialize p and pdv to 0.
1687 */
1688 p = em->vcoeff[0] * (*data);
1689 data += em->k;
1690 for (col = 1; col < em->vorder; col++) {
1691 /* Incrementally build up p, pdv value */
1692 p += em->vcoeff[col] * (*data);
1693 data += em->k;
1694 }
1695 /* Use p, pdv value to incrementally add up r, du, dv */
1696 retPoint[j] += em->ucoeff[row] * p;
1697 }
1698 }
1699}
void inPreEvaluate(int order, REAL vprime, REAL *coeff)
Definition: insurfeval.cc:1022
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
REAL ucoeff[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:76
REAL vcoeff[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:77
REAL ctlPoints[IN_MAX_BEZIER_ORDER *IN_MAX_BEZIER_ORDER *IN_MAX_DIMENSION]
Definition: glsurfeval.h:75

Referenced by inDoEvalCoord2EM().

◆ inDoDomain2WithDerivs()

void OpenGLSurfaceEvaluator::inDoDomain2WithDerivs ( int  k,
REAL  u,
REAL  v,
REAL  u1,
REAL  u2,
int  uorder,
REAL  v1,
REAL  v2,
int  vorder,
REAL baseData,
REAL retPoint,
REAL retdu,
REAL retdv 
)
private

Definition at line 949 of file insurfeval.cc.

954{
955 int j, row, col;
956 REAL uprime;
957 REAL vprime;
958 REAL p;
959 REAL pdv;
960 REAL *data;
961
962 if((u2 == u1) || (v2 == v1))
963 return;
964 uprime = (u - u1) / (u2 - u1);
965 vprime = (v - v1) / (v2 - v1);
966
967 /* Compute coefficients for values and derivs */
968
969 /* Use already cached values if possible */
970 if(global_uprime != uprime || global_uorder != uorder) {
973 global_uprime = uprime;
974 }
975 if (global_vprime != vprime ||
979 global_vprime = vprime;
980 }
981
982 for (j = 0; j < k; j++) {
983 data=baseData+j;
984 retPoint[j] = retdu[j] = retdv[j] = 0.0;
985 for (row = 0; row < uorder; row++) {
986 /*
987 ** Minor optimization.
988 ** The col == 0 part of the loop is extracted so we don't
989 ** have to initialize p and pdv to 0.
990 */
991 p = global_vcoeff[0] * (*data);
992 pdv = global_vcoeffDeriv[0] * (*data);
993 data += k;
994 for (col = 1; col < vorder; col++) {
995 /* Incrementally build up p, pdv value */
996 p += global_vcoeff[col] * (*data);
997 pdv += global_vcoeffDeriv[col] * (*data);
998 data += k;
999 }
1000 /* Use p, pdv value to incrementally add up r, du, dv */
1001 retPoint[j] += global_ucoeff[row] * p;
1002 retdu[j] += global_ucoeffDeriv[row] * p;
1003 retdv[j] += global_ucoeff[row] * pdv;
1004 }
1005 }
1006}
REAL global_vcoeffDeriv[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:245
REAL global_ucoeffDeriv[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:244
REAL global_ucoeff[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:242
void inPreEvaluateWithDeriv(int order, REAL vprime, REAL *coeff, REAL *coeffDeriv)
Definition: insurfeval.cc:1066
REAL global_vcoeff[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:243
GLdouble GLdouble GLint GLint uorder
Definition: glext.h:8308
GLdouble GLdouble u2
Definition: glext.h:8308
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint vorder
Definition: glext.h:8308
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
_In_ ULONG_PTR _In_opt_ DESIGNVECTOR * pdv
Definition: winddi.h:3723

Referenced by inDoEvalCoord2(), inDoEvalCoord2NOGE(), inDoEvalCoord2NOGE_BU(), and inDoEvalCoord2NOGE_BV().

◆ inDoDomain2WithDerivsBU()

void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBU ( int  k,
REAL  u,
REAL  v,
REAL  u1,
REAL  u2,
int  uorder,
REAL  v1,
REAL  v2,
int  vorder,
REAL baseData,
REAL retPoint,
REAL retdu,
REAL retdv 
)
private

Definition at line 868 of file insurfeval.cc.

873{
874 int j, col;
875
876 REAL vprime;
877
878
879 if((u2 == u1) || (v2 == v1))
880 return;
881
882 vprime = (v - v1) / (v2 - v1);
883
884
885 if(global_vprime != vprime || global_vorder != vorder) {
887 global_vprime = vprime;
889 }
890
891
892 for(j=0; j<k; j++)
893 {
894 retPoint[j] = retdu[j] = retdv[j] = 0.0;
895 for (col = 0; col < vorder; col++) {
896 retPoint[j] += global_BU[col][j] * global_vcoeff[col];
897 retdu[j] += global_PBU[col][j] * global_vcoeff[col];
898 retdv[j] += global_BU[col][j] * global_vcoeffDeriv[col];
899 }
900 }
901}
REAL global_PBU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
Definition: glsurfeval.h:250
REAL global_BU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
Definition: glsurfeval.h:249

Referenced by inDoEvalCoord2NOGE_BU().

◆ inDoDomain2WithDerivsBV()

void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsBV ( int  k,
REAL  u,
REAL  v,
REAL  u1,
REAL  u2,
int  uorder,
REAL  v1,
REAL  v2,
int  vorder,
REAL baseData,
REAL retPoint,
REAL retdu,
REAL retdv 
)
private

Definition at line 903 of file insurfeval.cc.

908{
909 int j, row;
910 REAL uprime;
911
912
913 if((u2 == u1) || (v2 == v1))
914 return;
915 uprime = (u - u1) / (u2 - u1);
916
917
918 if(global_uprime != uprime || global_uorder != uorder) {
920 global_uprime = uprime;
922 }
923
924
925 for(j=0; j<k; j++)
926 {
927 retPoint[j] = retdu[j] = retdv[j] = 0.0;
928 for (row = 0; row < uorder; row++) {
929 retPoint[j] += global_BV[row][j] * global_ucoeff[row];
930 retdu[j] += global_BV[row][j] * global_ucoeffDeriv[row];
931 retdv[j] += global_PBV[row][j] * global_ucoeff[row];
932 }
933 }
934}
REAL global_PBV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
Definition: glsurfeval.h:248
REAL global_BV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
Definition: glsurfeval.h:247

Referenced by inDoEvalCoord2NOGE_BV().

◆ inDoDomain2WithDerivsEM()

void OpenGLSurfaceEvaluator::inDoDomain2WithDerivsEM ( surfEvalMachine em,
REAL  u,
REAL  v,
REAL retPoint,
REAL retdu,
REAL retdv 
)
private

Definition at line 1600 of file insurfeval.cc.

1602{
1603 int j, row, col;
1604 REAL the_uprime;
1605 REAL the_vprime;
1606 REAL p;
1607 REAL pdv;
1608 REAL *data;
1609
1610 if((em->u2 == em->u1) || (em->v2 == em->v1))
1611 return;
1612 the_uprime = (u - em->u1) / (em->u2 - em->u1);
1613 the_vprime = (v - em->v1) / (em->v2 - em->v1);
1614
1615 /* Compute coefficients for values and derivs */
1616
1617 /* Use already cached values if possible */
1618 if(em->uprime != the_uprime) {
1619 inPreEvaluateWithDeriv(em->uorder, the_uprime, em->ucoeff, em->ucoeffDeriv);
1620 em->uprime = the_uprime;
1621 }
1622 if (em->vprime != the_vprime) {
1623 inPreEvaluateWithDeriv(em->vorder, the_vprime, em->vcoeff, em->vcoeffDeriv);
1624 em->vprime = the_vprime;
1625 }
1626
1627 for (j = 0; j < em->k; j++) {
1628 data=em->ctlPoints+j;
1629 retPoint[j] = retdu[j] = retdv[j] = 0.0;
1630 for (row = 0; row < em->uorder; row++) {
1631 /*
1632 ** Minor optimization.
1633 ** The col == 0 part of the loop is extracted so we don't
1634 ** have to initialize p and pdv to 0.
1635 */
1636 p = em->vcoeff[0] * (*data);
1637 pdv = em->vcoeffDeriv[0] * (*data);
1638 data += em->k;
1639 for (col = 1; col < em->vorder; col++) {
1640 /* Incrementally build up p, pdv value */
1641 p += em->vcoeff[col] * (*data);
1642 pdv += em->vcoeffDeriv[col] * (*data);
1643 data += em->k;
1644 }
1645 /* Use p, pdv value to incrementally add up r, du, dv */
1646 retPoint[j] += em->ucoeff[row] * p;
1647 retdu[j] += em->ucoeffDeriv[row] * p;
1648 retdv[j] += em->ucoeff[row] * pdv;
1649 }
1650 }
1651}
REAL ucoeffDeriv[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:78
REAL vcoeffDeriv[IN_MAX_BEZIER_ORDER]
Definition: glsurfeval.h:79

Referenced by inDoEvalCoord2EM().

◆ inDoEvalCoord2()

void OpenGLSurfaceEvaluator::inDoEvalCoord2 ( REAL  u,
REAL  v,
REAL retPoint,
REAL retNormal 
)
private

Definition at line 541 of file insurfeval.cc.

543{
544
545 REAL du[4];
546 REAL dv[4];
547
548
549 assert(global_ev_k>=3 && global_ev_k <= 4);
550 /*compute homegeneous point and partial derivatives*/
552
553#ifdef AVOID_ZERO_NORMAL
554
555 if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
556 {
557
558 REAL tempdu[4];
559 REAL tempdata[4];
562 if(u-MYDELTA*(u2-u1) < u1)
563 u = u+ MYDELTA*(u2-u1);
564 else
565 u = u-MYDELTA*(u2-u1);
567 }
568 if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
569 {
570 REAL tempdv[4];
571 REAL tempdata[4];
574 if(v-MYDELTA*(v2-v1) < v1)
575 v = v+ MYDELTA*(v2-v1);
576 else
577 v = v-MYDELTA*(v2-v1);
579 }
580#endif
581
582
583 /*compute normal*/
584 switch(global_ev_k){
585 case 3:
586 inComputeNormal2(du, dv, retNormal);
587
588 break;
589 case 4:
590 inComputeFirstPartials(retPoint, du, dv);
591 inComputeNormal2(du, dv, retNormal);
592 /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
593 retPoint[0] /= retPoint[3];
594 retPoint[1] /= retPoint[3];
595 retPoint[2] /= retPoint[3];
596 break;
597 }
598 /*output this vertex*/
599/* inMeshStreamInsert(global_ms, retPoint, retNormal);*/
600
601
602
603 glNormal3fv(retNormal);
604 glVertex3fv(retPoint);
605
606
607
608
609 #ifdef DEBUG
610 printf("vertex(%f,%f,%f)\n", retPoint[0],retPoint[1],retPoint[2]);
611 #endif
612
613
614
615}
void inDoDomain2WithDerivs(int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
Definition: insurfeval.cc:949
REAL global_ev_ctlPoints[IN_MAX_BEZIER_ORDER *IN_MAX_BEZIER_ORDER *IN_MAX_DIMENSION]
Definition: glsurfeval.h:262
void inComputeNormal2(REAL *pu, REAL *pv, REAL *n)
Definition: insurfeval.cc:518
void inComputeFirstPartials(REAL *p, REAL *pu, REAL *pv)
Definition: insurfeval.cc:501
GLAPI void GLAPIENTRY glVertex3fv(const GLfloat *v)
GLAPI void GLAPIENTRY glNormal3fv(const GLfloat *v)
#define myabs(x)
Definition: insurfeval.cc:54
#define MYZERO
Definition: insurfeval.cc:55
#define MYDELTA
Definition: insurfeval.cc:56

Referenced by inEvalCoord2f(), inEvalMesh2(), and inEvalPoint2().

◆ inDoEvalCoord2EM()

void OpenGLSurfaceEvaluator::inDoEvalCoord2EM ( REAL  u,
REAL  v 
)
private

Definition at line 1702 of file insurfeval.cc.

1703{
1704 REAL temp_vertex[5];
1705 REAL temp_normal[3];
1706 REAL temp_color[4];
1707 REAL temp_texcoord[4];
1708
1709 if(texcoord_flag)
1710 {
1711 inDoDomain2EM(&em_texcoord, u,v, temp_texcoord);
1712 texcoordCallBack(temp_texcoord, userData);
1713 }
1714 if(color_flag)
1715 {
1716 inDoDomain2EM(&em_color, u,v, temp_color);
1717 colorCallBack(temp_color, userData);
1718 }
1719
1720 if(normal_flag) //there is a normla map
1721 {
1722 inDoDomain2EM(&em_normal, u,v, temp_normal);
1723 normalCallBack(temp_normal, userData);
1724
1725 if(vertex_flag)
1726 {
1727 inDoDomain2EM(&em_vertex, u,v,temp_vertex);
1728 if(em_vertex.k == 4)
1729 {
1730 temp_vertex[0] /= temp_vertex[3];
1731 temp_vertex[1] /= temp_vertex[3];
1732 temp_vertex[2] /= temp_vertex[3];
1733 }
1734 temp_vertex[3]=u;
1735 temp_vertex[4]=v;
1736 vertexCallBack(temp_vertex, userData);
1737 }
1738 }
1739 else if(auto_normal_flag) //no normal map but there is a normal callbackfunctin
1740 {
1741 REAL du[4];
1742 REAL dv[4];
1743
1744 /*compute homegeneous point and partial derivatives*/
1745 inDoDomain2WithDerivsEM(&em_vertex, u,v,temp_vertex,du,dv);
1746
1747 if(em_vertex.k ==4)
1748 inComputeFirstPartials(temp_vertex, du, dv);
1749
1750#ifdef AVOID_ZERO_NORMAL
1751 if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
1752 {
1753
1754 REAL tempdu[4];
1755 REAL tempdata[4];
1756 REAL u1 = em_vertex.u1;
1757 REAL u2 = em_vertex.u2;
1758 if(u-MYDELTA*(u2-u1) < u1)
1759 u = u+ MYDELTA*(u2-u1);
1760 else
1761 u = u-MYDELTA*(u2-u1);
1762 inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, tempdu, dv);
1763
1764 if(em_vertex.k ==4)
1765 inComputeFirstPartials(temp_vertex, du, dv);
1766 }
1767 else if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
1768 {
1769 REAL tempdv[4];
1770 REAL tempdata[4];
1771 REAL v1 = em_vertex.v1;
1772 REAL v2 = em_vertex.v2;
1773 if(v-MYDELTA*(v2-v1) < v1)
1774 v = v+ MYDELTA*(v2-v1);
1775 else
1776 v = v-MYDELTA*(v2-v1);
1777 inDoDomain2WithDerivsEM(&em_vertex,u,v, tempdata, du, tempdv);
1778
1779 if(em_vertex.k ==4)
1780 inComputeFirstPartials(temp_vertex, du, dv);
1781 }
1782#endif
1783
1784 /*compute normal*/
1785 switch(em_vertex.k){
1786 case 3:
1787
1788 inComputeNormal2(du, dv, temp_normal);
1789 break;
1790 case 4:
1791
1792// inComputeFirstPartials(temp_vertex, du, dv);
1793 inComputeNormal2(du, dv, temp_normal);
1794
1795 /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
1796 temp_vertex[0] /= temp_vertex[3];
1797 temp_vertex[1] /= temp_vertex[3];
1798 temp_vertex[2] /= temp_vertex[3];
1799 break;
1800 }
1801 normalCallBack(temp_normal, userData);
1802 temp_vertex[3] = u;
1803 temp_vertex[4] = v;
1804 vertexCallBack(temp_vertex, userData);
1805
1806 }/*end if auto_normal*/
1807 else //no normal map, and no normal callback function
1808 {
1809 if(vertex_flag)
1810 {
1811 inDoDomain2EM(&em_vertex, u,v,temp_vertex);
1812 if(em_vertex.k == 4)
1813 {
1814 temp_vertex[0] /= temp_vertex[3];
1815 temp_vertex[1] /= temp_vertex[3];
1816 temp_vertex[2] /= temp_vertex[3];
1817 }
1818 temp_vertex[3] = u;
1819 temp_vertex[4] = v;
1820 vertexCallBack(temp_vertex, userData);
1821 }
1822 }
1823}
void texcoordCallBack(const GLfloat *texcoord, void *data)
Definition: glsurfeval.cc:1283
void inDoDomain2EM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint)
Definition: insurfeval.cc:1653
void inDoDomain2WithDerivsEM(surfEvalMachine *em, REAL u, REAL v, REAL *retPoint, REAL *retdu, REAL *retdv)
Definition: insurfeval.cc:1600
void colorCallBack(const GLfloat *color, void *data)
Definition: glsurfeval.cc:1274

Referenced by inBPMEvalEM().

◆ inDoEvalCoord2NOGE()

void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE ( REAL  u,
REAL  v,
REAL retPoint,
REAL retNormal 
)
privatevirtual

Implements BasicSurfaceEvaluator.

Definition at line 749 of file insurfeval.cc.

751{
752
753 REAL du[4];
754 REAL dv[4];
755
756
757 assert(global_ev_k>=3 && global_ev_k <= 4);
758 /*compute homegeneous point and partial derivatives*/
760
761
762#ifdef AVOID_ZERO_NORMAL
763
764 if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
765 {
766
767 REAL tempdu[4];
768 REAL tempdata[4];
771 if(u-MYDELTA*(u2-u1) < u1)
772 u = u+ MYDELTA*(u2-u1);
773 else
774 u = u-MYDELTA*(u2-u1);
776 }
777 if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
778 {
779 REAL tempdv[4];
780 REAL tempdata[4];
783 if(v-MYDELTA*(v2-v1) < v1)
784 v = v+ MYDELTA*(v2-v1);
785 else
786 v = v-MYDELTA*(v2-v1);
788 }
789#endif
790
791 /*compute normal*/
792 switch(global_ev_k){
793 case 3:
794 inComputeNormal2(du, dv, retNormal);
795 break;
796 case 4:
797 inComputeFirstPartials(retPoint, du, dv);
798 inComputeNormal2(du, dv, retNormal);
799 /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
800 retPoint[0] /= retPoint[3];
801 retPoint[1] /= retPoint[3];
802 retPoint[2] /= retPoint[3];
803 break;
804 }
805// glNormal3fv(retNormal);
806// glVertex3fv(retPoint);
807}

Referenced by inBPMEval().

◆ inDoEvalCoord2NOGE_BU()

void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BU ( REAL  u,
REAL  v,
REAL retPoint,
REAL retNormal 
)
privatevirtual

Implements BasicSurfaceEvaluator.

Definition at line 621 of file insurfeval.cc.

623{
624
625 REAL du[4];
626 REAL dv[4];
627
628
629 assert(global_ev_k>=3 && global_ev_k <= 4);
630 /*compute homegeneous point and partial derivatives*/
631// inPreEvaluateBU(global_ev_k, global_ev_uorder, global_ev_vorder, (u-global_ev_u1)/(global_ev_u2-global_ev_u1), global_ev_ctlPoints);
633
634
635#ifdef AVOID_ZERO_NORMAL
636
637 if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
638 {
639
640 REAL tempdu[4];
641 REAL tempdata[4];
644 if(u-MYDELTA*(u2-u1) < u1)
645 u = u+ MYDELTA*(u2-u1);
646 else
647 u = u-MYDELTA*(u2-u1);
649 }
650 if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
651 {
652 REAL tempdv[4];
653 REAL tempdata[4];
656 if(v-MYDELTA*(v2-v1) < v1)
657 v = v+ MYDELTA*(v2-v1);
658 else
659 v = v-MYDELTA*(v2-v1);
661 }
662#endif
663
664 /*compute normal*/
665 switch(global_ev_k){
666 case 3:
667 inComputeNormal2(du, dv, retNormal);
668 break;
669 case 4:
670 inComputeFirstPartials(retPoint, du, dv);
671 inComputeNormal2(du, dv, retNormal);
672 /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
673 retPoint[0] /= retPoint[3];
674 retPoint[1] /= retPoint[3];
675 retPoint[2] /= retPoint[3];
676 break;
677 }
678}
void inDoDomain2WithDerivsBU(int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
Definition: insurfeval.cc:868

Referenced by inEvalVLine().

◆ inDoEvalCoord2NOGE_BV()

void OpenGLSurfaceEvaluator::inDoEvalCoord2NOGE_BV ( REAL  u,
REAL  v,
REAL retPoint,
REAL retNormal 
)
privatevirtual

Implements BasicSurfaceEvaluator.

Definition at line 684 of file insurfeval.cc.

686{
687
688 REAL du[4];
689 REAL dv[4];
690
691
692 assert(global_ev_k>=3 && global_ev_k <= 4);
693 /*compute homegeneous point and partial derivatives*/
694// inPreEvaluateBV(global_ev_k, global_ev_uorder, global_ev_vorder, (v-global_ev_v1)/(global_ev_v2-global_ev_v1), global_ev_ctlPoints);
695
697
698
699#ifdef AVOID_ZERO_NORMAL
700
701 if(myabs(dv[0]) <= MYZERO && myabs(dv[1]) <= MYZERO && myabs(dv[2]) <= MYZERO)
702 {
703
704 REAL tempdu[4];
705 REAL tempdata[4];
708 if(u-MYDELTA*(u2-u1) < u1)
709 u = u+ MYDELTA*(u2-u1);
710 else
711 u = u-MYDELTA*(u2-u1);
713 }
714 if(myabs(du[0]) <= MYZERO && myabs(du[1]) <= MYZERO && myabs(du[2]) <= MYZERO)
715 {
716 REAL tempdv[4];
717 REAL tempdata[4];
720 if(v-MYDELTA*(v2-v1) < v1)
721 v = v+ MYDELTA*(v2-v1);
722 else
723 v = v-MYDELTA*(v2-v1);
725 }
726#endif
727
728 /*compute normal*/
729 switch(global_ev_k){
730 case 3:
731 inComputeNormal2(du, dv, retNormal);
732 break;
733 case 4:
734 inComputeFirstPartials(retPoint, du, dv);
735 inComputeNormal2(du, dv, retNormal);
736 /*transform the homegeneous coordinate of retPoint into inhomogenous one*/
737 retPoint[0] /= retPoint[3];
738 retPoint[1] /= retPoint[3];
739 retPoint[2] /= retPoint[3];
740 break;
741 }
742}
void inDoDomain2WithDerivsBV(int k, REAL u, REAL v, REAL u1, REAL u2, int uorder, REAL v1, REAL v2, int vorder, REAL *baseData, REAL *retPoint, REAL *retdu, REAL *retdv)
Definition: insurfeval.cc:903

Referenced by inEvalULine().

◆ inEvalCoord2f()

void OpenGLSurfaceEvaluator::inEvalCoord2f ( REAL  u,
REAL  v 
)
private

Definition at line 375 of file insurfeval.cc.

376{
377
378 REAL point[4];
379 REAL normal[3];
381}
void inDoEvalCoord2(REAL u, REAL v, REAL *retPoint, REAL *retNormal)
Definition: insurfeval.cc:541
POINTL point
Definition: edittest.c:50

Referenced by coord2f(), and inBPMEval().

◆ inEvalMesh2()

void OpenGLSurfaceEvaluator::inEvalMesh2 ( int  lowU,
int  lowV,
int  highU,
int  highV 
)
private

Definition at line 400 of file insurfeval.cc.

401{
402 REAL du, dv;
403 int i,j;
404 REAL point[4];
405 REAL normal[3];
406 if(global_grid_nu == 0 || global_grid_nv == 0)
407 return; /*no points need to be output*/
410
412 for(i=lowU; i<highU; i++){
414 REAL u2 = ((i+1) == global_grid_nu)? global_grid_u1: (global_grid_u0+(i+1)*du);
415
416 bgnqstrip();
417 for(j=highV; j>=lowV; j--){
419
422 }
423 endqstrip();
424 }
425 }
426
427 else{
428 for(i=lowV; i<highV; i++){
430 REAL v2 = ((i+1) == global_grid_nv)? global_grid_v1: (global_grid_v0+(i+1)*dv);
431
432 bgnqstrip();
433 for(j=highU; j>=lowU; j--){
437 }
438 endqstrip();
439 }
440 }
441
442}

Referenced by mapmesh2f().

◆ inEvalPoint2()

void OpenGLSurfaceEvaluator::inEvalPoint2 ( int  i,
int  j 
)
private

Definition at line 362 of file insurfeval.cc.

Referenced by point2i().

◆ inEvalULine()

void OpenGLSurfaceEvaluator::inEvalULine ( int  n_points,
REAL  v,
REAL u_vals,
int  stride,
REAL  ret_points[][3],
REAL  ret_normals[][3] 
)
private

Definition at line 1125 of file insurfeval.cc.

1127{
1128 int i,k;
1129 REAL temp[4];
1131
1132 for(i=0,k=0; i<n_points; i++, k += stride)
1133 {
1134 inDoEvalCoord2NOGE_BV(u_vals[k],v,temp, ret_normals[i]);
1135
1136 ret_points[i][0] = temp[0];
1137 ret_points[i][1] = temp[1];
1138 ret_points[i][2] = temp[2];
1139
1140 }
1141
1142}
void inPreEvaluateBV_intfac(REAL v)
Definition: glsurfeval.h:316
void inDoEvalCoord2NOGE_BV(REAL u, REAL v, REAL *retPoint, REAL *retNormal)
Definition: insurfeval.cc:684
GLsizei stride
Definition: glext.h:5848

Referenced by inEvalUStrip().

◆ inEvalUStrip()

void OpenGLSurfaceEvaluator::inEvalUStrip ( int  n_upper,
REAL  v_upper,
REAL upper_val,
int  n_lower,
REAL  v_lower,
REAL lower_val 
)
private

Definition at line 1166 of file insurfeval.cc.

1167{
1168 int i,j,k,l;
1169 REAL leftMostV[2];
1170 typedef REAL REAL3[3];
1171
1172 REAL3* upperXYZ = (REAL3*) malloc(sizeof(REAL3)*n_upper);
1173 assert(upperXYZ);
1174 REAL3* upperNormal = (REAL3*) malloc(sizeof(REAL3) * n_upper);
1175 assert(upperNormal);
1176 REAL3* lowerXYZ = (REAL3*) malloc(sizeof(REAL3)*n_lower);
1177 assert(lowerXYZ);
1178 REAL3* lowerNormal = (REAL3*) malloc(sizeof(REAL3) * n_lower);
1179 assert(lowerNormal);
1180
1181 inEvalULine(n_upper, v_upper, upper_val, 1, upperXYZ, upperNormal);
1182 inEvalULine(n_lower, v_lower, lower_val, 1, lowerXYZ, lowerNormal);
1183
1184
1185
1186 REAL* leftMostXYZ;
1187 REAL* leftMostNormal;
1188
1189 /*
1190 *the algorithm works by scanning from left to right.
1191 *leftMostV: the left most of the remaining verteces (on both upper and lower).
1192 * it could an element of upperVerts or lowerVerts.
1193 *i: upperVerts[i] is the first vertex to the right of leftMostV on upper line *j: lowerVerts[j] is the first vertex to the right of leftMostV on lower line */
1194
1195 /*initialize i,j,and leftMostV
1196 */
1197 if(upper_val[0] <= lower_val[0])
1198 {
1199 i=1;
1200 j=0;
1201
1202 leftMostV[0] = upper_val[0];
1203 leftMostV[1] = v_upper;
1204 leftMostXYZ = upperXYZ[0];
1205 leftMostNormal = upperNormal[0];
1206 }
1207 else
1208 {
1209 i=0;
1210 j=1;
1211
1212 leftMostV[0] = lower_val[0];
1213 leftMostV[1] = v_lower;
1214
1215 leftMostXYZ = lowerXYZ[0];
1216 leftMostNormal = lowerNormal[0];
1217 }
1218
1219 /*the main loop.
1220 *the invariance is that:
1221 *at the beginning of each loop, the meaning of i,j,and leftMostV are
1222 *maintained
1223 */
1224 while(1)
1225 {
1226 if(i >= n_upper) /*case1: no more in upper*/
1227 {
1228 if(j<n_lower-1) /*at least two vertices in lower*/
1229 {
1230 bgntfan();
1231 glNormal3fv(leftMostNormal);
1232 glVertex3fv(leftMostXYZ);
1233
1234 while(j<n_lower){
1235 glNormal3fv(lowerNormal[j]);
1236 glVertex3fv(lowerXYZ[j]);
1237 j++;
1238
1239 }
1240 endtfan();
1241 }
1242 break; /*exit the main loop*/
1243 }
1244 else if(j>= n_lower) /*case2: no more in lower*/
1245 {
1246 if(i<n_upper-1) /*at least two vertices in upper*/
1247 {
1248 bgntfan();
1249 glNormal3fv(leftMostNormal);
1250 glVertex3fv(leftMostXYZ);
1251
1252 for(k=n_upper-1; k>=i; k--) /*reverse order for two-side lighting*/
1253 {
1254 glNormal3fv(upperNormal[k]);
1255 glVertex3fv(upperXYZ[k]);
1256 }
1257
1258 endtfan();
1259 }
1260 break; /*exit the main loop*/
1261 }
1262 else /* case3: neither is empty, plus the leftMostV, there is at least one triangle to output*/
1263 {
1264 if(upper_val[i] <= lower_val[j])
1265 {
1266 bgntfan();
1267
1268 glNormal3fv(lowerNormal[j]);
1269 glVertex3fv(lowerXYZ[j]);
1270
1271 /*find the last k>=i such that
1272 *upperverts[k][0] <= lowerverts[j][0]
1273 */
1274 k=i;
1275
1276 while(k<n_upper)
1277 {
1278 if(upper_val[k] > lower_val[j])
1279 break;
1280 k++;
1281
1282 }
1283 k--;
1284
1285
1286 for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
1287 {
1288 glNormal3fv(upperNormal[l]);
1289 glVertex3fv(upperXYZ[l]);
1290
1291 }
1292 glNormal3fv(leftMostNormal);
1293 glVertex3fv(leftMostXYZ);
1294
1295 endtfan();
1296
1297 /*update i and leftMostV for next loop
1298 */
1299 i = k+1;
1300
1301 leftMostV[0] = upper_val[k];
1302 leftMostV[1] = v_upper;
1303 leftMostNormal = upperNormal[k];
1304 leftMostXYZ = upperXYZ[k];
1305 }
1306 else /*upperVerts[i][0] > lowerVerts[j][0]*/
1307 {
1308 bgntfan();
1309 glNormal3fv(upperNormal[i]);
1310 glVertex3fv(upperXYZ[i]);
1311
1312 glNormal3fv(leftMostNormal);
1313 glVertex3fv(leftMostXYZ);
1314
1315
1316 /*find the last k>=j such that
1317 *lowerverts[k][0] < upperverts[i][0]
1318 */
1319 k=j;
1320 while(k< n_lower)
1321 {
1322 if(lower_val[k] >= upper_val[i])
1323 break;
1324 glNormal3fv(lowerNormal[k]);
1325 glVertex3fv(lowerXYZ[k]);
1326
1327 k++;
1328 }
1329 endtfan();
1330
1331 /*update j and leftMostV for next loop
1332 */
1333 j=k;
1334 leftMostV[0] = lower_val[j-1];
1335 leftMostV[1] = v_lower;
1336
1337 leftMostNormal = lowerNormal[j-1];
1338 leftMostXYZ = lowerXYZ[j-1];
1339 }
1340 }
1341 }
1342 //clean up
1343 free(upperXYZ);
1344 free(lowerXYZ);
1345 free(upperNormal);
1346 free(lowerNormal);
1347}
void inEvalULine(int n_points, REAL v, REAL *u_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3])
Definition: insurfeval.cc:1125
#define free
Definition: debug_ros.c:5

Referenced by evalUStrip().

◆ inEvalVLine()

void OpenGLSurfaceEvaluator::inEvalVLine ( int  n_points,
REAL  u,
REAL v_vals,
int  stride,
REAL  ret_points[][3],
REAL  ret_normals[][3] 
)
private

Definition at line 1144 of file insurfeval.cc.

1146{
1147 int i,k;
1148 REAL temp[4];
1150 for(i=0,k=0; i<n_points; i++, k += stride)
1151 {
1152 inDoEvalCoord2NOGE_BU(u, v_vals[k], temp, ret_normals[i]);
1153 ret_points[i][0] = temp[0];
1154 ret_points[i][1] = temp[1];
1155 ret_points[i][2] = temp[2];
1156 }
1157}
void inDoEvalCoord2NOGE_BU(REAL u, REAL v, REAL *retPoint, REAL *retNormal)
Definition: insurfeval.cc:621
void inPreEvaluateBU_intfac(REAL u)
Definition: glsurfeval.h:321

Referenced by inEvalVStrip().

◆ inEvalVStrip()

void OpenGLSurfaceEvaluator::inEvalVStrip ( int  n_left,
REAL  u_left,
REAL left_val,
int  n_right,
REAL  u_right,
REAL right_val 
)
private

Definition at line 1355 of file insurfeval.cc.

1356{
1357 int i,j,k,l;
1358 REAL botMostV[2];
1359 typedef REAL REAL3[3];
1360
1361 REAL3* leftXYZ = (REAL3*) malloc(sizeof(REAL3)*n_left);
1362 assert(leftXYZ);
1363 REAL3* leftNormal = (REAL3*) malloc(sizeof(REAL3) * n_left);
1364 assert(leftNormal);
1365 REAL3* rightXYZ = (REAL3*) malloc(sizeof(REAL3)*n_right);
1366 assert(rightXYZ);
1367 REAL3* rightNormal = (REAL3*) malloc(sizeof(REAL3) * n_right);
1368 assert(rightNormal);
1369
1370 inEvalVLine(n_left, u_left, left_val, 1, leftXYZ, leftNormal);
1371 inEvalVLine(n_right, u_right, right_val, 1, rightXYZ, rightNormal);
1372
1373
1374
1375 REAL* botMostXYZ;
1376 REAL* botMostNormal;
1377
1378 /*
1379 *the algorithm works by scanning from bot to top.
1380 *botMostV: the bot most of the remaining verteces (on both left and right).
1381 * it could an element of leftVerts or rightVerts.
1382 *i: leftVerts[i] is the first vertex to the top of botMostV on left line
1383 *j: rightVerts[j] is the first vertex to the top of botMostV on rightline */
1384
1385 /*initialize i,j,and botMostV
1386 */
1387 if(left_val[0] <= right_val[0])
1388 {
1389 i=1;
1390 j=0;
1391
1392 botMostV[0] = u_left;
1393 botMostV[1] = left_val[0];
1394 botMostXYZ = leftXYZ[0];
1395 botMostNormal = leftNormal[0];
1396 }
1397 else
1398 {
1399 i=0;
1400 j=1;
1401
1402 botMostV[0] = u_right;
1403 botMostV[1] = right_val[0];
1404
1405 botMostXYZ = rightXYZ[0];
1406 botMostNormal = rightNormal[0];
1407 }
1408
1409 /*the main loop.
1410 *the invariance is that:
1411 *at the beginning of each loop, the meaning of i,j,and botMostV are
1412 *maintained
1413 */
1414 while(1)
1415 {
1416 if(i >= n_left) /*case1: no more in left*/
1417 {
1418 if(j<n_right-1) /*at least two vertices in right*/
1419 {
1420 bgntfan();
1421 glNormal3fv(botMostNormal);
1422 glVertex3fv(botMostXYZ);
1423
1424 while(j<n_right){
1425 glNormal3fv(rightNormal[j]);
1426 glVertex3fv(rightXYZ[j]);
1427 j++;
1428
1429 }
1430 endtfan();
1431 }
1432 break; /*exit the main loop*/
1433 }
1434 else if(j>= n_right) /*case2: no more in right*/
1435 {
1436 if(i<n_left-1) /*at least two vertices in left*/
1437 {
1438 bgntfan();
1439 glNormal3fv(botMostNormal);
1440 glVertex3fv(botMostXYZ);
1441
1442 for(k=n_left-1; k>=i; k--) /*reverse order for two-side lighting*/
1443 {
1444 glNormal3fv(leftNormal[k]);
1445 glVertex3fv(leftXYZ[k]);
1446 }
1447
1448 endtfan();
1449 }
1450 break; /*exit the main loop*/
1451 }
1452 else /* case3: neither is empty, plus the botMostV, there is at least one triangle to output*/
1453 {
1454 if(left_val[i] <= right_val[j])
1455 {
1456 bgntfan();
1457
1458 glNormal3fv(rightNormal[j]);
1459 glVertex3fv(rightXYZ[j]);
1460
1461 /*find the last k>=i such that
1462 *leftverts[k][0] <= rightverts[j][0]
1463 */
1464 k=i;
1465
1466 while(k<n_left)
1467 {
1468 if(left_val[k] > right_val[j])
1469 break;
1470 k++;
1471
1472 }
1473 k--;
1474
1475
1476 for(l=k; l>=i; l--)/*the reverse is for two-side lighting*/
1477 {
1478 glNormal3fv(leftNormal[l]);
1479 glVertex3fv(leftXYZ[l]);
1480
1481 }
1482 glNormal3fv(botMostNormal);
1483 glVertex3fv(botMostXYZ);
1484
1485 endtfan();
1486
1487 /*update i and botMostV for next loop
1488 */
1489 i = k+1;
1490
1491 botMostV[0] = u_left;
1492 botMostV[1] = left_val[k];
1493 botMostNormal = leftNormal[k];
1494 botMostXYZ = leftXYZ[k];
1495 }
1496 else /*left_val[i] > right_val[j])*/
1497 {
1498 bgntfan();
1499 glNormal3fv(leftNormal[i]);
1500 glVertex3fv(leftXYZ[i]);
1501
1502 glNormal3fv(botMostNormal);
1503 glVertex3fv(botMostXYZ);
1504
1505
1506 /*find the last k>=j such that
1507 *rightverts[k][0] < leftverts[i][0]
1508 */
1509 k=j;
1510 while(k< n_right)
1511 {
1512 if(right_val[k] >= left_val[i])
1513 break;
1514 glNormal3fv(rightNormal[k]);
1515 glVertex3fv(rightXYZ[k]);
1516
1517 k++;
1518 }
1519 endtfan();
1520
1521 /*update j and botMostV for next loop
1522 */
1523 j=k;
1524 botMostV[0] = u_right;
1525 botMostV[1] = right_val[j-1];
1526
1527 botMostNormal = rightNormal[j-1];
1528 botMostXYZ = rightXYZ[j-1];
1529 }
1530 }
1531 }
1532 //clean up
1533 free(leftXYZ);
1534 free(rightXYZ);
1535 free(leftNormal);
1536 free(rightNormal);
1537}
void inEvalVLine(int n_points, REAL u, REAL *v_vals, int stride, REAL ret_points[][3], REAL ret_normals[][3])
Definition: insurfeval.cc:1144

Referenced by evalVStrip().

◆ inMap2f()

void OpenGLSurfaceEvaluator::inMap2f ( int  k,
REAL  ulower,
REAL  uupper,
int  ustride,
int  uorder,
REAL  vlower,
REAL  vupper,
int  vstride,
int  vorder,
REAL ctlPoints 
)
private

Definition at line 444 of file insurfeval.cc.

454{
455 int i,j,x;
457
458
459
460 if(k == GL_MAP2_VERTEX_3) k=3;
461 else if (k==GL_MAP2_VERTEX_4) k =4;
462 else {
463 printf("error in inMap2f, maptype=%i is wrong, k,map is not updated\n", k);
464 return;
465 }
466
467 global_ev_k = k;
468 global_ev_u1 = ulower;
469 global_ev_u2 = uupper;
472 global_ev_v1 = vlower;
473 global_ev_v2 = vupper;
476
477 /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/
478 for (i=0; i<uorder; i++) {
479 for (j=0; j<vorder; j++) {
480 for (x=0; x<k; x++) {
481 data[x] = ctlPoints[x];
482 }
483 ctlPoints += vstride;
484 data += k;
485 }
486 ctlPoints += ustride - vstride * vorder;
487 }
488
489}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548

Referenced by inBPMEval(), and map2f().

◆ inMap2fEM()

void OpenGLSurfaceEvaluator::inMap2fEM ( int  which,
int  dimension,
REAL  ulower,
REAL  uupper,
int  ustride,
int  uorder,
REAL  vlower,
REAL  vupper,
int  vstride,
int  vorder,
REAL ctlPoints 
)
private

Definition at line 1540 of file insurfeval.cc.

1550{
1551 int i,j,x;
1552 surfEvalMachine *temp_em;
1553 switch(which){
1554 case 0: //vertex
1555 vertex_flag = 1;
1556 temp_em = &em_vertex;
1557 break;
1558 case 1: //normal
1559 normal_flag = 1;
1560 temp_em = &em_normal;
1561 break;
1562 case 2: //color
1563 color_flag = 1;
1564 temp_em = &em_color;
1565 break;
1566 default:
1567 texcoord_flag = 1;
1568 temp_em = &em_texcoord;
1569 break;
1570 }
1571
1572 REAL *data = temp_em->ctlPoints;
1573
1574 temp_em->uprime = -1;//initilized
1575 temp_em->vprime = -1;
1576
1577 temp_em->k = k;
1578 temp_em->u1 = ulower;
1579 temp_em->u2 = uupper;
1580 temp_em->ustride = ustride;
1581 temp_em->uorder = uorder;
1582 temp_em->v1 = vlower;
1583 temp_em->v2 = vupper;
1584 temp_em->vstride = vstride;
1585 temp_em->vorder = vorder;
1586
1587 /*copy the contrl points from ctlPoints to global_ev_ctlPoints*/
1588 for (i=0; i<uorder; i++) {
1589 for (j=0; j<vorder; j++) {
1590 for (x=0; x<k; x++) {
1591 data[x] = ctlPoints[x];
1592 }
1593 ctlPoints += vstride;
1594 data += k;
1595 }
1596 ctlPoints += ustride - vstride * vorder;
1597 }
1598}

Referenced by inBPMEvalEM().

◆ inMapGrid2f()

void OpenGLSurfaceEvaluator::inMapGrid2f ( int  nu,
REAL  u0,
REAL  u1,
int  nv,
REAL  v0,
REAL  v1 
)
private

Definition at line 389 of file insurfeval.cc.

391{
392 global_grid_u0 = u0;
394 global_grid_nu = nu;
397 global_grid_nv = nv;
398}

Referenced by mapgrid2f().

◆ inPreEvaluate()

void OpenGLSurfaceEvaluator::inPreEvaluate ( int  order,
REAL  vprime,
REAL coeff 
)
private

Definition at line 1022 of file insurfeval.cc.

1023{
1024 int i, j;
1025 REAL oldval, temp;
1026 REAL oneMinusvprime;
1027
1028 /*
1029 * Minor optimization
1030 * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to
1031 * their i==1 loop values to avoid the initialization and the i==1 loop.
1032 */
1033 if (order == 1) {
1034 coeff[0] = 1.0;
1035 return;
1036 }
1037
1038 oneMinusvprime = 1-vprime;
1039 coeff[0] = oneMinusvprime;
1040 coeff[1] = vprime;
1041 if (order == 2) return;
1042
1043 for (i = 2; i < order; i++) {
1044 oldval = coeff[0] * vprime;
1045 coeff[0] = oneMinusvprime * coeff[0];
1046 for (j = 1; j < i; j++) {
1047 temp = oldval;
1048 oldval = coeff[j] * vprime;
1049 coeff[j] = temp + oneMinusvprime * coeff[j];
1050 }
1051 coeff[j] = oldval;
1052 }
1053}
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194

Referenced by inDoDomain2EM().

◆ inPreEvaluateBU()

void OpenGLSurfaceEvaluator::inPreEvaluateBU ( int  k,
int  uorder,
int  vorder,
REAL  uprime,
REAL baseData 
)
private

Definition at line 838 of file insurfeval.cc.

839{
840 int j,row,col;
841 REAL p, pdu;
842 REAL *data;
843
844 if(global_uprime != uprime || global_uorder != uorder) {
846 global_uprime = uprime;
848 }
849
850 for(j=0; j<k; j++){
851 data = baseData+j;
852 for(col=0; col<vorder; col++){
853 data = baseData+j + k*col;
854 p = global_ucoeff[0] * (*data);
855 pdu = global_ucoeffDeriv[0] * (*data);
856 data += k*uorder;
857 for(row = 1; row < uorder; row++){
858 p += global_ucoeff[row] * (*data);
859 pdu += global_ucoeffDeriv[row] * (*data);
860 data += k * uorder;
861 }
862 global_BU[col][j] = p;
863 global_PBU[col][j] = pdu;
864 }
865 }
866}

Referenced by inPreEvaluateBU_intfac().

◆ inPreEvaluateBU_intfac()

void OpenGLSurfaceEvaluator::inPreEvaluateBU_intfac ( REAL  u)
inlineprivatevirtual

Implements BasicSurfaceEvaluator.

Definition at line 321 of file glsurfeval.h.

322 {
324 }
void inPreEvaluateBU(int k, int uorder, int vorder, REAL uprime, REAL *baseData)
Definition: insurfeval.cc:838

Referenced by inEvalVLine().

◆ inPreEvaluateBV()

void OpenGLSurfaceEvaluator::inPreEvaluateBV ( int  k,
int  uorder,
int  vorder,
REAL  vprime,
REAL baseData 
)
private

Definition at line 809 of file insurfeval.cc.

810{
811 int j,row,col;
812 REAL p, pdv;
813 REAL *data;
814
815 if(global_vprime != vprime || global_vorder != vorder) {
817 global_vprime = vprime;
819 }
820
821 for(j=0; j<k; j++){
822 data = baseData+j;
823 for(row=0; row<uorder; row++){
824 p = global_vcoeff[0] * (*data);
825 pdv = global_vcoeffDeriv[0] * (*data);
826 data += k;
827 for(col = 1; col < vorder; col++){
828 p += global_vcoeff[col] * (*data);
829 pdv += global_vcoeffDeriv[col] * (*data);
830 data += k;
831 }
832 global_BV[row][j] = p;
833 global_PBV[row][j] = pdv;
834 }
835 }
836}

Referenced by inPreEvaluateBV_intfac().

◆ inPreEvaluateBV_intfac()

void OpenGLSurfaceEvaluator::inPreEvaluateBV_intfac ( REAL  v)
inlineprivatevirtual

Implements BasicSurfaceEvaluator.

Definition at line 316 of file glsurfeval.h.

317 {
319 }
void inPreEvaluateBV(int k, int uorder, int vorder, REAL vprime, REAL *baseData)
Definition: insurfeval.cc:809

Referenced by inEvalULine().

◆ inPreEvaluateWithDeriv()

void OpenGLSurfaceEvaluator::inPreEvaluateWithDeriv ( int  order,
REAL  vprime,
REAL coeff,
REAL coeffDeriv 
)
private

Definition at line 1066 of file insurfeval.cc.

1068{
1069 int i, j;
1070 REAL oldval, temp;
1071 REAL oneMinusvprime;
1072
1073 oneMinusvprime = 1-vprime;
1074 /*
1075 * Minor optimization
1076 * Compute orders 1 and 2 outright, and set coeff[0], coeff[1] to
1077 * their i==1 loop values to avoid the initialization and the i==1 loop.
1078 */
1079 if (order == 1) {
1080 coeff[0] = 1.0;
1081 coeffDeriv[0] = 0.0;
1082 return;
1083 } else if (order == 2) {
1084 coeffDeriv[0] = -1.0;
1085 coeffDeriv[1] = 1.0;
1086 coeff[0] = oneMinusvprime;
1087 coeff[1] = vprime;
1088 return;
1089 }
1090 coeff[0] = oneMinusvprime;
1091 coeff[1] = vprime;
1092 for (i = 2; i < order - 1; i++) {
1093 oldval = coeff[0] * vprime;
1094 coeff[0] = oneMinusvprime * coeff[0];
1095 for (j = 1; j < i; j++) {
1096 temp = oldval;
1097 oldval = coeff[j] * vprime;
1098 coeff[j] = temp + oneMinusvprime * coeff[j];
1099 }
1100 coeff[j] = oldval;
1101 }
1102 coeffDeriv[0] = -coeff[0];
1103 /*
1104 ** Minor optimization:
1105 ** Would make this a "for (j=1; j<order-1; j++)" loop, but it is always
1106 ** executed at least once, so this is more efficient.
1107 */
1108 j=1;
1109 do {
1110 coeffDeriv[j] = coeff[j-1] - coeff[j];
1111 j++;
1112 } while (j < order - 1);
1113 coeffDeriv[j] = coeff[j-1];
1114
1115 oldval = coeff[0] * vprime;
1116 coeff[0] = oneMinusvprime * coeff[0];
1117 for (j = 1; j < i; j++) {
1118 temp = oldval;
1119 oldval = coeff[j] * vprime;
1120 coeff[j] = temp + oneMinusvprime * coeff[j];
1121 }
1122 coeff[j] = oldval;
1123}

Referenced by inDoDomain2WithDerivs(), inDoDomain2WithDerivsBU(), inDoDomain2WithDerivsBV(), inDoDomain2WithDerivsEM(), inPreEvaluateBU(), and inPreEvaluateBV().

◆ LOD_eval()

void OpenGLSurfaceEvaluator::LOD_eval ( int  num_vert,
REAL verts,
int  type,
int  level 
)
private

Referenced by inBPMEvalEM().

◆ LOD_eval_list()

void OpenGLSurfaceEvaluator::LOD_eval_list ( int  level)

Definition at line 84 of file glsurfeval.cc.

85{
86 if(level == 0)
88 else if(level == 1)
90 else if(level == 2)
92 else
94
96}
GLint level
Definition: gl.h:1546

Referenced by GLUnurbs::LOD_eval_list().

◆ LOD_triangle()

void OpenGLSurfaceEvaluator::LOD_triangle ( REAL  A[2],
REAL  B[2],
REAL  C[2],
int  level 
)
private

◆ map2f()

void OpenGLSurfaceEvaluator::map2f ( long  _type,
REAL  _ulower,
REAL  _uupper,
long  _ustride,
long  _uorder,
REAL  _vlower,
REAL  _vupper,
long  _vstride,
long  _vorder,
REAL pts 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 872 of file glsurfeval.cc.

883{
884#ifdef USE_INTERNAL_EVAL
885 inMap2f((int) _type, (REAL) _ulower, (REAL) _uupper,
886 (int) _ustride, (int) _uorder, (REAL) _vlower,
887 (REAL) _vupper, (int) _vstride, (int) _vorder,
888 (REAL *) pts);
889#else
890
891
892
894 {
895 if(global_bpm == NULL)
897 if(
898 (global_bpm->bpatch == NULL &&
899 (_type == GL_MAP2_VERTEX_3 || _type == GL_MAP2_VERTEX_4))
900 ||
902 (_type == GL_MAP2_NORMAL))
903 ||
905 (_type == GL_MAP2_INDEX || _type == GL_MAP2_COLOR_4))
906 ||
908 (_type == GL_MAP2_TEXTURE_COORD_1 ||
909 _type == GL_MAP2_TEXTURE_COORD_2 ||
910 _type == GL_MAP2_TEXTURE_COORD_3 ||
911 _type == GL_MAP2_TEXTURE_COORD_4 )
912 ))
913 {
914 bezierPatchMeshPutPatch(global_bpm, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts);
915 }
916 else /*new surface patch (with multiple maps) starts*/
917 {
919 bezierPatchMeshPutPatch(temp, (int) _type, _ulower, _uupper,(int) _ustride,(int) _uorder,_vlower, _vupper, (int) _vstride, (int) _vorder, pts);
921
922 /*
923 global_bpm = bezierPatchMeshListInsert(global_bpm,
924 bezierPatchMeshMake(
925 (int) _type, _ulower, _uupper,(int) _ustride, (int) _uorder, _vlower, _vupper, (int) _vstride, (int) _vorder, pts, 10, 10));
926 */
927 }
928 }
929 else /*not output triangles*/
930 {
931 glMap2f((GLenum) _type, (GLfloat) _ulower, (GLfloat) _uupper,
932 (GLint) _ustride, (GLint) _uorder, (GLfloat) _vlower,
933 (GLfloat) _vupper, (GLint) _vstride, (GLint) _vorder,
934 (const GLfloat *) pts);
935 }
936
937#endif
938}
void bezierPatchMeshPutPatch(bezierPatchMesh *bpm, int maptype, float umin, float umax, int ustride, int uorder, float vmin, float vmax, int vstride, int vorder, float *ctlpoints)
bezierPatchMesh * bezierPatchMeshListInsert(bezierPatchMesh *list, bezierPatchMesh *bpm)
bezierPatchMesh * bezierPatchMeshMake2(int size_UVarray, int size_length_array)
#define GL_MAP2_NORMAL
Definition: gl.h:562
#define GL_MAP2_INDEX
Definition: gl.h:561
#define GL_MAP2_TEXTURE_COORD_2
Definition: gl.h:564
#define GL_MAP2_TEXTURE_COORD_4
Definition: gl.h:566
#define GL_MAP2_COLOR_4
Definition: gl.h:560
#define GL_MAP2_TEXTURE_COORD_1
Definition: gl.h:563
#define GL_MAP2_TEXTURE_COORD_3
Definition: gl.h:565

◆ mapgrid2f()

void OpenGLSurfaceEvaluator::mapgrid2f ( long  nu,
REAL  u0,
REAL  u1,
long  nv,
REAL  v0,
REAL  v1 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 195 of file glsurfeval.cc.

196{
197#ifdef USE_INTERNAL_EVAL
198 inMapGrid2f((int) nu, (REAL) u0, (REAL) u1, (int) nv,
199 (REAL) v0, (REAL) v1);
200#else
201
203 {
204 global_grid_u0 = u0;
206 global_grid_nu = nu;
209 global_grid_nv = nv;
210 }
211 else
212 glMapGrid2d((GLint) nu, (GLdouble) u0, (GLdouble) u1, (GLint) nv,
213 (GLdouble) v0, (GLdouble) v1);
214
215#endif
216}
void inMapGrid2f(int nu, REAL u0, REAL u1, int nv, REAL v0, REAL v1)
Definition: insurfeval.cc:389
double GLdouble
Definition: gl.h:163
GLAPI void GLAPIENTRY glMapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)

◆ mapmesh2f()

void OpenGLSurfaceEvaluator::mapmesh2f ( long  style,
long  umin,
long  umax,
long  vmin,
long  vmax 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 946 of file glsurfeval.cc.

947{
948#ifdef NO_EVALUATION
949return;
950#endif
951
952#ifdef USE_INTERNAL_EVAL
953 inEvalMesh2((int)umin, (int)vmin, (int)umax, (int)vmax);
954#else
955
956
957
959{
960#ifdef USE_LOD
968
969#else
970
971 REAL du, dv;
972 long i,j;
973 if(global_grid_nu == 0 || global_grid_nv == 0)
974 return; /*no points need to be output*/
977
979
980 for(i=umin; i<umax; i++){
982 REAL u2 = ((i+1) == global_grid_nu)? global_grid_u1: (global_grid_u0+(i+1)*du);
983
984 bgnqstrip();
985 for(j=vmax; j>=vmin; j--){
987
988 coord2f(u1, v1);
989 coord2f(u2, v1);
990 }
991 endqstrip();
992 }
993 }
994 else{
995
996 for(i=vmin; i<vmax; i++){
998 REAL v2 = ((i+1) == global_grid_nv)? global_grid_v1: (global_grid_v0+(i+1)*dv);
999
1000 bgnqstrip();
1001 for(j=umax; j>=umin; j--){
1003 coord2f(u1, v2);
1004 coord2f(u1, v1);
1005 }
1006 endqstrip();
1007 }
1008 }
1009#endif
1010}
1011else
1012{
1013 switch(style) {
1014 default:
1015 case N_MESHFILL:
1016 glEvalMesh2((GLenum) GL_FILL, (GLint) umin, (GLint) umax,
1017 (GLint) vmin, (GLint) vmax);
1018 break;
1019 case N_MESHLINE:
1020 glEvalMesh2((GLenum) GL_LINE, (GLint) umin, (GLint) umax,
1021 (GLint) vmin, (GLint) vmax);
1022 break;
1023 case N_MESHPOINT:
1024 glEvalMesh2((GLenum) GL_POINT, (GLint) umin, (GLint) umax,
1025 (GLint) vmin, (GLint) vmax);
1026 break;
1027 }
1028 }
1029
1030#endif
1031
1032#ifdef STATISTICS
1033 STAT_num_of_quad_strips += (umax-umin)*(vmax-vmin);
1034#endif
1035}
Arabic default style
Definition: afstyles.h:94
void inEvalMesh2(int lowU, int lowV, int highU, int highV)
Definition: insurfeval.cc:400
#define N_MESHFILL
Definition: displaymode.h:36
#define N_MESHLINE
Definition: displaymode.h:37
#define N_MESHPOINT
Definition: displaymode.h:38
#define GL_POINT
Definition: gl.h:265
#define GL_LINE
Definition: gl.h:266

◆ newtmeshvert() [1/2]

void OpenGLSurfaceEvaluator::newtmeshvert ( long  u,
long  v 
)

Definition at line 1134 of file glsurfeval.cc.

1135{
1136#ifdef NO_EVALUATION
1137return;
1138#else
1139
1140 if (tmeshing) {
1141
1142 if (vcount == 2) {
1143 vertexCache[0]->invoke(this);
1144 vertexCache[1]->invoke(this);
1145 point2i( u, v);
1146
1147 } else {
1148 vcount++;
1149 }
1150
1152 which = 1 - which;
1153 } else {
1154 point2i( u, v);
1155 }
1156#endif
1157}
void point2i(long, long)
Definition: glsurfeval.cc:1069
void saveEvalPoint(long x, long y)
Definition: glsurfeval.h:90
void invoke(OpenGLSurfaceEvaluator *eval)
Definition: glsurfeval.h:390

◆ newtmeshvert() [2/2]

void OpenGLSurfaceEvaluator::newtmeshvert ( REAL  u,
REAL  v 
)

Definition at line 1160 of file glsurfeval.cc.

1161{
1162#ifdef NO_EVALUATION
1163return;
1164#else
1165 if (tmeshing) {
1166
1167
1168 if (vcount == 2) {
1169 vertexCache[0]->invoke(this);
1170 vertexCache[1]->invoke(this);
1171 coord2f(u,v);
1172
1173 } else {
1174 vcount++;
1175 }
1176
1178 which = 1 - which;
1179 } else {
1180
1181 coord2f( u, v);
1182 }
1183#endif
1184
1185}
void saveEvalCoord(REAL x, REAL y)
Definition: glsurfeval.h:88

Referenced by evalcoord2f(), and evalpoint2i().

◆ normalCallBack()

void OpenGLSurfaceEvaluator::normalCallBack ( const GLfloat normal,
void data 
)
private

Definition at line 1265 of file glsurfeval.cc.

1266{
1267 if(normalCallBackData)
1268 normalCallBackData(normal, data);
1269 else if(normalCallBackN)
1270 normalCallBackN(normal);
1271}

Referenced by inBPMEval(), inBPMEvalEM(), and inDoEvalCoord2EM().

◆ point2i()

void OpenGLSurfaceEvaluator::point2i ( long  u,
long  v 
)

Definition at line 1069 of file glsurfeval.cc.

1070{
1071#ifdef NO_EVALUATION
1072return;
1073#else
1074
1075#ifdef USE_INTERNAL_EVAL
1076 inEvalPoint2( (int)u, (int)v);
1077#else
1078
1079
1081{
1082
1083 REAL du, dv;
1084 REAL fu,fv;
1089 coord2f(fu,fv);
1090}
1091else
1092 glEvalPoint2((GLint) u, (GLint) v);
1093
1094
1095#endif
1096
1097#ifdef STATISTICS
1098 STAT_num_of_eval_vertices++;
1099#endif
1100
1101#endif
1102
1103}
void inEvalPoint2(int i, int j)
Definition: insurfeval.cc:362
GLAPI void GLAPIENTRY glEvalPoint2(GLint i, GLint j)

Referenced by StoredVertex::invoke(), and newtmeshvert().

◆ polymode()

void OpenGLSurfaceEvaluator::polymode ( long  style)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 219 of file glsurfeval.cc.

220{
221 if(! output_triangles)
222 {
223 switch(style) {
224 default:
225 case N_MESHFILL:
226
228 break;
229 case N_MESHLINE:
231 break;
232 case N_MESHPOINT:
234 break;
235 }
236 }
237}
#define GL_FRONT_AND_BACK
Definition: gl.h:336

◆ put_callback_auto_normal()

void OpenGLSurfaceEvaluator::put_callback_auto_normal ( int  flag)
inline

Definition at line 158 of file glsurfeval.h.

159 {
161 }
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 flag
Definition: glfuncs.h:52

Referenced by GLUnurbs::put_callback_auto_normal().

◆ put_vertices_call_back()

void OpenGLSurfaceEvaluator::put_vertices_call_back ( int  flag)
inline

Definition at line 153 of file glsurfeval.h.

154 {
156 }

Referenced by GLUnurbs::put_callbackFlag(), and GLUnurbs::put_vertices_call_back().

◆ putCallBack()

void OpenGLSurfaceEvaluator::putCallBack ( GLenum  which,
_GLUfuncptr  fn 
)

Definition at line 1190 of file glsurfeval.cc.

1192{
1193 switch(which)
1194 {
1195 case GLU_NURBS_BEGIN:
1196 beginCallBackN = (void (GLAPIENTRY *) (GLenum)) fn;
1197 break;
1198 case GLU_NURBS_END:
1199 endCallBackN = (void (GLAPIENTRY *) (void)) fn;
1200 break;
1201 case GLU_NURBS_VERTEX:
1202 vertexCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
1203 break;
1204 case GLU_NURBS_NORMAL:
1205 normalCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
1206 break;
1207 case GLU_NURBS_COLOR:
1208 colorCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
1209 break;
1211 texcoordCallBackN = (void (GLAPIENTRY *) (const GLfloat*)) fn;
1212 break;
1214 beginCallBackData = (void (GLAPIENTRY *) (GLenum, void*)) fn;
1215 break;
1216 case GLU_NURBS_END_DATA:
1217 endCallBackData = (void (GLAPIENTRY *) (void*)) fn;
1218 break;
1220 vertexCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
1221 break;
1223 normalCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
1224 break;
1226 colorCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
1227 break;
1229 texcoordCallBackData = (void (GLAPIENTRY *) (const GLfloat*, void*)) fn;
1230 break;
1231
1232 }
1233}
#define GLU_NURBS_END
Definition: glu.h:112
#define GLU_NURBS_NORMAL
Definition: glu.h:106
#define GLU_NURBS_COLOR
Definition: glu.h:108
#define GLU_NURBS_TEXTURE_COORD
Definition: glu.h:110
#define GLU_NURBS_VERTEX_DATA
Definition: glu.h:116
#define GLU_NURBS_TEXTURE_COORD_DATA
Definition: glu.h:122
#define GLU_NURBS_VERTEX
Definition: glu.h:104
#define GLAPIENTRY
Definition: glu.h:44
#define GLU_NURBS_COLOR_DATA
Definition: glu.h:120
#define GLU_NURBS_BEGIN_DATA
Definition: glu.h:114
#define GLU_NURBS_END_DATA
Definition: glu.h:124
#define GLU_NURBS_BEGIN
Definition: glu.h:102
#define GLU_NURBS_NORMAL_DATA
Definition: glu.h:118
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159

Referenced by GLUnurbs::putSurfCallBack().

◆ range2f()

void OpenGLSurfaceEvaluator::range2f ( long  type,
REAL from,
REAL to 
)
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 258 of file glsurfeval.cc.

259{
260}

◆ set_callback_userData()

void OpenGLSurfaceEvaluator::set_callback_userData ( void data)
inline

Definition at line 168 of file glsurfeval.h.

169 {
170 userData = data;
171 }

Referenced by GLUnurbs::setNurbsCallbackData().

◆ swaptmesh()

void OpenGLSurfaceEvaluator::swaptmesh ( void  )
virtual

Reimplemented from BasicSurfaceEvaluator.

Definition at line 305 of file glsurfeval.cc.

306{
307 which = 1 - which;
308
309}

◆ texcoordCallBack()

void OpenGLSurfaceEvaluator::texcoordCallBack ( const GLfloat texcoord,
void data 
)
private

Definition at line 1283 of file glsurfeval.cc.

1284{
1285 if(texcoordCallBackData)
1286 texcoordCallBackData(texcoord, data);
1287 else if(texcoordCallBackN)
1288 texcoordCallBackN(texcoord);
1289}

Referenced by inDoEvalCoord2EM().

◆ vertexCallBack()

void OpenGLSurfaceEvaluator::vertexCallBack ( const GLfloat vert,
void data 
)
private

Definition at line 1255 of file glsurfeval.cc.

1256{
1257 if(vertexCallBackData)
1258 vertexCallBackData(vert, data);
1259 else if(vertexCallBackN)
1260 vertexCallBackN(vert);
1261}

Referenced by inBPMEval(), inBPMEvalEM(), and inDoEvalCoord2EM().

◆ void() [1/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY beginCallBackData)
private

◆ void() [2/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY beginCallBackN)
private

◆ void() [3/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY colorCallBackData) const
private

◆ void() [4/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY colorCallBackN) const
private

◆ void() [5/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY endCallBackData)
private

◆ void() [6/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY endCallBackN)
private

◆ void() [7/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY normalCallBackData) const
private

◆ void() [8/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY normalCallBackN) const
private

◆ void() [9/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY texcoordCallBackData) const
private

◆ void() [10/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY texcoordCallBackN) const
private

◆ void() [11/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY vertexCallBackData) const
private

◆ void() [12/12]

OpenGLSurfaceEvaluator::void ( GLAPIENTRY vertexCallBackN) const
private

Member Data Documentation

◆ auto_normal_flag

int OpenGLSurfaceEvaluator::auto_normal_flag
private

Definition at line 354 of file glsurfeval.h.

Referenced by bgnmap2f(), inDoEvalCoord2EM(), and OpenGLSurfaceEvaluator().

◆ callback_auto_normal

int OpenGLSurfaceEvaluator::callback_auto_normal
private

◆ color_flag

int OpenGLSurfaceEvaluator::color_flag
private

Definition at line 359 of file glsurfeval.h.

Referenced by bgnmap2f(), inDoEvalCoord2EM(), inMap2fEM(), and OpenGLSurfaceEvaluator().

◆ data

void * OpenGLSurfaceEvaluator::data
private

◆ em_color

surfEvalMachine OpenGLSurfaceEvaluator::em_color
private

Definition at line 351 of file glsurfeval.h.

Referenced by inDoEvalCoord2EM(), inMap2fEM(), and OpenGLSurfaceEvaluator().

◆ em_normal

surfEvalMachine OpenGLSurfaceEvaluator::em_normal
private

Definition at line 350 of file glsurfeval.h.

Referenced by inDoEvalCoord2EM(), inMap2fEM(), and OpenGLSurfaceEvaluator().

◆ em_texcoord

surfEvalMachine OpenGLSurfaceEvaluator::em_texcoord
private

Definition at line 352 of file glsurfeval.h.

Referenced by inDoEvalCoord2EM(), inMap2fEM(), and OpenGLSurfaceEvaluator().

◆ em_vertex

surfEvalMachine OpenGLSurfaceEvaluator::em_vertex
private

Definition at line 349 of file glsurfeval.h.

Referenced by inDoEvalCoord2EM(), inMap2fEM(), and OpenGLSurfaceEvaluator().

◆ gl_polygon_mode

GLint OpenGLSurfaceEvaluator::gl_polygon_mode[2]
private

Definition at line 185 of file glsurfeval.h.

Referenced by bgnmap2f(), and endmap2f().

◆ global_baseData

REAL* OpenGLSurfaceEvaluator::global_baseData
private

Definition at line 251 of file glsurfeval.h.

Referenced by OpenGLSurfaceEvaluator().

◆ global_bpm

◆ global_BU

REAL OpenGLSurfaceEvaluator::global_BU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
private

Definition at line 249 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivsBU(), and inPreEvaluateBU().

◆ global_BV

REAL OpenGLSurfaceEvaluator::global_BV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
private

Definition at line 247 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivsBV(), and inPreEvaluateBV().

◆ global_ev_ctlPoints

◆ global_ev_k

int OpenGLSurfaceEvaluator::global_ev_k
private

◆ global_ev_u1

REAL OpenGLSurfaceEvaluator::global_ev_u1
private

◆ global_ev_u2

REAL OpenGLSurfaceEvaluator::global_ev_u2
private

◆ global_ev_uorder

int OpenGLSurfaceEvaluator::global_ev_uorder
private

◆ global_ev_ustride

int OpenGLSurfaceEvaluator::global_ev_ustride
private

Definition at line 256 of file glsurfeval.h.

Referenced by inMap2f().

◆ global_ev_v1

REAL OpenGLSurfaceEvaluator::global_ev_v1
private

◆ global_ev_v2

REAL OpenGLSurfaceEvaluator::global_ev_v2
private

◆ global_ev_vorder

int OpenGLSurfaceEvaluator::global_ev_vorder
private

◆ global_ev_vstride

int OpenGLSurfaceEvaluator::global_ev_vstride
private

Definition at line 260 of file glsurfeval.h.

Referenced by inMap2f().

◆ global_grid_nu

int OpenGLSurfaceEvaluator::global_grid_nu
private

Definition at line 266 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_grid_nv

int OpenGLSurfaceEvaluator::global_grid_nv
private

Definition at line 269 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_grid_u0

REAL OpenGLSurfaceEvaluator::global_grid_u0
private

Definition at line 264 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_grid_u1

REAL OpenGLSurfaceEvaluator::global_grid_u1
private

Definition at line 265 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_grid_v0

REAL OpenGLSurfaceEvaluator::global_grid_v0
private

Definition at line 267 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_grid_v1

REAL OpenGLSurfaceEvaluator::global_grid_v1
private

Definition at line 268 of file glsurfeval.h.

Referenced by inEvalMesh2(), inEvalPoint2(), inMapGrid2f(), mapgrid2f(), mapmesh2f(), and point2i().

◆ global_PBU

REAL OpenGLSurfaceEvaluator::global_PBU[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
private

Definition at line 250 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivsBU(), and inPreEvaluateBU().

◆ global_PBV

REAL OpenGLSurfaceEvaluator::global_PBV[IN_MAX_BEZIER_ORDER][IN_MAX_DIMENSION]
private

Definition at line 248 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivsBV(), and inPreEvaluateBV().

◆ global_ucoeff

REAL OpenGLSurfaceEvaluator::global_ucoeff[IN_MAX_BEZIER_ORDER]
private

Definition at line 242 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivs(), inDoDomain2WithDerivsBV(), and inPreEvaluateBU().

◆ global_ucoeffDeriv

REAL OpenGLSurfaceEvaluator::global_ucoeffDeriv[IN_MAX_BEZIER_ORDER]
private

Definition at line 244 of file glsurfeval.h.

Referenced by inDoDomain2WithDerivs(), inDoDomain2WithDerivsBV(), and inPreEvaluateBU().

◆ global_uorder

int OpenGLSurfaceEvaluator::global_uorder
private

◆ global_uorder_BU

int OpenGLSurfaceEvaluator::global_uorder_BU
private

Definition at line 239 of file glsurfeval.h.

Referenced by OpenGLSurfaceEvaluator().

◆ global_uorder_BV

int OpenGLSurfaceEvaluator::global_uorder_BV
private

Definition at line 237 of file glsurfeval.h.

Referenced by OpenGLSurfaceEvaluator().

◆ global_uprime

REAL OpenGLSurfaceEvaluator::global_uprime
private