36 #ifndef __glusubdivider_h_
37 #define __glusubdivider_h_
44 #include "trimvertex.h"
45 #include "trimvertpool.h"
61 void beginTrims(
void ) {}
62 void beginLoop(
void );
63 void addArc( REAL *,
Quilt *,
long );
65 void endLoop(
void ) {}
66 void endTrims(
void ) {}
68 void beginQuilts(
void );
69 void addQuilt(
Quilt * );
70 void endQuilts(
void ) {}
72 void drawCurves(
void );
73 void drawSurfaces(
long );
75 int ccwTurn_sl( Arc_ptr, Arc_ptr );
76 int ccwTurn_sr( Arc_ptr , Arc_ptr );
77 int ccwTurn_tl( Arc_ptr , Arc_ptr );
78 int ccwTurn_tr( Arc_ptr , Arc_ptr );
80 void setJumpbuffer( JumpBuffer * );
82 void set_domain_distance_u_rate(REAL u_rate)
84 domain_distance_u_rate = u_rate;
86 void set_domain_distance_v_rate(REAL v_rate)
88 domain_distance_v_rate = v_rate;
90 void set_is_domain_distance_sampling(
int flag)
92 is_domain_distance_sampling = flag;
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 );
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 );
119 JumpBuffer* jumpbuffer;
138 void subdivideInS(
Bin& );
139 void splitInS(
Bin&,
int,
int );
140 void splitInT(
Bin&,
int,
int );
144 void monosplitInS(
Bin&,
int,
int );
145 void monosplitInT(
Bin&,
int,
int );
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 );
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; }
160 void makeBorderTrim(
const REAL *,
const REAL * );
161 void split(
Bin &,
int,
const REAL *,
int,
int );
163 void findIrregularS(
Bin & );
164 void findIrregularT(
Bin & );
168 static int bbox( REAL, REAL, REAL, REAL, REAL, REAL );
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 );
178 Bin* makePatchBoundary(
const REAL *from,
const REAL *to );
188 REAL domain_distance_u_rate;
189 REAL domain_distance_v_rate;
190 int is_domain_distance_sampling;
194 Subdivider::beginLoop(
void )