Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1051 lines
22 KiB

  1. /*
  2. ** Copyright 1992, Silicon Graphics, Inc.
  3. ** All Rights Reserved.
  4. **
  5. ** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6. ** the contents of this file may not be disclosed to third parties, copied or
  7. ** duplicated in any form, in whole or in part, without the prior written
  8. ** permission of Silicon Graphics, Inc.
  9. **
  10. ** RESTRICTED RIGHTS LEGEND:
  11. ** Use, duplication or disclosure by the Government is subject to restrictions
  12. ** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13. ** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14. ** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15. ** rights reserved under the Copyright Laws of the United States.
  16. **
  17. */
  18. #include <setjmp.h>
  19. struct JumpBuffer {
  20. jmp_buf buf;
  21. };
  22. #define mysetjmp(x) setjmp((x)->buf)
  23. #define mylongjmp(x,y) longjmp((x)->buf, y)
  24. /* <<AT&T USL C++ Language System <3.0.1> 02/03/92>> */
  25. /* < ../core/ccw.c++ > */
  26. void *__vec_new (void *, int , int , void *);
  27. void __vec_ct (void *, int , int , void *);
  28. void __vec_dt (void *, int , int , void *);
  29. void __vec_delete (void *, int , int , void *, int , int );
  30. typedef int (*__vptp)(void);
  31. struct __mptr {short d; short i; __vptp f; };
  32. typedef unsigned int size_t ;
  33. // extern void *malloc (size_t );
  34. // extern void free (void *);
  35. struct JumpBuffer;
  36. struct Buffer;
  37. struct Buffer {
  38. struct Buffer *next__6Buffer ;
  39. };
  40. struct Pool;
  41. enum __Q2_4Pool5Magic { is_allocated__Q2_4Pool5Magic = 62369, is_free__Q2_4Pool5Magic = 61858} ;
  42. struct Pool {
  43. struct Buffer *freelist__4Pool ;
  44. char *blocklist__4Pool [32];
  45. int nextblock__4Pool ;
  46. char *curblock__4Pool ;
  47. int buffersize__4Pool ;
  48. int nextsize__4Pool ;
  49. int nextfree__4Pool ;
  50. int initsize__4Pool ;
  51. char *name__4Pool ;
  52. int magic__4Pool ;
  53. };
  54. void __glgrow__4PoolFv (struct Pool *);
  55. struct PooledObj;
  56. struct PooledObj {
  57. char __W3__9PooledObj ;
  58. };
  59. typedef float REAL ;
  60. typedef void (*Pfvv )(void );
  61. typedef void (*Pfvf )(float *);
  62. typedef int (*cmpfunc )(void *, void *);
  63. typedef REAL Knot ;
  64. typedef REAL *Knot_ptr ;
  65. struct TrimVertex;
  66. struct PwlArc;
  67. struct PwlArc {
  68. char __W3__9PooledObj ;
  69. struct TrimVertex *pts__6PwlArc ;
  70. int npts__6PwlArc ;
  71. long type__6PwlArc ;
  72. };
  73. struct TrimVertex;
  74. struct TrimVertex {
  75. REAL param__10TrimVertex [2];
  76. long nuid__10TrimVertex ;
  77. };
  78. typedef struct TrimVertex *TrimVertex_p ;
  79. struct Bin;
  80. struct Arc;
  81. struct BezierArc;
  82. typedef struct Arc *Arc_ptr ;
  83. enum arc_side { arc_none = 0, arc_right = 1, arc_top = 2, arc_left = 3, arc_bottom = 4} ;
  84. struct Arc;
  85. struct Arc {
  86. char __W3__9PooledObj ;
  87. Arc_ptr prev__3Arc ;
  88. Arc_ptr next__3Arc ;
  89. Arc_ptr link__3Arc ;
  90. struct BezierArc *bezierArc__3Arc ;
  91. struct PwlArc *pwlArc__3Arc ;
  92. long type__3Arc ;
  93. long nuid__3Arc ;
  94. };
  95. extern int __glbezier_tag__3Arc ;
  96. extern int __glarc_tag__3Arc ;
  97. extern int __gltail_tag__3Arc ;
  98. struct Bin;
  99. struct Bin {
  100. struct Arc *head__3Bin ;
  101. struct Arc *current__3Bin ;
  102. };
  103. struct Sorter;
  104. struct Sorter {
  105. int es__6Sorter ;
  106. struct __mptr *__vptr__6Sorter ;
  107. };
  108. struct FlistSorter;
  109. struct FlistSorter {
  110. int es__6Sorter ;
  111. struct __mptr *__vptr__6Sorter ;
  112. };
  113. struct Flist;
  114. struct Flist {
  115. REAL *pts__5Flist ;
  116. int npts__5Flist ;
  117. int start__5Flist ;
  118. int end__5Flist ;
  119. struct FlistSorter sorter__5Flist ;
  120. };
  121. struct Backend;
  122. struct Jarcloc;
  123. struct Jarcloc {
  124. struct Arc *arc__7Jarcloc ;
  125. struct TrimVertex *p__7Jarcloc ;
  126. struct TrimVertex *plast__7Jarcloc ;
  127. };
  128. struct Trimline;
  129. struct Trimline {
  130. struct TrimVertex **pts__8Trimline ;
  131. long numverts__8Trimline ;
  132. long i__8Trimline ;
  133. long size__8Trimline ;
  134. struct Jarcloc jarcl__8Trimline ;
  135. struct TrimVertex t__8Trimline ;
  136. struct TrimVertex b__8Trimline ;
  137. struct TrimVertex *tinterp__8Trimline ;
  138. struct TrimVertex *binterp__8Trimline ;
  139. };
  140. struct Gridline;
  141. struct Gridline {
  142. long v__8Gridline ;
  143. REAL vval__8Gridline ;
  144. long vindex__8Gridline ;
  145. long ustart__8Gridline ;
  146. long uend__8Gridline ;
  147. };
  148. struct Uarray;
  149. struct Uarray {
  150. long size__6Uarray ;
  151. long ulines__6Uarray ;
  152. REAL *uarray__6Uarray ;
  153. };
  154. struct Backend;
  155. struct TrimRegion;
  156. void __gl__dt__8TrimlineFv (struct Trimline *, int );
  157. void __gl__dt__6UarrayFv (struct Uarray *, int );
  158. struct TrimRegion {
  159. struct Trimline left__10TrimRegion ;
  160. struct Trimline right__10TrimRegion ;
  161. struct Gridline top__10TrimRegion ;
  162. struct Gridline bot__10TrimRegion ;
  163. struct Uarray uarray__10TrimRegion ;
  164. REAL oneOverDu__10TrimRegion ;
  165. };
  166. struct GridTrimVertex;
  167. struct __Q2_4Hull4Side;
  168. struct __Q2_4Hull4Side {
  169. struct Trimline *left__Q2_4Hull4Side ;
  170. struct Gridline *line__Q2_4Hull4Side ;
  171. struct Trimline *right__Q2_4Hull4Side ;
  172. long index__Q2_4Hull4Side ;
  173. };
  174. struct Hull;
  175. struct Hull {
  176. struct __Q2_4Hull4Side lower__4Hull ;
  177. struct __Q2_4Hull4Side upper__4Hull ;
  178. struct Trimline fakeleft__4Hull ;
  179. struct Trimline fakeright__4Hull ;
  180. struct TrimRegion *PTrimRegion;
  181. struct TrimRegion OTrimRegion;
  182. };
  183. struct Backend;
  184. struct GridTrimVertex;
  185. struct Mesher;
  186. struct Mesher {
  187. struct __Q2_4Hull4Side lower__4Hull ;
  188. struct __Q2_4Hull4Side upper__4Hull ;
  189. struct Trimline fakeleft__4Hull ;
  190. struct Trimline fakeright__4Hull ;
  191. struct TrimRegion *PTrimRegion;
  192. struct Backend *backend__6Mesher ;
  193. struct Pool p__6Mesher ;
  194. unsigned int stacksize__6Mesher ;
  195. struct GridTrimVertex **vdata__6Mesher ;
  196. struct GridTrimVertex *last__6Mesher [2];
  197. int itop__6Mesher ;
  198. int lastedge__6Mesher ;
  199. struct TrimRegion OTrimRegion;
  200. };
  201. extern float __glZERO__6Mesher ;
  202. struct Backend;
  203. struct GridVertex;
  204. struct GridTrimVertex;
  205. struct CoveAndTiler;
  206. struct CoveAndTiler {
  207. struct Backend *backend__12CoveAndTiler ;
  208. struct TrimRegion *PTrimRegion;
  209. struct TrimRegion OTrimRegion;
  210. };
  211. extern int __glMAXSTRIPSIZE__12CoveAndTil0 ;
  212. struct Backend;
  213. struct Slicer;
  214. struct Slicer {
  215. struct Backend *backend__12CoveAndTiler ;
  216. struct TrimRegion *PTrimRegion;
  217. struct Mesher OMesher;
  218. struct Backend *backend__6Slicer ;
  219. REAL oneOverDu__6Slicer ;
  220. REAL du__6Slicer ;
  221. REAL dv__6Slicer ;
  222. int isolines__6Slicer ;
  223. };
  224. struct BezierArc;
  225. struct TrimVertexPool;
  226. struct ArcTessellator;
  227. struct ArcTessellator {
  228. struct Pool *pwlarcpool__14ArcTessellator ;
  229. struct TrimVertexPool *trimvertexpool__14ArcTessellator ;
  230. };
  231. extern REAL __glgl_Bernstein__14ArcTessell0 [][24][24];
  232. struct TrimVertexPool;
  233. struct TrimVertexPool {
  234. struct Pool pool__14TrimVertexPool ;
  235. struct TrimVertex **vlist__14TrimVertexPool ;
  236. int nextvlistslot__14TrimVertexPool ;
  237. int vlistsize__14TrimVertexPool ;
  238. };
  239. struct Renderhints;
  240. struct Backend;
  241. struct Quilt;
  242. struct Patchlist;
  243. struct Curvelist;
  244. struct JumpBuffer;
  245. struct Subdivider;
  246. enum __Q2_10Subdivider3dir { down__Q2_10Subdivider3dir = 0, same__Q2_10Subdivider3dir = 1, up__Q2_10Subdivider3dir = 2, none__Q2_10Subdivider3dir = 3} ;
  247. struct Subdivider {
  248. struct Slicer slicer__10Subdivider ;
  249. struct ArcTessellator arctessellator__10Subdivider ;
  250. struct Pool arcpool__10Subdivider ;
  251. struct Pool bezierarcpool__10Subdivider ;
  252. struct Pool pwlarcpool__10Subdivider ;
  253. struct TrimVertexPool trimvertexpool__10Subdivider ;
  254. struct JumpBuffer *jumpbuffer__10Subdivider ;
  255. struct Renderhints *renderhints__10Subdivider ;
  256. struct Backend *backend__10Subdivider ;
  257. struct Bin initialbin__10Subdivider ;
  258. struct Arc *pjarc__10Subdivider ;
  259. int s_index__10Subdivider ;
  260. int t_index__10Subdivider ;
  261. struct Quilt *qlist__10Subdivider ;
  262. struct Flist spbrkpts__10Subdivider ;
  263. struct Flist tpbrkpts__10Subdivider ;
  264. struct Flist smbrkpts__10Subdivider ;
  265. struct Flist tmbrkpts__10Subdivider ;
  266. REAL stepsizes__10Subdivider [4];
  267. int showDegenerate__10Subdivider ;
  268. int isArcTypeBezier__10Subdivider ;
  269. };
  270. int __glbbox__10SubdividerSFfN51 (REAL , REAL , REAL , REAL , REAL , REAL );
  271. int __glccw__10SubdividerSFP10Trim0 (struct TrimVertex *, struct TrimVertex *, struct TrimVertex *);
  272. extern struct __mptr* __ptbl_vec_____core_ccw_c___ccwTurn_sr_[];
  273. int __glccwTurn_sr__10SubdividerFP0 (struct Subdivider *__0this , Arc_ptr __1j1 , Arc_ptr __1j2 )
  274. {
  275. register struct TrimVertex *__1v1 ;
  276. register struct TrimVertex *__1v1last ;
  277. register struct TrimVertex *__1v2 ;
  278. register struct TrimVertex *__1v2last ;
  279. register struct TrimVertex *__1v1next ;
  280. register struct TrimVertex *__1v2next ;
  281. int __1sgn ;
  282. __1v1 = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [(__1j1 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  283. __1v1last = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  284. __1v2 = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  285. __1v2last = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [(__1j2 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  286. __1v1next = (__1v1 - 1 );
  287. __1v2next = (__1v2 + 1 );
  288. ((void )0 );
  289. ((void )0 );
  290. if (((__1v1 -> param__10TrimVertex [0 ])== (__1v1next -> param__10TrimVertex [0 ]))&& ((__1v2 -> param__10TrimVertex [0 ])== (__1v2next -> param__10TrimVertex [0 ])))
  291. return 0 ;
  292. if (((__1v2next -> param__10TrimVertex [0 ])< (__1v2 -> param__10TrimVertex [0 ]))|| ((__1v1next -> param__10TrimVertex [0 ])< (__1v1 -> param__10TrimVertex [0 ])))
  293. mylongjmp ( __0this -> jumpbuffer__10Subdivider , 28 ) ;
  294. if ((__1v1 -> param__10TrimVertex [1 ])< (__1v2 -> param__10TrimVertex [1 ]))
  295. return 0 ;
  296. else if ((__1v1 -> param__10TrimVertex [1 ])> (__1v2 -> param__10TrimVertex [1 ]))
  297. return 1 ;
  298. while (1 ){
  299. if ((__1v1next -> param__10TrimVertex [0 ])< (__1v2next -> param__10TrimVertex [0 ])){
  300. struct TrimVertex *__1__X13 ;
  301. struct TrimVertex *__1__X14 ;
  302. struct TrimVertex *__1__X15 ;
  303. ((void )0 );
  304. ((void )0 );
  305. switch (( (__1__X13 = __1v2 ), ( (__1__X14 = __1v2next ), ( (__1__X15 = __1v1next ), ( __glbbox__10SubdividerSFfN51 ( __1__X13 -> param__10TrimVertex [1 ],
  306. __1__X14 -> param__10TrimVertex [1 ], __1__X15 -> param__10TrimVertex [1 ], __1__X13 -> param__10TrimVertex [(1 - 1 )], __1__X14 -> param__10TrimVertex [(1 - 1 )], __1__X15 -> param__10TrimVertex [(1 - 1 )]) )
  307. ) ) ) ){
  308. case -1:
  309. return 0 ;
  310. case 0 :
  311. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v2 , __1v2next ) ;
  312. if (__1sgn != -1){
  313. return __1sgn ;
  314. }
  315. else
  316. {
  317. ( 0 ) ;
  318. __1v1 = (__1v1next -- );
  319. if (__1v1 == __1v1last ){
  320. ( 0 ) ;
  321. return 0 ;
  322. }
  323. }
  324. break ;
  325. case 1 :
  326. return 1 ;
  327. }
  328. }
  329. else
  330. if ((__1v1next -> param__10TrimVertex [0 ])> (__1v2next -> param__10TrimVertex [0 ])){
  331. struct TrimVertex *__1__X16 ;
  332. struct TrimVertex *__1__X17 ;
  333. struct TrimVertex *__1__X18 ;
  334. ((void )0 );
  335. ((void )0 );
  336. switch (( (__1__X16 = __1v1 ), ( (__1__X17 = __1v1next ), ( (__1__X18 = __1v2next ), ( __glbbox__10SubdividerSFfN51 ( __1__X16 -> param__10TrimVertex [1 ],
  337. __1__X17 -> param__10TrimVertex [1 ], __1__X18 -> param__10TrimVertex [1 ], __1__X16 -> param__10TrimVertex [(1 - 1 )], __1__X17 -> param__10TrimVertex [(1 - 1 )], __1__X18 -> param__10TrimVertex [(1 - 1 )]) )
  338. ) ) ) ){
  339. case -1:
  340. return 1 ;
  341. case 0 :
  342. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v1 , __1v2next ) ;
  343. if (__1sgn != -1){
  344. return __1sgn ;
  345. }
  346. else
  347. {
  348. ( 0 ) ;
  349. __1v2 = (__1v2next ++ );
  350. if (__1v2 == __1v2last ){
  351. ( 0 ) ;
  352. return 0 ;
  353. }
  354. }
  355. break ;
  356. case 1 :
  357. return 0 ;
  358. }
  359. }
  360. else
  361. {
  362. if ((__1v1next -> param__10TrimVertex [1 ])< (__1v2next -> param__10TrimVertex [1 ]))
  363. return 0 ;
  364. else if ((__1v1next -> param__10TrimVertex [1 ])> (__1v2next -> param__10TrimVertex [1 ]))
  365. return 1 ;
  366. else {
  367. ( 0 ) ;
  368. __1v2 = (__1v2next ++ );
  369. if (__1v2 == __1v2last ){
  370. ( 0 ) ;
  371. return 0 ;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. int __glccwTurn_sl__10SubdividerFP0 (struct Subdivider *__0this , Arc_ptr __1j1 , Arc_ptr __1j2 )
  378. {
  379. register struct TrimVertex *__1v1 ;
  380. register struct TrimVertex *__1v1last ;
  381. register struct TrimVertex *__1v2 ;
  382. register struct TrimVertex *__1v2last ;
  383. register struct TrimVertex *__1v1next ;
  384. register struct TrimVertex *__1v2next ;
  385. int __1sgn ;
  386. __1v1 = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [(__1j1 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  387. __1v1last = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  388. __1v2 = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  389. __1v2last = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [(__1j2 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  390. __1v1next = (__1v1 - 1 );
  391. __1v2next = (__1v2 + 1 );
  392. ((void )0 );
  393. ((void )0 );
  394. if (((__1v1 -> param__10TrimVertex [0 ])== (__1v1next -> param__10TrimVertex [0 ]))&& ((__1v2 -> param__10TrimVertex [0 ])== (__1v2next -> param__10TrimVertex [0 ])))
  395. return 0 ;
  396. if (((__1v2next -> param__10TrimVertex [0 ])> (__1v2 -> param__10TrimVertex [0 ]))|| ((__1v1next -> param__10TrimVertex [0 ])> (__1v1 -> param__10TrimVertex [0 ])))
  397. mylongjmp ( __0this -> jumpbuffer__10Subdivider , 28 ) ;
  398. if ((__1v1 -> param__10TrimVertex [1 ])< (__1v2 -> param__10TrimVertex [1 ]))
  399. return 1 ;
  400. else if ((__1v1 -> param__10TrimVertex [1 ])> (__1v2 -> param__10TrimVertex [1 ]))
  401. return 0 ;
  402. while (1 ){
  403. if ((__1v1next -> param__10TrimVertex [0 ])> (__1v2next -> param__10TrimVertex [0 ])){
  404. struct TrimVertex *__1__X19 ;
  405. struct TrimVertex *__1__X20 ;
  406. struct TrimVertex *__1__X21 ;
  407. ((void )0 );
  408. ((void )0 );
  409. switch (( (__1__X19 = __1v2next ), ( (__1__X20 = __1v2 ), ( (__1__X21 = __1v1next ), ( __glbbox__10SubdividerSFfN51 ( __1__X19 -> param__10TrimVertex [1 ],
  410. __1__X20 -> param__10TrimVertex [1 ], __1__X21 -> param__10TrimVertex [1 ], __1__X19 -> param__10TrimVertex [(1 - 1 )], __1__X20 -> param__10TrimVertex [(1 - 1 )], __1__X21 -> param__10TrimVertex [(1 - 1 )]) )
  411. ) ) ) ){
  412. case -1:
  413. return 1 ;
  414. case 0 :
  415. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v2 , __1v2next ) ;
  416. if (__1sgn != -1)
  417. return __1sgn ;
  418. else {
  419. __1v1 = (__1v1next -- );
  420. ( 0 ) ;
  421. if (__1v1 == __1v1last ){
  422. ( 0 ) ;
  423. return 0 ;
  424. }
  425. }
  426. break ;
  427. case 1 :
  428. return 0 ;
  429. }
  430. }
  431. else
  432. if ((__1v1next -> param__10TrimVertex [0 ])< (__1v2next -> param__10TrimVertex [0 ])){
  433. struct TrimVertex *__1__X22 ;
  434. struct TrimVertex *__1__X23 ;
  435. struct TrimVertex *__1__X24 ;
  436. ((void )0 );
  437. ((void )0 );
  438. switch (( (__1__X22 = __1v1next ), ( (__1__X23 = __1v1 ), ( (__1__X24 = __1v2next ), ( __glbbox__10SubdividerSFfN51 ( __1__X22 -> param__10TrimVertex [1 ],
  439. __1__X23 -> param__10TrimVertex [1 ], __1__X24 -> param__10TrimVertex [1 ], __1__X22 -> param__10TrimVertex [(1 - 1 )], __1__X23 -> param__10TrimVertex [(1 - 1 )], __1__X24 -> param__10TrimVertex [(1 - 1 )]) )
  440. ) ) ) ){
  441. case -1:
  442. return 0 ;
  443. case 0 :
  444. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v1 , __1v2next ) ;
  445. if (__1sgn != -1)
  446. return __1sgn ;
  447. else {
  448. __1v2 = (__1v2next ++ );
  449. ( 0 ) ;
  450. if (__1v2 == __1v2last ){
  451. ( 0 ) ;
  452. return 0 ;
  453. }
  454. }
  455. break ;
  456. case 1 :
  457. return 1 ;
  458. }
  459. }
  460. else
  461. {
  462. ( 0 ) ;
  463. if ((__1v1next -> param__10TrimVertex [1 ])< (__1v2next -> param__10TrimVertex [1 ]))
  464. return 1 ;
  465. else if ((__1v1next -> param__10TrimVertex [1 ])> (__1v2next -> param__10TrimVertex [1 ]))
  466. return 0 ;
  467. else {
  468. __1v2 = (__1v2next ++ );
  469. ( 0 ) ;
  470. if (__1v2 == __1v2last ){
  471. ( 0 ) ;
  472. return 0 ;
  473. }
  474. }
  475. }
  476. }
  477. }
  478. int __glccwTurn_tr__10SubdividerFP0 (struct Subdivider *__0this , Arc_ptr __1j1 , Arc_ptr __1j2 )
  479. {
  480. register struct TrimVertex *__1v1 ;
  481. register struct TrimVertex *__1v1last ;
  482. register struct TrimVertex *__1v2 ;
  483. register struct TrimVertex *__1v2last ;
  484. register struct TrimVertex *__1v1next ;
  485. register struct TrimVertex *__1v2next ;
  486. int __1sgn ;
  487. __1v1 = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [(__1j1 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  488. __1v1last = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  489. __1v2 = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  490. __1v2last = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [(__1j2 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  491. __1v1next = (__1v1 - 1 );
  492. __1v2next = (__1v2 + 1 );
  493. ((void )0 );
  494. ((void )0 );
  495. if (((__1v1 -> param__10TrimVertex [1 ])== (__1v1next -> param__10TrimVertex [1 ]))&& ((__1v2 -> param__10TrimVertex [1 ])== (__1v2next -> param__10TrimVertex [1 ])))
  496. return 0 ;
  497. if (((__1v2next -> param__10TrimVertex [1 ])< (__1v2 -> param__10TrimVertex [1 ]))|| ((__1v1next -> param__10TrimVertex [1 ])< (__1v1 -> param__10TrimVertex [1 ])))
  498. mylongjmp ( __0this -> jumpbuffer__10Subdivider , 28 ) ;
  499. if ((__1v1 -> param__10TrimVertex [0 ])< (__1v2 -> param__10TrimVertex [0 ]))
  500. return 1 ;
  501. else if ((__1v1 -> param__10TrimVertex [0 ])> (__1v2 -> param__10TrimVertex [0 ]))
  502. return 0 ;
  503. while (1 ){
  504. if ((__1v1next -> param__10TrimVertex [1 ])< (__1v2next -> param__10TrimVertex [1 ])){
  505. struct TrimVertex *__1__X25 ;
  506. struct TrimVertex *__1__X26 ;
  507. struct TrimVertex *__1__X27 ;
  508. ((void )0 );
  509. ((void )0 );
  510. switch (( (__1__X25 = __1v2 ), ( (__1__X26 = __1v2next ), ( (__1__X27 = __1v1next ), ( __glbbox__10SubdividerSFfN51 ( __1__X25 -> param__10TrimVertex [0 ],
  511. __1__X26 -> param__10TrimVertex [0 ], __1__X27 -> param__10TrimVertex [0 ], __1__X25 -> param__10TrimVertex [(1 - 0 )], __1__X26 -> param__10TrimVertex [(1 - 0 )], __1__X27 -> param__10TrimVertex [(1 - 0 )]) )
  512. ) ) ) ){
  513. case -1:
  514. return 1 ;
  515. case 0 :
  516. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v2 , __1v2next ) ;
  517. if (__1sgn != -1){
  518. return __1sgn ;
  519. }
  520. else
  521. {
  522. ( 0 ) ;
  523. __1v1 = (__1v1next -- );
  524. if (__1v1 == __1v1last ){
  525. ( 0 ) ;
  526. return 0 ;
  527. }
  528. }
  529. break ;
  530. case 1 :
  531. return 0 ;
  532. }
  533. }
  534. else
  535. if ((__1v1next -> param__10TrimVertex [1 ])> (__1v2next -> param__10TrimVertex [1 ])){
  536. struct TrimVertex *__1__X28 ;
  537. struct TrimVertex *__1__X29 ;
  538. struct TrimVertex *__1__X30 ;
  539. ((void )0 );
  540. ((void )0 );
  541. switch (( (__1__X28 = __1v1 ), ( (__1__X29 = __1v1next ), ( (__1__X30 = __1v2next ), ( __glbbox__10SubdividerSFfN51 ( __1__X28 -> param__10TrimVertex [0 ],
  542. __1__X29 -> param__10TrimVertex [0 ], __1__X30 -> param__10TrimVertex [0 ], __1__X28 -> param__10TrimVertex [(1 - 0 )], __1__X29 -> param__10TrimVertex [(1 - 0 )], __1__X30 -> param__10TrimVertex [(1 - 0 )]) )
  543. ) ) ) ){
  544. case -1:
  545. return 0 ;
  546. case 0 :
  547. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v1 , __1v2next ) ;
  548. if (__1sgn != -1){
  549. return __1sgn ;
  550. }
  551. else
  552. {
  553. ( 0 ) ;
  554. __1v2 = (__1v2next ++ );
  555. if (__1v2 == __1v2last ){
  556. ( 0 ) ;
  557. return 0 ;
  558. }
  559. }
  560. break ;
  561. case 1 :
  562. return 1 ;
  563. }
  564. }
  565. else
  566. {
  567. ( 0 ) ;
  568. if ((__1v1next -> param__10TrimVertex [0 ])< (__1v2next -> param__10TrimVertex [0 ]))
  569. return 1 ;
  570. else if ((__1v1next -> param__10TrimVertex [0 ])> (__1v2next -> param__10TrimVertex [0 ]))
  571. return 0 ;
  572. else {
  573. ( 0 ) ;
  574. __1v2 = (__1v2next ++ );
  575. if (__1v2 == __1v2last ){
  576. ( 0 ) ;
  577. return 0 ;
  578. }
  579. }
  580. }
  581. }
  582. }
  583. int __glccwTurn_tl__10SubdividerFP0 (struct Subdivider *__0this , Arc_ptr __1j1 , Arc_ptr __1j2 )
  584. {
  585. register struct TrimVertex *__1v1 ;
  586. register struct TrimVertex *__1v1last ;
  587. register struct TrimVertex *__1v2 ;
  588. register struct TrimVertex *__1v2last ;
  589. register struct TrimVertex *__1v1next ;
  590. register struct TrimVertex *__1v2next ;
  591. int __1sgn ;
  592. __1v1 = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [(__1j1 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  593. __1v1last = (& (__1j1 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  594. __1v2 = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [0 ]));
  595. __1v2last = (& (__1j2 -> pwlArc__3Arc -> pts__6PwlArc [(__1j2 -> pwlArc__3Arc -> npts__6PwlArc - 1 )]));
  596. __1v1next = (__1v1 - 1 );
  597. __1v2next = (__1v2 + 1 );
  598. ((void )0 );
  599. ((void )0 );
  600. if (((__1v1 -> param__10TrimVertex [1 ])== (__1v1next -> param__10TrimVertex [1 ]))&& ((__1v2 -> param__10TrimVertex [1 ])== (__1v2next -> param__10TrimVertex [1 ])))
  601. return 0 ;
  602. if (((__1v2next -> param__10TrimVertex [1 ])> (__1v2 -> param__10TrimVertex [1 ]))|| ((__1v1next -> param__10TrimVertex [1 ])> (__1v1 -> param__10TrimVertex [1 ])))
  603. mylongjmp ( __0this -> jumpbuffer__10Subdivider , 28 ) ;
  604. if ((__1v1 -> param__10TrimVertex [0 ])< (__1v2 -> param__10TrimVertex [0 ]))
  605. return 0 ;
  606. else if ((__1v1 -> param__10TrimVertex [0 ])> (__1v2 -> param__10TrimVertex [0 ]))
  607. return 1 ;
  608. while (1 ){
  609. if ((__1v1next -> param__10TrimVertex [1 ])> (__1v2next -> param__10TrimVertex [1 ])){
  610. struct TrimVertex *__1__X31 ;
  611. struct TrimVertex *__1__X32 ;
  612. struct TrimVertex *__1__X33 ;
  613. ((void )0 );
  614. ((void )0 );
  615. switch (( (__1__X31 = __1v2next ), ( (__1__X32 = __1v2 ), ( (__1__X33 = __1v1next ), ( __glbbox__10SubdividerSFfN51 ( __1__X31 -> param__10TrimVertex [0 ],
  616. __1__X32 -> param__10TrimVertex [0 ], __1__X33 -> param__10TrimVertex [0 ], __1__X31 -> param__10TrimVertex [(1 - 0 )], __1__X32 -> param__10TrimVertex [(1 - 0 )], __1__X33 -> param__10TrimVertex [(1 - 0 )]) )
  617. ) ) ) ){
  618. case -1:
  619. return 0 ;
  620. case 0 :
  621. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v2 , __1v2next ) ;
  622. if (__1sgn != -1)
  623. return __1sgn ;
  624. else {
  625. __1v1 = (__1v1next -- );
  626. ( 0 ) ;
  627. if (__1v1 == __1v1last ){
  628. ( 0 ) ;
  629. return 0 ;
  630. }
  631. }
  632. break ;
  633. case 1 :
  634. return 1 ;
  635. }
  636. }
  637. else
  638. if ((__1v1next -> param__10TrimVertex [1 ])< (__1v2next -> param__10TrimVertex [1 ])){
  639. struct TrimVertex *__1__X34 ;
  640. struct TrimVertex *__1__X35 ;
  641. struct TrimVertex *__1__X36 ;
  642. switch (( (__1__X34 = __1v1next ), ( (__1__X35 = __1v1 ), ( (__1__X36 = __1v2next ), ( __glbbox__10SubdividerSFfN51 ( __1__X34 -> param__10TrimVertex [0 ],
  643. __1__X35 -> param__10TrimVertex [0 ], __1__X36 -> param__10TrimVertex [0 ], __1__X34 -> param__10TrimVertex [(1 - 0 )], __1__X35 -> param__10TrimVertex [(1 - 0 )], __1__X36 -> param__10TrimVertex [(1 - 0 )]) )
  644. ) ) ) ){
  645. case -1:
  646. return 1 ;
  647. case 0 :
  648. __1sgn = __glccw__10SubdividerSFP10Trim0 ( __1v1next , __1v1 , __1v2next ) ;
  649. if (__1sgn != -1)
  650. return __1sgn ;
  651. else {
  652. __1v2 = (__1v2next ++ );
  653. ( 0 ) ;
  654. if (__1v2 == __1v2last ){
  655. ( 0 ) ;
  656. return 0 ;
  657. }
  658. }
  659. break ;
  660. case 1 :
  661. return 0 ;
  662. }
  663. }
  664. else
  665. {
  666. ( 0 ) ;
  667. if ((__1v1next -> param__10TrimVertex [0 ])< (__1v2next -> param__10TrimVertex [0 ]))
  668. return 0 ;
  669. else if ((__1v1next -> param__10TrimVertex [0 ])> (__1v2next -> param__10TrimVertex [0 ]))
  670. return 1 ;
  671. else {
  672. __1v2 = (__1v2next ++ );
  673. ( 0 ) ;
  674. if (__1v2 == __1v2last ){
  675. ( 0 ) ;
  676. return 0 ;
  677. }
  678. }
  679. }
  680. }
  681. }
  682. int __glbbox__10SubdividerSFfN51 (register REAL __1sa , register REAL __1sb , register REAL __1sc ,
  683. register REAL __1__A37 , register REAL __1__A38 , register REAL __1__A39 )
  684. {
  685. if
  686. (__1sa < __1sb ){
  687. if (__1sc <= __1sa ){
  688. return -1;
  689. }
  690. else
  691. if (__1sb <= __1sc ){
  692. return 1 ;
  693. }
  694. else
  695. {
  696. return 0 ;
  697. }
  698. }
  699. else
  700. if (__1sa > __1sb ){
  701. if (__1sc >= __1sa ){
  702. return 1 ;
  703. }
  704. else
  705. if (__1sb >= __1sc ){
  706. return -1;
  707. }
  708. else
  709. {
  710. return 0 ;
  711. }
  712. }
  713. else
  714. {
  715. if (__1sc > __1sa ){
  716. return 1 ;
  717. }
  718. else
  719. if (__1sb > __1sc ){
  720. return -1;
  721. }
  722. else
  723. {
  724. return 0 ;
  725. }
  726. }
  727. }
  728. int __glccw__10SubdividerSFP10Trim0 (struct TrimVertex *__1a , struct TrimVertex *__1b , struct TrimVertex *__1c )
  729. {
  730. REAL __1d ;
  731. struct TrimVertex *__1__X40 ;
  732. struct TrimVertex *__1__X41 ;
  733. struct TrimVertex *__1__X42 ;
  734. __1d = ( (__1__X40 = __1a ), ( (__1__X41 = __1b ), ( (__1__X42 = __1c ), ( ((((__1__X40 -> param__10TrimVertex [0 ])* ((__1__X41 ->
  735. param__10TrimVertex [1 ])- (__1__X42 -> param__10TrimVertex [1 ])))+ ((__1__X41 -> param__10TrimVertex [0 ])* ((__1__X42 -> param__10TrimVertex [1 ])- (__1__X40 -> param__10TrimVertex [1 ]))))+ ((__1__X42 -> param__10TrimVertex [0 ])* ((__1__X40 -> param__10TrimVertex [1 ])- (__1__X41 ->
  736. param__10TrimVertex [1 ]))))) ) ) ) ;
  737. if (( ((__1d < 0.0 )?(- __1d ):__1d )) < 0.0001 )return -1;
  738. return ((__1d < 0.0 )?0 :1 );
  739. }
  740. /* the end */