ReactOS  0.4.15-dev-1207-g698a8e6
glcurveval.h
Go to the documentation of this file.
1 /*
2  * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3  * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice including the dates of first publication and
13  * either this permission notice or a reference to
14  * http://oss.sgi.com/projects/FreeB/
15  * shall be included in all copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20  * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  *
25  * Except as contained in this notice, the name of Silicon Graphics, Inc.
26  * shall not be used in advertising or otherwise to promote the sale, use or
27  * other dealings in this Software without prior written authorization from
28  * Silicon Graphics, Inc.
29  */
30 
31 /*
32  * glcurveval.h
33  *
34  */
35 
36 #ifndef __gluglcurveval_h_
37 #define __gluglcurveval_h_
38 
39 #include "gluos.h"
40 #include <GL/gl.h>
41 #include <GL/glu.h>
42 #include "basiccrveval.h"
43 
44 class CurveMap;
45 
46 /*for internal evaluator callback stuff*/
47 #ifndef IN_MAX_BEZIER_ORDER
48 #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/
49 #endif
50 
51 #ifndef IN_MAX_DIMENSION
52 #define IN_MAX_DIMENSION 4
53 #endif
54 
55 typedef struct curveEvalMachine{
56  REAL uprime; //cached previously evaluated uprime
57  int k; //the dimension
60  int ustride;
61  int uorder;
63  REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values
65 
67 public:
69  virtual ~OpenGLCurveEvaluator(void);
70  void range1f(long, REAL *, REAL *);
71  void domain1f(REAL, REAL);
72  void addMap(CurveMap *);
73 
74  void enable(long);
75  void disable(long);
76  void bgnmap1f(long);
77  void map1f(long, REAL, REAL, long, long, REAL *);
78  void mapgrid1f(long, REAL, REAL);
79  void mapmesh1f(long, long, long);
80  void evalpoint1i(long);
81  void evalcoord1f(long, REAL);
82  void endmap1f(void);
83 
84  void bgnline(void);
85  void endline(void);
86 
88  {
90  }
91 #ifdef _WIN32
92  void putCallBack(GLenum which, void (GLAPIENTRY *fn)() );
93 #else
95 #endif
97  {
98  userData = data;
99  }
100 
101 /*------------------begin for curveEvalMachine------------*/
106 int vertex_flag; //whether there is a vertex map or not
107 int normal_flag; //whether there is a normal map or not
108 int color_flag; //whether there is a color map or not
109 int texcoord_flag; //whether there is a texture map or not
110 
114 
115 void inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex
116  int dimension,
117  REAL ulower,
118  REAL uupper,
119  int ustride,
120  int uorder,
121  REAL *ctlpoints);
122 
123 void inPreEvaluate(int order, REAL vprime, REAL *coeff);
124 void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint);
125 void inDoEvalCoord1(REAL u);
126 void inMapMesh1f(int umin, int umax);
127 
128 void (GLAPIENTRY *beginCallBackN) (GLenum type);
129 void (GLAPIENTRY *endCallBackN) (void);
130 void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert);
131 void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal);
132 void (GLAPIENTRY *colorCallBackN) (const GLfloat *color);
133 void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord);
134 
135 void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data);
136 void (GLAPIENTRY *endCallBackData) (void* data);
137 void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data);
138 void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data);
139 void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data);
140 void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data);
141 
142 void* userData; //the opaque pointer for Data callback functions
143 void beginCallBack(GLenum type, void* data);
144 void endCallBack(void* data);
145 void vertexCallBack(const GLfloat *vert, void *data);
146 void normalCallBack(const GLfloat *normal, void* data);
147 void colorCallBack(const GLfloat *color, void* data);
148 void texcoordCallBack(const GLfloat *texcoord, void* data);
149 
150 
151 /*------------------end for curveEvalMachine------------*/
152 
153 private:
154  int output_triangles; //true 1; false 0
155 };
156 
157 #endif /* __gluglcurveval_h_ */
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
struct curveEvalMachine curveEvalMachine
GLdouble GLdouble GLint ustride
Definition: glext.h:8308
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
void mapgrid1f(long, REAL, REAL)
Definition: glcurveval.cc:147
void inMap1f(int which, int dimension, REAL ulower, REAL uupper, int ustride, int uorder, REAL *ctlpoints)
Definition: incurveeval.cc:90
void normalCallBack(const GLfloat *normal, void *data)
Definition: glcurveval.cc:378
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
static GLenum which
Definition: wgl_font.c:159
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void mapmesh1f(long, long, long)
Definition: glcurveval.cc:262
void put_vertices_call_back(int flag)
Definition: glcurveval.h:87
void addMap(CurveMap *)
Definition: glcurveval.cc:84
void putCallBack(GLenum which, _GLUfuncptr fn)
Definition: glcurveval.cc:305
void evalcoord1f(long, REAL)
Definition: glcurveval.cc:296
curveEvalMachine em_normal
Definition: glcurveval.h:103
#define IN_MAX_DIMENSION
Definition: glcurveval.h:52
void vertexCallBack(const GLfloat *vert, void *data)
Definition: glcurveval.cc:368
GLuint color
Definition: glext.h:6243
void inPreEvaluate(int order, REAL vprime, REAL *coeff)
Definition: incurveeval.cc:57
void colorCallBack(const GLfloat *color, void *data)
Definition: glcurveval.cc:387
void range1f(long, REAL *, REAL *)
Definition: glcurveval.cc:90
virtual ~OpenGLCurveEvaluator(void)
Definition: glcurveval.cc:78
GLdouble GLdouble GLint GLint uorder
Definition: glext.h:8308
curveEvalMachine em_vertex
Definition: glcurveval.h:102
void inMapMesh1f(int umin, int umax)
Definition: incurveeval.cc:193
void endCallBack(void *data)
Definition: glcurveval.cc:359
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void inDoEvalCoord1(REAL u)
Definition: incurveeval.cc:162
void map1f(long, REAL, REAL, long, long, REAL *)
Definition: glcurveval.cc:199
void domain1f(REAL, REAL)
Definition: glcurveval.cc:98
REAL ucoeff[IN_MAX_BEZIER_ORDER]
Definition: glcurveval.h:63
void(WINAPI * _GLUfuncptr)(void)
Definition: wgl_font.c:148
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
void evalpoint1i(long)
Definition: glcurveval.cc:287
unsigned int GLenum
Definition: gl.h:150
void(GLAPIENTRY *beginCallBackN)(GLenum type)
REAL ctlpoints[IN_MAX_BEZIER_ORDER *IN_MAX_DIMENSION]
Definition: glcurveval.h:62
void set_callback_userData(void *data)
Definition: glcurveval.h:96
#define IN_MAX_BEZIER_ORDER
Definition: glcurveval.h:48
curveEvalMachine em_texcoord
Definition: glcurveval.h:105
float GLfloat
Definition: gl.h:161
void texcoordCallBack(const GLfloat *texcoord, void *data)
Definition: glcurveval.cc:396
curveEvalMachine em_color
Definition: glcurveval.h:104
void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint)
Definition: incurveeval.cc:136
float REAL
Definition: types.h:41
void beginCallBack(GLenum type, void *data)
Definition: glcurveval.cc:350
#define GLAPIENTRY
Definition: glu.h:44