ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

glcurveval.h
Go to the documentation of this file.
00001 /*
00002 ** License Applicability. Except to the extent portions of this file are
00003 ** made subject to an alternative license as permitted in the SGI Free
00004 ** Software License B, Version 1.1 (the "License"), the contents of this
00005 ** file are subject only to the provisions of the License. You may not use
00006 ** this file except in compliance with the License. You may obtain a copy
00007 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
00008 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
00009 **
00010 ** http://oss.sgi.com/projects/FreeB
00011 **
00012 ** Note that, as provided in the License, the Software is distributed on an
00013 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
00014 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
00015 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
00016 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
00017 **
00018 ** Original Code. The Original Code is: OpenGL Sample Implementation,
00019 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
00020 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
00021 ** Copyright in any portions created by third parties is as indicated
00022 ** elsewhere herein. All Rights Reserved.
00023 **
00024 ** Additional Notice Provisions: The application programming interfaces
00025 ** established by SGI in conjunction with the Original Code are The
00026 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
00027 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
00028 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
00029 ** Window System(R) (Version 1.3), released October 19, 1998. This software
00030 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
00031 ** published by SGI, but has not been independently verified as being
00032 ** compliant with the OpenGL(R) version 1.2.1 Specification.
00033 */
00034 
00035 /*
00036  * glcurveval.h
00037  *
00038  */
00039 
00040 #ifndef __gluglcurveval_h_
00041 #define __gluglcurveval_h_
00042 
00043 #include "gluos.h"
00044 #include <GL/gl.h>
00045 #include <GL/glu.h>
00046 #include "basiccrveval.h"
00047 
00048 class CurveMap;
00049 
00050 /*for internal evaluator callback stuff*/
00051 #ifndef IN_MAX_BEZIER_ORDER
00052 #define IN_MAX_BEZIER_ORDER 40 /*XXX should be bigger than machine order*/
00053 #endif
00054 
00055 #ifndef IN_MAX_DIMENSION
00056 #define IN_MAX_DIMENSION 4
00057 #endif
00058 
00059 typedef struct curveEvalMachine{
00060   REAL uprime; //cached previously evaluated uprime
00061   int k; //the dimension
00062   REAL u1;
00063   REAL u2;
00064   int ustride;
00065   int uorder;
00066   REAL ctlpoints[IN_MAX_BEZIER_ORDER*IN_MAX_DIMENSION];
00067   REAL ucoeff[IN_MAX_BEZIER_ORDER];//cache the polynomial values
00068 } curveEvalMachine;
00069 
00070 class OpenGLCurveEvaluator : public BasicCurveEvaluator  {
00071 public:
00072             OpenGLCurveEvaluator(void);
00073             virtual ~OpenGLCurveEvaluator(void);
00074     void        range1f(long, REAL *, REAL *);
00075     void        domain1f(REAL, REAL);
00076     void        addMap(CurveMap *);
00077 
00078     void        enable(long);
00079     void        disable(long);
00080     void        bgnmap1f(long);
00081     void        map1f(long, REAL, REAL, long, long, REAL *);
00082     void        mapgrid1f(long, REAL, REAL);
00083     void        mapmesh1f(long, long, long);
00084     void        evalpoint1i(long);
00085     void        evalcoord1f(long, REAL);
00086     void        endmap1f(void);
00087 
00088     void        bgnline(void);
00089     void        endline(void);
00090 
00091     void                put_vertices_call_back(int flag)
00092       {
00093     output_triangles = flag;
00094       }
00095 #ifdef _WIN32
00096     void               putCallBack(GLenum which, void (APIENTRY *fn)() );
00097 #else
00098     void               putCallBack(GLenum which, _GLUfuncptr fn );
00099 #endif
00100     void               set_callback_userData(void *data)
00101       {
00102     userData = data;
00103       }
00104 
00105 /*------------------begin for curveEvalMachine------------*/
00106 curveEvalMachine em_vertex;
00107 curveEvalMachine em_normal;
00108 curveEvalMachine em_color;
00109 curveEvalMachine em_texcoord;
00110 int vertex_flag; //whether there is a vertex map or not
00111 int normal_flag; //whether there is a normal map or not
00112 int color_flag; //whether there is a color map or not
00113 int texcoord_flag; //whether there is a texture map or not
00114 
00115 REAL global_grid_u0;
00116 REAL global_grid_u1;
00117 int global_grid_nu;
00118 
00119 void inMap1f(int which, //0: vert, 1: norm, 2: color, 3: tex
00120          int dimension,
00121          REAL ulower,
00122          REAL uupper,
00123          int ustride,
00124          int uorder,
00125          REAL *ctlpoints);
00126 
00127 void inPreEvaluate(int order, REAL vprime, REAL *coeff);
00128 void inDoDomain1(curveEvalMachine *em, REAL u, REAL *retPoint);
00129 void inDoEvalCoord1(REAL u);
00130 void inMapMesh1f(int umin, int umax);
00131 
00132 void     (GLAPIENTRY *beginCallBackN) (GLenum type);
00133 void     (GLAPIENTRY *endCallBackN)   (void);
00134 void     (GLAPIENTRY *vertexCallBackN) (const GLfloat *vert);
00135 void     (GLAPIENTRY *normalCallBackN) (const GLfloat *normal);
00136 void     (GLAPIENTRY *colorCallBackN) (const GLfloat *color);
00137 void     (GLAPIENTRY *texcoordCallBackN) (const GLfloat *texcoord);
00138 
00139 void     (GLAPIENTRY *beginCallBackData) (GLenum type, void* data);
00140 void     (GLAPIENTRY *endCallBackData)   (void* data);
00141 void     (GLAPIENTRY *vertexCallBackData) (const GLfloat *vert, void* data);
00142 void     (GLAPIENTRY *normalCallBackData) (const GLfloat *normal, void* data);
00143 void     (GLAPIENTRY *colorCallBackData) (const GLfloat *color, void* data);
00144 void     (GLAPIENTRY *texcoordCallBackData) (const GLfloat *texcoord, void* data);
00145 
00146 void* userData; //the opaque pointer for Data callback functions
00147 void  beginCallBack(GLenum type, void* data);
00148 void endCallBack(void* data);
00149 void vertexCallBack(const GLfloat *vert, void *data);
00150 void normalCallBack(const GLfloat *normal, void* data);
00151 void colorCallBack(const  GLfloat *color, void* data);
00152 void texcoordCallBack(const GLfloat *texcoord, void* data);
00153 
00154 
00155 /*------------------end   for curveEvalMachine------------*/
00156 
00157 private:
00158     int output_triangles; //true 1; false 0
00159 };
00160 
00161 #endif /* __gluglcurveval_h_ */

Generated on Sun May 27 2012 04:23:38 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.