ReactOS 0.4.15-dev-7660-g0086d05
subdivider.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 * subdivider.h
33 *
34 */
35
36#ifndef __glusubdivider_h_
37#define __glusubdivider_h_
38
39#include "mysetjmp.h"
40#include "bin.h"
41#include "flist.h"
42#include "slicer.h"
43#include "arctess.h"
44//#include "trimvertex.h"
45#include "trimvertpool.h"
46
47class Arc;
48class Pool;
49class Renderhints;
50class Quilt;
51class Patchlist;
52class Curvelist;
53struct JumpBuffer;
54
56public:
58 ~Subdivider( void );
59 void clear( void );
60
61 void beginTrims( void ) {}
62 void beginLoop( void );
63 void addArc( REAL *, Quilt *, long );
64 void addArc( int, TrimVertex *, long );
65 void endLoop( void ) {}
66 void endTrims( void ) {}
67
68 void beginQuilts( void );
69 void addQuilt( Quilt * );
70 void endQuilts( void ) {}
71
72 void drawCurves( void );
73 void drawSurfaces( long );
74
76 int ccwTurn_sr( Arc_ptr , Arc_ptr );
77 int ccwTurn_tl( Arc_ptr , Arc_ptr );
78 int ccwTurn_tr( Arc_ptr , Arc_ptr );
79
80 void setJumpbuffer( JumpBuffer * );
81
83 {
85 }
87 {
89 }
91 {
93 }
94
95private:
96 void classify_headonleft_s( Bin &, Bin &, Bin &, REAL );
97 void classify_tailonleft_s( Bin &, Bin &, Bin &, REAL );
98 void classify_headonright_s( Bin &, Bin &, Bin &, REAL );
99 void classify_tailonright_s( Bin &, Bin &, Bin &, REAL );
100 void classify_headonleft_t( Bin &, Bin &, Bin &, REAL );
101 void classify_tailonleft_t( Bin &, Bin &, Bin &, REAL );
102 void classify_headonright_t( Bin &, Bin &, Bin &, REAL );
103 void classify_tailonright_t( Bin &, Bin &, Bin &, REAL );
104
105 enum dir { down, same, up, none };
106 void tessellate( Arc_ptr, REAL );
107 void monotonize( Arc_ptr , Bin & );
108 int isMonotone( Arc_ptr );
109 int decompose( Bin &, REAL );
110
111
118
119 JumpBuffer* jumpbuffer;
122
135
136 void samplingSplit( Curvelist&, int );
137
138 void subdivideInS( Bin& );
139 void splitInS( Bin&, int, int );
140 void splitInT( Bin&, int, int );
141 void samplingSplit( Bin&, Patchlist&, int, int );
142 void nonSamplingSplit( Bin&, Patchlist&, int, int );
143 void tessellation( Bin&, Patchlist& );
144 void monosplitInS( Bin&, int, int );
145 void monosplitInT( Bin&, int, int );
146
147 void outline( Bin & );
148 void freejarcs( Bin & );
149 void render( Bin & );
150 void split( Bin &, Bin &, Bin &, int, REAL );
151 void tessellate( Bin &, REAL, REAL, REAL, REAL );
152
153 inline void setDegenerate( void ) { showDegenerate = 1; }
154 inline void setNonDegenerate( void ) { showDegenerate = 0; }
155 inline int showingDegenerate( void ) { return showDegenerate; }
156 inline void setArcTypeBezier( void ) { isArcTypeBezier = 1; }
157 inline void setArcTypePwl( void ) { isArcTypeBezier = 0; }
158 inline int isBezierArcType( void ) { return isArcTypeBezier; }
159
160 void makeBorderTrim( const REAL *, const REAL * );
161 void split( Bin &, int, const REAL *, int, int );
162 void partition( Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL );
163 void findIrregularS( Bin & );
164 void findIrregularT( Bin & );
165
166
167 inline int bbox( TrimVertex *, TrimVertex *, TrimVertex *, int );
168 static int bbox( REAL, REAL, REAL, REAL, REAL, REAL );
169 static int ccw( TrimVertex *, TrimVertex *, TrimVertex * );
170 void join_s( Bin &, Bin &, Arc_ptr, Arc_ptr );
171 void join_t( Bin &, Bin &, Arc_ptr , Arc_ptr );
172 int arc_split( Arc_ptr , int, REAL, int );
173 void check_s( Arc_ptr , Arc_ptr );
174 void check_t( Arc_ptr , Arc_ptr );
175 inline void link( Arc_ptr , Arc_ptr , Arc_ptr , Arc_ptr );
176 inline void simple_link( Arc_ptr , Arc_ptr );
177
178 Bin* makePatchBoundary( const REAL *from, const REAL *to );
179
180 /*in domain distance method, the tessellation is controled by two numbers:
181 *GLU_U_STEP: number of u-segments per unit u length of domain
182 *GLU_V_STEP: number of v-segments per unit v length of domain
183 *These two numbers are normally stored in mapdesc->maxs(t)rate.
184 *I (ZL) put these two numbers here so that I can optimize the untrimmed
185 *case in the case of domain distance sampling.
186 *These two numbers are set by set_domain_distance_u_rate() and ..._v_..().
187 */
191};
192
193inline void
195{
196 pjarc = 0;
197}
198
199
200#endif /* __glusubdivider_h_ */
Definition: arc.h:55
Definition: bin.h:44
Definition: flist.h:42
Definition: bufpool.h:50
Definition: quilt.h:64
Definition: slicer.h:49
void freejarcs(Bin &)
Definition: subdivider.cc:846
void endQuilts(void)
Definition: subdivider.h:70
REAL domain_distance_u_rate
Definition: subdivider.h:188
Bin initialbin
Definition: subdivider.h:123
void classify_tailonright_s(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:555
static int ccw(TrimVertex *, TrimVertex *, TrimVertex *)
Definition: ccw.cc:558
void classify_tailonleft_s(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:445
int ccwTurn_sr(Arc_ptr, Arc_ptr)
Definition: ccw.cc:57
void endTrims(void)
Definition: subdivider.h:66
void classify_tailonleft_t(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:472
void samplingSplit(Curvelist &, int)
Definition: curvesub.cc:85
void check_t(Arc_ptr, Arc_ptr)
Definition: splitarcs.cc:221
int is_domain_distance_sampling
Definition: subdivider.h:190
void split(Bin &, int, const REAL *, int, int)
void join_s(Bin &, Bin &, Arc_ptr, Arc_ptr)
Definition: splitarcs.cc:180
void set_domain_distance_u_rate(REAL u_rate)
Definition: subdivider.h:82
~Subdivider(void)
Definition: subdivider.cc:148
void splitInT(Bin &, int, int)
Definition: subdivider.cc:422
Pool bezierarcpool
Definition: subdivider.h:115
void set_is_domain_distance_sampling(int flag)
Definition: subdivider.h:90
int decompose(Bin &, REAL)
Definition: monotonizer.cc:56
void drawSurfaces(long)
Definition: subdivider.cc:204
void monosplitInT(Bin &, int, int)
Definition: subdivider.cc:626
void makeBorderTrim(const REAL *, const REAL *)
Definition: subdivider.cc:757
Renderhints & renderhints
Definition: subdivider.h:120
ArcTessellator arctessellator
Definition: subdivider.h:113
int ccwTurn_tl(Arc_ptr, Arc_ptr)
Definition: ccw.cc:396
Bin * makePatchBoundary(const REAL *from, const REAL *to)
Definition: subdivider.cc:73
REAL stepsizes[4]
Definition: subdivider.h:132
int isMonotone(Arc_ptr)
Definition: monotonizer.cc:210
Flist smbrkpts
Definition: subdivider.h:130
void beginQuilts(void)
Definition: subdivider.cc:186
Backend & backend
Definition: subdivider.h:121
void check_s(Arc_ptr, Arc_ptr)
Definition: splitarcs.cc:122
void classify_tailonright_t(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:583
void partition(Bin &, Bin &, Bin &, Bin &, Bin &, int, REAL)
Definition: intersect.cc:61
Arc_ptr pjarc
Definition: subdivider.h:124
REAL domain_distance_v_rate
Definition: subdivider.h:189
void classify_headonleft_t(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:527
int isBezierArcType(void)
Definition: subdivider.h:158
int showingDegenerate(void)
Definition: subdivider.h:155
JumpBuffer * jumpbuffer
Definition: subdivider.h:119
Pool pwlarcpool
Definition: subdivider.h:116
void setNonDegenerate(void)
Definition: subdivider.h:154
void beginLoop(void)
Definition: subdivider.h:194
void findIrregularT(Bin &)
Definition: subdivider.cc:722
Slicer slicer
Definition: subdivider.h:112
void set_domain_distance_v_rate(REAL v_rate)
Definition: subdivider.h:86
Pool arcpool
Definition: subdivider.h:114
void tessellate(Arc_ptr, REAL)
Definition: monotonizer.cc:83
Flist spbrkpts
Definition: subdivider.h:128
Quilt * qlist
Definition: subdivider.h:127
void classify_headonleft_s(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:499
void tessellation(Bin &, Patchlist &)
Definition: subdivider.cc:571
void monosplitInS(Bin &, int, int)
Definition: subdivider.cc:597
void beginTrims(void)
Definition: subdivider.h:61
void addQuilt(Quilt *)
Definition: subdivider.cc:192
Flist tpbrkpts
Definition: subdivider.h:129
void classify_headonright_s(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:611
void subdivideInS(Bin &)
Definition: subdivider.cc:372
int arc_split(Arc_ptr, int, REAL, int)
Definition: intersect.cc:175
void join_t(Bin &, Bin &, Arc_ptr, Arc_ptr)
Definition: splitarcs.cc:252
void addArc(REAL *, Quilt *, long)
Definition: subdivider.cc:157
Flist tmbrkpts
Definition: subdivider.h:131
void splitInS(Bin &, int, int)
Definition: subdivider.cc:391
void monotonize(Arc_ptr, Bin &)
Definition: monotonizer.cc:114
int showDegenerate
Definition: subdivider.h:133
void nonSamplingSplit(Bin &, Patchlist &, int, int)
Definition: subdivider.cc:520
void setArcTypePwl(void)
Definition: subdivider.h:157
void drawCurves(void)
Definition: curvesub.cc:56
void clear(void)
Definition: subdivider.cc:135
void simple_link(Arc_ptr, Arc_ptr)
Definition: splitarcs.cc:164
void split(Bin &, Bin &, Bin &, int, REAL)
Definition: splitarcs.cc:58
int isArcTypeBezier
Definition: subdivider.h:134
void endLoop(void)
Definition: subdivider.h:65
void setJumpbuffer(JumpBuffer *)
Definition: subdivider.cc:124
void setDegenerate(void)
Definition: subdivider.h:153
int ccwTurn_sl(Arc_ptr, Arc_ptr)
Definition: ccw.cc:170
TrimVertexPool trimvertexpool
Definition: subdivider.h:117
void findIrregularS(Bin &)
Definition: subdivider.cc:658
int ccwTurn_tr(Arc_ptr, Arc_ptr)
Definition: ccw.cc:283
void classify_headonright_t(Bin &, Bin &, Bin &, REAL)
Definition: intersect.cc:639
void setArcTypeBezier(void)
Definition: subdivider.h:156
const WCHAR * link
Definition: db.cpp:997
class Arc * Arc_ptr
Definition: arc.h:50
float REAL
Definition: types.h:41
FT_BBox bbox
Definition: ftbbox.c:446
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
CardRegion * from
Definition: spigame.cpp:19
static void render(void)
Definition: ssstars.c:272
Definition: mesh.c:5330