2 ** License Applicability. Except to the extent portions of this file are
3 ** made subject to an alternative license as permitted in the SGI Free
4 ** Software License B, Version 1.1 (the "License"), the contents of this
5 ** file are subject only to the provisions of the License. You may not use
6 ** this file except in compliance with the License. You may obtain a copy
7 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
8 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
10 ** http://oss.sgi.com/projects/FreeB
12 ** Note that, as provided in the License, the Software is distributed on an
13 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
14 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
15 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
16 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
18 ** Original Code. The Original Code is: OpenGL Sample Implementation,
19 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
20 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21 ** Copyright in any portions created by third parties is as indicated
22 ** elsewhere herein. All Rights Reserved.
24 ** Additional Notice Provisions: The application programming interfaces
25 ** established by SGI in conjunction with the Original Code are The
26 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
27 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
28 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
29 ** Window System(R) (Version 1.3), released October 19, 1998. This software
30 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
31 ** published by SGI, but has not been independently verified as being
32 ** compliant with the OpenGL(R) version 1.2.1 Specification.
40 #ifndef __glunurbstess_h_
41 #define __glunurbstess_h_
44 #include "subdivider.h"
45 #include "renderhints.h"
49 #include "nurbsconsts.h"
54 class BasicCurveEvaluator
;
55 class BasicSurfaceEvaluator
;
57 class NurbsTessellator
{
59 NurbsTessellator( BasicCurveEvaluator
&c
,
60 BasicSurfaceEvaluator
&e
);
61 virtual ~NurbsTessellator( void );
63 void getnurbsproperty( long, INREAL
* );
64 void getnurbsproperty( long, long, INREAL
* );
65 void setnurbsproperty( long, INREAL
);
66 void setnurbsproperty( long, long, INREAL
);
67 void setnurbsproperty( long, long, INREAL
* );
68 void setnurbsproperty( long, long, INREAL
*, long, long );
70 // called before a tessellation begins/ends
71 virtual void bgnrender( void );
72 virtual void endrender( void );
74 // called to make a display list of the output vertices
75 virtual void makeobj( int n
);
76 virtual void closeobj( void );
78 // called when a error occurs
79 virtual void errorHandler( int );
81 void bgnsurface( long );
82 void endsurface( void );
85 void bgncurve( long );
86 void endcurve( void );
87 void pwlcurve( long, INREAL
[], long, long );
88 void nurbscurve( long, INREAL
[], long, INREAL
[], long, long );
89 void nurbssurface( long, INREAL
[], long, INREAL
[], long, long,
90 INREAL
[], long, long, long );
92 void defineMap( long, long, long );
93 void redefineMaps( void );
95 // recording of input description
96 void discardRecording( void * );
97 void * beginRecording( void );
98 void endRecording( void );
99 void playRecording( void * );
101 //for optimizing untrimmed nurbs in the case of domain distance sampling
102 void set_domain_distance_u_rate(REAL u_rate
);
103 void set_domain_distance_v_rate(REAL v_rate
);
104 void set_is_domain_distance_sampling(int flag
);
108 Renderhints renderhints
;
114 void resetObjects( void );
115 int do_check_knots( Knotvector
*, char * );
116 void do_nurbserror( int );
117 void do_bgncurve( O_curve
* );
118 void do_endcurve( void );
119 void do_freeall( void );
120 void do_freecurveall( O_curve
* );
121 void do_freebgntrim( O_trim
* );
122 void do_freebgncurve( O_curve
* );
123 void do_freepwlcurve( O_pwlcurve
* );
124 void do_freenurbscurve( O_nurbscurve
* );
125 void do_freenurbssurface( O_nurbssurface
* );
126 void do_freebgnsurface( O_surface
* );
127 void do_bgnsurface( O_surface
* );
128 void do_endsurface( void );
129 void do_bgntrim( O_trim
* );
130 void do_endtrim( void );
131 void do_pwlcurve( O_pwlcurve
* );
132 void do_nurbscurve( O_nurbscurve
* );
133 void do_nurbssurface( O_nurbssurface
* );
134 void do_freenurbsproperty( Property
* );
135 void do_setnurbsproperty( Property
* );
136 void do_setnurbsproperty2( Property
* );
138 Subdivider subdivider
;
139 JumpBuffer
* jumpbuffer
;
141 Pool o_nurbscurvePool
;
145 Pool o_nurbssurfacePool
;
150 TrimVertexPool extTrimVertexPool
;
152 int inSurface
; /* bgnsurface seen */
153 int inCurve
; /* bgncurve seen */
154 int inTrim
; /* bgntrim seen */
155 int isCurveModified
; /* curve changed */
156 int isTrimModified
; /* trim curves changed */
157 int isSurfaceModified
; /* surface changed */
158 int isDataValid
; /* all data is good */
159 int numTrims
; /* valid trim regions */
162 O_trim
** nextTrim
; /* place to link o_trim */
163 O_curve
** nextCurve
; /* place to link o_curve */
164 O_nurbscurve
** nextNurbscurve
; /* place to link o_nurbscurve */
165 O_pwlcurve
** nextPwlcurve
; /* place to link o_pwlcurve */
166 O_nurbssurface
** nextNurbssurface
; /* place to link o_nurbssurface */
168 O_surface
* currentSurface
;
170 O_curve
* currentCurve
;
176 #endif /* __glunurbstess_h_ */