ReactOS  0.4.12-dev-14-gd0c8636
nurbstess.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  * nurbstess.h
33  *
34  */
35 
36 #ifndef __glunurbstess_h_
37 #define __glunurbstess_h_
38 
39 //#include "mysetjmp.h"
40 #include "subdivider.h"
41 #include "renderhints.h"
42 #include "backend.h"
43 #include "maplist.h"
44 #include "reader.h"
45 //#include "nurbsconsts.h"
46 
47 struct Knotvector;
48 class Quilt;
49 class DisplayList;
52 
54 public:
57  virtual ~NurbsTessellator( void );
58 
59  void getnurbsproperty( long, INREAL * );
60  void getnurbsproperty( long, long, INREAL * );
61  void setnurbsproperty( long, INREAL );
62  void setnurbsproperty( long, long, INREAL );
63  void setnurbsproperty( long, long, INREAL * );
64  void setnurbsproperty( long, long, INREAL *, long, long );
65 
66  // called before a tessellation begins/ends
67  virtual void bgnrender( void );
68  virtual void endrender( void );
69 
70  // called to make a display list of the output vertices
71  virtual void makeobj( int n );
72  virtual void closeobj( void );
73 
74  // called when a error occurs
75  virtual void errorHandler( int );
76 
77  void bgnsurface( long );
78  void endsurface( void );
79  void bgntrim( void );
80  void endtrim( void );
81  void bgncurve( long );
82  void endcurve( void );
83  void pwlcurve( long, INREAL[], long, long );
84  void nurbscurve( long, INREAL[], long, INREAL[], long, long );
85  void nurbssurface( long, INREAL[], long, INREAL[], long, long,
86  INREAL[], long, long, long );
87 
88  void defineMap( long, long, long );
89  void redefineMaps( void );
90 
91  // recording of input description
92  void discardRecording( void * );
93  void * beginRecording( void );
94  void endRecording( void );
95  void playRecording( void * );
96 
97  //for optimizing untrimmed nurbs in the case of domain distance sampling
98  void set_domain_distance_u_rate(REAL u_rate);
99  void set_domain_distance_v_rate(REAL v_rate);
101 
102 
103 protected:
107 
108 private:
109 
110  void resetObjects( void );
111  int do_check_knots( Knotvector *, const char * );
112  void do_nurbserror( int );
113  void do_bgncurve( O_curve * );
114  void do_endcurve( void );
115  void do_freeall( void );
116  void do_freecurveall( O_curve * );
117  void do_freebgntrim( O_trim * );
118  void do_freebgncurve( O_curve * );
119  void do_freepwlcurve( O_pwlcurve * );
122  void do_freebgnsurface( O_surface * );
123  void do_bgnsurface( O_surface * );
124  void do_endsurface( void );
125  void do_bgntrim( O_trim * );
126  void do_endtrim( void );
127  void do_pwlcurve( O_pwlcurve * );
128  void do_nurbscurve( O_nurbscurve * );
130  void do_freenurbsproperty( Property * );
131  void do_setnurbsproperty( Property * );
132  void do_setnurbsproperty2( Property * );
133 
135  JumpBuffer* jumpbuffer;
143 public:
145 private:
147 
148  int inSurface; /* bgnsurface seen */
149  int inCurve; /* bgncurve seen */
150  int inTrim; /* bgntrim seen */
151  int isCurveModified; /* curve changed */
152  int isTrimModified; /* trim curves changed */
153  int isSurfaceModified; /* surface changed */
154  int isDataValid; /* all data is good */
155  int numTrims; /* valid trim regions */
156  int playBack;
157 
158  O_trim** nextTrim; /* place to link o_trim */
159  O_curve** nextCurve; /* place to link o_curve */
160  O_nurbscurve** nextNurbscurve; /* place to link o_nurbscurve */
161  O_pwlcurve** nextPwlcurve; /* place to link o_pwlcurve */
162  O_nurbssurface** nextNurbssurface; /* place to link o_nurbssurface */
163 
167 
169 
170 };
171 
172 #endif /* __glunurbstess_h_ */
O_nurbscurve ** nextNurbscurve
Definition: nurbstess.h:160
TrimVertexPool extTrimVertexPool
Definition: nurbstess.h:146
void endcurve(void)
Definition: quilt.h:64
void do_freebgncurve(O_curve *)
Definition: nurbstess.cc:456
void do_freenurbsproperty(Property *)
Definition: nurbstess.cc:636
void endtrim(void)
Renderhints renderhints
Definition: nurbstess.h:104
void do_freenurbssurface(O_nurbssurface *)
Definition: nurbstess.cc:585
void defineMap(long, long, long)
void do_bgncurve(O_curve *)
Definition: nurbstess.cc:154
void do_pwlcurve(O_pwlcurve *)
Definition: nurbstess.cc:468
void set_is_domain_distance_sampling(int flag)
Definition: nurbstess.cc:65
void do_bgntrim(O_trim *)
Definition: nurbstess.cc:389
O_surface * currentSurface
Definition: nurbstess.h:164
void nurbssurface(long, INREAL[], long, INREAL[], long, long, INREAL[], long, long, long)
Definition: reader.h:55
void endRecording(void)
void playRecording(void *)
void do_setnurbsproperty2(Property *)
Definition: nurbstess.cc:657
virtual void closeobj(void)
Definition: nurbstess.cc:85
void discardRecording(void *)
virtual void makeobj(int n)
Definition: nurbstess.cc:77
void do_freepwlcurve(O_pwlcurve *)
Definition: nurbstess.cc:450
void endsurface(void)
GLuint n
Definition: s_context.h:57
DisplayList * dl
Definition: nurbstess.h:168
#define e
Definition: ke_i.h:82
void setnurbsproperty(long, INREAL)
virtual ~NurbsTessellator(void)
O_curve ** nextCurve
Definition: nurbstess.h:159
void do_nurbserror(int)
Definition: nurbstess.cc:672
NurbsTessellator(BasicCurveEvaluator &c, BasicSurfaceEvaluator &e)
void do_endsurface(void)
Definition: nurbstess.cc:239
void nurbscurve(long, INREAL[], long, INREAL[], long, long)
void do_endcurve(void)
Definition: nurbstess.cc:187
void do_nurbscurve(O_nurbscurve *)
Definition: nurbstess.cc:534
void resetObjects(void)
Definition: nurbstess.cc:71
Pool o_nurbscurvePool
Definition: nurbstess.h:137
JumpBuffer * jumpbuffer
Definition: nurbstess.h:135
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean flag
Definition: glfuncs.h:72
Backend backend
Definition: nurbstess.h:106
virtual void endrender(void)
Definition: nurbstess.cc:101
const GLubyte * c
Definition: glext.h:8905
O_pwlcurve ** nextPwlcurve
Definition: nurbstess.h:161
Definition: bufpool.h:50
void getnurbsproperty(long, INREAL *)
void set_domain_distance_u_rate(REAL u_rate)
Definition: nurbstess.cc:53
O_trim ** nextTrim
Definition: nurbstess.h:158
Definition: reader.h:94
void do_bgnsurface(O_surface *)
Definition: nurbstess.cc:128
#define INREAL
Definition: types.h:40
virtual void bgnrender(void)
Definition: nurbstess.cc:93
O_curve * currentCurve
Definition: nurbstess.h:166
O_trim * currentTrim
Definition: nurbstess.h:165
void bgnsurface(long)
void do_freebgnsurface(O_surface *)
Definition: nurbstess.cc:115
void do_setnurbsproperty(Property *)
Definition: nurbstess.cc:649
Pool o_nurbssurfacePool
Definition: nurbstess.h:141
Maplist maplist
Definition: nurbstess.h:105
void set_domain_distance_v_rate(REAL v_rate)
Definition: nurbstess.cc:59
void do_freenurbscurve(O_nurbscurve *)
Definition: nurbstess.cc:520
void * beginRecording(void)
void do_endtrim(void)
Definition: nurbstess.cc:422
void do_freeall(void)
Definition: nurbstess.cc:315
int do_check_knots(Knotvector *, const char *)
Definition: nurbstess.cc:678
void bgncurve(long)
void bgntrim(void)
void pwlcurve(long, INREAL[], long, long)
void redefineMaps(void)
float REAL
Definition: types.h:41
void do_nurbssurface(O_nurbssurface *)
Definition: nurbstess.cc:598
Subdivider subdivider
Definition: nurbstess.h:134
void do_freebgntrim(O_trim *)
Definition: nurbstess.cc:376
void do_freecurveall(O_curve *)
Definition: nurbstess.cc:341
virtual void errorHandler(int)
Definition: nurbstess.cc:667
O_nurbssurface ** nextNurbssurface
Definition: nurbstess.h:162