1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 10:59:01 +00:00

version 1.2018.13

This commit is contained in:
Arnaud Roques 2018-11-26 19:46:22 +01:00
parent 697ca8f7f2
commit 03e61673a7
322 changed files with 2863 additions and 8523 deletions

View File

@ -30,7 +30,8 @@
Script Author: Julien Eluard Script Author: Julien Eluard
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.sourceforge.plantuml</groupId> <groupId>net.sourceforge.plantuml</groupId>

View File

@ -127,28 +127,28 @@ ENTERING("7ggbhlblmrfr1wq1k20npwyxb","dtclose");
try { try {
ST_dtdisc_s disc; ST_dtdisc_s disc;
int ev = 0; int ev = 0;
if(N(dt) || dt.getInt("nview") > 0 ) /* can't close if being viewed */ if(N(dt) || dt.nview > 0 ) /* can't close if being viewed */
return -1; return -1;
/* announce the close event to see if we should continue */ /* announce the close event to see if we should continue */
disc = (ST_dtdisc_s) dt.disc; disc = (ST_dtdisc_s) dt.disc;
if(disc.getPtr("eventf")!=null && if(disc.eventf!=null &&
(ev = (Integer)disc.call("eventf", dt, 2, null, disc)) < 0) (ev = (Integer)disc.eventf.exe(dt, 2, null, disc)) < 0)
return -1; return -1;
if(dt.getPtr("view")!=null) /* turn off viewing */ if(dt.view!=null) /* turn off viewing */
UNSUPPORTED("1xbo7gf92fmqmu2tzpfeuc0wk"); // dtview(dt,((Dt_t*)0)); UNSUPPORTED("1xbo7gf92fmqmu2tzpfeuc0wk"); // dtview(dt,((Dt_t*)0));
if(ev == 0) /* release all allocated data */ { if(ev == 0) /* release all allocated data */ {
dt.meth.call("searchf", dt, null, 0000100); dt.meth.searchf.exe(dt, null, 0000100);
if(dtsize_(dt) > 0) if(dtsize_(dt) > 0)
return -1; return -1;
if(dt.data.getInt("ntab") > 0) if(dt.data.ntab > 0)
UNSUPPORTED("4ugmcpi8vkb013vuo4wykn0a3"); // (*dt->memoryf)(dt,(void*)dt->data->hh._htab,0,disc); UNSUPPORTED("4ugmcpi8vkb013vuo4wykn0a3"); // (*dt->memoryf)(dt,(void*)dt->data->hh._htab,0,disc);
dt.call("memoryf", dt, dt.data, null, disc); dt.memoryf.exe(dt, dt.data, null, disc);
} }
if(dt.type == 0) if(dt.type == 0)
Memory.free(dt); Memory.free(dt);
else if(ev == 0 && dt.type == 1) else if(ev == 0 && dt.type == 1)
UNSUPPORTED("6wqxv1f7tzvjk0lwmqdrcq8la"); // (*dt->memoryf)(dt, (void*)dt, 0, disc); UNSUPPORTED("6wqxv1f7tzvjk0lwmqdrcq8la"); // (*dt->memoryf)(dt, (void*)dt, 0, disc);
if(disc.getPtr("eventf")!=null) if(disc.eventf!=null)
UNSUPPORTED("8bce06bdd64ypwb17ddloqzu8"); // (void)(*disc->eventf)(dt, 6, ((void*)0), disc); UNSUPPORTED("8bce06bdd64ypwb17ddloqzu8"); // (void)(*disc->eventf)(dt, 6, ((void*)0), disc);
return 0; return 0;
} finally { } finally {

View File

@ -159,18 +159,18 @@ try {
ST_dtdisc_s old; ST_dtdisc_s old;
if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */ if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */
{ dt.setPtr("disc", disc); { 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")); dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
return disc; return disc;
} }
if(N(disc)) /* only want to know current discipline */ if(N(disc)) /* only want to know current discipline */
return old; return old;
searchf = (Dtsearch_f) dt.meth.getPtr("searchf"); searchf = (Dtsearch_f) dt.meth.searchf;
if((dt.data.type&010000)!=0) dtrestore(dt,null); if((dt.data.type&010000)!=0) dtrestore(dt,null);
if(old.getPtr("eventf")!=null && ((Integer)old.call("eventf", dt,3, disc,old)) < 0) if(old.eventf!=null && ((Integer)old.eventf.exe(dt,3, disc,old)) < 0)
return null; return null;
dt.setPtr("disc", disc); 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")); dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
if((dt.data.type&(0000040|0000100|0000020))!=0) if((dt.data.type&(0000040|0000100|0000020))!=0)
UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done; UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done;

View File

@ -149,7 +149,7 @@ try {
dt.setPtr("view", null); dt.setPtr("view", null);
dt.setPtr("walk", null); dt.setPtr("walk", null);
dt.setPtr("user", null); dt.setPtr("user", null);
if(disc.getPtr("eventf")!=null) if(disc.eventf!=null)
{ /* if shared/persistent dictionary, get existing data */ { /* if shared/persistent dictionary, get existing data */
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
// data = ((Dtdata_t*)0); // data = ((Dtdata_t*)0);
@ -176,7 +176,7 @@ try {
// } // }
} }
/* allocate sharable data */ /* allocate sharable data */
if(N(data = (ST_dtdata_s) (dt.call("memoryf", dt,null,sizeof(ST_dtdata_s.class),disc)) )) if(N(data = (ST_dtdata_s) (dt.memoryf.exe(dt,null,sizeof(ST_dtdata_s.class),disc)) ))
{ err_open: { err_open:
Memory.free(dt); Memory.free(dt);
return (null); return (null);

View File

@ -127,7 +127,7 @@ try {
ST_dtlink_s t; ST_dtlink_s t;
//Dtlink_t **s, **ends; //Dtlink_t **s, **ends;
int type; int type;
Dtsearch_f searchf = (Dtsearch_f) dt.meth.getPtr("searchf"); Dtsearch_f searchf = (Dtsearch_f) dt.meth.searchf;
type = dt.data.type&010000; type = dt.data.type&010000;
if(N(list)) /* restoring a flattened dictionary */ if(N(list)) /* restoring a flattened dictionary */
{ if(N(type)) { if(N(type))

View File

@ -58,7 +58,7 @@ import h.ST_dt_s;
import h.ST_dtdisc_s; import h.ST_dtdisc_s;
import h.ST_dthold_s; import h.ST_dthold_s;
import h.ST_dtlink_s; import h.ST_dtlink_s;
import h._dthold_s; import h.ST_dthold_s;
import smetana.core.CFunction; import smetana.core.CFunction;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.__ptr__; import smetana.core.__ptr__;
@ -150,10 +150,10 @@ try {
Dtcompar_f cmpf; Dtcompar_f cmpf;
ST_dtdisc_s disc; ST_dtdisc_s disc;
if (((dt.data.type) & 010000) !=0) { dtrestore(dt,null); } if (((dt.data.type) & 010000) !=0) { dtrestore(dt,null); }
disc = (ST_dtdisc_s) dt.disc; ky = disc.getInt("key"); disc = (ST_dtdisc_s) dt.disc; ky = disc.key;
sz = disc.size; sz = disc.size;
lk = disc.link; lk = disc.link;
cmpf = (Dtcompar_f) disc.getPtr("comparf"); cmpf = (Dtcompar_f) disc.comparf;
dt.setInt("type", dt.type&~0100000); dt.setInt("type", dt.type&~0100000);
root = (ST_dtlink_s) dt.data.here; root = (ST_dtlink_s) dt.data.here;
if(N(obj)) if(N(obj))
@ -161,7 +161,7 @@ try {
return null; return null;
if((type&0000100)!=0) /* delete all objects */ if((type&0000100)!=0) /* delete all objects */
{ {
if(disc.getPtr("freef")!=null || disc.link < 0) { if(disc.freef!=null || disc.link < 0) {
do { do {
while((t = (ST_dtlink_s) root._left)!=null ) { while((t = (ST_dtlink_s) root._left)!=null ) {
root._left = t.right; root._left = t.right;
@ -169,11 +169,11 @@ try {
root = t; root = t;
} }
t = (ST_dtlink_s) root.right; t = (ST_dtlink_s) root.right;
if(disc.getPtr("freef")!=null) if(disc.freef!=null)
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
// (*disc->freef)(dt,(lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ),disc); // (*disc->freef)(dt,(lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ),disc);
if(disc.link < 0) if(disc.link < 0)
dt.call("memoryf", dt, root, null, disc); dt.memoryf.exe(dt, root, null, disc);
} while((root = t)!=null ); } while((root = t)!=null );
} }
dt.data.setInt("size", 0); dt.data.setInt("size", 0);
@ -196,7 +196,7 @@ try {
} }
} }
dt.data.here = root; dt.data.here = root;
return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk) ); 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 */ /* note that link.right is LEFT tree and link.left is RIGHT tree */
@ -232,14 +232,14 @@ try {
// if(root) // if(root)
// goto do_search; // 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)); { key = (sz < 0 ? ((__ptr__)obj).addVirtualBytes(ky) : ((__ptr__)obj).addVirtualBytes(ky));
throw new do_search(); throw new do_search();
} }
} catch (do_search do_search) { } catch (do_search do_search) {
// do_search: // do_search:
if(dt.meth.type == 0000004 && if(dt.meth.type == 0000004 &&
(minp = dt.data.getInt("minp")) != 0 && (type&(0001000|0000004))!=0) (minp = dt.data.minp) != 0 && (type&(0001000|0000004))!=0)
{ /* simple search, note that minp should be even */ { /* simple search, note that minp should be even */
// for(t = root, n = 0; n < minp; ++n) // 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)); // { k = (lk < 0 ? ((Dthold_t*)(t))->obj : (void*)((char*)(t) - lk) ); k = (void*)(sz < 0 ? *((char**)((char*)(k)+ky)) : ((char*)(k)+ky));
@ -283,7 +283,7 @@ try {
throw new UnsupportedOperationException("do_search1"); throw new UnsupportedOperationException("do_search1");
} }
while(true) { 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); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) : 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) (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) == 0)
@ -291,7 +291,7 @@ try {
else if(cmp < 0) else if(cmp < 0)
{ if((t = (ST_dtlink_s) root._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); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) 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) : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) < 0)
@ -328,7 +328,7 @@ try {
else /* if(cmp > 0) */ else /* if(cmp > 0) */
{ if ((t = (ST_dtlink_s) root.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); k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) 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) : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) > 0)
@ -425,19 +425,19 @@ try {
root.right = link._left; root.right = link._left;
link._left = root; link._left = root;
/*dt_insert: DUPLICATION*/ /*dt_insert: DUPLICATION*/
if(disc.getPtr("makef")!=null && (type&0000001)!=0) if(disc.makef!=null && (type&0000001)!=0)
obj = (__ptr__) disc.call("makef", dt,obj,disc); obj = (__ptr__) disc.makef.exe(dt,obj,disc);
if(obj!=null) if(obj!=null)
{ {
if(lk >= 0) if(lk >= 0)
root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class); root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
else else
{ {
root = (ST_dtlink_s)(((ST_dthold_s)dt.call("memoryf", root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
dt,null,sizeof(_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
if(root!=null) if(root!=null)
root.castTo(_dthold_s.class).setPtr("obj", obj); root.castTo(ST_dthold_s.class).setPtr("obj", obj);
else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null && else if(disc.makef!=null && disc.freef!=null &&
((type&0000001))!=0) ((type&0000001))!=0)
UNSUPPORTED("(*disc->freef)(dt,obj,disc);"); UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
} }
@ -494,19 +494,19 @@ try {
} }
else if((type&(0000001|0004000))!=0) else if((type&(0000001|0004000))!=0)
{ /*dt_insert: DUPLICATION*/ { /*dt_insert: DUPLICATION*/
if(disc.getPtr("makef")!=null && (type&0000001)!=0) if(disc.makef!=null && (type&0000001)!=0)
obj = (__ptr__) disc.call("makef", dt,obj,disc); obj = (__ptr__) disc.makef.exe(dt,obj,disc);
if(obj!=null) if(obj!=null)
{ {
if(lk >= 0) if(lk >= 0)
root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class); root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
else else
{ {
root = (ST_dtlink_s)(((ST_dthold_s)dt.call("memoryf", root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
dt,null,sizeof(_dthold_s.class),disc)).castTo(ST_dtlink_s.class)); dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
if(root!=null) if(root!=null)
root.castTo(_dthold_s.class).setPtr("obj", obj); root.castTo(ST_dthold_s.class).setPtr("obj", obj);
else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null && else if(disc.makef!=null && disc.freef!=null &&
((type&0000001))!=0) ((type&0000001))!=0)
UNSUPPORTED("(*disc->freef)(dt,obj,disc);"); UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
} }
@ -550,7 +550,7 @@ try {
// } // }
} }
dt.data.here = root; dt.data.here = root;
return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk)); return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk));
} catch (no_root no_root) { } catch (no_root no_root) {
while((t = (ST_dtlink_s) r._left)!=null) while((t = (ST_dtlink_s) r._left)!=null)
r = t; r = t;

View File

@ -138,11 +138,11 @@ try {
Dtcompar_f cmpf; Dtcompar_f cmpf;
/* these operations only happen at the top level */ /* these operations only happen at the top level */
if ((type&(0000001|0000002|0000100|0000040))!=0) if ((type&(0000001|0000002|0000100|0000040))!=0)
return (__ptr__) dt.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 */ if(((type&(0001000|0000004))!=0) || /* order sets first/last done below */
(((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) ) (((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) )
{ for(d = dt; d!=null; d = (ST_dt_s) d.getPtr("view")) { for(d = dt; d!=null; d = (ST_dt_s) d.view)
if((o = (__ptr__) d.meth.call("searchf", d,obj,type))!=null ) if((o = (__ptr__) d.meth.searchf.exe(d,obj,type))!=null )
break; break;
dt.setPtr("walk", d); dt.setPtr("walk", d);
return o; return o;
@ -151,13 +151,13 @@ try {
{ if(N(type & (0000200|0000400|0000010|0000020)) ) { if(N(type & (0000200|0000400|0000010|0000020)) )
return null; return null;
n = nk = null; p = null; n = nk = null; p = null;
for(d = dt; d!=null; d = (ST_dt_s) d.getPtr("view")) for(d = dt; d!=null; d = (ST_dt_s) d.view)
{ if(N(o = (__ptr__) d.meth.call("searchf", d, obj, type) )) { if(N(o = (__ptr__) d.meth.searchf.exe(d, obj, type) ))
continue; continue;
ky = d.disc.getInt("key"); ky = d.disc.key;
sz = d.disc.size; sz = d.disc.size;
lk = d.disc.link; lk = d.disc.link;
cmpf = (Dtcompar_f) d.disc.getPtr("comparf"); cmpf = (Dtcompar_f) d.disc.comparf;
ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky)); ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky));
if(n!=null) /* get the right one among all dictionaries */ if(n!=null) /* get the right one among all dictionaries */
{ 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)")) ); { 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)")) );
@ -225,22 +225,22 @@ try {
UNSUPPORTED("return null;"); UNSUPPORTED("return null;");
} }
/* make sure there won't be a cycle */ /* make sure there won't be a cycle */
for(d = view; d!=null; d = (ST_dt_s)d.getPtr("view")) for(d = view; d!=null; d = (ST_dt_s)d.view)
if(EQ(d, dt)) if(EQ(d, dt))
return null; return null;
/* no more viewing lower dictionary */ /* no more viewing lower dictionary */
if((d = (ST_dt_s)dt.getPtr("view"))!=null ) if((d = (ST_dt_s)dt.view)!=null )
d.setInt("nview", d.getInt("nview")-1); d.setInt("nview", d.nview-1);
dt.setPtr("walk", null); dt.setPtr("walk", null);
dt.setPtr("view", null); dt.setPtr("view", null);
if(N(view)) if(N(view))
{ dt.setPtr("searchf", dt.meth.getPtr("searchf")); { dt.setPtr("searchf", dt.meth.searchf);
return d; return d;
} }
/* ok */ /* ok */
dt.setPtr("view", view); dt.setPtr("view", view);
dt.setPtr("searchf", function(dtview__c.class, "dtvsearch")); dt.setPtr("searchf", function(dtview__c.class, "dtvsearch"));
view.setInt("nview", view.getInt("nview")+1 ); view.setInt("nview", view.nview+1 );
return view; return view;
} finally { } finally {
LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview"); LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview");

View File

@ -56,8 +56,8 @@ import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.AGTYPE; import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agraph_s;
import h.ST_Agobj_s; import h.ST_Agobj_s;
import h.ST_Agraph_s;
import smetana.core.CFunction; import smetana.core.CFunction;
import smetana.core.__ptr__; import smetana.core.__ptr__;
@ -233,7 +233,7 @@ throw new UnsupportedOperationException();
public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) { public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) {
ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search"); ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search");
try { try {
return (ST_Agobj_s) sub.castTo(ST_Agobj_s.class); return (ST_Agobj_s) sub.castTo_ST_Agobj_s();
} finally { } finally {
LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search"); LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search");
} }

View File

@ -294,14 +294,14 @@ try {
if (dd!=null) if (dd!=null)
switch (kind) { switch (kind) {
case AGRAPH: case AGRAPH:
dict = (ST_dt_s) dd.getPtr("dict.g"); dict = (ST_dt_s) dd.dict_g;
break; break;
case AGNODE: case AGNODE:
dict = (ST_dt_s) dd.getPtr("dict.n"); dict = (ST_dt_s) dd.dict_n;
break; break;
case AGINEDGE: case AGINEDGE:
case AGOUTEDGE: case AGOUTEDGE:
dict = (ST_dt_s) dd.getPtr("dict.e"); dict = (ST_dt_s) dd.dict_e;
break; break;
default: default:
System.err.println("agdictof: unknown kind "+ kind); System.err.println("agdictof: unknown kind "+ kind);
@ -374,17 +374,17 @@ try {
dd.setPtr("dict.g", 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) { if ((par = agparent(g))!=null) {
parent_dd = agdatadict(par, false); parent_dd = agdatadict(par, false);
dtview((ST_dt_s)dd.getPtr("dict.n"), (ST_dt_s)parent_dd.getPtr("dict.n")); dtview((ST_dt_s)dd.dict_n, (ST_dt_s)parent_dd.dict_n);
dtview((ST_dt_s)dd.getPtr("dict.e"), (ST_dt_s)parent_dd.getPtr("dict.e")); dtview((ST_dt_s)dd.dict_e, (ST_dt_s)parent_dd.dict_e);
dtview((ST_dt_s)dd.getPtr("dict.g"), (ST_dt_s)parent_dd.getPtr("dict.g")); dtview((ST_dt_s)dd.dict_g, (ST_dt_s)parent_dd.dict_g);
} else { } else {
if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) { if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) {
/* it's not ok to dtview here for several reasons. the proto /* it's not ok to dtview here for several reasons. the proto
graph could change, and the sym indices don't match */ graph could change, and the sym indices don't match */
parent_dd = agdatadict(Z.z().ProtoGraph, false); parent_dd = agdatadict(Z.z().ProtoGraph, false);
agcopydict(parent_dd.getPtr("dict.n"), dd.getPtr("dict.n"), g, AGNODE); agcopydict(parent_dd.dict_n, dd.dict_n, g, AGNODE);
agcopydict(parent_dd.getPtr("dict.e"), dd.getPtr("dict.e"), g, AGEDGE); agcopydict(parent_dd.dict_e, dd.dict_e, g, AGEDGE);
agcopydict(parent_dd.getPtr("dict.g"), dd.getPtr("dict.g"), g, AGRAPH); agcopydict(parent_dd.dict_g, dd.dict_g, g, AGRAPH);
} }
} }
return dd; return dd;
@ -403,7 +403,7 @@ ENTERING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
try { try {
ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class); ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class);
key.setPtr("name", name); key.setPtr("name", name);
return (ST_Agsym_s) dict.call("searchf", (dict),key,0000004); return (ST_Agsym_s) dict.searchf.exe((dict),key,0000004);
} finally { } finally {
LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym"); LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
} }
@ -494,9 +494,9 @@ try {
sz = 4; sz = 4;
rec.str = new ArrayList<CString>(); for (int i=0; i<sz; i++) rec.str.add(null); 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 */ /* doesn't call agxset() so no obj-modified callbacks occur */
for (sym = (ST_Agsym_s) ((__ptr__)datadict.call("searchf", datadict,null,0000200)); sym!=null; for (sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,null,0000200)); sym!=null;
sym = (ST_Agsym_s) ((__ptr__)datadict.call("searchf", datadict,sym,0000010))) sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,sym,0000010)))
rec.str.set(sym.getInt("id"), agstrdup(agraphof(obj), sym.defval)); rec.str.set(sym.id, agstrdup(agraphof(obj), sym.defval));
} else { } else {
} }
return (ST_Agrec_s) rec.castTo(ST_Agrec_s.class); return (ST_Agrec_s) rec.castTo(ST_Agrec_s.class);
@ -575,13 +575,13 @@ try {
ST_Agattr_s attr; ST_Agattr_s attr;
attr = (ST_Agattr_s) agattrrec(obj); attr = (ST_Agattr_s) agattrrec(obj);
if (sym.getInt("id") >= 4) if (sym.id >= 4)
// attr.str = (StarArrayOfCString) g.clos.disc.mem.call("resize", g.clos.state.mem, // attr.str = (StarArrayOfCString) g.clos.disc.mem.call("resize", g.clos.state.mem,
// attr.str, // attr.str,
// sizeof("char*", sym.getInt("id")), // sizeof("char*", sym.id),
// sizeof("char*", sym.getInt("id") + 1)); // sizeof("char*", sym.id + 1));
attr.str.add(null); attr.str.add(null);
attr.str.set(sym.getInt("id"), agstrdup(g, sym.defval)); attr.str.set(sym.id, agstrdup(g, sym.defval));
/* agmethod_upd(g,obj,sym); JCE and GN didn't like this. */ /* agmethod_upd(g,obj,sym); JCE and GN didn't like this. */
} finally { } finally {
LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr"); LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
@ -614,13 +614,13 @@ try {
} else { } else {
psym = agdictsym(ldict, name); /* search with viewpath up to root */ psym = agdictsym(ldict, name); /* search with viewpath up to root */
if (psym!=null) { /* new local definition */ if (psym!=null) { /* new local definition */
lsym = agnewsym(g, name, value, psym.getInt("id"), kind); lsym = agnewsym(g, name, value, psym.id, kind);
ldict.castTo(ST_dt_s.class).call("searchf",ldict,lsym,0000001); ldict.searchf.exe(ldict,lsym,0000001);
rv = lsym; rv = lsym;
} else { /* new global definition */ } else { /* new global definition */
rdict = agdictof(root, kind); rdict = agdictof(root, kind);
rsym = agnewsym(g, name, value, dtsize_(rdict), kind); rsym = agnewsym(g, name, value, dtsize_(rdict), kind);
rdict.castTo(ST_dt_s.class).call("searchf",rdict,rsym,0000001); rdict.searchf.exe(rdict,rsym,0000001);
switch (kind) { switch (kind) {
case AGRAPH: case AGRAPH:
agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"), agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"),
@ -726,7 +726,7 @@ try {
/* Agdatadict_t *dd; */ /* Agdatadict_t *dd; */
/* Agrec_t *attr; */ /* Agrec_t *attr; */
ST_Agraph_s context; ST_Agraph_s context;
((ST_Agdesc_s)g.getStruct("desc")).has_attrs = 1; ((ST_Agdesc_s)g.desc).has_attrs = 1;
/* dd = */ agmakedatadict(g); /* dd = */ agmakedatadict(g);
if (N(context = agparent(g))) if (N(context = agparent(g)))
context = g; context = g;
@ -849,7 +849,7 @@ try {
rv = null; /* note was "", but this provides more info */ rv = null; /* note was "", but this provides more info */
else { else {
data = agattrrec(obj.castTo(ST_Agobj_s.class)); data = agattrrec(obj.castTo(ST_Agobj_s.class));
rv = data.str.get(sym.getInt("id")); rv = data.str.get(sym.id);
} }
return rv; return rv;
} finally { } finally {
@ -869,7 +869,7 @@ try {
CString rv; CString rv;
data = agattrrec(obj.castTo(ST_Agobj_s.class)); data = agattrrec(obj.castTo(ST_Agobj_s.class));
rv = data.str.get(sym.getInt("id")); rv = data.str.get(sym.id);
return rv; return rv;
} finally { } finally {
LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget"); LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget");
@ -913,18 +913,18 @@ try {
hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class); hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class);
data = agattrrec(hdr); data = agattrrec(hdr);
agstrfree(g, data.str.get(sym.getInt("id"))); agstrfree(g, data.str.get(sym.id));
data.str.set(sym.getInt("id"), agstrdup(g, value)); data.str.set(sym.id, agstrdup(g, value));
if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) { if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) {
/* also update dict default */ /* also update dict default */
ST_dt_s dict; ST_dt_s dict;
dict = (ST_dt_s) agdatadict(g, false).getPtr("dict.g"); dict = (ST_dt_s) agdatadict(g, false).dict_g;
if ((lsym = aglocaldictsym(dict, sym.name))!=null) { if ((lsym = aglocaldictsym(dict, sym.name))!=null) {
agstrfree(g, lsym.defval); agstrfree(g, lsym.defval);
lsym.setPtr("defval", agstrdup(g, value)); lsym.setPtr("defval", agstrdup(g, value));
} else { } else {
lsym = agnewsym(g, sym.name, value, sym.getInt("id"), AGTYPE(hdr)); lsym = agnewsym(g, sym.name, value, sym.id, AGTYPE(hdr));
dict.call("searchf", dict, lsym, 0000001); dict.searchf.exe(dict, lsym, 0000001);
} }
} }
agmethod_upd(g, obj, sym); agmethod_upd(g, obj, sym);

View File

@ -79,13 +79,12 @@ import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT; import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agedge_s;
import h.ST_Agraph_s;
import h.ST_Agattr_s; import h.ST_Agattr_s;
import h.ST_Agdesc_s; import h.ST_Agdesc_s;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agedgepair_s; import h.ST_Agedgepair_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agsubnode_s; import h.ST_Agsubnode_s;
import h.ST_Agtag_s; import h.ST_Agtag_s;
import h.ST_dt_s; import h.ST_dt_s;
@ -93,7 +92,6 @@ import h.ST_dtdisc_s;
import h.ST_dtlink_s; import h.ST_dtlink_s;
import smetana.core.ACCESS; import smetana.core.ACCESS;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory;
import smetana.core.STARSTAR; import smetana.core.STARSTAR;
import smetana.core.Z; import smetana.core.Z;
import smetana.core.__ptr__; import smetana.core.__ptr__;
@ -243,14 +241,14 @@ public static ST_Agedge_s agfstout(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("9vamtktowqtk4955i546z9obw","agfstout"); ENTERING("9vamtktowqtk4955i546z9obw","agfstout");
try { try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
__ptr__ e = null; ST_Agedge_s e = null;
sn = agsubrep(g, n); sn = agsubrep(g, n);
if (sn!=null) { if (sn!=null) {
dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("out_seq")); dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
e = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200); e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
sn.setPtr("out_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); sn.out_seq = dtextract((ST_dt_s)g.e_seq);
} }
return e==null? null : (ST_Agedge_s) e.getPtr(); return e;
} finally { } finally {
LEAVING("9vamtktowqtk4955i546z9obw","agfstout"); LEAVING("9vamtktowqtk4955i546z9obw","agfstout");
} }
@ -266,15 +264,15 @@ ENTERING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
try { try {
ST_Agnode_s n; ST_Agnode_s n;
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
__ptr__ f = null; ST_Agedge_s f = null;
n = AGTAIL(e); n = AGTAIL(e);
sn = agsubrep(g, n); sn = agsubrep(g, n);
if (sn!=null) { if (sn!=null) {
dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("out_seq")); dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
f = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010); f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
sn.setPtr("out_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); sn.out_seq = dtextract((ST_dt_s)g.e_seq);
} }
return f==null?null:(ST_Agedge_s)f.getPtr(); return f;
} finally { } finally {
LEAVING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout"); LEAVING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
} }
@ -289,14 +287,14 @@ public static ST_Agedge_s agfstin(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin"); ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin");
try { try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
__ptr__ e = null; ST_Agedge_s e = null;
sn = agsubrep(g, n); sn = agsubrep(g, n);
if (sn!=null) { if (sn!=null) {
dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("in_seq")); dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
e = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200); e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
sn.setPtr("in_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
} }
return e==null?null:(ST_Agedge_s)e.getPtr(); return e;
} finally { } finally {
LEAVING("c60qt3ycq0xweabgtqt16xe93","agfstin"); LEAVING("c60qt3ycq0xweabgtqt16xe93","agfstin");
} }
@ -312,15 +310,15 @@ ENTERING("f2af4x97mqn16npd6alsw7avs","agnxtin");
try { try {
ST_Agnode_s n; ST_Agnode_s n;
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
__ptr__ f = null; ST_Agedge_s f = null;
n = AGHEAD(e); n = AGHEAD(e);
sn = agsubrep(g, n); sn = agsubrep(g, n);
if (sn!=null) { if (sn!=null) {
dtrestore((ST_dt_s)g.getPtr("e_seq"), (ST_dtlink_s)sn.getPtr("in_seq")); dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
f = (__ptr__) g.getPtr("e_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010); f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
sn.setPtr("in_seq", dtextract((ST_dt_s)g.getPtr("e_seq"))); sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
} }
return f==null?null:(ST_Agedge_s)f.getPtr(); return f;
} finally { } finally {
LEAVING("f2af4x97mqn16npd6alsw7avs","agnxtin"); LEAVING("f2af4x97mqn16npd6alsw7avs","agnxtin");
} }
@ -358,13 +356,13 @@ try {
if (rv == null) { if (rv == null) {
do { do {
rv = N(rv) ? agfstin(g, n) : agnxtin(g,rv); 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 { } else {
do { do {
rv = agnxtin(g, e); /* so that we only see each edge once, */ rv = agnxtin(g, e); /* so that we only see each edge once, */
e = rv; 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; return rv;
} finally { } finally {
@ -384,7 +382,7 @@ return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy());
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) { 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"); ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
try { try {
__ptr__ e; ST_Agedge_s e;
final ST_Agedge_s template = new ST_Agedge_s(); final ST_Agedge_s template = new ST_Agedge_s();
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
if ((t == null) || (h == null)) if ((t == null) || (h == null))
@ -394,11 +392,11 @@ try {
sn = agsubrep(g, h); sn = agsubrep(g, h);
if (N(sn)) e = null; if (N(sn)) e = null;
else { else {
dtrestore((ST_dt_s)g.getPtr("e_id"), (ST_dtlink_s)sn.getPtr("in_id")); dtrestore((ST_dt_s)g.e_id, (ST_dtlink_s)sn.in_id);
e = ((__ptr__)g.getPtr("e_id").castTo(ST_dt_s.class).call("searchf", g.getPtr("e_id"),template,0000004)); e = ((ST_Agedge_s)g.e_id.searchf.exe(g.e_id,template,0000004));
sn.setPtr("in_id", dtextract((ST_dt_s)g.getPtr("e_id"))); sn.setPtr("in_id", dtextract((ST_dt_s)g.e_id));
} }
return e==null?null:(ST_Agedge_s)e.getPtr(); return e;
} finally { } finally {
LEAVING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key"); LEAVING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
} }
@ -433,10 +431,10 @@ ENTERING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
try { try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
final ST_Agsubnode_s template = new ST_Agsubnode_s(); final ST_Agsubnode_s template = new ST_Agsubnode_s();
if (EQ(g, n.getPtr("root"))) sn = (ST_Agsubnode_s) n.mainsub; if (EQ(g, n.root)) sn = (ST_Agsubnode_s) n.mainsub;
else { else {
template.setPtr("node", n); template.setPtr("node", n);
sn = (ST_Agsubnode_s) g.getPtr("n_id").castTo(ST_dt_s.class).call("searchf", g.getPtr("n_id"), template, 0000004); sn = (ST_Agsubnode_s) g.n_id.searchf.exe(g.n_id, template, 0000004);
} }
return sn; return sn;
} finally { } finally {
@ -453,7 +451,7 @@ public static void ins(ST_dt_s d, STARSTAR<ST_dtlink_s> set, ST_Agedge_s e) {
ENTERING("6u0niow33w9gva780waluva4n","ins"); ENTERING("6u0niow33w9gva780waluva4n","ins");
try { try {
dtrestore(d, set.getMe()); dtrestore(d, set.getMe());
d.call("searchf", d,e,0000001); d.searchf.exe(d,e,0000001);
set.setMe(dtextract(d)); set.setMe(dtextract(d));
} finally { } finally {
LEAVING("6u0niow33w9gva780waluva4n","ins"); LEAVING("6u0niow33w9gva780waluva4n","ins");
@ -496,38 +494,38 @@ try {
while (g!=null) { while (g!=null) {
if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break; if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break;
sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn; sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn;
ins((ST_dt_s)g.getPtr("e_seq"), ins((ST_dt_s)g.e_seq,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn1.getPtr("out_seq"); return (ST_dtlink_s) sn1.out_seq;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn1.setPtr("out_seq", obj); sn1.setPtr("out_seq", obj);
}}) }})
, (ST_Agedge_s)out); , (ST_Agedge_s)out);
ins((ST_dt_s)g.getPtr("e_id"), ins((ST_dt_s)g.e_id,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn1.getPtr("out_id"); return (ST_dtlink_s) sn1.out_id;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn1.setPtr("out_id", obj); sn1.setPtr("out_id", obj);
}}) }})
, (ST_Agedge_s)out); , (ST_Agedge_s)out);
sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn; sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn;
ins((ST_dt_s)g.getPtr("e_seq"), ins((ST_dt_s)g.e_seq,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn2.getPtr("in_seq"); return (ST_dtlink_s) sn2.in_seq;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn2.setPtr("in_seq", obj); sn2.setPtr("in_seq", obj);
}}) }})
, (ST_Agedge_s)in); , (ST_Agedge_s)in);
ins((ST_dt_s)g.getPtr("e_id"), ins((ST_dt_s)g.e_id,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn2.getPtr("in_id"); return (ST_dtlink_s) sn2.in_id;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn2.setPtr("in_id", obj); sn2.setPtr("in_id", obj);
@ -581,7 +579,7 @@ try {
in.setPtr("node", t); in.setPtr("node", t);
out.setPtr("node", h); out.setPtr("node", h);
installedge(g, out); installedge(g, out);
if (((ST_Agdesc_s)g.getStruct("desc")).has_attrs!=0) { if (((ST_Agdesc_s)g.desc).has_attrs!=0) {
agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false); agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false);
agedgeattr_init(g, out); agedgeattr_init(g, out);
} }
@ -792,14 +790,14 @@ LEAVING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
//3 avk47eh26r45qk2dtoipwiqvz //3 avk47eh26r45qk2dtoipwiqvz
// int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) // int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
public static int agedgeidcmpf(ST_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, ST_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"); ENTERING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
try { try {
int v; int v;
ST_Agedge_s e0, e1; ST_Agedge_s e0, e1;
e0 = (ST_Agedge_s) arg_e0.getPtr(); e0 = (ST_Agedge_s) arg_e0;
e1 = (ST_Agedge_s) arg_e1.getPtr(); e1 = (ST_Agedge_s) arg_e1;
v = AGID(e0.getPtr("node")) - AGID(e1.getPtr("node")); v = AGID(e0.node) - AGID(e1.node);
if (v == 0) { /* same node */ if (v == 0) { /* same node */
if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0)) if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0))
v = 0; v = 0;
@ -817,14 +815,14 @@ LEAVING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
//3 b6jhzc16xvrknu4e7jp6zx0ue //3 b6jhzc16xvrknu4e7jp6zx0ue
// int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc) // int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
public static int agedgeseqcmpf(ST_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, ST_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"); ENTERING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf");
try { try {
int v; int v;
ST_Agedge_s e0, e1; ST_Agedge_s e0, e1;
e0 = (ST_Agedge_s) arg_e0.getPtr(); e0 = (ST_Agedge_s) arg_e0;
e1 = (ST_Agedge_s) arg_e1.getPtr(); e1 = (ST_Agedge_s) arg_e1;
if (NEQ(e0.getPtr("node"), e1.getPtr("node"))) v = AGSEQ(e0.getPtr("node")) - AGSEQ(e1.getPtr("node")); if (NEQ(e0.node, e1.node)) v = AGSEQ(e0.node) - AGSEQ(e1.node);
else v = (AGSEQ(e0) - AGSEQ(e1)); else v = (AGSEQ(e0) - AGSEQ(e1));
return ((v==0)?0:(v<0?-1:1)); return ((v==0)?0:(v<0?-1:1));
} finally { } finally {

View File

@ -69,12 +69,12 @@ import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT; import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agdisc_s;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agclos_s; import h.ST_Agclos_s;
import h.ST_Agdesc_s; import h.ST_Agdesc_s;
import h.ST_Agdisc_s;
import h.ST_Agmemdisc_s; import h.ST_Agmemdisc_s;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agsubnode_s; import h.ST_Agsubnode_s;
import h.ST_dt_s; import h.ST_dt_s;
import h.ST_dtdisc_s; import h.ST_dtdisc_s;
@ -233,14 +233,14 @@ try {
__ptr__ memclosure; __ptr__ memclosure;
ST_Agclos_s rv; ST_Agclos_s rv;
/* establish an allocation arena */ /* establish an allocation arena */
memdisc = (ST_Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z.z().AgMemDisc); memdisc = (ST_Agmemdisc_s) ((proto != null && proto.mem != null) ? proto.mem : Z.z().AgMemDisc);
memclosure = (__ptr__) memdisc.call("open", proto); memclosure = (__ptr__) memdisc.open.exe(proto);
rv = (ST_Agclos_s) memdisc.call("alloc", memclosure, sizeof(ST_Agclos_s.class)); rv = (ST_Agclos_s) memdisc.alloc.exe(memclosure, sizeof(ST_Agclos_s.class));
rv.getStruct("disc").setPtr("mem", memdisc); rv.disc.setPtr("mem", memdisc);
rv.getStruct("state").setPtr("mem", memclosure); rv.state.setPtr("mem", memclosure);
rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc)); 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 // 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().AgIoDisc)); // rv.disc.setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc));
rv.callbacks_enabled = (N(0)); rv.callbacks_enabled = (N(0));
return rv; return rv;
} finally { } finally {
@ -264,13 +264,13 @@ try {
ST_Agclos_s clos; ST_Agclos_s clos;
int gid[] = new int[1]; int gid[] = new int[1];
clos = agclos(arg_disc); clos = agclos(arg_disc);
g = (ST_Agraph_s) clos.getStruct("disc").getPtr("mem").call("alloc", clos.getStruct("state").getPtr("mem"), sizeof(ST_Agraph_s.class)); g = (ST_Agraph_s) clos.disc.mem.alloc.exe(clos.state.mem, sizeof(ST_Agraph_s.class));
AGTYPE(g, AGRAPH); AGTYPE(g, AGRAPH);
g.setPtr("clos", clos); g.setPtr("clos", clos);
g.setStruct("desc", desc); 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.setPtr("root", g);
g.clos.getStruct("state").setPtr("id", (__ptr__) g.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) if (agmapnametoid(g, AGRAPH, name, gid, (N(0)))!=0)
AGID(g, gid[0]); AGID(g, gid[0]);
// /* else AGID(g) = 0 because we have no alternatives */ // /* else AGID(g) = 0 because we have no alternatives */
@ -299,9 +299,9 @@ try {
par = agparent(g); par = agparent(g);
if (par!=null) { if (par!=null) {
AGSEQ(g, agnextseq(par, AGRAPH)); 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 */ } /* 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); agraphattr_init(g);
agmethod_init(g, g); agmethod_init(g, g);
return g; return g;
@ -399,7 +399,7 @@ LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
public static int agnnodes(ST_Agraph_s g) { public static int agnnodes(ST_Agraph_s g) {
ENTERING("688euygrkbl10cveflgwalo2n","agnnodes"); ENTERING("688euygrkbl10cveflgwalo2n","agnnodes");
try { try {
return dtsize_((ST_dt_s)g.getPtr("n_id")); return dtsize_((ST_dt_s)g.n_id);
} finally { } finally {
LEAVING("688euygrkbl10cveflgwalo2n","agnnodes"); LEAVING("688euygrkbl10cveflgwalo2n","agnnodes");
} }
@ -445,7 +445,7 @@ throw new UnsupportedOperationException();
public static boolean agisdirected(ST_Agraph_s g) { public static boolean agisdirected(ST_Agraph_s g) {
ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected"); ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
try { try {
return ((ST_Agdesc_s)g.getStruct("desc")).directed!=0; return ((ST_Agdesc_s)g.desc).directed!=0;
} finally { } finally {
LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected"); LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
} }
@ -473,7 +473,7 @@ LEAVING("8thgds4eioot64flko26m8ns0","agisundirected");
public static boolean agisstrict(ST_Agraph_s g) { public static boolean agisstrict(ST_Agraph_s g) {
ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict"); ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
try { try {
return ((ST_Agdesc_s)g.getStruct("desc")).strict!=0; return ((ST_Agdesc_s)g.desc).strict!=0;
} finally { } finally {
LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict"); LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
} }
@ -550,19 +550,19 @@ try {
sn = agsubrep(g, n); sn = agsubrep(g, n);
final ST_Agsubnode_s sn1 = sn; final ST_Agsubnode_s sn1 = sn;
if (sn!=null) { if (sn!=null) {
if (want_out) rv += cnt((ST_dt_s)g.getPtr("e_seq"), if (want_out) rv += cnt((ST_dt_s)g.e_seq,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn1.getPtr("out_seq"); return (ST_dtlink_s) sn1.out_seq;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn1.setPtr("out_seq", obj); sn1.setPtr("out_seq", obj);
}}) }})
); );
if (want_in) rv += cnt((ST_dt_s)g.getPtr("e_seq"), if (want_in) rv += cnt((ST_dt_s)g.e_seq,
STARSTAR.amp(new ACCESS<ST_dtlink_s>() { STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
public ST_dtlink_s get() { public ST_dtlink_s get() {
return (ST_dtlink_s) sn1.getPtr("in_seq"); return (ST_dtlink_s) sn1.in_seq;
} }
public void set(ST_dtlink_s obj) { public void set(ST_dtlink_s obj) {
sn1.setPtr("in_seq", obj); sn1.setPtr("in_seq", obj);
@ -580,13 +580,13 @@ LEAVING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
//3 dhbtfzzp8n5yygqmhmluo9bxl //3 dhbtfzzp8n5yygqmhmluo9bxl
// int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc) // int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
public static int agraphidcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_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"); ENTERING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf");
try { try {
int v; int v;
ST_Agraph_s sg0, sg1; ST_Agraph_s sg0, sg1;
sg0 = (ST_Agraph_s) arg0.getPtr(); sg0 = (ST_Agraph_s) arg0;
sg1 = (ST_Agraph_s) arg1.getPtr(); sg1 = (ST_Agraph_s) arg1;
v = (AGID(sg0) - AGID(sg1)); v = (AGID(sg0) - AGID(sg1));
return ((v==0)?0:(v<0?-1:1)); return ((v==0)?0:(v<0?-1:1));
} finally { } finally {

View File

@ -59,8 +59,8 @@ import static smetana.core.Macro.ASINT;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agdisc_s; import h.ST_Agdisc_s;
import h.ST_Agraph_s;
import h.ST_Agobj_s; import h.ST_Agobj_s;
import h.ST_Agraph_s;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory; import smetana.core.Memory;
import smetana.core.Z; import smetana.core.Z;
@ -341,7 +341,7 @@ ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
try { try {
int rv; int rv;
if (str!=null && (str.charAt(0) != '%')) { if (str!=null && (str.charAt(0) != '%')) {
rv = (Integer) g.clos.getStruct("disc").getPtr("id").call("map", g.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) if (rv!=0)
return rv; return rv;
} }
@ -354,7 +354,7 @@ try {
rv = 0; rv = 0;
if (createflag) { if (createflag) {
/* get a new anonymous ID, and store in the internal map */ /* get a new anonymous ID, and store in the internal map */
rv = (Integer) g.clos.getStruct("disc").getPtr("id").call("map", g.clos.getStruct("state").getPtr("id"), objtype, null, result, rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, null, result,
createflag); createflag);
if (rv!=0 && str!=null) if (rv!=0 && str!=null)
aginternalmapinsert(g, objtype, str, result[0]); aginternalmapinsert(g, objtype, str, result[0]);
@ -409,15 +409,15 @@ try {
g = agraphof(obj); g = agraphof(obj);
if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null) if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null)
return rv; return rv;
if (g.clos.getStruct("disc").getPtr("id").getPtr("print")!=null) { if (g.clos.disc.id.print!=null) {
if ((rv = if ((rv =
(CString) g.clos.getStruct("disc").getPtr("id").call("print", g.clos.getStruct("state").getPtr("id"), (CString) g.clos.disc.id.print.exe(g.clos.state.id,
AGTYPE(obj), AGTYPE(obj),
AGID(obj)))!=null) AGID(obj)))!=null)
return rv; return rv;
} }
if (AGTYPE(obj) != AGEDGE) { if (AGTYPE(obj) != AGEDGE) {
rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.getInt("id")); rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.id);
} }
else else
rv = null; rv = null;
@ -435,7 +435,7 @@ LEAVING("cctsybrl54fy799aynfej4iiy","agnameof");
public static void agregister(ST_Agraph_s g, int objtype, Object obj) { public static void agregister(ST_Agraph_s g, int objtype, Object obj) {
ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister"); ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister");
try { try {
g.clos.getStruct("disc").getPtr("id").call("idregister", g.clos.getStruct("state").getPtr("id"), objtype, obj); g.clos.disc.id.idregister.exe(g.clos.state.id, objtype, obj);
} finally { } finally {
LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister"); LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister");
} }

View File

@ -276,7 +276,7 @@ public static __ptr__ agalloc(ST_Agraph_s g, size_t size) {
ENTERING("7newv1hmzvt4vtttc9cxdxfpn","agalloc"); ENTERING("7newv1hmzvt4vtttc9cxdxfpn","agalloc");
try { try {
__ptr__ mem; __ptr__ mem;
mem = (__ptr__) g.clos.disc.mem.call("alloc", g.clos.state.mem, size); mem = (__ptr__) g.clos.disc.mem.alloc.exe(g.clos.state.mem, size);
if (mem == null) if (mem == null)
System.err.println("memory allocation failure"); System.err.println("memory allocation failure");
return mem; return mem;

View File

@ -68,10 +68,10 @@ import static smetana.core.Macro.AGSEQ;
import static smetana.core.Macro.AGTYPE; import static smetana.core.Macro.AGTYPE;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agattr_s; import h.ST_Agattr_s;
import h.ST_Agdesc_s; import h.ST_Agdesc_s;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agsubnode_s; import h.ST_Agsubnode_s;
import h.ST_Agtag_s; import h.ST_Agtag_s;
import h.ST_dt_s; import h.ST_dt_s;
@ -225,8 +225,8 @@ try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
((ST_Agtag_s)Z.z().dummy.base.tag).id = id; ((ST_Agtag_s)Z.z().dummy.base.tag).id = id;
Z.z().template.node = Z.z().dummy; Z.z().template.node = Z.z().dummy;
sn = (ST_Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z.z().template,0000004)); sn = (ST_Agsubnode_s) (g.n_id.searchf.exe(g.n_id, Z.z().template,0000004));
return (ST_Agnode_s) (sn!=null ? sn.getPtr("node") : null); return (ST_Agnode_s) (sn!=null ? sn.node : null);
} finally { } finally {
LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id"); LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
} }
@ -259,8 +259,8 @@ public static ST_Agnode_s agfstnode(ST_Agraph_s g) {
ENTERING("55wopi2gd93zpmycxoywlxm0y","agfstnode"); ENTERING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
try { try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
sn = (ST_Agsubnode_s) g.getPtr("n_seq").castTo(ST_dt_s.class).call("searchf", g.getPtr("n_seq"),null,0000200); sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,null,0000200);
return sn!=null ? (ST_Agnode_s) sn.getPtr("node") : null; return sn!=null ? (ST_Agnode_s) sn.node : null;
} finally { } finally {
LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode"); LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
} }
@ -284,9 +284,9 @@ try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
sn = agsubrep(g, n); sn = agsubrep(g, n);
LOG2("sn1="+sn); LOG2("sn1="+sn);
if (sn!=null) sn = (ST_Agsubnode_s) g.getPtr("n_seq").castTo(ST_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); LOG2("sn2="+sn);
final __ptr__ result = sn!=null ? sn.getPtr("node") : null; final __ptr__ result = sn!=null ? sn.node : null;
LOG2("result="+result); LOG2("result="+result);
return (ST_Agnode_s) result; return (ST_Agnode_s) result;
} finally { } finally {
@ -341,7 +341,7 @@ try {
AGID(n, id); AGID(n, id);
AGSEQ(n, seq); AGSEQ(n, seq);
n.setPtr("root", agroot(g)); n.setPtr("root", agroot(g));
if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0) if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0)
agbindrec(n, AgDataRecName, sizeof(ST_Agattr_s.class), false); agbindrec(n, AgDataRecName, sizeof(ST_Agattr_s.class), false);
/* nodeattr_init and method_init will be called later, from the /* nodeattr_init and method_init will be called later, from the
* subgraph where the node was actually created, but first it has * subgraph where the node was actually created, but first it has
@ -362,12 +362,12 @@ ENTERING("4m26dpgaiw44hcleugjy71eus","installnode");
try { try {
ST_Agsubnode_s sn; ST_Agsubnode_s sn;
int osize; int osize;
osize = dtsize_((ST_dt_s)g.getPtr("n_id")); osize = dtsize_((ST_dt_s)g.n_id);
if (EQ(g, agroot(g))) sn = (ST_Agsubnode_s) n.mainsub; 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); else sn = (ST_Agsubnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agsubnode_s.class))).castTo(ST_Agsubnode_s.class);
sn.setPtr("node", n); sn.setPtr("node", n);
g.getPtr("n_id").call("searchf", g.getPtr("n_id"),sn,0000001); g.n_id.searchf.exe(g.n_id,sn,0000001);
g.getPtr("n_seq").call("searchf", g.getPtr("n_seq"),sn,0000001); g.n_seq.searchf.exe(g.n_seq,sn,0000001);
} finally { } finally {
LEAVING("4m26dpgaiw44hcleugjy71eus","installnode"); LEAVING("4m26dpgaiw44hcleugjy71eus","installnode");
} }
@ -398,7 +398,7 @@ LEAVING("3mfxjcaeepn8nitirs3yoqaed","installnodetoroot");
public static void initnode(ST_Agraph_s g, ST_Agnode_s n) { public static void initnode(ST_Agraph_s g, ST_Agnode_s n) {
ENTERING("85bb9mezhsgtzar3kqz95mq1","initnode"); ENTERING("85bb9mezhsgtzar3kqz95mq1","initnode");
try { 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); agnodeattr_init(g,n);
agmethod_init(g, n); agmethod_init(g, n);
} finally { } finally {
@ -593,7 +593,7 @@ ENTERING("d5farp22buvesyi4pydjam4g2","agsubnode");
try { try {
ST_Agraph_s par; ST_Agraph_s par;
ST_Agnode_s n; ST_Agnode_s n;
if (NEQ(agroot(g), n0.getPtr("root"))) if (NEQ(agroot(g), n0.root))
return null; return null;
n = agfindnode_by_id(g, AGID(n0)); n = agfindnode_by_id(g, AGID(n0));
if ((n == null) && cflag) { if ((n == null) && cflag) {
@ -623,7 +623,7 @@ try {
ST_Agsubnode_s sn0, sn1; ST_Agsubnode_s sn0, sn1;
sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class); sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class); sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
v = (AGID(sn0.getPtr("node")) - AGID(sn1.getPtr("node"))); v = (AGID(sn0.node) - AGID(sn1.node));
return ((v==0)?0:(v<0?-1:1)); return ((v==0)?0:(v<0?-1:1));
} finally { } finally {
LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf"); LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
@ -642,7 +642,7 @@ try {
int v; int v;
sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class); sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class); sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
v = (AGSEQ(sn0.getPtr("node")) - AGSEQ(sn1.getPtr("node"))); v = (AGSEQ(sn0.node) - AGSEQ(sn1.node));
return ((v==0)?0:(v<0?-1:1)); return ((v==0)?0:(v<0?-1:1));
} finally { } finally {
LEAVING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf"); LEAVING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf");

View File

@ -279,7 +279,7 @@ public static void agmethod_init(ST_Agraph_s g, __ptr__ obj) {
ENTERING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init"); ENTERING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init");
try { try {
if (g.clos.callbacks_enabled) if (g.clos.callbacks_enabled)
aginitcb(g, obj, (Agcbstack_s) g.clos.getPtr("cb")); aginitcb(g, obj, (Agcbstack_s) g.clos.cb);
else else
agrecord_callback(g, obj, 100, null); agrecord_callback(g, obj, 100, null);
} finally { } finally {
@ -330,7 +330,7 @@ public static void agmethod_upd(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym) {
ENTERING("29p743rx2pw81slkoaayfeael","agmethod_upd"); ENTERING("29p743rx2pw81slkoaayfeael","agmethod_upd");
try { try {
if (g.clos.callbacks_enabled) if (g.clos.callbacks_enabled)
agupdcb(g, obj, sym, (Agcbstack_s) g.clos.getPtr("cb")); agupdcb(g, obj, sym, (Agcbstack_s) g.clos.cb);
else else
agrecord_callback(g, obj, 101, sym); agrecord_callback(g, obj, 101, sym);
} finally { } finally {
@ -431,11 +431,11 @@ try {
switch (AGTYPE(obj)) { switch (AGTYPE(obj)) {
case AGINEDGE: case AGINEDGE:
case AGOUTEDGE: case AGOUTEDGE:
return (ST_Agraph_s) obj.castTo(ST_Agedge_s.class).getPtr("node").getPtr("root"); return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root;
case AGNODE: case AGNODE:
return (ST_Agraph_s) obj.castTo(ST_Agnode_s.class).getPtr("root"); return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root;
case AGRAPH: case AGRAPH:
return (ST_Agraph_s) obj.castTo(ST_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 */ default: /* actually can't occur if only 2 bit tags */
System.err.println("agroot of a bad object"); System.err.println("agroot of a bad object");
return null; return null;
@ -456,9 +456,9 @@ try {
switch (AGTYPE(obj)) { switch (AGTYPE(obj)) {
case AGINEDGE: case AGINEDGE:
case AGOUTEDGE: case AGOUTEDGE:
return (ST_Agraph_s) obj.castTo(ST_Agedge_s.class).getPtr("node").getPtr("root").castTo(ST_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: case AGNODE:
return (ST_Agraph_s) obj.castTo(ST_Agnode_s.class).getPtr("root").castTo(ST_Agraph_s.class); return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root.castTo(ST_Agraph_s.class);
case AGRAPH: case AGRAPH:
return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class); return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class);
default: /* actually can't occur if only 2 bit tags */ default: /* actually can't occur if only 2 bit tags */

View File

@ -64,8 +64,8 @@ import static smetana.core.Macro.N;
import static smetana.core.Macro.NOT; import static smetana.core.Macro.NOT;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agraph_s;
import h.ST_Agobj_s; import h.ST_Agobj_s;
import h.ST_Agraph_s;
import h.ST_Agrec_s; import h.ST_Agrec_s;
import h.ST_Agtag_s; import h.ST_Agtag_s;
import smetana.core.CString; import smetana.core.CString;
@ -273,14 +273,14 @@ try {
newrec = (ST_Agrec_s) arg; newrec = (ST_Agrec_s) arg;
firstrec = (ST_Agrec_s) obj.data; firstrec = (ST_Agrec_s) obj.data;
if (firstrec == null) if (firstrec == null)
newrec.setPtr("next", newrec); /* 0 elts */ newrec.next = newrec; /* 0 elts */
else { else {
if (EQ(firstrec.next, firstrec)) { if (EQ(firstrec.next, firstrec)) {
firstrec.setPtr("next", newrec); /* 1 elt */ firstrec.next = newrec; /* 1 elt */
newrec.setPtr("next", firstrec); newrec.next = firstrec;
} else { } else {
newrec.setPtr("next", firstrec.next); newrec.next = firstrec.next;
firstrec.setPtr("next", newrec); firstrec.next = newrec;
} }
} }
if (NOT(((ST_Agtag_s)obj.tag).mtflock)) if (NOT(((ST_Agtag_s)obj.tag).mtflock))

View File

@ -232,7 +232,7 @@ try {
if (g != null) if (g != null)
dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() { dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
public ST_dt_s get() { public ST_dt_s get() {
return (ST_dt_s) g.clos.getPtr("strdict"); return (ST_dt_s) g.clos.strdict;
} }
public void set(ST_dt_s obj) { public void set(ST_dt_s obj) {
g.clos.setPtr("strdict", obj); g.clos.setPtr("strdict", obj);
@ -284,7 +284,7 @@ try {
ST_refstr_t r; ST_refstr_t r;
// key.setPtr("s", s.duplicate()); // key.setPtr("s", s.duplicate());
key.setString(s); key.setString(s);
r = (ST_refstr_t) strdict.call("searchf", strdict, key, 0000004); r = (ST_refstr_t) strdict.searchf.exe(strdict, key, 0000004);
return r; return r;
} finally { } finally {
LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind"); LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
@ -351,7 +351,7 @@ try {
r.setString(s.duplicate()); r.setString(s.duplicate());
// strcpy(r->store, s); // strcpy(r->store, s);
// r->s = r->store; // r->s = r->store;
strdict.call("searchf", strdict,r,0000001); strdict.searchf.exe(strdict,r,0000001);
} }
return r.s; return r.s;
} finally { } finally {

View File

@ -56,7 +56,6 @@ import static smetana.core.Macro.AGID;
import static smetana.core.Macro.AGRAPH; import static smetana.core.Macro.AGRAPH;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agraph_s;
import h.ST_Agdesc_s; import h.ST_Agdesc_s;
import h.ST_Agraph_s; import h.ST_Agraph_s;
import h.ST_dt_s; import h.ST_dt_s;
@ -205,9 +204,9 @@ public static ST_Agraph_s agfindsubg_by_id(ST_Agraph_s g, int id) {
ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id"); ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
try { try {
final ST_Agraph_s template = new ST_Agraph_s(); final ST_Agraph_s template = new ST_Agraph_s();
agdtdisc(g, (ST_dt_s) g.getPtr("g_dict"), Z.z().Ag_subgraph_id_disc); agdtdisc(g, (ST_dt_s) g.g_dict, Z.z().Ag_subgraph_id_disc);
AGID(template, id); AGID(template, id);
return (ST_Agraph_s) g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"), template, 0000004); return (ST_Agraph_s) g.g_dict.searchf.exe(g.g_dict, template, 0000004);
} finally { } finally {
LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id"); LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
} }
@ -227,10 +226,10 @@ try {
return subg; return subg;
subg = (ST_Agraph_s) agalloc(g, sizeof(ST_Agraph_s.class)); subg = (ST_Agraph_s) agalloc(g, sizeof(ST_Agraph_s.class));
subg.setPtr("clos", g.clos); subg.setPtr("clos", g.clos);
subg.setStruct("desc", g.getStruct("desc")); subg.setStruct("desc", g.desc);
((ST_Agdesc_s)subg.getStruct("desc")).maingraph = 0; ((ST_Agdesc_s)subg.desc).maingraph = 0;
subg.setPtr("parent", g); subg.setPtr("parent", g);
subg.setPtr("root", g.getPtr("root")); subg.setPtr("root", g.root);
AGID(subg, id); AGID(subg, id);
return agopen1(subg); return agopen1(subg);
} finally { } finally {
@ -290,7 +289,7 @@ LEAVING("a24jd4r2sdyb4lb2hyababrda","agsubg");
public static ST_Agraph_s agfstsubg(ST_Agraph_s g) { public static ST_Agraph_s agfstsubg(ST_Agraph_s g) {
ENTERING("51eksrs0lhkgohunejlpwyc4k","agfstsubg"); ENTERING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
try { try {
__ptr__ tmp = (__ptr__)g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"),null,0000200); __ptr__ tmp = (__ptr__)g.g_dict.searchf.exe(g.g_dict,null,0000200);
if (tmp!=null) tmp = tmp.castTo(ST_Agraph_s.class); if (tmp!=null) tmp = tmp.castTo(ST_Agraph_s.class);
return (ST_Agraph_s) tmp; return (ST_Agraph_s) tmp;
} finally { } finally {
@ -309,7 +308,7 @@ try {
ST_Agraph_s g; ST_Agraph_s g;
g = agparent(subg); g = agparent(subg);
if (g==null) return null; if (g==null) return null;
__ptr__ tmp = (__ptr__) g.getPtr("g_dict").castTo(ST_dt_s.class).call("searchf", g.getPtr("g_dict"), subg, 0000010); __ptr__ tmp = (__ptr__) g.g_dict.searchf.exe(g.g_dict, subg, 0000010);
if (tmp==null) return null; if (tmp==null) return null;
return (ST_Agraph_s) tmp.getPtr(); return (ST_Agraph_s) tmp.getPtr();
} finally { } finally {
@ -325,7 +324,7 @@ LEAVING("85c1qisrein0tzm2regoe61t","agnxtsubg");
public static ST_Agraph_s agparent(ST_Agraph_s g) { public static ST_Agraph_s agparent(ST_Agraph_s g) {
ENTERING("7kbp6j03hd7u6nnlivi0vt3ja","agparent"); ENTERING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
try { try {
return (ST_Agraph_s) g.getPtr("parent"); return (ST_Agraph_s) g.parent;
} finally { } finally {
LEAVING("7kbp6j03hd7u6nnlivi0vt3ja","agparent"); LEAVING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
} }

View File

@ -53,8 +53,8 @@ import static smetana.core.JUtils.function;
import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agraph_s;
import h.Dtmemory_f; import h.Dtmemory_f;
import h.ST_Agraph_s;
import h.ST_dt_s; import h.ST_dt_s;
import h.ST_dtdisc_s; import h.ST_dtdisc_s;
import h.ST_dtmethod_s; import h.ST_dtmethod_s;
@ -256,7 +256,7 @@ ENTERING("48ox0bg1qmasrer8np51uwsyk","agdtopen");
try { try {
Dtmemory_f memf; Dtmemory_f memf;
ST_dt_s d; ST_dt_s d;
memf = (Dtmemory_f) disc.getPtr("memoryf"); memf = (Dtmemory_f) disc.memoryf;
disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem")); disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
Z.z().Ag_dictop_G = g; Z.z().Ag_dictop_G = g;
d = dtopen(disc, method); d = dtopen(disc, method);

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -372,8 +372,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -66,7 +66,6 @@ import h.ST_pointf;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.MutableDouble; import smetana.core.MutableDouble;
import smetana.core.Z; import smetana.core.Z;
import smetana.core.__ptr__;
public class arrows__c { public class arrows__c {
//1 2digov3edok6d5srhgtlmrycs //1 2digov3edok6d5srhgtlmrycs
@ -393,8 +392,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -896,7 +895,7 @@ return inside_w_(inside_context, p.copy());
private static boolean inside_w_(ST_inside_t inside_context, final ST_pointf p) { private static boolean inside_w_(ST_inside_t inside_context, final ST_pointf p) {
ENTERING("7ymcsnwqkr1crisrga0kezh1f","inside"); ENTERING("7ymcsnwqkr1crisrga0kezh1f","inside");
try { 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 { } finally {
LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside"); LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside");
} }
@ -907,7 +906,7 @@ LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside");
//3 9eellwhg4gsa2pdszpeqihs2d //3 9eellwhg4gsa2pdszpeqihs2d
// int arrowEndClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int eflag) // int arrowEndClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int eflag)
public static int arrowEndClip(ST_Agedge_s e, __ptr__ ps, int startp, int endp, ST_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"); ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
try { try {
final ST_inside_t inside_context = new ST_inside_t(); final ST_inside_t inside_context = new ST_inside_t();
@ -918,13 +917,13 @@ try {
elen2.setValue(elen * elen); elen2.setValue(elen * elen);
spl.setInt("eflag", eflag); spl.setInt("eflag", eflag);
spl.setStruct("ep", ps.plus(endp + 3).getStruct()); 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; endp -= 3;
} }
sp.plus(3).setStruct(ps.plus(endp).getStruct()); sp.plus(3).setStruct(ps.plus(endp).getStruct());
sp.plus(2).setStruct(ps.plus(endp+1).getStruct()); sp.plus(2).setStruct(ps.plus(endp+1).getStruct());
sp.plus(1).setStruct(ps.plus(endp+2).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 */ /* ensure endpoint starts inside */
inside_context.setPtr("a.p", sp.plus(0).asPtr()); inside_context.setPtr("a.p", sp.plus(0).asPtr());
inside_context.setPtr("a.r", elen2.amp()); inside_context.setPtr("a.r", elen2.amp());
@ -944,7 +943,7 @@ LEAVING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
//3 q7y4oxn0paexbgynmtg2zmiv //3 q7y4oxn0paexbgynmtg2zmiv
// int arrowStartClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int sflag) // int arrowStartClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int sflag)
public static int arrowStartClip(ST_Agedge_s e, __ptr__ ps, int startp, int endp, ST_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"); ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip");
try { try {
final ST_inside_t inside_context = new ST_inside_t(); final ST_inside_t inside_context = new ST_inside_t();
@ -955,13 +954,13 @@ try {
slen2.setValue(slen * slen); slen2.setValue(slen * slen);
spl.setInt("sflag", sflag); spl.setInt("sflag", sflag);
spl.setStruct("sp", ps.plus(startp).getStruct()); 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; startp += 3;
} }
sp.plus(0).setStruct(ps.plus(startp+3).getStruct()); sp.plus(0).setStruct(ps.plus(startp+3).getStruct());
sp.plus(1).setStruct(ps.plus(startp+2).getStruct()); sp.plus(1).setStruct(ps.plus(startp+2).getStruct());
sp.plus(2).setStruct(ps.plus(startp+1).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 */ /* ensure endpoint starts inside */
inside_context.setPtr("a.p", sp.plus(3).asPtr()); inside_context.setPtr("a.p", sp.plus(3).asPtr());
inside_context.setPtr("a.r", slen2.amp()); inside_context.setPtr("a.r", slen2.amp());

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -383,8 +383,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -1398,27 +1398,27 @@ public static void update_bb_bz(ST_boxf bb, ST_pointf.Array cp) {
ENTERING("5wldemr88fdxl6101ugewclw9","update_bb_bz"); ENTERING("5wldemr88fdxl6101ugewclw9","update_bb_bz");
try { try {
/* if any control point of the segment is outside the bounding box */ /* if any control point of the segment is outside the bounding box */
if (cp.plus(0).getDouble("x") > bb.UR.x || cp.plus(0).getDouble("x") < bb.LL.x || if (cp.get(0).x > bb.UR.x || cp.get(0).x < bb.LL.x ||
cp.plus(0).getDouble("y") > bb.UR.y || cp.plus(0).getDouble("y") < bb.LL.y || cp.get(0).y > bb.UR.y || cp.get(0).y < bb.LL.y ||
cp.plus(1).getDouble("x") > bb.UR.x || cp.plus(1).getDouble("x") < bb.LL.x || cp.get(1).x > bb.UR.x || cp.get(1).x < bb.LL.x ||
cp.plus(1).getDouble("y") > bb.UR.y || cp.plus(1).getDouble("y") < bb.LL.y || cp.get(1).y > bb.UR.y || cp.get(1).y < bb.LL.y ||
cp.plus(2).getDouble("x") > bb.UR.x || cp.plus(2).getDouble("x") < bb.LL.x || cp.get(2).x > bb.UR.x || cp.get(2).x < bb.LL.x ||
cp.plus(2).getDouble("y") > bb.UR.y || cp.plus(2).getDouble("y") < bb.LL.y || cp.get(2).y > bb.UR.y || cp.get(2).y < bb.LL.y ||
cp.plus(3).getDouble("x") > bb.UR.x || cp.plus(3).getDouble("x") < bb.LL.x || cp.get(3).x > bb.UR.x || cp.get(3).x < bb.LL.x ||
cp.plus(3).getDouble("y") > bb.UR.y || cp.plus(3).getDouble("y") < bb.LL.y) { cp.get(3).y > bb.UR.y || cp.get(3).y < bb.LL.y) {
/* if the segment is sufficiently refined */ /* if the segment is sufficiently refined */
if (check_control_points(cp.asPtr())) { if (check_control_points(cp.asPtr())) {
int i; int i;
/* expand the bounding box */ /* expand the bounding box */
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (cp.plus(i).getDouble("x") > bb.UR.x) if (cp.get(i).x > bb.UR.x)
bb.UR.setDouble("x", cp.plus(i).getDouble("x")); bb.UR.setDouble("x", cp.get(i).x);
else if (cp.plus(i).getDouble("x") < bb.LL.x) else if (cp.get(i).x < bb.LL.x)
bb.LL.setDouble("x", cp.plus(i).getDouble("x")); bb.LL.setDouble("x", cp.get(i).x);
if (cp.plus(i).getDouble("y") > bb.UR.y) if (cp.get(i).y > bb.UR.y)
bb.UR.setDouble("y", cp.plus(i).getDouble("y")); bb.UR.setDouble("y", cp.get(i).y);
else if (cp.plus(i).getDouble("y") < bb.LL.y) else if (cp.get(i).y < bb.LL.y)
bb.LL.setDouble("y", cp.plus(i).getDouble("y")); bb.LL.setDouble("y", cp.get(i).y);
} }
} }
else { /* else refine the segment */ else { /* else refine the segment */

View File

@ -138,8 +138,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -711,7 +711,7 @@ return cwrotatepf_w_(p.copy(), cwrot).copy();
private static ST_pointf cwrotatepf_w_(final ST_pointf p, int cwrot) { private static ST_pointf cwrotatepf_w_(final ST_pointf p, int cwrot) {
ENTERING("5q8h2tm3jifiasn423wrm0y60","cwrotatepf"); ENTERING("5q8h2tm3jifiasn423wrm0y60","cwrotatepf");
try { try {
double x = p.getDouble("x"), y = p.getDouble("y"); double x = p.x, y = p.y;
switch (cwrot) { switch (cwrot) {
case 0: case 0:
break; break;
@ -789,7 +789,7 @@ return ccwrotatepf_w_(p.copy(), ccwrot).copy();
private static ST_pointf ccwrotatepf_w_(final ST_pointf p, int ccwrot) { private static ST_pointf ccwrotatepf_w_(final ST_pointf p, int ccwrot) {
ENTERING("6np74e9pfmv8uek8irqru2tma","ccwrotatepf"); ENTERING("6np74e9pfmv8uek8irqru2tma","ccwrotatepf");
try { try {
double x = p.getDouble("x"), y = p.getDouble("y"); double x = p.x, y = p.y;
switch (ccwrot) { switch (ccwrot) {
case 0: case 0:
break; break;
@ -880,9 +880,9 @@ return ptToLine2_w_(a.copy(), b.copy(), p.copy());
private static double ptToLine2_w_(final ST_pointf a, final ST_pointf b, final ST_pointf p) { private static double ptToLine2_w_(final ST_pointf a, final ST_pointf b, final ST_pointf p) {
ENTERING("90k9l4o3khu3dw0fzkrcd97nk","ptToLine2"); ENTERING("90k9l4o3khu3dw0fzkrcd97nk","ptToLine2");
try { try {
double dx = b.getDouble("x")-a.getDouble("x"); double dx = b.x-a.x;
double dy = b.getDouble("y")-a.getDouble("y"); double dy = b.y-a.y;
double a2 = (p.getDouble("y")-a.getDouble("y"))*dx - (p.getDouble("x")-a.getDouble("x"))*dy; double a2 = (p.y-a.y)*dx - (p.x-a.x)*dy;
a2 *= a2; /* square - ensures that it is positive */ a2 *= a2; /* square - ensures that it is positive */
if (a2 < 0.0000000001) return 0.; /* avoid 0/0 problems */ if (a2 < 0.0000000001) return 0.; /* avoid 0/0 problems */
return a2 / (dx*dx + dy*dy); return a2 / (dx*dx + dy*dy);

View File

@ -402,8 +402,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -376,8 +376,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -417,8 +417,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -1372,8 +1372,8 @@ UNSUPPORTED("dhhbmqv6n01j1eeyy7fpus1xw"); // xf = 0.02;
GD_fontnames(g, maptoken(p, fontnamenames, fontnamecodes)); GD_fontnames(g, maptoken(p, fontnamenames, fontnamecodes));
setRatio(g); setRatio(g);
GD_drawing(g).filled = GD_drawing(g).filled =
getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).getStruct("size")); getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).size);
getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).getStruct("page")); getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).page);
GD_drawing(g).centered = mapbool(agget(g, new CString("center"))); GD_drawing(g).centered = mapbool(agget(g, new CString("center")));
if ((p = agget(g, new CString("rotate")))!=null) if ((p = agget(g, new CString("rotate")))!=null)
GD_drawing(g).landscape= (atoi(p) == 90); GD_drawing(g).landscape= (atoi(p) == 90);
@ -1540,7 +1540,7 @@ try {
if ((str = agget(sg, new CString("label")))!=null && (str.charAt(0) != '\0')) { if ((str = agget(sg, new CString("label")))!=null && (str.charAt(0) != '\0')) {
char pos_flag=0; char pos_flag=0;
final ST_pointf dimen = new ST_pointf(); final ST_pointf dimen = new ST_pointf();
GD_has_labels(sg.getPtr("root"), GD_has_labels(sg.getPtr("root")) | (1 << 3)); 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)), GD_label(sg, make_label(sg, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
late_double(sg, (agattr(sg,AGRAPH,new CString("fontsize"),null)), late_double(sg, (agattr(sg,AGRAPH,new CString("fontsize"),null)),
14.0, 1.0), 14.0, 1.0),
@ -1574,8 +1574,8 @@ UNSUPPORTED("evu9w6pw3kkh7z8w7t4rx4qxc"); // pos_flag |= 4;
/* Set border information for cluster labels to allow space /* Set border information for cluster labels to allow space
*/ */
dimen.___(GD_label(sg).dimen); dimen.___(GD_label(sg).dimen);
dimen.setDouble("x", dimen.getDouble("x") + 4*4); dimen.setDouble("x", dimen.x + 4*4);
dimen.setDouble("y", dimen.getDouble("y") + 2*4); dimen.setDouble("y", dimen.y + 2*4);
if (N(GD_flip(agroot(sg)))) { if (N(GD_flip(agroot(sg)))) {
if ((GD_label_pos(sg) & 1)!=0) if ((GD_label_pos(sg) & 1)!=0)
pos_ix = 2; pos_ix = 2;

View File

@ -67,15 +67,16 @@ import static smetana.core.Macro.GD_label;
import static smetana.core.Macro.MAX; import static smetana.core.Macro.MAX;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.*; import static smetana.core.Macro.ZALLOC_ST_textspan_t;
import static smetana.core.Macro.agtail; import static smetana.core.Macro.agtail;
import static smetana.core.Macro.hackInitDimensionFromLabel; import static smetana.core.Macro.hackInitDimensionFromLabel;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agraphinfo_t;
import h.ST_Agnodeinfo_t; import h.ST_Agnodeinfo_t;
import h.ST_Agobj_s; 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_GVC_s;
import h.ST_pointf; import h.ST_pointf;
import h.ST_port; import h.ST_port;
@ -411,8 +412,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -714,32 +715,32 @@ public static void storeline(ST_GVC_s gvc, ST_textlabel_t lp, CString line, char
ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline"); ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
try { try {
final ST_pointf size = new ST_pointf(); final ST_pointf size = new ST_pointf();
__ptr__ span = null; ST_textspan_t span = null;
int oldsz = lp.getInt("u.txt.nspans") + 1; int oldsz = lp.nspans + 1;
lp.setPtr("u.txt.span", ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.getPtr("u.txt.span"), oldsz + 1)); lp.span = ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.span, oldsz + 1);
span = lp.getPtr("u.txt.span").plus(lp.getInt("u.txt.nspans")); span = lp.span.get(lp.nspans);
span.setPtr("str", line); span.str = line;
span.setInt("just", terminator); span.just = terminator;
if (line!=null && line.charAt(0)!='\0') { if (line!=null && line.charAt(0)!='\0') {
Z.z().tf.setPtr("name", lp.getPtr("fontname")); Z.z().tf.name = lp.fontname;
Z.z().tf.setDouble("size", lp.getDouble("fontsize")); Z.z().tf.size = lp.fontsize;
// WE CHEAT // WE CHEAT
((ST_pointf) size).x = 0.0; size.x = 0.0;
((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20); size.y = (int)(lp.fontsize * 1.20);
hackInitDimensionFromLabel(size, line.getContent()); hackInitDimensionFromLabel(size, line.getContent());
((ST_pointf) span.getStruct("size")).y = (int)size.getDouble("y"); span.size.y = (int)size.y;
} }
else { else {
System.err.println("YOU SHOULD NOT SEE THAT"); System.err.println("YOU SHOULD NOT SEE THAT");
((ST_pointf) size).x = 0.0; size.x = 0.0;
((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20); size.y = (int)(lp.fontsize * 1.20);
span.getStruct("size").setDouble("y", (int)(lp.getDouble("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 */ /* width = max line width */
((ST_pointf) lp.dimen).x = MAX(lp.dimen.getDouble("x"), size.getDouble("x")); lp.dimen.x = MAX(lp.dimen.x, size.x);
/* accumulate height */ /* accumulate height */
((ST_pointf) lp.dimen).y = lp.dimen.getDouble("y") + size.getDouble("y"); lp.dimen.y = lp.dimen.y + size.y;
} finally { } finally {
LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline"); LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
} }
@ -772,7 +773,7 @@ try {
* the second in 0x40-0x7e or 0xa1-0xfe. We assume that the input * 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'. * 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("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
UNSUPPORTED("ebmmarxykvf76hmfmjuk0ssjz"); // c = *p++; UNSUPPORTED("ebmmarxykvf76hmfmjuk0ssjz"); // c = *p++;
UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c; UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
@ -834,7 +835,7 @@ try {
switch (agobjkind(obj)) { switch (agobjkind(obj)) {
case AGRAPH: case AGRAPH:
sg = (ST_Agraph_s)obj; sg = (ST_Agraph_s)obj;
g = (ST_Agraph_s) sg.getPtr("root"); g = (ST_Agraph_s) sg.root;
break; break;
case AGNODE: case AGNODE:
n = (ST_Agnode_s)obj.castTo(ST_Agnode_s.class); n = (ST_Agnode_s)obj.castTo(ST_Agnode_s.class);
@ -848,7 +849,7 @@ try {
rv.setPtr("fontname", fontname); rv.setPtr("fontname", fontname);
rv.setPtr("fontcolor", fontcolor); rv.setPtr("fontcolor", fontcolor);
rv.setDouble("fontsize", fontsize); rv.setDouble("fontsize", fontsize);
rv.setInt("charset", g.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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) { if ((kind & (2 << 1))!=0) {
rv.setPtr("text", str.strdup()); rv.setPtr("text", str.strdup());
if ((kind & (1 << 1))!=0) { if ((kind & (1 << 1))!=0) {
@ -879,7 +880,7 @@ try {
* sequences (\n, \l, \r) are processed in make_simple_label. That call also replaces \\ with \. * 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)); rv.setPtr("text", strdup_and_subst_obj0(str, obj, 0));
switch (rv.getInt("charset")) { switch (rv.charset) {
case 1: case 1:
UNSUPPORTED("s = latin1ToUTF8(rv->text);"); UNSUPPORTED("s = latin1ToUTF8(rv->text);");
break; break;
@ -887,9 +888,9 @@ try {
s = htmlEntityUTF8(rv.text, g); s = htmlEntityUTF8(rv.text, g);
break; break;
} }
Memory.free(rv.getPtr("text")); Memory.free(rv.text);
rv.setPtr("text", s); rv.setPtr("text", s);
make_simple_label((ST_GVC_s) g.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agraphinfo_t.class).getPtr("gvc"), rv); make_simple_label(g.castTo_ST_Agobj_s().data.castTo_ST_Agraphinfo_t().gvc, rv);
} }
return rv; return rv;
} finally { } finally {
@ -1039,7 +1040,7 @@ try {
g_len = strlen(g_str); g_len = strlen(g_str);
n_str = agnameof(obj.castTo(ST_Agnode_s.class)); n_str = agnameof(obj.castTo(ST_Agnode_s.class));
n_len = strlen(n_str); n_len = strlen(n_str);
tl = (ST_textlabel_t) obj.castTo(ST_Agnode_s.class).castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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) { if (tl!=null) {
l_str = tl.text; l_str = tl.text;
if (str!=null) l_len = strlen(l_str); if (str!=null) l_len = strlen(l_str);

View File

@ -89,8 +89,8 @@ import static smetana.core.Macro.free_list;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agraph_s; import h.ST_Agraph_s;
import h.ST_pointf;
import h.ST_nodequeue; import h.ST_nodequeue;
import h.ST_pointf;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory; import smetana.core.Memory;
import smetana.core.Z; import smetana.core.Z;
@ -421,8 +421,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -55,14 +55,12 @@ import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode; import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.cgraph.obj__c.agroot; import static gen.lib.cgraph.obj__c.agroot;
import static gen.lib.common.geom__c.ccwrotatepf; 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.edgeMidpoint;
import static gen.lib.common.splines__c.getsplinepoints; import static gen.lib.common.splines__c.getsplinepoints;
import static gen.lib.common.utils__c.late_bool; import static gen.lib.common.utils__c.late_bool;
import static gen.lib.common.utils__c.updateBB; import static gen.lib.common.utils__c.updateBB;
import static gen.lib.label.xlabels__c.placeLabels; import static gen.lib.label.xlabels__c.placeLabels;
import static smetana.core.JUtils.NEQ; import static smetana.core.JUtils.NEQ;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGRAPH; import static smetana.core.Macro.AGRAPH;
@ -90,7 +88,7 @@ import static smetana.core.Macro.ND_coord;
import static smetana.core.Macro.ND_height; import static smetana.core.Macro.ND_height;
import static smetana.core.Macro.ND_width; import static smetana.core.Macro.ND_width;
import static smetana.core.Macro.ND_xlabel; import static smetana.core.Macro.ND_xlabel;
import static smetana.core.Macro.*; import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
@ -108,7 +106,6 @@ import h.ST_xlabel_t;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory; import smetana.core.Memory;
import smetana.core.Z; import smetana.core.Z;
import smetana.core.__ptr__;
public class postproc__c { public class postproc__c {
//1 2digov3edok6d5srhgtlmrycs //1 2digov3edok6d5srhgtlmrycs
@ -434,8 +431,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -752,8 +749,8 @@ private static ST_pointf map_point_w_(final ST_pointf p) {
ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point"); ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point");
try { try {
p.___(ccwrotatepf(p, Z.z().Rankdir * 90)); p.___(ccwrotatepf(p, Z.z().Rankdir * 90));
p.setDouble("x", p.getDouble("x") - Z.z().Offset.getDouble("x")); p.setDouble("x", p.x - Z.z().Offset.x);
p.setDouble("y", p.getDouble("y") - Z.z().Offset.getDouble("y")); p.setDouble("y", p.y - Z.z().Offset.y);
return p; return p;
} finally { } finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point"); LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
@ -784,18 +781,18 @@ try {
if (bz.sflag!=0) if (bz.sflag!=0)
UNSUPPORTED("7894dgzvk2um2w1a5ph2r0bcc"); // ED_spl(e)->list[j].sp = map_point(ED_spl(e)->list[j].sp); UNSUPPORTED("7894dgzvk2um2w1a5ph2r0bcc"); // ED_spl(e)->list[j].sp = map_point(ED_spl(e)->list[j].sp);
if (bz.eflag!=0) { if (bz.eflag!=0) {
ED_spl(e).list.plus(j).getStruct("ep").___(map_point((ST_pointf) ED_spl(e).list.plus(j).getStruct("ep"))); ED_spl(e).list.get(j).ep.___(map_point((ST_pointf) ED_spl(e).list.get(j).ep));
} }
} }
if (ED_label(e)!=null) if (ED_label(e)!=null)
ED_label(e).getStruct("pos").___(map_point((ST_pointf) ED_label(e).getStruct("pos"))); ED_label(e).pos.___(map_point((ST_pointf) ED_label(e).pos));
if (ED_xlabel(e)!=null) if (ED_xlabel(e)!=null)
UNSUPPORTED("al3tnq9zjjqeq1ll7qdxyu3ja"); // ED_xlabel(e)->pos = map_point(ED_xlabel(e)->pos); UNSUPPORTED("al3tnq9zjjqeq1ll7qdxyu3ja"); // ED_xlabel(e)->pos = map_point(ED_xlabel(e)->pos);
/* vladimir */ /* vladimir */
if (ED_head_label(e)!=null) if (ED_head_label(e)!=null)
ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).getStruct("pos"))); ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).pos));
if (ED_tail_label(e)!=null) if (ED_tail_label(e)!=null)
ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).getStruct("pos"))); ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).pos));
} finally { } finally {
LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge"); LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge");
} }
@ -821,10 +818,10 @@ UNSUPPORTED("crysiae5zxc69cj3v2ygfs8xn"); // new_bb.UR = map_point(pointfof(bb.
} }
GD_bb(g).___(new_bb); GD_bb(g).___(new_bb);
if (GD_label(g)!=null) { if (GD_label(g)!=null) {
GD_label(g).setStruct("pos", map_point((ST_pointf) 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++) for (c = 1; c <= GD_n_cluster(g); c++)
translate_bb((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), rankdir); translate_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), rankdir);
} finally { } finally {
LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb"); LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
} }
@ -840,7 +837,7 @@ ENTERING("h4i5qxnd7hlrew919abswd13","translate_drawing");
try { try {
ST_Agnode_s v; ST_Agnode_s v;
ST_Agedge_s e; ST_Agedge_s e;
boolean shift = (Z.z().Offset.getDouble("x")!=0.0 || Z.z().Offset.getDouble("y")!=0.0); boolean shift = (Z.z().Offset.x!=0.0 || Z.z().Offset.y!=0.0);
if (N(shift) && N(Z.z().Rankdir)) if (N(shift) && N(Z.z().Rankdir))
return; return;
for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) { for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) {
@ -892,13 +889,13 @@ throw new UnsupportedOperationException();
//3 2i713kmewjct2igf3lwm80462 //3 2i713kmewjct2igf3lwm80462
// static pointf centerPt (xlabel_t* xlp) // static pointf centerPt (xlabel_t* xlp)
public static ST_pointf centerPt(__ptr__ /*ST_xlabel_t*/ xlp) { public static ST_pointf centerPt(ST_xlabel_t.Array xlp) {
ENTERING("2i713kmewjct2igf3lwm80462","centerPt"); ENTERING("2i713kmewjct2igf3lwm80462","centerPt");
try { try {
final ST_pointf p = new ST_pointf(); final ST_pointf p = new ST_pointf();
p.___(xlp.getStruct("pos")); p.___(xlp.getStruct().pos);
p.setDouble("x", p.getDouble("x") + xlp.getStruct("sz").getDouble("x")/2); p.setDouble("x", p.x + xlp.getStruct().sz.x/2);
p.setDouble("y", p.getDouble("y") + xlp.getStruct("sz").getDouble("y")/2); p.setDouble("y", p.y + xlp.getStruct().sz.y/2);
return p; return p;
} finally { } finally {
LEAVING("2i713kmewjct2igf3lwm80462","centerPt"); LEAVING("2i713kmewjct2igf3lwm80462","centerPt");
@ -962,10 +959,10 @@ UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0; UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p; UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
} }
bez = spl.list.plus(0).getPtr(); bez = spl.list.get(0);
// bez = &spl->list[0]; // bez = &spl->list[0];
if (bez.sflag!=0) { if (bez.sflag!=0) {
return (ST_pointf) bez.getStruct("sp"); return (ST_pointf) bez.sp;
} else { } else {
return (ST_pointf) (bez.getPtr()).list.get(0); return (ST_pointf) (bez.getPtr()).list.get(0);
// return bez->list[0]; // return bez->list[0];
@ -1010,7 +1007,7 @@ if (bez.eflag!=0) {
//3 1ca6fh8ns5bgzfzcz8al4eh4k //3 1ca6fh8ns5bgzfzcz8al4eh4k
// static boxf adjustBB (object_t* objp, boxf bb) // static boxf adjustBB (object_t* objp, boxf bb)
public static ST_boxf adjustBB(__ptr__ objp, ST_boxf bb) { public static ST_boxf adjustBB(ST_object_t.Array objp, ST_boxf bb) {
ENTERING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB"); ENTERING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
try { try {
return adjustBB_(objp, bb.copy()).copy(); return adjustBB_(objp, bb.copy()).copy();
@ -1018,15 +1015,15 @@ try {
LEAVING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB"); LEAVING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
} }
} }
private static ST_boxf adjustBB_(__ptr__ objp, ST_boxf bb) { private static ST_boxf adjustBB_(ST_object_t.Array objp, ST_boxf bb) {
final ST_pointf ur = new ST_pointf(); final ST_pointf ur = new ST_pointf();
/* Adjust bounding box */ /* Adjust bounding box */
bb.LL.setDouble("x", MIN(bb.LL.x, objp.getPtr("pos").getDouble("x"))); bb.LL.setDouble("x", MIN(bb.LL.x, objp.getStruct().pos.x));
bb.LL.setDouble("y", MIN(bb.LL.y, objp.getPtr("pos").getDouble("y"))); bb.LL.setDouble("y", MIN(bb.LL.y, objp.getStruct().pos.y));
ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x")); ur.setDouble("x", objp.getStruct().pos.x + objp.getStruct().sz.x);
ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y")); ur.setDouble("y", objp.getStruct().pos.y + objp.getStruct().sz.y);
bb.UR.setDouble("x", MAX(bb.UR.x, ur.getDouble("x"))); bb.UR.setDouble("x", MAX(bb.UR.x, ur.x));
bb.UR.setDouble("y", MAX(bb.UR.y, ur.getDouble("y"))); bb.UR.setDouble("y", MAX(bb.UR.y, ur.y));
return bb; return bb;
} }
@ -1035,7 +1032,7 @@ private static ST_boxf adjustBB_(__ptr__ objp, ST_boxf bb) {
//3 3mefe722uemyoa0czmkkw6hjb //3 3mefe722uemyoa0czmkkw6hjb
// static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos) // static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
public static void addXLabel(ST_textlabel_t lp, __ptr__ objp, ST_xlabel_t.Array xlp, int initObj, ST_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"); ENTERING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
try { try {
addXLabel_(lp, objp, xlp, initObj, pos.copy()); addXLabel_(lp, objp, xlp, initObj, pos.copy());
@ -1043,10 +1040,10 @@ try {
LEAVING("3mefe722uemyoa0czmkkw6hjb","addXLabel"); LEAVING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
} }
} }
private static void addXLabel_(ST_textlabel_t lp, __ptr__ objp, ST_xlabel_t.Array xlp, int initObj, ST_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) { if (initObj!=0) {
objp.getStruct("sz").setDouble("x", 0); objp.getStruct().sz.setDouble("x", 0);
objp.getStruct("sz").setDouble("y", 0); objp.getStruct().sz.setDouble("y", 0);
objp.setStruct("pos", pos); objp.setStruct("pos", pos);
} }
if (Z.z().Flip) { if (Z.z().Flip) {
@ -1066,11 +1063,11 @@ objp.setPtr("lbl", xlp);
//3 dwxd5kvlanbcxqfuncjg0ea54 //3 dwxd5kvlanbcxqfuncjg0ea54
// static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb) // static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
public static ST_boxf addLabelObj(ST_textlabel_t lp, __ptr__ objp, final ST_boxf bb) { public static ST_boxf addLabelObj(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
// WARNING!! STRUCT // WARNING!! STRUCT
return addLabelObj_(lp, objp, bb.copy()).copy(); return addLabelObj_(lp, objp, bb.copy()).copy();
} }
private static ST_boxf addLabelObj_(ST_textlabel_t lp, __ptr__ objp, final ST_boxf bb) { private static ST_boxf addLabelObj_(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
ENTERING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj"); ENTERING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
try { try {
if (Z.z().Flip) { if (Z.z().Flip) {
@ -1078,12 +1075,12 @@ UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y;
UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x; UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
} }
else { else {
objp.getPtr("sz").setDouble("x", lp.dimen.getDouble("x")); objp.getStruct().sz.setDouble("x", lp.dimen.x);
objp.getPtr("sz").setDouble("y", lp.dimen.getDouble("y")); objp.getStruct().sz.setDouble("y", lp.dimen.y);
} }
objp.setStruct("pos", lp.getStruct("pos")); objp.setStruct("pos", lp.pos);
objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 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").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 )); objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - (objp.getStruct().sz.y / 2.0 ));
return adjustBB(objp, bb); return adjustBB(objp, bb);
} finally { } finally {
LEAVING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj"); LEAVING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
@ -1095,11 +1092,11 @@ UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
//3 b8tjygxnwny5qoiir1mha1d62 //3 b8tjygxnwny5qoiir1mha1d62
// static boxf addNodeObj (node_t* np, object_t* objp, boxf bb) // static boxf addNodeObj (node_t* np, object_t* objp, boxf bb)
public static ST_boxf addNodeObj(ST_Agnode_s np, __ptr__ objp, final ST_boxf bb) { public static ST_boxf addNodeObj(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
// WARNING!! STRUCT // WARNING!! STRUCT
return addNodeObj_(np, objp, bb.copy()).copy(); return addNodeObj_(np, objp, bb.copy()).copy();
} }
public static ST_boxf addNodeObj_(ST_Agnode_s np, __ptr__ objp, final ST_boxf bb) { public static ST_boxf addNodeObj_(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point"); ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
try { try {
if (Z.z().Flip) { if (Z.z().Flip) {
@ -1107,12 +1104,12 @@ try {
UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72); UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
} }
else { else {
objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72)); objp.getStruct().sz.setDouble("x", ((ND_width(np))*(double)72));
objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72)); objp.getStruct().sz.setDouble("y", ((ND_height(np))*(double)72));
} }
objp.setPtr("pos", ND_coord(np)); objp.setPtr("pos", ND_coord(np));
objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0); objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - objp.getStruct().sz.x / 2.0);
objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0); objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - objp.getStruct().sz.y / 2.0);
return adjustBB(objp, bb); return adjustBB(objp, bb);
} finally { } finally {
LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point"); LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
@ -1135,11 +1132,11 @@ LEAVING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj");
private static ST_cinfo_t addClusterObj_(ST_Agraph_s g, ST_cinfo_t info) { private static ST_cinfo_t addClusterObj_(ST_Agraph_s g, ST_cinfo_t info) {
int c; int c;
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
info.___(addClusterObj ((ST_Agraph_s)GD_clust(g).plus(c).getPtr().castTo(ST_Agraph_s.class), info)); 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) { if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && GD_label(g).set!=0) {
__ptr__ objp = info.getPtr("objp"); ST_object_t.Array objp = info.objp;
info.setStruct("bb", addLabelObj (GD_label(g), objp, (ST_boxf) info.bb)); info.setStruct("bb", addLabelObj (GD_label(g), objp, (ST_boxf) info.bb));
info.setPtr("objp", info.getPtr("objp").plus(1)); info.objp = info.objp.plus(1);
//UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp; //UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp;
//UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb); //UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb);
//UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++; //UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++;
@ -1331,7 +1328,7 @@ UNSUPPORTED("cls7z8l7wi371a4wrec0viqil"); // objp++;
if (n_clbls!=0) { if (n_clbls!=0) {
final ST_cinfo_t info = new ST_cinfo_t(); final ST_cinfo_t info = new ST_cinfo_t();
info.setStruct("bb", bb); info.setStruct("bb", bb);
info.setPtr("objp", objp); info.objp = objp;
info.___(addClusterObj (gp, info)); info.___(addClusterObj (gp, info));
bb.___(info.bb); bb.___(info.bb);
} }
@ -1346,7 +1343,7 @@ placeLabels(objs, n_objs, lbls, n_lbls, params);
for (i = 0; i < n_lbls; i++) { for (i = 0; i < n_lbls; i++) {
if (xlp.get(0).set!=0) { if (xlp.get(0).set!=0) {
cnt++; cnt++;
lp = (ST_textlabel_t) /*(textlabel_t *)*/ (xlp.getPtr("lbl")); lp = xlp.getStruct().lbl;
lp.setInt("set", 1); lp.setInt("set", 1);
lp.setStruct("pos", centerPt(xlp)); lp.setStruct("pos", centerPt(xlp));
updateBB (gp, lp); updateBB (gp, lp);
@ -1386,7 +1383,7 @@ UNSUPPORTED("4hxky2sp978rmy6018sfmts6m"); // place_flip_graph_label(g);
*/ */
addXLabels(g); addXLabels(g);
/* Add space for graph label if necessary */ /* 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("crj0py2wme4b5l8apvbxqcmqa"); // dimen = GD_label(g)->dimen;
UNSUPPORTED("22jhn709g4c5wh0gb6v40rh19"); // {((dimen).x += 4*4); ((dimen).y += 2*4);}; UNSUPPORTED("22jhn709g4c5wh0gb6v40rh19"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
UNSUPPORTED("9k69y89jybam5elefg45va3ey"); // if (Flip) { UNSUPPORTED("9k69y89jybam5elefg45va3ey"); // if (Flip) {
@ -1438,7 +1435,7 @@ UNSUPPORTED("3xtu7zkpqq7nsx9oe68oi6ebt"); // Offset = pointfof(GD_bb(g).LL.
} }
translate_drawing(g); 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); UNSUPPORTED("6dds0zsvqw48u510zcy954fh1"); // place_root_label(g, dimen);
if (Z.z().Show_boxes!=null) { if (Z.z().Show_boxes!=null) {
UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ]; UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
@ -1513,10 +1510,10 @@ ENTERING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
try { try {
int c; int c;
final ST_pointf p = new ST_pointf(), d = new ST_pointf(); final ST_pointf p = new ST_pointf(), d = new ST_pointf();
if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).getInt("set"))) { if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).set)) {
if ((GD_label_pos(g) & 1)!=0) { if ((GD_label_pos(g) & 1)!=0) {
d.___(GD_border(g)[2].getStruct()); d.___(GD_border(g)[2].getStruct());
p.setDouble("y", GD_bb(g).UR.y - d.getDouble("y") / 2); p.setDouble("y", GD_bb(g).UR.y - d.y / 2);
} else { } else {
UNSUPPORTED("1w38no4welthbwa0i10hei16b"); // d = GD_border(g)[0]; UNSUPPORTED("1w38no4welthbwa0i10hei16b"); // d = GD_border(g)[0];
UNSUPPORTED("2xa4n9ca16xpf1kahaycmkl4r"); // p.y = GD_bb(g).LL.y + d.y / 2; UNSUPPORTED("2xa4n9ca16xpf1kahaycmkl4r"); // p.y = GD_bb(g).LL.y + d.y / 2;
@ -1532,7 +1529,7 @@ UNSUPPORTED("7ictv9eqmjvxjii5lqlyw8nu"); // p.x = GD_bb(g).LL.x + d.x / 2;
GD_label(g).set= NOTI(false); GD_label(g).set= NOTI(false);
} }
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
place_graph_label((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); place_graph_label((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally { } finally {
LEAVING("72zw1alhd5vd0g6mhum507rvx","place_graph_label"); LEAVING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
} }

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -399,8 +399,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -740,10 +740,10 @@ try {
final ST_pointf.Array eps = new ST_pointf.Array( 2); final ST_pointf.Array eps = new ST_pointf.Array( 2);
final ST_pointf.Array evs = new ST_pointf.Array( 2); final ST_pointf.Array evs = new ST_pointf.Array( 2);
int i; int i;
eps.plus(0).setDouble("x", tp.getDouble("x")); eps.plus(0).setDouble("x", tp.x);
eps.plus(0).setDouble("y", tp.getDouble("y")); eps.plus(0).setDouble("y", tp.y);
eps.plus(1).setDouble("x", hp.getDouble("x")); eps.plus(1).setDouble("x", hp.x);
eps.plus(1).setDouble("y", hp.getDouble("y")); eps.plus(1).setDouble("y", hp.y);
if (Pshortestpath(poly, eps, pl) < 0) if (Pshortestpath(poly, eps, pl) < 0)
return null; return null;
if (polyline) if (polyline)
@ -838,26 +838,26 @@ try {
sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct()); sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct());
sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct()); sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct());
sp.plus(3).getStruct().___(pps.plus(splinepi+3).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("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).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("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).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("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y"))); sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).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("x", sp.get(2).x + t * (sp.get(3).x - sp.get(2).x));
sp.plus(2).setDouble("y", sp.plus(2).getDouble("y") + t * (sp.plus(3).getDouble("y") - sp.plus(2).getDouble("y"))); sp.plus(2).setDouble("y", sp.get(2).y + t * (sp.get(3).y - sp.get(2).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("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).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("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).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("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y"))); sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).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("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).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("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
for (bi = 0; bi < boxn; bi++) { for (bi = 0; bi < boxn; bi++) {
/* this tested ok on 64bit machines, but on 32bit we need this FUDGE /* this tested ok on 64bit machines, but on 32bit we need this FUDGE
* or graphs/directed/records.gv fails */ * or graphs/directed/records.gv fails */
if (sp.plus(0).getDouble("y") <= boxes[bi].UR.y+.0001 && sp.plus(0).getDouble("y") >= boxes[bi].LL.y-.0001) { 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.plus(0).getDouble("x")) if (boxes[bi].LL.x > sp.get(0).x)
boxes[bi].LL.setDouble("x", sp.plus(0).getDouble("x")); boxes[bi].LL.setDouble("x", sp.get(0).x);
if (boxes[bi].UR.x < sp.plus(0).getDouble("x")) if (boxes[bi].UR.x < sp.get(0).x)
boxes[bi].UR.setDouble("x", sp.plus(0).getDouble("x")); boxes[bi].UR.setDouble("x", sp.get(0).x);
} }
} }
} }
@ -889,7 +889,7 @@ try {
int loopcnt, delta = 10; int loopcnt, delta = 10;
boolean unbounded; boolean unbounded;
Z.z().nedges++; Z.z().nedges++;
Z.z().nboxes += pp.getInt("nbox"); Z.z().nboxes += pp.nbox;
for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class); for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class);
realedge!=null && ED_edge_type(realedge) != 0; realedge!=null && ED_edge_type(realedge) != 0;
realedge = ED_to_orig(realedge)); realedge = ED_to_orig(realedge));
@ -898,7 +898,7 @@ try {
return null; return null;
} }
boxes = pp.boxes; boxes = pp.boxes;
boxn = pp.getInt("nbox"); boxn = pp.nbox;
if (checkpath(boxn, boxes, pp)!=0) if (checkpath(boxn, boxes, pp)!=0)
return null; return null;
if (boxn * 8 > Z.z().polypointn) { if (boxn * 8 > Z.z().polypointn) {
@ -1003,7 +1003,7 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
((ST_boxf)boxes[bi]).LL.y = -v; ((ST_boxf)boxes[bi]).LL.y = -v;
} }
for (i = 0; i < pi; i++) 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++) { for (bi = 0; bi < boxn; bi++) {
((ST_boxf)boxes[bi]).LL.x = INT_MAX; ((ST_boxf)boxes[bi]).LL.x = INT_MAX;
@ -1011,10 +1011,10 @@ UNSUPPORTED("11hwqop4xebvtcskop4uhpp01"); // return NULL;
} }
poly.ps = Z.z().polypoints; poly.ps = Z.z().polypoints;
poly.pn = pi; poly.pn = pi;
eps.plus(0).getStruct().setDouble("x", pp.start.getStruct("p").getDouble("x")); eps.plus(0).getStruct().setDouble("x", pp.start.p.x);
eps.plus(0).getStruct().setDouble("y", pp.start.getStruct("p").getDouble("y")); eps.plus(0).getStruct().setDouble("y", pp.start.p.y);
eps.plus(1).getStruct().setDouble("x", pp.getStruct("end").getStruct("p").getDouble("x")); eps.plus(1).getStruct().setDouble("x", pp.end.p.x);
eps.plus(1).getStruct().setDouble("y", pp.getStruct("end").getStruct("p").getDouble("y")); eps.plus(1).getStruct().setDouble("y", pp.end.p.y);
if (Pshortestpath(poly, eps, pl) < 0) { if (Pshortestpath(poly, eps, pl) < 0) {
System.err.println("in routesplines, Pshortestpath failed\n"); System.err.println("in routesplines, Pshortestpath failed\n");
return null; return null;
@ -1032,16 +1032,16 @@ UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct()); Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct());
} }
if (pp.start.constrained!=0) { if (pp.start.constrained!=0) {
evs.plus(0).getStruct().setDouble("x", cos(pp.start.getDouble("theta"))); evs.plus(0).getStruct().setDouble("x", cos(pp.start.theta));
evs.plus(0).getStruct().setDouble("y", sin(pp.start.getDouble("theta"))); evs.plus(0).getStruct().setDouble("y", sin(pp.start.theta));
} else } else
{ {
evs.plus(0).getStruct().setDouble("x", 0); evs.plus(0).getStruct().setDouble("x", 0);
evs.plus(0).getStruct().setDouble("y", 0); evs.plus(0).getStruct().setDouble("y", 0);
} }
if (pp.end.constrained!=0) { if (pp.end.constrained!=0) {
evs.plus(1).getStruct().setDouble("x", -cos(pp.getStruct("end").getDouble("theta"))); evs.plus(1).getStruct().setDouble("x", -cos(pp.end.theta));
evs.plus(1).getStruct().setDouble("y", -sin(pp.getStruct("end").getDouble("theta"))); evs.plus(1).getStruct().setDouble("y", -sin(pp.end.theta));
} else } else
{ {
evs.plus(1).getStruct().setDouble("x", 0); evs.plus(1).getStruct().setDouble("x", 0);
@ -1091,8 +1091,8 @@ UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no mem
final ST_Ppoly_t polyspl = new ST_Ppoly_t(); 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"); 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); make_polyline (pl, polyspl);
limitBoxes (boxes, boxn, polyspl.getPtr("ps"), polyspl.pn, 10); limitBoxes (boxes, boxn, polyspl.ps, polyspl.pn, 10);
Memory.free (polyspl.getPtr("ps")); Memory.free (polyspl.ps);
} }
npoints[0] = spl.pn; npoints[0] = spl.pn;
return Z.z().ps; return Z.z().ps;
@ -1279,39 +1279,39 @@ UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.LL.x = bb.UR.x;
} }
} }
} }
if (thepath.start.getStruct("p").getDouble("x") < ((ST_boxf)boxes[0]).LL.x if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x
|| thepath.start.getStruct("p").getDouble("x") > ((ST_boxf)boxes[0]).UR.x || thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x
|| thepath.start.getStruct("p").getDouble("y") < ((ST_boxf)boxes[0]).LL.y || thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y
|| thepath.start.getStruct("p").getDouble("y") > ((ST_boxf)boxes[0]).UR.y) { || thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) {
/*if (Verbose) { /*if (Verbose) {
fprintf(stderr, "in checkpath, start port not in first box\n"); fprintf(stderr, "in checkpath, start port not in first box\n");
printpath(thepath); printpath(thepath);
}*/ }*/
if (thepath.start.getStruct("p").getDouble("x") < ((ST_boxf)boxes[0]).LL.x) if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x)
thepath.start.getStruct("p").setDouble("x", ((ST_boxf)boxes[0]).LL.x); thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).LL.x);
if (thepath.start.getStruct("p").getDouble("x") > ((ST_boxf)boxes[0]).UR.x) if (thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x)
thepath.start.getStruct("p").setDouble("x", ((ST_boxf)boxes[0]).UR.x); thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).UR.x);
if (thepath.start.getStruct("p").getDouble("y") < ((ST_boxf)boxes[0]).LL.y) if (thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y)
thepath.start.getStruct("p").setDouble("y", ((ST_boxf)boxes[0]).LL.y); thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).LL.y);
if (thepath.start.getStruct("p").getDouble("y") > ((ST_boxf)boxes[0]).UR.y) if (thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y)
thepath.start.getStruct("p").setDouble("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[boxn - 1]).LL.x if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x
|| thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes[boxn - 1]).UR.x || thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x
|| thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes[boxn - 1]).LL.y || thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y
|| thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes[boxn - 1]).UR.y) { || thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) {
/*if (Verbose) { /*if (Verbose) {
fprintf(stderr, "in checkpath, end port not in last box\n"); fprintf(stderr, "in checkpath, end port not in last box\n");
printpath(thepath); printpath(thepath);
}*/ }*/
if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes[boxn - 1]).LL.x) if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x)
thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x); thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x);
if (thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes[boxn - 1]).UR.x) if (thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x)
thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x); thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x);
if (thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes[boxn - 1]).LL.y) if (thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y)
thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y); thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y);
if (thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes[boxn - 1]).UR.y) if (thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y)
thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y); thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y);
} }
return 0; return 0;
} finally { } finally {

View File

@ -86,9 +86,9 @@ import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.fabs; import static smetana.core.Macro.fabs;
import static smetana.core.Macro.hypot; import static smetana.core.Macro.hypot;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agraphinfo_t;
import h.ST_Agnodeinfo_t; import h.ST_Agnodeinfo_t;
import h.ST_Agobj_s; import h.ST_Agobj_s;
import h.ST_Agraphinfo_t;
import h.ST_boxf; import h.ST_boxf;
import h.ST_inside_t; import h.ST_inside_t;
import h.ST_point; import h.ST_point;
@ -426,8 +426,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -724,8 +724,8 @@ throw new UnsupportedOperationException();
// static port Center = // static port Center =
/*private final static __struct__<port> Center = JUtils.from(port.class); /*private final static __struct__<port> Center = JUtils.from(port.class);
static { static {
Center.getStruct("p").setDouble("x", 0); Center.p.setDouble("x", 0);
Center.getStruct("p").setDouble("y", 0); Center.p.setDouble("y", 0);
Center.setDouble("theta", -1); Center.setDouble("theta", -1);
Center.setPtr("bp", null); Center.setPtr("bp", null);
Center.setInt("defined", 0); Center.setInt("defined", 0);
@ -1057,11 +1057,11 @@ try {
boolean s0, s1; boolean s0, s1;
double a, b, c; double a, b, c;
/* a x + b y = c */ /* a x + b y = c */
a = -(L1.getDouble("y") - L0.getDouble("y")); a = -(L1.y - L0.y);
b = (L1.getDouble("x") - L0.getDouble("x")); b = (L1.x - L0.x);
c = a * L0.getDouble("x") + b * L0.getDouble("y"); c = a * L0.x + b * L0.y;
s0 = (a * p0.getDouble("x") + b * p0.getDouble("y") - c >= 0); s0 = (a * p0.x + b * p0.y - c >= 0);
s1 = (a * p1.getDouble("x") + b * p1.getDouble("y") - c >= 0); s1 = (a * p1.x + b * p1.y - c >= 0);
return (s0 == s1); return (s0 == s1);
} finally { } finally {
LEAVING("eb4jyrh981apg1fy13fczexdl","same_side"); LEAVING("eb4jyrh981apg1fy13fczexdl","same_side");
@ -2504,7 +2504,7 @@ try {
CFunctionImpl ifn; //void (*ifn) (node_t *); CFunctionImpl ifn; //void (*ifn) (node_t *);
if (N(sh)) if (N(sh))
return enumAsInt(shape_kind.class, "SH_UNSET"); 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")) if (ifn.getName().equals("poly_init"))
return enumAsInt(shape_kind.class, "SH_POLY"); return enumAsInt(shape_kind.class, "SH_POLY");
UNSUPPORTED("251a710sgr57bnrs3uh7ppfpi"); // else if (ifn == record_init) UNSUPPORTED("251a710sgr57bnrs3uh7ppfpi"); // else if (ifn == record_init)
@ -2559,11 +2559,11 @@ try {
boolean isBox; int i, j, outp; boolean isBox; int i, j, outp;
ST_polygon_t poly = new ST_polygon_t(); ST_polygon_t poly = new ST_polygon_t();
regular = ND_shape(n).polygon.regular!=0; regular = ND_shape(n).polygon.regular!=0;
peripheries = ND_shape(n).getPtr("polygon").getInt("peripheries"); peripheries = ND_shape(n).polygon.peripheries;
sides = ND_shape(n).getPtr("polygon").getInt("sides"); sides = ND_shape(n).polygon.sides;
orientation = ND_shape(n).getPtr("polygon").getDouble("orientation"); orientation = ND_shape(n).polygon.orientation;
skew = ND_shape(n).getPtr("polygon").getDouble("skew"); skew = ND_shape(n).polygon.skew;
distortion = ND_shape(n).getPtr("polygon").getDouble("distortion"); distortion = ND_shape(n).polygon.distortion;
regular |= mapbool(agget(n, new CString("regular"))); regular |= mapbool(agget(n, new CString("regular")));
/* all calculations in floating point POINTS */ /* all calculations in floating point POINTS */
/* make x and y dimensions equal if node is regular /* make x and y dimensions equal if node is regular
@ -2594,7 +2594,7 @@ UNSUPPORTED("abmuc3vqirf3i48480fj0k14g"); // distortion = late_double(n, N_dist
/* get label dimensions */ /* get label dimensions */
dimen.___(ND_label(n).dimen); dimen.___(ND_label(n).dimen);
/* minimal whitespace around label */ /* 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 */ /* padding */
if ((p = agget(n, new CString("margin")))!=null) { if ((p = agget(n, new CString("margin")))!=null) {
UNSUPPORTED("4dlqwm3pklzgz2e777dm56n03"); // marginx = marginy = 0; UNSUPPORTED("4dlqwm3pklzgz2e777dm56n03"); // marginx = marginy = 0;
@ -2613,13 +2613,13 @@ UNSUPPORTED("afk9bpom7x393euamnvwwkx6b"); // } else
UNSUPPORTED("87bdwkkwbzyswxnepdd9bj8mb"); // {((dimen).x += 4*4); ((dimen).y += 2*4);}; UNSUPPORTED("87bdwkkwbzyswxnepdd9bj8mb"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
} else } else
{ {
((ST_pointf) dimen).x = dimen.getDouble("x") + 4*4; ((ST_pointf) dimen).x = dimen.x + 4*4;
((ST_pointf) dimen).y = dimen.getDouble("y") + 2*4; ((ST_pointf) dimen).y = dimen.y + 2*4;
}; };
} }
spacex = dimen.getDouble("x") - ND_label(n).dimen.getDouble("x"); spacex = dimen.x - ND_label(n).dimen.x;
/* quantization */ /* quantization */
if ((temp = agraphof(n).castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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("3nqb0s5rkwj3igt71vooj8asd"); // temp = ((((temp)*72>=0)?(int)((temp)*72 + .5):(int)((temp)*72 - .5)));
UNSUPPORTED("5fxtqwy8liyvnx1yvsou5hb4o"); // dimen.x = quant(dimen.x, temp); UNSUPPORTED("5fxtqwy8liyvnx1yvsou5hb4o"); // dimen.x = quant(dimen.x, temp);
UNSUPPORTED("et885f1jcqpske6ip856arouv"); // dimen.y = quant(dimen.y, temp); UNSUPPORTED("et885f1jcqpske6ip856arouv"); // dimen.y = quant(dimen.y, temp);
@ -2659,8 +2659,8 @@ UNSUPPORTED("1x57knvrmlciu7odfroo3paso"); // imagesize.y += 2;
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
} }
/* initialize node bb to labelsize */ /* initialize node bb to labelsize */
((ST_pointf) bb).x = ((dimen.getDouble("x"))>(imagesize.getInt("x"))?(dimen.getDouble("x")):(imagesize.getInt("x"))); ((ST_pointf) bb).x = ((dimen.x)>(imagesize.x)?(dimen.x):(imagesize.x));
((ST_pointf) bb).y = ((dimen.getDouble("y"))>(imagesize.getInt("y"))?(dimen.getDouble("y")):(imagesize.getInt("y"))); ((ST_pointf) bb).y = ((dimen.y)>(imagesize.y)?(dimen.y):(imagesize.y));
/* I don't know how to distort or skew ellipses in postscript */ /* I don't know how to distort or skew ellipses in postscript */
/* Convert request to a polygon with a large number of sides */ /* Convert request to a polygon with a large number of sides */
if ((sides <= 2) && ((distortion != 0.) || (skew != 0.))) { if ((sides <= 2) && ((distortion != 0.) || (skew != 0.))) {
@ -2669,14 +2669,14 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
/* extra sizing depends on if label is centered vertically */ /* extra sizing depends on if label is centered vertically */
p = agget(n, new CString("labelloc")); p = agget(n, new CString("labelloc"));
if (p!=null && (p.charAt(0) == 't' || p.charAt(0) == 'b')) if (p!=null && (p.charAt(0) == 't' || p.charAt(0) == 'b'))
n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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 else
n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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 isBox = (sides == 4 && (((orientation>=0)?(int)(orientation + .5):(int)(orientation - .5)) % 90) == 0
&& distortion == 0. && skew == 0.); && distortion == 0. && skew == 0.);
if (isBox) { if (isBox) {
/* for regular boxes the fit should be exact */ /* for regular boxes the fit should be exact */
} else if (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_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("4adqsyjwqwzs50ggjp57ok6u7"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices;
UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb); UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
} else { } else {
@ -2684,20 +2684,20 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
* containing bb centered on the origin, and then pad for that. * containing bb centered on the origin, and then pad for that.
* We assume the ellipse is defined by a scaling up of bb. * We assume the ellipse is defined by a scaling up of bb.
*/ */
temp = bb.getDouble("y") * 1.41421356237309504880; temp = bb.y * 1.41421356237309504880;
if (height > temp && (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getInt("valign") == 'c')) { 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 /* if there is height to spare
* and the label is centered vertically * and the label is centered vertically
* then just pad x in proportion to the spare height */ * 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 { } else {
bb.setDouble("x", bb.getDouble("x") * 1.41421356237309504880); bb.setDouble("x", bb.x * 1.41421356237309504880);
bb.setDouble("y", temp); bb.setDouble("y", temp);
} }
if (sides > 2) { if (sides > 2) {
temp = cos(3.14159265358979323846 / sides); temp = cos(3.14159265358979323846 / sides);
bb.setDouble("x", bb.getDouble("x") / temp); bb.setDouble("x", bb.x / temp);
bb.setDouble("y", bb.getDouble("y") / temp); bb.setDouble("y", bb.y / temp);
/* FIXME - for odd-sided polygons, e.g. triangles, there /* FIXME - for odd-sided polygons, e.g. triangles, there
would be a better fit with some vertical adjustment of the shape */ would be a better fit with some vertical adjustment of the shape */
} }
@ -2709,27 +2709,27 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) { if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) {
bb.setDouble("x", width); bb.setDouble("x", width);
bb.setDouble("y", height); bb.setDouble("y", height);
poly.setInt("option", poly.getInt("option") | (1 << 11)); poly.setInt("option", poly.option | (1 << 11));
} else if (mapbool(fxd)) { } else if (mapbool(fxd)) {
/* check only label, as images we can scale to fit */ /* check only label, as images we can scale to fit */
if ((width < (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getDouble("dimen.x")) if ((width < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.x)
|| (height < (n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).getPtr("label").getDouble("dimen.y"))))) || (height < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.y))))
System.err.println( System.err.println(
"node '%s', graph '%s' size too small for label\n"); "node '%s', graph '%s' size too small for label\n");
//agnameof(n), agnameof(agraphof(n))); //agnameof(n), agnameof(agraphof(n)));
bb.setDouble("x", width); bb.setDouble("x", width);
bb.setDouble("y", height); bb.setDouble("y", height);
} else { } else {
width = MAX(width, bb.getDouble("x")); width = MAX(width, bb.x);
((ST_pointf) bb).x = width; ((ST_pointf) bb).x = width;
height = MAX(height, bb.getDouble("y")); height = MAX(height, bb.y);
((ST_pointf) bb).y = height; ((ST_pointf) bb).y = height;
} }
/* If regular, make dimensions the same. /* If regular, make dimensions the same.
* Need this to guarantee final node size is regular. * Need this to guarantee final node size is regular.
*/ */
if (regular) { if (regular) {
width = MAX(bb.getDouble("x"), bb.getDouble("y")); width = MAX(bb.x, bb.y);
height = width; height = width;
((ST_pointf) bb).x = width; ((ST_pointf) bb).x = width;
((ST_pointf) bb).y = width; ((ST_pointf) bb).y = width;
@ -2737,22 +2737,22 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
/* Compute space available for label. Provides the justification borders */ /* Compute space available for label. Provides the justification borders */
if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) { if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) {
if (isBox) { if (isBox) {
((ST_pointf) ND_label(n).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")) { else if (dimen.y < bb.y) {
temp = bb.getDouble("x") * sqrt(1.0 - SQR(dimen.getDouble("y")) / SQR(bb.getDouble("y"))); temp = bb.x * sqrt(1.0 - SQR(dimen.y) / SQR(bb.y));
ND_label(n).space.setDouble("x", MAX(dimen.getDouble("x"),temp) - spacex); ND_label(n).space.setDouble("x", MAX(dimen.x,temp) - spacex);
} }
else else
ND_label(n).space.setDouble("x", dimen.getDouble("x") - spacex); ND_label(n).space.setDouble("x", dimen.x - spacex);
} else { } else {
ND_label(n).space.setDouble("x", dimen.getDouble("x") - spacex); ND_label(n).space.setDouble("x", dimen.x - spacex);
} }
if ((poly.getInt("option") & (1 << 11)) == 0) { if ((poly.option & (1 << 11)) == 0) {
temp = bb.getDouble("y") - min_bb.getDouble("y"); temp = bb.y - min_bb.y;
if (dimen.getDouble("y") < imagesize.getInt("y")) if (dimen.y < imagesize.y)
temp += imagesize.getInt("y") - dimen.getDouble("y"); temp += imagesize.y - dimen.y;
((ST_pointf) ND_label(n).space).y = dimen.getDouble("y") + temp; ((ST_pointf) ND_label(n).space).y = dimen.y + temp;
} }
outp = peripheries; outp = peripheries;
if (peripheries < 1) if (peripheries < 1)
@ -2760,12 +2760,12 @@ UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
if (sides < 3) { /* ellipses */ if (sides < 3) { /* ellipses */
sides = 2; sides = 2;
vertices = new ST_pointf.Array(outp * sides); vertices = new ST_pointf.Array(outp * sides);
P.setDouble("x", bb.getDouble("x") / 2.); P.setDouble("x", bb.x / 2.);
P.setDouble("y", bb.getDouble("y") / 2.); P.setDouble("y", bb.y / 2.);
vertices.setDouble("x", -P.getDouble("x")); vertices.setDouble("x", -P.x);
vertices.setDouble("y", -P.getDouble("y")); vertices.setDouble("y", -P.y);
vertices.plus(1).setDouble("x", P.getDouble("x")); vertices.plus(1).setDouble("x", P.x);
vertices.plus(1).setDouble("y", P.getDouble("y")); vertices.plus(1).setDouble("y", P.y);
if (peripheries > 1) { if (peripheries > 1) {
UNSUPPORTED("4ofenmfgj7cgyf624qmugcx77"); // for (j = 1, i = 2; j < peripheries; j++) { UNSUPPORTED("4ofenmfgj7cgyf624qmugcx77"); // for (j = 1, i = 2; j < peripheries; j++) {
UNSUPPORTED("458w3r6n3nidn2j2b154phpzt"); // P.x += 4; UNSUPPORTED("458w3r6n3nidn2j2b154phpzt"); // P.x += 4;
@ -2794,7 +2794,7 @@ UNSUPPORTED("b5z0hw4dacenv33xsaex70g8d"); // bb.y = 2. * P.y;
* the current segments, and outside by GAP distance, intersect. * the current segments, and outside by GAP distance, intersect.
*/ */
vertices = new ST_pointf.Array(outp * sides); vertices = new ST_pointf.Array(outp * sides);
if (((ST_polygon_t)ND_shape(n).getPtr("polygon")).vertices!=null) { 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("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("227lpcg9dt83m2bm8yshb4djf"); // pd->vertex_gen (vertices, &bb);
UNSUPPORTED("cc3jvnwvbhjhro4adeet363yd"); // xmax = bb.x/2; UNSUPPORTED("cc3jvnwvbhjhro4adeet363yd"); // xmax = bb.x/2;
@ -2815,33 +2815,33 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2;
/*next regular vertex */ /*next regular vertex */
angle += sectorangle; angle += sectorangle;
sinx = sin(angle); cosx = cos(angle); sinx = sin(angle); cosx = cos(angle);
((ST_pointf) R).x = R.getDouble("x") + sidelength * cosx; ((ST_pointf) R).x = R.x + sidelength * cosx;
((ST_pointf) R).y = R.getDouble("y") + sidelength * sinx; ((ST_pointf) R).y = R.y + sidelength * sinx;
/*distort and skew */ /*distort and skew */
((ST_pointf) P).x = R.getDouble("x") * (skewdist + R.getDouble("y") * gdistortion) + R.getDouble("y") * gskew; ((ST_pointf) P).x = R.x * (skewdist + R.y * gdistortion) + R.y * gskew;
((ST_pointf) P).y = R.getDouble("y"); ((ST_pointf) P).y = R.y;
/*orient P.x,P.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); sinx = sin(alpha); cosx = cos(alpha);
((ST_pointf) P).y = hypot(P.getDouble("x"), P.getDouble("y")); ((ST_pointf) P).y = hypot(P.x, P.y);
((ST_pointf) P).x = P.getDouble("y"); ((ST_pointf) P).x = P.y;
((ST_pointf) P).x = P.getDouble("x") * cosx; ((ST_pointf) P).x = P.x * cosx;
((ST_pointf) P).y = P.getDouble("y") * sinx; ((ST_pointf) P).y = P.y * sinx;
/*scale for label */ /*scale for label */
((ST_pointf) P).x = P.getDouble("x") * bb.getDouble("x"); ((ST_pointf) P).x = P.x * bb.x;
((ST_pointf) P).y = P.getDouble("y") * bb.getDouble("y"); ((ST_pointf) P).y = P.y * bb.y;
/*find max for bounding box */ /*find max for bounding box */
xmax = MAX(fabs(P.getDouble("x")), xmax); xmax = MAX(fabs(P.x), xmax);
ymax = MAX(fabs(P.getDouble("y")), ymax); ymax = MAX(fabs(P.y), ymax);
/* store result in array of points */ /* store result in array of points */
vertices.plus(i).setStruct(P); vertices.plus(i).setStruct(P);
if (isBox) { /* enforce exact symmetry of box */ if (isBox) { /* enforce exact symmetry of box */
vertices.get(1).x = -P.getDouble("x"); vertices.get(1).x = -P.x;
vertices.get(1).y = P.getDouble("y"); vertices.get(1).y = P.y;
vertices.get(2).x = -P.getDouble("x"); vertices.get(2).x = -P.x;
vertices.get(2).y = -P.getDouble("y"); vertices.get(2).y = -P.y;
vertices.get(3).x = P.getDouble("x"); vertices.get(3).x = P.x;
vertices.get(3).y = -P.getDouble("y"); vertices.get(3).y = -P.y;
break; break;
} }
} }
@ -2851,12 +2851,12 @@ UNSUPPORTED("39rdmp8vl9muqtv7xs1xwtrwk"); // ymax = bb.y/2;
ymax *= 2.; ymax *= 2.;
((ST_pointf) bb).x = MAX(width, xmax); ((ST_pointf) bb).x = MAX(width, xmax);
((ST_pointf) bb).y = MAX(height, ymax); ((ST_pointf) bb).y = MAX(height, ymax);
scalex = bb.getDouble("x") / xmax; scalex = bb.x / xmax;
scaley = bb.getDouble("y") / ymax; scaley = bb.y / ymax;
for (i = 0; i < sides; i++) { for (i = 0; i < sides; i++) {
P.____(vertices.plus(i)); P.____(vertices.plus(i));
((ST_pointf) P).x = P.getDouble("x") * scalex; ((ST_pointf) P).x = P.x * scalex;
((ST_pointf) P).y = P.getDouble("y") * scaley; ((ST_pointf) P).y = P.y * scaley;
vertices.plus(i).setStruct(P); vertices.plus(i).setStruct(P);
} }
if (peripheries > 1) { if (peripheries > 1) {
@ -2900,15 +2900,15 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
poly.setDouble("skew", skew); poly.setDouble("skew", skew);
poly.setDouble("distortion", distortion); poly.setDouble("distortion", distortion);
poly.vertices = vertices; poly.vertices = vertices;
if ((poly.getInt("option") & (1 << 11))!=0) { if ((poly.option & (1 << 11))!=0) {
/* set width and height to reflect label and shape */ /* 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("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); UNSUPPORTED("8oouzms2x039fhfcfxm7yc4su"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->height) = ((((dimen.y)>(bb.y)?(dimen.y):(bb.y)))/(double)72);
} else { } else {
n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.getDouble("x"))/(double)72)); n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.x)/(double)72));
n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.getDouble("y"))/(double)72)); n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.y)/(double)72));
} }
n.castTo(ST_Agobj_s.class).getPtr("data").castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly); n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly);
} finally { } finally {
LEAVING("a11xv6duihbr3d6gkgo2ye2j5","poly_init"); LEAVING("a11xv6duihbr3d6gkgo2ye2j5","poly_init");
} }
@ -2953,8 +2953,8 @@ try {
int i, i1, j; int i, i1, j;
boolean s; boolean s;
final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf(); final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf();
__ptr__ bp = inside_context.getPtr("s.bp"); ST_boxf bp = inside_context.s_bp;
__ptr__ n = inside_context.getPtr("s.n"); ST_Agnode_s n = inside_context.s_n;
P.___(ccwrotatepf(p, 90 * GD_rankdir(agraphof(n)))); P.___(ccwrotatepf(p, 90 * GD_rankdir(agraphof(n))));
/* Quick test if port rectangle is target */ /* Quick test if port rectangle is target */
if (bp!=null) { if (bp!=null) {
@ -2966,8 +2966,8 @@ try {
double n_width = 0, n_height = 0; double n_width = 0, n_height = 0;
Z.z().poly = (ST_polygon_t) ND_shape_info(n); Z.z().poly = (ST_polygon_t) ND_shape_info(n);
Z.z().vertex = Z.z().poly.vertices; Z.z().vertex = Z.z().poly.vertices;
Z.z().sides = Z.z().poly.getInt("sides"); Z.z().sides = Z.z().poly.sides;
if ((Z.z().poly.getInt("option") & (1 << 11))!=0) { if ((Z.z().poly.option & (1 << 11))!=0) {
UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly); UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly);
UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x; UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x;
UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y; UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y;
@ -3001,20 +3001,20 @@ UNSUPPORTED("8t3g4d9acruono62leh5a8hxh"); // xsize = ND_ht(n);
Z.z().box_URx = n_width / 2.0; Z.z().box_URx = n_width / 2.0;
Z.z().box_URy = n_height / 2.0; Z.z().box_URy = n_height / 2.0;
/* index to outer-periphery */ /* 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) if (Z.z().outp < 0)
Z.z().outp = 0; Z.z().outp = 0;
Z.z().lastn = (ST_Agnode_s) n; Z.z().lastn = (ST_Agnode_s) n;
} }
/* scale */ /* scale */
P.setDouble("x", P.getDouble("x") * Z.z().scalex); P.setDouble("x", P.x * Z.z().scalex);
P.setDouble("y", P.getDouble("y") * Z.z().scaley); P.setDouble("y", P.y * Z.z().scaley);
/* inside bounding box? */ /* 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; return false;
/* ellipses */ /* ellipses */
if (Z.z().sides <= 2) 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 */ /* 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 */ i = Z.z().last % Z.z().sides; /* in case last left over from larger polygon */
i1 = (i + 1) % Z.z().sides; i1 = (i + 1) % Z.z().sides;

View File

@ -79,7 +79,8 @@ import static smetana.core.Macro.ND_order;
import static smetana.core.Macro.ND_rank; import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_rw; import static smetana.core.Macro.ND_rw;
import static smetana.core.Macro.ND_shape; import static smetana.core.Macro.ND_shape;
import static smetana.core.Macro.*; import static smetana.core.Macro.NOT;
import static smetana.core.Macro.NOTI;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
@ -422,8 +423,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -720,7 +721,7 @@ throw new UnsupportedOperationException();
//3 6izm0fbkejw7odmiw4zaw1ycp //3 6izm0fbkejw7odmiw4zaw1ycp
// static void arrow_clip(edge_t * fe, node_t * hn, pointf * ps, int *startp, int *endp, bezier * spl, splineInfo * info) // 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(ST_Agedge_s fe, ST_Agnode_s hn, __ptr__ ps, int startp[], int endp[], ST_bezier spl, ST_splineInfo 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"); ENTERING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
try { try {
ST_Agedge_s e; ST_Agedge_s e;
@ -732,11 +733,11 @@ try {
if (info.ignoreSwap) if (info.ignoreSwap)
j = false; j = false;
else else
j = (Boolean) info.call("swapEnds", e); j = (Boolean) info.swapEnds.exe(e);
arrow_flags(e, sflag, eflag); arrow_flags(e, sflag, eflag);
if ((Boolean) info.call("splineMerge", hn)) if ((Boolean) info.splineMerge.exe(hn))
eflag[0] = 0; eflag[0] = 0;
if ((Boolean) info.call("splineMerge", agtail(fe))) if ((Boolean) info.splineMerge.exe(agtail(fe)))
sflag[0] = 0; sflag[0] = 0;
/* swap the two ends */ /* swap the two ends */
if (j) { if (j) {
@ -806,7 +807,7 @@ try {
found = NOT(false); found = NOT(false);
odir.setValue(t); 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) if (found)
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
sp.plus(i).setStruct(best.plus(i).getStruct()); sp.plus(i).setStruct(best.plus(i).getStruct());
@ -823,7 +824,7 @@ LEAVING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
//3 1fjkj1ydhtlf13pqj5r041orq //3 1fjkj1ydhtlf13pqj5r041orq
// static void shape_clip0(inside_t * inside_context, node_t * n, pointf curve[4], boolean left_inside) // 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, ST_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"); ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0");
try { try {
int i; int i;
@ -831,14 +832,14 @@ try {
final ST_pointf.Array c = new ST_pointf.Array( 4); final ST_pointf.Array c = new ST_pointf.Array( 4);
save_real_size = ND_rw(n); save_real_size = ND_rw(n);
for (i = 0; i < 4; i++) { 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("x", curve.get(i).x - ND_coord(n).x);
c.plus(i).setDouble("y", curve.plus(i).getDouble("y") - ND_coord(n).getDouble("y")); 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); left_inside);
for (i = 0; i < 4; i++) { 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("x", c.get(i).x + ND_coord(n).x);
curve.plus(i).setDouble("y", c.plus(i).getDouble("y") + ND_coord(n).getDouble("y")); curve.plus(i).setDouble("y", c.get(i).y + ND_coord(n).y);
} }
ND_rw(n, save_real_size); ND_rw(n, save_real_size);
} finally { } finally {
@ -893,10 +894,10 @@ try {
rv.setInt("size", sz); rv.setInt("size", sz);
rv.setInt("sflag", 0); rv.setInt("sflag", 0);
rv.setInt("eflag", 0); rv.setInt("eflag", 0);
rv.getStruct("sp").setDouble("x", 0); rv.sp.setDouble("x", 0);
rv.getStruct("sp").setDouble("y", 0); rv.sp.setDouble("y", 0);
rv.getStruct("ep").setDouble("x", 0); rv.ep.setDouble("x", 0);
rv.getStruct("ep").setDouble("y", 0); rv.ep.setDouble("y", 0);
return rv; return rv;
} finally { } finally {
LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline"); LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
@ -908,7 +909,7 @@ LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
//3 duednxyuvf6xrff752uuv620f //3 duednxyuvf6xrff752uuv620f
// void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info) // void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info)
public static void clip_and_install(ST_Agedge_s fe, ST_Agnode_s hn, __ptr__ ps, int pn, ST_splineInfo 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"); ENTERING("duednxyuvf6xrff752uuv620f","clip_and_install");
try { try {
final ST_pointf p2 = new ST_pointf(); final ST_pointf p2 = new ST_pointf();
@ -933,37 +934,37 @@ try {
tn = tmp; tn = tmp;
} }
if (EQ(tn, agtail(orig))) { if (EQ(tn, agtail(orig))) {
clipTail = ED_tail_port(orig).getInt("clip"); clipTail = ED_tail_port(orig).clip;
clipHead = ED_head_port(orig).getInt("clip"); clipHead = ED_head_port(orig).clip;
tbox = (ST_boxf) ED_tail_port(orig).getPtr("bp"); tbox = (ST_boxf) ED_tail_port(orig).bp;
hbox = (ST_boxf) ED_head_port(orig).getPtr("bp"); hbox = (ST_boxf) ED_head_port(orig).bp;
} }
else { /* fe and orig are reversed */ else { /* fe and orig are reversed */
clipTail = ED_head_port(orig).getInt("clip"); clipTail = ED_head_port(orig).clip;
clipHead = ED_tail_port(orig).getInt("clip"); clipHead = ED_tail_port(orig).clip;
hbox = (ST_boxf) ED_tail_port(orig).getPtr("bp"); hbox = (ST_boxf) ED_tail_port(orig).bp;
tbox = (ST_boxf) ED_head_port(orig).getPtr("bp"); tbox = (ST_boxf) ED_head_port(orig).bp;
} }
/* spline may be interior to node */ /* 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.n", tn);
inside_context.setPtr("s.bp", tbox); inside_context.setPtr("s.bp", tbox);
for (start[0] = 0; start[0] < pn - 4; start[0] += 3) { 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("x", ps.get(start[0] + 3).x - ND_coord(tn).x);
p2.setDouble("y", ps.plus(start[0] + 3).getDouble("y") - ND_coord(tn).getDouble("y")); p2.setDouble("y", ps.get(start[0] + 3).y - ND_coord(tn).y);
if (((Boolean)ND_shape(tn).getPtr("fns").call("insidefn", inside_context, p2)) == false) if (((Boolean)ND_shape(tn).fns.insidefn.exe(inside_context, p2)) == false)
break; break;
} }
shape_clip0(inside_context, tn, ps.plus(start[0]), NOT(false)); shape_clip0(inside_context, tn, ps.plus(start[0]), NOT(false));
} else } else
start[0] = 0; 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.n", hn);
inside_context.setPtr("s.bp", hbox); inside_context.setPtr("s.bp", hbox);
for (end[0] = pn - 4; end[0] > 0; end[0] -= 3) { 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("x", ps.get(end[0]).x - ND_coord(hn).x);
p2.setDouble("y", ps.plus(end[0]).getDouble("y") - ND_coord(hn).getDouble("y")); p2.setDouble("y", ps.get(end[0]).y - ND_coord(hn).y);
if (((Boolean)ND_shape(hn).getPtr("fns").call("insidefn", inside_context, p2)) == false) if (((Boolean)ND_shape(hn).fns.insidefn.exe(inside_context, p2)) == false)
break; break;
} }
shape_clip0(inside_context, hn, ps.plus(end[0]), false); shape_clip0(inside_context, hn, ps.plus(end[0]), false);
@ -1047,8 +1048,8 @@ ENTERING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
try { try {
if (b.LL.x < b.UR.x && b.LL.y < b.UR.y) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{ {
P.boxes[P.getInt("nbox")].setStruct(b); P.boxes[P.nbox].setStruct(b);
P.setInt("nbox", P.getInt("nbox")+1); P.nbox = P.nbox+1;
} }
} finally { } finally {
LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box"); LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
@ -1070,24 +1071,24 @@ try {
if (ED_tail_port(e).dyna!=0) if (ED_tail_port(e).dyna!=0)
ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e))); ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e)));
if (ND_shape(n)!=null) if (ND_shape(n)!=null)
pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn"); pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
else else
pboxfn = null; pboxfn = null;
P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).getStruct("p"))); P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).p));
if (merge) { if (merge) {
/*P->start.theta = - M_PI / 2; */ /*P->start.theta = - M_PI / 2; */
P.start.setDouble("theta", conc_slope(agtail(e))); P.start.setDouble("theta", conc_slope(agtail(e)));
P.start.constrained= NOTI(false); P.start.constrained= NOTI(false);
} else { } else {
if (ED_tail_port(e).constrained!=0) { if (ED_tail_port(e).constrained!=0) {
P.start.setDouble("theta", ED_tail_port(e).getDouble("theta")); P.start.setDouble("theta", ED_tail_port(e).theta);
P.start.constrained= NOTI(false); P.start.constrained= NOTI(false);
} else } else
P.start.constrained= 0; P.start.constrained= 0;
} }
P.setInt("nbox", 0); P.nbox = 0;
P.setPtr("data", e); P.setPtr("data", e);
endp.setStruct("np", P.start.getStruct("p")); endp.setStruct("np", P.start.p);
if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_tail_port(e).side)!=0)) { if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_tail_port(e).side)!=0)) {
UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig; UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb; UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
@ -1221,12 +1222,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side;
UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return; UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
} }
if (et == 1) side = (1<<0); if (et == 1) side = (1<<0);
else side = endp.getInt("sidemask"); /* for flat edges */ else side = endp.sidemask; /* for flat edges */
if (pboxfn!=null if (pboxfn!=null
&& (mask = (Integer) pboxfn.exe(n, ED_tail_port(e), side, endp.boxes[0], 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; UNSUPPORTED("ex9kjvshm19zbu9vqonk1avd8"); // endp->sidemask = mask;
else { else {
endp.boxes[0].setStruct(endp.getStruct("nb")); endp.boxes[0].setStruct(endp.nb);
endp.setInt("boxn", 1); endp.setInt("boxn", 1);
switch (et) { switch (et) {
case 8: case 8:
@ -1238,15 +1239,15 @@ UNSUPPORTED("46vb5zg9vm9n0q21g53nj66v3"); // endp->boxes[0].UR.y = P->start
UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = (1<<0); UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = (1<<0);
break; break;
case 2: case 2:
if (endp.getInt("sidemask") == (1<<2)) if (endp.sidemask == (1<<2))
((ST_boxf)endp.boxes[0]).LL.y = P.start.getStruct("p").getDouble("y"); ((ST_boxf)endp.boxes[0]).LL.y = P.start.p.y;
else else
((ST_boxf)endp.boxes[0]).UR.y = P.start.getStruct("p").getDouble("y"); ((ST_boxf)endp.boxes[0]).UR.y = P.start.p.y;
break; break;
case 1: case 1:
((ST_boxf)(endp).boxes[0]).UR.y = P.start.getStruct("p").getDouble("y"); ((ST_boxf)(endp).boxes[0]).UR.y = P.start.p.y;
endp.setInt("sidemask", (1<<0)); endp.setInt("sidemask", (1<<0));
P.start.getStruct("p").setDouble("y", P.start.getStruct("p").getDouble("y") - 1); P.start.p.setDouble("y", P.start.p.y - 1);
break; break;
} }
} }
@ -1270,10 +1271,10 @@ try {
if (ED_head_port(e).dyna!=0) if (ED_head_port(e).dyna!=0)
UNSUPPORTED("9brhx94sjudx3jtzrnwa60x8"); // ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e)); UNSUPPORTED("9brhx94sjudx3jtzrnwa60x8"); // ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e));
if (ND_shape(n)!=null) if (ND_shape(n)!=null)
pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn"); pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
else else
pboxfn = null; pboxfn = null;
P.getStruct("end").setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).getStruct("p"))); P.end.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).p));
if (merge) { if (merge) {
UNSUPPORTED("cproejwusj67kuugolh6tbkwz"); // /*P->end.theta = M_PI / 2; */ UNSUPPORTED("cproejwusj67kuugolh6tbkwz"); // /*P->end.theta = M_PI / 2; */
UNSUPPORTED("65vhfvz1d1tub3f85tdsgg2g5"); // P->end.theta = conc_slope(aghead(e)) + M_PI; UNSUPPORTED("65vhfvz1d1tub3f85tdsgg2g5"); // P->end.theta = conc_slope(aghead(e)) + M_PI;
@ -1281,12 +1282,12 @@ UNSUPPORTED("du4hwt6pjf3bmkvowssm7b0uo"); // assert(P->end.theta < 2 * M_PI);
UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0); UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0);
} else { } else {
if (ED_head_port(e).constrained!=0) { if (ED_head_port(e).constrained!=0) {
P.getStruct("end").setDouble("theta", ED_head_port(e).getDouble("theta")); P.end.setDouble("theta", ED_head_port(e).theta);
P.getStruct("end").setInt("constrained", 1); P.end.setInt("constrained", 1);
} else } 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)) { if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_head_port(e).side)!=0)) {
UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig; UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb; UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
@ -1421,12 +1422,12 @@ UNSUPPORTED("8jqn3kj2hrrlcifbw3x9sf6qu"); // endp->sidemask = side;
UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return; UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
} }
if (et == 1) side = (1<<2); if (et == 1) side = (1<<2);
else side = endp.getInt("sidemask"); /* for flat edges */ else side = endp.sidemask; /* for flat edges */
if (pboxfn!=null if (pboxfn!=null
&& (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.getInt("boxn")))!=0) && (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.boxn))!=0)
endp.setInt("sidemask", mask); endp.setInt("sidemask", mask);
else { else {
endp.boxes[0].setStruct(endp.getStruct("nb")); endp.boxes[0].setStruct(endp.nb);
endp.setInt("boxn", 1); endp.setInt("boxn", 1);
switch (et) { switch (et) {
case 8: case 8:
@ -1438,15 +1439,15 @@ UNSUPPORTED("db6vmvnse8bawy8qwct7l24u8"); // endp->boxes[0].LL.y = P->end.p
UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = (1<<2); UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = (1<<2);
UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break; UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
case 2: case 2:
if (endp.getInt("sidemask") == (1<<2)) if (endp.sidemask == (1<<2))
endp.boxes[0].LL.y = P.getStruct("end").getStruct("p").getDouble("y"); endp.boxes[0].LL.y = P.end.p.y;
else else
endp.boxes[0].UR.y = P.getStruct("end").getStruct("p").getDouble("y"); endp.boxes[0].UR.y = P.end.p.y;
break; break;
case 1: case 1:
endp.boxes[0].LL.y = P.getStruct("end").getStruct("p").getDouble("y"); endp.boxes[0].LL.y = P.end.p.y;
endp.setInt("sidemask", (1<<2)); 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; break;
} }
} }
@ -1684,7 +1685,7 @@ throw new UnsupportedOperationException();
//3 3sr8gvj4141qql0v12lb89cyt //3 3sr8gvj4141qql0v12lb89cyt
// static void selfRight (edge_t* edges[], int ind, int cnt, double stepx, double sizey, splineInfo* sinfo) // 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, ST_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"); ENTERING("3sr8gvj4141qql0v12lb89cyt","selfRight");
try { try {
int i, sgn, point_pair; int i, sgn, point_pair;
@ -1694,19 +1695,19 @@ try {
ST_Agedge_s e; ST_Agedge_s e;
final ST_pointf.Array points = new ST_pointf.Array( 1000); final ST_pointf.Array points = new ST_pointf.Array( 1000);
int pointn; int pointn;
e = (ST_Agedge_s) edges.plus(ind).getPtr(); e = (ST_Agedge_s) edges.get(ind);
n = agtail(e); n = agtail(e);
stepy = (sizey / 2.) / cnt; stepy = (sizey / 2.) / cnt;
stepy = MAX(stepy, 2.); stepy = MAX(stepy, 2.);
pointn = 0; pointn = 0;
np.___(ND_coord(n)); np.___(ND_coord(n));
tp.___(ED_tail_port(e).getStruct("p")); tp.___(ED_tail_port(e).p);
tp.setDouble("x", tp.getDouble("x") + np.getDouble("x")); tp.setDouble("x", tp.x + np.x);
tp.setDouble("y", tp.getDouble("y") + np.getDouble("y")); tp.setDouble("y", tp.y + np.y);
hp.___(ED_head_port(e).getStruct("p")); hp.___(ED_head_port(e).p);
hp.setDouble("x", hp.getDouble("x") + np.getDouble("x")); hp.setDouble("x", hp.x + np.x);
hp.setDouble("y", hp.getDouble("y") + np.getDouble("y")); hp.setDouble("y", hp.y + np.y);
if (tp.getDouble("y") >= hp.getDouble("y")) sgn = 1; if (tp.y >= hp.y) sgn = 1;
else sgn = -1; else sgn = -1;
dx = ND_rw(n); dx = ND_rw(n);
dy = 0; dy = 0;
@ -1715,35 +1716,35 @@ try {
point_pair = convert_sides_to_points(ED_tail_port(e).side,ED_head_port(e).side); point_pair = convert_sides_to_points(ED_tail_port(e).side,ED_head_port(e).side);
switch(point_pair){ switch(point_pair){
case 32: case 32:
case 65: if(tp.getDouble("y") == hp.getDouble("y")) case 65: if(tp.y == hp.y)
sgn = -sgn; sgn = -sgn;
break; break;
default: default:
break; break;
} }
tx = MIN(dx, 3*(np.getDouble("x") + dx - tp.getDouble("x"))); tx = MIN(dx, 3*(np.x + dx - tp.x));
hx = MIN(dx, 3*(np.getDouble("x") + dx - hp.getDouble("x"))); hx = MIN(dx, 3*(np.x + dx - hp.x));
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
e = (ST_Agedge_s) edges.plus(ind++).getPtr(); e = (ST_Agedge_s) edges.plus(ind++).getPtr();
dx += stepx; tx += stepx; hx += stepx; dy += sgn*stepy; dx += stepx; tx += stepx; hx += stepx; dy += sgn*stepy;
pointn = 0; pointn = 0;
points.plus(pointn++).setStruct(tp); points.plus(pointn++).setStruct(tp);
points.plus(pointn++).setStruct(pointfof(tp.getDouble("x") + tx / 3, tp.getDouble("y") + dy)); points.plus(pointn++).setStruct(pointfof(tp.x + tx / 3, tp.y + dy));
points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, tp.getDouble("y") + dy)); points.plus(pointn++).setStruct(pointfof(np.x + dx, tp.y + dy));
points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, (tp.getDouble("y")+hp.getDouble("y"))/2)); points.plus(pointn++).setStruct(pointfof(np.x + dx, (tp.y+hp.y)/2));
points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, hp.getDouble("y") - dy)); points.plus(pointn++).setStruct(pointfof(np.x + dx, hp.y - dy));
points.plus(pointn++).setStruct(pointfof(hp.getDouble("x") + hx / 3, hp.getDouble("y") - dy)); points.plus(pointn++).setStruct(pointfof(hp.x + hx / 3, hp.y - dy));
points.plus(pointn++).setStruct(hp); points.plus(pointn++).setStruct(hp);
if (ED_label(e)!=null) { if (ED_label(e)!=null) {
if (GD_flip(agraphof(agtail(e)))!=0) { if (GD_flip(agraphof(agtail(e)))!=0) {
width = ED_label(e).dimen.getDouble("y"); width = ED_label(e).dimen.y;
height = ED_label(e).dimen.getDouble("x"); height = ED_label(e).dimen.x;
} else { } else {
width = ED_label(e).dimen.getDouble("x"); width = ED_label(e).dimen.x;
height = ED_label(e).dimen.getDouble("y"); 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).pos.setDouble("x", ND_coord(n).x + dx + width / 2.0);
ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y")); ED_label(e).pos.setDouble("y", ND_coord(n).y);
ED_label(e).set= NOTI(false); ED_label(e).set= NOTI(false);
if (width > stepx) if (width > stepx)
dx += width - stepx; dx += width - stepx;
@ -1854,7 +1855,7 @@ try {
)) { )) {
sw = 18; sw = 18;
if (l!=null) { if (l!=null) {
label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.getDouble("y") : l.dimen.getDouble("x"); label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.y : l.dimen.x;
sw += label_width; sw += label_width;
} }
} }
@ -1870,11 +1871,11 @@ LEAVING("678whq05s481ertx02jloteu3","selfRightSpace");
//3 bt3fwgprixbc5rceeewozdqr9 //3 bt3fwgprixbc5rceeewozdqr9
// void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, double sizex, double sizey, splineInfo * sinfo) // void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, double sizex, double sizey, splineInfo * sinfo)
public static void makeSelfEdge(ST_path P, __ptr__ edges, int ind, int cnt, double sizex, double sizey, ST_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"); ENTERING("bt3fwgprixbc5rceeewozdqr9","makeSelfEdge");
try { try {
ST_Agedge_s e; ST_Agedge_s e;
e = (ST_Agedge_s) edges.plus(ind).getPtr(); e = (ST_Agedge_s) edges.get(ind);
/* self edge without ports or /* self edge without ports or
* self edge with all ports inside, on the right, or at most 1 on top * self edge with all ports inside, on the right, or at most 1 on top
* and at most 1 on bottom * and at most 1 on bottom
@ -1944,7 +1945,7 @@ public static void endPoints(ST_splines spl, ST_pointf p, ST_pointf q) {
ENTERING("7wyn51o9k6u7joaq9k18boffh","endPoints"); ENTERING("7wyn51o9k6u7joaq9k18boffh","endPoints");
try { try {
final ST_bezier bz = new ST_bezier(); final ST_bezier bz = new ST_bezier();
bz.____(spl.list.plus(0).getPtr()); bz.____(spl.list.get(0));
if (bz.sflag!=0) { if (bz.sflag!=0) {
UNSUPPORTED("4wazlko0bxmzxoobqacij1btk"); // *p = bz.sp; UNSUPPORTED("4wazlko0bxmzxoobqacij1btk"); // *p = bz.sp;
} }

View File

@ -50,7 +50,7 @@ import static smetana.core.Macro.UNSUPPORTED;
import h.ST_GVC_s; import h.ST_GVC_s;
import h.ST_dt_s; import h.ST_dt_s;
import h.ST_pointf; import h.ST_pointf;
import smetana.core.__ptr__; import h.ST_textspan_t;
public class textspan__c { public class textspan__c {
//1 9k44uhd5foylaeoekf3llonjq //1 9k44uhd5foylaeoekf3llonjq
@ -376,8 +376,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -773,17 +773,17 @@ throw new UnsupportedOperationException();
//3 n8tcl06mifdn779rzenam44z //3 n8tcl06mifdn779rzenam44z
// pointf textspan_size(GVC_t *gvc, textspan_t * span) // pointf textspan_size(GVC_t *gvc, textspan_t * span)
public static ST_pointf textspan_size(ST_GVC_s gvc, __ptr__ span) { public static ST_pointf textspan_size(ST_GVC_s gvc, ST_textspan_t span) {
// WARNING!! STRUCT // WARNING!! STRUCT
return textspan_size_w_(gvc, span).copy(); return textspan_size_w_(gvc, span).copy();
} }
private static ST_pointf textspan_size_w_(ST_GVC_s gvc, __ptr__ span) { private static ST_pointf textspan_size_w_(ST_GVC_s gvc, ST_textspan_t span) {
ENTERING("n8tcl06mifdn779rzenam44z","textspan_size"); ENTERING("n8tcl06mifdn779rzenam44z","textspan_size");
try { try {
System.err.println("Warning:textspan_size "+span); System.err.println("Warning:textspan_size "+span);
span.getStruct("size").setDouble("x", 30); span.size.setDouble("x", 30);
span.getStruct("size").setDouble("y", 20); span.size.setDouble("y", 20);
return (ST_pointf) span.getStruct("size").copy(); return span.size.copy();
} finally { } finally {
LEAVING("n8tcl06mifdn779rzenam44z","textspan_size"); LEAVING("n8tcl06mifdn779rzenam44z","textspan_size");
} }

View File

@ -436,8 +436,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -759,7 +759,7 @@ LEAVING("c7cptalfn8k75wyfirbnptnav","new_queue");
public static void free_queue(ST_nodequeue q) { public static void free_queue(ST_nodequeue q) {
ENTERING("1uj5nmdvwmuklnpd3v5py547f","free_queue"); ENTERING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
try { try {
Memory.free(q.getPtr("store")); Memory.free(q.store);
Memory.free(q); Memory.free(q);
} finally { } finally {
LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue"); LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
@ -775,9 +775,9 @@ public static void enqueue(ST_nodequeue q, ST_Agnode_s n) {
ENTERING("20pwd6i141q3o25lfvrdqytot","enqueue"); ENTERING("20pwd6i141q3o25lfvrdqytot","enqueue");
try { try {
q.tail.plus(0).setPtr(n); q.tail.plus(0).setPtr(n);
q.setPtr("tail", q.getPtr("tail").plus(1)); q.setPtr("tail", q.tail.plus(1));
if (q.getPtr("tail").comparePointer(q.getPtr("limit")) >= 0) if (q.tail.comparePointer(q.limit) >= 0)
q.setPtr("tail", q.getPtr("store")); q.setPtr("tail", q.store);
} finally { } finally {
LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue"); LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue");
} }
@ -792,13 +792,13 @@ public static ST_Agnode_s dequeue(ST_nodequeue q) {
ENTERING("b612nmtf16au96ztbs8pike9r","dequeue"); ENTERING("b612nmtf16au96ztbs8pike9r","dequeue");
try { try {
ST_Agnode_s n; ST_Agnode_s n;
if (EQ(q.getPtr("head"), q.getPtr("tail"))) if (EQ(q.head, q.tail))
n = null; n = null;
else { else {
n = (ST_Agnode_s) q.head.plus(0).getPtr(); n = (ST_Agnode_s) q.head.get(0);
q.setPtr("head", q.getPtr("head").plus(1)); q.setPtr("head", q.head.plus(1));
if (q.getPtr("head").comparePointer(q.getPtr("limit")) >= 0) if (q.head.comparePointer(q.limit) >= 0)
q.setPtr("head", q.getPtr("store")); q.setPtr("head", q.store);
} }
return n; return n;
} finally { } finally {
@ -1071,9 +1071,9 @@ try {
for (i = 1; i <= degree; i++) { for (i = 1; i <= degree; i++) {
for (j = 0; j <= degree - i; j++) { for (j = 0; j <= degree - i; j++) {
Vtemp[i].plus(j).setDouble("x", 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", 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) if (Left != null)
@ -1274,11 +1274,11 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) {
besti = bestj = -1; besti = bestj = -1;
bestdist2 = 1e+38; bestdist2 = 1e+38;
for (i = 0; i < spl.size; i++) { for (i = 0; i < spl.size; i++) {
bz.____(spl.list.plus(i).getPtr()); bz.____(spl.list.get(i));
for (j = 0; j < bz.size; j++) { for (j = 0; j < bz.size; j++) {
final ST_pointf b = new ST_pointf(); final ST_pointf b = new ST_pointf();
b.x = bz.list.get(j).getDouble("x"); b.x = bz.list.get(j).x;
b.y = bz.list.get(j).getDouble("y"); b.y = bz.list.get(j).y;
d2 = DIST2(b, pt); d2 = DIST2(b, pt);
if ((bestj == -1) || (d2 < bestdist2)) { if ((bestj == -1) || (d2 < bestdist2)) {
besti = i; besti = i;
@ -1287,7 +1287,7 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) {
} }
} }
} }
bz.____(spl.list.plus(besti).getPtr()); bz.____(spl.list.get(besti));
/* Pick best Bezier. If bestj is the last point in the B-spline, decrement. /* 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 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. * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc.
@ -1296,8 +1296,8 @@ private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) {
bestj--; bestj--;
j = 3*(bestj / 3); j = 3*(bestj / 3);
for (k = 0; k < 4; k++) { for (k = 0; k < 4; k++) {
c.plus(k).setDouble("x", bz.list.get(j + k).getDouble("x")); c.plus(k).setDouble("x", bz.list.get(j + k).x);
c.plus(k).setDouble("y", bz.list.get(j + k).getDouble("y")); c.plus(k).setDouble("y", bz.list.get(j + k).y);
} }
low = 0.0; low = 0.0;
high = 1.0; high = 1.0;
@ -1454,14 +1454,14 @@ try {
fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black"))); fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black")));
ND_label(n, make_label(n, str, 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))), ((aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)) | ( (shapeOf(n) == enumAsInt(shape_kind.class, "SH_RECORD")) ? (2 << 1) : (0 << 1))),
fi.getDouble("fontsize"), fi.fontname, fi.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')) { 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("4ua9vld76wpovsm1celv2ff6e"); // ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor); UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor);
UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4); UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4);
} }
ND_showboxes(n, late_int(n, Z.z().N_showboxes, 0, 0)); 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 { } finally {
LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node"); LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
} }
@ -1491,8 +1491,8 @@ LEAVING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) { public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) {
ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr"); ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
try { try {
if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi); if (N(fi.fontname)) initFontEdgeAttr(e, fi);
lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0)); 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("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.fontname));
lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor)); lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor));
} finally { } finally {
@ -1571,7 +1571,7 @@ try {
r = 1; r = 1;
initFontEdgeAttr(e, fi); initFontEdgeAttr(e, fi);
ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
fi.getDouble("fontsize"), fi.fontname, fi.fontcolor)); fi.fontsize, fi.fontname, fi.fontcolor));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 0)); GD_has_labels(sg, GD_has_labels(sg) | (1 << 0));
ED_label_ontop(e, ED_label_ontop(e,
mapbool(late_string(e, Z.z().E_label_float, new CString("false")))); mapbool(late_string(e, Z.z().E_label_float, new CString("false"))));
@ -1587,13 +1587,13 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) { if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
initFontLabelEdgeAttr(e, fi, lfi); initFontLabelEdgeAttr(e, fi, lfi);
ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
lfi.getDouble("fontsize"), lfi.fontname, lfi.fontcolor)); lfi.fontsize, lfi.fontname, lfi.fontcolor));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 1)); 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')) { if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
initFontLabelEdgeAttr(e, fi, lfi); initFontLabelEdgeAttr(e, fi, lfi);
ED_tail_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)), ED_tail_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
lfi.getDouble("fontsize"), lfi.fontname, lfi.fontcolor)); lfi.fontsize, lfi.fontname, lfi.fontcolor));
GD_has_labels(sg, GD_has_labels(sg) | (1 << 2)); GD_has_labels(sg, GD_has_labels(sg) | (1 << 2));
} }
/* end vladimir */ /* end vladimir */
@ -1607,7 +1607,7 @@ UNSUPPORTED("c078bypfszv0nsvp1nc0x28wx"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))
if (str!=null && str.charAt(0)!='\0') 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)); 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)) if (noClip(e, Z.z().E_tailclip))
UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0; UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0;
str = agget(e, new CString("headport")); str = agget(e, new CString("headport"));
@ -1616,7 +1616,7 @@ UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))-
if (str!=null && str.charAt(0)!='\0') 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)); 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)) if (noClip(e, Z.z().E_headclip))
UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0; UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0;
@ -1640,24 +1640,24 @@ ENTERING("3mkqvtbyq9j8ktzil6t7vakg5","addLabelBB");
try { try {
double width, height; double width, height;
final ST_pointf p = new ST_pointf(); final ST_pointf p = new ST_pointf();
p.___(lp.getStruct("pos")); p.___(lp.pos);
double min, max; double min, max;
if (flipxy) { if (flipxy) {
height = lp.dimen.getDouble("x"); height = lp.dimen.x;
width = lp.dimen.getDouble("y"); width = lp.dimen.y;
} }
else { else {
width = lp.dimen.getDouble("x"); width = lp.dimen.x;
height = lp.dimen.getDouble("y"); height = lp.dimen.y;
} }
min = p.getDouble("x") - width / 2.; min = p.x - width / 2.;
max = p.getDouble("x") + width / 2.; max = p.x + width / 2.;
if (min < bb.LL.x) if (min < bb.LL.x)
bb.LL.x = min; bb.LL.x = min;
if (max > bb.UR.x) if (max > bb.UR.x)
bb.UR.x = max; bb.UR.x = max;
min = p.getDouble("y") - height / 2.; min = p.y - height / 2.;
max = p.getDouble("y") + height / 2.; max = p.y + height / 2.;
if (min < bb.LL.y) if (min < bb.LL.y)
bb.LL.y = min; bb.LL.y = min;
if (max > bb.UR.y) if (max > bb.UR.y)

View File

@ -389,8 +389,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -379,8 +379,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -403,8 +403,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -427,8 +427,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -736,11 +736,11 @@ try {
ND_lw(v, GD_nodesep(agroot(v))); ND_lw(v, GD_nodesep(agroot(v)));
if (N(ED_label_ontop(orig))) { if (N(ED_label_ontop(orig))) {
if (GD_flip(agroot(g))!=0) { if (GD_flip(agroot(g))!=0) {
ND_ht(v, dimen.getDouble("x")); ND_ht(v, dimen.x);
ND_rw(v, dimen.getDouble("y")); ND_rw(v, dimen.y);
} else { } else {
ND_ht(v, dimen.getDouble("y")); ND_ht(v, dimen.y);
ND_rw(v, dimen.getDouble("x")); ND_rw(v, dimen.x);
} }
} }
return v; return v;
@ -954,7 +954,7 @@ try {
GD_n_nodes(g, 0); /* new */ GD_n_nodes(g, 0); /* new */
mark_clusters(g); mark_clusters(g);
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
build_skeleton(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); build_skeleton(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr());
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) { for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
if (ND_weight_class(aghead(e)) <= 2) if (ND_weight_class(aghead(e)) <= 2)

View File

@ -438,8 +438,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -760,27 +760,27 @@ ENTERING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
try { try {
int i; int i;
ST_Agnode_s v; ST_Agnode_s v;
__ptr__ vlist; ST_Agnode_s.ArrayOfStar vlist;
vlist = GD_rank(root).plus(r).getPtr().v.asPtr(); vlist = GD_rank(root).get(r).v;
if (d <= 0) { if (d <= 0) {
for (i = pos - d + 1; i < GD_rank(root).plus(r).getInt("n"); i++) { for (i = pos - d + 1; i < GD_rank(root).get(r).n; i++) {
v = (ST_Agnode_s) vlist.plus(i).getPtr(); v = (ST_Agnode_s) vlist.get(i);
ND_order(v, i + d - 1); ND_order(v, i + d - 1);
vlist.plus(ND_order(v)).setPtr(v); 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); vlist.plus(i).setPtr(null);
} else { } else {
/*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/ /*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--) { for (i = GD_rank(root).get(r).n - 1; i > pos; i--) {
v = (ST_Agnode_s) vlist.plus(i).getPtr(); v = (ST_Agnode_s) vlist.get(i);
ND_order(v, i + d - 1); ND_order(v, i + d - 1);
vlist.plus(ND_order(v)).setPtr(v); vlist.plus(ND_order(v)).setPtr(v);
} }
for (i = pos + 1; i < pos + d; i++) for (i = pos + 1; i < pos + d; i++)
vlist.plus(i).setPtr(null); 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 { } finally {
LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots"); LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
} }
@ -994,12 +994,12 @@ try {
if (GD_minrank(subg) > 0) if (GD_minrank(subg) > 0)
GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0); GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0);
for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) { for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
d = GD_rank(subg).plus(r).getPtr().getInt("n"); d = GD_rank(subg).get(r).n;
ipos = pos = ND_order(GD_rankleader(subg).plus(r).getPtr()); ipos = pos = ND_order(GD_rankleader(subg).get(r));
make_slots(root, r, pos, d); make_slots(root, r, pos, d);
for (i = 0; i < GD_rank(subg).plus(r).getPtr().getInt("n"); i++) { for (i = 0; i < GD_rank(subg).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(subg).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(subg).get(r).v.get(i);
GD_rank(root).plus(r).getPtr().v.plus(pos).setPtr(v); GD_rank(root).get(r).v.plus(pos).setPtr(v);
ND_order(v, pos++); ND_order(v, pos++);
/* real nodes automatically have v->root = root graph */ /* real nodes automatically have v->root = root graph */
if (ND_node_type(v) == 1) if (ND_node_type(v) == 1)
@ -1008,11 +1008,11 @@ try {
fast_node(root, v); fast_node(root, v);
GD_n_nodes(root, GD_n_nodes(root)+1); 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(subg).get(r).setPtr("v", GD_rank(root).get(r).v.plus(ipos));
GD_rank(root).plus(r).getPtr().setInt("valid", 0); GD_rank(root).get(r).setInt("valid", 0);
} }
if (r < GD_maxrank(root)) 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)); GD_expanded(subg, NOT(false));
} finally { } finally {
LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks"); LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
@ -1031,7 +1031,7 @@ try {
ST_Agnode_s v; ST_Agnode_s v;
ST_Agedge_s e; ST_Agedge_s e;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
v = (ST_Agnode_s) GD_rankleader(g).plus(r).getPtr(); v = (ST_Agnode_s) GD_rankleader(g).get(r);
/* remove the entire chain */ /* remove the entire chain */
while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null) while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null)
delete_fast_edge(e); delete_fast_edge(e);
@ -1088,7 +1088,7 @@ try {
ND_clust(n, null); ND_clust(n, null);
} }
for (c = 1; c <= GD_n_cluster(g); c++) { for (c = 1; c <= GD_n_cluster(g); c++) {
clust = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
for (n = agfstnode(clust); n!=null; n = nn) { for (n = agfstnode(clust); n!=null; n = nn) {
nn = agnxtnode(clust,n); nn = agnxtnode(clust,n);
if (ND_ranktype(n) != 0) { if (ND_ranktype(n) != 0) {
@ -1156,7 +1156,7 @@ try {
} }
} }
for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) { for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
rl = (ST_Agnode_s) GD_rankleader(subg).plus(r).getPtr(); rl = (ST_Agnode_s) GD_rankleader(subg).get(r);
if (ND_UF_size(rl) > 1) if (ND_UF_size(rl) > 1)
ND_UF_size(rl, ND_UF_size(rl)-1); ND_UF_size(rl, ND_UF_size(rl)-1);
} }
@ -1178,9 +1178,9 @@ try {
clust = ND_clust(n); clust = ND_clust(n);
if (GD_installed(clust) != pass + 1) { if (GD_installed(clust) != pass + 1) {
for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++) for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
install_in_rank(g, (ST_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++) for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
enqueue_neighbors(q, (ST_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); GD_installed(clust, pass + 1);
} }
} finally { } finally {
@ -1230,7 +1230,7 @@ try {
ST_Agedge_s orig, e; ST_Agedge_s orig, e;
int c; int c;
for (c = 1; c <= GD_n_cluster(g); c++) { for (c = 1; c <= GD_n_cluster(g); c++) {
clust = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
mark_lowcluster_basic(clust); mark_lowcluster_basic(clust);
} }
/* see what belongs to this graph that wasn't already marked */ /* see what belongs to this graph that wasn't already marked */

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -398,8 +398,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -102,11 +102,11 @@ import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.alloc_elist; import static smetana.core.Macro.alloc_elist;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agedgeinfo_t;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agnodeinfo_t;
import h.ST_Agraph_s; import h.ST_Agraph_s;
import h.ST_Agraphinfo_t; import h.ST_Agraphinfo_t;
import h.ST_Agedgeinfo_t;
import h.ST_Agnodeinfo_t;
import h.ST_aspect_t; import h.ST_aspect_t;
import h.ST_pack_info; import h.ST_pack_info;
import h.ST_pointf; import h.ST_pointf;
@ -440,8 +440,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -1080,8 +1080,8 @@ UNSUPPORTED("28kbszyxsjoj03gb134ov4hag"); // aspect.nextIter = 0;
attach_phase_attrs (g, 2); /* positions will be attached on output */ attach_phase_attrs (g, 2); /* positions will be attached on output */
return; return;
} }
aspect.setInt("nPasses", aspect.getInt("nPasses") -1); aspect.setInt("nPasses", aspect.nPasses -1);
} while (aspect.getInt("nextIter")!=0 && aspect.getInt("nPasses")!=0); } while (aspect.nextIter!=0 && aspect.nPasses!=0);
if ((GD_flags(g) & (1 << 4))!=0) if ((GD_flags(g) & (1 << 4))!=0)
removeFill (g); removeFill (g);
dot_sameports(g); dot_sameports(g);

View File

@ -486,8 +486,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -897,10 +897,10 @@ try {
} }
new_.setPtr("list", list); new_.setPtr("list", list);
new_.setInt("size", sz); new_.setInt("size", sz);
new_.setInt("sflag", old.getInt("eflag")); new_.setInt("sflag", old.getStruct().eflag);
new_.setInt("eflag", old.getInt("sflag")); new_.setInt("eflag", old.getStruct().sflag);
new_.setStruct("sp", old.getStruct("ep")); new_.setStruct("sp", old.getStruct().ep);
new_.setStruct("ep", old.getStruct("sp")); new_.setStruct("ep", old.getStruct().sp);
} finally { } finally {
LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier"); LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
} }
@ -918,7 +918,7 @@ try {
ST_bezier.Array2 lp; ST_bezier.Array2 lp;
ST_bezier.Array2 olp; ST_bezier.Array2 olp;
int i, sz; int i, sz;
sz = s.getInt("size"); sz = s.size;
list = new ST_bezier.Array2(sz); list = new ST_bezier.Array2(sz);
lp = list; lp = list;
olp = s.list.plus(sz - 1); olp = s.list.plus(sz - 1);
@ -929,7 +929,7 @@ try {
} }
/* free old structures */ /* free old structures */
for (i = 0; i < sz; i++) for (i = 0; i < sz; i++)
Memory.free(((ST_bezier)s.list.plus(i).getPtr()).getPtr().list); Memory.free(((ST_bezier)s.list.get(i)).getPtr().list);
Memory.free(s.list); Memory.free(s.list);
s.list = (ST_bezier.Array2) list; s.list = (ST_bezier.Array2) list;
} finally { } finally {
@ -949,7 +949,7 @@ try {
ST_Agnode_s n; ST_Agnode_s n;
for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) { for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) { 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)); swap_spline(ED_spl(e));
} }
} }
@ -1056,15 +1056,15 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
sd.setInt("LeftBound", 0); sd.setInt("LeftBound", 0);
n_edges = n_nodes = 0; n_edges = n_nodes = 0;
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
n_nodes += GD_rank(g).plus(i).getInt("n"); n_nodes += GD_rank(g).get(i).n;
if ((n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(0).getPtr())!=null) if ((n = (ST_Agnode_s) GD_rank(g).get(i).v.get(0))!=null)
sd.setInt("LeftBound", (int)MIN(sd.getInt("LeftBound"), (ND_coord(n).getDouble("x") - ND_lw(n)))); sd.setInt("LeftBound", (int)MIN(sd.LeftBound, (ND_coord(n).x - ND_lw(n))));
if (GD_rank(g).plus(i).getInt("n")!=0 && (n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(GD_rank(g).plus(i).getInt("n") - 1).getPtr())!=null) 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.getInt("RightBound"), (ND_coord(n).getDouble("x") + ND_rw(n)))); sd.setInt("RightBound", (int)MAX(sd.RightBound, (ND_coord(n).x + ND_rw(n))));
sd.setInt("LeftBound", sd.getInt("LeftBound") - 16); sd.setInt("LeftBound", sd.LeftBound - 16);
sd.setInt("RightBound", sd.getInt("RightBound") + 16); sd.setInt("RightBound", sd.RightBound + 16);
for (j = 0; j < GD_rank(g).plus(i).getInt("n"); j++) { for (j = 0; j < GD_rank(g).get(i).n; j++) {
n = (ST_Agnode_s) GD_rank(g).plus(i).getPtr().v.plus(j).getPtr(); 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 /* if n is the label of a flat edge, copy its position to
* the label. * the label.
*/ */
@ -1075,7 +1075,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
ED_label(fe).set= NOTI(false); ED_label(fe).set= NOTI(false);
} }
if ((ND_node_type(n) != 0) && if ((ND_node_type(n) != 0) &&
((Boolean)Z.z().sinfo.call("splineMerge", n) == false)) ((Boolean)Z.z().sinfo.splineMerge.exe(n) == false))
continue; continue;
for (k = 0; (e = (ST_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) if ((ED_edge_type(e) == 4)
@ -1150,7 +1150,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
ea = (ST_Agedge_s) fwdedgea.out; ea = (ST_Agedge_s) fwdedgea.out;
} }
for (cnt = 1; i < n_edges; cnt++, i++) { for (cnt = 1; i < n_edges; cnt++, i++) {
if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.plus(i).getPtr()))))) if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.get(i))))))
break; break;
if (ED_adjacent(e0)!=0) continue; /* all flat adjacent edges at once */ 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) { if (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) {
@ -1173,7 +1173,7 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
if ((ED_tree_index(e0) & 15) == 2 if ((ED_tree_index(e0) & 15) == 2
&& NEQ(ED_label(e0), ED_label(e1))) && NEQ(ED_label(e0), ED_label(e1)))
break; 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; break;
} }
if (EQ(agtail(e0), aghead(e0))) { if (EQ(agtail(e0), aghead(e0))) {
@ -1182,19 +1182,19 @@ UNSUPPORTED("46btiag50nczzur103eqhjcup"); // goto finish;
r = ND_rank(n); r = ND_rank(n);
if (r == GD_maxrank(g)) { if (r == GD_maxrank(g)) {
if (r > 0) if (r > 0)
sizey = (int) (ND_coord(GD_rank(g).plus(r-1).getPtr().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 else
sizey = (int) ND_ht(n); sizey = (int) ND_ht(n);
} }
else if (r == GD_minrank(g)) { else if (r == GD_minrank(g)) {
sizey = (int)(ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getPtr().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 { else {
int upy = (int) (ND_coord(GD_rank(g).plus(r-1).getPtr().v.plus(0).getPtr()).getDouble("y") - ND_coord(n).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).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getPtr().v.plus(0).getPtr()).getDouble("y")); int dwny = (int) (ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y);
sizey = MIN(upy, dwny); sizey = MIN(upy, dwny);
} }
makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z.z().sinfo); makeSelfEdge(P, edges, ind, cnt, sd.Multisep, sizey/2, Z.z().sinfo);
for (b = 0; b < cnt; b++) { for (b = 0; b < cnt; b++) {
e = (ST_Agedge_s) edges.plus(ind+b).getPtr(); e = (ST_Agedge_s) edges.plus(ind+b).getPtr();
if (ED_label(e)!=null) if (ED_label(e)!=null)
@ -1285,9 +1285,9 @@ try {
for (e = (ST_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)); e = ED_to_orig(e));
dimen.___(ED_label(e).dimen); dimen.___(ED_label(e).dimen);
width = GD_flip(agraphof(n))!=0 ? dimen.getDouble("y") : dimen.getDouble("x"); width = GD_flip(agraphof(n))!=0 ? dimen.y : dimen.x;
ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + width / 2.0); ED_label(e).pos.setDouble("x", ND_coord(n).x + width / 2.0);
ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y")); ED_label(e).pos.setDouble("y", ND_coord(n).y);
ED_label(e).set= NOTI(false); ED_label(e).set= NOTI(false);
} finally { } finally {
LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel"); LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
@ -1361,8 +1361,8 @@ try {
v1 = ABS((int)t1); v1 = ABS((int)t1);
if (v0 != v1) if (v0 != v1)
return (v0 - v1); return (v0 - v1);
t0 = ND_coord(agtail(le0)).getDouble("x") - ND_coord(aghead(le0)).getDouble("x"); t0 = ND_coord(agtail(le0)).x - ND_coord(aghead(le0)).x;
t1 = ND_coord(agtail(le1)).getDouble("x") - ND_coord(aghead(le1)).getDouble("x"); t1 = ND_coord(agtail(le1)).x - ND_coord(aghead(le1)).x;
v0 = ABS((int)t0); v0 = ABS((int)t0);
v1 = ABS((int)t1); v1 = ABS((int)t1);
if (v0 != v1) if (v0 != v1)
@ -1680,10 +1680,10 @@ try {
if (ED_label(e1)!=null) { if (ED_label(e1)!=null) {
sz0.___(ED_label(e0).dimen); sz0.___(ED_label(e0).dimen);
sz1.___(ED_label(e1).dimen); sz1.___(ED_label(e1).dimen);
if (sz0.getDouble("x") > sz1.getDouble("x")) return -1; if (sz0.x > sz1.x) return -1;
else if (sz0.getDouble("x") < sz1.getDouble("x")) return 1; else if (sz0.x < sz1.x) return 1;
else if (sz0.getDouble("y") > sz1.getDouble("y")) return -1; else if (sz0.y > sz1.y) return -1;
else if (sz0.getDouble("y") < sz1.getDouble("y")) return 1; else if (sz0.y < sz1.y) return 1;
else return 0; else return 0;
} }
else else
@ -1704,69 +1704,69 @@ LEAVING("bmsa24i3avg14po4sp17yh89k","edgelblcmpfn");
//3 3xmylrnypvoqrj2yrxnomsj5k //3 3xmylrnypvoqrj2yrxnomsj5k
// static void makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et, int n_lbls) // 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(ST_Agnode_s tn, ST_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"); ENTERING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels");
try { try {
ST_pointf.Array ps; ST_pointf.Array ps;
final ST_Ppoly_t poly = new ST_Ppoly_t(); final ST_Ppoly_t poly = new ST_Ppoly_t();
int pn[] = new int[1]; int pn[] = new int[1];
ST_Agedge_s e = (ST_Agedge_s) edges.plus(ind).getPtr(); ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
final ST_pointf.Array points = new ST_pointf.Array(10); final ST_pointf.Array points = new ST_pointf.Array(10);
final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(); final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
int i, pointn; int i, pointn;
double leftend, rightend, ctrx=0, ctry=0, miny, maxy; double leftend, rightend, ctrx=0, ctry=0, miny, maxy;
double uminx=0, umaxx=0; double uminx=0, umaxx=0;
double lminx=0, lmaxx=0; double lminx=0, lmaxx=0;
__ptr__ earray = new ST_Agedge_s.ArrayOfStar(cnt); ST_Agedge_s.ArrayOfStar earray = new ST_Agedge_s.ArrayOfStar(cnt);
for (i = 0; i < cnt; i++) { for (i = 0; i < cnt; i++) {
earray.plus(i).setPtr(edges.plus(ind + i).getPtr()); earray.plus(i).setPtr(edges.plus(ind + i).getPtr());
} }
qsort(earray, qsort(earray,
cnt, cnt,
function(dotsplines__c.class, "edgelblcmpfn")); function(dotsplines__c.class, "edgelblcmpfn"));
tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_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).getStruct("p"))); hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
leftend = tp.getDouble("x")+ND_rw(tn); leftend = tp.x+ND_rw(tn);
rightend = hp.getDouble("x")-ND_lw(hn); rightend = hp.x-ND_lw(hn);
ctrx = (leftend + rightend)/2.0; ctrx = (leftend + rightend)/2.0;
/* do first edge */ /* do first edge */
e = (ST_Agedge_s) earray.plus(0).getPtr(); e = (ST_Agedge_s) earray.get(0);
pointn = 0; pointn = 0;
points.plus(pointn++).setStruct(tp); points.plus(pointn++).setStruct(tp);
points.plus(pointn++).setStruct(tp); points.plus(pointn++).setStruct(tp);
points.plus(pointn++).setStruct(hp); points.plus(pointn++).setStruct(hp);
points.plus(pointn++).setStruct(hp); points.plus(pointn++).setStruct(hp);
clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo); clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo);
ED_label(e).getStruct("pos").setDouble("x", ctrx); ED_label(e).pos.setDouble("x", ctrx);
ED_label(e).getStruct("pos").setDouble("y", tp.getDouble("y") + (ED_label(e).dimen.getDouble("y")+6)/2.0); ED_label(e).pos.setDouble("y", tp.y + (ED_label(e).dimen.y+6)/2.0);
ED_label(e).set= NOTI(false); ED_label(e).set= NOTI(false);
miny = tp.getDouble("y") + 6/2.0; miny = tp.y + 6/2.0;
maxy = miny + ED_label(e).dimen.getDouble("y"); maxy = miny + ED_label(e).dimen.y;
uminx = ctrx - (ED_label(e).dimen.getDouble("x"))/2.0; uminx = ctrx - (ED_label(e).dimen.x)/2.0;
umaxx = ctrx + (ED_label(e).dimen.getDouble("x"))/2.0; umaxx = ctrx + (ED_label(e).dimen.x)/2.0;
for (i = 1; i < n_lbls; i++) { for (i = 1; i < n_lbls; i++) {
e = (ST_Agedge_s) earray.plus(i).getPtr(); e = (ST_Agedge_s) earray.get(i);
if (i%2!=0) { /* down */ if (i%2!=0) { /* down */
if (i == 1) { if (i == 1) {
lminx = ctrx - (ED_label(e).dimen.getDouble("x"))/2.0; lminx = ctrx - (ED_label(e).dimen.x)/2.0;
lmaxx = ctrx + (ED_label(e).dimen.getDouble("x"))/2.0; lmaxx = ctrx + (ED_label(e).dimen.x)/2.0;
} }
miny -= 6 + ED_label(e).dimen.getDouble("y"); miny -= 6 + ED_label(e).dimen.y;
points.plus(0).setStruct(tp); 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(1).setDouble("y", miny - 6);
points.plus(2).setDouble("x", hp.getDouble("x")); points.plus(2).setDouble("x", hp.x);
points.plus(2).setDouble("y", points.plus(1).getDouble("y")); points.plus(2).setDouble("y", points.get(1).y);
points.plus(3).setStruct(hp); points.plus(3).setStruct(hp);
points.plus(4).setDouble("x", lmaxx); 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("x", lmaxx);
points.plus(5).setDouble("y", miny); points.plus(5).setDouble("y", miny);
points.plus(6).setDouble("x", lminx); points.plus(6).setDouble("x", lminx);
points.plus(6).setDouble("y", miny); points.plus(6).setDouble("y", miny);
points.plus(7).setDouble("x", lminx); points.plus(7).setDouble("x", lminx);
points.plus(7).setDouble("y", tp.getDouble("y")); points.plus(7).setDouble("y", tp.y);
ctry = miny + (ED_label(e).dimen.getDouble("y"))/2.0; ctry = miny + (ED_label(e).dimen.y)/2.0;
} }
else { /* up */ else { /* up */
UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp; UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
@ -1791,14 +1791,14 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y +
poly.ps = points; poly.ps = points;
ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1)); ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
if (pn[0] == 0) return; if (pn[0] == 0) return;
ED_label(e).getStruct("pos").setDouble("x", ctrx); ED_label(e).pos.setDouble("x", ctrx);
ED_label(e).getStruct("pos").setDouble("y", ctry); ED_label(e).pos.setDouble("y", ctry);
ED_label(e).set= NOTI(false); ED_label(e).set= NOTI(false);
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo); clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
} }
/* edges with no labels */ /* edges with no labels */
for (; i < cnt; i++) { for (; i < cnt; i++) {
e = (ST_Agedge_s) earray.plus(i).getPtr(); e = (ST_Agedge_s) earray.get(i);
if (i%2!=0) { /* down */ if (i%2!=0) { /* down */
if (i == 1) { if (i == 1) {
lminx = (2*leftend + rightend)/3.0; lminx = (2*leftend + rightend)/3.0;
@ -1806,19 +1806,19 @@ UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y +
} }
miny -= 6; miny -= 6;
points.plus(0).setStruct(tp); 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(1).setDouble("y", miny - 6);
points.plus(2).setDouble("x", hp.getDouble("x")); points.plus(2).setDouble("x", hp.x);
points.plus(2).setDouble("y", points.plus(1).getDouble("y")); points.plus(2).setDouble("y", points.get(1).y);
points.plus(3).setStruct(hp); points.plus(3).setStruct(hp);
points.plus(4).setDouble("x", lmaxx); 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("x", lmaxx);
points.plus(5).setDouble("y", miny); points.plus(5).setDouble("y", miny);
points.plus(6).setDouble("x", lminx); points.plus(6).setDouble("x", lminx);
points.plus(6).setDouble("y", miny); points.plus(6).setDouble("y", miny);
points.plus(7).setDouble("x", lminx); points.plus(7).setDouble("x", lminx);
points.plus(7).setDouble("y", tp.getDouble("y")); points.plus(7).setDouble("y", tp.y);
} }
else { /* up */ else { /* up */
UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp; UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
@ -1855,25 +1855,25 @@ LEAVING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels");
//3 8kqyzk43ovc2sq6jegua6ytp //3 8kqyzk43ovc2sq6jegua6ytp
// static void makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et) // static void makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et)
public static void makeSimpleFlat(ST_Agnode_s tn, ST_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"); ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
try { try {
ST_Agedge_s e = (ST_Agedge_s) edges.plus(ind).getPtr(); ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
final ST_pointf.Array points = new ST_pointf.Array( 10); final ST_pointf.Array points = new ST_pointf.Array( 10);
final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(); final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
int i, pointn; int i, pointn;
double stepy, dy; double stepy, dy;
tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_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).getStruct("p"))); hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
stepy = (cnt > 1) ? ND_ht(tn) / (double)(cnt - 1) : 0.; 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++) { for (i = 0; i < cnt; i++) {
e = (ST_Agedge_s) edges.plus(ind + i).getPtr(); e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
pointn = 0; pointn = 0;
if ((et == (5 << 1)) || (et == (1 << 1))) { if ((et == (5 << 1)) || (et == (1 << 1))) {
points.plus(pointn++).setStruct(tp); 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 * tp.x + hp.x) / 3, dy));
points.plus(pointn++).setStruct(pointfof((2 * hp.getDouble("x") + tp.getDouble("x")) / 3, dy)); points.plus(pointn++).setStruct(pointfof((2 * hp.x + tp.x) / 3, dy));
points.plus(pointn++).setStruct(hp); points.plus(pointn++).setStruct(hp);
} }
else { /* ET_PLINE */ else { /* ET_PLINE */
@ -1901,7 +1901,7 @@ LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
//3 bhnjospwghq4plid12757c928 //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) // 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(ST_Agraph_s g, ST_path P, __ptr__ edges, int ind, int cnt, ST_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"); ENTERING("bhnjospwghq4plid12757c928","make_flat_adj_edges");
try { try {
ST_Agnode_s n; ST_Agnode_s n;
@ -2053,9 +2053,9 @@ try {
endp.setInt("sidemask", 1<<2); endp.setInt("sidemask", 1<<2);
if (isBegin) beginpath(P, e, 2, endp, false); if (isBegin) beginpath(P, e, 2, endp, false);
else endpath(P, e, 2, endp, false); else endpath(P, e, 2, endp, false);
b.UR.y = endp.boxes[endp.getInt("boxn") - 1].UR.y; b.UR.y = endp.boxes[endp.boxn - 1].UR.y;
b.LL.y = endp.boxes[endp.getInt("boxn") - 1].LL.y; b.LL.y = endp.boxes[endp.boxn - 1].LL.y;
b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).getDouble("y") + GD_rank(g).plus(ND_rank(n)).getDouble("ht2"))); 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) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("cmjm4y40vf7wklmgz0ae4k36v"); // endp->boxes[endp->boxn++] = b; UNSUPPORTED("cmjm4y40vf7wklmgz0ae4k36v"); // endp->boxes[endp->boxn++] = b;
} finally { } finally {
@ -2123,34 +2123,34 @@ UNSUPPORTED("68ojpcos92c96bc0i5ag1yb6v"); // ps = points;
UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7; UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7;
} }
else { else {
lb.LL.x = ND_coord(ln).getDouble("x") - ND_lw(ln); lb.LL.x = ND_coord(ln).x - ND_lw(ln);
lb.UR.x = ND_coord(ln).getDouble("x") + ND_rw(ln); lb.UR.x = ND_coord(ln).x + ND_rw(ln);
lb.UR.y = ND_coord(ln).getDouble("y") + ND_ht(ln)/2; lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2;
ydelta = (int)(ND_coord(ln).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1") - ydelta = (int)(ND_coord(ln).y - GD_rank(g).get(ND_rank(tn)).ht1 -
ND_coord(tn).getDouble("y") + GD_rank(g).plus(ND_rank(tn)).getDouble("ht2")); ND_coord(tn).y + GD_rank(g).get(ND_rank(tn)).ht2);
ydelta = (int)(ydelta / 6.); ydelta = (int)(ydelta / 6.);
lb.LL.y = lb.UR.y - MAX(5.,ydelta); lb.LL.y = lb.UR.y - MAX(5.,ydelta);
boxn = 0; boxn = 0;
makeFlatEnd (g, sp, P, tn, e, tend, NOT(false)); makeFlatEnd (g, sp, P, tn, e, tend, NOT(false));
makeFlatEnd (g, sp, P, hn, e, hend, false); makeFlatEnd (g, sp, P, hn, e, hend, false);
((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.getInt("boxn") - 1].LL.x; ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x;
((Z.z().boxes[boxn])).LL.y = (tend).boxes[tend.getInt("boxn") - 1].UR.y; ((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.x = lb.LL.x;
((Z.z().boxes[boxn])).UR.y = lb.LL.y; ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
boxn++; boxn++;
((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.getInt("boxn") - 1].LL.x; ((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])).LL.y = lb.LL.y;
((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.getInt("boxn") - 1].UR.x; ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
((Z.z().boxes[boxn])).UR.y = lb.UR.y; ((Z.z().boxes[boxn])).UR.y = lb.UR.y;
boxn++; boxn++;
((Z.z().boxes[boxn])).LL.x = lb.UR.x; ((Z.z().boxes[boxn])).LL.x = lb.UR.x;
((Z.z().boxes[boxn])).UR.y = lb.LL.y; ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.getInt("boxn") - 1].UR.y; ((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.boxn - 1].UR.y;
((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.getInt("boxn") - 1].UR.x; ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
boxn++; boxn++;
for (i = 0; i < tend.getInt("boxn"); i++) add_box(P, (tend).boxes[i]); 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 = 0; i < boxn; i++) add_box(P, Z.z().boxes[i]);
for (i = hend.getInt("boxn") - 1; i >= 0; i--) add_box(P, (hend).boxes[i]); for (i = hend.boxn - 1; i >= 0; i--) add_box(P, (hend).boxes[i]);
if (et == (5 << 1)) ps = routesplines(P, pn); if (et == (5 << 1)) ps = routesplines(P, pn);
else ps = routepolylines(P, pn); else ps = routepolylines(P, pn);
if (pn[0] == 0) return; if (pn[0] == 0) return;
@ -2235,7 +2235,7 @@ throw new UnsupportedOperationException();
//3 6yr3jfkljl5w0z6dv354ryx63 //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) // 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(ST_Agraph_s g, ST_spline_info_t sp, ST_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"); ENTERING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
try { try {
ST_Agnode_s tn, hn; ST_Agnode_s tn, hn;
@ -2250,7 +2250,7 @@ try {
final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t(); final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
fwdedge.out.base.setPtr("data", fwdedgei); fwdedge.out.base.setPtr("data", fwdedgei);
/* Get sample edge; normalize to go from left to right */ /* Get sample edge; normalize to go from left to right */
e = (ST_Agedge_s) edges.plus(ind).getPtr(); e = (ST_Agedge_s) edges.get(ind);
isAdjacent = ED_adjacent(e); isAdjacent = ED_adjacent(e);
if ((ED_tree_index(e) & 32)!=0) { if ((ED_tree_index(e) & 32)!=0) {
MAKEFWDEDGE(fwdedge.out, e); MAKEFWDEDGE(fwdedge.out, e);
@ -2277,8 +2277,8 @@ try {
makeSimpleFlat (agtail(e), aghead(e), edges, ind, cnt, et); makeSimpleFlat (agtail(e), aghead(e), edges, ind, cnt, et);
return; return;
} }
tside = ED_tail_port(e).getInt("side"); tside = ED_tail_port(e).side;
hside = ED_head_port(e).getInt("side"); hside = ED_head_port(e).side;
if (((tside == (1<<0)) && (hside != (1<<2))) || if (((tside == (1<<0)) && (hside != (1<<2))) ||
((hside == (1<<0)) && (tside != (1<<2)))) { ((hside == (1<<0)) && (tside != (1<<2)))) {
make_flat_bottom_edges (g, sp, P, edges, ind, cnt, e, et == (5 << 1)); make_flat_bottom_edges (g, sp, P, edges, ind, cnt, e, et == (5 << 1));
@ -2293,13 +2293,13 @@ try {
prevr = GD_rank(g).plus(r-2); prevr = GD_rank(g).plus(r-2);
else else
prevr = GD_rank(g).plus(r-1); prevr = GD_rank(g).plus(r-1);
vspace = ND_coord(prevr.getPtr().v.plus(0).getPtr()).getDouble("y") - prevr.getPtr().getDouble("ht1") vspace = ND_coord(prevr.getPtr().v.get(0)).y - prevr.getPtr().ht1
- ND_coord(tn).getDouble("y") - GD_rank(g).plus(r).getDouble("ht2"); - ND_coord(tn).y - GD_rank(g).get(r).ht2;
} }
else { else {
vspace = GD_ranksep(g); vspace = GD_ranksep(g);
} }
stepx = ((double)sp.getInt("Multisep")) / (cnt+1); stepx = ((double)sp.Multisep) / (cnt+1);
stepy = vspace / (cnt+1); stepy = vspace / (cnt+1);
makeFlatEnd (g, sp, P, tn, e, tend, true); makeFlatEnd (g, sp, P, tn, e, tend, true);
makeFlatEnd (g, sp, P, hn, e, hend, false); makeFlatEnd (g, sp, P, hn, e, hend, false);
@ -2308,32 +2308,32 @@ try {
final ST_boxf b = new ST_boxf(); final ST_boxf b = new ST_boxf();
e = (ST_Agedge_s) edges.plus(ind + i).getPtr(); e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
boxn = 0; boxn = 0;
b.___((tend).boxes[tend.getInt("boxn") - 1]); b.___((tend).boxes[tend.boxn - 1]);
((Z.z().boxes[boxn])).LL.x = b.LL.x; ((Z.z().boxes[boxn])).LL.x = b.LL.x;
((Z.z().boxes[boxn])).LL.y = b.UR.y; ((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.x = b.UR.x + (i + 1) * stepx;
((Z.z().boxes[boxn])).UR.y = b.UR.y + (i + 1) * stepy; ((Z.z().boxes[boxn])).UR.y = b.UR.y + (i + 1) * stepy;
boxn++; boxn++;
((Z.z().boxes[boxn])).LL.x = ((ST_boxf)((tend).boxes[tend.getInt("boxn") - 1])).LL.x; ((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])).LL.y = (Z.z().boxes[boxn-1]).UR.y;
((Z.z().boxes[boxn])).UR.x = ((ST_boxf)((hend).boxes[hend.getInt("boxn") - 1])).UR.x; ((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; ((Z.z().boxes[boxn])).UR.y = ((Z.z().boxes[boxn])).LL.y + stepy;
boxn++; boxn++;
b.___((hend).boxes[hend.getInt("boxn") - 1]); b.___((hend).boxes[hend.boxn - 1]);
((Z.z().boxes[boxn])).UR.x = b.UR.x; ((Z.z().boxes[boxn])).UR.x = b.UR.x;
((Z.z().boxes[boxn])).LL.y = b.UR.y; ((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])).LL.x = b.LL.x - (i + 1) * stepx;
((Z.z().boxes[boxn])).UR.y = (Z.z().boxes[boxn-1]).LL.y; ((Z.z().boxes[boxn])).UR.y = (Z.z().boxes[boxn-1]).LL.y;
boxn++; boxn++;
for (j = 0; j < tend.getInt("boxn"); j++) add_box(P, (tend).boxes[j]); 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 = 0; j < boxn; j++) add_box(P, Z.z().boxes[j]);
for (j = hend.getInt("boxn") - 1; j >= 0; j--) add_box(P, (hend).boxes[j]); for (j = hend.boxn - 1; j >= 0; j--) add_box(P, (hend).boxes[j]);
if (et == (5 << 1)) ps = routesplines(P, pn); if (et == (5 << 1)) ps = routesplines(P, pn);
else ps = routepolylines(P, pn); else ps = routepolylines(P, pn);
if (pn[0] == 0) if (pn[0] == 0)
return; return;
clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo); clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
P.setInt("nbox", 0); P.nbox = 0;
} }
} finally { } finally {
LEAVING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge"); LEAVING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
@ -2440,7 +2440,7 @@ LEAVING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge");
//private static int numpts2; //private static int numpts2;
//3 30wfq1dby4t07hft9io52nq6z //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) // 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, __ptr__ 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"); ENTERING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
try { try {
ST_Agnode_s tn, hn = null; ST_Agnode_s tn, hn = null;
@ -2464,7 +2464,7 @@ try {
Z.z().numpts2 = 2000; Z.z().numpts2 = 2000;
} }
sl = 0; sl = 0;
e = (ST_Agedge_s) edges.plus(ind).getPtr(); e = (ST_Agedge_s) edges.get(ind);
hackflag = 0; hackflag = 0;
if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) { if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) {
UNSUPPORTED("8f17srpa5iisomehrb4b01h51"); // fwdedgeai = *(Agedgeinfo_t*)e->base.data; UNSUPPORTED("8f17srpa5iisomehrb4b01h51"); // fwdedgeai = *(Agedgeinfo_t*)e->base.data;
@ -2492,8 +2492,8 @@ UNSUPPORTED("eih8eaai768x1un5mixrtgstp"); // e = &fwdedgea.out;
UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0); UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
} else { } else {
if ((ED_tree_index(e) & 32)!=0) { if ((ED_tree_index(e) & 32)!=0) {
MAKEFWDEDGE(fwdedgea.getPtr("out"), e); MAKEFWDEDGE(fwdedgea.out, e);
e = (ST_Agedge_s) fwdedgea.getPtr("out"); e = fwdedgea.out;
} }
} }
fe = e; fe = e;
@ -2508,22 +2508,22 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
tn = agtail(e); tn = agtail(e);
hn = aghead(e); hn = aghead(e);
b.___(maximal_bbox(g, sp, tn, null, e)); b.___(maximal_bbox(g, sp, tn, null, e));
tend.getStruct("nb").___(b); tend.nb.___(b);
beginpath(P, e, 1, tend, spline_merge(tn)); beginpath(P, e, 1, tend, spline_merge(tn));
b.UR.y = b.UR.y =
(tend).boxes[tend.getInt("boxn") - 1].UR.y; (tend).boxes[tend.boxn - 1].UR.y;
b.LL.y = b.LL.y =
(tend).boxes[tend.getInt("boxn") - 1].LL.y; (tend).boxes[tend.boxn - 1].LL.y;
b.___(makeregularend(b, (1<<0), 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) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{ {
tend.boxes[tend.getInt("boxn")].___(b); tend.boxes[tend.boxn].___(b);
tend.setInt("boxn", tend.getInt("boxn") + 1); tend.setInt("boxn", tend.boxn + 1);
} }
longedge = 0; longedge = 0;
smode = false; si = -1; 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; longedge = 1;
Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn))); Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
if (N(smode) if (N(smode)
@ -2542,12 +2542,12 @@ UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
} }
hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0))); 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))); endpath(P, e, 1, hend, spline_merge(aghead(e)));
b.___(makeregularend((hend).boxes[hend.getInt("boxn") - 1], (1<<2), b.___(makeregularend((hend).boxes[hend.boxn - 1], (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) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b; UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b;
P.getStruct("end").setDouble("theta", M_PI / 2); P.end.setDouble("theta", M_PI / 2);
P.getStruct("end").constrained= NOTI(false); P.end.constrained= NOTI(false);
completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, 1); completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, 1);
if (splines) ps = routesplines(P, pn); if (splines) ps = routesplines(P, pn);
else { else {
@ -2578,8 +2578,8 @@ UNSUPPORTED("8kbxhk7qirj3tr7hn1ukwar3h"); // pointfs = RALLOC(numpts, pointfs,
boxn = 0; boxn = 0;
tend.setStruct("nb", maximal_bbox(g, sp, tn, (ST_Agedge_s) ND_in(tn).getFromList(0), e)); 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)); beginpath(P, e, 1, tend, spline_merge(tn));
b.___(makeregularend((tend).boxes[tend.getInt("boxn") - 1], (1<<0), b.___(makeregularend((tend).boxes[tend.boxn - 1], (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) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = b; UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = b;
P.start.setDouble("theta", -M_PI / 2); P.start.setDouble("theta", -M_PI / 2);
@ -2588,16 +2588,16 @@ UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] =
} }
Z.z().boxes[boxn++].___(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)); b.___(maximal_bbox(g, sp, hn, e, null));
hend.getStruct("nb").___(b); hend.nb.___(b);
endpath(P, (ST_Agedge_s) (hackflag!=0 ? fwdedgeb.out : e), 1, hend, spline_merge(aghead(e))); endpath(P, (ST_Agedge_s) (hackflag!=0 ? fwdedgeb.out : e), 1, hend, spline_merge(aghead(e)));
b.UR.y = (hend).boxes[hend.getInt("boxn") - 1].UR.y; b.UR.y = (hend).boxes[hend.boxn - 1].UR.y;
b.LL.y = (hend).boxes[hend.getInt("boxn") - 1].LL.y; b.LL.y = (hend).boxes[hend.boxn - 1].LL.y;
b.___(makeregularend(b, (1<<2), 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) if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
{ {
hend.boxes[hend.getInt("boxn")].___(b); hend.boxes[hend.boxn].___(b);
hend.setInt("boxn", hend.getInt("boxn")+1); hend.setInt("boxn", hend.boxn+1);
} }
completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn,
longedge); longedge);
@ -2630,9 +2630,9 @@ UNSUPPORTED("bedaqcn9h03q6ia6zbezuee1m"); // pointfs = RALLOC(numpts, point
clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo); clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo);
return; return;
} }
dx = sp.getInt("Multisep") * (cnt - 1) / 2; dx = sp.Multisep * (cnt - 1) / 2;
for (i = 1; i < pointn[0] - 1; i++) 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) { if (Z.z().numpts > Z.z().numpts2) {
UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts; UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts;
UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf); UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf);
@ -2647,7 +2647,7 @@ UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs
e = (ST_Agedge_s) fwdedge.out; e = (ST_Agedge_s) fwdedge.out;
} }
for (i = 1; i < pointn[0] - 1; i++) 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++) for (i = 0; i < pointn[0]; i++)
Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct()); 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); clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo);
@ -2676,34 +2676,34 @@ try {
uright = top_bound(first, 1); uright = top_bound(first, 1);
if (uleft!=null) { if (uleft!=null) {
if (N(spl = getsplinepoints(uleft))) return; if (N(spl = getsplinepoints(uleft))) return;
pp = ((ST_bezier)spl.list.plus(0).getPtr().getPtr()).list; pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
pn = spl.list.plus(0).getPtr().getInt("size"); pn = spl.list.get(0).size;
} }
if (uright!=null) { if (uright!=null) {
if (N(spl = getsplinepoints(uright))) return; if (N(spl = getsplinepoints(uright))) return;
pp = ((ST_bezier)spl.list.plus(0).getPtr().getPtr()).list; pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
pn = spl.list.plus(0).getPtr().getInt("size"); pn = spl.list.get(0).size;
} }
lleft = lright = null; lleft = lright = null;
lleft = bot_bound(last, -1); lleft = bot_bound(last, -1);
lright = bot_bound(last, 1); lright = bot_bound(last, 1);
if (lleft!=null) { if (lleft!=null) {
if (N(spl = getsplinepoints(lleft))) return; if (N(spl = getsplinepoints(lleft))) return;
pp = ((ST_bezier)spl.list.plus(spl.getInt("size") - 1).getPtr().getPtr()).list; pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
pn = spl.list.plus(spl.getInt("size") - 1).getPtr().getInt("size"); pn = spl.list.plus(spl.size - 1).getPtr().size;
} }
if (lright!=null) { if (lright!=null) {
if (N(spl = getsplinepoints(lright))) return; if (N(spl = getsplinepoints(lright))) return;
pp = ((ST_bezier)spl.list.plus(spl.getInt("size") - 1).getPtr().getPtr()).list; pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
pn = spl.list.plus(spl.getInt("size") - 1).getPtr().getInt("size"); pn = spl.list.plus(spl.size - 1).getPtr().size;
} }
for (i = 0; i < tendp.getInt("boxn"); i++) for (i = 0; i < tendp.boxn; i++)
add_box(P, (tendp).boxes[i]); add_box(P, (tendp).boxes[i]);
fb = P.getInt("nbox") + 1; fb = P.nbox + 1;
lb = fb + boxn - 3; lb = fb + boxn - 3;
for (i = 0; i < boxn; i++) for (i = 0; i < boxn; i++)
add_box(P, boxes[i]); add_box(P, boxes[i]);
for (i = hendp.getInt("boxn") - 1; i >= 0; i--) for (i = hendp.boxn - 1; i >= 0; i--)
add_box(P, (hendp).boxes[i]); add_box(P, (hendp).boxes[i]);
adjustregularpath(P, fb, lb); adjustregularpath(P, fb, lb);
} finally { } finally {
@ -2764,7 +2764,7 @@ try {
} }
} }
} }
for (i = 0; i < P.getInt("nbox") - 1; i++) { for (i = 0; i < P.nbox - 1; i++) {
bp1 = (ST_boxf) P.boxes[i]; bp1 = (ST_boxf) P.boxes[i];
bp2 = (ST_boxf) P.boxes[i+1]; bp2 = (ST_boxf) P.boxes[i+1];
if (i >= fb && i <= lb && (i - fb) % 2 == 0) { if (i >= fb && i <= lb && (i - fb) % 2 == 0) {
@ -2800,14 +2800,14 @@ try {
ST_Agnode_s /* *right0, *right1, */ left0, left1; ST_Agnode_s /* *right0, *right1, */ left0, left1;
b.___(sp.Rank_box[r]); b.___(sp.Rank_box[r]);
if (b.LL.x == b.UR.x) { if (b.LL.x == b.UR.x) {
left0 = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().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]; */ /* right0 = GD_rank(g)[r].v[GD_rank(g)[r].n - 1]; */
left1 = (ST_Agnode_s) GD_rank(g).plus(r + 1).getPtr().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]; */ /* right1 = GD_rank(g)[r + 1].v[GD_rank(g)[r + 1].n - 1]; */
b.LL.x = sp.getInt("LeftBound"); b.LL.x = sp.LeftBound;
b.LL.y = ND_coord(left1).getDouble("y") + GD_rank(g).plus(r + 1).getDouble("ht2"); b.LL.y = ND_coord(left1).y + GD_rank(g).get(r + 1).ht2;
b.UR.x = sp.getInt("RightBound"); b.UR.x = sp.RightBound;
b.UR.y = ND_coord(left0).getDouble("y") - GD_rank(g).plus(r).getDouble("ht1"); b.UR.y = ND_coord(left0).y - GD_rank(g).get(r).ht1;
sp.Rank_box[r].setStruct(b); sp.Rank_box[r].setStruct(b);
} }
return b; return b;
@ -2833,7 +2833,7 @@ try {
break; break;
if ((ND_out(v).size != 1) || (ND_in(v).size != 1)) if ((ND_out(v).size != 1) || (ND_in(v).size != 1))
break; break;
if (ND_coord(v).getDouble("x") != ND_coord(n).getDouble("x")) if (ND_coord(v).x != ND_coord(n).x)
break; break;
cnt++; cnt++;
} }
@ -2876,13 +2876,13 @@ try {
ST_Agnode_s vn; ST_Agnode_s vn;
b = 0; /* skip first rank box */ b = 0; /* skip first rank box */
for (vn = aghead(e); 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))) { vn = aghead(ND_out(vn).getFromList(0))) {
while ((b < p.getInt("nbox")) && (p.boxes[b].LL.y > ND_coord(vn).getDouble("y"))) while ((b < p.nbox) && (p.boxes[b].LL.y > ND_coord(vn).y))
b++; b++;
if (b >= p.getInt("nbox")) if (b >= p.nbox)
break; break;
if (p.boxes[b].UR.y < ND_coord(vn).getDouble("y")) if (p.boxes[b].UR.y < ND_coord(vn).y)
continue; continue;
if (ND_label(vn)!=null) if (ND_label(vn)!=null)
resize_vn(vn, (int)p.boxes[b].LL.x, (int)p.boxes[b].UR.x, resize_vn(vn, (int)p.boxes[b].LL.x, (int)p.boxes[b].UR.x,
@ -2973,8 +2973,8 @@ LEAVING("9fsg0uiyhtrayd4mimmc0i25e","bot_bound");
public static boolean cl_vninside(ST_Agraph_s cl, ST_Agnode_s n) { public static boolean cl_vninside(ST_Agraph_s cl, ST_Agnode_s n) {
ENTERING("65uvkv1mextaah5m997ibe3qs","cl_vninside"); ENTERING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
try { try {
return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).getDouble("x")), GD_bb(cl).UR.x) && 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).getDouble("y")), GD_bb(cl).UR.y)); BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).y), GD_bb(cl).UR.y));
} finally { } finally {
LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside"); LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
} }
@ -3037,48 +3037,48 @@ try {
final ST_boxf rv = new ST_boxf(); final ST_boxf rv = new ST_boxf();
left_cl = right_cl = null; left_cl = right_cl = null;
/* give this node all the available space up to its neighbors */ /* 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 = neighbor(g, vn, ie, oe, -1))!=null) {
if ((left_cl = cl_bound(g, vn, left))!=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 { 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) if (ND_node_type(left) == 0)
nb += GD_nodesep(g) / 2.; nb += GD_nodesep(g) / 2.;
else else
nb += (double)(sp.getInt("Splinesep")); nb += (double)(sp.Splinesep);
} }
if (nb < b) if (nb < b)
b = nb; b = nb;
rv.LL.x = ROUND(b); rv.LL.x = ROUND(b);
} else } 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! */ /* we have to leave room for our own label! */
if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) 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 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 = neighbor(g, vn, ie, oe, 1))!=null) {
if ((right_cl = cl_bound(g, vn, right))!=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 { else {
nb = ND_coord(right).getDouble("x") - ND_lw(right); nb = ND_coord(right).x - ND_lw(right);
if (ND_node_type(right) == 0) if (ND_node_type(right) == 0)
nb -= GD_nodesep(g) / 2.; nb -= GD_nodesep(g) / 2.;
else else
nb -= (double)(sp.getInt("Splinesep")); nb -= (double)(sp.Splinesep);
} }
if (nb > b) if (nb > b)
b = nb; b = nb;
rv.UR.x = ROUND(b); rv.UR.x = ROUND(b);
} else } 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)) { if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) {
rv.UR.x = rv.UR.x - ND_rw(vn); 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.LL.y = ND_coord(vn).y - GD_rank(g).get(ND_rank(vn)).ht1;
rv.UR.y = ND_coord(vn).getDouble("y") + GD_rank(g).plus(ND_rank(vn)).getDouble("ht2"); rv.UR.y = ND_coord(vn).y + GD_rank(g).get(ND_rank(vn)).ht2;
return rv; return rv;
} finally { } finally {
LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox"); LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
@ -3096,8 +3096,8 @@ try {
int i; int i;
ST_Agnode_s n, rv = null; ST_Agnode_s n, rv = null;
ST_rank_t.Array2 rank = GD_rank(g).plus(ND_rank(vn)); ST_rank_t.Array2 rank = GD_rank(g).plus(ND_rank(vn));
for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getInt("n"))); i += dir) { for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getPtr().n)); i += dir) {
n = (ST_Agnode_s) rank.getPtr().v.plus(i).getPtr(); n = (ST_Agnode_s) rank.getPtr().v.get(i);
if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) { if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) {
rv = n; rv = n;
break; break;

View File

@ -47,10 +47,8 @@ package gen.lib.dotgen;
import static gen.lib.cgraph.edge__c.aghead; import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agtail; import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.obj__c.agroot; 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 gen.lib.dotgen.dotinit__c.dot_root;
import static smetana.core.JUtils.EQ; import static smetana.core.JUtils.EQ;
import static smetana.core.JUtils.sizeof;
import static smetana.core.JUtilsDebug.ENTERING; import static smetana.core.JUtilsDebug.ENTERING;
import static smetana.core.JUtilsDebug.LEAVING; import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.AGINEDGE; import static smetana.core.Macro.AGINEDGE;
@ -89,16 +87,14 @@ import static smetana.core.Macro.agtail;
import static smetana.core.Macro.alloc_elist; import static smetana.core.Macro.alloc_elist;
import static smetana.core.Macro.elist_append; import static smetana.core.Macro.elist_append;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import h.ST_Agedgeinfo_t; import h.ST_Agedgeinfo_t;
import h.ST_Agedgepair_s; import h.ST_Agedgepair_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agnodeinfo_t; import h.ST_Agnodeinfo_t;
import h.ST_Agraph_s;
import h.ST_Agrec_s; import h.ST_Agrec_s;
import h.ST_elist; import h.ST_elist;
import h.ST_pointf; import h.ST_pointf;
import h.ST_elist;
public class fastgr__c { public class fastgr__c {
//1 2digov3edok6d5srhgtlmrycs //1 2digov3edok6d5srhgtlmrycs
@ -425,8 +421,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -419,8 +419,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -723,19 +723,19 @@ try {
int i; int i;
ST_Agnode_s.ArrayOfStar v; ST_Agnode_s.ArrayOfStar v;
ST_Agnode_s n; ST_Agnode_s n;
v = ALLOC_Agnode_s(GD_rank(g).plus(r).getInt("n") + 2, (ST_Agnode_s.ArrayOfStar) GD_rank(g).plus(r).getPtr("v")); 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); 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()); 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); n = virtual_node(g);
v.plus(pos).setPtr(n); v.plus(pos).setPtr(n);
ND_order(n, pos); ND_order(n, pos);
ND_rank(n, r); ND_rank(n, r);
GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("n")+1); GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).n+1);
v.plus(GD_rank(g).plus(r).getInt("n")).setPtr(null); v.plus(GD_rank(g).get(r).n).setPtr(null);
return (ST_Agnode_s) v.plus(pos).getPtr(); return (ST_Agnode_s) v.get(pos);
} finally { } finally {
LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot"); LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
} }
@ -830,18 +830,18 @@ try {
int lnode, rnode, r, pos; int lnode, rnode, r, pos;
int[] lpos = new int[1], rpos = new int[1]; int[] lpos = new int[1], rpos = new int[1];
int bounds[] = new int[4]; int bounds[] = new int[4];
__ptr__ rank; ST_Agnode_s.ArrayOfStar rank;
r = ND_rank(agtail(e)) - 1; r = ND_rank(agtail(e)) - 1;
rank = GD_rank(g).plus(r).getPtr("v"); rank = GD_rank(g).get(r).v;
lnode = 0; 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[0] = bounds[2] = lnode - 1;
bounds[1] = bounds[3] = rnode + 1; bounds[1] = bounds[3] = rnode + 1;
findlr(agtail(e), aghead(e), lpos, rpos); findlr(agtail(e), aghead(e), lpos, rpos);
while (lnode <= rnode) { while (lnode <= rnode) {
setbounds((ST_Agnode_s)rank.plus(lnode).getPtr(), bounds, lpos, rpos); setbounds((ST_Agnode_s)rank.get(lnode), bounds, lpos, rpos);
if (lnode != rnode) if (lnode != rnode)
setbounds((ST_Agnode_s)rank.plus(rnode).getPtr(), bounds, lpos, rpos); setbounds((ST_Agnode_s)rank.get(rnode), bounds, lpos, rpos);
lnode++; lnode++;
rnode--; rnode--;
if (bounds[1] - bounds[0] <= 1) if (bounds[1] - bounds[0] <= 1)
@ -876,37 +876,37 @@ try {
r = ND_rank(agtail(e)); r = ND_rank(agtail(e));
place = flat_limits(g, e); place = flat_limits(g, e);
/* grab ypos = LL.y of label box before make_vn_slot() */ /* grab ypos = LL.y of label box before make_vn_slot() */
if ((n = (ST_Agnode_s) GD_rank(g).plus(r - 1).getPtr().v.plus(0).getPtr())!=null) if ((n = (ST_Agnode_s) GD_rank(g).get(r - 1).v.get(0))!=null)
ypos = (int)(ND_coord(n).getDouble("y") - GD_rank(g).plus(r - 1).getDouble("ht1")); ypos = (int)(ND_coord(n).y - GD_rank(g).get(r - 1).ht1);
else { else {
n = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); n = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
ypos = (int)(ND_coord(n).getDouble("y") + GD_rank(g).plus(r).getDouble("ht2") + GD_ranksep(g)); ypos = (int)(ND_coord(n).y + GD_rank(g).get(r).ht2 + GD_ranksep(g));
} }
vn = make_vn_slot(g, r - 1, place); vn = make_vn_slot(g, r - 1, place);
dimen.___(ED_label(e).dimen); dimen.___(ED_label(e).dimen);
if (GD_flip(g)!=0) { if (GD_flip(g)!=0) {
double f = dimen.getDouble("x"); double f = dimen.x;
dimen.setDouble("x", dimen.getDouble("y")); dimen.setDouble("x", dimen.y);
dimen.setDouble("y", f); dimen.setDouble("y", f);
} }
ND_ht(vn, dimen.getDouble("y")); ND_ht(vn, dimen.y);
h2 = (int)(ND_ht(vn) / 2); 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_lw(vn, ND_rw(vn));
ND_label(vn, ED_label(e)); ND_label(vn, ED_label(e));
ND_coord(vn).setDouble("y", ypos + h2); ND_coord(vn).setDouble("y", ypos + h2);
ve = virtual_edge(vn, agtail(e), e); /* was NULL? */ ve = virtual_edge(vn, agtail(e), e); /* was NULL? */
ED_tail_port(ve).getStruct("p").setDouble("x", -ND_lw(vn)); ED_tail_port(ve).p.setDouble("x", -ND_lw(vn));
ED_head_port(ve).getStruct("p").setDouble("x", ND_rw(agtail(e))); ED_head_port(ve).p.setDouble("x", ND_rw(agtail(e)));
ED_edge_type(ve, 4); ED_edge_type(ve, 4);
ve = virtual_edge(vn, aghead(e), e); ve = virtual_edge(vn, aghead(e), e);
ED_tail_port(ve).getStruct("p").setDouble("x", ND_rw(vn)); ED_tail_port(ve).p.setDouble("x", ND_rw(vn));
ED_head_port(ve).getStruct("p").setDouble("x", ND_lw(aghead(e))); ED_head_port(ve).p.setDouble("x", ND_lw(aghead(e)));
ED_edge_type(ve, 4); ED_edge_type(ve, 4);
/* another assumed symmetry of ht1/ht2 of a label node */ /* 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); 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); GD_rank(g).plus(r - 1).setDouble("ht2", h2);
ND_alg(vn, e); ND_alg(vn, e);
} finally { } finally {
@ -930,11 +930,11 @@ try {
rptr = ALLOC_ST_rank_t(r, (ST_rank_t.Array2) GD_rank(g)); rptr = ALLOC_ST_rank_t(r, (ST_rank_t.Array2) GD_rank(g));
GD_rank(g, rptr.plus(1)); GD_rank(g, rptr.plus(1));
for (r = GD_maxrank(g); r >= 0; r--) 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("n", 0);
GD_rank(g).plus(r).setInt("an", 0); GD_rank(g).plus(r).setInt("an", 0);
GD_rank(g).plus(r).setPtr("v", new ST_Agnode_s.ArrayOfStar(2)); GD_rank(g).plus(r).setPtr("v", new ST_Agnode_s.ArrayOfStar(2));
GD_rank(g).plus(r).setPtr("av", GD_rank(g).plus(r).getPtr("v")); 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).setPtr("flat", null);
GD_rank(g).plus(r).setDouble("ht1", 1); GD_rank(g).plus(r).setDouble("ht1", 1);
GD_rank(g).plus(r).setDouble("ht2", 1); GD_rank(g).plus(r).setDouble("ht2", 1);
@ -969,7 +969,7 @@ try {
} }
rank = GD_rank(dot_root(tn)).plus(ND_rank(tn)); rank = GD_rank(dot_root(tn)).plus(ND_rank(tn));
for (i = lo + 1; i < hi; i++) { for (i = lo + 1; i < hi; i++) {
n = (ST_Agnode_s) rank.getPtr().v.plus(i).getPtr(); n = (ST_Agnode_s) rank.getPtr().v.get(i);
if ((ND_node_type(n) == 1 && ND_label(n)!=null) || if ((ND_node_type(n) == 1 && ND_label(n)!=null) ||
ND_node_type(n) == 0) ND_node_type(n) == 0)
break; break;
@ -1009,8 +1009,8 @@ try {
checkFlatAdjacent (e); checkFlatAdjacent (e);
} }
} }
if ((GD_rank(g).plus(0).getPtr("flat")!=null) || (GD_n_cluster(g) > 0)) { if ((GD_rank(g).get(0).flat!=null) || (GD_n_cluster(g) > 0)) {
for (i = 0; (n = (ST_Agnode_s) GD_rank(g).plus(0).getPtr().v.plus(i).getPtr())!=null; i++) { 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++) { for (j = 0; (e = (ST_Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) {
if ((ED_label(e)!=null) && N(ED_adjacent(e))) { if ((ED_label(e)!=null) && N(ED_adjacent(e))) {
abomination(g); abomination(g);
@ -1029,8 +1029,8 @@ try {
for (i = 0; (e = (ST_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_label(e)!=null) {
if (ED_adjacent(e)!=0) { if (ED_adjacent(e)!=0) {
if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.getDouble("y")); if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.y);
else ED_dist(e, ED_label(e).dimen.getDouble("x")); else ED_dist(e, ED_label(e).dimen.x);
} }
else { else {
reset = 1; reset = 1;
@ -1050,8 +1050,8 @@ try {
if (ED_label(e)!=null) { if (ED_label(e)!=null) {
if (ED_adjacent(e)!=0) { if (ED_adjacent(e)!=0) {
double lw; double lw;
if (GD_flip(g)!=0) lw = ED_label(e).dimen.getDouble("y"); if (GD_flip(g)!=0) lw = ED_label(e).dimen.y;
else lw = ED_label(e).dimen.getDouble("x"); else lw = ED_label(e).dimen.x;
ED_dist(le, MAX(lw,ED_dist(le))); ED_dist(le, MAX(lw,ED_dist(le)));
} }
else { else {

View File

@ -132,7 +132,6 @@ import h.ST_elist;
import h.ST_nodequeue; import h.ST_nodequeue;
import h.ST_pointf; import h.ST_pointf;
import h.ST_rank_t; import h.ST_rank_t;
import h.rank_t;
import java.util.List; import java.util.List;
@ -465,8 +464,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -848,7 +847,7 @@ try {
merge2(g); merge2(g);
/* run mincross on contents of each cluster */ /* run mincross on contents of each cluster */
for (c = 1; c <= GD_n_cluster(g); c++) { for (c = 1; c <= GD_n_cluster(g); c++) {
nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), doBalance); nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
} }
if ((GD_n_cluster(g) > 0) if ((GD_n_cluster(g) > 0)
&& (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) { && (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) {
@ -910,7 +909,7 @@ try {
GD_nlist(g, GD_comp(g).getFromList(c)); GD_nlist(g, GD_comp(g).getFromList(c));
if (c > 0) { if (c > 0) {
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { 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); GD_rank(g).plus(r).setInt("n", 0);
} }
} }
@ -1080,7 +1079,7 @@ try {
flat_reorder(g); flat_reorder(g);
nc = mincross_(g, 2, 2, doBalance); nc = mincross_(g, 2, 2, doBalance);
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), doBalance); nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
save_vlist(g); save_vlist(g);
return nc; return nc;
} finally { } finally {
@ -1112,10 +1111,10 @@ try {
/*return ((ND_ranktype(v) != CLUSTER) && (ND_ranktype(w) != CLUSTER)); */ /*return ((ND_ranktype(v) != CLUSTER) && (ND_ranktype(w) != CLUSTER)); */
} }
} else { } else {
UNSUPPORTED("8lltx4lxwrqossx8qw1khzwf9"); // if ((ND_clust(v)) != (ND_clust(w))) if (NEQ(ND_clust(v), ND_clust(w)))
UNSUPPORTED("9qhn9m3123s8n6wwxjfo8awlm"); // return NOT(0); return NOT(0);
} }
M = (ST_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) if (M == null)
rv = false; rv = false;
else { else {
@ -1201,9 +1200,9 @@ try {
vi = ND_order(v); vi = ND_order(v);
wi = ND_order(w); wi = ND_order(w);
ND_order(v, wi); ND_order(v, wi);
GD_rank(Z.z().Root).plus(r).getPtr().v.plus(wi).setPtr(v); GD_rank(Z.z().Root).get(r).v.plus(wi).setPtr(v);
ND_order(w, vi); ND_order(w, vi);
GD_rank(Z.z().Root).plus(r).getPtr().v.plus(vi).setPtr(w); GD_rank(Z.z().Root).get(r).v.plus(vi).setPtr(w);
} finally { } finally {
LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange"); LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
} }
@ -1345,10 +1344,10 @@ try {
int i, c0, c1, rv; int i, c0, c1, rv;
ST_Agnode_s v, w; ST_Agnode_s v, w;
rv = 0; rv = 0;
GD_rank(g).plus(r).getPtr().candidate= false; GD_rank(g).get(r).candidate= false;
for (i = 0; i < GD_rank(g).plus(r).getInt("n") - 1; i++) { for (i = 0; i < GD_rank(g).get(r).n - 1; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
w = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i + 1).getPtr(); w = (ST_Agnode_s) GD_rank(g).get(r).v.plus(i + 1).getPtr();
//assert(ND_order(v) < ND_order(w)); //assert(ND_order(v) < ND_order(w));
if (left2right(g, v, w)) if (left2right(g, v, w))
continue; continue;
@ -1357,22 +1356,22 @@ try {
c0 += in_cross(v, w); c0 += in_cross(v, w);
c1 += in_cross(w, v); 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); c0 += out_cross(v, w);
c1 += out_cross(w, v); c1 += out_cross(w, v);
} }
if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) { if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) {
exchange(v, w); exchange(v, w);
rv += (c0 - c1); rv += (c0 - c1);
GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; GD_rank(Z.z().Root).get(r).valid= 0;
GD_rank(g).plus(r).getPtr().candidate= NOT(false); GD_rank(g).get(r).candidate= NOT(false);
if (r > GD_minrank(g)) { if (r > GD_minrank(g)) {
GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0; GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
GD_rank(g).plus(r - 1).getPtr().candidate= NOT(false); GD_rank(g).get(r - 1).candidate= NOT(false);
} }
if (r < GD_maxrank(g)) { if (r < GD_maxrank(g)) {
GD_rank(Z.z().Root).plus(r + 1).getPtr().valid= 0; GD_rank(Z.z().Root).plus(r + 1).getPtr().valid= 0;
GD_rank(g).plus(r + 1).getPtr().candidate= NOT(false); GD_rank(g).get(r + 1).candidate= NOT(false);
} }
} }
} }
@ -1392,11 +1391,11 @@ ENTERING("2i22bxgg5y7v5c5d40k5zppky","transpose");
try { try {
int r, delta; int r, delta;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) for (r = GD_minrank(g); r <= GD_maxrank(g); r++)
GD_rank(g).plus(r).getPtr().candidate= NOT(false); GD_rank(g).get(r).candidate= NOT(false);
do { do {
delta = 0; delta = 0;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
if (GD_rank(g).plus(r).getPtr().candidate) { if (GD_rank(g).get(r).candidate) {
delta += transpose_step(g, r, reverse); delta += transpose_step(g, r, reverse);
} }
} }
@ -1489,11 +1488,11 @@ try {
ST_Agnode_s n; ST_Agnode_s n;
int r; int r;
for (n = GD_nlist(g); n!=null; n = ND_next(n)) 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++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; GD_rank(Z.z().Root).get(r).valid= 0;
qsort(GD_rank(g).plus(r).getPtr("v"), qsort(GD_rank(g).get(r).v,
GD_rank(g).plus(r).getInt("n"), GD_rank(g).get(r).n,
function(mincross__c.class, "nodeposcmpf")); function(mincross__c.class, "nodeposcmpf"));
} }
} finally { } finally {
@ -1563,10 +1562,10 @@ try {
merge_components(g); merge_components(g);
/* install complete ranks */ /* install complete ranks */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { 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).setInt("n", GD_rank(g).get(r).an);
GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("av")); GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).av);
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (v == null) { if (v == null) {
/*if (Verbose) /*if (Verbose)
fprintf(stderr, fprintf(stderr,
@ -1604,23 +1603,23 @@ try {
} }
/* fix vlists of clusters */ /* fix vlists of clusters */
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
rec_reset_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
/* remove node temporary edges for ordering nodes */ /* remove node temporary edges for ordering nodes */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_order(v, i); ND_order(v, i);
if (ND_flat_out(v).listNotNull()) { if (ND_flat_out(v).listNotNull()) {
for (j = 0; (e = (ST_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) { if (ED_edge_type(e) == 4) {
delete_flat_edge(e); delete_flat_edge(e);
Memory.free(e.getPtr("base.data")); Memory.free(e.base.data);
Memory.free(e); Memory.free(e);
j--; j--;
} }
} }
} }
free_matrix((ST_adjmatrix_t) GD_rank(g).plus(r).getPtr("flat")); free_matrix((ST_adjmatrix_t) GD_rank(g).get(r).flat);
} }
/*if (Verbose) /*if (Verbose)
fprintf(stderr, "mincross %s: %d crossings, %.2f secs.\n", fprintf(stderr, "mincross %s: %d crossings, %.2f secs.\n",
@ -1736,7 +1735,7 @@ try {
int r; int r;
if (GD_rankleader(g)!=null) if (GD_rankleader(g)!=null)
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
GD_rankleader(g).plus(r).setPtr(GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()); GD_rankleader(g).plus(r).setPtr(GD_rank(g).get(r).v.get(0));
} }
} finally { } finally {
LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist"); LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
@ -1754,7 +1753,7 @@ try {
int c; int c;
save_vlist(g); save_vlist(g);
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
rec_save_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); rec_save_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally { } finally {
LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists"); LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
} }
@ -1772,14 +1771,14 @@ try {
ST_Agnode_s u, v, w; ST_Agnode_s u, v, w;
/* fix vlists of sub-clusters */ /* fix vlists of sub-clusters */
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
rec_reset_vlists((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
if (GD_rankleader(g)!=null) if (GD_rankleader(g)!=null)
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
v = (ST_Agnode_s) GD_rankleader(g).plus(r).getPtr(); v = (ST_Agnode_s) GD_rankleader(g).get(r);
u = furthestnode(g, v, -1); u = furthestnode(g, v, -1);
w = furthestnode(g, v, 1); w = furthestnode(g, v, 1);
GD_rankleader(g).plus(r).setPtr(u); 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); GD_rank(g).plus(r).setInt("n", ND_order(w) - ND_order(u) + 1);
} }
} finally { } finally {
@ -1939,7 +1938,7 @@ try {
int i; int i;
boolean hascl; boolean hascl;
ST_Agedge_s e; ST_Agedge_s e;
ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr("flat"); ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).get(ND_rank(v)).flat;
ND_mark(v, NOT(false)); ND_mark(v, NOT(false));
ND_onstack(v, NOT(false)); ND_onstack(v, NOT(false));
hascl = (GD_n_cluster(dot_root(g)) > 0); hascl = (GD_n_cluster(dot_root(g)) > 0);
@ -1951,8 +1950,8 @@ try {
if (ED_weight(e) == 0) if (ED_weight(e) == 0)
continue; continue;
if (ND_onstack(aghead(e)) == NOT(false)) { if (ND_onstack(aghead(e)) == NOT(false)) {
assert(ND_low(aghead(e)) < M.getInt("nrows")); assert(ND_low(aghead(e)) < M.nrows);
assert(ND_low(agtail(e)) < M.getInt("ncols")); assert(ND_low(agtail(e)) < M.ncols);
M.data[ND_low(aghead(e))][ND_low(agtail(e))]=1; M.data[ND_low(aghead(e))][ND_low(agtail(e))]=1;
delete_flat_edge(e); delete_flat_edge(e);
i--; i--;
@ -1960,8 +1959,8 @@ try {
continue; continue;
flat_rev(g, e); flat_rev(g, e);
} else { } else {
assert(ND_low(aghead(e)) < M.getInt("nrows")); assert(ND_low(aghead(e)) < M.nrows);
assert(ND_low(agtail(e)) < M.getInt("ncols")); assert(ND_low(agtail(e)) < M.ncols);
M.data[ND_low(agtail(e))][ND_low(aghead(e))]=1; M.data[ND_low(agtail(e))][ND_low(aghead(e))]=1;
if (ND_mark(aghead(e)) == 0) if (ND_mark(aghead(e)) == 0)
flat_search(g, aghead(e)); flat_search(g, aghead(e));
@ -1985,20 +1984,20 @@ try {
ST_Agnode_s v; ST_Agnode_s v;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
flat = 0; flat = 0;
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_mark(v, 0); ND_mark(v, 0);
ND_onstack(v, 0); ND_onstack(v, 0);
ND_low(v, i); ND_low(v, i);
if ((ND_flat_out(v).size > 0) && (flat == 0)) { if ((ND_flat_out(v).size > 0) && (flat == 0)) {
GD_rank(g).plus(r).setPtr("flat", 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; flat = 1;
} }
} }
if (flat!=0) { if (flat!=0) {
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (ND_mark(v) == 0) if (ND_mark(v) == 0)
flat_search(g, v); flat_search(g, v);
} }
@ -2062,17 +2061,17 @@ ENTERING("3lxoqxhiri9fgt20zc5jz3aa5","install_in_rank");
try { try {
int i, r; int i, r;
r = ND_rank(n); r = ND_rank(n);
i = GD_rank(g).plus(r).getInt("n"); i = GD_rank(g).get(r).n;
if (GD_rank(g).plus(r).getInt("an") <= 0) { 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("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); UNSUPPORTED("53h8d82ax23hys2k21hjswp72"); // 1034, agnameof(g), agnameof(n), r, i);
return; return;
} }
GD_rank(g).plus(r).getPtr().v.plus(i).setPtr(n); GD_rank(g).get(r).v.plus(i).setPtr(n);
ND_order(n, i); 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); // 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("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); UNSUPPORTED("9puojrmsk6vb1qc0jtr8ge4g8"); // 1052, agnameof(n), ND_order(n), r, GD_rank(Root)[r].an);
return; return;
@ -2082,8 +2081,8 @@ UNSUPPORTED("7o1thnqda767wqpe2lh9mj03t"); // agerr(AGERR, "install_in_rank, lin
UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_maxrank(g)); UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_maxrank(g));
return; return;
} }
if (GD_rank(g).plus(r).getPtr("v").plus(ND_order(n)).comparePointer( if (GD_rank(g).get(r).v.plus(ND_order(n)).comparePointer(
GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z.z().Root).plus(r).getInt("an")))>0) { 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("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); 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; return;
@ -2131,13 +2130,13 @@ try {
UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n"); UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n");
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
GD_rank(Z.z().Root).plus(i).setInt("valid", 0); 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; int nn, ndiv2;
__ptr__ vlist = GD_rank(g).plus(i).getPtr("v"); ST_Agnode_s.ArrayOfStar vlist = GD_rank(g).get(i).v;
nn = GD_rank(g).plus(i).getInt("n") - 1; nn = GD_rank(g).get(i).n - 1;
ndiv2 = nn / 2; ndiv2 = nn / 2;
for (j = 0; j <= ndiv2; j++) for (j = 0; j <= ndiv2; j++)
exchange((ST_Agnode_s)vlist.plus(j).getPtr(), (ST_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) if (EQ(g, dot_root(g)) && ncross(g) > 0)
@ -2239,16 +2238,16 @@ try {
if (GD_has_flat_edges(g) == 0) if (GD_has_flat_edges(g) == 0)
return; return;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
if (GD_rank(g).plus(r).getInt("n") == 0) continue; if (GD_rank(g).get(r).n == 0) continue;
base_order = ND_order(GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()); base_order = ND_order(GD_rank(g).get(r).v.get(0));
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) for (i = 0; i < GD_rank(g).get(r).n; i++)
ND_mark(GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(), 0); ND_mark(GD_rank(g).get(r).v.get(i), 0);
temprank = ALLOC_Agnode_s(i + 1, temprank); temprank = ALLOC_Agnode_s(i + 1, temprank);
pos = 0; pos = 0;
/* construct reverse topological sort order in temprank */ /* construct reverse topological sort order in temprank */
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
if (GD_flip(g)!=0) v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); 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).plus(r).getPtr().v.plus(GD_rank(g).plus(r).getInt("n") - i - 1).getPtr(); 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; local_in_cnt = local_out_cnt = 0;
for (j = 0; j < ND_flat_in(v).size; j++) { for (j = 0; j < ND_flat_in(v).size; j++) {
flat_e = (ST_Agedge_s) ND_flat_in(v).getFromList(j); flat_e = (ST_Agedge_s) ND_flat_in(v).getFromList(j);
@ -2280,14 +2279,14 @@ try {
right = right.plus(-1); right = right.plus(-1);
} }
} }
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) temprank.plus(i).getPtr(); v = (ST_Agnode_s) temprank.get(i);
GD_rank(g).plus(r).getPtr().v.plus(i).setPtr(v); GD_rank(g).get(r).v.plus(i).setPtr(v);
ND_order(v, i + base_order); ND_order(v, i + base_order);
} }
/* nonconstraint flat edges must be made LR */ /* nonconstraint flat edges must be made LR */
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
if (ND_flat_out(v).listNotNull()) { if (ND_flat_out(v).listNotNull()) {
for (j = 0; (e = (ST_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)))) || if ( ((GD_flip(g) == 0) && (ND_order(aghead(e)) < ND_order(agtail(e)))) ||
@ -2323,9 +2322,9 @@ try {
boolean changed = false; boolean changed = false;
int nelt; int nelt;
boolean muststay, sawclust; boolean muststay, sawclust;
__ptr__ vlist = GD_rank(g).plus(r).getPtr("v"); __ptr__ vlist = GD_rank(g).get(r).v;
__ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).plus(r).getInt("n")); __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).get(r).n);
for (nelt = GD_rank(g).plus(r).getInt("n") - 1; nelt >= 0; nelt--) { for (nelt = GD_rank(g).get(r).n - 1; nelt >= 0; nelt--) {
lp = vlist; lp = vlist;
while (lp.comparePointer(ep)<0) { while (lp.comparePointer(ep)<0) {
/* find leftmost node that can be compared */ /* find leftmost node that can be compared */
@ -2363,7 +2362,7 @@ try {
ep = ep.plus(-1); ep = ep.plus(-1);
} }
if (changed) { if (changed) {
GD_rank(Z.z().Root).plus(r).getPtr().valid= 0; GD_rank(Z.z().Root).get(r).valid= 0;
if (r > 0) if (r > 0)
GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0; GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
} }
@ -2473,38 +2472,38 @@ ENTERING("bk5nklhfqgg0uwkv7tv6dn8r2","rcross");
try { try {
int top, bot, cross, max, i, k; int top, bot, cross, max, i, k;
ST_Agnode_s v; ST_Agnode_s v;
__ptr__ rtop; ST_Agnode_s.ArrayOfStar rtop;
cross = 0; cross = 0;
max = 0; max = 0;
rtop = GD_rank(g).plus(r).getPtr("v"); rtop = GD_rank(g).get(r).v;
if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getInt("n")) { 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).getInt("n") + 1; 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); 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); Z.z().Count.plus(i).setInt(0);
for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) { for (top = 0; top < GD_rank(g).get(r).n; top++) {
ST_Agedge_s e; ST_Agedge_s e;
if (max > 0) { if (max > 0) {
for (i = 0; (e = (ST_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++) for (k = ND_order(aghead(e)) + 1; k <= max; k++)
cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e); cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e);
} }
} }
for (i = 0; (e = (ST_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)); int inv = ND_order(aghead(e));
if (inv > max) if (inv > max)
max = inv; max = inv;
Z.z().Count.plus(inv).setInt(Z.z().Count.plus(inv).getInt() + ED_xpenalty(e)); 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++) { for (top = 0; top < GD_rank(g).get(r).n; top++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(top).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(top);
if (ND_has_port(v)) if (ND_has_port(v))
cross += local_cross(ND_out(v), 1); cross += local_cross(ND_out(v), 1);
} }
for (bot = 0; bot < GD_rank(g).plus(r + 1).getInt("n"); bot++) { for (bot = 0; bot < GD_rank(g).get(r + 1).n; bot++) {
v = (ST_Agnode_s) GD_rank(g).plus(r + 1).getPtr().v.plus(bot).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(bot);
if (ND_has_port(v)) if (ND_has_port(v))
cross += local_cross(ND_in(v), -1); cross += local_cross(ND_in(v), -1);
} }
@ -2526,11 +2525,11 @@ try {
g = Z.z().Root; g = Z.z().Root;
count = 0; count = 0;
for (r = GD_minrank(g); r < GD_maxrank(g); r++) { for (r = GD_minrank(g); r < GD_maxrank(g); r++) {
if (GD_rank(g).plus(r).getPtr().valid!=0) if (GD_rank(g).get(r).valid!=0)
count += GD_rank(g).plus(r).getInt("cache_nc"); count += GD_rank(g).get(r).cache_nc;
else { else {
nc = rcross(g, r); nc = rcross(g, r);
GD_rank(g).plus(r).getInt("cache_nc"); GD_rank(g).get(r).cache_nc = nc;
count += nc; count += nc;
GD_rank(g).plus(r).setInt("valid", 1); GD_rank(g).plus(r).setInt("valid", 1);
} }
@ -2605,22 +2604,22 @@ try {
int i, j, j0, lm, rm, lspan, rspan; int i, j, j0, lm, rm, lspan, rspan;
__ptr__ list; __ptr__ list;
ST_Agnode_s n; ST_Agnode_s n;
__ptr__ v; ST_Agnode_s.ArrayOfStar v;
ST_Agedge_s e; ST_Agedge_s e;
boolean hasfixed = false; boolean hasfixed = false;
list = Z.z().TI_list; list = Z.z().TI_list;
v = GD_rank(g).plus(r0).getPtr("v"); v = GD_rank(g).get(r0).v;
for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r0).n; i++) {
n = (ST_Agnode_s) v.plus(i).getPtr(); n = (ST_Agnode_s) v.get(i);
j = 0; j = 0;
if (r1 > r0) if (r1 > r0)
for (j0 = 0; (e = (ST_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) 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 } else
for (j0 = 0; (e = (ST_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) 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) { switch (j) {
case 0: case 0:
@ -2653,8 +2652,8 @@ try {
} }
} }
} }
for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r0).n; i++) {
n = (ST_Agnode_s) v.plus(i).getPtr(); n = (ST_Agnode_s) v.get(i);
if ((ND_out(n).size == 0) && (ND_in(n).size == 0)) if ((ND_out(n).size == 0) && (ND_in(n).size == 0))
hasfixed |= flat_mval(n); hasfixed |= flat_mval(n);
} }

View File

@ -144,7 +144,6 @@ import h.ratio_t;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory; import smetana.core.Memory;
import smetana.core.Z; import smetana.core.Z;
import smetana.core.__ptr__;
public class position__c { public class position__c {
//1 2digov3edok6d5srhgtlmrycs //1 2digov3edok6d5srhgtlmrycs
@ -471,8 +470,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -803,8 +802,8 @@ try {
rp = GD_rank(g).plus(r); rp = GD_rank(g).plus(r);
found =0; found =0;
tp = null; tp = null;
for (i = 0; i < rp.getPtr().getInt("n"); i++) { for (i = 0; i < rp.getPtr().n; i++) {
tp = (ST_Agnode_s) rp.getPtr().v.plus(i).getPtr(); tp = (ST_Agnode_s) rp.getPtr().v.get(i);
if (ND_save_out(tp).listNotNull()) { if (ND_save_out(tp).listNotNull()) {
for (j = 0; (e = (ST_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)) { if ((ND_rank(aghead(e)) > r) || (ND_rank(agtail(e)) > r)) {
@ -825,9 +824,9 @@ try {
} }
} }
if (found!=0 || N(tp)) continue; if (found!=0 || N(tp)) continue;
tp = (ST_Agnode_s) rp.getPtr().v.plus(0).getPtr(); tp = (ST_Agnode_s) rp.getPtr().v.get(0);
if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.plus(1).getPtr().v.plus(0).getPtr(); 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.plus(0).getPtr(); else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.get(0);
//assert (hp); //assert (hp);
sn = virtual_node(g); sn = virtual_node(g);
ND_node_type(sn, 2); ND_node_type(sn, 2);
@ -1006,11 +1005,11 @@ try {
/* make edges to constrain left-to-right ordering */ /* make edges to constrain left-to-right ordering */
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
double last; double last;
ND_rank(rank.plus(i).getPtr().v.plus(0).getPtr(), 0); ND_rank(rank.get(i).v.get(0), 0);
last = 0; last = 0;
nodesep = sep[i & 1]; nodesep = sep[i & 1];
for (j = 0; j < rank.plus(i).getInt("n"); j++) { for (j = 0; j < rank.get(i).n; j++) {
u = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j).getPtr(); u = (ST_Agnode_s) rank.get(i).v.get(j);
ND_mval(u, ND_rw(u)); /* keep it somewhere safe */ ND_mval(u, ND_rw(u)); /* keep it somewhere safe */
if (ND_other(u).size > 0) { /* compute self size */ if (ND_other(u).size > 0) { /* compute self size */
/* FIX: dot assumes all self-edges go to the right. This /* FIX: dot assumes all self-edges go to the right. This
@ -1029,7 +1028,7 @@ try {
} }
ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */ ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */
} }
v = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j + 1).getPtr(); v = (ST_Agnode_s) rank.get(i).v.plus(j + 1).getPtr();
if (v!=null) { if (v!=null) {
width = ND_rw(u) + ND_lw(v) + nodesep; width = ND_rw(u) + ND_lw(v) + nodesep;
e0 = make_aux_edge(u, v, width, 0); e0 = make_aux_edge(u, v, width, 0);
@ -1150,7 +1149,7 @@ try {
make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */ make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */
} }
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
contain_clustnodes((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); contain_clustnodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally { } finally {
LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes"); LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
} }
@ -1190,22 +1189,22 @@ try {
ST_Agnode_s u, v; ST_Agnode_s u, v;
margin = late_int (g, Z.z().G_margin, 8, 0); margin = late_int (g, Z.z().G_margin, 8, 0);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { 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; continue;
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
if (v == null) if (v == null)
continue; continue;
for (i = ND_order(v) - 1; i >= 0; i--) { for (i = ND_order(v) - 1; i >= 0; i--) {
u = (ST_Agnode_s) GD_rank(dot_root(g)).plus(r).getPtr().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 */ /* can't use "is_a_vnode_of" because elists are swapped */
if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) { if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0); make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0);
break; 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++) { i++) {
u = (ST_Agnode_s) GD_rank(dot_root(g)).plus(r).getPtr().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)) { if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0); make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0);
break; break;
@ -1213,7 +1212,7 @@ try {
} }
} }
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
keepout_othernodes((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); keepout_othernodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally { } finally {
LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes"); LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
} }
@ -1232,12 +1231,12 @@ try {
margin = late_int (g, Z.z().G_margin, 8, 0); margin = late_int (g, Z.z().G_margin, 8, 0);
make_lrvn(g); make_lrvn(g);
for (c = 1; c <= GD_n_cluster(g); c++) { for (c = 1; c <= GD_n_cluster(g); c++) {
subg = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
make_lrvn(subg); make_lrvn(subg);
make_aux_edge(GD_ln(g), GD_ln(subg), make_aux_edge(GD_ln(g), GD_ln(subg),
margin + GD_border(g)[3].getDouble("x"), 0); margin + GD_border(g)[3].x, 0);
make_aux_edge(GD_rn(subg), GD_rn(g), make_aux_edge(GD_rn(subg), GD_rn(g),
margin + GD_border(g)[1].getDouble("x"), 0); margin + GD_border(g)[1].x, 0);
contain_subclust(subg); contain_subclust(subg);
} }
} finally { } finally {
@ -1258,11 +1257,11 @@ try {
ST_Agraph_s left, right; ST_Agraph_s left, right;
margin = late_int (g, Z.z().G_margin, 8, 0); margin = late_int (g, Z.z().G_margin, 8, 0);
for (i = 1; i <= GD_n_cluster(g); i++) for (i = 1; i <= GD_n_cluster(g); i++)
make_lrvn((ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr()); make_lrvn((ST_Agraph_s) GD_clust(g).get(i).getPtr());
for (i = 1; i <= GD_n_cluster(g); i++) { for (i = 1; i <= GD_n_cluster(g); i++) {
for (j = i + 1; j <= GD_n_cluster(g); j++) { for (j = i + 1; j <= GD_n_cluster(g); j++) {
low = (ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr(); low = (ST_Agraph_s) GD_clust(g).get(i).getPtr();
high = (ST_Agraph_s) GD_clust(g).plus(j).getPtr().getPtr(); high = (ST_Agraph_s) GD_clust(g).get(j).getPtr();
if (GD_minrank(low) > GD_minrank(high)) { if (GD_minrank(low) > GD_minrank(high)) {
ST_Agraph_s temp = low; ST_Agraph_s temp = low;
low = high; low = high;
@ -1270,8 +1269,8 @@ try {
} }
if (GD_maxrank(low) < GD_minrank(high)) if (GD_maxrank(low) < GD_minrank(high))
continue; continue;
if (ND_order(GD_rank(low).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).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())) { < ND_order(GD_rank(high).get(GD_minrank(high)).v.get(0))) {
left = low; left = low;
right = high; right = high;
} else { } else {
@ -1280,7 +1279,7 @@ try {
} }
make_aux_edge(GD_rn(left), GD_ln(right), margin, 0); make_aux_edge(GD_rn(left), GD_ln(right), margin, 0);
} }
separate_subclust((ST_Agraph_s) GD_clust(g).plus(i).getPtr().getPtr()); separate_subclust((ST_Agraph_s) GD_clust(g).get(i).getPtr());
} }
} finally { } finally {
LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust"); LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
@ -1316,7 +1315,7 @@ ENTERING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
try { try {
double x; double x;
ST_pointf p = new ST_pointf(); ST_pointf p = new ST_pointf();
if (GD_drawing(g).getInt("ratio_kind") != enumAsInt(ratio_t.class, "R_COMPRESS")) if (GD_drawing(g).ratio_kind != enumAsInt(ratio_t.class, "R_COMPRESS"))
return; return;
UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size; UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size;
UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1) UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1)
@ -1411,8 +1410,8 @@ try {
ST_Agnode_s v; ST_Agnode_s v;
ST_rank_t.Array2 rank = GD_rank(g); ST_rank_t.Array2 rank = GD_rank(g);
for (i = GD_minrank(g); i <= GD_maxrank(g); i++) { for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
for (j = 0; j < rank.plus(i).getInt("n"); j++) { for (j = 0; j < rank.get(i).n; j++) {
v = (ST_Agnode_s) rank.plus(i).getPtr().v.plus(j).getPtr(); v = (ST_Agnode_s) rank.get(i).v.get(j);
ND_coord(v).x = ND_rank(v); ND_coord(v).x = ND_rank(v);
ND_rank(v, i); ND_rank(v, i);
} }
@ -1520,7 +1519,7 @@ try {
int c; int c;
double ht1, ht2; double ht1, ht2;
ST_Agraph_s subg; ST_Agraph_s subg;
__ptr__ rank = GD_rank(dot_root(g)); ST_rank_t.Array2 rank = GD_rank(dot_root(g));
int margin, haveClustLabel = 0; int margin, haveClustLabel = 0;
if (EQ(g, dot_root(g))) if (EQ(g, dot_root(g)))
margin = 8; margin = 8;
@ -1530,7 +1529,7 @@ try {
ht2 = GD_ht2(g); ht2 = GD_ht2(g);
/* account for sub-clusters */ /* account for sub-clusters */
for (c = 1; c <= GD_n_cluster(g); c++) { for (c = 1; c <= GD_n_cluster(g); c++) {
subg = (ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(); subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
haveClustLabel |= clust_ht(subg); haveClustLabel |= clust_ht(subg);
if (GD_maxrank(subg) == GD_maxrank(g)) if (GD_maxrank(subg) == GD_maxrank(g))
ht1 = MAX(ht1, GD_ht1(subg) + margin); ht1 = MAX(ht1, GD_ht1(subg) + margin);
@ -1542,16 +1541,16 @@ try {
if (NEQ(g, dot_root(g)) && GD_label(g)!=null) { if (NEQ(g, dot_root(g)) && GD_label(g)!=null) {
haveClustLabel = 1; haveClustLabel = 1;
if (N(GD_flip(agroot(g)))) { if (N(GD_flip(agroot(g)))) {
ht1 += GD_border(g)[0].getDouble("y"); ht1 += GD_border(g)[0].y;
ht2 += GD_border(g)[2].getDouble("y"); ht2 += GD_border(g)[2].y;
} }
} }
GD_ht1(g, ht1); GD_ht1(g, ht1);
GD_ht2(g, ht2); GD_ht2(g, ht2);
/* update the global ranks */ /* update the global ranks */
if (NEQ(g, dot_root(g))) { 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_minrank(g)).setDouble("ht2", MAX(rank.get(GD_minrank(g)).ht2, ht2));
rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.plus(GD_maxrank(g)).getDouble("ht1"), ht1)); rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.get(GD_maxrank(g)).ht1, ht1));
} }
return haveClustLabel; return haveClustLabel;
} finally { } finally {
@ -1577,8 +1576,8 @@ try {
ht2 = maxht = 0; ht2 = maxht = 0;
/* scan ranks for tallest nodes. */ /* scan ranks for tallest nodes. */
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
for (i = 0; i < rank.plus(r).getInt("n"); i++) { for (i = 0; i < rank.get(r).n; i++) {
n = (ST_Agnode_s) rank.plus(r).getPtr().v.plus(i).getPtr(); n = (ST_Agnode_s) rank.get(r).v.get(i);
/* assumes symmetry, ht1 = ht2 */ /* assumes symmetry, ht1 = ht2 */
ht2 = ND_ht(n) / 2; ht2 = ND_ht(n) / 2;
/* have to look for high self-edge labels, too */ /* have to look for high self-edge labels, too */
@ -1586,15 +1585,15 @@ try {
for (j = 0; (e = (ST_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 (EQ(agtail(e), aghead(e))) {
if (ED_label(e)!=null) if (ED_label(e)!=null)
ht2 = MAX(ht2, ED_label(e).dimen.getDouble("y") / 2); ht2 = MAX(ht2, ED_label(e).dimen.y / 2);
} }
} }
/* update global rank ht */ /* 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("ht2", ht2);
rank.plus(r).setDouble("pht2", 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("ht1", ht2);
rank.plus(r).setDouble("pht1", ht2); rank.plus(r).setDouble("pht1", ht2);
} }
@ -1613,13 +1612,13 @@ try {
/* make the initial assignment of ycoords to leftmost nodes by ranks */ /* make the initial assignment of ycoords to leftmost nodes by ranks */
maxht = 0; maxht = 0;
r = GD_maxrank(g); r = GD_maxrank(g);
(ND_coord(rank.plus(r).getPtr().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)) { while (--r >= GD_minrank(g)) {
d0 = rank.plus(r + 1).getDouble("pht2") + rank.plus(r).getDouble("pht1") + GD_ranksep(g); /* prim node sep */ d0 = rank.get(r + 1).pht2 + rank.get(r).pht1 + GD_ranksep(g); /* prim node sep */
d1 = rank.plus(r + 1).getDouble("ht2") + rank.plus(r).getDouble("ht1") + 8; /* cluster sep */ d1 = rank.get(r + 1).ht2 + rank.get(r).ht1 + 8; /* cluster sep */
delta = MAX(d0, d1); delta = MAX(d0, d1);
if (rank.plus(r).getInt("n") > 0) /* this may reflect some problem */ if (rank.get(r).n > 0) /* this may reflect some problem */
(ND_coord(rank.plus(r).getPtr().v.plus(0).getPtr())).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.plus(0).getPtr())).getDouble("y") + delta); (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); maxht = MAX(maxht, delta);
} }
/* If there are cluster labels and the drawing is rotated, we need special processing to /* If there are cluster labels and the drawing is rotated, we need special processing to
@ -1650,7 +1649,7 @@ UNSUPPORTED("e6dfx5uesysjaefb0djyfp7f"); // (ND_coord(rank[r + 1].v[0])).y
} }
/* copy ycoord assignment from leftmost nodes to others */ /* copy ycoord assignment from leftmost nodes to others */
for (n = GD_nlist(g); n!=null; n = ND_next(n)) for (n = GD_nlist(g); n!=null; n = ND_next(n))
ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.plus(0).getPtr()).getDouble("y"); ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.get(0)).y;
} finally { } finally {
LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords"); LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords");
} }
@ -1673,23 +1672,23 @@ try {
LL.x = INT_MAX; LL.x = INT_MAX;
UR.x = -((double)INT_MAX); UR.x = -((double)INT_MAX);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { 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) if (rnkn == 0)
continue; continue;
if ((v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr()) == null) if ((v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0)) == null)
continue; continue;
for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++) for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++)
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(c).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
if (ND_node_type(v) == 0) { if (ND_node_type(v) == 0) {
x = ND_coord(v).getDouble("x") - ND_lw(v); x = ND_coord(v).x - ND_lw(v);
LL.setDouble("x", MIN(LL.x, x)); LL.setDouble("x", MIN(LL.x, x));
} }
else continue; else continue;
/* At this point, we know the rank contains a NORMAL node */ /* At this point, we know the rank contains a NORMAL node */
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().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--) for (c = rnkn-2; ND_node_type(v) != 0; c--)
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(c).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
x = ND_coord(v).getDouble("x") + ND_rw(v); x = ND_coord(v).x + ND_rw(v);
UR.x = MAX(UR.x, x); UR.x = MAX(UR.x, x);
} }
offset = 8; offset = 8;
@ -1703,8 +1702,8 @@ try {
LL.x = (double)(ND_rank(GD_ln(g))); LL.x = (double)(ND_rank(GD_ln(g)));
UR.x = (double)(ND_rank(GD_rn(g))); UR.x = (double)(ND_rank(GD_rn(g)));
} }
LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.plus(0).getPtr()).getDouble("y") - GD_ht1(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.plus(0).getPtr()).getDouble("y") + GD_ht2(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("LL", LL);
GD_bb(g).setStruct("UR", UR); GD_bb(g).setStruct("UR", UR);
} finally { } finally {
@ -1723,7 +1722,7 @@ ENTERING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
try { try {
int c; int c;
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
rec_bb((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr(), root); rec_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), root);
dot_compute_bb(g, root); dot_compute_bb(g, root);
} finally { } finally {
LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb"); LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
@ -1794,7 +1793,7 @@ try {
boolean scale_it, filled; boolean scale_it, filled;
ST_point sz = new ST_point(); ST_point sz = new ST_point();
rec_bb(g, g); 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("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("catd6eu5oc282ln95k9zz52f3"); // sz.y = GD_bb(g).UR.y - GD_bb(g).LL.y; /* normalize */
UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) { UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) {
@ -1921,23 +1920,23 @@ try {
ST_Agnode_s v; ST_Agnode_s v;
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
j = 0; j = 0;
for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) { for (i = 0; i < GD_rank(g).get(r).n; i++) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
ND_order(v, j); ND_order(v, j);
if (ND_ranktype(v) == 6) if (ND_ranktype(v) == 6)
j = j + ND_UF_size(v); j = j + ND_UF_size(v);
else else
j++; j++;
} }
if (j <= GD_rank(g).plus(r).getInt("n")) if (j <= GD_rank(g).get(r).n)
continue; continue;
GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).plus(r).getPtr("v"), j + 1)); 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).plus(r).getInt("n") - 1; i >= 0; i--) { for (i = GD_rank(g).get(r).n - 1; i >= 0; i--) {
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(i).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
GD_rank(g).plus(r).getPtr().v.plus(ND_order(v)).setPtr(v); 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).setInt("n", j);
GD_rank(g).plus(r).getPtr().v.plus(j).setPtr(null); GD_rank(g).get(r).v.plus(j).setPtr(null);
} }
} finally { } finally {
LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots"); LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
@ -2061,7 +2060,7 @@ try {
rn = virtual_node(dot_root(g)); rn = virtual_node(dot_root(g));
ND_node_type(rn, 2); ND_node_type(rn, 2);
if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) { if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) {
int w = MAX((int)GD_border(g)[0].getDouble("x"), (int)GD_border(g)[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); make_aux_edge(ln, rn, w, 0);
} }
GD_ln(g, ln); GD_ln(g, ln);
@ -2086,19 +2085,19 @@ try {
ln = GD_ln(g); ln = GD_ln(g);
rn = GD_rn(g); rn = GD_rn(g);
for (r = GD_minrank(g); r <= GD_maxrank(g); r++) { 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; continue;
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(0).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
if (v == null) { if (v == null) {
UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n", UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n",
UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r); UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r);
UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue; UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
} }
make_aux_edge(ln, v, make_aux_edge(ln, v,
ND_lw(v) + margin + GD_border(g)[3].getDouble("x"), 0); ND_lw(v) + margin + GD_border(g)[3].x, 0);
v = (ST_Agnode_s) GD_rank(g).plus(r).getPtr().v.plus(GD_rank(g).plus(r).getInt("n") - 1).getPtr(); v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - 1).getPtr();
make_aux_edge(v, rn, make_aux_edge(v, rn,
ND_rw(v) + margin + GD_border(g)[1].getDouble("x"), 0); ND_rw(v) + margin + GD_border(g)[1].x, 0);
} }
} finally { } finally {
LEAVING("daz786541idcxnywckcbncazb","contain_nodes"); LEAVING("daz786541idcxnywckcbncazb","contain_nodes");

View File

@ -101,14 +101,14 @@ import static smetana.core.Macro.ND_out;
import static smetana.core.Macro.ND_rank; import static smetana.core.Macro.ND_rank;
import static smetana.core.Macro.ND_ranktype; import static smetana.core.Macro.ND_ranktype;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.Macro.*; import static smetana.core.Macro.ZALLOC_ST_Agraph_s;
import h.ST_Agedge_s; import h.ST_Agedge_s;
import h.ST_Agnode_s; import h.ST_Agnode_s;
import h.ST_Agraph_s; import h.ST_Agraph_s;
import h.ST_aspect_t; import h.ST_aspect_t;
import h.ST_elist;
import h.ST_point; import h.ST_point;
import h.ST_pointf; import h.ST_pointf;
import h.ST_elist;
import smetana.core.CString; import smetana.core.CString;
import smetana.core.Memory; import smetana.core.Memory;
import smetana.core.Z; import smetana.core.Z;
@ -438,8 +438,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -929,7 +929,7 @@ try {
continue; continue;
} }
for (i = 1; i < GD_n_cluster(par); i++) for (i = 1; i < GD_n_cluster(par); i++)
if (agcontains((ST_Agraph_s) GD_clust(par).plus(i).getPtr().getPtr(), n)) if (agcontains((ST_Agraph_s) GD_clust(par).get(i).getPtr(), n))
break; break;
if (i < GD_n_cluster(par)) if (i < GD_n_cluster(par))
agdelete(g, n); agdelete(g, n);
@ -1088,7 +1088,7 @@ try {
GD_minrank(g, GD_minrank(g) + ND_rank(GD_leader(g))); GD_minrank(g, GD_minrank(g) + ND_rank(GD_leader(g)));
GD_maxrank(g, GD_maxrank(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++) for (c = 1; c <= GD_n_cluster(g); c++)
set_minmax((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} finally { } finally {
LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax"); LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax");
} }
@ -1190,7 +1190,7 @@ try {
if ((s = agget(g, new CString("nslimit1")))!=null) if ((s = agget(g, new CString("nslimit1")))!=null)
UNSUPPORTED("9tp2zk1tsr4ce9rwsr0is9u3o"); // maxiter = atof(s) * agnnodes(g); UNSUPPORTED("9tp2zk1tsr4ce9rwsr0is9u3o"); // maxiter = atof(s) * agnnodes(g);
for (c = 0; c < GD_comp(g).size; c++) { for (c = 0; c < GD_comp(g).size; c++) {
//GD_nlist(g, GD_comp(g).list.plus(c).getPtr()); //GD_nlist(g, GD_comp(g).list.get(c));
GD_nlist(g, GD_comp(g).getFromList(c)); GD_nlist(g, GD_comp(g).getFromList(c));
rank(g, (GD_n_cluster(g) == 0 ? 1 : 0), maxiter); /* TB balance */ rank(g, (GD_n_cluster(g) == 0 ? 1 : 0), maxiter); /* TB balance */
} }
@ -1230,7 +1230,7 @@ try {
if (EQ(g, dot_root(g))) { if (EQ(g, dot_root(g))) {
if (Z.z().CL_type == 100) { if (Z.z().CL_type == 100) {
for (c = 1; c <= GD_n_cluster(g); c++) for (c = 1; c <= GD_n_cluster(g); c++)
set_minmax((ST_Agraph_s) GD_clust(g).plus(c).getPtr().getPtr()); set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
} else { } else {
find_clusters(g); find_clusters(g);
} }

View File

@ -380,8 +380,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -373,8 +373,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -196,10 +196,10 @@ try {
// plugin = gvplugin_load(gvc, API_layout, layout); // plugin = gvplugin_load(gvc, API_layout, layout);
// if (plugin) { // if (plugin) {
// typeptr = plugin->typeptr; // typeptr = plugin->typeptr;
gvc.getStruct("layout").setPtr("type", typeptr.getPtr("type")); gvc.layout.setPtr("type", typeptr.type);
gvc.getStruct("layout").setPtr("engine", typeptr.getPtr("engine")); gvc.layout.setPtr("engine", typeptr.engine);
gvc.getStruct("layout").setInt("id", typeptr.getInt("id")); gvc.layout.setInt("id", typeptr.id);
gvc.getStruct("layout").setPtr("features", typeptr.getPtr("features")); gvc.layout.setPtr("features", typeptr.features);
return 300; /* FIXME - need better return code */ return 300; /* FIXME - need better return code */
// } // }
// return 999; // return 999;
@ -235,18 +235,18 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
rc = gvlayout_select(gvc, p); //Let's force things rc = gvlayout_select(gvc, p); //Let's force things
gvle = (ST_gvlayout_engine_s) gvc.getStruct("layout").getPtr("engine"); gvle = (ST_gvlayout_engine_s) gvc.layout.engine;
if (N(gvle)) if (N(gvle))
UNSUPPORTED("return -1;"); UNSUPPORTED("return -1;");
gv_fixLocale (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)); GD_drawing(agroot(g), GD_drawing(g));
if (gvle!=null && gvle.getPtr("layout")!=null) { if (gvle!=null && gvle.layout!=null) {
gvle.call("layout", g); gvle.layout.exe(g);
if (gvle.getPtr("cleanup")!=null) if (gvle.cleanup!=null)
if (GD_cleanup(g)==null) if (GD_cleanup(g)==null)
LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else 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); gv_fixLocale (0);
return 0; return 0;

View File

@ -237,8 +237,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -58,6 +58,7 @@ import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Branch_t; import h.ST_Branch_t;
import h.ST_LeafList_t; import h.ST_LeafList_t;
import h.ST_Node_t___; import h.ST_Node_t___;
import h.ST_Node_t___or_object_t;
import h.ST_RTree; import h.ST_RTree;
import h.ST_Rect_t; import h.ST_Rect_t;
import smetana.core.Memory; import smetana.core.Memory;
@ -68,7 +69,7 @@ public class index__c {
//3 1rfaqe5urty5uyp5xb2r0idce //3 1rfaqe5urty5uyp5xb2r0idce
// LeafList_t *RTreeNewLeafList(Leaf_t * lp) // LeafList_t *RTreeNewLeafList(Leaf_t * lp)
public static ST_LeafList_t RTreeNewLeafList(__ptr__ lp) { public static ST_LeafList_t RTreeNewLeafList(ST_Branch_t lp) {
ENTERING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList"); ENTERING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
try { try {
ST_LeafList_t llp; ST_LeafList_t llp;
@ -94,14 +95,14 @@ LEAVING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
//3 6pvstz7axi8a7saeqe3nrrmg5 //3 6pvstz7axi8a7saeqe3nrrmg5
// LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp) // LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp)
public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, __ptr__ lp) { public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, ST_Branch_t lp) {
ENTERING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd"); ENTERING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
try { try {
ST_LeafList_t nlp; ST_LeafList_t nlp;
if (N(lp)) if (N(lp))
return llp; return llp;
nlp = RTreeNewLeafList(lp); nlp = RTreeNewLeafList(lp);
nlp.setPtr("next", llp); nlp.next = llp;
return nlp; return nlp;
} finally { } finally {
LEAVING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd"); LEAVING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
@ -191,27 +192,27 @@ ENTERING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
try { try {
int i; int i;
if (n.getInt("level") > 0) { if (n.level > 0) {
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
if (N(n.branch[i].getPtr("child"))) if (N(n.branch[i].child))
continue; continue;
if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].getPtr("child")))) { if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].child))) {
Memory.free(n.branch[i].getPtr("child")); Memory.free(n.branch[i].child);
DisconBranch(n, i); DisconBranch(n, i);
rtp.setInt("EntryCount", rtp.EntryCount-1); rtp.setInt("EntryCount", rtp.EntryCount-1);
if (rtp.StatFlag!=0) if (rtp.StatFlag!=0)
rtp.setInt("ElimCount", rtp.getInt("ElimCount")+1); rtp.setInt("ElimCount", rtp.ElimCount+1);
} }
} }
} else { } else {
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
if (N(n.branch[i].getPtr("child"))) if (N(n.branch[i].child))
continue; continue;
// free(n->branch[i].child); // free(n->branch[i].child);
DisconBranch(n, i); DisconBranch(n, i);
rtp.setInt("EntryCount", rtp.EntryCount-1); rtp.setInt("EntryCount", rtp.EntryCount-1);
if (rtp.StatFlag!=0) if (rtp.StatFlag!=0)
rtp.setInt("ElimCount", rtp.getInt("ElimCount")+1); rtp.setInt("ElimCount", rtp.ElimCount+1);
} }
//free(n); //free(n);
} }
@ -226,8 +227,8 @@ LEAVING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
public static int RTreeClose(ST_RTree rtp) { public static int RTreeClose(ST_RTree rtp) {
ENTERING("aa59m7d7qc06m8id896e60lkg","RTreeClose"); ENTERING("aa59m7d7qc06m8id896e60lkg","RTreeClose");
try { try {
RTreeClose2(rtp, (ST_Node_t___) rtp.getPtr("root")); RTreeClose2(rtp, (ST_Node_t___) rtp.root);
Memory.free(rtp.getPtr("root")); Memory.free(rtp.root);
Memory.free(rtp); Memory.free(rtp);
return 0; return 0;
} finally { } finally {
@ -255,22 +256,22 @@ try {
rtp.setInt("SeTouchCount", rtp.SeTouchCount+1); rtp.setInt("SeTouchCount", rtp.SeTouchCount+1);
if (n.getInt("level") > 0) { /* this is an internal node in the tree */ if (n.level > 0) { /* this is an internal node in the tree */
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
if (n.branch[i].getPtr("child")!=null && if (n.branch[i].child!=null &&
Overlap(r, n.branch[i].rect)) { Overlap(r, n.branch[i].rect)) {
ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].getPtr("child"), r); ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].child, r);
if (llp!=null) { if (llp!=null) {
ST_LeafList_t xlp = llp; ST_LeafList_t xlp = llp;
while (xlp.next!=null) while (xlp.next!=null)
xlp = (ST_LeafList_t) xlp.next; xlp = (ST_LeafList_t) xlp.next;
xlp.setPtr("next", tlp); xlp.next = tlp;
} else } else
llp = tlp; llp = tlp;
} }
} else { /* this is a leaf node */ } else { /* this is a leaf node */
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
if (n.branch[i].getPtr("child")!=null && Overlap(r, n.branch[i].rect)) { if (n.branch[i].child!=null && Overlap(r, n.branch[i].rect)) {
llp = RTreeLeafListAdd(llp, /*(Leaf_t *)*/ n.branch[i]); llp = RTreeLeafListAdd(llp, /*(Leaf_t *)*/ n.branch[i]);
} }
} }
@ -316,7 +317,7 @@ UNSUPPORTED("bzb1oqc35evr96528iv16glb0"); // rtp->ReInsertCount++;
UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("3kxquse3qg2crme5dzybg9jxe"); // rtp->InsertCount++; UNSUPPORTED("3kxquse3qg2crme5dzybg9jxe"); // rtp->InsertCount++;
} }
if (N(rtp.getInt("Deleting"))) if (N(rtp.Deleting))
rtp.setInt("RectCount", rtp.RectCount+1); rtp.setInt("RectCount", rtp.RectCount+1);
if (RTreeInsert2(rtp, r, data, n[0], newnode, level)!=0) { /* root was split */ if (RTreeInsert2(rtp, r, data, n[0], newnode, level)!=0) { /* root was split */
if (rtp.StatFlag!=0) { if (rtp.StatFlag!=0) {
@ -326,13 +327,13 @@ UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++; UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
} }
newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */ newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */
rtp.setInt("NonLeafCount", rtp.getInt("NonLeafCount")+1); rtp.setInt("NonLeafCount", rtp.NonLeafCount+1);
newroot.setInt("level", n[0].getInt("level") + 1); newroot.setInt("level", n[0].level + 1);
b.setStruct("rect", NodeCover(n[0])); b.setStruct("rect", NodeCover(n[0]));
b.setPtr("child", n[0]); b.child = n[0];
AddBranch(rtp, b, newroot, null); AddBranch(rtp, b, newroot, null);
b.setStruct("rect", NodeCover(newnode[0])); b.setStruct("rect", NodeCover(newnode[0]));
b.setPtr("child", newnode[0]); b.child = newnode[0];
AddBranch(rtp, b, newroot, null); AddBranch(rtp, b, newroot, null);
n[0] = newroot; n[0] = newroot;
// rtp->root = newroot; // rtp->root = newroot;
@ -370,9 +371,9 @@ UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++; UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++;
} }
/* Still above level for insertion, go down tree recursively */ /* Still above level for insertion, go down tree recursively */
if (n.getInt("level") > level) { if (n.level > level) {
i = PickBranch(r, n); i = PickBranch(r, n);
if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].getPtr("child"), n2, level))) { if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].child, n2, level))) {
/* recurse: child was not split */ /* recurse: child was not split */
n.branch[i].setStruct("rect", n.branch[i].setStruct("rect",
CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect)); CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect));
@ -384,10 +385,10 @@ UNSUPPORTED("50z4r9qcomgi4o7vvwq0v0xs"); // b.rect = NodeCover(n2);
UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++; UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++;
UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new); UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new);
} }
} else if (n.getInt("level") == level) { /* at level for insertion. */ } else if (n.level == level) { /* at level for insertion. */
/*Add rect, split if necessary */ /*Add rect, split if necessary */
b.rect.___(r); b.rect.___(r);
b.setPtr("child", /*(Node_t *)*/data); // THIS CAST IS A BIG ISSUE b.child = /*(Node_t *)*/(ST_Node_t___or_object_t) data; // THIS CAST IS A BIG ISSUE
// UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data; // UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data;
rtp.setInt("EntryCount", rtp.EntryCount+1); rtp.setInt("EntryCount", rtp.EntryCount+1);
return AddBranch(rtp, b, n, new_); return AddBranch(rtp, b, n, new_);

View File

@ -65,7 +65,7 @@ public static ST_Node_t___ RTreeNewNode(ST_RTree rtp) {
ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode"); ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
try { try {
ST_Node_t___ n; ST_Node_t___ n;
rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1); rtp.setInt("NodeCount", rtp.NodeCount + 1);
n = new ST_Node_t___(); n = new ST_Node_t___();
InitNode(n); InitNode(n);
return n; return n;
@ -121,7 +121,7 @@ public static void InitBranch(ST_Branch_t b) {
ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch"); ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
try { try {
InitRect(b.rect); InitRect(b.rect);
b.setPtr("child", null); b.child = null;
} finally { } finally {
LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch"); LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
} }
@ -141,9 +141,9 @@ try {
InitRect(r); InitRect(r);
flag = 1; flag = 1;
for (i = 0; i < 64; i++) for (i = 0; i < 64; i++)
if (n.branch[i].getPtr("child")!=null) { if (n.branch[i].child!=null) {
if (flag!=0) { if (flag!=0) {
r.___(n.branch[i].getStruct("rect")); r.___(n.branch[i].rect);
flag = 0; flag = 0;
} else } else
r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect)); r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect));
@ -167,7 +167,7 @@ public static int PickBranch(ST_Rect_t r, ST_Node_t___ n) {
int best=0; int best=0;
// assert(r && n); // assert(r && n);
for (i = 0; i < 64; i++) { for (i = 0; i < 64; i++) {
if (n.branch[i].getPtr("child")!=null) { if (n.branch[i].child!=null) {
final ST_Rect_t rect = new ST_Rect_t(); final ST_Rect_t rect = new ST_Rect_t();
rr = (ST_Rect_t) n.branch[i].rect; rr = (ST_Rect_t) n.branch[i].rect;
area = RectArea((ST_Rect_t) rr); area = RectArea((ST_Rect_t) rr);
@ -205,7 +205,7 @@ try {
// assert(n); // assert(n);
if (n.count < 64) { /* split won't be necessary */ if (n.count < 64) { /* split won't be necessary */
for (i = 0; i < 64; i++) { /* find empty branch */ for (i = 0; i < 64; i++) { /* find empty branch */
if (n.branch[i].getPtr("child") == null) { if (n.branch[i].child == null) {
n.branch[i].___(b.getStruct()); n.branch[i].___(b.getStruct());
n.setInt("count", n.count+1); n.setInt("count", n.count+1);
break; break;
@ -222,7 +222,7 @@ UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
} }
// assert(new); // assert(new);
SplitNode(rtp, n, b, new_); SplitNode(rtp, n, b, new_);
if (n.getInt("level") == 0) if (n.level == 0)
rtp.setInt("LeafCount", rtp.LeafCount+1); rtp.setInt("LeafCount", rtp.LeafCount+1);
else else
UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // rtp->NonLeafCount++; UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // rtp->NonLeafCount++;

View File

@ -49,7 +49,6 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Rect_t; import h.ST_Rect_t;
import smetana.core.__ptr__;
public class rectangle__c { public class rectangle__c {
//1 9k44uhd5foylaeoekf3llonjq //1 9k44uhd5foylaeoekf3llonjq

View File

@ -81,14 +81,14 @@ UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
UNSUPPORTED("2cjo6wz1rmxfm5k7u7rw5dqpj"); // rtp->InSplitCount++; UNSUPPORTED("2cjo6wz1rmxfm5k7u7rw5dqpj"); // rtp->InSplitCount++;
} }
/* load all the branches into a buffer, initialize old node */ /* load all the branches into a buffer, initialize old node */
level = n.getInt("level"); level = n.level;
GetBranches(rtp, n, b); GetBranches(rtp, n, b);
/* find partition */ /* find partition */
p = rtp.split.Partitions[0]; p = rtp.split.Partitions[0];
MethodZero(rtp); MethodZero(rtp);
area = RectArea((ST_Rect_t)p.cover[0]) + RectArea((ST_Rect_t)p.cover[1]); area = RectArea((ST_Rect_t)p.cover[0]) + RectArea((ST_Rect_t)p.cover[1]);
/* record how good the split was for statistics */ /* record how good the split was for statistics */
if (rtp.StatFlag!=0 && N(rtp.getInt("Deleting")) && area!=0) if (rtp.StatFlag!=0 && N(rtp.Deleting) && area!=0)
UNSUPPORTED("z7xk6s3hzi3qcoiq2exj9hpv"); // rtp->SplitMeritSum += (float) rtp->split.CoverSplitArea / area; UNSUPPORTED("z7xk6s3hzi3qcoiq2exj9hpv"); // rtp->SplitMeritSum += (float) rtp->split.CoverSplitArea / area;
/* put branches from buffer into 2 nodes according to chosen partition */ /* put branches from buffer into 2 nodes according to chosen partition */
nn[0] = RTreeNewNode(rtp); nn[0] = RTreeNewNode(rtp);
@ -119,7 +119,7 @@ try {
} }
rtp.split.BranchBuf[64].___(b); rtp.split.BranchBuf[64].___(b);
/* calculate rect containing all in the set */ /* calculate rect containing all in the set */
rtp.split.getStruct("CoverSplit").___(rtp.split.BranchBuf[0].rect); rtp.split.CoverSplit.___(rtp.split.BranchBuf[0].rect);
for (i = 1; i < 64 + 1; i++) { for (i = 1; i < 64 + 1; i++) {
rtp.split.setStruct("CoverSplit", rtp.split.setStruct("CoverSplit",
CombineRect((ST_Rect_t)rtp.split.CoverSplit, CombineRect((ST_Rect_t)rtp.split.CoverSplit,
@ -147,9 +147,9 @@ try {
PickSeeds(rtp); PickSeeds(rtp);
while (rtp.split.Partitions[0].count[0] + while (rtp.split.Partitions[0].count[0] +
rtp.split.Partitions[0].count[1] < 64 + 1 && rtp.split.Partitions[0].count[1] < 64 + 1 &&
rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.getInt("MinFill") rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.MinFill
&& rtp.split.Partitions[0].count[1] < && rtp.split.Partitions[0].count[1] <
64 + 1 - rtp.getInt("MinFill")) { 64 + 1 - rtp.MinFill) {
biggestDiff = -1; biggestDiff = -1;
for (i = 0; i < 64 + 1; i++) { for (i = 0; i < 64 + 1; i++) {
if (N(rtp.split.Partitions[0].taken[i])) { if (N(rtp.split.Partitions[0].taken[i])) {

View File

@ -173,13 +173,13 @@ ST_XLabels_t xlp;
xlp = new ST_XLabels_t(); xlp = new ST_XLabels_t();
/* used to load the rtree in hilbert space filling curve order */ /* used to load the rtree in hilbert space filling curve order */
xlp.setPtr("hdx", dtopen(Z.z().Hdisc, Z.z().Dtobag)); xlp.setPtr("hdx", dtopen(Z.z().Hdisc, Z.z().Dtobag));
if (N(xlp.getPtr("hdx"))) { if (N(xlp.hdx)) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n"); UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad; UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
} }
/* for querying intersection candidates */ /* for querying intersection candidates */
xlp.setPtr("spdx", RTreeOpen()); xlp.setPtr("spdx", RTreeOpen());
if (N(xlp.getPtr("spdx"))) { if (N(xlp.spdx)) {
UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n"); UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad; UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
} }
@ -211,7 +211,7 @@ LEAVING("88mbfm305igsr7cew5qx6yldp","xlnew");
public static void xlfree(ST_XLabels_t xlp) { public static void xlfree(ST_XLabels_t xlp) {
ENTERING("apvhod2s1yjb8717rb7gie2kb","xlfree"); ENTERING("apvhod2s1yjb8717rb7gie2kb","xlfree");
try { try {
RTreeClose((ST_RTree) xlp.getPtr("spdx")); RTreeClose((ST_RTree) xlp.spdx);
Memory.free(xlp); Memory.free(xlp);
} finally { } finally {
LEAVING("apvhod2s1yjb8717rb7gie2kb","xlfree"); LEAVING("apvhod2s1yjb8717rb7gie2kb","xlfree");
@ -284,7 +284,7 @@ LEAVING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy");
} }
} }
private static int hd_hil_s_from_xy_(ST_point p, int n) { private static int hd_hil_s_from_xy_(ST_point p, int n) {
int i, x = p.getInt("x"), y = p.getInt("y"), xi, yi; int i, x = p.x, y = p.y, xi, yi;
int s; int s;
s = 0; /* Initialize. */ s = 0; /* Initialize. */
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
@ -344,10 +344,10 @@ try {
ST_xlabel_t.Array xlp = (ST_xlabel_t.Array) objp.lbl; ST_xlabel_t.Array xlp = (ST_xlabel_t.Array) objp.lbl;
// assert(objp1->sz.x == 0 && objp1->sz.y == 0); // assert(objp1->sz.x == 0 && objp1->sz.y == 0);
if(N(xlp)) return false; if(N(xlp)) return false;
return objp1.getStruct("pos").getDouble("x") > xlp.getStruct("pos").getDouble("x") && return objp1.pos.x > xlp.getStruct().pos.x &&
objp1.getStruct("pos").getDouble("x") < (xlp.getStruct("pos").getDouble("x") + xlp.getStruct("sz").getDouble("y")) && objp1.pos.x < (xlp.getStruct().pos.x + xlp.getStruct().sz.y) &&
objp1.getStruct("pos").getDouble("y") > xlp.getStruct("pos").getDouble("y") && objp1.pos.y > xlp.getStruct().pos.y &&
objp1.getStruct("pos").getDouble("y") < (xlp.getStruct("pos").getDouble("y") + xlp.getStruct("sz").getDouble("y")); objp1.pos.y < (xlp.getStruct().pos.y + xlp.getStruct().sz.y);
// UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x && // UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x &&
// UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) && // UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) &&
// UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y && // UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y &&
@ -367,10 +367,10 @@ LEAVING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing");
public static void objp2rect(ST_object_t op, ST_Rect_t r) { public static void objp2rect(ST_object_t op, ST_Rect_t r) {
ENTERING("dq1wkb4oxshdggv6cwtgas6m","objp2rect"); ENTERING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
try { try {
r.boundary[0]=((int)op.getStruct("pos").getDouble("x")); r.boundary[0]=((int)op.pos.x);
r.boundary[1]=((int)op.getStruct("pos").getDouble("y")); r.boundary[1]=((int)op.pos.y);
r.boundary[2]=((int)(op.getStruct("pos").getDouble("x")+op.getStruct("sz").getDouble("x"))); r.boundary[2]=((int)(op.pos.x+op.sz.x));
r.boundary[3]=((int)(op.getStruct("pos").getDouble("y")+op.getStruct("sz").getDouble("y"))); r.boundary[3]=((int)(op.pos.y+op.sz.y));
} finally { } finally {
LEAVING("dq1wkb4oxshdggv6cwtgas6m","objp2rect"); LEAVING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
} }
@ -385,10 +385,10 @@ public static void objplp2rect(ST_object_t objp, ST_Rect_t r) {
ENTERING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect"); ENTERING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
try { try {
ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl;
r.boundary[0]=((int)lp.getStruct("pos").getDouble("x")); r.boundary[0]=((int)lp.getStruct().pos.x);
r.boundary[1]=((int)lp.getStruct("pos").getDouble("y")); r.boundary[1]=((int)lp.getStruct().pos.y);
r.boundary[2]=((int)(lp.getStruct("pos").getDouble("x")+lp.getStruct("sz").getDouble("x"))); r.boundary[2]=((int)(lp.getStruct().pos.x+lp.getStruct().sz.x));
r.boundary[3]=((int)(lp.getStruct("pos").getDouble("y")+lp.getStruct("sz").getDouble("y"))); r.boundary[3]=((int)(lp.getStruct().pos.y+lp.getStruct().sz.y));
} finally { } finally {
LEAVING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect"); LEAVING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
} }
@ -407,12 +407,12 @@ try {
p.setDouble("x", 0); p.setDouble("x", 0);
p.setDouble("y", 0); p.setDouble("y", 0);
if (objp.lbl!=null) if (objp.lbl!=null)
p.___(objp.lbl.getStruct("sz")); p.___(objp.lbl.getStruct().sz);
rect.boundary[0]=((int) Math.floor(objp.getPtr("pos").getDouble("x") - p.getDouble("x"))); rect.boundary[0]=((int) Math.floor(objp.pos.x - p.x));
rect.boundary[1]=((int) Math.floor(objp.getPtr("pos").getDouble("y") - p.getDouble("y"))); rect.boundary[1]=((int) Math.floor(objp.pos.y - p.y));
rect.boundary[2]=((int) Math.ceil(objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x") + p.getDouble("x"))); rect.boundary[2]=((int) Math.ceil(objp.pos.x + objp.sz.x + p.x));
// assert(rect.boundary[2] < INT_MAX); // assert(rect.boundary[2] < INT_MAX);
rect.boundary[3]=((int) Math.ceil(objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y") + p.getDouble("y"))); rect.boundary[3]=((int) Math.ceil(objp.pos.y + objp.sz.y + p.y));
// assert(rect.boundary[3] < INT_MAX); // assert(rect.boundary[3] < INT_MAX);
return rect; return rect;
} finally { } finally {
@ -431,7 +431,7 @@ try {
int i = -1; int i = -1;
ST_xlabel_t.Array lp = (ST_xlabel_t.Array) op.lbl, clp = (ST_xlabel_t.Array) cp.lbl; ST_xlabel_t.Array lp = (ST_xlabel_t.Array) op.lbl, clp = (ST_xlabel_t.Array) cp.lbl;
assert(lp != clp); assert(lp != clp);
if (lp.getInt("set") == 0 || clp.getInt("set") == 0) if (lp.getStruct().set == 0 || clp.getStruct().set == 0)
return i; return i;
UNSUPPORTED("bofpvwtmumoe1ckgnlgbwg8bt"); // if ((op->pos.x == 0.0 && op->pos.y == 0.0) || 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("f039op8rn0jopi9r8kora4cwz"); // (cp->pos.x == 0.0 && cp->pos.y == 0.0))
@ -492,10 +492,10 @@ try {
if (maxa > 0.0) if (maxa > 0.0)
return maxa; return maxa;
/*replace overlapping label/object pair */ /*replace overlapping label/object pair */
intrsx[i] = (ST_object_t) cp.getStruct(); intrsx[i] = cp;
return a; return a;
} }
intrsx[i] = (ST_object_t) cp.getPtr(); intrsx[i] = cp;
return a; return a;
} finally { } finally {
LEAVING("52awwxu810dg9a2pjq45aomam","recordointrsx"); LEAVING("52awwxu810dg9a2pjq45aomam","recordointrsx");
@ -531,10 +531,10 @@ try {
if (maxa > 0.0) if (maxa > 0.0)
return maxa; return maxa;
/*replace overlapping label/object pair */ /*replace overlapping label/object pair */
intrsx[i] = (ST_object_t) cp.getStruct(); intrsx[i] = cp;
return a; return a;
} }
intrsx[i] = (ST_object_t) cp.getStruct(); intrsx[i] = cp;
return a; return a;
} finally { } finally {
LEAVING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx"); LEAVING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx");
@ -564,21 +564,24 @@ private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp,
// assert(objp->lbl); // assert(objp->lbl);
bp.setInt("n", 0); bp.setInt("n", 0);
bp.setDouble("area", 0.0); bp.setDouble("area", 0.0);
bp.setStruct("pos", objp.lbl.getStruct("pos")); bp.setStruct("pos", objp.lbl.getStruct().pos);
for(i=0; i<xlp.getInt("n_objs"); i++) { for(i=0; i<xlp.n_objs; i++) {
if (EQ(objp, xlp.getPtr("objs").plus(i).getStruct())) continue; if (EQ(objp, xlp.objs.plus(i).getStruct())) continue;
if(xlp.getPtr("objs").plus(i).getStruct("sz").getDouble("x") > 0 && xlp.getPtr("objs").plus(i).getStruct("sz").getDouble("y") > 0) continue; if(xlp.objs.get(i).sz.x > 0 && xlp.objs.get(i).sz.y > 0) continue;
if(lblenclosing(objp, (ST_object_t) xlp.getPtr("objs").plus(i).getStruct())) { if(lblenclosing(objp, (ST_object_t) xlp.objs.plus(i).getStruct())) {
bp.setInt("n", bp.getInt("n")+1); bp.setInt("n", bp.n+1);
} }
} }
objplp2rect((ST_object_t) objp.getStruct(), rect); objplp2rect((ST_object_t) objp.getStruct(), rect);
llp = RTreeSearch((ST_RTree)xlp.getPtr("spdx"), (ST_Node_t___)xlp.getPtr("spdx").getPtr("root"), rect); llp = RTreeSearch((ST_RTree)xlp.spdx, (ST_Node_t___)xlp.spdx.root, rect);
if (N(llp)) if (N(llp))
return bp; return bp;
for (ilp = llp; ilp!=null; ilp = (ST_LeafList_t) ilp.next) { for (ilp = llp; ilp!=null; ilp = (ST_LeafList_t) ilp.next) {
double a, ra; double a, ra;
ST_object_t cp = (ST_object_t) ilp.getPtr("leaf").getPtr("data").getPtr(); // 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)) if (EQ(cp, objp))
continue; continue;
/*label-object intersect */ /*label-object intersect */
@ -586,18 +589,18 @@ private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp,
a = aabbaabb(rect, srect); a = aabbaabb(rect, srect);
if (a > 0.0) { if (a > 0.0) {
ra = recordointrsx(xlp, objp, cp, rect, a, intrsx); ra = recordointrsx(xlp, objp, cp, rect, a, intrsx);
bp.setInt("n", bp.getInt("n")+1); bp.setInt("n", bp.n+1);
bp.setDouble("area", bp.getDouble("area")+ra); bp.setDouble("area", bp.area+ra);
} }
/*label-label intersect */ /*label-label intersect */
if (N(cp.lbl) || N(cp.lbl.getInt("set"))) if (N(cp.lbl) || N(cp.lbl.getStruct().set))
continue; continue;
objplp2rect((ST_object_t) cp.getStruct(), srect); objplp2rect((ST_object_t) cp.getStruct(), srect);
a = aabbaabb(rect, srect); a = aabbaabb(rect, srect);
if (a > 0.0) { if (a > 0.0) {
ra = recordlintrsx(xlp, objp, cp, rect, a, intrsx); ra = recordlintrsx(xlp, objp, cp, rect, a, intrsx);
bp.setInt("n", bp.getInt("n")+1); bp.setInt("n", bp.n+1);
bp.setDouble("area", bp.getDouble("area")+ra); bp.setDouble("area", bp.area+ra);
} }
} }
RTreeLeafListFree(llp); RTreeLeafListFree(llp);
@ -619,72 +622,72 @@ LEAVING("8rxvucqsqnqej6h8p1osfnk4b","xladjust");
} }
private static ST_BestPos_t xladjust_(ST_XLabels_t xlp, ST_object_t objp) { 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 ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; // ST_xlabel_t
double xincr = ((2 * lp.getStruct("sz").getDouble("x") + objp.getStruct("sz").getDouble("x"))) / 8; double xincr = ((2 * lp.getStruct().sz.x + objp.sz.x)) / 8;
double yincr = ((2 * lp.getStruct("sz").getDouble("y") + objp.getStruct("sz").getDouble("y"))) / 2; double yincr = ((2 * lp.getStruct().sz.y + objp.sz.y)) / 2;
ST_object_t intrsx[] = new ST_object_t[9]; ST_object_t intrsx[] = new ST_object_t[9];
final ST_BestPos_t bp = new ST_BestPos_t(); final ST_BestPos_t bp = new ST_BestPos_t();
final ST_BestPos_t nbp = new ST_BestPos_t(); final ST_BestPos_t nbp = new ST_BestPos_t();
// assert(objp->lbl); // assert(objp->lbl);
// memset(intrsx, 0, sizeof(intrsx)); // memset(intrsx, 0, sizeof(intrsx));
/*x left */ /*x left */
lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - lp.getStruct("sz").getDouble("x")); lp.getStruct().pos.setDouble("x", objp.pos.x - lp.getStruct().sz.x);
/*top */ /*top */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
bp.___(xlintersections(xlp, objp, intrsx)); bp.___(xlintersections(xlp, objp, intrsx));
if (bp.getInt("n") == 0) if (bp.n == 0)
return bp; return bp;
/*mid */ /*mid */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*bottom */ /*bottom */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*x mid */ /*x mid */
lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x")); lp.getStruct().pos.setDouble("x", objp.pos.x);
/*top */ /*top */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*bottom */ /*bottom */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*x right */ /*x right */
lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")); lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
/*top */ /*top */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") + objp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*mid */ /*mid */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*bottom */ /*bottom */
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
/*sliding from top left */ /*sliding from top left */
if (intrsx[6]!=null || intrsx[7]!=null || intrsx[8]!=null || intrsx[3]!=null || intrsx[0]!=null) { /* have to move */ if (intrsx[6]!=null || intrsx[7]!=null || intrsx[8]!=null || intrsx[3]!=null || intrsx[0]!=null) { /* have to move */
@ -716,19 +719,19 @@ UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // } UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
} }
/*sliding from bottom right */ /*sliding from bottom right */
lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")); lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); 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 (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? */ if (N(intrsx[1]) && N(intrsx[0])) { /* some room left? */
/* slide along lower edge */ /* slide along lower edge */
for (lp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") + objp.getStruct("sz").getDouble("x")), for (lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x),
lp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - lp.getStruct("sz").getDouble("y")); lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
lp.getStruct("pos").getDouble("x") >= (objp.getStruct("pos").getDouble("x") - lp.getStruct("sz").getDouble("x")); lp.getStruct().pos.x >= (objp.pos.x - lp.getStruct().sz.x);
lp.getStruct("pos").setDouble("x", lp.getStruct("pos").getDouble("x") - xincr)) { lp.getStruct().pos.setDouble("x", lp.getStruct().pos.x - xincr)) {
nbp.___(xlintersections(xlp, objp, intrsx)); nbp.___(xlintersections(xlp, objp, intrsx));
if (nbp.getInt("n") == 0) if (nbp.n == 0)
return nbp; return nbp;
if (nbp.getDouble("area") < bp.getDouble("area")) if (nbp.area < bp.area)
bp.___(nbp); bp.___(nbp);
} }
} }
@ -759,19 +762,19 @@ ENTERING("e29g2hwlogx0zchsnvi464c7t","xlhdxload");
try { try {
int i; int i;
int order = xlhorder(xlp); int order = xlhorder(xlp);
for (i = 0; i < xlp.getInt("n_objs"); i++) { for (i = 0; i < xlp.n_objs; i++) {
ST_HDict_t hp; ST_HDict_t hp;
final ST_point pi = new ST_point(); final ST_point pi = new ST_point();
hp = new ST_HDict_t(); hp = new ST_HDict_t();
hp.getStruct("d").setPtr("data", (__ptr__) xlp.getPtr("objs").plus(i).getStruct()); hp.d.child = xlp.objs.get(i);
hp.getStruct("d").setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.getPtr("objs").plus(i).getStruct())); hp.d.setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.objs.plus(i).getStruct()));
/* center of the labeling area */ /* center of the labeling area */
pi.setInt("x", hp.d.rect.boundary[0] + pi.setInt("x", hp.d.rect.boundary[0] +
(hp.d.rect.boundary[2] - hp.d.rect.boundary[0]) / 2); (hp.d.rect.boundary[2] - hp.d.rect.boundary[0]) / 2);
pi.setInt("y", hp.d.rect.boundary[1] + pi.setInt("y", hp.d.rect.boundary[1] +
(hp.d.rect.boundary[3] - hp.d.rect.boundary[1]) / 2); (hp.d.rect.boundary[3] - hp.d.rect.boundary[1]) / 2);
hp.setInt("key", hd_hil_s_from_xy(pi, order)); hp.setInt("key", hd_hil_s_from_xy(pi, order));
if (N(xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), hp, 0000001))) if (N(xlp.hdx.searchf.exe(xlp.hdx, hp, 0000001)))
return -1; return -1;
} }
return 0; return 0;
@ -816,16 +819,16 @@ public static int xlspdxload(ST_XLabels_t xlp) {
ENTERING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload"); ENTERING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload");
try { try {
ST_HDict_t op=null; ST_HDict_t op=null;
for (op = (ST_HDict_t) xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), null, 0000200); op!=null; for (op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, null, 0000200); op!=null;
op = (ST_HDict_t) xlp.getPtr("hdx").call("searchf", xlp.getPtr("hdx"), op, 0000010)) { op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, op, 0000010)) {
/* tree rectangle data node lvl */ /* tree rectangle data node lvl */
// RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0); // RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0);
// WARNING ARRAY // WARNING ARRAY
final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.getPtr("spdx").getPtr("root")}; final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.spdx.root};
RTreeInsert((ST_RTree) xlp.getPtr("spdx"), (ST_Rect_t)op.d.rect, RTreeInsert((ST_RTree) xlp.spdx, (ST_Rect_t)op.d.rect,
op.d.data, op.d.child,
tmp, 0); tmp, 0);
xlp.getPtr("spdx").setPtr("root", tmp[0]); xlp.spdx.setPtr("root", tmp[0]);
} }
return 0; return 0;
} finally { } finally {
@ -847,7 +850,7 @@ try {
if ((r = xlspdxload(xlp)) < 0) if ((r = xlspdxload(xlp)) < 0)
return r; return r;
xlhdxunload(xlp); xlhdxunload(xlp);
return dtclose((ST_dt_s) xlp.getPtr("hdx")); return dtclose((ST_dt_s) xlp.hdx);
} finally { } finally {
LEAVING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize"); LEAVING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize");
} }
@ -887,15 +890,15 @@ ST_XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
continue; continue;
xladjust(xlp, (ST_object_t) objs.get(i).getStruct()); xladjust(xlp, (ST_object_t) objs.get(i).getStruct());
bp.___(xladjust(xlp, (ST_object_t) objs.get(i).getStruct())); bp.___(xladjust(xlp, (ST_object_t) objs.get(i).getStruct()));
if (bp.getInt("n") == 0) { 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); objs.get(i).lbl.setInt("set", 1);
} else if(bp.getDouble("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;
} else if (params.force) { } else if (params.force) {
objs.get(i).lbl.getStruct("pos").setDouble("x", bp.getStruct("pos").getDouble("x")); objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x);
objs.get(i).lbl.getStruct("pos").setDouble("y", bp.getStruct("pos").getDouble("y")); objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y);
objs.get(i).lbl.setInt("set", 1); objs.get(i).lbl.setInt("set", 1);
} else { } else {
r = 1; r = 1;

View File

@ -242,8 +242,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -374,8 +374,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -377,8 +377,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
@ -1934,7 +1934,7 @@ UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
//fprintf (stderr, " size %d\n", pinfo->sz); //fprintf (stderr, " size %d\n", pinfo->sz);
//fprintf (stderr, " flags %d\n", pinfo->flags); //fprintf (stderr, " flags %d\n", pinfo->flags);
//} //}
return pinfo.getInt("mode"); return pinfo.mode;
} finally { } finally {
LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo"); LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
} }
@ -2009,7 +2009,7 @@ try {
pinfo.setInt("doSplines", 0); pinfo.setInt("doSplines", 0);
pinfo.setInt("fixed", 0); pinfo.setInt("fixed", 0);
getPackModeInfo(g, dflt, pinfo); getPackModeInfo(g, dflt, pinfo);
return pinfo.getInt("mode"); return pinfo.mode;
} finally { } finally {
LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo"); LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
} }

View File

@ -372,8 +372,8 @@ private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
try { try {
final ST_pointf r = new ST_pointf(); final ST_pointf r = new ST_pointf();
r.setDouble("x", p.getDouble("x") + q.getDouble("x")); r.setDouble("x", p.x + q.x);
r.setDouble("y", p.getDouble("y") + q.getDouble("y")); r.setDouble("y", p.y + q.y);
return r; return r;
} finally { } finally {
LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf"); LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");

View File

@ -52,6 +52,7 @@ import static smetana.core.JUtilsDebug.LEAVING;
import static smetana.core.Macro.DISTSQ; import static smetana.core.Macro.DISTSQ;
import static smetana.core.Macro.N; import static smetana.core.Macro.N;
import static smetana.core.Macro.UNSUPPORTED; import static smetana.core.Macro.UNSUPPORTED;
import h.ST_Pedge_t;
import h.ST_Ppoly_t; import h.ST_Ppoly_t;
import h.ST_pointf; import h.ST_pointf;
import h.ST_tna_t; import h.ST_tna_t;
@ -85,14 +86,14 @@ private static jmp_buf jbuf = new jmp_buf();
//3 9stmrdqlmufyk2wutp3totr5j //3 9stmrdqlmufyk2wutp3totr5j
// int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input, Ppoint_t * evs, Ppolyline_t * output) // int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input, Ppoint_t * evs, Ppolyline_t * output)
public static int Proutespline(__ptr__ edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) { public static int Proutespline(ST_Pedge_t.Array edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) {
// WARNING!! STRUCT // WARNING!! STRUCT
return Proutespline_w_(edges, edgen, (ST_Ppoly_t) 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 ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t 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"); ENTERING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
try { try {
__ptr__ inps; ST_pointf.Array inps;
int inpn; int inpn;
/* unpack into previous format rather than modify legacy code */ /* unpack into previous format rather than modify legacy code */
inps = input.ps; inps = input.ps;
@ -123,11 +124,11 @@ LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
// static int reallyroutespline(Pedge_t * edges, int edgen, Ppoint_t * inps, int inpn, Ppoint_t ev0, Ppoint_t ev1) // 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 __ptr__ tnas;
//private static int tnan; //private static int tnan;
public static int reallyroutespline(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final ST_pointf ev0, final ST_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 // WARNING!! STRUCT
return reallyroutespline_w_(edges, edgen, inps, inpn, ev0.copy(), ev1.copy()); 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 ST_pointf ev0, final ST_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"); ENTERING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline");
try { try {
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 p1 = new ST_pointf(), p2 = new ST_pointf(), cp1 = new ST_pointf(), cp2 = new ST_pointf(), p = new ST_pointf();
@ -146,12 +147,12 @@ try {
} }
Z.z().tnas.plus(0).getStruct().setDouble("t", 0); Z.z().tnas.plus(0).getStruct().setDouble("t", 0);
for (i = 1; i < inpn; i++) for (i = 1; i < inpn; i++)
Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().getDouble("t") + dist((ST_pointf)inps.plus(i).getStruct(), (ST_pointf)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++) 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++) { for (i = 0; i < inpn; i++) {
((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[0].____(scale(ev0, B1(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().getDouble("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, v1, p2, v2) == -1) if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1, v1, p2, v2) == -1)
return -1; return -1;
@ -160,9 +161,9 @@ try {
cp1.___(add(p1, scale(v1, 1 / 3.0))); cp1.___(add(p1, scale(v1, 1 / 3.0)));
cp2.___(sub(p2, scale(v2, 1 / 3.0))); cp2.___(sub(p2, scale(v2, 1 / 3.0)));
for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) { for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) {
t = Z.z().tnas.plus(i).getDouble("t"); t = Z.z().tnas.get(i).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("x", B0(t) * p1.x + B1(t) * cp1.x + B2(t) * cp2.x + B3(t) * p2.x);
p.setDouble("y", B0(t) * p1.getDouble("y") + B1(t) * cp1.getDouble("y") + B2(t) * cp2.getDouble("y") + B3(t) * p2.getDouble("y")); 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) if ((d = dist(p, (ST_pointf) inps.plus(i).getStruct())) > maxd)
{maxd = d; maxi = i;} {maxd = d; maxi = i;}
} }
@ -184,11 +185,11 @@ LEAVING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline");
//3 29sok6jkfyobf83q130snkhmh //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) // 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 ST_pointf ev0, final ST_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 // WARNING!! STRUCT
return mkspline_w_(inps, inpn, tnas, ev0.copy(), ev1.copy(), sp0, sv0, sp1, sv1); 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 ST_pointf ev0, final ST_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"); ENTERING("29sok6jkfyobf83q130snkhmh","mkspline");
try { try {
final ST_pointf tmp = new ST_pointf(); final ST_pointf tmp = new ST_pointf();
@ -205,8 +206,8 @@ try {
c[0][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]); 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][0] = c[0][1];
c[1][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]); 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().getDouble("t"))), 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().getDouble("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[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); x[1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], tmp);
} }
@ -237,7 +238,7 @@ LEAVING("29sok6jkfyobf83q130snkhmh","mkspline");
//3 ea6jsc0rwfyjtmmuxax6r5ngk //3 ea6jsc0rwfyjtmmuxax6r5ngk
// static double dist_n(Ppoint_t * p, int n) // 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"); ENTERING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n");
try { try {
int i; int i;
@ -245,8 +246,8 @@ try {
rv = 0.0; rv = 0.0;
for (i = 1; i < n; i++) { for (i = 1; i < n; i++) {
rv += 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"))+ 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().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y")) * (p.plus(i).getStruct().getDouble("y") - p.plus(i - 1).getStruct().getDouble("y"))); (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y) * (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y));
} }
return rv; return rv;
} finally { } finally {
@ -259,11 +260,11 @@ LEAVING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n");
//3 987ednrgu5qo9dzhpiox47mhb //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) // 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 ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_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 // WARNING!! STRUCT
return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), inps, inpn); 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 ST_pointf pa, final ST_pointf va, final ST_pointf pb, final ST_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"); ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits");
try { try {
final ST_pointf.Array sps = new ST_pointf.Array( 4); final ST_pointf.Array sps = new ST_pointf.Array( 4);
@ -274,14 +275,14 @@ try {
forceflag = (inpn == 2 ? 1 : 0); forceflag = (inpn == 2 ? 1 : 0);
a = b = 4; a = b = 4;
for (;;) { for (;;) {
sps.plus(0).getStruct().setDouble("x", pa.getDouble("x")); sps.plus(0).getStruct().setDouble("x", pa.x);
sps.plus(0).getStruct().setDouble("y", pa.getDouble("y")); sps.plus(0).getStruct().setDouble("y", pa.y);
sps.plus(1).getStruct().setDouble("x", pa.getDouble("x") + a * va.getDouble("x") / 3.0); sps.plus(1).getStruct().setDouble("x", pa.x + a * va.x / 3.0);
sps.plus(1).getStruct().setDouble("y", pa.getDouble("y") + a * va.getDouble("y") / 3.0); sps.plus(1).getStruct().setDouble("y", pa.y + a * va.y / 3.0);
sps.plus(2).getStruct().setDouble("x", pb.getDouble("x") - b * vb.getDouble("x") / 3.0); sps.plus(2).getStruct().setDouble("x", pb.x - b * vb.x / 3.0);
sps.plus(2).getStruct().setDouble("y", pb.getDouble("y") - b * vb.getDouble("y") / 3.0); sps.plus(2).getStruct().setDouble("y", pb.y - b * vb.y / 3.0);
sps.plus(3).getStruct().setDouble("x", pb.getDouble("x")); sps.plus(3).getStruct().setDouble("x", pb.x);
sps.plus(3).getStruct().setDouble("y", pb.getDouble("y")); sps.plus(3).getStruct().setDouble("y", pb.y);
/* shortcuts (paths shorter than the shortest path) not allowed - /* shortcuts (paths shorter than the shortest path) not allowed -
* they must be outside the constraint polygon. this can happen * they must be outside the constraint polygon. this can happen
* if the candidate spline intersects the constraint polygon exactly * if the candidate spline intersects the constraint polygon exactly
@ -295,8 +296,8 @@ try {
if (splineisinside(edges, edgen, sps)) { if (splineisinside(edges, edgen, sps)) {
growops(Z.z().opl + 4); growops(Z.z().opl + 4);
for (pi = 1; pi < 4; pi++) { 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("x", sps.plus(pi).getStruct().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("y", sps.plus(pi).getStruct().y);
Z.z().opl++; Z.z().opl++;
} }
return 1; return 1;
@ -306,8 +307,8 @@ try {
growops(Z.z().opl + 4); growops(Z.z().opl + 4);
for (pi = 1; pi < 4; pi++) 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("x", sps.plus(pi).getStruct().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("y", sps.plus(pi).getStruct().y);
Z.z().opl++; Z.z().opl++;
} }
return 1; return 1;
@ -333,7 +334,7 @@ LEAVING("987ednrgu5qo9dzhpiox47mhb","splinefits");
//3 b6eghkeu16aum3l778ig52ht1 //3 b6eghkeu16aum3l778ig52ht1
// static int splineisinside(Pedge_t * edges, int edgen, Ppoint_t * sps) // static int splineisinside(Pedge_t * edges, int edgen, Ppoint_t * sps)
public static boolean splineisinside(__ptr__ edges, int edgen, ST_pointf.Array sps) { public static boolean splineisinside(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array sps) {
ENTERING("b6eghkeu16aum3l778ig52ht1","splineisinside"); ENTERING("b6eghkeu16aum3l778ig52ht1","splineisinside");
try { try {
double roots[] = new double[4]; double roots[] = new double[4];
@ -343,8 +344,8 @@ try {
final ST_pointf ip = new ST_pointf(); final ST_pointf ip = new ST_pointf();
double t, ta, tb, tc, td; double t, ta, tb, tc, td;
for (ei = 0; ei < edgen; ei++) { for (ei = 0; ei < edgen; ei++) {
lps.plus(0).setStruct(edges.plus(ei).getStruct("a")); lps.plus(0).setStruct(edges.get(ei).a);
lps.plus(1).setStruct(edges.plus(ei).getStruct("b")); lps.plus(1).setStruct(edges.get(ei).b);
/* if ((rootn = splineintersectsline (sps, lps, roots)) == 4) /* if ((rootn = splineintersectsline (sps, lps, roots)) == 4)
return 1; */ return 1; */
if ((rootn = splineintersectsline(sps, lps, roots)) == 4) if ((rootn = splineintersectsline(sps, lps, roots)) == 4)
@ -357,10 +358,10 @@ try {
tc = 3 * t * t * (1 - t); tc = 3 * t * t * (1 - t);
tb = 3 * t * (1 - t) * (1 - t); tb = 3 * t * (1 - t) * (1 - t);
ta = (1 - 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") + ip.setDouble("x", ta * sps.get(0).x + tb * sps.get(1).x +
tc * sps.plus(2).getDouble("x") + td * sps.plus(3).getDouble("x")); tc * sps.get(2).x + td * sps.get(3).x);
ip.setDouble("y", ta * sps.plus(0).getDouble("y") + tb * sps.plus(1).getDouble("y") + ip.setDouble("y", ta * sps.get(0).y + tb * sps.get(1).y +
tc * sps.plus(2).getDouble("y") + td * sps.plus(3).getDouble("y")); tc * sps.get(2).y + td * sps.get(3).y);
if (DISTSQ(ip, lps.plus(0).getStruct()) < 1E-3 || if (DISTSQ(ip, lps.plus(0).getStruct()) < 1E-3 ||
DISTSQ(ip, lps.plus(1).getStruct()) < 1E-3) DISTSQ(ip, lps.plus(1).getStruct()) < 1E-3)
continue; continue;
@ -389,17 +390,17 @@ try {
double tv, sv, rat; double tv, sv, rat;
int rootn[] = new int[]{0}; int rootn[] = new int[]{0};
int xrootn, yrootn, i, j; int xrootn, yrootn, i, j;
xcoeff[0] = lps.plus(0).getStruct().getDouble("x"); xcoeff[0] = lps.plus(0).getStruct().x;
xcoeff[1] = lps.plus(1).getStruct().getDouble("x") - lps.plus(0).getStruct().getDouble("x"); xcoeff[1] = lps.plus(1).getStruct().x - lps.plus(0).getStruct().x;
ycoeff[0] = lps.plus(0).getStruct().getDouble("y"); ycoeff[0] = lps.plus(0).getStruct().y;
ycoeff[1] = lps.plus(1).getStruct().getDouble("y") - lps.plus(0).getStruct().getDouble("y"); ycoeff[1] = lps.plus(1).getStruct().y - lps.plus(0).getStruct().y;
rootn[0] = 0; rootn[0] = 0;
if (xcoeff[1] == 0) { if (xcoeff[1] == 0) {
if (ycoeff[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]; scoeff[0] -= xcoeff[0];
xrootn = solve3(scoeff, xroots); 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]; scoeff[0] -= ycoeff[0];
yrootn = solve3(scoeff, yroots); yrootn = solve3(scoeff, yroots);
if (xrootn == 4) if (xrootn == 4)
@ -418,7 +419,7 @@ try {
addroot(xroots[i], roots, rootn); addroot(xroots[i], roots, rootn);
return rootn[0]; return rootn[0];
} else { } 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]; scoeff[0] -= xcoeff[0];
xrootn = solve3(scoeff, xroots); xrootn = solve3(scoeff, xroots);
if (xrootn == 4) if (xrootn == 4)
@ -426,7 +427,7 @@ try {
for (i = 0; i < xrootn; i++) { for (i = 0; i < xrootn; i++) {
tv = xroots[i]; tv = xroots[i];
if (tv >= 0 && tv <= 1) { 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); scoeff);
sv = scoeff[0] + tv * (scoeff[1] + tv * sv = scoeff[0] + tv * (scoeff[1] + tv *
(scoeff[2] + tv * scoeff[3])); (scoeff[2] + tv * scoeff[3]));
@ -439,8 +440,8 @@ try {
} }
} else { } else {
rat = ycoeff[1] / xcoeff[1]; 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"), 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().getDouble("y") - rat * sps.plus(2).getStruct().getDouble("x"), sps.plus(3).getStruct().getDouble("y") - rat * sps.plus(3).getStruct().getDouble("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);
scoeff[0] += rat * xcoeff[0] - ycoeff[0]; scoeff[0] += rat * xcoeff[0] - ycoeff[0];
xrootn = solve3(scoeff, xroots); xrootn = solve3(scoeff, xroots);
@ -449,7 +450,7 @@ try {
for (i = 0; i < xrootn; i++) { for (i = 0; i < xrootn; i++) {
tv = xroots[i]; tv = xroots[i];
if (tv >= 0 && tv <= 1) { 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); scoeff);
sv = scoeff[0] + tv * (scoeff[1] + sv = scoeff[0] + tv * (scoeff[1] +
tv * (scoeff[2] + tv * scoeff[3])); tv * (scoeff[2] + tv * scoeff[3]));
@ -512,11 +513,11 @@ private static ST_pointf normv_w_(final ST_pointf v) {
ENTERING("3i8m1m9fg7qmnt8jloorwlu8e","normv"); ENTERING("3i8m1m9fg7qmnt8jloorwlu8e","normv");
try { try {
double d; 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) { if (d > 1e-6) {
d = sqrt(d); d = sqrt(d);
v.setDouble("x", v.getDouble("x") / d); v.setDouble("x", v.x / d);
v.setDouble("y", v.getDouble("y") / d); v.setDouble("y", v.y / d);
} }
return v; return v;
} finally { } finally {
@ -563,8 +564,8 @@ return add_w_(p1.copy(), p2.copy()).copy();
private static ST_pointf add_w_(final ST_pointf p1, final ST_pointf p2) { private static ST_pointf add_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("f4a7nt247bokdwr2owda050of","add"); ENTERING("f4a7nt247bokdwr2owda050of","add");
try { try {
p1.setDouble("x", p1.getDouble("x") + p2.getDouble("x")); p1.setDouble("x", p1.x + p2.x);
p1.setDouble("y", p1.getDouble("y") + p2.getDouble("y")); p1.setDouble("y", p1.y + p2.y);
return p1; return p1;
} finally { } finally {
LEAVING("f4a7nt247bokdwr2owda050of","add"); LEAVING("f4a7nt247bokdwr2owda050of","add");
@ -583,8 +584,8 @@ return sub_w_(p1.copy(), p2.copy()).copy();
private static ST_pointf sub_w_(final ST_pointf p1, final ST_pointf p2) { private static ST_pointf sub_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("c4l1gvlkv2s4mi6os7r9dh89f","sub"); ENTERING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
try { try {
p1.setDouble("x", p1.getDouble("x") - p2.getDouble("x")); p1.setDouble("x", p1.x - p2.x);
p1.setDouble("y", p1.getDouble("y") - p2.getDouble("y")); p1.setDouble("y", p1.y - p2.y);
return p1; return p1;
} finally { } finally {
LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub"); LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
@ -604,8 +605,8 @@ private static double dist_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("dqnlz0tceriykws4ngudl94w9","dist"); ENTERING("dqnlz0tceriykws4ngudl94w9","dist");
try { try {
double dx, dy; double dx, dy;
dx = p2.getDouble("x") - p1.getDouble("x"); dx = p2.x - p1.x;
dy = p2.getDouble("y") - p1.getDouble("y"); dy = p2.y - p1.y;
return sqrt(dx * dx + dy * dy); return sqrt(dx * dx + dy * dy);
} finally { } finally {
LEAVING("dqnlz0tceriykws4ngudl94w9","dist"); LEAVING("dqnlz0tceriykws4ngudl94w9","dist");
@ -624,8 +625,8 @@ return scale_w_(p.copy(), c).copy();
private static ST_pointf scale_w_(final ST_pointf p, double c) { private static ST_pointf scale_w_(final ST_pointf p, double c) {
ENTERING("19149pdllzhplvew0bsh5v6hy","scale"); ENTERING("19149pdllzhplvew0bsh5v6hy","scale");
try { try {
p.setDouble("x", p.getDouble("x") * c); p.setDouble("x", p.x * c);
p.setDouble("y", p.getDouble("y") * c); p.setDouble("y", p.y * c);
return p; return p;
} finally { } finally {
LEAVING("19149pdllzhplvew0bsh5v6hy","scale"); LEAVING("19149pdllzhplvew0bsh5v6hy","scale");
@ -644,7 +645,7 @@ return dot_w_(p1.copy(), p2.copy());
private static double dot_w_(final ST_pointf p1, final ST_pointf p2) { private static double dot_w_(final ST_pointf p1, final ST_pointf p2) {
ENTERING("7ebsa2s1eoopqj1pp43bh5fw","dot"); ENTERING("7ebsa2s1eoopqj1pp43bh5fw","dot");
try { try {
return p1.getDouble("x") * p2.getDouble("x") + p1.getDouble("y") * p2.getDouble("y"); return p1.x * p2.x + p1.y * p2.y;
} finally { } finally {
LEAVING("7ebsa2s1eoopqj1pp43bh5fw","dot"); LEAVING("7ebsa2s1eoopqj1pp43bh5fw","dot");
} }

View File

@ -130,31 +130,31 @@ try {
Z.z().dq.lpnlpi = Z.z().dq.fpnlpi - 1; Z.z().dq.lpnlpi = Z.z().dq.fpnlpi - 1;
/* make sure polygon is CCW and load pnls array */ /* make sure polygon is CCW and load pnls array */
for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.pn; pi++) { for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.pn; pi++) {
if (minx > polyp.ps.get(pi).getDouble("x")) if (minx > polyp.ps.get(pi).x)
{ minx = polyp.ps.get(pi).getDouble("x"); { minx = polyp.ps.get(pi).x;
minpi = pi; } minpi = pi; }
} }
p2.____(polyp.ps.plus(minpi)); p2.____(polyp.ps.plus(minpi));
p1.____(polyp.ps.plus(((minpi == 0) ? polyp.pn - 1 : minpi - 1))); p1.____(polyp.ps.plus(((minpi == 0) ? polyp.pn - 1 : minpi - 1)));
p3.____(polyp.ps.plus(((minpi == polyp.pn - 1) ? 0 : minpi + 1))); p3.____(polyp.ps.plus(((minpi == polyp.pn - 1) ? 0 : minpi + 1)));
if (((p1.getDouble("x") == p2.getDouble("x") && p2.getDouble("x") == p3.getDouble("x")) && (p3.getDouble("y") > p2.getDouble("y"))) || if (((p1.x == p2.x && p2.x == p3.x) && (p3.y > p2.y)) ||
ccw(p1, p2, p3) != 1) { ccw(p1, p2, p3) != 1) {
for (pi = polyp.pn - 1; pi >= 0; pi--) { for (pi = polyp.pn - 1; pi >= 0; pi--) {
if (pi < polyp.pn - 1 if (pi < polyp.pn - 1
&& polyp.ps.plus(pi).getDouble("x") == polyp.ps.plus(pi+1).getDouble("x") && polyp.ps.get(pi).x == polyp.ps.get(pi+1).x
&& polyp.ps.plus(pi).getDouble("y") == polyp.ps.plus(pi+1).getDouble("y")) && polyp.ps.get(pi).y == polyp.ps.get(pi+1).y)
continue; continue;
Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.plus(pi).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().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().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
Z.z().pnll++; Z.z().pnll++;
} }
} else { } else {
for (pi = 0; pi < polyp.pn; pi++) { for (pi = 0; pi < polyp.pn; pi++) {
if (pi > 0 && polyp.ps.plus(pi).getDouble("x") == polyp.ps.plus(pi - 1).getDouble("x") && if (pi > 0 && polyp.ps.get(pi).x == polyp.ps.get(pi - 1).x &&
polyp.ps.plus(pi).getDouble("y") == polyp.ps.plus(pi - 1).getDouble("y")) polyp.ps.get(pi).y == polyp.ps.get(pi - 1).y)
continue; continue;
Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.plus(pi).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().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().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
Z.z().pnll++; Z.z().pnll++;
@ -168,7 +168,7 @@ try {
connecttris(trii, trij); connecttris(trii, trij);
/* find first and last triangles */ /* find first and last triangles */
for (trii = 0; trii < Z.z().tril; trii++) for (trii = 0; trii < Z.z().tril; trii++)
if (pointintri(trii, (__ptr__) eps.plus(0).getStruct())) if (pointintri(trii, eps.plus(0).getStruct()))
break; break;
if (trii == Z.z().tril) { 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")); UNSUPPORTED("4ma3y8l4lmjcsw49kmsgknig6"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("source point not in any triangle"));
@ -176,7 +176,7 @@ UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
} }
ftrii = trii; ftrii = trii;
for (trii = 0; trii < Z.z().tril; trii++) for (trii = 0; trii < Z.z().tril; trii++)
if (pointintri(trii, (__ptr__) eps.plus(1).getStruct())) if (pointintri(trii, eps.plus(1).getStruct()))
break; break;
if (trii == Z.z().tril) { 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")); System.err.println("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("destination point not in any triangle"));
@ -203,9 +203,9 @@ UNSUPPORTED("3rcg6c9s9nmostq9c3r5n6x4h"); // output->ps = ops;
UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0; UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
} }
/* build funnel and shortest path linked list (in add2dq) */ /* build funnel and shortest path linked list (in add2dq) */
epnls[0].pp = (ST_pointf) ((ST_pointf)eps.plus(0).asPtr().getPtr()); epnls[0].pp = eps.get(0);
epnls[0].link = null; epnls[0].link = null;
epnls[1].pp = (ST_pointf) ((ST_pointf)eps.plus(1).asPtr().getPtr()); epnls[1].pp = eps.get(1);
epnls[1].link = null; epnls[1].link = null;
add2dq(1, epnls[0]); add2dq(1, epnls[0]);
Z.z().dq.apex = Z.z().dq.fpnlpi; Z.z().dq.apex = Z.z().dq.fpnlpi;
@ -216,10 +216,10 @@ UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
/* find the left and right points of the exiting edge */ /* find the left and right points of the exiting edge */
for (ei = 0; ei < 3; ei++) for (ei = 0; ei < 3; ei++)
if (trip.get(0).e[ei].rtp!=null && if (trip.get(0).e[ei].rtp!=null &&
trip.get(0).e[ei].rtp.get(0).getInt("mark") == 1) trip.get(0).e[ei].rtp.get(0).mark == 1)
break; break;
if (ei == 3) { /* in last triangle */ if (ei == 3) { /* in last triangle */
if (ccw(eps.plus(1).asPtr(), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp, if (ccw(eps.get(1), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp,
Z.z().dq.pnlps[Z.z().dq.lpnlpi].pp) == 1) Z.z().dq.pnlps[Z.z().dq.lpnlpi].pp) == 1)
{ {
lpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi]; lpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
@ -266,7 +266,7 @@ UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp
trii = -1; trii = -1;
for (ei = 0; ei < 3; ei++) for (ei = 0; ei < 3; ei++)
if (trip.get(0).e[ei].rtp!=null && if (trip.get(0).e[ei].rtp!=null &&
trip.get(0).e[ei].rtp.get(0).getInt("mark") == 1) { trip.get(0).e[ei].rtp.get(0).mark == 1) {
trii = trip.get(0).e[ei].rtp.minus(Z.z().tris); trii = trip.get(0).e[ei].rtp.minus(Z.z().tris);
break; break;
} }
@ -521,12 +521,12 @@ LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
//3 72h03s8inxtto2ekvmuqjtj3d //3 72h03s8inxtto2ekvmuqjtj3d
// static int ccw(Ppoint_t * p1p, Ppoint_t * p2p, Ppoint_t * p3p) // 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"); ENTERING("72h03s8inxtto2ekvmuqjtj3d","ccw");
try { try {
double d; double d;
d = ((p1p.getDouble("y") - p2p.getDouble("y")) * (p3p.getDouble("x") - p2p.getDouble("x"))) - d = ((p1p.y - p2p.y) * (p3p.x - p2p.x)) -
((p3p.getDouble("y") - p2p.getDouble("y")) * (p1p.getDouble("x") - p2p.getDouble("x"))); ((p3p.y - p2p.y) * (p1p.x - p2p.x));
return (d > 0) ? 1 : ((d < 0) ? 2 : 3); return (d > 0) ? 1 : ((d < 0) ? 2 : 3);
} finally { } finally {
LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw"); LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw");
@ -538,7 +538,7 @@ LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw");
//3 22a9ajg9t8ovqsigk3tyu3rkd //3 22a9ajg9t8ovqsigk3tyu3rkd
// static int intersects(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp, Ppoint_t * pdp) // 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"); ENTERING("22a9ajg9t8ovqsigk3tyu3rkd","intersects");
try { try {
int ccw1, ccw2, ccw3, ccw4; int ccw1, ccw2, ccw3, ccw4;
@ -565,18 +565,18 @@ LEAVING("22a9ajg9t8ovqsigk3tyu3rkd","intersects");
//3 uh5n18rzyevtb4cwpni70qpc //3 uh5n18rzyevtb4cwpni70qpc
// static int between(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp) // 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"); ENTERING("uh5n18rzyevtb4cwpni70qpc","between");
try { try {
final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(); final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf();
p1.setDouble("x", pbp.getDouble("x") - pap.getDouble("x")); p1.setDouble("x", pbp.x - pap.x);
p1.setDouble("y", pbp.getDouble("y") - pap.getDouble("y")); p1.setDouble("y", pbp.y - pap.y);
p2.setDouble("x", pcp.getDouble("x") - pap.getDouble("x")); p2.setDouble("x", pcp.x - pap.x);
p2.setDouble("y", pcp.getDouble("y") - pap.getDouble("y")); p2.setDouble("y", pcp.y - pap.y);
if (ccw(pap, pbp, pcp) != 3) if (ccw(pap, pbp, pcp) != 3)
return false; return false;
return (p2.getDouble("x") * p1.getDouble("x") + p2.getDouble("y") * p1.getDouble("y") >= 0) && return (p2.x * p1.x + p2.y * p1.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")); (p2.x * p2.x + p2.y * p2.y <= p1.x * p1.x + p1.y * p1.y);
} finally { } finally {
LEAVING("uh5n18rzyevtb4cwpni70qpc","between"); LEAVING("uh5n18rzyevtb4cwpni70qpc","between");
} }
@ -587,7 +587,7 @@ LEAVING("uh5n18rzyevtb4cwpni70qpc","between");
//3 zti1mzm2m7tr2xwnbf7e8u3d //3 zti1mzm2m7tr2xwnbf7e8u3d
// static int pointintri(int trii, Ppoint_t * pp) // 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"); ENTERING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri");
try { try {
int ei, sum; int ei, sum;

View File

@ -1,57 +0,0 @@
/* ========================================================================
* PlantUML : a free UML diagram generator
* ========================================================================
*
* Project Info: http://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* http://plantuml.com/patreon (only 1$ per month!)
* http://plantuml.com/paypal
*
* This file is part of Smetana.
* Smetana is a partial translation of Graphviz/Dot sources from C to Java.
*
* (C) Copyright 2009-2017, Arnaud Roques
*
* This translation is distributed under the same Licence as the original C program:
*
*************************************************************************
* Copyright (c) 2011 AT&T Intellectual Property
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors: See CVS logs. Details at http://www.graphviz.org/
*************************************************************************
*
* THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
* LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
*
* ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
* RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
*
* You may obtain a copy of the License at
*
* http://www.eclipse.org/legal/epl-v10.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
package h;
import java.util.Arrays;
import java.util.List;
//2 1tob3f90syune1bxwbffctfmj
public interface Dthold_t extends _dthold_s {
public static List<String> DEFINITION = Arrays.asList(
"typedef struct _dthold_s Dthold_t");
}
// typedef struct _dthold_s Dthold_t;

View File

@ -47,7 +47,6 @@ package h;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__; import smetana.core.__ptr__;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct; import smetana.core.amiga.StarStruct;
public class ST_Agclos_s extends UnsupportedStructAndPtr { public class ST_Agclos_s extends UnsupportedStructAndPtr {
@ -77,30 +76,6 @@ public class ST_Agclos_s extends UnsupportedStructAndPtr {
return parent; return parent;
} }
@Override
public boolean getBoolean(String fieldName) {
if (fieldName.equals("callbacks_enabled")) {
return callbacks_enabled;
}
return super.getBoolean(fieldName);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("strdict")) {
return strdict;
}
if (fieldName.equals("cb")) {
return cb;
}
if (fieldName.equals("disc")) {
return disc;
}
if (fieldName.equals("state")) {
return state;
}
return super.getPtr(fieldName);
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
@ -111,26 +86,6 @@ public class ST_Agclos_s extends UnsupportedStructAndPtr {
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("disc")) {
return disc;
}
if (fieldName.equals("state")) {
return state;
}
return super.getStruct(fieldName);
}
@Override
public void setBoolean(String fieldName, boolean data) {
if (fieldName.equals("callbacks_enabled")) {
this.callbacks_enabled = data;
return;
}
super.setBoolean(fieldName, data);
}
// public interface ST_Agclos_s extends __ptr__ { // public interface ST_Agclos_s extends __ptr__ {
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agclos_s", // "struct Agclos_s",

View File

@ -45,7 +45,6 @@
*/ */
package h; package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__; import smetana.core.__ptr__;
import smetana.core.amiga.StarStruct; import smetana.core.amiga.StarStruct;
@ -53,9 +52,9 @@ import smetana.core.amiga.StarStruct;
public class ST_Agdatadict_s extends UnsupportedStructAndPtr { public class ST_Agdatadict_s extends UnsupportedStructAndPtr {
private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */ private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */
public ST_dt_s n; public ST_dt_s dict_n;
public ST_dt_s e; public ST_dt_s dict_e;
public ST_dt_s g; public ST_dt_s dict_g;
private final StarStruct parent; private final StarStruct parent;
@ -74,34 +73,20 @@ public class ST_Agdatadict_s extends UnsupportedStructAndPtr {
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("dict.n")) { if (fieldName.equals("dict.n")) {
this.n = (ST_dt_s) newData; this.dict_n = (ST_dt_s) newData;
return n; return dict_n;
} }
if (fieldName.equals("dict.e")) { if (fieldName.equals("dict.e")) {
this.e = (ST_dt_s) newData; this.dict_e = (ST_dt_s) newData;
return e; return dict_e;
} }
if (fieldName.equals("dict.g")) { if (fieldName.equals("dict.g")) {
this.g = (ST_dt_s) newData; this.dict_g = (ST_dt_s) newData;
return g; return dict_g;
} }
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("dict.n")) {
return n;
}
if (fieldName.equals("dict.e")) {
return e;
}
if (fieldName.equals("dict.g")) {
return g;
}
return super.getPtr(fieldName);
}
@Override @Override
public __ptr__ castTo(Class dest) { public __ptr__ castTo(Class dest) {
if (dest == ST_Agrec_s.class) { if (dest == ST_Agrec_s.class) {

View File

@ -86,16 +86,6 @@ public class ST_Agdisc_s extends UnsupportedStructAndPtr {
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("mem")) {
return mem;
}
if (fieldName.equals("id")) {
return id;
}
return super.getPtr(fieldName);
}
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agdisc_s", // "struct Agdisc_s",

View File

@ -81,16 +81,6 @@ public class ST_Agdstate_s extends UnsupportedStructAndPtr {
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("mem")) {
return mem;
}
if (fieldName.equals("id")) {
return id;
}
return super.getPtr(fieldName);
}
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agdstate_s", // "struct Agdstate_s",

View File

@ -51,7 +51,6 @@ import java.util.List;
import smetana.core.HardcodedStruct; import smetana.core.HardcodedStruct;
import smetana.core.OFFSET; import smetana.core.OFFSET;
import smetana.core.UnsupportedArrayOfPtr; import smetana.core.UnsupportedArrayOfPtr;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__; import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__; import smetana.core.__ptr__;
@ -103,6 +102,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr
public ArrayOfStar plus(int delta) { public ArrayOfStar plus(int delta) {
return new ArrayOfStar(data, pos + delta); return new ArrayOfStar(data, pos + delta);
} }
public ST_Agedge_s get(int i) {
return plus(i).getPtr();
}
@Override @Override
public ArrayOfStar asPtr() { public ArrayOfStar asPtr() {
@ -134,6 +138,7 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr
} }
return this.pos == other.pos; return this.pos == other.pos;
} }
} }
@Override @Override
@ -198,6 +203,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr
} }
return super.castTo(dest); return super.castTo(dest);
} }
public ST_Agobj_s castTo_ST_Agobj_s() {
return base;
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
@ -208,27 +218,11 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("node")) {
return node;
}
return super.getPtr(fieldName);
}
@Override @Override
public ST_Agedge_s getPtr() { public ST_Agedge_s getPtr() {
return this; return this;
} }
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("base")) {
return base;
}
return super.getStruct(fieldName);
}
public StarStruct from_seq_link(ST_dtlink_s from) { public StarStruct from_seq_link(ST_dtlink_s from) {
if (from == seq_link) { if (from == seq_link) {
return this; return this;
@ -243,6 +237,7 @@ public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStr
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
// public interface ST_Agedge_s extends __ptr__ { // public interface ST_Agedge_s extends __ptr__ {
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agedge_s", // "struct Agedge_s",

View File

@ -45,7 +45,6 @@
*/ */
package h; package h;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__; import smetana.core.__ptr__;
import smetana.core.__struct__; import smetana.core.__struct__;
@ -138,15 +137,6 @@ public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr {
super.setStruct(fieldName, newData); super.setStruct(fieldName, newData);
} }
@Override
public void setBoolean(String fieldName, boolean data) {
if (fieldName.equals("label_ontop")) {
this.label_ontop = data;
return;
}
super.setBoolean(fieldName, data);
}
@Override @Override
public void setDouble(String fieldName, double data) { public void setDouble(String fieldName, double data) {
if (fieldName.equals("dist")) { if (fieldName.equals("dist")) {
@ -197,93 +187,6 @@ public class ST_Agedgeinfo_t extends UnsupportedStructAndPtr {
super.setInt(fieldName, data); super.setInt(fieldName, data);
} }
@Override
public double getDouble(String fieldName) {
if (fieldName.equals("dist")) {
return this.dist;
}
return super.getDouble(fieldName);
}
@Override
public boolean getBoolean(String fieldName) {
if (fieldName.equals("conc_opp_flag")) {
return this.conc_opp_flag;
}
if (fieldName.equals("label_ontop")) {
return this.label_ontop;
}
return super.getBoolean(fieldName);
}
@Override
public int getInt(String fieldName) {
if (fieldName.equals("minlen")) {
return this.minlen;
}
if (fieldName.equals("weight")) {
return this.weight;
}
if (fieldName.equals("cutvalue")) {
return this.cutvalue;
}
if (fieldName.equals("tree_index")) {
return this.tree_index;
}
if (fieldName.equals("count")) {
return this.count;
}
if (fieldName.equals("xpenalty")) {
return this.xpenalty;
}
if (fieldName.equals("showboxes")) {
return this.showboxes;
}
if (fieldName.equals("edge_type")) {
return this.edge_type;
}
if (fieldName.equals("adjacent")) {
return this.adjacent;
}
return super.getInt(fieldName);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("to_virt")) {
return this.to_virt;
}
if (fieldName.equals("to_orig")) {
return this.to_orig;
}
if (fieldName.equals("label")) {
return this.label;
}
if (fieldName.equals("spl")) {
return this.spl;
}
if (fieldName.equals("xlabel")) {
return this.xlabel;
}
if (fieldName.equals("head_label")) {
return this.head_label;
}
if (fieldName.equals("tail_label")) {
return this.tail_label;
}
return super.getPtr(fieldName);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("tail_port")) {
return this.tail_port;
}
if (fieldName.equals("head_port")) {
return this.head_port;
}
return super.getStruct(fieldName);
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {

View File

@ -46,9 +46,7 @@
package h; package h;
import smetana.core.HardcodedStruct; import smetana.core.HardcodedStruct;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__struct__;
import smetana.core.amiga.StarStruct; import smetana.core.amiga.StarStruct;
public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct { public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct {
@ -66,17 +64,6 @@ public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements Hardcode
this.parent = parent; this.parent = parent;
} }
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("out")) {
return out;
}
if (fieldName.equals("in")) {
return in;
}
return super.getStruct(fieldName);
}
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agedgepair_s", // "struct Agedgepair_s",
// "{", // "{",

View File

@ -47,7 +47,6 @@ package h;
import smetana.core.CFunction; import smetana.core.CFunction;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__;
public class ST_Agiddisc_s extends UnsupportedStructAndPtr { public class ST_Agiddisc_s extends UnsupportedStructAndPtr {
@ -59,30 +58,6 @@ public class ST_Agiddisc_s extends UnsupportedStructAndPtr {
public CFunction close; public CFunction close;
public CFunction idregister; public CFunction idregister;
@Override
public Object call(String fieldName, Object... args) {
if (fieldName.equals("open")) {
return open.exe(args);
}
if (fieldName.equals("map")) {
return map.exe(args);
}
if (fieldName.equals("idregister")) {
return idregister.exe(args);
}
if (fieldName.equals("print")) {
return print.exe(args);
}
return super.call(fieldName, args);
}
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("print")) {
return print;
}
return super.getPtr(fieldName);
}
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agiddisc_s", // "struct Agiddisc_s",

View File

@ -46,9 +46,7 @@
package h; package h;
import smetana.core.CFunction; import smetana.core.CFunction;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.amiga.StarStruct;
public class ST_Agmemdisc_s extends UnsupportedStructAndPtr { public class ST_Agmemdisc_s extends UnsupportedStructAndPtr {
@ -58,20 +56,6 @@ public class ST_Agmemdisc_s extends UnsupportedStructAndPtr {
public CFunction free; public CFunction free;
public CFunction close; public CFunction close;
@Override
public Object call(String fieldName, Object... args) {
if (fieldName.equals("open")) {
return open.exe(args);
}
if (fieldName.equals("alloc")) {
return alloc.exe(args);
}
if (fieldName.equals("resize")) {
return resize.exe(args);
}
return super.call(fieldName, args);
}
// public static List<String> DEFINITION = Arrays.asList( // public static List<String> DEFINITION = Arrays.asList(
// "struct Agmemdisc_s", // "struct Agmemdisc_s",
// "{", // "{",

View File

@ -48,7 +48,6 @@ package h;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import smetana.core.CString;
import smetana.core.UnsupportedArrayOfPtr; import smetana.core.UnsupportedArrayOfPtr;
import smetana.core.UnsupportedArrayOfStruct2; import smetana.core.UnsupportedArrayOfStruct2;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
@ -112,6 +111,10 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr {
public void setPtr(__ptr__ value) { public void setPtr(__ptr__ value) {
this.data.set(pos, (ST_Agnode_s) value); this.data.set(pos, (ST_Agnode_s) value);
} }
public ST_Agnode_s get(int i) {
return plus(i).getPtr();
}
@Override @Override
public ST_Agnode_s getPtr() { public ST_Agnode_s getPtr() {
@ -211,13 +214,6 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr {
throw new UnsupportedOperationException(getClass().toString()); throw new UnsupportedOperationException(getClass().toString());
} }
public CString getCString() {
throw new UnsupportedOperationException(getClass().toString());
}
public void setCString(CString value) {
throw new UnsupportedOperationException(getClass().toString());
}
} }
@ -243,6 +239,10 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr {
} }
return super.castTo(dest); return super.castTo(dest);
} }
public ST_Agobj_s castTo_ST_Agobj_s() {
return base;
}
@Override @Override
public boolean isSameThan(StarStruct other) { public boolean isSameThan(StarStruct other) {
@ -250,17 +250,6 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr {
return this == other2; return this == other2;
} }
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("base")) {
return base;
}
if (fieldName.equals("mainsub")) {
return mainsub;
}
return super.getStruct(fieldName);
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("root")) { if (fieldName.equals("root")) {
@ -271,15 +260,7 @@ public class ST_Agnode_s extends UnsupportedStructAndPtr {
} }
@Override @Override
public __ptr__ getPtr(String fieldName) { public ST_Agnode_s getStruct() {
if (fieldName.equals("root")) {
return root;
}
return super.getPtr(fieldName);
}
@Override
public __struct__ getStruct() {
return this; return this;
} }

View File

@ -153,42 +153,6 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {
super.setDouble(fieldName, data); super.setDouble(fieldName, data);
} }
@Override
public double getDouble(String fieldName) {
if (fieldName.equals("width")) {
return this.width;
}
if (fieldName.equals("height")) {
return this.height;
}
if (fieldName.equals("ht")) {
return this.ht;
}
if (fieldName.equals("lw")) {
return this.lw;
}
if (fieldName.equals("rw")) {
return this.rw;
}
if (fieldName.equals("mval")) {
return this.mval;
}
return super.getDouble(fieldName);
}
@Override
public void setBoolean(String fieldName, boolean data) {
if (fieldName.equals("mark")) {
this.mark = data ? 1 : 0;
return;
}
if (fieldName.equals("onstack")) {
this.onstack = data ? 1 : 0;
return;
}
super.setBoolean(fieldName, data);
}
@Override @Override
public void setInt(String fieldName, int data) { public void setInt(String fieldName, int data) {
if (fieldName.equals("showboxes")) { if (fieldName.equals("showboxes")) {
@ -242,67 +206,6 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {
super.setInt(fieldName, data); super.setInt(fieldName, data);
} }
@Override
public int getInt(String fieldName) {
if (fieldName.equals("UF_size")) {
return this.UF_size;
}
if (fieldName.equals("ranktype")) {
return this.ranktype;
}
if (fieldName.equals("mark")) {
return this.mark;
}
if (fieldName.equals("onstack")) {
return this.onstack;
}
if (fieldName.equals("priority")) {
return this.priority;
}
if (fieldName.equals("node_type")) {
return this.node_type;
}
if (fieldName.equals("rank")) {
return this.rank;
}
if (fieldName.equals("order")) {
return this.order;
}
if (fieldName.equals("ranktype")) {
return this.ranktype;
}
if (fieldName.equals("low")) {
return this.low;
}
if (fieldName.equals("lim")) {
return this.lim;
}
if (fieldName.equals("weight_class")) {
return this.weight_class;
}
if (fieldName.equals("id")) {
return this.id;
}
if (fieldName.equals("heapindex")) {
return this.heapindex;
}
if (fieldName.equals("hops")) {
return this.hops;
}
return super.getInt(fieldName);
}
@Override
public boolean getBoolean(String fieldName) {
if (fieldName.equals("onstack")) {
return this.onstack != 0;
}
if (fieldName.equals("has_port")) {
return this.has_port;
}
return super.getBoolean(fieldName);
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("shape")) { if (fieldName.equals("shape")) {
@ -344,81 +247,7 @@ public class ST_Agnodeinfo_t extends UnsupportedStructAndPtr {
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("shape")) {
return shape;
}
if (fieldName.equals("label")) {
return label;
}
if (fieldName.equals("UF_parent")) {
return UF_parent;
}
if (fieldName.equals("next")) {
return next;
}
if (fieldName.equals("prev")) {
return prev;
}
if (fieldName.equals("clust")) {
return clust;
}
if (fieldName.equals("inleaf")) {
return inleaf;
}
if (fieldName.equals("outleaf")) {
return outleaf;
}
if (fieldName.equals("alg")) {
return alg;
}
if (fieldName.equals("par")) {
return par;
}
if (fieldName.equals("xlabel")) {
return xlabel;
}
if (fieldName.equals("shape_info")) {
return shape_info;
}
return super.getPtr(fieldName);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("in")) {
return in;
}
if (fieldName.equals("out")) {
return out;
}
if (fieldName.equals("flat_out")) {
return flat_out;
}
if (fieldName.equals("flat_in")) {
return flat_in;
}
if (fieldName.equals("other")) {
return other;
}
if (fieldName.equals("save_in")) {
return save_in;
}
if (fieldName.equals("save_out")) {
return save_out;
}
if (fieldName.equals("tree_in")) {
return tree_in;
}
if (fieldName.equals("tree_out")) {
return tree_out;
}
if (fieldName.equals("coord")) {
return coord;
}
return super.getStruct(fieldName);
}
@Override @Override
public void setStruct(String fieldName, __struct__ newData) { public void setStruct(String fieldName, __struct__ newData) {

View File

@ -46,7 +46,6 @@
package h; package h;
import smetana.core.HardcodedStruct; import smetana.core.HardcodedStruct;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__ptr__; import smetana.core.__ptr__;
import smetana.core.__struct__; import smetana.core.__struct__;
@ -113,22 +112,6 @@ public class ST_Agobj_s extends UnsupportedStructAndPtr implements WithParent, H
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("data")) {
return data;
}
return super.getPtr(fieldName);
}
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("tag")) {
return tag;
}
return super.getStruct(fieldName);
}
@Override @Override
public void setStruct(String fieldName, __struct__ newData) { public void setStruct(String fieldName, __struct__ newData) {
if (fieldName.equals("tag")) { if (fieldName.equals("tag")) {

View File

@ -48,10 +48,8 @@ package h;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import smetana.core.CString;
import smetana.core.OFFSET; import smetana.core.OFFSET;
import smetana.core.UnsupportedArrayOfStruct2; import smetana.core.UnsupportedArrayOfStruct2;
import smetana.core.UnsupportedStarStruct;
import smetana.core.UnsupportedStructAndPtr; import smetana.core.UnsupportedStructAndPtr;
import smetana.core.__array_of_ptr__; import smetana.core.__array_of_ptr__;
import smetana.core.__ptr__; import smetana.core.__ptr__;
@ -88,7 +86,7 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
public StarStruct getParent() { public StarStruct getParent() {
return _parent; return _parent;
} }
@Override @Override
public ST_Agraph_s getStruct() { public ST_Agraph_s getStruct() {
return this; return this;
@ -107,47 +105,42 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
public ST_Agraph_s getPtr() { public ST_Agraph_s getPtr() {
return this; return this;
} }
public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{ public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ {
private final List<ST_Agraph_s> data; private final List<ST_Agraph_s> data;
private final int pos; private final int pos;
@Override @Override
public void setStruct(String fieldName, __struct__ data) { public void setStruct(String fieldName, __struct__ data) {
getStruct().setStruct(fieldName, data); getStruct().setStruct(fieldName, data);
} }
@Override @Override
public __ptr__ castTo(Class dest) { public __ptr__ castTo(Class dest) {
return getStruct().castTo(dest); return getStruct().castTo(dest);
} }
@Override @Override
public void setPtr(__ptr__ value) { public void setPtr(__ptr__ value) {
this.data.set(pos, (ST_Agraph_s) value); this.data.set(pos, (ST_Agraph_s) value);
} }
@Override @Override
public ST_Agraph_s getPtr() { public ST_Agraph_s getPtr() {
return this.data.get(pos); return this.data.get(pos);
} }
@Override
public __struct__ getStruct(String fieldName) {
return getStruct().getStruct(fieldName);
}
@Override @Override
public Array asPtr() { public Array asPtr() {
return this; return this;
} }
@Override @Override
public ST_Agraph_s getStruct() { public ST_Agraph_s getStruct() {
return data.get(pos); return data.get(pos);
} }
public Array(int size) { public Array(int size) {
this.data = new ArrayList<ST_Agraph_s>(); this.data = new ArrayList<ST_Agraph_s>();
this.pos = 0; this.pos = 0;
@ -162,7 +155,7 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
} }
return this; return this;
} }
public Array plus(int delta) { public Array plus(int delta) {
return plusJ(delta); return plusJ(delta);
} }
@ -199,18 +192,8 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
throw new UnsupportedOperationException(getClass().toString()); throw new UnsupportedOperationException(getClass().toString());
} }
public CString getCString() {
throw new UnsupportedOperationException(getClass().toString());
}
public void setCString(CString value) {
throw new UnsupportedOperationException(getClass().toString());
}
} }
@Override @Override
public Object addVirtualBytes(int virtualBytes) { public Object addVirtualBytes(int virtualBytes) {
if (virtualBytes == 0) { if (virtualBytes == 0) {
@ -227,14 +210,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
return super.addVirtualBytes(virtualBytes); return super.addVirtualBytes(virtualBytes);
} }
@Override
public __struct__ getStruct(String fieldName) {
if (fieldName.equals("desc")) {
return desc;
}
return super.getStruct(fieldName);
}
@Override @Override
public __ptr__ setPtr(String fieldName, __ptr__ newData) { public __ptr__ setPtr(String fieldName, __ptr__ newData) {
if (fieldName.equals("clos")) { if (fieldName.equals("clos")) {
@ -272,35 +247,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
return super.setPtr(fieldName, newData); return super.setPtr(fieldName, newData);
} }
@Override
public __ptr__ getPtr(String fieldName) {
if (fieldName.equals("clos")) {
return clos;
}
if (fieldName.equals("root")) {
return root;
}
if (fieldName.equals("parent")) {
return parent;
}
if (fieldName.equals("n_id")) {
return n_id;
}
if (fieldName.equals("n_seq")) {
return n_seq;
}
if (fieldName.equals("e_id")) {
return e_id;
}
if (fieldName.equals("e_seq")) {
return e_seq;
}
if (fieldName.equals("g_dict")) {
return g_dict;
}
return super.getPtr(fieldName);
}
@Override @Override
public __ptr__ castTo(Class dest) { public __ptr__ castTo(Class dest) {
if (dest == ST_Agobj_s.class) { if (dest == ST_Agobj_s.class) {
@ -312,6 +258,10 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
return super.castTo(dest); return super.castTo(dest);
} }
public ST_Agobj_s castTo_ST_Agobj_s() {
return base;
}
@Override @Override
public boolean isSameThan(StarStruct other) { public boolean isSameThan(StarStruct other) {
ST_Agraph_s other2 = (ST_Agraph_s) other; ST_Agraph_s other2 = (ST_Agraph_s) other;
@ -324,9 +274,6 @@ public class ST_Agraph_s extends UnsupportedStructAndPtr {
} }
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }
// //
// public interface ST_Agraph_s extends __ptr__ { // public interface ST_Agraph_s extends __ptr__ {

Some files were not shown because too many files have changed in this diff Show More