summaryrefslogtreecommitdiff
path: root/src/gen/lib
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2018-11-29 22:15:37 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2018-11-29 22:15:37 +0100
commit567b200b91537405689ae0ca944f121201360a6b (patch)
tree918d32d65a8588bfe06607dc94c39b4088edd5a8 /src/gen/lib
parent293202087ef00accaa85af02c2c9359ab6b2513c (diff)
New upstream version 1.2018.13
Diffstat (limited to 'src/gen/lib')
-rw-r--r--src/gen/lib/cdt/dtclose__c.java63
-rw-r--r--src/gen/lib/cdt/dtdisc__c.java72
-rw-r--r--src/gen/lib/cdt/dtextract__c.java26
-rw-r--r--src/gen/lib/cdt/dtflatten__c.java4
-rw-r--r--src/gen/lib/cdt/dtopen__c.java42
-rw-r--r--src/gen/lib/cdt/dtrestore__c.java26
-rw-r--r--src/gen/lib/cdt/dtsize__c.java28
-rw-r--r--src/gen/lib/cdt/dttree__c.java256
-rw-r--r--src/gen/lib/cdt/dtview__c.java50
-rw-r--r--src/gen/lib/cgraph/apply__c.java22
-rw-r--r--src/gen/lib/cgraph/attr__c.java264
-rw-r--r--src/gen/lib/cgraph/edge__c.java242
-rw-r--r--src/gen/lib/cgraph/graph__c.java136
-rw-r--r--src/gen/lib/cgraph/id__c.java30
-rw-r--r--src/gen/lib/cgraph/imap__c.java25
-rw-r--r--src/gen/lib/cgraph/mem__c.java43
-rw-r--r--src/gen/lib/cgraph/node__c.java118
-rw-r--r--src/gen/lib/cgraph/obj__c.java46
-rw-r--r--src/gen/lib/cgraph/rec__c.java73
-rw-r--r--src/gen/lib/cgraph/refstr__c.java95
-rw-r--r--src/gen/lib/cgraph/subg__c.java55
-rw-r--r--src/gen/lib/cgraph/utils__c.java21
-rw-r--r--src/gen/lib/circogen/block__c.java41
-rw-r--r--src/gen/lib/circogen/blockpath__c.java40
-rw-r--r--src/gen/lib/circogen/blocktree__c.java40
-rw-r--r--src/gen/lib/circogen/circpos__c.java41
-rw-r--r--src/gen/lib/circogen/circular__c.java41
-rw-r--r--src/gen/lib/circogen/circularinit__c.java41
-rw-r--r--src/gen/lib/circogen/deglist__c.java41
-rw-r--r--src/gen/lib/circogen/edgelist__c.java40
-rw-r--r--src/gen/lib/circogen/nodelist__c.java41
-rw-r--r--src/gen/lib/circogen/nodeset__c.java42
-rw-r--r--src/gen/lib/common/args__c.java41
-rw-r--r--src/gen/lib/common/arrows__c.java97
-rw-r--r--src/gen/lib/common/ellipse__c.java40
-rw-r--r--src/gen/lib/common/emit__c.java89
-rw-r--r--src/gen/lib/common/geom__c.java66
-rw-r--r--src/gen/lib/common/globals__c.java40
-rw-r--r--src/gen/lib/common/htmllex__c.java40
-rw-r--r--src/gen/lib/common/htmlparse__c.java41
-rw-r--r--src/gen/lib/common/htmltable__c.java44
-rw-r--r--src/gen/lib/common/input__c.java88
-rw-r--r--src/gen/lib/common/labels__c.java174
-rw-r--r--src/gen/lib/common/memory__c.java4
-rw-r--r--src/gen/lib/common/ns__c.java209
-rw-r--r--src/gen/lib/common/output__c.java41
-rw-r--r--src/gen/lib/common/pointset__c.java40
-rw-r--r--src/gen/lib/common/postproc__c.java478
-rw-r--r--src/gen/lib/common/psusershape__c.java40
-rw-r--r--src/gen/lib/common/routespl__c.java459
-rw-r--r--src/gen/lib/common/shapes__c.java318
-rw-r--r--src/gen/lib/common/splines__c.java447
-rw-r--r--src/gen/lib/common/textspan__c.java59
-rw-r--r--src/gen/lib/common/utils__c.java344
-rw-r--r--src/gen/lib/dotgen/acyclic__c.java62
-rw-r--r--src/gen/lib/dotgen/aspect__c.java46
-rw-r--r--src/gen/lib/dotgen/class1__c.java60
-rw-r--r--src/gen/lib/dotgen/class2__c.java115
-rw-r--r--src/gen/lib/dotgen/cluster__c.java196
-rw-r--r--src/gen/lib/dotgen/compound__c.java40
-rw-r--r--src/gen/lib/dotgen/conc__c.java41
-rw-r--r--src/gen/lib/dotgen/decomp__c.java81
-rw-r--r--src/gen/lib/dotgen/dotinit__c.java111
-rw-r--r--src/gen/lib/dotgen/dotsplines__c.java919
-rw-r--r--src/gen/lib/dotgen/fastgr__c.java143
-rw-r--r--src/gen/lib/dotgen/flat__c.java189
-rw-r--r--src/gen/lib/dotgen/mincross__c.java549
-rw-r--r--src/gen/lib/dotgen/position__c.java387
-rw-r--r--src/gen/lib/dotgen/rank__c.java154
-rw-r--r--src/gen/lib/dotgen/sameport__c.java54
-rw-r--r--src/gen/lib/fdpgen/clusteredges__c.java40
-rw-r--r--src/gen/lib/fdpgen/comp__c.java40
-rw-r--r--src/gen/lib/fdpgen/fdpinit__c.java41
-rw-r--r--src/gen/lib/fdpgen/grid__c.java40
-rw-r--r--src/gen/lib/fdpgen/layout__c.java41
-rw-r--r--src/gen/lib/fdpgen/tlayout__c.java40
-rw-r--r--src/gen/lib/fdpgen/xlayout__c.java40
-rw-r--r--src/gen/lib/gvc/gvc__c.java8
-rw-r--r--src/gen/lib/gvc/gvcontext__c.java16
-rw-r--r--src/gen/lib/gvc/gvlayout__c.java59
-rw-r--r--src/gen/lib/gvc/gvplugin__c.java10
-rw-r--r--src/gen/lib/gvc/gvrender__c.java41
-rw-r--r--src/gen/lib/gvc/gvtextlayout__c.java12
-rw-r--r--src/gen/lib/label/index__c.java448
-rw-r--r--src/gen/lib/label/node__c.java252
-rw-r--r--src/gen/lib/label/nrtmain__c.java10
-rw-r--r--src/gen/lib/label/rectangle__c.java162
-rw-r--r--src/gen/lib/label/split_q__c.java423
-rw-r--r--src/gen/lib/label/xlabels__c.java1087
-rw-r--r--src/gen/lib/ortho/ortho__c.java41
-rw-r--r--src/gen/lib/pack/ccomps__c.java41
-rw-r--r--src/gen/lib/pack/pack__c.java57
-rw-r--r--src/gen/lib/pack/ptest__c.java42
-rw-r--r--src/gen/lib/pathplan/cvt__c.java7
-rw-r--r--src/gen/lib/pathplan/route__c.java220
-rw-r--r--src/gen/lib/pathplan/shortest__c.java368
96 files changed, 5474 insertions, 6603 deletions
diff --git a/src/gen/lib/cdt/dtclose__c.java b/src/gen/lib/cdt/dtclose__c.java
index 4a2f7da..4468f03 100644
--- a/src/gen/lib/cdt/dtclose__c.java
+++ b/src/gen/lib/cdt/dtclose__c.java
@@ -44,7 +44,14 @@
*
*/
package gen.lib.cdt;
+import static gen.lib.cdt.dtsize__c.dtsize_;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import smetana.core.Memory;
public class dtclose__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -115,38 +122,38 @@ public class dtclose__c {
//3 7ggbhlblmrfr1wq1k20npwyxb
// int dtclose(register Dt_t* dt)
-public static Object dtclose(Object... arg) {
-UNSUPPORTED("5o7j3hhxxjdvmz0k3eg98i8in"); // int dtclose(register Dt_t* dt)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("2fi55lg37rcjprso1i0385cj5"); // Dtdisc_t *disc;
-UNSUPPORTED("pz52m7579heh6vdbqc3dt84v"); // int ev = 0;
-UNSUPPORTED("3iyrv07qx7n0s211y8m7mopsz"); // if(!dt || dt->nview > 0 ) /* can't close if being viewed */
-UNSUPPORTED("b0epxudfxjm8kichhaautm2qi"); // return -1;
-UNSUPPORTED("9y2zao3al22pjv2p480p4klcc"); // /* announce the close event to see if we should continue */
-UNSUPPORTED("70rampeezpyz05ynxa49umbrz"); // disc = dt->disc;
-UNSUPPORTED("8gsk9kzxnlwgo3aceze9c6gl7"); // if(disc->eventf &&
-UNSUPPORTED("ho436wfj1mjidd6obd19mhll"); // (ev = (*disc->eventf)(dt,2,((void*)0),disc)) < 0)
-UNSUPPORTED("b0epxudfxjm8kichhaautm2qi"); // return -1;
-UNSUPPORTED("66fqrcqd57dw3fzb30i176w0r"); // if(dt->view) /* turn off viewing */
+public static int dtclose(ST_dt_s dt) {
+ENTERING("7ggbhlblmrfr1wq1k20npwyxb","dtclose");
+ try {
+ ST_dtdisc_s disc;
+ int ev = 0;
+ if(N(dt) || dt.nview > 0 ) /* can't close if being viewed */
+ return -1;
+ /* announce the close event to see if we should continue */
+ disc = (ST_dtdisc_s) dt.disc;
+ if(disc.eventf!=null &&
+ (ev = (Integer)disc.eventf.exe(dt, 2, null, disc)) < 0)
+ return -1;
+ if(dt.view!=null) /* turn off viewing */
UNSUPPORTED("1xbo7gf92fmqmu2tzpfeuc0wk"); // dtview(dt,((Dt_t*)0));
-UNSUPPORTED("9vl9psbe52rphrxhc41erj2qd"); // if(ev == 0) /* release all allocated data */
-UNSUPPORTED("8fubw8ssxlx99qjv7n52cf3ru"); // { (void)(*(dt->meth->searchf))(dt,((void*)0),0000100);
-UNSUPPORTED("5rbpcw29jwi3l66b11are2xd5"); // if(dtsize(dt) > 0)
-UNSUPPORTED("896vcxnvc07fbkh09vojp66fv"); // return -1;
-UNSUPPORTED("8po7fioot1issl5obmk5hqndd"); // if(dt->data->ntab > 0)
+ if(ev == 0) /* release all allocated data */ {
+ dt.meth.searchf.exe(dt, null, 0000100);
+ if(dtsize_(dt) > 0)
+ return -1;
+if(dt.data.ntab > 0)
UNSUPPORTED("4ugmcpi8vkb013vuo4wykn0a3"); // (*dt->memoryf)(dt,(void*)dt->data->hh._htab,0,disc);
-UNSUPPORTED("1bguaull3m0kl140obilq4ucp"); // (*dt->memoryf)(dt,(void*)dt->data,0,disc);
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("4wjw4hx0hptydzyvkohwgzoo"); // if(dt->type == 0)
-UNSUPPORTED("9jx9g23tuicm5x7f5cvznr3rt"); // free((void*)dt);
-UNSUPPORTED("4r6n1aai6737i36g78f9z4apm"); // else if(ev == 0 && dt->type == 1)
+dt.memoryf.exe(dt, dt.data, null, disc);
+ }
+ if(dt.type == 0)
+ Memory.free(dt);
+ else if(ev == 0 && dt.type == 1)
UNSUPPORTED("6wqxv1f7tzvjk0lwmqdrcq8la"); // (*dt->memoryf)(dt, (void*)dt, 0, disc);
-UNSUPPORTED("oxrmf64nqi0a580iiczqkmky"); // if(disc->eventf)
+ if(disc.eventf!=null)
UNSUPPORTED("8bce06bdd64ypwb17ddloqzu8"); // (void)(*disc->eventf)(dt, 6, ((void*)0), disc);
-UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ return 0;
+} finally {
+LEAVING("7ggbhlblmrfr1wq1k20npwyxb","dtclose");
+}
}
diff --git a/src/gen/lib/cdt/dtdisc__c.java b/src/gen/lib/cdt/dtdisc__c.java
index 2e361a7..871ca01 100644
--- a/src/gen/lib/cdt/dtdisc__c.java
+++ b/src/gen/lib/cdt/dtdisc__c.java
@@ -44,16 +44,19 @@
*
*/
package gen.lib.cdt;
+import static gen.lib.cdt.dtflatten__c.dtflatten;
+import static gen.lib.cdt.dtrestore__c.dtrestore;
import static smetana.core.JUtils.function;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import h.Dtsearch_f;
-import h._dt_s;
-import h._dtdisc_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_dtlink_s;
import smetana.core.CString;
+import smetana.core.Memory;
import smetana.core.size_t;
public class dtdisc__c {
@@ -125,16 +128,21 @@ public class dtdisc__c {
//3 507t9jcy6v9twvl30rs9i2nwi
// static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
-public static Object dtmemory(_dt_s dt, Object addr, size_t size, _dtdisc_s disc) {
+public static Object dtmemory(ST_dt_s dt, Object addr, size_t size, ST_dtdisc_s disc) {
+ENTERING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
+try {
if(addr!=null) {
-UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // if(size == 0)
-UNSUPPORTED("15j5ccp5owse1ebc5ljhbzg59"); // { free(addr);
-UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
+ if(size == null) {
+ Memory.free(addr);
+ return null;
+ }
UNSUPPORTED("9ed8imo9cbvwtwe92qmavoqko"); // else return realloc(addr,size);
}
else return size.isStrictPositive() ? size.malloc() : null;
throw new UnsupportedOperationException();
+} finally {
+LEAVING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
+}
}
@@ -142,45 +150,45 @@ throw new UnsupportedOperationException();
//3 axpvuswclmi9bx3qtlh4quyah
// Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type)
-public static _dtdisc_s dtdisc(_dt_s dt, _dtdisc_s disc, int type) {
+public static ST_dtdisc_s dtdisc(ST_dt_s dt, ST_dtdisc_s disc, int type) {
ENTERING("axpvuswclmi9bx3qtlh4quyah","dtdisc");
try {
Dtsearch_f searchf;
- _dtlink_s r, t;
+ ST_dtlink_s r, t;
CString k;
- _dtdisc_s old;
- if(N(old = (_dtdisc_s) dt.getPtr("disc")) ) /* initialization call from dtopen() */
+ ST_dtdisc_s old;
+ if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */
{ dt.setPtr("disc", disc);
- if(N(dt.setPtr("memoryf", disc.getPtr("memoryf") )))
+ if(N(dt.setPtr("memoryf", disc.memoryf )))
dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
return disc;
}
if(N(disc)) /* only want to know current discipline */
return old;
-UNSUPPORTED("6htlkpaqff61iwmsg1be47uci"); // searchf = dt->meth->searchf;
-UNSUPPORTED("ckjxpmega2z5oju8xk72wsy0q"); // ((dt->data->type&010000) ? dtrestore(dt,((Dtlink_t*)0)) : 0);
-UNSUPPORTED("34klfi71a7k7iqdrvezqetdjg"); // if(old->eventf && (*old->eventf)(dt,3,(void*)disc,old) < 0)
-UNSUPPORTED("1cft3x8zrdzefdb93v3f1tuo7"); // return ((Dtdisc_t*)0);
-UNSUPPORTED("4e4gm32ypcbtlzkym7sh79rrd"); // dt->disc = disc;
-UNSUPPORTED("6nr96is5y2ct55pupgycwbjmt"); // if(!(dt->memoryf = disc->memoryf) )
-UNSUPPORTED("1prh3v6ko1v9w39hgk7wiknjc"); // dt->memoryf = dtmemory;
-UNSUPPORTED("epetks7tchxd027a5fogh5s8y"); // if(dt->data->type&(0000040|0000100|0000020))
+ searchf = (Dtsearch_f) dt.meth.searchf;
+ if((dt.data.type&010000)!=0) dtrestore(dt,null);
+ if(old.eventf!=null && ((Integer)old.eventf.exe(dt,3, disc,old)) < 0)
+ return null;
+ dt.setPtr("disc", disc);
+ if(N(dt.setPtr("memoryf", disc.memoryf)))
+ dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
+ if((dt.data.type&(0000040|0000100|0000020))!=0)
UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done;
-UNSUPPORTED("9z4k8xq4t2p909fvi8gusmmww"); // else if(dt->data->type&0000002)
-UNSUPPORTED("3q5nyguq8mgdfwmm0yrzq2br8"); // { if(type&0000002)
+ else if((dt.data.type&0000002)!=0) {
+UNSUPPORTED("3q5nyguq8mgdfwmm0yrzq2br8"); // if(type&0000002)
UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("eu35368wm4jf6yedwkayoycx4"); // else if(dt->data->type&(0000001|0000002))
-UNSUPPORTED("8xmm1djjds55s86jodixkp72u"); // { if((type&0000002) && (type&0000001))
+ }
+ else if((dt.data.type&(0000001|0000002))!=0) {
+UNSUPPORTED("8xmm1djjds55s86jodixkp72u"); // if((type&0000002) && (type&0000001))
UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("1ww5saiqcss2tdx5nts4rxpou"); // else /*if(dt->data->type&(DT_OSET|DT_OBAG))*/
-UNSUPPORTED("4582pmh67cgbsphrw05tf0hmm"); // { if(type&0000001)
+ }
+ else /*if(dt->data->type&(DT_OSET|DT_OBAG))*/ {
+ if((type&0000001)!=0)
UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
-UNSUPPORTED("8njey2jaa662w29s8zcqbjln5"); // dt_renew:
-UNSUPPORTED("assw6t0chu41lwws2ysqi4fgi"); // r = dtflatten(dt);
+// dt_renew:
+ r = dtflatten(dt);
UNSUPPORTED("1rry7yjzos90pgbf3li2qpa18"); // dt->data->type &= ~010000;
UNSUPPORTED("6vkn7padspfbtju9g5b65b34w"); // dt->data->here = ((Dtlink_t*)0);
UNSUPPORTED("2jfi30wa60xp7iqlk9yyf4k5j"); // dt->data->size = 0;
@@ -204,7 +212,7 @@ UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
UNSUPPORTED("cerydbb7i6l7c4pgeygvwoqk2"); // done:
UNSUPPORTED("bi0p581nen18ypj0ey48s6ete"); // return old;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+ }
throw new UnsupportedOperationException();
} finally {
diff --git a/src/gen/lib/cdt/dtextract__c.java b/src/gen/lib/cdt/dtextract__c.java
index dafad9d..f9b946a 100644
--- a/src/gen/lib/cdt/dtextract__c.java
+++ b/src/gen/lib/cdt/dtextract__c.java
@@ -47,8 +47,8 @@ package gen.lib.cdt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h._dt_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtlink_s;
public class dtextract__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -119,25 +119,25 @@ public class dtextract__c {
//3 ar89jjwhuitmbhut1o3ft3zpb
// Dtlink_t* dtextract(register Dt_t* dt)
-public static _dtlink_s dtextract(_dt_s dt) {
+public static ST_dtlink_s dtextract(ST_dt_s dt) {
ENTERING("ar89jjwhuitmbhut1o3ft3zpb","dtextract");
try {
- _dtlink_s list = null;
- _dtlink_s s[], ends[];
- if((dt.getPtr("data").getInt("type")&(0000004|0000010) )!=0)
- list = (_dtlink_s) dt.getPtr("data").getPtr("here");
- else if((dt.getPtr("data").getInt("type")&(0000001|0000002))!=0)
+ ST_dtlink_s list = null;
+ ST_dtlink_s s[], ends[];
+ if((dt.data.type&(0000004|0000010) )!=0)
+ list = (ST_dtlink_s) dt.data.here;
+ else if((dt.data.type&(0000001|0000002))!=0)
{ UNSUPPORTED("list = dtflatten(dt)");
UNSUPPORTED("8i2mufw9f604gvj48u8nbdazp"); // for(ends = (s = dt->data->hh._htab) + dt->data->ntab; s < ends; ++s)
UNSUPPORTED("4sml4zdr938yth6x815jt1dlm"); // *s = ((Dtlink_t*)0);
}
else /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE))*/
- { list = (_dtlink_s) dt.getPtr("data").getPtr("hh").getPtr("_head");
- dt.getPtr("data").getPtr("hh").setPtr("_head", null);
+ { list = (ST_dtlink_s) dt.data._head;
+ dt.data._head = null;
}
- dt.getPtr("data").setInt("type", dt.getPtr("data").getInt("type") & ~010000);
- dt.getPtr("data").setInt("size", 0);
- dt.getPtr("data").setPtr("here", null);
+ dt.data.setInt("type", dt.data.type & ~010000);
+ dt.data.setInt("size", 0);
+ dt.data.here = null;
return list;
} finally {
LEAVING("ar89jjwhuitmbhut1o3ft3zpb","dtextract");
diff --git a/src/gen/lib/cdt/dtflatten__c.java b/src/gen/lib/cdt/dtflatten__c.java
index 9c27097..3b7d2ff 100644
--- a/src/gen/lib/cdt/dtflatten__c.java
+++ b/src/gen/lib/cdt/dtflatten__c.java
@@ -45,6 +45,8 @@
*/
package gen.lib.cdt;
import static smetana.core.Macro.UNSUPPORTED;
+import h.ST_dt_s;
+import h.ST_dtlink_s;
public class dtflatten__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -115,7 +117,7 @@ public class dtflatten__c {
//3 5zkzkycgp4e90pajuq4tczdbu
// Dtlink_t* dtflatten(Dt_t* dt)
-public static Object dtflatten(Object... arg) {
+public static ST_dtlink_s dtflatten(ST_dt_s dt) {
UNSUPPORTED("1u9gaaespn5nsfpluy23yon7s"); // Dtlink_t* dtflatten(Dt_t* dt)
UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
UNSUPPORTED("82qvflv3akadrlktyouix927i"); // register Dtlink_t *t, *r, *list, *last, **s, **ends;
diff --git a/src/gen/lib/cdt/dtopen__c.java b/src/gen/lib/cdt/dtopen__c.java
index ae1262c..92d1f78 100644
--- a/src/gen/lib/cdt/dtopen__c.java
+++ b/src/gen/lib/cdt/dtopen__c.java
@@ -49,10 +49,10 @@ import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
-import h._dt_s;
-import h._dtdata_s;
-import h._dtdisc_s;
-import h._dtmethod_s;
+import h.ST_dt_s;
+import h.ST_dtdata_s;
+import h.ST_dtdisc_s;
+import h.ST_dtmethod_s;
import smetana.core.Memory;
public class dtopen__c {
@@ -128,16 +128,16 @@ public class dtopen__c {
//3 34nbfbdgwe34hb4vmfr5p6kbh
// Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth)
-public static _dt_s dtopen(_dtdisc_s disc, _dtmethod_s meth) {
+public static ST_dt_s dtopen(ST_dtdisc_s disc, ST_dtmethod_s meth) {
ENTERING("34nbfbdgwe34hb4vmfr5p6kbh","dtopen");
try {
- _dt_s dt = null;
+ ST_dt_s dt = null;
int e;
- _dtdata_s data;
+ ST_dtdata_s data;
if(N(disc) || N(meth))
return null;
/* allocate space for dictionary */
- if(N(dt = (_dt_s) Memory.malloc(_dt_s.class)))
+ if(N(dt = new ST_dt_s()))
return null;
// /* initialize all absolutely private data */
dt.setPtr("searchf", null);
@@ -149,7 +149,7 @@ try {
dt.setPtr("view", null);
dt.setPtr("walk", null);
dt.setPtr("user", null);
- if(disc.getPtr("eventf")!=null)
+ if(disc.eventf!=null)
{ /* if shared/persistent dictionary, get existing data */
throw new UnsupportedOperationException();
// data = ((Dtdata_t*)0);
@@ -176,23 +176,23 @@ try {
// }
}
/* allocate sharable data */
- if(N(data = (_dtdata_s) (dt.call("memoryf", dt,null,sizeof(_dtdata_s.class),disc)) ))
+ if(N(data = (ST_dtdata_s) (dt.memoryf.exe(dt,null,sizeof(ST_dtdata_s.class),disc)) ))
{ err_open:
Memory.free(dt);
return (null);
}
- data.setInt("type", meth.getInt("type"));
- data.setPtr("here", null);
- data.setPtr("hh._htab", null);
- data.setInt("ntab", 0);
- data.setInt("size", 0);
- data.setInt("loop", 0);
- data.setInt("minp", 0);
+ data.type = meth.type;
+ data.here = null;
+ data._htab = null;
+ data.ntab = 0;
+ data.size = 0;
+ data.loop = 0;
+ data.minp = 0;
//done:
- dt.setPtr("data", data);
- dt.setPtr("searchf", meth.getPtr("searchf"));
- dt.setPtr("meth", meth);
- if(disc.getPtr("eventf")!=null)
+ dt.data = data;
+ dt.searchf = meth.searchf;
+ dt.meth = meth;
+ if(disc.eventf!=null)
throw new UnsupportedOperationException();
// (*disc->eventf)(dt, 5, (void*)dt, disc);
return dt;
diff --git a/src/gen/lib/cdt/dtrestore__c.java b/src/gen/lib/cdt/dtrestore__c.java
index 8f04bde..b20961c 100644
--- a/src/gen/lib/cdt/dtrestore__c.java
+++ b/src/gen/lib/cdt/dtrestore__c.java
@@ -49,8 +49,8 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import h.Dtsearch_f;
-import h._dt_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtlink_s;
public class dtrestore__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -121,26 +121,26 @@ public class dtrestore__c {
//3 8dfut8799tvg4tjvn2yz48d7h
// int dtrestore(register Dt_t* dt, register Dtlink_t* list)
-public static int dtrestore(_dt_s dt, _dtlink_s list) {
+public static int dtrestore(ST_dt_s dt, ST_dtlink_s list) {
ENTERING("8dfut8799tvg4tjvn2yz48d7h","dtrestore");
try {
- _dtlink_s t;
+ ST_dtlink_s t;
//Dtlink_t **s, **ends;
int type;
- Dtsearch_f searchf = (Dtsearch_f) dt.getPtr("meth").getPtr("searchf");
- type = dt.getPtr("data").getInt("type")&010000;
+ Dtsearch_f searchf = (Dtsearch_f) dt.meth.searchf;
+ type = dt.data.type&010000;
if(N(list)) /* restoring a flattened dictionary */
{ if(N(type))
return -1;
- list = (_dtlink_s) dt.getPtr("data").getPtr("here");
+ list = (ST_dtlink_s) dt.data.here;
}
else /* restoring an extracted list of elements */
- { if(dt.getPtr("data").getInt("size") != 0)
+ { if(dt.data.size != 0)
return -1;
type = 0;
}
- dt.getPtr("data").setInt("type", dt.getPtr("data").getInt("type") & ~010000);
- if((dt.getPtr("data").getInt("type")&(0000001|0000002))!=0)
+ dt.data.setInt("type", dt.data.type & ~010000);
+ if((dt.data.type&(0000001|0000002))!=0)
{ //dt->data->here = ((Dtlink_t*)0);
UNSUPPORTED("4xawc48hce5sov89n8h4j7xw0"); // if(type) /* restoring a flattened dictionary */
UNSUPPORTED("3yrjmgus9a9415ocrrtj1e733"); // { for(ends = (s = dt->data->hh._htab) + dt->data->ntab; s < ends; ++s)
@@ -161,14 +161,14 @@ UNSUPPORTED("3to5h0rvqxdeqs38mhv47mm3o"); // }
UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
}
else
- { if((dt.getPtr("data").getInt("type")&(0000004|0000010))!=0)
- dt.getPtr("data").setPtr("here", list);
+ { if((dt.data.type&(0000004|0000010))!=0)
+ dt.data.here = list;
else /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE))*/
{UNSUPPORTED("79wu0m7edfdq02msgoqkzb32"); // { dt->data->here = ((Dtlink_t*)0);
UNSUPPORTED("c8q10nh3f6o4rjxtacmbgjxqj"); // dt->data->hh._head = list;
}
if(N(type))
- dt.getPtr("data").setInt("size", -1);
+ dt.data.setInt("size", -1);
}
return 0;
} finally {
diff --git a/src/gen/lib/cdt/dtsize__c.java b/src/gen/lib/cdt/dtsize__c.java
index 580dd46..a7881bf 100644
--- a/src/gen/lib/cdt/dtsize__c.java
+++ b/src/gen/lib/cdt/dtsize__c.java
@@ -47,8 +47,8 @@ package gen.lib.cdt;
import static gen.lib.cdt.dtrestore__c.dtrestore;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
-import h._dt_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtlink_s;
public class dtsize__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -119,10 +119,10 @@ public class dtsize__c {
//3 6j49zum5hqto1t7fyrz8qjv1u
// static int treecount(register Dtlink_t* e)
-public static int treecount(_dtlink_s e) {
+public static int treecount(ST_dtlink_s e) {
ENTERING("6j49zum5hqto1t7fyrz8qjv1u","treecount");
try {
- return e!=null ? treecount((_dtlink_s) e.getPtr("hl._left")) + treecount((_dtlink_s) e.getPtr("right")) + 1 : 0;
+ return e!=null ? treecount((ST_dtlink_s) e._left) + treecount((ST_dtlink_s) e.right) + 1 : 0;
} finally {
LEAVING("6j49zum5hqto1t7fyrz8qjv1u","treecount");
}
@@ -133,23 +133,23 @@ LEAVING("6j49zum5hqto1t7fyrz8qjv1u","treecount");
//3 bci0ea1fa7egf4aads6gdgvsq
// int dtsize(Dt_t* dt)
-public static int dtsize_(_dt_s dt) {
+public static int dtsize_(ST_dt_s dt) {
ENTERING("bci0ea1fa7egf4aads6gdgvsq","dtsize");
try {
- _dtlink_s t;
+ ST_dtlink_s t;
int size;
- if (((dt.getPtr("data").getInt("type")&010000)!=0)) dtrestore(dt,null);
- if(dt.getPtr("data").getInt("size") < 0) /* !(dt->data->type&(DT_SET|DT_BAG)) */
- { if((dt.getPtr("data").getInt("type")&(0000004|0000010))!=0)
- dt.getPtr("data").setInt("size", treecount((_dtlink_s) dt.getPtr("data").getPtr("here")));
- else if((dt.getPtr("data").getInt("type")&(0000020|0000040|0000100))!=0)
+ if (((dt.data.type&010000)!=0)) dtrestore(dt,null);
+ if(dt.data.size < 0) /* !(dt->data->type&(DT_SET|DT_BAG)) */
+ { if((dt.data.type&(0000004|0000010))!=0)
+ dt.data.setInt("size", treecount((ST_dtlink_s) dt.data.here));
+ else if((dt.data.type&(0000020|0000040|0000100))!=0)
{ size=0;
- for(t = (_dtlink_s) dt.getPtr("data").getPtr("hh").getPtr("_head"); t!=null; t = (_dtlink_s) t.getPtr("right"))
+ for(t = (ST_dtlink_s) dt.data._head; t!=null; t = (ST_dtlink_s) t.right)
size += 1;
- dt.getPtr("data").setInt("size", size);
+ dt.data.setInt("size", size);
}
}
- return dt.getPtr("data").getInt("size");
+ return dt.data.size;
} finally {
LEAVING("bci0ea1fa7egf4aads6gdgvsq","dtsize");
diff --git a/src/gen/lib/cdt/dttree__c.java b/src/gen/lib/cdt/dttree__c.java
index 614f0e7..4921198 100644
--- a/src/gen/lib/cdt/dttree__c.java
+++ b/src/gen/lib/cdt/dttree__c.java
@@ -54,15 +54,14 @@ import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.UNSUPPORTED_INT;
import h.Dtcompar_f;
-import h._dt_s;
-import h._dtdisc_s;
-import h._dthold_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_dthold_s;
+import h.ST_dtlink_s;
+import h.ST_dthold_s;
import smetana.core.CFunction;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class dttree__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -131,77 +130,80 @@ public class dttree__c {
-//3 abqfzg1d1vkzk51225tcdlik5
-// static void* dttree(Dt_t* dt, void* obj, int type)
static class no_root extends RuntimeException {}
static class has_root extends RuntimeException {}
static class do_search extends RuntimeException {}
static class dt_delete extends RuntimeException {}
static class dt_insert extends RuntimeException {}
static class dt_next extends RuntimeException {}
-public static Object dttree(_dt_s dt, __ptr__ obj, int type) {
+//3 abqfzg1d1vkzk51225tcdlik5
+//static void* dttree(Dt_t* dt, void* obj, int type)
+public static Object dttree(ST_dt_s dt, __ptr__ obj, int type) {
ENTERING("abqfzg1d1vkzk51225tcdlik5","dttree");
try {
- _dtlink_s root, t;
+ ST_dtlink_s root, t;
int cmp, lk, sz, ky;
- _dtlink_s l, r, me=null;
- final __struct__<_dtlink_s> link = JUtils.from(_dtlink_s.class);
+ ST_dtlink_s l, r, me=null;
+ final ST_dtlink_s link = new ST_dtlink_s();
Object o, k, key = null;
int n, minp; //, turn[(sizeof(size_t)*8 - 2)];
Dtcompar_f cmpf;
- _dtdisc_s disc;
- if (((dt.getPtr("data").getInt("type")) & 010000) !=0) { dtrestore(dt,null); }
- disc = (_dtdisc_s) dt.getPtr("disc"); ky = disc.getInt("key");
- sz = disc.getInt("size");
- lk = disc.getInt("link");
- cmpf = (Dtcompar_f) disc.getPtr("comparf");
- dt.setInt("type", dt.getInt("type")&~0100000);
- root = (_dtlink_s) dt.getPtr("data").getPtr("here");
+ ST_dtdisc_s disc;
+ if (((dt.data.type) & 010000) !=0) { dtrestore(dt,null); }
+ disc = (ST_dtdisc_s) dt.disc; ky = disc.key;
+ sz = disc.size;
+ lk = disc.link;
+ cmpf = (Dtcompar_f) disc.comparf;
+ dt.setInt("type", dt.type&~0100000);
+ root = (ST_dtlink_s) dt.data.here;
if(N(obj))
{ if(N(root) || N(type&(0000100|0000200|0000400)) )
return null;
if((type&0000100)!=0) /* delete all objects */
{
- throw new UnsupportedOperationException();
-// if(disc->freef || disc->link < 0)
-// { do
-// { while((t = root->hl._left) )
-// (((root)->hl._left = (t)->right, (t)->right = (root)), (root) = (t));
-// t = root->right;
-// if(disc->freef)
+ if(disc.freef!=null || disc.link < 0) {
+ do {
+ while((t = (ST_dtlink_s) root._left)!=null ) {
+ root._left = t.right;
+ t.right = root;
+ root = t;
+ }
+ t = (ST_dtlink_s) root.right;
+ if(disc.freef!=null)
+ throw new UnsupportedOperationException();
// (*disc->freef)(dt,(lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ),disc);
-// if(disc->link < 0)
-// (*dt->memoryf)(dt,(void*)root,0,disc);
-// } while((root = t) );
-// }
-// dt->data->size = 0;
-// dt->data->here = ((Dtlink_t*)0);
-// return ((void*)0);
+ if(disc.link < 0)
+ dt.memoryf.exe(dt, root, null, disc);
+ } while((root = t)!=null );
+ }
+ dt.data.setInt("size", 0);
+ dt.data.here = null;
+ return null;
}
else /* computing largest/smallest element */
{ if((type&0000400)!=0)
- { while((t = (_dtlink_s) root.getPtr("right"))!=null ) {
- root.setPtr("right", t.getPtr("hl._left"));
- t.setPtr("hl._left", root);
+ { while((t = (ST_dtlink_s) root.right)!=null ) {
+ root.right = t._left;
+ t._left = root;
root = t;
}
}
else /* type&DT_FIRST */
- { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
- root.setPtr("hl._left", t.getPtr("right"));
- t.setPtr("right", root);
+ { while((t = (ST_dtlink_s) root._left)!=null ) {
+ root._left = t.right;
+ t.right = root;
root = t;
}
}
- dt.getPtr("data").setPtr("here", root);
- return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk) );
+ dt.data.here = root;
+ return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk) );
}
}
/* note that link.right is LEFT tree and link.left is RIGHT tree */
- l = r = link.amp();
+ l = r = link;
/* allow apps to delete an object "actually" in the dictionary */
try {
- if(dt.getPtr("meth").getInt("type") == 0000010 && ((type&(0000002|0010000))!=0) ) {
+ if(dt.meth.type == 0000010 && ((type&(0000002|0010000))!=0) ) {
throw new UnsupportedOperationException();
// { key = (void*)(sz < 0 ? *((char**)((char*)(obj)+ky)) : ((char*)(obj)+ky));
// for(o = (*(((Dt_t*)(dt))->searchf))((dt),(void*)(obj),0000004); o; o = (*(((Dt_t*)(dt))->searchf))((dt),(void*)(o),0000010) )
@@ -230,14 +232,14 @@ try {
// if(root)
// goto do_search;
}
- else if(root!=null && (lk < 0 ? (root.castTo(_dthold_s.class).getPtr("obj")!=null): NEQ(root.addVirtualBytes(-lk), obj)))
+ else if(root!=null && (lk < 0 ? (root.castTo_ST_dthold_s().obj!=null): NEQ(root.addVirtualBytes(-lk), obj)))
{ key = (sz < 0 ? ((__ptr__)obj).addVirtualBytes(ky) : ((__ptr__)obj).addVirtualBytes(ky));
throw new do_search();
}
} catch (do_search do_search) {
// do_search:
- if(dt.getPtr("meth").getInt("type") == 0000004 &&
- (minp = dt.getPtr("data").getInt("minp")) != 0 && (type&(0001000|0000004))!=0)
+ if(dt.meth.type == 0000004 &&
+ (minp = dt.data.minp) != 0 && (type&(0001000|0000004))!=0)
{ /* simple search, note that minp should be even */
// for(t = root, n = 0; n < minp; ++n)
// { k = (lk < 0 ? ((Dthold_t*)(t))->obj : (void*)((char*)(t) - lk) ); k = (void*)(sz < 0 ? *((char**)((char*)(k)+ky)) : ((char*)(k)+ky));
@@ -281,80 +283,80 @@ try {
throw new UnsupportedOperationException("do_search1");
}
while(true) {
- k = lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk);
+ k = lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk);
k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) :
(sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) == 0)
break;
else if(cmp < 0)
- { if((t = (_dtlink_s) root.getPtr("hl._left"))!=null )
+ { if((t = (ST_dtlink_s) root._left)!=null )
{
- k = lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk);
+ k = lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk);
k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc)
: (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) < 0)
- { root.setPtr("hl._left", t.getPtr("right"));
- t.setPtr("right", root);
- r.setPtr("hl._left", t);
+ { root._left = t.right;
+ t.right = root;
+ r._left = t;
r = t;
- if(N(root = (_dtlink_s) t.getPtr("hl._left")) )
+ if(N(root = (ST_dtlink_s) t._left) )
break;
}
else if(cmp == 0)
- { r.setPtr("hl._left", root);
+ { r._left = root;
r = root;
root = t;
break;
}
else /* if(cmp > 0) */
- { l.setPtr("right", t);
+ { l.right = t;
l = t;
- r.setPtr("hl._left", root);
+ r._left = root;
r = root;
- if(N(root = (_dtlink_s) t.getPtr("right")) )
+ if(N(root = (ST_dtlink_s) t.right) )
break;
}
}
else
{
- r.setPtr("hl._left", root);
+ r._left = root;
r = root;
root = null;
break;
}
}
else /* if(cmp > 0) */
- { if ((t = (_dtlink_s) root.getPtr("right"))!=null )
+ { if ((t = (ST_dtlink_s) root.right)!=null )
{
- k = (lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk) );
+ k = (lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk) );
k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc)
: (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) > 0)
{
- root.setPtr("right", t.getPtr("hl._left"));
- t.setPtr("hl._left", root);
- l.setPtr("right", t);
+ root.right = t._left;
+ t._left = root;
+ l.right = t;
l = t;
- if(N(root = (_dtlink_s) t.getPtr("right") ))
+ if(N(root = (ST_dtlink_s) t.right ))
break;
}
else if(cmp == 0)
- { l.setPtr("right", root);
+ { l.right = root;
l = root;
root = t;
break;
}
else /* if(cmp < 0) */
- { r.setPtr("hl._left", t);
+ { r._left = t;
r = t;
- l.setPtr("right", root);
+ l.right = root;
l = root;
- if(N(root = (_dtlink_s) t.getPtr("hl._left") ))
+ if(N(root = (ST_dtlink_s) t._left ))
break;
}
}
else
- { l.setPtr("right", root);
+ { l.right = root;
l = root;
root = null;
break;
@@ -364,25 +366,25 @@ try {
}
if(root!=null)
{ /* found it, now isolate it */
- dt.setInt("type", dt.getInt("type") | 0100000);
- l.setPtr("right", root.getPtr("hl._left"));
- r.setPtr("hl._left", root.getPtr("right"));
+ dt.setInt("type", dt.type | 0100000);
+ l.right = root._left;
+ r._left = root.right;
if((type&(0000004|0001000))!=0)
{ /*has_root:*/
throw new has_root();
}
else if((type&0000010)!=0)
- { root.setPtr("hl._left", link.getPtr("right"));
- root.setPtr("right", null);
- link.setPtr("right", root);
+ { root._left = link.right;
+ root.right = null;
+ link.right = root;
//dt_next:
- if((root = (_dtlink_s) link.getPtr("hl._left"))!=null )
- { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
- root.setPtr("hl._left", t.getPtr("right"));
- t.setPtr("right", root);
+ if((root = (ST_dtlink_s) link._left)!=null )
+ { while((t = (ST_dtlink_s) root._left)!=null ) {
+ root._left = t.right;
+ t.right = root;
root = t;
}
- link.setPtr("hl._left", root.getPtr("right"));
+ link._left = root.right;
throw new has_root();
}
else throw new no_root();
@@ -415,14 +417,38 @@ try {
// goto no_root;
}
else if((type&(0000001|0004000))!=0)
- { if((dt.getPtr("meth").getInt("type")&0000004)!=0)
+ { if((dt.meth.type&0000004)!=0)
throw new has_root();
- else throw new UnsupportedOperationException();
-// { root->hl._left = ((Dtlink_t*)0);
-// root->right = link.hl._left;
-// link.hl._left = root;
-// goto dt_insert;
-// }
+ else
+ {
+ root._left = null;
+ root.right = link._left;
+ link._left = root;
+ /*dt_insert: DUPLICATION*/
+ if(disc.makef!=null && (type&0000001)!=0)
+ obj = (__ptr__) disc.makef.exe(dt,obj,disc);
+ if(obj!=null)
+ {
+ if(lk >= 0)
+ root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
+ else
+ {
+ root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
+ dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
+ if(root!=null)
+ root.castTo(ST_dthold_s.class).setPtr("obj", obj);
+ else if(disc.makef!=null && disc.freef!=null &&
+ ((type&0000001))!=0)
+ UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
+ }
+ }
+ if(root!=null)
+ { if(dt.data.size >= 0)
+ dt.data.setInt("size", dt.data.size+1 );
+ throw new has_root();
+ }
+ else throw new UnsupportedOperationException("goto no_root");
+ }
}
else if((type&0000040)!=0) /* a duplicate */ {
throw new UnsupportedOperationException();
@@ -443,18 +469,18 @@ try {
}
else
{ /* not found, finish up LEFT and RIGHT trees */
- r.setPtr("hl._left", null);
- l.setPtr("right", null);
+ r._left = null;
+ l.right = null;
if((type&0000010)!=0)
{
//goto dt_next:
- if((root = (_dtlink_s) link.getPtr("hl._left"))!=null )
- { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
- root.setPtr("hl._left", t.getPtr("right"));
- t.setPtr("right", root);
+ if((root = (ST_dtlink_s) link._left)!=null )
+ { while((t = (ST_dtlink_s) root._left)!=null ) {
+ root._left = t.right;
+ t.right = root;
root = t;
}
- link.setPtr("hl._left", root.getPtr("right"));
+ link._left = root.right;
throw new has_root();
}
else throw new no_root();
@@ -467,34 +493,34 @@ try {
throw new no_root();
}
else if((type&(0000001|0004000))!=0)
- { /*dt_insert:*/
- if(disc.getPtr("makef")!=null && (type&0000001)!=0)
- obj = (__ptr__) disc.call("makef", dt,obj,disc);
+ { /*dt_insert: DUPLICATION*/
+ if(disc.makef!=null && (type&0000001)!=0)
+ obj = (__ptr__) disc.makef.exe(dt,obj,disc);
if(obj!=null)
{
if(lk >= 0)
- root = (_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(_dtlink_s.class);
+ root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
else
{
- root = (_dtlink_s)(dt.call("memoryf",
- dt,null,sizeof(_dthold_s.class),disc));
+ root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
+ dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
if(root!=null)
- root.castTo(_dthold_s.class).setPtr("obj", obj);
- else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null &&
+ root.castTo(ST_dthold_s.class).setPtr("obj", obj);
+ else if(disc.makef!=null && disc.freef!=null &&
((type&0000001))!=0)
UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
}
}
if(root!=null)
- { if(dt.getPtr("data").getInt("size") >= 0)
- dt.getPtr("data").setInt("size", dt.getPtr("data").getInt("size")+1 );
+ { if(dt.data.size >= 0)
+ dt.data.setInt("size", dt.data.size+1 );
throw new has_root();
}
else throw new UnsupportedOperationException("goto no_root");
}
else if((type&0000040)!=0)
{ root = me;
- dt.getPtr("data").setInt("size", dt.getPtr("data").getInt("size")+1 );
+ dt.data.setInt("size", dt.data.size+1 );
throw new UnsupportedOperationException("goto has_root");
}
else /*if(type&DT_DELETE)*/
@@ -505,10 +531,10 @@ try {
}
// return ((void*)0);
} catch (has_root has_root) {
- root = (_dtlink_s) root.castTo(_dtlink_s.class);
- root.setPtr("hl._left", link.getPtr("right"));
- root.setPtr("right", link.getPtr("hl._left"));
- if((dt.getPtr("meth").getInt("type")&0000010)!=0 && (type&(0000004|0001000))!=0 )
+ root = (ST_dtlink_s) root.castTo(ST_dtlink_s.class);
+ root._left = link.right;
+ root.right = link._left;
+ if((dt.meth.type&0000010)!=0 && (type&(0000004|0001000))!=0 )
{ //key = (lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ); key = (void*)(sz < 0 ? *((char**)((char*)(key)+ky)) : ((char*)(key)+ky));
throw new UnsupportedOperationException();
// while((t = root->hl._left) )
@@ -523,13 +549,13 @@ try {
// (((root)->hl._left = (t)->right, (t)->right = (root)), (root) = (t));
// }
}
- dt.getPtr("data").setPtr("here", root);
- return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk));
+ dt.data.here = root;
+ return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk));
} catch (no_root no_root) {
- while((t = (_dtlink_s) r.getPtr("hl._left"))!=null)
+ while((t = (ST_dtlink_s) r._left)!=null)
r = t;
- r.setPtr("hl._left", link.getPtr("right"));
- dt.getPtr("data").setPtr("here", link.getPtr("hl._left"));
+ r._left = link.right;
+ dt.data.here = link._left;
return (type&0000002)!=0 ? obj : null;
}
throw new UnsupportedOperationException();
diff --git a/src/gen/lib/cdt/dtview__c.java b/src/gen/lib/cdt/dtview__c.java
index e098539..f116d90 100644
--- a/src/gen/lib/cdt/dtview__c.java
+++ b/src/gen/lib/cdt/dtview__c.java
@@ -55,7 +55,7 @@ import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.UNSUPPORTED_INT;
import h.Dtcompar_f;
-import h._dt_s;
+import h.ST_dt_s;
import smetana.core.CFunction;
import smetana.core.CString;
import smetana.core.__ptr__;
@@ -129,38 +129,38 @@ public class dtview__c {
//3 6spidg45w8teb64726drdswaa
// static void* dtvsearch(Dt_t* dt, register void* obj, register int type)
-public static __ptr__ dtvsearch(_dt_s dt, __ptr__ obj, int type) {
+public static __ptr__ dtvsearch(ST_dt_s dt, __ptr__ obj, int type) {
ENTERING("6spidg45w8teb64726drdswaa","dtvsearch");
try {
- _dt_s d, p;
+ ST_dt_s d, p;
__ptr__ o=null, n, ok, nk;
int cmp, lk, sz, ky;
Dtcompar_f cmpf;
/* these operations only happen at the top level */
if ((type&(0000001|0000002|0000100|0000040))!=0)
- return (__ptr__) dt.getPtr("meth").call("searchf", dt, obj, type);
+ return (__ptr__) dt.meth.searchf.exe(dt, obj, type);
if(((type&(0001000|0000004))!=0) || /* order sets first/last done below */
- (((type&(0000200|0000400))!=0) && N(dt.getPtr("meth").getInt("type")&(0000010|0000004)) ) )
- { for(d = dt; d!=null; d = (_dt_s) d.getPtr("view"))
- if((o = (__ptr__) d.getPtr("meth").call("searchf", d,obj,type))!=null )
+ (((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) )
+ { for(d = dt; d!=null; d = (ST_dt_s) d.view)
+ if((o = (__ptr__) d.meth.searchf.exe(d,obj,type))!=null )
break;
dt.setPtr("walk", d);
return o;
}
- if((dt.getPtr("meth").getInt("type") & (0000010|0000004) )!=0)
+ if((dt.meth.type & (0000010|0000004) )!=0)
{ if(N(type & (0000200|0000400|0000010|0000020)) )
return null;
n = nk = null; p = null;
- for(d = dt; d!=null; d = (_dt_s) d.getPtr("view"))
- { if(N(o = (__ptr__) d.getPtr("meth").call("searchf", d, obj, type) ))
+ for(d = dt; d!=null; d = (ST_dt_s) d.view)
+ { if(N(o = (__ptr__) d.meth.searchf.exe(d, obj, type) ))
continue;
- ky = d.getPtr("disc").getInt("key");
- sz = d.getPtr("disc").getInt("size");
- lk = d.getPtr("disc").getInt("link");
- cmpf = (Dtcompar_f) d.getPtr("disc").getPtr("comparf");
+ ky = d.disc.key;
+ sz = d.disc.size;
+ lk = d.disc.link;
+ cmpf = (Dtcompar_f) d.disc.comparf;
ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky));
if(n!=null) /* get the right one among all dictionaries */
- { cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(d,ok,nk,d.getPtr("disc")) : (sz <= 0 ? strcmp((CString)ok,(CString)nk) : UNSUPPORTED_INT("memcmp(ok,nk,sz)")) );
+ { cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(d,ok,nk,d.disc) : (sz <= 0 ? strcmp((CString)ok,(CString)nk) : UNSUPPORTED_INT("memcmp(ok,nk,sz)")) );
if(((type & (0000010|0000200))!=0 && cmp < 0) ||
((type & (0000020|0000400))!=0 && cmp > 0) )
UNSUPPORTED("5o3u9aaanyd9yh74sjfkkofmo"); // goto a_dj;
@@ -214,33 +214,33 @@ LEAVING("6spidg45w8teb64726drdswaa","dtvsearch");
//3 dfryioch2xz35w8nq6lxbk5kh
// Dt_t* dtview(register Dt_t* dt, register Dt_t* view)
-public static _dt_s dtview(_dt_s dt, _dt_s view) {
+public static ST_dt_s dtview(ST_dt_s dt, ST_dt_s view) {
ENTERING("dfryioch2xz35w8nq6lxbk5kh","dtview");
try {
- _dt_s d;
- if ((dt.getPtr("data").getInt("type")&010000)!=0) dtrestore(dt,null);
+ ST_dt_s d;
+ if ((dt.data.type&010000)!=0) dtrestore(dt,null);
if(view!=null)
- { if ((view.getPtr("data").getInt("type")&010000)!=0) dtrestore(view,null);
- if(NEQ(view.getPtr("meth"), dt.getPtr("meth"))) /* must use the same method */
+ { if ((view.data.type&010000)!=0) dtrestore(view,null);
+ if(NEQ(view.meth, dt.meth)) /* must use the same method */
UNSUPPORTED("return null;");
}
/* make sure there won't be a cycle */
- for(d = view; d!=null; d = (_dt_s)d.getPtr("view"))
+ for(d = view; d!=null; d = (ST_dt_s)d.view)
if(EQ(d, dt))
return null;
/* no more viewing lower dictionary */
- if((d = (_dt_s)dt.getPtr("view"))!=null )
- d.setInt("nview", d.getInt("nview")-1);
+ if((d = (ST_dt_s)dt.view)!=null )
+ d.setInt("nview", d.nview-1);
dt.setPtr("walk", null);
dt.setPtr("view", null);
if(N(view))
- { dt.setPtr("searchf", dt.getPtr("meth").getPtr("searchf"));
+ { dt.setPtr("searchf", dt.meth.searchf);
return d;
}
/* ok */
dt.setPtr("view", view);
dt.setPtr("searchf", function(dtview__c.class, "dtvsearch"));
- view.setInt("nview", view.getInt("nview")+1 );
+ view.setInt("nview", view.nview+1 );
return view;
} finally {
LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview");
diff --git a/src/gen/lib/cgraph/apply__c.java b/src/gen/lib/cgraph/apply__c.java
index 3a83187..840289c 100644
--- a/src/gen/lib/cgraph/apply__c.java
+++ b/src/gen/lib/cgraph/apply__c.java
@@ -56,8 +56,8 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agobj_s;
-import h.Agraph_s;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
import smetana.core.CFunction;
import smetana.core.__ptr__;
@@ -230,10 +230,10 @@ throw new UnsupportedOperationException();
//3 95y4aknoddh42lieikrb72vxw
// static Agobj_t *subgraph_search(Agraph_t * sub, Agobj_t * g)
-public static Agobj_s subgraph_search(Agraph_s sub, Agobj_s g) {
+public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) {
ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search");
try {
- return (Agobj_s) sub.castTo(Agobj_s.class);
+ return (ST_Agobj_s) sub.castTo_ST_Agobj_s();
} finally {
LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search");
}
@@ -244,15 +244,15 @@ LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search");
//3 8s9l15wqucf1glmbeb6fmya8e
// static void rec_apply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, agobjsearchfn_t objsearch, int preorder)
-public static void rec_apply(Agraph_s g, Agobj_s obj, CFunction fn, __ptr__ arg, CFunction objsearch, boolean preorder) {
+public static void rec_apply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, CFunction objsearch, boolean preorder) {
ENTERING("8s9l15wqucf1glmbeb6fmya8e","rec_apply");
try {
- Agraph_s sub;
- Agobj_s subobj;
+ ST_Agraph_s sub;
+ ST_Agobj_s subobj;
if (preorder)
fn.exe(g, obj, arg);
for (sub = agfstsubg(g); sub!=null; sub = agnxtsubg(sub)) {
- if ((subobj = (Agobj_s) objsearch.exe(sub, obj))!=null)
+ if ((subobj = (ST_Agobj_s) objsearch.exe(sub, obj))!=null)
rec_apply(sub, subobj, fn, arg, objsearch, preorder);
}
if (N(preorder))
@@ -267,10 +267,10 @@ LEAVING("8s9l15wqucf1glmbeb6fmya8e","rec_apply");
//3 9hqql178zpl8iudlf6sgnv7aj
// int agapply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, int preorder)
-public static int agapply(Agraph_s g, Agobj_s obj, CFunction fn, __ptr__ arg, boolean preorder) {
+public static int agapply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, boolean preorder) {
ENTERING("9hqql178zpl8iudlf6sgnv7aj","agapply");
try {
- Agobj_s subobj;
+ ST_Agobj_s subobj;
CFunction objsearch=null;
switch (AGTYPE(obj)) {
case AGRAPH:
@@ -288,7 +288,7 @@ UNSUPPORTED("2pc67byzirrkhe1cmdoguh6i1"); // agerr(AGERR, "agapply: unknown obj
UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
break;
}
- if ((subobj = (Agobj_s) objsearch.exe(g, obj))!=null) {
+ if ((subobj = (ST_Agobj_s) objsearch.exe(g, obj))!=null) {
rec_apply(g, subobj, fn, arg, objsearch, preorder);
return 0;
} else
diff --git a/src/gen/lib/cgraph/attr__c.java b/src/gen/lib/cgraph/attr__c.java
index 4867d9a..7596ba8 100644
--- a/src/gen/lib/cgraph/attr__c.java
+++ b/src/gen/lib/cgraph/attr__c.java
@@ -75,18 +75,21 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agattr_s;
-import h.Agdatadict_s;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agobj_s;
-import h.Agraph_s;
-import h.Agrec_s;
-import h.Agsym_s;
+import h.ST_Agattr_s;
+import h.ST_Agdatadict_s;
import h.ST_Agdesc_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
+import h.ST_Agrec_s;
+import h.ST_Agsym_s;
import h.ST_Agtag_s;
-import h._dt_s;
-import h._dtdisc_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+
+import java.util.ArrayList;
+
import smetana.core.CString;
import smetana.core.Memory;
import smetana.core.Z;
@@ -262,15 +265,15 @@ static {
//3 4bm10isw1qq1eqcse8afbxee3
// Agdatadict_t *agdatadict(Agraph_t * g, int cflag)
-public static Agdatadict_s agdatadict(Agraph_s g, boolean cflag) {
+public static ST_Agdatadict_s agdatadict(ST_Agraph_s g, boolean cflag) {
ENTERING("4bm10isw1qq1eqcse8afbxee3","agdatadict");
try {
- Agdatadict_s rv;
- rv = (Agdatadict_s) aggetrec(g, DataDictName, false).castTo(Agdatadict_s.class);
+ ST_Agdatadict_s rv;
+ rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class);
if (rv!=null || N(cflag))
return rv;
init_all_attrs(g);
- rv = (Agdatadict_s) aggetrec(g, DataDictName, false).castTo(Agdatadict_s.class);
+ rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class);
return rv;
} finally {
LEAVING("4bm10isw1qq1eqcse8afbxee3","agdatadict");
@@ -282,23 +285,23 @@ LEAVING("4bm10isw1qq1eqcse8afbxee3","agdatadict");
//3 2b2cg0am9e1lwc0nqikl2wczb
// Dict_t *agdictof(Agraph_t * g, int kind)
-public static _dt_s agdictof(Agraph_s g, int kind) {
+public static ST_dt_s agdictof(ST_Agraph_s g, int kind) {
ENTERING("2b2cg0am9e1lwc0nqikl2wczb","agdictof");
try {
- Agdatadict_s dd;
- _dt_s dict;
+ ST_Agdatadict_s dd;
+ ST_dt_s dict;
dd = agdatadict(g, false);
if (dd!=null)
switch (kind) {
case AGRAPH:
- dict = (_dt_s) dd.getPtr("dict.g");
+ dict = (ST_dt_s) dd.dict_g;
break;
case AGNODE:
- dict = (_dt_s) dd.getPtr("dict.n");
+ dict = (ST_dt_s) dd.dict_n;
break;
case AGINEDGE:
case AGOUTEDGE:
- dict = (_dt_s) dd.getPtr("dict.e");
+ dict = (ST_dt_s) dd.dict_e;
break;
default:
System.err.println("agdictof: unknown kind "+ kind);
@@ -317,11 +320,11 @@ LEAVING("2b2cg0am9e1lwc0nqikl2wczb","agdictof");
//3 dbhw2q2jfsz9qwawchy0hxj4i
// Agsym_t *agnewsym(Agraph_t * g, char *name, char *value, int id, int kind)
-public static Agsym_s agnewsym(Agraph_s g, CString name, CString value, int id, int kind) {
+public static ST_Agsym_s agnewsym(ST_Agraph_s g, CString name, CString value, int id, int kind) {
ENTERING("dbhw2q2jfsz9qwawchy0hxj4i","agnewsym");
try {
- Agsym_s sym;
- sym = (Agsym_s) agalloc(g, sizeof(Agsym_s.class));
+ ST_Agsym_s sym;
+ sym = (ST_Agsym_s) agalloc(g, sizeof(ST_Agsym_s.class));
sym.setInt("kind", kind);
sym.setPtr("name", agstrdup(g, name));
sym.setPtr("defval", agstrdup(g, value));
@@ -359,29 +362,29 @@ throw new UnsupportedOperationException();
//3 alb1d5x6huba3q44ms1wt0rr5
// static Agdatadict_t *agmakedatadict(Agraph_t * g)
-public static Agdatadict_s agmakedatadict(Agraph_s g) {
+public static ST_Agdatadict_s agmakedatadict(ST_Agraph_s g) {
ENTERING("alb1d5x6huba3q44ms1wt0rr5","agmakedatadict");
try {
- Agraph_s par;
- Agdatadict_s parent_dd, dd;
- dd = (Agdatadict_s) agbindrec(g, DataDictName, sizeof(Agdatadict_s.class),
- false).castTo(Agdatadict_s.class);
- dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
- dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc.amp(),Z.z(). Dttree));
- dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
+ ST_Agraph_s par;
+ ST_Agdatadict_s parent_dd, dd;
+ dd = (ST_Agdatadict_s) agbindrec(g, DataDictName, sizeof(ST_Agdatadict_s.class),
+ false).castTo(ST_Agdatadict_s.class);
+ dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree));
+ dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc,Z.z(). Dttree));
+ dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree));
if ((par = agparent(g))!=null) {
parent_dd = agdatadict(par, false);
- dtview((_dt_s)dd.getPtr("dict.n"), (_dt_s)parent_dd.getPtr("dict.n"));
- dtview((_dt_s)dd.getPtr("dict.e"), (_dt_s)parent_dd.getPtr("dict.e"));
- dtview((_dt_s)dd.getPtr("dict.g"), (_dt_s)parent_dd.getPtr("dict.g"));
+ dtview((ST_dt_s)dd.dict_n, (ST_dt_s)parent_dd.dict_n);
+ dtview((ST_dt_s)dd.dict_e, (ST_dt_s)parent_dd.dict_e);
+ dtview((ST_dt_s)dd.dict_g, (ST_dt_s)parent_dd.dict_g);
} else {
if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) {
/* it's not ok to dtview here for several reasons. the proto
graph could change, and the sym indices don't match */
parent_dd = agdatadict(Z.z().ProtoGraph, false);
- agcopydict(parent_dd.getPtr("dict.n"), dd.getPtr("dict.n"), g, AGNODE);
- agcopydict(parent_dd.getPtr("dict.e"), dd.getPtr("dict.e"), g, AGEDGE);
- agcopydict(parent_dd.getPtr("dict.g"), dd.getPtr("dict.g"), g, AGRAPH);
+ agcopydict(parent_dd.dict_n, dd.dict_n, g, AGNODE);
+ agcopydict(parent_dd.dict_e, dd.dict_e, g, AGEDGE);
+ agcopydict(parent_dd.dict_g, dd.dict_g, g, AGRAPH);
}
}
return dd;
@@ -395,12 +398,12 @@ LEAVING("alb1d5x6huba3q44ms1wt0rr5","agmakedatadict");
//3 50wfzq5wy8wc7vuyvs3mrx5ct
// Agsym_t *agdictsym(Dict_t * dict, char *name)
-public static Agsym_s agdictsym(_dt_s dict, CString name) {
+public static ST_Agsym_s agdictsym(ST_dt_s dict, CString name) {
ENTERING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
try {
- Agsym_s key = (Agsym_s) Memory.malloc(Agsym_s.class);
+ ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class);
key.setPtr("name", name);
- return (Agsym_s) dict.call("searchf", (dict),key,0000004);
+ return (ST_Agsym_s) dict.searchf.exe((dict),key,0000004);
} finally {
LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
}
@@ -411,11 +414,11 @@ LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
//3 4wy4ggu70d7harhix8xnh5w4l
// Agsym_t *aglocaldictsym(Dict_t * dict, char *name)
-public static Agsym_s aglocaldictsym(_dt_s dict, CString name) {
+public static ST_Agsym_s aglocaldictsym(ST_dt_s dict, CString name) {
ENTERING("4wy4ggu70d7harhix8xnh5w4l","aglocaldictsym");
try {
- Agsym_s rv;
- _dt_s view;
+ ST_Agsym_s rv;
+ ST_dt_s view;
view = dtview(dict, null);
rv = agdictsym(dict, name);
dtview(dict, view);
@@ -430,15 +433,15 @@ LEAVING("4wy4ggu70d7harhix8xnh5w4l","aglocaldictsym");
//3 8hy9sl3zmwobwm960jz466ufe
// Agsym_t *agattrsym(void *obj, char *name)
-public static Agsym_s agattrsym(__ptr__ obj, CString name) {
+public static ST_Agsym_s agattrsym(__ptr__ obj, CString name) {
ENTERING("8hy9sl3zmwobwm960jz466ufe","agattrsym");
try {
- Agattr_s data;
- Agsym_s rv;
+ ST_Agattr_s data;
+ ST_Agsym_s rv;
CString arg = name;
- data = agattrrec(obj.castTo(Agobj_s.class));
+ data = agattrrec(obj.castTo(ST_Agobj_s.class));
if (data!=null)
- rv = agdictsym((_dt_s)data.getPtr("dict"), arg);
+ rv = agdictsym((ST_dt_s)data.dict, arg);
else
rv = null;
return rv;
@@ -456,10 +459,10 @@ public final static CString AgDataRecName = new CString("_AG_strdata");
//3 6az8xu0sgu1d6abu0xfpd89hi
// static int topdictsize(Agobj_t * obj)
-public static int topdictsize(Agobj_s obj) {
+public static int topdictsize(ST_Agobj_s obj) {
ENTERING("6az8xu0sgu1d6abu0xfpd89hi","topdictsize");
try {
- _dt_s d;
+ ST_dt_s d;
d = agdictof(agroot(agraphof(obj)), AGTYPE(obj));
return d!=null ? dtsize_(d) : 0;
} finally {
@@ -472,31 +475,31 @@ LEAVING("6az8xu0sgu1d6abu0xfpd89hi","topdictsize");
//3 3wjrlyjdlz8k9nfxenxsfiqmj
// static Agrec_t *agmakeattrs(Agraph_t * context, void *obj)
-public static Agrec_s agmakeattrs(Agraph_s context, __ptr__ obj) {
+public static ST_Agrec_s agmakeattrs(ST_Agraph_s context, __ptr__ obj) {
ENTERING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs");
try {
int sz;
- Agattr_s rec;
- Agsym_s sym;
- _dt_s datadict;
- rec = (Agattr_s) agbindrec(obj, AgDataRecName, sizeof(Agattr_s.class), false).castTo(Agattr_s.class);
+ ST_Agattr_s rec;
+ ST_Agsym_s sym;
+ ST_dt_s datadict;
+ rec = (ST_Agattr_s) agbindrec(obj, AgDataRecName, sizeof(ST_Agattr_s.class), false).castTo(ST_Agattr_s.class);
datadict = agdictof(context, AGTYPE(obj));
- if (rec.getPtr("dict") == null) {
- rec.setPtr("dict", agdictof(agroot(context), AGTYPE(obj)));
+ if (rec.dict == null) {
+ rec.dict = agdictof(agroot(context), AGTYPE(obj));
/* don't malloc(0) */
- sz = topdictsize((Agobj_s) obj);
+ sz = topdictsize((ST_Agobj_s) obj.castTo(ST_Agobj_s.class));
if (sz < 4)
sz = 4;
- rec.setPtr("str", agalloc(agraphof(obj), sizeof("char*", sz)));
+ rec.str = new ArrayList<CString>(); for (int i=0; i<sz; i++) rec.str.add(null);
/* doesn't call agxset() so no obj-modified callbacks occur */
- for (sym = (Agsym_s) ((__ptr__)datadict.call("searchf", datadict,null,0000200)); sym!=null;
- sym = (Agsym_s) ((__ptr__)datadict.call("searchf", datadict,sym,0000010)))
- rec.getArrayOfCString("str").plus(sym.getInt("id")).setCString( agstrdup(agraphof(obj), sym.getCString("defval")));
+ for (sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,null,0000200)); sym!=null;
+ sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,sym,0000010)))
+ rec.str.set(sym.id, agstrdup(agraphof(obj), sym.defval));
} else {
}
- return (Agrec_s) rec;
+ return (ST_Agrec_s) rec.castTo(ST_Agrec_s.class);
} finally {
LEAVING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs");
}
@@ -527,7 +530,7 @@ throw new UnsupportedOperationException();
//3 6b3c2syvj23lbf7kz0aal8vmc
// static void freesym(Dict_t * d, void * obj, Dtdisc_t * disc)
-public static void freesym(_dt_s d, Object obj, _dtdisc_s disc) {
+public static void freesym(ST_dt_s d, Object obj, ST_dtdisc_s disc) {
ENTERING("6b3c2syvj23lbf7kz0aal8vmc","freesym");
try {
UNSUPPORTED("bf9av4xbx61835st3og3wfqr8"); // static void freesym(Dict_t * d, void * obj, Dtdisc_t * disc)
@@ -552,10 +555,10 @@ LEAVING("6b3c2syvj23lbf7kz0aal8vmc","freesym");
//3 13sfx74lme08ur04vkrqta25j
// Agattr_t *agattrrec(void *obj)
-public static Agattr_s agattrrec(__ptr__ obj) {
+public static ST_Agattr_s agattrrec(__ptr__ obj) {
ENTERING("13sfx74lme08ur04vkrqta25j","agattrrec");
try {
- return (Agattr_s) aggetrec(obj, AgDataRecName, false).castTo(Agattr_s.class);
+ return (ST_Agattr_s) aggetrec(obj, AgDataRecName, false).castTo(ST_Agattr_s.class);
} finally {
LEAVING("13sfx74lme08ur04vkrqta25j","agattrrec");
}
@@ -566,18 +569,19 @@ LEAVING("13sfx74lme08ur04vkrqta25j","agattrrec");
//3 2io7b26wq70e7kwdlzsh6bw7f
// static void addattr(Agraph_t * g, Agobj_t * obj, Agsym_t * sym)
-public static void addattr(Agraph_s g, Agobj_s obj, Agsym_s sym) {
+public static void addattr(ST_Agraph_s g, ST_Agobj_s obj, ST_Agsym_s sym) {
ENTERING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
try {
- Agattr_s attr;
- attr = (Agattr_s) agattrrec(obj);
-
- if (sym.getInt("id") >= 4)
- attr.setPtr("str", (__ptr__) g.getPtr("clos").getPtr("disc").getPtr("mem").call("resize", g.getPtr("clos").getPtr("state").getPtr("mem"),
- attr.getPtr("str"),
- sizeof("char*", sym.getInt("id")),
- sizeof("char*", sym.getInt("id") + 1)));
- attr.getArrayOfCString("str").plus(sym.getInt("id")).setCString(agstrdup(g, sym.getCString("defval")));
+ ST_Agattr_s attr;
+ attr = (ST_Agattr_s) agattrrec(obj);
+
+ if (sym.id >= 4)
+// attr.str = (StarArrayOfCString) g.clos.disc.mem.call("resize", g.clos.state.mem,
+// attr.str,
+// sizeof("char*", sym.id),
+// sizeof("char*", sym.id + 1));
+ attr.str.add(null);
+ attr.str.set(sym.id, agstrdup(g, sym.defval));
/* agmethod_upd(g,obj,sym); JCE and GN didn't like this. */
} finally {
LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
@@ -589,48 +593,48 @@ LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
//3 a3qr8ug1rkxp6ocieyp41ly3o
// static Agsym_t *setattr(Agraph_t * g, int kind, char *name, char *value)
-public static Agsym_s setattr(Agraph_s g, int kind, CString name, CString value) {
+public static ST_Agsym_s setattr(ST_Agraph_s g, int kind, CString name, CString value) {
ENTERING("a3qr8ug1rkxp6ocieyp41ly3o","setattr");
try {
- Agdatadict_s dd;
- _dt_s ldict, rdict;
- Agsym_s lsym, psym, rsym, rv;
- Agraph_s root;
- Agnode_s n;
- Agedge_s e;
+ ST_Agdatadict_s dd;
+ ST_dt_s ldict, rdict;
+ ST_Agsym_s lsym, psym, rsym, rv;
+ ST_Agraph_s root;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
root = agroot(g);
dd = agdatadict(g, (N(0))); /* force initialization of string attributes */
ldict = agdictof(g, kind);
lsym = aglocaldictsym(ldict, name);
if (lsym!=null) { /* update old local definiton */
- agstrfree(g, lsym.getCString("defval"));
+ agstrfree(g, lsym.defval);
lsym.setPtr("defval", agstrdup(g, value));
rv = lsym;
} else {
psym = agdictsym(ldict, name); /* search with viewpath up to root */
if (psym!=null) { /* new local definition */
- lsym = agnewsym(g, name, value, psym.getInt("id"), kind);
- ldict.castTo(_dt_s.class).call("searchf",ldict,lsym,0000001);
+ lsym = agnewsym(g, name, value, psym.id, kind);
+ ldict.searchf.exe(ldict,lsym,0000001);
rv = lsym;
} else { /* new global definition */
rdict = agdictof(root, kind);
rsym = agnewsym(g, name, value, dtsize_(rdict), kind);
- rdict.castTo(_dt_s.class).call("searchf",rdict,rsym,0000001);
+ rdict.searchf.exe(rdict,rsym,0000001);
switch (kind) {
case AGRAPH:
- agapply(root, (Agobj_s) root.castTo(Agobj_s.class), function(attr__c.class, "addattr"),
+ agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"),
rsym, (N(0)));
break;
case AGNODE:
for (n = agfstnode(root); n!=null; n = agnxtnode(root, n))
- addattr(g, (Agobj_s) n.castTo(Agobj_s.class), rsym);
+ addattr(g, (ST_Agobj_s) n.castTo(ST_Agobj_s.class), rsym);
break;
case AGINEDGE:
case AGOUTEDGE:
for (n = agfstnode(root); n!=null; n = agnxtnode(root, n))
for (e = agfstout(root, n); e!=null; e = agnxtout(root, e))
- addattr(g, (Agobj_s) e.castTo(Agobj_s.class), rsym);
+ addattr(g, (ST_Agobj_s) e.castTo(ST_Agobj_s.class), rsym);
break;
}
rv = rsym;
@@ -650,11 +654,11 @@ LEAVING("a3qr8ug1rkxp6ocieyp41ly3o","setattr");
//3 8f80aahwb8cqc2t9592v47ttd
// static Agsym_t *getattr(Agraph_t * g, int kind, char *name)
-public static Agsym_s getattr(Agraph_s g, int kind, CString name) {
+public static ST_Agsym_s getattr(ST_Agraph_s g, int kind, CString name) {
ENTERING("8f80aahwb8cqc2t9592v47ttd","getattr");
try {
- Agsym_s rv = null;
- _dt_s dict;
+ ST_Agsym_s rv = null;
+ ST_dt_s dict;
dict = agdictof(g, kind);
if (dict!=null)
rv = agdictsym(dict, name); /* viewpath up to root */
@@ -669,13 +673,13 @@ LEAVING("8f80aahwb8cqc2t9592v47ttd","getattr");
//3 blr3drm2hxuzwd6gpeeb84yyg
// Agsym_t *agattr(Agraph_t * g, int kind, char *name, char *value)
-public static Agsym_s agattr(Agraph_s g, int kind, CString name, CString value) {
+public static ST_Agsym_s agattr(ST_Agraph_s g, int kind, CString name, CString value) {
ENTERING("blr3drm2hxuzwd6gpeeb84yyg","agattr");
try {
- Agsym_s rv;
+ ST_Agsym_s rv;
if (g == null) {
if (Z.z().ProtoGraph == null)
- Z.z().ProtoGraph = agopen(null, Z.z().ProtoDesc.copy(), null);
+ Z.z().ProtoGraph = agopen(null, (ST_Agdesc_s) Z.z().ProtoDesc.copy(), null);
g = Z.z().ProtoGraph;
}
if (value!=null)
@@ -716,13 +720,13 @@ throw new UnsupportedOperationException();
//3 ex2qtmuwz0o2e5svkujdbux78
// void agraphattr_init(Agraph_t * g)
-public static void agraphattr_init(Agraph_s g) {
+public static void agraphattr_init(ST_Agraph_s g) {
ENTERING("ex2qtmuwz0o2e5svkujdbux78","agraphattr_init");
try {
/* Agdatadict_t *dd; */
/* Agrec_t *attr; */
- Agraph_s context;
- ((ST_Agdesc_s)g.getStruct("desc")).has_attrs = 1;
+ ST_Agraph_s context;
+ ((ST_Agdesc_s)g.desc).has_attrs = 1;
/* dd = */ agmakedatadict(g);
if (N(context = agparent(g)))
context = g;
@@ -764,12 +768,12 @@ throw new UnsupportedOperationException();
//3 2pp4ot3pqy71jpfvu3g398y4y
// void agnodeattr_init(Agraph_t * g, Agnode_t * n)
-public static void agnodeattr_init(Agraph_s g, Agnode_s n) {
+public static void agnodeattr_init(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init");
try {
- Agattr_s data;
- data = (Agattr_s) agattrrec(n);
- if ((N(data)) || (N(data.getPtr("dict"))))
+ ST_Agattr_s data;
+ data = (ST_Agattr_s) agattrrec(n);
+ if ((N(data)) || (N(data.dict)))
agmakeattrs(g, n);
} finally {
LEAVING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init");
@@ -799,12 +803,12 @@ throw new UnsupportedOperationException();
//3 ckfzmnxfi0jiiayxmq38giw0r
// void agedgeattr_init(Agraph_t * g, Agedge_t * e)
-public static void agedgeattr_init(Agraph_s g, Agedge_s e) {
+public static void agedgeattr_init(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init");
try {
- Agattr_s data;
+ ST_Agattr_s data;
data = agattrrec(e);
- if ((N(data)) || (N(data.getPtr("dict"))))
+ if ((N(data)) || (N(data.dict)))
agmakeattrs(g, e);
} finally {
LEAVING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init");
@@ -837,15 +841,15 @@ throw new UnsupportedOperationException();
public static CString agget(__ptr__ obj, CString name) {
ENTERING("eydjyhexv5jr6vi7uhk0cgphv","agget");
try {
- Agsym_s sym;
- Agattr_s data;
+ ST_Agsym_s sym;
+ ST_Agattr_s data;
CString rv = null;
sym = agattrsym(obj, name);
if (sym == null)
rv = null; /* note was "", but this provides more info */
else {
- data = agattrrec(obj.castTo(Agobj_s.class));
- rv = data.getArrayOfCString("str").plus(sym.getInt("id")).getCString();
+ data = agattrrec(obj.castTo(ST_Agobj_s.class));
+ rv = data.str.get(sym.id);
}
return rv;
} finally {
@@ -858,14 +862,14 @@ LEAVING("eydjyhexv5jr6vi7uhk0cgphv","agget");
//3 9h5oymhfkp6k34zl0fonn10k9
// char *agxget(void *obj, Agsym_t * sym)
-public static CString agxget(__ptr__ obj, Agsym_s sym) {
+public static CString agxget(__ptr__ obj, ST_Agsym_s sym) {
ENTERING("9h5oymhfkp6k34zl0fonn10k9","agxget");
try {
- Agattr_s data;
+ ST_Agattr_s data;
CString rv;
- data = agattrrec(obj.castTo(Agobj_s.class));
+ data = agattrrec(obj.castTo(ST_Agobj_s.class));
- rv = data.getArrayOfCString("str").plus(sym.getInt("id")).getCString();
+ rv = data.str.get(sym.id);
return rv;
} finally {
LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget");
@@ -898,29 +902,29 @@ throw new UnsupportedOperationException();
//3 4q8xvstvl6fbijhucfd1endxc
// int agxset(void *obj, Agsym_t * sym, char *value)
-public static int agxset(__ptr__ obj, Agsym_s sym, CString value) {
+public static int agxset(__ptr__ obj, ST_Agsym_s sym, CString value) {
ENTERING("4q8xvstvl6fbijhucfd1endxc","agxset");
try {
- Agraph_s g;
- Agobj_s hdr;
- Agattr_s data;
- Agsym_s lsym;
+ ST_Agraph_s g;
+ ST_Agobj_s hdr;
+ ST_Agattr_s data;
+ ST_Agsym_s lsym;
g = agraphof(obj);
- hdr = (Agobj_s) obj.castTo(Agobj_s.class);
+ hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class);
data = agattrrec(hdr);
- agstrfree(g, data.getArrayOfCString("str").plus(sym.getInt("id")).getCString());
- data.getArrayOfCString("str").plus(sym.getInt("id")).setCString(agstrdup(g, value));
- if (((ST_Agtag_s)hdr.getStruct("tag")).objtype == AGRAPH) {
+ agstrfree(g, data.str.get(sym.id));
+ data.str.set(sym.id, agstrdup(g, value));
+ if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) {
/* also update dict default */
- _dt_s dict;
- dict = (_dt_s) agdatadict(g, false).getPtr("dict.g");
- if ((lsym = aglocaldictsym(dict, sym.getCString("name")))!=null) {
- agstrfree(g, lsym.getCString("defval"));
+ ST_dt_s dict;
+ dict = (ST_dt_s) agdatadict(g, false).dict_g;
+ if ((lsym = aglocaldictsym(dict, sym.name))!=null) {
+ agstrfree(g, lsym.defval);
lsym.setPtr("defval", agstrdup(g, value));
} else {
- lsym = agnewsym(g, sym.getCString("name"), value, sym.getInt("id"), AGTYPE(hdr));
- dict.call("searchf", dict, lsym, 0000001);
+ lsym = agnewsym(g, sym.name, value, sym.id, AGTYPE(hdr));
+ dict.searchf.exe(dict, lsym, 0000001);
}
}
agmethod_upd(g, obj, sym);
@@ -938,7 +942,7 @@ LEAVING("4q8xvstvl6fbijhucfd1endxc","agxset");
public static int agsafeset(__ptr__ obj, CString name, CString value, CString def) {
ENTERING("9b7vn95cin8o7mb2f21exh1qr","agsafeset");
try {
- Agsym_s a;
+ ST_Agsym_s a;
a = agattr(agraphof(obj), AGTYPE(obj), name, null);
if (N(a))
a = agattr(agraphof(obj), AGTYPE(obj), name, def);
diff --git a/src/gen/lib/cgraph/edge__c.java b/src/gen/lib/cgraph/edge__c.java
index 861d1f4..80a8816 100644
--- a/src/gen/lib/cgraph/edge__c.java
+++ b/src/gen/lib/cgraph/edge__c.java
@@ -79,26 +79,22 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agattr_s;
-import h.Agedge_s;
-import h.Agedgepair_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsubnode_s;
-import h.Agtag_s;
+import h.ST_Agattr_s;
import h.ST_Agdesc_s;
+import h.ST_Agedge_s;
+import h.ST_Agedgepair_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Agsubnode_s;
import h.ST_Agtag_s;
-import h._dt_s;
-import h._dtdisc_s;
-import h._dtlink_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_dtlink_s;
import smetana.core.ACCESS;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.Memory;
import smetana.core.STARSTAR;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class edge__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -241,16 +237,16 @@ public class edge__c {
//3 9vamtktowqtk4955i546z9obw
// Agedge_t *agfstout(Agraph_t * g, Agnode_t * n)
-public static Agedge_s agfstout(Agraph_s g, Agnode_s n) {
+public static ST_Agedge_s agfstout(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("9vamtktowqtk4955i546z9obw","agfstout");
try {
- Agsubnode_s sn;
- Agedge_s e = null;
+ ST_Agsubnode_s sn;
+ ST_Agedge_s e = null;
sn = agsubrep(g, n);
if (sn!=null) {
- dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("out_seq"));
- e = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200);
- sn.setPtr("out_seq", dtextract((_dt_s)g.getPtr("e_seq")));
+ dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
+ e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
+ sn.out_seq = dtextract((ST_dt_s)g.e_seq);
}
return e;
} finally {
@@ -263,18 +259,18 @@ LEAVING("9vamtktowqtk4955i546z9obw","agfstout");
//3 1qh7mgqwomkdqvczauv4ex1lu
// Agedge_t *agnxtout(Agraph_t * g, Agedge_t * e)
-public static Agedge_s agnxtout(Agraph_s g, Agedge_s e) {
+public static ST_Agedge_s agnxtout(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
try {
- Agnode_s n;
- Agsubnode_s sn;
- Agedge_s f = null;
+ ST_Agnode_s n;
+ ST_Agsubnode_s sn;
+ ST_Agedge_s f = null;
n = AGTAIL(e);
sn = agsubrep(g, n);
if (sn!=null) {
- dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("out_seq"));
- f = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010);
- sn.setPtr("out_seq", dtextract((_dt_s)g.getPtr("e_seq")));
+ dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
+ f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
+ sn.out_seq = dtextract((ST_dt_s)g.e_seq);
}
return f;
} finally {
@@ -287,16 +283,16 @@ LEAVING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
//3 c60qt3ycq0xweabgtqt16xe93
// Agedge_t *agfstin(Agraph_t * g, Agnode_t * n)
-public static Agedge_s agfstin(Agraph_s g, Agnode_s n) {
+public static ST_Agedge_s agfstin(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin");
try {
- Agsubnode_s sn;
- Agedge_s e = null;
+ ST_Agsubnode_s sn;
+ ST_Agedge_s e = null;
sn = agsubrep(g, n);
if (sn!=null) {
- dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("in_seq"));
- e = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200);
- sn.setPtr("in_seq", dtextract((_dt_s)g.getPtr("e_seq")));
+ dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
+ e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
+ sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
}
return e;
} finally {
@@ -309,18 +305,18 @@ LEAVING("c60qt3ycq0xweabgtqt16xe93","agfstin");
//3 f2af4x97mqn16npd6alsw7avs
// Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e)
-public static Agedge_s agnxtin(Agraph_s g, Agedge_s e) {
+public static ST_Agedge_s agnxtin(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("f2af4x97mqn16npd6alsw7avs","agnxtin");
try {
- Agnode_s n;
- Agsubnode_s sn;
- Agedge_s f = null;
+ ST_Agnode_s n;
+ ST_Agsubnode_s sn;
+ ST_Agedge_s f = null;
n = AGHEAD(e);
sn = agsubrep(g, n);
if (sn!=null) {
- dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("in_seq"));
- f = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010);
- sn.setPtr("in_seq", dtextract((_dt_s)g.getPtr("e_seq")));
+ dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
+ f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
+ sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
}
return f;
} finally {
@@ -333,10 +329,10 @@ LEAVING("f2af4x97mqn16npd6alsw7avs","agnxtin");
//3 6nwyo5bklramr0d093aa1h25o
// Agedge_t *agfstedge(Agraph_t * g, Agnode_t * n)
-public static Agedge_s agfstedge(Agraph_s g, Agnode_s n) {
+public static ST_Agedge_s agfstedge(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("6nwyo5bklramr0d093aa1h25o","agfstedge");
try {
- Agedge_s rv;
+ ST_Agedge_s rv;
rv = agfstout(g, n);
if (rv == null)
rv = agfstin(g, n);
@@ -351,22 +347,22 @@ LEAVING("6nwyo5bklramr0d093aa1h25o","agfstedge");
//3 8zy2u6gsi2xzv2ffv8o4v4uvf
// Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n)
-public static Agedge_s agnxtedge(Agraph_s g, Agedge_s e, Agnode_s n) {
+public static ST_Agedge_s agnxtedge(ST_Agraph_s g, ST_Agedge_s e, ST_Agnode_s n) {
ENTERING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
try {
- Agedge_s rv;
+ ST_Agedge_s rv;
if (AGTYPE(e) == AGOUTEDGE) {
rv = agnxtout(g, e);
if (rv == null) {
do {
rv = N(rv) ? agfstin(g, n) : agnxtin(g,rv);
- } while (rv!=null && EQ(rv.getPtr("node"), n));
+ } while (rv!=null && EQ(rv.node, n));
}
} else {
do {
rv = agnxtin(g, e); /* so that we only see each edge once, */
e = rv;
- } while (rv!=null && EQ(rv.getPtr("node"), n)); /* ignore loops as in-edges */
+ } while (rv!=null && EQ(rv.node, n)); /* ignore loops as in-edges */
}
return rv;
} finally {
@@ -379,26 +375,26 @@ LEAVING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
//3 c175o6j61jqmfnl4o1g1h1mie
// static Agedge_t *agfindedge_by_key(Agraph_t * g, Agnode_t * t, Agnode_t * h, Agtag_t key)
-public static Agedge_s agfindedge_by_key(Agraph_s g, Agnode_s t, Agnode_s h, final __struct__<Agtag_s> key) {
+public static ST_Agedge_s agfindedge_by_key(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
// WARNING!! STRUCT
-return agfindedge_by_key_w_(g, t, h, key.copy());
+return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy());
}
-private static Agedge_s agfindedge_by_key_w_(Agraph_s g, Agnode_s t, Agnode_s h, final __struct__<Agtag_s> key) {
+private static ST_Agedge_s agfindedge_by_key_w_(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
try {
- Agedge_s e, template = (Agedge_s) Memory.malloc(Agedge_s.class);
- Agsubnode_s sn;
+ ST_Agedge_s e;
+ final ST_Agedge_s template = new ST_Agedge_s();
+ ST_Agsubnode_s sn;
if ((t == null) || (h == null))
return null;
- template.getStruct("base").setStruct("tag", key);
+ template.base.setStruct("tag", key);
template.setPtr("node", t); /* guess that fan-in < fan-out */
sn = agsubrep(g, h);
if (N(sn)) e = null;
else {
- dtrestore((_dt_s)g.getPtr("e_id"), (_dtlink_s)sn.getPtr("in_id"));
- e = (Agedge_s) ((__ptr__)g.getPtr("e_id").castTo(_dt_s.class).call("searchf", g.getPtr("e_id"),template,0000004));
- if (e!=null) e = (Agedge_s) e.castTo(Agedge_s.class);
- sn.setPtr("in_id", dtextract((_dt_s)g.getPtr("e_id")));
+ dtrestore((ST_dt_s)g.e_id, (ST_dtlink_s)sn.in_id);
+ e = ((ST_Agedge_s)g.e_id.searchf.exe(g.e_id,template,0000004));
+ sn.setPtr("in_id", dtextract((ST_dt_s)g.e_id));
}
return e;
} finally {
@@ -430,15 +426,15 @@ throw new UnsupportedOperationException();
//3 b32ssm6ex1pdz1b3nt4fwlhul
// Agsubnode_t *agsubrep(Agraph_t * g, Agnode_t * n)
-public static Agsubnode_s agsubrep(Agraph_s g, Agnode_s n) {
+public static ST_Agsubnode_s agsubrep(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
try {
- Agsubnode_s sn;
- final __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
- if (EQ(g, n.getPtr("root"))) sn = (Agsubnode_s) n.getStruct("mainsub").amp();
+ ST_Agsubnode_s sn;
+ final ST_Agsubnode_s template = new ST_Agsubnode_s();
+ if (EQ(g, n.root)) sn = (ST_Agsubnode_s) n.mainsub;
else {
template.setPtr("node", n);
- sn = (Agsubnode_s) g.getPtr("n_id").castTo(_dt_s.class).call("searchf", g.getPtr("n_id"), template.amp(), 0000004);
+ sn = (ST_Agsubnode_s) g.n_id.searchf.exe(g.n_id, template, 0000004);
}
return sn;
} finally {
@@ -451,11 +447,11 @@ LEAVING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
//3 6u0niow33w9gva780waluva4n
// static void ins(Dict_t * d, Dtlink_t ** set, Agedge_t * e)
-public static void ins(_dt_s d, STARSTAR<_dtlink_s> set, Agedge_s e) {
+public static void ins(ST_dt_s d, STARSTAR<ST_dtlink_s> set, ST_Agedge_s e) {
ENTERING("6u0niow33w9gva780waluva4n","ins");
try {
dtrestore(d, set.getMe());
- d.call("searchf", d,e,0000001);
+ d.searchf.exe(d,e,0000001);
set.setMe(dtextract(d));
} finally {
LEAVING("6u0niow33w9gva780waluva4n","ins");
@@ -485,56 +481,56 @@ throw new UnsupportedOperationException();
//3 8kizmg7gziussfgx8zs3qvkfw
// static void installedge(Agraph_t * g, Agedge_t * e)
-public static void installedge(Agraph_s g, Agedge_s e) {
+public static void installedge(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("8kizmg7gziussfgx8zs3qvkfw","installedge");
try {
- Agnode_s t, h;
- Agedge_s out, in;
- Agsubnode_s sn;
+ ST_Agnode_s t, h;
+ ST_Agedge_s out, in;
+ ST_Agsubnode_s sn;
out = AGMKOUT(e);
in = AGMKIN(e);
t = agtail(e);
h = aghead(e);
while (g!=null) {
if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break;
- sn = agsubrep(g, t); final Agsubnode_s sn1 = sn;
- ins((_dt_s)g.getPtr("e_seq"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn1.getPtr("out_seq");
+ sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn;
+ ins((ST_dt_s)g.e_seq,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn1.out_seq;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn1.setPtr("out_seq", obj);
}})
- , (Agedge_s)out);
- ins((_dt_s)g.getPtr("e_id"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn1.getPtr("out_id");
+ , (ST_Agedge_s)out);
+ ins((ST_dt_s)g.e_id,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn1.out_id;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn1.setPtr("out_id", obj);
}})
- , (Agedge_s)out);
- sn = agsubrep(g, h); final Agsubnode_s sn2 = sn;
- ins((_dt_s)g.getPtr("e_seq"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn2.getPtr("in_seq");
+ , (ST_Agedge_s)out);
+ sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn;
+ ins((ST_dt_s)g.e_seq,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn2.in_seq;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn2.setPtr("in_seq", obj);
}})
- , (Agedge_s)in);
- ins((_dt_s)g.getPtr("e_id"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn2.getPtr("in_id");
+ , (ST_Agedge_s)in);
+ ins((ST_dt_s)g.e_id,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn2.in_id;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn2.setPtr("in_id", obj);
}})
- , (Agedge_s)in);
+ , (ST_Agedge_s)in);
g = agparent(g);
}
} finally {
@@ -562,17 +558,17 @@ throw new UnsupportedOperationException();
//3 4rzjui6oo0k009o64bxwgjmvq
// static Agedge_t *newedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id)
-public static Agedge_s newedge(Agraph_s g, Agnode_s t, Agnode_s h, int id) {
+public static ST_Agedge_s newedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, int id) {
ENTERING("4rzjui6oo0k009o64bxwgjmvq","newedge");
try {
- Agedgepair_s e2;
- Agedge_s in, out;
+ ST_Agedgepair_s e2;
+ ST_Agedge_s in, out;
int seq;
agsubnode(g,t,(N(0)));
agsubnode(g,h,(N(0)));
- e2 = (Agedgepair_s) agalloc(g, sizeof(Agedgepair_s.class));
- in = (Agedge_s) e2.getStruct("in").amp();
- out = (Agedge_s) e2.getStruct("out").amp();
+ e2 = (ST_Agedgepair_s) agalloc(g, sizeof(ST_Agedgepair_s.class));
+ in = (ST_Agedge_s) e2.in;
+ out = (ST_Agedge_s) e2.out;
seq = agnextseq(g, AGEDGE);
AGTYPE(in, AGINEDGE);
AGTYPE(out, AGOUTEDGE);
@@ -583,8 +579,8 @@ try {
in.setPtr("node", t);
out.setPtr("node", h);
installedge(g, out);
- if (((ST_Agdesc_s)g.getStruct("desc")).has_attrs!=0) {
- agbindrec(out, AgDataRecName, sizeof(Agattr_s.class), false);
+ if (((ST_Agdesc_s)g.desc).has_attrs!=0) {
+ agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false);
agedgeattr_init(g, out);
}
agmethod_init(g, out);
@@ -599,13 +595,13 @@ LEAVING("4rzjui6oo0k009o64bxwgjmvq","newedge");
//3 1ufxhg5xnmll1pe5339477823
// static int ok_to_make_edge(Agraph_t * g, Agnode_t * t, Agnode_t * h)
-public static boolean ok_to_make_edge(Agraph_s g, Agnode_s t, Agnode_s h) {
+public static boolean ok_to_make_edge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h) {
ENTERING("1ufxhg5xnmll1pe5339477823","ok_to_make_edge");
try {
- final __struct__<Agtag_s> key = JUtils.from(Agtag_s.class);
+ final ST_Agtag_s key = new ST_Agtag_s();
/* protect against self, multi-edges in strict graphs */
if (agisstrict(g)) {
- if (g.getPtr("desc").getBoolean("no_loop") && (EQ(t, h))) /* simple graphs */
+ if (g.desc.no_loop!=0 && (EQ(t, h))) /* simple graphs */
return false;
key.___(Z.z().Tag);
key.setInt("objtype", 0); /* wild card */
@@ -653,10 +649,10 @@ throw new UnsupportedOperationException();
//3 4361pvzr3ozft2ov0fgx6t8bo
// Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, char *name, int cflag)
-public static Agedge_s agedge(Agraph_s g, Agnode_s t, Agnode_s h, CString name, boolean cflag) {
+public static ST_Agedge_s agedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, CString name, boolean cflag) {
ENTERING("4361pvzr3ozft2ov0fgx6t8bo","agedge");
try {
- Agedge_s e;
+ ST_Agedge_s e;
int id[] = new int[1];
int have_id;
have_id = agmapnametoid(g, AGEDGE, name, id, false);
@@ -766,11 +762,11 @@ throw new UnsupportedOperationException();
//3 30v8z3tlda81fbqbkzx6m9fkn
// Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int cflag)
-public static Agedge_s agsubedge(Agraph_s g, Agedge_s e, boolean cflag) {
+public static ST_Agedge_s agsubedge(ST_Agraph_s g, ST_Agedge_s e, boolean cflag) {
ENTERING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
try {
- Agnode_s t, h;
- Agedge_s rv;
+ ST_Agnode_s t, h;
+ ST_Agedge_s rv;
rv = null;
t = agsubnode(g, AGTAIL(e), cflag);
h = agsubnode(g, AGHEAD(e), cflag);
@@ -794,14 +790,14 @@ LEAVING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
//3 avk47eh26r45qk2dtoipwiqvz
// int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
-public static int agedgeidcmpf(_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, _dtdisc_s disc) {
+public static int agedgeidcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
ENTERING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
try {
int v;
- Agedge_s e0, e1;
- e0 = (Agedge_s) arg_e0;
- e1 = (Agedge_s) arg_e1;
- v = AGID(e0.getPtr("node")) - AGID(e1.getPtr("node"));
+ ST_Agedge_s e0, e1;
+ e0 = (ST_Agedge_s) arg_e0;
+ e1 = (ST_Agedge_s) arg_e1;
+ v = AGID(e0.node) - AGID(e1.node);
if (v == 0) { /* same node */
if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0))
v = 0;
@@ -819,14 +815,14 @@ LEAVING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
//3 b6jhzc16xvrknu4e7jp6zx0ue
// int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
-public static int agedgeseqcmpf(_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, _dtdisc_s disc) {
+public static int agedgeseqcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
ENTERING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf");
try {
int v;
- Agedge_s e0, e1;
- e0 = (Agedge_s) arg_e0;
- e1 = (Agedge_s) arg_e1;
- if (NEQ(e0.getPtr("node"), e1.getPtr("node"))) v = AGSEQ(e0.getPtr("node")) - AGSEQ(e1.getPtr("node"));
+ ST_Agedge_s e0, e1;
+ e0 = (ST_Agedge_s) arg_e0;
+ e1 = (ST_Agedge_s) arg_e1;
+ if (NEQ(e0.node, e1.node)) v = AGSEQ(e0.node) - AGSEQ(e1.node);
else v = (AGSEQ(e0) - AGSEQ(e1));
return ((v==0)?0:(v<0?-1:1));
} finally {
@@ -900,7 +896,7 @@ static {
//3 ceexs6t1q4jxwz6h0g8fszxp4
// Agnode_t *agtail(Agedge_t * e)
-public static Agnode_s agtail(Agedge_s e) {
+public static ST_Agnode_s agtail(ST_Agedge_s e) {
ENTERING("ceexs6t1q4jxwz6h0g8fszxp4","agtail");
try {
return AGTAIL(e);
@@ -914,10 +910,10 @@ LEAVING("ceexs6t1q4jxwz6h0g8fszxp4","agtail");
//3 3tj9gj3dvrpox6grrdd3rftd8
// Agnode_t *aghead(Agedge_t * e)
-public static Agnode_s aghead(__ptr__ e) {
+public static ST_Agnode_s aghead(__ptr__ e) {
ENTERING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
try {
- return AGHEAD((Agedge_s) e);
+ return AGHEAD((ST_Agedge_s) e);
} finally {
LEAVING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
}
@@ -928,10 +924,10 @@ LEAVING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
//3 15e6s5bh5hey2u79yoebir59w
// Agedge_t *agopp(Agedge_t * e)
-public static Agedge_s agopp(__ptr__ e) {
+public static ST_Agedge_s agopp(__ptr__ e) {
ENTERING("15e6s5bh5hey2u79yoebir59w","agopp");
try {
- return AGOPP((Agedge_s) e);
+ return AGOPP((ST_Agedge_s) e);
} finally {
LEAVING("15e6s5bh5hey2u79yoebir59w","agopp");
}
diff --git a/src/gen/lib/cgraph/graph__c.java b/src/gen/lib/cgraph/graph__c.java
index 64a36c3..b984e18 100644
--- a/src/gen/lib/cgraph/graph__c.java
+++ b/src/gen/lib/cgraph/graph__c.java
@@ -69,23 +69,21 @@ import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agclos_s;
-import h.Agdesc_s;
-import h.Agdisc_s;
-import h.Agmemdisc_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsubnode_s;
+import h.ST_Agclos_s;
import h.ST_Agdesc_s;
-import h._dt_s;
-import h._dtdisc_s;
-import h._dtlink_s;
+import h.ST_Agdisc_s;
+import h.ST_Agmemdisc_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Agsubnode_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_dtlink_s;
import smetana.core.ACCESS;
import smetana.core.CString;
import smetana.core.STARSTAR;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class graph__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -228,22 +226,22 @@ public class graph__c {
//3 bb2bu9iyqx0u6xx44l282vmch
// static Agclos_t *agclos(Agdisc_t * proto)
-public static Agclos_s agclos(Agdisc_s proto) {
+public static ST_Agclos_s agclos(ST_Agdisc_s proto) {
ENTERING("bb2bu9iyqx0u6xx44l282vmch","agclos");
try {
- Agmemdisc_s memdisc;
+ ST_Agmemdisc_s memdisc;
__ptr__ memclosure;
- Agclos_s rv;
+ ST_Agclos_s rv;
/* establish an allocation arena */
- memdisc = (Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z.z().AgMemDisc.amp());
- memclosure = (__ptr__) memdisc.call("open", proto);
- rv = (Agclos_s) memdisc.call("alloc", memclosure, sizeof(Agclos_s.class));
- rv.getStruct("disc").setPtr("mem", memdisc);
- rv.getStruct("state").setPtr("mem", memclosure);
- rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc.amp()));
+ memdisc = (ST_Agmemdisc_s) ((proto != null && proto.mem != null) ? proto.mem : Z.z().AgMemDisc);
+ memclosure = (__ptr__) memdisc.open.exe(proto);
+ rv = (ST_Agclos_s) memdisc.alloc.exe(memclosure, sizeof(ST_Agclos_s.class));
+ rv.disc.setPtr("mem", memdisc);
+ rv.state.setPtr("mem", memclosure);
+ rv.disc.setPtr("id", ((proto != null && proto.id != null) ? proto.id : Z.z().AgIdDisc));
// Translation bug in next line: should be AgIoDisc and not AgIdDisc
- // rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
- rv.setBoolean("callbacks_enabled", (N(0)));
+ // rv.disc.setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc));
+ rv.callbacks_enabled = (N(0));
return rv;
} finally {
LEAVING("bb2bu9iyqx0u6xx44l282vmch","agclos");
@@ -255,24 +253,24 @@ LEAVING("bb2bu9iyqx0u6xx44l282vmch","agclos");
//3 d5yqn56yii8cdoahswt4n6bug
// Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * arg_disc)
-public static Agraph_s agopen(CString name, final __struct__<Agdesc_s> desc, Agdisc_s arg_disc) {
+public static ST_Agraph_s agopen(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
// WARNING!! STRUCT
-return agopen_w_(name, desc.copy(), arg_disc);
+return agopen_w_(name, (ST_Agdesc_s) desc.copy(), arg_disc);
}
-private static Agraph_s agopen_w_(CString name, final __struct__<Agdesc_s> desc, Agdisc_s arg_disc) {
+private static ST_Agraph_s agopen_w_(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
ENTERING("d5yqn56yii8cdoahswt4n6bug","agopen");
try {
- Agraph_s g;
- Agclos_s clos;
+ ST_Agraph_s g;
+ ST_Agclos_s clos;
int gid[] = new int[1];
clos = agclos(arg_disc);
- g = (Agraph_s) clos.getStruct("disc").getPtr("mem").call("alloc", clos.getStruct("state").getPtr("mem"), sizeof(Agraph_s.class));
+ g = (ST_Agraph_s) clos.disc.mem.alloc.exe(clos.state.mem, sizeof(ST_Agraph_s.class));
AGTYPE(g, AGRAPH);
g.setPtr("clos", clos);
g.setStruct("desc", desc);
- ((ST_Agdesc_s)g.getStruct("desc")).maingraph = ASINT((N(0)));
+ ((ST_Agdesc_s)g.desc).maingraph = ASINT((N(0)));
g.setPtr("root", g);
- g.getPtr("clos").getStruct("state").setPtr("id", (__ptr__) g.getPtr("clos").getStruct("disc").getPtr("id").call("open", g, arg_disc));
+ g.clos.state.setPtr("id", (__ptr__) g.clos.disc.id.open.exe(g, arg_disc));
if (agmapnametoid(g, AGRAPH, name, gid, (N(0)))!=0)
AGID(g, gid[0]);
// /* else AGID(g) = 0 because we have no alternatives */
@@ -289,21 +287,21 @@ LEAVING("d5yqn56yii8cdoahswt4n6bug","agopen");
//3 8jyhwfdfm0a877qfz8cjlb8rk
// Agraph_t *agopen1(Agraph_t * g)
-public static Agraph_s agopen1(Agraph_s g) {
+public static ST_Agraph_s agopen1(ST_Agraph_s g) {
ENTERING("8jyhwfdfm0a877qfz8cjlb8rk","agopen1");
try {
- Agraph_s par;
- g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc.amp(), Z.z().Dttree));
- g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc.amp(), Z.z().Dttree));
- g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc.amp() : Z.z().Ag_subedge_seq_disc.amp(), Z.z().Dttree));
- g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc.amp() : Z.z().Ag_subedge_id_disc.amp(), Z.z().Dttree));
- g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc.amp(), Z.z().Dttree));
+ ST_Agraph_s par;
+ g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc, Z.z().Dttree));
+ g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc, Z.z().Dttree));
+ g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc : Z.z().Ag_subedge_seq_disc, Z.z().Dttree));
+ g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc : Z.z().Ag_subedge_id_disc, Z.z().Dttree));
+ g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc, Z.z().Dttree));
par = agparent(g);
if (par!=null) {
AGSEQ(g, agnextseq(par, AGRAPH));
- par.getPtr("g_dict").call("searchf", par.getPtr("g_dict"),g,0000001);
+ par.g_dict.searchf.exe(par.g_dict,g,0000001);
} /* else AGSEQ=0 */
- if (N(par) || ((ST_Agdesc_s)par.getStruct("desc")).has_attrs!=0)
+ if (N(par) || ((ST_Agdesc_s)par.desc).has_attrs!=0)
agraphattr_init(g);
agmethod_init(g, g);
return g;
@@ -381,12 +379,12 @@ throw new UnsupportedOperationException();
//3 axmdmml95l55vlp1vqmh0v5sn
// unsigned long agnextseq(Agraph_t * g, int objtype)
-public static int agnextseq(Agraph_s g, int objtype) {
+public static int agnextseq(ST_Agraph_s g, int objtype) {
ENTERING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
try {
- int tmp = g.getPtr("clos").getArrayOfInteger("seq").plus(objtype).getInt();
+ int tmp = g.clos.seq[objtype];
tmp++;
- g.getPtr("clos").getArrayOfInteger("seq").plus(objtype).setInt(tmp);
+ g.clos.seq[objtype]=tmp;
return tmp;
} finally {
LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
@@ -398,10 +396,10 @@ LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
//3 688euygrkbl10cveflgwalo2n
// int agnnodes(Agraph_t * g)
-public static int agnnodes(Agraph_s g) {
+public static int agnnodes(ST_Agraph_s g) {
ENTERING("688euygrkbl10cveflgwalo2n","agnnodes");
try {
- return dtsize_((_dt_s)g.getPtr("n_id"));
+ return dtsize_((ST_dt_s)g.n_id);
} finally {
LEAVING("688euygrkbl10cveflgwalo2n","agnnodes");
}
@@ -412,10 +410,10 @@ LEAVING("688euygrkbl10cveflgwalo2n","agnnodes");
//3 8zjne7uv8rfpmbv5t96zhnr4u
// int agnedges(Agraph_t * g)
-public static int agnedges(Agraph_s g) {
+public static int agnedges(ST_Agraph_s g) {
ENTERING("8zjne7uv8rfpmbv5t96zhnr4u","agnedges");
try {
- Agnode_s n;
+ ST_Agnode_s n;
int rv = 0;
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
rv += agdegree(g, n, (false), (N(0))); /* must use OUT to get self-arcs */
@@ -444,10 +442,10 @@ throw new UnsupportedOperationException();
//3 blvn1w3v0icnucu5m5xvbrba1
// int agisdirected(Agraph_t * g)
-public static boolean agisdirected(Agraph_s g) {
+public static boolean agisdirected(ST_Agraph_s g) {
ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
try {
- return ((ST_Agdesc_s)g.getStruct("desc")).directed!=0;
+ return ((ST_Agdesc_s)g.desc).directed!=0;
} finally {
LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
}
@@ -458,7 +456,7 @@ LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
//3 8thgds4eioot64flko26m8ns0
// int agisundirected(Agraph_t * g)
-public static boolean agisundirected(Agraph_s g) {
+public static boolean agisundirected(ST_Agraph_s g) {
ENTERING("8thgds4eioot64flko26m8ns0","agisundirected");
try {
return (NOT(agisdirected(g)));
@@ -472,10 +470,10 @@ LEAVING("8thgds4eioot64flko26m8ns0","agisundirected");
//3 9qgdebmdfrcfjm394bg59a7y5
// int agisstrict(Agraph_t * g)
-public static boolean agisstrict(Agraph_s g) {
+public static boolean agisstrict(ST_Agraph_s g) {
ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
try {
- return ((ST_Agdesc_s)g.getStruct("desc")).strict!=0;
+ return ((ST_Agdesc_s)g.desc).strict!=0;
} finally {
LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
}
@@ -500,7 +498,7 @@ throw new UnsupportedOperationException();
//3 abaldeo2ie6zi60cazxp7rv47
// static int cnt(Dict_t * d, Dtlink_t ** set)
-public static int cnt(_dt_s d, STARSTAR<_dtlink_s> set) {
+public static int cnt(ST_dt_s d, STARSTAR<ST_dtlink_s> set) {
ENTERING("abaldeo2ie6zi60cazxp7rv47","cnt");
try {
int rv;
@@ -544,29 +542,29 @@ throw new UnsupportedOperationException();
//3 2bz40qf0qo7pd6er1ut25gthp
// int agdegree(Agraph_t * g, Agnode_t * n, int want_in, int want_out)
-public static int agdegree(Agraph_s g, Agnode_s n, boolean want_in, boolean want_out) {
+public static int agdegree(ST_Agraph_s g, ST_Agnode_s n, boolean want_in, boolean want_out) {
ENTERING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
try {
- Agsubnode_s sn;
+ ST_Agsubnode_s sn;
int rv = 0;
sn = agsubrep(g, n);
- final Agsubnode_s sn1 = sn;
+ final ST_Agsubnode_s sn1 = sn;
if (sn!=null) {
- if (want_out) rv += cnt((_dt_s)g.getPtr("e_seq"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn1.getPtr("out_seq");
+ if (want_out) rv += cnt((ST_dt_s)g.e_seq,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn1.out_seq;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn1.setPtr("out_seq", obj);
}})
);
- if (want_in) rv += cnt((_dt_s)g.getPtr("e_seq"),
- STARSTAR.amp(new ACCESS<_dtlink_s>() {
- public _dtlink_s get() {
- return (_dtlink_s) sn1.getPtr("in_seq");
+ if (want_in) rv += cnt((ST_dt_s)g.e_seq,
+ STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
+ public ST_dtlink_s get() {
+ return (ST_dtlink_s) sn1.in_seq;
}
- public void set(_dtlink_s obj) {
+ public void set(ST_dtlink_s obj) {
sn1.setPtr("in_seq", obj);
}})
);
@@ -582,13 +580,13 @@ LEAVING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
//3 dhbtfzzp8n5yygqmhmluo9bxl
// int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
-public static int agraphidcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
+public static int agraphidcmpf(ST_dt_s d, ST_Agraph_s arg0, ST_Agraph_s arg1, ST_dtdisc_s disc) {
ENTERING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf");
try {
int v;
- Agraph_s sg0, sg1;
- sg0 = (Agraph_s) arg0;
- sg1 = (Agraph_s) arg1;
+ ST_Agraph_s sg0, sg1;
+ sg0 = (ST_Agraph_s) arg0;
+ sg1 = (ST_Agraph_s) arg1;
v = (AGID(sg0) - AGID(sg1));
return ((v==0)?0:(v<0?-1:1));
} finally {
diff --git a/src/gen/lib/cgraph/id__c.java b/src/gen/lib/cgraph/id__c.java
index 90b0493..ec591af 100644
--- a/src/gen/lib/cgraph/id__c.java
+++ b/src/gen/lib/cgraph/id__c.java
@@ -58,9 +58,9 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agdisc_s;
-import h.Agobj_s;
-import h.Agraph_s;
+import h.ST_Agdisc_s;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
import smetana.core.CString;
import smetana.core.Memory;
import smetana.core.Z;
@@ -203,7 +203,7 @@ public class id__c {
//3 a0a2zxsu8n019hzm1rwf1jc7f
// static void *idopen(Agraph_t * g, Agdisc_t* disc)
-public static Object idopen(Agraph_s g, Agdisc_s disc) {
+public static Object idopen(ST_Agraph_s g, ST_Agdisc_s disc) {
ENTERING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
try {
return g;
@@ -223,8 +223,8 @@ ENTERING("lsl0c1gejls1wv04ga6xy2cf","idmap");
try {
CString s;
if (str!=null) {
- Agraph_s g;
- g = (Agraph_s) state;
+ ST_Agraph_s g;
+ g = (ST_Agraph_s) state;
if (createflag)
s = agstrdup(g, str);
else
@@ -336,12 +336,12 @@ static {
//3 aq30wwcj4ugatsgx0zdtdmeed
// int agmapnametoid(Agraph_t * g, int objtype, char *str, unsigned long *result, int createflag)
-public static int agmapnametoid(Agraph_s g, int objtype, CString str, int result[], boolean createflag) {
+public static int agmapnametoid(ST_Agraph_s g, int objtype, CString str, int result[], boolean createflag) {
ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
try {
int rv;
if (str!=null && (str.charAt(0) != '%')) {
- rv = (Integer) g.getPtr("clos").getStruct("disc").getPtr("id").call("map", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, str, result, createflag);
+ rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, str, result, createflag);
if (rv!=0)
return rv;
}
@@ -354,7 +354,7 @@ try {
rv = 0;
if (createflag) {
/* get a new anonymous ID, and store in the internal map */
- rv = (Integer) g.getPtr("clos").getStruct("disc").getPtr("id").call("map", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, null, result,
+ rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, null, result,
createflag);
if (rv!=0 && str!=null)
aginternalmapinsert(g, objtype, str, result[0]);
@@ -403,21 +403,21 @@ throw new UnsupportedOperationException();
public static CString agnameof(__ptr__ obj) {
ENTERING("cctsybrl54fy799aynfej4iiy","agnameof");
try {
- Agraph_s g;
+ ST_Agraph_s g;
CString rv;
/* perform internal lookup first */
g = agraphof(obj);
if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null)
return rv;
- if (g.getPtr("clos").getStruct("disc").getPtr("id").getPtr("print")!=null) {
+ if (g.clos.disc.id.print!=null) {
if ((rv =
- (CString) g.getPtr("clos").getStruct("disc").getPtr("id").call("print", g.getPtr("clos").getStruct("state").getPtr("id"),
+ (CString) g.clos.disc.id.print.exe(g.clos.state.id,
AGTYPE(obj),
AGID(obj)))!=null)
return rv;
}
if (AGTYPE(obj) != AGEDGE) {
- rv = new CString("%"+obj.castTo(Agobj_s.class).getStruct("tag").getInt("id"));
+ rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.id);
}
else
rv = null;
@@ -432,10 +432,10 @@ LEAVING("cctsybrl54fy799aynfej4iiy","agnameof");
//3 emt63ldde99jnwe2vvjal9kt9
// void agregister(Agraph_t * g, int objtype, void *obj)
-public static void agregister(Agraph_s g, int objtype, Object obj) {
+public static void agregister(ST_Agraph_s g, int objtype, Object obj) {
ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister");
try {
- g.getPtr("clos").getStruct("disc").getPtr("id").call("idregister", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, obj);
+ g.clos.disc.id.idregister.exe(g.clos.state.id, objtype, obj);
} finally {
LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister");
}
diff --git a/src/gen/lib/cgraph/imap__c.java b/src/gen/lib/cgraph/imap__c.java
index eb8ed83..9ca615b 100644
--- a/src/gen/lib/cgraph/imap__c.java
+++ b/src/gen/lib/cgraph/imap__c.java
@@ -49,11 +49,10 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.IMapEntry_t;
-import h._dt_s;
+import h.ST_Agraph_s;
+import h.ST_IMapEntry_t;
+import h.ST_dt_s;
import smetana.core.CString;
-import smetana.core.Memory;
public class imap__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -239,7 +238,7 @@ throw new UnsupportedOperationException();
//3 mx2krtbgfhcihopw9rw8kcv3
// int aginternalmaplookup(Agraph_t * g, int objtype, char *str, unsigned long *result)
-public static int aginternalmaplookup(Agraph_s g, int objtype, CString str, int result[]) {
+public static int aginternalmaplookup(ST_Agraph_s g, int objtype, CString str, int result[]) {
ENTERING("mx2krtbgfhcihopw9rw8kcv3","aginternalmaplookup");
try {
UNSUPPORTED("9xuzgjxqveawe6v2n4x48r93l"); // int aginternalmaplookup(Agraph_t * g, int objtype, char *str,
@@ -303,16 +302,16 @@ throw new UnsupportedOperationException();
//3 3r16pkjiksv8i7o961ltxyge6
// static IMapEntry_t *find_isym(Agraph_t * g, int objtype, unsigned long id)
-public static IMapEntry_t find_isym(Agraph_s g, int objtype, int id) {
+public static ST_IMapEntry_t find_isym(ST_Agraph_s g, int objtype, int id) {
ENTERING("3r16pkjiksv8i7o961ltxyge6","find_isym");
try {
- _dt_s d;
- IMapEntry_t isym, itemplate = (IMapEntry_t) Memory.malloc(IMapEntry_t.class);
+ ST_dt_s d;
+ ST_IMapEntry_t isym, itemplate = new ST_IMapEntry_t();
if (objtype == AGINEDGE)
objtype = AGEDGE;
- if ((d = (_dt_s) g.getPtr("clos").getArrayOfPtr("lookup_by_id").plus(objtype).getPtr())!=null) {
+ if ((d = g.clos.lookup_by_id[objtype])!=null) {
itemplate.setInt("id", id);
- isym = (IMapEntry_t) UNSUPPORTED("(IMapEntry_t *) (*(((Dt_t*)(d))->searchf))((d),(void*)(&itemplate),0000004)");
+ isym = (ST_IMapEntry_t) UNSUPPORTED("(IMapEntry_t *) (*(((Dt_t*)(d))->searchf))((d),(void*)(&itemplate),0000004)");
} else
isym = null;
return isym;
@@ -326,12 +325,12 @@ LEAVING("3r16pkjiksv8i7o961ltxyge6","find_isym");
//3 foe6bvtujfevsc0f3m8aqln8
// char *aginternalmapprint(Agraph_t * g, int objtype, unsigned long id)
-public static CString aginternalmapprint(Agraph_s g, int objtype, int id) {
+public static CString aginternalmapprint(ST_Agraph_s g, int objtype, int id) {
ENTERING("foe6bvtujfevsc0f3m8aqln8","aginternalmapprint");
try {
- IMapEntry_t isym;
+ ST_IMapEntry_t isym;
if ((isym = find_isym(g, objtype, id))!=null)
- return isym.getCString("str");
+ return isym.str;
return null;
} finally {
LEAVING("foe6bvtujfevsc0f3m8aqln8","aginternalmapprint");
diff --git a/src/gen/lib/cgraph/mem__c.java b/src/gen/lib/cgraph/mem__c.java
index 7de15ad..fd2cac1 100644
--- a/src/gen/lib/cgraph/mem__c.java
+++ b/src/gen/lib/cgraph/mem__c.java
@@ -47,8 +47,8 @@ package gen.lib.cgraph;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agdisc_s;
-import h.Agraph_s;
+import h.ST_Agdisc_s;
+import h.ST_Agraph_s;
import smetana.core.__ptr__;
import smetana.core.size_t;
@@ -189,7 +189,7 @@ public class mem__c {
//3 akq0jgwdspf75ypeatgcnfn8w
// static void *memopen(Agdisc_t* disc)
-public static Object memopen(Agdisc_s disc) {
+public static Object memopen(ST_Agdisc_s disc) {
ENTERING("akq0jgwdspf75ypeatgcnfn8w","memopen");
try {
return null;
@@ -219,19 +219,26 @@ LEAVING("9mtjrx0vjzwuecjwpxylr9tag","memalloc");
//3 18v2hhjculhnb3b7fc4tx3yjw
// static void *memresize(void *heap, void *ptr, size_t oldsize, size_t request)
-public static Object memresize(Object... arg) {
-UNSUPPORTED("1s6udii0nias7f8g4vimpkefh"); // static void *memresize(void *heap, void *ptr, size_t oldsize,
-UNSUPPORTED("8zs6530gai5ogf503wd0333qh"); // size_t request)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("5ccnu5m92hidffpixzo964tna"); // void *rv;
-UNSUPPORTED("74rq74mh7lnfr9i3qmwsbx2hd"); // (void) heap;
-UNSUPPORTED("ebomd3babnm180zhyrfeg59wi"); // rv = realloc(ptr, request);
-UNSUPPORTED("bzgpl0js1bzsovafg9g24v4ya"); // if (request > oldsize)
-UNSUPPORTED("9cjvc6kya9bwic7bue6mcj8yf"); // memset((char *) rv + oldsize, 0, request - oldsize);
-UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static __ptr__ memresize(__ptr__ heap, __ptr__ ptr, size_t oldsize, size_t request) {
+ENTERING("18v2hhjculhnb3b7fc4tx3yjw","memresize");
+try {
+ request.realloc(ptr);
+ return ptr;
+} finally {
+LEAVING("18v2hhjculhnb3b7fc4tx3yjw","memresize");
+}
+//UNSUPPORTED("1s6udii0nias7f8g4vimpkefh"); // static void *memresize(void *heap, void *ptr, size_t oldsize,
+//UNSUPPORTED("8zs6530gai5ogf503wd0333qh"); // size_t request)
+//UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
+//UNSUPPORTED("5ccnu5m92hidffpixzo964tna"); // void *rv;
+//UNSUPPORTED("74rq74mh7lnfr9i3qmwsbx2hd"); // (void) heap;
+//UNSUPPORTED("ebomd3babnm180zhyrfeg59wi"); // rv = realloc(ptr, request);
+//UNSUPPORTED("bzgpl0js1bzsovafg9g24v4ya"); // if (request > oldsize)
+//UNSUPPORTED("9cjvc6kya9bwic7bue6mcj8yf"); // memset((char *) rv + oldsize, 0, request - oldsize);
+//UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
+//UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+//
+//throw new UnsupportedOperationException();
}
@@ -265,11 +272,11 @@ static {
//3 7newv1hmzvt4vtttc9cxdxfpn
// void *agalloc(Agraph_t * g, size_t size)
-public static __ptr__ agalloc(Agraph_s g, size_t size) {
+public static __ptr__ agalloc(ST_Agraph_s g, size_t size) {
ENTERING("7newv1hmzvt4vtttc9cxdxfpn","agalloc");
try {
__ptr__ mem;
- mem = (__ptr__) g.getPtr("clos").getStruct("disc").getPtr("mem").call("alloc", g.getPtr("clos").getStruct("state").getPtr("mem"), size);
+ mem = (__ptr__) g.clos.disc.mem.alloc.exe(g.clos.state.mem, size);
if (mem == null)
System.err.println("memory allocation failure");
return mem;
diff --git a/src/gen/lib/cgraph/node__c.java b/src/gen/lib/cgraph/node__c.java
index 67bf6d0..25c5860 100644
--- a/src/gen/lib/cgraph/node__c.java
+++ b/src/gen/lib/cgraph/node__c.java
@@ -68,14 +68,14 @@ import static smetana.core.Macro.AGSEQ;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agattr_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsubnode_s;
+import h.ST_Agattr_s;
import h.ST_Agdesc_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Agsubnode_s;
import h.ST_Agtag_s;
-import h._dt_s;
-import h._dtdisc_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
import smetana.core.CString;
import smetana.core.Z;
import smetana.core.__ptr__;
@@ -215,18 +215,18 @@ public class node__c {
-//3 4w89du6uel405pm3vxsr3ayxt
-// Agnode_t *agfindnode_by_id(Agraph_t * g, unsigned long id)
//private static __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
//private static __struct__<Agnode_s> dummy = JUtils.from(Agnode_s.class);
-public static Agnode_s agfindnode_by_id(Agraph_s g, int id) {
+//3 4w89du6uel405pm3vxsr3ayxt
+// Agnode_t *agfindnode_by_id(Agraph_t * g, unsigned long id)
+public static ST_Agnode_s agfindnode_by_id(ST_Agraph_s g, int id) {
ENTERING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
try {
- Agsubnode_s sn;
- ((ST_Agtag_s)Z.z().dummy.getStruct("base").getStruct("tag")).id = id;
- Z.z().template.setPtr("node", Z.z().dummy.amp());
- sn = (Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z.z().template.amp(),0000004));
- return (Agnode_s) (sn!=null ? sn.getPtr("node") : null);
+ ST_Agsubnode_s sn;
+ ((ST_Agtag_s)Z.z().dummy.base.tag).id = id;
+ Z.z().template.node = Z.z().dummy;
+ sn = (ST_Agsubnode_s) (g.n_id.searchf.exe(g.n_id, Z.z().template,0000004));
+ return (ST_Agnode_s) (sn!=null ? sn.node : null);
} finally {
LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
}
@@ -255,12 +255,12 @@ throw new UnsupportedOperationException();
//3 55wopi2gd93zpmycxoywlxm0y
// Agnode_t *agfstnode(Agraph_t * g)
-public static Agnode_s agfstnode(Agraph_s g) {
+public static ST_Agnode_s agfstnode(ST_Agraph_s g) {
ENTERING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
try {
- Agsubnode_s sn;
- sn = (Agsubnode_s) g.getPtr("n_seq").castTo(_dt_s.class).call("searchf", g.getPtr("n_seq"),null,0000200);
- return sn!=null ? (Agnode_s) sn.getPtr("node") : null;
+ ST_Agsubnode_s sn;
+ sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,null,0000200);
+ return sn!=null ? (ST_Agnode_s) sn.node : null;
} finally {
LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
}
@@ -272,7 +272,7 @@ LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
//3 bek79ccvjys1j9q404i3y6oh8
// Agnode_t *agnxtnode(Agraph_t * g, Agnode_t * n)
public static int NB = 0;
-public static Agnode_s agnxtnode(Agraph_s g, Agnode_s n) {
+public static ST_Agnode_s agnxtnode(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("bek79ccvjys1j9q404i3y6oh8","agnxtnode");
try {
//ZOOTO
@@ -281,14 +281,14 @@ try {
}
NB++;
LOG2("NB="+NB);
- Agsubnode_s sn;
+ ST_Agsubnode_s sn;
sn = agsubrep(g, n);
LOG2("sn1="+sn);
- if (sn!=null) sn = (Agsubnode_s) g.getPtr("n_seq").castTo(_dt_s.class).call("searchf", g.getPtr("n_seq"),sn,0000010);
+ if (sn!=null) sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,sn,0000010);
LOG2("sn2="+sn);
- final __ptr__ result = sn!=null ? sn.getPtr("node") : null;
+ final __ptr__ result = sn!=null ? sn.node : null;
LOG2("result="+result);
- return (Agnode_s) result;
+ return (ST_Agnode_s) result;
} finally {
LEAVING("bek79ccvjys1j9q404i3y6oh8","agnxtnode");
}
@@ -332,17 +332,17 @@ throw new UnsupportedOperationException();
//3 dzb7m0p5xsngvtyr8zs912og4
// static Agnode_t *newnode(Agraph_t * g, unsigned long id, unsigned long seq)
-public static Agnode_s newnode(Agraph_s g, int id, int seq) {
+public static ST_Agnode_s newnode(ST_Agraph_s g, int id, int seq) {
ENTERING("dzb7m0p5xsngvtyr8zs912og4","newnode");
try {
- Agnode_s n;
- n = (Agnode_s) ((__ptr__)agalloc(g, sizeof(Agnode_s.class))).castTo(Agnode_s.class);
+ ST_Agnode_s n;
+ n = (ST_Agnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agnode_s.class))).castTo(ST_Agnode_s.class);
AGTYPE(n, AGNODE);
AGID(n, id);
AGSEQ(n, seq);
n.setPtr("root", agroot(g));
- if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0)
- agbindrec(n, AgDataRecName, sizeof(Agattr_s.class), false);
+ if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0)
+ agbindrec(n, AgDataRecName, sizeof(ST_Agattr_s.class), false);
/* nodeattr_init and method_init will be called later, from the
* subgraph where the node was actually created, but first it has
* to be installed in all the (sub)graphs up to root. */
@@ -357,17 +357,17 @@ LEAVING("dzb7m0p5xsngvtyr8zs912og4","newnode");
//3 4m26dpgaiw44hcleugjy71eus
// static void installnode(Agraph_t * g, Agnode_t * n)
-public static void installnode(Agraph_s g, Agnode_s n) {
+public static void installnode(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("4m26dpgaiw44hcleugjy71eus","installnode");
try {
- Agsubnode_s sn;
+ ST_Agsubnode_s sn;
int osize;
- osize = dtsize_((_dt_s)g.getPtr("n_id"));
- if (EQ(g, agroot(g))) sn = (Agsubnode_s) n.getStruct("mainsub").amp().castTo(Agsubnode_s.class);
- else sn = (Agsubnode_s) ((__ptr__)agalloc(g, sizeof(Agsubnode_s.class))).castTo(Agsubnode_s.class);
+ osize = dtsize_((ST_dt_s)g.n_id);
+ if (EQ(g, agroot(g))) sn = (ST_Agsubnode_s) n.mainsub;
+ else sn = (ST_Agsubnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agsubnode_s.class))).castTo(ST_Agsubnode_s.class);
sn.setPtr("node", n);
- g.getPtr("n_id").call("searchf", g.getPtr("n_id"),sn,0000001);
- g.getPtr("n_seq").call("searchf", g.getPtr("n_seq"),sn,0000001);
+ g.n_id.searchf.exe(g.n_id,sn,0000001);
+ g.n_seq.searchf.exe(g.n_seq,sn,0000001);
} finally {
LEAVING("4m26dpgaiw44hcleugjy71eus","installnode");
}
@@ -378,10 +378,10 @@ LEAVING("4m26dpgaiw44hcleugjy71eus","installnode");
//3 3mfxjcaeepn8nitirs3yoqaed
// static void installnodetoroot(Agraph_t * g, Agnode_t * n)
-public static void installnodetoroot(Agraph_s g, Agnode_s n) {
+public static void installnodetoroot(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("3mfxjcaeepn8nitirs3yoqaed","installnodetoroot");
try {
- Agraph_s par;
+ ST_Agraph_s par;
installnode(g, n);
if ((par = agparent(g))!=null)
installnodetoroot(par, n);
@@ -395,10 +395,10 @@ LEAVING("3mfxjcaeepn8nitirs3yoqaed","installnodetoroot");
//3 85bb9mezhsgtzar3kqz95mq1
// static void initnode(Agraph_t * g, Agnode_t * n)
-public static void initnode(Agraph_s g, Agnode_s n) {
+public static void initnode(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("85bb9mezhsgtzar3kqz95mq1","initnode");
try {
- if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0)
+ if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0)
agnodeattr_init(g,n);
agmethod_init(g, n);
} finally {
@@ -411,11 +411,11 @@ LEAVING("85bb9mezhsgtzar3kqz95mq1","initnode");
//3 1m6sl9df2yaolmufyq5i577a3
// Agnode_t *agidnode(Agraph_t * g, unsigned long id, int cflag)
-public static Agnode_s agidnode(Agraph_s g, int id, int cflag) {
+public static ST_Agnode_s agidnode(ST_Agraph_s g, int id, int cflag) {
ENTERING("1m6sl9df2yaolmufyq5i577a3","agidnode");
try {
- Agraph_s root;
- Agnode_s n;
+ ST_Agraph_s root;
+ ST_Agnode_s n;
n = agfindnode_by_id(g, id);
if ((n == null) && cflag!=0) {
UNSUPPORTED("7zol2448bccu90sqoxkvnbuif"); // root = agroot(g);
@@ -442,11 +442,11 @@ LEAVING("1m6sl9df2yaolmufyq5i577a3","agidnode");
//3 4yh1h1cwoitzb1t8869b79e3g
// Agnode_t *agnode(Agraph_t * g, char *name, int cflag)
-public static Agnode_s agnode(Agraph_s g, CString name, boolean cflag) {
+public static ST_Agnode_s agnode(ST_Agraph_s g, CString name, boolean cflag) {
ENTERING("4yh1h1cwoitzb1t8869b79e3g","agnode");
try {
- Agraph_s root;
- Agnode_s n;
+ ST_Agraph_s root;
+ ST_Agnode_s n;
int id[] = new int[1];
root = agroot(g);
/* probe for existing node */
@@ -588,12 +588,12 @@ throw new UnsupportedOperationException();
//3 d5farp22buvesyi4pydjam4g2
// Agnode_t *agsubnode(Agraph_t * g, Agnode_t * n0, int cflag)
-public static Agnode_s agsubnode(Agraph_s g, Agnode_s n0, boolean cflag) {
+public static ST_Agnode_s agsubnode(ST_Agraph_s g, ST_Agnode_s n0, boolean cflag) {
ENTERING("d5farp22buvesyi4pydjam4g2","agsubnode");
try {
- Agraph_s par;
- Agnode_s n;
- if (NEQ(agroot(g), n0.getPtr("root")))
+ ST_Agraph_s par;
+ ST_Agnode_s n;
+ if (NEQ(agroot(g), n0.root))
return null;
n = agfindnode_by_id(g, AGID(n0));
if ((n == null) && cflag) {
@@ -616,14 +616,14 @@ LEAVING("d5farp22buvesyi4pydjam4g2","agsubnode");
//3 awwiazixy9c76hvyxlkvvb3vo
// int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
-public static int agsubnodeidcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
+public static int agsubnodeidcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_dtdisc_s disc) {
ENTERING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
try {
int v;
- Agsubnode_s sn0, sn1;
- sn0 = (Agsubnode_s) arg0.castTo(Agsubnode_s.class);
- sn1 = (Agsubnode_s) arg1.castTo(Agsubnode_s.class);
- v = (AGID(sn0.getPtr("node")) - AGID(sn1.getPtr("node")));
+ ST_Agsubnode_s sn0, sn1;
+ sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
+ sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
+ v = (AGID(sn0.node) - AGID(sn1.node));
return ((v==0)?0:(v<0?-1:1));
} finally {
LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
@@ -635,14 +635,14 @@ LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
//3 41fjseux0nxzpr0aq7igym9ux
// int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
-public static int agsubnodeseqcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
+public static int agsubnodeseqcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_dtdisc_s disc) {
ENTERING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf");
try {
- Agsubnode_s sn0, sn1;
+ ST_Agsubnode_s sn0, sn1;
int v;
- sn0 = (Agsubnode_s) arg0.castTo(Agsubnode_s.class);
- sn1 = (Agsubnode_s) arg1.castTo(Agsubnode_s.class);
- v = (AGSEQ(sn0.getPtr("node")) - AGSEQ(sn1.getPtr("node")));
+ sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
+ sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
+ v = (AGSEQ(sn0.node) - AGSEQ(sn1.node));
return ((v==0)?0:(v<0?-1:1));
} finally {
LEAVING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf");
diff --git a/src/gen/lib/cgraph/obj__c.java b/src/gen/lib/cgraph/obj__c.java
index bfb3822..6412193 100644
--- a/src/gen/lib/cgraph/obj__c.java
+++ b/src/gen/lib/cgraph/obj__c.java
@@ -58,10 +58,10 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.UNSUPPORTED;
import h.Agcbstack_s;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsym_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Agsym_s;
import h.agobjfn_t;
import h.agobjupdfn_t;
import smetana.core.__ptr__;
@@ -275,11 +275,11 @@ throw new UnsupportedOperationException();
//3 c4ft3rxx9au29a2ns2nhod4dn
// void agmethod_init(Agraph_t * g, void *obj)
-public static void agmethod_init(Agraph_s g, __ptr__ obj) {
+public static void agmethod_init(ST_Agraph_s g, __ptr__ obj) {
ENTERING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init");
try {
- if (g.getPtr("clos").getBoolean("callbacks_enabled"))
- aginitcb(g, obj, (Agcbstack_s) g.getPtr("clos").getPtr("cb"));
+ if (g.clos.callbacks_enabled)
+ aginitcb(g, obj, (Agcbstack_s) g.clos.cb);
else
agrecord_callback(g, obj, 100, null);
} finally {
@@ -292,7 +292,7 @@ LEAVING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init");
//3 eobcsheti70b9gzoi3z968zev
// void aginitcb(Agraph_t * g, void *obj, Agcbstack_t * cbstack)
-public static void aginitcb(Agraph_s g, __ptr__ obj, Agcbstack_s cbstack) {
+public static void aginitcb(ST_Agraph_s g, __ptr__ obj, Agcbstack_s cbstack) {
ENTERING("eobcsheti70b9gzoi3z968zev","aginitcb");
try {
agobjfn_t fn;
@@ -326,11 +326,11 @@ LEAVING("eobcsheti70b9gzoi3z968zev","aginitcb");
//3 29p743rx2pw81slkoaayfeael
// void agmethod_upd(Agraph_t * g, void *obj, Agsym_t * sym)
-public static void agmethod_upd(Agraph_s g, __ptr__ obj, Agsym_s sym) {
+public static void agmethod_upd(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym) {
ENTERING("29p743rx2pw81slkoaayfeael","agmethod_upd");
try {
- if (g.getPtr("clos").getBoolean("callbacks_enabled"))
- agupdcb(g, obj, sym, (Agcbstack_s) g.getPtr("clos").getPtr("cb"));
+ if (g.clos.callbacks_enabled)
+ agupdcb(g, obj, sym, (Agcbstack_s) g.clos.cb);
else
agrecord_callback(g, obj, 101, sym);
} finally {
@@ -343,7 +343,7 @@ LEAVING("29p743rx2pw81slkoaayfeael","agmethod_upd");
//3 8t9rkcpdvmxph6krjvfmz3s51
// void agupdcb(Agraph_t * g, void *obj, Agsym_t * sym, Agcbstack_t * cbstack)
-public static void agupdcb(Agraph_s g, __ptr__ obj, Agsym_s sym, Agcbstack_s cbstack) {
+public static void agupdcb(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym, Agcbstack_s cbstack) {
ENTERING("8t9rkcpdvmxph6krjvfmz3s51","agupdcb");
try {
agobjupdfn_t fn;
@@ -425,17 +425,17 @@ throw new UnsupportedOperationException();
//3 53858x47ifwq7ldf9ukvpdc5r
// Agraph_t *agroot(void* obj)
-public static Agraph_s agroot(__ptr__ obj) {
+public static ST_Agraph_s agroot(__ptr__ obj) {
ENTERING("53858x47ifwq7ldf9ukvpdc5r","agroot");
try {
switch (AGTYPE(obj)) {
case AGINEDGE:
case AGOUTEDGE:
- return (Agraph_s) obj.castTo(Agedge_s.class).getPtr("node").getPtr("root");
+ return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root;
case AGNODE:
- return (Agraph_s) obj.castTo(Agnode_s.class).getPtr("root");
+ return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root;
case AGRAPH:
- return (Agraph_s) obj.castTo(Agraph_s.class).getPtr("root");
+ return (ST_Agraph_s) ((ST_Agraph_s)obj.castTo(ST_Agraph_s.class)).root;
default: /* actually can't occur if only 2 bit tags */
System.err.println("agroot of a bad object");
return null;
@@ -450,17 +450,17 @@ LEAVING("53858x47ifwq7ldf9ukvpdc5r","agroot");
//3 brxx6qho8cw09dg7o27lc7c6z
// Agraph_t *agraphof(void *obj)
-public static Agraph_s agraphof(__ptr__ obj) {
+public static ST_Agraph_s agraphof(__ptr__ obj) {
ENTERING("brxx6qho8cw09dg7o27lc7c6z","agraphof");
try {
switch (AGTYPE(obj)) {
case AGINEDGE:
case AGOUTEDGE:
- return (Agraph_s) obj.castTo(Agedge_s.class).getPtr("node").getPtr("root").castTo(Agraph_s.class);
+ return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root.castTo(ST_Agraph_s.class);
case AGNODE:
- return (Agraph_s) obj.castTo(Agnode_s.class).getPtr("root").castTo(Agraph_s.class);
+ return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root.castTo(ST_Agraph_s.class);
case AGRAPH:
- return (Agraph_s) obj.castTo(Agraph_s.class);
+ return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class);
default: /* actually can't occur if only 2 bit tags */
System.err.println("agraphof a bad object");
return null;
@@ -542,10 +542,10 @@ throw new UnsupportedOperationException();
//3 91ej8cxcc0kzgkg2yk3pdiifs
// int agcontains(Agraph_t* g, void* obj)
-public static boolean agcontains(Agraph_s g, __ptr__ obj) {
+public static boolean agcontains(ST_Agraph_s g, __ptr__ obj) {
ENTERING("91ej8cxcc0kzgkg2yk3pdiifs","agcontains");
try {
- Agraph_s subg;
+ ST_Agraph_s subg;
if (NEQ(agroot(g), agroot(obj))) return false;
switch (AGTYPE(obj)) {
case AGRAPH:
@@ -557,7 +557,7 @@ UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
case AGNODE:
return (agidnode(g, AGID(obj), 0) != null);
default:
- return (agsubedge(g, (Agedge_s) obj, false) != null);
+ return (agsubedge(g, (ST_Agedge_s) obj, false) != null);
}
} finally {
LEAVING("91ej8cxcc0kzgkg2yk3pdiifs","agcontains");
diff --git a/src/gen/lib/cgraph/rec__c.java b/src/gen/lib/cgraph/rec__c.java
index d04fe85..bd31c9a 100644
--- a/src/gen/lib/cgraph/rec__c.java
+++ b/src/gen/lib/cgraph/rec__c.java
@@ -63,11 +63,10 @@ import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agobj_s;
-import h.Agraph_s;
-import h.Agrec_s;
-import h.ST_Agdesc_s;
+import h.ST_Agedge_s;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
+import h.ST_Agrec_s;
import h.ST_Agtag_s;
import smetana.core.CString;
import smetana.core.__ptr__;
@@ -210,16 +209,16 @@ public class rec__c {
//3 62z9z5vraa2as0c9t108j9xaf
// static void set_data(Agobj_t * obj, Agrec_t * data, int mtflock)
-public static void set_data(Agobj_s obj, Agrec_s data, int mtflock) {
+public static void set_data(ST_Agobj_s obj, ST_Agrec_s data, int mtflock) {
ENTERING("62z9z5vraa2as0c9t108j9xaf","set_data");
try {
- Agedge_s e;
+ ST_Agedge_s e;
obj.setPtr("data", data);
- ((ST_Agtag_s)obj.getStruct("tag")).mtflock = mtflock;
+ ((ST_Agtag_s)obj.tag).mtflock = mtflock;
if ((AGTYPE(obj) == AGINEDGE) || (AGTYPE(obj) == AGOUTEDGE)) {
- e = (Agedge_s) agopp(obj.castTo(Agedge_s.class));
+ e = (ST_Agedge_s) agopp(obj.castTo(ST_Agedge_s.class));
AGDATA(e, data);
- ((ST_Agtag_s)e.getStruct("base").getStruct("tag")).mtflock = mtflock;
+ ((ST_Agtag_s)e.base.tag).mtflock = mtflock;
}
} finally {
LEAVING("62z9z5vraa2as0c9t108j9xaf","set_data");
@@ -231,28 +230,28 @@ LEAVING("62z9z5vraa2as0c9t108j9xaf","set_data");
//3 7p2ne3oknmyclvsw4lh3axtd8
// Agrec_t *aggetrec(void *obj, char *name, int mtf)
-public static Agrec_s aggetrec(__ptr__ obj, CString name, boolean mtf) {
+public static ST_Agrec_s aggetrec(__ptr__ obj, CString name, boolean mtf) {
ENTERING("7p2ne3oknmyclvsw4lh3axtd8","aggetrec");
try {
- Agobj_s hdr;
- Agrec_s d, first;
- hdr = (Agobj_s) obj.castTo(Agobj_s.class);
- first = d = (Agrec_s) hdr.getPtr("data");
+ ST_Agobj_s hdr;
+ ST_Agrec_s d, first;
+ hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class);
+ first = d = (ST_Agrec_s) hdr.data;
while (d!=null) {
- if (N(strcmp(name,d.getCString("name"))))
+ if (N(strcmp(name,d.name)))
break;
- d = (Agrec_s) d.getPtr("next");
+ d = (ST_Agrec_s) d.next;
if (EQ(d, first)) {
d = null;
break;
}
}
if (d!=null) {
- if (((ST_Agtag_s)hdr.getStruct("tag")).mtflock!=0) {
- if (mtf && NEQ(hdr.getPtr("data"), d))
+ if (((ST_Agtag_s)hdr.tag).mtflock!=0) {
+ if (mtf && NEQ(hdr.data, d))
System.err.println("move to front lock inconsistency");
} else {
- if (NEQ(d, first) || (mtf != ((((ST_Agtag_s)hdr.getStruct("tag")).mtflock)!=0)))
+ if (NEQ(d, first) || (mtf != ((((ST_Agtag_s)hdr.tag).mtflock)!=0)))
set_data(hdr, d, ASINT(mtf)); /* Always optimize */
}
}
@@ -267,24 +266,24 @@ LEAVING("7p2ne3oknmyclvsw4lh3axtd8","aggetrec");
//3 7sk4k5ipm2jnd244556g1kr6
// static void objputrec(Agraph_t * g, Agobj_t * obj, void *arg)
-public static void objputrec(Agraph_s g, Agobj_s obj, Object arg) {
+public static void objputrec(ST_Agraph_s g, ST_Agobj_s obj, Object arg) {
ENTERING("7sk4k5ipm2jnd244556g1kr6","objputrec");
try {
- Agrec_s firstrec, newrec;
- newrec = (Agrec_s) arg;
- firstrec = (Agrec_s) obj.getPtr("data");
+ ST_Agrec_s firstrec, newrec;
+ newrec = (ST_Agrec_s) arg;
+ firstrec = (ST_Agrec_s) obj.data;
if (firstrec == null)
- newrec.setPtr("next", newrec); /* 0 elts */
+ newrec.next = newrec; /* 0 elts */
else {
- if (EQ(firstrec.getPtr("next"), firstrec)) {
- firstrec.setPtr("next", newrec); /* 1 elt */
- newrec.setPtr("next", firstrec);
+ if (EQ(firstrec.next, firstrec)) {
+ firstrec.next = newrec; /* 1 elt */
+ newrec.next = firstrec;
} else {
- newrec.setPtr("next", firstrec.getPtr("next"));
- firstrec.setPtr("next", newrec);
+ newrec.next = firstrec.next;
+ firstrec.next = newrec;
}
}
- if (NOT(((ST_Agtag_s)obj.getStruct("tag")).mtflock))
+ if (NOT(((ST_Agtag_s)obj.tag).mtflock))
set_data(obj, newrec, (0));
} finally {
LEAVING("7sk4k5ipm2jnd244556g1kr6","objputrec");
@@ -299,17 +298,17 @@ LEAVING("7sk4k5ipm2jnd244556g1kr6","objputrec");
public static __ptr__ agbindrec(__ptr__ arg_obj, CString recname, size_t recsize, boolean mtf) {
ENTERING("dmh5i83l15mnn1pnu6f5dfv8l","agbindrec");
try {
- Agraph_s g;
- Agobj_s obj;
- Agrec_s rec;
- obj = (Agobj_s) arg_obj.castTo(Agobj_s.class);
+ ST_Agraph_s g;
+ ST_Agobj_s obj;
+ ST_Agrec_s rec;
+ obj = (ST_Agobj_s) arg_obj.castTo(ST_Agobj_s.class);
g = agraphof(obj);
rec = aggetrec(obj, recname, false);
if ((rec == null && recsize.isStrictPositive())) {
- rec = (Agrec_s) ((__ptr__)agalloc(g, recsize)).castTo(Agrec_s.class);
+ rec = (ST_Agrec_s) ((__ptr__)agalloc(g, recsize)).castTo(ST_Agrec_s.class);
// rec = (Agrec_s) Memory.malloc(Agrec_s.class);
rec.setPtr("name", agstrdup(g, recname));
- switch (((ST_Agtag_s)obj.getStruct("tag")).objtype) {
+ switch (((ST_Agtag_s)obj.tag).objtype) {
case AGRAPH:
objputrec(g, obj, rec);
break;
diff --git a/src/gen/lib/cgraph/refstr__c.java b/src/gen/lib/cgraph/refstr__c.java
index 0bc080a..c7d699a 100644
--- a/src/gen/lib/cgraph/refstr__c.java
+++ b/src/gen/lib/cgraph/refstr__c.java
@@ -52,16 +52,13 @@ import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h._dt_s;
-import h.refstr_t;
+import h.ST_Agraph_s;
+import h.ST_dt_s;
+import h.ST_refstr_t;
import smetana.core.ACCESS;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.OFFSET;
import smetana.core.STARSTAR;
import smetana.core.Z;
-import smetana.core.__struct__;
import smetana.core.size_t;
public class refstr__c {
@@ -228,30 +225,30 @@ static {
//3 f1nwss2xoaub1hyord232ugoj
// static Dict_t *refdict(Agraph_t * g)
-public static _dt_s refdict(final Agraph_s g) {
+public static ST_dt_s refdict(final ST_Agraph_s g) {
ENTERING("f1nwss2xoaub1hyord232ugoj","refdict");
try {
- STARSTAR<_dt_s> dictref;
+ STARSTAR<ST_dt_s> dictref;
if (g != null)
- dictref = STARSTAR.amp(new ACCESS<_dt_s>() {
- public _dt_s get() {
- return (_dt_s) g.getPtr("clos").getPtr("strdict");
+ dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
+ public ST_dt_s get() {
+ return (ST_dt_s) g.clos.strdict;
}
- public void set(_dt_s obj) {
- g.getPtr("clos").setPtr("strdict", obj);
+ public void set(ST_dt_s obj) {
+ g.clos.setPtr("strdict", obj);
}
});
else
- dictref = STARSTAR.amp(new ACCESS<_dt_s>() {
- public _dt_s get() {
+ dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
+ public ST_dt_s get() {
return Z.z().Refdict_default;
}
- public void set(_dt_s obj) {
+ public void set(ST_dt_s obj) {
Z.z().Refdict_default = obj;
}
});
if (dictref.getMe() == null) {
- dictref.setMe(agdtopen(g, Z.z().Refstrdisc.amp(), Z.z().Dttree));
+ dictref.setMe(agdtopen(g, Z.z().Refstrdisc, Z.z().Dttree));
}
Z.z().HTML_BIT = 1 << 31;
Z.z().CNT_BITS = ~Z.z().HTML_BIT;
@@ -280,14 +277,14 @@ throw new UnsupportedOperationException();
//3 9ts4wqhw2xafdv3tlcilneewq
// static refstr_t *refsymbind(Dict_t * strdict, char *s)
-public static refstr_t refsymbind(_dt_s strdict, CString s) {
+public static ST_refstr_t refsymbind(ST_dt_s strdict, CString s) {
ENTERING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
try {
- final __struct__<refstr_t> key = JUtils.from(refstr_t.class);
- refstr_t r;
+ final ST_refstr_t key = new ST_refstr_t();
+ ST_refstr_t r;
// key.setPtr("s", s.duplicate());
- key.setPtr("s", s);
- r = (refstr_t) strdict.call("searchf", strdict, key.amp(), 0000004);
+ key.setString(s);
+ r = (ST_refstr_t) strdict.searchf.exe(strdict, key, 0000004);
return r;
} finally {
LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
@@ -299,13 +296,13 @@ LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
//3 1scntgo71z7c2v15zapiyw59w
// static char *refstrbind(Dict_t * strdict, char *s)
-public static CString refstrbind(_dt_s strdict, CString s) {
+public static CString refstrbind(ST_dt_s strdict, CString s) {
ENTERING("1scntgo71z7c2v15zapiyw59w","refstrbind");
try {
- refstr_t r;
+ ST_refstr_t r;
r = refsymbind(strdict, s);
if (r!=null)
- return r.getCString("s");
+ return r.s;
else
return null;
} finally {
@@ -318,7 +315,7 @@ LEAVING("1scntgo71z7c2v15zapiyw59w","refstrbind");
//3 bb8aqjshw3ecae2lsmhigd0mc
// char *agstrbind(Agraph_t * g, char *s)
-public static CString agstrbind(Agraph_s g, CString s) {
+public static CString agstrbind(ST_Agraph_s g, CString s) {
ENTERING("bb8aqjshw3ecae2lsmhigd0mc","agstrbind");
try {
return refstrbind(refdict(g), s);
@@ -332,32 +329,31 @@ LEAVING("bb8aqjshw3ecae2lsmhigd0mc","agstrbind");
//3 86oznromwhn9qeym0k7pih73q
// char *agstrdup(Agraph_t * g, char *s)
-public static CString agstrdup(Agraph_s g, CString s) {
+public static CString agstrdup(ST_Agraph_s g, CString s) {
ENTERING("86oznromwhn9qeym0k7pih73q","agstrdup");
try {
- refstr_t r;
- _dt_s strdict;
+ ST_refstr_t r;
+ ST_dt_s strdict;
size_t sz;
if (s == null)
return null;
strdict = refdict(g);
- r = (refstr_t) refsymbind(strdict, s);
- if (r!=null) r = (refstr_t) r.castTo(refstr_t.class);
+ r = (ST_refstr_t) refsymbind(strdict, s);
if (r!=null)
- r.setInt("refcnt", r.getInt("refcnt")+1);
+ r.refcnt++;
else {
- sz = sizeof(refstr_t.class).plus(s.length());
+ sz = sizeof(ST_refstr_t.class).plus(s.length());
if (g!=null)
- r = (refstr_t) agalloc(g, sz);
+ r = (ST_refstr_t) agalloc(g, sz);
else
- r = (refstr_t) sz.malloc();
- r.setInt("refcnt", 1);
- r.setPtr("s", s.duplicate());
+ r = new ST_refstr_t();
+ r.refcnt = 1;
+ r.setString(s.duplicate());
// strcpy(r->store, s);
// r->s = r->store;
- strdict.call("searchf", strdict,r,0000001);
+ strdict.searchf.exe(strdict,r,0000001);
}
- return r.getCString("s");
+ return r.s;
} finally {
LEAVING("86oznromwhn9qeym0k7pih73q","agstrdup");
}
@@ -402,19 +398,18 @@ throw new UnsupportedOperationException();
//3 enhn1ajfo86a19dgm4b8lduz7
// int agstrfree(Agraph_t * g, char *s)
-public static int agstrfree(Agraph_s g, CString s) {
+public static int agstrfree(ST_Agraph_s g, CString s) {
ENTERING("enhn1ajfo86a19dgm4b8lduz7","agstrfree");
try {
- refstr_t r;
- _dt_s strdict;
+ ST_refstr_t r;
+ ST_dt_s strdict;
if (s == null)
return -1;
strdict = refdict(g);
- r = refsymbind(strdict, s);
- if (r!=null) r = (refstr_t) r.castTo(refstr_t.class);
- if (r!=null && (EQ(r.getPtr("s"), s))) {
- r.setInt("refcnt", r.getInt("refcnt")-1);
- if ((r.getInt("refcnt")!=0 && Z.z().CNT_BITS!=0) == false) {
+ r = (ST_refstr_t) refsymbind(strdict, s);
+ if (r!=null && (EQ(r.s, s))) {
+ r.refcnt--;
+ if ((r.refcnt!=0 && Z.z().CNT_BITS!=0) == false) {
agdtdelete(g, strdict, r);
/*
if (g) agfree(g,r);
@@ -438,11 +433,11 @@ LEAVING("enhn1ajfo86a19dgm4b8lduz7","agstrfree");
public static int aghtmlstr(CString s) {
ENTERING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
try {
- refstr_t key;
+ ST_refstr_t key;
if (s == null)
return 0;
- key = (refstr_t) s.addVirtualBytes(-OFFSET.create(refstr_t.class, "s").toInt());
- return (key.getInt("refcnt") & Z.z().HTML_BIT);
+ key = (ST_refstr_t) s.getParent();
+ return (key.refcnt & Z.z().HTML_BIT);
} finally {
LEAVING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
}
diff --git a/src/gen/lib/cgraph/subg__c.java b/src/gen/lib/cgraph/subg__c.java
index b602bca..58e4ff1 100644
--- a/src/gen/lib/cgraph/subg__c.java
+++ b/src/gen/lib/cgraph/subg__c.java
@@ -56,14 +56,12 @@ import static smetana.core.Macro.AGID;
import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
import h.ST_Agdesc_s;
-import h._dt_s;
+import h.ST_Agraph_s;
+import h.ST_dt_s;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class subg__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -202,13 +200,13 @@ public class subg__c {
//3 11ezyrsjsotjz9b3cyvb4ie8p
// static Agraph_t *agfindsubg_by_id(Agraph_t * g, unsigned long id)
-public static Agraph_s agfindsubg_by_id(Agraph_s g, int id) {
+public static ST_Agraph_s agfindsubg_by_id(ST_Agraph_s g, int id) {
ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
try {
- final __struct__<Agraph_s> template = JUtils.from(Agraph_s.class);
- agdtdisc(g, (_dt_s) g.getPtr("g_dict"), Z.z().Ag_subgraph_id_disc.amp());
- AGID(template.amp(), id);
- return (Agraph_s) g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"), template.amp(), 0000004);
+ final ST_Agraph_s template = new ST_Agraph_s();
+ agdtdisc(g, (ST_dt_s) g.g_dict, Z.z().Ag_subgraph_id_disc);
+ AGID(template, id);
+ return (ST_Agraph_s) g.g_dict.searchf.exe(g.g_dict, template, 0000004);
} finally {
LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
}
@@ -219,19 +217,19 @@ LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
//3 44saycxbfbr9lou0itlyewkb4
// static Agraph_t *localsubg(Agraph_t * g, unsigned long id)
-public static Agraph_s localsubg(Agraph_s g, int id) {
+public static ST_Agraph_s localsubg(ST_Agraph_s g, int id) {
ENTERING("44saycxbfbr9lou0itlyewkb4","localsubg");
try {
- Agraph_s subg;
+ ST_Agraph_s subg;
subg = agfindsubg_by_id(g, id);
if (subg!=null)
return subg;
- subg = (Agraph_s) agalloc(g, sizeof(Agraph_s.class));
- subg.setPtr("clos", g.getPtr("clos"));
- subg.setStruct("desc", g.getStruct("desc"));
- ((ST_Agdesc_s)subg.getStruct("desc")).maingraph = 0;
+ subg = (ST_Agraph_s) agalloc(g, sizeof(ST_Agraph_s.class));
+ subg.setPtr("clos", g.clos);
+ subg.setStruct("desc", g.desc);
+ ((ST_Agdesc_s)subg.desc).maingraph = 0;
subg.setPtr("parent", g);
- subg.setPtr("root", g.getPtr("root"));
+ subg.setPtr("root", g.root);
AGID(subg, id);
return agopen1(subg);
} finally {
@@ -262,11 +260,11 @@ throw new UnsupportedOperationException();
//3 a24jd4r2sdyb4lb2hyababrda
// Agraph_t *agsubg(Agraph_t * g, char *name, int cflag)
-public static Agraph_s agsubg(Agraph_s g, CString name, boolean cflag) {
+public static ST_Agraph_s agsubg(ST_Agraph_s g, CString name, boolean cflag) {
ENTERING("a24jd4r2sdyb4lb2hyababrda","agsubg");
try {
int id[] = new int[]{0};
- Agraph_s subg;
+ ST_Agraph_s subg;
if (name!=null && agmapnametoid(g, AGRAPH, name, id, false)!=0) {
/* might already exist */
if ((subg = agfindsubg_by_id(g, id[0]))!=null)
@@ -288,12 +286,12 @@ LEAVING("a24jd4r2sdyb4lb2hyababrda","agsubg");
//3 51eksrs0lhkgohunejlpwyc4k
// Agraph_t *agfstsubg(Agraph_t * g)
-public static Agraph_s agfstsubg(Agraph_s g) {
+public static ST_Agraph_s agfstsubg(ST_Agraph_s g) {
ENTERING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
try {
- __ptr__ tmp = (__ptr__)g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"),null,0000200);
- if (tmp!=null) tmp = tmp.castTo(Agraph_s.class);
- return (Agraph_s) tmp;
+ __ptr__ tmp = (__ptr__)g.g_dict.searchf.exe(g.g_dict,null,0000200);
+ if (tmp!=null) tmp = tmp.castTo(ST_Agraph_s.class);
+ return (ST_Agraph_s) tmp;
} finally {
LEAVING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
}
@@ -304,12 +302,15 @@ LEAVING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
//3 85c1qisrein0tzm2regoe61t
// Agraph_t *agnxtsubg(Agraph_t * subg)
-public static Agraph_s agnxtsubg(Agraph_s subg) {
+public static ST_Agraph_s agnxtsubg(ST_Agraph_s subg) {
ENTERING("85c1qisrein0tzm2regoe61t","agnxtsubg");
try {
- Agraph_s g;
+ ST_Agraph_s g;
g = agparent(subg);
- return g!=null ? (Agraph_s) g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"), subg, 0000010) : null;
+ if (g==null) return null;
+ __ptr__ tmp = (__ptr__) g.g_dict.searchf.exe(g.g_dict, subg, 0000010);
+ if (tmp==null) return null;
+ return (ST_Agraph_s) tmp.getPtr();
} finally {
LEAVING("85c1qisrein0tzm2regoe61t","agnxtsubg");
}
@@ -320,10 +321,10 @@ LEAVING("85c1qisrein0tzm2regoe61t","agnxtsubg");
//3 7kbp6j03hd7u6nnlivi0vt3ja
// Agraph_t *agparent(Agraph_t * g)
-public static Agraph_s agparent(Agraph_s g) {
+public static ST_Agraph_s agparent(ST_Agraph_s g) {
ENTERING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
try {
- return (Agraph_s) g.getPtr("parent");
+ return (ST_Agraph_s) g.parent;
} finally {
LEAVING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
}
diff --git a/src/gen/lib/cgraph/utils__c.java b/src/gen/lib/cgraph/utils__c.java
index d5b74b5..3b4913b 100644
--- a/src/gen/lib/cgraph/utils__c.java
+++ b/src/gen/lib/cgraph/utils__c.java
@@ -53,15 +53,14 @@ import static smetana.core.JUtils.function;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
import h.Dtmemory_f;
-import h._dt_s;
-import h._dtdisc_s;
-import h._dtmethod_s;
+import h.ST_Agraph_s;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_dtmethod_s;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.size_t;
-import smetana.core.amiga.StarStruct;
public class utils__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -204,10 +203,10 @@ public class utils__c {
//3 7dkudp41c9byhicatk2sxtxqk
// void *agdictobjmem(Dict_t * dict, void * p, size_t size, Dtdisc_t * disc)
-public static Object agdictobjmem(_dt_s dict, Object p, size_t size, _dtdisc_s disc) {
+public static Object agdictobjmem(ST_dt_s dict, Object p, size_t size, ST_dtdisc_s disc) {
ENTERING("7dkudp41c9byhicatk2sxtxqk","agdictobjmem");
try {
- Agraph_s g;
+ ST_Agraph_s g;
g = Z.z().Ag_dictop_G;
if (g!=null) {
if (p!=null)
@@ -252,12 +251,12 @@ throw new UnsupportedOperationException();
//3 48ox0bg1qmasrer8np51uwsyk
// Dict_t *agdtopen(Agraph_t * g, Dtdisc_t * disc, Dtmethod_t * method)
-public static _dt_s agdtopen(Agraph_s g, StarStruct disc, _dtmethod_s method) {
+public static ST_dt_s agdtopen(ST_Agraph_s g, ST_dtdisc_s disc, ST_dtmethod_s method) {
ENTERING("48ox0bg1qmasrer8np51uwsyk","agdtopen");
try {
Dtmemory_f memf;
- _dt_s d;
- memf = (Dtmemory_f) disc.getPtr("memoryf");
+ ST_dt_s d;
+ memf = (Dtmemory_f) disc.memoryf;
disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
Z.z().Ag_dictop_G = g;
d = dtopen(disc, method);
@@ -328,7 +327,7 @@ throw new UnsupportedOperationException();
//3 cym72wvu6zffc0vzoa93zha8
// void agdtdisc(Agraph_t * g, Dict_t * dict, Dtdisc_t * disc)
-public static void agdtdisc(Agraph_s g, _dt_s dict, _dtdisc_s disc) {
+public static void agdtdisc(ST_Agraph_s g, ST_dt_s dict, ST_dtdisc_s disc) {
ENTERING("cym72wvu6zffc0vzoa93zha8","agdtdisc");
try {
if (disc!=null && NEQ(dtdisc(dict, null, 0), disc)) {
diff --git a/src/gen/lib/circogen/block__c.java b/src/gen/lib/circogen/block__c.java
index 659bbbe..51ba70b 100644
--- a/src/gen/lib/circogen/block__c.java
+++ b/src/gen/lib/circogen/block__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class block__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/blockpath__c.java b/src/gen/lib/circogen/blockpath__c.java
index 4ed7134..c39f868 100644
--- a/src/gen/lib/circogen/blockpath__c.java
+++ b/src/gen/lib/circogen/blockpath__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class blockpath__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/blocktree__c.java b/src/gen/lib/circogen/blocktree__c.java
index b519d82..f94e66e 100644
--- a/src/gen/lib/circogen/blocktree__c.java
+++ b/src/gen/lib/circogen/blocktree__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class blocktree__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/circpos__c.java b/src/gen/lib/circogen/circpos__c.java
index ff2135c..435b70a 100644
--- a/src/gen/lib/circogen/circpos__c.java
+++ b/src/gen/lib/circogen/circpos__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class circpos__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/circular__c.java b/src/gen/lib/circogen/circular__c.java
index 93a8930..b26bd87 100644
--- a/src/gen/lib/circogen/circular__c.java
+++ b/src/gen/lib/circogen/circular__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class circular__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/circularinit__c.java b/src/gen/lib/circogen/circularinit__c.java
index 6a7d87d..d6df123 100644
--- a/src/gen/lib/circogen/circularinit__c.java
+++ b/src/gen/lib/circogen/circularinit__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class circularinit__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/deglist__c.java b/src/gen/lib/circogen/deglist__c.java
index 74b6856..9362984 100644
--- a/src/gen/lib/circogen/deglist__c.java
+++ b/src/gen/lib/circogen/deglist__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class deglist__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/edgelist__c.java b/src/gen/lib/circogen/edgelist__c.java
index 80ac12b..89050e7 100644
--- a/src/gen/lib/circogen/edgelist__c.java
+++ b/src/gen/lib/circogen/edgelist__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class edgelist__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/nodelist__c.java b/src/gen/lib/circogen/nodelist__c.java
index b9bef20..5784fd3 100644
--- a/src/gen/lib/circogen/nodelist__c.java
+++ b/src/gen/lib/circogen/nodelist__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class nodelist__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/circogen/nodeset__c.java b/src/gen/lib/circogen/nodeset__c.java
index 1d773c0..98f15a5 100644
--- a/src/gen/lib/circogen/nodeset__c.java
+++ b/src/gen/lib/circogen/nodeset__c.java
@@ -47,10 +47,7 @@ package gen.lib.circogen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class nodeset__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,27 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
-
//3 1n5xl70wxuabyf97mclvilsm6
@@ -388,16 +364,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/args__c.java b/src/gen/lib/common/args__c.java
index 825ef9e..53893b2 100644
--- a/src/gen/lib/common/args__c.java
+++ b/src/gen/lib/common/args__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class args__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/arrows__c.java b/src/gen/lib/common/arrows__c.java
index 00af6c0..5f3d48e 100644
--- a/src/gen/lib/common/arrows__c.java
+++ b/src/gen/lib/common/arrows__c.java
@@ -57,20 +57,15 @@ import static smetana.core.Macro.DIST2;
import static smetana.core.Macro.ED_conc_opp_flag;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.arrowdir_t;
-import h.bezier;
-import h.boxf;
-import h.inside_t;
-import h.pointf;
+import h.ST_Agedge_s;
+import h.ST_arrowdir_t;
+import h.ST_arrowname_t;
+import h.ST_bezier;
+import h.ST_inside_t;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.MutableDouble;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
-import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class arrows__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -330,14 +325,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -366,25 +361,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -408,16 +384,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -767,7 +743,7 @@ private final static __struct__ createArrowtypes(int type, double lenfact, CFunc
//3 3apnay8wumntfkvud64ov7fcf
// static char *arrow_match_name_frag(char *name, arrowname_t * arrownames, int *flag)
-public static CString arrow_match_name_frag(CString name, __array_of_struct__ arrownames, int flag[]) {
+public static CString arrow_match_name_frag(CString name, ST_arrowname_t[] arrowsynonyms, int flag[]) {
ENTERING("3apnay8wumntfkvud64ov7fcf","arrow_match_name_frag");
try {
UNSUPPORTED("cw8t22aa6zs16jqowqjjkzywg"); // static char *arrow_match_name_frag(char *name, arrowname_t * arrownames, int *flag)
@@ -845,11 +821,11 @@ LEAVING("2pveqb5qcgfxcqp410ub942eg","arrow_match_name");
//3 2szgwtfieaw58pea2ohjyu8ea
// void arrow_flags(Agedge_t * e, int *sflag, int *eflag)
-public static void arrow_flags(Agedge_s e, int sflag[], int eflag[]) {
+public static void arrow_flags(ST_Agedge_s e, int sflag[], int eflag[]) {
ENTERING("2szgwtfieaw58pea2ohjyu8ea","arrow_flags");
try {
CString attr;
- arrowdir_t arrowdir;
+ ST_arrowdir_t arrowdir;
sflag[0] = (0);
eflag[0] = agisdirected(agraphof(e)) ? 1 : (0);
if (Z.z().E_dir!=null && ((attr = agxget(e, Z.z().E_dir))).charAt(0)!='\0') {
@@ -884,18 +860,17 @@ LEAVING("2szgwtfieaw58pea2ohjyu8ea","arrow_flags");
//3 1yk5wl46i7rlzcern0tefd24s
// double arrow_length(edge_t * e, int flag)
-public static double arrow_length(Agedge_s e, int flag) {
+public static double arrow_length(ST_Agedge_s e, int flag) {
ENTERING("1yk5wl46i7rlzcern0tefd24s","arrow_length");
try {
- __ptr__ arrowtype;
double lenfact = 0.0;
int f, i;
for (i = 0; i < 4; i++) {
/* we don't simply index with flag because arrowtypes are not necessarily sorted */
f = (flag >> (i * 8)) & ((1 << 4) - 1);
- for (arrowtype = Z.z().Arrowtypes.asPtr(); arrowtype.getPtr("gen")!=null; arrowtype=arrowtype.plus(1)) {
- if (f == arrowtype.getInt("type")) {
- lenfact += arrowtype.getDouble("lenfact");
+ for (int arrowtype = 0; Z.z().Arrowtypes[arrowtype].gen!=null; arrowtype++) {
+ if (f == Z.z().Arrowtypes[arrowtype].type) {
+ lenfact += Z.z().Arrowtypes[arrowtype].lenfact;
break;
}
}
@@ -913,14 +888,14 @@ LEAVING("1yk5wl46i7rlzcern0tefd24s","arrow_length");
//3 7ymcsnwqkr1crisrga0kezh1f
// static boolean inside(inside_t * inside_context, pointf p)
-public static boolean inside(inside_t inside_context, final __struct__<pointf> p) {
+public static boolean inside(ST_inside_t inside_context, final ST_pointf p) {
// WARNING!! STRUCT
return inside_w_(inside_context, p.copy());
}
-private static boolean inside_w_(inside_t inside_context, final __struct__<pointf> p) {
+private static boolean inside_w_(ST_inside_t inside_context, final ST_pointf p) {
ENTERING("7ymcsnwqkr1crisrga0kezh1f","inside");
try {
- return DIST2(p, inside_context.getPtr("a.p").plus(0).getPtr()) <= inside_context.getPtr("a.r").getDouble();
+ return DIST2(p, inside_context.a_p.get(0)) <= inside_context.a_r.getDouble();
} finally {
LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside");
}
@@ -931,28 +906,28 @@ LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside");
//3 9eellwhg4gsa2pdszpeqihs2d
// int arrowEndClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int eflag)
-public static int arrowEndClip(Agedge_s e, __ptr__ ps, int startp, int endp, bezier spl, int eflag) {
+public static int arrowEndClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int eflag) {
ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
try {
- final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
- final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_inside_t inside_context = new ST_inside_t();
+ final ST_pointf.Array sp = new ST_pointf.Array( 4);
double elen;
MutableDouble elen2 = new MutableDouble(0);
elen = arrow_length(e, eflag);
elen2.setValue(elen * elen);
spl.setInt("eflag", eflag);
spl.setStruct("ep", ps.plus(endp + 3).getStruct());
- if (endp > startp && DIST2(ps.plus(endp).getPtr(), ps.plus(endp + 3).getPtr()) < elen2.getValue()) {
+ if (endp > startp && DIST2(ps.get(endp), ps.get(endp + 3)) < elen2.getValue()) {
endp -= 3;
}
sp.plus(3).setStruct(ps.plus(endp).getStruct());
sp.plus(2).setStruct(ps.plus(endp+1).getStruct());
sp.plus(1).setStruct(ps.plus(endp+2).getStruct());
- sp.plus(0).setStruct(spl.getStruct("ep"));
+ sp.plus(0).setStruct(spl.ep);
/* ensure endpoint starts inside */
inside_context.setPtr("a.p", sp.plus(0).asPtr());
inside_context.setPtr("a.r", elen2.amp());
- bezier_clip(inside_context.amp(), function(arrows__c.class, "inside"), sp, NOT(false));
+ bezier_clip(inside_context, function(arrows__c.class, "inside"), sp, NOT(false));
ps.plus(endp).setStruct(sp.plus(3).getStruct());
ps.plus(endp+1).setStruct(sp.plus(2).getStruct());
ps.plus(endp+2).setStruct(sp.plus(1).getStruct());
@@ -968,28 +943,28 @@ LEAVING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
//3 q7y4oxn0paexbgynmtg2zmiv
// int arrowStartClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int sflag)
-public static int arrowStartClip(Agedge_s e, __ptr__ ps, int startp, int endp, bezier spl, int sflag) {
+public static int arrowStartClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int sflag) {
ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip");
try {
- final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
- final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_inside_t inside_context = new ST_inside_t();
+ final ST_pointf.Array sp = new ST_pointf.Array( 4);
double slen;
MutableDouble slen2 = new MutableDouble(0);
slen = arrow_length(e, sflag);
slen2.setValue(slen * slen);
spl.setInt("sflag", sflag);
spl.setStruct("sp", ps.plus(startp).getStruct());
- if (endp > startp && DIST2(ps.plus(startp).getPtr(), ps.plus(startp + 3).getPtr()) < slen2.getValue()) {
+ if (endp > startp && DIST2(ps.get(startp), ps.get(startp + 3)) < slen2.getValue()) {
startp += 3;
}
sp.plus(0).setStruct(ps.plus(startp+3).getStruct());
sp.plus(1).setStruct(ps.plus(startp+2).getStruct());
sp.plus(2).setStruct(ps.plus(startp+1).getStruct());
- sp.plus(3).setStruct(spl.getStruct("sp"));
+ sp.plus(3).setStruct(spl.sp);
/* ensure endpoint starts inside */
inside_context.setPtr("a.p", sp.plus(3).asPtr());
inside_context.setPtr("a.r", slen2.amp());
- bezier_clip(inside_context.amp(), function(arrows__c.class, "inside"), sp, false);
+ bezier_clip(inside_context, function(arrows__c.class, "inside"), sp, false);
ps.plus(startp).setStruct(sp.plus(3).getStruct());
ps.plus(startp+1).setStruct(sp.plus(2).getStruct());
ps.plus(startp+2).setStruct(sp.plus(1).getStruct());
diff --git a/src/gen/lib/common/ellipse__c.java b/src/gen/lib/common/ellipse__c.java
index c467707..52682e4 100644
--- a/src/gen/lib/common/ellipse__c.java
+++ b/src/gen/lib/common/ellipse__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class ellipse__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/emit__c.java b/src/gen/lib/common/emit__c.java
index 03a0459..88249d7 100644
--- a/src/gen/lib/common/emit__c.java
+++ b/src/gen/lib/common/emit__c.java
@@ -51,16 +51,12 @@ import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
+import h.ST_Agraph_s;
+import h.ST_boxf;
+import h.ST_pointf;
import h.xdot;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class emit__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -320,14 +316,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -356,25 +352,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -398,16 +375,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -704,7 +681,7 @@ throw new UnsupportedOperationException();
//3 7udip7yo3ddkp9ocjftokpm9y
// void* init_xdot (Agraph_t* g)
-public static __ptr__ init_xdot(Agraph_s g) {
+public static __ptr__ init_xdot(ST_Agraph_s g) {
ENTERING("7udip7yo3ddkp9ocjftokpm9y","init_xdot");
try {
CString p;
@@ -1401,8 +1378,8 @@ throw new UnsupportedOperationException();
public static boolean check_control_points(__ptr__ cp) {
ENTERING("7nqmdkcnal35ollpstkk707t8","check_control_points");
try {
- double dis1 = ptToLine2 (cp.plus(0).getStruct(), cp.plus(3).getStruct(), cp.plus(1).getStruct());
- double dis2 = ptToLine2 (cp.plus(0).getStruct(), cp.plus(3).getStruct(), cp.plus(2).getStruct());
+ double dis1 = ptToLine2 ((ST_pointf)cp.plus(0).getStruct(), (ST_pointf)cp.plus(3).getStruct(), (ST_pointf)cp.plus(1).getStruct());
+ double dis2 = ptToLine2 ((ST_pointf)cp.plus(0).getStruct(), (ST_pointf)cp.plus(3).getStruct(), (ST_pointf)cp.plus(2).getStruct());
if (dis1 < 2.0*2.0 && dis2 < 2.0*2.0)
return true;
else
@@ -1417,36 +1394,36 @@ LEAVING("7nqmdkcnal35ollpstkk707t8","check_control_points");
//3 5wldemr88fdxl6101ugewclw9
// void update_bb_bz(boxf *bb, pointf *cp)
-public static void update_bb_bz(__ptr__ bb, __array_of_struct__ cp) {
+public static void update_bb_bz(ST_boxf bb, ST_pointf.Array cp) {
ENTERING("5wldemr88fdxl6101ugewclw9","update_bb_bz");
try {
/* if any control point of the segment is outside the bounding box */
- if (cp.plus(0).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(0).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
- cp.plus(0).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(0).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
- cp.plus(1).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(1).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
- cp.plus(1).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(1).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
- cp.plus(2).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(2).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
- cp.plus(2).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(2).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
- cp.plus(3).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(3).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
- cp.plus(3).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(3).getDouble("y") < bb.getStruct("LL").getDouble("y")) {
+ if (cp.get(0).x > bb.UR.x || cp.get(0).x < bb.LL.x ||
+ cp.get(0).y > bb.UR.y || cp.get(0).y < bb.LL.y ||
+ cp.get(1).x > bb.UR.x || cp.get(1).x < bb.LL.x ||
+ cp.get(1).y > bb.UR.y || cp.get(1).y < bb.LL.y ||
+ cp.get(2).x > bb.UR.x || cp.get(2).x < bb.LL.x ||
+ cp.get(2).y > bb.UR.y || cp.get(2).y < bb.LL.y ||
+ cp.get(3).x > bb.UR.x || cp.get(3).x < bb.LL.x ||
+ cp.get(3).y > bb.UR.y || cp.get(3).y < bb.LL.y) {
/* if the segment is sufficiently refined */
if (check_control_points(cp.asPtr())) {
int i;
/* expand the bounding box */
for (i = 0; i < 4; i++) {
- if (cp.plus(i).getDouble("x") > bb.getStruct("UR").getDouble("x"))
- bb.getStruct("UR").setDouble("x", cp.plus(i).getDouble("x"));
- else if (cp.plus(i).getDouble("x") < bb.getStruct("LL").getDouble("x"))
- bb.getStruct("LL").setDouble("x", cp.plus(i).getDouble("x"));
- if (cp.plus(i).getDouble("y") > bb.getStruct("UR").getDouble("y"))
- bb.getStruct("UR").setDouble("y", cp.plus(i).getDouble("y"));
- else if (cp.plus(i).getDouble("y") < bb.getStruct("LL").getDouble("y"))
- bb.getStruct("LL").setDouble("y", cp.plus(i).getDouble("y"));
+ if (cp.get(i).x > bb.UR.x)
+ bb.UR.setDouble("x", cp.get(i).x);
+ else if (cp.get(i).x < bb.LL.x)
+ bb.LL.setDouble("x", cp.get(i).x);
+ if (cp.get(i).y > bb.UR.y)
+ bb.UR.setDouble("y", cp.get(i).y);
+ else if (cp.get(i).y < bb.LL.y)
+ bb.LL.setDouble("y", cp.get(i).y);
}
}
else { /* else refine the segment */
- final __array_of_struct__ left = __array_of_struct_impl__.malloc(pointf.class, 4);
- final __array_of_struct__ right = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_pointf.Array left = new ST_pointf.Array( 4);
+ final ST_pointf.Array right = new ST_pointf.Array( 4);
Bezier (cp, 3, 0.5, left.asPtr(), right.asPtr());
update_bb_bz(bb, left);
update_bb_bz(bb, right);
diff --git a/src/gen/lib/common/geom__c.java b/src/gen/lib/common/geom__c.java
index 85533ef..bf5a7de 100644
--- a/src/gen/lib/common/geom__c.java
+++ b/src/gen/lib/common/geom__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class geom__c {
@@ -74,14 +71,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -110,25 +107,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -152,16 +130,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -637,11 +615,11 @@ throw new UnsupportedOperationException();
//3 3aiyj7urv33rvps5ds204tciu
// static pointf rotatepf(pointf p, int cwrot)
-public static __struct__<pointf> rotatepf(final __struct__<pointf> p, int cwrot) {
+public static ST_pointf rotatepf(final ST_pointf p, int cwrot) {
// WARNING!! STRUCT
return rotatepf_w_(p.copy(), cwrot).copy();
}
-private static __struct__<pointf> rotatepf_w_(final __struct__<pointf> p, int cwrot) {
+private static ST_pointf rotatepf_w_(final ST_pointf p, int cwrot) {
ENTERING("3aiyj7urv33rvps5ds204tciu","rotatepf");
try {
UNSUPPORTED("adzi0wztceimu4ni3aonznmq7"); // static pointf rotatepf(pointf p, int cwrot)
@@ -726,14 +704,14 @@ throw new UnsupportedOperationException();
//3 5q8h2tm3jifiasn423wrm0y60
// pointf cwrotatepf(pointf p, int cwrot)
-public static __struct__<pointf> cwrotatepf(final __struct__<pointf> p, int cwrot) {
+public static ST_pointf cwrotatepf(final ST_pointf p, int cwrot) {
// WARNING!! STRUCT
return cwrotatepf_w_(p.copy(), cwrot).copy();
}
-private static __struct__<pointf> cwrotatepf_w_(final __struct__<pointf> p, int cwrot) {
+private static ST_pointf cwrotatepf_w_(final ST_pointf p, int cwrot) {
ENTERING("5q8h2tm3jifiasn423wrm0y60","cwrotatepf");
try {
- double x = p.getDouble("x"), y = p.getDouble("y");
+ double x = p.x, y = p.y;
switch (cwrot) {
case 0:
break;
@@ -804,14 +782,14 @@ throw new UnsupportedOperationException();
//3 6np74e9pfmv8uek8irqru2tma
// pointf ccwrotatepf(pointf p, int ccwrot)
-public static __struct__<pointf> ccwrotatepf(final __struct__<pointf> p, int ccwrot) {
+public static ST_pointf ccwrotatepf(final ST_pointf p, int ccwrot) {
// WARNING!! STRUCT
return ccwrotatepf_w_(p.copy(), ccwrot).copy();
}
-private static __struct__<pointf> ccwrotatepf_w_(final __struct__<pointf> p, int ccwrot) {
+private static ST_pointf ccwrotatepf_w_(final ST_pointf p, int ccwrot) {
ENTERING("6np74e9pfmv8uek8irqru2tma","ccwrotatepf");
try {
- double x = p.getDouble("x"), y = p.getDouble("y");
+ double x = p.x, y = p.y;
switch (ccwrot) {
case 0:
break;
@@ -895,16 +873,16 @@ throw new UnsupportedOperationException();
//3 90k9l4o3khu3dw0fzkrcd97nk
// double ptToLine2 (pointf a, pointf b, pointf p)
-public static double ptToLine2(final __struct__<pointf> a, final __struct__<pointf> b, final __struct__<pointf> p) {
+public static double ptToLine2(final ST_pointf a, final ST_pointf b, final ST_pointf p) {
// WARNING!! STRUCT
return ptToLine2_w_(a.copy(), b.copy(), p.copy());
}
-private static double ptToLine2_w_(final __struct__<pointf> a, final __struct__<pointf> b, final __struct__<pointf> p) {
+private static double ptToLine2_w_(final ST_pointf a, final ST_pointf b, final ST_pointf p) {
ENTERING("90k9l4o3khu3dw0fzkrcd97nk","ptToLine2");
try {
- double dx = b.getDouble("x")-a.getDouble("x");
- double dy = b.getDouble("y")-a.getDouble("y");
- double a2 = (p.getDouble("y")-a.getDouble("y"))*dx - (p.getDouble("x")-a.getDouble("x"))*dy;
+ double dx = b.x-a.x;
+ double dy = b.y-a.y;
+ double a2 = (p.y-a.y)*dx - (p.x-a.x)*dy;
a2 *= a2; /* square - ensures that it is positive */
if (a2 < 0.0000000001) return 0.; /* avoid 0/0 problems */
return a2 / (dx*dx + dy*dy);
diff --git a/src/gen/lib/common/globals__c.java b/src/gen/lib/common/globals__c.java
index 4ec9eb0..32b3263 100644
--- a/src/gen/lib/common/globals__c.java
+++ b/src/gen/lib/common/globals__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class globals__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -338,14 +335,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -374,25 +371,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -416,16 +394,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/htmllex__c.java b/src/gen/lib/common/htmllex__c.java
index 9c56dd2..b3911a7 100644
--- a/src/gen/lib/common/htmllex__c.java
+++ b/src/gen/lib/common/htmllex__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class htmllex__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/htmlparse__c.java b/src/gen/lib/common/htmlparse__c.java
index 1f616a6..0f064c4 100644
--- a/src/gen/lib/common/htmlparse__c.java
+++ b/src/gen/lib/common/htmlparse__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class htmlparse__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/htmltable__c.java b/src/gen/lib/common/htmltable__c.java
index 7d66336..7881482 100644
--- a/src/gen/lib/common/htmltable__c.java
+++ b/src/gen/lib/common/htmltable__c.java
@@ -47,12 +47,9 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import h.textlabel_t;
-import smetana.core.JUtils;
+import h.ST_pointf;
+import h.ST_textlabel_t;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class htmltable__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -312,14 +309,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -348,25 +345,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -390,16 +368,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -2676,7 +2654,7 @@ throw new UnsupportedOperationException();
//3 39z2hrj2uwkezxobreqxpgb10
// int make_html_label(void *obj, textlabel_t * lp)
-public static int make_html_label(__ptr__ obj, textlabel_t lp) {
+public static int make_html_label(__ptr__ obj, ST_textlabel_t lp) {
ENTERING("39z2hrj2uwkezxobreqxpgb10","make_html_label");
try {
UNSUPPORTED("3s2xr5n4swgcjctfsv6qg00p1"); // int make_html_label(void *obj, textlabel_t * lp)
diff --git a/src/gen/lib/common/input__c.java b/src/gen/lib/common/input__c.java
index 115d98b..75bb0db 100644
--- a/src/gen/lib/common/input__c.java
+++ b/src/gen/lib/common/input__c.java
@@ -51,7 +51,6 @@ import static gen.lib.cgraph.refstr__c.aghtmlstr;
import static gen.lib.common.emit__c.init_xdot;
import static gen.lib.common.labels__c.make_label;
import static gen.lib.common.labels__c.strdup_and_subst_obj;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.utils__c.late_double;
import static gen.lib.common.utils__c.late_int;
import static gen.lib.common.utils__c.late_nnstring;
@@ -64,7 +63,6 @@ import static smetana.core.JUtils.atof;
import static smetana.core.JUtils.atoi;
import static smetana.core.JUtils.enumAsInt;
import static smetana.core.JUtils.getenv;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtils.strstr;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
@@ -87,15 +85,12 @@ import static smetana.core.Macro.GD_showboxes;
import static smetana.core.Macro.N;
import static smetana.core.Macro.ROUND;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.boxf;
+import h.ST_Agraph_s;
+import h.ST_layout_t;
+import h.ST_pointf;
import h.fontname_kind;
-import h.layout_t;
-import h.pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Z;
-import smetana.core.__struct__;
public class input__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -355,14 +350,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -391,25 +386,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -433,16 +409,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -1165,7 +1141,7 @@ throw new UnsupportedOperationException();
//3 72no6ayfvjinlnupyn5jlmayg
// static boolean getdoubles2ptf(graph_t * g, char *name, pointf * result)
-public static boolean getdoubles2ptf(Agraph_s g, CString name, pointf result) {
+public static boolean getdoubles2ptf(ST_Agraph_s g, CString name, ST_pointf result) {
ENTERING("72no6ayfvjinlnupyn5jlmayg","getdoubles2ptf");
try {
CString p;
@@ -1268,7 +1244,7 @@ throw new UnsupportedOperationException();
//3 9t08dr2ks9qz1pyfz99awla6x
// static int findCharset (graph_t * g)
-public static int findCharset(Agraph_s g) {
+public static int findCharset(ST_Agraph_s g) {
ENTERING("9t08dr2ks9qz1pyfz99awla6x","findCharset");
try {
return 0;
@@ -1282,7 +1258,7 @@ LEAVING("9t08dr2ks9qz1pyfz99awla6x","findCharset");
//3 3bnmjpvynh1j9oh2p2vi0vh2m
// static void setRatio(graph_t * g)
-public static void setRatio(Agraph_s g) {
+public static void setRatio(ST_Agraph_s g) {
ENTERING("3bnmjpvynh1j9oh2p2vi0vh2m","setRatio");
try {
CString p;
@@ -1324,20 +1300,20 @@ LEAVING("3bnmjpvynh1j9oh2p2vi0vh2m","setRatio");
-//3 8gzdr3oil2d0e2o7m84wsszfg
-// void graph_init(graph_t * g, boolean use_rankdir)
static CString rankname[] = new CString[] { new CString("local"), new CString("global"), new CString("none"), null };
static int rankcode[] = { 100, 101, 102, 100 };
static CString fontnamenames[] = new CString[] {new CString("gd"),new CString("ps"),new CString("svg"), null};
static int fontnamecodes[] = {enumAsInt(fontname_kind.class, "NATIVEFONTS"),enumAsInt(fontname_kind.class, "PSFONTS"),
enumAsInt(fontname_kind.class, "SVGFONTS"),-1};
-public static void graph_init(Agraph_s g, boolean use_rankdir) {
+//3 8gzdr3oil2d0e2o7m84wsszfg
+//void graph_init(graph_t * g, boolean use_rankdir)
+public static void graph_init(ST_Agraph_s g, boolean use_rankdir) {
ENTERING("8gzdr3oil2d0e2o7m84wsszfg","graph_init");
try {
CString p;
double xf;
int rankdir;
- GD_drawing(g, zmalloc(sizeof(layout_t.class)));
+ GD_drawing(g, new ST_layout_t());
/* set this up fairly early in case any string sizes are needed */
if ((p = agget(g, new CString("fontpath")))!=null || (p = getenv(new CString("DOTFONTPATH")))!=null) {
UNSUPPORTED("81bz3jcukzyotxiqgrlhn9cbq"); // /* overide GDFONTPATH in local environment if dot
@@ -1395,16 +1371,16 @@ UNSUPPORTED("dhhbmqv6n01j1eeyy7fpus1xw"); // xf = 0.02;
p = late_string(g, (agattr(g,AGRAPH,new CString("fontnames"),null)), null);
GD_fontnames(g, maptoken(p, fontnamenames, fontnamecodes));
setRatio(g);
- GD_drawing(g).setBoolean("filled",
- getdoubles2ptf(g, new CString("size"), (pointf) GD_drawing(g).getStruct("size").amp()));
- getdoubles2ptf(g, new CString("page"), GD_drawing(g).getStruct("page").amp());
- GD_drawing(g).setBoolean("centered", mapbool(agget(g, new CString("center"))));
+ GD_drawing(g).filled =
+ getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).size);
+ getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).page);
+ GD_drawing(g).centered = mapbool(agget(g, new CString("center")));
if ((p = agget(g, new CString("rotate")))!=null)
- GD_drawing(g).setBoolean("landscape", (atoi(p) == 90));
+ GD_drawing(g).landscape= (atoi(p) == 90);
else if ((p = agget(g, new CString("orientation")))!=null)
- GD_drawing(g).setBoolean("landscape", ((p.charAt(0) == 'l') || (p.charAt(0) == 'L')));
+ GD_drawing(g).landscape= ((p.charAt(0) == 'l') || (p.charAt(0) == 'L'));
else if ((p = agget(g, new CString("landscape")))!=null)
- GD_drawing(g).setBoolean("landscape", mapbool(p));
+ GD_drawing(g).landscape= mapbool(p);
p = agget(g, new CString("clusterrank"));
Z.z().CL_type = maptoken(p, rankname, rankcode);
p = agget(g, new CString("concentrate"));
@@ -1555,7 +1531,7 @@ throw new UnsupportedOperationException();
//3 5vks1zdadu5vjinaivs0j2bkb
// void do_graph_label(graph_t * sg)
-public static void do_graph_label(Agraph_s sg) {
+public static void do_graph_label(ST_Agraph_s sg) {
ENTERING("5vks1zdadu5vjinaivs0j2bkb","do_graph_label");
try {
CString str, pos, just;
@@ -1563,8 +1539,8 @@ try {
/* it would be nice to allow multiple graph labels in the future */
if ((str = agget(sg, new CString("label")))!=null && (str.charAt(0) != '\0')) {
char pos_flag=0;
- final __struct__<pointf> dimen = JUtils.from(pointf.class);
- GD_has_labels(sg.getPtr("root"), GD_has_labels(sg.getPtr("root")) | (1 << 3));
+ final ST_pointf dimen = new ST_pointf();
+ GD_has_labels(sg.root, GD_has_labels(sg.root) | (1 << 3));
GD_label(sg, make_label(sg, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
late_double(sg, (agattr(sg,AGRAPH,new CString("fontsize"),null)),
14.0, 1.0),
@@ -1597,15 +1573,15 @@ UNSUPPORTED("evu9w6pw3kkh7z8w7t4rx4qxc"); // pos_flag |= 4;
return;
/* Set border information for cluster labels to allow space
*/
- dimen.___(GD_label(sg).getStruct("dimen"));
- dimen.setDouble("x", dimen.getDouble("x") + 4*4);
- dimen.setDouble("y", dimen.getDouble("y") + 2*4);
+ dimen.___(GD_label(sg).dimen);
+ dimen.setDouble("x", dimen.x + 4*4);
+ dimen.setDouble("y", dimen.y + 2*4);
if (N(GD_flip(agroot(sg)))) {
if ((GD_label_pos(sg) & 1)!=0)
pos_ix = 2;
else
pos_ix = 0;
- GD_border(sg).plus(pos_ix).setStruct(dimen);
+ GD_border(sg)[pos_ix].___(dimen);
} else {
/* when rotated, the labels will be restored to TOP or BOTTOM */
UNSUPPORTED("cabz6xbjdvz5vmjulzrhlxh48"); // if ((((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->label_pos) & 1)
diff --git a/src/gen/lib/common/labels__c.java b/src/gen/lib/common/labels__c.java
index 824601b..301eb8f 100644
--- a/src/gen/lib/common/labels__c.java
+++ b/src/gen/lib/common/labels__c.java
@@ -67,28 +67,25 @@ import static smetana.core.Macro.GD_label;
import static smetana.core.Macro.MAX;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import static smetana.core.Macro.ZALLOC;
+import static smetana.core.Macro.ZALLOC_ST_textspan_t;
import static smetana.core.Macro.agtail;
import static smetana.core.Macro.hackInitDimensionFromLabel;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agnodeinfo_t;
-import h.Agobj_s;
-import h.Agraph_s;
-import h.Agraphinfo_t;
-import h.GVC_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agnodeinfo_t;
+import h.ST_Agobj_s;
+import h.ST_Agraph_s;
+import h.ST_Agraphinfo_t;
+import h.ST_Agrec_s;
+import h.ST_GVC_s;
import h.ST_pointf;
import h.ST_port;
-import h.boxf;
-import h.pointf;
-import h.textlabel_t;
-import h.textspan_t;
+import h.ST_textlabel_t;
+import h.ST_textspan_t;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class labels__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -348,14 +345,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -384,25 +381,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -426,16 +404,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -733,36 +711,36 @@ throw new UnsupportedOperationException();
//3 4wkeqik2dt7ecr64ej6ltbnvb
// static void storeline(GVC_t *gvc, textlabel_t *lp, char *line, char terminator)
//private static __struct__<textfont_t> tf = JUtils.from(textfont_t.class);
-public static void storeline(GVC_s gvc, textlabel_t lp, CString line, char terminator) {
+public static void storeline(ST_GVC_s gvc, ST_textlabel_t lp, CString line, char terminator) {
ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
try {
- final __struct__<pointf> size = JUtils.from(pointf.class);
- __ptr__ span = null;
- int oldsz = lp.getInt("u.txt.nspans") + 1;
- lp.setPtr("u.txt.span", ZALLOC(oldsz + 1, lp.getPtr("u.txt.span"), textspan_t.class, oldsz));
- span = lp.getPtr("u.txt.span").plus(lp.getInt("u.txt.nspans"));
- span.setPtr("str", line);
- span.setInt("just", terminator);
+ final ST_pointf size = new ST_pointf();
+ ST_textspan_t span = null;
+ int oldsz = lp.nspans + 1;
+ lp.span = ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.span, oldsz + 1);
+ span = lp.span.get(lp.nspans);
+ span.str = line;
+ span.just = terminator;
if (line!=null && line.charAt(0)!='\0') {
- Z.z().tf.setPtr("name", lp.getPtr("fontname"));
- Z.z().tf.setDouble("size", lp.getDouble("fontsize"));
+ Z.z().tf.name = lp.fontname;
+ Z.z().tf.size = lp.fontsize;
// WE CHEAT
- ((ST_pointf) size).x = 0.0;
- ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20);
+ size.x = 0.0;
+ size.y = (int)(lp.fontsize * 1.20);
hackInitDimensionFromLabel(size, line.getContent());
- ((ST_pointf) span.getStruct("size")).y = (int)size.getDouble("y");
+ span.size.y = (int)size.y;
}
else {
System.err.println("YOU SHOULD NOT SEE THAT");
- ((ST_pointf) size).x = 0.0;
- ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20);
- span.getStruct("size").setDouble("y", (int)(lp.getDouble("fontsize") * 1.20));
+ size.x = 0.0;
+ size.y = (int)(lp.fontsize * 1.20);
+ span.size.y = (int)(lp.fontsize * 1.20);
}
- lp.setInt("u.txt.nspans", lp.getInt("u.txt.nspans") + 1);
+ lp.nspans = lp.nspans + 1;
/* width = max line width */
- ((ST_pointf) lp.getStruct("dimen")).x = MAX(lp.getStruct("dimen").getDouble("x"), size.getDouble("x"));
+ lp.dimen.x = MAX(lp.dimen.x, size.x);
/* accumulate height */
- ((ST_pointf) lp.getStruct("dimen")).y = lp.getStruct("dimen").getDouble("y") + size.getDouble("y");
+ lp.dimen.y = lp.dimen.y + size.y;
} finally {
LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
}
@@ -773,14 +751,14 @@ LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
//3 22ar72ye93a8ntj8pagnt5b5k
// void make_simple_label(GVC_t * gvc, textlabel_t * lp)
-public static void make_simple_label(GVC_s gvc, textlabel_t lp) {
+public static void make_simple_label(ST_GVC_s gvc, ST_textlabel_t lp) {
ENTERING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");
try {
char c;
- CString p, line, lineptr, str = lp.getCString("text");
+ CString p, line, lineptr, str = lp.text;
char bytee = 0x00;
- ((ST_pointf) lp.getStruct("dimen")).x = 0.0;
- ((ST_pointf) lp.getStruct("dimen")).y = 0.0;
+ ((ST_pointf) lp.dimen).x = 0.0;
+ ((ST_pointf) lp.dimen).y = 0.0;
if (str.charAt(0) == '\0')
return;
line = lineptr = null;
@@ -795,7 +773,7 @@ try {
* the second in 0x40-0x7e or 0xa1-0xfe. We assume that the input
* is well-formed, but check that we don't go past the ending '\0'.
*/
- if ((lp.getInt("charset") == 2) && 0xA1 <= bytee && bytee <= 0xFE) {
+ if ((lp.charset == 2) && 0xA1 <= bytee && bytee <= 0xFE) {
UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
UNSUPPORTED("ebmmarxykvf76hmfmjuk0ssjz"); // c = *p++;
UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
@@ -835,7 +813,7 @@ UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
lineptr = lineptr.plus(1);
storeline(gvc, lp, line, 'n');
}
- lp.setStruct("space", lp.getStruct("dimen"));
+ lp.setStruct("space", lp.dimen);
} finally {
LEAVING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");
}
@@ -846,41 +824,41 @@ LEAVING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");
//3 ecq5lydlrjrlaz8o6vm6svc8i
// textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
-public static textlabel_t make_label(__ptr__ obj, CString str, int kind, double fontsize, CString fontname, CString fontcolor) {
+public static ST_textlabel_t make_label(__ptr__ obj, CString str, int kind, double fontsize, CString fontname, CString fontcolor) {
ENTERING("ecq5lydlrjrlaz8o6vm6svc8i","make_label");
try {
- textlabel_t rv = (textlabel_t) Memory.malloc(textlabel_t.class);
- Agraph_s g = null, sg = null;
- Agnode_s n = null;
- Agedge_s e = null;
+ ST_textlabel_t rv = new ST_textlabel_t();
+ ST_Agraph_s g = null, sg = null;
+ ST_Agnode_s n = null;
+ ST_Agedge_s e = null;
CString s = null;
switch (agobjkind(obj)) {
case AGRAPH:
- sg = (Agraph_s)obj;
- g = (Agraph_s) sg.getPtr("root");
+ sg = (ST_Agraph_s)obj;
+ g = (ST_Agraph_s) sg.root;
break;
case AGNODE:
- n = (Agnode_s)obj.castTo(Agnode_s.class);
+ n = (ST_Agnode_s)obj.castTo(ST_Agnode_s.class);
g = agroot(agraphof(n));
break;
case AGEDGE:
- e = (Agedge_s)obj.castTo(Agedge_s.class);
+ e = (ST_Agedge_s)obj.castTo(ST_Agedge_s.class);
g = agroot(agraphof(aghead(e)));
break;
}
rv.setPtr("fontname", fontname);
rv.setPtr("fontcolor", fontcolor);
rv.setDouble("fontsize", fontsize);
- rv.setInt("charset", g.castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getInt("charset"));
+ rv.charset = ((ST_Agraphinfo_t)g.castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).charset;
if ((kind & (2 << 1))!=0) {
rv.setPtr("text", str.strdup());
if ((kind & (1 << 1))!=0) {
- rv.setBoolean("html", (N(0)));
+ rv.html = (N(0));
}
}
else if (kind == (1 << 1)) {
rv.setPtr("text", str.strdup());
- rv.setBoolean("html", N(0));
+ rv.html = N(0);
if (make_html_label(obj, rv)!=0) {
switch (agobjkind(obj)) {
case AGRAPH:
@@ -902,17 +880,17 @@ try {
* sequences (\n, \l, \r) are processed in make_simple_label. That call also replaces \\ with \.
*/
rv.setPtr("text", strdup_and_subst_obj0(str, obj, 0));
- switch (rv.getInt("charset")) {
+ switch (rv.charset) {
case 1:
UNSUPPORTED("s = latin1ToUTF8(rv->text);");
break;
default: /* UTF8 */
- s = htmlEntityUTF8(rv.getCString("text"), g);
+ s = htmlEntityUTF8(rv.text, g);
break;
}
- Memory.free(rv.getPtr("text"));
+ Memory.free(rv.text);
rv.setPtr("text", s);
- make_simple_label((GVC_s) g.castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getPtr("gvc"), rv);
+ make_simple_label(g.castTo_ST_Agobj_s().data.castTo_ST_Agraphinfo_t().gvc, rv);
}
return rv;
} finally {
@@ -1044,51 +1022,51 @@ try {
tp_len = 0, hp_len = 0;
int newlen = 0;
int isEdge = 0;
- textlabel_t tl;
+ ST_textlabel_t tl;
final ST_port pt = new ST_port();
/* prepare substitution strings */
switch (agobjkind(obj)) {
case AGRAPH:
- g_str = agnameof((Agraph_s)obj);
+ g_str = agnameof((ST_Agraph_s)obj);
g_len = strlen(g_str);
- tl = GD_label((Agraph_s)obj);
+ tl = GD_label((ST_Agraph_s)obj);
if (tl!=null) {
- l_str = tl.getCString("text");
+ l_str = tl.text;
if (str!=null) l_len = strlen(l_str);
}
break;
case AGNODE:
- g_str = agnameof(agraphof(obj.castTo(Agnode_s.class)));
+ g_str = agnameof(agraphof(obj.castTo(ST_Agnode_s.class)));
g_len = strlen(g_str);
- n_str = agnameof(obj.castTo(Agnode_s.class));
+ n_str = agnameof(obj.castTo(ST_Agnode_s.class));
n_len = strlen(n_str);
- tl = (textlabel_t) obj.castTo(Agnode_s.class).castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label");
+ tl = (ST_textlabel_t) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label;
if (tl!=null) {
- l_str = tl.getCString("text");
+ l_str = tl.text;
if (str!=null) l_len = strlen(l_str);
}
break;
case AGEDGE:
isEdge = 1;
- g_str = agnameof(agroot(agraphof(agtail((obj.castTo(Agedge_s.class))))));
+ g_str = agnameof(agroot(agraphof(agtail((obj.castTo(ST_Agedge_s.class))))));
g_len = strlen(g_str);
- t_str = agnameof(agtail((obj.castTo(Agedge_s.class))));
+ t_str = agnameof(agtail((obj.castTo(ST_Agedge_s.class))));
t_len = strlen(t_str);
- pt.___(ED_tail_port(obj.castTo(Agedge_s.class)));
+ pt.___(ED_tail_port(obj.castTo(ST_Agedge_s.class)));
if ((tp_str = pt.name)!=null)
tp_len = strlen(tp_str);
- h_str = agnameof(aghead((obj.castTo(Agedge_s.class))));
+ h_str = agnameof(aghead((obj.castTo(ST_Agedge_s.class))));
h_len = strlen(h_str);
- pt.___(ED_head_port(obj.castTo(Agedge_s.class)));
+ pt.___(ED_head_port(obj.castTo(ST_Agedge_s.class)));
if ((hp_str = pt.name)!=null)
hp_len = strlen(hp_str);
h_len = strlen(h_str);
- tl = ED_label(obj.castTo(Agedge_s.class));
+ tl = ED_label(obj.castTo(ST_Agedge_s.class));
if (tl!=null) {
- l_str = tl.getCString("text");
+ l_str = tl.text;
if (str!=null) l_len = strlen(l_str);
}
- if (agisdirected(agroot(agraphof(agtail((obj.castTo(Agedge_s.class)))))))
+ if (agisdirected(agroot(agraphof(agtail((obj.castTo(ST_Agedge_s.class)))))))
e_str = new CString("->");
else
e_str = new CString("--");
diff --git a/src/gen/lib/common/memory__c.java b/src/gen/lib/common/memory__c.java
index 9e748a5..67913a5 100644
--- a/src/gen/lib/common/memory__c.java
+++ b/src/gen/lib/common/memory__c.java
@@ -95,11 +95,11 @@ throw new UnsupportedOperationException();
-//3 4mfikqpmxyxrke46i5xakatmc
-// void *gmalloc(size_t nbytes)
public static CString gmalloc(int nbytes) {
return new CString(nbytes);
}
+//3 4mfikqpmxyxrke46i5xakatmc
+//void *gmalloc(size_t nbytes)
public static __ptr__ gmalloc(size_t nbytes) {
ENTERING("4mfikqpmxyxrke46i5xakatmc","gmalloc");
try {
diff --git a/src/gen/lib/common/ns__c.java b/src/gen/lib/common/ns__c.java
index b22bb7a..395db0d 100644
--- a/src/gen/lib/common/ns__c.java
+++ b/src/gen/lib/common/ns__c.java
@@ -57,10 +57,8 @@ import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.atoi;
import static smetana.core.JUtils.setjmp;
import static smetana.core.JUtils.size_t_array_of_integer;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
-import static smetana.core.Macro.ALLOC_empty;
import static smetana.core.Macro.ED_cutvalue;
import static smetana.core.Macro.ED_minlen;
import static smetana.core.Macro.ED_tree_index;
@@ -88,18 +86,15 @@ import static smetana.core.Macro.SLACK;
import static smetana.core.Macro.TREE_EDGE;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.free_list;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.nodequeue;
-import h.pointf;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_nodequeue;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
import smetana.core.jmp_buf;
public class ns__c {
@@ -360,14 +355,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -396,26 +391,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -438,16 +413,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -775,10 +750,10 @@ private static jmp_buf jbuf = new jmp_buf();
//3 6au5htcaxhw0blmx5c48v03u0
// static void add_tree_edge(edge_t * e)
-public static void add_tree_edge(Agedge_s e) {
+public static void add_tree_edge(ST_Agedge_s e) {
ENTERING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge");
try {
- Agnode_s n;
+ ST_Agnode_s n;
if (TREE_EDGE(e)) {
UNSUPPORTED("cq4nqjjxvb0dtdfy4c7pwpqai"); // agerr(AGERR, "add_tree_edge: missing tree edge\n");
UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
@@ -829,11 +804,11 @@ LEAVING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge");
//3 9b7b78pmafynmvffztrqnlxtn
// static void exchange_tree_edges(edge_t * e, edge_t * f)
-public static void exchange_tree_edges(Agedge_s e, Agedge_s f) {
+public static void exchange_tree_edges(ST_Agedge_s e, ST_Agedge_s f) {
ENTERING("9b7b78pmafynmvffztrqnlxtn","exchange_tree_edges");
try {
int i, j;
- Agnode_s n;
+ ST_Agnode_s n;
ED_tree_index(f, ED_tree_index(e));
Z.z().Tree_edge.setInList(ED_tree_index(e), f);
ED_tree_index(e, -1);
@@ -875,9 +850,9 @@ public static void init_rank() {
ENTERING("dbxco6m0mabzhsqfo3pb8nctk","init_rank");
try {
int i, ctr;
- nodequeue Q;
- Agnode_s v;
- Agedge_s e;
+ ST_nodequeue Q;
+ ST_Agnode_s v;
+ ST_Agedge_s e;
Q = new_queue(Z.z().N_nodes);
ctr = 0;
for (v = GD_nlist(Z.z().G_ns); v!=null; v = ND_next(v)) {
@@ -887,9 +862,9 @@ try {
while ((v = dequeue(Q))!=null) {
ND_rank(v, 0);
ctr++;
- for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++)
ND_rank(v, MAX(ND_rank(v), ND_rank(agtail(e)) + ED_minlen(e)));
- for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
ND_priority(aghead(e), ND_priority(aghead(e)) -1 );
if ((ND_priority(aghead(e))) <= 0)
enqueue(Q, aghead(e));
@@ -912,7 +887,7 @@ LEAVING("dbxco6m0mabzhsqfo3pb8nctk","init_rank");
//3 bj7ux5kz8ls2lnfh0ix6i00b9
// static node_t *incident(edge_t * e)
-public static Agnode_s incident(Agedge_s e) {
+public static ST_Agnode_s incident(ST_Agedge_s e) {
ENTERING("bj7ux5kz8ls2lnfh0ix6i00b9","incident");
try {
if (ND_mark(agtail(e))!=0) {
@@ -933,19 +908,19 @@ LEAVING("bj7ux5kz8ls2lnfh0ix6i00b9","incident");
//3 4i9tcvid2iql874c6k70s9aqm
// static edge_t *leave_edge(void)
-public static Agedge_s leave_edge() {
+public static ST_Agedge_s leave_edge() {
ENTERING("4i9tcvid2iql874c6k70s9aqm","leave_edge");
try {
- Agedge_s f, rv = null;
+ ST_Agedge_s f, rv = null;
int j, cnt = 0;
j = Z.z().S_i;
while (Z.z().S_i < Z.z().Tree_edge.size) {
- if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
+ if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
if (rv!=null) {
if (ED_cutvalue(rv) > ED_cutvalue(f))
rv = f;
} else
- rv = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
+ rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
if (++cnt >= Z.z().Search_size)
return rv;
}
@@ -954,12 +929,12 @@ try {
if (j > 0) {
Z.z().S_i = 0;
while (Z.z().S_i < j) {
- if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
+ if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
if (rv!=null) {
if (ED_cutvalue(rv) > ED_cutvalue(f))
rv = f;
} else
- rv = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
+ rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
if (++cnt >= Z.z().Search_size)
return rv;
}
@@ -985,12 +960,12 @@ LEAVING("4i9tcvid2iql874c6k70s9aqm","leave_edge");
//3 10lkpr4y40luvy2idlozfiva3
// static void dfs_enter_outedge(node_t * v)
-public static void dfs_enter_outedge(Agnode_s v) {
+public static void dfs_enter_outedge(ST_Agnode_s v) {
ENTERING("10lkpr4y40luvy2idlozfiva3","dfs_enter_outedge");
try {
int i, slack;
- Agedge_s e;
- for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
+ ST_Agedge_s e;
+ for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
if (TREE_EDGE(e) == false) {
if (N(SEQ(Z.z().Low, ND_lim(aghead(e)), Z.z().Lim))) {
slack = SLACK(e);
@@ -1002,7 +977,7 @@ try {
} else if (ND_lim(aghead(e)) < ND_lim(v))
dfs_enter_outedge(aghead(e));
}
- for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
if (ND_lim(agtail(e)) < ND_lim(v))
dfs_enter_outedge(agtail(e));
} finally {
@@ -1015,12 +990,12 @@ LEAVING("10lkpr4y40luvy2idlozfiva3","dfs_enter_outedge");
//3 2z9nii6380p8qlql8nznzgvof
// static void dfs_enter_inedge(node_t * v)
-public static void dfs_enter_inedge(Agnode_s v) {
+public static void dfs_enter_inedge(ST_Agnode_s v) {
ENTERING("2z9nii6380p8qlql8nznzgvof","dfs_enter_inedge");
try {
int i, slack;
- Agedge_s e;
- for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
+ ST_Agedge_s e;
+ for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
if (TREE_EDGE(e) == false) {
if (N(SEQ(Z.z().Low, ND_lim(agtail(e)), Z.z().Lim))) {
slack = SLACK(e);
@@ -1032,7 +1007,7 @@ try {
} else if (ND_lim(agtail(e)) < ND_lim(v))
dfs_enter_inedge(agtail(e));
}
- for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
if (ND_lim(aghead(e)) < ND_lim(v))
dfs_enter_inedge(aghead(e));
} finally {
@@ -1045,10 +1020,10 @@ LEAVING("2z9nii6380p8qlql8nznzgvof","dfs_enter_inedge");
//3 aeu2po1o1rvibmafk0k8dw0fh
// static edge_t *enter_edge(edge_t * e)
-public static Agedge_s enter_edge(Agedge_s e) {
+public static ST_Agedge_s enter_edge(ST_Agedge_s e) {
ENTERING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge");
try {
- Agnode_s v;
+ ST_Agnode_s v;
int outsearch;
/* v is the down node */
if (ND_lim(agtail(e)) < ND_lim(aghead(e))) {
@@ -1077,19 +1052,19 @@ LEAVING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge");
//3 1gvyafmercq92v3lg6gb33cbt
// static int treesearch(node_t * v)
-public static boolean treesearch(Agnode_s v) {
+public static boolean treesearch(ST_Agnode_s v) {
ENTERING("1gvyafmercq92v3lg6gb33cbt","treesearch");
try {
int i;
- Agedge_s e;
- for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
+ ST_Agedge_s e;
+ for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
if ((ND_mark(aghead(e)) == 0) && (SLACK(e) == 0)) {
add_tree_edge(e);
if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(aghead(e)))
return NOT(0);
}
}
- for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
if ((ND_mark(agtail(e)) == 0) && (SLACK(e) == 0)) {
add_tree_edge(e);
if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(agtail(e)))
@@ -1111,7 +1086,7 @@ public static int tight_tree() {
ENTERING("c98bj1u8j43cdezeczn33mec0","tight_tree");
try {
int i;
- Agnode_s n;
+ ST_Agnode_s n;
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
ND_mark(n, 0);
ND_tree_in(n).setInList(0, null);
@@ -1155,14 +1130,14 @@ public static int feasible_tree() {
ENTERING("756raqohoxdeiddqbyr37h7ig","feasible_tree");
try {
int i, delta;
- Agnode_s n;
- Agedge_s e, f;
+ ST_Agnode_s n;
+ ST_Agedge_s e, f;
if (Z.z().N_nodes <= 1)
return 0;
while (tight_tree() < Z.z().N_nodes) {
e = null;
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
- for (i = 0; (f = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
+ for (i = 0; (f = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
if ((TREE_EDGE(f) == false) && incident(f)!=null && ((e == null)
|| (SLACK(f)
<
@@ -1195,13 +1170,13 @@ LEAVING("756raqohoxdeiddqbyr37h7ig","feasible_tree");
//3 49un8m43odrf89cedvin3wz3r
// static node_t *treeupdate(node_t * v, node_t * w, int cutvalue, int dir)
-public static Agnode_s treeupdate(Agnode_s v, Agnode_s w, int cutvalue, boolean dir) {
+public static ST_Agnode_s treeupdate(ST_Agnode_s v, ST_Agnode_s w, int cutvalue, boolean dir) {
ENTERING("49un8m43odrf89cedvin3wz3r","treeupdate");
try {
- Agedge_s e;
+ ST_Agedge_s e;
boolean d;
while (N(SEQ(ND_low(v), ND_lim(w), ND_lim(v)))) {
- e = (Agedge_s) ND_par(v);
+ e = (ST_Agedge_s) ND_par(v);
if (EQ(v, agtail(e)))
d = dir;
else
@@ -1226,16 +1201,16 @@ LEAVING("49un8m43odrf89cedvin3wz3r","treeupdate");
//3 e66n8gern1fejjsn8nefypo0g
// static void rerank(node_t * v, int delta)
-public static void rerank(Agnode_s v, int delta) {
+public static void rerank(ST_Agnode_s v, int delta) {
ENTERING("e66n8gern1fejjsn8nefypo0g","rerank");
try {
int i;
- Agedge_s e;
+ ST_Agedge_s e;
ND_rank(v, ND_rank(v) - delta);
- for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
if (NEQ(e, ND_par(v)))
rerank(aghead(e), delta);
- for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
if (NEQ(e, ND_par(v)))
rerank(agtail(e), delta);
} finally {
@@ -1248,11 +1223,11 @@ LEAVING("e66n8gern1fejjsn8nefypo0g","rerank");
//3 xww1p8bentf1qk7mgfhi1q6m
// static void update(edge_t * e, edge_t * f)
-public static void update(Agedge_s e, Agedge_s f) {
+public static void update(ST_Agedge_s e, ST_Agedge_s f) {
ENTERING("xww1p8bentf1qk7mgfhi1q6m","update");
try {
int cutvalue, delta;
- Agnode_s lca;
+ ST_Agnode_s lca;
delta = SLACK(f);
/* "for (v = in nodes in tail side of e) do ND_rank(v) -= delta;" */
if (delta > 0) {
@@ -1295,7 +1270,7 @@ LEAVING("xww1p8bentf1qk7mgfhi1q6m","update");
public static void scan_and_normalize() {
ENTERING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize");
try {
- Agnode_s n;
+ ST_Agnode_s n;
Z.z().Minrank = Integer.MAX_VALUE;
Z.z().Maxrank = -Integer.MAX_VALUE;
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
@@ -1320,10 +1295,10 @@ LEAVING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize");
//3 7eg6zti36nbg4tqyo8yunh86r
// static void freeTreeList (graph_t* g)
-public static void freeTreeList(Agraph_s g) {
+public static void freeTreeList(ST_Agraph_s g) {
ENTERING("7eg6zti36nbg4tqyo8yunh86r","freeTreeList");
try {
- Agnode_s n;
+ ST_Agnode_s n;
for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
free_list(ND_tree_in(n));
free_list(ND_tree_out(n));
@@ -1343,9 +1318,9 @@ public static void LR_balance() {
ENTERING("9gx8p7md3v3mzp640xdjj814a","LR_balance");
try {
int i, delta;
- Agedge_s e, f;
+ ST_Agedge_s e, f;
for (i = 0; i < Z.z().Tree_edge.size; i++) {
- e = (Agedge_s) Z.z().Tree_edge.getFromList(i);
+ e = (ST_Agedge_s) Z.z().Tree_edge.getFromList(i);
if (ED_cutvalue(e) == 0) {
f = enter_edge(e);
if (f == null)
@@ -1373,8 +1348,8 @@ LEAVING("9gx8p7md3v3mzp640xdjj814a","LR_balance");
public static void TB_balance() {
ENTERING("5c01jnao2ubmy4l0vi5jol0jz","TB_balance");
try {
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
int i, low, high, choice;
__ptr__ nrank;
int inweight, outweight;
@@ -1392,11 +1367,11 @@ try {
inweight = outweight = 0;
low = 0;
high = Z.z().Maxrank;
- for (i = 0; (e = (Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
inweight += ED_weight(e);
low = MAX(low, ND_rank(agtail(e)) + ED_minlen(e));
}
- for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
outweight += ED_weight(e);
high = MIN(high, ND_rank(aghead(e)) - ED_minlen(e));
}
@@ -1426,21 +1401,21 @@ LEAVING("5c01jnao2ubmy4l0vi5jol0jz","TB_balance");
//3 37hg5w7ywmyljdiebgp5ltl22
// static int init_graph(graph_t * g)
-public static int init_graph(Agraph_s g) {
+public static int init_graph(ST_Agraph_s g) {
ENTERING("37hg5w7ywmyljdiebgp5ltl22","init_graph");
try {
int i, feasible;
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
Z.z().G_ns = g;
Z.z().N_nodes = Z.z().N_edges = Z.z().S_i = 0;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
ND_mark(n, 0);
Z.z().N_nodes++;
- for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++)
Z.z().N_edges++;
}
- Z.z().Tree_node.reallocEmpty(Z.z().N_nodes, Agnode_s.class);
+ Z.z().Tree_node.reallocEmpty(Z.z().N_nodes);
Z.z().Tree_node.size = 0;
// Z.z().Tree_edge.setPtr("list", ALLOC_empty(Z.z().N_nodes, Z.z().Tree_edge.getPtr("list"), Agedge_s.class));
Z.z().Tree_edge.realloc(Z.z().N_nodes);
@@ -1448,7 +1423,7 @@ try {
feasible = 1;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
ND_priority(n, 0);
- for (i = 0; (e = (Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
ND_priority(n, 1+ND_priority(n));
ED_cutvalue(e, 0);
ED_tree_index(e, -1);
@@ -1457,11 +1432,11 @@ try {
feasible = 0;
}
// ND_tree_in(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));;
- ND_tree_in(n).mallocEmpty(Agedge_s.class, i+1);
+ ND_tree_in(n).mallocEmpty(i+1);
ND_tree_in(n).size = 0;
- for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++);
+ for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++);
// ND_tree_out(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));
- ND_tree_out(n).mallocEmpty(Agedge_s.class, i+1);
+ ND_tree_out(n).mallocEmpty(i+1);
ND_tree_out(n).size = 0;
}
return feasible;
@@ -1501,12 +1476,12 @@ throw new UnsupportedOperationException();
//3 5n0ipwzhr8urlx0fsdzr02gwq
// int rank2(graph_t * g, int balance, int maxiter, int search_size)
-public static int rank2(Agraph_s g, int balance, int maxiter, int search_size) {
+public static int rank2(ST_Agraph_s g, int balance, int maxiter, int search_size) {
ENTERING("5n0ipwzhr8urlx0fsdzr02gwq","rank2");
try {
int iter = 0, feasible;
CString ns = new CString("network simplex: ");
- Agedge_s e, f;
+ ST_Agedge_s e, f;
/*if (Verbose) {
int nn, ne;
graphSize (g, &nn, &ne);
@@ -1575,7 +1550,7 @@ LEAVING("5n0ipwzhr8urlx0fsdzr02gwq","rank2");
//3 aqly8eniwjr5bmh4hzwc7ftdr
// int rank(graph_t * g, int balance, int maxiter)
-public static int rank(Agraph_s g, int balance, int maxiter) {
+public static int rank(ST_Agraph_s g, int balance, int maxiter) {
ENTERING("aqly8eniwjr5bmh4hzwc7ftdr","rank");
try {
CString s;
@@ -1595,11 +1570,11 @@ LEAVING("aqly8eniwjr5bmh4hzwc7ftdr","rank");
//3 2q59mz8qtn0biifbezb8uxz17
// static void x_cutval(edge_t * f)
-public static void x_cutval(Agedge_s f) {
+public static void x_cutval(ST_Agedge_s f) {
ENTERING("2q59mz8qtn0biifbezb8uxz17","x_cutval");
try {
- Agnode_s v=null;
- Agedge_s e;
+ ST_Agnode_s v=null;
+ ST_Agedge_s e;
int i, sum, dir=0;
/* set v to the node on the side of the edge already searched */
if (EQ(ND_par(agtail(f)), f)) {
@@ -1610,9 +1585,9 @@ try {
dir = -1;
}
sum = 0;
- for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++)
sum += x_val(e, v, dir);
- for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++)
sum += x_val(e, v, dir);
ED_cutvalue(f, sum);
} finally {
@@ -1625,10 +1600,10 @@ LEAVING("2q59mz8qtn0biifbezb8uxz17","x_cutval");
//3 bfeafmsmmnblgizs37qj03dy4
// static int x_val(edge_t * e, node_t * v, int dir)
-public static int x_val(Agedge_s e, Agnode_s v, int dir) {
+public static int x_val(ST_Agedge_s e, ST_Agnode_s v, int dir) {
ENTERING("bfeafmsmmnblgizs37qj03dy4","x_val");
try {
- Agnode_s other;
+ ST_Agnode_s other;
int d=0, rv=0, f=0;
if (EQ(agtail(e), v))
other = aghead(e);
@@ -1671,15 +1646,15 @@ LEAVING("bfeafmsmmnblgizs37qj03dy4","x_val");
//3 ah65iqmwa5j0qwotm6amhijlg
// static void dfs_cutval(node_t * v, edge_t * par)
-public static void dfs_cutval(Agnode_s v, Agedge_s par) {
+public static void dfs_cutval(ST_Agnode_s v, ST_Agedge_s par) {
ENTERING("ah65iqmwa5j0qwotm6amhijlg","dfs_cutval");
try {
int i;
- Agedge_s e;
- for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
+ ST_Agedge_s e;
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
if (NEQ(e, par))
dfs_cutval(aghead(e), e);
- for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
if (NEQ(e, par))
dfs_cutval(agtail(e), e);
if (par!=null)
@@ -1694,18 +1669,18 @@ LEAVING("ah65iqmwa5j0qwotm6amhijlg","dfs_cutval");
//3 cgqr48qol9p8bsqjnryo5z5x9
// static int dfs_range(node_t * v, edge_t * par, int low)
-public static int dfs_range(Agnode_s v, Agedge_s par, int low) {
+public static int dfs_range(ST_Agnode_s v, ST_Agedge_s par, int low) {
ENTERING("cgqr48qol9p8bsqjnryo5z5x9","dfs_range");
try {
- Agedge_s e;
+ ST_Agedge_s e;
int i, lim;
lim = low;
ND_par(v, par);
ND_low(v, low);
- for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
if (NEQ(e, par))
lim = dfs_range(aghead(e), e, lim);
- for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
if (NEQ(e, par))
lim = dfs_range(agtail(e), e, lim);
ND_lim(v, lim);
diff --git a/src/gen/lib/common/output__c.java b/src/gen/lib/common/output__c.java
index 4c6dad4..ea0815c 100644
--- a/src/gen/lib/common/output__c.java
+++ b/src/gen/lib/common/output__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class output__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/pointset__c.java b/src/gen/lib/common/pointset__c.java
index b42b761..bac8b10 100644
--- a/src/gen/lib/common/pointset__c.java
+++ b/src/gen/lib/common/pointset__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class pointset__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/postproc__c.java b/src/gen/lib/common/postproc__c.java
index 40ee2fd..0580986 100644
--- a/src/gen/lib/common/postproc__c.java
+++ b/src/gen/lib/common/postproc__c.java
@@ -55,12 +55,12 @@ import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.common.geom__c.ccwrotatepf;
-import static gen.lib.common.memory__c.zmalloc;
+import static gen.lib.common.splines__c.edgeMidpoint;
import static gen.lib.common.splines__c.getsplinepoints;
import static gen.lib.common.utils__c.late_bool;
+import static gen.lib.common.utils__c.updateBB;
import static gen.lib.label.xlabels__c.placeLabels;
import static smetana.core.JUtils.NEQ;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGRAPH;
@@ -88,26 +88,24 @@ import static smetana.core.Macro.ND_coord;
import static smetana.core.Macro.ND_height;
import static smetana.core.Macro.ND_width;
import static smetana.core.Macro.ND_xlabel;
-import static smetana.core.Macro.NOT;
+import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsym_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Agsym_s;
+import h.ST_bezier;
import h.ST_boxf;
-import h.bezier;
-import h.boxf;
-import h.label_params_t;
-import h.object_t;
-import h.pointf;
-import h.splines;
-import h.textlabel_t;
-import h.xlabel_t;
+import h.ST_cinfo_t;
+import h.ST_label_params_t;
+import h.ST_object_t;
+import h.ST_pointf;
+import h.ST_splines;
+import h.ST_textlabel_t;
+import h.ST_xlabel_t;
import smetana.core.CString;
-import smetana.core.JUtils;
+import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class postproc__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -367,14 +365,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -403,26 +401,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -445,16 +423,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -757,22 +735,22 @@ throw new UnsupportedOperationException();
//1 ejooa1m5uoq0ue852wtuerpy
// static pointf Offset
-//private final static __struct__<pointf> Offset = JUtils.from(pointf.class);
+//private final static ST_pointf Offset = new ST_pointf();
//3 dajapw16wus3rwimkrk5ihi2b
// static pointf map_point(pointf p)
-public static __struct__<pointf> map_point(final __struct__<pointf> p) {
+public static ST_pointf map_point(final ST_pointf p) {
// WARNING!! STRUCT
return map_point_w_(p.copy()).copy();
}
-private static __struct__<pointf> map_point_w_(final __struct__<pointf> p) {
+private static ST_pointf map_point_w_(final ST_pointf p) {
ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point");
try {
p.___(ccwrotatepf(p, Z.z().Rankdir * 90));
- p.setDouble("x", p.getDouble("x") - Z.z().Offset.getDouble("x"));
- p.setDouble("y", p.getDouble("y") - Z.z().Offset.getDouble("y"));
+ p.setDouble("x", p.x - Z.z().Offset.x);
+ p.setDouble("y", p.y - Z.z().Offset.y);
return p;
} finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
@@ -784,37 +762,37 @@ LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
//3 bvq3vvonvotn47mfe5zsvchie
// static void map_edge(edge_t * e)
-public static void map_edge(Agedge_s e) {
+public static void map_edge(ST_Agedge_s e) {
ENTERING("bvq3vvonvotn47mfe5zsvchie","map_edge");
try {
int j, k;
- final __struct__<bezier> bz = JUtils.from(bezier.class);
+ final ST_bezier bz = new ST_bezier();
if (ED_spl(e) == null) {
if ((Z.z().Concentrate == false) && (ED_edge_type(e) != 6))
System.err.println("lost %s %s edge\n"+ agnameof(agtail(e))+
agnameof(aghead(e)));
return;
}
- for (j = 0; j < ED_spl(e).getInt("size"); j++) {
- bz.___(ED_spl(e).getArrayOfPtr("list").plus(j).getStruct());
- for (k = 0; k < bz.getInt("size"); k++) {
- bz.getArrayOfPtr("list").plus(k).setStruct(map_point(bz.getArrayOfPtr("list").plus(k).getStruct()));
+ for (j = 0; j < ED_spl(e).size; j++) {
+ bz.___(ED_spl(e).list.plus(j).getStruct());
+ for (k = 0; k < bz.size; k++) {
+ bz.list.get(k).setStruct(map_point((ST_pointf) bz.list.get(k).getStruct()));
}
- if (bz.getBoolean("sflag"))
+ if (bz.sflag!=0)
UNSUPPORTED("7894dgzvk2um2w1a5ph2r0bcc"); // ED_spl(e)->list[j].sp = map_point(ED_spl(e)->list[j].sp);
- if (bz.getBoolean("eflag")) {
- ED_spl(e).getArrayOfPtr("list").plus(j).getStruct("ep").___(map_point(ED_spl(e).getArrayOfPtr("list").plus(j).getStruct("ep")));
+ if (bz.eflag!=0) {
+ ED_spl(e).list.get(j).ep.___(map_point((ST_pointf) ED_spl(e).list.get(j).ep));
}
}
if (ED_label(e)!=null)
- ED_label(e).getStruct("pos").___(map_point(ED_label(e).getStruct("pos")));
+ ED_label(e).pos.___(map_point((ST_pointf) ED_label(e).pos));
if (ED_xlabel(e)!=null)
UNSUPPORTED("al3tnq9zjjqeq1ll7qdxyu3ja"); // ED_xlabel(e)->pos = map_point(ED_xlabel(e)->pos);
/* vladimir */
if (ED_head_label(e)!=null)
-UNSUPPORTED("6ntujaf13k6emf6cuf7ox8ath"); // ED_head_label(e)->pos = map_point(ED_head_label(e)->pos);
+ ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).pos));
if (ED_tail_label(e)!=null)
-UNSUPPORTED("2is3ug7jbugrkl9bu6nfnz2lt"); // ED_tail_label(e)->pos = map_point(ED_tail_label(e)->pos);
+ ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).pos));
} finally {
LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge");
}
@@ -825,7 +803,7 @@ LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge");
//3 a3hf82rxsojxbunj6p8a6bkse
// void translate_bb(graph_t * g, int rankdir)
-public static void translate_bb(Agraph_s g, int rankdir) {
+public static void translate_bb(ST_Agraph_s g, int rankdir) {
ENTERING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
try {
int c;
@@ -840,10 +818,10 @@ UNSUPPORTED("crysiae5zxc69cj3v2ygfs8xn"); // new_bb.UR = map_point(pointfof(bb.
}
GD_bb(g).___(new_bb);
if (GD_label(g)!=null) {
- GD_label(g).setStruct("pos", map_point(GD_label(g).getStruct("pos")));
+ GD_label(g).setStruct("pos", map_point((ST_pointf) GD_label(g).pos));
}
for (c = 1; c <= GD_n_cluster(g); c++)
- translate_bb((Agraph_s) GD_clust(g).plus(c).getPtr(), rankdir);
+ translate_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), rankdir);
} finally {
LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
}
@@ -854,12 +832,12 @@ LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
//3 h4i5qxnd7hlrew919abswd13
// static void translate_drawing(graph_t * g)
-public static void translate_drawing(Agraph_s g) {
+public static void translate_drawing(ST_Agraph_s g) {
ENTERING("h4i5qxnd7hlrew919abswd13","translate_drawing");
try {
- Agnode_s v;
- Agedge_s e;
- boolean shift = (Z.z().Offset.getDouble("x")!=0.0 || Z.z().Offset.getDouble("y")!=0.0);
+ ST_Agnode_s v;
+ ST_Agedge_s e;
+ boolean shift = (Z.z().Offset.x!=0.0 || Z.z().Offset.y!=0.0);
if (N(shift) && N(Z.z().Rankdir))
return;
for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) {
@@ -911,17 +889,17 @@ throw new UnsupportedOperationException();
//3 2i713kmewjct2igf3lwm80462
// static pointf centerPt (xlabel_t* xlp)
-public static Object centerPt(Object... arg) {
-UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
-UNSUPPORTED("1pd2hqj3zbktacr9dt2vdvkgr"); // centerPt (xlabel_t* xlp) {
-UNSUPPORTED("3f7r93jimpwvyc6atnkppttgl"); // pointf p;
-UNSUPPORTED("6jtpe3khjpc9oogxx6kerapem"); // p = xlp->pos;
-UNSUPPORTED("7rsewd63gsf3h9d5aj5v7x66c"); // p.x += (xlp->sz.x)/2.0;
-UNSUPPORTED("3c70xgshcb3nvyi64kr041yjz"); // p.y += (xlp->sz.y)/2.0;
-UNSUPPORTED("bft6601q2uop0mu5y59jg4c81"); // return p;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_pointf centerPt(ST_xlabel_t.Array xlp) {
+ENTERING("2i713kmewjct2igf3lwm80462","centerPt");
+try {
+ final ST_pointf p = new ST_pointf();
+ p.___(xlp.getStruct().pos);
+ p.setDouble("x", p.x + xlp.getStruct().sz.x/2);
+ p.setDouble("y", p.y + xlp.getStruct().sz.y/2);
+ return p;
+} finally {
+LEAVING("2i713kmewjct2igf3lwm80462","centerPt");
+}
}
@@ -964,26 +942,32 @@ throw new UnsupportedOperationException();
//3 95pnpuiq4khinrz2bqkci9nfg
// static pointf edgeTailpoint (Agedge_t* e)
-public static Object edgeTailpoint(Object... arg) {
-UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
-UNSUPPORTED("b5i1gh69zn27sn9j8kpmvtbeb"); // edgeTailpoint (Agedge_t* e)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("6tl9mepc2bett364jduh2q4mf"); // splines *spl;
-UNSUPPORTED("3hs99atzl1l857khumt6ycmbh"); // bezier *bez;
-UNSUPPORTED("26m18ntdxgq9wp5vlh2x7auh5"); // if ((spl = getsplinepoints(e)) == NULL) {
+public static ST_pointf edgeTailpoint(ST_Agedge_s e) {
+ENTERING("95pnpuiq4khinrz2bqkci9nfg","edgeTailpoint");
+try {
+ return edgeTailpoint_(e).copy();
+} finally {
+LEAVING("95pnpuiq4khinrz2bqkci9nfg","edgeTailpoint");
+}
+}
+private static ST_pointf edgeTailpoint_(ST_Agedge_s e) {
+ ST_splines spl;
+ ST_bezier bez;
+ spl = getsplinepoints(e);
+ if (spl == null) {
UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4djdvk87infum4r43tuhnm5mp"); // bez = &spl->list[0];
-UNSUPPORTED("45rq0m21hutb3z6f4npw7ke9f"); // if (bez->sflag) {
-UNSUPPORTED("9ttezx014gi1oy9xopnihsnac"); // return bez->sp;
-UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
-UNSUPPORTED("c00cyqleu301qclgim7szyf7"); // return bez->list[0];
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+ }
+ bez = spl.list.get(0);
+ // bez = &spl->list[0];
+if (bez.sflag!=0) {
+ return (ST_pointf) bez.sp;
+} else {
+ return (ST_pointf) (bez.getPtr()).list.get(0);
+ // return bez->list[0];
+ }
-throw new UnsupportedOperationException();
}
@@ -991,27 +975,31 @@ throw new UnsupportedOperationException();
//3 av67wf2xi70ncgl90j1ttrjjs
// static pointf edgeHeadpoint (Agedge_t* e)
-public static __struct__<pointf> edgeHeadpoint(Agedge_s e) {
+public static ST_pointf edgeHeadpoint(ST_Agedge_s e) {
+ENTERING("av67wf2xi70ncgl90j1ttrjjs","edgeHeadpoint");
+try {
return edgeHeadpoint_(e).copy();
+} finally {
+LEAVING("av67wf2xi70ncgl90j1ttrjjs","edgeHeadpoint");
}
-private static __struct__<pointf> edgeHeadpoint_(Agedge_s e) {
- splines spl;
- __ptr__ bez;
+}
+private static ST_pointf edgeHeadpoint_(ST_Agedge_s e) {
+ ST_splines spl;
+ ST_bezier bez;
spl = getsplinepoints(e);
if (spl == null) {
UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
}
-bez = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr();
+bez = spl.list.plus(spl.size - 1).getPtr();
// bez = &spl->list[spl->size - 1];
-if (bez.getBoolean("eflag")) {
- return bez.getStruct("ep");
+if (bez.eflag!=0) {
+ return (ST_pointf) bez.ep;
} else {
-UNSUPPORTED("6qzm0hh4pxrspfbvxearcz9z8"); // return bez->list[bez->size - 1];
+ return (ST_pointf) ((ST_bezier)bez.getPtr()).list.plus(bez.size - 1).getStruct();
+// return bez->list[bez->size - 1];
}
-
-throw new UnsupportedOperationException();
}
@@ -1019,18 +1007,23 @@ throw new UnsupportedOperationException();
//3 1ca6fh8ns5bgzfzcz8al4eh4k
// static boxf adjustBB (object_t* objp, boxf bb)
-public static __struct__<boxf> adjustBB(__ptr__ objp, __struct__<boxf> bb) {
+public static ST_boxf adjustBB(ST_object_t.Array objp, ST_boxf bb) {
+ENTERING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
+try {
return adjustBB_(objp, bb.copy()).copy();
+} finally {
+LEAVING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
}
-private static __struct__<boxf> adjustBB_(__ptr__ objp, __struct__<boxf> bb) {
- final __struct__<pointf> ur = JUtils.from(pointf.class);
+}
+private static ST_boxf adjustBB_(ST_object_t.Array objp, ST_boxf bb) {
+ final ST_pointf ur = new ST_pointf();
/* Adjust bounding box */
- bb.getStruct("LL").setDouble("x", MIN(bb.getStruct("LL").getDouble("x"), objp.getPtr("pos").getDouble("x")));
- bb.getStruct("LL").setDouble("y", MIN(bb.getStruct("LL").getDouble("y"), objp.getPtr("pos").getDouble("y")));
- ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x"));
- ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y"));
- bb.getStruct("UR").setDouble("x", MAX(bb.getStruct("UR").getDouble("x"), ur.getDouble("x")));
- bb.getStruct("UR").setDouble("y", MAX(bb.getStruct("UR").getDouble("y"), ur.getDouble("y")));
+ bb.LL.setDouble("x", MIN(bb.LL.x, objp.getStruct().pos.x));
+ bb.LL.setDouble("y", MIN(bb.LL.y, objp.getStruct().pos.y));
+ ur.setDouble("x", objp.getStruct().pos.x + objp.getStruct().sz.x);
+ ur.setDouble("y", objp.getStruct().pos.y + objp.getStruct().sz.y);
+ bb.UR.setDouble("x", MAX(bb.UR.x, ur.x));
+ bb.UR.setDouble("y", MAX(bb.UR.y, ur.y));
return bb;
}
@@ -1039,13 +1032,18 @@ private static __struct__<boxf> adjustBB_(__ptr__ objp, __struct__<boxf> bb) {
//3 3mefe722uemyoa0czmkkw6hjb
// static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
-public static void addXLabel(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
+public static void addXLabel(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) {
+ENTERING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
+try {
addXLabel_(lp, objp, xlp, initObj, pos.copy());
+} finally {
+LEAVING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
+}
}
-private static void addXLabel_(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
+private static void addXLabel_(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) {
if (initObj!=0) {
- objp.getStruct("sz").setDouble("x", 0);
- objp.getStruct("sz").setDouble("y", 0);
+ objp.getStruct().sz.setDouble("x", 0);
+ objp.getStruct().sz.setDouble("y", 0);
objp.setStruct("pos", pos);
}
if (Z.z().Flip) {
@@ -1053,10 +1051,10 @@ UNSUPPORTED("99tzt7erbvtfsbo0jbdz0lc8m"); // xlp->sz.x = lp->dimen.y;
UNSUPPORTED("6v5t3ysaisj27bwc0r9zg3rpd"); // xlp->sz.y = lp->dimen.x;
}
else {
- xlp.setStruct("sz", lp.getStruct("dimen"));
+ xlp.get(0).sz.___(lp.dimen);
}
-xlp.setPtr("lbl", lp);
-xlp.setInt("set", 0);
+xlp.get(0).lbl = lp;
+xlp.get(0).set = 0;
objp.setPtr("lbl", xlp);
}
@@ -1065,27 +1063,27 @@ objp.setPtr("lbl", xlp);
//3 dwxd5kvlanbcxqfuncjg0ea54
// static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
-public static __struct__<boxf> addLabelObj(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
+public static ST_boxf addLabelObj(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
// WARNING!! STRUCT
return addLabelObj_(lp, objp, bb.copy()).copy();
}
-private static __struct__<boxf> addLabelObj_(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
- ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
+private static ST_boxf addLabelObj_(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
+ ENTERING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
try {
if (Z.z().Flip) {
UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y;
UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
}
else {
- objp.getPtr("sz").setDouble("x", lp.getStruct("dimen").getDouble("x"));
- objp.getPtr("sz").setDouble("y", lp.getStruct("dimen").getDouble("y"));
+ objp.getStruct().sz.setDouble("x", lp.dimen.x);
+ objp.getStruct().sz.setDouble("y", lp.dimen.y);
}
- objp.setStruct("pos", lp.getStruct("pos"));
- objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 2.0 ));
- objp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 ));
+ objp.setStruct("pos", lp.pos);
+ objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - (objp.getStruct().sz.x / 2.0 ));
+ objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - (objp.getStruct().sz.y / 2.0 ));
return adjustBB(objp, bb);
} finally {
- LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
+ LEAVING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
}
}
@@ -1094,11 +1092,11 @@ UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
//3 b8tjygxnwny5qoiir1mha1d62
// static boxf addNodeObj (node_t* np, object_t* objp, boxf bb)
-public static __struct__<boxf> addNodeObj(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
+public static ST_boxf addNodeObj(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
// WARNING!! STRUCT
return addNodeObj_(np, objp, bb.copy()).copy();
}
-public static __struct__<boxf> addNodeObj_(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
+public static ST_boxf addNodeObj_(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
try {
if (Z.z().Flip) {
@@ -1106,12 +1104,12 @@ try {
UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
}
else {
- objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72));
- objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72));
+ objp.getStruct().sz.setDouble("x", ((ND_width(np))*(double)72));
+ objp.getStruct().sz.setDouble("y", ((ND_height(np))*(double)72));
}
objp.setPtr("pos", ND_coord(np));
- objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0);
- objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0);
+ objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - objp.getStruct().sz.x / 2.0);
+ objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - objp.getStruct().sz.y / 2.0);
return adjustBB(objp, bb);
} finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
@@ -1123,22 +1121,27 @@ try {
//3 6kx3lin2ig9o2otk2bqzdvd4t
// static cinfo_t addClusterObj (Agraph_t* g, cinfo_t info)
-public static Object addClusterObj(Object... arg) {
-UNSUPPORTED("91ncv8p43nko0ygysclvv77j"); // static cinfo_t
-UNSUPPORTED("bmfjbc1td1mizemu2aa81cyli"); // addClusterObj (Agraph_t* g, cinfo_t info)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("53xzwretgdbd0atozc0w6hagb"); // int c;
-UNSUPPORTED("7z5fb6iyowsosn1hiz7opeoc6"); // for (c = 1; c <= GD_n_cluster(g); c++)
-UNSUPPORTED("6o81thi0rqvkah0s4zkn2fcg4"); // info = addClusterObj (GD_clust(g)[c], info);
-UNSUPPORTED("1ke0hve63v76yb4shi7jfrp6x"); // if ((g != agroot(g)) && (GD_label(g)) && GD_label(g)->set) {
-UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp;
-UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb);
-UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("9kt6o7m6t7fgdh41zfez84fmv"); // return info;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_cinfo_t addClusterObj(ST_Agraph_s g, ST_cinfo_t info) {
+ENTERING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj");
+try {
+ return addClusterObj_(g, info.copy()).copy();
+} finally {
+LEAVING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj");
+}
+}
+private static ST_cinfo_t addClusterObj_(ST_Agraph_s g, ST_cinfo_t info) {
+ int c;
+ for (c = 1; c <= GD_n_cluster(g); c++)
+ info.___(addClusterObj ((ST_Agraph_s)GD_clust(g).get(c).castTo(ST_Agraph_s.class), info));
+ if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && GD_label(g).set!=0) {
+ ST_object_t.Array objp = info.objp;
+ info.setStruct("bb", addLabelObj (GD_label(g), objp, (ST_boxf) info.bb));
+ info.objp = info.objp.plus(1);
+//UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp;
+//UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb);
+//UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++;
+ }
+ return info;
}
@@ -1146,19 +1149,19 @@ throw new UnsupportedOperationException();
//3 2tdbzvdtkwxp75kj0iufsynm5
// static int countClusterLabels (Agraph_t* g)
-public static Object countClusterLabels(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("6o4fsu24jc0ezulf31fsi9bce"); // countClusterLabels (Agraph_t* g)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("2q4dlnxpy4lj011whzcbyq3xj"); // int c, i = 0;
-UNSUPPORTED("68odyos1g0n4tbs7c77r0f9wn"); // if ((g != agroot(g)) && (GD_label(g)) && GD_label(g)->set)
-UNSUPPORTED("chd2f5z6rt19lbaye25ej7q6j"); // i++;
-UNSUPPORTED("7z5fb6iyowsosn1hiz7opeoc6"); // for (c = 1; c <= GD_n_cluster(g); c++)
-UNSUPPORTED("adgz5sd2oklf51or5uq3wduuz"); // i += countClusterLabels (GD_clust(g)[c]);
-UNSUPPORTED("ahwo5hst5k1gyq20ve63ahe81"); // return i;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+public static int countClusterLabels(ST_Agraph_s g) {
+ENTERING("2tdbzvdtkwxp75kj0iufsynm5","countClusterLabels");
+try {
+ int c, i = 0;
+ if (NEQ(g, agroot(g)) && GD_label(g)!=null && GD_label(g).set!=0)
+ i++;
+ for (c = 1; c <= GD_n_cluster(g); c++)
+ i += countClusterLabels((ST_Agraph_s) GD_clust(g).plus(c).castTo(ST_Agraph_s.class));
+ return i;
+} finally {
+LEAVING("2tdbzvdtkwxp75kj0iufsynm5","countClusterLabels");
+}
-throw new UnsupportedOperationException();
}
@@ -1166,25 +1169,25 @@ throw new UnsupportedOperationException();
//3 d4215jd9wukfn6t0iknwzjcof
// static void addXLabels(Agraph_t * gp)
-public static void addXLabels(Agraph_s gp) {
+public static void addXLabels(ST_Agraph_s gp) {
ENTERING("d4215jd9wukfn6t0iknwzjcof","addXLabels");
try {
- Agnode_s np;
- Agedge_s ep;
+ ST_Agnode_s np;
+ ST_Agedge_s ep;
int cnt, i, n_objs, n_lbls;
int n_nlbls = 0; /* # of unset node xlabels */
int n_elbls = 0; /* # of unset edge labels or xlabels */
int n_set_lbls = 0; /* # of set xlabels and edge labels */
int n_clbls = 0; /* # of set cluster labels */
- final __struct__<boxf> bb = JUtils.from(boxf.class);
- final __struct__<pointf> ur = JUtils.from(pointf.class);
- textlabel_t lp;
- final __struct__<label_params_t> params = JUtils.from(label_params_t.class);
- __ptr__ objs;
- __ptr__ lbls;
- __ptr__ objp;
- __ptr__ xlp;
- Agsym_s force;
+ final ST_boxf bb = new ST_boxf();
+ final ST_pointf ur = new ST_pointf();
+ ST_textlabel_t lp;
+ final ST_label_params_t params = new ST_label_params_t();
+ ST_object_t.Array objs;
+ ST_xlabel_t.Array lbls;
+ ST_object_t.Array objp;
+ ST_xlabel_t.Array xlp;
+ ST_Agsym_s force;
int et = (GD_flags(gp) & (7 << 1));
if (N(GD_has_labels(gp) & (1 << 4)) &&
N(GD_has_labels(gp) & (1 << 5)) &&
@@ -1207,19 +1210,19 @@ UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED
UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
}
if (ED_head_label(ep)!=null) {
- if (ED_head_label(ep).getBoolean("set"))
+ if (ED_head_label(ep).set!=0)
n_set_lbls++;
else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
n_elbls++;
}
if (ED_tail_label(ep)!=null) {
-UNSUPPORTED("abwl715n01quq34u2qs1kn9xn"); // if (ED_tail_label(ep)->set)
-UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
-UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
-UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
+ if (ED_tail_label(ep).set!=0)
+ n_set_lbls++;
+ else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
+ n_elbls++;
}
if (ED_label(ep)!=null) {
- if (ED_label(ep).getBoolean("set"))
+ if (ED_label(ep).set!=0)
n_set_lbls++;
else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
n_elbls++;
@@ -1227,7 +1230,7 @@ UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
}
}
if ((GD_has_labels(gp) & (1 << 3))!=0)
-UNSUPPORTED("4z3bgexjlrmdrfgpdaajems8q"); // n_clbls = countClusterLabels (gp);
+ n_clbls = countClusterLabels (gp);
/* A label for each unpositioned external label */
n_lbls = n_nlbls + n_elbls;
if (n_lbls == 0) return;
@@ -1235,9 +1238,9 @@ UNSUPPORTED("4z3bgexjlrmdrfgpdaajems8q"); // n_clbls = countClusterLabels (gp);
* and all unset edge labels and xlabels.
*/
n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
- objs = zmalloc(sizeof(object_t.class, n_objs));
+ objs = new ST_object_t.Array(n_objs);
objp = objs;
- lbls = zmalloc(sizeof(xlabel_t.class, n_lbls));
+ lbls = new ST_xlabel_t.Array(n_lbls);
xlp = lbls;
bb.setStruct("LL", pointfof(INT_MAX, INT_MAX));
bb.setStruct("UR", pointfof(-INT_MAX, -INT_MAX));
@@ -1258,12 +1261,12 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
lp = ED_label(ep);
if (lp != null) {
- if (lp.getBoolean("set")) {
+ if (lp.set!=0) {
bb.___(addLabelObj (lp, objp, bb));
}
else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
-UNSUPPORTED("9ffmrymv8cg4h4b3ea97t9qbp"); // addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
-UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
+ addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
+ xlp = xlp.plus(1);
}
else {
UNSUPPORTED("3ia66n3hqrwmh3hybkoh6f8wa"); // agerr(AGWARN, "no position for edge with label %s",
@@ -1274,23 +1277,23 @@ objp = objp.plus(1);
}
lp = ED_tail_label(ep);
if (lp != null) {
-if (lp.getBoolean("set")) {
+if (lp.set!=0) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
}
-UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
-UNSUPPORTED("bqc6ukxlmt6l3osbpsmqbzutc"); // addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
-UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
+ else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
+ addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
+ xlp = xlp.plus(1);
+ }
+ else {
UNSUPPORTED("5ixexxcbcix5hrfl43td7pj4s"); // agerr(AGWARN, "no position for edge with tail label %s",
UNSUPPORTED("cf9qaysecgkvv4165la4uu6cb"); // ED_tail_label(ep)->text);
UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
+ }
objp = objp.plus(1);
}
lp = ED_head_label(ep);
if (lp != null) {
-if (lp.getBoolean("set")) {
+if (lp.set!=0) {
UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
}
else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
@@ -1323,39 +1326,36 @@ UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
}
}
if (n_clbls!=0) {
-UNSUPPORTED("48ipxdlv7xlti99g0yhi5zuai"); // cinfo_t info;
-UNSUPPORTED("7c5iohb8t706p273ae1lxal8r"); // info.bb = bb;
-UNSUPPORTED("b1474fakrbyw7p5ja42jgv90c"); // info.objp = objp;
-UNSUPPORTED("6ygw8idplugc5u6w7ro3gakmb"); // info = addClusterObj (gp, info);
-UNSUPPORTED("1l2cwgzediv4hztjhtm052rl3"); // bb = info.bb;
+ final ST_cinfo_t info = new ST_cinfo_t();
+ info.setStruct("bb", bb);
+ info.objp = objp;
+ info.___(addClusterObj (gp, info));
+ bb.___(info.bb);
}
force = (agattr(gp,AGRAPH,new CString("forcelabels"),null));
-params.setBoolean("force", late_bool(gp, force, 1));
+params.force = late_bool(gp, force, 1);
params.setStruct("bb", bb);
-placeLabels(objs, n_objs, lbls, n_lbls, params.amp());
-UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
-UNSUPPORTED("4iypau1fdov37qnq2ub6iq5ra"); // printData(objs, n_objs, lbls, n_lbls, &params);
-UNSUPPORTED("52mefujap7scy273ud7nyj9hn"); // xlp = lbls;
-UNSUPPORTED("3wtn792c3ql5yhn77alu6r5d8"); // cnt = 0;
-UNSUPPORTED("30yvif5t111f94y1fs2gd8crq"); // for (i = 0; i < n_lbls; i++) {
-UNSUPPORTED("w0kpfap6pb5scjkqkgsfira0"); // if (xlp->set) {
-UNSUPPORTED("7hl03wjg5yryhvbe4ar0i0b8g"); // cnt++;
-UNSUPPORTED("8xqwhcveb6ivragr1ebkp4pfh"); // lp = (textlabel_t *) (xlp->lbl);
-UNSUPPORTED("a5h8ktnl3raui7zo5kcjzd2e0"); // lp->set = 1;
-UNSUPPORTED("4lub8ddx8vt0gove63lajjr4s"); // lp->pos = centerPt(xlp);
-UNSUPPORTED("d613i6370zjpynl7n5caiorig"); // updateBB (gp, lp);
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("1966qdxqc520zc0itk8al0xus"); // xlp++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
-UNSUPPORTED("dy42jv2urndusl1b1jrir300t"); // fprintf (stderr, "%d out of %d labels positioned.\n", cnt, n_lbls);
-UNSUPPORTED("1jtgut2015ohnwt6qfisxgbs5"); // else if (cnt != n_lbls)
+placeLabels(objs, n_objs, lbls, n_lbls, params);
+// if (Verbose)
+// printData(objs, n_objs, lbls, n_lbls, &params);
+ xlp = lbls;
+ cnt = 0;
+ for (i = 0; i < n_lbls; i++) {
+ if (xlp.get(0).set!=0) {
+ cnt++;
+ lp = xlp.getStruct().lbl;
+ lp.setInt("set", 1);
+ lp.setStruct("pos", centerPt(xlp));
+ updateBB (gp, lp);
+ }
+ xlp = xlp.plus(1);
+ }
+// if (Verbose)
+// fprintf (stderr, "%d out of %d labels positioned.\n", cnt, n_lbls);
+if (cnt != n_lbls)
UNSUPPORTED("9hqu9h8q1a2xl4ty48ct0fdyp"); // agerr(AGWARN, "%d out of %d exterior labels positioned.\n", cnt, n_lbls);
-UNSUPPORTED("baez6nmarx9nht65vulvjojic"); // free(objs);
-UNSUPPORTED("ayak2o9js1lmsa5vuzul2sdxs"); // free(lbls);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ Memory.free(objs);
+ Memory.free(lbls);
} finally {
LEAVING("d4215jd9wukfn6t0iknwzjcof","addXLabels");
}
@@ -1366,11 +1366,11 @@ LEAVING("d4215jd9wukfn6t0iknwzjcof","addXLabels");
//3 8fc0zxg8y7hec3n4evx3jw6cq
// void gv_postprocess(Agraph_t * g, int allowTranslation)
-public static void gv_postprocess(Agraph_s g, int allowTranslation) {
+public static void gv_postprocess(ST_Agraph_s g, int allowTranslation) {
ENTERING("8fc0zxg8y7hec3n4evx3jw6cq","gv_postprocess");
try {
double diff;
- final __struct__<pointf> dimen = JUtils.from(pointf.class);
+ final ST_pointf dimen = new ST_pointf();
Z.z().Rankdir = GD_rankdir(g);
Z.z().Flip = GD_flip(g)!=0;
/* Handle cluster labels */
@@ -1383,7 +1383,7 @@ UNSUPPORTED("4hxky2sp978rmy6018sfmts6m"); // place_flip_graph_label(g);
*/
addXLabels(g);
/* Add space for graph label if necessary */
- if (GD_label(g)!=null && N(GD_label(g).getPtr("set"))) {
+ if (GD_label(g)!=null && N(GD_label(g).set)) {
UNSUPPORTED("crj0py2wme4b5l8apvbxqcmqa"); // dimen = GD_label(g)->dimen;
UNSUPPORTED("22jhn709g4c5wh0gb6v40rh19"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
UNSUPPORTED("9k69y89jybam5elefg45va3ey"); // if (Flip) {
@@ -1435,7 +1435,7 @@ UNSUPPORTED("3xtu7zkpqq7nsx9oe68oi6ebt"); // Offset = pointfof(GD_bb(g).LL.
}
translate_drawing(g);
}
- if (GD_label(g)!=null && N(GD_label(g).getPtr("set")))
+ if (GD_label(g)!=null && N(GD_label(g).set))
UNSUPPORTED("6dds0zsvqw48u510zcy954fh1"); // place_root_label(g, dimen);
if (Z.z().Show_boxes!=null) {
UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
@@ -1456,7 +1456,7 @@ LEAVING("8fc0zxg8y7hec3n4evx3jw6cq","gv_postprocess");
//3 3qbbvlnq1b06ylgr0yj2slbhm
// void dotneato_postprocess(Agraph_t * g)
-public static void dotneato_postprocess(Agraph_s g) {
+public static void dotneato_postprocess(ST_Agraph_s g) {
ENTERING("3qbbvlnq1b06ylgr0yj2slbhm","dotneato_postprocess");
try {
gv_postprocess(g, 1);
@@ -1505,15 +1505,15 @@ throw new UnsupportedOperationException();
//3 72zw1alhd5vd0g6mhum507rvx
// void place_graph_label(graph_t * g)
-public static void place_graph_label(Agraph_s g) {
+public static void place_graph_label(ST_Agraph_s g) {
ENTERING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
try {
int c;
- final __struct__<pointf> p = JUtils.from(pointf.class), d = JUtils.from(pointf.class);
- if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).getInt("set"))) {
+ final ST_pointf p = new ST_pointf(), d = new ST_pointf();
+ if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).set)) {
if ((GD_label_pos(g) & 1)!=0) {
- d.___(GD_border(g).plus(2).getStruct());
- p.setDouble("y", GD_bb(g).UR.y - d.getDouble("y") / 2);
+ d.___(GD_border(g)[2].getStruct());
+ p.setDouble("y", GD_bb(g).UR.y - d.y / 2);
} else {
UNSUPPORTED("1w38no4welthbwa0i10hei16b"); // d = GD_border(g)[0];
UNSUPPORTED("2xa4n9ca16xpf1kahaycmkl4r"); // p.y = GD_bb(g).LL.y + d.y / 2;
@@ -1526,10 +1526,10 @@ UNSUPPORTED("7ictv9eqmjvxjii5lqlyw8nu"); // p.x = GD_bb(g).LL.x + d.x / 2;
p.setDouble("x", (GD_bb(g).LL.x + GD_bb(g).UR.x) / 2);
}
GD_label(g).setStruct("pos", p);
- GD_label(g).setBoolean("set", NOT(false));
+ GD_label(g).set= NOTI(false);
}
for (c = 1; c <= GD_n_cluster(g); c++)
- place_graph_label((Agraph_s) GD_clust(g).plus(c).getPtr());
+ place_graph_label((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally {
LEAVING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
}
diff --git a/src/gen/lib/common/psusershape__c.java b/src/gen/lib/common/psusershape__c.java
index d5e5485..deb6a9f 100644
--- a/src/gen/lib/common/psusershape__c.java
+++ b/src/gen/lib/common/psusershape__c.java
@@ -47,10 +47,7 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class psusershape__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/common/routespl__c.java b/src/gen/lib/common/routespl__c.java
index 7478aaf..9ed4acb 100644
--- a/src/gen/lib/common/routespl__c.java
+++ b/src/gen/lib/common/routespl__c.java
@@ -46,19 +46,17 @@
package gen.lib.common;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agtail;
-import static gen.lib.common.memory__c.gmalloc;
import static gen.lib.pathplan.route__c.Proutespline;
import static gen.lib.pathplan.shortest__c.Pshortestpath;
import static gen.lib.pathplan.util__c.make_polyline;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.cos;
import static smetana.core.JUtils.sin;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
-import static smetana.core.Macro.ALLOC;
-import static smetana.core.Macro.ALLOC_allocated2;
+import static smetana.core.Macro.ALLOC_allocated_ST_Pedge_t;
+import static smetana.core.Macro.ALLOC_allocated_ST_pointf;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_to_orig;
import static smetana.core.Macro.INT_MAX;
@@ -66,23 +64,15 @@ import static smetana.core.Macro.INT_MIN;
import static smetana.core.Macro.MIN;
import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT;
-import static smetana.core.Macro.RALLOC;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Pedge_t;
-import h.Ppoly_t;
+import h.ST_Agedge_s;
+import h.ST_Ppoly_t;
import h.ST_boxf;
-import h.boxf;
-import h.path;
-import h.pointf;
-import smetana.core.JUtils;
+import h.ST_path;
+import h.ST_pointf;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__array_of_ptr__;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class routespl__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -342,14 +332,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -378,25 +368,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -420,16 +391,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -758,48 +729,48 @@ throw new UnsupportedOperationException();
//3 7ebl6qohcfpf1b9ucih5r9qgp
// pointf* simpleSplineRoute (pointf tp, pointf hp, Ppoly_t poly, int* n_spl_pts, int polyline)
-public static pointf simpleSplineRoute(final __struct__<pointf> tp, final __struct__<pointf> hp, final __struct__<Ppoly_t> poly, int[] n_spl_pts, boolean polyline) {
+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) {
// WARNING!! STRUCT
-return simpleSplineRoute_w_(tp.copy(), hp.copy(), poly.copy(), n_spl_pts, polyline);
+return simpleSplineRoute_w_(tp.copy(), hp.copy(), (ST_Ppoly_t) poly.copy(), n_spl_pts, polyline);
}
-private static pointf simpleSplineRoute_w_(final __struct__<pointf> tp, final __struct__<pointf> hp, final __struct__<Ppoly_t> poly, int[] n_spl_pts, boolean polyline) {
+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) {
ENTERING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
try {
- final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
- final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
- final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
+ final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
+ final ST_pointf.Array eps = new ST_pointf.Array( 2);
+ final ST_pointf.Array evs = new ST_pointf.Array( 2);
int i;
- eps.plus(0).setDouble("x", tp.getDouble("x"));
- eps.plus(0).setDouble("y", tp.getDouble("y"));
- eps.plus(1).setDouble("x", hp.getDouble("x"));
- eps.plus(1).setDouble("y", hp.getDouble("y"));
- if (Pshortestpath(poly.amp(), eps, pl.amp()) < 0)
+ eps.plus(0).setDouble("x", tp.x);
+ eps.plus(0).setDouble("y", tp.y);
+ eps.plus(1).setDouble("x", hp.x);
+ eps.plus(1).setDouble("y", hp.y);
+ if (Pshortestpath(poly, eps, pl) < 0)
return null;
if (polyline)
- make_polyline (pl, spl.amp());
+ make_polyline (pl, spl);
else {
- if (poly.getInt("pn") > Z.z().edgen) {
- Z.z().edges = ALLOC(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
- Z.z().edgen = poly.getInt("pn");
+ if (poly.pn > Z.z().edgen) {
+ Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
+ Z.z().edgen = poly.pn;
}
- for (i = 0; i < poly.getInt("pn"); i++) {
- Z.z().edges.plus(i).setStruct("a", poly.getArrayOfStruct("ps").plus(i).getStruct());
- Z.z().edges.plus(i).setStruct("b", poly.getArrayOfStruct("ps").plus((i + 1) % poly.getInt("pn")).getStruct());
+ for (i = 0; i < poly.pn; i++) {
+ Z.z().edges.plus(i).setStruct("a", poly.ps.plus(i).getStruct());
+ Z.z().edges.plus(i).setStruct("b", poly.ps.plus((i + 1) % poly.pn).getStruct());
}
evs.plus(0).setDouble("x", 0);
evs.plus(0).setDouble("y", 0);
evs.plus(1).setDouble("x", 0);
evs.plus(1).setDouble("y", 0);
- if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0)
+ if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0)
return null;
}
- if (mkspacep(spl.getInt("pn")))
+ if (mkspacep(spl.pn))
return null;
- for (i = 0; i < spl.getInt("pn"); i++) {
- Z.z().ps.plus(i).setStruct(spl.getArrayOfPtr("ps").plus(i).getStruct());
+ for (i = 0; i < spl.pn; i++) {
+ Z.z().ps.plus(i).setStruct(spl.ps.plus(i).getStruct());
}
- n_spl_pts[0] = spl.getInt("pn");
- return (pointf) Z.z().ps;
+ n_spl_pts[0] = spl.pn;
+ return Z.z().ps;
} finally {
LEAVING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
}
@@ -814,7 +785,7 @@ public static int routesplinesinit() {
ENTERING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
try {
if (++Z.z().routeinit > 1) return 0;
- if (N(Z.z().ps = gmalloc(sizeof(pointf.class, 300)))) {
+ if (N(Z.z().ps = new ST_pointf.Array(300))) {
UNSUPPORTED("2qoo3na2ur9oh7hmvt6xv1txd"); // agerr(AGERR, "routesplinesinit: cannot allocate ps\n");
UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
}
@@ -853,12 +824,12 @@ LEAVING("55j3tny5cxemrsvrt3m21jxg8","routesplinesterm");
//3 cu8ssjizw7ileqe9u7tcclq7k
// static void limitBoxes (boxf* boxes, int boxn, pointf *pps, int pn, int delta)
-public static void limitBoxes(__array_of_ptr__ boxes, int boxn, __ptr__ pps, int pn, int delta) {
+public static void limitBoxes(ST_boxf boxes[], int boxn, __ptr__ pps, int pn, int delta) {
ENTERING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
try {
int bi, si, splinepi;
double t;
- final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_pointf.Array sp = new ST_pointf.Array( 4);
int num_div = delta * boxn;
for (splinepi = 0; splinepi + 3 < pn; splinepi += 3) {
for (si = 0; si <= num_div; si++) {
@@ -867,26 +838,26 @@ try {
sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct());
sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct());
sp.plus(3).getStruct().___(pps.plus(splinepi+3).getStruct());
- sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
- sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
- sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x")));
- sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y")));
- sp.plus(2).setDouble("x", sp.plus(2).getDouble("x") + t * (sp.plus(3).getDouble("x") - sp.plus(2).getDouble("x")));
- sp.plus(2).setDouble("y", sp.plus(2).getDouble("y") + t * (sp.plus(3).getDouble("y") - sp.plus(2).getDouble("y")));
- sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
- sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
- sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x")));
- sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y")));
- sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
- sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
+ sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
+ sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
+ sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
+ sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
+ sp.plus(2).setDouble("x", sp.get(2).x + t * (sp.get(3).x - sp.get(2).x));
+ sp.plus(2).setDouble("y", sp.get(2).y + t * (sp.get(3).y - sp.get(2).y));
+ sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
+ sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
+ sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
+ sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
+ sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
+ sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
for (bi = 0; bi < boxn; bi++) {
/* this tested ok on 64bit machines, but on 32bit we need this FUDGE
* or graphs/directed/records.gv fails */
- if (sp.plus(0).getDouble("y") <= boxes.plus(bi).getStruct("UR").getDouble("y")+.0001 && sp.plus(0).getDouble("y") >= boxes.plus(bi).getStruct("LL").getDouble("y")-.0001) {
- if (boxes.plus(bi).getStruct("LL").getDouble("x") > sp.plus(0).getDouble("x"))
- boxes.plus(bi).getStruct("LL").setDouble("x", sp.plus(0).getDouble("x"));
- if (boxes.plus(bi).getStruct("UR").getDouble("x") < sp.plus(0).getDouble("x"))
- boxes.plus(bi).getStruct("UR").setDouble("x", sp.plus(0).getDouble("x"));
+ if (sp.get(0).y <= boxes[bi].UR.y+.0001 && sp.get(0).y >= boxes[bi].LL.y-.0001) {
+ if (boxes[bi].LL.x > sp.get(0).x)
+ boxes[bi].LL.setDouble("x", sp.get(0).x);
+ if (boxes[bi].UR.x < sp.get(0).x)
+ boxes[bi].UR.setDouble("x", sp.get(0).x);
}
}
}
@@ -901,45 +872,45 @@ LEAVING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
//3 3mcnemqisisnqtd4mr72ej76y
// static pointf *_routesplines(path * pp, int *npoints, int polyline)
-public static __ptr__ _routesplines(path pp, int npoints[], int polyline) {
+public static __ptr__ _routesplines(ST_path pp, int npoints[], int polyline) {
ENTERING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
try {
- final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
- final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
+ final ST_Ppoly_t poly = new ST_Ppoly_t();
+ final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
int splinepi;
- final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
- final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
+ final ST_pointf.Array eps = new ST_pointf.Array( 2);
+ final ST_pointf.Array evs = new ST_pointf.Array( 2);
int edgei, prev, next;
int pi=0, bi;
- __array_of_ptr__ boxes;
+ ST_boxf[] boxes;
int boxn;
- Agedge_s realedge;
+ ST_Agedge_s realedge;
int flip;
int loopcnt, delta = 10;
boolean unbounded;
Z.z().nedges++;
- Z.z().nboxes += pp.getInt("nbox");
- for (realedge = (Agedge_s) pp.getPtr("data").castTo(Agedge_s.class);
+ Z.z().nboxes += pp.nbox;
+ for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class);
realedge!=null && ED_edge_type(realedge) != 0;
realedge = ED_to_orig(realedge));
if (N(realedge)) {
UNSUPPORTED("agerr(AGERR, _in routesplines, cannot find NORMAL edge");
return null;
}
- boxes = pp.getArrayOfPtr("boxes");
- boxn = pp.getInt("nbox");
+ boxes = pp.boxes;
+ boxn = pp.nbox;
if (checkpath(boxn, boxes, pp)!=0)
return null;
if (boxn * 8 > Z.z().polypointn) {
- Z.z().polypoints = ALLOC_allocated2(boxn * 8, Z.z().polypoints, pointf.class);
+ Z.z().polypoints = ALLOC_allocated_ST_pointf(Z.z().polypoints, boxn * 8);
Z.z().polypointn = boxn * 8;
}
- if ((boxn > 1) && (((ST_boxf)boxes.plus(0).getStruct()).LL.y > ((ST_boxf)boxes.plus(1).getStruct()).LL.y)) {
+ if ((boxn > 1) && (((ST_boxf)boxes[0]).LL.y > ((ST_boxf)boxes[1]).LL.y)) {
flip = 1;
for (bi = 0; bi < boxn; bi++) {
- double v = ((ST_boxf)boxes.plus(bi).getStruct()).UR.y;
- ((ST_boxf)boxes.plus(bi).getStruct()).UR.y= -1*((ST_boxf)boxes.plus(bi).getStruct()).LL.y;
- ((ST_boxf)boxes.plus(bi).getStruct()).LL.y = -v;
+ double v = ((ST_boxf)boxes[bi]).UR.y;
+ ((ST_boxf)boxes[bi]).UR.y= -1*((ST_boxf)boxes[bi]).LL.y;
+ ((ST_boxf)boxes[bi]).LL.y = -v;
}
}
else flip = 0;
@@ -949,20 +920,20 @@ try {
for (bi = 0, pi = 0; bi < boxn; bi++) {
next = prev = 0;
if (bi > 0)
- prev = (((ST_boxf)boxes.plus(bi).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi-1).getStruct()).LL.y) ? -1 : 1;
+ prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi-1]).LL.y) ? -1 : 1;
if (bi < boxn - 1)
- next = (((ST_boxf)boxes.plus(bi+1).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi).getStruct()).LL.y) ? 1 : -1;
+ next = (((ST_boxf)boxes[bi+1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
if (prev != next) {
if (next == -1 || prev == 1) {
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
} else {
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
}
}
else if (prev == 0) { /* single box */
@@ -981,20 +952,20 @@ UNSUPPORTED("9idk92zg2ysz316lfwzvvvde6"); // return NULL;
for (bi = boxn - 1; bi >= 0; bi--) {
next = prev = 0;
if (bi < boxn - 1)
- prev = (((ST_boxf)boxes.plus(bi).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi+1).getStruct()).LL.y) ? -1 : 1;
+ prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi+1]).LL.y) ? -1 : 1;
if (bi > 0)
- next = (((ST_boxf)boxes.plus(bi-1).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi).getStruct()).LL.y) ? 1 : -1;
+ next = (((ST_boxf)boxes[bi-1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
if (prev != next) {
if (next == -1 || prev == 1 ) {
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
} else {
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
}
}
else if (prev == 0) { /* single box */
@@ -1009,14 +980,14 @@ UNSUPPORTED("87y5d0ts6xdjyx905bha50f3s"); // /* it went badly, e.g. degene
UNSUPPORTED("1qt7hixteu3pt64wk1sqw352a"); // agerr(AGERR, "in routesplines, illegal values of prev %d and next %d, line %d\n", prev, next, 476);
UNSUPPORTED("35untdbpd42pt4c74gjbxqx7q"); // return NULL; /* for correctness sake, it's best to just stop */
}
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
- Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
- Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
+ Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
+ Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
}
}
}
@@ -1027,24 +998,24 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
if (flip!=0) {
int i;
for (bi = 0; bi < boxn; bi++) {
- int v = (int) ((ST_boxf)boxes.plus(bi).getStruct()).UR.y;
- ((ST_boxf)boxes.plus(bi).getStruct()).UR.y = -1*((ST_boxf)boxes.plus(bi).getStruct()).LL.y;
- ((ST_boxf)boxes.plus(bi).getStruct()).LL.y = -v;
+ int v = (int) ((ST_boxf)boxes[bi]).UR.y;
+ ((ST_boxf)boxes[bi]).UR.y = -1*((ST_boxf)boxes[bi]).LL.y;
+ ((ST_boxf)boxes[bi]).LL.y = -v;
}
for (i = 0; i < pi; i++)
- Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.plus(i).getDouble("y"));
+ Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.get(i).y);
}
for (bi = 0; bi < boxn; bi++) {
- ((ST_boxf)boxes.plus(bi).getStruct()).LL.x = INT_MAX;
- ((ST_boxf)boxes.plus(bi).getStruct()).UR.x = INT_MIN;
+ ((ST_boxf)boxes[bi]).LL.x = INT_MAX;
+ ((ST_boxf)boxes[bi]).UR.x = INT_MIN;
}
- poly.setPtr("ps", Z.z().polypoints);
- poly.setInt("pn", pi);
- eps.plus(0).getStruct().setDouble("x", pp.getStruct("start").getStruct("p").getDouble("x"));
- eps.plus(0).getStruct().setDouble("y", pp.getStruct("start").getStruct("p").getDouble("y"));
- eps.plus(1).getStruct().setDouble("x", pp.getStruct("end").getStruct("p").getDouble("x"));
- eps.plus(1).getStruct().setDouble("y", pp.getStruct("end").getStruct("p").getDouble("y"));
- if (Pshortestpath((Ppoly_t) poly.amp(), eps, (Ppoly_t) pl.amp()) < 0) {
+ poly.ps = Z.z().polypoints;
+ poly.pn = pi;
+ eps.plus(0).getStruct().setDouble("x", pp.start.p.x);
+ eps.plus(0).getStruct().setDouble("y", pp.start.p.y);
+ eps.plus(1).getStruct().setDouble("x", pp.end.p.x);
+ eps.plus(1).getStruct().setDouble("y", pp.end.p.y);
+ if (Pshortestpath(poly, eps, pl) < 0) {
System.err.println("in routesplines, Pshortestpath failed\n");
return null;
}
@@ -1052,47 +1023,47 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
}
else {
- if (poly.getInt("pn") > Z.z().edgen) {
- Z.z().edges = ALLOC_allocated2(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
- Z.z().edgen = poly.getInt("pn");
+ if (poly.pn > Z.z().edgen) {
+ Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
+ Z.z().edgen = poly.pn;
}
- for (edgei = 0; edgei < poly.getInt("pn"); edgei++) {
+ for (edgei = 0; edgei < poly.pn; edgei++) {
Z.z().edges.plus(edgei).setStruct("a", Z.z().polypoints.plus(edgei).getStruct());
- Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.getInt("pn")).getStruct());
+ Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct());
}
- if (pp.getStruct("start").getBoolean("constrained")) {
- evs.plus(0).getStruct().setDouble("x", cos(pp.getStruct("start").getDouble("theta")));
- evs.plus(0).getStruct().setDouble("y", sin(pp.getStruct("start").getDouble("theta")));
+ if (pp.start.constrained!=0) {
+ evs.plus(0).getStruct().setDouble("x", cos(pp.start.theta));
+ evs.plus(0).getStruct().setDouble("y", sin(pp.start.theta));
} else
{
evs.plus(0).getStruct().setDouble("x", 0);
evs.plus(0).getStruct().setDouble("y", 0);
}
- if (pp.getStruct("end").getBoolean("constrained")) {
- evs.plus(1).getStruct().setDouble("x", -cos(pp.getStruct("end").getDouble("theta")));
- evs.plus(1).getStruct().setDouble("y", -sin(pp.getStruct("end").getDouble("theta")));
+ if (pp.end.constrained!=0) {
+ evs.plus(1).getStruct().setDouble("x", -cos(pp.end.theta));
+ evs.plus(1).getStruct().setDouble("y", -sin(pp.end.theta));
} else
{
evs.plus(1).getStruct().setDouble("x", 0);
evs.plus(1).getStruct().setDouble("y", 0);
}
- if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0) {
+ if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0) {
UNSUPPORTED("elkeyywrfd4hq75w7toc94rzs"); // agerr(AGERR, "in routesplines, Proutespline failed\n");
UNSUPPORTED("7t3fvwp9cv90qu5bdjdglcgtk"); // return NULL;
}
}
- if (mkspacep(spl.getInt("pn")))
+ if (mkspacep(spl.pn))
UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no memory left */
for (bi = 0; bi < boxn; bi++) {
- boxes.plus(bi).getStruct("LL").setDouble("x", INT_MAX);
- boxes.plus(bi).getStruct("UR").setDouble("x", INT_MIN);
+ boxes[bi].LL.setDouble("x", INT_MAX);
+ boxes[bi].UR.setDouble("x", INT_MIN);
}
unbounded = NOT(false);
- for (splinepi = 0; splinepi < spl.getInt("pn"); splinepi++) {
- Z.z().ps.plus(splinepi).setStruct(spl.getArrayOfPtr("ps").plus(splinepi).getStruct());
+ for (splinepi = 0; splinepi < spl.pn; splinepi++) {
+ Z.z().ps.plus(splinepi).setStruct(spl.ps.plus(splinepi).getStruct());
}
for (loopcnt = 0; unbounded && (loopcnt < 15); loopcnt++) {
- limitBoxes (boxes, boxn, Z.z().ps, spl.getInt("pn"), delta);
+ limitBoxes (boxes, boxn, Z.z().ps, spl.pn, delta);
/* The following check is necessary because if a box is not very
* high, it is possible that the sampling above might miss it.
* Therefore, we make the sample finer until all boxes have
@@ -1101,7 +1072,7 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem
for (bi = 0; bi < boxn; bi++) {
/* these fp equality tests are used only to detect if the
* values have been changed since initialization - ok */
- if ((boxes.plus(bi).getStruct("LL").getDouble("x") == INT_MAX) || (boxes.plus(bi).getStruct("UR").getDouble("x") == INT_MIN)) {
+ if ((boxes[bi].LL.x == INT_MAX) || (boxes[bi].UR.x == INT_MIN)) {
delta *= 2; /* try again with a finer interval */
if (delta > INT_MAX/boxn) /* in limitBoxes, boxn*delta must fit in an int, so give up */
loopcnt = 15;
@@ -1117,13 +1088,13 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem
* to bound the boxes. This will probably mean a bad edge, but we avoid an infinite
* loop and we can see the bad edge, and even use the showboxes scaffolding.
*/
- final __struct__<Ppoly_t> polyspl = JUtils.from(Ppoly_t.class);
+ final ST_Ppoly_t polyspl = new ST_Ppoly_t();
System.err.println("Unable to reclaim box space in spline routing for edge \"%s\" -> \"%s\". Something is probably seriously wrong.\n");
- make_polyline (pl, polyspl.amp());
- limitBoxes (boxes, boxn, polyspl.getPtr("ps"), polyspl.getInt("pn"), 10);
- Memory.free (polyspl.getPtr("ps"));
+ make_polyline (pl, polyspl);
+ limitBoxes (boxes, boxn, polyspl.ps, polyspl.pn, 10);
+ Memory.free (polyspl.ps);
}
- npoints[0] = spl.getInt("pn");
+ npoints[0] = spl.pn;
return Z.z().ps;
} finally {
LEAVING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
@@ -1135,10 +1106,10 @@ LEAVING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
//3 axqoytp2rpr8crajhkuvns6q9
// pointf *routesplines(path * pp, int *npoints)
-public static pointf routesplines(path pp, int npoints[]) {
+public static ST_pointf.Array routesplines(ST_path pp, int npoints[]) {
ENTERING("axqoytp2rpr8crajhkuvns6q9","routesplines");
try {
- return (pointf) _routesplines (pp, npoints, 0);
+ return (ST_pointf.Array) _routesplines (pp, npoints, 0);
} finally {
LEAVING("axqoytp2rpr8crajhkuvns6q9","routesplines");
}
@@ -1149,7 +1120,7 @@ LEAVING("axqoytp2rpr8crajhkuvns6q9","routesplines");
//3 2v22s41xitwnnsljk9n01nrcy
// pointf *routepolylines(path * pp, int *npoints)
-public static pointf routepolylines(path pp, int npoints[]) {
+public static ST_pointf.Array routepolylines(ST_path pp, int npoints[]) {
ENTERING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
try {
UNSUPPORTED("1kjkc6bl8zpf8zjcwgbyni9p3"); // pointf *routepolylines(path * pp, int *npoints)
@@ -1192,43 +1163,43 @@ LEAVING("65qv6x7ghwyt6hey5qd8cgizn","overlap");
//3 dxqjhiid5f58b9gjxp0v3j97b
// static int checkpath(int boxn, boxf* boxes, path* thepath)
-public static int checkpath(int boxn, __array_of_ptr__ boxes, path thepath) {
+public static int checkpath(int boxn, ST_boxf[] boxes, ST_path thepath) {
ENTERING("dxqjhiid5f58b9gjxp0v3j97b","checkpath");
try {
- boxf ba, bb;
+ ST_boxf ba, bb;
int bi, i, errs, l, r, d, u;
int xoverlap, yoverlap;
/* remove degenerate boxes. */
i = 0;
for (bi = 0; bi < boxn; bi++) {
- if (ABS(((ST_boxf)boxes.plus(bi).getStruct()).LL.y - ((ST_boxf)boxes.plus(bi).getStruct()).UR.y) < .01)
+ if (ABS(((ST_boxf)boxes[bi]).LL.y - ((ST_boxf)boxes[bi]).UR.y) < .01)
continue;
- if (ABS(((ST_boxf)boxes.plus(bi).getStruct()).LL.x - ((ST_boxf)boxes.plus(bi).getStruct()).UR.x) < .01)
+ if (ABS(((ST_boxf)boxes[bi]).LL.x - ((ST_boxf)boxes[bi]).UR.x) < .01)
continue;
if (i != bi)
- boxes.plus(i).setStruct(boxes.plus(bi).getStruct());
+ boxes[i].setStruct(boxes[bi]);
i++;
}
boxn = i;
- ba = boxes.plus(0).getStruct().amp();
- if (ba.getStruct("LL").getDouble("x") > ba.getStruct("UR").getDouble("x") || ba.getStruct("LL").getDouble("y") > ba.getStruct("UR").getDouble("y")) {
+ ba = (ST_boxf) boxes[0];
+ if (ba.LL.x > ba.UR.x || ba.LL.y > ba.UR.y) {
UNSUPPORTED("39tznwvf6k5lgj78jp32p0kfl"); // agerr(AGERR, "in checkpath, box 0 has LL coord > UR coord\n");
UNSUPPORTED("evdvb9esh16y8zeoczxhcz7xm"); // printpath(thepath);
UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
}
for (bi = 0; bi < boxn - 1; bi++) {
- ba = boxes.plus(bi).getStruct().amp();
- bb = boxes.plus(bi + 1).getStruct().amp();
- if (bb.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x") || bb.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y")) {
+ ba = (ST_boxf) boxes[bi];
+ bb = (ST_boxf) boxes[bi + 1];
+ if (bb.LL.x > bb.UR.x || bb.LL.y > bb.UR.y) {
UNSUPPORTED("c8oodo0ge4n4dglb28fvf610v"); // agerr(AGERR, "in checkpath, box %d has LL coord > UR coord\n",
UNSUPPORTED("929pkk2ob1lh7hfe4scuoo5pn"); // bi + 1);
UNSUPPORTED("2m9o6g4nneiul4gt8xb9yb9zi"); // printpath(thepath);
UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
}
- l = (ba.getStruct("UR").getDouble("x") < bb.getStruct("LL").getDouble("x")) ? 1 : 0;
- r = (ba.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x")) ? 1 : 0;
- d = (ba.getStruct("UR").getDouble("y") < bb.getStruct("LL").getDouble("y")) ? 1 : 0;
- u = (ba.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y")) ? 1 : 0;
+ l = (ba.UR.x < bb.LL.x) ? 1 : 0;
+ r = (ba.LL.x > bb.UR.x) ? 1 : 0;
+ d = (ba.UR.y < bb.LL.y) ? 1 : 0;
+ u = (ba.LL.y > bb.UR.y) ? 1 : 0;
errs = l + r + d + u;
/*if (errs > 0 && Verbose) {
fprintf(stderr, "in checkpath, boxes %d and %d don't touch\n",
@@ -1239,108 +1210,108 @@ UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
int xy;
if (l == 1)
{
- xy = (int) ba.getStruct("UR").getDouble("x");
- ba.getStruct("UR").setDouble("x", bb.getStruct("LL").getDouble("x"));
- bb.getStruct("LL").setDouble("x", xy);
+ xy = (int) ba.UR.x;
+ ba.UR.setDouble("x", bb.LL.x);
+ bb.LL.setDouble("x", xy);
l = 0;
}
else if (r == 1) {
- xy = (int)(ba.getStruct("LL").getDouble("x"));
- ba.getStruct("LL").setDouble("x", bb.getStruct("UR").getDouble("x"));
- bb.getStruct("UR").setDouble("x", xy);
+ xy = (int)(ba.LL.x);
+ ba.LL.setDouble("x", bb.UR.x);
+ bb.UR.setDouble("x", xy);
r = 0;
}
else if (d == 1) {
- xy = (int)(ba.getStruct("UR").getDouble("y"));
- ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
- bb.getStruct("LL").setDouble("y", xy);
+ xy = (int)(ba.UR.y);
+ ba.UR.setDouble("y", bb.LL.y);
+ bb.LL.setDouble("y", xy);
d = 0;
}
else if (u == 1)
-UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.getStruct("LL").getDouble("y"), ba.getStruct("LL").getDouble("y") = bb.getStruct("UR").getDouble("y"), bb.getStruct("UR").getDouble("y") = xy, u = 0;
+UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.LL.y, ba.LL.y = bb.UR.y, bb.UR.y = xy, u = 0;
for (i = 0; i < errs - 1; i++) {
UNSUPPORTED("as3p2ldwbg3rbgy64oxx5phar"); // if (l == 1)
-UNSUPPORTED("efz1z5cfywki1k6q6avldku9z"); // xy = (ba.getStruct("UR").getDouble("x") + bb.getStruct("LL").getDouble("x")) / 2.0 + 0.5, ba.getStruct("UR").getDouble("x") =
-UNSUPPORTED("6dfh7cf1xptapqd1mcqtxjrxa"); // bb.getStruct("LL").getDouble("x") = xy, l = 0;
+UNSUPPORTED("efz1z5cfywki1k6q6avldku9z"); // xy = (ba.UR.x + bb.LL.x) / 2.0 + 0.5, ba.UR.x =
+UNSUPPORTED("6dfh7cf1xptapqd1mcqtxjrxa"); // bb.LL.x = xy, l = 0;
UNSUPPORTED("ang3qytu77fd5owijwbnmkdav"); // else if (r == 1)
-UNSUPPORTED("67ehof0qqlk339zgl0sqwfu5r"); // xy = (ba.getStruct("LL").getDouble("x") + bb.getStruct("UR").getDouble("x")) / 2.0 + 0.5, ba.getStruct("LL").getDouble("x") =
-UNSUPPORTED("llmwvndoq1ne9c62ohtstkwa"); // bb.getStruct("UR").getDouble("x") = xy, r = 0;
+UNSUPPORTED("67ehof0qqlk339zgl0sqwfu5r"); // xy = (ba.LL.x + bb.UR.x) / 2.0 + 0.5, ba.LL.x =
+UNSUPPORTED("llmwvndoq1ne9c62ohtstkwa"); // bb.UR.x = xy, r = 0;
UNSUPPORTED("3ce9i9asrqbuog7v1tdurqo6e"); // else if (d == 1)
-UNSUPPORTED("3mibjrb2jtfextkg9ac5k9spl"); // xy = (ba.getStruct("UR").getDouble("y") + bb.getStruct("LL").getDouble("y")) / 2.0 + 0.5, ba.getStruct("UR").getDouble("y") =
-UNSUPPORTED("bccpbv2n38c5utkfh7msoc2y"); // bb.getStruct("LL").getDouble("y") = xy, d = 0;
+UNSUPPORTED("3mibjrb2jtfextkg9ac5k9spl"); // xy = (ba.UR.y + bb.LL.y) / 2.0 + 0.5, ba.UR.y =
+UNSUPPORTED("bccpbv2n38c5utkfh7msoc2y"); // bb.LL.y = xy, d = 0;
UNSUPPORTED("7302rnmwdji9n7txquk8k36to"); // else if (u == 1)
-UNSUPPORTED("9oqpoodvpheztihe63p40guof"); // xy = (ba.getStruct("LL").getDouble("y") + bb.getStruct("UR").getDouble("y")) / 2.0 + 0.5, ba.getStruct("LL").getDouble("y") =
-UNSUPPORTED("2cnb1bdjh6y26f98vonla73qa"); // bb.getStruct("UR").getDouble("y") = xy, u = 0;
+UNSUPPORTED("9oqpoodvpheztihe63p40guof"); // xy = (ba.LL.y + bb.UR.y) / 2.0 + 0.5, ba.LL.y =
+UNSUPPORTED("2cnb1bdjh6y26f98vonla73qa"); // bb.UR.y = xy, u = 0;
}
}
/* check for overlapping boxes */
- xoverlap = overlap(ba.getStruct("LL").getDouble("x"), ba.getStruct("UR").getDouble("x"), bb.getStruct("LL").getDouble("x"), bb.getStruct("UR").getDouble("x"));
- yoverlap = overlap(ba.getStruct("LL").getDouble("y"), ba.getStruct("UR").getDouble("y"), bb.getStruct("LL").getDouble("y"), bb.getStruct("UR").getDouble("y"));
+ xoverlap = overlap(ba.LL.x, ba.UR.x, bb.LL.x, bb.UR.x);
+ yoverlap = overlap(ba.LL.y, ba.UR.y, bb.LL.y, bb.UR.y);
if (xoverlap!=0 && yoverlap!=0) {
if (xoverlap < yoverlap) {
- if (ba.getStruct("UR").getDouble("x") - ba.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x") - bb.getStruct("LL").getDouble("x")) {
+ if (ba.UR.x - ba.LL.x > bb.UR.x - bb.LL.x) {
/* take space from ba */
-UNSUPPORTED("5dqxf3gq05pjtobtnru1g2tuj"); // if (ba.getStruct("UR").getDouble("x") < bb.getStruct("UR").getDouble("x"))
-UNSUPPORTED("8gz6k803qp9zyw9s459cpp039"); // ba.getStruct("UR").getDouble("x") = bb.getStruct("LL").getDouble("x");
+UNSUPPORTED("5dqxf3gq05pjtobtnru1g2tuj"); // if (ba.UR.x < bb.UR.x)
+UNSUPPORTED("8gz6k803qp9zyw9s459cpp039"); // ba.UR.x = bb.LL.x;
UNSUPPORTED("9acag2yacl63g8rg6r1alu62x"); // else
-UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.getStruct("LL").getDouble("x") = bb.getStruct("UR").getDouble("x");
+UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.LL.x = bb.UR.x;
} else {
/* take space from bb */
- if (ba.getStruct("UR").getDouble("x") < bb.getStruct("UR").getDouble("x"))
- bb.getStruct("LL").setDouble("x", ba.getStruct("UR").getDouble("x"));
+ if (ba.UR.x < bb.UR.x)
+ bb.LL.setDouble("x", ba.UR.x);
else
- bb.getStruct("UR").setDouble("x", ba.getStruct("LL").getDouble("x"));
+ bb.UR.setDouble("x", ba.LL.x);
}
} else { /* symmetric for y coords */
- if (ba.getStruct("UR").getDouble("y") - ba.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y") - bb.getStruct("LL").getDouble("y")) {
+ if (ba.UR.y - ba.LL.y > bb.UR.y - bb.LL.y) {
/* take space from ba */
- if (ba.getStruct("UR").getDouble("y") < bb.getStruct("UR").getDouble("y"))
- ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
+ if (ba.UR.y < bb.UR.y)
+ ba.UR.setDouble("y", bb.LL.y);
else
- ba.getStruct("LL").setDouble("y", bb.getStruct("UR").getDouble("y"));
+ ba.LL.setDouble("y", bb.UR.y);
} else {
/* take space from bb */
- if (ba.getStruct("UR").getDouble("y") < bb.getStruct("UR").getDouble("y"))
- bb.getStruct("LL").setDouble("y", ba.getStruct("UR").getDouble("y"));
+ if (ba.UR.y < bb.UR.y)
+ bb.LL.setDouble("y", ba.UR.y);
else
- bb.getStruct("UR").setDouble("y", ba.getStruct("LL").getDouble("y"));
+ bb.UR.setDouble("y", ba.LL.y);
}
}
}
}
- if (thepath.getStruct("start").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(0).getStruct()).LL.x
- || thepath.getStruct("start").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(0).getStruct()).UR.x
- || thepath.getStruct("start").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(0).getStruct()).LL.y
- || thepath.getStruct("start").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(0).getStruct()).UR.y) {
+ if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x
+ || thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x
+ || thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y
+ || thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) {
/*if (Verbose) {
fprintf(stderr, "in checkpath, start port not in first box\n");
printpath(thepath);
}*/
- if (thepath.getStruct("start").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(0).getStruct()).LL.x)
- thepath.getStruct("start").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(0).getStruct()).LL.x);
- if (thepath.getStruct("start").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(0).getStruct()).UR.x)
- thepath.getStruct("start").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(0).getStruct()).UR.x);
- if (thepath.getStruct("start").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(0).getStruct()).LL.y)
- thepath.getStruct("start").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(0).getStruct()).LL.y);
- if (thepath.getStruct("start").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(0).getStruct()).UR.y)
- thepath.getStruct("start").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(0).getStruct()).UR.y);
+ if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x)
+ thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).LL.x);
+ if (thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x)
+ thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).UR.x);
+ if (thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y)
+ thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).LL.y);
+ if (thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y)
+ thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).UR.y);
}
- if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x
- || thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x
- || thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y
- || thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y) {
+ if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x
+ || thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x
+ || thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y
+ || thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) {
/*if (Verbose) {
fprintf(stderr, "in checkpath, end port not in last box\n");
printpath(thepath);
}*/
- if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x)
- thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x);
- if (thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x)
- thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x);
- if (thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y)
- thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y);
- if (thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y)
- thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y);
+ if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x)
+ thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x);
+ if (thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x)
+ thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x);
+ if (thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y)
+ thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y);
+ if (thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y)
+ thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y);
}
return 0;
} finally {
@@ -1358,7 +1329,7 @@ ENTERING("de6jvvw786rx88318tuuqywgq","mkspacep");
try {
if (size > Z.z().maxpn) {
int newmax = Z.z().maxpn + (size / 300 + 1) * 300;
- Z.z().ps = RALLOC(newmax, Z.z().ps, pointf.class);
+ Z.z().ps = Z.z().ps.reallocJ(newmax);
if (N(Z.z().ps)) {
UNSUPPORTED("ds2v91aohji00tc7zmjuc3v6q"); // agerr(AGERR, "cannot re-allocate ps\n");
UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
diff --git a/src/gen/lib/common/shapes__c.java b/src/gen/lib/common/shapes__c.java
index de19ece..88883dd 100644
--- a/src/gen/lib/common/shapes__c.java
+++ b/src/gen/lib/common/shapes__c.java
@@ -47,7 +47,6 @@ package gen.lib.common;
import static gen.lib.cgraph.attr__c.agget;
import static gen.lib.cgraph.obj__c.agraphof;
import static gen.lib.common.geom__c.ccwrotatepf;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.utils__c.late_double;
import static gen.lib.common.utils__c.late_int;
import static gen.lib.common.utils__c.late_string;
@@ -59,7 +58,6 @@ import static smetana.core.JUtils.atan2;
import static smetana.core.JUtils.cos;
import static smetana.core.JUtils.enumAsInt;
import static smetana.core.JUtils.sin;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtils.sqrt;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtilsDebug.ENTERING;
@@ -87,30 +85,22 @@ import static smetana.core.Macro.SQRT2;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.fabs;
import static smetana.core.Macro.hypot;
-import h.Agnode_s;
-import h.Agnodeinfo_t;
-import h.Agobj_s;
-import h.Agraphinfo_t;
+import h.ST_Agnode_s;
+import h.ST_Agnodeinfo_t;
+import h.ST_Agobj_s;
+import h.ST_Agraphinfo_t;
import h.ST_boxf;
+import h.ST_inside_t;
+import h.ST_point;
import h.ST_pointf;
+import h.ST_polygon_t;
import h.ST_port;
-import h.boxf;
-import h.inside_t;
-import h.point;
-import h.pointf;
-import h.polygon_t;
-import h.port;
-import h.shape_desc;
+import h.ST_shape_desc;
import h.shape_kind;
import smetana.core.CFunctionImpl;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__c__fields;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
-import smetana.core.amiga.StarArrayOfPtr;
public class shapes__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -370,14 +360,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -406,26 +396,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -448,16 +418,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -754,8 +724,8 @@ throw new UnsupportedOperationException();
// static port Center =
/*private final static __struct__<port> Center = JUtils.from(port.class);
static {
-Center.getStruct("p").setDouble("x", 0);
-Center.getStruct("p").setDouble("y", 0);
+Center.p.setDouble("x", 0);
+Center.p.setDouble("y", 0);
Center.setDouble("theta", -1);
Center.setPtr("bp", null);
Center.setInt("defined", 0);
@@ -1077,21 +1047,21 @@ throw new UnsupportedOperationException();
//3 eb4jyrh981apg1fy13fczexdl
// static int same_side(pointf p0, pointf p1, pointf L0, pointf L1)
-public static boolean same_side(final __struct__<pointf> p0, final __struct__<pointf> p1, final __struct__<pointf> L0, final __struct__<pointf> L1) {
+public static boolean same_side(final ST_pointf p0, final ST_pointf p1, final ST_pointf L0, final ST_pointf L1) {
// WARNING!! STRUCT
return same_side_w_(p0.copy(), p1.copy(), L0.copy(), L1.copy());
}
-private static boolean same_side_w_(final __struct__<pointf> p0, final __struct__<pointf> p1, final __struct__<pointf> L0, final __struct__<pointf> L1) {
+private static boolean same_side_w_(final ST_pointf p0, final ST_pointf p1, final ST_pointf L0, final ST_pointf L1) {
ENTERING("eb4jyrh981apg1fy13fczexdl","same_side");
try {
boolean s0, s1;
double a, b, c;
/* a x + b y = c */
- a = -(L1.getDouble("y") - L0.getDouble("y"));
- b = (L1.getDouble("x") - L0.getDouble("x"));
- c = a * L0.getDouble("x") + b * L0.getDouble("y");
- s0 = (a * p0.getDouble("x") + b * p0.getDouble("y") - c >= 0);
- s1 = (a * p1.getDouble("x") + b * p1.getDouble("y") - c >= 0);
+ a = -(L1.y - L0.y);
+ b = (L1.x - L0.x);
+ c = a * L0.x + b * L0.y;
+ s0 = (a * p0.x + b * p0.y - c >= 0);
+ s1 = (a * p1.x + b * p1.y - c >= 0);
return (s0 == s1);
} finally {
LEAVING("eb4jyrh981apg1fy13fczexdl","same_side");
@@ -2527,14 +2497,14 @@ throw new UnsupportedOperationException();
//3 5gahokttzv65lspm84ao1le37
// shape_kind shapeOf(node_t * n)
-public static int shapeOf(Agnode_s n) {
+public static int shapeOf(ST_Agnode_s n) {
ENTERING("5gahokttzv65lspm84ao1le37","shapeOf");
try {
- shape_desc sh = (shape_desc) ND_shape(n);
+ ST_shape_desc sh = (ST_shape_desc) ND_shape(n);
CFunctionImpl ifn; //void (*ifn) (node_t *);
if (N(sh))
return enumAsInt(shape_kind.class, "SH_UNSET");
- ifn = (CFunctionImpl) ND_shape(n).getPtr("fns").getPtr("initfn");
+ ifn = (CFunctionImpl) ND_shape(n).fns.initfn;
if (ifn.getName().equals("poly_init"))
return enumAsInt(shape_kind.class, "SH_POLY");
UNSUPPORTED("251a710sgr57bnrs3uh7ppfpi"); // else if (ifn == record_init)
@@ -2572,13 +2542,13 @@ throw new UnsupportedOperationException();
//3 a11xv6duihbr3d6gkgo2ye2j5
// static void poly_init(node_t * n)
-public static void poly_init(Agnode_s n) {
+public static void poly_init(ST_Agnode_s n) {
ENTERING("a11xv6duihbr3d6gkgo2ye2j5","poly_init");
try {
- final __struct__<pointf> dimen = JUtils.from(pointf.class), min_bb = JUtils.from(pointf.class), bb = JUtils.from(pointf.class);
- final __struct__<point> imagesize = JUtils.from(point.class);
- final __struct__<pointf> P = JUtils.from(pointf.class), Q = JUtils.from(pointf.class), R = JUtils.from(pointf.class);
- __ptr__ vertices = null;
+ final ST_pointf dimen = new ST_pointf(), min_bb = new ST_pointf(), bb = new ST_pointf();
+ final ST_point imagesize = new ST_point();
+ final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf();
+ ST_pointf.Array vertices = null;
CString p, sfile, fxd;
double temp, alpha, beta, gamma;
double orientation, distortion, skew;
@@ -2587,13 +2557,13 @@ try {
double width=0, height=0, marginx, marginy, spacex;
boolean regular; int peripheries, sides;
boolean isBox; int i, j, outp;
- polygon_t poly = (polygon_t) Memory.malloc(polygon_t.class);
- regular = ND_shape(n).getPtr("polygon").getBoolean("regular");
- peripheries = ND_shape(n).getPtr("polygon").getInt("peripheries");
- sides = ND_shape(n).getPtr("polygon").getInt("sides");
- orientation = ND_shape(n).getPtr("polygon").getDouble("orientation");
- skew = ND_shape(n).getPtr("polygon").getDouble("skew");
- distortion = ND_shape(n).getPtr("polygon").getDouble("distortion");
+ ST_polygon_t poly = new ST_polygon_t();
+ regular = ND_shape(n).polygon.regular!=0;
+ peripheries = ND_shape(n).polygon.peripheries;
+ sides = ND_shape(n).polygon.sides;
+ orientation = ND_shape(n).polygon.orientation;
+ skew = ND_shape(n).polygon.skew;
+ distortion = ND_shape(n).polygon.distortion;
regular |= mapbool(agget(n, new CString("regular")));
/* all calculations in floating point POINTS */
/* make x and y dimensions equal if node is regular
@@ -2622,9 +2592,9 @@ UNSUPPORTED("cp83hdn3dp0a7rp9bauc3bgki"); // sides = late_int(n, N_sides, 4, 0)
UNSUPPORTED("abmuc3vqirf3i48480fj0k14g"); // distortion = late_double(n, N_distortion, 0.0, -100.0);
}
/* get label dimensions */
- dimen.___(ND_label(n).getStruct("dimen"));
+ dimen.___(ND_label(n).dimen);
/* minimal whitespace around label */
- if (ROUND(abs(dimen.getDouble("x")))!=0 || ROUND(abs(dimen.getDouble("y")))!=0) {
+ if (ROUND(abs(dimen.x))!=0 || ROUND(abs(dimen.y))!=0) {
/* padding */
if ((p = agget(n, new CString("margin")))!=null) {
UNSUPPORTED("4dlqwm3pklzgz2e777dm56n03"); // marginx = marginy = 0;
@@ -2643,20 +2613,20 @@ UNSUPPORTED("afk9bpom7x393euamnvwwkx6b"); // } else
UNSUPPORTED("87bdwkkwbzyswxnepdd9bj8mb"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
} else
{
- ((ST_pointf) dimen).x = dimen.getDouble("x") + 4*4;
- ((ST_pointf) dimen).y = dimen.getDouble("y") + 2*4;
+ ((ST_pointf) dimen).x = dimen.x + 4*4;
+ ((ST_pointf) dimen).y = dimen.y + 2*4;
};
}
- spacex = dimen.getDouble("x") - ND_label(n).getStruct("dimen").getDouble("x");
+ spacex = dimen.x - ND_label(n).dimen.x;
/* quantization */
- if ((temp = agraphof(n).castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getPtr("drawing").getDouble("quantum")) > 0.0) {
+ if ((temp = ((ST_Agraphinfo_t)agraphof(n).castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).drawing.quantum) > 0.0) {
UNSUPPORTED("3nqb0s5rkwj3igt71vooj8asd"); // temp = ((((temp)*72>=0)?(int)((temp)*72 + .5):(int)((temp)*72 - .5)));
UNSUPPORTED("5fxtqwy8liyvnx1yvsou5hb4o"); // dimen.x = quant(dimen.x, temp);
UNSUPPORTED("et885f1jcqpske6ip856arouv"); // dimen.y = quant(dimen.y, temp);
}
imagesize.setInt("x", 0);
imagesize.setInt("y", 0);
- if (ND_shape(n).getBoolean("usershape")) {
+ if (ND_shape(n).usershape) {
/* custom requires a shapefile
* not custom is an adaptable user shape such as a postscript
* function.
@@ -2689,8 +2659,8 @@ UNSUPPORTED("1x57knvrmlciu7odfroo3paso"); // imagesize.y += 2;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
}
/* initialize node bb to labelsize */
- ((ST_pointf) bb).x = ((dimen.getDouble("x"))>(imagesize.getInt("x"))?(dimen.getDouble("x")):(imagesize.getInt("x")));
- ((ST_pointf) bb).y = ((dimen.getDouble("y"))>(imagesize.getInt("y"))?(dimen.getDouble("y")):(imagesize.getInt("y")));
+ ((ST_pointf) bb).x = ((dimen.x)>(imagesize.x)?(dimen.x):(imagesize.x));
+ ((ST_pointf) bb).y = ((dimen.y)>(imagesize.y)?(dimen.y):(imagesize.y));
/* I don't know how to distort or skew ellipses in postscript */
/* Convert request to a polygon with a large number of sides */
if ((sides <= 2) && ((distortion != 0.) || (skew != 0.))) {
@@ -2699,14 +2669,14 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
/* extra sizing depends on if label is centered vertically */
p = agget(n, new CString("labelloc"));
if (p!=null && (p.charAt(0) == 't' || p.charAt(0) == 'b'))
- n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").setInt("valign", p.charAt(0));
+ n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", p.charAt(0));
else
- n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").setInt("valign", 'c');
+ n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", 'c');
isBox = (sides == 4 && (((orientation>=0)?(int)(orientation + .5):(int)(orientation - .5)) % 90) == 0
&& distortion == 0. && skew == 0.);
if (isBox) {
/* for regular boxes the fit should be exact */
- } else if (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("shape").getPtr("polygon").getPtr("vertices")!=null) {
+ } else if (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).shape.polygon.vertices!=null) {
UNSUPPORTED("4adqsyjwqwzs50ggjp57ok6u7"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices;
UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
} else {
@@ -2714,20 +2684,20 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
* containing bb centered on the origin, and then pad for that.
* We assume the ellipse is defined by a scaling up of bb.
*/
- temp = bb.getDouble("y") * 1.41421356237309504880;
- if (height > temp && (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getInt("valign") == 'c')) {
+ temp = bb.y * 1.41421356237309504880;
+ if (height > temp && (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.valign == 'c')) {
/* if there is height to spare
* and the label is centered vertically
* then just pad x in proportion to the spare height */
- bb.setDouble("x", bb.getDouble("x") * sqrt(1. / (1. - ((bb.getDouble("y") / height) * (bb.getDouble("y") / height)))));
+ bb.setDouble("x", bb.x * sqrt(1. / (1. - ((bb.y / height) * (bb.y / height)))));
} else {
- bb.setDouble("x", bb.getDouble("x") * 1.41421356237309504880);
+ bb.setDouble("x", bb.x * 1.41421356237309504880);
bb.setDouble("y", temp);
}
if (sides > 2) {
temp = cos(3.14159265358979323846 / sides);
- bb.setDouble("x", bb.getDouble("x") / temp);
- bb.setDouble("y", bb.getDouble("y") / temp);
+ bb.setDouble("x", bb.x / temp);
+ bb.setDouble("y", bb.y / temp);
/* FIXME - for odd-sided polygons, e.g. triangles, there
would be a better fit with some vertical adjustment of the shape */
}
@@ -2739,27 +2709,27 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) {
bb.setDouble("x", width);
bb.setDouble("y", height);
- poly.setInt("option", poly.getInt("option") | (1 << 11));
+ poly.setInt("option", poly.option | (1 << 11));
} else if (mapbool(fxd)) {
/* check only label, as images we can scale to fit */
- if ((width < (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getDouble("dimen.x"))
- || (height < (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getDouble("dimen.y")))))
+ if ((width < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.x)
+ || (height < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.y))))
System.err.println(
"node '%s', graph '%s' size too small for label\n");
//agnameof(n), agnameof(agraphof(n)));
bb.setDouble("x", width);
bb.setDouble("y", height);
} else {
- width = MAX(width, bb.getDouble("x"));
+ width = MAX(width, bb.x);
((ST_pointf) bb).x = width;
- height = MAX(height, bb.getDouble("y"));
+ height = MAX(height, bb.y);
((ST_pointf) bb).y = height;
}
/* If regular, make dimensions the same.
* Need this to guarantee final node size is regular.
*/
if (regular) {
- width = MAX(bb.getDouble("x"), bb.getDouble("y"));
+ width = MAX(bb.x, bb.y);
height = width;
((ST_pointf) bb).x = width;
((ST_pointf) bb).y = width;
@@ -2767,35 +2737,35 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
/* Compute space available for label. Provides the justification borders */
if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) {
if (isBox) {
- ((ST_pointf) ND_label(n).getStruct("space")).x = MAX(dimen.getDouble("x"),bb.getDouble("x")) - spacex;
+ ((ST_pointf) ND_label(n).space).x = MAX(dimen.x,bb.x) - spacex;
}
- else if (dimen.getDouble("y") < bb.getDouble("y")) {
- temp = bb.getDouble("x") * sqrt(1.0 - SQR(dimen.getDouble("y")) / SQR(bb.getDouble("y")));
- ND_label(n).getStruct("space").setDouble("x", MAX(dimen.getDouble("x"),temp) - spacex);
+ else if (dimen.y < bb.y) {
+ temp = bb.x * sqrt(1.0 - SQR(dimen.y) / SQR(bb.y));
+ ND_label(n).space.setDouble("x", MAX(dimen.x,temp) - spacex);
}
else
- ND_label(n).getStruct("space").setDouble("x", dimen.getDouble("x") - spacex);
+ ND_label(n).space.setDouble("x", dimen.x - spacex);
} else {
- ND_label(n).getStruct("space").setDouble("x", dimen.getDouble("x") - spacex);
+ ND_label(n).space.setDouble("x", dimen.x - spacex);
}
- if ((poly.getInt("option") & (1 << 11)) == 0) {
- temp = bb.getDouble("y") - min_bb.getDouble("y");
- if (dimen.getDouble("y") < imagesize.getInt("y"))
- temp += imagesize.getInt("y") - dimen.getDouble("y");
- ((ST_pointf) ND_label(n).getStruct("space")).y = dimen.getDouble("y") + temp;
+ if ((poly.option & (1 << 11)) == 0) {
+ temp = bb.y - min_bb.y;
+ if (dimen.y < imagesize.y)
+ temp += imagesize.y - dimen.y;
+ ((ST_pointf) ND_label(n).space).y = dimen.y + temp;
}
outp = peripheries;
if (peripheries < 1)
outp = 1;
if (sides < 3) { /* ellipses */
sides = 2;
- vertices = zmalloc(sizeof(pointf.class, outp * sides));
- P.setDouble("x", bb.getDouble("x") / 2.);
- P.setDouble("y", bb.getDouble("y") / 2.);
- vertices.setDouble("x", -P.getDouble("x"));
- vertices.setDouble("y", -P.getDouble("y"));
- vertices.plus(1).setDouble("x", P.getDouble("x"));
- vertices.plus(1).setDouble("y", P.getDouble("y"));
+ vertices = new ST_pointf.Array(outp * sides);
+ P.setDouble("x", bb.x / 2.);
+ P.setDouble("y", bb.y / 2.);
+ vertices.setDouble("x", -P.x);
+ vertices.setDouble("y", -P.y);
+ vertices.plus(1).setDouble("x", P.x);
+ vertices.plus(1).setDouble("y", P.y);
if (peripheries > 1) {
UNSUPPORTED("4ofenmfgj7cgyf624qmugcx77"); // for (j = 1, i = 2; j < peripheries; j++) {
UNSUPPORTED("458w3r6n3nidn2j2b154phpzt"); // P.x += 4;
@@ -2823,8 +2793,8 @@ UNSUPPORTED("b5z0hw4dacenv33xsaex70g8d"); // bb.y = 2. * P.y;
* It needs to find the point where the two lines, parallel to
* the current segments, and outside by GAP distance, intersect.
*/
- vertices = zmalloc(sizeof(pointf.class, outp * sides));
- if (ND_shape(n).getPtr("polygon").getPtr("vertices")!=null) {
+ vertices = new ST_pointf.Array(outp * sides);
+ if (((ST_polygon_t)ND_shape(n).polygon).vertices!=null) {
UNSUPPORTED("3ghle84ieryaenfnlbzrfv7bw"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices;
UNSUPPORTED("227lpcg9dt83m2bm8yshb4djf"); // pd->vertex_gen (vertices, &bb);
UNSUPPORTED("cc3jvnwvbhjhro4adeet363yd"); // xmax = bb.x/2;
@@ -2845,33 +2815,33 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2;
/*next regular vertex */
angle += sectorangle;
sinx = sin(angle); cosx = cos(angle);
- ((ST_pointf) R).x = R.getDouble("x") + sidelength * cosx;
- ((ST_pointf) R).y = R.getDouble("y") + sidelength * sinx;
+ ((ST_pointf) R).x = R.x + sidelength * cosx;
+ ((ST_pointf) R).y = R.y + sidelength * sinx;
/*distort and skew */
- ((ST_pointf) P).x = R.getDouble("x") * (skewdist + R.getDouble("y") * gdistortion) + R.getDouble("y") * gskew;
- ((ST_pointf) P).y = R.getDouble("y");
+ ((ST_pointf) P).x = R.x * (skewdist + R.y * gdistortion) + R.y * gskew;
+ ((ST_pointf) P).y = R.y;
/*orient P.x,P.y */
- alpha = RADIANS(orientation) + atan2(P.getDouble("y"), P.getDouble("x"));
+ alpha = RADIANS(orientation) + atan2(P.y, P.x);
sinx = sin(alpha); cosx = cos(alpha);
- ((ST_pointf) P).y = hypot(P.getDouble("x"), P.getDouble("y"));
- ((ST_pointf) P).x = P.getDouble("y");
- ((ST_pointf) P).x = P.getDouble("x") * cosx;
- ((ST_pointf) P).y = P.getDouble("y") * sinx;
+ ((ST_pointf) P).y = hypot(P.x, P.y);
+ ((ST_pointf) P).x = P.y;
+ ((ST_pointf) P).x = P.x * cosx;
+ ((ST_pointf) P).y = P.y * sinx;
/*scale for label */
- ((ST_pointf) P).x = P.getDouble("x") * bb.getDouble("x");
- ((ST_pointf) P).y = P.getDouble("y") * bb.getDouble("y");
+ ((ST_pointf) P).x = P.x * bb.x;
+ ((ST_pointf) P).y = P.y * bb.y;
/*find max for bounding box */
- xmax = MAX(fabs(P.getDouble("x")), xmax);
- ymax = MAX(fabs(P.getDouble("y")), ymax);
+ xmax = MAX(fabs(P.x), xmax);
+ ymax = MAX(fabs(P.y), ymax);
/* store result in array of points */
vertices.plus(i).setStruct(P);
if (isBox) { /* enforce exact symmetry of box */
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(1)).getInternalArray().getInternal(0)))).x = -P.getDouble("x");
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(1)).getInternalArray().getInternal(0)))).y = P.getDouble("y");
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(2)).getInternalArray().getInternal(0)))).x = -P.getDouble("x");
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(2)).getInternalArray().getInternal(0)))).y = -P.getDouble("y");
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(3)).getInternalArray().getInternal(0)))).x = P.getDouble("x");
- ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(3)).getInternalArray().getInternal(0)))).y = -P.getDouble("y");
+ vertices.get(1).x = -P.x;
+ vertices.get(1).y = P.y;
+ vertices.get(2).x = -P.x;
+ vertices.get(2).y = -P.y;
+ vertices.get(3).x = P.x;
+ vertices.get(3).y = -P.y;
break;
}
}
@@ -2881,12 +2851,12 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2;
ymax *= 2.;
((ST_pointf) bb).x = MAX(width, xmax);
((ST_pointf) bb).y = MAX(height, ymax);
- scalex = bb.getDouble("x") / xmax;
- scaley = bb.getDouble("y") / ymax;
+ scalex = bb.x / xmax;
+ scaley = bb.y / ymax;
for (i = 0; i < sides; i++) {
P.____(vertices.plus(i));
- ((ST_pointf) P).x = P.getDouble("x") * scalex;
- ((ST_pointf) P).y = P.getDouble("y") * scaley;
+ ((ST_pointf) P).x = P.x * scalex;
+ ((ST_pointf) P).y = P.y * scaley;
vertices.plus(i).setStruct(P);
}
if (peripheries > 1) {
@@ -2929,16 +2899,16 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
poly.setDouble("orientation", orientation);
poly.setDouble("skew", skew);
poly.setDouble("distortion", distortion);
- poly.setPtr("vertices", vertices);
- if ((poly.getInt("option") & (1 << 11))!=0) {
+ poly.vertices = vertices;
+ if ((poly.option & (1 << 11))!=0) {
/* set width and height to reflect label and shape */
UNSUPPORTED("7kk8oru3b3copylmq3gssx6qx"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->width) = ((((dimen.x)>(bb.x)?(dimen.x):(bb.x)))/(double)72);
UNSUPPORTED("8oouzms2x039fhfcfxm7yc4su"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->height) = ((((dimen.y)>(bb.y)?(dimen.y):(bb.y)))/(double)72);
} else {
- n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setDouble("width", ((bb.getDouble("x"))/(double)72));
- n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setDouble("height", ((bb.getDouble("y"))/(double)72));
+ n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.x)/(double)72));
+ n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.y)/(double)72));
}
- n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setPtr("shape_info", poly);
+ n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly);
} finally {
LEAVING("a11xv6duihbr3d6gkgo2ye2j5","poly_init");
}
@@ -2965,26 +2935,26 @@ throw new UnsupportedOperationException();
-//3 570t4xovyyfqipaikkf63crmk
-// static boolean poly_inside(inside_t * inside_context, pointf p)
//static Agnode_s lastn; /* last node argument */
//static polygon_t poly;
//static int last, outp, sides;
-//static final __struct__<pointf> O = JUtils.from(pointf.class); /* point (0,0) */
+//static final ST_pointf O = new ST_pointf(); /* point (0,0) */
//static pointf vertex;
//static double xsize, ysize, scalex, scaley, box_URx, box_URy;
-public static boolean poly_inside(inside_t inside_context, final __struct__<pointf> p) {
+//3 570t4xovyyfqipaikkf63crmk
+//static boolean poly_inside(inside_t * inside_context, pointf p)
+public static boolean poly_inside(ST_inside_t inside_context, ST_pointf p) {
// WARNING!! STRUCT
return poly_inside_w_(inside_context, p.copy());
}
-private static boolean poly_inside_w_(inside_t inside_context, final __struct__<pointf> p) {
+private static boolean poly_inside_w_(ST_inside_t inside_context, final ST_pointf p) {
ENTERING("570t4xovyyfqipaikkf63crmk","poly_inside");
try {
int i, i1, j;
boolean s;
final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf();
- __ptr__ bp = inside_context.getPtr("s.bp");
- __ptr__ n = inside_context.getPtr("s.n");
+ ST_boxf bp = inside_context.s_bp;
+ ST_Agnode_s n = inside_context.s_n;
P.___(ccwrotatepf(p, 90 * GD_rankdir(agraphof(n))));
/* Quick test if port rectangle is target */
if (bp!=null) {
@@ -2994,10 +2964,10 @@ try {
}
if (NEQ(n, Z.z().lastn)) {
double n_width = 0, n_height = 0;
- Z.z().poly = (polygon_t) ND_shape_info(n);
- Z.z().vertex = (pointf) Z.z().poly.getPtr("vertices");
- Z.z().sides = Z.z().poly.getInt("sides");
- if ((Z.z().poly.getInt("option") & (1 << 11))!=0) {
+ Z.z().poly = (ST_polygon_t) ND_shape_info(n);
+ Z.z().vertex = Z.z().poly.vertices;
+ Z.z().sides = Z.z().poly.sides;
+ if ((Z.z().poly.option & (1 << 11))!=0) {
UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly);
UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x;
UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y;
@@ -3031,29 +3001,29 @@ UNSUPPORTED("8t3g4d9acruono62leh5a8hxh"); // xsize = ND_ht(n);
Z.z().box_URx = n_width / 2.0;
Z.z().box_URy = n_height / 2.0;
/* index to outer-periphery */
- Z.z().outp = (Z.z().poly.getInt("peripheries") - 1) * Z.z().sides;
+ Z.z().outp = (Z.z().poly.peripheries - 1) * Z.z().sides;
if (Z.z().outp < 0)
Z.z().outp = 0;
- Z.z().lastn = (Agnode_s) n;
+ Z.z().lastn = (ST_Agnode_s) n;
}
/* scale */
- P.setDouble("x", P.getDouble("x") * Z.z().scalex);
- P.setDouble("y", P.getDouble("y") * Z.z().scaley);
+ P.setDouble("x", P.x * Z.z().scalex);
+ P.setDouble("y", P.y * Z.z().scaley);
/* inside bounding box? */
- if ((fabs(P.getDouble("x")) > Z.z().box_URx) || (fabs(P.getDouble("y")) > Z.z().box_URy))
+ if ((fabs(P.x) > Z.z().box_URx) || (fabs(P.y) > Z.z().box_URy))
return false;
/* ellipses */
if (Z.z().sides <= 2)
- return (hypot(P.getDouble("x") / Z.z().box_URx, P.getDouble("y") / Z.z().box_URy) < 1.);
+ return (hypot(P.x / Z.z().box_URx, P.y / Z.z().box_URy) < 1.);
/* use fast test in case we are converging on a segment */
i = Z.z().last % Z.z().sides; /* in case last left over from larger polygon */
i1 = (i + 1) % Z.z().sides;
Q.___(Z.z().vertex.plus(i + Z.z().outp).getStruct());
R.___(Z.z().vertex.plus(i1 + Z.z().outp).getStruct());
- if (N(same_side(P, Z.z().O, Q, R))) /* false if outside the segment's face */
+ if (N(same_side(P, (ST_pointf)Z.z().O, Q, R))) /* false if outside the segment's face */
return false;
/* else inside the segment face... */
- if ((s = same_side(P, Q, R, Z.z().O)) && (same_side(P, R, Z.z().O, Q))) /* true if between the segment's sides */
+ if ((s = same_side(P, Q, R, (ST_pointf)Z.z().O)) && (same_side(P, R, (ST_pointf)Z.z().O, Q))) /* true if between the segment's sides */
return NOT(0);
/* else maybe in another segment */
for (j = 1; j < Z.z().sides; j++) { /* iterate over remaining segments */
@@ -3064,7 +3034,7 @@ UNSUPPORTED("8t3g4d9acruono62leh5a8hxh"); // xsize = ND_ht(n);
i1 = i;
i = (i + Z.z().sides - 1) % Z.z().sides;
}
- if (N(same_side(P, Z.z().O, Z.z().vertex.plus(i + Z.z().outp).getStruct(), Z.z().vertex.plus(i1 + Z.z().outp).getStruct()))) { /* false if outside any other segment's face */
+ if (N(same_side(P, (ST_pointf)Z.z().O, (ST_pointf)Z.z().vertex.plus(i + Z.z().outp).getStruct(), (ST_pointf)Z.z().vertex.plus(i1 + Z.z().outp).getStruct()))) { /* false if outside any other segment's face */
Z.z().last = i;
return false;
}
@@ -3082,11 +3052,11 @@ LEAVING("570t4xovyyfqipaikkf63crmk","poly_inside");
//3 5mmuhvq40xadw0g9mzlauyztq
// static int poly_path(node_t * n, port * p, int side, boxf rv[], int *kptr)
-public static int poly_path(Agnode_s n, port p, int side, Object rv, Object kptr) {
+public static int poly_path(ST_Agnode_s n, ST_port p, int side, Object rv, Object kptr) {
ENTERING("5mmuhvq40xadw0g9mzlauyztq","poly_path");
try {
side = 0;
- if (ND_label(n).getBoolean("html") && ND_has_port(n)) {
+ if (ND_label(n).html && ND_has_port(n)) {
UNSUPPORTED("67g7bthntnw8syb6zd03ueg84"); // side = html_path(n, p, side, rv, kptr);
}
return side;
@@ -3429,15 +3399,15 @@ throw new UnsupportedOperationException();
//3 5k2b9gfpwm2tj3zmzniuz9azt
// static port poly_port(node_t * n, char *portname, char *compass)
-public static __struct__<port> poly_port(Agnode_s n, CString portname, CString compass) {
+public static ST_port poly_port(ST_Agnode_s n, CString portname, CString compass) {
// WARNING!! STRUCT
return poly_port_w_(n, portname, compass).copy();
}
-private static __struct__<port> poly_port_w_(Agnode_s n, CString portname, CString compass) {
+private static ST_port poly_port_w_(ST_Agnode_s n, CString portname, CString compass) {
ENTERING("5k2b9gfpwm2tj3zmzniuz9azt","poly_port");
try {
- final __struct__<port> rv= JUtils.from(port.class);
- boxf bp;
+ final ST_port rv= new ST_port();
+ ST_boxf bp;
int sides; /* bitmap of which sides the port lies along */
if (portname.charAt(0) == '\0')
return Z.z().Center.copy();
@@ -4592,18 +4562,18 @@ throw new UnsupportedOperationException();
//3 bmt148wdf0a7gslm7hmp043jy
// shape_desc *bind_shape(char *name, node_t * np)
-public static shape_desc bind_shape(CString name, Agnode_s np) {
+public static ST_shape_desc bind_shape(CString name, ST_Agnode_s np) {
ENTERING("bmt148wdf0a7gslm7hmp043jy","bind_shape");
try {
- shape_desc rv = null;
+ ST_shape_desc rv = null;
CString str;
str = safefile(agget(np, new CString("shapefile")));
/* If shapefile is defined and not epsf, set shape = custom */
if (str!=null && UNSUPPORTED("!(*(name)==*(\"epsf\")&&!strcmp(name,\"epsf\"))")!=null)
name = new CString("custom");
if (N(name.charAt(0)=='c' && N(strcmp(name,new CString("custom"))))) {
- for (shape_desc ptr : Z.z().Shapes) {
- if ((N(strcmp(ptr.getCString("name"),name)))) {
+ for (ST_shape_desc ptr : Z.z().Shapes) {
+ if ((N(strcmp(ptr.name,name)))) {
rv = ptr;
break;
}
@@ -4896,11 +4866,11 @@ throw new UnsupportedOperationException();
//3 ckbg1dyu9jzx7g0c9dbriez7r
// port resolvePort(node_t * n, node_t * other, port * oldport)
-public static ST_port resolvePort(Agnode_s n, Agnode_s other, port oldport) {
+public static ST_port resolvePort(ST_Agnode_s n, ST_Agnode_s other, ST_port oldport) {
// WARNING!! STRUCT
return resolvePort_w_(n, other, oldport).copy();
}
-private static ST_port resolvePort_w_(Agnode_s n, Agnode_s other, port oldport) {
+private static ST_port resolvePort_w_(ST_Agnode_s n, ST_Agnode_s other, ST_port oldport) {
ENTERING("ckbg1dyu9jzx7g0c9dbriez7r","resolvePort");
try {
UNSUPPORTED("1aa44pvk8su341rug2x5h5h9o"); // port resolvePort(node_t * n, node_t * other, port * oldport)
diff --git a/src/gen/lib/common/splines__c.java b/src/gen/lib/common/splines__c.java
index dd80a56..d209f1e 100644
--- a/src/gen/lib/common/splines__c.java
+++ b/src/gen/lib/common/splines__c.java
@@ -51,15 +51,14 @@ import static gen.lib.common.arrows__c.arrowEndClip;
import static gen.lib.common.arrows__c.arrowStartClip;
import static gen.lib.common.arrows__c.arrow_flags;
import static gen.lib.common.emit__c.update_bb_bz;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.shapes__c.resolvePort;
import static gen.lib.common.utils__c.Bezier;
+import static gen.lib.common.utils__c.dotneato_closest;
import static smetana.core.JUtils.EQ;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
-import static smetana.core.Macro.ALLOC;
+import static smetana.core.Macro.ALLOC_ST_bezier;
import static smetana.core.Macro.APPROXEQPT;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_port;
@@ -68,6 +67,7 @@ import static smetana.core.Macro.ED_spl;
import static smetana.core.Macro.ED_tail_port;
import static smetana.core.Macro.ED_to_orig;
import static smetana.core.Macro.GD_bb;
+import static smetana.core.Macro.GD_flags;
import static smetana.core.Macro.GD_flip;
import static smetana.core.Macro.MAX;
import static smetana.core.Macro.MILLIPOINT;
@@ -80,28 +80,23 @@ import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.ND_shape;
import static smetana.core.Macro.NOT;
+import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_bezier;
import h.ST_boxf;
+import h.ST_inside_t;
+import h.ST_path;
+import h.ST_pathend_t;
import h.ST_pointf;
-import h.bezier;
-import h.boxf;
-import h.inside_t;
-import h.path;
-import h.pathend_t;
-import h.pointf;
-import h.splineInfo;
-import h.splines;
-import h.textlabel_t;
+import h.ST_splineInfo;
+import h.ST_splines;
+import h.ST_textlabel_t;
import smetana.core.CFunction;
-import smetana.core.JUtils;
import smetana.core.MutableDouble;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class splines__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -361,14 +356,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -397,25 +392,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -439,16 +415,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -745,23 +721,23 @@ throw new UnsupportedOperationException();
//3 6izm0fbkejw7odmiw4zaw1ycp
// static void arrow_clip(edge_t * fe, node_t * hn, pointf * ps, int *startp, int *endp, bezier * spl, splineInfo * info)
-public static void arrow_clip(Agedge_s fe, Agnode_s hn, __ptr__ ps, int startp[], int endp[], bezier spl, __ptr__ info) {
+public static void arrow_clip(ST_Agedge_s fe, ST_Agnode_s hn, ST_pointf.Array ps, int startp[], int endp[], ST_bezier spl, ST_splineInfo info) {
ENTERING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
try {
- Agedge_s e;
+ ST_Agedge_s e;
int i;
boolean j;
int sflag[] = new int[]{0};
int eflag[] = new int[]{0};
for (e = fe; ED_to_orig(e)!=null; e = ED_to_orig(e));
- if (info.getBoolean("ignoreSwap"))
+ if (info.ignoreSwap)
j = false;
else
- j = (Boolean) info.call("swapEnds", e);
+ j = (Boolean) info.swapEnds.exe(e);
arrow_flags(e, sflag, eflag);
- if ((Boolean) info.call("splineMerge", hn))
+ if ((Boolean) info.splineMerge.exe(hn))
eflag[0] = 0;
- if ((Boolean) info.call("splineMerge", agtail(fe)))
+ if ((Boolean) info.splineMerge.exe(agtail(fe)))
sflag[0] = 0;
/* swap the two ends */
if (j) {
@@ -769,7 +745,7 @@ try {
sflag[0] = eflag[0];
eflag[0] = i;
}
- if (info.getBoolean("isOrtho")) {
+ if (info.isOrtho) {
UNSUPPORTED("7a3lmojyfh13d6shkviuogx2c"); // if (eflag || sflag)
UNSUPPORTED("dzbrwr2ulubtjkbd8j2o4yyov"); // arrowOrthoClip(e, ps, *startp, *endp, spl, sflag, eflag);
}
@@ -791,12 +767,12 @@ LEAVING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
//3 q4t1ywnk3wm1vyh5seoj7xye
// void bezier_clip(inside_t * inside_context, boolean(*inside) (inside_t * inside_context, pointf p), pointf * sp, boolean left_inside)
-public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, __array_of_struct__ sp, boolean left_inside) {
+public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, ST_pointf.Array sp, boolean left_inside) {
ENTERING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
try {
- final __array_of_struct__ seg = __array_of_struct_impl__.malloc(pointf.class, 4);
- final __array_of_struct__ best = __array_of_struct_impl__.malloc(pointf.class, 4);
- final __struct__<pointf> pt = JUtils.from(pointf.class), opt = JUtils.from(pointf.class);
+ final ST_pointf.Array seg = new ST_pointf.Array( 4);
+ final ST_pointf.Array best = new ST_pointf.Array( 4);
+ final ST_pointf pt = new ST_pointf(), opt = new ST_pointf();
__ptr__ left, right;
final MutableDouble low = new MutableDouble(0), high = new MutableDouble(0);
double t;
@@ -805,12 +781,12 @@ try {
int i;
if (left_inside) {
left = null;
- right = (pointf) seg.asPtr();
+ right = seg.asPtr();
pt.___(sp.plus(0).getStruct());
idir = low;
odir = high;
} else {
- left = (pointf) seg.asPtr();
+ left = seg.asPtr();
right = null;
pt.___(sp.plus(3).getStruct());
idir = high;
@@ -831,7 +807,7 @@ try {
found = NOT(false);
odir.setValue(t);
}
- } while (ABS(opt.getDouble("x") - pt.getDouble("x")) > .5 || ABS(opt.getDouble("y") - pt.getDouble("y")) > .5);
+ } while (ABS(opt.x - pt.x) > .5 || ABS(opt.y - pt.y) > .5);
if (found)
for (i = 0; i < 4; i++)
sp.plus(i).setStruct(best.plus(i).getStruct());
@@ -848,22 +824,22 @@ LEAVING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
//3 1fjkj1ydhtlf13pqj5r041orq
// static void shape_clip0(inside_t * inside_context, node_t * n, pointf curve[4], boolean left_inside)
-public static void shape_clip0(__ptr__ inside_context, Agnode_s n, __ptr__ curve, boolean left_inside) {
+public static void shape_clip0(__ptr__ inside_context, ST_Agnode_s n, ST_pointf.Array curve, boolean left_inside) {
ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0");
try {
int i;
double save_real_size;
- final __array_of_struct__ c = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_pointf.Array c = new ST_pointf.Array( 4);
save_real_size = ND_rw(n);
for (i = 0; i < 4; i++) {
- c.plus(i).setDouble("x", curve.plus(i).getDouble("x") - ND_coord(n).getDouble("x"));
- c.plus(i).setDouble("y", curve.plus(i).getDouble("y") - ND_coord(n).getDouble("y"));
+ c.plus(i).setDouble("x", curve.get(i).x - ND_coord(n).x);
+ c.plus(i).setDouble("y", curve.get(i).y - ND_coord(n).y);
}
- bezier_clip(inside_context, ND_shape(n).getPtr("fns").getPtr("insidefn"), c,
+ bezier_clip(inside_context, ND_shape(n).fns.insidefn, c,
left_inside);
for (i = 0; i < 4; i++) {
- curve.plus(i).setDouble("x", c.plus(i).getDouble("x") + ND_coord(n).getDouble("x"));
- curve.plus(i).setDouble("y", c.plus(i).getDouble("y") + ND_coord(n).getDouble("y"));
+ curve.plus(i).setDouble("x", c.get(i).x + ND_coord(n).x);
+ curve.plus(i).setDouble("y", c.get(i).y + ND_coord(n).y);
}
ND_rw(n, save_real_size);
} finally {
@@ -903,25 +879,25 @@ throw new UnsupportedOperationException();
//3 bdirexg1qdtophlh0ofjvsmj7
// bezier *new_spline(edge_t * e, int sz)
-public static bezier new_spline(Agedge_s e, int sz) {
+public static ST_bezier new_spline(ST_Agedge_s e, int sz) {
ENTERING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
try {
- bezier rv;
+ ST_bezier rv;
while (ED_edge_type(e) != 0)
e = ED_to_orig(e);
if (ED_spl(e) == null)
- ED_spl(e, zmalloc(sizeof(splines.class)));
- ED_spl(e).setPtr("list", ALLOC(ED_spl(e).getInt("size") + 1, ED_spl(e).getPtr("list"), bezier.class));
- rv = (bezier) ED_spl(e).getPtr("list").plus(ED_spl(e).getInt("size"));
- ED_spl(e).setInt("size", ED_spl(e).getInt("size")+1);
- rv.setPtr("list", zmalloc(sizeof(pointf.class, sz)));
+ ED_spl(e, new ST_splines());
+ ED_spl(e).list = ALLOC_ST_bezier(ED_spl(e).size + 1, ED_spl(e).list);
+ rv = (ST_bezier) ED_spl(e).list.plus(ED_spl(e).size).getPtr();
+ ED_spl(e).setInt("size", ED_spl(e).size+1);
+ rv.list = new ST_pointf.Array(sz);
rv.setInt("size", sz);
rv.setInt("sflag", 0);
rv.setInt("eflag", 0);
- rv.getStruct("sp").setDouble("x", 0);
- rv.getStruct("sp").setDouble("y", 0);
- rv.getStruct("ep").setDouble("x", 0);
- rv.getStruct("ep").setDouble("y", 0);
+ rv.sp.setDouble("x", 0);
+ rv.sp.setDouble("y", 0);
+ rv.ep.setDouble("x", 0);
+ rv.ep.setDouble("y", 0);
return rv;
} finally {
LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
@@ -933,65 +909,65 @@ LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
//3 duednxyuvf6xrff752uuv620f
// void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info)
-public static void clip_and_install(Agedge_s fe, Agnode_s hn, __ptr__ ps, int pn, __ptr__ info) {
+public static void clip_and_install(ST_Agedge_s fe, ST_Agnode_s hn, ST_pointf.Array ps, int pn, ST_splineInfo info) {
ENTERING("duednxyuvf6xrff752uuv620f","clip_and_install");
try {
- final __struct__<pointf> p2 = JUtils.from(pointf.class);
- bezier newspl;
- Agnode_s tn;
+ final ST_pointf p2 = new ST_pointf();
+ ST_bezier newspl;
+ ST_Agnode_s tn;
int start[] = new int[] {0};
int end[] = new int[] {0};
int i, clipTail=0, clipHead=0;
- Agraph_s g;
- Agedge_s orig;
- boxf tbox=null, hbox=null;
- final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
+ ST_Agraph_s g;
+ ST_Agedge_s orig;
+ ST_boxf tbox=null, hbox=null;
+ final ST_inside_t inside_context = new ST_inside_t();
tn = agtail(fe);
g = agraphof(tn);
newspl = new_spline(fe, pn);
for (orig = fe; ED_edge_type(orig) != 0; orig = ED_to_orig(orig));
/* may be a reversed flat edge */
- if (N(info.getBoolean("ignoreSwap")) && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
- Agnode_s tmp;
+ if (N(info.ignoreSwap) && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
+ ST_Agnode_s tmp;
tmp = hn;
hn = tn;
tn = tmp;
}
if (EQ(tn, agtail(orig))) {
- clipTail = ED_tail_port(orig).getInt("clip");
- clipHead = ED_head_port(orig).getInt("clip");
- tbox = (boxf) ED_tail_port(orig).getPtr("bp");
- hbox = (boxf) ED_head_port(orig).getPtr("bp");
+ clipTail = ED_tail_port(orig).clip;
+ clipHead = ED_head_port(orig).clip;
+ tbox = (ST_boxf) ED_tail_port(orig).bp;
+ hbox = (ST_boxf) ED_head_port(orig).bp;
}
else { /* fe and orig are reversed */
- clipTail = ED_head_port(orig).getInt("clip");
- clipHead = ED_tail_port(orig).getInt("clip");
- hbox = (boxf) ED_tail_port(orig).getPtr("bp");
- tbox = (boxf) ED_head_port(orig).getPtr("bp");
+ clipTail = ED_head_port(orig).clip;
+ clipHead = ED_tail_port(orig).clip;
+ hbox = (ST_boxf) ED_tail_port(orig).bp;
+ tbox = (ST_boxf) ED_head_port(orig).bp;
}
/* spline may be interior to node */
- if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).getPtr("fns").getPtr("insidefn")!=null) {
+ if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).fns.insidefn!=null) {
inside_context.setPtr("s.n", tn);
inside_context.setPtr("s.bp", tbox);
for (start[0] = 0; start[0] < pn - 4; start[0] += 3) {
- p2.setDouble("x", ps.plus(start[0] + 3).getDouble("x") - ND_coord(tn).getDouble("x"));
- p2.setDouble("y", ps.plus(start[0] + 3).getDouble("y") - ND_coord(tn).getDouble("y"));
- if (((Boolean)ND_shape(tn).getPtr("fns").call("insidefn", inside_context.amp(), p2)) == false)
+ p2.setDouble("x", ps.get(start[0] + 3).x - ND_coord(tn).x);
+ p2.setDouble("y", ps.get(start[0] + 3).y - ND_coord(tn).y);
+ if (((Boolean)ND_shape(tn).fns.insidefn.exe(inside_context, p2)) == false)
break;
}
- shape_clip0(inside_context.amp(), tn, ps.plus(start[0]), NOT(false));
+ shape_clip0(inside_context, tn, ps.plus(start[0]), NOT(false));
} else
start[0] = 0;
- if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).getPtr("fns").getPtr("insidefn")!=null) {
+ if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).fns.insidefn!=null) {
inside_context.setPtr("s.n", hn);
inside_context.setPtr("s.bp", hbox);
for (end[0] = pn - 4; end[0] > 0; end[0] -= 3) {
- p2.setDouble("x", ps.plus(end[0]).getDouble("x") - ND_coord(hn).getDouble("x"));
- p2.setDouble("y", ps.plus(end[0]).getDouble("y") - ND_coord(hn).getDouble("y"));
- if (((Boolean)ND_shape(hn).getPtr("fns").call("insidefn", inside_context.amp(), p2)) == false)
+ p2.setDouble("x", ps.get(end[0]).x - ND_coord(hn).x);
+ p2.setDouble("y", ps.get(end[0]).y - ND_coord(hn).y);
+ if (((Boolean)ND_shape(hn).fns.insidefn.exe(inside_context, p2)) == false)
break;
}
- shape_clip0(inside_context.amp(), hn, ps.plus(end[0]), false);
+ shape_clip0(inside_context, hn, ps.plus(end[0]), false);
} else
end[0] = pn - 4;
for (; start[0] < pn - 4; start[0] += 3)
@@ -1002,20 +978,20 @@ try {
break;
arrow_clip(fe, hn, ps, start, end, newspl, info);
for (i = start[0]; i < end[0] + 4; ) {
- final __array_of_struct__ cp = __array_of_struct_impl__.malloc(pointf.class, 4);
- newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
+ final ST_pointf.Array cp = new ST_pointf.Array( 4);
+ newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
cp.plus(0).setStruct(ps.plus(i).getStruct());
i++;
if ( i >= end[0] + 4)
break;
- newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
+ newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
cp.plus(1).setStruct(ps.plus(i).getStruct());
i++;
- newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
+ newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
cp.plus(2).setStruct(ps.plus(i).getStruct());
i++;
cp.plus(3).setStruct(ps.plus(i).getStruct());
- update_bb_bz(GD_bb(g).amp(), cp);
+ update_bb_bz(GD_bb(g), cp);
}
newspl.setInt("size", end[0] - start[0] + 4);
} finally {
@@ -1028,7 +1004,7 @@ LEAVING("duednxyuvf6xrff752uuv620f","clip_and_install");
//3 25ndy15kghfrogsv0b0o0xkgv
// static double conc_slope(node_t* n)
-public static double conc_slope(Agnode_s n) {
+public static double conc_slope(ST_Agnode_s n) {
ENTERING("25ndy15kghfrogsv0b0o0xkgv","conc_slope");
try {
UNSUPPORTED("e388y3vtrp8f6spgh9q4wx37w"); // static double
@@ -1063,17 +1039,17 @@ LEAVING("25ndy15kghfrogsv0b0o0xkgv","conc_slope");
//3 egq4f4tmy1dhyj6jpj92r7xhu
// void add_box(path * P, boxf b)
-public static void add_box(path P, final ST_boxf b) {
+public static void add_box(ST_path P, final ST_boxf b) {
// WARNING!! STRUCT
add_box_w_(P, b.copy());
}
-private static void add_box_w_(path P, final ST_boxf b) {
+private static void add_box_w_(ST_path P, final ST_boxf b) {
ENTERING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
try {
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{
- P.getArrayOfPtr("boxes").plus(P.getInt("nbox")).setStruct(b);
- P.setInt("nbox", P.getInt("nbox")+1);
+ P.boxes[P.nbox].setStruct(b);
+ P.nbox = P.nbox+1;
}
} finally {
LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
@@ -1085,34 +1061,34 @@ LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
//3 7pc43ifcw5g56449d101qf590
// void beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
-public static void beginpath(path P, Agedge_s e, int et, pathend_t endp, boolean merge) {
+public static void beginpath(ST_path P, ST_Agedge_s e, int et, ST_pathend_t endp, boolean merge) {
ENTERING("7pc43ifcw5g56449d101qf590","beginpath");
try {
int side, mask;
- Agnode_s n;
+ ST_Agnode_s n;
CFunction pboxfn;
n = agtail(e);
if (ED_tail_port(e).dyna!=0)
- ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e).amp()));
+ ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e)));
if (ND_shape(n)!=null)
- pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn");
+ pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
else
pboxfn = null;
- P.getStruct("start").setStruct("p", add_pointf(ND_coord(n), ED_tail_port(e).getStruct("p")));
+ P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).p));
if (merge) {
/*P->start.theta = - M_PI / 2; */
- P.getStruct("start").setDouble("theta", conc_slope(agtail(e)));
- P.getStruct("start").setBoolean("constrained", NOT(false));
+ P.start.setDouble("theta", conc_slope(agtail(e)));
+ P.start.constrained= NOTI(false);
} else {
- if (ED_tail_port(e).getBoolean("constrained")) {
- P.getStruct("start").setDouble("theta", ED_tail_port(e).getDouble("theta"));
- P.getStruct("start").setBoolean("constrained", NOT(false));
+ if (ED_tail_port(e).constrained!=0) {
+ P.start.setDouble("theta", ED_tail_port(e).theta);
+ P.start.constrained= NOTI(false);
} else
- P.getStruct("start").setBoolean("constrained", false);
+ P.start.constrained= 0;
}
- P.setInt("nbox", 0);
+ P.nbox = 0;
P.setPtr("data", e);
- endp.setStruct("np", P.getStruct("start").getStruct("p"));
+ endp.setStruct("np", P.start.p);
if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_tail_port(e).side)!=0)) {
UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
@@ -1246,12 +1222,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side;
UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
}
if (et == 1) side = (1<<0);
- else side = endp.getInt("sidemask"); /* for flat edges */
+ else side = endp.sidemask; /* for flat edges */
if (pboxfn!=null
- && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e).amp(), side, endp.getArrayOfStruct("boxes").plus(0).getStruct().amp(), endp.getInt("boxn")))!=0)
+ && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e), side, endp.boxes[0], endp.boxn))!=0)
UNSUPPORTED("ex9kjvshm19zbu9vqonk1avd8"); // endp->sidemask = mask;
else {
- endp.getArrayOfStruct("boxes").plus(0).setStruct(endp.getStruct("nb"));
+ endp.boxes[0].setStruct(endp.nb);
endp.setInt("boxn", 1);
switch (et) {
case 8:
@@ -1263,15 +1239,15 @@ UNSUPPORTED("46vb5zg9vm9n0q21g53nj66v3"); // endp->boxes[0].UR.y = P->start
UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = (1<<0);
break;
case 2:
- if (endp.getInt("sidemask") == (1<<2))
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("start").getStruct("p").getDouble("y");
+ if (endp.sidemask == (1<<2))
+ ((ST_boxf)endp.boxes[0]).LL.y = P.start.p.y;
else
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("start").getStruct("p").getDouble("y");
+ ((ST_boxf)endp.boxes[0]).UR.y = P.start.p.y;
break;
case 1:
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("start").getStruct("p").getDouble("y");
+ ((ST_boxf)(endp).boxes[0]).UR.y = P.start.p.y;
endp.setInt("sidemask", (1<<0));
- P.getStruct("start").getStruct("p").setDouble("y", P.getStruct("start").getStruct("p").getDouble("y") - 1);
+ P.start.p.setDouble("y", P.start.p.y - 1);
break;
}
}
@@ -1285,33 +1261,33 @@ LEAVING("7pc43ifcw5g56449d101qf590","beginpath");
//3 79dr5om55xs3n5lgai1sf58vu
// void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
-public static void endpath(path P, Agedge_s e, int et, pathend_t endp, boolean merge) {
+public static void endpath(ST_path P, ST_Agedge_s e, int et, ST_pathend_t endp, boolean merge) {
ENTERING("79dr5om55xs3n5lgai1sf58vu","endpath");
try {
int side, mask;
- Agnode_s n;
+ ST_Agnode_s n;
CFunction pboxfn;
n = aghead(e);
- if (ED_head_port(e).getBoolean("dyna"))
+ if (ED_head_port(e).dyna!=0)
UNSUPPORTED("9brhx94sjudx3jtzrnwa60x8"); // ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e));
if (ND_shape(n)!=null)
- pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn");
+ pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
else
pboxfn = null;
- P.getStruct("end").setStruct("p", add_pointf(ND_coord(n), ED_head_port(e).getStruct("p")));
+ P.end.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).p));
if (merge) {
UNSUPPORTED("cproejwusj67kuugolh6tbkwz"); // /*P->end.theta = M_PI / 2; */
UNSUPPORTED("65vhfvz1d1tub3f85tdsgg2g5"); // P->end.theta = conc_slope(aghead(e)) + M_PI;
UNSUPPORTED("du4hwt6pjf3bmkvowssm7b0uo"); // assert(P->end.theta < 2 * M_PI);
UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0);
} else {
- if (ED_head_port(e).getBoolean("constrained")) {
- P.getStruct("end").setDouble("theta", ED_head_port(e).getDouble("theta"));
- P.getStruct("end").setInt("constrained", 1);
+ if (ED_head_port(e).constrained!=0) {
+ P.end.setDouble("theta", ED_head_port(e).theta);
+ P.end.setInt("constrained", 1);
} else
- P.getStruct("end").setInt("constrained", 0);
+ P.end.setInt("constrained", 0);
}
- endp.setStruct("np", P.getStruct("end").getStruct("p"));
+ endp.setStruct("np", P.end.p);
if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_head_port(e).side)!=0)) {
UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
@@ -1446,12 +1422,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side;
UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
}
if (et == 1) side = (1<<2);
- else side = endp.getInt("sidemask"); /* for flat edges */
+ else side = endp.sidemask; /* for flat edges */
if (pboxfn!=null
- && (mask = (Integer) pboxfn.exe(n, ED_head_port(e).amp(), side, endp.getArrayOfStruct("boxes").plus(0).getStruct().amp(), endp.getInt("boxn")))!=0)
+ && (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.boxn))!=0)
endp.setInt("sidemask", mask);
else {
- endp.getArrayOfStruct("boxes").plus(0).setStruct(endp.getStruct("nb"));
+ endp.boxes[0].setStruct(endp.nb);
endp.setInt("boxn", 1);
switch (et) {
case 8:
@@ -1463,15 +1439,15 @@ UNSUPPORTED("db6vmvnse8bawy8qwct7l24u8"); // endp->boxes[0].LL.y = P->end.p
UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = (1<<2);
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
case 2:
- if (endp.getInt("sidemask") == (1<<2))
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("end").getStruct("p").getDouble("y");
+ if (endp.sidemask == (1<<2))
+ endp.boxes[0].LL.y = P.end.p.y;
else
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("end").getStruct("p").getDouble("y");
+ endp.boxes[0].UR.y = P.end.p.y;
break;
case 1:
- ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("end").getStruct("p").getDouble("y");
+ endp.boxes[0].LL.y = P.end.p.y;
endp.setInt("sidemask", (1<<2));
- P.getStruct("end").getStruct("p").setDouble("y", P.getStruct("end").getStruct("p").getDouble("y") +1);
+ P.end.p.setDouble("y", P.end.p.y +1);
break;
}
}
@@ -1486,6 +1462,7 @@ LEAVING("79dr5om55xs3n5lgai1sf58vu","endpath");
//3 3g7alj6eirl5b2hlhluiqvaax
// static int convert_sides_to_points(int tail_side, int head_side)
public static int convert_sides_to_points(int tail_side, int head_side) {
+ENTERING("3g7alj6eirl5b2hlhluiqvaax","convert_sides_to_points");
int vertices[] = new int[] {12,4,6,2,3,1,9,8}; //the cumulative side value of each node point
int i, tail_i, head_i;
int pair_a[][] = new int[][] { //array of possible node point pairs
@@ -1498,7 +1475,6 @@ int pair_a[][] = new int[][] { //array of possible node point pairs
{71,72,73,74,75,76,77,78},
{81,82,83,84,85,86,87,88}
};
-ENTERING("3g7alj6eirl5b2hlhluiqvaax","convert_sides_to_points");
try {
tail_i = head_i = -1;
for(i=0;i< 8; i++){
@@ -1709,29 +1685,29 @@ throw new UnsupportedOperationException();
//3 3sr8gvj4141qql0v12lb89cyt
// static void selfRight (edge_t* edges[], int ind, int cnt, double stepx, double sizey, splineInfo* sinfo)
-public static void selfRight(__ptr__ edges, int ind, int cnt, double stepx, double sizey, splineInfo sinfo) {
+public static void selfRight(ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double stepx, double sizey, ST_splineInfo sinfo) {
ENTERING("3sr8gvj4141qql0v12lb89cyt","selfRight");
try {
int i, sgn, point_pair;
double hx, tx, stepy, dx, dy, width, height;
final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(), np = new ST_pointf();
- Agnode_s n;
- Agedge_s e;
- final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 1000);
+ ST_Agnode_s n;
+ ST_Agedge_s e;
+ final ST_pointf.Array points = new ST_pointf.Array( 1000);
int pointn;
- e = (Agedge_s) edges.plus(ind).getPtr();
+ e = (ST_Agedge_s) edges.get(ind);
n = agtail(e);
stepy = (sizey / 2.) / cnt;
stepy = MAX(stepy, 2.);
pointn = 0;
np.___(ND_coord(n));
- tp.___(ED_tail_port(e).getStruct("p"));
- tp.setDouble("x", tp.getDouble("x") + np.getDouble("x"));
- tp.setDouble("y", tp.getDouble("y") + np.getDouble("y"));
- hp.___(ED_head_port(e).getStruct("p"));
- hp.setDouble("x", hp.getDouble("x") + np.getDouble("x"));
- hp.setDouble("y", hp.getDouble("y") + np.getDouble("y"));
- if (tp.getDouble("y") >= hp.getDouble("y")) sgn = 1;
+ tp.___(ED_tail_port(e).p);
+ tp.setDouble("x", tp.x + np.x);
+ tp.setDouble("y", tp.y + np.y);
+ hp.___(ED_head_port(e).p);
+ hp.setDouble("x", hp.x + np.x);
+ hp.setDouble("y", hp.y + np.y);
+ if (tp.y >= hp.y) sgn = 1;
else sgn = -1;
dx = ND_rw(n);
dy = 0;
@@ -1740,36 +1716,36 @@ try {
point_pair = convert_sides_to_points(ED_tail_port(e).side,ED_head_port(e).side);
switch(point_pair){
case 32:
- case 65: if(tp.getDouble("y") == hp.getDouble("y"))
+ case 65: if(tp.y == hp.y)
sgn = -sgn;
break;
default:
break;
}
- tx = MIN(dx, 3*(np.getDouble("x") + dx - tp.getDouble("x")));
- hx = MIN(dx, 3*(np.getDouble("x") + dx - hp.getDouble("x")));
+ tx = MIN(dx, 3*(np.x + dx - tp.x));
+ hx = MIN(dx, 3*(np.x + dx - hp.x));
for (i = 0; i < cnt; i++) {
- e = (Agedge_s) edges.plus(ind++).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind++).getPtr();
dx += stepx; tx += stepx; hx += stepx; dy += sgn*stepy;
pointn = 0;
points.plus(pointn++).setStruct(tp);
- points.plus(pointn++).setStruct(pointfof(tp.getDouble("x") + tx / 3, tp.getDouble("y") + dy));
- points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, tp.getDouble("y") + dy));
- points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, (tp.getDouble("y")+hp.getDouble("y"))/2));
- points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, hp.getDouble("y") - dy));
- points.plus(pointn++).setStruct(pointfof(hp.getDouble("x") + hx / 3, hp.getDouble("y") - dy));
+ points.plus(pointn++).setStruct(pointfof(tp.x + tx / 3, tp.y + dy));
+ points.plus(pointn++).setStruct(pointfof(np.x + dx, tp.y + dy));
+ points.plus(pointn++).setStruct(pointfof(np.x + dx, (tp.y+hp.y)/2));
+ points.plus(pointn++).setStruct(pointfof(np.x + dx, hp.y - dy));
+ points.plus(pointn++).setStruct(pointfof(hp.x + hx / 3, hp.y - dy));
points.plus(pointn++).setStruct(hp);
if (ED_label(e)!=null) {
if (GD_flip(agraphof(agtail(e)))!=0) {
- width = ED_label(e).getStruct("dimen").getDouble("y");
- height = ED_label(e).getStruct("dimen").getDouble("x");
+ width = ED_label(e).dimen.y;
+ height = ED_label(e).dimen.x;
} else {
- width = ED_label(e).getStruct("dimen").getDouble("x");
- height = ED_label(e).getStruct("dimen").getDouble("y");
+ width = ED_label(e).dimen.x;
+ height = ED_label(e).dimen.y;
}
- ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + dx + width / 2.0);
- ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y"));
- ED_label(e).setBoolean("set", NOT(false));
+ ED_label(e).pos.setDouble("x", ND_coord(n).x + dx + width / 2.0);
+ ED_label(e).pos.setDouble("y", ND_coord(n).y);
+ ED_label(e).set= NOTI(false);
if (width > stepx)
dx += width - stepx;
}
@@ -1864,12 +1840,12 @@ throw new UnsupportedOperationException();
//3 678whq05s481ertx02jloteu3
// int selfRightSpace (edge_t* e)
-public static int selfRightSpace(Agedge_s e) {
+public static int selfRightSpace(ST_Agedge_s e) {
ENTERING("678whq05s481ertx02jloteu3","selfRightSpace");
try {
int sw=0;
double label_width;
- textlabel_t l = ED_label(e);
+ ST_textlabel_t l = ED_label(e);
if ((N(ED_tail_port(e).defined) && N(ED_head_port(e).defined)) ||
(
N(ED_tail_port(e).side & (1<<3)) &&
@@ -1879,7 +1855,7 @@ try {
)) {
sw = 18;
if (l!=null) {
- label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.getStruct("dimen").getDouble("y") : l.getStruct("dimen").getDouble("x");
+ label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.y : l.dimen.x;
sw += label_width;
}
}
@@ -1895,11 +1871,11 @@ LEAVING("678whq05s481ertx02jloteu3","selfRightSpace");
//3 bt3fwgprixbc5rceeewozdqr9
// void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, double sizex, double sizey, splineInfo * sinfo)
-public static void makeSelfEdge(path P, __ptr__ edges, int ind, int cnt, double sizex, double sizey, splineInfo sinfo) {
+public static void makeSelfEdge(ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double sizex, double sizey, ST_splineInfo sinfo) {
ENTERING("bt3fwgprixbc5rceeewozdqr9","makeSelfEdge");
try {
- Agedge_s e;
- e = (Agedge_s) edges.plus(ind).getPtr();
+ ST_Agedge_s e;
+ e = (ST_Agedge_s) edges.get(ind);
/* self edge without ports or
* self edge with all ports inside, on the right, or at most 1 on top
* and at most 1 on bottom
@@ -1965,27 +1941,27 @@ throw new UnsupportedOperationException();
//3 7wyn51o9k6u7joaq9k18boffh
// static void endPoints(splines * spl, pointf * p, pointf * q)
-public static Object endPoints(Object... arg) {
-UNSUPPORTED("5r4ewx4i6zia04hwqvonnvcg9"); // static void endPoints(splines * spl, pointf * p, pointf * q)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("37thdceezsvepe7tlyfatrbcw"); // bezier bz;
-UNSUPPORTED("2hacb9fdt2n4mkiveluxkiu2e"); // bz = spl->list[0];
-UNSUPPORTED("dtt0q54ov71fji9i2ae24aeyc"); // if (bz.sflag) {
+public static void endPoints(ST_splines spl, ST_pointf p, ST_pointf q) {
+ENTERING("7wyn51o9k6u7joaq9k18boffh","endPoints");
+try {
+ final ST_bezier bz = new ST_bezier();
+ bz.____(spl.list.get(0));
+ if (bz.sflag!=0) {
UNSUPPORTED("4wazlko0bxmzxoobqacij1btk"); // *p = bz.sp;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("3gwxodchk1jdid7jbltvxhnaf"); // *p = bz.list[0];
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("6pj4gaguml8ocln5h92kpqk94"); // bz = spl->list[spl->size - 1];
-UNSUPPORTED("4o7tep38o3pxavxbzw15khp2r"); // if (bz.eflag) {
+ }
+ else {
+ p.____(bz.list.get(0));
+ }
+ bz.____(spl.list.plus(spl.size-1).getPtr());
+ if (bz.eflag!=0) {
UNSUPPORTED("78u9nvs8u7rxturidz5nf8hn4"); // *q = bz.ep;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
-UNSUPPORTED("3kkyg7t050mn59a1ekp0f0lzj"); // *q = bz.list[bz.size - 1];
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ else {
+ q.____(bz.list.get(bz.size-1));
+ }
+} finally {
+LEAVING("7wyn51o9k6u7joaq9k18boffh","endPoints");
+}
}
@@ -2039,28 +2015,35 @@ throw new UnsupportedOperationException();
//3 8hpmwzlqbj1nii32zubbe9hru
// pointf edgeMidpoint (graph_t* g, edge_t * e)
-public static Object edgeMidpoint(Object... arg) {
-UNSUPPORTED("ddgobb6cu0307nl6cc2hm7jak"); // pointf
-UNSUPPORTED("8ww957bkesrmzkmuchx2pvhb2"); // edgeMidpoint (graph_t* g, edge_t * e)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("cx1drb9eui5nioe70lvmlgm79"); // int et = (GD_flags(g) & (7 << 1));
-UNSUPPORTED("2auwjymmiryq94uc6spzynrvi"); // pointf d, spf, p, q;
-UNSUPPORTED("bpo1twbinspgdzr5k3fmntxtg"); // endPoints(ED_spl(e), &p, &q);
-UNSUPPORTED("4yaabujbmowa3lyxk4205gkpv"); // if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
+public static ST_pointf edgeMidpoint(ST_Agraph_s g, ST_Agedge_s e) {
+ENTERING("8hpmwzlqbj1nii32zubbe9hru","edgeMidpoint");
+try {
+ return edgeMidpoint_(g, e).copy();
+} finally {
+LEAVING("8hpmwzlqbj1nii32zubbe9hru","edgeMidpoint");
+}
+}
+
+
+private static ST_pointf edgeMidpoint_(ST_Agraph_s g, ST_Agedge_s e) {
+ int et = (GD_flags(g) & (7 << 1));
+ final ST_pointf d = new ST_pointf();
+ final ST_pointf spf = new ST_pointf();
+ final ST_pointf p = new ST_pointf();
+ final ST_pointf q = new ST_pointf();
+ endPoints((ST_splines) ED_spl(e), p, q);
+ if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
UNSUPPORTED("7i8m5mpfnv7m9uqxh015zfdaj"); // spf = p;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("bpe21xennpxofkh2a8ce70n8r"); // else if ((et == (5 << 1)) || (et == (2 << 1))) {
-UNSUPPORTED("6frrlsqvrym5x5bivjwo3rkg4"); // d.x = (q.x + p.x) / 2.;
-UNSUPPORTED("5qa6kgh9e0trsgfkiwhzxtc5n"); // d.y = (p.y + q.y) / 2.;
-UNSUPPORTED("dn0aho2lzwtnxuk3v45gd81fo"); // spf = dotneato_closest(ED_spl(e), d);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2flg4ooa026ob187pje77te28"); // else { /* ET_PLINE, ET_ORTHO or ET_LINE */
+ }
+ else if ((et == (5 << 1)) || (et == (2 << 1))) {
+ d.x = (q.x + p.x) / 2.;
+ d.y = (p.y + q.y) / 2.;
+ spf.___(dotneato_closest((ST_splines)ED_spl(e), d));
+ }
+ else { /* ET_PLINE, ET_ORTHO or ET_LINE */
UNSUPPORTED("6he3hi05vusuthrchn4enk7o6"); // spf = polylineMidpoint (ED_spl(e), &p, &q);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("56kh0ww24ygwjntzmm9q6wec3"); // return spf;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ return spf;
}
@@ -2142,11 +2125,11 @@ throw new UnsupportedOperationException();
//3 2tbz9tbkzx8os72qiyhgnby67
// splines *getsplinepoints(edge_t * e)
-public static splines getsplinepoints(Agedge_s e) {
+public static ST_splines getsplinepoints(ST_Agedge_s e) {
ENTERING("2tbz9tbkzx8os72qiyhgnby67","getsplinepoints");
try {
- Agedge_s le;
- splines sp;
+ ST_Agedge_s le;
+ ST_splines sp;
for (le = e; N(sp = ED_spl(le)) && ED_edge_type(le) != 0;
le = ED_to_orig(le));
if (sp == null)
diff --git a/src/gen/lib/common/textspan__c.java b/src/gen/lib/common/textspan__c.java
index aed083f..2f8ab31 100644
--- a/src/gen/lib/common/textspan__c.java
+++ b/src/gen/lib/common/textspan__c.java
@@ -47,13 +47,10 @@ package gen.lib.common;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
-import h._dt_s;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__ptr__;
-import smetana.core.__struct__;
+import h.ST_GVC_s;
+import h.ST_dt_s;
+import h.ST_pointf;
+import h.ST_textspan_t;
public class textspan__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -313,14 +310,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -349,26 +346,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -391,16 +368,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -796,17 +773,17 @@ throw new UnsupportedOperationException();
//3 n8tcl06mifdn779rzenam44z
// pointf textspan_size(GVC_t *gvc, textspan_t * span)
-public static __struct__<pointf> textspan_size(GVC_s gvc, __ptr__ span) {
+public static ST_pointf textspan_size(ST_GVC_s gvc, ST_textspan_t span) {
// WARNING!! STRUCT
return textspan_size_w_(gvc, span).copy();
}
-private static __struct__<pointf> textspan_size_w_(GVC_s gvc, __ptr__ span) {
+private static ST_pointf textspan_size_w_(ST_GVC_s gvc, ST_textspan_t span) {
ENTERING("n8tcl06mifdn779rzenam44z","textspan_size");
try {
System.err.println("Warning:textspan_size "+span);
- span.getStruct("size").setDouble("x", 30);
- span.getStruct("size").setDouble("y", 20);
- return span.getStruct("size").copy();
+ span.size.setDouble("x", 30);
+ span.size.setDouble("y", 20);
+ return span.size.copy();
} finally {
LEAVING("n8tcl06mifdn779rzenam44z","textspan_size");
}
@@ -889,7 +866,7 @@ throw new UnsupportedOperationException();
//3 9mfrgcpzz2d9f7nxfgx4nxj2q
// Dt_t * textfont_dict_open(GVC_t *gvc)
-public static _dt_s textfont_dict_open(GVC_s gvc) {
+public static ST_dt_s textfont_dict_open(ST_GVC_s gvc) {
ENTERING("9mfrgcpzz2d9f7nxfgx4nxj2q","textfont_dict_open");
try {
return null;
diff --git a/src/gen/lib/common/utils__c.java b/src/gen/lib/common/utils__c.java
index 2391482..2346e20 100644
--- a/src/gen/lib/common/utils__c.java
+++ b/src/gen/lib/common/utils__c.java
@@ -51,7 +51,6 @@ import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.obj__c.agraphof;
import static gen.lib.cgraph.refstr__c.aghtmlstr;
import static gen.lib.common.labels__c.make_label;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.shapes__c.bind_shape;
import static gen.lib.common.shapes__c.shapeOf;
import static smetana.core.JUtils.EQ;
@@ -60,7 +59,6 @@ import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.atoi;
import static smetana.core.JUtils.enumAsInt;
import static smetana.core.JUtils.isdigit;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtils.strchr;
import static smetana.core.JUtils.strcmp;
import static smetana.core.JUtils.strtod;
@@ -68,10 +66,12 @@ import static smetana.core.JUtils.strtol;
import static smetana.core.JUtils.tolower;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.DIST2;
import static smetana.core.Macro.ED_head_label;
import static smetana.core.Macro.ED_head_port;
import static smetana.core.Macro.ED_label;
import static smetana.core.Macro.ED_label_ontop;
+import static smetana.core.Macro.ED_tail_label;
import static smetana.core.Macro.ED_tail_port;
import static smetana.core.Macro.GD_bb;
import static smetana.core.Macro.GD_flags;
@@ -91,29 +91,25 @@ import static smetana.core.Macro.ND_shape;
import static smetana.core.Macro.ND_showboxes;
import static smetana.core.Macro.ND_width;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Agsym_s;
+import static smetana.core.Macro.fabs;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
import h.ST_Agsym_s;
+import h.ST_bezier;
import h.ST_boxf;
+import h.ST_fontinfo;
+import h.ST_nodequeue;
+import h.ST_pointf;
import h.ST_port;
-import h.boxf;
-import h.fontinfo;
-import h.nodequeue;
-import h.pointf;
-import h.port;
+import h.ST_splines;
+import h.ST_textlabel_t;
import h.shape_kind;
-import h.textlabel_t;
import smetana.core.CFunction;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class utils__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -373,14 +369,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -409,25 +405,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -451,16 +428,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -757,13 +734,13 @@ throw new UnsupportedOperationException();
//3 c7cptalfn8k75wyfirbnptnav
// nodequeue *new_queue(int sz)
-public static nodequeue new_queue(int sz) {
+public static ST_nodequeue new_queue(int sz) {
ENTERING("c7cptalfn8k75wyfirbnptnav","new_queue");
try {
- nodequeue q = (nodequeue)zmalloc(sizeof(nodequeue.class));
+ ST_nodequeue q = new ST_nodequeue();
if (sz <= 1)
sz = 2;
- final __ptr__ tmp__ = zmalloc(sizeof(Agnode_s.class, sz));
+ final ST_Agnode_s.ArrayOfStar tmp__ = new ST_Agnode_s.ArrayOfStar(sz);
q.setPtr("store", tmp__);
q.setPtr("tail", tmp__);
q.setPtr("head", tmp__);
@@ -779,10 +756,10 @@ LEAVING("c7cptalfn8k75wyfirbnptnav","new_queue");
//3 1uj5nmdvwmuklnpd3v5py547f
// void free_queue(nodequeue * q)
-public static void free_queue(nodequeue q) {
+public static void free_queue(ST_nodequeue q) {
ENTERING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
try {
- Memory.free(q.getPtr("store"));
+ Memory.free(q.store);
Memory.free(q);
} finally {
LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
@@ -794,13 +771,13 @@ LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
//3 20pwd6i141q3o25lfvrdqytot
// void enqueue(nodequeue * q, node_t * n)
-public static void enqueue(nodequeue q, Agnode_s n) {
+public static void enqueue(ST_nodequeue q, ST_Agnode_s n) {
ENTERING("20pwd6i141q3o25lfvrdqytot","enqueue");
try {
- q.getArrayOfPtr("tail").plus(0).setPtr(n);
- q.setPtr("tail", q.getPtr("tail").plus(1));
- if (q.getPtr("tail").comparePointer(q.getPtr("limit")) >= 0)
- q.setPtr("tail", q.getPtr("store"));
+ q.tail.plus(0).setPtr(n);
+ q.setPtr("tail", q.tail.plus(1));
+ if (q.tail.comparePointer(q.limit) >= 0)
+ q.setPtr("tail", q.store);
} finally {
LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue");
}
@@ -811,17 +788,17 @@ LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue");
//3 b612nmtf16au96ztbs8pike9r
// node_t *dequeue(nodequeue * q)
-public static Agnode_s dequeue(nodequeue q) {
+public static ST_Agnode_s dequeue(ST_nodequeue q) {
ENTERING("b612nmtf16au96ztbs8pike9r","dequeue");
try {
- Agnode_s n;
- if (EQ(q.getPtr("head"), q.getPtr("tail")))
+ ST_Agnode_s n;
+ if (EQ(q.head, q.tail))
n = null;
else {
- n = (Agnode_s) q.getArrayOfPtr("head").plus(0).getPtr();
- q.setPtr("head", q.getPtr("head").plus(1));
- if (q.getPtr("head").comparePointer(q.getPtr("limit")) >= 0)
- q.setPtr("head", q.getPtr("store"));
+ n = (ST_Agnode_s) q.head.get(0);
+ q.setPtr("head", q.head.plus(1));
+ if (q.head.comparePointer(q.limit) >= 0)
+ q.setPtr("head", q.store);
}
return n;
} finally {
@@ -834,7 +811,7 @@ LEAVING("b612nmtf16au96ztbs8pike9r","dequeue");
//3 6nydxv4f2m7jcfh8ljs0neu0x
// int late_int(void *obj, attrsym_t * attr, int def, int low)
-public static int late_int(__ptr__ obj, Agsym_s attr, int def, int low) {
+public static int late_int(__ptr__ obj, ST_Agsym_s attr, int def, int low) {
ENTERING("6nydxv4f2m7jcfh8ljs0neu0x","late_int");
try {
CString p;
@@ -859,7 +836,7 @@ LEAVING("6nydxv4f2m7jcfh8ljs0neu0x","late_int");
//3 d68314e4f20r79tt0cnmxugme
// double late_double(void *obj, attrsym_t * attr, double def, double low)
-public static double late_double(__ptr__ obj, Agsym_s attr, double def, double low) {
+public static double late_double(__ptr__ obj, ST_Agsym_s attr, double def, double low) {
ENTERING("d68314e4f20r79tt0cnmxugme","late_double");
try {
CString p;
@@ -902,7 +879,7 @@ throw new UnsupportedOperationException();
//3 83xm6yc9q5h1bzufhsnv0v2up
// char *late_string(void *obj, attrsym_t * attr, char *def)
-public static CString late_string(__ptr__ obj, Agsym_s attr, CString def) {
+public static CString late_string(__ptr__ obj, ST_Agsym_s attr, CString def) {
ENTERING("83xm6yc9q5h1bzufhsnv0v2up","late_string");
try {
if (N(attr) || N(obj))
@@ -918,7 +895,7 @@ LEAVING("83xm6yc9q5h1bzufhsnv0v2up","late_string");
//3 8oon4q1mrublaru177xfntqgd
// char *late_nnstring(void *obj, attrsym_t * attr, char *def)
-public static CString late_nnstring(__ptr__ obj, Agsym_s attr, CString def) {
+public static CString late_nnstring(__ptr__ obj, ST_Agsym_s attr, CString def) {
ENTERING("8oon4q1mrublaru177xfntqgd","late_nnstring");
try {
CString rv = late_string(obj, attr, def);
@@ -935,13 +912,18 @@ LEAVING("8oon4q1mrublaru177xfntqgd","late_nnstring");
//3 87ifze04q7qzigjj1fb9y9by2
// boolean late_bool(void *obj, attrsym_t * attr, int def)
-public static boolean late_bool(__ptr__ obj, Agsym_s attr, int def) {
+public static boolean late_bool(__ptr__ obj, ST_Agsym_s attr, int def) {
+ENTERING("87ifze04q7qzigjj1fb9y9by2","late_bool");
+try {
if (attr == null)
return def!=0;
UNSUPPORTED("a0kh1y5n8u59z0xo7mag3zmt6"); // return mapbool(agxget(obj, attr));
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
+} finally {
+LEAVING("87ifze04q7qzigjj1fb9y9by2","late_bool");
+}
}
@@ -949,7 +931,7 @@ throw new UnsupportedOperationException();
//3 aeq0acpkhfv3gd5jx8op4jf18
// node_t *UF_find(node_t * n)
-public static Agnode_s UF_find(Agnode_s n) {
+public static ST_Agnode_s UF_find(ST_Agnode_s n) {
ENTERING("aeq0acpkhfv3gd5jx8op4jf18","UF_find");
try {
while (ND_UF_parent(n)!=null && NEQ(ND_UF_parent(n), n)) {
@@ -968,7 +950,7 @@ LEAVING("aeq0acpkhfv3gd5jx8op4jf18","UF_find");
//3 9ldxwfr4vvijrvfcvs1hvdzrt
// node_t *UF_union(node_t * u, node_t * v)
-public static Agnode_s UF_union(Agnode_s u, Agnode_s v) {
+public static ST_Agnode_s UF_union(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("9ldxwfr4vvijrvfcvs1hvdzrt","UF_union");
try {
if (EQ(u, v))
@@ -1018,7 +1000,7 @@ throw new UnsupportedOperationException();
//3 22k0u1imxyw06k9rizqlfz153
// void UF_singleton(node_t * u)
-public static void UF_singleton(Agnode_s u) {
+public static void UF_singleton(ST_Agnode_s u) {
ENTERING("22k0u1imxyw06k9rizqlfz153","UF_singleton");
try {
ND_UF_size(u, 1);
@@ -1034,7 +1016,7 @@ LEAVING("22k0u1imxyw06k9rizqlfz153","UF_singleton");
//3 e0fn8xuzkdt0q8xoofl6j1txb
// void UF_setname(node_t * u, node_t * v)
-public static void UF_setname(Agnode_s u, Agnode_s v) {
+public static void UF_setname(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("e0fn8xuzkdt0q8xoofl6j1txb","UF_setname");
try {
assert(EQ(u, UF_find(u)));
@@ -1067,20 +1049,20 @@ throw new UnsupportedOperationException();
//3 6p0ey2c2ujk2o7h221p0b4xon
// pointf Bezier(pointf * V, int degree, double t, pointf * Left, pointf * Right)
-public static __struct__<pointf> Bezier(__array_of_struct__ V, int degree, double t, __ptr__ Left, __ptr__ Right) {
+public static ST_pointf Bezier(final ST_pointf.Array V, int degree, double t, __ptr__ Left, __ptr__ Right) {
// WARNING!! STRUCT
return Bezier_w_(V, degree, t, Left, Right).copy();
}
-private static __struct__<pointf> Bezier_w_(__array_of_struct__ V, int degree, double t, __ptr__ Left, __ptr__ Right) {
+private static ST_pointf Bezier_w_(final ST_pointf.Array V, int degree, double t, __ptr__ Left, __ptr__ Right) {
ENTERING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
try {
int i, j; /* Index variables */
- final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct_impl__.malloc(pointf.class, 5+1),
- __array_of_struct_impl__.malloc(pointf.class, 5+1),
- __array_of_struct_impl__.malloc(pointf.class, 5+1),
- __array_of_struct_impl__.malloc(pointf.class, 5+1),
- __array_of_struct_impl__.malloc(pointf.class, 5+1),
- __array_of_struct_impl__.malloc(pointf.class, 5+1) };
+ final ST_pointf.Array Vtemp[] = new ST_pointf.Array[] { new ST_pointf.Array( 5+1),
+ new ST_pointf.Array( 5+1),
+ new ST_pointf.Array( 5+1),
+ new ST_pointf.Array( 5+1),
+ new ST_pointf.Array( 5+1),
+ new ST_pointf.Array( 5+1) };
/* Copy control points */
for (j = 0; j <= degree; j++) {
Vtemp[0].plus(j).setStruct(V.plus(j).getStruct());
@@ -1089,9 +1071,9 @@ try {
for (i = 1; i <= degree; i++) {
for (j = 0; j <= degree - i; j++) {
Vtemp[i].plus(j).setDouble("x",
- (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("x") + t * Vtemp[i - 1].plus(j + 1).getDouble("x"));
+ (1.0 - t) * Vtemp[i - 1].get(j).x + t * Vtemp[i - 1].get(j + 1).x);
Vtemp[i].plus(j).setDouble("y",
- (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("y") + t * Vtemp[i - 1].plus(j + 1).getDouble("y"));
+ (1.0 - t) * Vtemp[i - 1].get(j).y + t * Vtemp[i - 1].get(j + 1).y);
}
}
if (Left != null)
@@ -1100,7 +1082,7 @@ try {
if (Right != null)
for (j = 0; j <= degree; j++)
Right.plus(j).setStruct(Vtemp[degree - j].plus(j).getStruct());
- return (Vtemp[degree].plus(0).getStruct());
+ return (ST_pointf) (Vtemp[degree].plus(0).getStruct());
} finally {
LEAVING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
}
@@ -1193,12 +1175,12 @@ throw new UnsupportedOperationException();
-//3 3xll2b0v9nthwvx9dafq49t8s
-// const char *safefile(const char *filename)
//static boolean onetime = (!(0));
//static char *pathlist = (void *)0;
//static int maxdirlen;
//static char** dirs;
+//3 3xll2b0v9nthwvx9dafq49t8s
+// const char *safefile(const char *filename)
public static CString safefile(CString filename) {
ENTERING("3xll2b0v9nthwvx9dafq49t8s","safefile");
try {
@@ -1273,53 +1255,61 @@ LEAVING("ehkvqh6bwf4jw3mj1w5p7a8m8","mapbool");
//3 37hgj44s94wf9bmz16he85pgq
// pointf dotneato_closest(splines * spl, pointf pt)
-public static Object dotneato_closest(Object... arg) {
-UNSUPPORTED("6xi9wmswic1fv76qsqa100zrg"); // pointf dotneato_closest(splines * spl, pointf pt)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7vg6345lno41yawbke5qjffjx"); // int i, j, k, besti, bestj;
-UNSUPPORTED("7tvhpuiv2bp57tuo5a1qrptwi"); // double bestdist2, d2, dlow2, dhigh2; /* squares of distances */
-UNSUPPORTED("52bzzd12n2awux2b59j2jqh8x"); // double low, high, t;
-UNSUPPORTED("1ciwu1ibmcvutr9d4mbq8jjp"); // pointf c[4], pt2;
-UNSUPPORTED("37thdceezsvepe7tlyfatrbcw"); // bezier bz;
-UNSUPPORTED("cv0cmfkdyov0ifz46uknfgwaa"); // besti = bestj = -1;
-UNSUPPORTED("988ajfgcb4de6sx2d5un10g4x"); // bestdist2 = 1e+38;
-UNSUPPORTED("4z4l1zu33m72iirxmuhdg36iw"); // for (i = 0; i < spl->size; i++) {
-UNSUPPORTED("ewoeh3d6otc2rgpaxuzwm38x7"); // bz = spl->list[i];
-UNSUPPORTED("bdak7kaqfdpo7zuzg9fm7b6sw"); // for (j = 0; j < bz.size; j++) {
-UNSUPPORTED("wdh4m8cw4why11o5q87r88zj"); // pointf b;
-UNSUPPORTED("3tf1mdorgslv29e6azr3rzonw"); // b.x = bz.list[j].x;
-UNSUPPORTED("dxmmss8xn49bbq09iskmvgo1a"); // b.y = bz.list[j].y;
-UNSUPPORTED("d0o8y6vs1vm9qcfq5oyn2zmb5"); // d2 = DIST2(b, pt);
-UNSUPPORTED("5x61wak384zfu9waxz4iib38j"); // if ((bestj == -1) || (d2 < bestdist2)) {
-UNSUPPORTED("cmhf0aasa4t5z81xkhjsih2h3"); // besti = i;
-UNSUPPORTED("en6tmpmufawtaviu8s9gbiir5"); // bestj = j;
-UNSUPPORTED("aqecj956cthm5r94jj461cz7"); // bestdist2 = d2;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4o4fen9osijkuva0tyij06dff"); // bz = spl->list[besti];
-UNSUPPORTED("cylnfbfm0pqu1um785gk5ox0m"); // /* Pick best Bezier. If bestj is the last point in the B-spline, decrement.
-UNSUPPORTED("84b6e5g3wx9iisglwjcp5lno1"); // * Then set j to be the first point in the corresponding Bezier by dividing
-UNSUPPORTED("57jzmu3ed1g4aa00hivvreb3c"); // * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc.
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("2oqk9suiq102615kp2p6u9pbc"); // if (bestj == bz.size-1)
-UNSUPPORTED("b8unnlnu1bnnhbs85vgllqltd"); // bestj--;
-UNSUPPORTED("34l7vean6sci8jd61jcga5t9j"); // j = 3*(bestj / 3);
-UNSUPPORTED("634ul430au56jfgnuq945ecev"); // for (k = 0; k < 4; k++) {
-UNSUPPORTED("emeum5x5u6s5wlj9pg5e18mge"); // c[k].x = bz.list[j + k].x;
-UNSUPPORTED("6fqdkdgvc0jr8pgud3rpf5blk"); // c[k].y = bz.list[j + k].y;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("13ldc3scyuiddbvqn7xeazovv"); // low = 0.0;
-UNSUPPORTED("5diyw4rai5ul7vmjhf654bvc0"); // high = 1.0;
-UNSUPPORTED("v90htrjkydw3zaf6t3apnl32"); // dlow2 = DIST2(c[0], pt);
-UNSUPPORTED("5fvcsu2wp47fo7crx2ob0h44u"); // dhigh2 = DIST2(c[3], pt);
-UNSUPPORTED("53kc41p479auwcycfsbhw8xix"); // do {
-UNSUPPORTED("14iyya2zn31kcyo2gqfx6u181"); // t = (low + high) / 2.0;
-UNSUPPORTED("5rti9akx01gql0rz4afihqg0q"); // pt2 = Bezier(c, 3, t, (void *)0, (void *)0);
-UNSUPPORTED("1mco76xn6x54y3tzfvzeptejl"); // if (fabs(dlow2 - dhigh2) < 1.0)
-UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
-UNSUPPORTED("aaurmb2ppl2kefmdaw9njymyt"); // if (fabs(high - low) < .00001)
-UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
+public static ST_pointf dotneato_closest(ST_splines spl, final ST_pointf pt) {
+ENTERING("37hgj44s94wf9bmz16he85pgq","dotneato_closest");
+try {
+ return (ST_pointf) dotneato_closest_ (spl, (ST_pointf) pt.copy()).copy();
+} finally {
+LEAVING("37hgj44s94wf9bmz16he85pgq","dotneato_closest");
+}
+}
+private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) {
+ int i, j, k, besti, bestj;
+ double bestdist2, d2, dlow2, dhigh2; /* squares of distances */
+ double low, high, t;
+ // final ST_pointf c[] = new ST_pointf[] {new ST_pointf(),new ST_pointf(),new ST_pointf(),new ST_pointf()};
+ final ST_pointf.Array c = new ST_pointf.Array( 4);
+ final ST_pointf pt2 = new ST_pointf();
+ final ST_bezier bz = new ST_bezier();
+ besti = bestj = -1;
+ bestdist2 = 1e+38;
+ for (i = 0; i < spl.size; i++) {
+ bz.____(spl.list.get(i));
+ for (j = 0; j < bz.size; j++) {
+ final ST_pointf b = new ST_pointf();
+ b.x = bz.list.get(j).x;
+ b.y = bz.list.get(j).y;
+ d2 = DIST2(b, pt);
+ if ((bestj == -1) || (d2 < bestdist2)) {
+ besti = i;
+ bestj = j;
+ bestdist2 = d2;
+ }
+ }
+ }
+ bz.____(spl.list.get(besti));
+ /* Pick best Bezier. If bestj is the last point in the B-spline, decrement.
+ * Then set j to be the first point in the corresponding Bezier by dividing
+ * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc.
+ */
+ if (bestj == bz.size-1)
+ bestj--;
+ j = 3*(bestj / 3);
+ for (k = 0; k < 4; k++) {
+ c.plus(k).setDouble("x", bz.list.get(j + k).x);
+ c.plus(k).setDouble("y", bz.list.get(j + k).y);
+ }
+ low = 0.0;
+ high = 1.0;
+ dlow2 = DIST2(c.get(0), pt);
+ dhigh2 = DIST2(c.get(3), pt);
+ do {
+ t = (low + high) / 2.0;
+ pt2.___(Bezier(c, 3, t, null, null));
+ if (fabs(dlow2 - dhigh2) < 1.0)
+ break;
+ if (fabs(high - low) < .00001)
+ break;
UNSUPPORTED("6apa9aoby9j8a0eanbfhy5mn2"); // if (dlow2 < dhigh2) {
UNSUPPORTED("6jttyuryfaxa193mme86dqf58"); // high = t;
UNSUPPORTED("6avwplrum9i9qi3g9wl6yvz04"); // dhigh2 = DIST2(pt2, pt);
@@ -1327,11 +1317,8 @@ UNSUPPORTED("7yhr8hn3r6wohafwxrt85b2j2"); // } else {
UNSUPPORTED("556vs5i22602clhs1p3htz7vk"); // low = t;
UNSUPPORTED("507tgq81szei2ge3miiak4b1v"); // dlow2 = DIST2(pt2, pt);
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("bisaeb1i484iutawysrspjmfw"); // } while (1);
-UNSUPPORTED("9v7upfp8kp93skdlnpaz055xv"); // return pt2;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ } while (true);
+ return pt2;
}
@@ -1450,10 +1437,10 @@ throw new UnsupportedOperationException();
//3 cr81drt18h5feqzxyh3jb0u49
// void common_init_node(node_t * n)
-public static void common_init_node(Agnode_s n) {
+public static void common_init_node(ST_Agnode_s n) {
ENTERING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
try {
- fontinfo fi = (fontinfo) Memory.malloc(fontinfo.class);
+ ST_fontinfo fi = new ST_fontinfo();
CString str;
ND_width(n,
late_double(n, Z.z().N_width, 0.75, 0.01));
@@ -1467,14 +1454,14 @@ try {
fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black")));
ND_label(n, make_label(n, str,
((aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)) | ( (shapeOf(n) == enumAsInt(shape_kind.class, "SH_RECORD")) ? (2 << 1) : (0 << 1))),
- fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
+ fi.fontsize, fi.fontname, fi.fontcolor));
if (Z.z().N_xlabel!=null && (str = agxget(n, Z.z().N_xlabel))!=null && (str.charAt(0)!='\0')) {
UNSUPPORTED("4ua9vld76wpovsm1celv2ff6e"); // ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor);
UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4);
}
ND_showboxes(n, late_int(n, Z.z().N_showboxes, 0, 0));
- ND_shape(n).getPtr("fns").call("initfn", n);
+ ND_shape(n).fns.initfn.exe(n);
} finally {
LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
}
@@ -1485,7 +1472,7 @@ LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
//3 d2v8l80y27ue2fag5c0qplah8
// static void initFontEdgeAttr(edge_t * e, struct fontinfo *fi)
-public static void initFontEdgeAttr(Agedge_s e, fontinfo fi) {
+public static void initFontEdgeAttr(ST_Agedge_s e, ST_fontinfo fi) {
ENTERING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
try {
fi.setDouble("fontsize", late_double(e, Z.z().E_fontsize, 14.0, 1.0));
@@ -1501,13 +1488,13 @@ LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
//3 ak3pxrdrq900wymudwnjmbito
// static void initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi, struct fontinfo *lfi)
-public static void initFontLabelEdgeAttr(Agedge_s e, fontinfo fi, fontinfo lfi) {
+public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) {
ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
try {
- if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi);
- lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0));
- lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.getCString("fontname")));
- lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.getCString("fontcolor")));
+ if (N(fi.fontname)) initFontEdgeAttr(e, fi);
+ lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.fontsize, 1.0));
+ lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.fontname));
+ lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor));
} finally {
LEAVING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
}
@@ -1518,7 +1505,7 @@ LEAVING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
//3 bgnk1zwht9rwx6thmly98iofb
// static boolean noClip(edge_t *e, attrsym_t* sym)
-public static boolean noClip(Agedge_s e, Agsym_s sym) {
+public static boolean noClip(ST_Agedge_s e, ST_Agsym_s sym) {
ENTERING("bgnk1zwht9rwx6thmly98iofb","noClip");
try {
CString str;
@@ -1539,11 +1526,11 @@ LEAVING("bgnk1zwht9rwx6thmly98iofb","noClip");
//3 9vnr1bc7p533acazoxbhbfmx3
// static port chkPort (port (*pf)(node_t*, char*, char*), node_t* n, char* s)
-public static ST_port chkPort(CFunction pf, Agnode_s n, CString s) {
+public static ST_port chkPort(CFunction pf, ST_Agnode_s n, CString s) {
// WARNING!! STRUCT
return chkPort_w_(pf, n, s).copy();
}
-private static ST_port chkPort_w_(CFunction pf, Agnode_s n, CString s) {
+private static ST_port chkPort_w_(CFunction pf, ST_Agnode_s n, CString s) {
ENTERING("9vnr1bc7p533acazoxbhbfmx3","chkPort");
try {
final ST_port pt = new ST_port();
@@ -1557,7 +1544,7 @@ UNSUPPORTED("971i954brvgqb35cftazlqhon"); // *cp = ':';
UNSUPPORTED("2o9oidtrr5gspl1dh6vnz7mlz"); // pt.name = cp+1;
}
else
- pt.___((__struct__<port>) pf.exe(n, s, null));
+ pt.___((ST_port) pf.exe(n, s, null));
pt.name = s;
return pt;
} finally {
@@ -1570,21 +1557,21 @@ LEAVING("9vnr1bc7p533acazoxbhbfmx3","chkPort");
//3 3aqh64lxwv4da2snfe7fvr45b
// int common_init_edge(edge_t * e)
-public static int common_init_edge(Agedge_s e) {
+public static int common_init_edge(ST_Agedge_s e) {
ENTERING("3aqh64lxwv4da2snfe7fvr45b","common_init_edge");
try {
CString str;
int r = 0;
- final __struct__<fontinfo> fi = JUtils.from(fontinfo.class);
- final __struct__<fontinfo> lfi = JUtils.from(fontinfo.class);
- Agraph_s sg = agraphof(agtail(e));
+ final ST_fontinfo fi = new ST_fontinfo();
+ final ST_fontinfo lfi = new ST_fontinfo();
+ ST_Agraph_s sg = agraphof(agtail(e));
fi.setPtr("fontname", null);
lfi.setPtr("fontname", null);
if (Z.z().E_label!=null && (str = agxget(e, Z.z().E_label))!=null && (str.charAt(0)!='\0')) {
r = 1;
- initFontEdgeAttr(e, fi.amp());
+ initFontEdgeAttr(e, fi);
ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
- fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
+ fi.fontsize, fi.fontname, fi.fontcolor));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 0));
ED_label_ontop(e,
mapbool(late_string(e, Z.z().E_label_float, new CString("false"))));
@@ -1598,17 +1585,16 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
}
/* vladimir */
if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
- initFontLabelEdgeAttr(e, fi.amp(), lfi.amp());
+ initFontLabelEdgeAttr(e, fi, lfi);
ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
- lfi.getDouble("fontsize"), lfi.getCString("fontname"), lfi.getCString("fontcolor")));
+ lfi.fontsize, lfi.fontname, lfi.fontcolor));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 1));
}
if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
-UNSUPPORTED("6y6e1y496y6j6a6065nfesr8o"); // if (!lfi.fontname)
-UNSUPPORTED("4w2bicw8rsgyy40x0vhyzzlnm"); // initFontLabelEdgeAttr(e, &fi, &lfi);
-UNSUPPORTED("ans0pi92t6ou5mworb3ohiqj3"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
-UNSUPPORTED("eu3ztkfva2x87y72tnu7vv4re"); // lfi.fontsize, lfi.fontname, lfi.fontcolor);
-UNSUPPORTED("50hobbhvpqr6dj302waqr59mu"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 2);
+ initFontLabelEdgeAttr(e, fi, lfi);
+ ED_tail_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
+ lfi.fontsize, lfi.fontname, lfi.fontcolor));
+ GD_has_labels(sg, GD_has_labels(sg) | (1 << 2));
}
/* end vladimir */
/* We still accept ports beginning with colons but this is deprecated
@@ -1621,7 +1607,7 @@ UNSUPPORTED("50hobbhvpqr6dj302waqr59mu"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
if (str!=null && str.charAt(0)!='\0')
UNSUPPORTED("j71lo2acx1ydov0uj7xjjce"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 3?(e):((e)+1))->node)))->data))->has_port) = (!(0));
- ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).getPtr("fns").getPtr("portfn"), agtail(e), str));
+ ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).fns.portfn, agtail(e), str));
if (noClip(e, Z.z().E_tailclip))
UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0;
str = agget(e, new CString("headport"));
@@ -1630,7 +1616,7 @@ UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))-
if (str!=null && str.charAt(0)!='\0')
UNSUPPORTED("542y57dbsosmjvsmdnzon2qb5"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 2?(e):((e)-1))->node)))->data))->has_port) = (!(0));
- ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).getPtr("fns").getPtr("portfn"), aghead(e), str));
+ ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).fns.portfn, aghead(e), str));
if (noClip(e, Z.z().E_headclip))
UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0;
@@ -1645,33 +1631,33 @@ LEAVING("3aqh64lxwv4da2snfe7fvr45b","common_init_edge");
//3 3mkqvtbyq9j8ktzil6t7vakg5
// static boxf addLabelBB(boxf bb, textlabel_t * lp, boolean flipxy)
-public static __struct__<boxf> addLabelBB(final ST_boxf bb, textlabel_t lp, boolean flipxy) {
+public static ST_boxf addLabelBB(final ST_boxf bb, ST_textlabel_t lp, boolean flipxy) {
// WARNING!! STRUCT
return addLabelBB_w_(bb.copy(), lp, flipxy).copy();
}
-private static __struct__<boxf> addLabelBB_w_(final ST_boxf bb, textlabel_t lp, boolean flipxy) {
+private static ST_boxf addLabelBB_w_(final ST_boxf bb, ST_textlabel_t lp, boolean flipxy) {
ENTERING("3mkqvtbyq9j8ktzil6t7vakg5","addLabelBB");
try {
double width, height;
- final __struct__<pointf> p = JUtils.from(pointf.class);
- p.___(lp.getStruct("pos"));
+ final ST_pointf p = new ST_pointf();
+ p.___(lp.pos);
double min, max;
if (flipxy) {
- height = lp.getStruct("dimen").getDouble("x");
- width = lp.getStruct("dimen").getDouble("y");
+ height = lp.dimen.x;
+ width = lp.dimen.y;
}
else {
- width = lp.getStruct("dimen").getDouble("x");
- height = lp.getStruct("dimen").getDouble("y");
+ width = lp.dimen.x;
+ height = lp.dimen.y;
}
- min = p.getDouble("x") - width / 2.;
- max = p.getDouble("x") + width / 2.;
+ min = p.x - width / 2.;
+ max = p.x + width / 2.;
if (min < bb.LL.x)
bb.LL.x = min;
if (max > bb.UR.x)
bb.UR.x = max;
- min = p.getDouble("y") - height / 2.;
- max = p.getDouble("y") + height / 2.;
+ min = p.y - height / 2.;
+ max = p.y + height / 2.;
if (min < bb.LL.y)
bb.LL.y = min;
if (max > bb.UR.y)
@@ -1713,7 +1699,7 @@ throw new UnsupportedOperationException();
//3 bz7kjecium6a7xa39qfobwwnc
// void updateBB(graph_t * g, textlabel_t * lp)
-public static void updateBB(Agraph_s g, textlabel_t lp) {
+public static void updateBB(ST_Agraph_s g, ST_textlabel_t lp) {
ENTERING("bz7kjecium6a7xa39qfobwwnc","updateBB");
try {
GD_bb(g).___(addLabelBB(GD_bb(g), lp, GD_flip(g)!=0));
@@ -2355,7 +2341,7 @@ throw new UnsupportedOperationException();
//3 9yungx7uxqkmzfh2ub6gs9l48
// char* htmlEntityUTF8 (char* s, graph_t* g)
-public static CString htmlEntityUTF8(CString s, Agraph_s g) {
+public static CString htmlEntityUTF8(CString s, ST_Agraph_s g) {
ENTERING("9yungx7uxqkmzfh2ub6gs9l48","htmlEntityUTF8");
try {
LOG2("htmlEntityUTF8 "+s);
@@ -2736,7 +2722,7 @@ LEAVING("ckavkcnz5rcrqs17lleds1uxu","edgeType");
//3 13cpqbf2ztcjdfz4a6v7nv00u
// void setEdgeType (graph_t* g, int dflt)
-public static void setEdgeType(Agraph_s g, int dflt) {
+public static void setEdgeType(ST_Agraph_s g, int dflt) {
ENTERING("13cpqbf2ztcjdfz4a6v7nv00u","setEdgeType");
try {
CString s = agget(g, new CString("splines"));
@@ -2934,7 +2920,7 @@ throw new UnsupportedOperationException();
//3 80q488y0eqojtsm7osnfydmo5
// void gv_nodesize(node_t * n, boolean flip)
-public static void gv_nodesize(Agnode_s n, int flip) {
+public static void gv_nodesize(ST_Agnode_s n, int flip) {
ENTERING("80q488y0eqojtsm7osnfydmo5","gv_nodesize");
try {
double w;
diff --git a/src/gen/lib/dotgen/acyclic__c.java b/src/gen/lib/dotgen/acyclic__c.java
index a661a10..1271f4c 100644
--- a/src/gen/lib/dotgen/acyclic__c.java
+++ b/src/gen/lib/dotgen/acyclic__c.java
@@ -59,13 +59,10 @@ import static smetana.core.Macro.ND_next;
import static smetana.core.Macro.ND_onstack;
import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_pointf;
public class acyclic__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -325,14 +322,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -361,25 +358,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -403,16 +381,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -709,10 +687,10 @@ throw new UnsupportedOperationException();
//3 9hm902ya6q6bq246ewuh67h38
// void reverse_edge(edge_t * e)
-public static void reverse_edge(Agedge_s e) {
+public static void reverse_edge(ST_Agedge_s e) {
ENTERING("9hm902ya6q6bq246ewuh67h38","reverse_edge");
try {
- Agedge_s f;
+ ST_Agedge_s f;
delete_fast_edge(e);
if ((f = find_fast_edge(aghead(e), agtail(e)))!=null)
merge_oneway(e, f);
@@ -728,17 +706,17 @@ LEAVING("9hm902ya6q6bq246ewuh67h38","reverse_edge");
//3 e9h7n52fs8rucrug9tr0zebe2
// static void dfs(node_t * n)
-public static void dfs(Agnode_s n) {
+public static void dfs(ST_Agnode_s n) {
ENTERING("e9h7n52fs8rucrug9tr0zebe2","dfs");
try {
int i;
- Agedge_s e;
- Agnode_s w;
+ ST_Agedge_s e;
+ ST_Agnode_s w;
if (ND_mark(n)!=0)
return;
ND_mark(n, 1);
ND_onstack(n, 1);
- for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
w = aghead(e);
if (ND_onstack(w)) {
reverse_edge(e);
@@ -759,11 +737,11 @@ LEAVING("e9h7n52fs8rucrug9tr0zebe2","dfs");
//3 1ejgnwd7ek344caegjwg46n6h
// void acyclic(graph_t * g)
-public static void acyclic_(Agraph_s g) {
+public static void acyclic_(ST_Agraph_s g) {
ENTERING("1ejgnwd7ek344caegjwg46n6h","acyclic");
try {
int c;
- Agnode_s n;
+ ST_Agnode_s n;
for (c = 0; c < GD_comp(g).size; c++) {
GD_nlist(g, GD_comp(g).getFromList(c));
for (n = GD_nlist(g); n!=null; n = ND_next(n))
diff --git a/src/gen/lib/dotgen/aspect__c.java b/src/gen/lib/dotgen/aspect__c.java
index cf6b5e4..5eeca97 100644
--- a/src/gen/lib/dotgen/aspect__c.java
+++ b/src/gen/lib/dotgen/aspect__c.java
@@ -49,13 +49,10 @@ import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.aspect_t;
-import h.boxf;
-import h.pointf;
+import h.ST_Agraph_s;
+import h.ST_aspect_t;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
public class aspect__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -315,14 +312,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -351,25 +348,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -393,16 +371,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -1234,7 +1212,7 @@ throw new UnsupportedOperationException();
//3 5srsfxqlego6qiyj5mm8m4ql2
// aspect_t* setAspect (Agraph_t * g, aspect_t* adata)
-public static aspect_t setAspect(Agraph_s g, aspect_t adata) {
+public static ST_aspect_t setAspect(ST_Agraph_s g, ST_aspect_t adata) {
ENTERING("5srsfxqlego6qiyj5mm8m4ql2","setAspect");
try {
double rv;
diff --git a/src/gen/lib/dotgen/class1__c.java b/src/gen/lib/dotgen/class1__c.java
index fad352f..8f61976 100644
--- a/src/gen/lib/dotgen/class1__c.java
+++ b/src/gen/lib/dotgen/class1__c.java
@@ -71,15 +71,12 @@ import static smetana.core.Macro.ND_clust;
import static smetana.core.Macro.ND_node_type;
import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Z;
-import smetana.core.__struct__;
public class class1__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -339,14 +336,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -375,25 +372,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -417,16 +395,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -723,7 +701,7 @@ throw new UnsupportedOperationException();
//3 2luyof8ca7ewf9r08z3os3lk7
// int nonconstraint_edge(edge_t * e)
-public static boolean nonconstraint_edge(Agedge_s e) {
+public static boolean nonconstraint_edge(ST_Agedge_s e) {
ENTERING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
try {
CString constr;
@@ -742,12 +720,12 @@ LEAVING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
//3 dpimuv55sylui7jx8fh3ic1qc
// static void interclust1(graph_t * g, node_t * t, node_t * h, edge_t * e)
-public static void interclust1(Agraph_s g, Agnode_s t, Agnode_s h, Agedge_s e) {
+public static void interclust1(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, ST_Agedge_s e) {
ENTERING("dpimuv55sylui7jx8fh3ic1qc","interclust1");
try {
- Agnode_s v, t0, h0;
+ ST_Agnode_s v, t0, h0;
int offset, t_len, h_len, t_rank, h_rank;
- Agedge_s rt, rh;
+ ST_Agedge_s rt, rh;
if (ND_clust(agtail(e))!=null)
t_rank = ND_rank(agtail(e)) - ND_rank(GD_leader(ND_clust(agtail(e))));
else
@@ -782,11 +760,11 @@ LEAVING("dpimuv55sylui7jx8fh3ic1qc","interclust1");
//3 acy5ct6402jgf0ga5oeeskx5m
// void class1(graph_t * g)
-public static void class1_(Agraph_s g) {
+public static void class1_(ST_Agraph_s g) {
ENTERING("acy5ct6402jgf0ga5oeeskx5m","class1");
try {
- Agnode_s n, t, h;
- Agedge_s e, rep;
+ ST_Agnode_s n, t, h;
+ ST_Agedge_s e, rep;
mark_clusters(g);
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
diff --git a/src/gen/lib/dotgen/class2__c.java b/src/gen/lib/dotgen/class2__c.java
index 843107d..daf2526 100644
--- a/src/gen/lib/dotgen/class2__c.java
+++ b/src/gen/lib/dotgen/class2__c.java
@@ -69,7 +69,6 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
-import static smetana.core.Macro.ALLOC_empty;
import static smetana.core.Macro.ED_conc_opp_flag;
import static smetana.core.Macro.ED_count;
import static smetana.core.Macro.ED_edge_type;
@@ -99,14 +98,11 @@ import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.ND_weight_class;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_pointf;
import smetana.core.Z;
-import smetana.core.__struct__;
public class class2__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -366,14 +362,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -402,27 +398,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
-
//3 1n5xl70wxuabyf97mclvilsm6
@@ -444,16 +419,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -750,22 +725,22 @@ throw new UnsupportedOperationException();
//3 2zn7c6ulmwwzaibdxo127jf04
// static node_t* label_vnode(graph_t * g, edge_t * orig)
-public static Agnode_s label_vnode(Agraph_s g, Agedge_s orig) {
+public static ST_Agnode_s label_vnode(ST_Agraph_s g, ST_Agedge_s orig) {
ENTERING("2zn7c6ulmwwzaibdxo127jf04","label_vnode");
try {
- Agnode_s v;
- final __struct__<pointf> dimen = JUtils.from(pointf.class);
- dimen.___(ED_label(orig).getStruct("dimen"));
+ ST_Agnode_s v;
+ final ST_pointf dimen = new ST_pointf();
+ dimen.___(ED_label(orig).dimen);
v = virtual_node(g);
ND_label(v, ED_label(orig));
ND_lw(v, GD_nodesep(agroot(v)));
if (N(ED_label_ontop(orig))) {
if (GD_flip(agroot(g))!=0) {
- ND_ht(v, dimen.getDouble("x"));
- ND_rw(v, dimen.getDouble("y"));
+ ND_ht(v, dimen.x);
+ ND_rw(v, dimen.y);
} else {
- ND_ht(v, dimen.getDouble("y"));
- ND_rw(v, dimen.getDouble("x"));
+ ND_ht(v, dimen.y);
+ ND_rw(v, dimen.x);
}
}
return v;
@@ -779,7 +754,7 @@ LEAVING("2zn7c6ulmwwzaibdxo127jf04","label_vnode");
//3 49tji49jdm9uges7v8lf2j2rn
// static void incr_width(graph_t * g, node_t * v)
-public static void incr_width(Agraph_s g, Agnode_s v) {
+public static void incr_width(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("49tji49jdm9uges7v8lf2j2rn","incr_width");
try {
int width = GD_nodesep(g) / 2;
@@ -795,10 +770,10 @@ LEAVING("49tji49jdm9uges7v8lf2j2rn","incr_width");
//3 xujihq6vep3ez275shtrbilo
// static node_t* plain_vnode(graph_t * g, edge_t * orig)
-public static Agnode_s plain_vnode(Agraph_s g, Agedge_s orig) {
+public static ST_Agnode_s plain_vnode(ST_Agraph_s g, ST_Agedge_s orig) {
ENTERING("xujihq6vep3ez275shtrbilo","plain_vnode");
try {
- Agnode_s v;
+ ST_Agnode_s v;
orig = orig;
v = virtual_node(g);
incr_width(g, v);
@@ -813,17 +788,17 @@ LEAVING("xujihq6vep3ez275shtrbilo","plain_vnode");
//3 9fmfj1b2jik7skv6ms0657t8r
// static node_t* leader_of(graph_t * g, node_t * v)
-public static Agnode_s leader_of(Agraph_s g, Agnode_s v) {
+public static ST_Agnode_s leader_of(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("9fmfj1b2jik7skv6ms0657t8r","leader_of");
try {
- Agraph_s clust;
- Agnode_s rv;
+ ST_Agraph_s clust;
+ ST_Agnode_s rv;
if (ND_ranktype(v) != 7) {
/*assert(v == UF_find(v)); could be leaf, so comment out */
rv = UF_find(v);
} else {
clust = ND_clust(v);
- rv = (Agnode_s) GD_rankleader(clust).plus(ND_rank(v)).getPtr();
+ rv = (ST_Agnode_s) GD_rankleader(clust).plus(ND_rank(v)).getPtr();
}
return rv;
} finally {
@@ -836,12 +811,12 @@ LEAVING("9fmfj1b2jik7skv6ms0657t8r","leader_of");
//3 6sbvlvurvkodunw2qt1ug70c2
// static void make_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig)
-public static void make_chain(Agraph_s g, Agnode_s from, Agnode_s to, Agedge_s orig) {
+public static void make_chain(ST_Agraph_s g, ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig) {
ENTERING("6sbvlvurvkodunw2qt1ug70c2","make_chain");
try {
int r, label_rank;
- Agnode_s u, v=null;
- Agedge_s e;
+ ST_Agnode_s u, v=null;
+ ST_Agedge_s e;
u = from;
if (ED_label(orig)!=null)
label_rank = (ND_rank(from) + ND_rank(to)) / 2;
@@ -872,15 +847,15 @@ LEAVING("6sbvlvurvkodunw2qt1ug70c2","make_chain");
//3 659ld5tcseo3l0hopxb3pf0vv
// static void interclrep(graph_t * g, edge_t * e)
-public static void interclrep(Agraph_s g, Agedge_s e) {
+public static void interclrep(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("659ld5tcseo3l0hopxb3pf0vv","interclrep");
try {
- Agnode_s t, h;
- Agedge_s ve;
+ ST_Agnode_s t, h;
+ ST_Agedge_s ve;
t = leader_of(g, agtail(e));
h = leader_of(g, aghead(e));
if (ND_rank(t) > ND_rank(h)) {
- Agnode_s t0 = t;
+ ST_Agnode_s t0 = t;
t = h;
h = t0;
}
@@ -894,7 +869,7 @@ try {
make_chain(g, t, h, e);
/* mark as cluster edge */
for (ve = ED_to_virt(e); ve!=null && (ND_rank(aghead(ve)) <= ND_rank(h));
- ve = (Agedge_s) ND_out(aghead(ve)).getFromList(0))
+ ve = (ST_Agedge_s) ND_out(aghead(ve)).getFromList(0))
ED_edge_type(ve, 5);
}
/* else ignore intra-cluster edges at this point */
@@ -908,7 +883,7 @@ LEAVING("659ld5tcseo3l0hopxb3pf0vv","interclrep");
//3 c0cx00ki1i1kx0bp84e7xjg8d
// static int is_cluster_edge(edge_t * e)
-public static boolean is_cluster_edge(Agedge_s e) {
+public static boolean is_cluster_edge(ST_Agedge_s e) {
ENTERING("c0cx00ki1i1kx0bp84e7xjg8d","is_cluster_edge");
try {
return ((ND_ranktype(agtail(e)) == 7)
@@ -923,10 +898,10 @@ LEAVING("c0cx00ki1i1kx0bp84e7xjg8d","is_cluster_edge");
//3 c45973dtaighb3u0auuekcs1y
// void merge_chain(graph_t * g, edge_t * e, edge_t * f, int flag)
-public static void merge_chain(Agraph_s g, Agedge_s e, Agedge_s f, boolean flag) {
+public static void merge_chain(ST_Agraph_s g, ST_Agedge_s e, ST_Agedge_s f, boolean flag) {
ENTERING("c45973dtaighb3u0auuekcs1y","merge_chain");
try {
- Agedge_s rep;
+ ST_Agedge_s rep;
int lastrank = MAX(ND_rank(agtail(e)), ND_rank(aghead(e)));
//assert(ED_to_virt(e) == NULL);
ED_to_virt(e, f);
@@ -940,7 +915,7 @@ try {
if (ND_rank(aghead(rep)) == lastrank)
break;
incr_width(g, aghead(rep));
- rep = (Agedge_s) ND_out(aghead(rep)).getFromList(0);
+ rep = (ST_Agedge_s) ND_out(aghead(rep)).getFromList(0);
} while (rep!=null);
} finally {
LEAVING("c45973dtaighb3u0auuekcs1y","merge_chain");
@@ -952,7 +927,7 @@ LEAVING("c45973dtaighb3u0auuekcs1y","merge_chain");
//3 bg5r9wlego0d8pv0hr96zt45c
// int mergeable(edge_t * e, edge_t * f)
-public static boolean mergeable(Agedge_s e, Agedge_s f) {
+public static boolean mergeable(ST_Agedge_s e, ST_Agedge_s f) {
ENTERING("bg5r9wlego0d8pv0hr96zt45c","mergeable");
try {
if (e!=null && f!=null && EQ(agtail(e), agtail(f)) && EQ(aghead(e), aghead(f)) &&
@@ -969,17 +944,17 @@ LEAVING("bg5r9wlego0d8pv0hr96zt45c","mergeable");
//3 d0bxlkysxucmww7t74u9krrgz
// void class2(graph_t * g)
-public static void class2(Agraph_s g) {
+public static void class2(ST_Agraph_s g) {
ENTERING("d0bxlkysxucmww7t74u9krrgz","class2");
try {
int c;
- Agnode_s n, t, h;
- Agedge_s e, prev, opp;
+ ST_Agnode_s n, t, h;
+ ST_Agedge_s e, prev, opp;
GD_nlist(g, null);
GD_n_nodes(g, 0); /* new */
mark_clusters(g);
for (c = 1; c <= GD_n_cluster(g); c++)
- build_skeleton(g, (Agraph_s) GD_clust(g).plus(c).getPtr());
+ build_skeleton(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr());
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
if (ND_weight_class(aghead(e)) <= 2)
@@ -1088,7 +1063,7 @@ try {
}
/* since decompose() is not called on subgraphs */
if (NEQ(g, dot_root(g))) {
- GD_comp(g).reallocEmpty(1, Agnode_s.class);
+ GD_comp(g).reallocEmpty(1);
GD_comp(g).setInList(0, GD_nlist(g));
}
} finally {
diff --git a/src/gen/lib/dotgen/cluster__c.java b/src/gen/lib/dotgen/cluster__c.java
index 9befefa..a093d71 100644
--- a/src/gen/lib/dotgen/cluster__c.java
+++ b/src/gen/lib/dotgen/cluster__c.java
@@ -54,7 +54,6 @@ import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agcontains;
import static gen.lib.cgraph.obj__c.agroot;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.utils__c.UF_setname;
import static gen.lib.common.utils__c.UF_singleton;
import static gen.lib.dotgen.class2__c.class2;
@@ -77,7 +76,6 @@ import static gen.lib.dotgen.mincross__c.install_in_rank;
import static gen.lib.dotgen.position__c.ports_eq;
import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.NEQ;
-import static smetana.core.JUtils.sizeof_starstar_empty;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGMKOUT;
@@ -109,15 +107,12 @@ import static smetana.core.Macro.ND_ranktype;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.nodequeue;
-import h.pointf;
-import smetana.core.JUtils;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_nodequeue;
+import h.ST_pointf;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class cluster__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -377,14 +372,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -413,26 +408,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -455,16 +430,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -761,14 +736,14 @@ throw new UnsupportedOperationException();
//3 8bd317q0mykfu6wpr3e4cxmh2
// static node_t* map_interclust_node(node_t * n)
-public static Agnode_s map_interclust_node(Agnode_s n) {
+public static ST_Agnode_s map_interclust_node(ST_Agnode_s n) {
ENTERING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
try {
- Agnode_s rv;
+ ST_Agnode_s rv;
if ((ND_clust(n) == null) || ( GD_expanded(ND_clust(n))) )
rv = n;
else
- rv = (Agnode_s) GD_rankleader(ND_clust(n)).plus(ND_rank(n)).getPtr();
+ rv = (ST_Agnode_s) GD_rankleader(ND_clust(n)).plus(ND_rank(n)).getPtr();
return rv;
} finally {
LEAVING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
@@ -780,32 +755,32 @@ LEAVING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
//3 5ib4nnt2ah5fdd22zs0xds29r
// static void make_slots(graph_t * root, int r, int pos, int d)
-public static void make_slots(Agraph_s root, int r, int pos, int d) {
+public static void make_slots(ST_Agraph_s root, int r, int pos, int d) {
ENTERING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
try {
int i;
- Agnode_s v;
- __ptr__ vlist;
- vlist = GD_rank(root).plus(r).getPtr().getArrayOfPtr("v").asPtr();
+ ST_Agnode_s v;
+ ST_Agnode_s.ArrayOfStar vlist;
+ vlist = GD_rank(root).get(r).v;
if (d <= 0) {
- for (i = pos - d + 1; i < GD_rank(root).plus(r).getInt("n"); i++) {
- v = (Agnode_s) vlist.plus(i).getPtr();
+ for (i = pos - d + 1; i < GD_rank(root).get(r).n; i++) {
+ v = (ST_Agnode_s) vlist.get(i);
ND_order(v, i + d - 1);
vlist.plus(ND_order(v)).setPtr(v);
}
- for (i = GD_rank(root).plus(r).getInt("n") + d - 1; i < GD_rank(root).plus(r).getInt("n"); i++)
+ for (i = GD_rank(root).get(r).n + d - 1; i < GD_rank(root).get(r).n; i++)
vlist.plus(i).setPtr(null);
} else {
/*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/
- for (i = GD_rank(root).plus(r).getPtr().getInt("n") - 1; i > pos; i--) {
- v = (Agnode_s) vlist.plus(i).getPtr();
+ for (i = GD_rank(root).get(r).n - 1; i > pos; i--) {
+ v = (ST_Agnode_s) vlist.get(i);
ND_order(v, i + d - 1);
vlist.plus(ND_order(v)).setPtr(v);
}
for (i = pos + 1; i < pos + d; i++)
vlist.plus(i).setPtr(null);
}
- GD_rank(root).plus(r).getPtr().setInt("n", GD_rank(root).plus(r).getPtr().getInt("n") + d - 1);
+ GD_rank(root).get(r).setInt("n", GD_rank(root).get(r).n + d - 1);
} finally {
LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
}
@@ -816,10 +791,10 @@ LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
//3 d4mwxesl56uh9dyttg9cjlq70
// static node_t* clone_vn(graph_t * g, node_t * vn)
-public static Agnode_s clone_vn(Agraph_s g, Agnode_s vn) {
+public static ST_Agnode_s clone_vn(ST_Agraph_s g, ST_Agnode_s vn) {
ENTERING("d4mwxesl56uh9dyttg9cjlq70","clone_vn");
try {
- Agnode_s rv;
+ ST_Agnode_s rv;
int r;
r = ND_rank(vn);
make_slots(g, r, ND_order(vn), 2);
@@ -842,12 +817,12 @@ LEAVING("d4mwxesl56uh9dyttg9cjlq70","clone_vn");
//3 6o86r59v2ujlxqcw7761y6o5b
// static void map_path(node_t * from, node_t * to, edge_t * orig, edge_t * ve, int type)
-public static void map_path(Agnode_s from, Agnode_s to, Agedge_s orig, Agedge_s ve, int type) {
+public static void map_path(ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig, ST_Agedge_s ve, int type) {
ENTERING("6o86r59v2ujlxqcw7761y6o5b","map_path");
try {
int r;
- Agnode_s u, v;
- Agedge_s e;
+ ST_Agnode_s u, v;
+ ST_Agedge_s e;
assert(ND_rank(from) < ND_rank(to));
if (EQ(agtail(ve), from) && EQ(aghead(ve), to))
return;
@@ -872,7 +847,7 @@ try {
ED_edge_type(e, type);
u = v;
ED_count(ve, ED_count(ve) - 1);
- ve = (Agedge_s) ND_out(aghead(ve)).getFromList(0);
+ ve = (ST_Agedge_s) ND_out(aghead(ve)).getFromList(0);
}
} else {
if (ND_rank(to) - ND_rank(from) == 1) {
@@ -900,7 +875,7 @@ try {
} else
e = ve;
while (ND_rank(aghead(e)) != ND_rank(to))
- e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
+ e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
if (NEQ(aghead(e), to)) {
ve = e;
e = virtual_edge(agtail(e), to, orig);
@@ -919,11 +894,11 @@ LEAVING("6o86r59v2ujlxqcw7761y6o5b","map_path");
//3 69xbflgja0gvrsl5xcv7o7dia
// static void make_interclust_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig)
-public static void make_interclust_chain(Agraph_s g, Agnode_s from, Agnode_s to, Agedge_s orig) {
+public static void make_interclust_chain(ST_Agraph_s g, ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig) {
ENTERING("69xbflgja0gvrsl5xcv7o7dia","make_interclust_chain");
try {
int newtype;
- Agnode_s u, v;
+ ST_Agnode_s u, v;
u = map_interclust_node(from);
v = map_interclust_node(to);
if (EQ(u, from) && EQ(v, to))
@@ -941,12 +916,12 @@ LEAVING("69xbflgja0gvrsl5xcv7o7dia","make_interclust_chain");
//3 6g2m2y44x66lajznvnon2gubv
// void interclexp(graph_t * subg)
-public static void interclexp(Agraph_s subg) {
+public static void interclexp(ST_Agraph_s subg) {
ENTERING("6g2m2y44x66lajznvnon2gubv","interclexp");
try {
- Agraph_s g;
- Agnode_s n;
- Agedge_s e, prev, next;
+ ST_Agraph_s g;
+ ST_Agnode_s n;
+ ST_Agedge_s e, prev, next;
g = dot_root(subg);
for (n = agfstnode(subg); n!=null; n = agnxtnode(subg, n)) {
/* N.B. n may be in a sub-cluster of subg */
@@ -971,7 +946,7 @@ UNSUPPORTED("6hyelvzskqfqa07xtgjtvg2is"); // continue;
}
/* flat edges */
if (ND_rank(agtail(e)) == ND_rank(aghead(e))) {
- Agedge_s fe;
+ ST_Agedge_s fe;
if ((fe = find_flat_edge(agtail(e), aghead(e))) == null) {
flat_edge(g, e);
prev = e;
@@ -1009,22 +984,22 @@ LEAVING("6g2m2y44x66lajznvnon2gubv","interclexp");
//3 85nhs7tnmwunw0fsjj1kxao7l
// static void merge_ranks(graph_t * subg)
-public static void merge_ranks(Agraph_s subg) {
+public static void merge_ranks(ST_Agraph_s subg) {
ENTERING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
try {
int i, d, r, pos, ipos;
- Agnode_s v;
- Agraph_s root;
+ ST_Agnode_s v;
+ ST_Agraph_s root;
root = dot_root(subg);
if (GD_minrank(subg) > 0)
GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0);
for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
- d = GD_rank(subg).plus(r).getPtr().getInt("n");
- ipos = pos = ND_order(GD_rankleader(subg).plus(r).getPtr());
+ d = GD_rank(subg).get(r).n;
+ ipos = pos = ND_order(GD_rankleader(subg).get(r));
make_slots(root, r, pos, d);
- for (i = 0; i < GD_rank(subg).plus(r).getPtr().getInt("n"); i++) {
- v = (Agnode_s) GD_rank(subg).plus(r).getArrayOfPtr("v").plus(i).getPtr();
- GD_rank(root).plus(r).getArrayOfPtr("v").plus(pos).setPtr(v);
+ for (i = 0; i < GD_rank(subg).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(subg).get(r).v.get(i);
+ GD_rank(root).get(r).v.plus(pos).setPtr(v);
ND_order(v, pos++);
/* real nodes automatically have v->root = root graph */
if (ND_node_type(v) == 1)
@@ -1033,11 +1008,11 @@ try {
fast_node(root, v);
GD_n_nodes(root, GD_n_nodes(root)+1);
}
- GD_rank(subg).plus(r).getPtr().setPtr("v", GD_rank(root).plus(r).getPtr().getPtr("v").plus(ipos));
- GD_rank(root).plus(r).getPtr().setInt("valid", 0);
+ GD_rank(subg).get(r).setPtr("v", GD_rank(root).get(r).v.plus(ipos));
+ GD_rank(root).get(r).setInt("valid", 0);
}
if (r < GD_maxrank(root))
- GD_rank(root).plus(r).getPtr().setInt("valid", 0);
+ GD_rank(root).get(r).setInt("valid", 0);
GD_expanded(subg, NOT(false));
} finally {
LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
@@ -1049,18 +1024,18 @@ LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
//3 c9p7dm16i13qktnh95os0sv58
// static void remove_rankleaders(graph_t * g)
-public static void remove_rankleaders(Agraph_s g) {
+public static void remove_rankleaders(ST_Agraph_s g) {
ENTERING("c9p7dm16i13qktnh95os0sv58","remove_rankleaders");
try {
int r;
- Agnode_s v;
- Agedge_s e;
+ ST_Agnode_s v;
+ ST_Agedge_s e;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- v = (Agnode_s) GD_rankleader(g).plus(r).getPtr();
+ v = (ST_Agnode_s) GD_rankleader(g).get(r);
/* remove the entire chain */
- while ((e = (Agedge_s) ND_out(v).getFromList(0))!=null)
+ while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null)
delete_fast_edge(e);
- while ((e = (Agedge_s) ND_in(v).getFromList(0))!=null)
+ while ((e = (ST_Agedge_s) ND_in(v).getFromList(0))!=null)
delete_fast_edge(e);
delete_fast_node(dot_root(g), v);
GD_rankleader(g).plus(r).setPtr(null);
@@ -1075,13 +1050,13 @@ LEAVING("c9p7dm16i13qktnh95os0sv58","remove_rankleaders");
//3 ecrplg8hsyl484f9kxc5xp0go
// void expand_cluster(graph_t * subg)
-public static void expand_cluster(Agraph_s subg) {
+public static void expand_cluster(ST_Agraph_s subg) {
ENTERING("ecrplg8hsyl484f9kxc5xp0go","expand_cluster");
try {
/* build internal structure of the cluster */
class2(subg);
GD_comp(subg).size = 1;
- // GD_comp(subg).getArrayOfPtr("list").plus(0).setPtr(GD_nlist(subg));
+ // GD_comp(subg).list.plus(0).setPtr(GD_nlist(subg));
GD_comp(subg).setInList(0, GD_nlist(subg));
allocate_ranks(subg);
build_ranks(subg, 0);
@@ -1099,13 +1074,13 @@ LEAVING("ecrplg8hsyl484f9kxc5xp0go","expand_cluster");
//3 cxuirggihlap2iv2khmb1w5l5
// void mark_clusters(graph_t * g)
-public static void mark_clusters(Agraph_s g) {
+public static void mark_clusters(ST_Agraph_s g) {
ENTERING("cxuirggihlap2iv2khmb1w5l5","mark_clusters");
try {
int c;
- Agnode_s n, nn=null, vn;
- Agedge_s orig, e;
- Agraph_s clust;
+ ST_Agnode_s n, nn=null, vn;
+ ST_Agedge_s orig, e;
+ ST_Agraph_s clust;
/* remove sub-clusters below this level */
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
if (ND_ranktype(n) == 7)
@@ -1113,7 +1088,7 @@ try {
ND_clust(n, null);
}
for (c = 1; c <= GD_n_cluster(g); c++) {
- clust = (Agraph_s) GD_clust(g).plus(c).getPtr();
+ clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
for (n = agfstnode(clust); n!=null; n = nn) {
nn = agnxtnode(clust,n);
if (ND_ranktype(n) != 0) {
@@ -1132,7 +1107,7 @@ UNSUPPORTED("6hyelvzskqfqa07xtgjtvg2is"); // continue;
if ((e = ED_to_virt(orig))!=null) {
while (e!=null && ND_node_type(vn =aghead(e)) == 1) {
ND_clust(vn, clust);
- e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
+ e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
/* trouble if concentrators and clusters are mixed */
}
}
@@ -1149,14 +1124,15 @@ LEAVING("cxuirggihlap2iv2khmb1w5l5","mark_clusters");
//3 bwrw5u0gi2rgah1cn9h0glpse
// void build_skeleton(graph_t * g, graph_t * subg)
-public static void build_skeleton(Agraph_s g, Agraph_s subg) {
+public static void build_skeleton(ST_Agraph_s g, ST_Agraph_s subg) {
ENTERING("bwrw5u0gi2rgah1cn9h0glpse","build_skeleton");
try {
int r;
- Agnode_s v, prev, rl;
- Agedge_s e;
+ ST_Agnode_s v, prev, rl;
+ ST_Agedge_s e;
prev = null;
- GD_rankleader(subg, zmalloc(sizeof_starstar_empty(Agnode_s.class, GD_maxrank(subg) + 2)));
+ // GD_rankleader(subg, zmalloc(sizeof_starstar_empty(Agnode_s.class, GD_maxrank(subg) + 2)));
+ GD_rankleader(subg, new ST_Agnode_s.Array(GD_maxrank(subg) + 2));
for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
v = virtual_node(g);
GD_rankleader(subg).plus(r).setPtr(v);
@@ -1171,7 +1147,7 @@ try {
}
/* set the counts on virtual edges of the cluster skeleton */
for (v = agfstnode(subg); v!=null; v = agnxtnode(subg, v)) {
- rl = (Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
+ rl = (ST_Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
ND_UF_size(rl, ND_UF_size(rl)+1);
for (e = agfstout(subg, v); e!=null; e = agnxtout(subg, e)) {
for (r = ND_rank(agtail(e)); r < ND_rank(aghead(e)); r++) {
@@ -1180,7 +1156,7 @@ try {
}
}
for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
- rl = (Agnode_s) GD_rankleader(subg).plus(r).getPtr();
+ rl = (ST_Agnode_s) GD_rankleader(subg).get(r);
if (ND_UF_size(rl) > 1)
ND_UF_size(rl, ND_UF_size(rl)-1);
}
@@ -1194,17 +1170,17 @@ LEAVING("bwrw5u0gi2rgah1cn9h0glpse","build_skeleton");
//3 75yt3xwcwnxipi827t1r8zcmn
// void install_cluster(graph_t * g, node_t * n, int pass, nodequeue * q)
-public static void install_cluster(Agraph_s g, Agnode_s n, int pass, nodequeue q) {
+public static void install_cluster(ST_Agraph_s g, ST_Agnode_s n, int pass, ST_nodequeue q) {
ENTERING("75yt3xwcwnxipi827t1r8zcmn","install_cluster");
try {
int r;
- Agraph_s clust;
+ ST_Agraph_s clust;
clust = ND_clust(n);
if (GD_installed(clust) != pass + 1) {
for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
- install_in_rank(g, (Agnode_s) GD_rankleader(clust).plus(r).getPtr());
+ install_in_rank(g, (ST_Agnode_s) GD_rankleader(clust).get(r));
for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
- enqueue_neighbors(q, (Agnode_s) GD_rankleader(clust).plus(r).getPtr(), pass);
+ enqueue_neighbors(q, (ST_Agnode_s) GD_rankleader(clust).get(r), pass);
GD_installed(clust, pass + 1);
}
} finally {
@@ -1217,11 +1193,11 @@ LEAVING("75yt3xwcwnxipi827t1r8zcmn","install_cluster");
//3 4muksvb3ec03mt6cvaqpb5c7a
// void mark_lowclusters(Agraph_t * root)
-public static void mark_lowclusters(Agraph_s root) {
+public static void mark_lowclusters(ST_Agraph_s root) {
ENTERING("4muksvb3ec03mt6cvaqpb5c7a","mark_lowclusters");
try {
- Agnode_s n, vn;
- Agedge_s orig, e;
+ ST_Agnode_s n, vn;
+ ST_Agedge_s orig, e;
/* first, zap any previous cluster labelings */
for (n = agfstnode(root); n!=null; n = agnxtnode(root, n)) {
ND_clust(n, null);
@@ -1229,7 +1205,7 @@ try {
if ((e = ED_to_virt(orig))!=null) {
while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
ND_clust(vn, null);
- e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
+ e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
}
}
}
@@ -1246,15 +1222,15 @@ LEAVING("4muksvb3ec03mt6cvaqpb5c7a","mark_lowclusters");
//3 48j6fdymvkcgeh4wde060ctac
// static void mark_lowcluster_basic(Agraph_t * g)
-public static void mark_lowcluster_basic(Agraph_s g) {
+public static void mark_lowcluster_basic(ST_Agraph_s g) {
ENTERING("48j6fdymvkcgeh4wde060ctac","mark_lowcluster_basic");
try {
- Agraph_s clust;
- Agnode_s n, vn;
- Agedge_s orig, e;
+ ST_Agraph_s clust;
+ ST_Agnode_s n, vn;
+ ST_Agedge_s orig, e;
int c;
for (c = 1; c <= GD_n_cluster(g); c++) {
- clust = (Agraph_s) GD_clust(g).plus(c).getPtr();
+ clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
mark_lowcluster_basic(clust);
}
/* see what belongs to this graph that wasn't already marked */
@@ -1266,7 +1242,7 @@ try {
while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
if (ND_clust(vn) == null)
ND_clust(vn, g);
- e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
+ e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
}
}
}
diff --git a/src/gen/lib/dotgen/compound__c.java b/src/gen/lib/dotgen/compound__c.java
index 614cae9..5cd594e 100644
--- a/src/gen/lib/dotgen/compound__c.java
+++ b/src/gen/lib/dotgen/compound__c.java
@@ -47,10 +47,7 @@ package gen.lib.dotgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class compound__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/dotgen/conc__c.java b/src/gen/lib/dotgen/conc__c.java
index ea9d419..d027092 100644
--- a/src/gen/lib/dotgen/conc__c.java
+++ b/src/gen/lib/dotgen/conc__c.java
@@ -47,10 +47,7 @@ package gen.lib.dotgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
import smetana.core.jmp_buf;
public class conc__c {
@@ -311,14 +308,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -347,26 +344,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -389,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/dotgen/decomp__c.java b/src/gen/lib/dotgen/decomp__c.java
index 4c04a39..c4595cf 100644
--- a/src/gen/lib/dotgen/decomp__c.java
+++ b/src/gen/lib/dotgen/decomp__c.java
@@ -66,18 +66,12 @@ import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_prev;
import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
import h.ST_elist;
-import h.boxf;
-import h.elist;
-import h.pointf;
-import smetana.core.JUtils;
+import h.ST_pointf;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
-import smetana.core.__struct__;
public class decomp__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -337,14 +331,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -373,25 +367,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -415,16 +390,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -745,7 +720,7 @@ LEAVING("7ggrwt0f912kp1marrxdjq155","begin_component");
//3 7icc6b2pvnj6te1yndbel47gg
// static void add_to_component(node_t * n)
-public static void add_to_component(Agnode_s n) {
+public static void add_to_component(ST_Agnode_s n) {
ENTERING("7icc6b2pvnj6te1yndbel47gg","add_to_component");
try {
GD_n_nodes(Z.z().G_decomp, 1+GD_n_nodes(Z.z().G_decomp));
@@ -775,7 +750,7 @@ try {
int i;
i = GD_comp(Z.z().G_decomp).size;
GD_comp(Z.z().G_decomp).size = 1+GD_comp(Z.z().G_decomp).size;
- GD_comp(Z.z().G_decomp).reallocEmpty(GD_comp(Z.z().G_decomp).size, Agnode_s.class);
+ GD_comp(Z.z().G_decomp).reallocEmpty(GD_comp(Z.z().G_decomp).size);
GD_comp(Z.z().G_decomp).setInList(i ,GD_nlist(Z.z().G_decomp));
} finally {
LEAVING("5o8hxpr6ppi15pinuy79m7u04","end_component");
@@ -787,21 +762,21 @@ LEAVING("5o8hxpr6ppi15pinuy79m7u04","end_component");
//3 c5u5lnfbu0pmlk6vsvyrdj8ep
// static void search_component(graph_t * g, node_t * n)
-public static void search_component(Agraph_s g, Agnode_s n) {
+public static void search_component(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("c5u5lnfbu0pmlk6vsvyrdj8ep","search_component");
try {
int c, i;
- __array_of_struct__ vec = __array_of_struct_impl__.malloc(elist.class, 4);
- Agnode_s other;
- Agedge_s e;
+ final ST_elist vec[] = new ST_elist[] {new ST_elist(),new ST_elist(),new ST_elist(),new ST_elist()};
+ ST_Agnode_s other;
+ ST_Agedge_s e;
add_to_component(n);
- vec.plus(0).setStruct(ND_out(n));
- vec.plus(1).setStruct(ND_in(n));
- vec.plus(2).setStruct(ND_flat_out(n));
- vec.plus(3).setStruct(ND_flat_in(n));
+ vec[0].setStruct(ND_out(n));
+ vec[1].setStruct(ND_in(n));
+ vec[2].setStruct(ND_flat_out(n));
+ vec[3].setStruct(ND_flat_in(n));
for (c = 0; c <= 3; c++) {
- if (((ST_elist) vec.plus(c).getStruct()).listNotNull())
- for (i = 0; (e = (Agedge_s) ((ST_elist) vec.plus(c).getStruct()).getFromList(i))!=null; i++) {
+ if (vec[c].listNotNull())
+ for (i = 0; (e = (ST_Agedge_s) vec[c].getFromList(i))!=null; i++) {
if (EQ(other = aghead(e), n))
other = agtail(e);
if ((ND_mark(other) != Z.z().Cmark) && (EQ(other, UF_find(other))))
@@ -818,11 +793,11 @@ LEAVING("c5u5lnfbu0pmlk6vsvyrdj8ep","search_component");
//3 2t7r964kqtl5qrl7i57i22tqy
// void decompose(graph_t * g, int pass)
-public static void decompose(Agraph_s g, int pass) {
+public static void decompose(ST_Agraph_s g, int pass) {
ENTERING("2t7r964kqtl5qrl7i57i22tqy","decompose");
try {
- Agraph_s subg;
- Agnode_s n, v;
+ ST_Agraph_s subg;
+ ST_Agnode_s n, v;
Z.z().G_decomp = g;
if (++Z.z().Cmark == 0)
Z.z().Cmark = 1;
@@ -831,7 +806,7 @@ try {
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
v = n;
if ((pass > 0) && (subg = ND_clust(v))!=null)
- v = (Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
+ v = (ST_Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
else if (v != UF_find(v))
continue;
if (ND_mark(v) != Z.z().Cmark) {
diff --git a/src/gen/lib/dotgen/dotinit__c.java b/src/gen/lib/dotgen/dotinit__c.java
index f6768c0..a854ef1 100644
--- a/src/gen/lib/dotgen/dotinit__c.java
+++ b/src/gen/lib/dotgen/dotinit__c.java
@@ -101,23 +101,19 @@ import static smetana.core.Macro.ND_other;
import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.alloc_elist;
-import h.Agedge_s;
-import h.Agedgeinfo_t;
-import h.Agnode_s;
-import h.Agnodeinfo_t;
-import h.Agraph_s;
-import h.Agraphinfo_t;
-import h.aspect_t;
-import h.boxf;
-import h.pack_info;
+import h.ST_Agedge_s;
+import h.ST_Agedgeinfo_t;
+import h.ST_Agnode_s;
+import h.ST_Agnodeinfo_t;
+import h.ST_Agraph_s;
+import h.ST_Agraphinfo_t;
+import h.ST_aspect_t;
+import h.ST_pack_info;
+import h.ST_pointf;
import h.pack_mode;
-import h.pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class dotinit__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -377,14 +373,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -413,25 +409,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -455,16 +432,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -765,12 +742,12 @@ throw new UnsupportedOperationException();
//3 cmr94z4p2bdeiply1d4wrqwes
// static void dot_init_subg(graph_t * g, graph_t* droot)
-public static void dot_init_subg(Agraph_s g, Agraph_s droot) {
+public static void dot_init_subg(ST_Agraph_s g, ST_Agraph_s droot) {
ENTERING("cmr94z4p2bdeiply1d4wrqwes","dot_init_subg");
try {
- Agraph_s subg;
+ ST_Agraph_s subg;
if (NEQ(g, agroot(g)))
- agbindrec(g, new CString("Agraphinfo_t"), sizeof(Agraphinfo_t.class), (N(0)));
+ agbindrec(g, new CString("Agraphinfo_t"), sizeof(ST_Agraphinfo_t.class), (N(0)));
if (EQ(g, droot))
GD_dotroot(agroot(g), droot);
for (subg = agfstsubg(g); subg!=null; subg = agnxtsubg(subg)) {
@@ -786,17 +763,17 @@ LEAVING("cmr94z4p2bdeiply1d4wrqwes","dot_init_subg");
//3 3hk92jbrfjmn6no3svn9jvje9
// static void dot_init_node(node_t * n)
-public static void dot_init_node(Agnode_s n) {
+public static void dot_init_node(ST_Agnode_s n) {
ENTERING("3hk92jbrfjmn6no3svn9jvje9","dot_init_node");
try {
- agbindrec(n, new CString("Agnodeinfo_t"), sizeof(Agnodeinfo_t.class), (N(0))); //graph custom data
+ agbindrec(n, new CString("Agnodeinfo_t"), sizeof(ST_Agnodeinfo_t.class), (N(0))); //graph custom data
common_init_node(n);
gv_nodesize(n, GD_flip(agraphof(n)));
- alloc_elist(4, ND_in(n), Agnode_s.class);
- alloc_elist(4, ND_out(n), Agnode_s.class);
- alloc_elist(2, ND_flat_in(n), Agnode_s.class);
- alloc_elist(2, ND_flat_out(n), Agnode_s.class);
- alloc_elist(2, ND_other(n), Agnode_s.class);
+ alloc_elist(4, ND_in(n));
+ alloc_elist(4, ND_out(n));
+ alloc_elist(2, ND_flat_in(n));
+ alloc_elist(2, ND_flat_out(n));
+ alloc_elist(2, ND_other(n));
ND_UF_size(n, 1);
} finally {
LEAVING("3hk92jbrfjmn6no3svn9jvje9","dot_init_node");
@@ -808,11 +785,11 @@ LEAVING("3hk92jbrfjmn6no3svn9jvje9","dot_init_node");
//3 zbvhnhd78bppq8wb872847bj
// static void dot_init_edge(edge_t * e)
-public static void dot_init_edge(Agedge_s e) {
+public static void dot_init_edge(ST_Agedge_s e) {
ENTERING("zbvhnhd78bppq8wb872847bj","dot_init_edge");
try {
CString tailgroup, headgroup;
- agbindrec(e, new CString("Agedgeinfo_t"), sizeof(Agedgeinfo_t.class), (N(0))); //graph custom data
+ agbindrec(e, new CString("Agedgeinfo_t"), sizeof(ST_Agedgeinfo_t.class), (N(0))); //graph custom data
common_init_edge(e);
ED_weight(e, late_int(e, Z.z().E_weight, 1, 0));
tailgroup = late_string(agtail(e), Z.z().N_group, new CString(""));
@@ -839,11 +816,11 @@ LEAVING("zbvhnhd78bppq8wb872847bj","dot_init_edge");
//3 2ylyhz7macit0ts1hap2tg3wy
// void dot_init_node_edge(graph_t * g)
-public static void dot_init_node_edge(Agraph_s g) {
+public static void dot_init_node_edge(ST_Agraph_s g) {
ENTERING("2ylyhz7macit0ts1hap2tg3wy","dot_init_node_edge");
try {
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
dot_init_node(n);
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
@@ -1072,11 +1049,11 @@ throw new UnsupportedOperationException();
//3 7t18nggek2s9vvb5opwqa8rwr
// static void dotLayout(Agraph_t * g)
-public static void dotLayout(Agraph_s g) {
+public static void dotLayout(ST_Agraph_s g) {
ENTERING("7t18nggek2s9vvb5opwqa8rwr","dotLayout");
try {
- aspect_t aspect = (aspect_t) Memory.malloc(aspect_t.class);
- aspect_t asp;
+ ST_aspect_t aspect = new ST_aspect_t();
+ ST_aspect_t asp;
int maxphase = late_int(g, (agattr(g,AGRAPH,new CString("phase"),null)), -1, 1);
setEdgeType (g, (5 << 1));
asp = setAspect (g, aspect);
@@ -1088,7 +1065,7 @@ try {
attach_phase_attrs (g, 1);
return;
}
- if (aspect.getBoolean("badGraph")) {
+ if (aspect.badGraph!=0) {
UNSUPPORTED("1yu5j8tk43i6jlmu8wk9jks15"); // agerr(AGWARN, "dot does not support the aspect attribute for disconnected graphs or graphs with clusters\n");
UNSUPPORTED("5uwp9z6jkv5uc30iyfszyg6dw"); // asp = NULL;
UNSUPPORTED("28kbszyxsjoj03gb134ov4hag"); // aspect.nextIter = 0;
@@ -1103,8 +1080,8 @@ UNSUPPORTED("28kbszyxsjoj03gb134ov4hag"); // aspect.nextIter = 0;
attach_phase_attrs (g, 2); /* positions will be attached on output */
return;
}
- aspect.setInt("nPasses", aspect.getInt("nPasses") -1);
- } while (aspect.getInt("nextIter")!=0 && aspect.getInt("nPasses")!=0);
+ aspect.setInt("nPasses", aspect.nPasses -1);
+ } while (aspect.nextIter!=0 && aspect.nPasses!=0);
if ((GD_flags(g) & (1 << 4))!=0)
removeFill (g);
dot_sameports(g);
@@ -1191,14 +1168,14 @@ throw new UnsupportedOperationException();
//3 nedairhdof6qkmjjoh4h68zy
// static void doDot (Agraph_t* g)
-public static void doDot(Agraph_s g) {
+public static void doDot(ST_Agraph_s g) {
ENTERING("nedairhdof6qkmjjoh4h68zy","doDot");
try {
- Agraph_s ccs[];
- Agraph_s sg;
+ ST_Agraph_s ccs[];
+ ST_Agraph_s sg;
int ncc;
int i;
- pack_info pinfo = (pack_info) Memory.malloc(pack_info.class);
+ final ST_pack_info pinfo = new ST_pack_info();
int Pack = getPack(g, -1, 8);
int mode = getPackModeInfo (g, enumAsInt(pack_mode.class, "l_undef"), pinfo);
getPackInfo(g, enumAsInt(pack_mode.class, "l_node"), 8, pinfo);
@@ -1253,7 +1230,7 @@ LEAVING("nedairhdof6qkmjjoh4h68zy","doDot");
//3 euvc3uoksq3e24augkwebfkcv
// void dot_layout(Agraph_t * g)
-public static void dot_layout(Agraph_s g) {
+public static void dot_layout(ST_Agraph_s g) {
ENTERING("euvc3uoksq3e24augkwebfkcv","dot_layout");
try {
if (agnnodes(g)!=0) doDot (g);
@@ -1268,7 +1245,7 @@ LEAVING("euvc3uoksq3e24augkwebfkcv","dot_layout");
//3 ca52dadcp7m8x0bqhaw4tvtaw
// Agraph_t * dot_root (void* p)
-public static Agraph_s dot_root(__ptr__ p) {
+public static ST_Agraph_s dot_root(__ptr__ p) {
ENTERING("ca52dadcp7m8x0bqhaw4tvtaw","dot_root");
try {
return GD_dotroot(agroot(p));
diff --git a/src/gen/lib/dotgen/dotsplines__c.java b/src/gen/lib/dotgen/dotsplines__c.java
index c7c5d9a..f390a6c 100644
--- a/src/gen/lib/dotgen/dotsplines__c.java
+++ b/src/gen/lib/dotgen/dotsplines__c.java
@@ -51,7 +51,6 @@ import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agraphof;
-import static gen.lib.common.memory__c.gmalloc;
import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.routespl__c.makeStraightEdge;
import static gen.lib.common.routespl__c.routepolylines;
@@ -73,12 +72,11 @@ import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.function;
import static smetana.core.JUtils.qsort;
import static smetana.core.JUtils.sizeof;
-import static smetana.core.JUtils.sizeof_starstar_empty;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.ABS;
import static smetana.core.Macro.AGSEQ;
-import static smetana.core.Macro.ALLOC_empty;
+import static smetana.core.Macro.ALLOC_allocated_ST_Agedge_s;
import static smetana.core.Macro.BETWEEN;
import static smetana.core.Macro.ED_adjacent;
import static smetana.core.Macro.ED_edge_type;
@@ -121,31 +119,28 @@ import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NOT;
+import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.ROUND;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agedgeinfo_t;
-import h.Agedgepair_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.Ppoly_t;
+import h.ST_Agedge_s;
+import h.ST_Agedgeinfo_t;
+import h.ST_Agedgepair_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_Ppoly_t;
+import h.ST_bezier;
import h.ST_boxf;
+import h.ST_path;
+import h.ST_pathend_t;
+import h.ST_pointf;
import h.ST_port;
+import h.ST_rank_t;
+import h.ST_spline_info_t;
+import h.ST_splines;
import h.attr_state_t;
-import h.bezier;
-import h.boxf;
-import h.path;
-import h.pathend_t;
-import h.pointf;
-import h.spline_info_t;
-import h.splines;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class dotsplines__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -405,14 +400,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -483,16 +478,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -793,10 +788,10 @@ throw new UnsupportedOperationException();
//3 dobhmc46zwtvv8rg3ywntl91j
// static edge_t* getmainedge(edge_t * e)
-public static Agedge_s getmainedge(Agedge_s e) {
+public static ST_Agedge_s getmainedge(ST_Agedge_s e) {
ENTERING("dobhmc46zwtvv8rg3ywntl91j","getmainedge");
try {
- Agedge_s le = e;
+ ST_Agedge_s le = e;
while (ED_to_virt(le)!=null)
le = ED_to_virt(le);
while (ED_to_orig(le)!=null)
@@ -812,7 +807,7 @@ LEAVING("dobhmc46zwtvv8rg3ywntl91j","getmainedge");
//3 ddeny5ht7w8b16ztj5zt840ld
// static boolean spline_merge(node_t * n)
-public static boolean spline_merge(Agnode_s n) {
+public static boolean spline_merge(ST_Agnode_s n) {
ENTERING("ddeny5ht7w8b16ztj5zt840ld","spline_merge");
try {
return ((ND_node_type(n) == 1)
@@ -827,7 +822,7 @@ LEAVING("ddeny5ht7w8b16ztj5zt840ld","spline_merge");
//3 36ofw2qfqlh5ci8gc8cfkqgg3
// static boolean swap_ends_p(edge_t * e)
-public static boolean swap_ends_p(Agedge_s e) {
+public static boolean swap_ends_p(ST_Agedge_s e) {
ENTERING("36ofw2qfqlh5ci8gc8cfkqgg3","swap_ends_p");
try {
while (ED_to_orig(e)!=null)
@@ -884,17 +879,17 @@ LEAVING("3krohso3quojiv4fveh1en7o6","portcmp");
//3 10wbtt4gwnxgqutinpj4ymjpk
// static void swap_bezier(bezier * old, bezier * new)
-public static void swap_bezier(__ptr__ old, __ptr__ new_) {
+public static void swap_bezier(ST_bezier.Array2 old, ST_bezier.Array2 new_) {
ENTERING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
try {
- __ptr__ list;
- __ptr__ lp;
- __ptr__ olp;
+ ST_pointf.Array list;
+ ST_pointf.Array lp;
+ ST_pointf.Array olp;
int i, sz;
- sz = old.getInt("size");
- list = gmalloc(sizeof(pointf.class, sz));
+ sz = old.getStruct().size;
+ list = new ST_pointf.Array(sz);
lp = list;
- olp = old.getArrayOfPtr("list").plus(sz - 1).asPtr();
+ olp = old.getStruct().list.plus(sz - 1);
for (i = 0; i < sz; i++) { /* reverse list of points */
lp.getStruct().___(olp.getStruct());
lp=lp.plus(1);
@@ -902,10 +897,10 @@ try {
}
new_.setPtr("list", list);
new_.setInt("size", sz);
- new_.setInt("sflag", old.getInt("eflag"));
- new_.setInt("eflag", old.getInt("sflag"));
- new_.setStruct("sp", old.getStruct("ep"));
- new_.setStruct("ep", old.getStruct("sp"));
+ new_.setInt("sflag", old.getStruct().eflag);
+ new_.setInt("eflag", old.getStruct().sflag);
+ new_.setStruct("sp", old.getStruct().ep);
+ new_.setStruct("ep", old.getStruct().sp);
} finally {
LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
}
@@ -916,17 +911,17 @@ LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
//3 3256l3e2huarsy29dd97vqj85
// static void swap_spline(splines * s)
-public static void swap_spline(splines s) {
+public static void swap_spline(ST_splines s) {
ENTERING("3256l3e2huarsy29dd97vqj85","swap_spline");
try {
- __ptr__ list;
- __ptr__ lp;
- __ptr__ olp;
+ ST_bezier.Array2 list;
+ ST_bezier.Array2 lp;
+ ST_bezier.Array2 olp;
int i, sz;
- sz = s.getInt("size");
- list = gmalloc(sizeof(bezier.class, sz));
+ sz = s.size;
+ list = new ST_bezier.Array2(sz);
lp = list;
- olp = s.getArrayOfPtr("list").plus(sz - 1).asPtr();
+ olp = s.list.plus(sz - 1);
for (i = 0; i < sz; i++) { /* reverse and swap list of beziers */
swap_bezier(olp, lp);
olp = olp.plus(-1);
@@ -934,9 +929,9 @@ try {
}
/* free old structures */
for (i = 0; i < sz; i++)
- Memory.free(s.getArrayOfPtr("list").plus(i).getPtr().getArrayOfPtr("list"));
- Memory.free(s.getArrayOfPtr("list"));
- s.setPtr("list", list);
+ Memory.free(((ST_bezier)s.list.get(i)).getPtr().list);
+ Memory.free(s.list);
+ s.list = (ST_bezier.Array2) list;
} finally {
LEAVING("3256l3e2huarsy29dd97vqj85","swap_spline");
}
@@ -947,14 +942,14 @@ LEAVING("3256l3e2huarsy29dd97vqj85","swap_spline");
//3 dgkssqjj566ifra0xy7m46qsb
// static void edge_normalize(graph_t * g)
-public static void edge_normalize(Agraph_s g) {
+public static void edge_normalize(ST_Agraph_s g) {
ENTERING("dgkssqjj566ifra0xy7m46qsb","edge_normalize");
try {
- Agedge_s e;
- Agnode_s n;
+ ST_Agedge_s e;
+ ST_Agnode_s n;
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
- if ((Boolean)Z.z().sinfo.call("swapEnds", e) && ED_spl(e)!=null)
+ if ((Boolean)Z.z().sinfo.swapEnds.exe(e) && ED_spl(e)!=null)
swap_spline(ED_spl(e));
}
}
@@ -1021,21 +1016,21 @@ throw new UnsupportedOperationException();
//3 6agx6m2qof9lg57co232lwakj
// static void _dot_splines(graph_t * g, int normalize)
-static void _dot_splines(Agraph_s g, int normalize)
+static void _dot_splines(ST_Agraph_s g, int normalize)
{
ENTERING("6agx6m2qof9lg57co232lwakj","_dot_splines");
try {
int i, j, k, n_nodes, n_edges, ind, cnt;
- Agnode_s n;
- final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class);
- final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class);
- Agedge_s e, e0, e1, ea, eb, le0, le1;
- __ptr__ edges;
- path P;
- final __struct__<spline_info_t> sd = JUtils.from(spline_info_t.class);
+ ST_Agnode_s n;
+ final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t();
+ final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s();
+ ST_Agedge_s e, e0, e1, ea, eb, le0, le1;
+ ST_Agedge_s.ArrayOfStar edges;
+ ST_path P;
+ final ST_spline_info_t sd = new ST_spline_info_t();
int et = (GD_flags(g) & (7 << 1));
- fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
- fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
+ fwdedgea.out.base.setPtr("data", fwdedgeai);
+ fwdedgeb.out.base.setPtr("data", fwdedgebi);
if (et == (0 << 1)) return;
if (et == (2 << 1)) {
resetRW (g);
@@ -1051,52 +1046,52 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
}
mark_lowclusters(g);
if (routesplinesinit()!=0) return;
- P = (path) zmalloc(sizeof(path.class));
+ P = (ST_path) zmalloc(sizeof(ST_path.class));
/* FlatHeight = 2 * GD_nodesep(g); */
sd.setInt("Splinesep", GD_nodesep(g) / 4);
sd.setInt("Multisep", GD_nodesep(g));
- edges = zmalloc(sizeof_starstar_empty(Agedge_s.class, 128));
+ edges = new ST_Agedge_s.ArrayOfStar(128);
/* compute boundaries and list of splines */
sd.setInt("RightBound", 0);
sd.setInt("LeftBound", 0);
n_edges = n_nodes = 0;
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
- n_nodes += GD_rank(g).plus(i).getInt("n");
- if ((n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(0).getPtr())!=null)
- sd.setInt("LeftBound", (int)MIN(sd.getInt("LeftBound"), (ND_coord(n).getDouble("x") - ND_lw(n))));
- if (GD_rank(g).plus(i).getInt("n")!=0 && (n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(GD_rank(g).plus(i).getInt("n") - 1).getPtr())!=null)
- sd.setInt("RightBound", (int)MAX(sd.getInt("RightBound"), (ND_coord(n).getDouble("x") + ND_rw(n))));
- sd.setInt("LeftBound", sd.getInt("LeftBound") - 16);
- sd.setInt("RightBound", sd.getInt("RightBound") + 16);
- for (j = 0; j < GD_rank(g).plus(i).getInt("n"); j++) {
- n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(j).getPtr();
+ n_nodes += GD_rank(g).get(i).n;
+ if ((n = (ST_Agnode_s) GD_rank(g).get(i).v.get(0))!=null)
+ sd.setInt("LeftBound", (int)MIN(sd.LeftBound, (ND_coord(n).x - ND_lw(n))));
+ if (GD_rank(g).get(i).n!=0 && (n = (ST_Agnode_s) GD_rank(g).get(i).v.plus(GD_rank(g).get(i).n - 1).getPtr())!=null)
+ sd.setInt("RightBound", (int)MAX(sd.RightBound, (ND_coord(n).x + ND_rw(n))));
+ sd.setInt("LeftBound", sd.LeftBound - 16);
+ sd.setInt("RightBound", sd.RightBound + 16);
+ for (j = 0; j < GD_rank(g).get(i).n; j++) {
+ n = (ST_Agnode_s) GD_rank(g).get(i).v.get(j);
/* if n is the label of a flat edge, copy its position to
* the label.
*/
if (ND_alg(n)!=null) {
- Agedge_s fe = (Agedge_s) ND_alg(n);
+ ST_Agedge_s fe = (ST_Agedge_s) ND_alg(n);
assert (ED_label(fe)!=null);
ED_label(fe).setStruct("pos", ND_coord(n));
- ED_label(fe).setBoolean("set", NOT(false));
+ ED_label(fe).set= NOTI(false);
}
if ((ND_node_type(n) != 0) &&
- ((Boolean)Z.z().sinfo.call("splineMerge", n) == false))
+ ((Boolean)Z.z().sinfo.splineMerge.exe(n) == false))
continue;
- for (k = 0; (e = (Agedge_s) ND_out(n).getFromList(k))!=null; k++) {
+ for (k = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(k))!=null; k++) {
if ((ED_edge_type(e) == 4)
|| (ED_edge_type(e) == 6))
continue;
setflags(e, 1, 16, 64);
edges.plus(n_edges++).setPtr(e);
if (n_edges % 128 == 0)
- edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
+ edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
}
if (ND_flat_out(n).listNotNull())
- for (k = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(k))!=null; k++) {
+ for (k = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(k))!=null; k++) {
setflags(e, 2, 0, 128);
edges.plus(n_edges++).setPtr(e);
if (n_edges % 128 == 0)
- edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
+ edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
}
if (ND_other(n).listNotNull()) {
/* In position, each node has its rw stored in mval and,
@@ -1109,11 +1104,11 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
ND_rw(n, ND_mval(n));
ND_mval(n, tmp);
}
- for (k = 0; (e = (Agedge_s) ND_other(n).getFromList(k))!=null; k++) {
+ for (k = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(k))!=null; k++) {
setflags(e, 0, 0, 128);
edges.plus(n_edges++).setPtr(e);
if (n_edges % 128 == 0)
- edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
+ edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
}
}
}
@@ -1127,11 +1122,10 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
LOG2("_dot_splines::n_edges="+n_edges);
qsort(edges,
n_edges,
- sizeof(edges.plus(0)),
function(dotsplines__c.class, "edgecmp"));
/* FIXME: just how many boxes can there be? */
- P.setPtr("boxes", zmalloc(sizeof(boxf.class, n_nodes + 20 * 2 * 9)));
- sd.setPtr("Rank_box", zmalloc(sizeof(boxf.class, i)));
+ P.boxes = ST_boxf.malloc(n_nodes + 20 * 2 * 9);
+ sd.Rank_box = ST_boxf.malloc(i);
if (et == (1 << 1)) {
/* place regular edge labels */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
@@ -1143,7 +1137,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
for (i = 0; i < n_edges;) {
boolean havePorts;
ind = i;
- le0 = getmainedge((e0 = (Agedge_s) edges.plus(i++).getPtr()));
+ le0 = getmainedge((e0 = (ST_Agedge_s) edges.plus(i++).getPtr()));
if (ED_tail_port(e0).defined!=0 || ED_head_port(e0).defined!=0) {
havePorts = NOT(false);
ea = e0;
@@ -1152,11 +1146,11 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
ea = le0;
}
if ((ED_tree_index(ea) & 32)!=0) {
- MAKEFWDEDGE(fwdedgea.getStruct("out").amp(), ea);
- ea = (Agedge_s) fwdedgea.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedgea.out, ea);
+ ea = (ST_Agedge_s) fwdedgea.out;
}
for (cnt = 1; i < n_edges; cnt++, i++) {
- if (NEQ(le0, (le1 = getmainedge((e1 = (Agedge_s) edges.plus(i).getPtr())))))
+ if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.get(i))))))
break;
if (ED_adjacent(e0)!=0) continue; /* all flat adjacent edges at once */
if (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) {
@@ -1169,8 +1163,8 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
eb = le1;
}
if ((ED_tree_index(eb) & 32)!=0) {
- MAKEFWDEDGE(fwdedgeb.getStruct("out").amp(), eb);
- eb = (Agedge_s) fwdedgeb.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedgeb.out, eb);
+ eb = (ST_Agedge_s) fwdedgeb.out;
}
if (portcmp(ED_tail_port(ea), ED_tail_port(eb))!=0)
break;
@@ -1179,7 +1173,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
if ((ED_tree_index(e0) & 15) == 2
&& NEQ(ED_label(e0), ED_label(e1)))
break;
- if ((ED_tree_index(edges.plus(i).getPtr()) & 64)!=0) /* Aha! -C is on */
+ if ((ED_tree_index(edges.get(i)) & 64)!=0) /* Aha! -C is on */
break;
}
if (EQ(agtail(e0), aghead(e0))) {
@@ -1188,30 +1182,30 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
r = ND_rank(n);
if (r == GD_maxrank(g)) {
if (r > 0)
- sizey = (int) (ND_coord(GD_rank(g).plus(r-1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y"));
+ sizey = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y);
else
sizey = (int) ND_ht(n);
}
else if (r == GD_minrank(g)) {
- sizey = (int)(ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y"));
+ sizey = (int)(ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y);
}
else {
- int upy = (int) (ND_coord(GD_rank(g).plus(r-1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y"));
- int dwny = (int) (ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y"));
+ int upy = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y);
+ int dwny = (int) (ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y);
sizey = MIN(upy, dwny);
}
- makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z.z().sinfo.amp());
+ makeSelfEdge(P, edges, ind, cnt, sd.Multisep, sizey/2, Z.z().sinfo);
for (b = 0; b < cnt; b++) {
- e = (Agedge_s) edges.plus(ind+b).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind+b).getPtr();
if (ED_label(e)!=null)
updateBB(g, ED_label(e));
}
}
else if (ND_rank(agtail(e0)) == ND_rank(aghead(e0))) {
- make_flat_edge(g, sd.amp(), P, edges, ind, cnt, et);
+ make_flat_edge(g, sd, P, edges, ind, cnt, et);
}
else
- make_regular_edge(g, sd.amp(), P, edges, ind, cnt, et);
+ make_regular_edge(g, sd, P, edges, ind, cnt, et);
}
/* place regular edge labels */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
@@ -1249,9 +1243,9 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
/* end vladimir */
if (et != (2 << 1)) {
Memory.free(edges);
- Memory.free(P.getPtr("boxes"));
+ Memory.free(P.boxes);
Memory.free(P);
- Memory.free(sd.getPtr("Rank_box"));
+ Memory.free(sd.Rank_box);
routesplinesterm();
}
Z.z().State = 1;
@@ -1266,7 +1260,7 @@ LEAVING("6agx6m2qof9lg57co232lwakj","_dot_splines");
//3 5n306wbdfjbfnimdo9lg6jjaa
// void dot_splines(graph_t * g)
-public static void dot_splines(Agraph_s g) {
+public static void dot_splines(ST_Agraph_s g) {
ENTERING("5n306wbdfjbfnimdo9lg6jjaa","dot_splines");
try {
_dot_splines (g, 1);
@@ -1280,21 +1274,21 @@ LEAVING("5n306wbdfjbfnimdo9lg6jjaa","dot_splines");
//3 8jja9ukzsq8tlb9yy7uzavg91
// static void place_vnlabel(node_t * n)
-public static void place_vnlabel(Agnode_s n) {
+public static void place_vnlabel(ST_Agnode_s n) {
ENTERING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
try {
- final __struct__<pointf> dimen = JUtils.from(pointf.class);
+ final ST_pointf dimen = new ST_pointf();
double width;
- Agedge_s e;
+ ST_Agedge_s e;
if (ND_in(n).size == 0)
return; /* skip flat edge labels here */
- for (e = (Agedge_s) ND_out(n).getFromList(0); ED_edge_type(e) != 0;
+ for (e = (ST_Agedge_s) ND_out(n).getFromList(0); ED_edge_type(e) != 0;
e = ED_to_orig(e));
- dimen.___(ED_label(e).getStruct("dimen"));
- width = GD_flip(agraphof(n))!=0 ? dimen.getDouble("y") : dimen.getDouble("x");
- ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + width / 2.0);
- ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y"));
- ED_label(e).setBoolean("set", NOT(false));
+ dimen.___(ED_label(e).dimen);
+ width = GD_flip(agraphof(n))!=0 ? dimen.y : dimen.x;
+ ED_label(e).pos.setDouble("x", ND_coord(n).x + width / 2.0);
+ ED_label(e).pos.setDouble("y", ND_coord(n).y);
+ ED_label(e).set= NOTI(false);
} finally {
LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
}
@@ -1305,7 +1299,7 @@ LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
//3 598jn37hjkm7j0kcg2nmdvlwq
// static void setflags(edge_t *e, int hint1, int hint2, int f3)
-public static void setflags(Agedge_s e, int hint1, int hint2, int f3) {
+public static void setflags(ST_Agedge_s e, int hint1, int hint2, int f3) {
ENTERING("598jn37hjkm7j0kcg2nmdvlwq","setflags");
try {
int f1, f2;
@@ -1346,15 +1340,15 @@ LEAVING("598jn37hjkm7j0kcg2nmdvlwq","setflags");
public static int edgecmp(__ptr__ ptr0, __ptr__ ptr1) {
ENTERING("1nf1s6wkn35ptjn884ii56fh","edgecmp");
try {
- final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class);
- final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class);
- Agedge_s e0, e1, ea, eb, le0, le1;
+ final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t();
+ final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s();
+ ST_Agedge_s e0, e1, ea, eb, le0, le1;
int et0, et1, v0, v1, rv;
double t0, t1;
- fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
- fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
- e0 = (Agedge_s) ptr0.getPtr();
- e1 = (Agedge_s) ptr1.getPtr();
+ fwdedgea.out.base.setPtr("data", fwdedgeai);
+ fwdedgeb.out.base.setPtr("data", fwdedgebi);
+ e0 = (ST_Agedge_s) ptr0.getPtr();
+ e1 = (ST_Agedge_s) ptr1.getPtr();
et0 = ED_tree_index(e0) & 15;
et1 = ED_tree_index(e1) & 15;
if (et0 != et1)
@@ -1367,8 +1361,8 @@ try {
v1 = ABS((int)t1);
if (v0 != v1)
return (v0 - v1);
- t0 = ND_coord(agtail(le0)).getDouble("x") - ND_coord(aghead(le0)).getDouble("x");
- t1 = ND_coord(agtail(le1)).getDouble("x") - ND_coord(aghead(le1)).getDouble("x");
+ t0 = ND_coord(agtail(le0)).x - ND_coord(aghead(le0)).x;
+ t1 = ND_coord(agtail(le1)).x - ND_coord(aghead(le1)).x;
v0 = ABS((int)t0);
v1 = ABS((int)t1);
if (v0 != v1)
@@ -1378,13 +1372,13 @@ try {
return (AGSEQ(le0) - AGSEQ(le1));
ea = (ED_tail_port(e0).defined!=0 || ED_head_port(e0).defined!=0) ? e0 : le0;
if ((ED_tree_index(ea) & 32)!=0) {
- MAKEFWDEDGE(fwdedgea.getStruct("out").amp(), ea);
- ea = fwdedgea.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedgea.out, ea);
+ ea = (ST_Agedge_s) fwdedgea.out;
}
eb = (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) ? e1 : le1;
if ((ED_tree_index(eb) & 32)!=0) {
- MAKEFWDEDGE(fwdedgeb.getStruct("out").amp(), eb);
- eb = fwdedgeb.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedgeb.out, eb);
+ eb = (ST_Agedge_s) fwdedgeb.out;
}
if ((rv = portcmp(ED_tail_port(ea), ED_tail_port(eb)))!=0)
return rv;
@@ -1678,18 +1672,18 @@ throw new UnsupportedOperationException();
public static int edgelblcmpfn(__ptr__ ptr0, __ptr__ ptr1) {
ENTERING("bmsa24i3avg14po4sp17yh89k","edgelblcmpfn");
try {
- Agedge_s e0, e1;
- final __struct__<pointf> sz0 = JUtils.from(pointf.class), sz1 = JUtils.from(pointf.class);
- e0 = (Agedge_s) ptr0.getPtr();
- e1 = (Agedge_s) ptr1.getPtr();
+ ST_Agedge_s e0, e1;
+ final ST_pointf sz0 = new ST_pointf(), sz1 = new ST_pointf();
+ e0 = (ST_Agedge_s) ptr0.getPtr();
+ e1 = (ST_Agedge_s) ptr1.getPtr();
if (ED_label(e0)!=null) {
if (ED_label(e1)!=null) {
- sz0.___(ED_label(e0).getStruct("dimen"));
- sz1.___(ED_label(e1).getStruct("dimen"));
- if (sz0.getDouble("x") > sz1.getDouble("x")) return -1;
- else if (sz0.getDouble("x") < sz1.getDouble("x")) return 1;
- else if (sz0.getDouble("y") > sz1.getDouble("y")) return -1;
- else if (sz0.getDouble("y") < sz1.getDouble("y")) return 1;
+ sz0.___(ED_label(e0).dimen);
+ sz1.___(ED_label(e1).dimen);
+ if (sz0.x > sz1.x) return -1;
+ else if (sz0.x < sz1.x) return 1;
+ else if (sz0.y > sz1.y) return -1;
+ else if (sz0.y < sz1.y) return 1;
else return 0;
}
else
@@ -1710,70 +1704,69 @@ LEAVING("bmsa24i3avg14po4sp17yh89k","edgelblcmpfn");
//3 3xmylrnypvoqrj2yrxnomsj5k
// static void makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et, int n_lbls)
-public static void makeSimpleFlatLabels(Agnode_s tn, Agnode_s hn, __ptr__ edges, int ind, int cnt, int et, int n_lbls) {
+public static void makeSimpleFlatLabels(ST_Agnode_s tn, ST_Agnode_s hn, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et, int n_lbls) {
ENTERING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels");
try {
- pointf ps;
- final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
+ ST_pointf.Array ps;
+ final ST_Ppoly_t poly = new ST_Ppoly_t();
int pn[] = new int[1];
- Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
- final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
- final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
+ ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
+ final ST_pointf.Array points = new ST_pointf.Array(10);
+ final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
int i, pointn;
double leftend, rightend, ctrx=0, ctry=0, miny, maxy;
double uminx=0, umaxx=0;
double lminx=0, lmaxx=0;
- __ptr__ earray = zmalloc(sizeof_starstar_empty(Agedge_s.class, cnt));
+ ST_Agedge_s.ArrayOfStar earray = new ST_Agedge_s.ArrayOfStar(cnt);
for (i = 0; i < cnt; i++) {
earray.plus(i).setPtr(edges.plus(ind + i).getPtr());
}
qsort(earray,
cnt,
- sizeof(earray.plus(0)),
function(dotsplines__c.class, "edgelblcmpfn"));
- tp.___(add_pointf(ND_coord(tn), ED_tail_port(e).getStruct("p")));
- hp.___(add_pointf(ND_coord(hn), ED_head_port(e).getStruct("p")));
- leftend = tp.getDouble("x")+ND_rw(tn);
- rightend = hp.getDouble("x")-ND_lw(hn);
+ tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p));
+ hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
+ leftend = tp.x+ND_rw(tn);
+ rightend = hp.x-ND_lw(hn);
ctrx = (leftend + rightend)/2.0;
/* do first edge */
- e = (Agedge_s) earray.plus(0).getPtr();
+ e = (ST_Agedge_s) earray.get(0);
pointn = 0;
points.plus(pointn++).setStruct(tp);
points.plus(pointn++).setStruct(tp);
points.plus(pointn++).setStruct(hp);
points.plus(pointn++).setStruct(hp);
- clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
- ED_label(e).getStruct("pos").setDouble("x", ctrx);
- ED_label(e).getStruct("pos").setDouble("y", tp.getDouble("y") + (ED_label(e).getStruct("dimen").getDouble("y")+6)/2.0);
- ED_label(e).setBoolean("set", NOT(false));
- miny = tp.getDouble("y") + 6/2.0;
- maxy = miny + ED_label(e).getStruct("dimen").getDouble("y");
- uminx = ctrx - (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
- umaxx = ctrx + (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
+ clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo);
+ ED_label(e).pos.setDouble("x", ctrx);
+ ED_label(e).pos.setDouble("y", tp.y + (ED_label(e).dimen.y+6)/2.0);
+ ED_label(e).set= NOTI(false);
+ miny = tp.y + 6/2.0;
+ maxy = miny + ED_label(e).dimen.y;
+ uminx = ctrx - (ED_label(e).dimen.x)/2.0;
+ umaxx = ctrx + (ED_label(e).dimen.x)/2.0;
for (i = 1; i < n_lbls; i++) {
- e = (Agedge_s) earray.plus(i).getPtr();
+ e = (ST_Agedge_s) earray.get(i);
if (i%2!=0) { /* down */
if (i == 1) {
- lminx = ctrx - (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
- lmaxx = ctrx + (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
+ lminx = ctrx - (ED_label(e).dimen.x)/2.0;
+ lmaxx = ctrx + (ED_label(e).dimen.x)/2.0;
}
- miny -= 6 + ED_label(e).getStruct("dimen").getDouble("y");
+ miny -= 6 + ED_label(e).dimen.y;
points.plus(0).setStruct(tp);
- points.plus(1).setDouble("x", tp.getDouble("x"));
+ points.plus(1).setDouble("x", tp.x);
points.plus(1).setDouble("y", miny - 6);
- points.plus(2).setDouble("x", hp.getDouble("x"));
- points.plus(2).setDouble("y", points.plus(1).getDouble("y"));
+ points.plus(2).setDouble("x", hp.x);
+ points.plus(2).setDouble("y", points.get(1).y);
points.plus(3).setStruct(hp);
points.plus(4).setDouble("x", lmaxx);
- points.plus(4).setDouble("y", hp.getDouble("y"));
+ points.plus(4).setDouble("y", hp.y);
points.plus(5).setDouble("x", lmaxx);
points.plus(5).setDouble("y", miny);
points.plus(6).setDouble("x", lminx);
points.plus(6).setDouble("y", miny);
points.plus(7).setDouble("x", lminx);
- points.plus(7).setDouble("y", tp.getDouble("y"));
- ctry = miny + (ED_label(e).getStruct("dimen").getDouble("y"))/2.0;
+ points.plus(7).setDouble("y", tp.y);
+ ctry = miny + (ED_label(e).dimen.y)/2.0;
}
else { /* up */
UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
@@ -1794,18 +1787,18 @@ UNSUPPORTED("56zheeat0b8mo4uvlcbvgbu80"); // points[7].y = maxy + 6;
UNSUPPORTED("ehcig8trxc4ble6pcochubv7z"); // ctry = maxy + (ED_label(e)->dimen.y)/2.0 + 6;
UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y + 6;
}
- poly.setInt("pn", 8);
- poly.setPtr("ps", points.asPtr());
+ poly.pn = 8;
+ poly.ps = points;
ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
if (pn[0] == 0) return;
- ED_label(e).getStruct("pos").setDouble("x", ctrx);
- ED_label(e).getStruct("pos").setDouble("y", ctry);
- ED_label(e).setBoolean("set", NOT(false));
- clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
+ ED_label(e).pos.setDouble("x", ctrx);
+ ED_label(e).pos.setDouble("y", ctry);
+ ED_label(e).set= NOTI(false);
+ clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
}
/* edges with no labels */
for (; i < cnt; i++) {
- e = (Agedge_s) earray.plus(i).getPtr();
+ e = (ST_Agedge_s) earray.get(i);
if (i%2!=0) { /* down */
if (i == 1) {
lminx = (2*leftend + rightend)/3.0;
@@ -1813,19 +1806,19 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y +
}
miny -= 6;
points.plus(0).setStruct(tp);
- points.plus(1).setDouble("x", tp.getDouble("x"));
+ points.plus(1).setDouble("x", tp.x);
points.plus(1).setDouble("y", miny - 6);
- points.plus(2).setDouble("x", hp.getDouble("x"));
- points.plus(2).setDouble("y", points.plus(1).getDouble("y"));
+ points.plus(2).setDouble("x", hp.x);
+ points.plus(2).setDouble("y", points.get(1).y);
points.plus(3).setStruct(hp);
points.plus(4).setDouble("x", lmaxx);
- points.plus(4).setDouble("y", hp.getDouble("y"));
+ points.plus(4).setDouble("y", hp.y);
points.plus(5).setDouble("x", lmaxx);
points.plus(5).setDouble("y", miny);
points.plus(6).setDouble("x", lminx);
points.plus(6).setDouble("y", miny);
points.plus(7).setDouble("x", lminx);
- points.plus(7).setDouble("y", tp.getDouble("y"));
+ points.plus(7).setDouble("y", tp.y);
}
else { /* up */
UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
@@ -1845,11 +1838,11 @@ UNSUPPORTED("5s3o04yf5lzca6ruuygfxngj2"); // points[7].x = tp.x;
UNSUPPORTED("56zheeat0b8mo4uvlcbvgbu80"); // points[7].y = maxy + 6;
UNSUPPORTED("7un2qk34mmmhqi296vl50bacs"); // maxy += + 6;
}
- poly.setInt("pn", 8);
- poly.setPtr("ps", points.asPtr());
+ poly.pn = 8;
+ poly.ps = points;
ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
if (pn[0] == 0) return;
- clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
+ clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
}
Memory.free (earray);
} finally {
@@ -1862,25 +1855,25 @@ LEAVING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels");
//3 8kqyzk43ovc2sq6jegua6ytp
// static void makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et)
-public static void makeSimpleFlat(Agnode_s tn, Agnode_s hn, __ptr__ edges, int ind, int cnt, int et) {
+public static void makeSimpleFlat(ST_Agnode_s tn, ST_Agnode_s hn, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) {
ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
try {
- Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
- final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
- final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
+ ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
+ final ST_pointf.Array points = new ST_pointf.Array( 10);
+ final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
int i, pointn;
double stepy, dy;
- tp.___(add_pointf(ND_coord(tn), ED_tail_port(e).getStruct("p")));
- hp.___(add_pointf(ND_coord(hn), ED_head_port(e).getStruct("p")));
+ tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p));
+ hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
stepy = (cnt > 1) ? ND_ht(tn) / (double)(cnt - 1) : 0.;
- dy = tp.getDouble("y") - ((cnt > 1) ? ND_ht(tn) / 2. : 0.);
+ dy = tp.y - ((cnt > 1) ? ND_ht(tn) / 2. : 0.);
for (i = 0; i < cnt; i++) {
- e = (Agedge_s) edges.plus(ind + i).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
pointn = 0;
if ((et == (5 << 1)) || (et == (1 << 1))) {
points.plus(pointn++).setStruct(tp);
- points.plus(pointn++).setStruct(pointfof((2 * tp.getDouble("x") + hp.getDouble("x")) / 3, dy));
- points.plus(pointn++).setStruct(pointfof((2 * hp.getDouble("x") + tp.getDouble("x")) / 3, dy));
+ points.plus(pointn++).setStruct(pointfof((2 * tp.x + hp.x) / 3, dy));
+ points.plus(pointn++).setStruct(pointfof((2 * hp.x + tp.x) / 3, dy));
points.plus(pointn++).setStruct(hp);
}
else { /* ET_PLINE */
@@ -1896,7 +1889,7 @@ UNSUPPORTED("59cwjy3j5e0igp278migykzi"); // points[pointn++] = hp;
UNSUPPORTED("59cwjy3j5e0igp278migykzi"); // points[pointn++] = hp;
}
dy += stepy;
- clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
+ clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo);
}
} finally {
LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
@@ -1908,24 +1901,24 @@ LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
//3 bhnjospwghq4plid12757c928
// static void make_flat_adj_edges(graph_t* g, path* P, edge_t** edges, int ind, int cnt, edge_t* e0, int et)
-public static void make_flat_adj_edges(Agraph_s g, path P, __ptr__ edges, int ind, int cnt, Agedge_s e0, int et) {
+public static void make_flat_adj_edges(ST_Agraph_s g, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, ST_Agedge_s e0, int et) {
ENTERING("bhnjospwghq4plid12757c928","make_flat_adj_edges");
try {
- Agnode_s n;
- Agnode_s tn, hn;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agnode_s tn, hn;
+ ST_Agedge_s e;
int labels = 0, ports = 0;
- Agraph_s auxg;
- Agraph_s subg;
- Agnode_s auxt, auxh;
- Agedge_s auxe;
+ ST_Agraph_s auxg;
+ ST_Agraph_s subg;
+ ST_Agnode_s auxt, auxh;
+ ST_Agedge_s auxe;
int i, j, midx, midy, leftx, rightx;
- final __struct__<pointf> del = JUtils.from(pointf.class);
- Agedge_s hvye = null;
+ final ST_pointf del = new ST_pointf();
+ ST_Agedge_s hvye = null;
attr_state_t attrs;
tn = agtail(e0); hn = aghead(e0);
for (i = 0; i < cnt; i++) {
- e = (Agedge_s) edges.plus(ind + i).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
if (ED_label(e)!=null) labels++;
if (ED_tail_port(e).defined!=0 || ED_head_port(e).defined!=0) ports = 1;
}
@@ -2051,7 +2044,7 @@ LEAVING("bhnjospwghq4plid12757c928","make_flat_adj_edges");
//3 fybar4mljnmkh3kure5k1eod
// static void makeFlatEnd (graph_t* g, spline_info_t* sp, path* P, node_t* n, edge_t* e, pathend_t* endp, boolean isBegin)
-public static void makeFlatEnd(Agraph_s g, spline_info_t sp, path P, Agnode_s n, Agedge_s e, pathend_t endp, boolean isBegin) {
+public static void makeFlatEnd(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agnode_s n, ST_Agedge_s e, ST_pathend_t endp, boolean isBegin) {
ENTERING("fybar4mljnmkh3kure5k1eod","makeFlatEnd");
try {
final ST_boxf b = new ST_boxf();
@@ -2060,9 +2053,9 @@ try {
endp.setInt("sidemask", 1<<2);
if (isBegin) beginpath(P, e, 2, endp, false);
else endpath(P, e, 2, endp, false);
- b.UR.y = ((ST_boxf)endp.getArrayOfStruct("boxes").plus(endp.getInt("boxn") - 1).getStruct()).UR.y;
- b.LL.y = ((ST_boxf)endp.getArrayOfStruct("boxes").plus(endp.getInt("boxn") - 1).getStruct()).LL.y;
- b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).getDouble("y") + GD_rank(g).plus(ND_rank(n)).getDouble("ht2")));
+ b.UR.y = endp.boxes[endp.boxn - 1].UR.y;
+ b.LL.y = endp.boxes[endp.boxn - 1].LL.y;
+ b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).y + GD_rank(g).get(ND_rank(n)).ht2));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("cmjm4y40vf7wklmgz0ae4k36v"); // endp->boxes[endp->boxn++] = b;
} finally {
@@ -2100,23 +2093,23 @@ throw new UnsupportedOperationException();
//3 w8ptjibydq995d2lexg85mku
// static void make_flat_labeled_edge(graph_t* g, spline_info_t* sp, path* P, edge_t* e, int et)
-public static void make_flat_labeled_edge(Agraph_s g, spline_info_t sp, path P, Agedge_s e, int et) {
+public static void make_flat_labeled_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s e, int et) {
ENTERING("w8ptjibydq995d2lexg85mku","make_flat_labeled_edge");
try {
- Agnode_s tn, hn, ln;
- pointf ps = null;
- final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
+ ST_Agnode_s tn, hn, ln;
+ ST_pointf.Array ps = null;
+ final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
final ST_boxf lb = new ST_boxf();
int boxn, i, ydelta;
int pn[] = new int[1];
- Agedge_s f;
- final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 7);
+ ST_Agedge_s f;
+ final ST_pointf.Array points = new ST_pointf.Array( 7);
tn = agtail(e);
hn = aghead(e);
for (f = ED_to_virt(e); ED_to_virt(f)!=null; f = ED_to_virt(f));
ln = agtail(f);
ED_label(e).setStruct("pos", ND_coord(ln));
- ED_label(e).setBoolean("set", NOT(false));
+ ED_label(e).set= NOTI(false);
if (et == (1 << 1)) {
UNSUPPORTED("ataaqkehwb736ts2x6olzqokx"); // pointf startp, endp, lp;
UNSUPPORTED("48h6vk2e5niep4dmpua377248"); // startp = add_pointf(ND_coord(tn), ED_tail_port(e).p);
@@ -2130,39 +2123,39 @@ UNSUPPORTED("68ojpcos92c96bc0i5ag1yb6v"); // ps = points;
UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7;
}
else {
- lb.LL.x = ND_coord(ln).getDouble("x") - ND_lw(ln);
- lb.UR.x = ND_coord(ln).getDouble("x") + ND_rw(ln);
- lb.UR.y = ND_coord(ln).getDouble("y") + ND_ht(ln)/2;
- ydelta = (int)(ND_coord(ln).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1") -
- ND_coord(tn).getDouble("y") + GD_rank(g).plus(ND_rank(tn)).getDouble("ht2"));
+ lb.LL.x = ND_coord(ln).x - ND_lw(ln);
+ lb.UR.x = ND_coord(ln).x + ND_rw(ln);
+ lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2;
+ ydelta = (int)(ND_coord(ln).y - GD_rank(g).get(ND_rank(tn)).ht1 -
+ ND_coord(tn).y + GD_rank(g).get(ND_rank(tn)).ht2);
ydelta = (int)(ydelta / 6.);
lb.LL.y = lb.UR.y - MAX(5.,ydelta);
boxn = 0;
- makeFlatEnd (g, sp, P, tn, e, tend.amp(), NOT(false));
- makeFlatEnd (g, sp, P, hn, e, hend.amp(), false);
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).UR.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = lb.LL.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.LL.y;
+ makeFlatEnd (g, sp, P, tn, e, tend, NOT(false));
+ makeFlatEnd (g, sp, P, hn, e, hend, false);
+ ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x;
+ ((Z.z().boxes[boxn])).LL.y = (tend).boxes[tend.boxn - 1].UR.y;
+ ((Z.z().boxes[boxn])).UR.x = lb.LL.x;
+ ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
boxn++;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = lb.LL.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.UR.y;
+ ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x;
+ ((Z.z().boxes[boxn])).LL.y = lb.LL.y;
+ ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
+ ((Z.z().boxes[boxn])).UR.y = lb.UR.y;
boxn++;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = lb.UR.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.LL.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.x;
+ ((Z.z().boxes[boxn])).LL.x = lb.UR.x;
+ ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
+ ((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.boxn - 1].UR.y;
+ ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
boxn++;
- for (i = 0; i < tend.getInt("boxn"); i++) add_box(P, (ST_boxf)tend.getArrayOfStruct("boxes").plus(i).getStruct());
- for (i = 0; i < boxn; i++) add_box(P, (ST_boxf)Z.z().boxes.plus(i).getStruct());
- for (i = hend.getInt("boxn") - 1; i >= 0; i--) add_box(P, (ST_boxf)hend.getArrayOfStruct("boxes").plus(i).getStruct());
+ for (i = 0; i < tend.boxn; i++) add_box(P, (tend).boxes[i]);
+ for (i = 0; i < boxn; i++) add_box(P, Z.z().boxes[i]);
+ for (i = hend.boxn - 1; i >= 0; i--) add_box(P, (hend).boxes[i]);
if (et == (5 << 1)) ps = routesplines(P, pn);
else ps = routepolylines(P, pn);
if (pn[0] == 0) return;
}
- clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
+ clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
} finally {
LEAVING("w8ptjibydq995d2lexg85mku","make_flat_labeled_edge");
}
@@ -2242,26 +2235,26 @@ throw new UnsupportedOperationException();
//3 6yr3jfkljl5w0z6dv354ryx63
// static void make_flat_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
-public static void make_flat_edge(Agraph_s g, spline_info_t sp, path P, __ptr__ edges, int ind, int cnt, int et) {
+public static void make_flat_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) {
ENTERING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
try {
- Agnode_s tn, hn;
- final __struct__<Agedgeinfo_t> fwdedgei = JUtils.from(Agedgeinfo_t.class);
- final __struct__<Agedgepair_s> fwdedge = JUtils.from(Agedgepair_s.class);
- Agedge_s e;
+ ST_Agnode_s tn, hn;
+ final ST_Agedgeinfo_t fwdedgei = new ST_Agedgeinfo_t();
+ final ST_Agedgepair_s fwdedge = new ST_Agedgepair_s();
+ ST_Agedge_s e;
int j, i, r, isAdjacent;
double stepx, stepy, vspace;
int tside, hside;
int pn[] = new int[] {0};
- pointf ps;
- final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
- fwdedge.getStruct("out").getStruct("base").setPtr("data", fwdedgei.amp());
+ ST_pointf.Array ps;
+ final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
+ fwdedge.out.base.setPtr("data", fwdedgei);
/* Get sample edge; normalize to go from left to right */
- e = (Agedge_s) edges.plus(ind).getPtr();
+ e = (ST_Agedge_s) edges.get(ind);
isAdjacent = ED_adjacent(e);
if ((ED_tree_index(e) & 32)!=0) {
- MAKEFWDEDGE(fwdedge.getStruct("out").amp(), e);
- e = (Agedge_s) fwdedge.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedge.out, e);
+ e = (ST_Agedge_s) fwdedge.out;
}
for (i = 1; i < cnt; i++) {
if (ED_adjacent(edges.plus(ind+i).getPtr())!=0) {
@@ -2284,8 +2277,8 @@ try {
makeSimpleFlat (agtail(e), aghead(e), edges, ind, cnt, et);
return;
}
- tside = ED_tail_port(e).getInt("side");
- hside = ED_head_port(e).getInt("side");
+ tside = ED_tail_port(e).side;
+ hside = ED_head_port(e).side;
if (((tside == (1<<0)) && (hside != (1<<2))) ||
((hside == (1<<0)) && (tside != (1<<2)))) {
make_flat_bottom_edges (g, sp, P, edges, ind, cnt, e, et == (5 << 1));
@@ -2295,52 +2288,52 @@ try {
hn = aghead(e);
r = ND_rank(tn);
if (r > 0) {
- __ptr__ prevr;
+ ST_rank_t.Array2 prevr;
if ((GD_has_labels(g) & (1 << 0))!=0)
prevr = GD_rank(g).plus(r-2);
else
prevr = GD_rank(g).plus(r-1);
- vspace = ND_coord(prevr.getPtr().getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - prevr.getPtr().getDouble("ht1")
- - ND_coord(tn).getDouble("y") - GD_rank(g).plus(r).getDouble("ht2");
+ vspace = ND_coord(prevr.getPtr().v.get(0)).y - prevr.getPtr().ht1
+ - ND_coord(tn).y - GD_rank(g).get(r).ht2;
}
else {
vspace = GD_ranksep(g);
}
- stepx = ((double)sp.getInt("Multisep")) / (cnt+1);
+ stepx = ((double)sp.Multisep) / (cnt+1);
stepy = vspace / (cnt+1);
- makeFlatEnd (g, sp, P, tn, e, tend.amp(), true);
- makeFlatEnd (g, sp, P, hn, e, hend.amp(), false);
+ makeFlatEnd (g, sp, P, tn, e, tend, true);
+ makeFlatEnd (g, sp, P, hn, e, hend, false);
for (i = 0; i < cnt; i++) {
int boxn;
final ST_boxf b = new ST_boxf();
- e = (Agedge_s) edges.plus(ind + i).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
boxn = 0;
- b.___(tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct());
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = b.LL.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = b.UR.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = b.UR.x + (i + 1) * stepx;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = b.UR.y + (i + 1) * stepy;
+ b.___((tend).boxes[tend.boxn - 1]);
+ ((Z.z().boxes[boxn])).LL.x = b.LL.x;
+ ((Z.z().boxes[boxn])).LL.y = b.UR.y;
+ ((Z.z().boxes[boxn])).UR.x = b.UR.x + (i + 1) * stepx;
+ ((Z.z().boxes[boxn])).UR.y = b.UR.y + (i + 1) * stepy;
boxn++;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)(tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct())).LL.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)Z.z().boxes.plus(boxn-1).getStruct()).UR.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)(hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct())).UR.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y + stepy;
+ ((Z.z().boxes[boxn])).LL.x = ((ST_boxf)((tend).boxes[tend.boxn - 1])).LL.x;
+ ((Z.z().boxes[boxn])).LL.y = (Z.z().boxes[boxn-1]).UR.y;
+ ((Z.z().boxes[boxn])).UR.x = ((ST_boxf)((hend).boxes[hend.boxn - 1])).UR.x;
+ ((Z.z().boxes[boxn])).UR.y = ((Z.z().boxes[boxn])).LL.y + stepy;
boxn++;
- b.___(hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct());
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = b.UR.x;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = b.UR.y;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = b.LL.x - (i + 1) * stepx;
- ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = ((ST_boxf)Z.z().boxes.plus(boxn-1).getStruct()).LL.y;
+ b.___((hend).boxes[hend.boxn - 1]);
+ ((Z.z().boxes[boxn])).UR.x = b.UR.x;
+ ((Z.z().boxes[boxn])).LL.y = b.UR.y;
+ ((Z.z().boxes[boxn])).LL.x = b.LL.x - (i + 1) * stepx;
+ ((Z.z().boxes[boxn])).UR.y = (Z.z().boxes[boxn-1]).LL.y;
boxn++;
- for (j = 0; j < tend.getInt("boxn"); j++) add_box(P, (ST_boxf)tend.getArrayOfStruct("boxes").plus(j).getStruct());
- for (j = 0; j < boxn; j++) add_box(P, (ST_boxf)Z.z().boxes.plus(j).getStruct());
- for (j = hend.getInt("boxn") - 1; j >= 0; j--) add_box(P, (ST_boxf)hend.getArrayOfStruct("boxes").plus(j).getStruct());
- if (et == (5 << 1)) ps = (pointf) routesplines(P, pn);
- else ps = (pointf) routepolylines(P, pn);
+ for (j = 0; j < tend.boxn; j++) add_box(P, (tend).boxes[j]);
+ for (j = 0; j < boxn; j++) add_box(P, Z.z().boxes[j]);
+ for (j = hend.boxn - 1; j >= 0; j--) add_box(P, (hend).boxes[j]);
+ if (et == (5 << 1)) ps = routesplines(P, pn);
+ else ps = routepolylines(P, pn);
if (pn[0] == 0)
return;
- clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
- P.setInt("nbox", 0);
+ clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
+ P.nbox = 0;
}
} finally {
LEAVING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
@@ -2370,7 +2363,7 @@ throw new UnsupportedOperationException();
//3 2n9bpvx34fnukqu1f9u4v7v6n
// static int makeLineEdge(graph_t* g, edge_t* fe, pointf* points, node_t** hp)
-public static int makeLineEdge(Agraph_s g, Agedge_s fe, __ptr__ points, __ptr__ hp) {
+public static int makeLineEdge(ST_Agraph_s g, ST_Agedge_s fe, __ptr__ points, __ptr__ hp) {
ENTERING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge");
try {
UNSUPPORTED("d9cz56vtrl0ri6hz88cumukuf"); // static int
@@ -2441,37 +2434,37 @@ LEAVING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge");
-//3 30wfq1dby4t07hft9io52nq6z
-// static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
//private static __ptr__ pointfs;
//private static __ptr__ pointfs2;
//private static int numpts;
//private static int numpts2;
-public static void make_regular_edge(Agraph_s g, spline_info_t sp, path P, __ptr__ edges, int ind, int cnt, int et) {
+//3 30wfq1dby4t07hft9io52nq6z
+// static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
+public static void make_regular_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) {
ENTERING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
try {
- Agnode_s tn, hn = null;
- final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class), fwdedgei = JUtils.from(Agedgeinfo_t.class);
- final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class), fwdedge = JUtils.from(Agedgepair_s.class);
- Agedge_s e, fe, le, segfirst;
- pointf ps = null;
- final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
+ ST_Agnode_s tn, hn = null;
+ final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t(), fwdedgei = new ST_Agedgeinfo_t();
+ final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s(), fwdedge = new ST_Agedgepair_s();
+ ST_Agedge_s e, fe, le, segfirst;
+ ST_pointf.Array ps = null;
+ final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
final ST_boxf b = new ST_boxf();
int boxn, sl, si, i, j, dx, hackflag, longedge;
boolean smode;
int pn[] = new int[] {0};
int pointn[] = new int[] {0};
- fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
- fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
- fwdedge.getStruct("out").getStruct("base").setPtr("data", fwdedgei.amp());
+ fwdedgea.out.base.setPtr("data", fwdedgeai);
+ fwdedgeb.out.base.setPtr("data", fwdedgebi);
+ fwdedge.out.base.setPtr("data", fwdedgei);
if (N(Z.z().pointfs)) {
- Z.z().pointfs = gmalloc(sizeof(pointf.class, 2000));
- Z.z().pointfs2 = gmalloc(sizeof(pointf.class, 2000));
+ Z.z().pointfs = new ST_pointf.Array(2000);
+ Z.z().pointfs2 = new ST_pointf.Array(2000);
Z.z().numpts = 2000;
Z.z().numpts2 = 2000;
}
sl = 0;
- e = (Agedge_s) edges.plus(ind).getPtr();
+ e = (ST_Agedge_s) edges.get(ind);
hackflag = 0;
if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) {
UNSUPPORTED("8f17srpa5iisomehrb4b01h51"); // fwdedgeai = *(Agedgeinfo_t*)e->base.data;
@@ -2499,8 +2492,8 @@ UNSUPPORTED("eih8eaai768x1un5mixrtgstp"); // e = &fwdedgea.out;
UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
} else {
if ((ED_tree_index(e) & 32)!=0) {
- MAKEFWDEDGE(fwdedgea.getPtr("out"), e);
- e = (Agedge_s) fwdedgea.getPtr("out");
+ MAKEFWDEDGE(fwdedgea.out, e);
+ e = fwdedgea.out;
}
}
fe = e;
@@ -2515,24 +2508,24 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
tn = agtail(e);
hn = aghead(e);
b.___(maximal_bbox(g, sp, tn, null, e));
- tend.getStruct("nb").___(b);
- beginpath(P, e, 1, tend.amp(), spline_merge(tn));
+ tend.nb.___(b);
+ beginpath(P, e, 1, tend, spline_merge(tn));
b.UR.y =
- ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).UR.y;
+ (tend).boxes[tend.boxn - 1].UR.y;
b.LL.y =
- ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.y;
+ (tend).boxes[tend.boxn - 1].LL.y;
b.___(makeregularend(b, (1<<0),
- ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1")));
+ ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{
- tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn")).setStruct(b);
- tend.setInt("boxn", tend.getInt("boxn") + 1);
+ tend.boxes[tend.boxn].___(b);
+ tend.setInt("boxn", tend.boxn + 1);
}
longedge = 0;
smode = false; si = -1;
- while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", hn)).booleanValue())) {
+ while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(hn)).booleanValue())) {
longedge = 1;
- Z.z().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
+ Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
if (N(smode)
&& ((sl = straight_len(hn)) >=
((GD_has_labels(g) & (1 << 0))!=0 ? 4 + 1 : 2 + 1))) {
@@ -2541,21 +2534,21 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
}
if (N(smode) || si > 0) {
si--;
- Z.z().boxes.plus(boxn++).setStruct( maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getFromList(0)));
- e = (Agedge_s) ND_out(hn).getFromList(0);
+ Z.z().boxes[boxn++].___(maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0)));
+ e = (ST_Agedge_s) ND_out(hn).getFromList(0);
tn = agtail(e);
hn = aghead(e);
continue;
}
- hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getFromList(0)));
- endpath(P, e, 1, hend.amp(), spline_merge(aghead(e)));
- b.___(makeregularend((ST_boxf) hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct(), (1<<2),
- ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2")));
+ hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0)));
+ endpath(P, e, 1, hend, spline_merge(aghead(e)));
+ b.___(makeregularend((hend).boxes[hend.boxn - 1], (1<<2),
+ ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b;
- P.getStruct("end").setDouble("theta", M_PI / 2);
- P.getStruct("end").setBoolean("constrained", NOT(false));
- completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn, 1);
+ P.end.setDouble("theta", M_PI / 2);
+ P.end.constrained= NOTI(false);
+ completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, 1);
if (splines) ps = routesplines(P, pn);
else {
UNSUPPORTED("biyp75vm751j3qmqacagfej4b"); // ps = routepolylines (P, &pn);
@@ -2577,36 +2570,36 @@ UNSUPPORTED("8kbxhk7qirj3tr7hn1ukwar3h"); // pointfs = RALLOC(numpts, pointfs,
for (i = 0; i < pn[0]; i++) {
Z.z().pointfs.plus(pointn[0]++).setStruct(ps.plus(i).getStruct());
}
- e = straight_path((Agedge_s)ND_out(hn).getFromList(0), sl, Z.z().pointfs, pointn);
+ e = straight_path((ST_Agedge_s)ND_out(hn).getFromList(0), sl, Z.z().pointfs, pointn);
recover_slack(segfirst, P);
segfirst = e;
tn = agtail(e);
hn = aghead(e);
boxn = 0;
- tend.setStruct("nb", maximal_bbox(g, sp, tn, (Agedge_s) ND_in(tn).getFromList(0), e));
- beginpath(P, e, 1, tend.amp(), spline_merge(tn));
- b.___(makeregularend((ST_boxf) tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct(), (1<<0),
- ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1")));
+ tend.setStruct("nb", maximal_bbox(g, sp, tn, (ST_Agedge_s) ND_in(tn).getFromList(0), e));
+ beginpath(P, e, 1, tend, spline_merge(tn));
+ b.___(makeregularend((tend).boxes[tend.boxn - 1], (1<<0),
+ ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = b;
- P.getStruct("start").setDouble("theta", -M_PI / 2);
- P.getStruct("start").setBoolean("constrained", NOT(false));
+ P.start.setDouble("theta", -M_PI / 2);
+ P.start.constrained= NOTI(false);
smode = false;
}
- Z.z().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
+ Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
b.___(maximal_bbox(g, sp, hn, e, null));
- hend.getStruct("nb").___(b);
- endpath(P, hackflag!=0 ? fwdedgeb.getStruct("out").amp() : e, 1, hend.amp(), spline_merge(aghead(e)));
- b.UR.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.y;
- b.LL.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).LL.y;
+ hend.nb.___(b);
+ endpath(P, (ST_Agedge_s) (hackflag!=0 ? fwdedgeb.out : e), 1, hend, spline_merge(aghead(e)));
+ b.UR.y = (hend).boxes[hend.boxn - 1].UR.y;
+ b.LL.y = (hend).boxes[hend.boxn - 1].LL.y;
b.___(makeregularend(b, (1<<2),
- ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2")));
+ ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2));
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{
- hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn")).setStruct(b);
- hend.setInt("boxn", hend.getInt("boxn")+1);
+ hend.boxes[hend.boxn].___(b);
+ hend.setInt("boxn", hend.boxn+1);
}
- completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn,
+ completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn,
longedge);
if (splines) ps = routesplines(P, pn);
else ps = routepolylines (P, pn);
@@ -2630,34 +2623,34 @@ UNSUPPORTED("bedaqcn9h03q6ia6zbezuee1m"); // pointfs = RALLOC(numpts, point
pointn[0]++;
}
recover_slack(segfirst, P);
- hn = hackflag!=0 ? aghead(fwdedgeb.getStruct("out").amp()) : aghead(e);
+ hn = hackflag!=0 ? aghead(fwdedgeb.out) : aghead(e);
}
/* make copies of the spline points, one per multi-edge */
if (cnt == 1) {
- clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo.amp());
+ clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo);
return;
}
- dx = sp.getInt("Multisep") * (cnt - 1) / 2;
+ dx = sp.Multisep * (cnt - 1) / 2;
for (i = 1; i < pointn[0] - 1; i++)
- Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") - dx);
+ Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x - dx);
if (Z.z().numpts > Z.z().numpts2) {
UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts;
UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf);
}
for (i = 0; i < pointn[0]; i++)
Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
- clip_and_install(fe, hn, Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
+ clip_and_install(fe, hn, Z.z().pointfs2, pointn[0], Z.z().sinfo);
for (j = 1; j < cnt; j++) {
- e = (Agedge_s) edges.plus(ind + j).getPtr();
+ e = (ST_Agedge_s) edges.plus(ind + j).getPtr();
if ((ED_tree_index(e) & 32)!=0) {
- MAKEFWDEDGE(fwdedge.getStruct("out").amp(), e);
- e = (Agedge_s) fwdedge.getStruct("out").amp();
+ MAKEFWDEDGE(fwdedge.out, e);
+ e = (ST_Agedge_s) fwdedge.out;
}
for (i = 1; i < pointn[0] - 1; i++)
- Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") + sp.getInt("Multisep"));
+ Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x + sp.Multisep);
for (i = 0; i < pointn[0]; i++)
Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
- clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
+ clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo);
}
} finally {
LEAVING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
@@ -2669,13 +2662,13 @@ LEAVING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
//3 va61hggynvb6z6j34w7otmab
// static void completeregularpath(path * P, edge_t * first, edge_t * last, pathend_t * tendp, pathend_t * hendp, boxf * boxes, int boxn, int flag)
-public static void completeregularpath(path P, Agedge_s first, Agedge_s last, pathend_t tendp, pathend_t hendp, __array_of_struct__ boxes, int boxn, int flag) {
+public static void completeregularpath(ST_path P, ST_Agedge_s first, ST_Agedge_s last, ST_pathend_t tendp, ST_pathend_t hendp, ST_boxf[] boxes, int boxn, int flag) {
ENTERING("va61hggynvb6z6j34w7otmab","completeregularpath");
try {
- Agedge_s uleft, uright, lleft, lright;
+ ST_Agedge_s uleft, uright, lleft, lright;
int i, fb, lb;
- splines spl;
- pointf pp;
+ ST_splines spl;
+ ST_pointf.Array pp;
int pn;
fb = lb = -1;
uleft = uright = null;
@@ -2683,35 +2676,35 @@ try {
uright = top_bound(first, 1);
if (uleft!=null) {
if (N(spl = getsplinepoints(uleft))) return;
- pp = (pointf) spl.getArrayOfPtr("list").plus(0).getPtr().getPtr("list");
- pn = spl.getArrayOfPtr("list").plus(0).getPtr().getInt("size");
+ pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
+ pn = spl.list.get(0).size;
}
if (uright!=null) {
if (N(spl = getsplinepoints(uright))) return;
- pp = (pointf) spl.getArrayOfPtr("list").plus(0).getPtr().getPtr("list");
- pn = spl.getArrayOfPtr("list").plus(0).getPtr().getInt("size");
+ pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
+ pn = spl.list.get(0).size;
}
lleft = lright = null;
lleft = bot_bound(last, -1);
lright = bot_bound(last, 1);
if (lleft!=null) {
if (N(spl = getsplinepoints(lleft))) return;
- pp = (pointf) spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getPtr("list");
- pn = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getInt("size");
+ pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
+ pn = spl.list.plus(spl.size - 1).getPtr().size;
}
if (lright!=null) {
if (N(spl = getsplinepoints(lright))) return;
- pp = (pointf) spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getPtr("list");
- pn = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getInt("size");
+ pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
+ pn = spl.list.plus(spl.size - 1).getPtr().size;
}
- for (i = 0; i < tendp.getInt("boxn"); i++)
- add_box(P, (ST_boxf)tendp.getArrayOfStruct("boxes").plus(i).getStruct());
- fb = P.getInt("nbox") + 1;
+ for (i = 0; i < tendp.boxn; i++)
+ add_box(P, (tendp).boxes[i]);
+ fb = P.nbox + 1;
lb = fb + boxn - 3;
for (i = 0; i < boxn; i++)
- add_box(P, (ST_boxf)boxes.plus(i).getStruct());
- for (i = hendp.getInt("boxn") - 1; i >= 0; i--)
- add_box(P, (ST_boxf)hendp.getArrayOfStruct("boxes").plus(i).getStruct());
+ add_box(P, boxes[i]);
+ for (i = hendp.boxn - 1; i >= 0; i--)
+ add_box(P, (hendp).boxes[i]);
adjustregularpath(P, fb, lb);
} finally {
LEAVING("va61hggynvb6z6j34w7otmab","completeregularpath");
@@ -2723,14 +2716,14 @@ LEAVING("va61hggynvb6z6j34w7otmab","completeregularpath");
//3 3wwhczhpkcnflwr1l9wcga7tq
// static boxf makeregularend(boxf b, int side, double y)
-public static __struct__<boxf> makeregularend(final ST_boxf b, int side, double y) {
+public static ST_boxf makeregularend(final ST_boxf b, int side, double y) {
// WARNING!! STRUCT
return makeregularend_w_(b.copy(), side, y).copy();
}
-private static __struct__<boxf> makeregularend_w_(final ST_boxf b, int side, double y) {
+private static ST_boxf makeregularend_w_(final ST_boxf b, int side, double y) {
ENTERING("3wwhczhpkcnflwr1l9wcga7tq","makeregularend");
try {
- final __struct__<boxf> newb = JUtils.from(boxf.class);
+ final ST_boxf newb = new ST_boxf();
switch (side) {
case (1<<0):
newb.___(boxfof(b.LL.x, y, b.UR.x, b.LL.y));
@@ -2750,40 +2743,40 @@ LEAVING("3wwhczhpkcnflwr1l9wcga7tq","makeregularend");
//3 88xrlzjovkxcnay9b2y5zyiid
// static void adjustregularpath(path * P, int fb, int lb)
-public static void adjustregularpath(path P, int fb, int lb) {
+public static void adjustregularpath(ST_path P, int fb, int lb) {
ENTERING("88xrlzjovkxcnay9b2y5zyiid","adjustregularpath");
try {
- boxf bp1, bp2;
+ ST_boxf bp1, bp2;
int i, x;
for (i = fb-1; i < lb+1; i++) {
- bp1 = P.getArrayOfPtr("boxes").plus(i).getStruct().amp();
+ bp1 = (ST_boxf) P.boxes[i];
if ((i - fb) % 2 == 0) {
- if (bp1.getStruct("LL").getDouble("x") >= bp1.getStruct("UR").getDouble("x")) {
- x = (int)((bp1.getStruct("LL").getDouble("x") + bp1.getStruct("UR").getDouble("x")) / 2);
- bp1.getStruct("LL").setDouble("x", x - 8);
- bp1.getStruct("UR").setDouble("x", x + 8);
+ if (bp1.LL.x >= bp1.UR.x) {
+ x = (int)((bp1.LL.x + bp1.UR.x) / 2);
+ bp1.LL.setDouble("x", x - 8);
+ bp1.UR.setDouble("x", x + 8);
}
} else {
- if (bp1.getStruct("LL").getDouble("x") + 16 > bp1.getStruct("UR").getDouble("x")) {
- x = (int)((bp1.getStruct("LL").getDouble("x") + bp1.getStruct("UR").getDouble("x")) / 2);
- bp1.getStruct("LL").setDouble("x", x - 8);
- bp1.getStruct("UR").setDouble("x", x + 8);
+ if (bp1.LL.x + 16 > bp1.UR.x) {
+ x = (int)((bp1.LL.x + bp1.UR.x) / 2);
+ bp1.LL.setDouble("x", x - 8);
+ bp1.UR.setDouble("x", x + 8);
}
}
}
- for (i = 0; i < P.getInt("nbox") - 1; i++) {
- bp1 = P.getArrayOfPtr("boxes").plus(i).getStruct().amp();
- bp2 = P.getArrayOfPtr("boxes").plus(i+1).getStruct().amp();
+ for (i = 0; i < P.nbox - 1; i++) {
+ bp1 = (ST_boxf) P.boxes[i];
+ bp2 = (ST_boxf) P.boxes[i+1];
if (i >= fb && i <= lb && (i - fb) % 2 == 0) {
- if (bp1.getStruct("LL").getDouble("x") + 16 > bp2.getStruct("UR").getDouble("x"))
- bp2.getStruct("UR").setDouble("x", bp1.getStruct("LL").getDouble("x") + 16);
- if (bp1.getStruct("UR").getDouble("x") - 16 < bp2.getStruct("LL").getDouble("x"))
- bp2.getStruct("LL").setDouble("x", bp1.getStruct("UR").getDouble("x") - 16);
+ if (bp1.LL.x + 16 > bp2.UR.x)
+ bp2.UR.setDouble("x", bp1.LL.x + 16);
+ if (bp1.UR.x - 16 < bp2.LL.x)
+ bp2.LL.setDouble("x", bp1.UR.x - 16);
} else if (i + 1 >= fb && i < lb && (i + 1 - fb) % 2 == 0) {
- if (bp1.getStruct("LL").getDouble("x") + 16 > bp2.getStruct("UR").getDouble("x"))
- bp1.getStruct("LL").setDouble("x", bp2.getStruct("UR").getDouble("x") - 16);
- if (bp1.getStruct("UR").getDouble("x") - 16 < bp2.getStruct("LL").getDouble("x"))
- bp1.getStruct("UR").setDouble("x", bp2.getStruct("LL").getDouble("x") + 16);
+ if (bp1.LL.x + 16 > bp2.UR.x)
+ bp1.LL.setDouble("x", bp2.UR.x - 16);
+ if (bp1.UR.x - 16 < bp2.LL.x)
+ bp1.UR.setDouble("x", bp2.LL.x + 16);
}
}
} finally {
@@ -2796,26 +2789,26 @@ LEAVING("88xrlzjovkxcnay9b2y5zyiid","adjustregularpath");
//3 bajn5vx0isu427n6dh131b985
// static boxf rank_box(spline_info_t* sp, graph_t * g, int r)
-public static ST_boxf rank_box(spline_info_t sp, Agraph_s g, int r) {
+public static ST_boxf rank_box(ST_spline_info_t sp, ST_Agraph_s g, int r) {
// WARNING!! STRUCT
return rank_box_w_(sp, g, r).copy();
}
-private static ST_boxf rank_box_w_(spline_info_t sp, Agraph_s g, int r) {
+private static ST_boxf rank_box_w_(ST_spline_info_t sp, ST_Agraph_s g, int r) {
ENTERING("bajn5vx0isu427n6dh131b985","rank_box");
try {
final ST_boxf b = new ST_boxf();
- Agnode_s /* *right0, *right1, */ left0, left1;
- b.___(sp.getPtr("Rank_box").plus(r).getStruct());
+ ST_Agnode_s /* *right0, *right1, */ left0, left1;
+ b.___(sp.Rank_box[r]);
if (b.LL.x == b.UR.x) {
- left0 = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
+ left0 = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
/* right0 = GD_rank(g)[r].v[GD_rank(g)[r].n - 1]; */
- left1 = (Agnode_s) GD_rank(g).plus(r + 1).getArrayOfPtr("v").plus(0).getPtr();
+ left1 = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(0);
/* right1 = GD_rank(g)[r + 1].v[GD_rank(g)[r + 1].n - 1]; */
- b.LL.x = sp.getInt("LeftBound");
- b.LL.y = ND_coord(left1).getDouble("y") + GD_rank(g).plus(r + 1).getDouble("ht2");
- b.UR.x = sp.getInt("RightBound");
- b.UR.y = ND_coord(left0).getDouble("y") - GD_rank(g).plus(r).getDouble("ht1");
- sp.getPtr("Rank_box").plus(r).setStruct(b);
+ b.LL.x = sp.LeftBound;
+ b.LL.y = ND_coord(left1).y + GD_rank(g).get(r + 1).ht2;
+ b.UR.x = sp.RightBound;
+ b.UR.y = ND_coord(left0).y - GD_rank(g).get(r).ht1;
+ sp.Rank_box[r].setStruct(b);
}
return b;
} finally {
@@ -2828,19 +2821,19 @@ LEAVING("bajn5vx0isu427n6dh131b985","rank_box");
//3 6qwcnugx2ytjrvi5rgxzyzg5i
// static int straight_len(node_t * n)
-public static int straight_len(Agnode_s n) {
+public static int straight_len(ST_Agnode_s n) {
ENTERING("6qwcnugx2ytjrvi5rgxzyzg5i","straight_len");
try {
int cnt = 0;
- Agnode_s v;
+ ST_Agnode_s v;
v = n;
while (true) {
- v = (Agnode_s) aghead(ND_out(v).getFromList(0));
+ v = (ST_Agnode_s) aghead(ND_out(v).getFromList(0));
if (ND_node_type(v) != 1)
break;
if ((ND_out(v).size != 1) || (ND_in(v).size != 1))
break;
- if (ND_coord(v).getDouble("x") != ND_coord(n).getDouble("x"))
+ if (ND_coord(v).x != ND_coord(n).x)
break;
cnt++;
}
@@ -2855,13 +2848,13 @@ LEAVING("6qwcnugx2ytjrvi5rgxzyzg5i","straight_len");
//3 15pgjjuil2c1rjldu29j07gbz
// static edge_t *straight_path(edge_t * e, int cnt, pointf * plist, int *np)
-public static Agedge_s straight_path(Agedge_s e, int cnt, __ptr__ plist, int np[]) {
+public static ST_Agedge_s straight_path(ST_Agedge_s e, int cnt, __ptr__ plist, int np[]) {
ENTERING("15pgjjuil2c1rjldu29j07gbz","straight_path");
try {
int n = np[0];
- Agedge_s f = e;
+ ST_Agedge_s f = e;
while ((cnt--)!=0)
- f = (Agedge_s) ND_out(aghead(f)).getFromList(0);
+ f = (ST_Agedge_s) ND_out(aghead(f)).getFromList(0);
plist.plus(np[0]++).setStruct(plist.plus(n - 1).getStruct());
plist.plus(np[0]++).setStruct(plist.plus(n - 1).getStruct());
plist.plus(np[0]).setStruct(ND_coord(agtail(f))); /* will be overwritten by next spline */
@@ -2876,28 +2869,28 @@ LEAVING("15pgjjuil2c1rjldu29j07gbz","straight_path");
//3 4ilkzqtegd5uffawb4qcjthu1
// static void recover_slack(edge_t * e, path * p)
-public static void recover_slack(Agedge_s e, path p) {
+public static void recover_slack(ST_Agedge_s e, ST_path p) {
ENTERING("4ilkzqtegd5uffawb4qcjthu1","recover_slack");
try {
int b;
- Agnode_s vn;
+ ST_Agnode_s vn;
b = 0; /* skip first rank box */
for (vn = aghead(e);
- ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", vn)).booleanValue());
+ ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(vn)).booleanValue());
vn = aghead(ND_out(vn).getFromList(0))) {
- while ((b < p.getInt("nbox")) && (p.getPtr("boxes").plus(b).getStruct("LL").getDouble("y") > ND_coord(vn).getDouble("y")))
+ while ((b < p.nbox) && (p.boxes[b].LL.y > ND_coord(vn).y))
b++;
- if (b >= p.getInt("nbox"))
+ if (b >= p.nbox)
break;
- if (p.getPtr("boxes").plus(b).getStruct("UR").getDouble("y") < ND_coord(vn).getDouble("y"))
+ if (p.boxes[b].UR.y < ND_coord(vn).y)
continue;
if (ND_label(vn)!=null)
- resize_vn(vn, (int)p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x"), (int)p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x"),
- (int)(p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x") + ND_rw(vn)));
+ resize_vn(vn, (int)p.boxes[b].LL.x, (int)p.boxes[b].UR.x,
+ (int)(p.boxes[b].UR.x + ND_rw(vn)));
else
- resize_vn(vn, (int)p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x"), (int)((p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x") +
- p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x")) / 2),
- (int)p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x"));
+ resize_vn(vn, (int)p.boxes[b].LL.x, (int)((p.boxes[b].LL.x +
+ p.boxes[b].UR.x) / 2),
+ (int)p.boxes[b].UR.x);
}
} finally {
LEAVING("4ilkzqtegd5uffawb4qcjthu1","recover_slack");
@@ -2909,7 +2902,7 @@ LEAVING("4ilkzqtegd5uffawb4qcjthu1","recover_slack");
//3 3vmg1q1r0eb14etvjdk4cukpd
// static void resize_vn(vn, lx, cx, rx) node_t *vn
-public static void resize_vn(Agnode_s vn, int lx, int cx, int rx) {
+public static void resize_vn(ST_Agnode_s vn, int lx, int cx, int rx) {
ENTERING("3vmg1q1r0eb14etvjdk4cukpd","resize_vn");
try {
ND_coord(vn).setDouble("x", cx);
@@ -2925,12 +2918,12 @@ LEAVING("3vmg1q1r0eb14etvjdk4cukpd","resize_vn");
//3 9t0v5wicmjuc3ij9hko6iawle
// static edge_t *top_bound(edge_t * e, int side)
-public static Agedge_s top_bound(Agedge_s e, int side) {
+public static ST_Agedge_s top_bound(ST_Agedge_s e, int side) {
ENTERING("9t0v5wicmjuc3ij9hko6iawle","top_bound");
try {
- Agedge_s f, ans = null;
+ ST_Agedge_s f, ans = null;
int i;
- for (i = 0; (f = (Agedge_s) ND_out(agtail(e)).getFromList(i))!=null; i++) {
+ for (i = 0; (f = (ST_Agedge_s) ND_out(agtail(e)).getFromList(i))!=null; i++) {
if (side * (ND_order(aghead(f)) - ND_order(aghead(e))) <= 0)
continue;
if ((ED_spl(f) == null)
@@ -2951,12 +2944,12 @@ LEAVING("9t0v5wicmjuc3ij9hko6iawle","top_bound");
//3 9fsg0uiyhtrayd4mimmc0i25e
// static edge_t *bot_bound(edge_t * e, int side)
-public static Agedge_s bot_bound(Agedge_s e, int side) {
+public static ST_Agedge_s bot_bound(ST_Agedge_s e, int side) {
ENTERING("9fsg0uiyhtrayd4mimmc0i25e","bot_bound");
try {
- Agedge_s f, ans = null;
+ ST_Agedge_s f, ans = null;
int i;
- for (i = 0; (f = (Agedge_s) ND_in(aghead(e)).getFromList(i))!=null; i++) {
+ for (i = 0; (f = (ST_Agedge_s) ND_in(aghead(e)).getFromList(i))!=null; i++) {
if (side * (ND_order(agtail(f)) - ND_order(agtail(e))) <= 0)
continue;
if ((ED_spl(f) == null)
@@ -2977,11 +2970,11 @@ LEAVING("9fsg0uiyhtrayd4mimmc0i25e","bot_bound");
//3 65uvkv1mextaah5m997ibe3qs
// static int cl_vninside(graph_t * cl, node_t * n)
-public static boolean cl_vninside(Agraph_s cl, Agnode_s n) {
+public static boolean cl_vninside(ST_Agraph_s cl, ST_Agnode_s n) {
ENTERING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
try {
- return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).getDouble("x")), GD_bb(cl).UR.x) &&
- BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).getDouble("y")), GD_bb(cl).UR.y));
+ return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).x), GD_bb(cl).UR.x) &&
+ BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).y), GD_bb(cl).UR.y));
} finally {
LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
}
@@ -2992,11 +2985,11 @@ LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
//3 dzvvmxkya868w5x78lkvchigk
// static Agraph_t *cl_bound(graph_t* g, node_t *n, node_t *adj)
-public static Agraph_s cl_bound(Agraph_s g, Agnode_s n, Agnode_s adj) {
+public static ST_Agraph_s cl_bound(ST_Agraph_s g, ST_Agnode_s n, ST_Agnode_s adj) {
ENTERING("dzvvmxkya868w5x78lkvchigk","cl_bound");
try {
- Agraph_s rv, cl, tcl, hcl;
- Agedge_s orig;
+ ST_Agraph_s rv, cl, tcl, hcl;
+ ST_Agedge_s orig;
rv = null;
if (ND_node_type(n) == 0)
tcl = hcl = ND_clust(n);
@@ -3031,61 +3024,61 @@ LEAVING("dzvvmxkya868w5x78lkvchigk","cl_bound");
//3 6qwgl36ugfnduc5x59ohuewv1
// static boxf maximal_bbox(graph_t* g, spline_info_t* sp, node_t* vn, edge_t* ie, edge_t* oe)
-public static __struct__<boxf> maximal_bbox(Agraph_s g, spline_info_t sp, Agnode_s vn, Agedge_s ie, Agedge_s oe) {
+public static ST_boxf maximal_bbox(ST_Agraph_s g, ST_spline_info_t sp, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe) {
// WARNING!! STRUCT
return maximal_bbox_w_(g, sp, vn, ie, oe).copy();
}
-private static __struct__<boxf> maximal_bbox_w_(Agraph_s g, spline_info_t sp, Agnode_s vn, Agedge_s ie, Agedge_s oe) {
+private static ST_boxf maximal_bbox_w_(ST_Agraph_s g, ST_spline_info_t sp, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe) {
ENTERING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
try {
double b, nb;
- Agraph_s left_cl, right_cl;
- Agnode_s left, right;
+ ST_Agraph_s left_cl, right_cl;
+ ST_Agnode_s left, right;
final ST_boxf rv = new ST_boxf();
left_cl = right_cl = null;
/* give this node all the available space up to its neighbors */
- b = (double)(ND_coord(vn).getDouble("x") - ND_lw(vn) - 4);
+ b = (double)(ND_coord(vn).x - ND_lw(vn) - 4);
if ((left = neighbor(g, vn, ie, oe, -1))!=null) {
if ((left_cl = cl_bound(g, vn, left))!=null)
- nb = GD_bb(left_cl).UR.x + (double)(sp.getInt("Splinesep"));
+ nb = GD_bb(left_cl).UR.x + (double)(sp.Splinesep);
else {
- nb = (double)(ND_coord(left).getDouble("x") + ND_mval(left));
+ nb = (double)(ND_coord(left).x + ND_mval(left));
if (ND_node_type(left) == 0)
nb += GD_nodesep(g) / 2.;
else
- nb += (double)(sp.getInt("Splinesep"));
+ nb += (double)(sp.Splinesep);
}
if (nb < b)
b = nb;
rv.LL.x = ROUND(b);
} else
- rv.LL.x = MIN(ROUND(b), sp.getInt("LeftBound"));
+ rv.LL.x = MIN(ROUND(b), sp.LeftBound);
/* we have to leave room for our own label! */
if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null))
- b = (double)(ND_coord(vn).getDouble("x") + 10);
+ b = (double)(ND_coord(vn).x + 10);
else
- b = (double)(ND_coord(vn).getDouble("x") + ND_rw(vn) + 4);
+ b = (double)(ND_coord(vn).x + ND_rw(vn) + 4);
if ((right = neighbor(g, vn, ie, oe, 1))!=null) {
if ((right_cl = cl_bound(g, vn, right))!=null)
- nb = GD_bb(right_cl).LL.x - (double)(sp.getInt("Splinesep"));
+ nb = GD_bb(right_cl).LL.x - (double)(sp.Splinesep);
else {
- nb = ND_coord(right).getDouble("x") - ND_lw(right);
+ nb = ND_coord(right).x - ND_lw(right);
if (ND_node_type(right) == 0)
nb -= GD_nodesep(g) / 2.;
else
- nb -= (double)(sp.getInt("Splinesep"));
+ nb -= (double)(sp.Splinesep);
}
if (nb > b)
b = nb;
rv.UR.x = ROUND(b);
} else
- rv.UR.x = MAX(ROUND(b), sp.getInt("RightBound"));
+ rv.UR.x = MAX(ROUND(b), sp.RightBound);
if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) {
rv.UR.x = rv.UR.x - ND_rw(vn);
- if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).getDouble("x");
+ if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).x;
}
- rv.LL.y = ND_coord(vn).getDouble("y") - GD_rank(g).plus(ND_rank(vn)).getDouble("ht1");
- rv.UR.y = ND_coord(vn).getDouble("y") + GD_rank(g).plus(ND_rank(vn)).getDouble("ht2");
+ rv.LL.y = ND_coord(vn).y - GD_rank(g).get(ND_rank(vn)).ht1;
+ rv.UR.y = ND_coord(vn).y + GD_rank(g).get(ND_rank(vn)).ht2;
return rv;
} finally {
LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
@@ -3097,14 +3090,14 @@ LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
//3 18pm6r3xcy90f0xi5hpm9jdhk
// static node_t * neighbor(graph_t* g, node_t *vn, edge_t *ie, edge_t *oe, int dir)
-public static Agnode_s neighbor(Agraph_s g, Agnode_s vn, Agedge_s ie, Agedge_s oe, int dir) {
+public static ST_Agnode_s neighbor(ST_Agraph_s g, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe, int dir) {
ENTERING("18pm6r3xcy90f0xi5hpm9jdhk","neighbor");
try {
int i;
- Agnode_s n, rv = null;
- __ptr__ rank = GD_rank(g).plus(ND_rank(vn));
- for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getInt("n"))); i += dir) {
- n = (Agnode_s) rank.getArrayOfPtr("v").plus(i).getPtr();
+ ST_Agnode_s n, rv = null;
+ ST_rank_t.Array2 rank = GD_rank(g).plus(ND_rank(vn));
+ for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getPtr().n)); i += dir) {
+ n = (ST_Agnode_s) rank.getPtr().v.get(i);
if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) {
rv = n;
break;
@@ -3129,11 +3122,11 @@ LEAVING("18pm6r3xcy90f0xi5hpm9jdhk","neighbor");
//3 f4q0oqe165s9pl5k0th5noeyv
// static boolean pathscross(n0, n1, ie1, oe1) node_t *n0, *n1
-public static boolean pathscross(Agnode_s n0, Agnode_s n1, Agedge_s ie1, Agedge_s oe1) {
+public static boolean pathscross(ST_Agnode_s n0, ST_Agnode_s n1, ST_Agedge_s ie1, ST_Agedge_s oe1) {
ENTERING("f4q0oqe165s9pl5k0th5noeyv","pathscross");
try {
- Agedge_s e0, e1;
- Agnode_s na, nb;
+ ST_Agedge_s e0, e1;
+ ST_Agnode_s na, nb;
boolean order;
int cnt;
order = (ND_order(n0) > ND_order(n1));
@@ -3141,7 +3134,7 @@ try {
return false;
e1 = oe1;
if (ND_out(n0).size == 1 && e1!=null) {
- e0 = (Agedge_s) ND_out(n0).getFromList(0);
+ e0 = (ST_Agedge_s) ND_out(n0).getFromList(0);
for (cnt = 0; cnt < 2; cnt++) {
if (EQ(na = aghead(e0), nb = aghead(e1)))
break;
@@ -3149,15 +3142,15 @@ try {
return NOT(false);
if ((ND_out(na).size != 1) || (ND_node_type(na) == 0))
break;
- e0 = (Agedge_s) ND_out(na).getFromList(0);
+ e0 = (ST_Agedge_s) ND_out(na).getFromList(0);
if ((ND_out(nb).size != 1) || (ND_node_type(nb) == 0))
break;
- e1 = (Agedge_s) ND_out(nb).getFromList(0);
+ e1 = (ST_Agedge_s) ND_out(nb).getFromList(0);
}
}
e1 = ie1;
if (ND_in(n0).size == 1 && e1!=null) {
- e0 = (Agedge_s) ND_in(n0).getFromList(0);
+ e0 = (ST_Agedge_s) ND_in(n0).getFromList(0);
for (cnt = 0; cnt < 2; cnt++) {
if (EQ(na = agtail(e0), nb = agtail(e1)))
break;
@@ -3165,10 +3158,10 @@ try {
return NOT(false);
if ((ND_in(na).size != 1) || (ND_node_type(na) == 0))
break;
- e0 = (Agedge_s) ND_in(na).getFromList(0);
+ e0 = (ST_Agedge_s) ND_in(na).getFromList(0);
if ((ND_in(nb).size != 1) || (ND_node_type(nb) == 0))
break;
- e1 = (Agedge_s) ND_in(nb).getFromList(0);
+ e1 = (ST_Agedge_s) ND_in(nb).getFromList(0);
}
}
return false;
diff --git a/src/gen/lib/dotgen/fastgr__c.java b/src/gen/lib/dotgen/fastgr__c.java
index 6f9e9fe..01e27f3 100644
--- a/src/gen/lib/dotgen/fastgr__c.java
+++ b/src/gen/lib/dotgen/fastgr__c.java
@@ -47,10 +47,8 @@ package gen.lib.dotgen;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.obj__c.agroot;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.dotgen.dotinit__c.dot_root;
import static smetana.core.JUtils.EQ;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE;
@@ -88,19 +86,15 @@ import static smetana.core.Macro.aghead;
import static smetana.core.Macro.agtail;
import static smetana.core.Macro.alloc_elist;
import static smetana.core.Macro.elist_append;
-import h.Agedge_s;
-import h.Agedgeinfo_t;
-import h.Agedgepair_s;
-import h.Agnode_s;
-import h.Agnodeinfo_t;
-import h.Agraph_s;
-import h.Agrec_s;
+import h.ST_Agedge_s;
+import h.ST_Agedgeinfo_t;
+import h.ST_Agedgepair_s;
+import h.ST_Agnode_s;
+import h.ST_Agnodeinfo_t;
+import h.ST_Agraph_s;
+import h.ST_Agrec_s;
import h.ST_elist;
-import h.boxf;
-import h.elist;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class fastgr__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -360,14 +354,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -396,25 +390,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -438,16 +413,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -744,22 +719,22 @@ throw new UnsupportedOperationException();
//3 econbrl314rr46qnvvw5e32j7
// static edge_t *ffe(node_t * u, elist uL, node_t * v, elist vL)
-public static Agedge_s ffe(Agnode_s u, final ST_elist uL, Agnode_s v, final ST_elist vL) {
+public static ST_Agedge_s ffe(ST_Agnode_s u, final ST_elist uL, ST_Agnode_s v, final ST_elist vL) {
// WARNING!! STRUCT
return ffe_w_(u, uL.copy(), v, vL.copy());
}
-private static Agedge_s ffe_w_(Agnode_s u, final ST_elist uL, Agnode_s v, final ST_elist vL) {
+private static ST_Agedge_s ffe_w_(ST_Agnode_s u, final ST_elist uL, ST_Agnode_s v, final ST_elist vL) {
ENTERING("econbrl314rr46qnvvw5e32j7","ffe");
try {
int i;
- Agedge_s e = null;
+ ST_Agedge_s e = null;
if ((uL.size > 0) && (vL.size > 0)) {
if (uL.size < vL.size) {
- for (i = 0; (e = (Agedge_s) uL.getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) uL.getFromList(i))!=null; i++)
if (EQ(aghead(e), v))
break;
} else {
- for (i = 0; (e = (Agedge_s) vL.getFromList(i))!=null; i++)
+ for (i = 0; (e = (ST_Agedge_s) vL.getFromList(i))!=null; i++)
if (EQ(agtail(e), u))
break;
}
@@ -776,7 +751,7 @@ LEAVING("econbrl314rr46qnvvw5e32j7","ffe");
//3 1uygfrgur73lfy9vsjozwwupm
// edge_t *find_fast_edge(node_t * u, node_t * v)
-public static Agedge_s find_fast_edge(Agnode_s u, Agnode_s v) {
+public static ST_Agedge_s find_fast_edge(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("1uygfrgur73lfy9vsjozwwupm","find_fast_edge");
try {
return ffe(u, ND_out(u), v, ND_in(v));
@@ -790,10 +765,10 @@ LEAVING("1uygfrgur73lfy9vsjozwwupm","find_fast_edge");
//3 1yw7ahdnxnexnicj552zqyyej
// static node_t* find_fast_node(graph_t * g, node_t * n)
-public static Agnode_s find_fast_node(Agraph_s g, Agnode_s n) {
+public static ST_Agnode_s find_fast_node(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("1yw7ahdnxnexnicj552zqyyej","find_fast_node");
try {
- Agnode_s v;
+ ST_Agnode_s v;
for (v = GD_nlist(g); v!=null; v = ND_next(v))
if (EQ(v, n))
break;
@@ -808,7 +783,7 @@ LEAVING("1yw7ahdnxnexnicj552zqyyej","find_fast_node");
//3 bf1j97keudu416avridkj9fpb
// edge_t *find_flat_edge(node_t * u, node_t * v)
-public static Agedge_s find_flat_edge(Agnode_s u, Agnode_s v) {
+public static ST_Agedge_s find_flat_edge(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("bf1j97keudu416avridkj9fpb","find_flat_edge");
try {
return ffe(u, ND_flat_out(u), v, ND_flat_in(v));
@@ -841,7 +816,7 @@ throw new UnsupportedOperationException();
//3 8t6gpubo908pz1pqnt1s88lnt
// edge_t *fast_edge(edge_t * e)
-public static Agedge_s fast_edge(Agedge_s e) {
+public static ST_Agedge_s fast_edge(ST_Agedge_s e) {
ENTERING("8t6gpubo908pz1pqnt1s88lnt","fast_edge");
try {
elist_append(e, ND_out(agtail(e)));
@@ -857,15 +832,15 @@ LEAVING("8t6gpubo908pz1pqnt1s88lnt","fast_edge");
//3 dxb0q8ajb7iv25aj6zdqnbwh5
// void zapinlist(elist * L, edge_t * e)
-public static void zapinlist(elist L, Agedge_s e) {
+public static void zapinlist(ST_elist L, ST_Agedge_s e) {
ENTERING("dxb0q8ajb7iv25aj6zdqnbwh5","zapinlist");
try {
int i;
- for (i = 0; i < L.getInt("size"); i++) {
- if (EQ(L.getArrayOfPtr("list").plus(i).getPtr(), e)) {
- L.setInt("size", L.getInt("size")-1);
- L.getArrayOfPtr("list").plus(i).setPtr(L.getArrayOfPtr("list").plus(L.getInt("size")).getPtr());
- L.getArrayOfPtr("list").plus(L.getInt("size")).setPtr(null);
+ for (i = 0; i < L.size; i++) {
+ if (EQ(L.list.get(i), e)) {
+ L.size = L.size-1;
+ L.list.set(i, L.list.get(L.size));
+ L.list.set(L.size, null);
break;
}
}
@@ -879,12 +854,12 @@ LEAVING("dxb0q8ajb7iv25aj6zdqnbwh5","zapinlist");
//3 dkv97rr4ytpehp291etaxe9gc
// void delete_fast_edge(edge_t * e)
-public static void delete_fast_edge(Agedge_s e) {
+public static void delete_fast_edge(ST_Agedge_s e) {
ENTERING("dkv97rr4ytpehp291etaxe9gc","delete_fast_edge");
try {
//assert(e != NULL);
- zapinlist((ND_out(agtail(e))).amp(), e);
- zapinlist((ND_in(aghead(e))).amp(), e);
+ zapinlist((ND_out(agtail(e))), e);
+ zapinlist((ND_in(aghead(e))), e);
} finally {
LEAVING("dkv97rr4ytpehp291etaxe9gc","delete_fast_edge");
}
@@ -918,7 +893,7 @@ throw new UnsupportedOperationException();
//3 73oebfcfiescklohgt8mddswc
// void other_edge(edge_t * e)
-public static void other_edge(Agedge_s e) {
+public static void other_edge(ST_Agedge_s e) {
ENTERING("73oebfcfiescklohgt8mddswc","other_edge");
try {
elist_append(e, ND_other(agtail(e)));
@@ -946,21 +921,21 @@ throw new UnsupportedOperationException();
//3 4gd9tmpq70q0rij5otj0k6sn2
// edge_t *new_virtual_edge(node_t * u, node_t * v, edge_t * orig)
-public static Agedge_s new_virtual_edge(Agnode_s u, Agnode_s v, Agedge_s orig) {
+public static ST_Agedge_s new_virtual_edge(ST_Agnode_s u, ST_Agnode_s v, ST_Agedge_s orig) {
ENTERING("4gd9tmpq70q0rij5otj0k6sn2","new_virtual_edge");
try {
- Agedge_s e;
- Agedgepair_s e2 = (Agedgepair_s)zmalloc(sizeof(Agedgepair_s.class));
- AGTYPE(e2.getStruct("in").amp(), AGINEDGE);
- AGTYPE(e2.getStruct("out").amp(), AGOUTEDGE);
- e2.getStruct("out").getStruct("base").setPtr("data", zmalloc(sizeof(Agedgeinfo_t.class)).castTo(Agedgeinfo_t.class).castTo(Agrec_s.class));
- e = (Agedge_s) e2.getStruct("out").amp();
+ ST_Agedge_s e;
+ ST_Agedgepair_s e2 = new ST_Agedgepair_s();
+ AGTYPE(e2.in, AGINEDGE);
+ AGTYPE(e2.out, AGOUTEDGE);
+ e2.out.base.setPtr("data", new ST_Agedgeinfo_t().castTo(ST_Agrec_s.class));
+ e = (ST_Agedge_s) e2.out;
agtail(e, u);
aghead(e, v);
ED_edge_type(e, 1);
if (orig!=null) {
AGSEQ(e, AGSEQ(orig));
- AGSEQ(e2.getStruct("in").amp(), AGSEQ(orig));
+ AGSEQ(e2.in, AGSEQ(orig));
ED_count(e, ED_count(orig));
ED_xpenalty(e, ED_xpenalty(orig));
ED_weight(e, ED_weight(orig));
@@ -993,7 +968,7 @@ LEAVING("4gd9tmpq70q0rij5otj0k6sn2","new_virtual_edge");
//3 9obdfflzw4cs2z9r0dng26mvw
// edge_t *virtual_edge(node_t * u, node_t * v, edge_t * orig)
-public static Agedge_s virtual_edge(Agnode_s u, Agnode_s v, Agedge_s orig) {
+public static ST_Agedge_s virtual_edge(ST_Agnode_s u, ST_Agnode_s v, ST_Agedge_s orig) {
ENTERING("9obdfflzw4cs2z9r0dng26mvw","virtual_edge");
try {
return fast_edge(new_virtual_edge(u, v, orig));
@@ -1007,7 +982,7 @@ LEAVING("9obdfflzw4cs2z9r0dng26mvw","virtual_edge");
//3 98hkec8t6fjk10bjpstumw0ey
// void fast_node(graph_t * g, Agnode_t * n)
-public static void fast_node(Agraph_s g, Agnode_s n) {
+public static void fast_node(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("98hkec8t6fjk10bjpstumw0ey","fast_node");
try {
ND_next(n, GD_nlist(g));
@@ -1046,7 +1021,7 @@ throw new UnsupportedOperationException();
//3 emsq7b6s5100lscckzy3ileqd
// void delete_fast_node(graph_t * g, node_t * n)
-public static void delete_fast_node(Agraph_s g, Agnode_s n) {
+public static void delete_fast_node(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("emsq7b6s5100lscckzy3ileqd","delete_fast_node");
try {
assert(find_fast_node(g, n)!=null);
@@ -1066,22 +1041,22 @@ LEAVING("emsq7b6s5100lscckzy3ileqd","delete_fast_node");
//3 eg08ajzojsm0224btmfi7kdxt
// node_t *virtual_node(graph_t * g)
-public static Agnode_s virtual_node(Agraph_s g) {
+public static ST_Agnode_s virtual_node(ST_Agraph_s g) {
ENTERING("eg08ajzojsm0224btmfi7kdxt","virtual_node");
try {
- Agnode_s n;
- n = (Agnode_s)zmalloc(sizeof(Agnode_s.class));
+ ST_Agnode_s n;
+ n = new ST_Agnode_s();
// agnameof(n) = "virtual";
AGTYPE(n, AGNODE);
- n.getStruct("base").setPtr("data", (Agnodeinfo_t)zmalloc(sizeof(Agnodeinfo_t.class)));
+ n.base.setPtr("data", new ST_Agnodeinfo_t());
n.setPtr("root", agroot(g));
ND_node_type(n, 1);
ND_rw(n, 1);
ND_lw(n, 1);
ND_ht(n, 1);
ND_UF_size(n, 1);
- alloc_elist(4, ND_in(n), Agnode_s.class);
- alloc_elist(4, ND_out(n), Agnode_s.class);
+ alloc_elist(4, ND_in(n));
+ alloc_elist(4, ND_out(n));
fast_node(g, n);
GD_n_nodes(g, GD_n_nodes(g)+1);
return n;
@@ -1095,7 +1070,7 @@ LEAVING("eg08ajzojsm0224btmfi7kdxt","virtual_node");
//3 8dvukicq96g5t3xgdl0ue35mj
// void flat_edge(graph_t * g, edge_t * e)
-public static void flat_edge(Agraph_s g, Agedge_s e) {
+public static void flat_edge(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("8dvukicq96g5t3xgdl0ue35mj","flat_edge");
try {
elist_append(e, ND_flat_out(agtail(e)));
@@ -1112,14 +1087,14 @@ LEAVING("8dvukicq96g5t3xgdl0ue35mj","flat_edge");
//3 clspalhiuedfnk9g9rlvfqpg7
// void delete_flat_edge(edge_t * e)
-public static void delete_flat_edge(Agedge_s e) {
+public static void delete_flat_edge(ST_Agedge_s e) {
ENTERING("clspalhiuedfnk9g9rlvfqpg7","delete_flat_edge");
try {
assert(e != null);
if (ED_to_orig(e)!=null && EQ(ED_to_virt(ED_to_orig(e)), e))
ED_to_virt(ED_to_orig(e), null);
- zapinlist((ND_flat_out(agtail(e))).amp(), e);
- zapinlist((ND_flat_in(aghead(e))).amp(), e);
+ zapinlist((ND_flat_out(agtail(e))), e);
+ zapinlist((ND_flat_in(aghead(e))), e);
} finally {
LEAVING("clspalhiuedfnk9g9rlvfqpg7","delete_flat_edge");
}
@@ -1130,7 +1105,7 @@ LEAVING("clspalhiuedfnk9g9rlvfqpg7","delete_flat_edge");
//3 dcfpol11cvlt6aaa6phqbp6fo
// static void basic_merge(edge_t * e, edge_t * rep)
-public static void basic_merge(Agedge_s e, Agedge_s rep) {
+public static void basic_merge(ST_Agedge_s e, ST_Agedge_s rep) {
ENTERING("dcfpol11cvlt6aaa6phqbp6fo","basic_merge");
try {
if (ED_minlen(rep) < ED_minlen(e))
@@ -1151,7 +1126,7 @@ LEAVING("dcfpol11cvlt6aaa6phqbp6fo","basic_merge");
//3 6dxgtoii76tmonlnvz4rmiytd
// void merge_oneway(edge_t * e, edge_t * rep)
-public static void merge_oneway(Agedge_s e, Agedge_s rep) {
+public static void merge_oneway(ST_Agedge_s e, ST_Agedge_s rep) {
ENTERING("6dxgtoii76tmonlnvz4rmiytd","merge_oneway");
try {
if (EQ(rep, ED_to_virt(e))) {
diff --git a/src/gen/lib/dotgen/flat__c.java b/src/gen/lib/dotgen/flat__c.java
index a3e79f3..fd776b5 100644
--- a/src/gen/lib/dotgen/flat__c.java
+++ b/src/gen/lib/dotgen/flat__c.java
@@ -46,17 +46,16 @@
package gen.lib.dotgen;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agtail;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.dotgen.dotinit__c.dot_root;
import static gen.lib.dotgen.fastgr__c.virtual_edge;
import static gen.lib.dotgen.fastgr__c.virtual_node;
import static gen.lib.dotgen.mincross__c.rec_reset_vlists;
import static gen.lib.dotgen.mincross__c.rec_save_vlists;
import static smetana.core.JUtils.EQ;
-import static smetana.core.JUtils.sizeof_starstar_empty;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
-import static smetana.core.Macro.ALLOC;
+import static smetana.core.Macro.ALLOC_Agnode_s;
+import static smetana.core.Macro.ALLOC_ST_rank_t;
import static smetana.core.Macro.ED_adjacent;
import static smetana.core.Macro.ED_dist;
import static smetana.core.Macro.ED_edge_type;
@@ -90,15 +89,12 @@ import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
-import h.rank_t;
-import smetana.core.JUtils;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_pointf;
+import h.ST_rank_t;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class flat__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -358,14 +354,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -394,27 +390,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
-
//3 1n5xl70wxuabyf97mclvilsm6
@@ -436,16 +411,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -742,25 +717,25 @@ throw new UnsupportedOperationException();
//3 e0gtvsxlvztmwu8yy44wfvf97
// static node_t *make_vn_slot(graph_t * g, int r, int pos)
-public static Agnode_s make_vn_slot(Agraph_s g, int r, int pos) {
+public static ST_Agnode_s make_vn_slot(ST_Agraph_s g, int r, int pos) {
ENTERING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
try {
int i;
- __ptr__ v;
- Agnode_s n;
- v = ALLOC(GD_rank(g).plus(r).getInt("n") + 2, GD_rank(g).plus(r).getPtr("v"), Agnode_s.class);
+ ST_Agnode_s.ArrayOfStar v;
+ ST_Agnode_s n;
+ v = ALLOC_Agnode_s(GD_rank(g).get(r).n + 2, (ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v);
GD_rank(g).plus(r).setPtr("v", v);
- for (i = GD_rank(g).plus(r).getInt("n"); i > pos; i--) {
+ for (i = GD_rank(g).get(r).n; i > pos; i--) {
v.plus(i).setPtr(v.plus(i - 1).getPtr());
- ND_order(v.plus(i).getPtr(), ND_order(v.plus(i).getPtr())+1);
+ ND_order(v.get(i), ND_order(v.get(i))+1);
}
n = virtual_node(g);
v.plus(pos).setPtr(n);
ND_order(n, pos);
ND_rank(n, r);
- GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("n")+1);
- v.plus(GD_rank(g).plus(r).getInt("n")).setPtr(null);
- return (Agnode_s) v.plus(pos).getPtr();
+ GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).n+1);
+ v.plus(GD_rank(g).get(r).n).setPtr(null);
+ return (ST_Agnode_s) v.get(pos);
} finally {
LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
}
@@ -771,7 +746,7 @@ LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
//3 d64wt9oqphauv3hp4axbg2ep3
// static void findlr(node_t * u, node_t * v, int *lp, int *rp)
-public static void findlr(Agnode_s u, Agnode_s v, int lp[], int rp[]) {
+public static void findlr(ST_Agnode_s u, ST_Agnode_s v, int lp[], int rp[]) {
ENTERING("d64wt9oqphauv3hp4axbg2ep3","findlr");
try {
int l, r;
@@ -794,17 +769,17 @@ LEAVING("d64wt9oqphauv3hp4axbg2ep3","findlr");
//3 bwjjmaydx5a2fnpeoligkha0r
// static void setbounds(node_t * v, int *bounds, int lpos, int rpos)
-public static void setbounds(Agnode_s v, int bounds[], int lpos[], int rpos[]) {
+public static void setbounds(ST_Agnode_s v, int bounds[], int lpos[], int rpos[]) {
ENTERING("bwjjmaydx5a2fnpeoligkha0r","setbounds");
try {
int i, ord;
int[] l = new int[1], r = new int[1];
- Agedge_s f;
+ ST_Agedge_s f;
if (ND_node_type(v) == 1) {
ord = ND_order(v);
if (ND_in(v).size == 0) { /* flat */
assert(ND_out(v).size == 2);
- findlr((Agnode_s) aghead(ND_out(v).getFromList(0)), (Agnode_s) aghead(ND_out(v).getFromList(1)), l,
+ findlr((ST_Agnode_s) aghead(ND_out(v).getFromList(0)), (ST_Agnode_s) aghead(ND_out(v).getFromList(1)), l,
r);
/* the other flat edge could be to the left or right */
if (r[0] <= lpos[0])
@@ -823,7 +798,7 @@ try {
} else { /* forward */
boolean onleft, onright;
onleft = onright = false;
- for (i = 0; (f = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
+ for (i = 0; (f = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
if (ND_order(aghead(f)) <= lpos[0]) {
onleft = NOT(false);
continue;
@@ -849,24 +824,24 @@ LEAVING("bwjjmaydx5a2fnpeoligkha0r","setbounds");
//3 3bc4otcsxj1dujj49ydbb19oa
// static int flat_limits(graph_t * g, edge_t * e)
-public static int flat_limits(Agraph_s g, Agedge_s e) {
+public static int flat_limits(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("3bc4otcsxj1dujj49ydbb19oa","flat_limits");
try {
int lnode, rnode, r, pos;
int[] lpos = new int[1], rpos = new int[1];
int bounds[] = new int[4];
- __ptr__ rank;
+ ST_Agnode_s.ArrayOfStar rank;
r = ND_rank(agtail(e)) - 1;
- rank = GD_rank(g).plus(r).getPtr("v");
+ rank = GD_rank(g).get(r).v;
lnode = 0;
- rnode = GD_rank(g).plus(r).getInt("n") - 1;
+ rnode = GD_rank(g).get(r).n - 1;
bounds[0] = bounds[2] = lnode - 1;
bounds[1] = bounds[3] = rnode + 1;
findlr(agtail(e), aghead(e), lpos, rpos);
while (lnode <= rnode) {
- setbounds((Agnode_s)rank.plus(lnode).getPtr(), bounds, lpos, rpos);
+ setbounds((ST_Agnode_s)rank.get(lnode), bounds, lpos, rpos);
if (lnode != rnode)
- setbounds((Agnode_s)rank.plus(rnode).getPtr(), bounds, lpos, rpos);
+ setbounds((ST_Agnode_s)rank.get(rnode), bounds, lpos, rpos);
lnode++;
rnode--;
if (bounds[1] - bounds[0] <= 1)
@@ -887,51 +862,51 @@ LEAVING("3bc4otcsxj1dujj49ydbb19oa","flat_limits");
//3 4cw9yo9ap8ze1r873v6jat4yc
// static void flat_node(edge_t * e)
-public static void flat_node(Agedge_s e) {
+public static void flat_node(ST_Agedge_s e) {
ENTERING("4cw9yo9ap8ze1r873v6jat4yc","flat_node");
try {
int r, place, ypos, h2;
- Agraph_s g;
- Agnode_s n, vn;
- Agedge_s ve;
- final __struct__<pointf> dimen = JUtils.from(pointf.class);
+ ST_Agraph_s g;
+ ST_Agnode_s n, vn;
+ ST_Agedge_s ve;
+ final ST_pointf dimen = new ST_pointf();
if (ED_label(e) == null)
return;
g = dot_root(agtail(e));
r = ND_rank(agtail(e));
place = flat_limits(g, e);
/* grab ypos = LL.y of label box before make_vn_slot() */
- if ((n = (Agnode_s) GD_rank(g).plus(r - 1).getArrayOfPtr("v").plus(0).getPtr())!=null)
- ypos = (int)(ND_coord(n).getDouble("y") - GD_rank(g).plus(r - 1).getDouble("ht1"));
+ if ((n = (ST_Agnode_s) GD_rank(g).get(r - 1).v.get(0))!=null)
+ ypos = (int)(ND_coord(n).y - GD_rank(g).get(r - 1).ht1);
else {
- n = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
- ypos = (int)(ND_coord(n).getDouble("y") + GD_rank(g).plus(r).getDouble("ht2") + GD_ranksep(g));
+ n = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
+ ypos = (int)(ND_coord(n).y + GD_rank(g).get(r).ht2 + GD_ranksep(g));
}
vn = make_vn_slot(g, r - 1, place);
- dimen.___(ED_label(e).getStruct("dimen"));
+ dimen.___(ED_label(e).dimen);
if (GD_flip(g)!=0) {
- double f = dimen.getDouble("x");
- dimen.setDouble("x", dimen.getDouble("y"));
+ double f = dimen.x;
+ dimen.setDouble("x", dimen.y);
dimen.setDouble("y", f);
}
- ND_ht(vn, dimen.getDouble("y"));
+ ND_ht(vn, dimen.y);
h2 = (int)(ND_ht(vn) / 2);
- ND_rw(vn, dimen.getDouble("x") / 2);
+ ND_rw(vn, dimen.x / 2);
ND_lw(vn, ND_rw(vn));
ND_label(vn, ED_label(e));
ND_coord(vn).setDouble("y", ypos + h2);
ve = virtual_edge(vn, agtail(e), e); /* was NULL? */
- ED_tail_port(ve).getStruct("p").setDouble("x", -ND_lw(vn));
- ED_head_port(ve).getStruct("p").setDouble("x", ND_rw(agtail(e)));
+ ED_tail_port(ve).p.setDouble("x", -ND_lw(vn));
+ ED_head_port(ve).p.setDouble("x", ND_rw(agtail(e)));
ED_edge_type(ve, 4);
ve = virtual_edge(vn, aghead(e), e);
- ED_tail_port(ve).getStruct("p").setDouble("x", ND_rw(vn));
- ED_head_port(ve).getStruct("p").setDouble("x", ND_lw(aghead(e)));
+ ED_tail_port(ve).p.setDouble("x", ND_rw(vn));
+ ED_head_port(ve).p.setDouble("x", ND_lw(aghead(e)));
ED_edge_type(ve, 4);
/* another assumed symmetry of ht1/ht2 of a label node */
- if (GD_rank(g).plus(r - 1).getDouble("ht1") < h2)
+ if (GD_rank(g).get(r - 1).ht1 < h2)
GD_rank(g).plus(r - 1).setDouble("ht1", h2);
- if (GD_rank(g).plus(r - 1).getDouble("ht2") < h2)
+ if (GD_rank(g).get(r - 1).ht2 < h2)
GD_rank(g).plus(r - 1).setDouble("ht2", h2);
ND_alg(vn, e);
} finally {
@@ -944,22 +919,22 @@ LEAVING("4cw9yo9ap8ze1r873v6jat4yc","flat_node");
//3 1lopavodoru6ee52snd5l6swd
// static void abomination(graph_t * g)
-public static void abomination(Agraph_s g) {
+public static void abomination(ST_Agraph_s g) {
ENTERING("1lopavodoru6ee52snd5l6swd","abomination");
try {
int r;
- __ptr__ rptr;
+ ST_rank_t.Array2 rptr;
assert(GD_minrank(g) == 0);
/* 3 = one for new rank, one for sentinel, one for off-by-one */
r = GD_maxrank(g) + 3;
- rptr = ALLOC(r, GD_rank(g), rank_t.class);
+ rptr = ALLOC_ST_rank_t(r, (ST_rank_t.Array2) GD_rank(g));
GD_rank(g, rptr.plus(1));
for (r = GD_maxrank(g); r >= 0; r--)
- GD_rank(g).plus(r).getPtr().setStruct(GD_rank(g).plus(r - 1).getPtr().getStruct());
+ GD_rank(g).get(r).setStruct(GD_rank(g).get(r - 1).getStruct());
GD_rank(g).plus(r).setInt("n", 0);
GD_rank(g).plus(r).setInt("an", 0);
- GD_rank(g).plus(r).setPtr("v", zmalloc(sizeof_starstar_empty(Agnode_s.class, 2)));
- GD_rank(g).plus(r).setPtr("av", GD_rank(g).plus(r).getPtr("v"));
+ GD_rank(g).plus(r).setPtr("v", new ST_Agnode_s.ArrayOfStar(2));
+ GD_rank(g).plus(r).setPtr("av", GD_rank(g).get(r).v);
GD_rank(g).plus(r).setPtr("flat", null);
GD_rank(g).plus(r).setDouble("ht1", 1);
GD_rank(g).plus(r).setDouble("ht2", 1);
@@ -976,14 +951,14 @@ LEAVING("1lopavodoru6ee52snd5l6swd","abomination");
//3 ctujx6e8k3rzv08h6gswdcaqs
// static void checkFlatAdjacent (edge_t* e)
-public static void checkFlatAdjacent(Agedge_s e) {
+public static void checkFlatAdjacent(ST_Agedge_s e) {
ENTERING("ctujx6e8k3rzv08h6gswdcaqs","checkFlatAdjacent");
try {
- Agnode_s tn = agtail(e);
- Agnode_s hn = aghead(e);
+ ST_Agnode_s tn = agtail(e);
+ ST_Agnode_s hn = aghead(e);
int i, lo, hi;
- Agnode_s n;
- __ptr__ rank;
+ ST_Agnode_s n;
+ ST_rank_t.Array2 rank;
if (ND_order(tn) < ND_order(hn)) {
lo = ND_order(tn);
hi = ND_order(hn);
@@ -994,7 +969,7 @@ try {
}
rank = GD_rank(dot_root(tn)).plus(ND_rank(tn));
for (i = lo + 1; i < hi; i++) {
- n = (Agnode_s) rank.getArrayOfPtr("v").plus(i).getPtr();
+ n = (ST_Agnode_s) rank.getPtr().v.get(i);
if ((ND_node_type(n) == 1 && ND_label(n)!=null) ||
ND_node_type(n) == 0)
break;
@@ -1015,28 +990,28 @@ LEAVING("ctujx6e8k3rzv08h6gswdcaqs","checkFlatAdjacent");
//3 bjwwj6ftkm0gv04cf1edqeaw6
// int flat_edges(graph_t * g)
-public static int flat_edges(Agraph_s g) {
+public static int flat_edges(ST_Agraph_s g) {
ENTERING("bjwwj6ftkm0gv04cf1edqeaw6","flat_edges");
try {
int i, j, reset = 0;
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
int found = 0;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
if (ND_flat_out(n).listNotNull()) {
- for (j = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(j))!=null; j++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(j))!=null; j++) {
checkFlatAdjacent (e);
}
}
for (j = 0; j < ND_other(n).size; j++) {
- e = (Agedge_s) ND_other(n).getFromList(j);
+ e = (ST_Agedge_s) ND_other(n).getFromList(j);
if (ND_rank(aghead(e)) == ND_rank(agtail(e)))
checkFlatAdjacent (e);
}
}
- if ((GD_rank(g).plus(0).getPtr("flat")!=null) || (GD_n_cluster(g) > 0)) {
- for (i = 0; (n = (Agnode_s) GD_rank(g).plus(0).getArrayOfPtr("v").plus(i).getPtr())!=null; i++) {
- for (j = 0; (e = (Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) {
+ if ((GD_rank(g).get(0).flat!=null) || (GD_n_cluster(g) > 0)) {
+ for (i = 0; (n = (ST_Agnode_s) GD_rank(g).get(0).v.get(i))!=null; i++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) {
if ((ED_label(e)!=null) && N(ED_adjacent(e))) {
abomination(g);
found = 1;
@@ -1051,11 +1026,11 @@ try {
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
/* if n is the tail of any flat edge, one will be in flat_out */
if (ND_flat_out(n).listNotNull()) {
- for (i = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(i))!=null; i++) {
if (ED_label(e)!=null) {
if (ED_adjacent(e)!=0) {
- if (GD_flip(g)!=0) ED_dist(e, ED_label(e).getStruct("dimen").getDouble("y"));
- else ED_dist(e, ED_label(e).getStruct("dimen").getDouble("x"));
+ if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.y);
+ else ED_dist(e, ED_label(e).dimen.x);
}
else {
reset = 1;
@@ -1065,8 +1040,8 @@ try {
}
/* look for other flat edges with labels */
for (j = 0; j < ND_other(n).size; j++) {
- Agedge_s le;
- e = (Agedge_s) ND_other(n).getFromList(j);
+ ST_Agedge_s le;
+ e = (ST_Agedge_s) ND_other(n).getFromList(j);
if (ND_rank(agtail(e)) != ND_rank(aghead(e))) continue;
if (EQ(agtail(e), aghead(e))) continue; /* skip loops */
le = e;
@@ -1075,8 +1050,8 @@ try {
if (ED_label(e)!=null) {
if (ED_adjacent(e)!=0) {
double lw;
- if (GD_flip(g)!=0) lw = ED_label(e).getStruct("dimen").getDouble("y");
- else lw = ED_label(e).getStruct("dimen").getDouble("x");
+ if (GD_flip(g)!=0) lw = ED_label(e).dimen.y;
+ else lw = ED_label(e).dimen.x;
ED_dist(le, MAX(lw,ED_dist(le)));
}
else {
diff --git a/src/gen/lib/dotgen/mincross__c.java b/src/gen/lib/dotgen/mincross__c.java
index 09aef4b..5d3527e 100644
--- a/src/gen/lib/dotgen/mincross__c.java
+++ b/src/gen/lib/dotgen/mincross__c.java
@@ -75,11 +75,9 @@ import static smetana.core.JUtils.atof;
import static smetana.core.JUtils.function;
import static smetana.core.JUtils.qsort;
import static smetana.core.JUtils.size_t_array_of_integer;
-import static smetana.core.JUtils.sizeof;
-import static smetana.core.JUtils.sizeof_starstar_empty;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
-import static smetana.core.Macro.ALLOC;
+import static smetana.core.Macro.ALLOC_Agnode_s;
import static smetana.core.Macro.ALLOC_INT;
import static smetana.core.Macro.ED_edge_type;
import static smetana.core.Macro.ED_head_port;
@@ -125,24 +123,22 @@ import static smetana.core.Macro.ND_ranktype;
import static smetana.core.Macro.ND_weight_class;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import static smetana.core.Macro.agtail;
import static smetana.core.Macro.elist_append;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.adjmatrix_t;
-import h.boxf;
-import h.elist;
-import h.nodequeue;
-import h.pointf;
-import h.rank_t;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_adjmatrix_t;
+import h.ST_elist;
+import h.ST_nodequeue;
+import h.ST_pointf;
+import h.ST_rank_t;
+
+import java.util.List;
+
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class mincross__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -402,14 +398,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -438,26 +434,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -480,16 +456,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -858,7 +834,7 @@ throw new UnsupportedOperationException();
//3 e876vp4hgkzshluz6qk77cjwk
// void dot_mincross(graph_t * g, int doBalance)
-public static void dot_mincross(Agraph_s g, boolean doBalance) {
+public static void dot_mincross(ST_Agraph_s g, boolean doBalance) {
ENTERING("e876vp4hgkzshluz6qk77cjwk","dot_mincross");
try {
int c, nc;
@@ -871,7 +847,7 @@ try {
merge2(g);
/* run mincross on contents of each cluster */
for (c = 1; c <= GD_n_cluster(g); c++) {
- nc += mincross_clust(g, (Agraph_s) GD_clust(g).plus(c).getPtr(), doBalance);
+ nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
}
if ((GD_n_cluster(g) > 0)
&& (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) {
@@ -890,13 +866,13 @@ LEAVING("e876vp4hgkzshluz6qk77cjwk","dot_mincross");
//3 756bre1tpxb1tq68p7xhkrxkc
// static adjmatrix_t *new_matrix(int i, int j)
-public static adjmatrix_t new_matrix(int i, int j) {
+public static ST_adjmatrix_t new_matrix(int i, int j) {
ENTERING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");
try {
- adjmatrix_t rv = (adjmatrix_t) Memory.malloc(adjmatrix_t.class);
- rv.setInt("nrows", i);
- rv.setInt("ncols", j);
- rv.setPtr("data", zmalloc(size_t_array_of_integer(i*j)));
+ ST_adjmatrix_t rv = new ST_adjmatrix_t();
+ rv.nrows = i;
+ rv.ncols = j;
+ rv.data = new int[i][j]; // Or maybe new int[j][i] ?
return rv;
} finally {
LEAVING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");
@@ -908,11 +884,11 @@ LEAVING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");
//3 1n1e0k0wtlbugwm3cb4na6av6
// static void free_matrix(adjmatrix_t * p)
-public static void free_matrix(adjmatrix_t p) {
+public static void free_matrix(ST_adjmatrix_t p) {
ENTERING("1n1e0k0wtlbugwm3cb4na6av6","free_matrix");
try {
if (p!=null) {
- Memory.free(p.getPtr("data"));
+ Memory.free(p.data);
Memory.free(p);
}
} finally {
@@ -925,7 +901,7 @@ LEAVING("1n1e0k0wtlbugwm3cb4na6av6","free_matrix");
//3 49vw7fkn99wbojtfksugvuruh
// static void init_mccomp(graph_t * g, int c)
-public static void init_mccomp(Agraph_s g, int c) {
+public static void init_mccomp(ST_Agraph_s g, int c) {
ENTERING("49vw7fkn99wbojtfksugvuruh","init_mccomp");
try {
int r;
@@ -933,7 +909,7 @@ try {
GD_nlist(g, GD_comp(g).getFromList(c));
if (c > 0) {
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("v").plus(GD_rank(g).plus(r).getInt("n")));
+ GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n));
GD_rank(g).plus(r).setInt("n", 0);
}
}
@@ -1056,7 +1032,7 @@ throw new UnsupportedOperationException();
//3 hzoz2czb672i0nbjvjhbc3na
// static void ordered_edges(graph_t * g)
-public static void ordered_edges(Agraph_s g) {
+public static void ordered_edges(ST_Agraph_s g) {
ENTERING("hzoz2czb672i0nbjvjhbc3na","ordered_edges");
try {
CString ordering;
@@ -1093,7 +1069,7 @@ LEAVING("hzoz2czb672i0nbjvjhbc3na","ordered_edges");
//3 crwc5qe7fmrpgcqh1a80toyvo
// static int mincross_clust(graph_t * par, graph_t * g, int doBalance)
-public static int mincross_clust(Agraph_s par, Agraph_s g, boolean doBalance) {
+public static int mincross_clust(ST_Agraph_s par, ST_Agraph_s g, boolean doBalance) {
ENTERING("crwc5qe7fmrpgcqh1a80toyvo","mincross_clust");
try {
int c, nc;
@@ -1103,7 +1079,7 @@ try {
flat_reorder(g);
nc = mincross_(g, 2, 2, doBalance);
for (c = 1; c <= GD_n_cluster(g); c++)
- nc += mincross_clust(g, (Agraph_s) GD_clust(g).plus(c).getPtr(), doBalance);
+ nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
save_vlist(g);
return nc;
} finally {
@@ -1116,10 +1092,10 @@ LEAVING("crwc5qe7fmrpgcqh1a80toyvo","mincross_clust");
//3 657v773m21j5w3g3v94o7464t
// static int left2right(graph_t * g, node_t * v, node_t * w)
-public static boolean left2right(Agraph_s g, Agnode_s v, Agnode_s w) {
+public static boolean left2right(ST_Agraph_s g, ST_Agnode_s v, ST_Agnode_s w) {
ENTERING("657v773m21j5w3g3v94o7464t","left2right");
try {
- adjmatrix_t M;
+ ST_adjmatrix_t M;
boolean rv=false;
/* CLUSTER indicates orig nodes of clusters, and vnodes of skeletons */
if (Z.z().ReMincross == false) {
@@ -1135,19 +1111,19 @@ try {
/*return ((ND_ranktype(v) != CLUSTER) && (ND_ranktype(w) != CLUSTER)); */
}
} else {
-UNSUPPORTED("8lltx4lxwrqossx8qw1khzwf9"); // if ((ND_clust(v)) != (ND_clust(w)))
-UNSUPPORTED("9qhn9m3123s8n6wwxjfo8awlm"); // return NOT(0);
+ if (NEQ(ND_clust(v), ND_clust(w)))
+ return NOT(0);
}
- M = (adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().getPtr("flat");
+ M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().flat;
if (M == null)
rv = false;
else {
if (GD_flip(g)!=0) {
- Agnode_s t = v;
+ ST_Agnode_s t = v;
v = w;
w = t;
}
- rv = (M.getArrayOfInteger("data").plus(((ND_low(v))*M.getInt("ncols"))+(ND_low(w))).getInt())!=0;
+ rv = M.data[ND_low(v)][ND_low(w)]!=0;
}
return rv;
} finally {
@@ -1160,21 +1136,21 @@ LEAVING("657v773m21j5w3g3v94o7464t","left2right");
//3 daknncpjy7g5peiicolbmh55i
// static int in_cross(node_t * v, node_t * w)
-public static int in_cross(Agnode_s v, Agnode_s w) {
+public static int in_cross(ST_Agnode_s v, ST_Agnode_s w) {
ENTERING("daknncpjy7g5peiicolbmh55i","in_cross");
try {
- __array_of_ptr__ e1;
- __array_of_ptr__ e2;
+ List<ST_Agedge_s> e2_ = ND_in(w).list;
int inv, cross = 0, t;
- for (e2 = ND_in(w).getTheArray(); e2.getPtr()!=null; e2=e2.plus(1)) {
- int cnt = ED_xpenalty(e2.getPtr());
- inv = ND_order((agtail(e2.getPtr())));
- for (e1 = ND_in(v).getTheArray(); e1.getPtr()!=null; e1=e1.plus(1)) {
- t = ND_order(agtail(e1.getPtr())) - inv;
+ for (int ie2 = 0; e2_.get(ie2)!=null; ie2++) {
+ int cnt = ED_xpenalty(e2_.get(ie2));
+ inv = ND_order((agtail(e2_.get(ie2))));
+ List<ST_Agedge_s> e1_ = ND_in(v).list;
+ for (int ie1 = 0; e1_.get(ie1)!=null; ie1++) {
+ t = ND_order(agtail(e1_.get(ie1))) - inv;
if ((t > 0)
|| ((t == 0)
- && ( ED_tail_port(e1.getPtr()).getStruct("p").getDouble("x") > ED_tail_port(e2.getPtr()).getStruct("p").getDouble("x"))))
- cross += ED_xpenalty(e1.getPtr()) * cnt;
+ && ( ED_tail_port(e1_.get(ie1)).p.x > ED_tail_port(e2_.get(ie2)).p.x)))
+ cross += ED_xpenalty(e1_.get(ie1)) * cnt;
}
}
return cross;
@@ -1188,20 +1164,21 @@ LEAVING("daknncpjy7g5peiicolbmh55i","in_cross");
//3 b7mf74np8ewrgzwd5u0o8fqod
// static int out_cross(node_t * v, node_t * w)
-public static int out_cross(Agnode_s v, Agnode_s w) {
+public static int out_cross(ST_Agnode_s v, ST_Agnode_s w) {
ENTERING("b7mf74np8ewrgzwd5u0o8fqod","out_cross");
try {
- __array_of_ptr__ e1, e2;
+ List<ST_Agedge_s> e2_ = ND_out(w).list;
int inv, cross = 0, t;
- for (e2 = ND_out(w).getTheArray(); e2.getPtr()!=null; e2=e2.plus(1)) {
- int cnt = ED_xpenalty((Agedge_s)e2.getPtr());
- inv = ND_order(aghead(e2.getPtr()));
- for (e1 = ND_out(v).getTheArray(); e1.getPtr()!=null; e1=e1.plus(1)) {
- t = ND_order(aghead(e1.getPtr())) - inv;
+ for (int ie2 = 0; e2_.get(ie2)!=null; ie2++) {
+ int cnt = ED_xpenalty(e2_.get(ie2));
+ inv = ND_order(aghead(e2_.get(ie2)));
+ List<ST_Agedge_s> e1_ = ND_out(v).list;
+ for (int ie1 = 0; e1_.get(ie1)!=null; ie1++) {
+ t = ND_order(aghead(e1_.get(ie1))) - inv;
if ((t > 0)
|| ((t == 0)
- && ((ED_head_port(e1.getPtr())).getStruct("p").getDouble("x") > (ED_head_port(e2.getPtr())).getStruct("p").getDouble("x"))))
- cross += ((ED_xpenalty(e1.getPtr())) * cnt);
+ && ((ED_head_port(e1_.get(ie1))).p.x) > (ED_head_port(e2_.get(ie2))).p.x))
+ cross += ((ED_xpenalty(e1_.get(ie1))) * cnt);
}
}
return cross;
@@ -1215,7 +1192,7 @@ LEAVING("b7mf74np8ewrgzwd5u0o8fqod","out_cross");
//3 ba4tbr57wips1dzpgxzx3b6ja
// static void exchange(node_t * v, node_t * w)
-public static void exchange(Agnode_s v, Agnode_s w) {
+public static void exchange(ST_Agnode_s v, ST_Agnode_s w) {
ENTERING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
try {
int vi, wi, r;
@@ -1223,9 +1200,9 @@ try {
vi = ND_order(v);
wi = ND_order(w);
ND_order(v, wi);
- GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(wi).setPtr(v);
+ GD_rank(Z.z().Root).get(r).v.plus(wi).setPtr(v);
ND_order(w, vi);
- GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(vi).setPtr(w);
+ GD_rank(Z.z().Root).get(r).v.plus(vi).setPtr(w);
} finally {
LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
}
@@ -1361,16 +1338,16 @@ throw new UnsupportedOperationException();
//3 bxwzx4m9ejausu58u7abr6fm0
// static int transpose_step(graph_t * g, int r, int reverse)
-public static int transpose_step(Agraph_s g, int r, boolean reverse) {
+public static int transpose_step(ST_Agraph_s g, int r, boolean reverse) {
ENTERING("bxwzx4m9ejausu58u7abr6fm0","transpose_step");
try {
int i, c0, c1, rv;
- Agnode_s v, w;
+ ST_Agnode_s v, w;
rv = 0;
- GD_rank(g).plus(r).getPtr().setBoolean("candidate", false);
- for (i = 0; i < GD_rank(g).plus(r).getInt("n") - 1; i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
- w = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i + 1).getPtr();
+ GD_rank(g).get(r).candidate= false;
+ for (i = 0; i < GD_rank(g).get(r).n - 1; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
+ w = (ST_Agnode_s) GD_rank(g).get(r).v.plus(i + 1).getPtr();
//assert(ND_order(v) < ND_order(w));
if (left2right(g, v, w))
continue;
@@ -1379,22 +1356,22 @@ try {
c0 += in_cross(v, w);
c1 += in_cross(w, v);
}
- if (GD_rank(g).plus(r + 1).getInt("n") > 0) {
+ if (GD_rank(g).get(r + 1).n > 0) {
c0 += out_cross(v, w);
c1 += out_cross(w, v);
}
if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) {
exchange(v, w);
rv += (c0 - c1);
- GD_rank(Z.z().Root).plus(r).getPtr().setBoolean("valid", false);
- GD_rank(g).plus(r).getPtr().setBoolean("candidate", NOT(false));
+ GD_rank(Z.z().Root).get(r).valid= 0;
+ GD_rank(g).get(r).candidate= NOT(false);
if (r > GD_minrank(g)) {
- GD_rank(Z.z().Root).plus(r - 1).getPtr().setBoolean("valid", false);
- GD_rank(g).plus(r - 1).getPtr().setBoolean("candidate", NOT(false));
+ GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
+ GD_rank(g).get(r - 1).candidate= NOT(false);
}
if (r < GD_maxrank(g)) {
- GD_rank(Z.z().Root).plus(r + 1).getPtr().setBoolean("valid", false);
- GD_rank(g).plus(r + 1).getPtr().setBoolean("candidate", NOT(false));
+ GD_rank(Z.z().Root).plus(r + 1).getPtr().valid= 0;
+ GD_rank(g).get(r + 1).candidate= NOT(false);
}
}
}
@@ -1409,16 +1386,16 @@ LEAVING("bxwzx4m9ejausu58u7abr6fm0","transpose_step");
//3 2i22bxgg5y7v5c5d40k5zppky
// static void transpose(graph_t * g, int reverse)
-public static void transpose(Agraph_s g, boolean reverse) {
+public static void transpose(ST_Agraph_s g, boolean reverse) {
ENTERING("2i22bxgg5y7v5c5d40k5zppky","transpose");
try {
int r, delta;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++)
- GD_rank(g).plus(r).getPtr().setBoolean("candidate", NOT(false));
+ GD_rank(g).get(r).candidate= NOT(false);
do {
delta = 0;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- if (GD_rank(g).plus(r).getPtr().getBoolean("candidate")) {
+ if (GD_rank(g).get(r).candidate) {
delta += transpose_step(g, r, reverse);
}
}
@@ -1434,7 +1411,7 @@ LEAVING("2i22bxgg5y7v5c5d40k5zppky","transpose");
//3 7lrk2rxqnwwdau8cx85oqkpmv
// static int mincross(graph_t * g, int startpass, int endpass, int doBalance)
-public static int mincross_(Agraph_s g, int startpass, int endpass, boolean doBalance) {
+public static int mincross_(ST_Agraph_s g, int startpass, int endpass, boolean doBalance) {
ENTERING("7lrk2rxqnwwdau8cx85oqkpmv","mincross");
try {
int maxthispass=0, iter, trying, pass;
@@ -1505,18 +1482,17 @@ LEAVING("7lrk2rxqnwwdau8cx85oqkpmv","mincross");
//3 520049zkz9mafaeklgvm6s8e5
// static void restore_best(graph_t * g)
-public static void restore_best(Agraph_s g) {
+public static void restore_best(ST_Agraph_s g) {
ENTERING("520049zkz9mafaeklgvm6s8e5","restore_best");
try {
- Agnode_s n;
+ ST_Agnode_s n;
int r;
for (n = GD_nlist(g); n!=null; n = ND_next(n))
- ND_order(n, (int)ND_coord(n).getDouble("x"));
+ ND_order(n, (int)ND_coord(n).x);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
- qsort(GD_rank(g).plus(r).getPtr("v"),
- GD_rank(g).plus(r).getInt("n"),
- sizeof(GD_rank(g).plus(r).getPtr("v").plus(0)),
+ GD_rank(Z.z().Root).get(r).valid= 0;
+ qsort(GD_rank(g).get(r).v,
+ GD_rank(g).get(r).n,
function(mincross__c.class, "nodeposcmpf"));
}
} finally {
@@ -1529,10 +1505,10 @@ LEAVING("520049zkz9mafaeklgvm6s8e5","restore_best");
//3 8uyqc48j0oul206l3np85wj9p
// static void save_best(graph_t * g)
-public static void save_best(Agraph_s g) {
+public static void save_best(ST_Agraph_s g) {
ENTERING("8uyqc48j0oul206l3np85wj9p","save_best");
try {
- Agnode_s n;
+ ST_Agnode_s n;
for (n = GD_nlist(g); n!=null; n = ND_next(n))
(ND_coord(n)).x = ND_order(n);
} finally {
@@ -1545,16 +1521,16 @@ LEAVING("8uyqc48j0oul206l3np85wj9p","save_best");
//3 6d08fwi4dsk6ikk5d0gy6rq2h
// static void merge_components(graph_t * g)
-public static void merge_components(Agraph_s g) {
+public static void merge_components(ST_Agraph_s g) {
ENTERING("6d08fwi4dsk6ikk5d0gy6rq2h","merge_components");
try {
int c;
- Agnode_s u, v;
+ ST_Agnode_s u, v;
if (GD_comp(g).size <= 1)
return;
u = null;
for (c = 0; c < GD_comp(g).size; c++) {
- v = (Agnode_s) GD_comp(g).getFromList(c);
+ v = (ST_Agnode_s) GD_comp(g).getFromList(c);
if (u!=null)
ND_next(u, v);
ND_prev(v, u);
@@ -1577,19 +1553,19 @@ LEAVING("6d08fwi4dsk6ikk5d0gy6rq2h","merge_components");
//3 91vebcdl3q3y0uyxef0iw71n9
// static void merge2(graph_t * g)
-public static void merge2(Agraph_s g) {
+public static void merge2(ST_Agraph_s g) {
ENTERING("91vebcdl3q3y0uyxef0iw71n9","merge2");
try {
int i, r;
- Agnode_s v;
+ ST_Agnode_s v;
/* merge the components and rank limits */
merge_components(g);
/* install complete ranks */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("an"));
- GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("av"));
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).an);
+ GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).av);
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (v == null) {
/*if (Verbose)
fprintf(stderr,
@@ -1611,12 +1587,12 @@ LEAVING("91vebcdl3q3y0uyxef0iw71n9","merge2");
//3 3cwiyyk1d1jkoo9iqwb5bge4x
// static void cleanup2(graph_t * g, int nc)
-public static void cleanup2(Agraph_s g, int nc) {
+public static void cleanup2(ST_Agraph_s g, int nc) {
ENTERING("3cwiyyk1d1jkoo9iqwb5bge4x","cleanup2");
try {
int i, j, r, c;
- Agnode_s v;
- Agedge_s e;
+ ST_Agnode_s v;
+ ST_Agedge_s e;
if (Z.z().TI_list!=null) {
Memory.free(Z.z().TI_list);
Z.z().TI_list = null;
@@ -1627,23 +1603,23 @@ try {
}
/* fix vlists of clusters */
for (c = 1; c <= GD_n_cluster(g); c++)
- rec_reset_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
+ rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
/* remove node temporary edges for ordering nodes */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_order(v, i);
if (ND_flat_out(v).listNotNull()) {
- for (j = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++)
+ for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++)
if (ED_edge_type(e) == 4) {
delete_flat_edge(e);
- Memory.free(e.getPtr("base.data"));
+ Memory.free(e.base.data);
Memory.free(e);
j--;
}
}
}
- free_matrix((adjmatrix_t) GD_rank(g).plus(r).getPtr("flat"));
+ free_matrix((ST_adjmatrix_t) GD_rank(g).get(r).flat);
}
/*if (Verbose)
fprintf(stderr, "mincross %s: %d crossings, %.2f secs.\n",
@@ -1658,17 +1634,17 @@ LEAVING("3cwiyyk1d1jkoo9iqwb5bge4x","cleanup2");
//3 arax68kzcf86dr2xu0gp962gq
// static node_t *neighbor(node_t * v, int dir)
-public static Agnode_s neighbor(Agnode_s v, int dir) {
+public static ST_Agnode_s neighbor(ST_Agnode_s v, int dir) {
ENTERING("arax68kzcf86dr2xu0gp962gq","neighbor");
try {
- Agnode_s rv;
+ ST_Agnode_s rv;
rv = null;
assert(v!=null);
if (dir < 0) {
if (ND_order(v) > 0)
- rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) - 1).getPtr();
+ rv = (ST_Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getPtr().v.plus(ND_order(v) - 1).getPtr();
} else
- rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) + 1).getPtr();
+ rv = (ST_Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getPtr().v.plus(ND_order(v) + 1).getPtr();
assert((rv == null) || (ND_order(rv)-ND_order(v))*dir > 0);
return rv;
} finally {
@@ -1681,7 +1657,7 @@ LEAVING("arax68kzcf86dr2xu0gp962gq","neighbor");
//3 1waqm8z71hi389dt1wqh0bmhr
// static int is_a_normal_node_of(graph_t * g, node_t * v)
-public static boolean is_a_normal_node_of(Agraph_s g, Agnode_s v) {
+public static boolean is_a_normal_node_of(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("1waqm8z71hi389dt1wqh0bmhr","is_a_normal_node_of");
try {
return ((ND_node_type(v) == 0) && agcontains(g, v));
@@ -1695,12 +1671,12 @@ LEAVING("1waqm8z71hi389dt1wqh0bmhr","is_a_normal_node_of");
//3 9f8atyi1unmleplge3rijdt4s
// static int is_a_vnode_of_an_edge_of(graph_t * g, node_t * v)
-public static boolean is_a_vnode_of_an_edge_of(Agraph_s g, Agnode_s v) {
+public static boolean is_a_vnode_of_an_edge_of(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("9f8atyi1unmleplge3rijdt4s","is_a_vnode_of_an_edge_of");
try {
if ((ND_node_type(v) == 1)
&& (ND_in(v).size == 1) && (ND_out(v).size == 1)) {
- Agedge_s e = (Agedge_s) ND_out(v).getFromList(0);
+ ST_Agedge_s e = (ST_Agedge_s) ND_out(v).getFromList(0);
while (ED_edge_type(e) != 0)
e = ED_to_orig(e);
if (agcontains(g, e))
@@ -1717,7 +1693,7 @@ LEAVING("9f8atyi1unmleplge3rijdt4s","is_a_vnode_of_an_edge_of");
//3 eo7ulc8vwmoaig0j479yapve2
// static int inside_cluster(graph_t * g, node_t * v)
-public static boolean inside_cluster(Agraph_s g, Agnode_s v) {
+public static boolean inside_cluster(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("eo7ulc8vwmoaig0j479yapve2","inside_cluster");
try {
return (is_a_normal_node_of(g, v) | is_a_vnode_of_an_edge_of(g, v));
@@ -1731,10 +1707,10 @@ LEAVING("eo7ulc8vwmoaig0j479yapve2","inside_cluster");
//3 8xkmkt4r6gfqj8gk0mokszoz0
// static node_t *furthestnode(graph_t * g, node_t * v, int dir)
-public static Agnode_s furthestnode(Agraph_s g, Agnode_s v, int dir) {
+public static ST_Agnode_s furthestnode(ST_Agraph_s g, ST_Agnode_s v, int dir) {
ENTERING("8xkmkt4r6gfqj8gk0mokszoz0","furthestnode");
try {
- Agnode_s u, rv;
+ ST_Agnode_s u, rv;
rv = u = v;
while ((u = neighbor(u, dir))!=null) {
if (is_a_normal_node_of(g, u))
@@ -1753,13 +1729,13 @@ LEAVING("8xkmkt4r6gfqj8gk0mokszoz0","furthestnode");
//3 bwmu2hkwud40601oq5vgo2f1h
// void save_vlist(graph_t * g)
-public static void save_vlist(Agraph_s g) {
+public static void save_vlist(ST_Agraph_s g) {
ENTERING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
try {
int r;
if (GD_rankleader(g)!=null)
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- GD_rankleader(g).plus(r).setPtr(GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr());
+ GD_rankleader(g).plus(r).setPtr(GD_rank(g).get(r).v.get(0));
}
} finally {
LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
@@ -1771,13 +1747,13 @@ LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
//3 hwdxg97sefkuyd25x2q4pgzg
// void rec_save_vlists(graph_t * g)
-public static void rec_save_vlists(Agraph_s g) {
+public static void rec_save_vlists(ST_Agraph_s g) {
ENTERING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
try {
int c;
save_vlist(g);
for (c = 1; c <= GD_n_cluster(g); c++)
- rec_save_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
+ rec_save_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally {
LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
}
@@ -1788,21 +1764,21 @@ LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
//3 f3b4wat4uxn5oil720i5mwq4v
// void rec_reset_vlists(graph_t * g)
-public static void rec_reset_vlists(Agraph_s g) {
+public static void rec_reset_vlists(ST_Agraph_s g) {
ENTERING("f3b4wat4uxn5oil720i5mwq4v","rec_reset_vlists");
try {
int r, c;
- Agnode_s u, v, w;
+ ST_Agnode_s u, v, w;
/* fix vlists of sub-clusters */
for (c = 1; c <= GD_n_cluster(g); c++)
- rec_reset_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
+ rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
if (GD_rankleader(g)!=null)
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- v = (Agnode_s) GD_rankleader(g).plus(r).getPtr();
+ v = (ST_Agnode_s) GD_rankleader(g).get(r);
u = furthestnode(g, v, -1);
w = furthestnode(g, v, 1);
GD_rankleader(g).plus(r).setPtr(u);
- GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).plus(r).getPtr("v").plus(ND_order(u)));
+ GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).get(r).v.plus(ND_order(u)));
GD_rank(g).plus(r).setInt("n", ND_order(w) - ND_order(u) + 1);
}
} finally {
@@ -1815,7 +1791,7 @@ LEAVING("f3b4wat4uxn5oil720i5mwq4v","rec_reset_vlists");
//3 pv0rbbdopo4hmkbl5916qys1
// static Agraph_t* realFillRanks (Agraph_t* g, int rnks[], int rnks_sz, Agraph_t* sg)
-public static Agraph_s realFillRanks(Agraph_s g, __ptr__ rnks, int rnks_sz, Agraph_s sg) {
+public static ST_Agraph_s realFillRanks(ST_Agraph_s g, __ptr__ rnks, int rnks_sz, ST_Agraph_s sg) {
ENTERING("pv0rbbdopo4hmkbl5916qys1","realFillRanks");
try {
UNSUPPORTED("2o2sf6xi2aumo5k0vglp4ik2y"); // static Agraph_t*
@@ -1866,10 +1842,10 @@ LEAVING("pv0rbbdopo4hmkbl5916qys1","realFillRanks");
//3 1qy9bupreg1pax62owznr98k
// static void fillRanks (Agraph_t* g)
-public static void fillRanks(Agraph_s g) {
+public static void fillRanks(ST_Agraph_s g) {
ENTERING("1qy9bupreg1pax62owznr98k","fillRanks");
try {
- Agraph_s sg;
+ ST_Agraph_s sg;
int rnks_sz = GD_maxrank(g) + 2;
__ptr__ rnks = zmalloc(size_t_array_of_integer(rnks_sz));
sg = realFillRanks (g, rnks, rnks_sz, null);
@@ -1884,7 +1860,7 @@ LEAVING("1qy9bupreg1pax62owznr98k","fillRanks");
//3 7fy4chyk12o7bgp1rv3h27yl3
// static void init_mincross(graph_t * g)
-public static void init_mincross(Agraph_s g) {
+public static void init_mincross(ST_Agraph_s g) {
ENTERING("7fy4chyk12o7bgp1rv3h27yl3","init_mincross");
try {
int size;
@@ -1896,7 +1872,7 @@ try {
/* also, the +1 avoids attempts to alloc 0 sizes, something
that efence complains about */
size = agnedges(dot_root(g)) + 1;
- Z.z().TE_list = zmalloc(sizeof_starstar_empty(Agedge_s.class, size));
+ Z.z().TE_list = new ST_Agedge_s.ArrayOfStar(size);
Z.z().TI_list = zmalloc(size_t_array_of_integer(size));
mincross_options(g);
if ((GD_flags(g) & (1 << 4))!=0)
@@ -1917,16 +1893,16 @@ LEAVING("7fy4chyk12o7bgp1rv3h27yl3","init_mincross");
//3 6fprrp93vmz0jn3l4ro0iropp
// void flat_rev(Agraph_t * g, Agedge_t * e)
-public static void flat_rev(Agraph_s g, Agedge_s e) {
+public static void flat_rev(ST_Agraph_s g, ST_Agedge_s e) {
ENTERING("6fprrp93vmz0jn3l4ro0iropp","flat_rev");
try {
int j;
- Agedge_s rev;
+ ST_Agedge_s rev;
if (ND_flat_out(aghead(e)).listNotNull()==false)
- // if (N(ND_flat_out(aghead(e)).getArrayOfPtr("list")))
+ // if (N(ND_flat_out(aghead(e)).list))
rev = null;
else
- for (j = 0; (rev = (Agedge_s) ND_flat_out(aghead(e)).getFromList(j))!=null; j++)
+ for (j = 0; (rev = (ST_Agedge_s) ND_flat_out(aghead(e)).getFromList(j))!=null; j++)
if (EQ(aghead(rev), agtail(e)))
break;
if (rev!=null) {
@@ -1956,36 +1932,36 @@ LEAVING("6fprrp93vmz0jn3l4ro0iropp","flat_rev");
//3 63ol0ch6cgln1nvl5oiz6n1v0
// static void flat_search(graph_t * g, node_t * v)
-public static void flat_search(Agraph_s g, Agnode_s v) {
+public static void flat_search(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("63ol0ch6cgln1nvl5oiz6n1v0","flat_search");
try {
int i;
boolean hascl;
- Agedge_s e;
- adjmatrix_t M = (adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr("flat");
+ ST_Agedge_s e;
+ ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).get(ND_rank(v)).flat;
ND_mark(v, NOT(false));
ND_onstack(v, NOT(false));
hascl = (GD_n_cluster(dot_root(g)) > 0);
if (ND_flat_out(v).listNotNull())
- for (i = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
if (hascl
&& NOT(agcontains(g, agtail(e)) && agcontains(g, aghead(e))))
continue;
if (ED_weight(e) == 0)
continue;
if (ND_onstack(aghead(e)) == NOT(false)) {
- assert(ND_low(aghead(e)) < M.getInt("nrows"));
- assert(ND_low(agtail(e)) < M.getInt("ncols"));
- M.getArrayOfInteger("data").plus(ND_low(aghead(e))*M.getInt("ncols")+ND_low(agtail(e))).setInt(1);
+ assert(ND_low(aghead(e)) < M.nrows);
+ assert(ND_low(agtail(e)) < M.ncols);
+ M.data[ND_low(aghead(e))][ND_low(agtail(e))]=1;
delete_flat_edge(e);
i--;
if (ED_edge_type(e) == 4)
continue;
flat_rev(g, e);
} else {
- assert(ND_low(aghead(e)) < M.getInt("nrows"));
- assert(ND_low(agtail(e)) < M.getInt("ncols"));
- M.getArrayOfInteger("data").plus(ND_low(agtail(e))*M.getInt("ncols")+ND_low(aghead(e))).setInt(1);
+ assert(ND_low(aghead(e)) < M.nrows);
+ assert(ND_low(agtail(e)) < M.ncols);
+ M.data[ND_low(agtail(e))][ND_low(aghead(e))]=1;
if (ND_mark(aghead(e)) == 0)
flat_search(g, aghead(e));
}
@@ -2001,27 +1977,27 @@ LEAVING("63ol0ch6cgln1nvl5oiz6n1v0","flat_search");
//3 3v5h7z4vqivibvpt913lg8at0
// static void flat_breakcycles(graph_t * g)
-public static void flat_breakcycles(Agraph_s g) {
+public static void flat_breakcycles(ST_Agraph_s g) {
ENTERING("3v5h7z4vqivibvpt913lg8at0","flat_breakcycles");
try {
int i, r, flat;
- Agnode_s v;
+ ST_Agnode_s v;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
flat = 0;
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_mark(v, 0);
ND_onstack(v, 0);
ND_low(v, i);
if ((ND_flat_out(v).size > 0) && (flat == 0)) {
GD_rank(g).plus(r).setPtr("flat",
- new_matrix(GD_rank(g).plus(r).getInt("n"), GD_rank(g).plus(r).getInt("n")));
+ new_matrix(GD_rank(g).get(r).n, GD_rank(g).get(r).n));
flat = 1;
}
}
if (flat!=0) {
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (ND_mark(v) == 0)
flat_search(g, v);
}
@@ -2037,14 +2013,14 @@ LEAVING("3v5h7z4vqivibvpt913lg8at0","flat_breakcycles");
//3 d5vb6jiw8mhkaa8gjwn4eqfyn
// void allocate_ranks(graph_t * g)
-public static void allocate_ranks(Agraph_s g) {
+public static void allocate_ranks(ST_Agraph_s g) {
ENTERING("d5vb6jiw8mhkaa8gjwn4eqfyn","allocate_ranks");
try {
// REVIEW 17/01/2016
int r, low, high;
__ptr__ cn;
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
cn = zmalloc(size_t_array_of_integer(GD_maxrank(g) + 2));
/* must be 0 based, not GD_minrank */
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
@@ -2061,11 +2037,11 @@ try {
cn.plus(r).setInt(1+cn.plus(r).getInt());
}
}
- GD_rank(g, zmalloc(sizeof(rank_t.class, GD_maxrank(g) + 2)));
+ GD_rank(g, new ST_rank_t.Array2(GD_maxrank(g) + 2));
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
GD_rank(g).plus(r).setInt("n", cn.plus(r).getInt());
GD_rank(g).plus(r).setInt("an", cn.plus(r).getInt());
- __ptr__ tmp = zmalloc(sizeof_starstar_empty(Agnode_s.class, cn.plus(r).getInt() + 1));
+ ST_Agnode_s.ArrayOfStar tmp = new ST_Agnode_s.ArrayOfStar(cn.plus(r).getInt() + 1);
GD_rank(g).plus(r).setPtr("v", tmp);
GD_rank(g).plus(r).setPtr("av", tmp);
}
@@ -2080,22 +2056,22 @@ LEAVING("d5vb6jiw8mhkaa8gjwn4eqfyn","allocate_ranks");
//3 3lxoqxhiri9fgt20zc5jz3aa5
// void install_in_rank(graph_t * g, node_t * n)
-public static void install_in_rank(Agraph_s g, Agnode_s n) {
+public static void install_in_rank(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("3lxoqxhiri9fgt20zc5jz3aa5","install_in_rank");
try {
int i, r;
r = ND_rank(n);
- i = GD_rank(g).plus(r).getInt("n");
- if (GD_rank(g).plus(r).getInt("an") <= 0) {
+ i = GD_rank(g).get(r).n;
+ if (GD_rank(g).get(r).an <= 0) {
UNSUPPORTED("8qk1xhvvb994zhv9aq10k4v12"); // agerr(AGERR, "install_in_rank, line %d: %s %s rank %d i = %d an = 0\n",
UNSUPPORTED("53h8d82ax23hys2k21hjswp72"); // 1034, agnameof(g), agnameof(n), r, i);
return;
}
- GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).setPtr(n);
+ GD_rank(g).get(r).v.plus(i).setPtr(n);
ND_order(n, i);
- GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).plus(r).getInt("n"));
+ GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).get(r).n);
// assert(GD_rank(g)[r].n <= GD_rank(g)[r].an);
- if (ND_order(n) > GD_rank(Z.z().Root).plus(r).getInt("an")) {
+ if (ND_order(n) > GD_rank(Z.z().Root).get(r).an) {
UNSUPPORTED("399szcw1txekt1xssyw7s2x07"); // agerr(AGERR, "install_in_rank, line %d: ND_order(%s) [%d] > GD_rank(Root)[%d].an [%d]\n",
UNSUPPORTED("9puojrmsk6vb1qc0jtr8ge4g8"); // 1052, agnameof(n), ND_order(n), r, GD_rank(Root)[r].an);
return;
@@ -2105,8 +2081,8 @@ UNSUPPORTED("7o1thnqda767wqpe2lh9mj03t"); // agerr(AGERR, "install_in_rank, lin
UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_maxrank(g));
return;
}
- if (GD_rank(g).plus(r).getPtr("v").plus(ND_order(n)).comparePointer(
- GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z.z().Root).plus(r).getInt("an")))>0) {
+ if (GD_rank(g).get(r).v.plus(ND_order(n)).comparePointer(
+ GD_rank(g).get(r).av.plus(GD_rank(Z.z().Root).get(r).an))>0) {
UNSUPPORTED("3eb32nc5czs5auwzz5p5mtl04"); // agerr(AGERR, "install_in_rank, line %d: GD_rank(g)[%d].v + ND_order(%s) [%d] > GD_rank(g)[%d].av + GD_rank(Root)[%d].an [%d]\n",
UNSUPPORTED("3qe3qpw5h6vse39xs1ca9sjmo"); // 1062, r, agnameof(n),GD_rank(g)[r].v + ND_order(n), r, r, GD_rank(g)[r].av+GD_rank(Root)[r].an);
return;
@@ -2121,21 +2097,21 @@ LEAVING("3lxoqxhiri9fgt20zc5jz3aa5","install_in_rank");
//3 7t49bz6lfcbd9v63ds2x3518z
// void build_ranks(graph_t * g, int pass)
-public static void build_ranks(Agraph_s g, int pass) {
+public static void build_ranks(ST_Agraph_s g, int pass) {
ENTERING("7t49bz6lfcbd9v63ds2x3518z","build_ranks");
try {
int i, j;
- Agnode_s n, n0 = null;
- __ptr__ otheredges;
- nodequeue q;
+ ST_Agnode_s n, n0 = null;
+ List<ST_Agedge_s> otheredges;
+ ST_nodequeue q;
q = new_queue(GD_n_nodes(g));
for (n = GD_nlist(g); n!=null; n = ND_next(n))
ND_mark(n, 0);
for (i = GD_minrank(g); i <= GD_maxrank(g); i++)
GD_rank(g).plus(i).setInt("n", 0);
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
- otheredges = ((pass == 0) ? ND_in(n).getTheList() : ND_out(n).getTheList());
- if (otheredges.plus(0).getPtr() != null)
+ otheredges = ((pass == 0) ? ND_in(n).list : ND_out(n).list);
+ if (otheredges.get(0)!= null)
continue;
if ((ND_mark(n)) == 0) {
ND_mark(n, 1);
@@ -2154,13 +2130,13 @@ try {
UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n");
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
GD_rank(Z.z().Root).plus(i).setInt("valid", 0);
- if (GD_flip(g)!=0 && (GD_rank(g).plus(i).getInt("n") > 0)) {
+ if (GD_flip(g)!=0 && (GD_rank(g).get(i).n > 0)) {
int nn, ndiv2;
- __ptr__ vlist = GD_rank(g).plus(i).getPtr("v");
- nn = GD_rank(g).plus(i).getInt("n") - 1;
+ ST_Agnode_s.ArrayOfStar vlist = GD_rank(g).get(i).v;
+ nn = GD_rank(g).get(i).n - 1;
ndiv2 = nn / 2;
for (j = 0; j <= ndiv2; j++)
- exchange((Agnode_s)vlist.plus(j).getPtr(), (Agnode_s)vlist.plus(nn - j).getPtr());
+ exchange((ST_Agnode_s)vlist.get(j), (ST_Agnode_s)vlist.plus(nn - j).getPtr());
}
}
if (EQ(g, dot_root(g)) && ncross(g) > 0)
@@ -2176,14 +2152,14 @@ LEAVING("7t49bz6lfcbd9v63ds2x3518z","build_ranks");
//3 bmjlneqxex6a9silzkkidkx6s
// void enqueue_neighbors(nodequeue * q, node_t * n0, int pass)
-public static void enqueue_neighbors(nodequeue q, Agnode_s n0, int pass) {
+public static void enqueue_neighbors(ST_nodequeue q, ST_Agnode_s n0, int pass) {
ENTERING("bmjlneqxex6a9silzkkidkx6s","enqueue_neighbors");
try {
int i;
- Agedge_s e;
+ ST_Agedge_s e;
if (pass == 0) {
for (i = 0; i < ND_out(n0).size; i++) {
- e = (Agedge_s) ND_out(n0).getFromList(i);
+ e = (ST_Agedge_s) ND_out(n0).getFromList(i);
if (((ND_mark(aghead(e)))) == 0) {
ND_mark(aghead(e), 1);
enqueue(q, aghead(e));
@@ -2191,7 +2167,7 @@ try {
}
} else {
for (i = 0; i < ND_in(n0).size; i++) {
- e = (Agedge_s) ND_in(n0).getFromList(i);
+ e = (ST_Agedge_s) ND_in(n0).getFromList(i);
if (((ND_mark(agtail(e)))) == 0) {
ND_mark(agtail(e), 1);
enqueue(q, agtail(e));
@@ -2208,7 +2184,7 @@ LEAVING("bmjlneqxex6a9silzkkidkx6s","enqueue_neighbors");
//3 c8nqj0v20api63pikohsbx92u
// static int constraining_flat_edge(Agraph_t *g, Agnode_t *v, Agedge_t *e)
-public static boolean constraining_flat_edge(Agraph_s g, Agnode_s v, Agedge_s e) {
+public static boolean constraining_flat_edge(ST_Agraph_s g, ST_Agnode_s v, ST_Agedge_s e) {
ENTERING("c8nqj0v20api63pikohsbx92u","constraining_flat_edge");
try {
if (ED_weight(e) == 0) return false;
@@ -2225,14 +2201,14 @@ LEAVING("c8nqj0v20api63pikohsbx92u","constraining_flat_edge");
//3 46to0pkk188af2dlkik2ab7e3
// static int postorder(graph_t * g, node_t * v, node_t ** list, int r)
-public static int postorder(Agraph_s g, Agnode_s v, __ptr__ list, int r) {
+public static int postorder(ST_Agraph_s g, ST_Agnode_s v, __ptr__ list, int r) {
ENTERING("46to0pkk188af2dlkik2ab7e3","postorder");
try {
- Agedge_s e;
+ ST_Agedge_s e;
int i, cnt = 0;
ND_mark(v, NOT(false));
if (ND_flat_out(v).size > 0) {
- for (i = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
if (N(constraining_flat_edge(g,v,e))) continue;
if ((ND_mark(aghead(e))) == 0)
cnt += postorder(g, aghead(e), list.plus(cnt), r);
@@ -2251,34 +2227,34 @@ LEAVING("46to0pkk188af2dlkik2ab7e3","postorder");
//3 zuxoswju917kyl08a5f0gtp6
// static void flat_reorder(graph_t * g)
-public static void flat_reorder(Agraph_s g) {
+public static void flat_reorder(ST_Agraph_s g) {
ENTERING("zuxoswju917kyl08a5f0gtp6","flat_reorder");
try {
int i, j, r, pos, n_search, local_in_cnt, local_out_cnt, base_order;
- Agnode_s v, t;
+ ST_Agnode_s v, t;
__ptr__ left, right;
- __ptr__ temprank = null;
- Agedge_s flat_e, e;
+ ST_Agnode_s.ArrayOfStar temprank = null;
+ ST_Agedge_s flat_e, e;
if (GD_has_flat_edges(g) == 0)
return;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- if (GD_rank(g).plus(r).getInt("n") == 0) continue;
- base_order = ND_order(GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr());
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++)
- ND_mark(GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr(), 0);
- temprank = ALLOC(i + 1, temprank, Agnode_s.class);
+ if (GD_rank(g).get(r).n == 0) continue;
+ base_order = ND_order(GD_rank(g).get(r).v.get(0));
+ for (i = 0; i < GD_rank(g).get(r).n; i++)
+ ND_mark(GD_rank(g).get(r).v.get(i), 0);
+ temprank = ALLOC_Agnode_s(i + 1, temprank);
pos = 0;
/* construct reverse topological sort order in temprank */
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- if (GD_flip(g)!=0) v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
- else v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(GD_rank(g).plus(r).getInt("n") - i - 1).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ if (GD_flip(g)!=0) v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
+ else v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - i - 1).getPtr();
local_in_cnt = local_out_cnt = 0;
for (j = 0; j < ND_flat_in(v).size; j++) {
- flat_e = (Agedge_s) ND_flat_in(v).getFromList(j);
+ flat_e = (ST_Agedge_s) ND_flat_in(v).getFromList(j);
if (constraining_flat_edge(g,v,flat_e)) local_in_cnt++;
}
for (j = 0; j < ND_flat_out(v).size; j++) {
- flat_e = (Agedge_s) ND_flat_out(v).getFromList(j);
+ flat_e = (ST_Agedge_s) ND_flat_out(v).getFromList(j);
if (constraining_flat_edge(g,v,flat_e)) local_out_cnt++;
}
if ((local_in_cnt == 0) && (local_out_cnt == 0))
@@ -2296,23 +2272,23 @@ try {
left = temprank;
right = temprank.plus(pos - 1);
while (left.comparePointer(right) < 0) {
- t = (Agnode_s) left.getPtr();
+ t = (ST_Agnode_s) left.getPtr();
left.setPtr(right.getPtr());
right.setPtr(t);
left = left.plus(1);
right = right.plus(-1);
}
}
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) temprank.plus(i).getPtr();
- GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).setPtr(v);
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) temprank.get(i);
+ GD_rank(g).get(r).v.plus(i).setPtr(v);
ND_order(v, i + base_order);
}
/* nonconstraint flat edges must be made LR */
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (ND_flat_out(v).listNotNull()) {
- for (j = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) {
if ( ((GD_flip(g) == 0) && (ND_order(aghead(e)) < ND_order(agtail(e)))) ||
( (GD_flip(g)!=0) && (ND_order(aghead(e)) > ND_order(agtail(e)) ))) {
assert(constraining_flat_edge(g,v,e) == false);
@@ -2340,15 +2316,15 @@ LEAVING("zuxoswju917kyl08a5f0gtp6","flat_reorder");
//3 inv6wazjcnh4xkzzphsdcmg4
// static void reorder(graph_t * g, int r, int reverse, int hasfixed)
-public static void reorder(Agraph_s g, int r, boolean reverse, boolean hasfixed) {
+public static void reorder(ST_Agraph_s g, int r, boolean reverse, boolean hasfixed) {
ENTERING("inv6wazjcnh4xkzzphsdcmg4","reorder");
try {
boolean changed = false;
int nelt;
boolean muststay, sawclust;
- __ptr__ vlist = GD_rank(g).plus(r).getPtr("v");
- __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).plus(r).getInt("n"));
- for (nelt = GD_rank(g).plus(r).getInt("n") - 1; nelt >= 0; nelt--) {
+ __ptr__ vlist = GD_rank(g).get(r).v;
+ __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).get(r).n);
+ for (nelt = GD_rank(g).get(r).n - 1; nelt >= 0; nelt--) {
lp = vlist;
while (lp.comparePointer(ep)<0) {
/* find leftmost node that can be compared */
@@ -2361,7 +2337,7 @@ try {
for (rp = lp.plus(1); rp.comparePointer(ep) < 0; rp=rp.plus(1)) {
if (sawclust && ND_clust(rp.getPtr())!=null)
continue; /* ### */
- if (left2right(g, (Agnode_s) lp.getPtr(), (Agnode_s) rp.getPtr())) {
+ if (left2right(g, (ST_Agnode_s) lp.getPtr(), (ST_Agnode_s) rp.getPtr())) {
muststay = NOT(false);
break;
}
@@ -2376,7 +2352,7 @@ try {
int p1 = (int) (ND_mval(lp.getPtr()));
int p2 = (int) (ND_mval(rp.getPtr()));
if ((p1 > p2) || ((p1 == p2) && (reverse))) {
- exchange((Agnode_s)lp.getPtr(), (Agnode_s)rp.getPtr());
+ exchange((ST_Agnode_s)lp.getPtr(), (ST_Agnode_s)rp.getPtr());
changed=true;
}
}
@@ -2386,9 +2362,9 @@ try {
ep = ep.plus(-1);
}
if (changed) {
- GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
+ GD_rank(Z.z().Root).get(r).valid= 0;
if (r > 0)
- GD_rank(Z.z().Root).plus(r - 1).setBoolean("valid", false);
+ GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
}
} finally {
LEAVING("inv6wazjcnh4xkzzphsdcmg4","reorder");
@@ -2400,7 +2376,7 @@ LEAVING("inv6wazjcnh4xkzzphsdcmg4","reorder");
//3 14t80owwvm7io4ou6czb9ba9
// static void mincross_step(graph_t * g, int pass)
-public static void mincross_step(Agraph_s g, int pass) {
+public static void mincross_step(ST_Agraph_s g, int pass) {
ENTERING("14t80owwvm7io4ou6czb9ba9","mincross_step");
try {
int r, other, first, last, dir;
@@ -2446,11 +2422,11 @@ LEAVING("14t80owwvm7io4ou6czb9ba9","mincross_step");
//3 aq18oa4k4grixvfjx7r2qnl6r
// static int local_cross(elist l, int dir)
-public static int local_cross(final __struct__<elist> l, int dir) {
+public static int local_cross(final ST_elist l, int dir) {
// WARNING!! STRUCT
return local_cross_w_(l.copy(), dir);
}
-private static int local_cross_w_(final __struct__<elist> l, int dir) {
+private static int local_cross_w_(final ST_elist l, int dir) {
ENTERING("aq18oa4k4grixvfjx7r2qnl6r","local_cross");
try {
UNSUPPORTED("3jmndo6p8u1x5wp297qpt0jto"); // static int local_cross(elist l, int dir)
@@ -2487,47 +2463,47 @@ LEAVING("aq18oa4k4grixvfjx7r2qnl6r","local_cross");
-//3 bk5nklhfqgg0uwkv7tv6dn8r2
-// static int rcross(graph_t * g, int r)
//static __ptr__ Count;
//static int C;
-public static int rcross(Agraph_s g, int r) {
+//3 bk5nklhfqgg0uwkv7tv6dn8r2
+// static int rcross(graph_t * g, int r)
+public static int rcross(ST_Agraph_s g, int r) {
ENTERING("bk5nklhfqgg0uwkv7tv6dn8r2","rcross");
try {
int top, bot, cross, max, i, k;
- Agnode_s v;
- __ptr__ rtop;
+ ST_Agnode_s v;
+ ST_Agnode_s.ArrayOfStar rtop;
cross = 0;
max = 0;
- rtop = GD_rank(g).plus(r).getPtr("v");
- if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getInt("n")) {
- Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getInt("n") + 1;
+ rtop = GD_rank(g).get(r).v;
+ if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getPtr().n) {
+ Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getPtr().n + 1;
Z.z().Count = ALLOC_INT(Z.z().C, Z.z().Count);
}
- for (i = 0; i < GD_rank(g).plus(r + 1).getInt("n"); i++)
+ for (i = 0; i < GD_rank(g).get(r + 1).n; i++)
Z.z().Count.plus(i).setInt(0);
- for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
- Agedge_s e;
+ for (top = 0; top < GD_rank(g).get(r).n; top++) {
+ ST_Agedge_s e;
if (max > 0) {
- for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) {
for (k = ND_order(aghead(e)) + 1; k <= max; k++)
cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e);
}
}
- for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) {
int inv = ND_order(aghead(e));
if (inv > max)
max = inv;
Z.z().Count.plus(inv).setInt(Z.z().Count.plus(inv).getInt() + ED_xpenalty(e));
}
}
- for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(top).getPtr();
+ for (top = 0; top < GD_rank(g).get(r).n; top++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(top);
if (ND_has_port(v))
cross += local_cross(ND_out(v), 1);
}
- for (bot = 0; bot < GD_rank(g).plus(r + 1).getInt("n"); bot++) {
- v = (Agnode_s) GD_rank(g).plus(r + 1).getArrayOfPtr("v").plus(bot).getPtr();
+ for (bot = 0; bot < GD_rank(g).get(r + 1).n; bot++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(bot);
if (ND_has_port(v))
cross += local_cross(ND_in(v), -1);
}
@@ -2542,18 +2518,18 @@ LEAVING("bk5nklhfqgg0uwkv7tv6dn8r2","rcross");
//3 dbjmz2tnii2pn9sxg26ap6w5r
// int ncross(graph_t * g)
-public static int ncross(Agraph_s g) {
+public static int ncross(ST_Agraph_s g) {
ENTERING("dbjmz2tnii2pn9sxg26ap6w5r","ncross");
try {
int r, count, nc;
g = Z.z().Root;
count = 0;
for (r = GD_minrank(g); r < GD_maxrank(g); r++) {
- if (GD_rank(g).plus(r).getBoolean("valid"))
- count += GD_rank(g).plus(r).getInt("cache_nc");
+ if (GD_rank(g).get(r).valid!=0)
+ count += GD_rank(g).get(r).cache_nc;
else {
nc = rcross(g, r);
- GD_rank(g).plus(r).getInt("cache_nc");
+ GD_rank(g).get(r).cache_nc = nc;
count += nc;
GD_rank(g).plus(r).setInt("valid", 1);
}
@@ -2583,17 +2559,17 @@ LEAVING("8wrsq8a2vooekcm3cdtv5x3ke","ordercmpf");
//3 7397kynkpqf2m1jkpmi8pgf0n
// static int flat_mval(node_t * n)
-public static boolean flat_mval(Agnode_s n) {
+public static boolean flat_mval(ST_Agnode_s n) {
ENTERING("7397kynkpqf2m1jkpmi8pgf0n","flat_mval");
try {
int i;
- Agedge_s e;
- __ptr__ fl;
- Agnode_s nn;
+ ST_Agedge_s e;
+ List<ST_Agedge_s> fl;
+ ST_Agnode_s nn;
if (ND_flat_in(n).size > 0) {
- fl = ND_flat_in(n).getTheList();
- nn = agtail(fl.plus(0).getPtr());
- for (i = 1; (e = (Agedge_s) fl.plus(i).getPtr())!=null; i++)
+ fl = ND_flat_in(n).list;
+ nn = agtail(fl.get(0));
+ for (i = 1; (e = (ST_Agedge_s) fl.get(i))!=null; i++)
if (ND_order(agtail(e)) > ND_order(nn))
nn = agtail(e);
if (ND_mval(nn) >= 0) {
@@ -2601,9 +2577,9 @@ try {
return false;
}
} else if (ND_flat_out(n).size > 0) {
- fl = ND_flat_out(n).getTheList();
- nn = aghead(fl.plus(0).getPtr());
- for (i = 1; (e = (Agedge_s) fl.plus(i).getPtr())!=null; i++)
+ fl = ND_flat_out(n).list;
+ nn = aghead(fl.get(0));
+ for (i = 1; (e = (ST_Agedge_s) fl.get(i))!=null; i++)
if (ND_order(aghead(e)) < ND_order(nn))
nn = aghead(e);
if (ND_mval(nn) > 0) {
@@ -2622,28 +2598,28 @@ LEAVING("7397kynkpqf2m1jkpmi8pgf0n","flat_mval");
//3 azvdpixwwxspl31wp7f4k4fmh
// static boolean medians(graph_t * g, int r0, int r1)
-public static boolean medians(Agraph_s g, int r0, int r1) {
+public static boolean medians(ST_Agraph_s g, int r0, int r1) {
ENTERING("azvdpixwwxspl31wp7f4k4fmh","medians");
try {
int i, j, j0, lm, rm, lspan, rspan;
__ptr__ list;
- Agnode_s n;
- __ptr__ v;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agnode_s.ArrayOfStar v;
+ ST_Agedge_s e;
boolean hasfixed = false;
list = Z.z().TI_list;
- v = GD_rank(g).plus(r0).getPtr("v");
- for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) {
- n = (Agnode_s) v.plus(i).getPtr();
+ v = GD_rank(g).get(r0).v;
+ for (i = 0; i < GD_rank(g).get(r0).n; i++) {
+ n = (ST_Agnode_s) v.get(i);
j = 0;
if (r1 > r0)
- for (j0 = 0; (e = (Agedge_s) ND_out(n).getFromList(j0))!=null; j0++) {
+ for (j0 = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(j0))!=null; j0++) {
if (ED_xpenalty(e) > 0)
- list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).getInt("order")));
+ list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).order));
} else
- for (j0 = 0; (e = (Agedge_s) ND_in(n).getFromList(j0))!=null; j0++) {
+ for (j0 = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(j0))!=null; j0++) {
if (ED_xpenalty(e) > 0)
- list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).getInt("order")));
+ list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).order));
}
switch (j) {
case 0:
@@ -2658,7 +2634,6 @@ try {
default:
qsort(list,
j,
- sizeof(list.plus(0)),
function(mincross__c.class, "ordercmpf"));
if (j % 2!=0)
ND_mval(n, list.plus(j / 2).getInt());
@@ -2677,8 +2652,8 @@ try {
}
}
}
- for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) {
- n = (Agnode_s) v.plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r0).n; i++) {
+ n = (ST_Agnode_s) v.get(i);
if ((ND_out(n).size == 0) && (ND_in(n).size == 0))
hasfixed |= flat_mval(n);
}
@@ -2729,7 +2704,7 @@ private static int table[][] = new int[][]{
//3 7j638prioxd97f74v1v4adbsf
// static int endpoint_class(node_t * n)
-public static int endpoint_class(Agnode_s n) {
+public static int endpoint_class(ST_Agnode_s n) {
ENTERING("7j638prioxd97f74v1v4adbsf","endpoint_class");
try {
if (ND_node_type(n) == 1)
@@ -2747,7 +2722,7 @@ LEAVING("7j638prioxd97f74v1v4adbsf","endpoint_class");
//3 es57bn7ga4wc9tqtcixpn0451
// void virtual_weight(edge_t * e)
-public static void virtual_weight(Agedge_s e) {
+public static void virtual_weight(ST_Agedge_s e) {
ENTERING("es57bn7ga4wc9tqtcixpn0451","virtual_weight");
try {
int t;
@@ -2763,7 +2738,7 @@ LEAVING("es57bn7ga4wc9tqtcixpn0451","virtual_weight");
//3 7ru09oqbudpeofsthzveig2m2
// static void mincross_options(graph_t * g)
-public static void mincross_options(Agraph_s g) {
+public static void mincross_options(ST_Agraph_s g) {
ENTERING("7ru09oqbudpeofsthzveig2m2","mincross_options");
try {
CString p;
diff --git a/src/gen/lib/dotgen/position__c.java b/src/gen/lib/dotgen/position__c.java
index b0e40a1..a78bf74 100644
--- a/src/gen/lib/dotgen/position__c.java
+++ b/src/gen/lib/dotgen/position__c.java
@@ -50,7 +50,6 @@ import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.graph__c.agnnodes;
import static gen.lib.cgraph.obj__c.agcontains;
import static gen.lib.cgraph.obj__c.agroot;
-import static gen.lib.common.memory__c.zmalloc;
import static gen.lib.common.ns__c.rank;
import static gen.lib.common.splines__c.selfRightSpace;
import static gen.lib.common.utils__c.late_int;
@@ -67,13 +66,12 @@ import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.USHRT_MAX;
import static smetana.core.JUtils.atof;
import static smetana.core.JUtils.enumAsInt;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE;
import static smetana.core.Macro.AGOUTEDGE;
import static smetana.core.Macro.AGTYPE;
-import static smetana.core.Macro.ALLOC_empty;
+import static smetana.core.Macro.ALLOC_allocated_ST_Agnode_s;
import static smetana.core.Macro.ED_dist;
import static smetana.core.Macro.ED_head_port;
import static smetana.core.Macro.ED_label;
@@ -133,23 +131,19 @@ import static smetana.core.Macro.aghead;
import static smetana.core.Macro.agtail;
import static smetana.core.Macro.alloc_elist;
import static smetana.core.Macro.free_list;
-import h.Agedge_s;
-import h.Agedgeinfo_t;
-import h.Agedgepair_s;
-import h.Agnode_s;
-import h.Agraph_s;
+import h.ST_Agedge_s;
+import h.ST_Agedgeinfo_t;
+import h.ST_Agedgepair_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_aspect_t;
+import h.ST_point;
import h.ST_pointf;
-import h.aspect_t;
-import h.boxf;
-import h.point;
-import h.pointf;
+import h.ST_rank_t;
import h.ratio_t;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__ptr__;
-import smetana.core.__struct__;
public class position__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -409,14 +403,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -445,25 +439,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -487,16 +462,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -814,23 +789,23 @@ LEAVING("6knxbdrmgk6294aw61s2lpvvf","largeMinlen");
//3 ccowbxkwmrj75tojopmhcmubx
// static void connectGraph (graph_t* g)
-public static void connectGraph(Agraph_s g) {
+public static void connectGraph(ST_Agraph_s g) {
ENTERING("ccowbxkwmrj75tojopmhcmubx","connectGraph");
try {
int i, j, r, found;
- Agnode_s tp;
- Agnode_s hp;
- Agnode_s sn;
- Agedge_s e;
- __ptr__ rp;
+ ST_Agnode_s tp;
+ ST_Agnode_s hp;
+ ST_Agnode_s sn;
+ ST_Agedge_s e;
+ ST_rank_t.Array2 rp;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
rp = GD_rank(g).plus(r);
found =0;
tp = null;
- for (i = 0; i < rp.getPtr().getInt("n"); i++) {
- tp = (Agnode_s) rp.getPtr().getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < rp.getPtr().n; i++) {
+ tp = (ST_Agnode_s) rp.getPtr().v.get(i);
if (ND_save_out(tp).listNotNull()) {
- for (j = 0; (e = (Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) {
if ((ND_rank(aghead(e)) > r) || (ND_rank(agtail(e)) > r)) {
found = 1;
break;
@@ -839,7 +814,7 @@ try {
if (found!=0) break;
}
if (ND_save_in(tp).listNotNull()) {
- for (j = 0; (e = (Agedge_s) ND_save_in(tp).getFromList(j))!=null; j++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_save_in(tp).getFromList(j))!=null; j++) {
if ((ND_rank(agtail(e)) > r) || (ND_rank(aghead(e)) > r)) {
found = 1;
break;
@@ -849,9 +824,9 @@ try {
}
}
if (found!=0 || N(tp)) continue;
- tp = (Agnode_s) rp.getPtr().getArrayOfPtr("v").plus(0).getPtr();
- if (r < GD_maxrank(g)) hp = (Agnode_s) rp.plus(1).getPtr().getArrayOfPtr("v").plus(0).getPtr();
- else hp = (Agnode_s) rp.plus(-1).getPtr().getArrayOfPtr("v").plus(0).getPtr();
+ tp = (ST_Agnode_s) rp.getPtr().v.get(0);
+ if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.get(1).v.get(0);
+ else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.get(0);
//assert (hp);
sn = virtual_node(g);
ND_node_type(sn, 2);
@@ -869,7 +844,7 @@ LEAVING("ccowbxkwmrj75tojopmhcmubx","connectGraph");
//3 33snzyd9z0loienur06dnily9
// void dot_position(graph_t * g, aspect_t* asp)
-public static void dot_position(Agraph_s g, aspect_t asp) {
+public static void dot_position(ST_Agraph_s g, ST_aspect_t asp) {
ENTERING("33snzyd9z0loienur06dnily9","dot_position");
try {
if (GD_nlist(g) == null)
@@ -901,7 +876,7 @@ LEAVING("33snzyd9z0loienur06dnily9","dot_position");
//3 90vn63m6v0w9fn9a2dgfxxx3h
// static int nsiter2(graph_t * g)
-public static int nsiter2(Agraph_s g) {
+public static int nsiter2(ST_Agraph_s g) {
ENTERING("90vn63m6v0w9fn9a2dgfxxx3h","nsiter2");
try {
int maxiter = INT_MAX;
@@ -919,14 +894,14 @@ LEAVING("90vn63m6v0w9fn9a2dgfxxx3h","nsiter2");
//3 5bax8ut6nnk4pr7yxdumk9chl
// static int go(node_t * u, node_t * v)
-public static boolean go(Agnode_s u, Agnode_s v) {
+public static boolean go(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("5bax8ut6nnk4pr7yxdumk9chl","go");
try {
int i;
- Agedge_s e;
+ ST_Agedge_s e;
if (EQ(u, v))
return NOT(false);
- for (i = 0; (e = (Agedge_s) ND_out(u).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_out(u).getFromList(i))!=null; i++) {
if (go(aghead(e), v))
return NOT(false);
}
@@ -941,7 +916,7 @@ LEAVING("5bax8ut6nnk4pr7yxdumk9chl","go");
//3 9xz8numztzj4qsq85pziahv1k
// static int canreach(node_t * u, node_t * v)
-public static boolean canreach(Agnode_s u, Agnode_s v) {
+public static boolean canreach(ST_Agnode_s u, ST_Agnode_s v) {
ENTERING("9xz8numztzj4qsq85pziahv1k","canreach");
try {
return go(u, v);
@@ -955,15 +930,15 @@ LEAVING("9xz8numztzj4qsq85pziahv1k","canreach");
//3 4cvgiatny97ou6mhqoq6aqwek
// edge_t *make_aux_edge(node_t * u, node_t * v, double len, int wt)
-public static Agedge_s make_aux_edge(Agnode_s u, Agnode_s v, double len, int wt) {
+public static ST_Agedge_s make_aux_edge(ST_Agnode_s u, ST_Agnode_s v, double len, int wt) {
ENTERING("4cvgiatny97ou6mhqoq6aqwek","make_aux_edge");
try {
- Agedge_s e;
- Agedgepair_s e2 = (Agedgepair_s) zmalloc(sizeof(Agedgepair_s.class));
- AGTYPE(e2.getStruct("in").amp(), AGINEDGE);
- AGTYPE(e2.getStruct("out").amp(), AGOUTEDGE);
- e2.getStruct("out").getStruct("base").setPtr("data", zmalloc(sizeof(Agedgeinfo_t.class)));
- e = (Agedge_s) e2.getStruct("out").amp();
+ ST_Agedge_s e;
+ ST_Agedgepair_s e2 = new ST_Agedgepair_s();
+ AGTYPE(e2.in, AGINEDGE);
+ AGTYPE(e2.out, AGOUTEDGE);
+ e2.out.base.setPtr("data", new ST_Agedgeinfo_t());
+ e = (ST_Agedge_s) e2.out;
agtail(e, u);
aghead(e, v);
if (len > USHRT_MAX)
@@ -982,11 +957,11 @@ LEAVING("4cvgiatny97ou6mhqoq6aqwek","make_aux_edge");
//3 53fvij7oun7aezlb7x66vzuyb
// static void allocate_aux_edges(graph_t * g)
-public static void allocate_aux_edges(Agraph_s g) {
+public static void allocate_aux_edges(ST_Agraph_s g) {
ENTERING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
try {
int i, j, n_in;
- Agnode_s n;
+ ST_Agnode_s n;
/* allocate space for aux edge lists */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
ND_save_in(n, ND_in(n));
@@ -994,8 +969,8 @@ try {
for (i = 0; ND_out(n).getFromList(i)!=null; i++);
for (j = 0; ND_in(n).getFromList(j)!=null; j++);
n_in = i + j;
- alloc_elist(n_in + 3, ND_in(n), Agnode_s.class);
- alloc_elist(3, ND_out(n), Agnode_s.class);
+ alloc_elist(n_in + 3, ND_in(n));
+ alloc_elist(3, ND_out(n));
}
} finally {
LEAVING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
@@ -1007,7 +982,7 @@ LEAVING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
//3 ah28nr6mxpjeosr85bhmzd3si
// static void make_LR_constraints(graph_t * g)
-public static void make_LR_constraints(Agraph_s g) {
+public static void make_LR_constraints(ST_Agraph_s g) {
ENTERING("ah28nr6mxpjeosr85bhmzd3si","make_LR_constraints");
try {
int i, j, k;
@@ -1016,9 +991,9 @@ try {
double width;
int sep[] = new int[2];
int nodesep; /* separation between nodes on same rank */
- Agedge_s e, e0, e1, ff;
- Agnode_s u, v, t0, h0;
- __ptr__ rank = GD_rank(g);
+ ST_Agedge_s e, e0, e1, ff;
+ ST_Agnode_s u, v, t0, h0;
+ ST_rank_t.Array2 rank = GD_rank(g);
/* Use smaller separation on odd ranks if g has edge labels */
if ((GD_has_labels(g) & (1 << 0))!=0) {
sep[0] = GD_nodesep(g);
@@ -1030,11 +1005,11 @@ try {
/* make edges to constrain left-to-right ordering */
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
double last;
- ND_rank(rank.plus(i).getArrayOfPtr("v").plus(0).getPtr(), 0);
+ ND_rank(rank.get(i).v.get(0), 0);
last = 0;
nodesep = sep[i & 1];
- for (j = 0; j < rank.plus(i).getInt("n"); j++) {
- u = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j).getPtr();
+ for (j = 0; j < rank.get(i).n; j++) {
+ u = (ST_Agnode_s) rank.get(i).v.get(j);
ND_mval(u, ND_rw(u)); /* keep it somewhere safe */
if (ND_other(u).size > 0) { /* compute self size */
/* FIX: dot assumes all self-edges go to the right. This
@@ -1046,14 +1021,14 @@ try {
* positioning but may also affect interrank spacing.
*/
sw = 0;
- for (k = 0; (e = (Agedge_s) ND_other(u).getFromList(k))!=null; k++) {
+ for (k = 0; (e = (ST_Agedge_s) ND_other(u).getFromList(k))!=null; k++) {
if (EQ(agtail(e), aghead(e))) {
sw += selfRightSpace (e);
}
}
ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */
}
- v = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j + 1).getPtr();
+ v = (ST_Agnode_s) rank.get(i).v.plus(j + 1).getPtr();
if (v!=null) {
width = ND_rw(u) + ND_lw(v) + nodesep;
e0 = make_aux_edge(u, v, width, 0);
@@ -1061,9 +1036,9 @@ try {
last = (int)(last + width);
}
/* constraints from labels of flat edges on previous rank */
- if ((e = (Agedge_s) ND_alg(u))!=null) {
- e0 = (Agedge_s) ND_save_out(u).getFromList(0);
- e1 = (Agedge_s) ND_save_out(u).getFromList(1);
+ if ((e = (ST_Agedge_s) ND_alg(u))!=null) {
+ e0 = (ST_Agedge_s) ND_save_out(u).getFromList(0);
+ e1 = (ST_Agedge_s) ND_save_out(u).getFromList(1);
if (ND_order(aghead(e0)) > ND_order(aghead(e1))) {
ff = e0;
e0 = e1;
@@ -1083,7 +1058,7 @@ try {
}
/* position flat edge endpoints */
for (k = 0; k < ND_flat_out(u).size; k++) {
- e = (Agedge_s) ND_flat_out(u).getFromList(k);
+ e = (ST_Agedge_s) ND_flat_out(u).getFromList(k);
if (ND_order(agtail(e)) < ND_order(aghead(e))) {
t0 = agtail(e);
h0 = aghead(e);
@@ -1126,15 +1101,15 @@ LEAVING("ah28nr6mxpjeosr85bhmzd3si","make_LR_constraints");
//3 6uruo8mutxgcni9fm8jcrw4cr
// static void make_edge_pairs(graph_t * g)
-public static void make_edge_pairs(Agraph_s g) {
+public static void make_edge_pairs(ST_Agraph_s g) {
ENTERING("6uruo8mutxgcni9fm8jcrw4cr","make_edge_pairs");
try {
int i, m0, m1;
- Agnode_s n, sn;
- Agedge_s e;
+ ST_Agnode_s n, sn;
+ ST_Agedge_s e;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
if (ND_save_out(n).listNotNull())
- for (i = 0; (e = (Agedge_s) ND_save_out(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_save_out(n).getFromList(i))!=null; i++) {
sn = virtual_node(g);
ND_node_type(sn, 2);
m0 = (int)(ED_head_port(e).p.x - ED_tail_port(e).p.x);
@@ -1161,11 +1136,11 @@ LEAVING("6uruo8mutxgcni9fm8jcrw4cr","make_edge_pairs");
//3 79v3omwzni0nm3h05l3onjsbz
// static void contain_clustnodes(graph_t * g)
-public static void contain_clustnodes(Agraph_s g) {
+public static void contain_clustnodes(ST_Agraph_s g) {
ENTERING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
try {
int c;
- Agedge_s e;
+ ST_Agedge_s e;
if (NEQ(g, dot_root(g))) {
contain_nodes(g);
if ((e = find_fast_edge(GD_ln(g),GD_rn(g)))!=null) /* maybe from lrvn()?*/
@@ -1174,7 +1149,7 @@ try {
make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */
}
for (c = 1; c <= GD_n_cluster(g); c++)
- contain_clustnodes((Agraph_s) GD_clust(g).plus(c).getPtr());
+ contain_clustnodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally {
LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
}
@@ -1185,13 +1160,13 @@ LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
//3 24yfgklubun581fbfyx62lzsm
// static int vnode_not_related_to(graph_t * g, node_t * v)
-public static boolean vnode_not_related_to(Agraph_s g, Agnode_s v) {
+public static boolean vnode_not_related_to(ST_Agraph_s g, ST_Agnode_s v) {
ENTERING("24yfgklubun581fbfyx62lzsm","vnode_not_related_to");
try {
- Agedge_s e;
+ ST_Agedge_s e;
if (ND_node_type(v) != 1)
return false;
- for (e = (Agedge_s) ND_save_out(v).getFromList(0); ED_to_orig(e)!=null; e = ED_to_orig(e));
+ for (e = (ST_Agedge_s) ND_save_out(v).getFromList(0); ED_to_orig(e)!=null; e = ED_to_orig(e));
if (agcontains(g, agtail(e)))
return false;
if (agcontains(g, aghead(e)))
@@ -1207,29 +1182,29 @@ LEAVING("24yfgklubun581fbfyx62lzsm","vnode_not_related_to");
//3 73cdgjl47ohty2va766evbo4
// static void keepout_othernodes(graph_t * g)
-public static void keepout_othernodes(Agraph_s g) {
+public static void keepout_othernodes(ST_Agraph_s g) {
ENTERING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
try {
int i, c, r, margin;
- Agnode_s u, v;
+ ST_Agnode_s u, v;
margin = late_int (g, Z.z().G_margin, 8, 0);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- if (GD_rank(g).plus(r).getInt("n") == 0)
+ if (GD_rank(g).get(r).n == 0)
continue;
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
if (v == null)
continue;
for (i = ND_order(v) - 1; i >= 0; i--) {
- u = (Agnode_s) GD_rank(dot_root(g)).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
/* can't use "is_a_vnode_of" because elists are swapped */
if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0);
break;
}
}
- for (i = ND_order(v) + GD_rank(g).plus(r).getInt("n"); i < GD_rank(dot_root(g)).plus(r).getInt("n");
+ for (i = ND_order(v) + GD_rank(g).get(r).n; i < GD_rank(dot_root(g)).get(r).n;
i++) {
- u = (Agnode_s) GD_rank(dot_root(g)).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0);
break;
@@ -1237,7 +1212,7 @@ try {
}
}
for (c = 1; c <= GD_n_cluster(g); c++)
- keepout_othernodes((Agraph_s) GD_clust(g).plus(c).getPtr());
+ keepout_othernodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally {
LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
}
@@ -1248,20 +1223,20 @@ LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
//3 c734mx1638sfqtl7vh7itaxyx
// static void contain_subclust(graph_t * g)
-public static void contain_subclust(Agraph_s g) {
+public static void contain_subclust(ST_Agraph_s g) {
ENTERING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
try {
int margin, c;
- Agraph_s subg;
+ ST_Agraph_s subg;
margin = late_int (g, Z.z().G_margin, 8, 0);
make_lrvn(g);
for (c = 1; c <= GD_n_cluster(g); c++) {
- subg = (Agraph_s) GD_clust(g).plus(c).getPtr();
+ subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
make_lrvn(subg);
make_aux_edge(GD_ln(g), GD_ln(subg),
- margin + GD_border(g).plus(3).getStruct().getDouble("x"), 0);
+ margin + GD_border(g)[3].x, 0);
make_aux_edge(GD_rn(subg), GD_rn(g),
- margin + GD_border(g).plus(1).getStruct().getDouble("x"), 0);
+ margin + GD_border(g)[1].x, 0);
contain_subclust(subg);
}
} finally {
@@ -1274,28 +1249,28 @@ LEAVING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
//3 6oruu1p1b7kxr5moh3kmcmvr3
// static void separate_subclust(graph_t * g)
-public static void separate_subclust(Agraph_s g) {
+public static void separate_subclust(ST_Agraph_s g) {
ENTERING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
try {
int i, j, margin;
- Agraph_s low, high;
- Agraph_s left, right;
+ ST_Agraph_s low, high;
+ ST_Agraph_s left, right;
margin = late_int (g, Z.z().G_margin, 8, 0);
for (i = 1; i <= GD_n_cluster(g); i++)
- make_lrvn((Agraph_s) GD_clust(g).plus(i).getPtr());
+ make_lrvn((ST_Agraph_s) GD_clust(g).get(i).getPtr());
for (i = 1; i <= GD_n_cluster(g); i++) {
for (j = i + 1; j <= GD_n_cluster(g); j++) {
- low = (Agraph_s) GD_clust(g).plus(i).getPtr();
- high = (Agraph_s) GD_clust(g).plus(j).getPtr();
+ low = (ST_Agraph_s) GD_clust(g).get(i).getPtr();
+ high = (ST_Agraph_s) GD_clust(g).get(j).getPtr();
if (GD_minrank(low) > GD_minrank(high)) {
- Agraph_s temp = low;
+ ST_Agraph_s temp = low;
low = high;
high = temp;
}
if (GD_maxrank(low) < GD_minrank(high))
continue;
- if (ND_order(GD_rank(low).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())
- < ND_order(GD_rank(high).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())) {
+ if (ND_order(GD_rank(low).get(GD_minrank(high)).v.get(0))
+ < ND_order(GD_rank(high).get(GD_minrank(high)).v.get(0))) {
left = low;
right = high;
} else {
@@ -1304,7 +1279,7 @@ try {
}
make_aux_edge(GD_rn(left), GD_ln(right), margin, 0);
}
- separate_subclust((Agraph_s) GD_clust(g).plus(i).getPtr());
+ separate_subclust((ST_Agraph_s) GD_clust(g).get(i).getPtr());
}
} finally {
LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
@@ -1316,7 +1291,7 @@ LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
//3 8f8gs2zivo4pnd3hmtb9g23x4
// static void pos_clusters(graph_t * g)
-public static void pos_clusters(Agraph_s g) {
+public static void pos_clusters(ST_Agraph_s g) {
ENTERING("8f8gs2zivo4pnd3hmtb9g23x4","pos_clusters");
try {
if (GD_n_cluster(g) > 0) {
@@ -1335,12 +1310,12 @@ LEAVING("8f8gs2zivo4pnd3hmtb9g23x4","pos_clusters");
//3 fywsxto7yvl5wa2dfu7u7jj1
// static void compress_graph(graph_t * g)
-public static void compress_graph(Agraph_s g) {
+public static void compress_graph(ST_Agraph_s g) {
ENTERING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
try {
double x;
- pointf p = (pointf) Memory.malloc(pointf.class);
- if (GD_drawing(g).getInt("ratio_kind") != enumAsInt(ratio_t.class, "R_COMPRESS"))
+ ST_pointf p = new ST_pointf();
+ if (GD_drawing(g).ratio_kind != enumAsInt(ratio_t.class, "R_COMPRESS"))
return;
UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size;
UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1)
@@ -1369,7 +1344,7 @@ LEAVING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
//3 b7y0htx4svbhaqb1a12dihlue
// static void create_aux_edges(graph_t * g)
-public static void create_aux_edges(Agraph_s g) {
+public static void create_aux_edges(ST_Agraph_s g) {
ENTERING("b7y0htx4svbhaqb1a12dihlue","create_aux_edges");
try {
allocate_aux_edges(g);
@@ -1387,15 +1362,15 @@ LEAVING("b7y0htx4svbhaqb1a12dihlue","create_aux_edges");
//3 euzeilq92ry8a4tcrij5s52t5
// static void remove_aux_edges(graph_t * g)
-public static void remove_aux_edges(Agraph_s g) {
+public static void remove_aux_edges(ST_Agraph_s g) {
ENTERING("euzeilq92ry8a4tcrij5s52t5","remove_aux_edges");
try {
int i;
- Agnode_s n, nnext, nprev;
- Agedge_s e;
+ ST_Agnode_s n, nnext, nprev;
+ ST_Agedge_s e;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
- for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
- Memory.free(e.getStruct("base").getPtr("data"));
+ for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
+ Memory.free(e.base.data);
Memory.free(e);
}
free_list(ND_out(n));
@@ -1412,7 +1387,7 @@ try {
ND_next(nprev, nnext);
else
GD_nlist(g, nnext);
- Memory.free(n.getStruct("base").getPtr("data"));
+ Memory.free(n.base.data);
Memory.free(n);
} else
nprev = n;
@@ -1428,15 +1403,15 @@ LEAVING("euzeilq92ry8a4tcrij5s52t5","remove_aux_edges");
//3 1oobmglea9t819y95xeel37h8
// static void set_xcoords(graph_t * g)
-public static void set_xcoords(Agraph_s g) {
+public static void set_xcoords(ST_Agraph_s g) {
ENTERING("1oobmglea9t819y95xeel37h8","set_xcoords");
try {
int i, j;
- Agnode_s v;
- __ptr__ rank = GD_rank(g);
+ ST_Agnode_s v;
+ ST_rank_t.Array2 rank = GD_rank(g);
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
- for (j = 0; j < rank.plus(i).getInt("n"); j++) {
- v = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j).getPtr();
+ for (j = 0; j < rank.get(i).n; j++) {
+ v = (ST_Agnode_s) rank.get(i).v.get(j);
ND_coord(v).x = ND_rank(v);
ND_rank(v, i);
}
@@ -1538,13 +1513,13 @@ throw new UnsupportedOperationException();
//3 emtrqv582hdma5aajqtjd76m1
// static int clust_ht(Agraph_t * g)
-public static int clust_ht(Agraph_s g) {
+public static int clust_ht(ST_Agraph_s g) {
ENTERING("emtrqv582hdma5aajqtjd76m1","clust_ht");
try {
int c;
double ht1, ht2;
- Agraph_s subg;
- __ptr__ rank = GD_rank(dot_root(g));
+ ST_Agraph_s subg;
+ ST_rank_t.Array2 rank = GD_rank(dot_root(g));
int margin, haveClustLabel = 0;
if (EQ(g, dot_root(g)))
margin = 8;
@@ -1554,7 +1529,7 @@ try {
ht2 = GD_ht2(g);
/* account for sub-clusters */
for (c = 1; c <= GD_n_cluster(g); c++) {
- subg = (Agraph_s) GD_clust(g).plus(c).getPtr();
+ subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
haveClustLabel |= clust_ht(subg);
if (GD_maxrank(subg) == GD_maxrank(g))
ht1 = MAX(ht1, GD_ht1(subg) + margin);
@@ -1566,16 +1541,16 @@ try {
if (NEQ(g, dot_root(g)) && GD_label(g)!=null) {
haveClustLabel = 1;
if (N(GD_flip(agroot(g)))) {
- ht1 += GD_border(g).plus(0).getDouble("y");
- ht2 += GD_border(g).plus(2).getDouble("y");
+ ht1 += GD_border(g)[0].y;
+ ht2 += GD_border(g)[2].y;
}
}
GD_ht1(g, ht1);
GD_ht2(g, ht2);
/* update the global ranks */
if (NEQ(g, dot_root(g))) {
- rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.plus(GD_minrank(g)).getDouble("ht2"), ht2));
- rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.plus(GD_maxrank(g)).getDouble("ht1"), ht1));
+ rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.get(GD_minrank(g)).ht2, ht2));
+ rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.get(GD_maxrank(g)).ht1, ht1));
}
return haveClustLabel;
} finally {
@@ -1588,37 +1563,37 @@ LEAVING("emtrqv582hdma5aajqtjd76m1","clust_ht");
//3 bp8vmol4ncadervcfossysdtd
// static void set_ycoords(graph_t * g)
-public static void set_ycoords(Agraph_s g) {
+public static void set_ycoords(ST_Agraph_s g) {
ENTERING("bp8vmol4ncadervcfossysdtd","set_ycoords");
try {
int i, j, r;
double ht2, maxht, delta, d0, d1;
- Agnode_s n;
- Agedge_s e;
- __ptr__ rank = GD_rank(g);
- Agraph_s clust;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
+ ST_rank_t.Array2 rank = GD_rank(g);
+ ST_Agraph_s clust;
int lbl;
ht2 = maxht = 0;
/* scan ranks for tallest nodes. */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- for (i = 0; i < rank.plus(r).getInt("n"); i++) {
- n = (Agnode_s) rank.plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < rank.get(r).n; i++) {
+ n = (ST_Agnode_s) rank.get(r).v.get(i);
/* assumes symmetry, ht1 = ht2 */
ht2 = ND_ht(n) / 2;
/* have to look for high self-edge labels, too */
if (ND_other(n).listNotNull())
- for (j = 0; (e = (Agedge_s) ND_other(n).getFromList(j))!=null; j++) {
+ for (j = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(j))!=null; j++) {
if (EQ(agtail(e), aghead(e))) {
if (ED_label(e)!=null)
- ht2 = MAX(ht2, ED_label(e).getStruct("dimen").getDouble("y") / 2);
+ ht2 = MAX(ht2, ED_label(e).dimen.y / 2);
}
}
/* update global rank ht */
- if (rank.plus(r).getDouble("pht2") < ht2) {
+ if (rank.get(r).pht2 < ht2) {
rank.plus(r).setDouble("ht2", ht2);
rank.plus(r).setDouble("pht2", ht2);
}
- if (rank.plus(r).getDouble("pht1") < ht2) {
+ if (rank.get(r).pht1 < ht2) {
rank.plus(r).setDouble("ht1", ht2);
rank.plus(r).setDouble("pht1", ht2);
}
@@ -1637,13 +1612,13 @@ try {
/* make the initial assignment of ycoords to leftmost nodes by ranks */
maxht = 0;
r = GD_maxrank(g);
- (ND_coord(rank.plus(r).getArrayOfPtr("v").plus(0).getPtr())).setDouble("y", rank.plus(r).getDouble("ht1"));
+ (ND_coord(rank.get(r).v.get(0))).setDouble("y", rank.get(r).ht1);
while (--r >= GD_minrank(g)) {
- d0 = rank.plus(r + 1).getDouble("pht2") + rank.plus(r).getDouble("pht1") + GD_ranksep(g); /* prim node sep */
- d1 = rank.plus(r + 1).getDouble("ht2") + rank.plus(r).getDouble("ht1") + 8; /* cluster sep */
+ d0 = rank.get(r + 1).pht2 + rank.get(r).pht1 + GD_ranksep(g); /* prim node sep */
+ d1 = rank.get(r + 1).ht2 + rank.get(r).ht1 + 8; /* cluster sep */
delta = MAX(d0, d1);
- if (rank.plus(r).getInt("n") > 0) /* this may reflect some problem */
- (ND_coord(rank.plus(r).getArrayOfPtr("v").plus(0).getPtr())).setDouble("y", (ND_coord(rank.plus(r + 1).getArrayOfPtr("v").plus(0).getPtr())).getDouble("y") + delta);
+ if (rank.get(r).n > 0) /* this may reflect some problem */
+ (ND_coord(rank.get(r).v.get(0))).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.get(0))).y + delta);
maxht = MAX(maxht, delta);
}
/* If there are cluster labels and the drawing is rotated, we need special processing to
@@ -1674,7 +1649,7 @@ UNSUPPORTED("e6dfx5uesysjaefb0djyfp7f"); // (ND_coord(rank[r + 1].v[0])).y
}
/* copy ycoord assignment from leftmost nodes to others */
for (n = GD_nlist(g); n!=null; n = ND_next(n))
- ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y");
+ ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.get(0)).y;
} finally {
LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords");
}
@@ -1685,50 +1660,50 @@ LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords");
//3 9ay2xnnmh407i32pfokujfda5
//static void dot_compute_bb(graph_t * g, graph_t * root)
-public static void dot_compute_bb(Agraph_s g, Agraph_s root) {
+public static void dot_compute_bb(ST_Agraph_s g, ST_Agraph_s root) {
ENTERING("9ay2xnnmh407i32pfokujfda5","dot_compute_bb");
try {
int r, c;
double x, offset;
- Agnode_s v;
+ ST_Agnode_s v;
final ST_pointf LL = new ST_pointf();
final ST_pointf UR = new ST_pointf();
if (EQ(g, dot_root(g))) {
LL.x = INT_MAX;
UR.x = -((double)INT_MAX);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- int rnkn = GD_rank(g).plus(r).getInt("n");
+ int rnkn = GD_rank(g).get(r).n;
if (rnkn == 0)
continue;
- if ((v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr()) == null)
+ if ((v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0)) == null)
continue;
for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++)
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(c).getPtr();
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
if (ND_node_type(v) == 0) {
- x = ND_coord(v).getDouble("x") - ND_lw(v);
- LL.setDouble("x", MIN(LL.getDouble("x"), x));
+ x = ND_coord(v).x - ND_lw(v);
+ LL.setDouble("x", MIN(LL.x, x));
}
else continue;
/* At this point, we know the rank contains a NORMAL node */
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(rnkn - 1).getPtr();
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(rnkn - 1).getPtr();
for (c = rnkn-2; ND_node_type(v) != 0; c--)
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(c).getPtr();
- x = ND_coord(v).getDouble("x") + ND_rw(v);
- UR.x = MAX(UR.getDouble("x"), x);
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
+ x = ND_coord(v).x + ND_rw(v);
+ UR.x = MAX(UR.x, x);
}
offset = 8;
for (c = 1; c <= GD_n_cluster(g); c++) {
x = (double)(GD_bb(GD_clust(g).plus(c)).LL.x - offset);
- LL.x = MIN(LL.getDouble("x"), x);
+ LL.x = MIN(LL.x, x);
x = (double)(GD_bb(GD_clust(g).plus(c)).UR.x + offset);
- UR.x = MAX(UR.getDouble("x"), x);
+ UR.x = MAX(UR.x, x);
}
} else {
LL.x = (double)(ND_rank(GD_ln(g)));
UR.x = (double)(ND_rank(GD_rn(g)));
}
- LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - GD_ht1(g);
- UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") + GD_ht2(g);
+ LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.get(0)).y - GD_ht1(g);
+ UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getPtr().v.get(0)).y + GD_ht2(g);
GD_bb(g).setStruct("LL", LL);
GD_bb(g).setStruct("UR", UR);
} finally {
@@ -1742,12 +1717,12 @@ LEAVING("9ay2xnnmh407i32pfokujfda5","dot_compute_bb");
//3 dlbpiimh9g9ff9w7wjoabf817
// static void rec_bb(graph_t * g, graph_t * root)
-public static void rec_bb(Agraph_s g, Agraph_s root) {
+public static void rec_bb(ST_Agraph_s g, ST_Agraph_s root) {
ENTERING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
try {
int c;
for (c = 1; c <= GD_n_cluster(g); c++)
- rec_bb((Agraph_s) GD_clust(g).plus(c).getPtr(), root);
+ rec_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), root);
dot_compute_bb(g, root);
} finally {
LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
@@ -1810,15 +1785,15 @@ throw new UnsupportedOperationException();
//3 7effq6z6ur101wrch6ttozr26
// static void set_aspect(graph_t * g, aspect_t* asp)
-public static void set_aspect(Agraph_s g, aspect_t asp) {
+public static void set_aspect(ST_Agraph_s g, ST_aspect_t asp) {
ENTERING("7effq6z6ur101wrch6ttozr26","set_aspect");
try {
double xf = 0.0, yf = 0.0, actual, desired;
- Agnode_s n;
+ ST_Agnode_s n;
boolean scale_it, filled;
- point sz = (point) Memory.malloc(point.class);
+ ST_point sz = new ST_point();
rec_bb(g, g);
- if ((GD_maxrank(g) > 0) && (GD_drawing(g).getInt("ratio_kind")!=0)) {
+ if ((GD_maxrank(g) > 0) && (GD_drawing(g).ratio_kind!=0)) {
UNSUPPORTED("5wbmy4x78flo2ztfabki9lyjf"); // sz.x = GD_bb(g).UR.x - GD_bb(g).LL.x;
UNSUPPORTED("catd6eu5oc282ln95k9zz52f3"); // sz.y = GD_bb(g).UR.y - GD_bb(g).LL.y; /* normalize */
UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) {
@@ -1938,30 +1913,30 @@ throw new UnsupportedOperationException();
//3 1lejhh3evsa10auyj7cgqj8ub
// static void make_leafslots(graph_t * g)
-public static void make_leafslots(Agraph_s g) {
+public static void make_leafslots(ST_Agraph_s g) {
ENTERING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
try {
int i, j, r;
- Agnode_s v;
+ ST_Agnode_s v;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
j = 0;
- for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
+ for (i = 0; i < GD_rank(g).get(r).n; i++) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_order(v, j);
if (ND_ranktype(v) == 6)
j = j + ND_UF_size(v);
else
j++;
}
- if (j <= GD_rank(g).plus(r).getInt("n"))
+ if (j <= GD_rank(g).get(r).n)
continue;
- GD_rank(g).plus(r).setPtr("v", ALLOC_empty(j + 1, GD_rank(g).plus(r).getPtr("v"), Agnode_s.class));
- for (i = GD_rank(g).plus(r).getInt("n") - 1; i >= 0; i--) {
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
- GD_rank(g).plus(r).getArrayOfPtr("v").plus(ND_order(v)).setPtr(v);
+ GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v, j + 1));
+ for (i = GD_rank(g).get(r).n - 1; i >= 0; i--) {
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
+ GD_rank(g).get(r).v.plus(ND_order(v)).setPtr(v);
}
GD_rank(g).plus(r).setInt("n", j);
- GD_rank(g).plus(r).getArrayOfPtr("v").plus(j).setPtr(null);
+ GD_rank(g).get(r).v.plus(j).setPtr(null);
}
} finally {
LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
@@ -2017,7 +1992,7 @@ throw new UnsupportedOperationException();
//3 alpljm8o6nsam95ly6leelnbp
// int ports_eq(edge_t * e, edge_t * f)
-public static boolean ports_eq(Agedge_s e, Agedge_s f) {
+public static boolean ports_eq(ST_Agedge_s e, ST_Agedge_s f) {
ENTERING("alpljm8o6nsam95ly6leelnbp","ports_eq");
try {
return ((ED_head_port(e).defined == ED_head_port(f).defined)
@@ -2038,12 +2013,12 @@ LEAVING("alpljm8o6nsam95ly6leelnbp","ports_eq");
//3 cfotmdif5xv7n6oauyvzv0qwa
// static void expand_leaves(graph_t * g)
-public static void expand_leaves(Agraph_s g) {
+public static void expand_leaves(ST_Agraph_s g) {
ENTERING("cfotmdif5xv7n6oauyvzv0qwa","expand_leaves");
try {
int i, d;
- Agnode_s n;
- Agedge_s e, f;
+ ST_Agnode_s n;
+ ST_Agedge_s e, f;
make_leafslots(g);
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
if (ND_inleaf(n)!=null)
@@ -2051,12 +2026,12 @@ try {
if (ND_outleaf(n)!=null)
do_leaves(g, ND_outleaf(n));
if (ND_other(n).listNotNull())
- for (i = 0; (e = (Agedge_s) ND_other(n).getFromList(i))!=null; i++) {
+ for (i = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(i))!=null; i++) {
if ((d = ND_rank(aghead(e)) - ND_rank(aghead(e))) == 0)
continue;
f = ED_to_orig(e);
if (ports_eq(e, f) == false) {
- zapinlist(ND_other(n).amp(), e);
+ zapinlist(ND_other(n), e);
if (d == 1)
fast_edge(e);
/*else unitize(e); ### */
@@ -2074,10 +2049,10 @@ LEAVING("cfotmdif5xv7n6oauyvzv0qwa","expand_leaves");
//3 d4b57ugpwxy567pfmxn14ed8d
// static void make_lrvn(graph_t * g)
-public static void make_lrvn(Agraph_s g) {
+public static void make_lrvn(ST_Agraph_s g) {
ENTERING("d4b57ugpwxy567pfmxn14ed8d","make_lrvn");
try {
- Agnode_s ln, rn;
+ ST_Agnode_s ln, rn;
if (GD_ln(g)!=null)
return;
ln = virtual_node(dot_root(g));
@@ -2085,7 +2060,7 @@ try {
rn = virtual_node(dot_root(g));
ND_node_type(rn, 2);
if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) {
- int w = MAX((int)GD_border(g).plus(0).getDouble("x"), (int)GD_border(g).plus(2).getDouble("x"));
+ int w = MAX((int)GD_border(g)[0].x, (int)GD_border(g)[2].x);
make_aux_edge(ln, rn, w, 0);
}
GD_ln(g, ln);
@@ -2100,29 +2075,29 @@ LEAVING("d4b57ugpwxy567pfmxn14ed8d","make_lrvn");
//3 daz786541idcxnywckcbncazb
// static void contain_nodes(graph_t * g)
-public static void contain_nodes(Agraph_s g) {
+public static void contain_nodes(ST_Agraph_s g) {
ENTERING("daz786541idcxnywckcbncazb","contain_nodes");
try {
int margin, r;
- Agnode_s ln, rn, v;
+ ST_Agnode_s ln, rn, v;
margin = late_int (g, Z.z().G_margin, 8, 0);
make_lrvn(g);
ln = GD_ln(g);
rn = GD_rn(g);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
- if (GD_rank(g).plus(r).getInt("n") == 0)
+ if (GD_rank(g).get(r).n == 0)
continue;
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
if (v == null) {
UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n",
UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r);
UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
}
make_aux_edge(ln, v,
- ND_lw(v) + margin + GD_border(g).plus(3).getStruct().getDouble("x"), 0);
- v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(GD_rank(g).plus(r).getInt("n") - 1).getPtr();
+ ND_lw(v) + margin + GD_border(g)[3].x, 0);
+ v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - 1).getPtr();
make_aux_edge(v, rn,
- ND_rw(v) + margin + GD_border(g).plus(1).getStruct().getDouble("x"), 0);
+ ND_rw(v) + margin + GD_border(g)[1].x, 0);
}
} finally {
LEAVING("daz786541idcxnywckcbncazb","contain_nodes");
diff --git a/src/gen/lib/dotgen/rank__c.java b/src/gen/lib/dotgen/rank__c.java
index 6e6aa2c..f47309e 100644
--- a/src/gen/lib/dotgen/rank__c.java
+++ b/src/gen/lib/dotgen/rank__c.java
@@ -101,20 +101,17 @@ import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_ranktype;
import static smetana.core.Macro.UNSUPPORTED;
-import static smetana.core.Macro.ZALLOC;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.aspect_t;
-import h.boxf;
-import h.elist;
-import h.point;
-import h.pointf;
+import static smetana.core.Macro.ZALLOC_ST_Agraph_s;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_aspect_t;
+import h.ST_elist;
+import h.ST_point;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Memory;
import smetana.core.Z;
-import smetana.core.__struct__;
public class rank__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -374,14 +371,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -410,25 +407,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -452,16 +430,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -758,13 +736,13 @@ throw new UnsupportedOperationException();
//3 3f1re3nfkhxwjjb90kppwuupr
// static void renewlist(elist * L)
-public static void renewlist(elist L) {
+public static void renewlist(ST_elist L) {
ENTERING("3f1re3nfkhxwjjb90kppwuupr","renewlist");
try {
int i;
- for (i = L.getInt("size"); i >= 0; i--)
- L.getArrayOfPtr("list").plus(i).setPtr(null);
- L.setInt("size", 0);
+ for (i = L.size; i >= 0; i--)
+ L.list.set(i, null);
+ L.size = 0;
} finally {
LEAVING("3f1re3nfkhxwjjb90kppwuupr","renewlist");
}
@@ -775,17 +753,17 @@ LEAVING("3f1re3nfkhxwjjb90kppwuupr","renewlist");
//3 1xov2qhuxj1f9nbzu3xsa6679
// static void cleanup1(graph_t * g)
-public static void cleanup1(Agraph_s g) {
+public static void cleanup1(ST_Agraph_s g) {
ENTERING("1xov2qhuxj1f9nbzu3xsa6679","cleanup1");
try {
- Agnode_s n;
- Agedge_s e, f;
+ ST_Agnode_s n;
+ ST_Agedge_s e, f;
int c;
for (c = 0; c < GD_comp(g).size; c++) {
GD_nlist(g, GD_comp(g).getFromList(c));
for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
- renewlist(ND_in(n).amp());
- renewlist(ND_out(n).amp());
+ renewlist(ND_in(n));
+ renewlist(ND_out(n));
ND_mark(n, 0);
}
}
@@ -797,8 +775,8 @@ try {
* share a virtual edge.
*/
if (f!=null && (EQ(e, ED_to_orig(f)))) {
- Agedge_s e1, f1;
- Agnode_s n1;
+ ST_Agedge_s e1, f1;
+ ST_Agnode_s n1;
for (n1 = agfstnode(g); n1!=null; n1 = agnxtnode(g, n1)) {
for (e1 = agfstout(g, n1); e1!=null; e1 = agnxtout(g, e1)) {
if (NEQ(e, e1)) {
@@ -809,7 +787,7 @@ try {
}
}
}
- Memory.free(f.getStruct("base").getPtr("data"));
+ Memory.free(f.base.data);
Memory.free(f);
}
ED_to_virt(e, null);
@@ -827,11 +805,11 @@ LEAVING("1xov2qhuxj1f9nbzu3xsa6679","cleanup1");
//3 bxjf5g7g953ii1hfodl1j0y4u
// static void edgelabel_ranks(graph_t * g)
-public static void edgelabel_ranks(Agraph_s g) {
+public static void edgelabel_ranks(ST_Agraph_s g) {
ENTERING("bxjf5g7g953ii1hfodl1j0y4u","edgelabel_ranks");
try {
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
if ((GD_has_labels(g) & (1 << 0))!=0) {
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e))
@@ -895,7 +873,7 @@ throw new UnsupportedOperationException();
//3 65qi5f0bxp6d6vahhlcolpk88
// static int rank_set_class(graph_t * g)
-public static int rank_set_class(Agraph_s g) {
+public static int rank_set_class(ST_Agraph_s g) {
ENTERING("65qi5f0bxp6d6vahhlcolpk88","rank_set_class");
try {
CString name[] = new CString[] { new CString("same"), new CString("min"), new CString("source"), new CString("max"), new CString("sink"), null };
@@ -916,13 +894,13 @@ LEAVING("65qi5f0bxp6d6vahhlcolpk88","rank_set_class");
//3 5189iviqj57iztftckz86y6jj
// static int make_new_cluster(graph_t * g, graph_t * subg)
-public static int make_new_cluster(Agraph_s g, Agraph_s subg) {
+public static int make_new_cluster(ST_Agraph_s g, ST_Agraph_s subg) {
ENTERING("5189iviqj57iztftckz86y6jj","make_new_cluster");
try {
int cno;
GD_n_cluster(g, GD_n_cluster(g)+1);
cno = GD_n_cluster(g);
- GD_clust(g, ZALLOC(cno + 1, GD_clust(g), Agraph_s.class, GD_n_cluster(g)));
+ GD_clust(g, ZALLOC_ST_Agraph_s((ST_Agraph_s.Array) GD_clust(g), cno + 1));
GD_clust(g).plus(cno).setPtr(subg);
do_graph_label(subg);
return cno;
@@ -936,11 +914,11 @@ LEAVING("5189iviqj57iztftckz86y6jj","make_new_cluster");
//3 9lvm2ufqjzl2bsbpo0zg9go58
// static void node_induce(graph_t * par, graph_t * g)
-public static void node_induce(Agraph_s par, Agraph_s g) {
+public static void node_induce(ST_Agraph_s par, ST_Agraph_s g) {
ENTERING("9lvm2ufqjzl2bsbpo0zg9go58","node_induce");
try {
- Agnode_s n, nn;
- Agedge_s e;
+ ST_Agnode_s n, nn;
+ ST_Agedge_s e;
int i;
LOG2("node_induce");
/* enforce that a node is in at most one cluster at this level */
@@ -951,7 +929,7 @@ try {
continue;
}
for (i = 1; i < GD_n_cluster(par); i++)
- if (agcontains((Agraph_s) GD_clust(par).plus(i).getPtr(), n))
+ if (agcontains((ST_Agraph_s) GD_clust(par).get(i).getPtr(), n))
break;
if (i < GD_n_cluster(par))
agdelete(g, n);
@@ -1003,10 +981,10 @@ throw new UnsupportedOperationException();
//3 2rbs5deyvlh5s7lkhv6zouqbe
// static void cluster_leader(graph_t * clust)
-public static void cluster_leader(Agraph_s clust) {
+public static void cluster_leader(ST_Agraph_s clust) {
ENTERING("2rbs5deyvlh5s7lkhv6zouqbe","cluster_leader");
try {
- Agnode_s leader, n;
+ ST_Agnode_s leader, n;
int maxrank = 0;
/* find number of ranks and select a leader */
leader = null;
@@ -1033,7 +1011,7 @@ LEAVING("2rbs5deyvlh5s7lkhv6zouqbe","cluster_leader");
//3 f3sl627dqmre3kru883bpdxc3
// static void collapse_cluster(graph_t * g, graph_t * subg)
-public static void collapse_cluster(Agraph_s g, Agraph_s subg) {
+public static void collapse_cluster(ST_Agraph_s g, ST_Agraph_s subg) {
ENTERING("f3sl627dqmre3kru883bpdxc3","collapse_cluster");
try {
if (GD_parent(subg)!=null) {
@@ -1059,11 +1037,11 @@ LEAVING("f3sl627dqmre3kru883bpdxc3","collapse_cluster");
//3 din4qnipewrwnelaimzvlplft
// static void collapse_sets(graph_t *rg, graph_t *g)
-public static void collapse_sets(Agraph_s rg, Agraph_s g) {
+public static void collapse_sets(ST_Agraph_s rg, ST_Agraph_s g) {
ENTERING("din4qnipewrwnelaimzvlplft","collapse_sets");
try {
int c;
- Agraph_s subg;
+ ST_Agraph_s subg;
for (subg = agfstsubg(g); subg!=null; subg = agnxtsubg(subg)) {
c = rank_set_class(subg);
if (c!=0) {
@@ -1103,14 +1081,14 @@ throw new UnsupportedOperationException();
//3 12fw0esv4unfin6waf9mknc1o
// static void set_minmax(graph_t * g)
-public static void set_minmax(Agraph_s g) {
+public static void set_minmax(ST_Agraph_s g) {
ENTERING("12fw0esv4unfin6waf9mknc1o","set_minmax");
try {
int c;
GD_minrank(g, GD_minrank(g) + ND_rank(GD_leader(g)));
GD_maxrank(g, GD_maxrank(g) + ND_rank(GD_leader(g)));
for (c = 1; c <= GD_n_cluster(g); c++)
- set_minmax((Agraph_s) GD_clust(g).plus(c).getPtr());
+ set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally {
LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax");
}
@@ -1121,16 +1099,16 @@ LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax");
//3 3bcr1748gqnu8ogb73jeja7ly
// static point minmax_edges(graph_t * g)
-public static __struct__<point> minmax_edges(Agraph_s g) {
+public static ST_point minmax_edges(ST_Agraph_s g) {
// WARNING!! STRUCT
-return minmax_edges_w_(g).copy();
+return (ST_point) minmax_edges_w_(g).copy();
}
-private static __struct__<point> minmax_edges_w_(Agraph_s g) {
+private static ST_point minmax_edges_w_(ST_Agraph_s g) {
ENTERING("3bcr1748gqnu8ogb73jeja7ly","minmax_edges");
try {
- Agnode_s n;
- Agedge_s e;
- final __struct__<point> slen = JUtils.from(point.class);
+ ST_Agnode_s n;
+ ST_Agedge_s e;
+ final ST_point slen = new ST_point();
slen.setInt("x", 0);
slen.setInt("y", 0);
if ((GD_maxset(g) == null) && (GD_minset(g) == null))
@@ -1167,15 +1145,15 @@ LEAVING("3bcr1748gqnu8ogb73jeja7ly","minmax_edges");
//3 1rmlm1wo3t94wyet9rlwrmith
// static int minmax_edges2(graph_t * g, point slen)
-public static boolean minmax_edges2(Agraph_s g, final __struct__<point> slen) {
+public static boolean minmax_edges2(ST_Agraph_s g, final ST_point slen) {
// WARNING!! STRUCT
-return minmax_edges2_w_(g, slen.copy());
+return minmax_edges2_w_(g, (ST_point) slen.copy());
}
-private static boolean minmax_edges2_w_(Agraph_s g, final __struct__<point> slen) {
+private static boolean minmax_edges2_w_(ST_Agraph_s g, final ST_point slen) {
ENTERING("1rmlm1wo3t94wyet9rlwrmith","minmax_edges2");
try {
- Agnode_s n;
- Agedge_s e = null;
+ ST_Agnode_s n;
+ ST_Agedge_s e = null;
if ((GD_maxset(g)!=null) || (GD_minset(g)!=null)) {
UNSUPPORTED("attp4bsjqe99xnhi7lr7pszar"); // for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
UNSUPPORTED("8y47p29z0c2f1xpkrsb8w8re8"); // if (n != UF_find(n))
@@ -1203,7 +1181,7 @@ LEAVING("1rmlm1wo3t94wyet9rlwrmith","minmax_edges2");
//3 3vpthwso788idvycelpnqijys
// void rank1(graph_t * g)
-public static void rank1(Agraph_s g) {
+public static void rank1(ST_Agraph_s g) {
ENTERING("3vpthwso788idvycelpnqijys","rank1");
try {
int maxiter = Integer.MAX_VALUE;
@@ -1212,7 +1190,7 @@ try {
if ((s = agget(g, new CString("nslimit1")))!=null)
UNSUPPORTED("9tp2zk1tsr4ce9rwsr0is9u3o"); // maxiter = atof(s) * agnnodes(g);
for (c = 0; c < GD_comp(g).size; c++) {
- //GD_nlist(g, GD_comp(g).getArrayOfPtr("list").plus(c).getPtr());
+ //GD_nlist(g, GD_comp(g).list.get(c));
GD_nlist(g, GD_comp(g).getFromList(c));
rank(g, (GD_n_cluster(g) == 0 ? 1 : 0), maxiter); /* TB balance */
}
@@ -1226,11 +1204,11 @@ LEAVING("3vpthwso788idvycelpnqijys","rank1");
//3 cdh8wnb99v90dy6efpbzmrjix
// static void expand_ranksets(graph_t * g, aspect_t* asp)
-public static void expand_ranksets(Agraph_s g, aspect_t asp) {
+public static void expand_ranksets(ST_Agraph_s g, ST_aspect_t asp) {
ENTERING("cdh8wnb99v90dy6efpbzmrjix","expand_ranksets");
try {
int c;
- Agnode_s n, leader;
+ ST_Agnode_s n, leader;
if ((n = agfstnode(g))!=null) {
GD_minrank(g, MAXSHORT);
GD_maxrank(g, -1);
@@ -1252,7 +1230,7 @@ try {
if (EQ(g, dot_root(g))) {
if (Z.z().CL_type == 100) {
for (c = 1; c <= GD_n_cluster(g); c++)
- set_minmax((Agraph_s) GD_clust(g).plus(c).getPtr());
+ set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} else {
find_clusters(g);
}
@@ -1271,10 +1249,10 @@ LEAVING("cdh8wnb99v90dy6efpbzmrjix","expand_ranksets");
//3 2o4rmb4o6f6zh46ak3se91rwr
// static void dot1_rank(graph_t * g, aspect_t* asp)
-public static void dot1_rank(Agraph_s g, aspect_t asp) {
+public static void dot1_rank(ST_Agraph_s g, ST_aspect_t asp) {
ENTERING("2o4rmb4o6f6zh46ak3se91rwr","dot1_rank");
try {
- final __struct__<point> p = JUtils.from(point.class);
+ final ST_point p = new ST_point();
edgelabel_ranks(g);
if (asp!=null) {
UNSUPPORTED("kh7e20nqwuserrnpf3zpvuyl"); // init_UF_size(g);
@@ -1285,7 +1263,7 @@ UNSUPPORTED("d88j5oswhz0d3yvd4wlvxohmu"); // initEdgeTypes(g);
class1_(g);
p.___(minmax_edges(g));
decompose(g, 0);
- if (asp!=null && ((GD_comp(g).getInt("size") > 1)||(GD_n_cluster(g) > 0))) {
+ if (asp!=null && ((GD_comp(g).size > 1)||(GD_n_cluster(g) > 0))) {
UNSUPPORTED("evcjt85irnaa02v8cam07i009"); // asp->badGraph = 1;
UNSUPPORTED("45nxv6kczal9hnytkfcyt2jk8"); // asp = NULL;
}
@@ -1308,7 +1286,7 @@ LEAVING("2o4rmb4o6f6zh46ak3se91rwr","dot1_rank");
//3 asyfujgwqa407ffvqn5psbtsc
// void dot_rank(graph_t * g, aspect_t* asp)
-public static void dot_rank(Agraph_s g, aspect_t asp) {
+public static void dot_rank(ST_Agraph_s g, ST_aspect_t asp) {
ENTERING("asyfujgwqa407ffvqn5psbtsc","dot_rank");
try {
if (agget (g, new CString("newrank"))!=null) {
@@ -1329,7 +1307,7 @@ LEAVING("asyfujgwqa407ffvqn5psbtsc","dot_rank");
//3 cdncou6d2ng5i48rd1mk2cpnw
// int is_cluster(graph_t * g)
-public static boolean is_cluster(Agraph_s g) {
+public static boolean is_cluster(ST_Agraph_s g) {
ENTERING("cdncou6d2ng5i48rd1mk2cpnw","is_cluster");
try {
return (strncmp(agnameof(g), new CString("cluster"), 7) == 0);
diff --git a/src/gen/lib/dotgen/sameport__c.java b/src/gen/lib/dotgen/sameport__c.java
index 63b20dc..71ff710 100644
--- a/src/gen/lib/dotgen/sameport__c.java
+++ b/src/gen/lib/dotgen/sameport__c.java
@@ -50,15 +50,12 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGEDGE;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agedge_s;
-import h.Agnode_s;
-import h.Agraph_s;
-import h.boxf;
-import h.pointf;
+import h.ST_Agedge_s;
+import h.ST_Agnode_s;
+import h.ST_Agraph_s;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
import smetana.core.Z;
-import smetana.core.__struct__;
public class sameport__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -318,14 +315,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -354,27 +351,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
-
//3 1n5xl70wxuabyf97mclvilsm6
@@ -396,16 +372,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -702,11 +678,11 @@ throw new UnsupportedOperationException();
//3 eu2yvovb9xx4rzic3gllij2bv
// void dot_sameports(graph_t * g)
-public static void dot_sameports(Agraph_s g) {
+public static void dot_sameports(ST_Agraph_s g) {
ENTERING("eu2yvovb9xx4rzic3gllij2bv","dot_sameports");
try {
- Agnode_s n;
- Agedge_s e;
+ ST_Agnode_s n;
+ ST_Agedge_s e;
CString id;
//same_t samehead[5];
//same_t sametail[5];
diff --git a/src/gen/lib/fdpgen/clusteredges__c.java b/src/gen/lib/fdpgen/clusteredges__c.java
index 48afde6..4626a95 100644
--- a/src/gen/lib/fdpgen/clusteredges__c.java
+++ b/src/gen/lib/fdpgen/clusteredges__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class clusteredges__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/comp__c.java b/src/gen/lib/fdpgen/comp__c.java
index 42f9745..6f2c75a 100644
--- a/src/gen/lib/fdpgen/comp__c.java
+++ b/src/gen/lib/fdpgen/comp__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class comp__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/fdpinit__c.java b/src/gen/lib/fdpgen/fdpinit__c.java
index 457cc4c..f92b6b7 100644
--- a/src/gen/lib/fdpgen/fdpinit__c.java
+++ b/src/gen/lib/fdpgen/fdpinit__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class fdpinit__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,26 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -388,16 +365,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/grid__c.java b/src/gen/lib/fdpgen/grid__c.java
index 35122bc..8ec5049 100644
--- a/src/gen/lib/fdpgen/grid__c.java
+++ b/src/gen/lib/fdpgen/grid__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class grid__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/layout__c.java b/src/gen/lib/fdpgen/layout__c.java
index 12a8203..ea6735b 100644
--- a/src/gen/lib/fdpgen/layout__c.java
+++ b/src/gen/lib/fdpgen/layout__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
import smetana.core.jmp_buf;
public class layout__c {
@@ -311,14 +308,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -347,26 +344,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -389,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/tlayout__c.java b/src/gen/lib/fdpgen/tlayout__c.java
index 81c5760..46c4a9f 100644
--- a/src/gen/lib/fdpgen/tlayout__c.java
+++ b/src/gen/lib/fdpgen/tlayout__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class tlayout__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/fdpgen/xlayout__c.java b/src/gen/lib/fdpgen/xlayout__c.java
index 8614a20..4eeac70 100644
--- a/src/gen/lib/fdpgen/xlayout__c.java
+++ b/src/gen/lib/fdpgen/xlayout__c.java
@@ -47,10 +47,7 @@ package gen.lib.fdpgen;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class xlayout__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,25 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
@@ -388,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/gvc/gvc__c.java b/src/gen/lib/gvc/gvc__c.java
index b084fa0..b9a2b2d 100644
--- a/src/gen/lib/gvc/gvc__c.java
+++ b/src/gen/lib/gvc/gvc__c.java
@@ -53,7 +53,7 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGNODE;
import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
+import h.ST_GVC_s;
import smetana.core.CString;
public class gvc__c {
@@ -161,13 +161,13 @@ public class gvc__c {
//3 f3vdhir2c7dz3pvmx9d3m4lx1
// GVC_t *gvContext(void)
-public static GVC_s gvContext(Object... arg) {
+public static ST_GVC_s gvContext(Object... arg) {
ENTERING("f3vdhir2c7dz3pvmx9d3m4lx1","gvContext");
try {
- GVC_s gvc;
+ ST_GVC_s gvc;
agattr(null, AGNODE, new CString("label"), new CString("\\N"));
/* default to no builtins, demand loading enabled */
- gvc = (GVC_s) gvNEWcontext(null, (NOT(0)));
+ gvc = (ST_GVC_s) gvNEWcontext(null, (NOT(0)));
/* builtins don't require LTDL */
gvc.setInt("config_found", 0);
gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
diff --git a/src/gen/lib/gvc/gvcontext__c.java b/src/gen/lib/gvc/gvcontext__c.java
index e849ffe..29c89e7 100644
--- a/src/gen/lib/gvc/gvcontext__c.java
+++ b/src/gen/lib/gvc/gvcontext__c.java
@@ -44,13 +44,11 @@
*
*/
package gen.lib.gvc;
-import static gen.lib.common.memory__c.zmalloc;
import static smetana.core.JUtils.function;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
+import h.ST_GVC_s;
import h.lt_symlist_t;
import smetana.core.__ptr__;
@@ -168,15 +166,15 @@ public static __ptr__ LibInfo = null;
//3 8jwauh4lo3kcvxhomy40s94b
// GVC_t *gvNEWcontext(const lt_symlist_t *builtins, int demand_loading)
-public static GVC_s gvNEWcontext(lt_symlist_t builtins, boolean demand_loading) {
+public static ST_GVC_s gvNEWcontext(lt_symlist_t builtins, boolean demand_loading) {
ENTERING("8jwauh4lo3kcvxhomy40s94b","gvNEWcontext");
try {
- GVC_s gvc = (GVC_s) zmalloc(sizeof(GVC_s.class));
+ ST_GVC_s gvc = new ST_GVC_s();
if (gvc!=null) {
- gvc.getStruct("common").setPtr("info", LibInfo);
- gvc.getStruct("common").setPtr("errorfn", function(gen.lib.cgraph.agerror__c.class, "agerrorf"));
- gvc.getStruct("common").setPtr("builtins", builtins);
- gvc.getStruct("common").setBoolean("demand_loading", demand_loading);
+ gvc.common.setPtr("info", LibInfo);
+ gvc.common.setPtr("errorfn", function(gen.lib.cgraph.agerror__c.class, "agerrorf"));
+ gvc.common.setPtr("builtins", builtins);
+ gvc.common.demand_loading = demand_loading;
}
return gvc;
} finally {
diff --git a/src/gen/lib/gvc/gvlayout__c.java b/src/gen/lib/gvc/gvlayout__c.java
index e305e48..1fb4ac2 100644
--- a/src/gen/lib/gvc/gvlayout__c.java
+++ b/src/gen/lib/gvc/gvlayout__c.java
@@ -60,17 +60,14 @@ import static smetana.core.Macro.GD_drawing;
import static smetana.core.Macro.GD_gvc;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.Agraphinfo_t;
-import h.GVC_s;
-import h.gvlayout_engine_s;
-import h.gvlayout_features_t;
-import h.gvplugin_installed_t;
+import h.ST_Agraph_s;
+import h.ST_Agraphinfo_t;
+import h.ST_GVC_s;
+import h.ST_gvlayout_engine_s;
+import h.ST_gvlayout_features_t;
+import h.ST_gvplugin_installed_t;
import h.layout_type;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.Memory;
-import smetana.core.__struct__;
public class gvlayout__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -175,34 +172,34 @@ public class gvlayout__c {
-//3 2g20jitdi8afuoei8p1mcfg9l
-// int gvlayout_select(GVC_t * gvc, const char *layout)
-private final static __struct__<gvlayout_features_t> dotgen_features = JUtils.from(gvlayout_features_t.class);
-private final static __struct__<gvlayout_engine_s> dotgen_engine = JUtils.from(gvlayout_engine_s.class);
+private final static ST_gvlayout_features_t dotgen_features = new ST_gvlayout_features_t();
+private final static ST_gvlayout_engine_s dotgen_engine = new ST_gvlayout_engine_s();
static {
dotgen_features.setInt("flags", 1<<0);
dotgen_engine.setPtr("layout", function(gen.lib.dotgen.dotinit__c.class, "dot_layout"));
dotgen_engine.setPtr("cleanup", function(gen.lib.dotgen.dotinit__c.class, "dot_cleanup"));
}
-public static int gvlayout_select(GVC_s gvc, CString layout) {
+//3 2g20jitdi8afuoei8p1mcfg9l
+//int gvlayout_select(GVC_t * gvc, const char *layout)
+public static int gvlayout_select(ST_GVC_s gvc, CString layout) {
ENTERING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select");
try {
- gvplugin_installed_t gvlayout_dot_layout = (gvplugin_installed_t) Memory.malloc(gvplugin_installed_t.class);
+ ST_gvplugin_installed_t gvlayout_dot_layout = new ST_gvplugin_installed_t();
gvlayout_dot_layout.setInt("id", enumAsInt(layout_type.class, "LAYOUT_DOT"));
gvlayout_dot_layout.setPtr("type", new CString("dot"));
gvlayout_dot_layout.setInt("quality", 0);
- gvlayout_dot_layout.setPtr("engine", dotgen_engine.amp());
- gvlayout_dot_layout.setPtr("features", dotgen_features.amp());
+ gvlayout_dot_layout.setPtr("engine", dotgen_engine);
+ gvlayout_dot_layout.setPtr("features", dotgen_features);
// gvplugin_available_t *plugin;
- gvplugin_installed_t typeptr = gvlayout_dot_layout;
+ ST_gvplugin_installed_t typeptr = gvlayout_dot_layout;
// plugin = gvplugin_load(gvc, API_layout, layout);
// if (plugin) {
// typeptr = plugin->typeptr;
- gvc.getStruct("layout").setPtr("type", typeptr.getPtr("type"));
- gvc.getStruct("layout").setPtr("engine", typeptr.getPtr("engine"));
- gvc.getStruct("layout").setInt("id", typeptr.getInt("id"));
- gvc.getStruct("layout").setPtr("features", typeptr.getPtr("features"));
+ gvc.layout.setPtr("type", typeptr.type);
+ gvc.layout.setPtr("engine", typeptr.engine);
+ gvc.layout.setInt("id", typeptr.id);
+ gvc.layout.setPtr("features", typeptr.features);
return 300; /* FIXME - need better return code */
// }
// return 999;
@@ -216,13 +213,13 @@ LEAVING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select");
//3 991b7t7n0x8ifkp49zotjs78x
// int gvLayoutJobs(GVC_t * gvc, Agraph_t * g)
-public static int gvLayoutJobs(GVC_s gvc, Agraph_s g) {
+public static int gvLayoutJobs(ST_GVC_s gvc, ST_Agraph_s g) {
ENTERING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs");
try {
- gvlayout_engine_s gvle;
+ ST_gvlayout_engine_s gvle;
CString p = null;
int rc;
- agbindrec(g, new CString("Agraphinfo_t"), sizeof(Agraphinfo_t.class), (N(0)));
+ agbindrec(g, new CString("Agraphinfo_t"), sizeof(ST_Agraphinfo_t.class), (N(0)));
GD_gvc(g, gvc);
if (NEQ(g, agroot(g)))
UNSUPPORTED("ah9ygbaap1fyxr97z734juk0j"); // (((Agraphinfo_t*)(((Agobj_t*)(agroot(g)))->data))->gvc) = gvc;
@@ -238,18 +235,18 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
rc = gvlayout_select(gvc, p); //Let's force things
- gvle = (gvlayout_engine_s) gvc.getStruct("layout").getPtr("engine");
+ gvle = (ST_gvlayout_engine_s) gvc.layout.engine;
if (N(gvle))
UNSUPPORTED("return -1;");
gv_fixLocale (1);
- graph_init(g, (gvc.getStruct("layout").getPtr("features").getInt("flags") & (1<<0))!=0);
+ graph_init(g, (gvc.layout.features.flags & (1<<0))!=0);
GD_drawing(agroot(g), GD_drawing(g));
- if (gvle!=null && gvle.getPtr("layout")!=null) {
- gvle.call("layout", g);
- if (gvle.getPtr("cleanup")!=null)
+ if (gvle!=null && gvle.layout!=null) {
+ gvle.layout.exe(g);
+ if (gvle.cleanup!=null)
if (GD_cleanup(g)==null)
LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else
- GD_cleanup(g).setPtr(gvle.getPtr("cleanup"));
+ GD_cleanup(g).setPtr(gvle.cleanup);
}
gv_fixLocale (0);
return 0;
diff --git a/src/gen/lib/gvc/gvplugin__c.java b/src/gen/lib/gvc/gvplugin__c.java
index 4f2ae3f..4d5c7d5 100644
--- a/src/gen/lib/gvc/gvplugin__c.java
+++ b/src/gen/lib/gvc/gvplugin__c.java
@@ -50,11 +50,11 @@ import static smetana.core.JUtils.strncpy;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
+import h.ST_GVC_s;
+import h.ST_gvplugin_available_s;
+import h.ST_gvplugin_installed_t;
import h.api_t;
import h.gvplugin_api_t;
-import h.gvplugin_available_s;
-import h.gvplugin_installed_t;
import h.gvplugin_library_t;
import smetana.core.CString;
@@ -294,14 +294,14 @@ throw new UnsupportedOperationException();
//3 dh7wri9ra8xvm9ur14gd95xjj
// gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, const char *str)
-public static gvplugin_available_s gvplugin_load(GVC_s gvc, int api, CString str) {
+public static ST_gvplugin_available_s gvplugin_load(ST_GVC_s gvc, int api, CString str) {
ENTERING("dh7wri9ra8xvm9ur14gd95xjj","gvplugin_load");
try {
//gvplugin_available_s **pnext;
//gvplugin_available_s rv;
gvplugin_library_t library;
gvplugin_api_t apis;
- gvplugin_installed_t types;
+ ST_gvplugin_installed_t types;
CString reqtyp = new CString(64), typ = new CString(64);
CString reqdep, dep , reqpkg;
int i;
diff --git a/src/gen/lib/gvc/gvrender__c.java b/src/gen/lib/gvc/gvrender__c.java
index 8467a48..cbe645a 100644
--- a/src/gen/lib/gvc/gvrender__c.java
+++ b/src/gen/lib/gvc/gvrender__c.java
@@ -47,10 +47,7 @@ package gen.lib.gvc;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class gvrender__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -174,14 +171,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -210,26 +207,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -252,16 +229,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/gvc/gvtextlayout__c.java b/src/gen/lib/gvc/gvtextlayout__c.java
index 7e0d856..8b0b09f 100644
--- a/src/gen/lib/gvc/gvtextlayout__c.java
+++ b/src/gen/lib/gvc/gvtextlayout__c.java
@@ -49,10 +49,10 @@ import static smetana.core.JUtils.enumAsInt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.GVC_s;
+import h.ST_GVC_s;
+import h.ST_gvplugin_available_s;
+import h.ST_gvplugin_installed_t;
import h.api_t;
-import h.gvplugin_available_s;
-import h.gvplugin_installed_t;
import smetana.core.CString;
public class gvtextlayout__c {
@@ -160,11 +160,11 @@ public class gvtextlayout__c {
//3 f1oiyeonoigwygyq8c88wl8tz
// int gvtextlayout_select(GVC_t * gvc)
-public static int gvtextlayout_select(GVC_s gvc) {
+public static int gvtextlayout_select(ST_GVC_s gvc) {
ENTERING("f1oiyeonoigwygyq8c88wl8tz","gvtextlayout_select");
try {
- gvplugin_available_s plugin;
- gvplugin_installed_t typeptr;
+ ST_gvplugin_available_s plugin;
+ ST_gvplugin_installed_t typeptr;
plugin = gvplugin_load(gvc, enumAsInt(api_t.class, "API_textlayout"), new CString("textlayout"));
if (plugin!=null) {
UNSUPPORTED("8cnmkxanogd09zc24faarugvo"); // typeptr = plugin->typeptr;
diff --git a/src/gen/lib/label/index__c.java b/src/gen/lib/label/index__c.java
index d2221e5..eda1fc2 100644
--- a/src/gen/lib/label/index__c.java
+++ b/src/gen/lib/label/index__c.java
@@ -44,12 +44,24 @@
*
*/
package gen.lib.label;
-import static gen.lib.label.node__c.*;
-import static gen.lib.common.memory__c.zmalloc;
-import static smetana.core.JUtils.sizeof;
+import static gen.lib.label.node__c.AddBranch;
+import static gen.lib.label.node__c.DisconBranch;
+import static gen.lib.label.node__c.NodeCover;
+import static gen.lib.label.node__c.PickBranch;
+import static gen.lib.label.node__c.RTreeNewNode;
+import static gen.lib.label.rectangle__c.CombineRect;
+import static gen.lib.label.rectangle__c.Overlap;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.RTree;
-import h._Node_t___;
+import h.ST_Branch_t;
+import h.ST_LeafList_t;
+import h.ST_Node_t___;
+import h.ST_Node_t___or_object_t;
+import h.ST_RTree;
+import h.ST_Rect_t;
+import smetana.core.Memory;
import smetana.core.__ptr__;
public class index__c {
@@ -57,18 +69,25 @@ public class index__c {
//3 1rfaqe5urty5uyp5xb2r0idce
// LeafList_t *RTreeNewLeafList(Leaf_t * lp)
-public static Object RTreeNewLeafList(Object... arg) {
-UNSUPPORTED("bu04wzk5vh5g14rcm11j6y1bc"); // LeafList_t *RTreeNewLeafList(Leaf_t * lp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8mcrniwafqlmy5ysg6jeand6o"); // LeafList_t *llp;
-UNSUPPORTED("3b215c61vcll0rkorzyelp40j"); // if ((llp = (LeafList_t*)zmalloc(sizeof(LeafList_t)))) {
-UNSUPPORTED("48u04cv4b40c0avzy99mdycx5"); // llp->leaf = lp;
-UNSUPPORTED("bbvk7v1s0z6yw1xdoq99v233w"); // llp->next = 0;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("5a1d3zolzdjict0gus6vz04a2"); // return llp;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_LeafList_t RTreeNewLeafList(ST_Branch_t lp) {
+ENTERING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
+try {
+ ST_LeafList_t llp;
+ llp = new ST_LeafList_t();
+ llp.leaf = lp;
+ llp.next = null;
+ return llp;
+//UNSUPPORTED("3b215c61vcll0rkorzyelp40j"); // if ((llp = (LeafList_t*)zmalloc(sizeof(LeafList_t)))) {
+//UNSUPPORTED("48u04cv4b40c0avzy99mdycx5"); // llp->leaf = lp;
+//UNSUPPORTED("bbvk7v1s0z6yw1xdoq99v233w"); // llp->next = 0;
+//UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
+//UNSUPPORTED("5a1d3zolzdjict0gus6vz04a2"); // return llp;
+//UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+//
+//throw new UnsupportedOperationException();
+} finally {
+LEAVING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
+}
}
@@ -76,18 +95,18 @@ throw new UnsupportedOperationException();
//3 6pvstz7axi8a7saeqe3nrrmg5
// LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp)
-public static Object RTreeLeafListAdd(Object... arg) {
-UNSUPPORTED("eiwtmfygcnm8i2i38dywdrxvu"); // LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("c8jefspkzejjwynx8rg8zejbx"); // LeafList_t *nlp;
-UNSUPPORTED("5whcehr1j26r7aahssfvo2dxa"); // if (!lp)
-UNSUPPORTED("1sxqq75kqdqzr0enoukqqx3m1"); // return llp;
-UNSUPPORTED("adl5lp3lwoh3u5zssznsdnxms"); // nlp = RTreeNewLeafList(lp);
-UNSUPPORTED("373n3s0slcur0mj477nbkp2z9"); // nlp->next = llp;
-UNSUPPORTED("c398zm44c0kp59y82avlt28qs"); // return nlp;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, ST_Branch_t lp) {
+ENTERING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
+try {
+ ST_LeafList_t nlp;
+ if (N(lp))
+ return llp;
+ nlp = RTreeNewLeafList(lp);
+ nlp.next = llp;
+ return nlp;
+} finally {
+LEAVING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
+}
}
@@ -95,20 +114,19 @@ throw new UnsupportedOperationException();
//3 6zraor7x44vrnm19d2igkvow2
// void RTreeLeafListFree(LeafList_t * llp)
-public static Object RTreeLeafListFree(Object... arg) {
-UNSUPPORTED("cwsuv5x6hz2atkriag0lyrwpq"); // void RTreeLeafListFree(LeafList_t * llp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("96shepyp7pgdusod9eu04oqsa"); // LeafList_t *tlp;
-UNSUPPORTED("66etdhvz2fmsepzj2nfiioze9"); // while (llp->next) {
-UNSUPPORTED("aa7iqc08758zwe37qyy2wffec"); // tlp = llp->next;
-UNSUPPORTED("efbq5hg14ncf3x5du5wro1m6d"); // free(llp);
-UNSUPPORTED("6qcaq7a673zdej3uu1ke2kz0a"); // llp = tlp;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("41smjtwh6jsdofomjdbd76o7j"); // free(llp);
-UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void RTreeLeafListFree(ST_LeafList_t llp) {
+ENTERING("6zraor7x44vrnm19d2igkvow2","RTreeLeafListFree");
+try {
+ ST_LeafList_t tlp;
+ while (llp.next!=null) {
+ tlp = (ST_LeafList_t) llp.next;
+ Memory.free(llp);
+ llp = tlp;
+ }
+ Memory.free(llp);
+} finally {
+LEAVING("6zraor7x44vrnm19d2igkvow2","RTreeLeafListFree");
+}
}
///* Allocate space for a node in the list used in DeletRect to
@@ -122,8 +140,10 @@ throw new UnsupportedOperationException();
///* Add a node to the reinsertion list. All its branches will later
// * be reinserted into the index structure.
// */
+//3 aa19m7d7qc06m8id896e60lkg
//static int RTreeReInsert(RTree_t * rtp, Node_t * n, struct ListNode **ee)
//{
+// WARNING!! STRUCT
// register struct ListNode *l;
//
// if (!(l = RTreeNewListNode()))
@@ -134,105 +154,134 @@ throw new UnsupportedOperationException();
// return 0;
//}
//
+//3 aa29m7d7qc06m8id896e60lkg
//RTree_t *RTreeOpen()
public static __ptr__ RTreeOpen() {
- RTree rtp;
- rtp = (RTree) zmalloc(sizeof(RTree.class));
+ENTERING("aa29m7d7qc06m8id896e60lkg","RTreeOpen");
+try {
+ ST_RTree rtp;
+ rtp = new ST_RTree();
if (rtp!=null)
rtp.setPtr("root", RTreeNewIndex(rtp));
return rtp;
+} finally {
+LEAVING("aa29m7d7qc06m8id896e60lkg","RTreeOpen");
+}
}
-///* Make a new index, empty. Consists of a single node. */
+/* Make a new index, empty. Consists of a single node. */
+//3 aa39m7d7qc06m8id896e60lkg
//Node_t *RTreeNewIndex(RTree_t * rtp)
-public static _Node_t___ RTreeNewIndex(RTree rtp) {
- _Node_t___ x;
+public static ST_Node_t___ RTreeNewIndex(ST_RTree rtp) {
+ENTERING("aa39m7d7qc06m8id896e60lkg","RTreeNewIndex");
+try {
+ ST_Node_t___ x;
x = RTreeNewNode(rtp);
-// x->level = 0; /* leaf */
-// rtp->LeafCount++;
-// return x;
-//}
- throw new UnsupportedOperationException();
+ x.setInt("level", 0); /* leaf */
+ rtp.setInt("LeafCount", rtp.LeafCount+1);
+ return x;
+} finally {
+LEAVING("aa39m7d7qc06m8id896e60lkg","RTreeNewIndex");
}
-//
+}
+
+//3 aa49m7d7qc06m8id896e60lkg
//static int RTreeClose2(RTree_t * rtp, Node_t * n)
-//{
-// int i;
-//
-// if (n->level > 0) {
-// for (i = 0; i < 64; i++) {
-// if (!n->branch[i].child)
-// continue;
-// if (!RTreeClose2(rtp, n->branch[i].child)) {
-// free(n->branch[i].child);
-// DisconBranch(n, i);
-// rtp->EntryCount--;
-// if (rtp->StatFlag)
-// rtp->ElimCount++;
-// }
-// }
-// } else {
-// for (i = 0; i < 64; i++) {
-// if (!n->branch[i].child)
-// continue;
-// // free(n->branch[i].child);
-// DisconBranch(n, i);
-// rtp->EntryCount--;
-// if (rtp->StatFlag)
-// rtp->ElimCount++;
-// }
-// //free(n);
-// }
-// return 0;
-//}
-//
+public static int RTreeClose2(ST_RTree rtp, ST_Node_t___ n) {
+ENTERING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
+try {
+ int i;
+
+ if (n.level > 0) {
+ for (i = 0; i < 64; i++) {
+ if (N(n.branch[i].child))
+ continue;
+ if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].child))) {
+ Memory.free(n.branch[i].child);
+ DisconBranch(n, i);
+ rtp.setInt("EntryCount", rtp.EntryCount-1);
+ if (rtp.StatFlag!=0)
+ rtp.setInt("ElimCount", rtp.ElimCount+1);
+ }
+ }
+ } else {
+ for (i = 0; i < 64; i++) {
+ if (N(n.branch[i].child))
+ continue;
+ // free(n->branch[i].child);
+ DisconBranch(n, i);
+ rtp.setInt("EntryCount", rtp.EntryCount-1);
+ if (rtp.StatFlag!=0)
+ rtp.setInt("ElimCount", rtp.ElimCount+1);
+ }
+ //free(n);
+ }
+ return 0;
+} finally {
+LEAVING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
+}
+}
+
+//3 aa59m7d7qc06m8id896e60lkg
//int RTreeClose(RTree_t * rtp)
-//{
-// RTreeClose2(rtp, rtp->root);
-// free(rtp->root);
-// free(rtp);
-// return 0;
-//}
-//
-//
-///* RTreeSearch in an index tree or subtree for all data retangles that
-//** overlap the argument rectangle.
-//** Returns the number of qualifying data rects.
-//*/
+public static int RTreeClose(ST_RTree rtp) {
+ENTERING("aa59m7d7qc06m8id896e60lkg","RTreeClose");
+try {
+ RTreeClose2(rtp, (ST_Node_t___) rtp.root);
+ Memory.free(rtp.root);
+ Memory.free(rtp);
+ return 0;
+} finally {
+LEAVING("aa59m7d7qc06m8id896e60lkg","RTreeClose");
+}
+}
+
+
+
+/* RTreeSearch in an index tree or subtree for all data retangles that
+** overlap the argument rectangle.
+** Returns the number of qualifying data rects.
+*/
+//3 aa69m7d7qc06m8id896e60lkg
//LeafList_t *RTreeSearch(RTree_t * rtp, Node_t * n, Rect_t * r)
-//{
-// register int i;
-// LeafList_t *llp = 0;
-//
+public static ST_LeafList_t RTreeSearch(ST_RTree rtp, ST_Node_t___ n, ST_Rect_t r) {
+ENTERING("aa69m7d7qc06m8id896e60lkg","RTreeSearch");
+try {
+ int i;
+ ST_LeafList_t llp = null;
+
// assert(n);
// assert(n->level >= 0);
// assert(r);
-//
-// rtp->SeTouchCount++;
-//
-// if (n->level > 0) { /* this is an internal node in the tree */
-// for (i = 0; i < 64; i++)
-// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
-// LeafList_t *tlp = RTreeSearch(rtp, n->branch[i].child, r);
-// if (llp) {
-// LeafList_t *xlp = llp;
-// while (xlp->next)
-// xlp = xlp->next;
-// xlp->next = tlp;
-// } else
-// llp = tlp;
-// }
-// } else { /* this is a leaf node */
-// for (i = 0; i < 64; i++) {
-// if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
-// llp = RTreeLeafListAdd(llp, (Leaf_t *) & n->branch[i]);
-//
-//
-//
-// }
-// }
-// }
-// return llp;
+
+ rtp.setInt("SeTouchCount", rtp.SeTouchCount+1);
+
+ if (n.level > 0) { /* this is an internal node in the tree */
+ for (i = 0; i < 64; i++)
+ if (n.branch[i].child!=null &&
+ Overlap(r, n.branch[i].rect)) {
+ ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].child, r);
+ if (llp!=null) {
+ ST_LeafList_t xlp = llp;
+ while (xlp.next!=null)
+ xlp = (ST_LeafList_t) xlp.next;
+ xlp.next = tlp;
+ } else
+ llp = tlp;
+ }
+ } else { /* this is a leaf node */
+ for (i = 0; i < 64; i++) {
+ if (n.branch[i].child!=null && Overlap(r, n.branch[i].rect)) {
+ llp = RTreeLeafListAdd(llp, /*(Leaf_t *)*/ n.branch[i]);
+ }
+ }
+ }
+ return llp;
+} finally {
+LEAVING("aa69m7d7qc06m8id896e60lkg","RTreeSearch");
+}
+}
+
//}
//
///* Insert a data rectangle into an index structure.
@@ -250,106 +299,107 @@ public static _Node_t___ RTreeNewIndex(RTree rtp) {
//3 3wss9r0zgt5k06j8ovjv7hq0d
// int RTreeInsert(RTree_t * rtp, Rect_t * r, void *data, Node_t ** n, int level)
-public static Object RTreeInsert(Object... arg) {
-UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
-UNSUPPORTED("4vefy88zis2pcgmerh9m6nllk"); // RTreeInsert(RTree_t * rtp, Rect_t * r, void *data, Node_t ** n, int level)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("8ey3knwkpac8aeth9v8pxu3jo"); // /* RTreeInsert(RTree_t*rtp, Rect_t*r, int data, Node_t**n, int level) { */
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("bp3fw6x5k0c1muih5wl2fmk9n"); // register Node_t *newroot;
-UNSUPPORTED("k2d14nu7r2g4yefydufxqa6l"); // Node_t *newnode=0;
-UNSUPPORTED("8jhu5fyksz5wgdvvak4rqzjog"); // Branch_t b;
-UNSUPPORTED("1dfkfq72ilaevpylx2giyequh"); // int result = 0;
-UNSUPPORTED("3lp95fcfxfbsb08w5umj6mjxb"); // assert(r && n);
-UNSUPPORTED("jakzrkbz09r9gvlx5yfqsq4t"); // assert(level >= 0 && level <= (*n)->level);
-UNSUPPORTED("1acecsj25mg52d6624llst9la"); // for (i = 0; i < 2; i++)
-UNSUPPORTED("au1dzglobtl3y92py1o59k29w"); // assert(r->boundary[i] <= r->boundary[2 + i]);
-UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
+public static int RTreeInsert(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n[], int level) {
+ENTERING("3wss9r0zgt5k06j8ovjv7hq0d","RTreeInsert");
+try {
+ int i;
+ ST_Node_t___ newroot;
+ ST_Node_t___ newnode[] = new ST_Node_t___[1];
+ final ST_Branch_t b = new ST_Branch_t();
+ int result = 0;
+// assert(r && n);
+// assert(level >= 0 && level <= (*n)->level);
+// for (i = 0; i < 2; i++)
+// assert(r->boundary[i] <= r->boundary[2 + i]);
+if (rtp.StatFlag!=0) {
UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
UNSUPPORTED("bzb1oqc35evr96528iv16glb0"); // rtp->ReInsertCount++;
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("3kxquse3qg2crme5dzybg9jxe"); // rtp->InsertCount++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("872g4yc6sa8rtep8wdqiys74d"); // if (!rtp->Deleting)
-UNSUPPORTED("4kv2cwozm6o06e73mjdidn17p"); // rtp->RectCount++;
-UNSUPPORTED("p721o575619ujgj5774sswe4"); // if (RTreeInsert2(rtp, r, data, *n, &newnode, level)) { /* root was split */
-UNSUPPORTED("dhd7sfbis7klukcyf8rg2skvp"); // if (rtp->StatFlag) {
+}
+ if (N(rtp.Deleting))
+ rtp.setInt("RectCount", rtp.RectCount+1);
+ if (RTreeInsert2(rtp, r, data, n[0], newnode, level)!=0) { /* root was split */
+ if (rtp.StatFlag!=0) {
UNSUPPORTED("2y8kv6b3ysrr61q7tqn76rhhc"); // if (rtp->Deleting)
UNSUPPORTED("dn4oynmx9ugizzs5pkxiyptbi"); // rtp->DeTouchCount++;
UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("f1ubx3a7wizvjmsawzdn97nwy"); // newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */
-UNSUPPORTED("cb1h5p8jnxwwzvaoyg1k27xmf"); // rtp->NonLeafCount++;
-UNSUPPORTED("1611m4hdihz2ns6tzb00du4f"); // newroot->level = (*n)->level + 1;
-UNSUPPORTED("7abewx8c16vuk9ksc6dh0co53"); // b.rect = NodeCover(*n);
-UNSUPPORTED("465b8w8j2mnvocx78bsxgs0si"); // b.child = *n;
-UNSUPPORTED("8lf6tafgpibucjtrng2bzhqt"); // AddBranch(rtp, &b, newroot, (void *)0);
-UNSUPPORTED("5ncet5h2bsh7p0gqx0zcjk8zs"); // b.rect = NodeCover(newnode);
-UNSUPPORTED("2iec9n0l9utuq5wm6188trocr"); // b.child = newnode;
-UNSUPPORTED("8lf6tafgpibucjtrng2bzhqt"); // AddBranch(rtp, &b, newroot, (void *)0);
-UNSUPPORTED("9kv07evealck0kkd4uos4gkz"); // *n = newroot;
-UNSUPPORTED("6s4qssw97iu3cy7cu2z00dnd"); // // rtp->root = newroot;
-UNSUPPORTED("5iff078lko2zs9b2cm7erd5kj"); // rtp->EntryCount += 2;
-UNSUPPORTED("akq58xm5u8sg03eunssjzl44f"); // result = 1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("e73y2609z2557xahrcvzmcb8e"); // return result;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */
+ rtp.setInt("NonLeafCount", rtp.NonLeafCount+1);
+ newroot.setInt("level", n[0].level + 1);
+ b.setStruct("rect", NodeCover(n[0]));
+ b.child = n[0];
+ AddBranch(rtp, b, newroot, null);
+ b.setStruct("rect", NodeCover(newnode[0]));
+ b.child = newnode[0];
+ AddBranch(rtp, b, newroot, null);
+ n[0] = newroot;
+ // rtp->root = newroot;
+ rtp.setInt("EntryCount", rtp.EntryCount + 2);
+ result = 1;
+ }
+ return result;
+} finally {
+LEAVING("3wss9r0zgt5k06j8ovjv7hq0d","RTreeInsert");
+}
}
+// public static int RTreeInsert(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n[], int level) {
//3 bsc9m7d7qc06m8id896e60lkg
// static int RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data, Node_t * n, Node_t ** new, int level)
-public static Object RTreeInsert2(Object... arg) {
-UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
-UNSUPPORTED("e1c7cm1mq875co9obwzzyyxt"); // RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data,
-UNSUPPORTED("4errdslfbv5x54v81wpgk55l7"); // Node_t * n, Node_t ** new, int level)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("d5termnm5bwrhia82rw6jvi00"); // /*static int */
-UNSUPPORTED("12ickqloxyobilus63e3bdi65"); // /* RTreeInsert2(RTree_t*rtp, Rect_t*r,
-UNSUPPORTED("e27l28tilpvjc3y9m1iz6c51k"); // int data, Node_t*n, Node_t**new, int level) {
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("6crctkpvpno5y1bsv7yuqjnm2"); // register int i=0;
-UNSUPPORTED("8jhu5fyksz5wgdvvak4rqzjog"); // Branch_t b;
-UNSUPPORTED("4dqkrcduvdmv3d5fgv1enjacs"); // Node_t *n2=0;
-UNSUPPORTED("bsrr9pvjfr4ki5il3quxx4rqg"); // assert(r && n && new);
-UNSUPPORTED("5xudi4txe3k13af1mbe43tgbn"); // assert(level >= 0 && level <= n->level);
-UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
+public static int RTreeInsert2(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n, ST_Node_t___ new_[], int level) {
+ENTERING("bsc9m7d7qc06m8id896e60lkg","RTreeInsert2");
+try {
+ /*static int */
+ /* RTreeInsert2(RTree_t*rtp, Rect_t*r,
+ int data, Node_t*n, Node_t**new, int level) {
+ */
+ int i=0;
+ final ST_Branch_t b = new ST_Branch_t();
+ ST_Node_t___ n2[]=new ST_Node_t___[1];
+// assert(r && n && new);
+// assert(level >= 0 && level <= n->level);
+ if (rtp.StatFlag!=0) {
UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
UNSUPPORTED("8k1kgaoa4b2mcye1xthc3f1kf"); // rtp->DeTouchCount++;
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("6bsiysfcc9wix18ej9zs9z659"); // /* Still above level for insertion, go down tree recursively */
-UNSUPPORTED("4hz5jfabrdewpogbs7ahesjld"); // if (n->level > level) {
-UNSUPPORTED("2sz071aqfm5owiilsfyuw76rn"); // i = PickBranch(r, n);
-UNSUPPORTED("9qcjfckv31n1pds6m7zevi25p"); // if (!RTreeInsert2(rtp, r, data, n->branch[i].child, &n2, level)) { /* recurse: child was not split */
-UNSUPPORTED("8yht6usxlnq2ubp9xeqjz71o"); // n->branch[i].rect = CombineRect(r, &(n->branch[i].rect));
-UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
-UNSUPPORTED("99yufmtztzeyeo68jo3yftbcf"); // } else { /* child was split */
+ }
+/* Still above level for insertion, go down tree recursively */
+ if (n.level > level) {
+ i = PickBranch(r, n);
+ if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].child, n2, level))) {
+/* recurse: child was not split */
+ n.branch[i].setStruct("rect",
+ CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect));
+ return 0;
+ } else { /* child was split */
UNSUPPORTED("7evrfdq7uc1smqislqm9d82l6"); // n->branch[i].rect = NodeCover(n->branch[i].child);
UNSUPPORTED("echuth2qnq0o4n5gkzgtu5bgs"); // b.child = n2;
UNSUPPORTED("50z4r9qcomgi4o7vvwq0v0xs"); // b.rect = NodeCover(n2);
UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++;
UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new);
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("3uu0fkl3xw648hn9rehmuq54y"); // } else if (n->level == level) { /* at level for insertion. */
-UNSUPPORTED("cwtg3er5fpt2rr0k2efjapdmq"); // /*Add rect, split if necessary */
-UNSUPPORTED("1xql4kr4r981y1whzdo5zavad"); // b.rect = *r;
-UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data;
-UNSUPPORTED("7476ssw2oyxxzrqtz24g9cecp"); // rtp->EntryCount++;
-UNSUPPORTED("8gejxq93li6nilezate9nd078"); // return AddBranch(rtp, &b, n, new);
-UNSUPPORTED("an9bctf9o42m97fmlr7tb3xd5"); // } else { /* Not supposed to happen */
+ }
+ } else if (n.level == level) { /* at level for insertion. */
+ /*Add rect, split if necessary */
+ b.rect.___(r);
+ b.child = /*(Node_t *)*/(ST_Node_t___or_object_t) data; // THIS CAST IS A BIG ISSUE
+// UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data;
+ rtp.setInt("EntryCount", rtp.EntryCount+1);
+ return AddBranch(rtp, b, n, new_);
+ } else { /* Not supposed to happen */
UNSUPPORTED("22oqraxnqrjall7fj6pooexmi"); // assert((0));
UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
+ }
throw new UnsupportedOperationException();
+} finally {
+LEAVING("bsc9m7d7qc06m8id896e60lkg","RTreeInsert2");
+}
}
diff --git a/src/gen/lib/label/node__c.java b/src/gen/lib/label/node__c.java
index e6e26b3..4eaac1c 100644
--- a/src/gen/lib/label/node__c.java
+++ b/src/gen/lib/label/node__c.java
@@ -44,25 +44,34 @@
*
*/
package gen.lib.label;
+import static gen.lib.label.rectangle__c.CombineRect;
+import static gen.lib.label.rectangle__c.InitRect;
+import static gen.lib.label.rectangle__c.RectArea;
+import static gen.lib.label.split_q__c.SplitNode;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.RTree;
-import h._Node_t___;
-import smetana.core.Memory;
+import h.ST_Branch_t;
+import h.ST_Node_t___;
+import h.ST_RTree;
+import h.ST_Rect_t;
public class node__c {
//3 9uj7ni1m6q6drtoh56w82d6m4
// Node_t *RTreeNewNode(RTree_t * rtp)
-public static _Node_t___ RTreeNewNode(RTree rtp) {
- _Node_t___ n;
- rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1);
- n = (_Node_t___) Memory.malloc(_Node_t___.class);
-UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
-UNSUPPORTED("69hc24ic55i66g8tf2ne42327"); // return n;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_Node_t___ RTreeNewNode(ST_RTree rtp) {
+ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
+try {
+ ST_Node_t___ n;
+ rtp.setInt("NodeCount", rtp.NodeCount + 1);
+ n = new ST_Node_t___();
+ InitNode(n);
+ return n;
+} finally {
+LEAVING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
+}
}
@@ -89,17 +98,18 @@ throw new UnsupportedOperationException();
//3 4qk9wkm05q2pwf20ud6g2tufg
// void InitNode(Node_t * n)
-public static Object InitNode(Object... arg) {
-UNSUPPORTED("dlpky13v9fa11z9uukagldaj1"); // void InitNode(Node_t * n)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("7rbjc9psqd4hoib2lezl7pnh"); // n->count = 0;
-UNSUPPORTED("55ukro5lb2mre4owzaww8q2hc"); // n->level = -1;
-UNSUPPORTED("8v5nz5apd36odx9nwrk8p8jow"); // for (i = 0; i < 64; i++)
-UNSUPPORTED("80i9o3c1pvhadp8xg5nka4k0z"); // InitBranch(&(n->branch[i]));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void InitNode(ST_Node_t___ n) {
+ENTERING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
+try {
+ int i;
+ n.setInt("count", 0);
+ n.setInt("level", -1);
+ for (i = 0; i < 64; i++)
+ InitBranch(n.branch[i]);
+ // InitBranch(&(n->branch[i]));
+} finally {
+LEAVING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
+}
}
@@ -107,14 +117,14 @@ throw new UnsupportedOperationException();
//3 ruhxixxei7au9z1iaj0zggwo
// void InitBranch(Branch_t * b)
-public static Object InitBranch(Object... arg) {
-UNSUPPORTED("2ds4g44o2u9jlcjegxiplx78k"); // void InitBranch(Branch_t * b)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7tixqnx33892tw39ys6j048c9"); // InitRect(&(b->rect));
-UNSUPPORTED("6rffpszutr9tr32hwasnosx1l"); // b->child = NULL;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void InitBranch(ST_Branch_t b) {
+ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
+try {
+ InitRect(b.rect);
+ b.child = null;
+} finally {
+LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
+}
}
@@ -122,26 +132,26 @@ throw new UnsupportedOperationException();
//3 42vjqe8n5yeq2jjby00xzrotk
// Rect_t NodeCover(Node_t * n)
-public static Object NodeCover(Object... arg) {
-UNSUPPORTED("2khwamjri7uz3vu8fhl4bz8yr"); // Rect_t NodeCover(Node_t * n)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("e4wfnyowhq6r7cll9ebbr5pcr"); // register int i, flag;
-UNSUPPORTED("9jotn4njsd13qx406m9otorg4"); // Rect_t r;
-UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
-UNSUPPORTED("7t0m2a3824uy7f5r4wu3p2no9"); // InitRect(&r);
-UNSUPPORTED("e0yg2emzy8u4jgn9z7jdfpziq"); // flag = 1;
-UNSUPPORTED("8v5nz5apd36odx9nwrk8p8jow"); // for (i = 0; i < 64; i++)
-UNSUPPORTED("1ro7ykl3rxfkkcyghzozikkfc"); // if (n->branch[i].child) {
-UNSUPPORTED("ycid67impnxkwa9mvvkvdu0q"); // if (flag) {
-UNSUPPORTED("ektombc80083wiu0lsj6kto83"); // r = n->branch[i].rect;
-UNSUPPORTED("6bejndin7u1ns7xicz114gqtn"); // flag = 0;
-UNSUPPORTED("afk9bpom7x393euamnvwwkx6b"); // } else
-UNSUPPORTED("31n3s0xk5l7s3rhi9xeraiklo"); // r = CombineRect(&r, &(n->branch[i].rect));
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_Rect_t NodeCover(ST_Node_t___ n) {
+ENTERING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
+try {
+ int i, flag;
+ final ST_Rect_t r = new ST_Rect_t();
+ // assert(n);
+ InitRect(r);
+ flag = 1;
+ for (i = 0; i < 64; i++)
+ if (n.branch[i].child!=null) {
+ if (flag!=0) {
+ r.___(n.branch[i].rect);
+ flag = 0;
+ } else
+ r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect));
+ }
+ return r;
+} finally {
+LEAVING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
+}
}
@@ -149,37 +159,37 @@ throw new UnsupportedOperationException();
//3 bek56v2skz6jfvw4uggy2h5w3
// int PickBranch(Rect_t * r, Node_t * n)
-public static Object PickBranch(Object... arg) {
-UNSUPPORTED("efxc8619milx7pkmu113b8cl0"); // int PickBranch(Rect_t * r, Node_t * n)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("4rx3my7ninlw252mkhq0t72v7"); // register Rect_t *rr=0;
-UNSUPPORTED("cu5ueogqdqm7ym79nlop077f9"); // register int i=0, flag=1, increase=0, bestIncr=0, area=0, bestArea=0;
-UNSUPPORTED("b5pkdhy36omd5ubfol2jsyr2z"); // int best=0;
-UNSUPPORTED("3lp95fcfxfbsb08w5umj6mjxb"); // assert(r && n);
-UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
-UNSUPPORTED("1ro7ykl3rxfkkcyghzozikkfc"); // if (n->branch[i].child) {
-UNSUPPORTED("4wt347mvef1i2kr5h5z9l0g8i"); // Rect_t rect;
-UNSUPPORTED("ak8qz4z2mipw1i6img1tvc3hk"); // rr = &n->branch[i].rect;
-UNSUPPORTED("d4pnse7tksvywt9f6rcaluv8e"); // area = RectArea(rr);
-UNSUPPORTED("4wsrjtivlov1p70rt8tn4dt9v"); // /* increase = RectArea(&CombineRect(r, rr)) - area; */
-UNSUPPORTED("8b9or9d0f959zrx6zrd0o9noj"); // rect = CombineRect(r, rr);
-UNSUPPORTED("a1p1sz58nzxnj53fxzzkut6cm"); // increase = RectArea(&rect) - area;
-UNSUPPORTED("6k6tiifs973t6iordeclfqygk"); // if (increase < bestIncr || flag) {
-UNSUPPORTED("93dpfupbht4p3y9bsui3n8km4"); // best = i;
-UNSUPPORTED("apb6b50as71d87ge91yfjwr33"); // bestArea = area;
-UNSUPPORTED("45tyhbogdetuq767acgw0cvyg"); // bestIncr = increase;
-UNSUPPORTED("6bejndin7u1ns7xicz114gqtn"); // flag = 0;
-UNSUPPORTED("1wqm4msrcepk5ixg5ab8polj7"); // } else if (increase == bestIncr && area < bestArea) {
-UNSUPPORTED("93dpfupbht4p3y9bsui3n8km4"); // best = i;
-UNSUPPORTED("apb6b50as71d87ge91yfjwr33"); // bestArea = area;
-UNSUPPORTED("45tyhbogdetuq767acgw0cvyg"); // bestIncr = increase;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("3kkxvbiqcsdmtjhhw3b2jcqcy"); // return best;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int PickBranch(ST_Rect_t r, ST_Node_t___ n) {
+ ENTERING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
+ try {
+ ST_Rect_t rr=null;
+ int i=0, flag=1, increase=0, bestIncr=0, area=0, bestArea=0;
+ int best=0;
+// assert(r && n);
+ for (i = 0; i < 64; i++) {
+ if (n.branch[i].child!=null) {
+ final ST_Rect_t rect = new ST_Rect_t();
+ rr = (ST_Rect_t) n.branch[i].rect;
+ area = RectArea((ST_Rect_t) rr);
+ /* increase = RectArea(&CombineRect(r, rr)) - area; */
+ rect.___(CombineRect((ST_Rect_t) r, rr));
+ increase = RectArea((ST_Rect_t) rect) - area;
+ if (increase < bestIncr || flag!=0) {
+ best = i;
+ bestArea = area;
+ bestIncr = increase;
+ flag = 0;
+ } else if (increase == bestIncr && area < bestArea) {
+ best = i;
+ bestArea = area;
+ bestIncr = increase;
+ }
+ }
+ }
+ return best;
+} finally {
+LEAVING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
+}
}
@@ -187,40 +197,40 @@ throw new UnsupportedOperationException();
//3 2njctcrpeff95ysmv9ji34x4s
// int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new)
-public static Object AddBranch(Object... arg) {
-UNSUPPORTED("abswgz0jexhhyl0we1x68i5gl"); // int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
-UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
-UNSUPPORTED("8irlja6ar7hjh8mel91hltz17"); // if (n->count < 64) { /* split won't be necessary */
-UNSUPPORTED("8vlryher8oaw4h715yfzs4h0"); // for (i = 0; i < 64; i++) { /* find empty branch */
-UNSUPPORTED("3eaeba8b8yt8gq9074wtep0e0"); // if (n->branch[i].child == NULL) {
-UNSUPPORTED("9newc1m7r062crcakg2dn00kp"); // n->branch[i] = *b;
-UNSUPPORTED("b4orzj362grzvud5mj73w1cb1"); // n->count++;
-UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("2gjzrafpfll8afj90mhedcnnq"); // assert(i < 64);
-UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
-UNSUPPORTED("dhd7sfbis7klukcyf8rg2skvp"); // if (rtp->StatFlag) {
+public static int AddBranch(ST_RTree rtp, ST_Branch_t b, ST_Node_t___ n, ST_Node_t___ new_[]) {
+ENTERING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
+try {
+ int i;
+// assert(b);
+// assert(n);
+ if (n.count < 64) { /* split won't be necessary */
+ for (i = 0; i < 64; i++) { /* find empty branch */
+ if (n.branch[i].child == null) {
+ n.branch[i].___(b.getStruct());
+ n.setInt("count", n.count+1);
+ break;
+ }
+}
+// assert(i < 64);
+ return 0;
+ } else {
+ if (rtp.StatFlag!=0) {
UNSUPPORTED("2y8kv6b3ysrr61q7tqn76rhhc"); // if (rtp->Deleting)
UNSUPPORTED("dn4oynmx9ugizzs5pkxiyptbi"); // rtp->DeTouchCount++;
UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("chipmsvc1hum7sbmvzrfmewz6"); // assert(new);
-UNSUPPORTED("91mdffv90jr6ypnu3u1bmc972"); // SplitNode(rtp, n, b, new);
-UNSUPPORTED("1t8cl7q3utcr23gvhtgc1cp0u"); // if (n->level == 0)
-UNSUPPORTED("b2cc70cq7gpras4l3rbz241at"); // rtp->LeafCount++;
-UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
+ }
+// assert(new);
+ SplitNode(rtp, n, b, new_);
+ if (n.level == 0)
+ rtp.setInt("LeafCount", rtp.LeafCount+1);
+ else
UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // rtp->NonLeafCount++;
-UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ return 1;
+ }
+} finally {
+LEAVING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
+}
}
@@ -228,16 +238,16 @@ throw new UnsupportedOperationException();
//3 eqzamflj58f43cflwns9cemnk
// void DisconBranch(Node_t * n, int i)
-public static Object DisconBranch(Object... arg) {
-UNSUPPORTED("1gbs5xw4y9htfbc5suxq1rdm4"); // void DisconBranch(Node_t * n, int i)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ays33wicr9a5qwu2dr9g8t1h2"); // assert(n && i >= 0 && i < 64);
-UNSUPPORTED("29zl8z52z6bh8yxdkmezbs82l"); // assert(n->branch[i].child);
-UNSUPPORTED("3rvakcl9f71ez4zya83f1vvgx"); // InitBranch(&(n->branch[i]));
-UNSUPPORTED("4a3m9b5jmmhd18oa8nzovalys"); // n->count--;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void DisconBranch(ST_Node_t___ n, int i) {
+ENTERING("eqzamflj58f43cflwns9cemnk","DisconBranch");
+try {
+// assert(n && i >= 0 && i < 64);
+// assert(n->branch[i].child);
+ InitBranch(n.branch[i]);
+ n.setInt("count", n.count-1);
+} finally {
+LEAVING("eqzamflj58f43cflwns9cemnk","DisconBranch");
+}
}
diff --git a/src/gen/lib/label/nrtmain__c.java b/src/gen/lib/label/nrtmain__c.java
index 8cd4559..6447fc2 100644
--- a/src/gen/lib/label/nrtmain__c.java
+++ b/src/gen/lib/label/nrtmain__c.java
@@ -47,9 +47,7 @@ package gen.lib.label;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class nrtmain__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -164,14 +162,14 @@ public class nrtmain__c {
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
diff --git a/src/gen/lib/label/rectangle__c.java b/src/gen/lib/label/rectangle__c.java
index 981e15f..5a6e5a8 100644
--- a/src/gen/lib/label/rectangle__c.java
+++ b/src/gen/lib/label/rectangle__c.java
@@ -44,7 +44,11 @@
*
*/
package gen.lib.label;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
+import h.ST_Rect_t;
public class rectangle__c {
//1 9k44uhd5foylaeoekf3llonjq
@@ -147,15 +151,15 @@ public class rectangle__c {
//3 1wtvfzwbzj03e6w5rw4k7qdax
// void InitRect(Rect_t * r)
-public static Object InitRect(Object... arg) {
-UNSUPPORTED("bfynnbut17s29886tfi4hmp71"); // void InitRect(Rect_t * r)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("6v26zqmzay64h92bxd4qt6qgs"); // for (i = 0; i < 2*2; i++)
-UNSUPPORTED("d3uknh6sy0xxecd62dbcemd5p"); // r->boundary[i] = 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void InitRect(ST_Rect_t r) {
+ENTERING("1wtvfzwbzj03e6w5rw4k7qdax","InitRect");
+try {
+ int i;
+ for (i = 0; i < 2*2; i++)
+ r.boundary[i]=0;
+} finally {
+LEAVING("1wtvfzwbzj03e6w5rw4k7qdax","InitRect");
+}
}
@@ -163,19 +167,21 @@ throw new UnsupportedOperationException();
//3 bvazxgli5q4yxvzl5kn1vjqpm
// Rect_t NullRect()
-public static Object NullRect(Object... arg) {
-UNSUPPORTED("7bfeg4qbgfa72qeao4zmwznat"); // Rect_t NullRect()
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9jotn4njsd13qx406m9otorg4"); // Rect_t r;
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("4cmj0swptez35tqafqf86bskl"); // r.boundary[0] = 1;
-UNSUPPORTED("6lzrqh8r1olplqcbtz1n5dow7"); // r.boundary[2] = -1;
-UNSUPPORTED("ol4wmdbmn9kjw3hpmp2gwavz"); // for (i = 1; i < 2; i++)
-UNSUPPORTED("9xr8ijrn07laqlacrzelzczxa"); // r.boundary[i] = r.boundary[i + 2] = 0;
-UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_Rect_t NullRect() {
+ENTERING("bvazxgli5q4yxvzl5kn1vjqpm","NullRect");
+try {
+ ST_Rect_t r = new ST_Rect_t();
+ int i;
+ r.boundary[0]=1;
+ r.boundary[2]=-1;
+ for (i = 1; i < 2; i++) {
+ r.boundary[i]=0;
+ r.boundary[i+2]=0;
+ }
+ return r;
+} finally {
+LEAVING("bvazxgli5q4yxvzl5kn1vjqpm","NullRect");
+}
}
@@ -183,30 +189,30 @@ throw new UnsupportedOperationException();
//3 1ijarur71gcahchxz8vqf69na
// unsigned int RectArea(Rect_t * r)
-public static Object RectArea(Object... arg) {
-UNSUPPORTED("dt9366zeifsgcei4onz0fdt4i"); // unsigned int RectArea(Rect_t * r)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9cyat6ft4tmgpumn70l9fwydy"); // register int i;
-UNSUPPORTED("eep6ne1fnwvxrzmao6aq2e80t"); // unsigned int area=1, a=1;
-UNSUPPORTED("bxtlpefe142w9pb81aa0gkkcj"); // assert(r);
-UNSUPPORTED("7xe9zz3f2fwhfptig6esqvb1t"); // if (((r)->boundary[0] > (r)->boundary[2])) return 0;
-UNSUPPORTED("9gsgfs2guis9c3c3oi57mxpq2"); // /*
-UNSUPPORTED("asaz8qrby7qugc5m3ylnjg6o7"); // * XXX add overflow checks
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("17o3f4aat9tkp17wsngm29nst"); // area = 1;
-UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
-UNSUPPORTED("6g0ik6vssf9px33quo2z9ferr"); // unsigned int b = r->boundary[i + 2] - r->boundary[i];
-UNSUPPORTED("7tqqzmxu3tsfxccs53evs54me"); // a *= b;
-UNSUPPORTED("3u7h4981b69nu4w80bhv3s4q"); // if( (a / b ) != area) {
+public static int RectArea(ST_Rect_t r) {
+ENTERING("1ijarur71gcahchxz8vqf69na","RectArea");
+try {
+ int i;
+ int area=1, a=1;
+// assert(r);
+ if (r.boundary[0] > r.boundary[2]) return 0;
+ /*
+ * XXX add overflow checks
+ */
+ area = 1;
+ for (i = 0; i < 2; i++) {
+ int b = r.boundary[i+2] - r.boundary[i];
+ a *= b;
+ if( (a / b ) != area) {
UNSUPPORTED("6qc59bm54jy4hv9gw8a50rk0u"); // agerr (AGERR, "label: area too large for rtree\n");
UNSUPPORTED("awx87c59fwl0w8r64jfd86jrd"); // return UINT_MAX;
-UNSUPPORTED("dquo3qofk56ds5xl95lhvcthf"); // }
-UNSUPPORTED("b34qh5cr4ie1y00nbl91sn2km"); // area = a;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("9ww3ox2wqjgbtsin4e26qgoyx"); // return area;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ area = a;
+ }
+ return area;
+} finally {
+LEAVING("1ijarur71gcahchxz8vqf69na","RectArea");
+}
}
@@ -214,25 +220,25 @@ throw new UnsupportedOperationException();
//3 tgmhi1wshyhqky2pappb6w6w
// Rect_t CombineRect(Rect_t * r, Rect_t * rr)
-public static Object CombineRect(Object... arg) {
-UNSUPPORTED("18ebi8xfcz225jqpfk5vtp9hf"); // Rect_t CombineRect(Rect_t * r, Rect_t * rr)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7gcww32g3xx6yjb9m2tgq8f7c"); // register int i, j;
-UNSUPPORTED("ep1c21oj5vdbkci5nklq26u6d"); // Rect_t new;
-UNSUPPORTED("8woqwn01hzllzlrb8an6apviw"); // assert(r && rr);
-UNSUPPORTED("61el74qdlszr9b7htgajgnncw"); // if (((r)->boundary[0] > (r)->boundary[2]))
-UNSUPPORTED("26gbreijuodtzexgobqd73u1p"); // return *rr;
-UNSUPPORTED("9c5jzil5a7hm4bfzytn0e7aww"); // if (((rr)->boundary[0] > (rr)->boundary[2]))
-UNSUPPORTED("h0psmi4ydywx720mvhp33x5g"); // return *r;
-UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
-UNSUPPORTED("1p51ro3v4iw4nogctzk3y0bts"); // new.boundary[i] = MIN(r->boundary[i], rr->boundary[i]);
-UNSUPPORTED("2h0ee6s8hk7srb6xqmnfluf52"); // j = i + 2;
-UNSUPPORTED("3cljcok8kw06fphxnu0183g4"); // new.boundary[j] = MAX(r->boundary[j], rr->boundary[j]);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4b8pgvy3c1dhlanxwmafau4pt"); // return new;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_Rect_t CombineRect(ST_Rect_t r, ST_Rect_t rr) {
+ENTERING("tgmhi1wshyhqky2pappb6w6w","CombineRect");
+try {
+ int i, j;
+ ST_Rect_t new_ = new ST_Rect_t();
+ // assert(r && rr);
+ if (r.boundary[0] > r.boundary[2])
+ return (ST_Rect_t) rr.copy();
+ if (rr.boundary[0] > rr.boundary[2])
+ return (ST_Rect_t) r.copy();
+ for (i = 0; i < 2; i++) {
+ new_.boundary[i] = Math.min(r.boundary[i], rr.boundary[i]);
+ j = i + 2;
+ new_.boundary[j] = Math.max(r.boundary[j], rr.boundary[j]);
+ }
+ return new_;
+} finally {
+LEAVING("tgmhi1wshyhqky2pappb6w6w","CombineRect");
+}
}
@@ -240,21 +246,21 @@ throw new UnsupportedOperationException();
//3 9glce34jzknoqj98agg96k03o
// int Overlap(Rect_t * r, Rect_t * s)
-public static Object Overlap(Object... arg) {
-UNSUPPORTED("75f545jos6v3su84hbt728wxr"); // int Overlap(Rect_t * r, Rect_t * s)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7gcww32g3xx6yjb9m2tgq8f7c"); // register int i, j;
-UNSUPPORTED("3ilt6jfw7dcaebocva6xawiui"); // assert(r && s);
-UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
-UNSUPPORTED("71gqfx1xze9ccjzy9ids9x8cj"); // j = i + 2; /* index for high sides */
-UNSUPPORTED("b41yx5qm8jqsnyojyaztg6wy1"); // if (r->boundary[i] > s->boundary[j]
-UNSUPPORTED("cjb3lqf10yggej4b0uh9acc72"); // || s->boundary[i] > r->boundary[j])
-UNSUPPORTED("8tnlb2txucdutal7665h0v68g"); // return (0);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static boolean Overlap(ST_Rect_t r, ST_Rect_t s) {
+ENTERING("9glce34jzknoqj98agg96k03o","Overlap");
+try {
+ int i, j;
+// assert(r && s);
+ for (i = 0; i < 2; i++) {
+ j = i + 2; /* index for high sides */
+ if (r.boundary[i] > s.boundary[j]
+ || s.boundary[i] > r.boundary[j])
+ return false;
+ }
+ return (N(0));
+} finally {
+LEAVING("9glce34jzknoqj98agg96k03o","Overlap");
+}
}
diff --git a/src/gen/lib/label/split_q__c.java b/src/gen/lib/label/split_q__c.java
index 4e5b014..30f37cb 100644
--- a/src/gen/lib/label/split_q__c.java
+++ b/src/gen/lib/label/split_q__c.java
@@ -44,45 +44,61 @@
*
*/
package gen.lib.label;
+import static gen.lib.label.node__c.AddBranch;
+import static gen.lib.label.node__c.InitNode;
+import static gen.lib.label.node__c.RTreeNewNode;
+import static gen.lib.label.rectangle__c.CombineRect;
+import static gen.lib.label.rectangle__c.NullRect;
+import static gen.lib.label.rectangle__c.RectArea;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
+import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
+import h.Branch_t;
+import h.ST_Branch_t;
+import h.ST_Node_t___;
+import h.ST_PartitionVars;
+import h.ST_RTree;
+import h.ST_Rect_t;
public class split_q__c {
//3 6vl3snxd6k95gamfkwfsfdguc
// void SplitNode(RTree_t * rtp, Node_t * n, Branch_t * b, Node_t ** nn)
-public static Object SplitNode(Object... arg) {
-UNSUPPORTED("78ce6yisssjvu8419g3hps65l"); // void SplitNode(RTree_t * rtp, Node_t * n, Branch_t * b, Node_t ** nn)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ajyfxc076ll1tzroielljxa4s"); // register struct PartitionVars *p;
-UNSUPPORTED("8jufm5xh68khkqy7z1kcdmesw"); // register int level;
-UNSUPPORTED("7bskhxl3c4vhiobuvlm02c79c"); // int area;
-UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
-UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
-UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
+public static void SplitNode(ST_RTree rtp, ST_Node_t___ n, ST_Branch_t b, ST_Node_t___ nn[]) {
+ENTERING("6vl3snxd6k95gamfkwfsfdguc","SplitNode");
+try {
+ ST_PartitionVars p;
+ int level;
+ int area;
+// assert(n);
+// assert(b);
+ if (rtp.StatFlag!=0) {
UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
UNSUPPORTED("4g80zdlbvunm838x8g3ic9tex"); // rtp->DeSplitCount++;
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("2cjo6wz1rmxfm5k7u7rw5dqpj"); // rtp->InSplitCount++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8396srmzb1jm8lij0ngslpcrf"); // /* load all the branches into a buffer, initialize old node */
-UNSUPPORTED("21fuexra37tdi6sx7rtjdg1nj"); // level = n->level;
-UNSUPPORTED("bqz4krdoll1zhnuqj6zgotbcu"); // GetBranches(rtp, n, b);
-UNSUPPORTED("hdjjn3pouo1k1eq8y4x0nmxs"); // /* find partition */
-UNSUPPORTED("prf503ssj57ewtg2w9ypvt6"); // p = &rtp->split.Partitions[0];
-UNSUPPORTED("e5s838qmpxfzesnb90fmga2th"); // MethodZero(rtp);
-UNSUPPORTED("e2qxl0u7yon3spy2kr56ah1lx"); // area = RectArea(&p->cover[0]) + RectArea(&p->cover[1]);
-UNSUPPORTED("bqvd9kyv5qlcddypjudg6lwpl"); // /* record how good the split was for statistics */
-UNSUPPORTED("9isnpzrwseyh76rz7fawgkdyw"); // if (rtp->StatFlag && !rtp->Deleting && area)
+ }
+ /* load all the branches into a buffer, initialize old node */
+ level = n.level;
+ GetBranches(rtp, n, b);
+ /* find partition */
+ p = rtp.split.Partitions[0];
+ MethodZero(rtp);
+ area = RectArea((ST_Rect_t)p.cover[0]) + RectArea((ST_Rect_t)p.cover[1]);
+ /* record how good the split was for statistics */
+ if (rtp.StatFlag!=0 && N(rtp.Deleting) && area!=0)
UNSUPPORTED("z7xk6s3hzi3qcoiq2exj9hpv"); // rtp->SplitMeritSum += (float) rtp->split.CoverSplitArea / area;
-UNSUPPORTED("dytz8fm640zs5ercfjtork8u2"); // /* put branches from buffer into 2 nodes according to chosen partition */
-UNSUPPORTED("3vka4yfkd2kilsogvopxmh6ry"); // *nn = RTreeNewNode(rtp);
-UNSUPPORTED("3wybhajryp9yjj3lxvzuiv7p9"); // (*nn)->level = n->level = level;
-UNSUPPORTED("izrbnvm6p45dy2xfr3265jdf"); // LoadNodes(rtp, n, *nn, p);
-UNSUPPORTED("e0lxlkm80cy0577wy8jdxbhq9"); // assert(n->count + (*nn)->count == 64 + 1);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ /* put branches from buffer into 2 nodes according to chosen partition */
+ nn[0] = RTreeNewNode(rtp);
+ n.setInt("level", level);
+ nn[0].setInt("level", level);
+ LoadNodes(rtp, n, nn[0], p);
+// assert(n->count + (*nn)->count == 64 + 1);
+} finally {
+LEAVING("6vl3snxd6k95gamfkwfsfdguc","SplitNode");
+}
}
@@ -90,29 +106,30 @@ throw new UnsupportedOperationException();
//3 al7lyin008m7kvrvuxhcuvn61
// static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
-public static Object GetBranches(Object... arg) {
-UNSUPPORTED("378qaodt9k6ytly4svwl41z9w"); // static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
-UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
-UNSUPPORTED("4oznkldmd6dyb0i9hwec78vcs"); // /* load the branch buffer */
-UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
-UNSUPPORTED("8q6h71l7igid38ccu2eiu2u59"); // assert(n->branch[i].child); /* node should have every entry full */
-UNSUPPORTED("gimqiz18hbjhs9folzw2kmv9"); // rtp->split.BranchBuf[i] = n->branch[i];
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("e53m9mpp58nv3640vo2p82rdv"); // rtp->split.BranchBuf[64] = *b;
-UNSUPPORTED("277onaphbigykl17b8k9ucsw3"); // /* calculate rect containing all in the set */
-UNSUPPORTED("ea4y9kg2yx11whdarwr9up60y"); // rtp->split.CoverSplit = rtp->split.BranchBuf[0].rect;
-UNSUPPORTED("27yzy7ezx5w65cas3232s6j4m"); // for (i = 1; i < 64 + 1; i++) {
-UNSUPPORTED("4qq8r3ecwl603g3xs97658ebu"); // rtp->split.CoverSplit = CombineRect(&rtp->split.CoverSplit,
-UNSUPPORTED("8fgchf6ahna7tcxprht01sodq"); // &rtp->split.BranchBuf[i].rect);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8kobdqnp7t9xhtshqkemby6us"); // rtp->split.CoverSplitArea = RectArea(&rtp->split.CoverSplit);
-UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void GetBranches(ST_RTree rtp, ST_Node_t___ n, ST_Branch_t b) {
+ENTERING("al7lyin008m7kvrvuxhcuvn61","GetBranches");
+try {
+ int i;
+// assert(n);
+// assert(b);
+ /* load the branch buffer */
+ for (i = 0; i < 64; i++) {
+ // assert(n->branch[i].child); /* node should have every entry full */
+ rtp.split.BranchBuf[i].___(n.branch[i]);
+ }
+ rtp.split.BranchBuf[64].___(b);
+ /* calculate rect containing all in the set */
+ rtp.split.CoverSplit.___(rtp.split.BranchBuf[0].rect);
+ for (i = 1; i < 64 + 1; i++) {
+ rtp.split.setStruct("CoverSplit",
+ CombineRect((ST_Rect_t)rtp.split.CoverSplit,
+ (ST_Rect_t)rtp.split.BranchBuf[i].castTo(ST_Rect_t.class)));
+ }
+ rtp.split.setInt("CoverSplitArea", RectArea((ST_Rect_t)rtp.split.CoverSplit));
+ InitNode(n);
+} finally {
+LEAVING("al7lyin008m7kvrvuxhcuvn61","GetBranches");
+}
}
@@ -120,63 +137,63 @@ throw new UnsupportedOperationException();
//3 4woz5xy4gjlahoj7no3ljxmex
// static void MethodZero(RTree_t * rtp)
-public static Object MethodZero(Object... arg) {
-UNSUPPORTED("4skckzef98x4fz6mws7s1ya15"); // static void MethodZero(RTree_t * rtp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("cdtuwprcw1d3bn91v9sde844l"); // register Rect_t *r;
-UNSUPPORTED("ackphjde797dk6rshtiyv1ydx"); // register int i, growth0, growth1, diff, biggestDiff;
-UNSUPPORTED("5lh1z9jfdefgm50i9fgjjzf8q"); // register int group, chosen, betterGroup;
-UNSUPPORTED("6y4x18eeg7eay10tbawh6myhr"); // InitPVars(rtp);
-UNSUPPORTED("5tz02egfuze5n9nquye65i9lr"); // PickSeeds(rtp);
-UNSUPPORTED("59gdg3tgr5tyx6gkffgutcpn7"); // while (rtp->split.Partitions[0].count[0] +
-UNSUPPORTED("7e0o94342ckw0syu4j0m8vyml"); // rtp->split.Partitions[0].count[1] < 64 + 1 &&
-UNSUPPORTED("3kmgnkrx7ku1nnb7vprgwnfvt"); // rtp->split.Partitions[0].count[0] < 64 + 1 - rtp->MinFill
-UNSUPPORTED("9efzei446ga5t6kd5zstv3mat"); // && rtp->split.Partitions[0].count[1] <
-UNSUPPORTED("cxlhyya4bw33nn0kxhwtgj7ni"); // 64 + 1 - rtp->MinFill) {
-UNSUPPORTED("1e60en5izveud5k83xw9vkxwy"); // biggestDiff = -1;
-UNSUPPORTED("2x1nx9nsne4x3ygmcywl1m3og"); // for (i = 0; i < 64 + 1; i++) {
-UNSUPPORTED("4c65v1kbz8jvl3tmy8gyj66qi"); // if (!rtp->split.Partitions[0].taken[i]) {
-UNSUPPORTED("6qli7mcgtgb1ne6pl33r3okkj"); // Rect_t rect;
-UNSUPPORTED("9tqgad4ybio0vj8j5qgol8sqe"); // r = &rtp->split.BranchBuf[i].rect;
-UNSUPPORTED("9xitbkq1bfy3lqwrboyzd3wk0"); // /* growth0 = RectArea(&CombineRect(r,
-UNSUPPORTED("bqznmsnmx0j2z1sfi1s0rtx0t"); // &rtp->split.Partitions[0].cover[0])) -
-UNSUPPORTED("6tdjjnpjjde476wvn4ez9gy0h"); // rtp->split.Partitions[0].area[0];
-UNSUPPORTED("edw1ss2r31mqgsvca2gowi52v"); // */
-UNSUPPORTED("b2awl1bpq2krcq7yjahwzc77s"); // /* growth1 = RectArea(&CombineRect(r,
-UNSUPPORTED("bkjabgaskndtlequuc8ahat39"); // &rtp->split.Partitions[0].cover[1])) -
-UNSUPPORTED("567lkxsqa5bu7d4nibvr4tpe1"); // rtp->split.Partitions[0].area[1];
-UNSUPPORTED("edw1ss2r31mqgsvca2gowi52v"); // */
-UNSUPPORTED("5046nw6shbhk2m5dtt3itg1qf"); // rect = CombineRect(r, &rtp->split.Partitions[0].cover[0]);
-UNSUPPORTED("nc6om9tl3e7nixzkvrf0etup"); // growth0 =
-UNSUPPORTED("ed7mreakvazgougj1ls6ioj33"); // RectArea(&rect) - rtp->split.Partitions[0].area[0];
-UNSUPPORTED("eh4bst7jlzxrquw8wrweiosfn"); // rect = CombineRect(r, &rtp->split.Partitions[0].cover[1]);
-UNSUPPORTED("9jwgrynpgu0d39tmz3uvb0f5o"); // growth1 =
-UNSUPPORTED("i0duy3nph3k4msny0ibs81ph"); // RectArea(&rect) - rtp->split.Partitions[0].area[1];
-UNSUPPORTED("b9ktilnf5m1wc70yqwf4mdq9e"); // diff = growth1 - growth0;
-UNSUPPORTED("81ij2fgplw64rbpouql9na7a1"); // if (diff >= 0)
-UNSUPPORTED("b49dtkykbufvv3lk5trobmbw5"); // group = 0;
-UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
-UNSUPPORTED("7sge254zb30sgd45k1os7fw3y"); // group = 1;
-UNSUPPORTED("adlw9es1w2znqr4h71hd9k1j8"); // diff = -diff;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("7qd8i0mpxxu4wueggpmmx9704"); // if (diff > biggestDiff) {
-UNSUPPORTED("cc2jxkxp6wf0y4a6er7iildb4"); // biggestDiff = diff;
-UNSUPPORTED("4gq0kbfwv4ls5gbqaxqusd6k"); // chosen = i;
-UNSUPPORTED("dwalhyg0t90zo8gdq7pstef8a"); // betterGroup = group;
-UNSUPPORTED("71bce3js2b0lpi50misxff7uy"); // } else if (diff == biggestDiff &&
-UNSUPPORTED("fjvt87on1mhn9dyt0b9vp3jg"); // rtp->split.Partitions[0].count[group] <
-UNSUPPORTED("1v2g0u9t6ou9xeajwcl3u2nr4"); // rtp->split.Partitions[0].count[betterGroup]) {
-UNSUPPORTED("4gq0kbfwv4ls5gbqaxqusd6k"); // chosen = i;
-UNSUPPORTED("dwalhyg0t90zo8gdq7pstef8a"); // betterGroup = group;
-UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("967zxvkt7liyzfgjy03xrpwf2"); // Classify(rtp, chosen, betterGroup);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("15gmufvsx34eo7l2gxmf9sjph"); // /* if one group too full, put remaining rects in the other */
-UNSUPPORTED("bz0f1s1b90c4mqpxr24oamywd"); // if (rtp->split.Partitions[0].count[0] +
-UNSUPPORTED("d6a1dolgcf9n4go7fsk616dlz"); // rtp->split.Partitions[0].count[1] < 64 + 1) {
-UNSUPPORTED("9xvua0lzynx3u05pjeoibo9tt"); // group = 0;
+public static void MethodZero(ST_RTree rtp) {
+ENTERING("4woz5xy4gjlahoj7no3ljxmex","MethodZero");
+try {
+ ST_Rect_t r;
+ int i, growth0, growth1, diff, biggestDiff;
+ int group, chosen=0, betterGroup=0;
+ InitPVars(rtp);
+ PickSeeds(rtp);
+ while (rtp.split.Partitions[0].count[0] +
+ rtp.split.Partitions[0].count[1] < 64 + 1 &&
+ rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.MinFill
+ && rtp.split.Partitions[0].count[1] <
+ 64 + 1 - rtp.MinFill) {
+ biggestDiff = -1;
+ for (i = 0; i < 64 + 1; i++) {
+ if (N(rtp.split.Partitions[0].taken[i])) {
+ final ST_Rect_t rect = new ST_Rect_t();
+ r = (ST_Rect_t) rtp.split.BranchBuf[i].castTo(ST_Rect_t.class);
+ /* growth0 = RectArea(&CombineRect(r,
+ &rtp->split.Partitions[0].cover[0])) -
+ rtp->split.Partitions[0].area[0];
+ */
+ /* growth1 = RectArea(&CombineRect(r,
+ &rtp->split.Partitions[0].cover[1])) -
+ rtp->split.Partitions[0].area[1];
+ */
+ rect.___(CombineRect(r, (ST_Rect_t) rtp.split.Partitions[0].cover[0]));
+ growth0 =
+ RectArea((ST_Rect_t)rect) - rtp.split.Partitions[0].area[0];
+ rect.___(CombineRect(r, (ST_Rect_t) rtp.split.Partitions[0].cover[1]));
+ growth1 =
+ RectArea((ST_Rect_t)rect) - rtp.split.Partitions[0].area[1];
+ diff = growth1 - growth0;
+ if (diff >= 0)
+ group = 0;
+ else {
+ group = 1;
+ diff = -diff;
+ }
+ if (diff > biggestDiff) {
+ biggestDiff = diff;
+ chosen = i;
+ betterGroup = group;
+ } else if (diff == biggestDiff &&
+ rtp.split.Partitions[0].count[group] <
+ rtp.split.Partitions[0].count[betterGroup]) {
+ chosen = i;
+ betterGroup = group;
+ }
+ }
+ }
+ Classify(rtp, chosen, betterGroup);
+ }
+ /* if one group too full, put remaining rects in the other */
+ if (rtp.split.Partitions[0].count[0] +
+ rtp.split.Partitions[0].count[1] < 64 + 1) {
+ group = 0;
UNSUPPORTED("4edp65b21liyii0fj1ikco7o0"); // if (rtp->split.Partitions[0].count[0] >=
UNSUPPORTED("20lpsuiyepr2ujozaf6gp4cc"); // 64 + 1 - rtp->MinFill)
UNSUPPORTED("9qtt6i40h8vtjp2cvqyb8ycaz"); // group = 1;
@@ -184,14 +201,14 @@ UNSUPPORTED("2x1nx9nsne4x3ygmcywl1m3og"); // for (i = 0; i < 64 + 1; i++) {
UNSUPPORTED("jdepsnmrs3ghh78ql301sfvu"); // if (!rtp->split.Partitions[0].taken[i])
UNSUPPORTED("gqfhorilvtlogp6f2ozx5akf"); // Classify(rtp, i, group);
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("5r5xug64f1z60bggncz1pne3f"); // assert(rtp->split.Partitions[0].count[0] +
-UNSUPPORTED("1whhfnenwvqqzfd4kkosc09z"); // rtp->split.Partitions[0].count[1] == 64 + 1);
-UNSUPPORTED("c4k8arobh90w9e9sk4s8zx6a5"); // assert(rtp->split.Partitions[0].count[0] >= rtp->MinFill
-UNSUPPORTED("2lio9rd6ztigudntp9gohkge9"); // && rtp->split.Partitions[0].count[1] >= rtp->MinFill);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ // assert(rtp->split.Partitions[0].count[0] +
+ // rtp->split.Partitions[0].count[1] == 64 + 1);
+ // assert(rtp->split.Partitions[0].count[0] >= rtp->MinFill
+ // && rtp->split.Partitions[0].count[1] >= rtp->MinFill);
+} finally {
+LEAVING("4woz5xy4gjlahoj7no3ljxmex","MethodZero");
+}
}
@@ -199,38 +216,39 @@ throw new UnsupportedOperationException();
//3 8rui4cun4tvq5xy6ke6r3p55e
// static void PickSeeds(RTree_t * rtp)
-public static Object PickSeeds(Object... arg) {
-UNSUPPORTED("4lrul9ern8gc76sno14wqgtne"); // static void PickSeeds(RTree_t * rtp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("vshrs98l6la9fwui89y20ji3"); // register int i, j;
-UNSUPPORTED("cz82o6423cha33x8v31g7lhso"); // unsigned int waste, worst;
-UNSUPPORTED("8glrb479bftuwm5m4w4eqy3id"); // int seed0, seed1;
-UNSUPPORTED("em2tlievesov4lr9nkas30k2p"); // unsigned int area[64 + 1];
-UNSUPPORTED("1rer9hfsfz4to936cdqosy26h"); // for (i = 0; i < 64 + 1; i++)
-UNSUPPORTED("2f701q18yaasbx3zewp4pc3i3"); // area[i] = RectArea(&rtp->split.BranchBuf[i].rect);
-UNSUPPORTED("5aj4ab555713s4o7hsg305y2c"); // //worst = -rtp->split.CoverSplitArea - 1;
-UNSUPPORTED("b2ayju4kcpmgel4or2zbz0dyr"); // worst=0;
-UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
-UNSUPPORTED("dw3tar5d5xv4kxcnkcevzm9iw"); // for (j = i + 1; j < 64 + 1; j++) {
-UNSUPPORTED("4wt347mvef1i2kr5h5z9l0g8i"); // Rect_t rect;
-UNSUPPORTED("d5jmdkycgoaq3d846xryh0wtz"); // /* waste = RectArea(&CombineRect(&rtp->split.BranchBuf[i].rect,
-UNSUPPORTED("1d3xkv54rko81ltklwjdtrmj1"); // // &rtp->split.BranchBuf[j].rect)) - area[i] - area[j];
-UNSUPPORTED("20m1lc1moer8x00tx9ceto0iw"); // */
-UNSUPPORTED("8vf1f6q13lthe8sasqcvpatr3"); // rect = CombineRect(&rtp->split.BranchBuf[i].rect,
-UNSUPPORTED("5wjck74u7gv0xbv7a01rp3eia"); // &rtp->split.BranchBuf[j].rect);
-UNSUPPORTED("bzjsjoq354eduv4f511rmjmtk"); // waste = RectArea(&rect) - area[i] - area[j];
-UNSUPPORTED("7g3m0cplrcsffy7f3iqsrwztc"); // if (waste > worst) {
-UNSUPPORTED("1irem1gz77fx5eym990j8l9v5"); // worst = waste;
-UNSUPPORTED("29q6pzycm1gb2gukvicejmmks"); // seed0 = i;
-UNSUPPORTED("11wyv1lzvxs0lyd59xqrp77lb"); // seed1 = j;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c1o6jr885s70ej9txo4zjtk3k"); // Classify(rtp, seed0, 0);
-UNSUPPORTED("bf0ov5eigcyw1mhs6rlnwt7g"); // Classify(rtp, seed1, 1);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void PickSeeds(ST_RTree rtp) {
+ENTERING("8rui4cun4tvq5xy6ke6r3p55e","PickSeeds");
+try {
+ int i, j;
+ int waste, worst;
+ int seed0=0, seed1=0;
+ int area[] = new int[64 + 1];
+ for (i = 0; i < 64 + 1; i++)
+ area[i] = RectArea((ST_Rect_t) rtp.split.BranchBuf[i].rect);
+ //worst = -rtp->split.CoverSplitArea - 1;
+ worst=0;
+ for (i = 0; i < 64; i++) {
+ for (j = i + 1; j < 64 + 1; j++) {
+ final ST_Rect_t rect = new ST_Rect_t();
+ /* waste = RectArea(&CombineRect(&rtp->split.BranchBuf[i].rect,
+ &rtp->split.BranchBuf[j].rect)) - area[i] - area[j];
+ */
+ rect.___(
+ CombineRect((ST_Rect_t)rtp.split.BranchBuf[i].rect,
+ (ST_Rect_t)rtp.split.BranchBuf[j].rect));
+ waste = RectArea((ST_Rect_t)rect) - area[i] - area[j];
+ if (waste > worst) {
+ worst = waste;
+ seed0 = i;
+ seed1 = j;
+ }
+ }
+ }
+ Classify(rtp, seed0, 0);
+ Classify(rtp, seed1, 1);
+} finally {
+LEAVING("8rui4cun4tvq5xy6ke6r3p55e","PickSeeds");
+}
}
@@ -238,25 +256,27 @@ throw new UnsupportedOperationException();
//3 4qyy2dpbkziuubssvfwb8u1sh
// static void Classify(RTree_t * rtp, int i, int group)
-public static Object Classify(Object... arg) {
-UNSUPPORTED("8ml9djski25i25i59wyn3dld9"); // static void Classify(RTree_t * rtp, int i, int group)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("2ulo1dpl3kexdah5mcmnqpzdl"); // assert(!rtp->split.Partitions[0].taken[i]);
-UNSUPPORTED("i4edl48bp8pljcmtxd1rep7a"); // rtp->split.Partitions[0].partition[i] = group;
-UNSUPPORTED("ackdd63x1sev2rjvlsh0xgqbo"); // rtp->split.Partitions[0].taken[i] = (!(0));
-UNSUPPORTED("7bethw7ebtjrhmrrq3004xvhh"); // if (rtp->split.Partitions[0].count[group] == 0)
-UNSUPPORTED("cyhkvve52l3mzao5x0u5df13f"); // rtp->split.Partitions[0].cover[group] =
-UNSUPPORTED("9mprl7dpvobrbs232soqoyv62"); // rtp->split.BranchBuf[i].rect;
-UNSUPPORTED("div10atae09n36x269sl208r1"); // else
-UNSUPPORTED("cyhkvve52l3mzao5x0u5df13f"); // rtp->split.Partitions[0].cover[group] =
-UNSUPPORTED("7ez406d998w0vpfm3e5tbc0qq"); // CombineRect(&rtp->split.BranchBuf[i].rect,
-UNSUPPORTED("e0r4nqeeu1jmir6akus7bjggm"); // &rtp->split.Partitions[0].cover[group]);
-UNSUPPORTED("3n9txb7nb3kh2v0bsy0fufx1e"); // rtp->split.Partitions[0].area[group] =
-UNSUPPORTED("anowu5wmi1sw0e8v669a1obek"); // RectArea(&rtp->split.Partitions[0].cover[group]);
-UNSUPPORTED("d8ahf9tcusfmm5zeecg8pmdxb"); // rtp->split.Partitions[0].count[group]++;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void Classify(ST_RTree rtp, int i, int group) {
+ENTERING("4qyy2dpbkziuubssvfwb8u1sh","Classify");
+try {
+// assert(!rtp->split.Partitions[0].taken[i]);
+ rtp.split.Partitions[0].partition[i]=group;
+ rtp.split.Partitions[0].taken[i]=1;
+ if (rtp.split.Partitions[0].count[group] == 0)
+ rtp.split.Partitions[0].cover[group].___(
+ rtp.split.BranchBuf[i].rect);
+ else
+ rtp.split.Partitions[0].cover[group].___(
+ CombineRect((ST_Rect_t)rtp.split.BranchBuf[i].rect,
+ (ST_Rect_t)rtp.split.Partitions[0].cover[group]));
+ rtp.split.Partitions[0].area[group]=
+ RectArea((ST_Rect_t)rtp.split.Partitions[0].cover[group]);
+
+ rtp.split.Partitions[0].count[group]=
+ rtp.split.Partitions[0].count[group]+1;
+} finally {
+LEAVING("4qyy2dpbkziuubssvfwb8u1sh","Classify");
+}
}
@@ -264,25 +284,24 @@ throw new UnsupportedOperationException();
//3 ay7l4setwyl3hbx4o2jpa7vyz
// static void LoadNodes(RTree_t * rtp, Node_t * n, Node_t * q, struct PartitionVars *p)
-public static Object LoadNodes(Object... arg) {
-UNSUPPORTED("d0dvfornj5165j53js6eyidii"); // static void LoadNodes(RTree_t * rtp, Node_t * n, Node_t * q,
-UNSUPPORTED("an9dlrefy1hbusq999x8s9qgf"); // struct PartitionVars *p)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
-UNSUPPORTED("30uxqb850wr1s0f0jg8uipd4m"); // assert(q);
-UNSUPPORTED("eh686hxootmu11yk2foc2tmr2"); // assert(p);
-UNSUPPORTED("83olszqrugs1dppzl6flgshr5"); // for (i = 0; i < 64 + 1; i++) {
-UNSUPPORTED("46lk8hxsutpzodwl5udrq4tik"); // assert(rtp->split.Partitions[0].partition[i] == 0 ||
-UNSUPPORTED("8jebrifw0oq30vs4i2wf1cbse"); // rtp->split.Partitions[0].partition[i] == 1);
-UNSUPPORTED("56sxhs1suv0k6iod6sl1w72dw"); // if (rtp->split.Partitions[0].partition[i] == 0)
-UNSUPPORTED("cwda9vt3f43bi23igyzgossds"); // AddBranch(rtp, &rtp->split.BranchBuf[i], n, (void *)0);
-UNSUPPORTED("9m8w97hthfczabpgdcm7xah33"); // else if (rtp->split.Partitions[0].partition[i] == 1)
-UNSUPPORTED("2f02d8m6p439gevwt7mxtyo4p"); // AddBranch(rtp, &rtp->split.BranchBuf[i], q, (void *)0);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void LoadNodes(ST_RTree rtp, ST_Node_t___ n, ST_Node_t___ q, ST_PartitionVars p) {
+ENTERING("ay7l4setwyl3hbx4o2jpa7vyz","LoadNodes");
+try {
+ int i;
+// assert(n);
+// assert(q);
+// assert(p);
+ for (i = 0; i < 64 + 1; i++) {
+// assert(rtp->split.Partitions[0].partition[i] == 0 ||
+// rtp->split.Partitions[0].partition[i] == 1);
+ if (rtp.split.Partitions[0].partition[i] == 0)
+ AddBranch(rtp, (ST_Branch_t)rtp.split.BranchBuf[i].castTo(Branch_t.class), n, null);
+ else if (rtp.split.Partitions[0].partition[i] == 1)
+ AddBranch(rtp, (ST_Branch_t)rtp.split.BranchBuf[i].castTo(Branch_t.class), q, null);
+ }
+} finally {
+LEAVING("ay7l4setwyl3hbx4o2jpa7vyz","LoadNodes");
+}
}
@@ -290,23 +309,23 @@ throw new UnsupportedOperationException();
//3 dvgjc83sogjhzf5kxpir405rh
// static void InitPVars(RTree_t * rtp)
-public static Object InitPVars(Object... arg) {
-UNSUPPORTED("18v3kgq3ud3q6c0nu07xyv8wa"); // static void InitPVars(RTree_t * rtp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
-UNSUPPORTED("2yvv0x8uir74h718l313i7it6"); // rtp->split.Partitions[0].count[0] = rtp->split.Partitions[0].count[1] =
-UNSUPPORTED("556sry61ttzbp13quuzhes74v"); // 0;
-UNSUPPORTED("bvhvtlpo10lxy8rquegyfg5jb"); // rtp->split.Partitions[0].cover[0] = rtp->split.Partitions[0].cover[1] =
-UNSUPPORTED("5bf9thav82syw0gzxp8b9p5ou"); // NullRect();
-UNSUPPORTED("8avyuhj51jxnpeujd7fmgcgtq"); // rtp->split.Partitions[0].area[0] = rtp->split.Partitions[0].area[1] =
-UNSUPPORTED("556sry61ttzbp13quuzhes74v"); // 0;
-UNSUPPORTED("83olszqrugs1dppzl6flgshr5"); // for (i = 0; i < 64 + 1; i++) {
-UNSUPPORTED("5dttrbxrjqa1omiz2oovpe18k"); // rtp->split.Partitions[0].taken[i] = (0);
-UNSUPPORTED("324vwwpg2hf07ejcj9w02evkm"); // rtp->split.Partitions[0].partition[i] = -1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void InitPVars(ST_RTree rtp) {
+ENTERING("dvgjc83sogjhzf5kxpir405rh","InitPVars");
+ int i;
+ rtp.split.Partitions[0].count[0]=0;
+ rtp.split.Partitions[0].count[1]=0;
+ rtp.split.Partitions[0].cover[0].___(NullRect());
+ rtp.split.Partitions[0].cover[1].___(NullRect());
+ rtp.split.Partitions[0].area[0]=0;
+ rtp.split.Partitions[0].area[1]=0;
+ for (i = 0; i < 64 + 1; i++) {
+ rtp.split.Partitions[0].taken[i]=0;
+ rtp.split.Partitions[0].partition[i]=-1;
+ }
+try {
+} finally {
+LEAVING("dvgjc83sogjhzf5kxpir405rh","InitPVars");
+}
}
diff --git a/src/gen/lib/label/xlabels__c.java b/src/gen/lib/label/xlabels__c.java
index 8cb299f..8f48110 100644
--- a/src/gen/lib/label/xlabels__c.java
+++ b/src/gen/lib/label/xlabels__c.java
@@ -44,20 +44,35 @@
*
*/
package gen.lib.label;
+import static gen.lib.cdt.dtclose__c.dtclose;
import static gen.lib.cdt.dtopen__c.dtopen;
-import static gen.lib.common.memory__c.zmalloc;
+import static gen.lib.label.index__c.RTreeClose;
+import static gen.lib.label.index__c.RTreeInsert;
+import static gen.lib.label.index__c.RTreeLeafListFree;
import static gen.lib.label.index__c.RTreeOpen;
-import static smetana.core.JUtils.sizeof;
+import static gen.lib.label.index__c.RTreeSearch;
+import static smetana.core.JUtils.EQ;
+import static smetana.core.JUtilsDebug.ENTERING;
+import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.BestPos_t;
-import h.XLabels_t;
-import h._dt_s;
-import h._dtdisc_s;
-import h.label_params_t;
+import h.ST_BestPos_t;
+import h.ST_HDict_t;
+import h.ST_LeafList_t;
+import h.ST_Node_t___;
+import h.ST_RTree;
+import h.ST_Rect_t;
+import h.ST_XLabels_t;
+import h.ST_dt_s;
+import h.ST_dtdisc_s;
+import h.ST_label_params_t;
+import h.ST_object_t;
+import h.ST_point;
+import h.ST_pointf;
+import h.ST_xlabel_t;
+import smetana.core.Memory;
import smetana.core.Z;
import smetana.core.__ptr__;
-
public class xlabels__c {
//1 9k44uhd5foylaeoekf3llonjq
// extern Dtmethod_t* Dtset
@@ -135,13 +150,15 @@ public class xlabels__c {
//3 5p3ac8qk4gnne5hj1dc21ysi
// static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
-public static int icompare(_dt_s dt, __ptr__ v1, __ptr__ v2, _dtdisc_s disc) {
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ehks25fxahyjbjd4lm6ryh9su"); // int k1 = *((int *) v1), k2 = *((int *) v2);
-UNSUPPORTED("6in30ubiocmaih693f0arymgc"); // return k1 - k2;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int icompare(ST_dt_s dt, Object v1, Object v2, ST_dtdisc_s disc) {
+ENTERING("5p3ac8qk4gnne5hj1dc21ysi","icompare");
+try {
+ Integer k1 = (Integer) v1;
+ Integer k2 = (Integer) v2;
+ return k1 - k2;
+} finally {
+LEAVING("5p3ac8qk4gnne5hj1dc21ysi","icompare");
+}
}
@@ -149,38 +166,41 @@ throw new UnsupportedOperationException();
//3 88mbfm305igsr7cew5qx6yldp
// static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
-public static XLabels_t xlnew(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
-__ptr__ xlp;
-xlp = zmalloc(sizeof(XLabels_t.class));
+public static ST_XLabels_t xlnew(ST_object_t.Array objs, int n_objs, ST_xlabel_t.Array lbls, int n_lbls, ST_label_params_t params) {
+ENTERING("88mbfm305igsr7cew5qx6yldp","xlnew");
+try {
+ST_XLabels_t xlp;
+xlp = new ST_XLabels_t();
/* used to load the rtree in hilbert space filling curve order */
-xlp.setPtr("hdx", dtopen(Z.z().Hdisc.amp(), Z.z().Dtobag));
-if (N(xlp.getPtr("hdx"))) {
+xlp.setPtr("hdx", dtopen(Z.z().Hdisc, Z.z().Dtobag));
+if (N(xlp.hdx)) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
}
/* for querying intersection candidates */
xlp.setPtr("spdx", RTreeOpen());
-UNSUPPORTED("7elrkgy2129t2ut4mi03dhf75"); // if (!(xlp->spdx = RTreeOpen())) {
+if (N(xlp.spdx)) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
+ }
/* save arg pointers in the handle */
-UNSUPPORTED("ava6c0wrmq2d6j1i4j7bd1lpp"); // xlp->objs = objs;
-UNSUPPORTED("85sh2ov52z31nsy9mk5su9p5p"); // xlp->n_objs = n_objs;
-UNSUPPORTED("3et8g76wlkf60sgxrmi3z1vom"); // xlp->lbls = lbls;
-UNSUPPORTED("2pwe3sog0n7styjgekuhrnd5e"); // xlp->n_lbls = n_lbls;
-UNSUPPORTED("52j9u0n44sdpwexr3bunb46zi"); // xlp->params = params;
-UNSUPPORTED("64t9yhsoz02rjp8vy1as25a5n"); // return xlp;
-UNSUPPORTED("98zx7s9vt8t1s5x9l35evcxnz"); // bad:
-UNSUPPORTED("66s40csd2ivd8rx4h2ut8oai5"); // if (xlp->hdx)
-UNSUPPORTED("8mg8tqxa78f1nfk4jh9drw2n0"); // dtclose(xlp->hdx);
-UNSUPPORTED("b9uy03exphaovgyz5t4gru409"); // if (xlp->spdx)
-UNSUPPORTED("4cfpl6hom6vo3btrjlhfmn6mi"); // RTreeClose(xlp->spdx);
-UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+xlp.objs = objs;
+xlp.setInt("n_objs", n_objs);
+xlp.lbls = lbls;
+xlp.setInt("n_lbls", n_lbls);
+xlp.setPtr("params", params);
+return (ST_XLabels_t) xlp;
+} finally {
+LEAVING("88mbfm305igsr7cew5qx6yldp","xlnew");
+}
+//UNSUPPORTED("98zx7s9vt8t1s5x9l35evcxnz"); // bad:
+//UNSUPPORTED("66s40csd2ivd8rx4h2ut8oai5"); // if (xlp->hdx)
+//UNSUPPORTED("8mg8tqxa78f1nfk4jh9drw2n0"); // dtclose(xlp->hdx);
+//UNSUPPORTED("b9uy03exphaovgyz5t4gru409"); // if (xlp->spdx)
+//UNSUPPORTED("4cfpl6hom6vo3btrjlhfmn6mi"); // RTreeClose(xlp->spdx);
+//UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
+//UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
+//UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
}
@@ -188,15 +208,14 @@ throw new UnsupportedOperationException();
//3 apvhod2s1yjb8717rb7gie2kb
// static void xlfree(XLabels_t * xlp)
-public static Object xlfree(Object... arg) {
-UNSUPPORTED("7jv3t0oxe54lacl7qn1meznth"); // static void xlfree(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3120ftcrfb2pccpafsxzl14te"); // RTreeClose(xlp->spdx);
-UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
-UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void xlfree(ST_XLabels_t xlp) {
+ENTERING("apvhod2s1yjb8717rb7gie2kb","xlfree");
+try {
+ RTreeClose((ST_RTree) xlp.spdx);
+ Memory.free(xlp);
+} finally {
+LEAVING("apvhod2s1yjb8717rb7gie2kb","xlfree");
+}
}
@@ -204,35 +223,35 @@ throw new UnsupportedOperationException();
//3 6lz36gkh8fla3z6f0lxniy368
// static int floorLog2(unsigned int n)
-public static Object floorLog2(Object... arg) {
-UNSUPPORTED("dhjwlofpfy5gop5y81eemv6i4"); // static int floorLog2(unsigned int n)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3xzujk207ipx0d60nbbrwyjez"); // int pos = 0;
-UNSUPPORTED("f0os7tzuki1s9mllsml3zu2fd"); // if (n == 0)
-UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
-UNSUPPORTED("4b22up0qcghijti04gz41jqiz"); // if (n >= 1 << 16) {
-UNSUPPORTED("b8h1lnvuhauq15z5k0fs5u2l1"); // n >>= 16;
-UNSUPPORTED("e1kd6x1c70e7l8ml3qgzahq34"); // pos += 16;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("a7hxj1hb2pc8py8ywsfit3q4n"); // if (n >= 1 << 8) {
-UNSUPPORTED("aioe8c94e5sluu8n00fdgq128"); // n >>= 8;
-UNSUPPORTED("b5apnzow59vwb4z38m0bgaxuj"); // pos += 8;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8ln2bn60t9zq7iigfqy9wa5dk"); // if (n >= 1 << 4) {
-UNSUPPORTED("albua8gefgieknhiuhr1cook"); // n >>= 4;
-UNSUPPORTED("5ivee6b3gs2khi9h8mpbr20g9"); // pos += 4;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("930rjgw6ueudlb4emmrfw8y8w"); // if (n >= 1 << 2) {
-UNSUPPORTED("3p8vzi941bcva583xzhk2o7qb"); // n >>= 2;
-UNSUPPORTED("3t90pfuwl7kz4zpjrsa99cof8"); // pos += 2;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8b1fqmv1sxvuyxs3dcp7aas0k"); // if (n >= 1 << 1) {
-UNSUPPORTED("nx53w89cor5x9akadlbw5et8"); // pos += 1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2kr5zds5y6oiaubm8wiunqccr"); // return pos;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int floorLog2(int n) {
+ENTERING("6lz36gkh8fla3z6f0lxniy368","floorLog2");
+try {
+ int pos = 0;
+ if (n == 0)
+ return -1;
+ if (n >= 1 << 16) {
+ n >>= 16;
+ pos += 16;
+ }
+ if (n >= 1 << 8) {
+ n >>= 8;
+ pos += 8;
+ }
+ if (n >= 1 << 4) {
+ n >>= 4;
+ pos += 4;
+ }
+ if (n >= 1 << 2) {
+ n >>= 2;
+ pos += 2;
+ }
+ if (n >= 1 << 1) {
+ pos += 1;
+ }
+ return pos;
+} finally {
+LEAVING("6lz36gkh8fla3z6f0lxniy368","floorLog2");
+}
}
@@ -240,14 +259,15 @@ throw new UnsupportedOperationException();
//3 uvnzthcpf4xiih05gxie2rx1
// unsigned int xlhorder(XLabels_t * xlp)
-public static Object xlhorder(Object... arg) {
-UNSUPPORTED("9rtsoeopc1glcmntqwf7hz6x7"); // unsigned int xlhorder(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("7w1e4a6q9gftmlsxkc4v7eq9d"); // double maxx = xlp->params->bb.UR.x, maxy = xlp->params->bb.UR.y;
-UNSUPPORTED("147h47bz0sqql0238qat4fdky"); // return floorLog2(maxx > maxy ? maxx : maxy) + 1;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int xlhorder(ST_XLabels_t xlp) {
+ENTERING("uvnzthcpf4xiih05gxie2rx1","xlhorder");
+try {
+ double maxx = xlp.params.bb.UR.x;
+ double maxy = xlp.params.bb.UR.y;
+ return floorLog2(maxx > maxy ? (int)maxx : (int)maxy) + 1;
+} finally {
+LEAVING("uvnzthcpf4xiih05gxie2rx1","xlhorder");
+}
}
@@ -255,59 +275,62 @@ throw new UnsupportedOperationException();
//3 9lkyvq87bawe3yon7bdwvcjzq
// static unsigned int hd_hil_s_from_xy(point p, int n)
-public static Object hd_hil_s_from_xy(Object... arg) {
-UNSUPPORTED("9zi37w33fe5wi8h5d2dymr0tt"); // static unsigned int hd_hil_s_from_xy(point p, int n)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("65resmfdu81d1xg2em5l84y82"); // int i, x = p.x, y = p.y, xi, yi;
-UNSUPPORTED("3s2drtfrrzifwhrt8rk6kq5gq"); // unsigned s;
-UNSUPPORTED("bd5j4s2m9y2fcgu9giqi9qrhy"); // s = 0; /* Initialize. */
-UNSUPPORTED("9d7993w9kft7mplobqeb9boaz"); // for (i = n - 1; i >= 0; i--) {
-UNSUPPORTED("c1xqmgsdfzeebwk2yfoz65pue"); // xi = (x >> i) & 1; /* Get bit i of x. */
-UNSUPPORTED("270wzledmbxq3z8mp5tz7ezib"); // yi = (y >> i) & 1; /* Get bit i of y. */
-UNSUPPORTED("3d69e96cdg4apqijubufzse5z"); // s = 4 * s + 2 * xi + (xi ^ yi); /* Append two bits to s. */
-UNSUPPORTED("c4cig8vru225s8qy4aj21mfe0"); // x = x ^ y; /* These 3 lines swap */
-UNSUPPORTED("7r0w00av090u8a4vi14al4ct6"); // y = y ^ (x & (yi - 1)); /* x and y if yi = 0. */
-UNSUPPORTED("cpz7xdfh4gvp5hufdb1ij5amy"); // x = x ^ y;
-UNSUPPORTED("7i7jygllv89x29npu61cfn74p"); // x = x ^ (-xi & (yi - 1)); /* Complement x and y if */
-UNSUPPORTED("5p8kbkyzcbsr9m1b1fl7z3q0h"); // y = y ^ (-xi & (yi - 1)); /* xi = 1 and yi = 0. */
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("3y6wj3ntgmr1qkdpm7wp1dsch"); // return s;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int hd_hil_s_from_xy(ST_point p, int n) {
+ENTERING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy");
+try {
+ return hd_hil_s_from_xy_((ST_point) p.copy(), n);
+} finally {
+LEAVING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy");
+}
}
+private static int hd_hil_s_from_xy_(ST_point p, int n) {
+ int i, x = p.x, y = p.y, xi, yi;
+ int s;
+ s = 0; /* Initialize. */
+ for (i = n - 1; i >= 0; i--) {
+ xi = (x >> i) & 1; /* Get bit i of x. */
+ yi = (y >> i) & 1; /* Get bit i of y. */
+ s = 4 * s + 2 * xi + (xi ^ yi); /* Append two bits to s. */
+ x = x ^ y; /* These 3 lines swap */
+ y = y ^ (x & (yi - 1)); /* x and y if yi = 0. */
+ x = x ^ y;
+ x = x ^ (-xi & (yi - 1)); /* Complement x and y if */
+ y = y ^ (-xi & (yi - 1)); /* xi = 1 and yi = 0. */
+ }
+ return s;
+ }
//3 bpkzwylrchx5wta1qhytfgbtr
// static double aabbaabb(Rect_t * r, Rect_t * s)
-public static Object aabbaabb(Object... arg) {
-UNSUPPORTED("21oyvapf2qfnxqid5aolv4mmr"); // static double aabbaabb(Rect_t * r, Rect_t * s)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("dywr73ggaui4ayztq3tmljs4z"); // /* per dimension if( max < omin || min > omax) */
-UNSUPPORTED("981pm44oz7wkhcspjabhjqpmq"); // double iminx, iminy, imaxx, imaxy;
-UNSUPPORTED("60uso6twsxyml3pff70yndkys"); // if (r->boundary[2] < s->boundary[0] || r->boundary[0] > s->boundary[2])
-UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("1tavt6umo55xyoarc64k3dxs0"); // if (r->boundary[3] < s->boundary[1] || r->boundary[1] > s->boundary[3])
-UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
-UNSUPPORTED("ls92qicz53qcx6cwst6f8om3"); // /* if we get here we have an intersection */
-UNSUPPORTED("31cw8fo82001qx6nsg22hugnf"); // /* rightmost left edge of the 2 rectangles */
-UNSUPPORTED("7d66kym3m7c0ya8b4kt7vjtvv"); // iminx =
-UNSUPPORTED("2ohiqb8vdv4gbnzqigtqd47c3"); // r->boundary[0] > s->boundary[0] ? r->boundary[0] : s->boundary[0];
-UNSUPPORTED("2bf3t8qfsxq7y4d98hc3p59gv"); // /* upmost bottom edge */
-UNSUPPORTED("cvk4ll2zvw3sljlm63j6bcjr8"); // iminy =
-UNSUPPORTED("13n8uz9c82r3pkg85oh43qf74"); // r->boundary[1] > s->boundary[1] ? r->boundary[1] : s->boundary[1];
-UNSUPPORTED("dsfdevf6xy6buo0sydh3h3fis"); // /* leftmost right edge */
-UNSUPPORTED("8rdxlzisdq5iw8b07usm1toc9"); // imaxx =
-UNSUPPORTED("a8uyhcvpgmwrihxaaa5u77i69"); // r->boundary[2] < s->boundary[2] ? r->boundary[2] : s->boundary[2];
-UNSUPPORTED("cr403g6ud2h0cyys19fti84tb"); // /* downmost top edge */
-UNSUPPORTED("cqszcttk6vqvj0hezy1t1bsig"); // imaxy =
-UNSUPPORTED("41qdog59oicvy8ku3n9vbzhj6"); // r->boundary[3] < s->boundary[3] ? r->boundary[3] : s->boundary[3];
-UNSUPPORTED("cxtiz800rb16yy2u6burhy6mi"); // return (imaxx - iminx) * (imaxy - iminy);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static double aabbaabb(ST_Rect_t r, ST_Rect_t s) {
+ENTERING("bpkzwylrchx5wta1qhytfgbtr","aabbaabb");
+try {
+ /* per dimension if( max < omin || min > omax) */
+ double iminx, iminy, imaxx, imaxy;
+ if (r.boundary[2] < s.boundary[0] || r.boundary[0] > s.boundary[2])
+ return 0;
+ if (r.boundary[3] < s.boundary[1] || r.boundary[1] > s.boundary[3])
+ return 0;
+ /* if we get here we have an intersection */
+ /* rightmost left edge of the 2 rectangles */
+ iminx =
+ r.boundary[0] > s.boundary[0] ? r.boundary[0] : s.boundary[0];
+ /* upmost bottom edge */
+ iminy =
+ r.boundary[1] > s.boundary[1] ? r.boundary[1] : s.boundary[1];
+ /* leftmost right edge */
+ imaxx =
+ r.boundary[2] < s.boundary[2] ? r.boundary[2] : s.boundary[2];
+ /* downmost top edge */
+ imaxy =
+ r.boundary[3] < s.boundary[3] ? r.boundary[3] : s.boundary[3];
+ return (imaxx - iminx) * (imaxy - iminy);
+} finally {
+LEAVING("bpkzwylrchx5wta1qhytfgbtr","aabbaabb");
+}
}
@@ -315,37 +338,42 @@ throw new UnsupportedOperationException();
//3 2g71cq6f8w5jbmbnn2x9y5qfq
// static int lblenclosing(object_t * objp, object_t * objp1)
-public static Object lblenclosing(Object... arg) {
-UNSUPPORTED("96fk2h2cameoldx630f8490ei"); // static int lblenclosing(object_t * objp, object_t * objp1)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("2uf1ispemhfeg8c7qhy0fbq2j"); // xlabel_t * xlp = objp->lbl;;
-UNSUPPORTED("txl92fx6l8dzi4yeuegwqirj"); // assert(objp1->sz.x == 0 && objp1->sz.y == 0);
-UNSUPPORTED("ek6g4dsfb8puipbh006mizket"); // if(! xlp) return 0;
-UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x &&
-UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) &&
-UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y &&
-UNSUPPORTED("29g3tye8vebllnv9b91xyntzi"); // objp1->pos.y < (xlp->pos.y + xlp->sz.y);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static boolean lblenclosing(ST_object_t objp, ST_object_t objp1) {
+ENTERING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing");
+try {
+ ST_xlabel_t.Array xlp = (ST_xlabel_t.Array) objp.lbl;
+// assert(objp1->sz.x == 0 && objp1->sz.y == 0);
+ if(N(xlp)) return false;
+ return objp1.pos.x > xlp.getStruct().pos.x &&
+ objp1.pos.x < (xlp.getStruct().pos.x + xlp.getStruct().sz.y) &&
+ objp1.pos.y > xlp.getStruct().pos.y &&
+ objp1.pos.y < (xlp.getStruct().pos.y + xlp.getStruct().sz.y);
+// UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x &&
+// UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) &&
+// UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y &&
+// UNSUPPORTED("29g3tye8vebllnv9b91xyntzi"); // objp1->pos.y < (xlp->pos.y + xlp->sz.y);
+// UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+} finally {
+LEAVING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing");
+}
}
+
//3 dq1wkb4oxshdggv6cwtgas6m
// static void objp2rect(object_t * op, Rect_t * r)
-public static Object objp2rect(Object... arg) {
-UNSUPPORTED("bmdr5joxjahq30nkb15r6rf41"); // static void objp2rect(object_t * op, Rect_t * r)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("cdtyz1w6cga7n2jo2fbh8c6ro"); // r->boundary[0] = op->pos.x;
-UNSUPPORTED("9ir52jgzphc4cgyevo2o2ltjs"); // r->boundary[1] = op->pos.y;
-UNSUPPORTED("cz4cc7haeit4u59so96vv80ch"); // r->boundary[2] = op->pos.x + op->sz.x;
-UNSUPPORTED("3m857h9kn35205vsumkenc0dx"); // r->boundary[3] = op->pos.y + op->sz.y;
-UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void objp2rect(ST_object_t op, ST_Rect_t r) {
+ENTERING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
+try {
+ r.boundary[0]=((int)op.pos.x);
+ r.boundary[1]=((int)op.pos.y);
+ r.boundary[2]=((int)(op.pos.x+op.sz.x));
+ r.boundary[3]=((int)(op.pos.y+op.sz.y));
+} finally {
+LEAVING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
+}
}
@@ -353,18 +381,17 @@ throw new UnsupportedOperationException();
//3 71b5ttp3xs7lo9fqgb7ypyqgx
// static void objplp2rect(object_t * objp, Rect_t * r)
-public static Object objplp2rect(Object... arg) {
-UNSUPPORTED("5giyzyeu3hmuyo2r06ushsohy"); // static void objplp2rect(object_t * objp, Rect_t * r)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3wparjbgs7cft1xsjcztm8bdh"); // xlabel_t *lp = objp->lbl;
-UNSUPPORTED("5abhryoldlbjfzt4lh63gmcb4"); // r->boundary[0] = lp->pos.x;
-UNSUPPORTED("acpv39vcusl8yzf591aja97a0"); // r->boundary[1] = lp->pos.y;
-UNSUPPORTED("flr92u77dscu4d286xzfwhzs"); // r->boundary[2] = lp->pos.x + lp->sz.x;
-UNSUPPORTED("beq6fj10iaic6pf2z8xgb1atm"); // r->boundary[3] = lp->pos.y + lp->sz.y;
-UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void objplp2rect(ST_object_t objp, ST_Rect_t r) {
+ENTERING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
+try {
+ ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl;
+ r.boundary[0]=((int)lp.getStruct().pos.x);
+ r.boundary[1]=((int)lp.getStruct().pos.y);
+ r.boundary[2]=((int)(lp.getStruct().pos.x+lp.getStruct().sz.x));
+ r.boundary[3]=((int)(lp.getStruct().pos.y+lp.getStruct().sz.y));
+} finally {
+LEAVING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
+}
}
@@ -372,24 +399,25 @@ throw new UnsupportedOperationException();
//3 ksqjbiie0e6vvaeawdxriie5
// static Rect_t objplpmks(XLabels_t * xlp, object_t * objp)
-public static Object objplpmks(Object... arg) {
-UNSUPPORTED("56xi0kf7c3v2wjn9pgxjfd6h"); // static Rect_t objplpmks(XLabels_t * xlp, object_t * objp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("1xpsng8cc6f4327hr9iybol18"); // Rect_t rect;
-UNSUPPORTED("2bghyit203pd6xw2ihhenzyn8"); // pointf p;
-UNSUPPORTED("44i0d8rb96ptawj2nb9zhyuzq"); // p.x = p.y = 0.0;
-UNSUPPORTED("3dwj4u821y9ogiqj7n51lyoag"); // if (objp->lbl)
-UNSUPPORTED("43e7r8tcv1i4842l88wzlv8oh"); // p = objp->lbl->sz;
-UNSUPPORTED("5vkhq86nkkgbben2zw7acts5t"); // rect.boundary[0] = (int) floor(objp->pos.x - p.x);
-UNSUPPORTED("3smh87oiqzvpexhjkfsvfqk9x"); // rect.boundary[1] = (int) floor(objp->pos.y - p.y);
-UNSUPPORTED("2qxkma0x5w0j667gciafl1erp"); // rect.boundary[2] = (int) ceil(objp->pos.x + objp->sz.x + p.x);
-UNSUPPORTED("6jltyhrpm228xlstvy1cij4b"); // assert(rect.boundary[2] < INT_MAX);
-UNSUPPORTED("aczubaaqymb9ns1q4t70v16a2"); // rect.boundary[3] = (int) ceil(objp->pos.y + objp->sz.y + p.y);
-UNSUPPORTED("560x8steudix953y8g7kyqgph"); // assert(rect.boundary[3] < INT_MAX);
-UNSUPPORTED("5r5gm69aqx2rcthvo0oaisz5n"); // return rect;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static ST_Rect_t objplpmks(ST_XLabels_t xlp, ST_object_t objp) {
+ENTERING("ksqjbiie0e6vvaeawdxriie5","objplpmks");
+try {
+ final ST_Rect_t rect = new ST_Rect_t();
+ final ST_pointf p = new ST_pointf();
+ p.setDouble("x", 0);
+ p.setDouble("y", 0);
+ if (objp.lbl!=null)
+ p.___(objp.lbl.getStruct().sz);
+ rect.boundary[0]=((int) Math.floor(objp.pos.x - p.x));
+ rect.boundary[1]=((int) Math.floor(objp.pos.y - p.y));
+ rect.boundary[2]=((int) Math.ceil(objp.pos.x + objp.sz.x + p.x));
+ // assert(rect.boundary[2] < INT_MAX);
+ rect.boundary[3]=((int) Math.ceil(objp.pos.y + objp.sz.y + p.y));
+ // assert(rect.boundary[3] < INT_MAX);
+ return rect;
+} finally {
+LEAVING("ksqjbiie0e6vvaeawdxriie5","objplpmks");
+}
}
@@ -397,14 +425,14 @@ throw new UnsupportedOperationException();
//3 calnhom3s9dqvvi6crrz3h2wp
// static int getintrsxi(XLabels_t * xlp, object_t * op, object_t * cp)
-public static Object getintrsxi(Object... arg) {
-UNSUPPORTED("a9fedvxwftar39hm6zje929tj"); // static int getintrsxi(XLabels_t * xlp, object_t * op, object_t * cp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("451bp6msra12odk32g38u2p4l"); // int i = -1;
-UNSUPPORTED("6ve3kvakrupo08cfuexjzim3j"); // xlabel_t *lp = op->lbl, *clp = cp->lbl;
-UNSUPPORTED("bot9xncc749y7iruelw2v96mm"); // assert(lp != clp);
-UNSUPPORTED("95np7ge1zv1ws57dp9wu3twm8"); // if (lp->set == 0 || clp->set == 0)
-UNSUPPORTED("11drvggon8u61uz4iw75insly"); // return i;
+public static int getintrsxi(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp) {
+ENTERING("calnhom3s9dqvvi6crrz3h2wp","getintrsxi");
+try {
+ int i = -1;
+ ST_xlabel_t.Array lp = (ST_xlabel_t.Array) op.lbl, clp = (ST_xlabel_t.Array) cp.lbl;
+ assert(lp != clp);
+ if (lp.getStruct().set == 0 || clp.getStruct().set == 0)
+ return i;
UNSUPPORTED("bofpvwtmumoe1ckgnlgbwg8bt"); // if ((op->pos.x == 0.0 && op->pos.y == 0.0) ||
UNSUPPORTED("f039op8rn0jopi9r8kora4cwz"); // (cp->pos.x == 0.0 && cp->pos.y == 0.0))
UNSUPPORTED("11drvggon8u61uz4iw75insly"); // return i;
@@ -430,6 +458,9 @@ UNSUPPORTED("ahwo5hst5k1gyq20ve63ahe81"); // return i;
UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
throw new UnsupportedOperationException();
+} finally {
+LEAVING("calnhom3s9dqvvi6crrz3h2wp","getintrsxi");
+}
}
@@ -437,40 +468,38 @@ throw new UnsupportedOperationException();
//3 52awwxu810dg9a2pjq45aomam
// static double recordointrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp, double a, object_t * intrsx[9])
-public static Object recordointrsx(Object... arg) {
-UNSUPPORTED("lt6cippjix5bbvyhkcpl8g7g"); // static double
-UNSUPPORTED("2zz9cixco1u51p503mmbdrgwj"); // recordointrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp,
-UNSUPPORTED("apwjxkvmqelrsmtxwca7febp5"); // double a, object_t * intrsx[9])
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ejj0lh0dxc3weinkmoqplvk87"); // int i = getintrsxi(xlp, op, cp);
-UNSUPPORTED("7jqpiltkvdvvkjldnxqmz4nfw"); // if (i < 0)
-UNSUPPORTED("cmp9l0lizmu0ars1jf1oxdms"); // i = 5;
-UNSUPPORTED("b3zyhtz43kkfxl6c8kovnaukv"); // if (intrsx[i] != (void *)0) {
-UNSUPPORTED("908eps96desp6goewhn8nkz4v"); // double sa, maxa = 0.0;
-UNSUPPORTED("cz5yjl642c9a3c7quub0ndp2a"); // Rect_t srect;
-UNSUPPORTED("aq0f27u636o0qqw392noohjgj"); // /* keep maximally overlapping object */
-UNSUPPORTED("5vocmgb870od0q18046qxkydh"); // objp2rect(intrsx[i], &srect);
-UNSUPPORTED("3by02iwc6g6vz00qca2gs8af1"); // sa = aabbaabb(rp, &srect);
-UNSUPPORTED("77dloi6nsmguqzpi413an26qc"); // if (sa > a)
-UNSUPPORTED("8e6d6m12amff6diyc58bdpzap"); // maxa = sa;
-UNSUPPORTED("2d4heu1iudrpn42muf8z4aedr"); // /*keep maximally overlapping label */
-UNSUPPORTED("5g3p1wh0h43afgmy1ttrgr1jv"); // if (intrsx[i]->lbl) {
-UNSUPPORTED("e5ldv4apogj6g1ixv62v7fqn7"); // objplp2rect(intrsx[i], &srect);
-UNSUPPORTED("6h73h574xwo051r2xjepln3kk"); // sa = aabbaabb(rp, &srect);
-UNSUPPORTED("cl94uq2flao8cddtvg02oliwb"); // if (sa > a)
-UNSUPPORTED("d9hnc5ox6fsga1e2336gg1fwv"); // maxa = sa > maxa ? sa : maxa;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("6nmie1l1f5g573kzykn3266zd"); // if (maxa > 0.0)
-UNSUPPORTED("dm9264t4efl70h617d1apqrlj"); // return maxa;
-UNSUPPORTED("3vems3bwps1fshis117u06l2l"); // /*replace overlapping label/object pair */
-UNSUPPORTED("c3ewj48u0ngzq2xd8g3238ays"); // intrsx[i] = cp;
-UNSUPPORTED("efte22brajv8hm98pgq1oyjc5"); // return a;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2u8wtbwfirvx570l7nhbkqwmn"); // intrsx[i] = cp;
-UNSUPPORTED("3gfohtnqgemf2e1akg4je944a"); // return a;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static double recordointrsx(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp, ST_Rect_t rp, double a, ST_object_t[] intrsx) {
+ENTERING("52awwxu810dg9a2pjq45aomam","recordointrsx");
+try {
+ int i = getintrsxi(xlp, op, cp);
+ if (i < 0)
+ i = 5;
+ if (intrsx[i] != null) {
+ double sa, maxa = 0.0;
+ final ST_Rect_t srect = new ST_Rect_t();
+ /* keep maximally overlapping object */
+ objp2rect(intrsx[i], srect);
+ sa = aabbaabb(rp, srect);
+ if (sa > a)
+ maxa = sa;
+ /*keep maximally overlapping label */
+ if (intrsx[i].lbl!=null) {
+ objplp2rect(intrsx[i], srect);
+ sa = aabbaabb(rp, srect);
+ if (sa > a)
+ maxa = sa > maxa ? sa : maxa;
+ }
+ if (maxa > 0.0)
+ return maxa;
+ /*replace overlapping label/object pair */
+ intrsx[i] = cp;
+ return a;
+ }
+ intrsx[i] = cp;
+ return a;
+} finally {
+LEAVING("52awwxu810dg9a2pjq45aomam","recordointrsx");
+}
}
@@ -478,40 +507,38 @@ throw new UnsupportedOperationException();
//3 2umrncgkunxoyeuc8i9hd5pwa
// static double recordlintrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp, double a, object_t * intrsx[9])
-public static Object recordlintrsx(Object... arg) {
-UNSUPPORTED("lt6cippjix5bbvyhkcpl8g7g"); // static double
-UNSUPPORTED("a36vanbvru4xq84pujn0rdpr5"); // recordlintrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp,
-UNSUPPORTED("apwjxkvmqelrsmtxwca7febp5"); // double a, object_t * intrsx[9])
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("ejj0lh0dxc3weinkmoqplvk87"); // int i = getintrsxi(xlp, op, cp);
-UNSUPPORTED("7jqpiltkvdvvkjldnxqmz4nfw"); // if (i < 0)
-UNSUPPORTED("cmp9l0lizmu0ars1jf1oxdms"); // i = 5;
-UNSUPPORTED("b3zyhtz43kkfxl6c8kovnaukv"); // if (intrsx[i] != (void *)0) {
-UNSUPPORTED("908eps96desp6goewhn8nkz4v"); // double sa, maxa = 0.0;
-UNSUPPORTED("cz5yjl642c9a3c7quub0ndp2a"); // Rect_t srect;
-UNSUPPORTED("aq0f27u636o0qqw392noohjgj"); // /* keep maximally overlapping object */
-UNSUPPORTED("5vocmgb870od0q18046qxkydh"); // objp2rect(intrsx[i], &srect);
-UNSUPPORTED("3by02iwc6g6vz00qca2gs8af1"); // sa = aabbaabb(rp, &srect);
-UNSUPPORTED("77dloi6nsmguqzpi413an26qc"); // if (sa > a)
-UNSUPPORTED("8e6d6m12amff6diyc58bdpzap"); // maxa = sa;
-UNSUPPORTED("2d4heu1iudrpn42muf8z4aedr"); // /*keep maximally overlapping label */
-UNSUPPORTED("5g3p1wh0h43afgmy1ttrgr1jv"); // if (intrsx[i]->lbl) {
-UNSUPPORTED("e5ldv4apogj6g1ixv62v7fqn7"); // objplp2rect(intrsx[i], &srect);
-UNSUPPORTED("6h73h574xwo051r2xjepln3kk"); // sa = aabbaabb(rp, &srect);
-UNSUPPORTED("cl94uq2flao8cddtvg02oliwb"); // if (sa > a)
-UNSUPPORTED("d9hnc5ox6fsga1e2336gg1fwv"); // maxa = sa > maxa ? sa : maxa;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("6nmie1l1f5g573kzykn3266zd"); // if (maxa > 0.0)
-UNSUPPORTED("dm9264t4efl70h617d1apqrlj"); // return maxa;
-UNSUPPORTED("3vems3bwps1fshis117u06l2l"); // /*replace overlapping label/object pair */
-UNSUPPORTED("c3ewj48u0ngzq2xd8g3238ays"); // intrsx[i] = cp;
-UNSUPPORTED("efte22brajv8hm98pgq1oyjc5"); // return a;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("2u8wtbwfirvx570l7nhbkqwmn"); // intrsx[i] = cp;
-UNSUPPORTED("3gfohtnqgemf2e1akg4je944a"); // return a;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static double recordlintrsx(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp, ST_Rect_t rp, double a, ST_object_t intrsx[]) {
+ENTERING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx");
+try {
+ int i = getintrsxi(xlp, op, cp);
+ if (i < 0)
+ i = 5;
+ if (intrsx[i] != null) {
+ double sa, maxa = 0.0;
+ final ST_Rect_t srect = new ST_Rect_t();
+ /* keep maximally overlapping object */
+ objp2rect(intrsx[i], srect);
+ sa = aabbaabb(rp, srect);
+ if (sa > a)
+ maxa = sa;
+ /*keep maximally overlapping label */
+ if (intrsx[i].lbl!=null) {
+ objplp2rect(intrsx[i], srect);
+ sa = aabbaabb(rp, srect);
+ if (sa > a)
+ maxa = sa > maxa ? sa : maxa;
+ }
+ if (maxa > 0.0)
+ return maxa;
+ /*replace overlapping label/object pair */
+ intrsx[i] = cp;
+ return a;
+ }
+ intrsx[i] = cp;
+ return a;
+} finally {
+LEAVING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx");
+}
}
@@ -519,58 +546,65 @@ throw new UnsupportedOperationException();
//3 2td62i5hus8obwt8j1lo3ddj9
// static BestPos_t xlintersections(XLabels_t * xlp, object_t * objp, object_t * intrsx[9])
-public static Object xlintersections(Object... arg) {
-UNSUPPORTED("5d1nc0otrpz1jjsig9p42wcdx"); // static BestPos_t
-UNSUPPORTED("6wd33niscsg9gaphvjj2k27mk"); // xlintersections(XLabels_t * xlp, object_t * objp, object_t * intrsx[9])
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
-UNSUPPORTED("3zfiovc9yy1ux6pn9mcga1mhx"); // LeafList_t *ilp, *llp;
-UNSUPPORTED("a1j5r089evbgqbrk12ebcposk"); // Rect_t rect, srect;
-UNSUPPORTED("ac14qcqjljksbh1ulqbhsnrnb"); // BestPos_t bp;
-UNSUPPORTED("cep99zzwrn6h0kw9g90d0bcx5"); // assert(objp->lbl);
-UNSUPPORTED("at98kl98nqfoglwklw8bmf8dy"); // bp.n = 0;
-UNSUPPORTED("6umte8r5yaoo1st9aa3ak69vv"); // bp.area = 0.0;
-UNSUPPORTED("6lbd8rbktjb11npai18mqgehg"); // bp.pos = objp->lbl->pos;
-UNSUPPORTED("bu059qij9p4jrq3c2fc3dv1tc"); // for(i=0; i<xlp->n_objs; i++) {
-UNSUPPORTED("2ju28cg7zhx8a22r2nngjed1z"); // if(objp == &xlp->objs[i]) continue;
-UNSUPPORTED("8y5ea7egphfppbq3tbxnqvszd"); // if(xlp->objs[i].sz.x > 0 && xlp->objs[i].sz.y > 0) continue;
-UNSUPPORTED("8kr7yfnz75qb1mcurk9ikvqm4"); // if(lblenclosing(objp, &xlp->objs[i]) ) {
-UNSUPPORTED("4szbt8bacnec4eh6741w9202k"); // bp.n++;
-UNSUPPORTED("dquo3qofk56ds5xl95lhvcthf"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("3kxhpoylut0o1vn46d51xaxmm"); // objplp2rect(objp, &rect);
-UNSUPPORTED("2oyraxz5ikxma3gbfbygvqyfb"); // llp = RTreeSearch(xlp->spdx, xlp->spdx->root, &rect);
-UNSUPPORTED("5gmvhcq1f7m3vaw99uu5u2lhh"); // if (!llp)
-UNSUPPORTED("6t20fkj318tjhdok8hlpbsnf7"); // return bp;
-UNSUPPORTED("cu0fy461wercnkus2c5pix4y9"); // for (ilp = llp; ilp; ilp = ilp->next) {
-UNSUPPORTED("694r1mgceoxxp4ktbci1h2qnm"); // double a, ra;
-UNSUPPORTED("6sqdh7rdwpg33jt0ecjx3yobj"); // object_t *cp = ilp->leaf->data;
-UNSUPPORTED("7wl0z6xy4danjs21muyt94sm7"); // if (cp == objp)
-UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
-UNSUPPORTED("91gncffnouukjk2940jfpcll4"); // /*label-object intersect */
-UNSUPPORTED("8gzbd1z9dm5uszv31wx6una1n"); // objp2rect(cp, &srect);
-UNSUPPORTED("c5t1kwupnkevwfpx3deb42y52"); // a = aabbaabb(&rect, &srect);
-UNSUPPORTED("9zmfoo91yy2c8v5o1x9tul9a5"); // if (a > 0.0) {
-UNSUPPORTED("di2i1k0ht9d4tbn1d0os7lj44"); // ra = recordointrsx(xlp, objp, cp, &rect, a, intrsx);
-UNSUPPORTED("20fp32yan59vu7bbp6jc1t8fn"); // bp.n++;
-UNSUPPORTED("asfx7fyb1rvar23xmjcttxkyc"); // bp.area += ra;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("6pabj7ne9s1dinxh7rgynt84r"); // /*label-label intersect */
-UNSUPPORTED("6azbae5tbds7g6ytolv14300v"); // if (!cp->lbl || !cp->lbl->set)
-UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
-UNSUPPORTED("4jw7tfl9ltqgflydxukej7r0d"); // objplp2rect(cp, &srect);
-UNSUPPORTED("c5t1kwupnkevwfpx3deb42y52"); // a = aabbaabb(&rect, &srect);
-UNSUPPORTED("9zmfoo91yy2c8v5o1x9tul9a5"); // if (a > 0.0) {
-UNSUPPORTED("db5ir72mk4a23hg0pqyapmdav"); // ra = recordlintrsx(xlp, objp, cp, &rect, a, intrsx);
-UNSUPPORTED("20fp32yan59vu7bbp6jc1t8fn"); // bp.n++;
-UNSUPPORTED("asfx7fyb1rvar23xmjcttxkyc"); // bp.area += ra;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("6q4puajbcusq4jhaq2i60nlt4"); // RTreeLeafListFree(llp);
-UNSUPPORTED("bgo7070e5cs998w6zp1ma85ad"); // return bp;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+public static ST_BestPos_t xlintersections(ST_XLabels_t xlp, ST_object_t objp, ST_object_t intrsx[]) {
+ENTERING("2td62i5hus8obwt8j1lo3ddj9","xlintersections");
+try {
+ return (ST_BestPos_t) xlintersections_(xlp, objp, intrsx).copy();
+} finally {
+LEAVING("2td62i5hus8obwt8j1lo3ddj9","xlintersections");
+}
+}
-throw new UnsupportedOperationException();
+private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp, ST_object_t intrsx[]) {
+ int i;
+ ST_LeafList_t ilp, llp;
+ final ST_Rect_t rect = new ST_Rect_t();
+ final ST_Rect_t srect = new ST_Rect_t();
+ final ST_BestPos_t bp = new ST_BestPos_t();
+// assert(objp->lbl);
+ bp.setInt("n", 0);
+ bp.setDouble("area", 0.0);
+ bp.setStruct("pos", objp.lbl.getStruct().pos);
+ for(i=0; i<xlp.n_objs; i++) {
+ if (EQ(objp, xlp.objs.plus(i).getStruct())) continue;
+ if(xlp.objs.get(i).sz.x > 0 && xlp.objs.get(i).sz.y > 0) continue;
+ if(lblenclosing(objp, (ST_object_t) xlp.objs.plus(i).getStruct())) {
+ bp.setInt("n", bp.n+1);
+ }
+ }
+ objplp2rect((ST_object_t) objp.getStruct(), rect);
+ llp = RTreeSearch((ST_RTree)xlp.spdx, (ST_Node_t___)xlp.spdx.root, rect);
+ if (N(llp))
+ return bp;
+ for (ilp = llp; ilp!=null; ilp = (ST_LeafList_t) ilp.next) {
+ double a, ra;
+ // WARNING FOR TRANSLATION
+ // In the C code, "data" was used. However ST_Branch_t is very close to ST_Leaf_t
+ // So in Java version, ST_Leaf_t has been removed and ST_Branch_t is used instead
+ ST_object_t cp = (ST_object_t) ilp.leaf.child;
+ if (EQ(cp, objp))
+ continue;
+ /*label-object intersect */
+ objp2rect((ST_object_t) cp.getStruct(), srect);
+ a = aabbaabb(rect, srect);
+ if (a > 0.0) {
+ ra = recordointrsx(xlp, objp, cp, rect, a, intrsx);
+ bp.setInt("n", bp.n+1);
+ bp.setDouble("area", bp.area+ra);
+ }
+ /*label-label intersect */
+ if (N(cp.lbl) || N(cp.lbl.getStruct().set))
+ continue;
+ objplp2rect((ST_object_t) cp.getStruct(), srect);
+ a = aabbaabb(rect, srect);
+ if (a > 0.0) {
+ ra = recordlintrsx(xlp, objp, cp, rect, a, intrsx);
+ bp.setInt("n", bp.n+1);
+ bp.setDouble("area", bp.area+ra);
+ }
+ }
+ RTreeLeafListFree(llp);
+ return bp;
}
@@ -578,78 +612,85 @@ throw new UnsupportedOperationException();
//3 8rxvucqsqnqej6h8p1osfnk4b
// static BestPos_t xladjust(XLabels_t * xlp, object_t * objp)
-public static Object xladjust(Object... arg) {
-UNSUPPORTED("855u8yvlwgwm8xrgmk8yd4q2g"); // static BestPos_t xladjust(XLabels_t * xlp, object_t * objp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("3wparjbgs7cft1xsjcztm8bdh"); // xlabel_t *lp = objp->lbl;
-UNSUPPORTED("3z9wizs5r8uuyz9r6zxqmltyr"); // double xincr = ((2 * lp->sz.x) + objp->sz.x) / 8;
-UNSUPPORTED("6y5jbcs5zcnghcye723x4gerv"); // double yincr = ((2 * lp->sz.y) + objp->sz.y) / 2;
-UNSUPPORTED("75ucply06uar4cxvlazotnq23"); // object_t *intrsx[9];
-UNSUPPORTED("9akjtu5ebkpokhkmmtkmz7alu"); // BestPos_t bp, nbp;
-UNSUPPORTED("cep99zzwrn6h0kw9g90d0bcx5"); // assert(objp->lbl);
-UNSUPPORTED("8imr23u6gekt0djjf1kronrfn"); // memset(intrsx, 0, sizeof(intrsx));
-UNSUPPORTED("1yhd7hlhm8avh8zzfa6szjhz"); // /*x left */
-UNSUPPORTED("9j4u90wq1z4maw7hj3ecfdm76"); // lp->pos.x = objp->pos.x - lp->sz.x;
-UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
-UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
-UNSUPPORTED("4ol5wxgvom71bm5d6x8u1uhce"); // bp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("b2di2eiikxmj7aprwrglzmouu"); // if (bp.n == 0)
-UNSUPPORTED("6t20fkj318tjhdok8hlpbsnf7"); // return bp;
-UNSUPPORTED("aagnln5mk16fd69wnvh7p5m33"); // /*mid */
-UNSUPPORTED("b7imuebo95ow7fl42ukl08csq"); // lp->pos.y = objp->pos.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
-UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("7fnjcyugtimcpcfm4309c9tdm"); // /*x mid */
-UNSUPPORTED("321pfgsh01nbsjro6xmf2ayfz"); // lp->pos.x = objp->pos.x;
-UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
-UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
-UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("630ofptck59xowlm1hcwiue59"); // /*x right */
-UNSUPPORTED("3zrvv0dmz98537x06egk4mwsj"); // lp->pos.x = objp->pos.x + objp->sz.x;
-UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
-UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("aagnln5mk16fd69wnvh7p5m33"); // /*mid */
-UNSUPPORTED("b7imuebo95ow7fl42ukl08csq"); // lp->pos.y = objp->pos.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
-UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
-UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
-UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
-UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
-UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
-UNSUPPORTED("6eft7mmbcin2x9bhx6gvtc33b"); // /*sliding from top left */
-UNSUPPORTED("2lmnvn101cpkt9b1cwipe71gz"); // if (intrsx[6] || intrsx[7] || intrsx[8] || intrsx[3] || intrsx[0]) { /* have to move */
+public static ST_BestPos_t xladjust(ST_XLabels_t xlp, ST_object_t objp) {
+ENTERING("8rxvucqsqnqej6h8p1osfnk4b","xladjust");
+try {
+ return (ST_BestPos_t) xladjust_(xlp, objp).copy();
+} finally {
+LEAVING("8rxvucqsqnqej6h8p1osfnk4b","xladjust");
+}
+}
+private static ST_BestPos_t xladjust_(ST_XLabels_t xlp, ST_object_t objp) {
+ ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; // ST_xlabel_t
+ double xincr = ((2 * lp.getStruct().sz.x + objp.sz.x)) / 8;
+ double yincr = ((2 * lp.getStruct().sz.y + objp.sz.y)) / 2;
+ ST_object_t intrsx[] = new ST_object_t[9];
+ final ST_BestPos_t bp = new ST_BestPos_t();
+ final ST_BestPos_t nbp = new ST_BestPos_t();
+ // assert(objp->lbl);
+ // memset(intrsx, 0, sizeof(intrsx));
+ /*x left */
+ lp.getStruct().pos.setDouble("x", objp.pos.x - lp.getStruct().sz.x);
+ /*top */
+ lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
+ bp.___(xlintersections(xlp, objp, intrsx));
+ if (bp.n == 0)
+ return bp;
+ /*mid */
+ lp.getStruct().pos.setDouble("y", objp.pos.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+ if (nbp.n == 0)
+ return nbp;
+ if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*bottom */
+ lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+ if (nbp.n == 0)
+ return nbp;
+ if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*x mid */
+ lp.getStruct().pos.setDouble("x", objp.pos.x);
+ /*top */
+ lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+ if (nbp.n == 0)
+ return nbp;
+ if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*bottom */
+ lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+ if (nbp.n == 0)
+ return nbp;
+ if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*x right */
+ lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
+ /*top */
+ lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+if (nbp.n == 0)
+return nbp;
+if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*mid */
+ lp.getStruct().pos.setDouble("y", objp.pos.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+if (nbp.n == 0)
+return nbp;
+if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*bottom */
+ lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
+ nbp.___(xlintersections(xlp, objp, intrsx));
+if (nbp.n == 0)
+return nbp;
+if (nbp.area < bp.area)
+ bp.___(nbp);
+ /*sliding from top left */
+ if (intrsx[6]!=null || intrsx[7]!=null || intrsx[8]!=null || intrsx[3]!=null || intrsx[0]!=null) { /* have to move */
UNSUPPORTED("c5acs4cl77hgu5j6nmhk090uz"); // if (!intrsx[7] && !intrsx[8]) { /* some room right? */
UNSUPPORTED("ez8sbh237xdqdjeewev2ys74y"); // /* slide along upper edge */
UNSUPPORTED("ajgw2jggmwmofm77lgbx5eo2n"); // for (lp->pos.x = objp->pos.x - lp->sz.x,
@@ -676,25 +717,25 @@ UNSUPPORTED("8yd6g3a3f0g09gmu5f67vah0x"); // if (nbp.area < bp.area)
UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("8nu4s12gyh52h2ot9r2mlueuv"); // /*sliding from bottom right */
-UNSUPPORTED("3zrvv0dmz98537x06egk4mwsj"); // lp->pos.x = objp->pos.x + objp->sz.x;
-UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
-UNSUPPORTED("9bzyoo2lc0pw2w76mz7eeduvc"); // if (intrsx[2] || intrsx[1] || intrsx[0] || intrsx[5] || intrsx[8]) { /* have to move */
-UNSUPPORTED("dq7ul34gznvszkqhgqlz4fihm"); // if (!intrsx[1] && !intrsx[0]) { /* some room left? */
-UNSUPPORTED("ahn6dk8lj2by2umnd8pceb83d"); // /* slide along lower edge */
-UNSUPPORTED("7natp0873pfsvymhhhvki1sev"); // for (lp->pos.x = objp->pos.x + objp->sz.x,
-UNSUPPORTED("56ycmo0ljb7e86mnezdx3regh"); // lp->pos.y = objp->pos.y - lp->sz.y;
-UNSUPPORTED("3wro576dh2vj9wpmfxx4rldbm"); // lp->pos.x >= (objp->pos.x - lp->sz.x);
-UNSUPPORTED("bvw5pjd7v4j796l8hhh1zrln6"); // lp->pos.x -= xincr) {
-UNSUPPORTED("8pbum2o0fs86ceaiuxv4efbb6"); // nbp = xlintersections(xlp, objp, intrsx);
-UNSUPPORTED("5xx7o143ftoj0rhyhg1hqgioa"); // if (nbp.n == 0)
-UNSUPPORTED("eqanxe9w90oki7yqvwyzpfcw1"); // return nbp;
-UNSUPPORTED("8yd6g3a3f0g09gmu5f67vah0x"); // if (nbp.area < bp.area)
-UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
-UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("4owpyb9p8esm06ttngj1arl5c"); // if (!intrsx[5] && !intrsx[8]) { /* some room up? */
+ }
+ /*sliding from bottom right */
+ lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
+ lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
+ if (intrsx[2]!=null || intrsx[1]!=null || intrsx[0]!=null || intrsx[5]!=null || intrsx[8]!=null) { /* have to move */
+ if (N(intrsx[1]) && N(intrsx[0])) { /* some room left? */
+ /* slide along lower edge */
+ for (lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x),
+ lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
+ lp.getStruct().pos.x >= (objp.pos.x - lp.getStruct().sz.x);
+ lp.getStruct().pos.setDouble("x", lp.getStruct().pos.x - xincr)) {
+ nbp.___(xlintersections(xlp, objp, intrsx));
+ if (nbp.n == 0)
+ return nbp;
+ if (nbp.area < bp.area)
+ bp.___(nbp);
+ }
+ }
+ if (N(intrsx[5]) && N(intrsx[8])) { /* some room up? */
UNSUPPORTED("4bcpk3ixfwrlr0yzrjv2efigj"); // /* slide up right edge */
UNSUPPORTED("7natp0873pfsvymhhhvki1sev"); // for (lp->pos.x = objp->pos.x + objp->sz.x,
UNSUPPORTED("56ycmo0ljb7e86mnezdx3regh"); // lp->pos.y = objp->pos.y - lp->sz.y;
@@ -706,12 +747,9 @@ UNSUPPORTED("eqanxe9w90oki7yqvwyzpfcw1"); // return nbp;
UNSUPPORTED("8yd6g3a3f0g09gmu5f67vah0x"); // if (nbp.area < bp.area)
UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("bgo7070e5cs998w6zp1ma85ad"); // return bp;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+ }
+ }
+ return bp;
}
@@ -719,30 +757,30 @@ throw new UnsupportedOperationException();
//3 e29g2hwlogx0zchsnvi464c7t
// static int xlhdxload(XLabels_t * xlp)
-public static Object xlhdxload(Object... arg) {
-UNSUPPORTED("ttxmlo99ck9eo0jae04cg2v0"); // static int xlhdxload(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
-UNSUPPORTED("5qghcwlht7sxz3cthtja5f043"); // int order = xlhorder(xlp);
-UNSUPPORTED("eali4r93mgkm937waq6to82sj"); // for (i = 0; i < xlp->n_objs; i++) {
-UNSUPPORTED("aves0wxiz65s447kr8wukl6zr"); // HDict_t *hp;
-UNSUPPORTED("43j1m17g0mjbn69pbx7ph6omt"); // point pi;
-UNSUPPORTED("bn6ewrzw1x1whedilfc6kobal"); // hp = (HDict_t*)zmalloc(sizeof(HDict_t));
-UNSUPPORTED("5wresbe1bm8eff0j10in23a8b"); // hp->d.data = &xlp->objs[i];
-UNSUPPORTED("7syosspcm4ygedrsu0c1gaqop"); // hp->d.rect = objplpmks(xlp, &xlp->objs[i]);
-UNSUPPORTED("6mb29odwxakb6cqdulhhed9j5"); // /* center of the labeling area */
-UNSUPPORTED("83ihi4lf580lzo4gdus20wr2w"); // pi.x = hp->d.rect.boundary[0] +
-UNSUPPORTED("ao944ocofv44otdeh08kl4u8o"); // (hp->d.rect.boundary[2] - hp->d.rect.boundary[0]) / 2;
-UNSUPPORTED("3igtyiyl8cpovcwukpm44iquw"); // pi.y = hp->d.rect.boundary[1] +
-UNSUPPORTED("3r4kfmd4lw5d0osh14sf4cjwg"); // (hp->d.rect.boundary[3] - hp->d.rect.boundary[1]) / 2;
-UNSUPPORTED("42x3x9vgkald7xdpbxyxih2zj"); // hp->key = hd_hil_s_from_xy(pi, order);
-UNSUPPORTED("4apoyv2n3t2fcv72hom4owvgj"); // if (!((*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(hp),0000001)))
-UNSUPPORTED("aivfd7ajlfz8o8oi68d4u5s5z"); // return -1;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int xlhdxload(ST_XLabels_t xlp) {
+ENTERING("e29g2hwlogx0zchsnvi464c7t","xlhdxload");
+try {
+ int i;
+ int order = xlhorder(xlp);
+ for (i = 0; i < xlp.n_objs; i++) {
+ ST_HDict_t hp;
+ final ST_point pi = new ST_point();
+ hp = new ST_HDict_t();
+ hp.d.child = xlp.objs.get(i);
+ hp.d.setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.objs.plus(i).getStruct()));
+ /* center of the labeling area */
+ pi.setInt("x", hp.d.rect.boundary[0] +
+ (hp.d.rect.boundary[2] - hp.d.rect.boundary[0]) / 2);
+ pi.setInt("y", hp.d.rect.boundary[1] +
+ (hp.d.rect.boundary[3] - hp.d.rect.boundary[1]) / 2);
+ hp.setInt("key", hd_hil_s_from_xy(pi, order));
+ if (N(xlp.hdx.searchf.exe(xlp.hdx, hp, 0000001)))
+ return -1;
+ }
+ return 0;
+} finally {
+LEAVING("e29g2hwlogx0zchsnvi464c7t","xlhdxload");
+}
}
@@ -750,23 +788,26 @@ throw new UnsupportedOperationException();
//3 26qpvnyd6tmdut8i2wo4itza3
// static void xlhdxunload(XLabels_t * xlp)
-public static Object xlhdxunload(Object... arg) {
-UNSUPPORTED("4bsnj74f63qe288s6be1xmrzw"); // static void xlhdxunload(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("9sqtid8yyo2ws8avf33utdebf"); // int size=dtsize(xlp->hdx), freed=0;
-UNSUPPORTED("dm7bmt2fwlkdskmcebdm1ctqj"); // while(dtsize(xlp->hdx) ) {
-UNSUPPORTED("a3jz6ykhoarsdfviidq7beb9z"); // void*vp=(((Dt_t*)(xlp->hdx))->data->here ? (((Dt_t*)((xlp->hdx)))->disc->link < 0 ? ((Dthold_t*)((((Dt_t*)(xlp->hdx))->data->here)))->obj : (void*)((char*)((((Dt_t*)(xlp->hdx))->data->here)) - ((Dt_t*)((xlp->hdx)))->disc->link) ):(void*)(0));
-UNSUPPORTED("2covsywkzvpkysnjf34nmr1uw"); // assert(vp);
-UNSUPPORTED("a9jmr8hmnwcky7f1e1qorwnjv"); // if(vp) {
-UNSUPPORTED("d2vfgb4tj6x8x7cq0kv0qgk23"); // (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(vp),0010000);
-UNSUPPORTED("7f4abg2jsf465jjlnp95d9sk6"); // free(vp);
-UNSUPPORTED("5hklxkrkvjgi37kkm6v9xajwc"); // freed++;
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("7ijd6pszsxnoopppf6xwo8wdl"); // }
-UNSUPPORTED("bifp41eoqo8l51crrab087z21"); // assert(size==freed);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static void xlhdxunload(ST_XLabels_t xlp) {
+ENTERING("26qpvnyd6tmdut8i2wo4itza3","xlhdxunload");
+try {
+//UNSUPPORTED("4bsnj74f63qe288s6be1xmrzw"); // static void xlhdxunload(XLabels_t * xlp)
+//UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
+//UNSUPPORTED("9sqtid8yyo2ws8avf33utdebf"); // int size=dtsize(xlp->hdx), freed=0;
+//UNSUPPORTED("dm7bmt2fwlkdskmcebdm1ctqj"); // while(dtsize(xlp->hdx) ) {
+//UNSUPPORTED("a3jz6ykhoarsdfviidq7beb9z"); // void*vp=(((Dt_t*)(xlp->hdx))->data->here ? (((Dt_t*)((xlp->hdx)))->disc->link < 0 ? ((Dthold_t*)((((Dt_t*)(xlp->hdx))->data->here)))->obj : (void*)((char*)((((Dt_t*)(xlp->hdx))->data->here)) - ((Dt_t*)((xlp->hdx)))->disc->link) ):(void*)(0));
+//UNSUPPORTED("2covsywkzvpkysnjf34nmr1uw"); // assert(vp);
+//UNSUPPORTED("a9jmr8hmnwcky7f1e1qorwnjv"); // if(vp) {
+//UNSUPPORTED("d2vfgb4tj6x8x7cq0kv0qgk23"); // (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(vp),0010000);
+//UNSUPPORTED("7f4abg2jsf465jjlnp95d9sk6"); // free(vp);
+//UNSUPPORTED("5hklxkrkvjgi37kkm6v9xajwc"); // freed++;
+//UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
+//UNSUPPORTED("7ijd6pszsxnoopppf6xwo8wdl"); // }
+//UNSUPPORTED("bifp41eoqo8l51crrab087z21"); // assert(size==freed);
+//UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
+} finally {
+LEAVING("26qpvnyd6tmdut8i2wo4itza3","xlhdxunload");
+}
}
@@ -774,18 +815,25 @@ throw new UnsupportedOperationException();
//3 3wrxwwd3y5ts0ekr32o8vhuvv
// static int xlspdxload(XLabels_t * xlp)
-public static Object xlspdxload(Object... arg) {
-UNSUPPORTED("87f4jxirnq7mx28zcremgaezf"); // static int xlspdxload(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("eoerd3bf05xvvfj7aisz4slcs"); // HDict_t *op=0;
-UNSUPPORTED("2ub4kt9g1hlj02ucnbi3as0ps"); // for (op = (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(0),0000200); op; op = (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(op),0000010)) {
-UNSUPPORTED("cklsugu3v9hzi5pvl4dqcq7gf"); // /* tree rectangle data node lvl */
-UNSUPPORTED("b49ahflq7xke1g6eoxv0jw2tg"); // RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0);
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int xlspdxload(ST_XLabels_t xlp) {
+ENTERING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload");
+try {
+ ST_HDict_t op=null;
+ for (op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, null, 0000200); op!=null;
+ op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, op, 0000010)) {
+ /* tree rectangle data node lvl */
+// RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0);
+ // WARNING ARRAY
+ final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.spdx.root};
+ RTreeInsert((ST_RTree) xlp.spdx, (ST_Rect_t)op.d.rect,
+ op.d.child,
+ tmp, 0);
+ xlp.spdx.setPtr("root", tmp[0]);
+ }
+ return 0;
+} finally {
+LEAVING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload");
+}
}
@@ -793,19 +841,19 @@ throw new UnsupportedOperationException();
//3 6d3fqrllm55toeo3wscwvv4ty
// static int xlinitialize(XLabels_t * xlp)
-public static Object xlinitialize(Object... arg) {
-UNSUPPORTED("732719k3woyiirridxkwkzxoo"); // static int xlinitialize(XLabels_t * xlp)
-UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
-UNSUPPORTED("4s45njph0l3mj07r60fuv2k3y"); // int r=0;
-UNSUPPORTED("ez5mifho06mx5h3ncausptuzp"); // if ((r = xlhdxload(xlp)) < 0)
-UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
-UNSUPPORTED("f2rrvhf7kqopq3w2vk3a66gqq"); // if ((r = xlspdxload(xlp)) < 0)
-UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
-UNSUPPORTED("5stn8d1urg4jlet1hh0it6cnh"); // xlhdxunload(xlp);
-UNSUPPORTED("bevdavatk2tsg3i7wugaqk0ta"); // return dtclose(xlp->hdx);
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+public static int xlinitialize(ST_XLabels_t xlp) {
+ENTERING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize");
+try {
+ int r=0;
+ if ((r = xlhdxload(xlp)) < 0)
+ return r;
+ if ((r = xlspdxload(xlp)) < 0)
+ return r;
+ xlhdxunload(xlp);
+ return dtclose((ST_dt_s) xlp.hdx);
+} finally {
+LEAVING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize");
+}
}
@@ -813,51 +861,54 @@ throw new UnsupportedOperationException();
//3 brqgbskh3z4ah8infjompibvu
// int placeLabels(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
-public static int placeLabels(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
+public static int placeLabels(ST_object_t.Array objs, int n_objs, ST_xlabel_t.Array lbls, int n_lbls, ST_label_params_t params) {
+ENTERING("brqgbskh3z4ah8infjompibvu","placeLabels");
+try {
int r, i;
-BestPos_t bp;
-XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
-UNSUPPORTED("dm5w2lmehr2rv6b2yi2v83i3g"); // if ((r = xlinitialize(xlp)) < 0)
-UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
-UNSUPPORTED("8izrf1sxed8y2dmpz5ju27b6h"); // /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left
-UNSUPPORTED("dy7wplw95swrlkv1ne5udmbk4"); // * corner is lp->pos, and size is lp->sz does not intersect any object
-UNSUPPORTED("8x5vdo798lnffr7xy14gs8x50"); // * in objs (by convention, an object consisting of a single point
-UNSUPPORTED("9gxb8rlhafdv5g89oagw3add7"); // * intersects nothing) nor any other label, if possible. On input,
-UNSUPPORTED("4w8t3nbzjsvab8g9jpodkwd8m"); // * lp->set is 0.
-UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
-UNSUPPORTED("z4vevdpoynmn19xji08qzk3g"); // * On output, any label with a position should have this stored in
-UNSUPPORTED("4v5b9m6g4uktmdpnsll0erj7z"); // * lp->pos and have lp->set non-zero.
-UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
-UNSUPPORTED("3lkc8tv6lv7r7ufa9evyti04j"); // * If params->force is true, all labels must be positioned, even if
-UNSUPPORTED("4lybka8gtaqneks34nylp952d"); // * overlaps are necessary.
-UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
-UNSUPPORTED("5frb7jkllwey3jie0brk7sexw"); // * Return 0 if all labels could be placed without overlap;
-UNSUPPORTED("b8t343yuuec8v0l5c25l9lpi9"); // * non-zero otherwise.
-UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
-UNSUPPORTED("dfy198s0balu93ez4di7muow9"); // r = 0;
-UNSUPPORTED("bznihqrwh4167vo2mn4du53da"); // for (i = 0; i < n_objs; i++) {
-UNSUPPORTED("1kray7p45i859cpqe20uu98y6"); // if (objs[i].lbl == 0)
-UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
-UNSUPPORTED("572cl1ylp2iqus4kjdigoqut3"); // bp = xladjust(xlp, &objs[i]);
-UNSUPPORTED("dr8tnm5vyr6b4kb5le39f33s9"); // if (bp.n == 0) {
-UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
-UNSUPPORTED("crlmrxaiu6t07d3ztas7pwfoi"); // } else if(bp.area == 0) {
-UNSUPPORTED("djsgfzak14js9ukvgmoqnkm8v"); // objs[i].lbl->pos.x = bp.pos.x;
-UNSUPPORTED("5s2aq4djc0l3xyilkowd7ri1r"); // objs[i].lbl->pos.y = bp.pos.y;
-UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
-UNSUPPORTED("19st2bzrcserz5r5280g8iwb8"); // } else if (params->force == 1) {
-UNSUPPORTED("djsgfzak14js9ukvgmoqnkm8v"); // objs[i].lbl->pos.x = bp.pos.x;
-UNSUPPORTED("5s2aq4djc0l3xyilkowd7ri1r"); // objs[i].lbl->pos.y = bp.pos.y;
-UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
-UNSUPPORTED("7yhr8hn3r6wohafwxrt85b2j2"); // } else {
-UNSUPPORTED("cqgdtl138trieiu5el4upwpg0"); // r = 1;
-UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
-UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
-UNSUPPORTED("6oy0ry9luo305no4iuqqxcdjr"); // xlfree(xlp);
-UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
-UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
-
-throw new UnsupportedOperationException();
+final ST_BestPos_t bp = new ST_BestPos_t();
+ST_XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
+ if ((r = xlinitialize(xlp)) < 0)
+ return r;
+ /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left
+ * corner is lp->pos, and size is lp->sz does not intersect any object
+ * in objs (by convention, an object consisting of a single point
+ * intersects nothing) nor any other label, if possible. On input,
+ * lp->set is 0.
+ *
+ * On output, any label with a position should have this stored in
+ * lp->pos and have lp->set non-zero.
+ *
+ * If params->force is true, all labels must be positioned, even if
+ * overlaps are necessary.
+ *
+ * Return 0 if all labels could be placed without overlap;
+ * non-zero otherwise.
+ */
+ r = 0;
+ for (i = 0; i < n_objs; i++) {
+ if (objs.get(i).lbl == null)
+ continue;
+ xladjust(xlp, (ST_object_t) objs.get(i).getStruct());
+ bp.___(xladjust(xlp, (ST_object_t) objs.get(i).getStruct()));
+ if (bp.n == 0) {
+ objs.get(i).lbl.setInt("set", 1);
+ } else if(bp.area == 0) {
+ objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x);
+ objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y);
+ objs.get(i).lbl.setInt("set", 1);
+ } else if (params.force) {
+ objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x);
+ objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y);
+ objs.get(i).lbl.setInt("set", 1);
+ } else {
+ r = 1;
+ }
+ }
+ xlfree(xlp);
+ return r;
+} finally {
+LEAVING("brqgbskh3z4ah8infjompibvu","placeLabels");
+}
}
diff --git a/src/gen/lib/ortho/ortho__c.java b/src/gen/lib/ortho/ortho__c.java
index 8f66e6d..02fa889 100644
--- a/src/gen/lib/ortho/ortho__c.java
+++ b/src/gen/lib/ortho/ortho__c.java
@@ -47,10 +47,7 @@ package gen.lib.ortho;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
import smetana.core.jmp_buf;
public class ortho__c {
@@ -179,14 +176,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -215,26 +212,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -257,16 +234,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/pack/ccomps__c.java b/src/gen/lib/pack/ccomps__c.java
index 48bb065..5a283ad 100644
--- a/src/gen/lib/pack/ccomps__c.java
+++ b/src/gen/lib/pack/ccomps__c.java
@@ -47,10 +47,7 @@ package gen.lib.pack;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
import smetana.core.jmp_buf;
public class ccomps__c {
@@ -311,14 +308,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -347,26 +344,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -389,16 +366,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/pack/pack__c.java b/src/gen/lib/pack/pack__c.java
index 9222007..6a0702a 100644
--- a/src/gen/lib/pack/pack__c.java
+++ b/src/gen/lib/pack/pack__c.java
@@ -48,13 +48,10 @@ import static gen.lib.cgraph.attr__c.agget;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Agraph_s;
-import h.boxf;
-import h.pack_info;
-import h.pointf;
+import h.ST_Agraph_s;
+import h.ST_pack_info;
+import h.ST_pointf;
import smetana.core.CString;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
public class pack__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -314,14 +311,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -350,26 +347,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
@@ -392,16 +369,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@@ -1907,7 +1884,7 @@ throw new UnsupportedOperationException();
//3 dyb1n3lhbi0wnr9kvmu6onux9
// pack_mode parsePackModeInfo(char* p, pack_mode dflt, pack_info* pinfo)
-public static int parsePackModeInfo(CString p, int dflt, pack_info pinfo) {
+public static int parsePackModeInfo(CString p, int dflt, ST_pack_info pinfo) {
ENTERING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
try {
float v;
@@ -1957,7 +1934,7 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
//fprintf (stderr, " size %d\n", pinfo->sz);
//fprintf (stderr, " flags %d\n", pinfo->flags);
//}
- return pinfo.getInt("mode");
+ return pinfo.mode;
} finally {
LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
}
@@ -1968,7 +1945,7 @@ LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
//3 bnxqpsmvz6tyekstfjte4pzwj
// pack_mode getPackModeInfo(Agraph_t * g, pack_mode dflt, pack_info* pinfo)
-public static int getPackModeInfo(Agraph_s g, int dflt, pack_info pinfo) {
+public static int getPackModeInfo(ST_Agraph_s g, int dflt, ST_pack_info pinfo) {
ENTERING("bnxqpsmvz6tyekstfjte4pzwj","getPackModeInfo");
try {
return parsePackModeInfo (agget(g, new CString("packmode")), dflt, pinfo);
@@ -1998,7 +1975,7 @@ throw new UnsupportedOperationException();
//3 ata97fmix5q1oikrmk5pezvrf
// int getPack(Agraph_t * g, int not_def, int dflt)
-public static int getPack(Agraph_s g, int not_def, int dflt) {
+public static int getPack(ST_Agraph_s g, int not_def, int dflt) {
ENTERING("ata97fmix5q1oikrmk5pezvrf","getPack");
try {
CString p;
@@ -2021,7 +1998,7 @@ LEAVING("ata97fmix5q1oikrmk5pezvrf","getPack");
//3 ce4a70w8ddkj4l9efi74h61s6
// pack_mode getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info* pinfo)
-public static int getPackInfo(Agraph_s g, int dflt, int dfltMargin, pack_info pinfo) {
+public static int getPackInfo(ST_Agraph_s g, int dflt, int dfltMargin, ST_pack_info pinfo) {
ENTERING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
try {
//assert (pinfo);
@@ -2032,7 +2009,7 @@ try {
pinfo.setInt("doSplines", 0);
pinfo.setInt("fixed", 0);
getPackModeInfo(g, dflt, pinfo);
- return pinfo.getInt("mode");
+ return pinfo.mode;
} finally {
LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
}
diff --git a/src/gen/lib/pack/ptest__c.java b/src/gen/lib/pack/ptest__c.java
index 9f2f1c9..e109420 100644
--- a/src/gen/lib/pack/ptest__c.java
+++ b/src/gen/lib/pack/ptest__c.java
@@ -47,10 +47,7 @@ package gen.lib.pack;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.boxf;
-import h.pointf;
-import smetana.core.JUtils;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class ptest__c {
//1 2digov3edok6d5srhgtlmrycs
@@ -310,14 +307,14 @@ throw new UnsupportedOperationException();
//3 c1s4k85p1cdfn176o3uryeros
// static inline pointf pointfof(double x, double y)
-public static __struct__<pointf> pointfof(double x, double y) {
+public static ST_pointf pointfof(double x, double y) {
// WARNING!! STRUCT
return pointfof_w_(x, y).copy();
}
-private static __struct__<pointf> pointfof_w_(double x, double y) {
+private static ST_pointf pointfof_w_(double x, double y) {
ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
+ final ST_pointf r = new ST_pointf();
r.setDouble("x", x);
r.setDouble("y", y);
return r;
@@ -346,27 +343,6 @@ throw new UnsupportedOperationException();
-//3 1vvsta5i8of59frav6uymguav
-// static inline boxf boxfof(double llx, double lly, double urx, double ury)
-public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
-// WARNING!! STRUCT
-return boxfof_w_(llx, lly, urx, ury).copy();
-}
-private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
-ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
-try {
- final __struct__<boxf> b = JUtils.from(boxf.class);
- b.getStruct("LL").setDouble("x", llx);
- b.getStruct("LL").setDouble("y", lly);
- b.getStruct("UR").setDouble("x", urx);
- b.getStruct("UR").setDouble("y", ury);
- return b;
-} finally {
-LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
-}
-}
-
-
//3 1n5xl70wxuabyf97mclvilsm6
@@ -388,16 +364,16 @@ throw new UnsupportedOperationException();
//3 arrsbik9b5tnfcbzsm8gr2chx
// static inline pointf add_pointf(pointf p, pointf q)
-public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
+public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
// WARNING!! STRUCT
return add_pointf_w_(p.copy(), q.copy()).copy();
}
-private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
+private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try {
- final __struct__<pointf> r = JUtils.from(pointf.class);
- r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
- r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
+ final ST_pointf r = new ST_pointf();
+ r.setDouble("x", p.x + q.x);
+ r.setDouble("y", p.y + q.y);
return r;
} finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
diff --git a/src/gen/lib/pathplan/cvt__c.java b/src/gen/lib/pathplan/cvt__c.java
index dd62cee..d360a6f 100644
--- a/src/gen/lib/pathplan/cvt__c.java
+++ b/src/gen/lib/pathplan/cvt__c.java
@@ -47,8 +47,7 @@ package gen.lib.pathplan;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED;
-import h.pointf;
-import smetana.core.__struct__;
+import h.ST_pointf;
public class cvt__c {
//1 baedz5i9est5csw3epz3cv7z
@@ -248,11 +247,11 @@ throw new UnsupportedOperationException();
//3 3xaxtxslceffm0wx9zcpiqjgb
// static ilcoord_t Bezier(ilcoord_t * V, int degree, double t, ilcoord_t * Left, ilcoord_t * Right)
-public static __struct__<pointf> Bezier(pointf V, int degree, double t, pointf Left, pointf Right) {
+public static ST_pointf Bezier(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
// WARNING!! STRUCT
return Bezier_w_(V, degree, t, Left, Right).copy();
}
-private static __struct__<pointf> Bezier_w_(pointf V, int degree, double t, pointf Left, pointf Right) {
+private static ST_pointf Bezier_w_(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
ENTERING("3xaxtxslceffm0wx9zcpiqjgb","Bezier");
try {
int i, j; /* Index variables */
diff --git a/src/gen/lib/pathplan/route__c.java b/src/gen/lib/pathplan/route__c.java
index c598f53..aa390f5 100644
--- a/src/gen/lib/pathplan/route__c.java
+++ b/src/gen/lib/pathplan/route__c.java
@@ -46,23 +46,18 @@
package gen.lib.pathplan;
import static gen.lib.pathplan.solvers__c.solve3;
import static smetana.core.JUtils.setjmp;
-import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtils.sqrt;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DISTSQ;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Ppoly_t;
-import h.pointf;
-import h.tna_t;
-import smetana.core.JUtils;
-import smetana.core.Memory;
+import h.ST_Pedge_t;
+import h.ST_Ppoly_t;
+import h.ST_pointf;
+import h.ST_tna_t;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
import smetana.core.jmp_buf;
public class route__c {
@@ -91,31 +86,31 @@ private static jmp_buf jbuf = new jmp_buf();
//3 9stmrdqlmufyk2wutp3totr5j
// int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input, Ppoint_t * evs, Ppolyline_t * output)
-public static int Proutespline(__ptr__ edges, int edgen, final __struct__<Ppoly_t> input, __ptr__ evs, __ptr__ output) {
+public static int Proutespline(ST_Pedge_t.Array edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) {
// WARNING!! STRUCT
-return Proutespline_w_(edges, edgen, input.copy(), evs, output);
+return Proutespline_w_(edges, edgen, (ST_Ppoly_t) input.copy(), evs, output);
}
-private static int Proutespline_w_(__ptr__ edges, int edgen, final __struct__<Ppoly_t> input, __ptr__ evs, __ptr__ output) {
+private static int Proutespline_w_(ST_Pedge_t.Array edges, int edgen, final ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) {
ENTERING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
try {
- __ptr__ inps;
+ ST_pointf.Array inps;
int inpn;
/* unpack into previous format rather than modify legacy code */
- inps = input.getPtr("ps");
- inpn = input.getInt("pn");
+ inps = input.ps;
+ inpn = input.pn;
if (setjmp(jbuf)!=0)
UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
/* generate the splines */
- evs.plus(0).getStruct().___(normv(evs.plus(0).getStruct()));
- evs.plus(1).getStruct().___(normv(evs.plus(1).getStruct()));
+ evs.plus(0).getStruct().___(normv((ST_pointf) evs.plus(0).getStruct()));
+ evs.plus(1).getStruct().___(normv((ST_pointf) evs.plus(1).getStruct()));
Z.z().opl = 0;
growops(4);
Z.z().ops_route.plus(Z.z().opl).setStruct(inps.plus(0).getStruct());
Z.z().opl++;
- if (reallyroutespline(edges, edgen, inps, inpn, evs.plus(0).getStruct(), evs.plus(1).getStruct()) == -1)
+ if (reallyroutespline(edges, edgen, inps, inpn, (ST_pointf)evs.plus(0).getStruct(), (ST_pointf)evs.plus(1).getStruct()) == -1)
return -1;
output.setInt("pn", Z.z().opl);
- output.setPtr("ps", Z.z().ops_route);
+ output.ps = Z.z().ops_route;
return 0;
} finally {
LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
@@ -129,52 +124,52 @@ LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
// static int reallyroutespline(Pedge_t * edges, int edgen, Ppoint_t * inps, int inpn, Ppoint_t ev0, Ppoint_t ev1)
//private static __ptr__ tnas;
//private static int tnan;
-public static int reallyroutespline(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final __struct__<pointf> ev0, final __struct__<pointf> ev1) {
+public static int reallyroutespline(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) {
// WARNING!! STRUCT
return reallyroutespline_w_(edges, edgen, inps, inpn, ev0.copy(), ev1.copy());
}
-private static int reallyroutespline_w_(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final __struct__<pointf> ev0, final __struct__<pointf> ev1) {
+private static int reallyroutespline_w_(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array inps, int inpn, final ST_pointf ev0, final ST_pointf ev1) {
ENTERING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline");
try {
- final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), cp1 = JUtils.from(pointf.class), cp2 = JUtils.from(pointf.class), p = JUtils.from(pointf.class);
- final __struct__<pointf> v1 = JUtils.from(pointf.class), v2 = JUtils.from(pointf.class), splitv = JUtils.from(pointf.class), splitv1 = JUtils.from(pointf.class), splitv2 = JUtils.from(pointf.class);
+ final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(), cp1 = new ST_pointf(), cp2 = new ST_pointf(), p = new ST_pointf();
+ final ST_pointf v1 = new ST_pointf(), v2 = new ST_pointf(), splitv = new ST_pointf(), splitv1 = new ST_pointf(), splitv2 = new ST_pointf();
double maxd, d, t;
int maxi, i, spliti;
if (Z.z().tnan < inpn) {
if (N(Z.z().tnas)) {
- if (N(Z.z().tnas = Memory.malloc(sizeof(tna_t.class, inpn))))
+ if (N(Z.z().tnas = new ST_tna_t.Array(inpn)))
return -1;
} else {
- if (N(Z.z().tnas = Memory.realloc(Z.z().tnas, sizeof(tna_t.class, inpn))))
+ if (N(Z.z().tnas = Z.z().tnas.reallocJ(inpn)))
return -1;
}
Z.z().tnan = inpn;
}
Z.z().tnas.plus(0).getStruct().setDouble("t", 0);
for (i = 1; i < inpn; i++)
- Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().getDouble("t") + dist(inps.plus(i).getStruct(), inps.plus(i-1).getStruct()));
+ Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().t + dist((ST_pointf)inps.plus(i).getStruct(), (ST_pointf)inps.plus(i-1).getStruct()));
for (i = 1; i < inpn; i++)
- Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().getDouble("t") / Z.z().tnas.plus(inpn - 1).getStruct().getDouble("t"));
+ Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().t / Z.z().tnas.plus(inpn - 1).getStruct().t);
for (i = 0; i < inpn; i++) {
- Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).setStruct(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
- Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).setStruct(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
+ ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[0].____(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().t)));
+ ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[1].____(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().t)));
}
- if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1.amp(), v1.amp(), p2.amp(), v2.amp()) == -1)
+ if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1, v1, p2, v2) == -1)
return -1;
if (splinefits(edges, edgen, p1, v1, p2, v2, inps, inpn)!=0)
return 0;
cp1.___(add(p1, scale(v1, 1 / 3.0)));
cp2.___(sub(p2, scale(v2, 1 / 3.0)));
for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) {
- t = Z.z().tnas.plus(i).getDouble("t");
- p.setDouble("x", B0(t) * p1.getDouble("x") + B1(t) * cp1.getDouble("x") + B2(t) * cp2.getDouble("x") + B3(t) * p2.getDouble("x"));
- p.setDouble("y", B0(t) * p1.getDouble("y") + B1(t) * cp1.getDouble("y") + B2(t) * cp2.getDouble("y") + B3(t) * p2.getDouble("y"));
- if ((d = dist(p, inps.plus(i).getStruct())) > maxd)
+ t = Z.z().tnas.get(i).t;
+ p.setDouble("x", B0(t) * p1.x + B1(t) * cp1.x + B2(t) * cp2.x + B3(t) * p2.x);
+ p.setDouble("y", B0(t) * p1.y + B1(t) * cp1.y + B2(t) * cp2.y + B3(t) * p2.y);
+ if ((d = dist(p, (ST_pointf) inps.plus(i).getStruct())) > maxd)
{maxd = d; maxi = i;}
}
spliti = maxi;
- splitv1.___(normv(sub(inps.plus(spliti).getStruct(), inps.plus(spliti - 1).getStruct())));
- splitv2.___(normv(sub(inps.plus(spliti + 1).getStruct(), inps.plus(spliti).getStruct())));
+ splitv1.___(normv(sub((ST_pointf)inps.plus(spliti).getStruct(), (ST_pointf)inps.plus(spliti - 1).getStruct())));
+ splitv2.___(normv(sub((ST_pointf)inps.plus(spliti + 1).getStruct(), (ST_pointf)inps.plus(spliti).getStruct())));
splitv.___(normv(add(splitv1, splitv2)));
reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv);
reallyroutespline(edges, edgen, inps.plus(spliti), inpn - spliti, splitv,
@@ -190,14 +185,14 @@ LEAVING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline");
//3 29sok6jkfyobf83q130snkhmh
// static int mkspline(Ppoint_t * inps, int inpn, tna_t * tnas, Ppoint_t ev0, Ppoint_t ev1, Ppoint_t * sp0, Ppoint_t * sv0, Ppoint_t * sp1, Ppoint_t * sv1)
-public static int mkspline(__ptr__ inps, int inpn, __ptr__ tnas, final __struct__<pointf> ev0, final __struct__<pointf> ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
+public static int mkspline(__ptr__ inps, int inpn, ST_tna_t.Array tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
// WARNING!! STRUCT
return mkspline_w_(inps, inpn, tnas, ev0.copy(), ev1.copy(), sp0, sv0, sp1, sv1);
}
-private static int mkspline_w_(__ptr__ inps, int inpn, __ptr__ tnas, final __struct__<pointf> ev0, final __struct__<pointf> ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
+private static int mkspline_w_(__ptr__ inps, int inpn, ST_tna_t.Array tnas, final ST_pointf ev0, final ST_pointf ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
ENTERING("29sok6jkfyobf83q130snkhmh","mkspline");
try {
- final __struct__<pointf> tmp = JUtils.from(pointf.class);
+ final ST_pointf tmp = new ST_pointf();
double c[][] = new double[2][2];
double x[] = new double[2];
double det01, det0X, detX1;
@@ -207,14 +202,14 @@ try {
c[0][0] = c[0][1] = c[1][0] = c[1][1] = 0.0;
x[0] = x[1] = 0.0;
for (i = 0; i < inpn; i++) {
- c[0][0] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct());
- c[0][1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct());
+ c[0][0] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[0]);
+ c[0][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]);
c[1][0] = c[0][1];
- c[1][1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct());
- tmp.___(sub(inps.plus(i).getStruct(), add(scale(inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().getDouble("t"))),
- scale(inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().getDouble("t"))))));
- x[0] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tmp);
- x[1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct(), tmp);
+ c[1][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]);
+ tmp.___(sub((ST_pointf) inps.plus(i).getStruct(), add(scale((ST_pointf) inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().t)),
+ scale((ST_pointf) inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().t)))));
+ x[0] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], tmp);
+ x[1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], tmp);
}
det01 = c[0][0] * c[1][1] - c[1][0] * c[0][1];
det0X = c[0][0] * x[1] - c[0][1] * x[0];
@@ -224,7 +219,7 @@ try {
scale3 = det0X / det01;
}
if (((det01) >= 0 ? (det01) : -(det01)) < 1e-6 || scale0 <= 0.0 || scale3 <= 0.0) {
- d01 = dist(inps.plus(0).getStruct(), inps.plus(inpn - 1).getStruct()) / 3.0;
+ d01 = dist((ST_pointf)inps.plus(0).getStruct(), (ST_pointf)inps.plus(inpn - 1).getStruct()) / 3.0;
scale0 = d01;
scale3 = d01;
}
@@ -243,7 +238,7 @@ LEAVING("29sok6jkfyobf83q130snkhmh","mkspline");
//3 ea6jsc0rwfyjtmmuxax6r5ngk
// static double dist_n(Ppoint_t * p, int n)
-public static double dist_n(__ptr__ p, int n) {
+public static double dist_n(ST_pointf.Array p, int n) {
ENTERING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n");
try {
int i;
@@ -251,8 +246,8 @@ try {
rv = 0.0;
for (i = 1; i < n; i++) {
rv +=
- sqrt((p.plus(i).getStruct().getDouble("x") - p.plus(i - 1).getStruct().getDouble("x")) * (p.plus(i).getStruct().getDouble("x") - p.plus(i - 1).getStruct().getDouble("x"))+
- (p.plus(i).getStruct().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y")) * (p.plus(i).getStruct().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y")));
+ sqrt((p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x) * (p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x)+
+ (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y) * (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y));
}
return rv;
} finally {
@@ -265,14 +260,14 @@ LEAVING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n");
//3 987ednrgu5qo9dzhpiox47mhb
// static int splinefits(Pedge_t * edges, int edgen, Ppoint_t pa, Pvector_t va, Ppoint_t pb, Pvector_t vb, Ppoint_t * inps, int inpn)
-public static int splinefits(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
+public static int splinefits(ST_Pedge_t.Array edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, ST_pointf.Array inps, int inpn) {
// WARNING!! STRUCT
return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), inps, inpn);
}
-private static int splinefits_w_(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
+private static int splinefits_w_(ST_Pedge_t.Array edges, int edgen, final ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_pointf vb, ST_pointf.Array inps, int inpn) {
ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits");
try {
- final __array_of_struct__ sps = __array_of_struct_impl__.malloc(pointf.class, 4);
+ final ST_pointf.Array sps = new ST_pointf.Array( 4);
double a, b;
int pi;
int forceflag;
@@ -280,14 +275,14 @@ try {
forceflag = (inpn == 2 ? 1 : 0);
a = b = 4;
for (;;) {
- sps.plus(0).getStruct().setDouble("x", pa.getDouble("x"));
- sps.plus(0).getStruct().setDouble("y", pa.getDouble("y"));
- sps.plus(1).getStruct().setDouble("x", pa.getDouble("x") + a * va.getDouble("x") / 3.0);
- sps.plus(1).getStruct().setDouble("y", pa.getDouble("y") + a * va.getDouble("y") / 3.0);
- sps.plus(2).getStruct().setDouble("x", pb.getDouble("x") - b * vb.getDouble("x") / 3.0);
- sps.plus(2).getStruct().setDouble("y", pb.getDouble("y") - b * vb.getDouble("y") / 3.0);
- sps.plus(3).getStruct().setDouble("x", pb.getDouble("x"));
- sps.plus(3).getStruct().setDouble("y", pb.getDouble("y"));
+ sps.plus(0).getStruct().setDouble("x", pa.x);
+ sps.plus(0).getStruct().setDouble("y", pa.y);
+ sps.plus(1).getStruct().setDouble("x", pa.x + a * va.x / 3.0);
+ sps.plus(1).getStruct().setDouble("y", pa.y + a * va.y / 3.0);
+ sps.plus(2).getStruct().setDouble("x", pb.x - b * vb.x / 3.0);
+ sps.plus(2).getStruct().setDouble("y", pb.y - b * vb.y / 3.0);
+ sps.plus(3).getStruct().setDouble("x", pb.x);
+ sps.plus(3).getStruct().setDouble("y", pb.y);
/* shortcuts (paths shorter than the shortest path) not allowed -
* they must be outside the constraint polygon. this can happen
* if the candidate spline intersects the constraint polygon exactly
@@ -301,8 +296,8 @@ try {
if (splineisinside(edges, edgen, sps)) {
growops(Z.z().opl + 4);
for (pi = 1; pi < 4; pi++) {
- Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
- Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
+ Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x);
+ Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y);
Z.z().opl++;
}
return 1;
@@ -312,8 +307,8 @@ try {
growops(Z.z().opl + 4);
for (pi = 1; pi < 4; pi++)
{
- Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
- Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
+ Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x);
+ Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y);
Z.z().opl++;
}
return 1;
@@ -339,18 +334,18 @@ LEAVING("987ednrgu5qo9dzhpiox47mhb","splinefits");
//3 b6eghkeu16aum3l778ig52ht1
// static int splineisinside(Pedge_t * edges, int edgen, Ppoint_t * sps)
-public static boolean splineisinside(__ptr__ edges, int edgen, __array_of_struct__ sps) {
+public static boolean splineisinside(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array sps) {
ENTERING("b6eghkeu16aum3l778ig52ht1","splineisinside");
try {
double roots[] = new double[4];
int rooti, rootn;
int ei;
- final __array_of_struct__ lps = __array_of_struct_impl__.malloc(pointf.class, 2);
- final __struct__<pointf> ip = JUtils.from(pointf.class);
+ final ST_pointf.Array lps = new ST_pointf.Array( 2);
+ final ST_pointf ip = new ST_pointf();
double t, ta, tb, tc, td;
for (ei = 0; ei < edgen; ei++) {
- lps.plus(0).setStruct(edges.plus(ei).getStruct("a"));
- lps.plus(1).setStruct(edges.plus(ei).getStruct("b"));
+ lps.plus(0).setStruct(edges.get(ei).a);
+ lps.plus(1).setStruct(edges.get(ei).b);
/* if ((rootn = splineintersectsline (sps, lps, roots)) == 4)
return 1; */
if ((rootn = splineintersectsline(sps, lps, roots)) == 4)
@@ -363,10 +358,10 @@ try {
tc = 3 * t * t * (1 - t);
tb = 3 * t * (1 - t) * (1 - t);
ta = (1 - t) * (1 - t) * (1 - t);
- ip.setDouble("x", ta * sps.plus(0).getDouble("x") + tb * sps.plus(1).getDouble("x") +
- tc * sps.plus(2).getDouble("x") + td * sps.plus(3).getDouble("x"));
- ip.setDouble("y", ta * sps.plus(0).getDouble("y") + tb * sps.plus(1).getDouble("y") +
- tc * sps.plus(2).getDouble("y") + td * sps.plus(3).getDouble("y"));
+ ip.setDouble("x", ta * sps.get(0).x + tb * sps.get(1).x +
+ tc * sps.get(2).x + td * sps.get(3).x);
+ ip.setDouble("y", ta * sps.get(0).y + tb * sps.get(1).y +
+ tc * sps.get(2).y + td * sps.get(3).y);
if (DISTSQ(ip, lps.plus(0).getStruct()) < 1E-3 ||
DISTSQ(ip, lps.plus(1).getStruct()) < 1E-3)
continue;
@@ -384,7 +379,7 @@ LEAVING("b6eghkeu16aum3l778ig52ht1","splineisinside");
//3 32nc8itszi77u36la8npt2870
// static int splineintersectsline(Ppoint_t * sps, Ppoint_t * lps, double *roots)
-public static int splineintersectsline(__array_of_struct__ sps, __array_of_struct__ lps, double roots[]) {
+public static int splineintersectsline(ST_pointf.Array sps, ST_pointf.Array lps, double roots[]) {
ENTERING("32nc8itszi77u36la8npt2870","splineintersectsline");
try {
double scoeff[] = new double[4];
@@ -395,17 +390,17 @@ try {
double tv, sv, rat;
int rootn[] = new int[]{0};
int xrootn, yrootn, i, j;
- xcoeff[0] = lps.plus(0).getStruct().getDouble("x");
- xcoeff[1] = lps.plus(1).getStruct().getDouble("x") - lps.plus(0).getStruct().getDouble("x");
- ycoeff[0] = lps.plus(0).getStruct().getDouble("y");
- ycoeff[1] = lps.plus(1).getStruct().getDouble("y") - lps.plus(0).getStruct().getDouble("y");
+ xcoeff[0] = lps.plus(0).getStruct().x;
+ xcoeff[1] = lps.plus(1).getStruct().x - lps.plus(0).getStruct().x;
+ ycoeff[0] = lps.plus(0).getStruct().y;
+ ycoeff[1] = lps.plus(1).getStruct().y - lps.plus(0).getStruct().y;
rootn[0] = 0;
if (xcoeff[1] == 0) {
if (ycoeff[1] == 0) {
- points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"), scoeff);
+ points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff);
scoeff[0] -= xcoeff[0];
xrootn = solve3(scoeff, xroots);
- points2coeff(sps.plus(0).getStruct().getDouble("y"), sps.plus(1).getStruct().getDouble("y"), sps.plus(2).getStruct().getDouble("y"), sps.plus(3).getStruct().getDouble("y"), scoeff);
+ points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y, scoeff);
scoeff[0] -= ycoeff[0];
yrootn = solve3(scoeff, yroots);
if (xrootn == 4)
@@ -424,7 +419,7 @@ try {
addroot(xroots[i], roots, rootn);
return rootn[0];
} else {
- points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"), scoeff);
+ points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff);
scoeff[0] -= xcoeff[0];
xrootn = solve3(scoeff, xroots);
if (xrootn == 4)
@@ -432,7 +427,7 @@ try {
for (i = 0; i < xrootn; i++) {
tv = xroots[i];
if (tv >= 0 && tv <= 1) {
- points2coeff(sps.plus(0).getStruct().getDouble("y"), sps.plus(1).getStruct().getDouble("y"), sps.plus(2).getStruct().getDouble("y"), sps.plus(3).getStruct().getDouble("y"),
+ points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y,
scoeff);
sv = scoeff[0] + tv * (scoeff[1] + tv *
(scoeff[2] + tv * scoeff[3]));
@@ -445,8 +440,8 @@ try {
}
} else {
rat = ycoeff[1] / xcoeff[1];
- points2coeff(sps.plus(0).getStruct().getDouble("y") - rat * sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("y") - rat * sps.plus(1).getStruct().getDouble("x"),
- sps.plus(2).getStruct().getDouble("y") - rat * sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("y") - rat * sps.plus(3).getStruct().getDouble("x"),
+ points2coeff(sps.plus(0).getStruct().y - rat * sps.plus(0).getStruct().x, sps.plus(1).getStruct().y - rat * sps.plus(1).getStruct().x,
+ sps.plus(2).getStruct().y - rat * sps.plus(2).getStruct().x, sps.plus(3).getStruct().y - rat * sps.plus(3).getStruct().x,
scoeff);
scoeff[0] += rat * xcoeff[0] - ycoeff[0];
xrootn = solve3(scoeff, xroots);
@@ -455,7 +450,7 @@ try {
for (i = 0; i < xrootn; i++) {
tv = xroots[i];
if (tv >= 0 && tv <= 1) {
- points2coeff(sps.plus(0).getStruct().getDouble("x"), sps.plus(1).getStruct().getDouble("x"), sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("x"),
+ points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x,
scoeff);
sv = scoeff[0] + tv * (scoeff[1] +
tv * (scoeff[2] + tv * scoeff[3]));
@@ -510,19 +505,19 @@ LEAVING("6ldk438jjflh0huxkg4cs8kwu","addroot");
//3 3i8m1m9fg7qmnt8jloorwlu8e
// static Pvector_t normv(Pvector_t v)
-public static __struct__<pointf> normv(final __struct__<pointf> v) {
+public static ST_pointf normv(final ST_pointf v) {
// WARNING!! STRUCT
return normv_w_(v.copy()).copy();
}
-private static __struct__<pointf> normv_w_(final __struct__<pointf> v) {
+private static ST_pointf normv_w_(final ST_pointf v) {
ENTERING("3i8m1m9fg7qmnt8jloorwlu8e","normv");
try {
double d;
- d = v.getDouble("x") * v.getDouble("x") + v.getDouble("y") * v.getDouble("y");
+ d = v.x * v.x + v.y * v.y;
if (d > 1e-6) {
d = sqrt(d);
- v.setDouble("x", v.getDouble("x") / d);
- v.setDouble("y", v.getDouble("y") / d);
+ v.setDouble("x", v.x / d);
+ v.setDouble("y", v.y / d);
}
return v;
} finally {
@@ -541,13 +536,12 @@ try {
if (newopn <= Z.z().opn_route)
return;
if (N(Z.z().ops_route)) {
- if (N(Z.z().ops_route = Memory.malloc(sizeof (pointf.class, newopn)))) {
+ if (N(Z.z().ops_route = new ST_pointf.Array(newopn))) {
UNSUPPORTED("413an1hqgkb4ezaec6qdsdplx"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot malloc ops"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
} else {
- if (N(Z.z().ops_route = Memory.realloc(Z.z().ops_route,
- sizeof (pointf.class, newopn)))) {
+ if (N(Z.z().ops_route = Z.z().ops_route.reallocJ(newopn))) {
UNSUPPORTED("8u0qgahxvk5pplf90thmhwxhl"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot realloc ops"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
@@ -563,15 +557,15 @@ LEAVING("d59jcnpi1y0wr8e9uwxny2fvk","growops");
//3 f4a7nt247bokdwr2owda050of
// static Ppoint_t add(Ppoint_t p1, Ppoint_t p2)
-public static __struct__<pointf> add(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+public static ST_pointf add(final ST_pointf p1, final ST_pointf p2) {
// WARNING!! STRUCT
return add_w_(p1.copy(), p2.copy()).copy();
}
-private static __struct__<pointf> add_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+private static ST_pointf add_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("f4a7nt247bokdwr2owda050of","add");
try {
- p1.setDouble("x", p1.getDouble("x") + p2.getDouble("x"));
- p1.setDouble("y", p1.getDouble("y") + p2.getDouble("y"));
+ p1.setDouble("x", p1.x + p2.x);
+ p1.setDouble("y", p1.y + p2.y);
return p1;
} finally {
LEAVING("f4a7nt247bokdwr2owda050of","add");
@@ -583,15 +577,15 @@ LEAVING("f4a7nt247bokdwr2owda050of","add");
//3 c4l1gvlkv2s4mi6os7r9dh89f
// static Ppoint_t sub(Ppoint_t p1, Ppoint_t p2)
-public static __struct__<pointf> sub(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+public static ST_pointf sub(final ST_pointf p1, final ST_pointf p2) {
// WARNING!! STRUCT
return sub_w_(p1.copy(), p2.copy()).copy();
}
-private static __struct__<pointf> sub_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+private static ST_pointf sub_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
try {
- p1.setDouble("x", p1.getDouble("x") - p2.getDouble("x"));
- p1.setDouble("y", p1.getDouble("y") - p2.getDouble("y"));
+ p1.setDouble("x", p1.x - p2.x);
+ p1.setDouble("y", p1.y - p2.y);
return p1;
} finally {
LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
@@ -603,16 +597,16 @@ LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
//3 dqnlz0tceriykws4ngudl94w9
// static double dist(Ppoint_t p1, Ppoint_t p2)
-public static double dist(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+public static double dist(final ST_pointf p1, final ST_pointf p2) {
// WARNING!! STRUCT
return dist_w_(p1.copy(), p2.copy());
}
-private static double dist_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+private static double dist_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("dqnlz0tceriykws4ngudl94w9","dist");
try {
double dx, dy;
- dx = p2.getDouble("x") - p1.getDouble("x");
- dy = p2.getDouble("y") - p1.getDouble("y");
+ dx = p2.x - p1.x;
+ dy = p2.y - p1.y;
return sqrt(dx * dx + dy * dy);
} finally {
LEAVING("dqnlz0tceriykws4ngudl94w9","dist");
@@ -624,15 +618,15 @@ LEAVING("dqnlz0tceriykws4ngudl94w9","dist");
//3 19149pdllzhplvew0bsh5v6hy
// static Ppoint_t scale(Ppoint_t p, double c)
-public static __struct__<pointf> scale(final __struct__<pointf> p, double c) {
+public static ST_pointf scale(final ST_pointf p, double c) {
// WARNING!! STRUCT
return scale_w_(p.copy(), c).copy();
}
-private static __struct__<pointf> scale_w_(final __struct__<pointf> p, double c) {
+private static ST_pointf scale_w_(final ST_pointf p, double c) {
ENTERING("19149pdllzhplvew0bsh5v6hy","scale");
try {
- p.setDouble("x", p.getDouble("x") * c);
- p.setDouble("y", p.getDouble("y") * c);
+ p.setDouble("x", p.x * c);
+ p.setDouble("y", p.y * c);
return p;
} finally {
LEAVING("19149pdllzhplvew0bsh5v6hy","scale");
@@ -644,14 +638,14 @@ LEAVING("19149pdllzhplvew0bsh5v6hy","scale");
//3 7ebsa2s1eoopqj1pp43bh5fw
// static double dot(Ppoint_t p1, Ppoint_t p2)
-public static double dot(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+public static double dot(final ST_pointf p1, final ST_pointf p2) {
// WARNING!! STRUCT
return dot_w_(p1.copy(), p2.copy());
}
-private static double dot_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
+private static double dot_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("7ebsa2s1eoopqj1pp43bh5fw","dot");
try {
- return p1.getDouble("x") * p2.getDouble("x") + p1.getDouble("y") * p2.getDouble("y");
+ return p1.x * p2.x + p1.y * p2.y;
} finally {
LEAVING("7ebsa2s1eoopqj1pp43bh5fw","dot");
}
diff --git a/src/gen/lib/pathplan/shortest__c.java b/src/gen/lib/pathplan/shortest__c.java
index e620742..15f372e 100644
--- a/src/gen/lib/pathplan/shortest__c.java
+++ b/src/gen/lib/pathplan/shortest__c.java
@@ -48,24 +48,17 @@ import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.LOG2;
import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.setjmp;
-import static smetana.core.JUtils.sizeof;
-import static smetana.core.JUtils.sizeof_starstar_empty;
import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.HUGE_VAL;
import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED;
-import h.Ppoly_t;
-import h.pointf;
-import h.pointnlink_t;
-import h.triangle_t;
-import smetana.core.JUtils;
-import smetana.core.Memory;
+import h.ST_Ppoly_t;
+import h.ST_pointf;
+import h.ST_pointnlink_t;
+import h.ST_triangle_t;
import smetana.core.Z;
-import smetana.core.__array_of_struct__;
-import smetana.core.__array_of_struct_impl__;
import smetana.core.__ptr__;
-import smetana.core.__struct__;
import smetana.core.jmp_buf;
public class shortest__c {
@@ -114,56 +107,56 @@ private static jmp_buf jbuf = new jmp_buf();
//3 2gub5b19vo2qexn56nw23wage
// int Pshortestpath(Ppoly_t * polyp, Ppoint_t * eps, Ppolyline_t * output)
-public static int Pshortestpath(Ppoly_t polyp, __array_of_struct__ eps, Ppoly_t output) {
+public static int Pshortestpath(ST_Ppoly_t polyp, ST_pointf.Array eps, ST_Ppoly_t output) {
ENTERING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
try {
int pi, minpi;
double minx;
- final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), p3 = JUtils.from(pointf.class);
+ final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(), p3 = new ST_pointf();
int trii, trij, ftrii, ltrii;
int ei;
- final __array_of_struct__ epnls = __array_of_struct_impl__.malloc(pointnlink_t.class, 2);
- pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
- triangle_t trip;
+ final ST_pointnlink_t[] epnls = new ST_pointnlink_t[] {new ST_pointnlink_t(),new ST_pointnlink_t()};
+ ST_pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
+ ST_triangle_t.Array trip;
int splitindex;
if (setjmp(jbuf)!=0)
return -2;
/* make space */
- growpnls(polyp.getInt("pn"));
+ growpnls(polyp.pn);
Z.z().pnll = 0;
Z.z().tril = 0;
- growdq(polyp.getInt("pn") * 2);
- Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("pnlpn") / 2);
- Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("fpnlpi") - 1);
+ growdq(polyp.pn * 2);
+ Z.z().dq.fpnlpi = Z.z().dq.pnlpn / 2;
+ Z.z().dq.lpnlpi = Z.z().dq.fpnlpi - 1;
/* make sure polygon is CCW and load pnls array */
- for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.getInt("pn"); pi++) {
- if (minx > polyp.getPtr("ps").plus(pi).getDouble("x"))
- { minx = polyp.getPtr("ps").plus(pi).getDouble("x");
+ for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.pn; pi++) {
+ if (minx > polyp.ps.get(pi).x)
+ { minx = polyp.ps.get(pi).x;
minpi = pi; }
}
- p2.____(polyp.getPtr("ps").plus(minpi));
- p1.____(polyp.getPtr("ps").plus(((minpi == 0) ? polyp.getInt("pn") - 1 : minpi - 1)));
- p3.____(polyp.getPtr("ps").plus(((minpi == polyp.getInt("pn") - 1) ? 0 : minpi + 1)));
- if (((p1.getDouble("x") == p2.getDouble("x") && p2.getDouble("x") == p3.getDouble("x")) && (p3.getDouble("y") > p2.getDouble("y"))) ||
- ccw(p1.amp(), p2.amp(), p3.amp()) != 1) {
- for (pi = polyp.getInt("pn") - 1; pi >= 0; pi--) {
- if (pi < polyp.getInt("pn") - 1
- && polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi+1).getDouble("x")
- && polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi+1).getDouble("y"))
+ p2.____(polyp.ps.plus(minpi));
+ p1.____(polyp.ps.plus(((minpi == 0) ? polyp.pn - 1 : minpi - 1)));
+ p3.____(polyp.ps.plus(((minpi == polyp.pn - 1) ? 0 : minpi + 1)));
+ if (((p1.x == p2.x && p2.x == p3.x) && (p3.y > p2.y)) ||
+ ccw(p1, p2, p3) != 1) {
+ for (pi = polyp.pn - 1; pi >= 0; pi--) {
+ if (pi < polyp.pn - 1
+ && polyp.ps.get(pi).x == polyp.ps.get(pi+1).x
+ && polyp.ps.get(pi).y == polyp.ps.get(pi+1).y)
continue;
- Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
- Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
- Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll).getPtr());
+ Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi));
+ Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn];
+ Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
Z.z().pnll++;
}
} else {
- for (pi = 0; pi < polyp.getInt("pn"); pi++) {
- if (pi > 0 && polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi - 1).getDouble("x") &&
- polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi - 1).getDouble("y"))
+ for (pi = 0; pi < polyp.pn; pi++) {
+ if (pi > 0 && polyp.ps.get(pi).x == polyp.ps.get(pi - 1).x &&
+ polyp.ps.get(pi).y == polyp.ps.get(pi - 1).y)
continue;
- Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
- Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
- Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll));
+ Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi));
+ Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn];
+ Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
Z.z().pnll++;
}
}
@@ -175,7 +168,7 @@ try {
connecttris(trii, trij);
/* find first and last triangles */
for (trii = 0; trii < Z.z().tril; trii++)
- if (pointintri(trii, eps.plus(0).getStruct().amp()))
+ if (pointintri(trii, eps.plus(0).getStruct()))
break;
if (trii == Z.z().tril) {
UNSUPPORTED("4ma3y8l4lmjcsw49kmsgknig6"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("source point not in any triangle"));
@@ -183,7 +176,7 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
}
ftrii = trii;
for (trii = 0; trii < Z.z().tril; trii++)
- if (pointintri(trii, eps.plus(1).getStruct().amp()))
+ if (pointintri(trii, eps.plus(1).getStruct()))
break;
if (trii == Z.z().tril) {
System.err.println("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("destination point not in any triangle"));
@@ -195,7 +188,7 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
System.err.println("libpath/%s:%d: %s" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("cannot find triangle path"));
/* a straight line is better than failing */
growops(2);
- output.setInt("pn", 2);
+ output.pn = 2;
Z.z().ops_shortest.plus(0).setStruct(eps.plus(0).getStruct());
Z.z().ops_shortest.plus(1).setStruct(eps.plus(1).getStruct());
output.setPtr("ps", Z.z().ops_shortest);
@@ -210,40 +203,40 @@ UNSUPPORTED("3rcg6c9s9nmostq9c3r5n6x4h"); // output->ps = ops;
UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
}
/* build funnel and shortest path linked list (in add2dq) */
- epnls.plus(0).getStruct().setPtr("pp", eps.plus(0).asPtr());
- epnls.plus(0).getStruct().setPtr("link", null);
- epnls.plus(1).getStruct().setPtr("pp", eps.plus(1).asPtr());
- epnls.plus(1).getStruct().setPtr("link", null);
- add2dq(1, epnls.plus(0).asPtr());
- Z.z().dq.setInt("apex", Z.z().dq.getInt("fpnlpi"));
+ epnls[0].pp = eps.get(0);
+ epnls[0].link = null;
+ epnls[1].pp = eps.get(1);
+ epnls[1].link = null;
+ add2dq(1, epnls[0]);
+ Z.z().dq.apex = Z.z().dq.fpnlpi;
trii = ftrii;
while (trii != -1) {
- trip = (triangle_t) Z.z().tris.plus(trii);
- trip.setInt("mark", 2);
+ trip = Z.z().tris.plusJ(trii);
+ trip.get(0).mark = 2;
/* find the left and right points of the exiting edge */
for (ei = 0; ei < 3; ei++)
- if (trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
- trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1)
+ if (trip.get(0).e[ei].rtp!=null &&
+ trip.get(0).e[ei].rtp.get(0).mark == 1)
break;
if (ei == 3) { /* in last triangle */
- if (ccw(eps.plus(1).asPtr(), Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr().getPtr("pp"),
- Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr().getPtr("pp")) == 1)
+ if (ccw(eps.get(1), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp,
+ Z.z().dq.pnlps[Z.z().dq.lpnlpi].pp) == 1)
{
- lpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
- rpnlp = (pointnlink_t) epnls.plus(1).asPtr();
+ lpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
+ rpnlp = epnls[1];
} else {
- lpnlp = (pointnlink_t) epnls.plus(1).asPtr();
- rpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
+ lpnlp = epnls[1];
+ rpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
}
} else {
- pnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus((ei + 1) % 3).getStruct().getPtr("pnl1p");
- if (ccw(trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"), pnlp.getPtr("pp"),
- trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp")) == 1)
+ pnlp = trip.get(0).e[(ei + 1) % 3].pnl1p;
+ if (ccw(trip.get(0).e[ei].pnl0p.pp, pnlp.pp,
+ trip.get(0).e[ei].pnl1p.pp) == 1)
UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp = trip->e[ei].pnl0p;
else
{
- lpnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p");
- rpnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p");
+ lpnlp = trip.get(0).e[ei].pnl0p;
+ rpnlp = trip.get(0).e[ei].pnl1p;
}
}
/* update deque */
@@ -251,40 +244,40 @@ UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp
add2dq(2, lpnlp);
add2dq(1, rpnlp);
} else {
- if (NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr(), rpnlp)
- && NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr(), rpnlp)) {
+ if (NEQ(Z.z().dq.pnlps[Z.z().dq.fpnlpi], rpnlp)
+ && NEQ(Z.z().dq.pnlps[Z.z().dq.lpnlpi], rpnlp)) {
/* add right point to deque */
splitindex = finddqsplit(rpnlp);
splitdq(2, splitindex);
add2dq(1, rpnlp);
/* if the split is behind the apex, then reset apex */
- if (splitindex > Z.z().dq.getInt("apex"))
- Z.z().dq.setInt("apex", splitindex);
+ if (splitindex > Z.z().dq.apex)
+ Z.z().dq.apex = splitindex;
} else {
/* add left point to deque */
splitindex = finddqsplit(lpnlp);
splitdq(1, splitindex);
add2dq(2, lpnlp);
/* if the split is in front of the apex, then reset apex */
- if (splitindex < Z.z().dq.getInt("apex"))
- Z.z().dq.setInt("apex", splitindex);
+ if (splitindex < Z.z().dq.apex)
+ Z.z().dq.apex = splitindex;
}
}
trii = -1;
for (ei = 0; ei < 3; ei++)
- if (trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
- trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1) {
- trii = trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris);
+ if (trip.get(0).e[ei].rtp!=null &&
+ trip.get(0).e[ei].rtp.get(0).mark == 1) {
+ trii = trip.get(0).e[ei].rtp.minus(Z.z().tris);
break;
}
}
- for (pi = 0, pnlp = (pointnlink_t) epnls.plus(1).asPtr(); pnlp!=null; pnlp = (pointnlink_t) pnlp.getPtr("link"))
+ for (pi = 0, pnlp = epnls[1]; pnlp!=null; pnlp = pnlp.link)
pi++;
growops(pi);
- output.setInt("pn", pi);
- for (pi = pi - 1, pnlp = (pointnlink_t) epnls.plus(1).asPtr(); pnlp!=null; pi--, pnlp = (pointnlink_t) pnlp.getPtr("link"))
- Z.z().ops_shortest.plus(pi).setPtr(pnlp.getPtr("pp"));
- output.setPtr("ps", Z.z().ops_shortest);
+ output.pn = pi;
+ for (pi = pi - 1, pnlp = epnls[1]; pnlp!=null; pi--, pnlp = pnlp.link)
+ Z.z().ops_shortest.get(pi).____(pnlp.pp);
+ output.ps = Z.z().ops_shortest;
return 0;
} finally {
LEAVING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
@@ -296,7 +289,7 @@ LEAVING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
//3 73cr7m3mqvtuotpzrmaw2y8zm
// static void triangulate(pointnlink_t ** pnlps, int pnln)
-public static void triangulate(__ptr__ pnlps, int pnln) {
+public static void triangulate(ST_pointnlink_t pnlps[], int pnln) {
ENTERING("73cr7m3mqvtuotpzrmaw2y8zm","triangulate");
try {
int pnli, pnlip1, pnlip2;
@@ -309,9 +302,9 @@ try {
pnlip2 = (pnli + 2) % pnln;
if (isdiagonal(pnli, pnlip2, pnlps, pnln))
{
- loadtriangle(pnlps.plus(pnli).getPtr(), pnlps.plus(pnlip1).getPtr(), pnlps.plus(pnlip2).getPtr());
+ loadtriangle(pnlps[pnli], pnlps[pnlip1], pnlps[pnlip2]);
for (pnli = pnlip1; pnli < pnln - 1; pnli++)
- pnlps.plus(pnli).setPtr(pnlps.plus(pnli + 1).getPtr());
+ pnlps[pnli] = pnlps[pnli + 1];
triangulate(pnlps, pnln - 1);
return;
}
@@ -319,7 +312,7 @@ try {
throw new IllegalStateException("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("triangulation failed"));
}
else
- loadtriangle(pnlps.plus(0).getPtr(), pnlps.plus(1).getPtr(), pnlps.plus(2).getPtr());
+ loadtriangle(pnlps[0], pnlps[1], pnlps[2]);
} finally {
LEAVING("73cr7m3mqvtuotpzrmaw2y8zm","triangulate");
}
@@ -330,7 +323,7 @@ LEAVING("73cr7m3mqvtuotpzrmaw2y8zm","triangulate");
//3 72of3cd7shtwokglxapw04oe9
// static int isdiagonal(int pnli, int pnlip2, pointnlink_t ** pnlps, int pnln)
-public static boolean isdiagonal(int pnli, int pnlip2, __ptr__ pnlps, int pnln) {
+public static boolean isdiagonal(int pnli, int pnlip2, ST_pointnlink_t[] pnlps, int pnln) {
ENTERING("72of3cd7shtwokglxapw04oe9","isdiagonal");
try {
int pnlip1, pnlim1, pnlj, pnljp1;
@@ -339,17 +332,17 @@ try {
pnlip1 = (pnli + 1) % pnln;
pnlim1 = (pnli + pnln - 1) % pnln;
/* If P[pnli] is a convex vertex [ pnli+1 left of (pnli-1,pnli) ]. */
- if (ccw(pnlps.plus(pnlim1).getPtr("pp"), pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip1).getPtr("pp")) ==
+ if (ccw(pnlps[pnlim1].pp, pnlps[pnli].pp, pnlps[pnlip1].pp) ==
1)
res =
- (ccw(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"), pnlps.plus(pnlim1).getPtr("pp")) ==
+ (ccw(pnlps[pnli].pp, pnlps[pnlip2].pp, pnlps[pnlim1].pp) ==
1)
- && (ccw(pnlps.plus(pnlip2).getPtr("pp"), pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip1).getPtr("pp"))
+ && (ccw(pnlps[pnlip2].pp, pnlps[pnli].pp, pnlps[pnlip1].pp)
== 1);
/* Assume (pnli - 1, pnli, pnli + 1) not collinear. */
else
- res = (ccw(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"),
- pnlps.plus(pnlip1).getPtr("pp")) == 2);
+ res = (ccw(pnlps[pnli].pp, pnlps[pnlip2].pp,
+ pnlps[pnlip1].pp) == 2);
if (N(res))
return false;
/* check against all other edges */
@@ -357,8 +350,8 @@ try {
pnljp1 = (pnlj + 1) % pnln;
if (N((pnlj == pnli) || (pnljp1 == pnli) ||
(pnlj == pnlip2) || (pnljp1 == pnlip2)))
- if (intersects(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"),
- pnlps.plus(pnlj).getPtr("pp"), pnlps.plus(pnljp1).getPtr("pp")))
+ if (intersects(pnlps[pnli].pp, pnlps[pnlip2].pp,
+ pnlps[pnlj].pp, pnlps[pnljp1].pp))
return false;
}
return ((N(false)));
@@ -375,24 +368,24 @@ LEAVING("72of3cd7shtwokglxapw04oe9","isdiagonal");
public static void loadtriangle(__ptr__ pnlap, __ptr__ pnlbp, __ptr__ pnlcp) {
ENTERING("7vf9jtj9i8rg0cxrstbqswuck","loadtriangle");
try {
- triangle_t trip;
+ ST_triangle_t.Array trip;
int ei;
/* make space */
if (Z.z().tril >= Z.z().trin)
growtris(Z.z().trin + 20);
- trip = (triangle_t) Z.z().tris.plus(Z.z().tril++);
- trip.setInt("mark", 0);
- trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl0p", pnlap);
- trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl1p", pnlbp);
- trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("rtp", null);
- trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("pnl0p", pnlbp);
- trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("pnl1p", pnlcp);
- trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("rtp", null);
- trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("pnl0p", pnlcp);
- trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("pnl1p", pnlap);
- trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("rtp", null);
+ trip = Z.z().tris.plusJ(Z.z().tril++);
+ trip.get(0).mark = 0;
+ trip.get(0).e[0].pnl0p = (ST_pointnlink_t) pnlap;
+ trip.get(0).e[0].pnl1p = (ST_pointnlink_t) pnlbp;
+ trip.get(0).e[0].rtp = null;
+ trip.get(0).e[1].pnl0p = (ST_pointnlink_t) pnlbp;
+ trip.get(0).e[1].pnl1p = (ST_pointnlink_t) pnlcp;
+ trip.get(0).e[1].rtp = null;
+ trip.get(0).e[2].pnl0p = (ST_pointnlink_t) pnlcp;
+ trip.get(0).e[2].pnl1p = (ST_pointnlink_t) pnlap;
+ trip.get(0).e[2].rtp = null;
for (ei = 0; ei < 3; ei++)
- trip.getArrayOfStruct("e").plus(ei).getStruct().setPtr("ltp", trip);
+ trip.get(0).e[ei].lrp = trip;
} finally {
LEAVING("7vf9jtj9i8rg0cxrstbqswuck","loadtriangle");
}
@@ -406,23 +399,24 @@ LEAVING("7vf9jtj9i8rg0cxrstbqswuck","loadtriangle");
public static void connecttris(int tri1, int tri2) {
ENTERING("6coujw0qksrgu5sxj0r39qm1u","connecttris");
try {
- triangle_t tri1p, tri2p;
+ ST_triangle_t.Array tri1p;
+ ST_triangle_t.Array tri2p;
int ei, ej;
for (ei = 0; ei < 3; ei++) {
for (ej = 0; ej < 3; ej++) {
- tri1p = (triangle_t) Z.z().tris.plus(tri1);
- tri2p = (triangle_t) Z.z().tris.plus(tri2);
- if ((EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
- tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl0p").getPtr("pp")) &&
- EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"),
- tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl1p").getPtr("pp"))) ||
- (EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
- tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl1p").getPtr("pp")) &&
- EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"),
- tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl0p").getPtr("pp"))))
+ tri1p = Z.z().tris.plusJ(tri1);
+ tri2p = Z.z().tris.plusJ(tri2);
+ if ((EQ(tri1p.get(0).e[ei].pnl0p.pp,
+ tri2p.get(0).e[ej].pnl0p.pp) &&
+ EQ(tri1p.get(0).e[ei].pnl1p.pp,
+ tri2p.get(0).e[ej].pnl1p.pp)) ||
+ (EQ(tri1p.get(0).e[ei].pnl0p.pp,
+ tri2p.get(0).e[ej].pnl1p.pp) &&
+ EQ(tri1p.get(0).e[ei].pnl1p.pp,
+ tri2p.get(0).e[ej].pnl0p.pp)))
{
- tri1p.getArrayOfStruct("e").plus(ei).getStruct().setPtr("rtp", tri2p);
- tri2p.getArrayOfStruct("e").plus(ej).getStruct().setPtr("rtp", tri1p);
+ tri1p.get(0).e[ei].rtp = tri2p;
+ tri2p.get(0).e[ej].rtp = tri1p;
}
}
}
@@ -440,16 +434,16 @@ public static boolean marktripath(int trii, int trij) {
ENTERING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
try {
int ei;
- if (Z.z().tris.plus(trii).getBoolean("mark"))
+ if (Z.z().tris.plusJ(trii).get(0).mark!=0)
return false;
- Z.z().tris.plus(trii).setInt("mark", 1);
+ Z.z().tris.plusJ(trii).get(0).mark = 1;
if (trii == trij)
return ((!(false)));
for (ei = 0; ei < 3; ei++)
- if (Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
- marktripath(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris), trij))
+ if ((Z.z().tris.plusJ(trii).get(0).e[ei].rtp!=null &&
+ marktripath(Z.z().tris.plusJ(trii).get(0).e[ei].rtp.minus(Z.z().tris), trij)))
return ((!(false)));
- Z.z().tris.plus(trii).setInt("mark", 0);
+ Z.z().tris.plusJ(trii).get(0).mark = 0;
return false;
} finally {
LEAVING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
@@ -461,21 +455,21 @@ LEAVING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
//3 44szdl31mg8mt5qrfj70kb2sn
// static void add2dq(int side, pointnlink_t * pnlp)
-public static void add2dq(int side, __ptr__ pnlp) {
+public static void add2dq(int side, ST_pointnlink_t pnlp) {
ENTERING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
try {
if (side == 1) {
- if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
- pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr());
+ if (Z.z().dq.lpnlpi - Z.z().dq.fpnlpi >= 0)
+ pnlp.link = Z.z().dq.pnlps[Z.z().dq.fpnlpi];
/* shortest path links */
- Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("fpnlpi")-1);
- Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).setPtr(pnlp);
+ Z.z().dq.fpnlpi = Z.z().dq.fpnlpi-1;
+ Z.z().dq.pnlps[Z.z().dq.fpnlpi] = pnlp;
} else {
- if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
- pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr());
+ if (Z.z().dq.lpnlpi - Z.z().dq.fpnlpi >= 0)
+ pnlp.link = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
/* shortest path links */
- Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("lpnlpi")+1);
- Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).setPtr(pnlp);
+ Z.z().dq.lpnlpi = Z.z().dq.lpnlpi+1;
+ Z.z().dq.pnlps[Z.z().dq.lpnlpi] = pnlp;
}
} finally {
LEAVING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
@@ -491,9 +485,9 @@ public static void splitdq(int side, int index) {
ENTERING("572sssdz1se16w790xceiy5vr","splitdq");
try {
if (side == 1)
- Z.z().dq.setInt("lpnlpi", index);
+ Z.z().dq.lpnlpi = index;
else
- Z.z().dq.setInt("fpnlpi", index);
+ Z.z().dq.fpnlpi = index;
} finally {
LEAVING("572sssdz1se16w790xceiy5vr","splitdq");
}
@@ -504,19 +498,19 @@ LEAVING("572sssdz1se16w790xceiy5vr","splitdq");
//3 9dnrc8vqpffp5t3bmsackgqtl
// static int finddqsplit(pointnlink_t * pnlp)
-public static int finddqsplit(pointnlink_t pnlp) {
+public static int finddqsplit(ST_pointnlink_t pnlp) {
ENTERING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
try {
int index;
- for (index = Z.z().dq.getInt("fpnlpi"); index < Z.z().dq.getInt("apex"); index++)
- if (ccw(Z.z().dq.getPtr("pnlps").plus(index + 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
+ for (index = Z.z().dq.fpnlpi; index < Z.z().dq.apex; index++)
+ if (ccw(Z.z().dq.pnlps[index + 1].pp, Z.z().dq.pnlps[index].pp, pnlp.pp) ==
1)
return index;
- for (index = Z.z().dq.getInt("lpnlpi"); index > Z.z().dq.getInt("apex"); index--)
- if (ccw(Z.z().dq.getPtr("pnlps").plus(index - 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
+ for (index = Z.z().dq.lpnlpi; index > Z.z().dq.apex; index--)
+ if (ccw(Z.z().dq.pnlps[index - 1].pp, Z.z().dq.pnlps[index].pp, pnlp.pp) ==
2)
return index;
- return Z.z().dq.getInt("apex");
+ return Z.z().dq.apex;
} finally {
LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
}
@@ -527,12 +521,12 @@ LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
//3 72h03s8inxtto2ekvmuqjtj3d
// static int ccw(Ppoint_t * p1p, Ppoint_t * p2p, Ppoint_t * p3p)
-public static int ccw(__ptr__ p1p, __ptr__ p2p, __ptr__ p3p) {
+public static int ccw(ST_pointf p1p, ST_pointf p2p, ST_pointf p3p) {
ENTERING("72h03s8inxtto2ekvmuqjtj3d","ccw");
try {
double d;
- d = ((p1p.getDouble("y") - p2p.getDouble("y")) * (p3p.getDouble("x") - p2p.getDouble("x"))) -
- ((p3p.getDouble("y") - p2p.getDouble("y")) * (p1p.getDouble("x") - p2p.getDouble("x")));
+ d = ((p1p.y - p2p.y) * (p3p.x - p2p.x)) -
+ ((p3p.y - p2p.y) * (p1p.x - p2p.x));
return (d > 0) ? 1 : ((d < 0) ? 2 : 3);
} finally {
LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw");
@@ -544,7 +538,7 @@ LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw");
//3 22a9ajg9t8ovqsigk3tyu3rkd
// static int intersects(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp, Ppoint_t * pdp)
-public static boolean intersects(__ptr__ pap, __ptr__ pbp, __ptr__ pcp, __ptr__ pdp) {
+public static boolean intersects(ST_pointf pap, ST_pointf pbp, ST_pointf pcp, ST_pointf pdp) {
ENTERING("22a9ajg9t8ovqsigk3tyu3rkd","intersects");
try {
int ccw1, ccw2, ccw3, ccw4;
@@ -571,18 +565,18 @@ LEAVING("22a9ajg9t8ovqsigk3tyu3rkd","intersects");
//3 uh5n18rzyevtb4cwpni70qpc
// static int between(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp)
-public static boolean between(__ptr__ pap, __ptr__ pbp, __ptr__ pcp) {
+public static boolean between(ST_pointf pap, ST_pointf pbp, ST_pointf pcp) {
ENTERING("uh5n18rzyevtb4cwpni70qpc","between");
try {
- final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class);
- p1.setDouble("x", pbp.getDouble("x") - pap.getDouble("x"));
- p1.setDouble("y", pbp.getDouble("y") - pap.getDouble("y"));
- p2.setDouble("x", pcp.getDouble("x") - pap.getDouble("x"));
- p2.setDouble("y", pcp.getDouble("y") - pap.getDouble("y"));
+ final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf();
+ p1.setDouble("x", pbp.x - pap.x);
+ p1.setDouble("y", pbp.y - pap.y);
+ p2.setDouble("x", pcp.x - pap.x);
+ p2.setDouble("y", pcp.y - pap.y);
if (ccw(pap, pbp, pcp) != 3)
return false;
- return (p2.getDouble("x") * p1.getDouble("x") + p2.getDouble("y") * p1.getDouble("y") >= 0) &&
- (p2.getDouble("x") * p2.getDouble("x") + p2.getDouble("y") * p2.getDouble("y") <= p1.getDouble("x") * p1.getDouble("x") + p1.getDouble("y") * p1.getDouble("y"));
+ return (p2.x * p1.x + p2.y * p1.y >= 0) &&
+ (p2.x * p2.x + p2.y * p2.y <= p1.x * p1.x + p1.y * p1.y);
} finally {
LEAVING("uh5n18rzyevtb4cwpni70qpc","between");
}
@@ -593,13 +587,13 @@ LEAVING("uh5n18rzyevtb4cwpni70qpc","between");
//3 zti1mzm2m7tr2xwnbf7e8u3d
// static int pointintri(int trii, Ppoint_t * pp)
-public static boolean pointintri(int trii, __ptr__ pp) {
+public static boolean pointintri(int trii, ST_pointf pp) {
ENTERING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri");
try {
int ei, sum;
for (ei = 0, sum = 0; ei < 3; ei++)
- if (ccw(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
- Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"), pp) != 2)
+ if (ccw(Z.z().tris.plusJ(trii).get(0).e[ei].pnl0p.pp,
+ Z.z().tris.plusJ(trii).get(0).e[ei].pnl1p.pp, pp) != 2)
sum++;
return (sum == 3 || sum == 0);
} finally {
@@ -618,22 +612,20 @@ try {
if (newpnln <= Z.z().pnln)
return;
if (N(Z.z().pnls)) {
- if (N(Z.z().pnls = (pointnlink_t) Memory.malloc(sizeof (pointnlink_t.class, newpnln)))) {
+ if (N(Z.z().pnls = malloc(newpnln))) {
UNSUPPORTED("9zyfc4bjg3i6rrna9vqf8doys"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnls"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
- if (N(Z.z().pnlps = Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
+ if (N(Z.z().pnlps = malloc(newpnln))) {
UNSUPPORTED("1etar0wd2cbbvqo4jnmbvjiz4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnlps"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
} else {
- if (N(Z.z().pnls = (pointnlink_t) Memory.realloc(Z.z().pnls,
- sizeof (pointnlink_t.class, newpnln)))) {
+ if (N(Z.z().pnls = realloc(Z.z().pnls, newpnln))) {
UNSUPPORTED("105nogpkt0qqut0yu4alvkk1u"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnls"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
- if (N(Z.z().pnlps = Memory.realloc(Z.z().pnlps,
- sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
+ if (N(Z.z().pnlps = realloc(Z.z().pnlps, newpnln))) {
UNSUPPORTED("be84alh84ub40x4um989aj20d"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnlps"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
@@ -644,6 +636,23 @@ LEAVING("85wstb60jkjd0kbh9tyninm4h","growpnls");
}
}
+private static ST_pointnlink_t[] malloc(int nb) {
+ ST_pointnlink_t result[] = new ST_pointnlink_t[nb];
+ for (int i = 0; i < result.length; i++) {
+ result[i] = new ST_pointnlink_t();
+ }
+ return result;
+}
+private static ST_pointnlink_t[] realloc(ST_pointnlink_t orig[], int nb) {
+ if (orig.length >= nb) {
+ return orig;
+ }
+ ST_pointnlink_t result[] = malloc(nb);
+ for (int i = 0; i < orig.length; i++) {
+ result[i] = orig[i];
+ }
+ return result;
+}
@@ -655,12 +664,12 @@ try {
if (newtrin <= Z.z().trin)
return;
if (N(Z.z().tris)) {
- if (N(Z.z().tris = Memory.malloc(sizeof(triangle_t.class, newtrin)))) {
+ if (N(Z.z().tris = new ST_triangle_t.Array(newtrin))) {
UNSUPPORTED("5782e28cjpaa3dpf8up4zmtq7"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc tris"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
} else {
- if (N(Z.z().tris = Memory.realloc(Z.z().tris, sizeof (triangle_t.class, newtrin)))) {
+ if (N(Z.z().tris = Z.z().tris.reallocJ(newtrin))) {
UNSUPPORTED("d3fgu54pn5tydfhn7z73v73ra"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc tris"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
@@ -672,6 +681,24 @@ LEAVING("c5q8ult6w26jppe5ifzgcoq82","growtris");
}
+private static ST_triangle_t[] malloc2(int nb) {
+ ST_triangle_t result[] = new ST_triangle_t[nb];
+ for (int i = 0; i < result.length; i++) {
+ result[i] = new ST_triangle_t();
+ }
+ return result;
+}
+private static ST_triangle_t[] realloc2(ST_triangle_t orig[], int nb) {
+ if (orig.length >= nb) {
+ return orig;
+ }
+ ST_triangle_t result[] = malloc2(nb);
+ for (int i = 0; i < orig.length; i++) {
+ result[i] = orig[i];
+ }
+ return result;
+}
+
//3 bzym9u6dtatii1vp4hcmofc80
@@ -679,23 +706,21 @@ LEAVING("c5q8ult6w26jppe5ifzgcoq82","growtris");
public static void growdq(int newdqn) {
ENTERING("bzym9u6dtatii1vp4hcmofc80","growdq");
try {
- if (newdqn <= Z.z().dq.getInt("pnlpn"))
+ if (newdqn <= Z.z().dq.pnlpn)
return;
- if (N(Z.z().dq.getPtr("pnlps"))) {
+ if (N(Z.z().dq.pnlps)) {
if (N
- (Z.z().dq.setPtr("pnlps",
- (__ptr__) Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
+ (Z.z().dq.malloc(newdqn))) {
UNSUPPORTED("88fwpb40wz9jc8jiz7u032s4t"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc dq.pnls"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
} else {
- if (N(Z.z().dq.setPtr("pnlps", (__ptr__) Memory.realloc(Z.z().dq.getPtr("pnlps"),
- sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
+ if (N(Z.z().dq.realloc(newdqn))) {
UNSUPPORTED("exqx4ck7h15m8whgip6xpnhoo"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc dq.pnls"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
}
- Z.z().dq.setInt("pnlpn", newdqn);
+ Z.z().dq.pnlpn = newdqn;
} finally {
LEAVING("bzym9u6dtatii1vp4hcmofc80","growdq");
}
@@ -712,13 +737,12 @@ try {
if (newopn <= Z.z().opn_shortest)
return;
if (N(Z.z().ops_shortest)) {
- if (N(Z.z().ops_shortest = Memory.malloc(sizeof(pointf.class, newopn)))) {
+ if (N(Z.z().ops_shortest = new ST_pointf.Array(newopn))) {
UNSUPPORTED("7wxgcgah7iy6vetj5yszoq4k4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc ops"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}
} else {
- if (N(Z.z().ops_shortest = Memory.realloc(Z.z().ops_shortest,
- sizeof(pointf.class, newopn)))) {
+ if (N(Z.z().ops_shortest = Z.z().ops_shortest.reallocJ(newopn))) {
UNSUPPORTED("7azrdo5s3kc44taqmtmeu1s33"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc ops"));
UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
}