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.
38
* $Date: 2001/08/07 17:34:11 $ $Revision: 1.2 $
39
* $Header: /home/krh/git/sync/mesa-cvs-repo/Mesa/src/glu/sgi/libnurbs/internals/subdivider.h,v 1.2 2001/08/07 17:34:11 brianp Exp $
42
#ifndef __glusubdivider_h_
43
#define __glusubdivider_h_
50
#include "trimvertex.h"
51
#include "trimvertpool.h"
63
Subdivider( Renderhints&, Backend& );
67
void beginTrims( void ) {}
68
void beginLoop( void );
69
void addArc( REAL *, Quilt *, long );
70
void addArc( int, TrimVertex *, long );
71
void endLoop( void ) {}
72
void endTrims( void ) {}
74
void beginQuilts( void );
75
void addQuilt( Quilt * );
76
void endQuilts( void ) {}
78
void drawCurves( void );
79
void drawSurfaces( long );
81
int ccwTurn_sl( Arc_ptr, Arc_ptr );
82
int ccwTurn_sr( Arc_ptr , Arc_ptr );
83
int ccwTurn_tl( Arc_ptr , Arc_ptr );
84
int ccwTurn_tr( Arc_ptr , Arc_ptr );
86
void setJumpbuffer( JumpBuffer * );
88
void set_domain_distance_u_rate(REAL u_rate)
90
domain_distance_u_rate = u_rate;
92
void set_domain_distance_v_rate(REAL v_rate)
94
domain_distance_v_rate = v_rate;
96
void set_is_domain_distance_sampling(int flag)
98
is_domain_distance_sampling = flag;
102
void classify_headonleft_s( Bin &, Bin &, Bin &, REAL );
103
void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL );
104
void classify_headonright_s( Bin &, Bin &, Bin &, REAL );
105
void classify_tailonright_s( Bin &, Bin &, Bin &, REAL );
106
void classify_headonleft_t( Bin &, Bin &, Bin &, REAL );
107
void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL );
108
void classify_headonright_t( Bin &, Bin &, Bin &, REAL );
109
void classify_tailonright_t( Bin &, Bin &, Bin &, REAL );
111
enum dir { down, same, up, none };
112
void tessellate( Arc_ptr, REAL );
113
void monotonize( Arc_ptr , Bin & );
114
int isMonotone( Arc_ptr );
115
int decompose( Bin &, REAL );
119
ArcTessellator arctessellator;
123
TrimVertexPool trimvertexpool;
125
JumpBuffer* jumpbuffer;
126
Renderhints& renderhints;
142
void samplingSplit( Curvelist&, int );
144
void subdivideInS( Bin& );
145
void splitInS( Bin&, int, int );
146
void splitInT( Bin&, int, int );
147
void samplingSplit( Bin&, Patchlist&, int, int );
148
void nonSamplingSplit( Bin&, Patchlist&, int, int );
149
void tessellation( Bin&, Patchlist& );
150
void monosplitInS( Bin&, int, int );
151
void monosplitInT( Bin&, int, int );
153
void outline( Bin & );
154
void freejarcs( Bin & );
155
void render( Bin & );
156
void split( Bin &, Bin &, Bin &, int, REAL );
157
void tessellate( Bin &, REAL, REAL, REAL, REAL );
159
inline void setDegenerate( void ) { showDegenerate = 1; }
160
inline void setNonDegenerate( void ) { showDegenerate = 0; }
161
inline int showingDegenerate( void ) { return showDegenerate; }
162
inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; }
163
inline void setArcTypePwl( void ) { isArcTypeBezier = 0; }
164
inline int isBezierArcType( void ) { return isArcTypeBezier; }
166
void makeBorderTrim( const REAL *, const REAL * );
167
void split( Bin &, int, const REAL *, int, int );
168
void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL );
169
void findIrregularS( Bin & );
170
void findIrregularT( Bin & );
173
inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int );
174
static int bbox( REAL, REAL, REAL, REAL, REAL, REAL );
175
static int ccw( TrimVertex *, TrimVertex *, TrimVertex * );
176
void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr );
177
void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr );
178
int arc_split( Arc_ptr , int, REAL, int );
179
void check_s( Arc_ptr , Arc_ptr );
180
void check_t( Arc_ptr , Arc_ptr );
181
inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr );
182
inline void simple_link( Arc_ptr , Arc_ptr );
184
Bin* makePatchBoundary( const REAL *from, const REAL *to );
186
/*in domain distance method, the tessellation is controled by two numbers:
187
*GLU_U_STEP: number of u-segments per unit u length of domain
188
*GLU_V_STEP: number of v-segments per unit v length of domain
189
*These two numbers are normally stored in mapdesc->maxs(t)rate.
190
*I (ZL) put these two numbers here so that I can optimize the untrimmed
191
*case in the case of domain distance sampling.
192
*These two numbers are set by set_domain_distance_u_rate() and ..._v_..().
194
REAL domain_distance_u_rate;
195
REAL domain_distance_v_rate;
196
int is_domain_distance_sampling;
200
Subdivider::beginLoop( void )
206
#endif /* __glusubdivider_h_ */