Debian Codegraph @

src/gen/lib/common/routespl__c.java

raw symbols SCIP
1 /* ========================================================================
2 * PlantUML : a free UML diagram generator
3 * ========================================================================
4 *
5 * Project Info: http://plantuml.com
6 *
7 * If you like this project or if you find it useful, you can support us at:
8 *
9 * http://plantuml.com/patreon (only 1$ per month!)
10 * http://plantuml.com/paypal
11 *
12 * This file is part of Smetana.
13 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
14 *
15 * (C) Copyright 2009-2020, Arnaud Roques
16 *
17 * This translation is distributed under the same Licence as the original C program:
18 *
19 *************************************************************************
20 * Copyright (c) 2011 AT&T Intellectual Property
21 * All rights reserved. This program and the accompanying materials
22 * are made available under the terms of the Eclipse Public License v1.0
23 * which accompanies this distribution, and is available at
24 * http://www.eclipse.org/legal/epl-v10.html
25 *
26 * Contributors: See CVS logs. Details at http://www.graphviz.org/
27 *************************************************************************
28 *
29 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
30 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
31 *
32 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
33 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
34 *
35 * You may obtain a copy of the License at
36 *
37 * http://www.eclipse.org/legal/epl-v10.html
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 *
45 */
46 package gen.lib.common;
47 import static gen.lib.cgraph.edge__c.aghead;
48 import static gen.lib.cgraph.edge__c.agtail;
49 import static gen.lib.pathplan.route__c.Proutespline;
50 import static gen.lib.pathplan.shortest__c.Pshortestpath;
51 import static gen.lib.pathplan.util__c.make_polyline;
52 import static smetana.core.JUtils.NEQ;
53 import static smetana.core.JUtils.cos;
54 import static smetana.core.JUtils.sin;
55 import static smetana.core.JUtilsDebug.ENTERING;
56 import static smetana.core.JUtilsDebug.LEAVING;
57 import static smetana.core.Macro.ABS;
58 import static smetana.core.Macro.ALLOC_allocated_ST_Pedge_t;
59 import static smetana.core.Macro.ALLOC_allocated_ST_pointf;
60 import static smetana.core.Macro.ED_edge_type;
61 import static smetana.core.Macro.ED_to_orig;
62 import static smetana.core.Macro.INT_MAX;
63 import static smetana.core.Macro.INT_MIN;
64 import static smetana.core.Macro.MIN;
65 import static smetana.core.Macro.N;
66 import static smetana.core.Macro.NOT;
67 import static smetana.core.Macro.UNSUPPORTED;
68 import h.ST_Agedge_s;
69 import h.ST_Ppoly_t;
70 import h.ST_boxf;
71 import h.ST_path;
72 import h.ST_pointf;
73 import smetana.core.Memory;
74 import smetana.core.Z;
75 import smetana.core.__ptr__;
76
77 public class routespl__c {
78 //1 2digov3edok6d5srhgtlmrycs
79 // extern lt_symlist_t lt_preloaded_symbols[]
80
81
82 //1 baedz5i9est5csw3epz3cv7z
83 // typedef Ppoly_t Ppolyline_t
84
85
86 //1 9k44uhd5foylaeoekf3llonjq
87 // extern Dtmethod_t* Dtset
88
89
90 //1 1ahfywsmzcpcig2oxm7pt9ihj
91 // extern Dtmethod_t* Dtbag
92
93
94 //1 anhghfj3k7dmkudy2n7rvt31v
95 // extern Dtmethod_t* Dtoset
96
97
98 //1 5l6oj1ux946zjwvir94ykejbc
99 // extern Dtmethod_t* Dtobag
100
101
102 //1 2wtf222ak6cui8cfjnw6w377z
103 // extern Dtmethod_t* Dtlist
104
105
106 //1 d1s1s6ibtcsmst88e3057u9r7
107 // extern Dtmethod_t* Dtstack
108
109
110 //1 axa7mflo824p6fspjn1rdk0mt
111 // extern Dtmethod_t* Dtqueue
112
113
114 //1 ega812utobm4xx9oa9w9ayij6
115 // extern Dtmethod_t* Dtdeque
116
117
118 //1 cyfr996ur43045jv1tjbelzmj
119 // extern Dtmethod_t* Dtorder
120
121
122 //1 wlofoiftbjgrrabzb2brkycg
123 // extern Dtmethod_t* Dttree
124
125
126 //1 12bds94t7voj7ulwpcvgf6agr
127 // extern Dtmethod_t* Dthash
128
129
130 //1 9lqknzty480cy7zsubmabkk8h
131 // extern Dtmethod_t _Dttree
132
133
134 //1 bvn6zkbcp8vjdhkccqo1xrkrb
135 // extern Dtmethod_t _Dthash
136
137
138 //1 9lidhtd6nsmmv3e7vjv9e10gw
139 // extern Dtmethod_t _Dtlist
140
141
142 //1 34ujfamjxo7xn89u90oh2k6f8
143 // extern Dtmethod_t _Dtqueue
144
145
146 //1 3jy4aceckzkdv950h89p4wjc8
147 // extern Dtmethod_t _Dtstack
148
149
150 //1 8dfqgf3u1v830qzcjqh9o8ha7
151 // extern Agmemdisc_t AgMemDisc
152
153
154 //1 18k2oh2t6llfsdc5x0wlcnby8
155 // extern Agiddisc_t AgIdDisc
156
157
158 //1 a4r7hi80gdxtsv4hdoqpyiivn
159 // extern Agiodisc_t AgIoDisc
160
161
162 //1 bnzt5syjb7mgeru19114vd6xx
163 // extern Agdisc_t AgDefaultDisc
164
165
166 //1 35y2gbegsdjilegaribes00mg
167 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
168
169
170 //1 c2rygslq6bcuka3awmvy2b3ow
171 // typedef Agsubnode_t Agnoderef_t
172
173
174 //1 xam6yv0dcsx57dtg44igpbzn
175 // typedef Dtlink_t Agedgeref_t
176
177
178 //1 nye6dsi1twkbddwo9iffca1j
179 // extern char *Version
180
181
182 //1 65mu6k7h7lb7bx14jpiw7iyxr
183 // extern char **Files
184
185
186 //1 2rpjdzsdyrvomf00zcs3u3dyn
187 // extern const char **Lib
188
189
190 //1 6d2f111lntd2rsdt4gswh5909
191 // extern char *CmdName
192
193
194 //1 a0ltq04fpeg83soa05a2fkwb2
195 // extern char *specificFlags
196
197
198 //1 1uv30qeqq2jh6uznlr4dziv0y
199 // extern char *specificItems
200
201
202 //1 7i4hkvngxe3x7lmg5h6b3t9g3
203 // extern char *Gvfilepath
204
205
206 //1 9jp96pa73kseya3w6sulxzok6
207 // extern char *Gvimagepath
208
209
210 //1 40ylumfu7mrvawwf4v2asvtwk
211 // extern unsigned char Verbose
212
213
214 //1 93st8awjy1z0h07n28qycbaka
215 // extern unsigned char Reduce
216
217
218 //1 f2vs67ts992erf8onwfglurzp
219 // extern int MemTest
220
221
222 //1 c6f8whijgjwwagjigmxlwz3gb
223 // extern char *HTTPServerEnVar
224
225
226 //1 cp4hzj7p87m7arw776d3bt7aj
227 // extern char *Output_file_name
228
229
230 //1 a3rqagofsgraie6mx0krzkgsy
231 // extern int graphviz_errors
232
233
234 //1 5up05203r4kxvjn1m4njcgq5x
235 // extern int Nop
236
237
238 //1 umig46cco431x14b3kosde2t
239 // extern double PSinputscale
240
241
242 //1 52bj6v8fqz39khasobljfukk9
243 // extern int Syntax_errors
244
245
246 //1 9ekf2ina8fsjj6y6i0an6somj
247 // extern int Show_cnt
248
249
250 //1 38di5qi3nkxkq65onyvconk3r
251 // extern char** Show_boxes
252
253
254 //1 6ri6iu712m8mpc7t2670etpcw
255 // extern int CL_type
256
257
258 //1 bomxiw3gy0cgd1ydqtek7fpxr
259 // extern unsigned char Concentrate
260
261
262 //1 cqy3gqgcq8empdrbnrhn84058
263 // extern double Epsilon
264
265
266 //1 64slegfoouqeg0rmbyjrm8wgr
267 // extern int MaxIter
268
269
270 //1 88wdinpnmfs4mab4aw62yb0bg
271 // extern int Ndim
272
273
274 //1 8bbad3ogcelqnnvo5br5s05gq
275 // extern int State
276
277
278 //1 17rnd8q45zclfn68qqst2vxxn
279 // extern int EdgeLabelsDone
280
281
282 //1 ymx1z4s8cznjifl2d9f9m8jr
283 // extern double Initial_dist
284
285
286 //1 a33bgl0c3uqb3trx419qulj1x
287 // extern double Damping
288
289
290 //1 d9lvrpjg1r0ojv40pod1xwk8n
291 // extern int Y_invert
292
293
294 //1 71efkfs77q5tq9ex6y0f4kanh
295 // extern int GvExitOnUsage
296
297
298 //1 4xy2dkdkv0acs2ue9eca8hh2e
299 // extern Agsym_t *G_activepencolor, *G_activefillcolor, *G_selectedpencolor, *G_selectedfillcolor, *G_visitedpencolor, *G_visitedfillcolor, *G_deletedpencolor, *G_deletedfillcolor, *G_ordering, *G_peripheries, *G_penwidth, *G_gradientangle, *G_margin
300
301
302 //1 9js5gxgzr74eakgtfhnbws3t9
303 // extern Agsym_t *N_height, *N_width, *N_shape, *N_color, *N_fillcolor, *N_activepencolor, *N_activefillcolor, *N_selectedpencolor, *N_selectedfillcolor, *N_visitedpencolor, *N_visitedfillcolor, *N_deletedpencolor, *N_deletedfillcolor, *N_fontsize, *N_fontname, *N_fontcolor, *N_margin, *N_label, *N_xlabel, *N_nojustify, *N_style, *N_showboxes, *N_sides, *N_peripheries, *N_ordering, *N_orientation, *N_skew, *N_distortion, *N_fixed, *N_imagescale, *N_layer, *N_group, *N_comment, *N_vertices, *N_z, *N_penwidth, *N_gradientangle
304
305
306 //1 anqllp9sj7wo45w6bm11j8trn
307 // extern Agsym_t *E_weight, *E_minlen, *E_color, *E_fillcolor, *E_activepencolor, *E_activefillcolor, *E_selectedpencolor, *E_selectedfillcolor, *E_visitedpencolor, *E_visitedfillcolor, *E_deletedpencolor, *E_deletedfillcolor, *E_fontsize, *E_fontname, *E_fontcolor, *E_label, *E_xlabel, *E_dir, *E_style, *E_decorate, *E_showboxes, *E_arrowsz, *E_constr, *E_layer, *E_comment, *E_label_float, *E_samehead, *E_sametail, *E_arrowhead, *E_arrowtail, *E_headlabel, *E_taillabel, *E_labelfontsize, *E_labelfontname, *E_labelfontcolor, *E_labeldistance, *E_labelangle, *E_tailclip, *E_headclip, *E_penwidth
308
309
310 //1 bh0z9puipqw7gymjd5h5b8s6i
311 // extern struct fdpParms_s* fdp_parms
312
313
314
315
316 //3 ciez0pfggxdljedzsbklq49f0
317 // static inline point pointof(int x, int y)
318 public static Object pointof(Object... arg) {
319 UNSUPPORTED("8e4tj258yvfq5uhsdpk37n5eq"); // static inline point pointof(int x, int y)
320 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
321 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
322 UNSUPPORTED("12jimkrzqxavaie0cpapbx18c"); // r.x = x;
323 UNSUPPORTED("7ivmviysahgsc5nn9gtp7q2if"); // r.y = y;
324 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
325 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
326
327 throw new UnsupportedOperationException();
328 }
329
330
331
332
333 //3 c1s4k85p1cdfn176o3uryeros
334 // static inline pointf pointfof(double x, double y)
335 public static ST_pointf pointfof(double x, double y) {
336 // WARNING!! STRUCT
337 return pointfof_w_(x, y).copy();
338 }
339 private static ST_pointf pointfof_w_(double x, double y) {
340 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
341 try {
342 final ST_pointf r = new ST_pointf();
343 r.setDouble("x", x);
344 r.setDouble("y", y);
345 return r;
346 } finally {
347 LEAVING("c1s4k85p1cdfn176o3uryeros","pointfof");
348 }
349 }
350
351
352
353
354 //3 7cufnfitrh935ew093mw0i4b7
355 // static inline box boxof(int llx, int lly, int urx, int ury)
356 public static Object boxof(Object... arg) {
357 UNSUPPORTED("3lzesfdd337h31jrlib1czocm"); // static inline box boxof(int llx, int lly, int urx, int ury)
358 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
359 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
360 UNSUPPORTED("cylhjlutoc0sc0uy7g98m9fb8"); // b.LL.x = llx, b.LL.y = lly;
361 UNSUPPORTED("242of6revxzx8hpe7yerrchz6"); // b.UR.x = urx, b.UR.y = ury;
362 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
363 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
364
365 throw new UnsupportedOperationException();
366 }
367
368
369
370
371
372
373
374
375 //3 1n5xl70wxuabyf97mclvilsm6
376 // static inline point add_point(point p, point q)
377 public static Object add_point(Object... arg) {
378 UNSUPPORTED("6iamka1fx8fk1rohzzse8phte"); // static inline point add_point(point p, point q)
379 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
380 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
381 UNSUPPORTED("3n2sizjd0civbzm6iq7su1s2p"); // r.x = p.x + q.x;
382 UNSUPPORTED("65ygdo31w09i5i6bd2f7azcd3"); // r.y = p.y + q.y;
383 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
384 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
385
386 throw new UnsupportedOperationException();
387 }
388
389
390
391
392 //3 arrsbik9b5tnfcbzsm8gr2chx
393 // static inline pointf add_pointf(pointf p, pointf q)
394 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
395 // WARNING!! STRUCT
396 return add_pointf_w_(p.copy(), q.copy()).copy();
397 }
398 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
399 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
400 try {
401 final ST_pointf r = new ST_pointf();
402 r.setDouble("x", p.x + q.x);
403 r.setDouble("y", p.y + q.y);
404 return r;
405 } finally {
406 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
407 }
408 }
409
410
411
412
413 //3 ai2dprak5y6obdsflguh5qbd7
414 // static inline point sub_point(point p, point q)
415 public static Object sub_point(Object... arg) {
416 UNSUPPORTED("cd602849h0bce8lu9xegka0ia"); // static inline point sub_point(point p, point q)
417 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
418 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
419 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
420 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
421 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
422 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
423
424 throw new UnsupportedOperationException();
425 }
426
427
428
429
430 //3 16f6pyogcv3j7n2p0n8giqqgh
431 // static inline pointf sub_pointf(pointf p, pointf q)
432 public static Object sub_pointf(Object... arg) {
433 UNSUPPORTED("dmufj44lddsnj0wjyxsg2fcso"); // static inline pointf sub_pointf(pointf p, pointf q)
434 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
435 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
436 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
437 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
438 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
439 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
440
441 throw new UnsupportedOperationException();
442 }
443
444
445
446
447 //3 9k50jgrhc4f9824vf8ony74rw
448 // static inline point mid_point(point p, point q)
449 public static Object mid_point(Object... arg) {
450 UNSUPPORTED("evy44tdsmu3erff9dp2x835u2"); // static inline point mid_point(point p, point q)
451 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
452 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
453 UNSUPPORTED("1a6p6fm57o0wt5ze2btsx06c7"); // r.x = (p.x + q.x) / 2;
454 UNSUPPORTED("1kbj5tgdmfi6kf4jgg6skhr6e"); // r.y = (p.y + q.y) / 2;
455 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
456 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
457
458 throw new UnsupportedOperationException();
459 }
460
461
462
463
464 //3 59c4f7im0ftyowhnzzq2v9o1x
465 // static inline pointf mid_pointf(pointf p, pointf q)
466 public static Object mid_pointf(Object... arg) {
467 UNSUPPORTED("381o63o9kb04d7gzg65v0r3q"); // static inline pointf mid_pointf(pointf p, pointf q)
468 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
469 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
470 UNSUPPORTED("c5vboetlr3mf43wns7iik6m1w"); // r.x = (p.x + q.x) / 2.;
471 UNSUPPORTED("bcdf562ldr3bjn78hcay5xd63"); // r.y = (p.y + q.y) / 2.;
472 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
473 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
474
475 throw new UnsupportedOperationException();
476 }
477
478
479
480
481 //3 5r18p38gisvcx3zsvbb9saixx
482 // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
483 public static Object interpolate_pointf(Object... arg) {
484 UNSUPPORTED("894yimn33kmtm454llwdaotu8"); // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
485 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
486 UNSUPPORTED("ef2acl8wa2ooqcb5vz3098maz"); // pointf r;
487 UNSUPPORTED("5tpwuyf5iidesy80v8o4nwkmk"); // r.x = p.x + t * (q.x - p.x);
488 UNSUPPORTED("ewnrc5uloj3w5jbmsjcn3wja0"); // r.y = p.y + t * (q.y - p.y);
489 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
490 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
491
492 throw new UnsupportedOperationException();
493 }
494
495
496
497
498 //3 bxzrv2ghq04qk5cbyy68s4mol
499 // static inline point exch_xy(point p)
500 public static Object exch_xy(Object... arg) {
501 UNSUPPORTED("2vxya0v2fzlv5e0vjaa8d414"); // static inline point exch_xy(point p)
502 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
503 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
504 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
505 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
506 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
507 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
508
509 throw new UnsupportedOperationException();
510 }
511
512
513
514
515 //3 9lt3e03tac6h6sydljrcws8fd
516 // static inline pointf exch_xyf(pointf p)
517 public static Object exch_xyf(Object... arg) {
518 UNSUPPORTED("8qamrobrqi8jsvvfrxkimrsnw"); // static inline pointf exch_xyf(pointf p)
519 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
520 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
521 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
522 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
523 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
524 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
525
526 throw new UnsupportedOperationException();
527 }
528
529
530
531
532 //3 8l9qhieokthntzdorlu5zn29b
533 // static inline box box_bb(box b0, box b1)
534 public static Object box_bb(Object... arg) {
535 UNSUPPORTED("36et5gmnjrby6o7bq9sgh1hx6"); // static inline box box_bb(box b0, box b1)
536 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
537 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
538 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
539 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
540 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
541 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
542 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
543 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
544
545 throw new UnsupportedOperationException();
546 }
547
548
549
550
551 //3 clws9h3bbjm0lw3hexf8nl4c4
552 // static inline boxf boxf_bb(boxf b0, boxf b1)
553 public static Object boxf_bb(Object... arg) {
554 UNSUPPORTED("dyrqu4ww9osr9c86gqgmifcp6"); // static inline boxf boxf_bb(boxf b0, boxf b1)
555 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
556 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
557 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
558 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
559 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
560 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
561 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
562 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
563
564 throw new UnsupportedOperationException();
565 }
566
567
568
569
570 //3 bit6ycxo1iqd2al92y8gkzlvb
571 // static inline box box_intersect(box b0, box b1)
572 public static Object box_intersect(Object... arg) {
573 UNSUPPORTED("34gv28cldst09bl71itjgviue"); // static inline box box_intersect(box b0, box b1)
574 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
575 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
576 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
577 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
578 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
579 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
580 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
581 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
582
583 throw new UnsupportedOperationException();
584 }
585
586
587
588
589 //3 8gfybie7k6pgb3o1a6llgpwng
590 // static inline boxf boxf_intersect(boxf b0, boxf b1)
591 public static Object boxf_intersect(Object... arg) {
592 UNSUPPORTED("ape22b8z6jfg17gvo42hok9eb"); // static inline boxf boxf_intersect(boxf b0, boxf b1)
593 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
594 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
595 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
596 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
597 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
598 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
599 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
600 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
601
602 throw new UnsupportedOperationException();
603 }
604
605
606
607
608 //3 7z8j2quq65govaaejrz7b4cvb
609 // static inline int box_overlap(box b0, box b1)
610 public static Object box_overlap(Object... arg) {
611 UNSUPPORTED("1e9k599x7ygct7r4cfdxlk9u9"); // static inline int box_overlap(box b0, box b1)
612 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
613 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
614 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
615
616 throw new UnsupportedOperationException();
617 }
618
619
620
621
622 //3 4z0suuut2acsay5m8mg9dqjdu
623 // static inline int boxf_overlap(boxf b0, boxf b1)
624 public static Object boxf_overlap(Object... arg) {
625 UNSUPPORTED("905nejsewihwhhc3bhnrz9nwo"); // static inline int boxf_overlap(boxf b0, boxf b1)
626 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
627 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
628 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
629
630 throw new UnsupportedOperationException();
631 }
632
633
634
635
636 //3 dd34swz5rmdgu3a2np2a4h1dy
637 // static inline int box_contains(box b0, box b1)
638 public static Object box_contains(Object... arg) {
639 UNSUPPORTED("aputfc30fjkvy6jx4otljaczq"); // static inline int box_contains(box b0, box b1)
640 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
641 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
642 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
643
644 throw new UnsupportedOperationException();
645 }
646
647
648
649
650 //3 8laj1bspbu2i1cjd9upr7xt32
651 // static inline int boxf_contains(boxf b0, boxf b1)
652 public static Object boxf_contains(Object... arg) {
653 UNSUPPORTED("7ccnttkiwt834yfyw0evcm18v"); // static inline int boxf_contains(boxf b0, boxf b1)
654 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
655 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
656 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
657
658 throw new UnsupportedOperationException();
659 }
660
661
662
663
664 //3 4wf5swkz24xx51ja2dynbycu1
665 // static inline pointf perp (pointf p)
666 public static Object perp(Object... arg) {
667 UNSUPPORTED("567wpqlg9rv63ynyvxd9sgkww"); // static inline pointf perp (pointf p)
668 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
669 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
670 UNSUPPORTED("2fyydy6t6yifjsczccsb9szeg"); // r.x = -p.y;
671 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
672 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
673 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
674
675 throw new UnsupportedOperationException();
676 }
677
678
679
680
681 //3 6dtlpzv4mvgzb9o0b252yweuv
682 // static inline pointf scale (double c, pointf p)
683 public static Object scale(Object... arg) {
684 UNSUPPORTED("c1ngytew34bmkdb7vps5h3dh8"); // static inline pointf scale (double c, pointf p)
685 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
686 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
687 UNSUPPORTED("dznf7nac14snww4usquyd6r3r"); // r.x = c * p.x;
688 UNSUPPORTED("33kk73m8vjcux5tnjl8co2pe6"); // r.y = c * p.y;
689 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
690 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
691
692 throw new UnsupportedOperationException();
693 }
694
695
696 //1 6fn146yunkq3g30gummlety1l
697 // static int nedges, nboxes
698 //private static int nedges, nboxes;
699
700 //1 651u86vwr4psbjmrzsbg6zgi5
701 // static int routeinit
702 //private static int routeinit;
703
704 //1 bitbif2zv0lxox45wigfzbqcp
705 // static pointf *ps
706 //private static __ptr__ ps;
707
708 //1 5m31ig8bxuefkdin279ih13kc
709 // static int maxpn
710 //private static int maxpn;
711
712 //1 4u04uog28vlnmx0azm4y9qvj1
713 // static Ppoint_t *polypoints
714 //private static __ptr__ polypoints;
715
716 //1 eoo5tej8soeqa10cqz02mpetw
717 // static int polypointn
718 //private static int polypointn;
719
720 //1 dr2m01yvkuh5brtywxzvn5tal
721 // static Pedge_t *edges
722 //private static __ptr__ edges;
723
724 //1 cxjqaauevyqicged5zki42yg7
725 // static int edgen
726 //private static int edgen;
727
728
729
730 //3 7ebl6qohcfpf1b9ucih5r9qgp
731 // pointf* simpleSplineRoute (pointf tp, pointf hp, Ppoly_t poly, int* n_spl_pts, int polyline)
732 public static ST_pointf.Array simpleSplineRoute(final ST_pointf tp, final ST_pointf hp, final ST_Ppoly_t poly, int[] n_spl_pts, boolean polyline) {
733 // WARNING!! STRUCT
734 return simpleSplineRoute_w_(tp.copy(), hp.copy(), (ST_Ppoly_t) poly.copy(), n_spl_pts, polyline);
735 }
736 private static ST_pointf.Array simpleSplineRoute_w_(final ST_pointf tp, final ST_pointf hp, final ST_Ppoly_t poly, int[] n_spl_pts, boolean polyline) {
737 ENTERING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
738 try {
739 final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
740 final ST_pointf.Array eps = new ST_pointf.Array( 2);
741 final ST_pointf.Array evs = new ST_pointf.Array( 2);
742 int i;
743 eps.plus(0).setDouble("x", tp.x);
744 eps.plus(0).setDouble("y", tp.y);
745 eps.plus(1).setDouble("x", hp.x);
746 eps.plus(1).setDouble("y", hp.y);
747 if (Pshortestpath(poly, eps, pl) < 0)
748 return null;
749 if (polyline)
750 make_polyline (pl, spl);
751 else {
752 if (poly.pn > Z.z().edgen) {
753 Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
754 Z.z().edgen = poly.pn;
755 }
756 for (i = 0; i < poly.pn; i++) {
757 Z.z().edges.plus(i).setStruct("a", poly.ps.plus(i).getStruct());
758 Z.z().edges.plus(i).setStruct("b", poly.ps.plus((i + 1) % poly.pn).getStruct());
759 }
760 evs.plus(0).setDouble("x", 0);
761 evs.plus(0).setDouble("y", 0);
762 evs.plus(1).setDouble("x", 0);
763 evs.plus(1).setDouble("y", 0);
764 if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0)
765 return null;
766 }
767 if (mkspacep(spl.pn))
768 return null;
769 for (i = 0; i < spl.pn; i++) {
770 Z.z().ps.plus(i).setStruct(spl.ps.plus(i).getStruct());
771 }
772 n_spl_pts[0] = spl.pn;
773 return Z.z().ps;
774 } finally {
775 LEAVING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
776 }
777 }
778
779
780
781
782 //3 bfsrazjf3vkf12stnke48vc8t
783 // int routesplinesinit()
784 public static int routesplinesinit() {
785 ENTERING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
786 try {
787 if (++Z.z().routeinit > 1) return 0;
788 if (N(Z.z().ps = new ST_pointf.Array(300))) {
789 UNSUPPORTED("2qoo3na2ur9oh7hmvt6xv1txd"); // agerr(AGERR, "routesplinesinit: cannot allocate ps\n");
790 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
791 }
792 Z.z().maxpn = 300;
793 Z.z().nedges = 0;
794 Z.z().nboxes = 0;
795 /*if (Verbose)
796 start_timer();*/
797 return 0;
798 } finally {
799 LEAVING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
800 }
801 }
802
803
804
805
806 //3 55j3tny5cxemrsvrt3m21jxg8
807 // void routesplinesterm()
808 public static void routesplinesterm() {
809 ENTERING("55j3tny5cxemrsvrt3m21jxg8","routesplinesterm");
810 try {
811 if (--Z.z().routeinit > 0) return;
812 Memory.free(Z.z().ps);
813 /*if (Verbose)
814 fprintf(stderr,
815 "routesplines: %d edges, %d boxes %.2f sec\n",
816 nedges, nboxes, elapsed_sec());*/
817 } finally {
818 LEAVING("55j3tny5cxemrsvrt3m21jxg8","routesplinesterm");
819 }
820 }
821
822
823
824
825 //3 cu8ssjizw7ileqe9u7tcclq7k
826 // static void limitBoxes (boxf* boxes, int boxn, pointf *pps, int pn, int delta)
827 public static void limitBoxes(ST_boxf boxes[], int boxn, __ptr__ pps, int pn, int delta) {
828 ENTERING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
829 try {
830 int bi, si, splinepi;
831 double t;
832 final ST_pointf.Array sp = new ST_pointf.Array( 4);
833 int num_div = delta * boxn;
834 for (splinepi = 0; splinepi + 3 < pn; splinepi += 3) {
835 for (si = 0; si <= num_div; si++) {
836 t = si / (double)num_div;
837 sp.plus(0).getStruct().___(pps.plus(splinepi).getStruct());
838 sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct());
839 sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct());
840 sp.plus(3).getStruct().___(pps.plus(splinepi+3).getStruct());
841 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
842 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
843 sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
844 sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
845 sp.plus(2).setDouble("x", sp.get(2).x + t * (sp.get(3).x - sp.get(2).x));
846 sp.plus(2).setDouble("y", sp.get(2).y + t * (sp.get(3).y - sp.get(2).y));
847 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
848 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
849 sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
850 sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
851 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
852 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
853 for (bi = 0; bi < boxn; bi++) {
854 /* this tested ok on 64bit machines, but on 32bit we need this FUDGE
855 * or graphs/directed/records.gv fails */
856 if (sp.get(0).y <= boxes[bi].UR.y+.0001 && sp.get(0).y >= boxes[bi].LL.y-.0001) {
857 if (boxes[bi].LL.x > sp.get(0).x)
858 boxes[bi].LL.setDouble("x", sp.get(0).x);
859 if (boxes[bi].UR.x < sp.get(0).x)
860 boxes[bi].UR.setDouble("x", sp.get(0).x);
861 }
862 }
863 }
864 }
865 } finally {
866 LEAVING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
867 }
868 }
869
870
871
872
873 //3 3mcnemqisisnqtd4mr72ej76y
874 // static pointf *_routesplines(path * pp, int *npoints, int polyline)
875 public static __ptr__ _routesplines(ST_path pp, int npoints[], int polyline) {
876 ENTERING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
877 try {
878 final ST_Ppoly_t poly = new ST_Ppoly_t();
879 final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
880 int splinepi;
881 final ST_pointf.Array eps = new ST_pointf.Array( 2);
882 final ST_pointf.Array evs = new ST_pointf.Array( 2);
883 int edgei, prev, next;
884 int pi=0, bi;
885 ST_boxf[] boxes;
886 int boxn;
887 ST_Agedge_s realedge;
888 int flip;
889 int loopcnt, delta = 10;
890 boolean unbounded;
891 Z.z().nedges++;
892 Z.z().nboxes += pp.nbox;
893 for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class);
894 realedge!=null && ED_edge_type(realedge) != 0;
895 realedge = ED_to_orig(realedge));
896 if (N(realedge)) {
897 UNSUPPORTED("agerr(AGERR, _in routesplines, cannot find NORMAL edge");
898 return null;
899 }
900 boxes = pp.boxes;
901 boxn = pp.nbox;
902 if (checkpath(boxn, boxes, pp)!=0)
903 return null;
904 if (boxn * 8 > Z.z().polypointn) {
905 Z.z().polypoints = ALLOC_allocated_ST_pointf(Z.z().polypoints, boxn * 8);
906 Z.z().polypointn = boxn * 8;
907 }
908 if ((boxn > 1) && (((ST_boxf)boxes[0]).LL.y > ((ST_boxf)boxes[1]).LL.y)) {
909 flip = 1;
910 for (bi = 0; bi < boxn; bi++) {
911 double v = ((ST_boxf)boxes[bi]).UR.y;
912 ((ST_boxf)boxes[bi]).UR.y= -1*((ST_boxf)boxes[bi]).LL.y;
913 ((ST_boxf)boxes[bi]).LL.y = -v;
914 }
915 }
916 else flip = 0;
917 if (NEQ(agtail(realedge), aghead(realedge))) {
918 /* I assume that the path goes either down only or
919 up - right - down */
920 for (bi = 0, pi = 0; bi < boxn; bi++) {
921 next = prev = 0;
922 if (bi > 0)
923 prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi-1]).LL.y) ? -1 : 1;
924 if (bi < boxn - 1)
925 next = (((ST_boxf)boxes[bi+1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
926 if (prev != next) {
927 if (next == -1 || prev == 1) {
928 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
929 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
930 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
931 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
932 } else {
933 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
934 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
935 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
936 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
937 }
938 }
939 else if (prev == 0) { /* single box */
940 UNSUPPORTED("2bfai79qe7cec0rljrn56jg2f"); // polypoints[pi].x = boxes[bi].LL.x;
941 UNSUPPORTED("cjppvcr7k9pknjrjugccsky56"); // polypoints[pi++].y = boxes[bi].UR.y;
942 UNSUPPORTED("2bfai79qe7cec0rljrn56jg2f"); // polypoints[pi].x = boxes[bi].LL.x;
943 UNSUPPORTED("99xeozpks5v0iza4sv2occuuq"); // polypoints[pi++].y = boxes[bi].LL.y;
944 }
945 else {
946 if (N(prev == -1 && next == -1)) {
947 UNSUPPORTED("cgpvvfb9phbipyhij0cjh1nmi"); // agerr(AGERR, "in routesplines, illegal values of prev %d and next %d, line %d\n", prev, next, 444);
948 UNSUPPORTED("9idk92zg2ysz316lfwzvvvde6"); // return NULL;
949 }
950 }
951 }
952 for (bi = boxn - 1; bi >= 0; bi--) {
953 next = prev = 0;
954 if (bi < boxn - 1)
955 prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi+1]).LL.y) ? -1 : 1;
956 if (bi > 0)
957 next = (((ST_boxf)boxes[bi-1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
958 if (prev != next) {
959 if (next == -1 || prev == 1 ) {
960 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
961 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
962 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
963 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
964 } else {
965 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
966 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
967 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
968 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
969 }
970 }
971 else if (prev == 0) { /* single box */
972 UNSUPPORTED("ya84m81ogarx28l99om39lba"); // polypoints[pi].x = boxes[bi].UR.x;
973 UNSUPPORTED("99xeozpks5v0iza4sv2occuuq"); // polypoints[pi++].y = boxes[bi].LL.y;
974 UNSUPPORTED("ya84m81ogarx28l99om39lba"); // polypoints[pi].x = boxes[bi].UR.x;
975 UNSUPPORTED("cjppvcr7k9pknjrjugccsky56"); // polypoints[pi++].y = boxes[bi].UR.y;
976 }
977 else {
978 if (N(prev == -1 && next == -1)) {
979 UNSUPPORTED("87y5d0ts6xdjyx905bha50f3s"); // /* it went badly, e.g. degenerate box in boxlist */
980 UNSUPPORTED("1qt7hixteu3pt64wk1sqw352a"); // agerr(AGERR, "in routesplines, illegal values of prev %d and next %d, line %d\n", prev, next, 476);
981 UNSUPPORTED("35untdbpd42pt4c74gjbxqx7q"); // return NULL; /* for correctness sake, it's best to just stop */
982 }
983 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
984 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
985 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
986 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
987 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
988 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
989 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
990 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
991 }
992 }
993 }
994 else {
995 UNSUPPORTED("1izvmtfwbnl5xq4u2x5fdraxp"); // agerr(AGERR, "in routesplines, edge is a loop at %s\n", agnameof(aghead(realedge)));
996 UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
997 }
998 if (flip!=0) {
999 int i;
1000 for (bi = 0; bi < boxn; bi++) {
1001 int v = (int) ((ST_boxf)boxes[bi]).UR.y;
1002 ((ST_boxf)boxes[bi]).UR.y = -1*((ST_boxf)boxes[bi]).LL.y;
1003 ((ST_boxf)boxes[bi]).LL.y = -v;
1004 }
1005 for (i = 0; i < pi; i++)
1006 Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.get(i).y);
1007 }
1008 for (bi = 0; bi < boxn; bi++) {
1009 ((ST_boxf)boxes[bi]).LL.x = INT_MAX;
1010 ((ST_boxf)boxes[bi]).UR.x = INT_MIN;
1011 }
1012 poly.ps = Z.z().polypoints;
1013 poly.pn = pi;
1014 eps.plus(0).getStruct().setDouble("x", pp.start.p.x);
1015 eps.plus(0).getStruct().setDouble("y", pp.start.p.y);
1016 eps.plus(1).getStruct().setDouble("x", pp.end.p.x);
1017 eps.plus(1).getStruct().setDouble("y", pp.end.p.y);
1018 if (Pshortestpath(poly, eps, pl) < 0) {
1019 System.err.println("in routesplines, Pshortestpath failed\n");
1020 return null;
1021 }
1022 if (polyline!=0) {
1023 UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
1024 }
1025 else {
1026 if (poly.pn > Z.z().edgen) {
1027 Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
1028 Z.z().edgen = poly.pn;
1029 }
1030 for (edgei = 0; edgei < poly.pn; edgei++) {
1031 Z.z().edges.plus(edgei).setStruct("a", Z.z().polypoints.plus(edgei).getStruct());
1032 Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct());
1033 }
1034 if (pp.start.constrained!=0) {
1035 evs.plus(0).getStruct().setDouble("x", cos(pp.start.theta));
1036 evs.plus(0).getStruct().setDouble("y", sin(pp.start.theta));
1037 } else
1038 {
1039 evs.plus(0).getStruct().setDouble("x", 0);
1040 evs.plus(0).getStruct().setDouble("y", 0);
1041 }
1042 if (pp.end.constrained!=0) {
1043 evs.plus(1).getStruct().setDouble("x", -cos(pp.end.theta));
1044 evs.plus(1).getStruct().setDouble("y", -sin(pp.end.theta));
1045 } else
1046 {
1047 evs.plus(1).getStruct().setDouble("x", 0);
1048 evs.plus(1).getStruct().setDouble("y", 0);
1049 }
1050 if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0) {
1051 UNSUPPORTED("elkeyywrfd4hq75w7toc94rzs"); // agerr(AGERR, "in routesplines, Proutespline failed\n");
1052 UNSUPPORTED("7t3fvwp9cv90qu5bdjdglcgtk"); // return NULL;
1053 }
1054 }
1055 if (mkspacep(spl.pn))
1056 UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no memory left */
1057 for (bi = 0; bi < boxn; bi++) {
1058 boxes[bi].LL.setDouble("x", INT_MAX);
1059 boxes[bi].UR.setDouble("x", INT_MIN);
1060 }
1061 unbounded = NOT(false);
1062 for (splinepi = 0; splinepi < spl.pn; splinepi++) {
1063 Z.z().ps.plus(splinepi).setStruct(spl.ps.plus(splinepi).getStruct());
1064 }
1065 for (loopcnt = 0; unbounded && (loopcnt < 15); loopcnt++) {
1066 limitBoxes (boxes, boxn, Z.z().ps, spl.pn, delta);
1067 /* The following check is necessary because if a box is not very
1068 * high, it is possible that the sampling above might miss it.
1069 * Therefore, we make the sample finer until all boxes have
1070 * valid values. cf. bug 456. Would making sp[] pointfs help?
1071 */
1072 for (bi = 0; bi < boxn; bi++) {
1073 /* these fp equality tests are used only to detect if the
1074 * values have been changed since initialization - ok */
1075 if ((boxes[bi].LL.x == INT_MAX) || (boxes[bi].UR.x == INT_MIN)) {
1076 delta *= 2; /* try again with a finer interval */
1077 if (delta > INT_MAX/boxn) /* in limitBoxes, boxn*delta must fit in an int, so give up */
1078 loopcnt = 15;
1079 break;
1080 }
1081 }
1082 if (bi == boxn)
1083 unbounded = false;
1084 }
1085 if (unbounded) {
1086 /* Either an extremely short, even degenerate, box, or some failure with the path
1087 * planner causing the spline to miss some boxes. In any case, use the shortest path
1088 * to bound the boxes. This will probably mean a bad edge, but we avoid an infinite
1089 * loop and we can see the bad edge, and even use the showboxes scaffolding.
1090 */
1091 final ST_Ppoly_t polyspl = new ST_Ppoly_t();
1092 System.err.println("Unable to reclaim box space in spline routing for edge \"%s\" -> \"%s\". Something is probably seriously wrong.\n");
1093 make_polyline (pl, polyspl);
1094 limitBoxes (boxes, boxn, polyspl.ps, polyspl.pn, 10);
1095 Memory.free (polyspl.ps);
1096 }
1097 npoints[0] = spl.pn;
1098 return Z.z().ps;
1099 } finally {
1100 LEAVING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
1101 }
1102 }
1103
1104
1105
1106
1107 //3 axqoytp2rpr8crajhkuvns6q9
1108 // pointf *routesplines(path * pp, int *npoints)
1109 public static ST_pointf.Array routesplines(ST_path pp, int npoints[]) {
1110 ENTERING("axqoytp2rpr8crajhkuvns6q9","routesplines");
1111 try {
1112 return (ST_pointf.Array) _routesplines (pp, npoints, 0);
1113 } finally {
1114 LEAVING("axqoytp2rpr8crajhkuvns6q9","routesplines");
1115 }
1116 }
1117
1118
1119
1120
1121 //3 2v22s41xitwnnsljk9n01nrcy
1122 // pointf *routepolylines(path * pp, int *npoints)
1123 public static ST_pointf.Array routepolylines(ST_path pp, int npoints[]) {
1124 ENTERING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
1125 try {
1126 UNSUPPORTED("1kjkc6bl8zpf8zjcwgbyni9p3"); // pointf *routepolylines(path * pp, int *npoints)
1127 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1128 UNSUPPORTED("6wf7p4npeom96y0l1v39essmx"); // return _routesplines (pp, npoints, 1);
1129 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1130
1131 throw new UnsupportedOperationException();
1132 } finally {
1133 LEAVING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
1134 }
1135 }
1136
1137
1138
1139
1140 //3 65qv6x7ghwyt6hey5qd8cgizn
1141 // static int overlap(int i0, int i1, int j0, int j1)
1142 public static int overlap(double i0, double i1, double j0, double j1) {return overlap((int) i0, (int) i1, (int) j0, (int) j1);}
1143 public static int overlap(int i0, int i1, int j0, int j1) {
1144 ENTERING("65qv6x7ghwyt6hey5qd8cgizn","overlap");
1145 try {
1146 /* i'll bet there's an elegant way to do this */
1147 if (i1 <= j0)
1148 return 0;
1149 if (i0 >= j1)
1150 return 0;
1151 if ((j0 <= i0) && (i0 <= j1))
1152 return (j1 - i0);
1153 if ((j0 <= i1) && (i1 <= j1))
1154 return (i1 - j0);
1155 return MIN(i1 - i0, j1 - j0);
1156 } finally {
1157 LEAVING("65qv6x7ghwyt6hey5qd8cgizn","overlap");
1158 }
1159 }
1160
1161
1162
1163
1164 //3 dxqjhiid5f58b9gjxp0v3j97b
1165 // static int checkpath(int boxn, boxf* boxes, path* thepath)
1166 public static int checkpath(int boxn, ST_boxf[] boxes, ST_path thepath) {
1167 ENTERING("dxqjhiid5f58b9gjxp0v3j97b","checkpath");
1168 try {
1169 ST_boxf ba, bb;
1170 int bi, i, errs, l, r, d, u;
1171 int xoverlap, yoverlap;
1172 /* remove degenerate boxes. */
1173 i = 0;
1174 for (bi = 0; bi < boxn; bi++) {
1175 if (ABS(((ST_boxf)boxes[bi]).LL.y - ((ST_boxf)boxes[bi]).UR.y) < .01)
1176 continue;
1177 if (ABS(((ST_boxf)boxes[bi]).LL.x - ((ST_boxf)boxes[bi]).UR.x) < .01)
1178 continue;
1179 if (i != bi)
1180 boxes[i].setStruct(boxes[bi]);
1181 i++;
1182 }
1183 boxn = i;
1184 ba = (ST_boxf) boxes[0];
1185 if (ba.LL.x > ba.UR.x || ba.LL.y > ba.UR.y) {
1186 UNSUPPORTED("39tznwvf6k5lgj78jp32p0kfl"); // agerr(AGERR, "in checkpath, box 0 has LL coord > UR coord\n");
1187 UNSUPPORTED("evdvb9esh16y8zeoczxhcz7xm"); // printpath(thepath);
1188 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
1189 }
1190 for (bi = 0; bi < boxn - 1; bi++) {
1191 ba = (ST_boxf) boxes[bi];
1192 bb = (ST_boxf) boxes[bi + 1];
1193 if (bb.LL.x > bb.UR.x || bb.LL.y > bb.UR.y) {
1194 UNSUPPORTED("c8oodo0ge4n4dglb28fvf610v"); // agerr(AGERR, "in checkpath, box %d has LL coord > UR coord\n",
1195 UNSUPPORTED("929pkk2ob1lh7hfe4scuoo5pn"); // bi + 1);
1196 UNSUPPORTED("2m9o6g4nneiul4gt8xb9yb9zi"); // printpath(thepath);
1197 UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
1198 }
1199 l = (ba.UR.x < bb.LL.x) ? 1 : 0;
1200 r = (ba.LL.x > bb.UR.x) ? 1 : 0;
1201 d = (ba.UR.y < bb.LL.y) ? 1 : 0;
1202 u = (ba.LL.y > bb.UR.y) ? 1 : 0;
1203 errs = l + r + d + u;
1204 /*if (errs > 0 && Verbose) {
1205 fprintf(stderr, "in checkpath, boxes %d and %d don't touch\n",
1206 bi, bi + 1);
1207 printpath(thepath);
1208 }*/
1209 if (errs > 0) {
1210 int xy;
1211 if (l == 1)
1212 {
1213 xy = (int) ba.UR.x;
1214 ba.UR.setDouble("x", bb.LL.x);
1215 bb.LL.setDouble("x", xy);
1216 l = 0;
1217 }
1218 else if (r == 1) {
1219 xy = (int)(ba.LL.x);
1220 ba.LL.setDouble("x", bb.UR.x);
1221 bb.UR.setDouble("x", xy);
1222 r = 0;
1223 }
1224 else if (d == 1) {
1225 xy = (int)(ba.UR.y);
1226 ba.UR.setDouble("y", bb.LL.y);
1227 bb.LL.setDouble("y", xy);
1228 d = 0;
1229 }
1230 else if (u == 1)
1231 UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.LL.y, ba.LL.y = bb.UR.y, bb.UR.y = xy, u = 0;
1232 for (i = 0; i < errs - 1; i++) {
1233 UNSUPPORTED("as3p2ldwbg3rbgy64oxx5phar"); // if (l == 1)
1234 UNSUPPORTED("efz1z5cfywki1k6q6avldku9z"); // xy = (ba.UR.x + bb.LL.x) / 2.0 + 0.5, ba.UR.x =
1235 UNSUPPORTED("6dfh7cf1xptapqd1mcqtxjrxa"); // bb.LL.x = xy, l = 0;
1236 UNSUPPORTED("ang3qytu77fd5owijwbnmkdav"); // else if (r == 1)
1237 UNSUPPORTED("67ehof0qqlk339zgl0sqwfu5r"); // xy = (ba.LL.x + bb.UR.x) / 2.0 + 0.5, ba.LL.x =
1238 UNSUPPORTED("llmwvndoq1ne9c62ohtstkwa"); // bb.UR.x = xy, r = 0;
1239 UNSUPPORTED("3ce9i9asrqbuog7v1tdurqo6e"); // else if (d == 1)
1240 UNSUPPORTED("3mibjrb2jtfextkg9ac5k9spl"); // xy = (ba.UR.y + bb.LL.y) / 2.0 + 0.5, ba.UR.y =
1241 UNSUPPORTED("bccpbv2n38c5utkfh7msoc2y"); // bb.LL.y = xy, d = 0;
1242 UNSUPPORTED("7302rnmwdji9n7txquk8k36to"); // else if (u == 1)
1243 UNSUPPORTED("9oqpoodvpheztihe63p40guof"); // xy = (ba.LL.y + bb.UR.y) / 2.0 + 0.5, ba.LL.y =
1244 UNSUPPORTED("2cnb1bdjh6y26f98vonla73qa"); // bb.UR.y = xy, u = 0;
1245 }
1246 }
1247 /* check for overlapping boxes */
1248 xoverlap = overlap(ba.LL.x, ba.UR.x, bb.LL.x, bb.UR.x);
1249 yoverlap = overlap(ba.LL.y, ba.UR.y, bb.LL.y, bb.UR.y);
1250 if (xoverlap!=0 && yoverlap!=0) {
1251 if (xoverlap < yoverlap) {
1252 if (ba.UR.x - ba.LL.x > bb.UR.x - bb.LL.x) {
1253 /* take space from ba */
1254 UNSUPPORTED("5dqxf3gq05pjtobtnru1g2tuj"); // if (ba.UR.x < bb.UR.x)
1255 UNSUPPORTED("8gz6k803qp9zyw9s459cpp039"); // ba.UR.x = bb.LL.x;
1256 UNSUPPORTED("9acag2yacl63g8rg6r1alu62x"); // else
1257 UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.LL.x = bb.UR.x;
1258 } else {
1259 /* take space from bb */
1260 if (ba.UR.x < bb.UR.x)
1261 bb.LL.setDouble("x", ba.UR.x);
1262 else
1263 bb.UR.setDouble("x", ba.LL.x);
1264 }
1265 } else { /* symmetric for y coords */
1266 if (ba.UR.y - ba.LL.y > bb.UR.y - bb.LL.y) {
1267 /* take space from ba */
1268 if (ba.UR.y < bb.UR.y)
1269 ba.UR.setDouble("y", bb.LL.y);
1270 else
1271 ba.LL.setDouble("y", bb.UR.y);
1272 } else {
1273 /* take space from bb */
1274 if (ba.UR.y < bb.UR.y)
1275 bb.LL.setDouble("y", ba.UR.y);
1276 else
1277 bb.UR.setDouble("y", ba.LL.y);
1278 }
1279 }
1280 }
1281 }
1282 if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x
1283 || thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x
1284 || thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y
1285 || thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) {
1286 /*if (Verbose) {
1287 fprintf(stderr, "in checkpath, start port not in first box\n");
1288 printpath(thepath);
1289 }*/
1290 if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x)
1291 thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).LL.x);
1292 if (thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x)
1293 thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).UR.x);
1294 if (thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y)
1295 thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).LL.y);
1296 if (thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y)
1297 thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).UR.y);
1298 }
1299 if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x
1300 || thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x
1301 || thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y
1302 || thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) {
1303 /*if (Verbose) {
1304 fprintf(stderr, "in checkpath, end port not in last box\n");
1305 printpath(thepath);
1306 }*/
1307 if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x)
1308 thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x);
1309 if (thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x)
1310 thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x);
1311 if (thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y)
1312 thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y);
1313 if (thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y)
1314 thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y);
1315 }
1316 return 0;
1317 } finally {
1318 LEAVING("dxqjhiid5f58b9gjxp0v3j97b","checkpath");
1319 }
1320 }
1321
1322
1323
1324
1325 //3 de6jvvw786rx88318tuuqywgq
1326 // static int mkspacep(int size)
1327 public static boolean mkspacep(int size) {
1328 ENTERING("de6jvvw786rx88318tuuqywgq","mkspacep");
1329 try {
1330 if (size > Z.z().maxpn) {
1331 int newmax = Z.z().maxpn + (size / 300 + 1) * 300;
1332 Z.z().ps = Z.z().ps.reallocJ(newmax);
1333 if (N(Z.z().ps)) {
1334 UNSUPPORTED("ds2v91aohji00tc7zmjuc3v6q"); // agerr(AGERR, "cannot re-allocate ps\n");
1335 UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
1336 }
1337 Z.z().maxpn = newmax;
1338 }
1339 return false;
1340 } finally {
1341 LEAVING("de6jvvw786rx88318tuuqywgq","mkspacep");
1342 }
1343 }
1344
1345
1346
1347
1348 //3 eoba7h2vv4nbevb7t3uj8xdxd
1349 // static void printpath(path * pp)
1350 public static Object printpath(Object... arg) {
1351 UNSUPPORTED("baqhg7gu97aw2vlb1lexu7ocs"); // static void printpath(path * pp)
1352 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1353 UNSUPPORTED("8k9loe0uz6grwq8fq5iqfih2c"); // int bi;
1354 UNSUPPORTED("hop7xuggqoec7e0p0gpzb5ys"); // fprintf(stderr, "%d boxes:\n", pp->nbox);
1355 UNSUPPORTED("fqxwgt6brxm5novm8sey6vp3"); // for (bi = 0; bi < pp->nbox; bi++)
1356 UNSUPPORTED("2n85v7ex13a1rhnx63lam2yth"); // fprintf(stderr, "%d (%.5g, %.5g), (%.5g, %.5g)\n", bi,
1357 UNSUPPORTED("86zhcjpiy229kbbomcqmj1bvn"); // pp->boxes[bi].LL.x, pp->boxes[bi].LL.y,
1358 UNSUPPORTED("dbddokl6i6319f232oqnbecmv"); // pp->boxes[bi].UR.x, pp->boxes[bi].UR.y);
1359 UNSUPPORTED("867y6166h7x6yibezm0cb0cf1"); // fprintf(stderr, "start port: (%.5g, %.5g), tangent angle: %.5g, %s\n",
1360 UNSUPPORTED("8nze219nhghn1a0uewjfq30xr"); // pp->start.p.x, pp->start.p.y, pp->start.theta,
1361 UNSUPPORTED("1apwqgz53812wo2ejjdn8zz3h"); // pp->start.constrained ? "constrained" : "not constrained");
1362 UNSUPPORTED("4i8p7ha6i9bkydbg3i04ssmqj"); // fprintf(stderr, "end port: (%.5g, %.5g), tangent angle: %.5g, %s\n",
1363 UNSUPPORTED("32nx4386ouvodf09v0u4emfkv"); // pp->end.p.x, pp->end.p.y, pp->end.theta,
1364 UNSUPPORTED("d7cxrqy42haay280fzr1e81ts"); // pp->end.constrained ? "constrained" : "not constrained");
1365 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1366
1367 throw new UnsupportedOperationException();
1368 }
1369
1370
1371
1372
1373 //3 6u7mpvz8gz08jacc16azxm31t
1374 // static pointf get_centroid(Agraph_t *g)
1375 public static Object get_centroid(Object... arg) {
1376 UNSUPPORTED("2zo1gwkn1bj1agy4g8dxcfmh"); // static pointf get_centroid(Agraph_t *g)
1377 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1378 UNSUPPORTED("6reqgncjwgiuo3fb8rkhmtjv1"); // int cnt = 0;
1379 UNSUPPORTED("e1s7ys0dbvp12r1vo9cdl7sp0"); // static pointf sum = {0.0, 0.0};
1380 UNSUPPORTED("4nx1l2ustbo0ptupk2ja9ekds"); // static Agraph_t *save;
1381 UNSUPPORTED("2jcii9cclu1dijzqekzc175pe"); // Agnode_t *n;
1382 UNSUPPORTED("f17csexi07fwmif5pkxj2wgr1"); // sum.x = (GD_bb(g).LL.x + GD_bb(g).UR.x) / 2.0;
1383 UNSUPPORTED("8hoglhn0m8txbvp8w9fvo5cwt"); // sum.y = (GD_bb(g).LL.y + GD_bb(g).UR.y) / 2.0;
1384 UNSUPPORTED("e8d6re0f7zq6d14zby6lxtm85"); // return sum;
1385 UNSUPPORTED("5xw9py1u6p24f7e8fju2hsmw0"); // if (save == g) return sum;
1386 UNSUPPORTED("a1cvki7btccn0pv2gpusya4pt"); // save = g;
1387 UNSUPPORTED("7wq24g054kmx3aw25vk5ksj4"); // for (n = agfstnode(g); n; n = agnxtnode(g,n)) {
1388 UNSUPPORTED("7mgmah70c4cze5ed5zlcjfnpj"); // sum.x += ND_pos(n)[0];
1389 UNSUPPORTED("3pk32i8trbg5r4tjfzi0xepsa"); // sum.y += ND_pos(n)[1];
1390 UNSUPPORTED("77mslev6fngkh87g2jkd6j87j"); // cnt++;
1391 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1392 UNSUPPORTED("ci5ydgm2xpqvgw8qn5sz0317w"); // sum.x = sum.x / cnt;
1393 UNSUPPORTED("f1ofwhoh52tmotz2jx74ji4h5"); // sum.y = sum.y / cnt;
1394 UNSUPPORTED("e8d6re0f7zq6d14zby6lxtm85"); // return sum;
1395 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1396
1397 throw new UnsupportedOperationException();
1398 }
1399
1400
1401
1402
1403 //3 7l11iqopuq2ovl93rxmwkobas
1404 // static void bend(pointf spl[4], pointf centroid)
1405 public static Object bend(Object... arg) {
1406 UNSUPPORTED("4ftn2rr6n4c36dbi9as8t8g5h"); // static void bend(pointf spl[4], pointf centroid)
1407 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1408 UNSUPPORTED("1xm6245yjmk93iuvvm93e1rci"); // pointf midpt,a;
1409 UNSUPPORTED("6zgogm7cuuy7co8hhompfoo5"); // double r;
1410 UNSUPPORTED("9lxjpyaeeeq2agdn7fik6kzhs"); // double dist,dx,dy;
1411 UNSUPPORTED("5bkk1q959a76y20xt0228j9d7"); // midpt.x = (spl[0].x + spl[3].x)/2.0;
1412 UNSUPPORTED("bfx7hrazv0khewy4e1ejp2kyb"); // midpt.y = (spl[0].y + spl[3].y)/2.0;
1413 UNSUPPORTED("9ydjah76t018eukiay40izzko"); // dx = (spl[3].x - spl[0].x);
1414 UNSUPPORTED("ap0c81vlb8rsjnpumymlnvzrl"); // dy = (spl[3].y - spl[0].y);
1415 UNSUPPORTED("dfs4ufukqaz9pf7ey54fbuaco"); // dist = sqrt(dx*dx + dy*dy);
1416 UNSUPPORTED("97su53ievky8nzohnw0en0a6e"); // r = dist/5.0;
1417 UNSUPPORTED("6ld19omy1z68vprfzbhrjqr2z"); // {
1418 UNSUPPORTED("cltgduzxyw56ktxuoeoqt4bkm"); // double vX = centroid.x - midpt.x;
1419 UNSUPPORTED("h4thwscp36mqboiugjkim5um"); // double vY = centroid.y - midpt.y;
1420 UNSUPPORTED("5q6wpyh72kf9xggy2oc929uc3"); // double magV = sqrt(vX*vX + vY*vY);
1421 UNSUPPORTED("1w5d961mnlte15ap13tdi5sv2"); // a.x = midpt.x - vX / magV * r; /* + would be closest point */
1422 UNSUPPORTED("2oxj7hzixzdciej9f8u7xe49o"); // a.y = midpt.y - vY / magV * r;
1423 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1424 UNSUPPORTED("645kbqr5zpbe6vj9z3o2x5yrb"); // /* this can be improved */
1425 UNSUPPORTED("72i64plp6g9odwle7ly7wgn4a"); // spl[1].x = spl[2].x = a.x;
1426 UNSUPPORTED("at1u1jcu4ulhd191p0rfc9e8j"); // spl[1].y = spl[2].y = a.y;
1427 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1428
1429 throw new UnsupportedOperationException();
1430 }
1431
1432
1433
1434
1435 //3 2erpr561ggowmq2m9465p5kqd
1436 // void makeStraightEdge(graph_t * g, edge_t * e, int et, splineInfo* sinfo)
1437 public static Object makeStraightEdge(Object... arg) {
1438 UNSUPPORTED("347dderd02mvlozoheqo4ejwo"); // void
1439 UNSUPPORTED("89t1p0jilkexnvk5i1vv1arc0"); // makeStraightEdge(graph_t * g, edge_t * e, int et, splineInfo* sinfo)
1440 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1441 UNSUPPORTED("7pmvaj5a5w3pee9zkh22s4jt5"); // edge_t *e0;
1442 UNSUPPORTED("821nfzu5iwd6ayryeggj37hj2"); // edge_t** edges;
1443 UNSUPPORTED("19s88cb2xh6yjpqg0ip3ovi08"); // edge_t* elist[20];
1444 UNSUPPORTED("5dd4r3fk1fwybt8tvqt4z4ta3"); // int i, e_cnt;
1445 UNSUPPORTED("310og4kvqsrlm4vs26zqw8c8p"); // e_cnt = 1;
1446 UNSUPPORTED("63kfcznl8sc62h1pj6k83cjn3"); // e0 = e;
1447 UNSUPPORTED("1451mr2njzp5m6mj64k6m36tf"); // while ((e0 = ED_to_virt(e0))) e_cnt++;
1448 UNSUPPORTED("1qovtxs3b3fa6ztj4wx1ahkf2"); // if (e_cnt <= 20)
1449 UNSUPPORTED("bp3rco5i77vkqs7wua0k7dbfo"); // edges = elist;
1450 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
1451 UNSUPPORTED("8zwb4z35iwpyfy9d9n4b51yvh"); // edges = (edge_t**)zmalloc((e_cnt)*sizeof(edge_t*));
1452 UNSUPPORTED("63kfcznl8sc62h1pj6k83cjn3"); // e0 = e;
1453 UNSUPPORTED("tf4qi3e2hsjxi603z57w6hx6"); // for (i = 0; i < e_cnt; i++) {
1454 UNSUPPORTED("106t1hs57atf24mgepcp9wwjw"); // edges[i] = e0;
1455 UNSUPPORTED("dfdtts0ddwzo6ffy5m1pso8t6"); // e0 = ED_to_virt(e0);
1456 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1457 UNSUPPORTED("db2lohkib2plgiw7i90nxgkjk"); // makeStraightEdges (g, edges, e_cnt, et, sinfo);
1458 UNSUPPORTED("b1xlizpp11lvumjyajfk6mxky"); // if (e_cnt > 20) free (edges);
1459 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1460
1461 throw new UnsupportedOperationException();
1462 }
1463
1464
1465
1466
1467 //3 5ztzq4z6l8uj7cn0d1ke7n87p
1468 // void makeStraightEdges(graph_t * g, edge_t** edges, int e_cnt, int et, splineInfo* sinfo)
1469 public static Object makeStraightEdges(Object... arg) {
1470 UNSUPPORTED("347dderd02mvlozoheqo4ejwo"); // void
1471 UNSUPPORTED("ayvyrhydt6lt2z6uvpxyh2nxn"); // makeStraightEdges(graph_t * g, edge_t** edges, int e_cnt, int et, splineInfo* sinfo)
1472 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1473 UNSUPPORTED("5u4oz0rrd9yradyuzr6qniald"); // pointf dumb[4];
1474 UNSUPPORTED("cjx5v6hayed3q8eeub1cggqca"); // node_t *n;
1475 UNSUPPORTED("8i0kwb8r6a2sj6nuvcy3bg9rx"); // node_t *head;
1476 UNSUPPORTED("b6jt41a0u7si76m5i0lookv4x"); // int curved = (et == (2 << 1));
1477 UNSUPPORTED("2qrm9sibdk45g8miaadnlmf0z"); // pointf perp;
1478 UNSUPPORTED("e88o7l9ftcoq7m3q7njvm0hjb"); // pointf del;
1479 UNSUPPORTED("7pmvaj5a5w3pee9zkh22s4jt5"); // edge_t *e0;
1480 UNSUPPORTED("5gypxs09iuryx5a2eho9lgdcp"); // edge_t *e;
1481 UNSUPPORTED("39f8qp0sf99n5kz67fe1sjnao"); // int i, j, xstep, dx;
1482 UNSUPPORTED("5qf9bfxinlwybt6vckmul8n5c"); // double l_perp;
1483 UNSUPPORTED("biqd62eqps6szrtk8p8sci92q"); // pointf dumber[4];
1484 UNSUPPORTED("3ircl7kohy2qt6yrj3lysuhor"); // pointf p, q;
1485 UNSUPPORTED("b0ek9vxrdn6l0aponkc0ezxof"); // e = edges[0];
1486 UNSUPPORTED("dul1axf6kjslblufm4omk5k32"); // n = agtail(e);
1487 UNSUPPORTED("9vcgvjkna4elv9mw682bcl1ry"); // head = aghead(e);
1488 UNSUPPORTED("b7iaxy7swt1knhamnyh2kvzlj"); // p = dumb[1] = dumb[0] = add_pointf(ND_coord(n), ED_tail_port(e).p);
1489 UNSUPPORTED("di45fpacl09sotabtbtbrk4bw"); // q = dumb[2] = dumb[3] = add_pointf(ND_coord(head), ED_head_port(e).p);
1490 UNSUPPORTED("9yh32i6luwgciwhvrfvt8aw1a"); // if ((e_cnt == 1) || Concentrate) {
1491 UNSUPPORTED("coqqvdvknesi3rdbg68qcc6vn"); // if (curved) bend(dumb,get_centroid(g));
1492 UNSUPPORTED("ejd1q887zolcoupzctycvs5cv"); // clip_and_install(e, aghead(e), dumb, 4, sinfo);
1493 UNSUPPORTED("11s5bteac4942mtfiiy4qbq5t"); // addEdgeLabels(g, e, p, q);
1494 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
1495 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1496 UNSUPPORTED("63kfcznl8sc62h1pj6k83cjn3"); // e0 = e;
1497 UNSUPPORTED("6qz2idcg1avhf5caqig9ewcxv"); // if (APPROXEQPT(dumb[0], dumb[3], MILLIPOINT)) {
1498 UNSUPPORTED("738uip25tpsxuc3qvsye90wm7"); // /* degenerate case */
1499 UNSUPPORTED("bq580fqcdybbomvpm4qmh5jtq"); // dumb[1] = dumb[0];
1500 UNSUPPORTED("8u36zhoh7cpf1dv8ky0ngt667"); // dumb[2] = dumb[3];
1501 UNSUPPORTED("bgjd2ldhnogj885m52k0nxe0d"); // del.x = 0;
1502 UNSUPPORTED("b1x914d40c33xvbmrjx82p563"); // del.y = 0;
1503 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1504 UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
1505 UNSUPPORTED("3ksfb9uz6ssvxevjyvfdhcx15"); // perp.x = dumb[0].y - dumb[3].y;
1506 UNSUPPORTED("5qy02hcm7w3srhbws1saebqfk"); // perp.y = dumb[3].x - dumb[0].x;
1507 UNSUPPORTED("dkis85cdygy51zdkxp4m6zrfn"); // l_perp = LEN(perp.x, perp.y);
1508 UNSUPPORTED("60ix8gm4odvpl4njysex8efr4"); // xstep = GD_nodesep(g->root);
1509 UNSUPPORTED("9lo8r2t8xlvkucmcxj6r7zcjc"); // dx = xstep * (e_cnt - 1) / 2;
1510 UNSUPPORTED("29kynt0cc7vrimccs1typen4c"); // dumb[1].x = dumb[0].x + (dx * perp.x) / l_perp;
1511 UNSUPPORTED("8ffy5d6eokrgqxbbzlr3oeo7w"); // dumb[1].y = dumb[0].y + (dx * perp.y) / l_perp;
1512 UNSUPPORTED("5ss1wkhlrlbzhjmgex5g5td0j"); // dumb[2].x = dumb[3].x + (dx * perp.x) / l_perp;
1513 UNSUPPORTED("78hu4vl7uqaa2xjxh966lsl2z"); // dumb[2].y = dumb[3].y + (dx * perp.y) / l_perp;
1514 UNSUPPORTED("czezd6edgg6prqa40qn4cjk99"); // del.x = -xstep * perp.x / l_perp;
1515 UNSUPPORTED("brlhwaq7o7jlirlmbgsluegqc"); // del.y = -xstep * perp.y / l_perp;
1516 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1517 UNSUPPORTED("tf4qi3e2hsjxi603z57w6hx6"); // for (i = 0; i < e_cnt; i++) {
1518 UNSUPPORTED("ezgc9yof65sv59h9bc3xaarqc"); // e0 = edges[i];
1519 UNSUPPORTED("cdinc4vpag193dvamw97pjop"); // if (aghead(e0) == head) {
1520 UNSUPPORTED("70bzwaan8xb1eymztyzg8db4z"); // p = dumb[0];
1521 UNSUPPORTED("7s7bzu6vkika1vowxe90pn8jl"); // q = dumb[3];
1522 UNSUPPORTED("xt68cvhca5ecivsf28r6480k"); // for (j = 0; j < 4; j++) {
1523 UNSUPPORTED("euip77qbbydsz8d5amnoqz2wp"); // dumber[j] = dumb[j];
1524 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1525 UNSUPPORTED("7yhr8hn3r6wohafwxrt85b2j2"); // } else {
1526 UNSUPPORTED("65qac2gqwej8ehvl0kr0azgoc"); // p = dumb[3];
1527 UNSUPPORTED("1p3ys1kne72eu96ymhhd08ki9"); // q = dumb[0];
1528 UNSUPPORTED("xt68cvhca5ecivsf28r6480k"); // for (j = 0; j < 4; j++) {
1529 UNSUPPORTED("cl6iic4z87ms6sxw112uwa8iq"); // dumber[3 - j] = dumb[j];
1530 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1531 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1532 UNSUPPORTED("duxo2x55p2xtgyt3bec5dikrr"); // if (et == (3 << 1)) {
1533 UNSUPPORTED("3cuaxa5hpxf783bmxnedboxcr"); // Ppoint_t pts[4];
1534 UNSUPPORTED("ey5aedx85s5fe7o31ioqdfot3"); // Ppolyline_t spl, line;
1535 UNSUPPORTED("8h359s121i98xp9zlr35vrgo9"); // line.pn = 4;
1536 UNSUPPORTED("57e37c2h1b5chgu6si6xi0cp4"); // line.ps = pts;
1537 UNSUPPORTED("phcktpjx2242lnn14blec2nu"); // for (j=0; j < 4; j++) {
1538 UNSUPPORTED("5tjkl4ul3rus6dd6xt7wfhv9a"); // pts[j] = dumber[j];
1539 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1540 UNSUPPORTED("5uszm2xlyusuekyfgopt358b8"); // make_polyline (line, &spl);
1541 UNSUPPORTED("4g67nliqr55eodkgwfdxbw87k"); // clip_and_install(e0, aghead(e0), spl.ps, spl.pn, sinfo);
1542 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1543 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
1544 UNSUPPORTED("cs4gj80s0cjsf32zlavo9gg0q"); // clip_and_install(e0, aghead(e0), dumber, 4, sinfo);
1545 UNSUPPORTED("9g4169ket42x6bl41jrpu9vvm"); // addEdgeLabels(g, e0, p, q);
1546 UNSUPPORTED("8yg135oq3whkc9jbibbmn6v6a"); // dumb[1].x += del.x;
1547 UNSUPPORTED("9sw7189ksprjtdn4dlniux8z4"); // dumb[1].y += del.y;
1548 UNSUPPORTED("81xmo1my3dst3f72w8v2o3xb6"); // dumb[2].x += del.x;
1549 UNSUPPORTED("bba6iln00idzhk4wan9c8n5ja"); // dumb[2].y += del.y;
1550 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1551 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1552
1553 throw new UnsupportedOperationException();
1554 }
1555
1556
1557 }