ReactOS 0.4.15-dev-7842-g558ab78
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
44class 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
55typedef struct curveEvalMachine{
56 REAL uprime; //cached previously evaluated uprime
57 int k; //the dimension
61 int uorder;
63 REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values
65
67public:
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------------*/
106int vertex_flag; //whether there is a vertex map or not
107int normal_flag; //whether there is a normal map or not
108int color_flag; //whether there is a color map or not
109int texcoord_flag; //whether there is a texture map or not
110
114
115void 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
123void inPreEvaluate(int order, REAL vprime, REAL *coeff);
124void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint);
125void inDoEvalCoord1(REAL u);
126void inMapMesh1f(int umin, int umax);
127
128void (GLAPIENTRY *beginCallBackN) (GLenum type);
129void (GLAPIENTRY *endCallBackN) (void);
130void (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert);
131void (GLAPIENTRY *normalCallBackN) (const GLfloat *normal);
132void (GLAPIENTRY *colorCallBackN) (const GLfloat *color);
133void (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord);
134
135void (GLAPIENTRY *beginCallBackData) (GLenum type, void* data);
136void (GLAPIENTRY *endCallBackData) (void* data);
137void (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data);
138void (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data);
139void (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data);
140void (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data);
141
142void* userData; //the opaque pointer for Data callback functions
143void beginCallBack(GLenum type, void* data);
144void endCallBack(void* data);
145void vertexCallBack(const GLfloat *vert, void *data);
146void normalCallBack(const GLfloat *normal, void* data);
147void colorCallBack(const GLfloat *color, void* data);
148void texcoordCallBack(const GLfloat *texcoord, void* data);
149
150
151/*------------------end for curveEvalMachine------------*/
152
153private:
154 int output_triangles; //true 1; false 0
155};
156
157#endif /* __gluglcurveval_h_ */
void(GLAPIENTRY *texcoordCallBackN)(const GLfloat *texcoord)
void(GLAPIENTRY *texcoordCallBackData)(const GLfloat *texcoord
void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint)
Definition: incurveeval.cc:136
void(GLAPIENTRY *endCallBackData)(void *data)
void(GLAPIENTRY *colorCallBackN)(const GLfloat *color)
void put_vertices_call_back(int flag)
Definition: glcurveval.h:87
curveEvalMachine em_color
Definition: glcurveval.h:104
void addMap(CurveMap *)
Definition: glcurveval.cc:84
void evalpoint1i(long)
Definition: glcurveval.cc:287
curveEvalMachine em_texcoord
Definition: glcurveval.h:105
void normalCallBack(const GLfloat *normal, void *data)
Definition: glcurveval.cc:378
curveEvalMachine em_vertex
Definition: glcurveval.h:102
void colorCallBack(const GLfloat *color, void *data)
Definition: glcurveval.cc:387
void beginCallBack(GLenum type, void *data)
Definition: glcurveval.cc:350
void set_callback_userData(void *data)
Definition: glcurveval.h:96
void range1f(long, REAL *, REAL *)
Definition: glcurveval.cc:90
curveEvalMachine em_normal
Definition: glcurveval.h:103
void texcoordCallBack(const GLfloat *texcoord, void *data)
Definition: glcurveval.cc:396
void inMap1f(int which, int dimension, REAL ulower, REAL uupper, int ustride, int uorder, REAL *ctlpoints)
Definition: incurveeval.cc:90
void endCallBack(void *data)
Definition: glcurveval.cc:359
void(GLAPIENTRY *colorCallBackData)(const GLfloat *color
void map1f(long, REAL, REAL, long, long, REAL *)
Definition: glcurveval.cc:199
void mapgrid1f(long, REAL, REAL)
Definition: glcurveval.cc:147
void(GLAPIENTRY *vertexCallBackN)(const GLfloat *vert)
virtual ~OpenGLCurveEvaluator(void)
Definition: glcurveval.cc:78
void evalcoord1f(long, REAL)
Definition: glcurveval.cc:296
void vertexCallBack(const GLfloat *vert, void *data)
Definition: glcurveval.cc:368
void(GLAPIENTRY *normalCallBackData)(const GLfloat *normal
void(GLAPIENTRY *endCallBackN)(void)
void(GLAPIENTRY *beginCallBackN)(GLenum type)
void(GLAPIENTRY *vertexCallBackData)(const GLfloat *vert
void domain1f(REAL, REAL)
Definition: glcurveval.cc:98
void putCallBack(GLenum which, _GLUfuncptr fn)
Definition: glcurveval.cc:305
void(GLAPIENTRY *normalCallBackN)(const GLfloat *normal)
void mapmesh1f(long, long, long)
Definition: glcurveval.cc:262
void inDoEvalCoord1(REAL u)
Definition: incurveeval.cc:162
void inMapMesh1f(int umin, int umax)
Definition: incurveeval.cc:193
void inPreEvaluate(int order, REAL vprime, REAL *coeff)
Definition: incurveeval.cc:57
#define GLAPIENTRY
Definition: glu.h:44
float REAL
Definition: types.h:41
float GLfloat
Definition: gl.h:161
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
unsigned int GLenum
Definition: gl.h:150
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define IN_MAX_BEZIER_ORDER
Definition: glcurveval.h:48
#define IN_MAX_DIMENSION
Definition: glcurveval.h:52
GLdouble GLdouble GLint ustride
Definition: glext.h:8308
GLuint color
Definition: glext.h:6243
GLdouble GLdouble GLint GLint uorder
Definition: glext.h:8308
GLboolean enable
Definition: glext.h:11120
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
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
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
int disable
Definition: msacm.c:1365
@ normal
Definition: optimize.h:166
REAL ucoeff[IN_MAX_BEZIER_ORDER]
Definition: glcurveval.h:63
REAL ctlpoints[IN_MAX_BEZIER_ORDER *IN_MAX_DIMENSION]
Definition: glcurveval.h:62
static GLenum which
Definition: wgl_font.c:159
static GLenum _GLUfuncptr fn
Definition: wgl_font.c:159
void(WINAPI * _GLUfuncptr)(void)
Definition: wgl_font.c:148