Debian Codegraph @

src/gen/lib/dotgen/position__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.dotgen;
47 import static gen.lib.cgraph.attr__c.agget;
48 import static gen.lib.cgraph.edge__c.aghead;
49 import static gen.lib.cgraph.edge__c.agtail;
50 import static gen.lib.cgraph.graph__c.agnnodes;
51 import static gen.lib.cgraph.obj__c.agcontains;
52 import static gen.lib.cgraph.obj__c.agroot;
53 import static gen.lib.common.ns__c.rank;
54 import static gen.lib.common.splines__c.selfRightSpace;
55 import static gen.lib.common.utils__c.late_int;
56 import static gen.lib.dotgen.cluster__c.mark_lowclusters;
57 import static gen.lib.dotgen.conc__c.dot_concentrate;
58 import static gen.lib.dotgen.dotinit__c.dot_root;
59 import static gen.lib.dotgen.fastgr__c.fast_edge;
60 import static gen.lib.dotgen.fastgr__c.find_fast_edge;
61 import static gen.lib.dotgen.fastgr__c.virtual_node;
62 import static gen.lib.dotgen.fastgr__c.zapinlist;
63 import static gen.lib.dotgen.flat__c.flat_edges;
64 import static smetana.core.JUtils.EQ;
65 import static smetana.core.JUtils.NEQ;
66 import static smetana.core.JUtils.USHRT_MAX;
67 import static smetana.core.JUtils.atof;
68 import static smetana.core.JUtils.enumAsInt;
69 import static smetana.core.JUtilsDebug.ENTERING;
70 import static smetana.core.JUtilsDebug.LEAVING;
71 import static smetana.core.Macro.AGINEDGE;
72 import static smetana.core.Macro.AGOUTEDGE;
73 import static smetana.core.Macro.AGTYPE;
74 import static smetana.core.Macro.ALLOC_allocated_ST_Agnode_s;
75 import static smetana.core.Macro.ED_dist;
76 import static smetana.core.Macro.ED_head_port;
77 import static smetana.core.Macro.ED_label;
78 import static smetana.core.Macro.ED_minlen;
79 import static smetana.core.Macro.ED_tail_port;
80 import static smetana.core.Macro.ED_to_orig;
81 import static smetana.core.Macro.ED_weight;
82 import static smetana.core.Macro.GD_bb;
83 import static smetana.core.Macro.GD_border;
84 import static smetana.core.Macro.GD_clust;
85 import static smetana.core.Macro.GD_drawing;
86 import static smetana.core.Macro.GD_exact_ranksep;
87 import static smetana.core.Macro.GD_flip;
88 import static smetana.core.Macro.GD_has_labels;
89 import static smetana.core.Macro.GD_ht1;
90 import static smetana.core.Macro.GD_ht2;
91 import static smetana.core.Macro.GD_label;
92 import static smetana.core.Macro.GD_ln;
93 import static smetana.core.Macro.GD_maxrank;
94 import static smetana.core.Macro.GD_minrank;
95 import static smetana.core.Macro.GD_n_cluster;
96 import static smetana.core.Macro.GD_nlist;
97 import static smetana.core.Macro.GD_nodesep;
98 import static smetana.core.Macro.GD_rank;
99 import static smetana.core.Macro.GD_ranksep;
100 import static smetana.core.Macro.GD_rn;
101 import static smetana.core.Macro.INT_MAX;
102 import static smetana.core.Macro.MAX;
103 import static smetana.core.Macro.MIN;
104 import static smetana.core.Macro.N;
105 import static smetana.core.Macro.ND_UF_size;
106 import static smetana.core.Macro.ND_alg;
107 import static smetana.core.Macro.ND_clust;
108 import static smetana.core.Macro.ND_coord;
109 import static smetana.core.Macro.ND_flat_out;
110 import static smetana.core.Macro.ND_ht;
111 import static smetana.core.Macro.ND_in;
112 import static smetana.core.Macro.ND_inleaf;
113 import static smetana.core.Macro.ND_lw;
114 import static smetana.core.Macro.ND_mval;
115 import static smetana.core.Macro.ND_next;
116 import static smetana.core.Macro.ND_node_type;
117 import static smetana.core.Macro.ND_order;
118 import static smetana.core.Macro.ND_other;
119 import static smetana.core.Macro.ND_out;
120 import static smetana.core.Macro.ND_outleaf;
121 import static smetana.core.Macro.ND_prev;
122 import static smetana.core.Macro.ND_rank;
123 import static smetana.core.Macro.ND_ranktype;
124 import static smetana.core.Macro.ND_rw;
125 import static smetana.core.Macro.ND_save_in;
126 import static smetana.core.Macro.ND_save_out;
127 import static smetana.core.Macro.NOT;
128 import static smetana.core.Macro.ROUND;
129 import static smetana.core.Macro.UNSUPPORTED;
130 import static smetana.core.Macro.aghead;
131 import static smetana.core.Macro.agtail;
132 import static smetana.core.Macro.alloc_elist;
133 import static smetana.core.Macro.free_list;
134 import h.ST_Agedge_s;
135 import h.ST_Agedgeinfo_t;
136 import h.ST_Agedgepair_s;
137 import h.ST_Agnode_s;
138 import h.ST_Agraph_s;
139 import h.ST_aspect_t;
140 import h.ST_point;
141 import h.ST_pointf;
142 import h.ST_rank_t;
143 import h.ratio_t;
144 import smetana.core.CString;
145 import smetana.core.Memory;
146 import smetana.core.Z;
147
148 public class position__c {
149 //1 2digov3edok6d5srhgtlmrycs
150 // extern lt_symlist_t lt_preloaded_symbols[]
151
152
153 //1 baedz5i9est5csw3epz3cv7z
154 // typedef Ppoly_t Ppolyline_t
155
156
157 //1 9k44uhd5foylaeoekf3llonjq
158 // extern Dtmethod_t* Dtset
159
160
161 //1 1ahfywsmzcpcig2oxm7pt9ihj
162 // extern Dtmethod_t* Dtbag
163
164
165 //1 anhghfj3k7dmkudy2n7rvt31v
166 // extern Dtmethod_t* Dtoset
167
168
169 //1 5l6oj1ux946zjwvir94ykejbc
170 // extern Dtmethod_t* Dtobag
171
172
173 //1 2wtf222ak6cui8cfjnw6w377z
174 // extern Dtmethod_t* Dtlist
175
176
177 //1 d1s1s6ibtcsmst88e3057u9r7
178 // extern Dtmethod_t* Dtstack
179
180
181 //1 axa7mflo824p6fspjn1rdk0mt
182 // extern Dtmethod_t* Dtqueue
183
184
185 //1 ega812utobm4xx9oa9w9ayij6
186 // extern Dtmethod_t* Dtdeque
187
188
189 //1 cyfr996ur43045jv1tjbelzmj
190 // extern Dtmethod_t* Dtorder
191
192
193 //1 wlofoiftbjgrrabzb2brkycg
194 // extern Dtmethod_t* Dttree
195
196
197 //1 12bds94t7voj7ulwpcvgf6agr
198 // extern Dtmethod_t* Dthash
199
200
201 //1 9lqknzty480cy7zsubmabkk8h
202 // extern Dtmethod_t _Dttree
203
204
205 //1 bvn6zkbcp8vjdhkccqo1xrkrb
206 // extern Dtmethod_t _Dthash
207
208
209 //1 9lidhtd6nsmmv3e7vjv9e10gw
210 // extern Dtmethod_t _Dtlist
211
212
213 //1 34ujfamjxo7xn89u90oh2k6f8
214 // extern Dtmethod_t _Dtqueue
215
216
217 //1 3jy4aceckzkdv950h89p4wjc8
218 // extern Dtmethod_t _Dtstack
219
220
221 //1 8dfqgf3u1v830qzcjqh9o8ha7
222 // extern Agmemdisc_t AgMemDisc
223
224
225 //1 18k2oh2t6llfsdc5x0wlcnby8
226 // extern Agiddisc_t AgIdDisc
227
228
229 //1 a4r7hi80gdxtsv4hdoqpyiivn
230 // extern Agiodisc_t AgIoDisc
231
232
233 //1 bnzt5syjb7mgeru19114vd6xx
234 // extern Agdisc_t AgDefaultDisc
235
236
237 //1 35y2gbegsdjilegaribes00mg
238 // extern Agdesc_t Agdirected, Agstrictdirected, Agundirected, Agstrictundirected
239
240
241 //1 c2rygslq6bcuka3awmvy2b3ow
242 // typedef Agsubnode_t Agnoderef_t
243
244
245 //1 xam6yv0dcsx57dtg44igpbzn
246 // typedef Dtlink_t Agedgeref_t
247
248
249 //1 nye6dsi1twkbddwo9iffca1j
250 // extern char *Version
251
252
253 //1 65mu6k7h7lb7bx14jpiw7iyxr
254 // extern char **Files
255
256
257 //1 2rpjdzsdyrvomf00zcs3u3dyn
258 // extern const char **Lib
259
260
261 //1 6d2f111lntd2rsdt4gswh5909
262 // extern char *CmdName
263
264
265 //1 a0ltq04fpeg83soa05a2fkwb2
266 // extern char *specificFlags
267
268
269 //1 1uv30qeqq2jh6uznlr4dziv0y
270 // extern char *specificItems
271
272
273 //1 7i4hkvngxe3x7lmg5h6b3t9g3
274 // extern char *Gvfilepath
275
276
277 //1 9jp96pa73kseya3w6sulxzok6
278 // extern char *Gvimagepath
279
280
281 //1 40ylumfu7mrvawwf4v2asvtwk
282 // extern unsigned char Verbose
283
284
285 //1 93st8awjy1z0h07n28qycbaka
286 // extern unsigned char Reduce
287
288
289 //1 f2vs67ts992erf8onwfglurzp
290 // extern int MemTest
291
292
293 //1 c6f8whijgjwwagjigmxlwz3gb
294 // extern char *HTTPServerEnVar
295
296
297 //1 cp4hzj7p87m7arw776d3bt7aj
298 // extern char *Output_file_name
299
300
301 //1 a3rqagofsgraie6mx0krzkgsy
302 // extern int graphviz_errors
303
304
305 //1 5up05203r4kxvjn1m4njcgq5x
306 // extern int Nop
307
308
309 //1 umig46cco431x14b3kosde2t
310 // extern double PSinputscale
311
312
313 //1 52bj6v8fqz39khasobljfukk9
314 // extern int Syntax_errors
315
316
317 //1 9ekf2ina8fsjj6y6i0an6somj
318 // extern int Show_cnt
319
320
321 //1 38di5qi3nkxkq65onyvconk3r
322 // extern char** Show_boxes
323
324
325 //1 6ri6iu712m8mpc7t2670etpcw
326 // extern int CL_type
327
328
329 //1 bomxiw3gy0cgd1ydqtek7fpxr
330 // extern unsigned char Concentrate
331
332
333 //1 cqy3gqgcq8empdrbnrhn84058
334 // extern double Epsilon
335
336
337 //1 64slegfoouqeg0rmbyjrm8wgr
338 // extern int MaxIter
339
340
341 //1 88wdinpnmfs4mab4aw62yb0bg
342 // extern int Ndim
343
344
345 //1 8bbad3ogcelqnnvo5br5s05gq
346 // extern int State
347
348
349 //1 17rnd8q45zclfn68qqst2vxxn
350 // extern int EdgeLabelsDone
351
352
353 //1 ymx1z4s8cznjifl2d9f9m8jr
354 // extern double Initial_dist
355
356
357 //1 a33bgl0c3uqb3trx419qulj1x
358 // extern double Damping
359
360
361 //1 d9lvrpjg1r0ojv40pod1xwk8n
362 // extern int Y_invert
363
364
365 //1 71efkfs77q5tq9ex6y0f4kanh
366 // extern int GvExitOnUsage
367
368
369 //1 4xy2dkdkv0acs2ue9eca8hh2e
370 // 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
371
372
373 //1 9js5gxgzr74eakgtfhnbws3t9
374 // 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
375
376
377 //1 anqllp9sj7wo45w6bm11j8trn
378 // 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
379
380
381 //1 bh0z9puipqw7gymjd5h5b8s6i
382 // extern struct fdpParms_s* fdp_parms
383
384
385
386
387 //3 ciez0pfggxdljedzsbklq49f0
388 // static inline point pointof(int x, int y)
389 public static Object pointof(Object... arg) {
390 UNSUPPORTED("8e4tj258yvfq5uhsdpk37n5eq"); // static inline point pointof(int x, int y)
391 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
392 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
393 UNSUPPORTED("12jimkrzqxavaie0cpapbx18c"); // r.x = x;
394 UNSUPPORTED("7ivmviysahgsc5nn9gtp7q2if"); // r.y = y;
395 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
396 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
397
398 throw new UnsupportedOperationException();
399 }
400
401
402
403
404 //3 c1s4k85p1cdfn176o3uryeros
405 // static inline pointf pointfof(double x, double y)
406 public static ST_pointf pointfof(double x, double y) {
407 // WARNING!! STRUCT
408 return pointfof_w_(x, y).copy();
409 }
410 private static ST_pointf pointfof_w_(double x, double y) {
411 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
412 try {
413 final ST_pointf r = new ST_pointf();
414 r.setDouble("x", x);
415 r.setDouble("y", y);
416 return r;
417 } finally {
418 LEAVING("c1s4k85p1cdfn176o3uryeros","pointfof");
419 }
420 }
421
422
423
424
425 //3 7cufnfitrh935ew093mw0i4b7
426 // static inline box boxof(int llx, int lly, int urx, int ury)
427 public static Object boxof(Object... arg) {
428 UNSUPPORTED("3lzesfdd337h31jrlib1czocm"); // static inline box boxof(int llx, int lly, int urx, int ury)
429 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
430 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
431 UNSUPPORTED("cylhjlutoc0sc0uy7g98m9fb8"); // b.LL.x = llx, b.LL.y = lly;
432 UNSUPPORTED("242of6revxzx8hpe7yerrchz6"); // b.UR.x = urx, b.UR.y = ury;
433 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
434 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
435
436 throw new UnsupportedOperationException();
437 }
438
439
440
441
442
443
444
445
446 //3 1n5xl70wxuabyf97mclvilsm6
447 // static inline point add_point(point p, point q)
448 public static Object add_point(Object... arg) {
449 UNSUPPORTED("6iamka1fx8fk1rohzzse8phte"); // static inline point add_point(point p, point q)
450 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
451 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
452 UNSUPPORTED("3n2sizjd0civbzm6iq7su1s2p"); // r.x = p.x + q.x;
453 UNSUPPORTED("65ygdo31w09i5i6bd2f7azcd3"); // r.y = p.y + q.y;
454 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
455 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
456
457 throw new UnsupportedOperationException();
458 }
459
460
461
462
463 //3 arrsbik9b5tnfcbzsm8gr2chx
464 // static inline pointf add_pointf(pointf p, pointf q)
465 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
466 // WARNING!! STRUCT
467 return add_pointf_w_(p.copy(), q.copy()).copy();
468 }
469 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
470 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
471 try {
472 final ST_pointf r = new ST_pointf();
473 r.setDouble("x", p.x + q.x);
474 r.setDouble("y", p.y + q.y);
475 return r;
476 } finally {
477 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
478 }
479 }
480
481
482
483
484 //3 ai2dprak5y6obdsflguh5qbd7
485 // static inline point sub_point(point p, point q)
486 public static Object sub_point(Object... arg) {
487 UNSUPPORTED("cd602849h0bce8lu9xegka0ia"); // static inline point sub_point(point p, point q)
488 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
489 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
490 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
491 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
492 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
493 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
494
495 throw new UnsupportedOperationException();
496 }
497
498
499
500
501 //3 16f6pyogcv3j7n2p0n8giqqgh
502 // static inline pointf sub_pointf(pointf p, pointf q)
503 public static Object sub_pointf(Object... arg) {
504 UNSUPPORTED("dmufj44lddsnj0wjyxsg2fcso"); // static inline pointf sub_pointf(pointf p, pointf q)
505 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
506 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
507 UNSUPPORTED("4q4q9dveah93si8ajfv59gz27"); // r.x = p.x - q.x;
508 UNSUPPORTED("9f90ik0o2yqhanzntpy3d2ydy"); // r.y = p.y - q.y;
509 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
510 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
511
512 throw new UnsupportedOperationException();
513 }
514
515
516
517
518 //3 9k50jgrhc4f9824vf8ony74rw
519 // static inline point mid_point(point p, point q)
520 public static Object mid_point(Object... arg) {
521 UNSUPPORTED("evy44tdsmu3erff9dp2x835u2"); // static inline point mid_point(point p, point q)
522 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
523 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
524 UNSUPPORTED("1a6p6fm57o0wt5ze2btsx06c7"); // r.x = (p.x + q.x) / 2;
525 UNSUPPORTED("1kbj5tgdmfi6kf4jgg6skhr6e"); // r.y = (p.y + q.y) / 2;
526 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
527 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
528
529 throw new UnsupportedOperationException();
530 }
531
532
533
534
535 //3 59c4f7im0ftyowhnzzq2v9o1x
536 // static inline pointf mid_pointf(pointf p, pointf q)
537 public static Object mid_pointf(Object... arg) {
538 UNSUPPORTED("381o63o9kb04d7gzg65v0r3q"); // static inline pointf mid_pointf(pointf p, pointf q)
539 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
540 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
541 UNSUPPORTED("c5vboetlr3mf43wns7iik6m1w"); // r.x = (p.x + q.x) / 2.;
542 UNSUPPORTED("bcdf562ldr3bjn78hcay5xd63"); // r.y = (p.y + q.y) / 2.;
543 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
544 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
545
546 throw new UnsupportedOperationException();
547 }
548
549
550
551
552 //3 5r18p38gisvcx3zsvbb9saixx
553 // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
554 public static Object interpolate_pointf(Object... arg) {
555 UNSUPPORTED("894yimn33kmtm454llwdaotu8"); // static inline pointf interpolate_pointf(double t, pointf p, pointf q)
556 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
557 UNSUPPORTED("ef2acl8wa2ooqcb5vz3098maz"); // pointf r;
558 UNSUPPORTED("5tpwuyf5iidesy80v8o4nwkmk"); // r.x = p.x + t * (q.x - p.x);
559 UNSUPPORTED("ewnrc5uloj3w5jbmsjcn3wja0"); // r.y = p.y + t * (q.y - p.y);
560 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
561 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
562
563 throw new UnsupportedOperationException();
564 }
565
566
567
568
569 //3 bxzrv2ghq04qk5cbyy68s4mol
570 // static inline point exch_xy(point p)
571 public static Object exch_xy(Object... arg) {
572 UNSUPPORTED("2vxya0v2fzlv5e0vjaa8d414"); // static inline point exch_xy(point p)
573 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
574 UNSUPPORTED("c0j3k9xv06332q98k2pgpacto"); // point r;
575 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
576 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
577 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
578 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
579
580 throw new UnsupportedOperationException();
581 }
582
583
584
585
586 //3 9lt3e03tac6h6sydljrcws8fd
587 // static inline pointf exch_xyf(pointf p)
588 public static Object exch_xyf(Object... arg) {
589 UNSUPPORTED("8qamrobrqi8jsvvfrxkimrsnw"); // static inline pointf exch_xyf(pointf p)
590 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
591 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
592 UNSUPPORTED("60cojdwc2h7f0m51s9jdwvup7"); // r.x = p.y;
593 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
594 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
595 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
596
597 throw new UnsupportedOperationException();
598 }
599
600
601
602
603 //3 8l9qhieokthntzdorlu5zn29b
604 // static inline box box_bb(box b0, box b1)
605 public static Object box_bb(Object... arg) {
606 UNSUPPORTED("36et5gmnjrby6o7bq9sgh1hx6"); // static inline box box_bb(box b0, box b1)
607 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
608 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
609 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
610 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
611 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
612 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
613 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
614 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
615
616 throw new UnsupportedOperationException();
617 }
618
619
620
621
622 //3 clws9h3bbjm0lw3hexf8nl4c4
623 // static inline boxf boxf_bb(boxf b0, boxf b1)
624 public static Object boxf_bb(Object... arg) {
625 UNSUPPORTED("dyrqu4ww9osr9c86gqgmifcp6"); // static inline boxf boxf_bb(boxf b0, boxf b1)
626 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
627 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
628 UNSUPPORTED("8mr2c9xitsqi8z1plbp7ox1hu"); // b.LL.x = MIN(b0.LL.x, b1.LL.x);
629 UNSUPPORTED("2egu55ef4u1i03nwz01k7kcrl"); // b.LL.y = MIN(b0.LL.y, b1.LL.y);
630 UNSUPPORTED("9n6ei3odbgefwfxvql9whcpe"); // b.UR.x = MAX(b0.UR.x, b1.UR.x);
631 UNSUPPORTED("19ocysbuh4pxyft2bqhyhigr1"); // b.UR.y = MAX(b0.UR.y, b1.UR.y);
632 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
633 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
634
635 throw new UnsupportedOperationException();
636 }
637
638
639
640
641 //3 bit6ycxo1iqd2al92y8gkzlvb
642 // static inline box box_intersect(box b0, box b1)
643 public static Object box_intersect(Object... arg) {
644 UNSUPPORTED("34gv28cldst09bl71itjgviue"); // static inline box box_intersect(box b0, box b1)
645 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
646 UNSUPPORTED("52u27kayecy1i1e8bbo8f7s9r"); // box b;
647 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
648 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
649 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
650 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
651 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
652 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
653
654 throw new UnsupportedOperationException();
655 }
656
657
658
659
660 //3 8gfybie7k6pgb3o1a6llgpwng
661 // static inline boxf boxf_intersect(boxf b0, boxf b1)
662 public static Object boxf_intersect(Object... arg) {
663 UNSUPPORTED("ape22b8z6jfg17gvo42hok9eb"); // static inline boxf boxf_intersect(boxf b0, boxf b1)
664 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
665 UNSUPPORTED("c57pq0f87j6dnbcvygu7v6k84"); // boxf b;
666 UNSUPPORTED("9slu7bixuymxttjic76ha2nl2"); // b.LL.x = MAX(b0.LL.x, b1.LL.x);
667 UNSUPPORTED("3uv943c2f82yuif249pf5azob"); // b.LL.y = MAX(b0.LL.y, b1.LL.y);
668 UNSUPPORTED("74tf5h16bc9zabq3s3dyny543"); // b.UR.x = MIN(b0.UR.x, b1.UR.x);
669 UNSUPPORTED("d99gcv3i7xes7y7rqf8ii20ux"); // b.UR.y = MIN(b0.UR.y, b1.UR.y);
670 UNSUPPORTED("2vmm1j57brhn455f8f3iyw6mo"); // return b;
671 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
672
673 throw new UnsupportedOperationException();
674 }
675
676
677
678
679 //3 7z8j2quq65govaaejrz7b4cvb
680 // static inline int box_overlap(box b0, box b1)
681 public static Object box_overlap(Object... arg) {
682 UNSUPPORTED("1e9k599x7ygct7r4cfdxlk9u9"); // static inline int box_overlap(box b0, box b1)
683 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
684 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
685 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
686
687 throw new UnsupportedOperationException();
688 }
689
690
691
692
693 //3 4z0suuut2acsay5m8mg9dqjdu
694 // static inline int boxf_overlap(boxf b0, boxf b1)
695 public static Object boxf_overlap(Object... arg) {
696 UNSUPPORTED("905nejsewihwhhc3bhnrz9nwo"); // static inline int boxf_overlap(boxf b0, boxf b1)
697 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
698 UNSUPPORTED("7a9wwpu7dhdphd08y1ecw54w5"); // return OVERLAP(b0, b1);
699 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
700
701 throw new UnsupportedOperationException();
702 }
703
704
705
706
707 //3 dd34swz5rmdgu3a2np2a4h1dy
708 // static inline int box_contains(box b0, box b1)
709 public static Object box_contains(Object... arg) {
710 UNSUPPORTED("aputfc30fjkvy6jx4otljaczq"); // static inline int box_contains(box b0, box b1)
711 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
712 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
713 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
714
715 throw new UnsupportedOperationException();
716 }
717
718
719
720
721 //3 8laj1bspbu2i1cjd9upr7xt32
722 // static inline int boxf_contains(boxf b0, boxf b1)
723 public static Object boxf_contains(Object... arg) {
724 UNSUPPORTED("7ccnttkiwt834yfyw0evcm18v"); // static inline int boxf_contains(boxf b0, boxf b1)
725 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
726 UNSUPPORTED("87ap80vrh2a4gpprbxr33lrg3"); // return CONTAINS(b0, b1);
727 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
728
729 throw new UnsupportedOperationException();
730 }
731
732
733
734
735 //3 4wf5swkz24xx51ja2dynbycu1
736 // static inline pointf perp (pointf p)
737 public static Object perp(Object... arg) {
738 UNSUPPORTED("567wpqlg9rv63ynyvxd9sgkww"); // static inline pointf perp (pointf p)
739 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
740 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
741 UNSUPPORTED("2fyydy6t6yifjsczccsb9szeg"); // r.x = -p.y;
742 UNSUPPORTED("evp2x66oa4s1tlnc0ytxq2qbq"); // r.y = p.x;
743 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
744 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
745
746 throw new UnsupportedOperationException();
747 }
748
749
750
751
752 //3 6dtlpzv4mvgzb9o0b252yweuv
753 // static inline pointf scale (double c, pointf p)
754 public static Object scale(Object... arg) {
755 UNSUPPORTED("c1ngytew34bmkdb7vps5h3dh8"); // static inline pointf scale (double c, pointf p)
756 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
757 UNSUPPORTED("cvexv13y9fq49v0j4d5t4cm9f"); // pointf r;
758 UNSUPPORTED("dznf7nac14snww4usquyd6r3r"); // r.x = c * p.x;
759 UNSUPPORTED("33kk73m8vjcux5tnjl8co2pe6"); // r.y = c * p.y;
760 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
761 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
762
763 throw new UnsupportedOperationException();
764 }
765
766
767
768
769 //3 6knxbdrmgk6294aw61s2lpvvf
770 // static double largeMinlen (double l)
771 public static double largeMinlen(double l) {
772 ENTERING("6knxbdrmgk6294aw61s2lpvvf","largeMinlen");
773 try {
774 UNSUPPORTED("lt6cippjix5bbvyhkcpl8g7g"); // static double
775 UNSUPPORTED("e2f0xhw6om2fpgt48xyjjg3i"); // largeMinlen (double l)
776 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
777 UNSUPPORTED("dad2o3vzemegi5fywxl7hcezk"); // agerr (AGERR, "Edge length %f larger than maximum %u allowed.\nCheck for overwide node(s).\n", l, USHRT_MAX);
778 UNSUPPORTED("dlasv24dnuygpwagcamhyg15w"); // return (double)USHRT_MAX;
779 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
780
781 throw new UnsupportedOperationException();
782 } finally {
783 LEAVING("6knxbdrmgk6294aw61s2lpvvf","largeMinlen");
784 }
785 }
786
787
788
789
790 //3 ccowbxkwmrj75tojopmhcmubx
791 // static void connectGraph (graph_t* g)
792 public static void connectGraph(ST_Agraph_s g) {
793 ENTERING("ccowbxkwmrj75tojopmhcmubx","connectGraph");
794 try {
795 int i, j, r, found;
796 ST_Agnode_s tp;
797 ST_Agnode_s hp;
798 ST_Agnode_s sn;
799 ST_Agedge_s e;
800 ST_rank_t.Array2 rp;
801 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
802 rp = GD_rank(g).plus(r);
803 found =0;
804 tp = null;
805 for (i = 0; i < rp.getPtr().n; i++) {
806 tp = (ST_Agnode_s) rp.getPtr().v.get(i);
807 if (ND_save_out(tp).listNotNull()) {
808 for (j = 0; (e = (ST_Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) {
809 if ((ND_rank(aghead(e)) > r) || (ND_rank(agtail(e)) > r)) {
810 found = 1;
811 break;
812 }
813 }
814 if (found!=0) break;
815 }
816 if (ND_save_in(tp).listNotNull()) {
817 for (j = 0; (e = (ST_Agedge_s) ND_save_in(tp).getFromList(j))!=null; j++) {
818 if ((ND_rank(agtail(e)) > r) || (ND_rank(aghead(e)) > r)) {
819 found = 1;
820 break;
821 }
822 }
823 if (found!=0) break;
824 }
825 }
826 if (found!=0 || N(tp)) continue;
827 tp = (ST_Agnode_s) rp.getPtr().v.get(0);
828 if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.get(1).v.get(0);
829 else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.get(0);
830 //assert (hp);
831 sn = virtual_node(g);
832 ND_node_type(sn, 2);
833 make_aux_edge(sn, tp, 0, 0);
834 make_aux_edge(sn, hp, 0, 0);
835 ND_rank(sn, MIN(ND_rank(tp), ND_rank(hp)));
836 }
837 } finally {
838 LEAVING("ccowbxkwmrj75tojopmhcmubx","connectGraph");
839 }
840 }
841
842
843
844
845 //3 33snzyd9z0loienur06dnily9
846 // void dot_position(graph_t * g, aspect_t* asp)
847 public static void dot_position(ST_Agraph_s g, ST_aspect_t asp) {
848 ENTERING("33snzyd9z0loienur06dnily9","dot_position");
849 try {
850 if (GD_nlist(g) == null)
851 return; /* ignore empty graph */
852 mark_lowclusters(g); /* we could remove from splines.c now */
853 set_ycoords(g);
854 if (Z.z().Concentrate)
855 dot_concentrate(g);
856 expand_leaves(g);
857 if (flat_edges(g)!=0)
858 set_ycoords(g);
859 create_aux_edges(g);
860 if (rank(g, 2, nsiter2(g))!=0) { /* LR balance == 2 */
861 connectGraph (g);
862 //assert(rank(g, 2, nsiter2(g)) == 0);
863 }
864 set_xcoords(g);
865 set_aspect(g, asp);
866 remove_aux_edges(g); /* must come after set_aspect since we now
867 * use GD_ln and GD_rn for bbox width.
868 */
869 } finally {
870 LEAVING("33snzyd9z0loienur06dnily9","dot_position");
871 }
872 }
873
874
875
876
877 //3 90vn63m6v0w9fn9a2dgfxxx3h
878 // static int nsiter2(graph_t * g)
879 public static int nsiter2(ST_Agraph_s g) {
880 ENTERING("90vn63m6v0w9fn9a2dgfxxx3h","nsiter2");
881 try {
882 int maxiter = INT_MAX;
883 CString s;
884 if ((s = agget(g, new CString("nslimit")))!=null)
885 maxiter = (int)(atof(s) * agnnodes(g));
886 return maxiter;
887 } finally {
888 LEAVING("90vn63m6v0w9fn9a2dgfxxx3h","nsiter2");
889 }
890 }
891
892
893
894
895 //3 5bax8ut6nnk4pr7yxdumk9chl
896 // static int go(node_t * u, node_t * v)
897 public static boolean go(ST_Agnode_s u, ST_Agnode_s v) {
898 ENTERING("5bax8ut6nnk4pr7yxdumk9chl","go");
899 try {
900 int i;
901 ST_Agedge_s e;
902 if (EQ(u, v))
903 return NOT(false);
904 for (i = 0; (e = (ST_Agedge_s) ND_out(u).getFromList(i))!=null; i++) {
905 if (go(aghead(e), v))
906 return NOT(false);
907 }
908 return false;
909 } finally {
910 LEAVING("5bax8ut6nnk4pr7yxdumk9chl","go");
911 }
912 }
913
914
915
916
917 //3 9xz8numztzj4qsq85pziahv1k
918 // static int canreach(node_t * u, node_t * v)
919 public static boolean canreach(ST_Agnode_s u, ST_Agnode_s v) {
920 ENTERING("9xz8numztzj4qsq85pziahv1k","canreach");
921 try {
922 return go(u, v);
923 } finally {
924 LEAVING("9xz8numztzj4qsq85pziahv1k","canreach");
925 }
926 }
927
928
929
930
931 //3 4cvgiatny97ou6mhqoq6aqwek
932 // edge_t *make_aux_edge(node_t * u, node_t * v, double len, int wt)
933 public static ST_Agedge_s make_aux_edge(ST_Agnode_s u, ST_Agnode_s v, double len, int wt) {
934 ENTERING("4cvgiatny97ou6mhqoq6aqwek","make_aux_edge");
935 try {
936 ST_Agedge_s e;
937 ST_Agedgepair_s e2 = new ST_Agedgepair_s();
938 AGTYPE(e2.in, AGINEDGE);
939 AGTYPE(e2.out, AGOUTEDGE);
940 e2.out.base.setPtr("data", new ST_Agedgeinfo_t());
941 e = (ST_Agedge_s) e2.out;
942 agtail(e, u);
943 aghead(e, v);
944 if (len > USHRT_MAX)
945 len = largeMinlen (len);
946 ED_minlen(e, ROUND(len));
947 ED_weight(e, wt);
948 fast_edge(e);
949 return e;
950 } finally {
951 LEAVING("4cvgiatny97ou6mhqoq6aqwek","make_aux_edge");
952 }
953 }
954
955
956
957
958 //3 53fvij7oun7aezlb7x66vzuyb
959 // static void allocate_aux_edges(graph_t * g)
960 public static void allocate_aux_edges(ST_Agraph_s g) {
961 ENTERING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
962 try {
963 int i, j, n_in;
964 ST_Agnode_s n;
965 /* allocate space for aux edge lists */
966 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
967 ND_save_in(n, ND_in(n));
968 ND_save_out(n, ND_out(n));
969 for (i = 0; ND_out(n).getFromList(i)!=null; i++);
970 for (j = 0; ND_in(n).getFromList(j)!=null; j++);
971 n_in = i + j;
972 alloc_elist(n_in + 3, ND_in(n));
973 alloc_elist(3, ND_out(n));
974 }
975 } finally {
976 LEAVING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
977 }
978 }
979
980
981
982
983 //3 ah28nr6mxpjeosr85bhmzd3si
984 // static void make_LR_constraints(graph_t * g)
985 public static void make_LR_constraints(ST_Agraph_s g) {
986 ENTERING("ah28nr6mxpjeosr85bhmzd3si","make_LR_constraints");
987 try {
988 int i, j, k;
989 int sw; /* self width */
990 int m0, m1;
991 double width;
992 int sep[] = new int[2];
993 int nodesep; /* separation between nodes on same rank */
994 ST_Agedge_s e, e0, e1, ff;
995 ST_Agnode_s u, v, t0, h0;
996 ST_rank_t.Array2 rank = GD_rank(g);
997 /* Use smaller separation on odd ranks if g has edge labels */
998 if ((GD_has_labels(g) & (1 << 0))!=0) {
999 sep[0] = GD_nodesep(g);
1000 sep[1] = 5;
1001 }
1002 else {
1003 sep[1] = sep[0] = GD_nodesep(g);
1004 }
1005 /* make edges to constrain left-to-right ordering */
1006 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
1007 double last;
1008 ND_rank(rank.get(i).v.get(0), 0);
1009 last = 0;
1010 nodesep = sep[i & 1];
1011 for (j = 0; j < rank.get(i).n; j++) {
1012 u = (ST_Agnode_s) rank.get(i).v.get(j);
1013 ND_mval(u, ND_rw(u)); /* keep it somewhere safe */
1014 if (ND_other(u).size > 0) { /* compute self size */
1015 /* FIX: dot assumes all self-edges go to the right. This
1016 * is no longer true, though makeSelfEdge still attempts to
1017 * put as many as reasonable on the right. The dot code
1018 * should be modified to allow a box reflecting the placement
1019 * of all self-edges, and use that to reposition the nodes.
1020 * Note that this would not only affect left and right
1021 * positioning but may also affect interrank spacing.
1022 */
1023 sw = 0;
1024 for (k = 0; (e = (ST_Agedge_s) ND_other(u).getFromList(k))!=null; k++) {
1025 if (EQ(agtail(e), aghead(e))) {
1026 sw += selfRightSpace (e);
1027 }
1028 }
1029 ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */
1030 }
1031 v = (ST_Agnode_s) rank.get(i).v.plus(j + 1).getPtr();
1032 if (v!=null) {
1033 width = ND_rw(u) + ND_lw(v) + nodesep;
1034 e0 = make_aux_edge(u, v, width, 0);
1035 ND_rank(v, (int)(last + width));
1036 last = (int)(last + width);
1037 }
1038 /* constraints from labels of flat edges on previous rank */
1039 if ((e = (ST_Agedge_s) ND_alg(u))!=null) {
1040 e0 = (ST_Agedge_s) ND_save_out(u).getFromList(0);
1041 e1 = (ST_Agedge_s) ND_save_out(u).getFromList(1);
1042 if (ND_order(aghead(e0)) > ND_order(aghead(e1))) {
1043 ff = e0;
1044 e0 = e1;
1045 e1 = ff;
1046 }
1047 m0 = (ED_minlen(e) * GD_nodesep(g)) / 2;
1048 m1 = m0 + ((int)(ND_rw(aghead(e0)) + ND_lw(agtail(e0))));
1049 /* these guards are needed because the flat edges
1050 * work very poorly with cluster layout */
1051 if (canreach(agtail(e0), aghead(e0)) == false)
1052 make_aux_edge(aghead(e0), agtail(e0), m1,
1053 ED_weight(e));
1054 m1 = m0 + ((int)(ND_rw(agtail(e1)) + ND_lw(aghead(e1))));
1055 if (canreach(aghead(e1), agtail(e1)) == false)
1056 make_aux_edge(agtail(e1), aghead(e1), m1,
1057 ED_weight(e));
1058 }
1059 /* position flat edge endpoints */
1060 for (k = 0; k < ND_flat_out(u).size; k++) {
1061 e = (ST_Agedge_s) ND_flat_out(u).getFromList(k);
1062 if (ND_order(agtail(e)) < ND_order(aghead(e))) {
1063 t0 = agtail(e);
1064 h0 = aghead(e);
1065 } else {
1066 t0 = aghead(e);
1067 h0 = agtail(e);
1068 }
1069 width = ND_rw(t0) + ND_lw(h0);
1070 m0 = (int) (ED_minlen(e) * GD_nodesep(g) + width);
1071 if ((e0 = find_fast_edge(t0, h0))!=null) {
1072 /* flat edge between adjacent neighbors
1073 * ED_dist contains the largest label width.
1074 */
1075 m0 = MAX(m0, (int)(width + GD_nodesep(g) + ROUND(ED_dist(e))));
1076 if (m0 > USHRT_MAX)
1077 m0 = (int) largeMinlen (m0);
1078 ED_minlen(e0, MAX(ED_minlen(e0), m0));
1079 ED_weight(e0, MAX(ED_weight(e0), ED_weight(e)));
1080 }
1081 else if (N(ED_label(e))) {
1082 /* unlabeled flat edge between non-neighbors
1083 * ED_minlen(e) is max of ED_minlen of all equivalent
1084 * edges.
1085 */
1086 make_aux_edge(t0, h0, m0, ED_weight(e));
1087 }
1088 /* labeled flat edges between non-neighbors have already
1089 * been constrained by the label above.
1090 */
1091 }
1092 }
1093 }
1094 } finally {
1095 LEAVING("ah28nr6mxpjeosr85bhmzd3si","make_LR_constraints");
1096 }
1097 }
1098
1099
1100
1101
1102 //3 6uruo8mutxgcni9fm8jcrw4cr
1103 // static void make_edge_pairs(graph_t * g)
1104 public static void make_edge_pairs(ST_Agraph_s g) {
1105 ENTERING("6uruo8mutxgcni9fm8jcrw4cr","make_edge_pairs");
1106 try {
1107 int i, m0, m1;
1108 ST_Agnode_s n, sn;
1109 ST_Agedge_s e;
1110 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
1111 if (ND_save_out(n).listNotNull())
1112 for (i = 0; (e = (ST_Agedge_s) ND_save_out(n).getFromList(i))!=null; i++) {
1113 sn = virtual_node(g);
1114 ND_node_type(sn, 2);
1115 m0 = (int)(ED_head_port(e).p.x - ED_tail_port(e).p.x);
1116 if (m0 > 0)
1117 m1 = 0;
1118 else {
1119 m1 = -m0;
1120 m0 = 0;
1121 }
1122 make_aux_edge(sn, agtail(e), m0 + 1, ED_weight(e));
1123 make_aux_edge(sn, aghead(e), m1 + 1, ED_weight(e));
1124 ND_rank(sn,
1125 MIN(ND_rank(agtail(e)) - m0 - 1,
1126 ND_rank(aghead(e)) - m1 - 1));
1127 }
1128 }
1129 } finally {
1130 LEAVING("6uruo8mutxgcni9fm8jcrw4cr","make_edge_pairs");
1131 }
1132 }
1133
1134
1135
1136
1137 //3 79v3omwzni0nm3h05l3onjsbz
1138 // static void contain_clustnodes(graph_t * g)
1139 public static void contain_clustnodes(ST_Agraph_s g) {
1140 ENTERING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
1141 try {
1142 int c;
1143 ST_Agedge_s e;
1144 if (NEQ(g, dot_root(g))) {
1145 contain_nodes(g);
1146 if ((e = find_fast_edge(GD_ln(g),GD_rn(g)))!=null) /* maybe from lrvn()?*/
1147 ED_weight(e, ED_weight(e) + 128);
1148 else
1149 make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */
1150 }
1151 for (c = 1; c <= GD_n_cluster(g); c++)
1152 contain_clustnodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
1153 } finally {
1154 LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
1155 }
1156 }
1157
1158
1159
1160
1161 //3 24yfgklubun581fbfyx62lzsm
1162 // static int vnode_not_related_to(graph_t * g, node_t * v)
1163 public static boolean vnode_not_related_to(ST_Agraph_s g, ST_Agnode_s v) {
1164 ENTERING("24yfgklubun581fbfyx62lzsm","vnode_not_related_to");
1165 try {
1166 ST_Agedge_s e;
1167 if (ND_node_type(v) != 1)
1168 return false;
1169 for (e = (ST_Agedge_s) ND_save_out(v).getFromList(0); ED_to_orig(e)!=null; e = ED_to_orig(e));
1170 if (agcontains(g, agtail(e)))
1171 return false;
1172 if (agcontains(g, aghead(e)))
1173 return false;
1174 return NOT(false);
1175 } finally {
1176 LEAVING("24yfgklubun581fbfyx62lzsm","vnode_not_related_to");
1177 }
1178 }
1179
1180
1181
1182
1183 //3 73cdgjl47ohty2va766evbo4
1184 // static void keepout_othernodes(graph_t * g)
1185 public static void keepout_othernodes(ST_Agraph_s g) {
1186 ENTERING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
1187 try {
1188 int i, c, r, margin;
1189 ST_Agnode_s u, v;
1190 margin = late_int (g, Z.z().G_margin, 8, 0);
1191 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1192 if (GD_rank(g).get(r).n == 0)
1193 continue;
1194 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
1195 if (v == null)
1196 continue;
1197 for (i = ND_order(v) - 1; i >= 0; i--) {
1198 u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
1199 /* can't use "is_a_vnode_of" because elists are swapped */
1200 if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
1201 make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0);
1202 break;
1203 }
1204 }
1205 for (i = ND_order(v) + GD_rank(g).get(r).n; i < GD_rank(dot_root(g)).get(r).n;
1206 i++) {
1207 u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
1208 if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
1209 make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0);
1210 break;
1211 }
1212 }
1213 }
1214 for (c = 1; c <= GD_n_cluster(g); c++)
1215 keepout_othernodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
1216 } finally {
1217 LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
1218 }
1219 }
1220
1221
1222
1223
1224 //3 c734mx1638sfqtl7vh7itaxyx
1225 // static void contain_subclust(graph_t * g)
1226 public static void contain_subclust(ST_Agraph_s g) {
1227 ENTERING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
1228 try {
1229 int margin, c;
1230 ST_Agraph_s subg;
1231 margin = late_int (g, Z.z().G_margin, 8, 0);
1232 make_lrvn(g);
1233 for (c = 1; c <= GD_n_cluster(g); c++) {
1234 subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
1235 make_lrvn(subg);
1236 make_aux_edge(GD_ln(g), GD_ln(subg),
1237 margin + GD_border(g)[3].x, 0);
1238 make_aux_edge(GD_rn(subg), GD_rn(g),
1239 margin + GD_border(g)[1].x, 0);
1240 contain_subclust(subg);
1241 }
1242 } finally {
1243 LEAVING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
1244 }
1245 }
1246
1247
1248
1249
1250 //3 6oruu1p1b7kxr5moh3kmcmvr3
1251 // static void separate_subclust(graph_t * g)
1252 public static void separate_subclust(ST_Agraph_s g) {
1253 ENTERING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
1254 try {
1255 int i, j, margin;
1256 ST_Agraph_s low, high;
1257 ST_Agraph_s left, right;
1258 margin = late_int (g, Z.z().G_margin, 8, 0);
1259 for (i = 1; i <= GD_n_cluster(g); i++)
1260 make_lrvn((ST_Agraph_s) GD_clust(g).get(i).getPtr());
1261 for (i = 1; i <= GD_n_cluster(g); i++) {
1262 for (j = i + 1; j <= GD_n_cluster(g); j++) {
1263 low = (ST_Agraph_s) GD_clust(g).get(i).getPtr();
1264 high = (ST_Agraph_s) GD_clust(g).get(j).getPtr();
1265 if (GD_minrank(low) > GD_minrank(high)) {
1266 ST_Agraph_s temp = low;
1267 low = high;
1268 high = temp;
1269 }
1270 if (GD_maxrank(low) < GD_minrank(high))
1271 continue;
1272 if (ND_order(GD_rank(low).get(GD_minrank(high)).v.get(0))
1273 < ND_order(GD_rank(high).get(GD_minrank(high)).v.get(0))) {
1274 left = low;
1275 right = high;
1276 } else {
1277 left = high;
1278 right = low;
1279 }
1280 make_aux_edge(GD_rn(left), GD_ln(right), margin, 0);
1281 }
1282 separate_subclust((ST_Agraph_s) GD_clust(g).get(i).getPtr());
1283 }
1284 } finally {
1285 LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
1286 }
1287 }
1288
1289
1290
1291
1292 //3 8f8gs2zivo4pnd3hmtb9g23x4
1293 // static void pos_clusters(graph_t * g)
1294 public static void pos_clusters(ST_Agraph_s g) {
1295 ENTERING("8f8gs2zivo4pnd3hmtb9g23x4","pos_clusters");
1296 try {
1297 if (GD_n_cluster(g) > 0) {
1298 contain_clustnodes(g);
1299 keepout_othernodes(g);
1300 contain_subclust(g);
1301 separate_subclust(g);
1302 }
1303 } finally {
1304 LEAVING("8f8gs2zivo4pnd3hmtb9g23x4","pos_clusters");
1305 }
1306 }
1307
1308
1309
1310
1311 //3 fywsxto7yvl5wa2dfu7u7jj1
1312 // static void compress_graph(graph_t * g)
1313 public static void compress_graph(ST_Agraph_s g) {
1314 ENTERING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
1315 try {
1316 double x;
1317 ST_pointf p = new ST_pointf();
1318 if (GD_drawing(g).ratio_kind != enumAsInt(ratio_t.class, "R_COMPRESS"))
1319 return;
1320 UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size;
1321 UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1)
1322 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
1323 UNSUPPORTED("5f3k9yz6btwxc8r5t8exytqqt"); // contain_nodes(g);
1324 UNSUPPORTED("4mvbrmj6dfhaz3burnpac7zsx"); // if (GD_flip(g) == 0)
1325 UNSUPPORTED("dzkztznjq2andjnjzqh8i5tij"); // x = p.x;
1326 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
1327 UNSUPPORTED("ddzjdkqij3y4gq9i3hikpoqvj"); // x = p.y;
1328 UNSUPPORTED("e1xij2jh66kyaiikenemo1qza"); // /* Guard against huge size attribute since max. edge length is USHRT_MAX
1329 UNSUPPORTED("5ilmnsqirjhzn5q6s3f9pkgi3"); // * A warning might be called for. Also, one could check that the graph
1330 UNSUPPORTED("1nhxkt9jijvhw5gsp2pluh8g8"); // * already fits GD_drawing(g)->size and return immediately.
1331 UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
1332 UNSUPPORTED("dkqac1chvtsaao23vr43xqs5r"); // x = MIN(x,USHRT_MAX);
1333 UNSUPPORTED("5es2j3xrdatvha5uea2wlqcxp"); // make_aux_edge(GD_ln(g), GD_rn(g), x, 1000);
1334 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1335
1336 throw new UnsupportedOperationException();
1337 } finally {
1338 LEAVING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
1339 }
1340 }
1341
1342
1343
1344
1345 //3 b7y0htx4svbhaqb1a12dihlue
1346 // static void create_aux_edges(graph_t * g)
1347 public static void create_aux_edges(ST_Agraph_s g) {
1348 ENTERING("b7y0htx4svbhaqb1a12dihlue","create_aux_edges");
1349 try {
1350 allocate_aux_edges(g);
1351 make_LR_constraints(g);
1352 make_edge_pairs(g);
1353 pos_clusters(g);
1354 compress_graph(g);
1355 } finally {
1356 LEAVING("b7y0htx4svbhaqb1a12dihlue","create_aux_edges");
1357 }
1358 }
1359
1360
1361
1362
1363 //3 euzeilq92ry8a4tcrij5s52t5
1364 // static void remove_aux_edges(graph_t * g)
1365 public static void remove_aux_edges(ST_Agraph_s g) {
1366 ENTERING("euzeilq92ry8a4tcrij5s52t5","remove_aux_edges");
1367 try {
1368 int i;
1369 ST_Agnode_s n, nnext, nprev;
1370 ST_Agedge_s e;
1371 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
1372 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
1373 Memory.free(e.base.data);
1374 Memory.free(e);
1375 }
1376 free_list(ND_out(n));
1377 free_list(ND_in(n));
1378 ND_out(n, ND_save_out(n));
1379 ND_in(n, ND_save_in(n));
1380 }
1381 /* cannot be merged with previous loop */
1382 nprev = null;
1383 for (n = GD_nlist(g); n!=null; n = nnext) {
1384 nnext = ND_next(n);
1385 if (ND_node_type(n) == 2) {
1386 if (nprev!=null)
1387 ND_next(nprev, nnext);
1388 else
1389 GD_nlist(g, nnext);
1390 Memory.free(n.base.data);
1391 Memory.free(n);
1392 } else
1393 nprev = n;
1394 }
1395 ND_prev(GD_nlist(g), null);
1396 } finally {
1397 LEAVING("euzeilq92ry8a4tcrij5s52t5","remove_aux_edges");
1398 }
1399 }
1400
1401
1402
1403
1404 //3 1oobmglea9t819y95xeel37h8
1405 // static void set_xcoords(graph_t * g)
1406 public static void set_xcoords(ST_Agraph_s g) {
1407 ENTERING("1oobmglea9t819y95xeel37h8","set_xcoords");
1408 try {
1409 int i, j;
1410 ST_Agnode_s v;
1411 ST_rank_t.Array2 rank = GD_rank(g);
1412 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
1413 for (j = 0; j < rank.get(i).n; j++) {
1414 v = (ST_Agnode_s) rank.get(i).v.get(j);
1415 ND_coord(v).x = ND_rank(v);
1416 ND_rank(v, i);
1417 }
1418 }
1419 } finally {
1420 LEAVING("1oobmglea9t819y95xeel37h8","set_xcoords");
1421 }
1422 }
1423
1424
1425
1426
1427 //3 6mip7s1k9xt9tp6x6nnsbt34p
1428 // static void adjustSimple(graph_t * g, int delta, int margin_total)
1429 public static Object adjustSimple(Object... arg) {
1430 UNSUPPORTED("6b5zs45snahyh3bzod53vasjx"); // static void adjustSimple(graph_t * g, int delta, int margin_total)
1431 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1432 UNSUPPORTED("4dxxcgj8emjoyp2vlrcw5xmwl"); // int r, bottom, deltop, delbottom;
1433 UNSUPPORTED("6i5o0pm41tgebv48wcngsxwqd"); // graph_t *root = dot_root(g);
1434 UNSUPPORTED("2clvms28da6dp56nhcz1fw6l8"); // rank_t *rank = GD_rank(root);
1435 UNSUPPORTED("3fkjf35jwcy291suh6fv3lnu"); // int maxr = GD_maxrank(g);
1436 UNSUPPORTED("be5w8b0upg8swanznmjl6ml56"); // int minr = GD_minrank(g);
1437 UNSUPPORTED("enzyy8zeeg6bsgsuwm86u5bwb"); // bottom = (delta+1) / 2;
1438 UNSUPPORTED("9jp6b6z7el15spss761fh4rgx"); // delbottom = GD_ht1(g) + bottom - (rank[maxr].ht1 - margin_total);
1439 UNSUPPORTED("ckra1b9nceo8q21bwo5iu3rap"); // if (delbottom > 0) {
1440 UNSUPPORTED("3jotxrk6oermksl3is78mj0e2"); // for (r = maxr; r >= minr; r--) {
1441 UNSUPPORTED("b905w55w58349wk9aktevaljm"); // if (rank[r].n > 0)
1442 UNSUPPORTED("bjuzvkc8hhlni54hkaef0j0xa"); // ND_coord(rank[r].v[0]).y += delbottom;
1443 UNSUPPORTED("e9yhkch195gia8gdiu6vb4rbn"); // }
1444 UNSUPPORTED("bdmop8bk7tvltc7z16xj07kqn"); // deltop = GD_ht2(g) + (delta-bottom) + delbottom - (rank[minr].ht2 - margin_total);
1445 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1446 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
1447 UNSUPPORTED("cw3vv20i8np95bafexnuhhpdg"); // deltop = GD_ht2(g) + (delta-bottom) - (rank[minr].ht2 - margin_total);
1448 UNSUPPORTED("49prm57gvpenehfkcxz9xuxu4"); // if (deltop > 0) {
1449 UNSUPPORTED("axexjgvfow9k3x1l6j2my6cd"); // for (r = minr-1; r >= GD_minrank(root); r--) {
1450 UNSUPPORTED("b905w55w58349wk9aktevaljm"); // if (rank[r].n > 0)
1451 UNSUPPORTED("1nebaz06hwqknqrqcnwf03z2"); // ND_coord(rank[r].v[0]).y += deltop;
1452 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1453 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1454 UNSUPPORTED("7o49wizb9vp55xhz88lycavep"); // GD_ht2(g) += (delta - bottom);
1455 UNSUPPORTED("4mq1sot7a9bxpobj9602hyyl5"); // GD_ht1(g) += bottom;
1456 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1457
1458 throw new UnsupportedOperationException();
1459 }
1460
1461
1462
1463
1464 //3 9sv968rni5moio662r9kjzai3
1465 // static void adjustRanks(graph_t * g, int margin_total)
1466 public static Object adjustRanks(Object... arg) {
1467 UNSUPPORTED("47ywar141vmwjartmboxs38cz"); // static void adjustRanks(graph_t * g, int margin_total)
1468 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1469 UNSUPPORTED("cbyzaxb8pmtp6lo2y4tajk45s"); // double lht; /* label height */
1470 UNSUPPORTED("3r7yt838qvvliagprkv30uka1"); // double rht; /* height between top and bottom ranks */
1471 UNSUPPORTED("n5e6qzpiyv4zvlemheyvbky7"); // int maxr, minr, margin;
1472 UNSUPPORTED("53xzwretgdbd0atozc0w6hagb"); // int c;
1473 UNSUPPORTED("7p11k11wgq46szos3u4lfa5a4"); // double delta, ht1, ht2;
1474 UNSUPPORTED("39w5issxrjmte1dn2qnt8gpbj"); // rank_t *rank = GD_rank(dot_root(g));
1475 UNSUPPORTED("aerooskq9gwysw6euktdqjmaq"); // if (g == dot_root(g))
1476 UNSUPPORTED("8tm7x791luf0uq7v2q53kfuqk"); // margin = 0;
1477 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
1478 UNSUPPORTED("182pb9igel0aoytgtoiguek4x"); // margin = late_int (g, G_margin, 8, 0);
1479 UNSUPPORTED("8bcey7cvczgf3t3ominh7ye1b"); // ht1 = GD_ht1(g);
1480 UNSUPPORTED("1ac5605x86vam4z4spx361rpd"); // ht2 = GD_ht2(g);
1481 UNSUPPORTED("99d9j6m0161wdv2tu4wbf3ifi"); // for (c = 1; c <= GD_n_cluster(g); c++) {
1482 UNSUPPORTED("6wacplh886lzcey0jjkfo5jcn"); // graph_t *subg = GD_clust(g)[c];
1483 UNSUPPORTED("6jkyxr322md2frf0pic57ak6e"); // adjustRanks(subg, margin+margin_total);
1484 UNSUPPORTED("41b09kckthwa070wznf9tneej"); // if (GD_maxrank(subg) == GD_maxrank(g))
1485 UNSUPPORTED("7gbj2fwymn5k7pywbjc1kbhmb"); // ht1 = MAX(ht1, GD_ht1(subg) + margin);
1486 UNSUPPORTED("clsf4pg9bdlkzghw3oq7fpo7c"); // if (GD_minrank(subg) == GD_minrank(g))
1487 UNSUPPORTED("9vmpt65t8kavsz1zoorcr5ik"); // ht2 = MAX(ht2, GD_ht2(subg) + margin);
1488 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1489 UNSUPPORTED("9lx88c3pk4z5zxca5orq7v2yf"); // GD_ht1(g) = ht1;
1490 UNSUPPORTED("2p0gs3kpty9mg9ymk70kjekh0"); // GD_ht2(g) = ht2;
1491 UNSUPPORTED("34p29mvxtmpuzcgzh4s03lixs"); // if ((g != dot_root(g)) && GD_label(g)) {
1492 UNSUPPORTED("ak9x1j2bu2d8zr8tls942u42r"); // lht = MAX(GD_border(g)[3].y, GD_border(g)[1].y);
1493 UNSUPPORTED("ehkev01oc7ynzwkbjbzclaqj6"); // maxr = GD_maxrank(g);
1494 UNSUPPORTED("2906nnve3dmqroo2jsq13wfex"); // minr = GD_minrank(g);
1495 UNSUPPORTED("8s9tksg226ob1ti8o5ljo1gbg"); // rht = ND_coord(rank[minr].v[0]).y - ND_coord(rank[maxr].v[0]).y;
1496 UNSUPPORTED("b0dxtg7jama7mgqccujsbb97n"); // delta = lht - (rht + ht1 + ht2);
1497 UNSUPPORTED("bfapr2l9berlmq4ubgk0zp7qf"); // if (delta > 0) {
1498 UNSUPPORTED("3zllny0pp0nf7gzw7829oqexo"); // adjustSimple(g, delta, margin_total);
1499 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1500 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1501 UNSUPPORTED("a86aoq62oyhhkqpyzz0um3pvq"); // /* update the global ranks */
1502 UNSUPPORTED("1pmq9pca155672xcv1ow2cbfy"); // if (g != dot_root(g)) {
1503 UNSUPPORTED("1kgp3b6qifeit9n2i2k8oc8qv"); // rank[GD_minrank(g)].ht2 = MAX(rank[GD_minrank(g)].ht2, GD_ht2(g));
1504 UNSUPPORTED("8f7gccnlt6m8v3k1ijaznaew3"); // rank[GD_maxrank(g)].ht1 = MAX(rank[GD_maxrank(g)].ht1, GD_ht1(g));
1505 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1506 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1507
1508 throw new UnsupportedOperationException();
1509 }
1510
1511
1512
1513
1514 //3 emtrqv582hdma5aajqtjd76m1
1515 // static int clust_ht(Agraph_t * g)
1516 public static int clust_ht(ST_Agraph_s g) {
1517 ENTERING("emtrqv582hdma5aajqtjd76m1","clust_ht");
1518 try {
1519 int c;
1520 double ht1, ht2;
1521 ST_Agraph_s subg;
1522 ST_rank_t.Array2 rank = GD_rank(dot_root(g));
1523 int margin, haveClustLabel = 0;
1524 if (EQ(g, dot_root(g)))
1525 margin = 8;
1526 else
1527 margin = late_int (g, Z.z().G_margin, 8, 0);
1528 ht1 = GD_ht1(g);
1529 ht2 = GD_ht2(g);
1530 /* account for sub-clusters */
1531 for (c = 1; c <= GD_n_cluster(g); c++) {
1532 subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
1533 haveClustLabel |= clust_ht(subg);
1534 if (GD_maxrank(subg) == GD_maxrank(g))
1535 ht1 = MAX(ht1, GD_ht1(subg) + margin);
1536 if (GD_minrank(subg) == GD_minrank(g))
1537 ht2 = MAX(ht2, GD_ht2(subg) + margin);
1538 }
1539 /* account for a possible cluster label in clusters */
1540 /* room for root graph label is handled in dotneato_postprocess */
1541 if (NEQ(g, dot_root(g)) && GD_label(g)!=null) {
1542 haveClustLabel = 1;
1543 if (N(GD_flip(agroot(g)))) {
1544 ht1 += GD_border(g)[0].y;
1545 ht2 += GD_border(g)[2].y;
1546 }
1547 }
1548 GD_ht1(g, ht1);
1549 GD_ht2(g, ht2);
1550 /* update the global ranks */
1551 if (NEQ(g, dot_root(g))) {
1552 rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.get(GD_minrank(g)).ht2, ht2));
1553 rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.get(GD_maxrank(g)).ht1, ht1));
1554 }
1555 return haveClustLabel;
1556 } finally {
1557 LEAVING("emtrqv582hdma5aajqtjd76m1","clust_ht");
1558 }
1559 }
1560
1561
1562
1563
1564 //3 bp8vmol4ncadervcfossysdtd
1565 // static void set_ycoords(graph_t * g)
1566 public static void set_ycoords(ST_Agraph_s g) {
1567 ENTERING("bp8vmol4ncadervcfossysdtd","set_ycoords");
1568 try {
1569 int i, j, r;
1570 double ht2, maxht, delta, d0, d1;
1571 ST_Agnode_s n;
1572 ST_Agedge_s e;
1573 ST_rank_t.Array2 rank = GD_rank(g);
1574 ST_Agraph_s clust;
1575 int lbl;
1576 ht2 = maxht = 0;
1577 /* scan ranks for tallest nodes. */
1578 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1579 for (i = 0; i < rank.get(r).n; i++) {
1580 n = (ST_Agnode_s) rank.get(r).v.get(i);
1581 /* assumes symmetry, ht1 = ht2 */
1582 ht2 = ND_ht(n) / 2;
1583 /* have to look for high self-edge labels, too */
1584 if (ND_other(n).listNotNull())
1585 for (j = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(j))!=null; j++) {
1586 if (EQ(agtail(e), aghead(e))) {
1587 if (ED_label(e)!=null)
1588 ht2 = MAX(ht2, ED_label(e).dimen.y / 2);
1589 }
1590 }
1591 /* update global rank ht */
1592 if (rank.get(r).pht2 < ht2) {
1593 rank.plus(r).setDouble("ht2", ht2);
1594 rank.plus(r).setDouble("pht2", ht2);
1595 }
1596 if (rank.get(r).pht1 < ht2) {
1597 rank.plus(r).setDouble("ht1", ht2);
1598 rank.plus(r).setDouble("pht1", ht2);
1599 }
1600 /* update nearest enclosing cluster rank ht */
1601 if ((clust = ND_clust(n))!=null) {
1602 int yoff = (clust == g ? 0 : late_int (clust, Z.z().G_margin, 8, 0));
1603 if (ND_rank(n) == GD_minrank(clust))
1604 GD_ht2(clust, MAX(GD_ht2(clust), ht2 + yoff));
1605 if (ND_rank(n) == GD_maxrank(clust))
1606 GD_ht1(clust, MAX(GD_ht1(clust), ht2 + yoff));
1607 }
1608 }
1609 }
1610 /* scan sub-clusters */
1611 lbl = clust_ht(g);
1612 /* make the initial assignment of ycoords to leftmost nodes by ranks */
1613 maxht = 0;
1614 r = GD_maxrank(g);
1615 (ND_coord(rank.get(r).v.get(0))).setDouble("y", rank.get(r).ht1);
1616 while (--r >= GD_minrank(g)) {
1617 d0 = rank.get(r + 1).pht2 + rank.get(r).pht1 + GD_ranksep(g); /* prim node sep */
1618 d1 = rank.get(r + 1).ht2 + rank.get(r).ht1 + 8; /* cluster sep */
1619 delta = MAX(d0, d1);
1620 if (rank.get(r).n > 0) /* this may reflect some problem */
1621 (ND_coord(rank.get(r).v.get(0))).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.get(0))).y + delta);
1622 maxht = MAX(maxht, delta);
1623 }
1624 /* If there are cluster labels and the drawing is rotated, we need special processing to
1625 * allocate enough room. We use adjustRanks for this, and then recompute the maxht if
1626 * the ranks are to be equally spaced. This seems simpler and appears to work better than
1627 * handling equal spacing as a special case.
1628 */
1629 if (lbl!=0 && GD_flip(g)!=0) {
1630 UNSUPPORTED("bxjqk5nu40mwo1156dicr9tur"); // adjustRanks(g, 0);
1631 UNSUPPORTED("6vy9qfed3u61pmvy12724s9l4"); // if (GD_exact_ranksep(g)) { /* recompute maxht */
1632 UNSUPPORTED("74f5n6u4x39ngn0gsan7fgzyr"); // maxht = 0;
1633 UNSUPPORTED("2pd9g1n9b0746fgt892degls3"); // r = GD_maxrank(g);
1634 UNSUPPORTED("8dils3hlxottsbf2iuapvhqeq"); // d0 = (ND_coord(rank[r].v[0])).y;
1635 UNSUPPORTED("cw5accmrcan3lqfc789udgcka"); // while (--r >= GD_minrank(g)) {
1636 UNSUPPORTED("6bxo7bknt38qh9t31zr7p6kie"); // d1 = (ND_coord(rank[r].v[0])).y;
1637 UNSUPPORTED("b1ta7vjm5i7swyklhfwy27w35"); // delta = d1 - d0;
1638 UNSUPPORTED("65l8hg0imd48bfdu614k2kylt"); // maxht = MAX(maxht, delta);
1639 UNSUPPORTED("5irf6cp6xdzi2ik033azsbauo"); // d0 = d1;
1640 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1641 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1642 }
1643 /* re-assign if ranks are equally spaced */
1644 if (GD_exact_ranksep(g)!=0) {
1645 UNSUPPORTED("cyxbyjrdzywkc46nl8lkrngai"); // for (r = GD_maxrank(g) - 1; r >= GD_minrank(g); r--)
1646 UNSUPPORTED("5sd5ltavyp6llt0t2t0xmqwj5"); // if (rank[r].n > 0) /* this may reflect the same problem :-() */
1647 UNSUPPORTED("5zoeqpznt31feqxjcx2rg0o1f"); // (ND_coord(rank[r].v[0])).y=
1648 UNSUPPORTED("e6dfx5uesysjaefb0djyfp7f"); // (ND_coord(rank[r + 1].v[0])).y + maxht;
1649 }
1650 /* copy ycoord assignment from leftmost nodes to others */
1651 for (n = GD_nlist(g); n!=null; n = ND_next(n))
1652 ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.get(0)).y;
1653 } finally {
1654 LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords");
1655 }
1656 }
1657
1658
1659
1660
1661 //3 9ay2xnnmh407i32pfokujfda5
1662 //static void dot_compute_bb(graph_t * g, graph_t * root)
1663 public static void dot_compute_bb(ST_Agraph_s g, ST_Agraph_s root) {
1664 ENTERING("9ay2xnnmh407i32pfokujfda5","dot_compute_bb");
1665 try {
1666 int r, c;
1667 double x, offset;
1668 ST_Agnode_s v;
1669 final ST_pointf LL = new ST_pointf();
1670 final ST_pointf UR = new ST_pointf();
1671 if (EQ(g, dot_root(g))) {
1672 LL.x = INT_MAX;
1673 UR.x = -((double)INT_MAX);
1674 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1675 int rnkn = GD_rank(g).get(r).n;
1676 if (rnkn == 0)
1677 continue;
1678 if ((v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0)) == null)
1679 continue;
1680 for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++)
1681 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
1682 if (ND_node_type(v) == 0) {
1683 x = ND_coord(v).x - ND_lw(v);
1684 LL.setDouble("x", MIN(LL.x, x));
1685 }
1686 else continue;
1687 /* At this point, we know the rank contains a NORMAL node */
1688 v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(rnkn - 1).getPtr();
1689 for (c = rnkn-2; ND_node_type(v) != 0; c--)
1690 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
1691 x = ND_coord(v).x + ND_rw(v);
1692 UR.x = MAX(UR.x, x);
1693 }
1694 offset = 8;
1695 for (c = 1; c <= GD_n_cluster(g); c++) {
1696 x = (double)(GD_bb(GD_clust(g).plus(c)).LL.x - offset);
1697 LL.x = MIN(LL.x, x);
1698 x = (double)(GD_bb(GD_clust(g).plus(c)).UR.x + offset);
1699 UR.x = MAX(UR.x, x);
1700 }
1701 } else {
1702 LL.x = (double)(ND_rank(GD_ln(g)));
1703 UR.x = (double)(ND_rank(GD_rn(g)));
1704 }
1705 LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.get(0)).y - GD_ht1(g);
1706 UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getPtr().v.get(0)).y + GD_ht2(g);
1707 GD_bb(g).setStruct("LL", LL);
1708 GD_bb(g).setStruct("UR", UR);
1709 } finally {
1710 LEAVING("9ay2xnnmh407i32pfokujfda5","dot_compute_bb");
1711 }
1712 }
1713
1714
1715
1716
1717
1718 //3 dlbpiimh9g9ff9w7wjoabf817
1719 // static void rec_bb(graph_t * g, graph_t * root)
1720 public static void rec_bb(ST_Agraph_s g, ST_Agraph_s root) {
1721 ENTERING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
1722 try {
1723 int c;
1724 for (c = 1; c <= GD_n_cluster(g); c++)
1725 rec_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), root);
1726 dot_compute_bb(g, root);
1727 } finally {
1728 LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
1729 }
1730 }
1731
1732
1733
1734
1735 //3 2p3nacev7k2jft9xov90nke50
1736 // static void scale_bb(graph_t * g, graph_t * root, double xf, double yf)
1737 public static Object scale_bb(Object... arg) {
1738 UNSUPPORTED("9zkkf6x8cj12vuzqrjaoxfn8s"); // static void scale_bb(graph_t * g, graph_t * root, double xf, double yf)
1739 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1740 UNSUPPORTED("53xzwretgdbd0atozc0w6hagb"); // int c;
1741 UNSUPPORTED("7z5fb6iyowsosn1hiz7opeoc6"); // for (c = 1; c <= GD_n_cluster(g); c++)
1742 UNSUPPORTED("7leh3r5v7roon4liia73wue7e"); // scale_bb(GD_clust(g)[c], root, xf, yf);
1743 UNSUPPORTED("duz0iqmos1i372cztpjtsemab"); // GD_bb(g).LL.x *= xf;
1744 UNSUPPORTED("ja25041s2x99bhwj5wcliok0"); // GD_bb(g).LL.y *= yf;
1745 UNSUPPORTED("7mpnp4j7m1ymn1zdbxzeh5xxd"); // GD_bb(g).UR.x *= xf;
1746 UNSUPPORTED("4ahigy1a10wsl6lvc90lpax5e"); // GD_bb(g).UR.y *= yf;
1747 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1748
1749 throw new UnsupportedOperationException();
1750 }
1751
1752
1753
1754
1755 //3 53z9yhpfixulhgqsauulkllvc
1756 // static void adjustAspectRatio (graph_t* g, aspect_t* asp)
1757 public static Object adjustAspectRatio(Object... arg) {
1758 UNSUPPORTED("ezldb6r0csirv1fmkq5itw1v2"); // static void adjustAspectRatio (graph_t* g, aspect_t* asp)
1759 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1760 UNSUPPORTED("7rtldqefvdgcf4u50kulbxtvn"); // double AR = (GD_bb(g).UR.x - GD_bb(g).LL.x)/(GD_bb(g).UR.y - GD_bb(g).LL.y);
1761 UNSUPPORTED("cve2on8gll5i0vomy8lnwhai2"); // if (Verbose) {
1762 UNSUPPORTED("6z0q1m3yc6o11ejsa59eghqag"); // fprintf(stderr, "AR=%0.4lf\t Area= %0.4lf\t", AR, (double)(GD_bb(g).UR.x - GD_bb(g).LL.x)*(GD_bb(g).UR.y - GD_bb(g).LL.y)/10000.0);
1763 UNSUPPORTED("2uealcdkjdgg8ne1cijkbagpu"); // fprintf(stderr, "Dummy=%d\n", countDummyNodes(g));
1764 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1765 UNSUPPORTED("96mqnzcfbfghxkxkn1x8kdh8i"); // if (AR > 1.1*asp->targetAR) {
1766 UNSUPPORTED("6gq7uj15zh138zyae50c8nh2z"); // asp->nextIter = (int)(asp->targetAR * (double)(asp->curIterations - asp->prevIterations)/(AR));
1767 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1768 UNSUPPORTED("e1443w2cx49ogpsf5m59zy4fq"); // else if (AR <= 0.8 * asp->targetAR) {
1769 UNSUPPORTED("5awa0x1pxpta5wou27bzrtvoc"); // asp->nextIter = -1;
1770 UNSUPPORTED("5xdo0sx20rmxgmdkrm1giaige"); // if (Verbose)
1771 UNSUPPORTED("du5ztjo6nfo54ailmk1tqs05b"); // fprintf(stderr, "Going to apply another expansion.\n");
1772 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1773 UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
1774 UNSUPPORTED("757eq4638npmb5w5e39iemxfo"); // asp->nextIter = 0;
1775 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1776 UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
1777 UNSUPPORTED("29wdml7g4931q8kgah8hgwjd0"); // fprintf(stderr, "next#iter=%d\n", asp->nextIter);
1778 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1779
1780 throw new UnsupportedOperationException();
1781 }
1782
1783
1784
1785
1786 //3 7effq6z6ur101wrch6ttozr26
1787 // static void set_aspect(graph_t * g, aspect_t* asp)
1788 public static void set_aspect(ST_Agraph_s g, ST_aspect_t asp) {
1789 ENTERING("7effq6z6ur101wrch6ttozr26","set_aspect");
1790 try {
1791 double xf = 0.0, yf = 0.0, actual, desired;
1792 ST_Agnode_s n;
1793 boolean scale_it, filled;
1794 ST_point sz = new ST_point();
1795 rec_bb(g, g);
1796 if ((GD_maxrank(g) > 0) && (GD_drawing(g).ratio_kind!=0)) {
1797 UNSUPPORTED("5wbmy4x78flo2ztfabki9lyjf"); // sz.x = GD_bb(g).UR.x - GD_bb(g).LL.x;
1798 UNSUPPORTED("catd6eu5oc282ln95k9zz52f3"); // sz.y = GD_bb(g).UR.y - GD_bb(g).LL.y; /* normalize */
1799 UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) {
1800 UNSUPPORTED("d55uzald1tvs7xodnua67pxv6"); // int t = sz.x;
1801 UNSUPPORTED("47s1klx0pfzda4e311w53ou7e"); // sz.x = sz.y;
1802 UNSUPPORTED("3tx1mj7j0rqw33y24a0gu4ali"); // sz.y = t;
1803 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1804 UNSUPPORTED("4ct8ztqxnsskgphsp1v3aw5ec"); // scale_it = NOT(0);
1805 UNSUPPORTED("8v772n1u4wqlmskqfswlzcz2o"); // if (GD_drawing(g)->ratio_kind == R_AUTO)
1806 UNSUPPORTED("8mtmgag5dxj8ttlcabbpd865p"); // filled = idealsize(g, .5);
1807 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
1808 UNSUPPORTED("bxtk5e5ls8qsd36eucvhufg9y"); // filled = (GD_drawing(g)->ratio_kind == R_FILL);
1809 UNSUPPORTED("2atgu691bmn6h9jvk8lve5qzc"); // if (filled) {
1810 UNSUPPORTED("1zx5etcjofceqjvogfn8urkdj"); // /* fill is weird because both X and Y can stretch */
1811 UNSUPPORTED("7ezqjon4u21dwg4qvxssrnwfc"); // if (GD_drawing(g)->size.x <= 0)
1812 UNSUPPORTED("dao0fnoi65upcdtr9csqhhy41"); // scale_it = 0;
1813 UNSUPPORTED("6q044im7742qhglc4553noina"); // else {
1814 UNSUPPORTED("6ifkww34s7php908n9wg0oiju"); // xf = (double) GD_drawing(g)->size.x / (double) sz.x;
1815 UNSUPPORTED("6faiikvxwdge2ydblv90976hb"); // yf = (double) GD_drawing(g)->size.y / (double) sz.y;
1816 UNSUPPORTED("5xkzvdrdnfd5afhhxgajbywya"); // if ((xf < 1.0) || (yf < 1.0)) {
1817 UNSUPPORTED("cvkvyq93xp1itpomhj1r2xlzy"); // if (xf < yf) {
1818 UNSUPPORTED("capfpf4tncicsp81elmwvf0l"); // yf = yf / xf;
1819 UNSUPPORTED("7sdzyzqj65rbq6edfgf5x6xht"); // xf = 1.0;
1820 UNSUPPORTED("d86r93g8nz9a1kfzgi7f8j8nh"); // } else {
1821 UNSUPPORTED("emwaipsi6kyqbpk2y26k3cxfw"); // xf = xf / yf;
1822 UNSUPPORTED("1s91x56ftedjsc3m32dqgspqn"); // yf = 1.0;
1823 UNSUPPORTED("dkxvw03k2gg9anv4dbze06axd"); // }
1824 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
1825 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1826 UNSUPPORTED("c48w89y9jw5baxqqucmiyfha7"); // } else if (GD_drawing(g)->ratio_kind == R_EXPAND) {
1827 UNSUPPORTED("7ezqjon4u21dwg4qvxssrnwfc"); // if (GD_drawing(g)->size.x <= 0)
1828 UNSUPPORTED("dao0fnoi65upcdtr9csqhhy41"); // scale_it = 0;
1829 UNSUPPORTED("6q044im7742qhglc4553noina"); // else {
1830 UNSUPPORTED("akfs904fsk7cyl8wbv0x7fnvz"); // xf = (double) GD_drawing(g)->size.x /
1831 UNSUPPORTED("1ewqbc4kglc2kg1n13euxrxzh"); // (double) GD_bb(g).UR.x;
1832 UNSUPPORTED("6fmkpg9ypaxceugi24gklvdra"); // yf = (double) GD_drawing(g)->size.y /
1833 UNSUPPORTED("8mskb0mqou89myfbiihsjpbg6"); // (double) GD_bb(g).UR.y;
1834 UNSUPPORTED("a2jzgqbpoanzqdqc7vjk32vmz"); // if ((xf > 1.0) && (yf > 1.0)) {
1835 UNSUPPORTED("6np8qfg5qnlaypikhw0bdx84j"); // double scale = MIN(xf, yf);
1836 UNSUPPORTED("272bmuv1row7l9tla5bhot840"); // xf = yf = scale;
1837 UNSUPPORTED("738mi6h8ef0itznt34ngxe25o"); // } else
1838 UNSUPPORTED("b5qs3ho2fcywk3sd5cw3m88kw"); // scale_it = 0;
1839 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1840 UNSUPPORTED("d7deewhp6akdb13j7ry364hbd"); // } else if (GD_drawing(g)->ratio_kind == R_VALUE) {
1841 UNSUPPORTED("fpejwrlknxizaxxibhuyaxdt"); // desired = GD_drawing(g)->ratio;
1842 UNSUPPORTED("douwz2voka0puoeooqjn8kijk"); // actual = ((double) sz.y) / ((double) sz.x);
1843 UNSUPPORTED("7u9yvuqazzo19geppiphd9rfh"); // if (actual < desired) {
1844 UNSUPPORTED("apqq3m2rezfl96zbvk7lut02"); // yf = desired / actual;
1845 UNSUPPORTED("8po0oizki4figodjv9xku16gq"); // xf = 1.0;
1846 UNSUPPORTED("175pyfe8j8mbhdwvrbx3gmew9"); // } else {
1847 UNSUPPORTED("84c3pp9xgnii11clyyxblqmy6"); // xf = actual / desired;
1848 UNSUPPORTED("1tr1b9rp1b00pcafss87kadfe"); // yf = 1.0;
1849 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1850 UNSUPPORTED("6to1esmb8qfrhzgtr7jdqleja"); // } else
1851 UNSUPPORTED("csvnhx5mo535o6ue1tg3ktjhs"); // scale_it = 0;
1852 UNSUPPORTED("bh2d68e9s7cr7k1bl0h9fmr9a"); // if (scale_it) {
1853 UNSUPPORTED("b8symsgdtoq84y3j1151pv0g4"); // if (GD_flip(g)) {
1854 UNSUPPORTED("bi983gfofc0blj8r4yetj14kb"); // double t = xf;
1855 UNSUPPORTED("69pmocxfvmk0urni4fg0x4na5"); // xf = yf;
1856 UNSUPPORTED("cyt895z1pa5arxz4d1kv0hqgq"); // yf = t;
1857 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1858 UNSUPPORTED("crtcqz91ff5l8ntjbne40b5x4"); // for (n = GD_nlist(g); n; n = ND_next(n)) {
1859 UNSUPPORTED("brs6nych5z9m0a75ixbe5l80o"); // ND_coord(n).x = ROUND(ND_coord(n).x * xf);
1860 UNSUPPORTED("cpe0pjsilppgrp2ofysn4y54w"); // ND_coord(n).y = ROUND(ND_coord(n).y * yf);
1861 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1862 UNSUPPORTED("8f0d3etdet1pk8ikvltmz5h2s"); // scale_bb(g, g, xf, yf);
1863 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1864 }
1865 if (asp!=null) adjustAspectRatio (g, asp);
1866 } finally {
1867 LEAVING("7effq6z6ur101wrch6ttozr26","set_aspect");
1868 }
1869 }
1870
1871
1872
1873
1874 //3 41mmud7cyx1rwhd0k7g7weaf8
1875 // static point resize_leaf(node_t * leaf, point lbound)
1876 public static Object resize_leaf(Object... arg) {
1877 UNSUPPORTED("alcqddrml4aj55twvzwyyvfjh"); // static point resize_leaf(node_t * leaf, point lbound)
1878 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1879 UNSUPPORTED("dnj5vqe4cb2yzzx75ubwrxvav"); // gv_nodesize(leaf, GD_flip(agraphof(leaf)));
1880 UNSUPPORTED("bxig9t3r62l84xejntt3x96kv"); // ND_coord(leaf).y = lbound.y;
1881 UNSUPPORTED("bx00ps5hied5a63922sqqpvhi"); // ND_coord(leaf).x = lbound.x + ND_lw(leaf);
1882 UNSUPPORTED("euhijhn76fi66yqoh8gxk5nq0"); // lbound.x = lbound.x + ND_lw(leaf) + ND_rw(leaf) + GD_nodesep(agraphof(leaf));
1883 UNSUPPORTED("1xmj5l8g8znua01mljujyh61i"); // return lbound;
1884 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1885
1886 throw new UnsupportedOperationException();
1887 }
1888
1889
1890
1891
1892 //3 4jx34mwc4aby8v45omelmfluv
1893 // static point place_leaf(graph_t* ing, node_t * leaf, point lbound, int order)
1894 public static Object place_leaf(Object... arg) {
1895 UNSUPPORTED("cetlk9m8mjd69vuru3rjho0lw"); // static point place_leaf(graph_t* ing, node_t * leaf, point lbound, int order)
1896 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1897 UNSUPPORTED("b1ht34ftmnpsuxflrqun4ptkr"); // node_t *leader;
1898 UNSUPPORTED("aqfu9qyb55o3lehhaqmxag540"); // graph_t *g = dot_root(ing);
1899 UNSUPPORTED("1b5u4ut4j70lu60geogmkv572"); // leader = UF_find(leaf);
1900 UNSUPPORTED("3urvo2e4w7312r8scg44o0hqw"); // if (leaf != leader)
1901 UNSUPPORTED("azdkjz4shu49j3fzjpazxrpwz"); // fast_nodeapp(leader, leaf);
1902 UNSUPPORTED("95h5y689udztblrtgdwc8y2ei"); // ND_order(leaf) = order;
1903 UNSUPPORTED("cvsh6pf3vxzxd2zn1u8ykd8hx"); // ND_rank(leaf) = ND_rank(leader);
1904 UNSUPPORTED("6k8r94a4chbol18r2rnbi9haj"); // GD_rank(g)[ND_rank(leaf)].v[ND_order(leaf)] = leaf;
1905 UNSUPPORTED("7ku2dbhi28rhi6dtag1v4zung"); // return resize_leaf(leaf, lbound);
1906 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1907
1908 throw new UnsupportedOperationException();
1909 }
1910
1911
1912
1913
1914 //3 1lejhh3evsa10auyj7cgqj8ub
1915 // static void make_leafslots(graph_t * g)
1916 public static void make_leafslots(ST_Agraph_s g) {
1917 ENTERING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
1918 try {
1919 int i, j, r;
1920 ST_Agnode_s v;
1921 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1922 j = 0;
1923 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1924 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
1925 ND_order(v, j);
1926 if (ND_ranktype(v) == 6)
1927 j = j + ND_UF_size(v);
1928 else
1929 j++;
1930 }
1931 if (j <= GD_rank(g).get(r).n)
1932 continue;
1933 GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v, j + 1));
1934 for (i = GD_rank(g).get(r).n - 1; i >= 0; i--) {
1935 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
1936 GD_rank(g).get(r).v.plus(ND_order(v)).setPtr(v);
1937 }
1938 GD_rank(g).plus(r).setInt("n", j);
1939 GD_rank(g).get(r).v.plus(j).setPtr(null);
1940 }
1941 } finally {
1942 LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
1943 }
1944 }
1945
1946
1947
1948
1949 //3 wb2wvxthkr2sp9u8113go3j3
1950 // static void do_leaves(graph_t * g, node_t * leader)
1951 public static Object do_leaves(Object... arg) {
1952 UNSUPPORTED("5nmyuqyhfqfwbmgdj5aot9fp4"); // static void do_leaves(graph_t * g, node_t * leader)
1953 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1954 UNSUPPORTED("2bs0wcp6367dz1o5x166ec7l8"); // int j;
1955 UNSUPPORTED("4bxv0pw87c31sbbz6x6s1cq9d"); // point lbound;
1956 UNSUPPORTED("cjx5v6hayed3q8eeub1cggqca"); // node_t *n;
1957 UNSUPPORTED("5gypxs09iuryx5a2eho9lgdcp"); // edge_t *e;
1958 UNSUPPORTED("b9upgllg8zjx49090hr3afv91"); // if (ND_UF_size(leader) <= 1)
1959 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
1960 UNSUPPORTED("9m0hiwybw3dr0lcxmgq833heo"); // lbound.x = ND_coord(leader).x - ND_lw(leader);
1961 UNSUPPORTED("ev0phf24gpqz3xtvtueq72f7g"); // lbound.y = ND_coord(leader).y;
1962 UNSUPPORTED("90r9xqe4faj7b1g8907ord1x3"); // lbound = resize_leaf(leader, lbound);
1963 UNSUPPORTED("66ue8mvk3axhgbkcg3xqo94tb"); // if (ND_out(leader).size > 0) { /* in-edge leaves */
1964 UNSUPPORTED("9lq5udq73fgfeqyqsxw6i3pgm"); // n = aghead(ND_out(leader).list[0]);
1965 UNSUPPORTED("4vp9ny4udt1jcmibfgpwgrnqo"); // j = ND_order(leader) + 1;
1966 UNSUPPORTED("3ml0tasns5tz6d5xc2xdb6nc"); // for (e = agfstin(g, n); e; e = agnxtin(g, e)) {
1967 UNSUPPORTED("e2y71fdc15yxylowp6ohlal9a"); // edge_t *e1 = AGMKOUT(e);
1968 UNSUPPORTED("ew4udmdawt257gbk5kzmi1n1"); // if ((agtail(e1) != leader) && (UF_find(agtail(e1)) == leader)) {
1969 UNSUPPORTED("d2r94m7xk4qa9hn6s2td5nb6h"); // lbound = place_leaf(g, agtail(e1), lbound, j++);
1970 UNSUPPORTED("5xk9d4ra447xucksge6c9mgos"); // unmerge_oneway(e1);
1971 UNSUPPORTED("4dqun0n52lcyerkebva2hxh15"); // elist_append(e1, ND_in(aghead(e1)));
1972 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1973 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1974 UNSUPPORTED("6owoaz61uf3928omhuf3rqjoa"); // } else { /* out edge leaves */
1975 UNSUPPORTED("4lbkem8hb4jy3gdg6nt3cbtl9"); // n = agtail(ND_in(leader).list[0]);
1976 UNSUPPORTED("4vp9ny4udt1jcmibfgpwgrnqo"); // j = ND_order(leader) + 1;
1977 UNSUPPORTED("e20lm4qtccvgsfq5fzjv6sjyl"); // for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
1978 UNSUPPORTED("38a98cy0214odvsa98hgyce8q"); // if ((aghead(e) != leader) && (UF_find(aghead(e)) == leader)) {
1979 UNSUPPORTED("9j9o79r2bdc6npidu38aq0cym"); // lbound = place_leaf(g, aghead(e), lbound, j++);
1980 UNSUPPORTED("6wbwzuqqh5vxume7ga2kuejcf"); // unmerge_oneway(e);
1981 UNSUPPORTED("dv9vv9pfcd3cibfjn258toxyv"); // elist_append(e, ND_out(agtail(e)));
1982 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1983 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1984 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1985 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1986
1987 throw new UnsupportedOperationException();
1988 }
1989
1990
1991
1992
1993 //3 alpljm8o6nsam95ly6leelnbp
1994 // int ports_eq(edge_t * e, edge_t * f)
1995 public static boolean ports_eq(ST_Agedge_s e, ST_Agedge_s f) {
1996 ENTERING("alpljm8o6nsam95ly6leelnbp","ports_eq");
1997 try {
1998 return ((ED_head_port(e).defined == ED_head_port(f).defined)
1999 && (((ED_head_port(e).p.x == ED_head_port(f).p.x) &&
2000 (ED_head_port(e).p.y == ED_head_port(f).p.y))
2001 || (ED_head_port(e).defined == 0))
2002 && (((ED_tail_port(e).p.x == ED_tail_port(f).p.x) &&
2003 (ED_tail_port(e).p.y == ED_tail_port(f).p.y))
2004 || (ED_tail_port(e).defined == 0))
2005 );
2006 } finally {
2007 LEAVING("alpljm8o6nsam95ly6leelnbp","ports_eq");
2008 }
2009 }
2010
2011
2012
2013
2014 //3 cfotmdif5xv7n6oauyvzv0qwa
2015 // static void expand_leaves(graph_t * g)
2016 public static void expand_leaves(ST_Agraph_s g) {
2017 ENTERING("cfotmdif5xv7n6oauyvzv0qwa","expand_leaves");
2018 try {
2019 int i, d;
2020 ST_Agnode_s n;
2021 ST_Agedge_s e, f;
2022 make_leafslots(g);
2023 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
2024 if (ND_inleaf(n)!=null)
2025 do_leaves(g, ND_inleaf(n));
2026 if (ND_outleaf(n)!=null)
2027 do_leaves(g, ND_outleaf(n));
2028 if (ND_other(n).listNotNull())
2029 for (i = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(i))!=null; i++) {
2030 if ((d = ND_rank(aghead(e)) - ND_rank(aghead(e))) == 0)
2031 continue;
2032 f = ED_to_orig(e);
2033 if (ports_eq(e, f) == false) {
2034 zapinlist(ND_other(n), e);
2035 if (d == 1)
2036 fast_edge(e);
2037 /*else unitize(e); ### */
2038 i--;
2039 }
2040 }
2041 }
2042 } finally {
2043 LEAVING("cfotmdif5xv7n6oauyvzv0qwa","expand_leaves");
2044 }
2045 }
2046
2047
2048
2049
2050 //3 d4b57ugpwxy567pfmxn14ed8d
2051 // static void make_lrvn(graph_t * g)
2052 public static void make_lrvn(ST_Agraph_s g) {
2053 ENTERING("d4b57ugpwxy567pfmxn14ed8d","make_lrvn");
2054 try {
2055 ST_Agnode_s ln, rn;
2056 if (GD_ln(g)!=null)
2057 return;
2058 ln = virtual_node(dot_root(g));
2059 ND_node_type(ln, 2);
2060 rn = virtual_node(dot_root(g));
2061 ND_node_type(rn, 2);
2062 if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) {
2063 int w = MAX((int)GD_border(g)[0].x, (int)GD_border(g)[2].x);
2064 make_aux_edge(ln, rn, w, 0);
2065 }
2066 GD_ln(g, ln);
2067 GD_rn(g, rn);
2068 } finally {
2069 LEAVING("d4b57ugpwxy567pfmxn14ed8d","make_lrvn");
2070 }
2071 }
2072
2073
2074
2075
2076 //3 daz786541idcxnywckcbncazb
2077 // static void contain_nodes(graph_t * g)
2078 public static void contain_nodes(ST_Agraph_s g) {
2079 ENTERING("daz786541idcxnywckcbncazb","contain_nodes");
2080 try {
2081 int margin, r;
2082 ST_Agnode_s ln, rn, v;
2083 margin = late_int (g, Z.z().G_margin, 8, 0);
2084 make_lrvn(g);
2085 ln = GD_ln(g);
2086 rn = GD_rn(g);
2087 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
2088 if (GD_rank(g).get(r).n == 0)
2089 continue;
2090 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
2091 if (v == null) {
2092 UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n",
2093 UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r);
2094 UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
2095 }
2096 make_aux_edge(ln, v,
2097 ND_lw(v) + margin + GD_border(g)[3].x, 0);
2098 v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - 1).getPtr();
2099 make_aux_edge(v, rn,
2100 ND_rw(v) + margin + GD_border(g)[1].x, 0);
2101 }
2102 } finally {
2103 LEAVING("daz786541idcxnywckcbncazb","contain_nodes");
2104 }
2105 }
2106
2107
2108
2109
2110 //3 betdvb8dk8icvqkn6e6y5h94x
2111 // static boolean idealsize(graph_t * g, double minallowed)
2112 public static Object idealsize(Object... arg) {
2113 UNSUPPORTED("74m5dgfkgpr7bq7elj8bk5w6z"); // static boolean idealsize(graph_t * g, double minallowed)
2114 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
2115 UNSUPPORTED("bp9bpmgkh2gsdynqe5wio0i32"); // double xf, yf, f, R;
2116 UNSUPPORTED("8404v5b2qtn2x2mlgbyxidbx4"); // pointf b, relpage, margin;
2117 UNSUPPORTED("a3ke28asz3w87p4n8bgil541i"); // /* try for one page */
2118 UNSUPPORTED("avi96122npbhja9hwa4goidp"); // relpage = GD_drawing(g)->page;
2119 UNSUPPORTED("19uch6jfal0x385xni41gqam6"); // if (relpage.x < 0.001 || relpage.y < 0.001)
2120 UNSUPPORTED("52kuioyxcuboss35kg15wudvt"); // return 0; /* no page was specified */
2121 UNSUPPORTED("d6i2metpbkzakq2abzgvcdzle"); // margin = GD_drawing(g)->margin;
2122 UNSUPPORTED("asgqm8o7cruxxpfx9lobsif1c"); // relpage = sub_pointf(relpage, margin);
2123 UNSUPPORTED("asgqm8o7cruxxpfx9lobsif1c"); // relpage = sub_pointf(relpage, margin);
2124 UNSUPPORTED("aqhjsr7rv4ig7d1vagm74jpmo"); // b.x = GD_bb(g).UR.x;
2125 UNSUPPORTED("30xemhqjxz13hiyv2o2r8mol1"); // b.y = GD_bb(g).UR.y;
2126 UNSUPPORTED("cv2s8vkuet41gdoms8vue473z"); // xf = relpage.x / b.x;
2127 UNSUPPORTED("rvfej1l4o57i17le73vt80cf"); // yf = relpage.y / b.y;
2128 UNSUPPORTED("4f2ksj9hf0fi9wnzrz20eswmo"); // if ((xf >= 1.0) && (yf >= 1.0))
2129 UNSUPPORTED("e64anddwrzfgr4xoopjelwqg1"); // return 0; /* fits on one page */
2130 UNSUPPORTED("9vakpuy3iri2q9upsuy7lqhln"); // f = MIN(xf, yf);
2131 UNSUPPORTED("ccu6nxd64lwxm1h8x0sbrkdv7"); // xf = yf = MAX(f, minallowed);
2132 UNSUPPORTED("yc64sd7yr28zgjqrr734fc7i"); // R = ceil((xf * b.x) / relpage.x);
2133 UNSUPPORTED("aht5rw6872hwmg7vaop0eairh"); // xf = ((R * relpage.x) / b.x);
2134 UNSUPPORTED("asw2ato73u7m4kb07x2mr2snv"); // R = ceil((yf * b.y) / relpage.y);
2135 UNSUPPORTED("76j6b15q20gswxka8cglflbym"); // yf = ((R * relpage.y) / b.y);
2136 UNSUPPORTED("49gpvau7p2bvvkp6oemyqyjev"); // GD_drawing(g)->size.x = b.x * xf;
2137 UNSUPPORTED("7gewumkvzgtqon1jqxp8yf0kk"); // GD_drawing(g)->size.y = b.y * yf;
2138 UNSUPPORTED("8fwlqtemsmckleh6946lyd8mw"); // return NOT(0);
2139 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
2140
2141 throw new UnsupportedOperationException();
2142 }
2143
2144
2145 }