ReactOS 0.4.15-dev-7924-g5949c20
GLUnurbs Class Reference

#include <glrenderer.h>

Inheritance diagram for GLUnurbs:
Collaboration diagram for GLUnurbs:

Public Member Functions

 GLUnurbs (void)
 
void loadGLMatrices (void)
 
void useGLMatrices (const GLfloat modelMatrix[16], const GLfloat projMatrix[16], const GLint viewport[4])
 
void setSamplingMatrixIdentity (void)
 
void errorHandler (int)
 
void bgnrender (void)
 
void endrender (void)
 
void setautoloadmode (INREAL value)
 
GLboolean getautoloadmode (void)
 
void postError (int which)
 
void putSurfCallBack (GLenum which, _GLUfuncptr fn)
 
int get_vertices_call_back ()
 
void put_vertices_call_back (int flag)
 
int get_callback_auto_normal ()
 
void put_callback_auto_normal (int flag)
 
void setNurbsCallbackData (void *userData)
 
void LOD_eval_list (int level)
 
int is_callback ()
 
void put_callbackFlag (int flag)
 
- Public Member Functions inherited from NurbsTessellator
 NurbsTessellator (BasicCurveEvaluator &c, BasicSurfaceEvaluator &e)
 
virtual ~NurbsTessellator (void)
 
void getnurbsproperty (long, INREAL *)
 
void getnurbsproperty (long, long, INREAL *)
 
void setnurbsproperty (long, INREAL)
 
void setnurbsproperty (long, long, INREAL)
 
void setnurbsproperty (long, long, INREAL *)
 
void setnurbsproperty (long, long, INREAL *, long, long)
 
virtual void bgnrender (void)
 
virtual void endrender (void)
 
virtual void makeobj (int n)
 
virtual void closeobj (void)
 
virtual void errorHandler (int)
 
void bgnsurface (long)
 
void endsurface (void)
 
void bgntrim (void)
 
void endtrim (void)
 
void bgncurve (long)
 
void endcurve (void)
 
void pwlcurve (long, INREAL[], long, long)
 
void nurbscurve (long, INREAL[], long, INREAL[], long, long)
 
void nurbssurface (long, INREAL[], long, INREAL[], long, long, INREAL[], long, long, long)
 
void defineMap (long, long, long)
 
void redefineMaps (void)
 
void discardRecording (void *)
 
voidbeginRecording (void)
 
void endRecording (void)
 
void playRecording (void *)
 
void set_domain_distance_u_rate (REAL u_rate)
 
void set_domain_distance_v_rate (REAL v_rate)
 
void set_is_domain_distance_sampling (int flag)
 

Public Attributes

errorCallbackType errorCallback
 
- Public Attributes inherited from NurbsTessellator
Pool quiltPool
 

Private Member Functions

void loadSamplingMatrix (const GLfloat vmat[4][4], const GLint viewport[4])
 
void loadCullingMatrix (GLfloat vmat[4][4])
 

Static Private Member Functions

static void grabGLMatrix (GLfloat vmat[4][4])
 
static void transform4d (GLfloat A[4], GLfloat B[4], GLfloat mat[4][4])
 
static void multmatrix4d (GLfloat n[4][4], const GLfloat left[4][4], const GLfloat right[4][4])
 

Private Attributes

GLboolean autoloadmode
 
OpenGLSurfaceEvaluator surfaceEvaluator
 
OpenGLCurveEvaluator curveEvaluator
 
int callbackFlag
 

Additional Inherited Members

- Protected Attributes inherited from NurbsTessellator
Renderhints renderhints
 
Maplist maplist
 
Backend backend
 

Detailed Description

Definition at line 49 of file glrenderer.h.

Constructor & Destructor Documentation

◆ GLUnurbs()

GLUnurbs::GLUnurbs ( void  )

Definition at line 42 of file glrenderer.cc.

44{
64
69
74
79
84
85 //added for optimizing untrimmed case
87
92
93 //added for optimizing untrimmed case
95 set_is_domain_distance_sampling(0); //since the default is path_length
96
97 //default autoloadmode is true
98 autoloadmode = 1;
99
100 //default callbackFlag is 0
101 callbackFlag = 0;
102
104}
errorCallbackType errorCallback
Definition: glrenderer.h:71
OpenGLCurveEvaluator curveEvaluator
Definition: glrenderer.h:132
OpenGLSurfaceEvaluator surfaceEvaluator
Definition: glrenderer.h:131
GLboolean autoloadmode
Definition: glrenderer.h:130
int callbackFlag
Definition: glrenderer.h:143
void set_domain_distance_v_rate(REAL v_rate)
Definition: nurbstess.cc:59
void set_is_domain_distance_sampling(int flag)
Definition: nurbstess.cc:65
void redefineMaps(void)
void set_domain_distance_u_rate(REAL u_rate)
Definition: nurbstess.cc:53
void defineMap(long, long, long)
void setnurbsproperty(long, INREAL)
#define NULL
Definition: types.h:112
#define GL_MAP2_NORMAL
Definition: gl.h:562
#define GL_MAP1_TEXTURE_COORD_3
Definition: gl.h:556
#define GL_MAP2_INDEX
Definition: gl.h:561
#define GL_MAP2_TEXTURE_COORD_2
Definition: gl.h:564
#define GL_MAP1_VERTEX_3
Definition: gl.h:558
#define GL_MAP1_TEXTURE_COORD_2
Definition: gl.h:555
#define GL_MAP2_TEXTURE_COORD_4
Definition: gl.h:566
#define GL_MAP2_COLOR_4
Definition: gl.h:560
#define GL_MAP1_TEXTURE_COORD_1
Definition: gl.h:554
#define GL_MAP2_VERTEX_4
Definition: gl.h:568
#define GL_MAP1_INDEX
Definition: gl.h:552
#define GL_MAP2_VERTEX_3
Definition: gl.h:567
#define GL_MAP1_TEXTURE_COORD_4
Definition: gl.h:557
#define GL_MAP1_COLOR_4
Definition: gl.h:551
#define GL_MAP2_TEXTURE_COORD_1
Definition: gl.h:563
#define GL_MAP2_TEXTURE_COORD_3
Definition: gl.h:565
#define GL_MAP1_NORMAL
Definition: gl.h:553
#define GL_MAP1_VERTEX_4
Definition: gl.h:559
#define N_PATHLENGTH
Definition: nurbsconsts.h:59
#define N_S_STEPS
Definition: nurbsconsts.h:99
#define N_T_STEPS
Definition: nurbsconsts.h:100
#define N_PIXEL_TOLERANCE
Definition: nurbsconsts.h:89
#define N_ERROR_TOLERANCE
Definition: nurbsconsts.h:90
#define N_SAMPLINGMETHOD
Definition: nurbsconsts.h:54

Member Function Documentation

◆ bgnrender()

void GLUnurbs::bgnrender ( void  )
virtual

Reimplemented from NurbsTessellator.

Definition at line 107 of file glrenderer.cc.

108{
109 if (autoloadmode) {
111 }
112}
void loadGLMatrices(void)
Definition: glrenderer.cc:129

◆ endrender()

void GLUnurbs::endrender ( void  )
virtual

Reimplemented from NurbsTessellator.

Definition at line 115 of file glrenderer.cc.

116{
117}

◆ errorHandler()

void GLUnurbs::errorHandler ( int  i)
virtual

Reimplemented from NurbsTessellator.

Definition at line 120 of file glrenderer.cc.

121{
122 int gluError;
123
124 gluError = i + (GLU_NURBS_ERROR1 - 1);
125 postError( gluError );
126}
void postError(int which)
Definition: glrenderer.h:72
#define GLU_NURBS_ERROR1
Definition: glu.h:128
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

◆ get_callback_auto_normal()

int GLUnurbs::get_callback_auto_normal ( )
inline

Definition at line 94 of file glrenderer.h.

◆ get_vertices_call_back()

int GLUnurbs::get_vertices_call_back ( )
inline

Definition at line 84 of file glrenderer.h.

85 {
87 }

◆ getautoloadmode()

GLboolean GLUnurbs::getautoloadmode ( void  )
inline

Definition at line 69 of file glrenderer.h.

69{ return autoloadmode; }

◆ grabGLMatrix()

void GLUnurbs::grabGLMatrix ( GLfloat  vmat[4][4])
staticprivate

Definition at line 159 of file glrenderer.cc.

160{
161 GLfloat m1[4][4], m2[4][4];
162
165 multmatrix4d((GLfloat (*)[4]) vmat,
166 (const GLfloat (*)[4]) m1, (const GLfloat (*)[4]) m2);
167}
static void multmatrix4d(GLfloat n[4][4], const GLfloat left[4][4], const GLfloat right[4][4])
Definition: glrenderer.cc:294
float GLfloat
Definition: gl.h:161
unsigned int GLenum
Definition: gl.h:150
#define GL_PROJECTION_MATRIX
Definition: gl.h:541
#define GL_MODELVIEW_MATRIX
Definition: gl.h:538
GLAPI void GLAPIENTRY glGetFloatv(GLenum pname, GLfloat *params)

Referenced by loadGLMatrices().

◆ is_callback()

int GLUnurbs::is_callback ( )
inline

Definition at line 118 of file glrenderer.h.

119 {
120 return callbackFlag;
121 }

◆ loadCullingMatrix()

void GLUnurbs::loadCullingMatrix ( GLfloat  vmat[4][4])
private

Definition at line 237 of file glrenderer.cc.

238{
239 INREAL cmat[4][4];
240
241 cmat[0][0] = vmat[0][0];
242 cmat[0][1] = vmat[0][1];
243 cmat[0][2] = vmat[0][2];
244 cmat[0][3] = vmat[0][3];
245
246 cmat[1][0] = vmat[1][0];
247 cmat[1][1] = vmat[1][1];
248 cmat[1][2] = vmat[1][2];
249 cmat[1][3] = vmat[1][3];
250
251 cmat[2][0] = vmat[2][0];
252 cmat[2][1] = vmat[2][1];
253 cmat[2][2] = vmat[2][2];
254 cmat[2][3] = vmat[2][3];
255
256 cmat[3][0] = vmat[3][0];
257 cmat[3][1] = vmat[3][1];
258 cmat[3][2] = vmat[3][2];
259 cmat[3][3] = vmat[3][3];
260
261 const long rstride = sizeof(cmat[0]) / sizeof(cmat[0][0]);
262 const long cstride = 1;
263
265 cstride);
267 cstride);
268 //added for curves by zl
270 cstride);
272 cstride);
273}
#define INREAL
Definition: types.h:40
#define N_CULLINGMATRIX
Definition: nurbsconsts.h:105

Referenced by loadGLMatrices(), and useGLMatrices().

◆ loadGLMatrices()

void GLUnurbs::loadGLMatrices ( void  )

Definition at line 129 of file glrenderer.cc.

130{
131 GLfloat vmat[4][4];
132 GLint viewport[4];
133
134 grabGLMatrix((GLfloat (*)[4]) vmat);
135 loadCullingMatrix((GLfloat (*)[4]) vmat);
136 ::glGetIntegerv((GLenum) GL_VIEWPORT, (GLint *) viewport);
137 loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport);
138}
void loadCullingMatrix(GLfloat vmat[4][4])
Definition: glrenderer.cc:237
static void grabGLMatrix(GLfloat vmat[4][4])
Definition: glrenderer.cc:159
void loadSamplingMatrix(const GLfloat vmat[4][4], const GLint viewport[4])
Definition: glrenderer.cc:194
#define GL_VIEWPORT
Definition: gl.h:547
int GLint
Definition: gl.h:156
GLAPI void GLAPIENTRY glGetIntegerv(GLenum pname, GLint *params)

Referenced by bgnrender().

◆ loadSamplingMatrix()

void GLUnurbs::loadSamplingMatrix ( const GLfloat  vmat[4][4],
const GLint  viewport[4] 
)
private

Definition at line 194 of file glrenderer.cc.

196{
197
198 /* rescale the mapping to correspond to pixels in x/y */
199 REAL xsize = 0.5 * (REAL) (viewport[2]);
200 REAL ysize = 0.5 * (REAL) (viewport[3]);
201
202 INREAL smat[4][4];
203 smat[0][0] = vmat[0][0] * xsize;
204 smat[1][0] = vmat[1][0] * xsize;
205 smat[2][0] = vmat[2][0] * xsize;
206 smat[3][0] = vmat[3][0] * xsize;
207
208 smat[0][1] = vmat[0][1] * ysize;
209 smat[1][1] = vmat[1][1] * ysize;
210 smat[2][1] = vmat[2][1] * ysize;
211 smat[3][1] = vmat[3][1] * ysize;
212
213 smat[0][2] = 0.0;
214 smat[1][2] = 0.0;
215 smat[2][2] = 0.0;
216 smat[3][2] = 0.0;
217
218 smat[0][3] = vmat[0][3];
219 smat[1][3] = vmat[1][3];
220 smat[2][3] = vmat[2][3];
221 smat[3][3] = vmat[3][3];
222
223 const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]);
224 const long cstride = 1;
225
227 cstride);
229 cstride);
231 cstride);
233 cstride);
234}
float REAL
Definition: types.h:41
#define N_SAMPLINGMATRIX
Definition: nurbsconsts.h:106

Referenced by loadGLMatrices(), and useGLMatrices().

◆ LOD_eval_list()

void GLUnurbs::LOD_eval_list ( int  level)
inline

Definition at line 112 of file glrenderer.h.

113 {
115 }
void LOD_eval_list(int level)
Definition: glsurfeval.cc:84
GLint level
Definition: gl.h:1546

Referenced by glu_LOD_eval_list().

◆ multmatrix4d()

void GLUnurbs::multmatrix4d ( GLfloat  n[4][4],
const GLfloat  left[4][4],
const GLfloat  right[4][4] 
)
staticprivate

Definition at line 294 of file glrenderer.cc.

296{
297 transform4d ((GLfloat *) n[0],(GLfloat *) left[0],(GLfloat (*)[4]) right);
298 transform4d ((GLfloat *) n[1],(GLfloat *) left[1],(GLfloat (*)[4]) right);
299 transform4d ((GLfloat *) n[2],(GLfloat *) left[2],(GLfloat (*)[4]) right);
300 transform4d ((GLfloat *) n[3],(GLfloat *) left[3],(GLfloat (*)[4]) right);
301}
static void transform4d(GLfloat A[4], GLfloat B[4], GLfloat mat[4][4])
Definition: glrenderer.cc:280
GLdouble n
Definition: glext.h:7729
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726

Referenced by grabGLMatrix(), and useGLMatrices().

◆ postError()

void GLUnurbs::postError ( int  which)
inline

Definition at line 72 of file glrenderer.h.

static GLenum which
Definition: wgl_font.c:159

Referenced by errorHandler().

◆ put_callback_auto_normal()

void GLUnurbs::put_callback_auto_normal ( int  flag)
inline

Definition at line 99 of file glrenderer.h.

100 {
102 }
void put_callback_auto_normal(int flag)
Definition: glsurfeval.h:158
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

◆ put_callbackFlag()

void GLUnurbs::put_callbackFlag ( int  flag)
inline

Definition at line 122 of file glrenderer.h.

◆ put_vertices_call_back()

void GLUnurbs::put_vertices_call_back ( int  flag)
inline

Definition at line 89 of file glrenderer.h.

◆ putSurfCallBack()

void GLUnurbs::putSurfCallBack ( GLenum  which,
_GLUfuncptr  fn 
)
inline

Definition at line 77 of file glrenderer.h.

79 {
82 }
void putCallBack(GLenum which, _GLUfuncptr fn)
Definition: glcurveval.cc:305
void putCallBack(GLenum which, _GLUfuncptr fn)
Definition: glsurfeval.cc:1190
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159

◆ setautoloadmode()

void GLUnurbs::setautoloadmode ( INREAL  value)
inline

Definition at line 62 of file glrenderer.h.

63 {
64
66 else autoloadmode = GL_FALSE;
67
68 }
#define GL_TRUE
Definition: gl.h:174
#define GL_FALSE
Definition: gl.h:173
Definition: pdh_main.c:94

◆ setNurbsCallbackData()

void GLUnurbs::setNurbsCallbackData ( void userData)
inline

Definition at line 104 of file glrenderer.h.

105 {
108 }
void set_callback_userData(void *data)
Definition: glcurveval.h:96
void set_callback_userData(void *data)
Definition: glsurfeval.h:168

◆ setSamplingMatrixIdentity()

void GLUnurbs::setSamplingMatrixIdentity ( void  )

Definition at line 171 of file glrenderer.cc.

172{
173 INREAL smat[4][4] = {
174 {1,0,0,0},
175 {0,1,0,0},
176 {0,0,1,0},
177 {0,0,0,1}
178 };
179 const long rstride = sizeof(smat[0]) / sizeof(smat[0][0]);
180 const long cstride = 1;
181
183 cstride);
185 cstride);
187 cstride);
189 cstride);
190}

◆ transform4d()

void GLUnurbs::transform4d ( GLfloat  A[4],
GLfloat  B[4],
GLfloat  mat[4][4] 
)
staticprivate

Definition at line 280 of file glrenderer.cc.

281{
282
283 A[0] = B[0]*mat[0][0] + B[1]*mat[1][0] + B[2]*mat[2][0] + B[3]*mat[3][0];
284 A[1] = B[0]*mat[0][1] + B[1]*mat[1][1] + B[2]*mat[2][1] + B[3]*mat[3][1];
285 A[2] = B[0]*mat[0][2] + B[1]*mat[1][2] + B[2]*mat[2][2] + B[3]*mat[3][2];
286 A[3] = B[0]*mat[0][3] + B[1]*mat[1][3] + B[2]*mat[2][3] + B[3]*mat[3][3];
287}
Definition: ehthrow.cxx:93
Definition: ehthrow.cxx:54
static const MAT2 mat
Definition: font.c:66

Referenced by multmatrix4d().

◆ useGLMatrices()

void GLUnurbs::useGLMatrices ( const GLfloat  modelMatrix[16],
const GLfloat  projMatrix[16],
const GLint  viewport[4] 
)

Definition at line 141 of file glrenderer.cc.

144{
145 GLfloat vmat[4][4];
146
147 multmatrix4d(vmat, (const GLfloat (*)[4]) modelMatrix,
148 (const GLfloat (*)[4]) projMatrix);
149 loadCullingMatrix((GLfloat (*)[4]) vmat);
150 loadSamplingMatrix((const GLfloat (*)[4]) vmat, (const GLint *) viewport);
151}

Member Data Documentation

◆ autoloadmode

GLboolean GLUnurbs::autoloadmode
private

Definition at line 130 of file glrenderer.h.

Referenced by bgnrender(), getautoloadmode(), GLUnurbs(), and setautoloadmode().

◆ callbackFlag

int GLUnurbs::callbackFlag
private

Definition at line 143 of file glrenderer.h.

Referenced by GLUnurbs(), is_callback(), and put_callbackFlag().

◆ curveEvaluator

OpenGLCurveEvaluator GLUnurbs::curveEvaluator
private

Definition at line 132 of file glrenderer.h.

Referenced by put_callbackFlag(), putSurfCallBack(), and setNurbsCallbackData().

◆ errorCallback

errorCallbackType GLUnurbs::errorCallback

Definition at line 71 of file glrenderer.h.

Referenced by GLUnurbs(), and postError().

◆ surfaceEvaluator


The documentation for this class was generated from the following files: