Codebase list plantuml / 567b200
New upstream version 1.2018.13 Andrej Shadura 5 years ago
776 changed file(s) with 17501 addition(s) and 37144 deletion(s). Raw diff Collapse all Expand all
2929 Script Author: Julien Eluard
3030
3131 -->
32 <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">
32 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3334 <modelVersion>4.0.0</modelVersion>
3435
3536 <groupId>net.sourceforge.plantuml</groupId>
3637 <artifactId>plantuml</artifactId>
37 <version>1.2018.10-SNAPSHOT</version>
38 <version>1.2018.13-SNAPSHOT</version>
3839 <packaging>jar</packaging>
3940
4041 <name>PlantUML</name>
4242 * Renders a {@link BitMatrix} as an image, where "false" bits are rendered
4343 * as white, and "true" bits are rendered as black.
4444 */
45 public static BufferedImage toBufferedImage(BitMatrix matrix) {
45 public static BufferedImage toBufferedImage(BitMatrix matrix, int fore, int back) {
4646 int width = matrix.getWidth();
4747 int height = matrix.getHeight();
4848 BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
4949 for (int x = 0; x < width; x++) {
5050 for (int y = 0; y < height; y++) {
51 image.setRGB(x, y, matrix.get(x, y) ? BLACK : WHITE);
51 image.setRGB(x, y, matrix.get(x, y) ? fore : back);
5252 }
5353 }
5454 return image;
5555 }
5656
57 /**
58 * Writes a {@link BitMatrix} to a file.
59 *
60 * @see #toBufferedImage(BitMatrix)
61 */
62 public static void writeToFile(BitMatrix matrix, String format, File file)
63 throws IOException {
64 BufferedImage image = toBufferedImage(matrix);
65 ImageIO.write(image, format, file);
66 }
67
68 /**
69 * Writes a {@link BitMatrix} to a stream.
70 *
71 * @see #toBufferedImage(BitMatrix)
72 */
73 public static void writeToStream(BitMatrix matrix, String format, OutputStream stream)
74 throws IOException {
75 BufferedImage image = toBufferedImage(matrix);
76 ImageIO.write(image, format, stream);
77 }
57 // /**
58 // * Writes a {@link BitMatrix} to a file.
59 // *
60 // * @see #toBufferedImage(BitMatrix)
61 // */
62 // public static void writeToFile(BitMatrix matrix, String format, File file)
63 // throws IOException {
64 // BufferedImage image = toBufferedImage(matrix);
65 // ImageIO.write(image, format, file);
66 // }
67 //
68 // /**
69 // * Writes a {@link BitMatrix} to a stream.
70 // *
71 // * @see #toBufferedImage(BitMatrix)
72 // */
73 // public static void writeToStream(BitMatrix matrix, String format, OutputStream stream)
74 // throws IOException {
75 // BufferedImage image = toBufferedImage(matrix);
76 // ImageIO.write(image, format, stream);
77 // }
7878
7979 }
4343 *
4444 */
4545 package gen.lib.cdt;
46 import static gen.lib.cdt.dtsize__c.dtsize_;
47 import static smetana.core.JUtilsDebug.ENTERING;
48 import static smetana.core.JUtilsDebug.LEAVING;
49 import static smetana.core.Macro.N;
4650 import static smetana.core.Macro.UNSUPPORTED;
51 import h.ST_dt_s;
52 import h.ST_dtdisc_s;
53 import smetana.core.Memory;
4754
4855 public class dtclose__c {
4956 //1 9k44uhd5foylaeoekf3llonjq
114121
115122 //3 7ggbhlblmrfr1wq1k20npwyxb
116123 // int dtclose(register Dt_t* dt)
117 public static Object dtclose(Object... arg) {
118 UNSUPPORTED("5o7j3hhxxjdvmz0k3eg98i8in"); // int dtclose(register Dt_t* dt)
119 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
120 UNSUPPORTED("2fi55lg37rcjprso1i0385cj5"); // Dtdisc_t *disc;
121 UNSUPPORTED("pz52m7579heh6vdbqc3dt84v"); // int ev = 0;
122 UNSUPPORTED("3iyrv07qx7n0s211y8m7mopsz"); // if(!dt || dt->nview > 0 ) /* can't close if being viewed */
123 UNSUPPORTED("b0epxudfxjm8kichhaautm2qi"); // return -1;
124 UNSUPPORTED("9y2zao3al22pjv2p480p4klcc"); // /* announce the close event to see if we should continue */
125 UNSUPPORTED("70rampeezpyz05ynxa49umbrz"); // disc = dt->disc;
126 UNSUPPORTED("8gsk9kzxnlwgo3aceze9c6gl7"); // if(disc->eventf &&
127 UNSUPPORTED("ho436wfj1mjidd6obd19mhll"); // (ev = (*disc->eventf)(dt,2,((void*)0),disc)) < 0)
128 UNSUPPORTED("b0epxudfxjm8kichhaautm2qi"); // return -1;
129 UNSUPPORTED("66fqrcqd57dw3fzb30i176w0r"); // if(dt->view) /* turn off viewing */
124 public static int dtclose(ST_dt_s dt) {
125 ENTERING("7ggbhlblmrfr1wq1k20npwyxb","dtclose");
126 try {
127 ST_dtdisc_s disc;
128 int ev = 0;
129 if(N(dt) || dt.nview > 0 ) /* can't close if being viewed */
130 return -1;
131 /* announce the close event to see if we should continue */
132 disc = (ST_dtdisc_s) dt.disc;
133 if(disc.eventf!=null &&
134 (ev = (Integer)disc.eventf.exe(dt, 2, null, disc)) < 0)
135 return -1;
136 if(dt.view!=null) /* turn off viewing */
130137 UNSUPPORTED("1xbo7gf92fmqmu2tzpfeuc0wk"); // dtview(dt,((Dt_t*)0));
131 UNSUPPORTED("9vl9psbe52rphrxhc41erj2qd"); // if(ev == 0) /* release all allocated data */
132 UNSUPPORTED("8fubw8ssxlx99qjv7n52cf3ru"); // { (void)(*(dt->meth->searchf))(dt,((void*)0),0000100);
133 UNSUPPORTED("5rbpcw29jwi3l66b11are2xd5"); // if(dtsize(dt) > 0)
134 UNSUPPORTED("896vcxnvc07fbkh09vojp66fv"); // return -1;
135 UNSUPPORTED("8po7fioot1issl5obmk5hqndd"); // if(dt->data->ntab > 0)
138 if(ev == 0) /* release all allocated data */ {
139 dt.meth.searchf.exe(dt, null, 0000100);
140 if(dtsize_(dt) > 0)
141 return -1;
142 if(dt.data.ntab > 0)
136143 UNSUPPORTED("4ugmcpi8vkb013vuo4wykn0a3"); // (*dt->memoryf)(dt,(void*)dt->data->hh._htab,0,disc);
137 UNSUPPORTED("1bguaull3m0kl140obilq4ucp"); // (*dt->memoryf)(dt,(void*)dt->data,0,disc);
138 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
139 UNSUPPORTED("4wjw4hx0hptydzyvkohwgzoo"); // if(dt->type == 0)
140 UNSUPPORTED("9jx9g23tuicm5x7f5cvznr3rt"); // free((void*)dt);
141 UNSUPPORTED("4r6n1aai6737i36g78f9z4apm"); // else if(ev == 0 && dt->type == 1)
144 dt.memoryf.exe(dt, dt.data, null, disc);
145 }
146 if(dt.type == 0)
147 Memory.free(dt);
148 else if(ev == 0 && dt.type == 1)
142149 UNSUPPORTED("6wqxv1f7tzvjk0lwmqdrcq8la"); // (*dt->memoryf)(dt, (void*)dt, 0, disc);
143 UNSUPPORTED("oxrmf64nqi0a580iiczqkmky"); // if(disc->eventf)
150 if(disc.eventf!=null)
144151 UNSUPPORTED("8bce06bdd64ypwb17ddloqzu8"); // (void)(*disc->eventf)(dt, 6, ((void*)0), disc);
145 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
146 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
147
148 throw new UnsupportedOperationException();
152 return 0;
153 } finally {
154 LEAVING("7ggbhlblmrfr1wq1k20npwyxb","dtclose");
155 }
149156 }
150157
151158
4343 *
4444 */
4545 package gen.lib.cdt;
46 import static gen.lib.cdt.dtflatten__c.dtflatten;
47 import static gen.lib.cdt.dtrestore__c.dtrestore;
4648 import static smetana.core.JUtils.function;
4749 import static smetana.core.JUtilsDebug.ENTERING;
4850 import static smetana.core.JUtilsDebug.LEAVING;
4951 import static smetana.core.Macro.N;
5052 import static smetana.core.Macro.UNSUPPORTED;
5153 import h.Dtsearch_f;
52 import h._dt_s;
53 import h._dtdisc_s;
54 import h._dtlink_s;
54 import h.ST_dt_s;
55 import h.ST_dtdisc_s;
56 import h.ST_dtlink_s;
5557 import smetana.core.CString;
58 import smetana.core.Memory;
5659 import smetana.core.size_t;
5760
5861 public class dtdisc__c {
124127
125128 //3 507t9jcy6v9twvl30rs9i2nwi
126129 // static void* dtmemory(Dt_t* dt,void* addr,size_t size,Dtdisc_t* disc)
127 public static Object dtmemory(_dt_s dt, Object addr, size_t size, _dtdisc_s disc) {
130 public static Object dtmemory(ST_dt_s dt, Object addr, size_t size, ST_dtdisc_s disc) {
131 ENTERING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
132 try {
128133 if(addr!=null) {
129 UNSUPPORTED("bn1cyxafod2777wzl55qh14xq"); // if(size == 0)
130 UNSUPPORTED("15j5ccp5owse1ebc5ljhbzg59"); // { free(addr);
131 UNSUPPORTED("aihzmr4oo3tuh6kkxwtn9tlbd"); // return ((void*)0);
132 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
134 if(size == null) {
135 Memory.free(addr);
136 return null;
137 }
133138 UNSUPPORTED("9ed8imo9cbvwtwe92qmavoqko"); // else return realloc(addr,size);
134139 }
135140 else return size.isStrictPositive() ? size.malloc() : null;
136141 throw new UnsupportedOperationException();
142 } finally {
143 LEAVING("507t9jcy6v9twvl30rs9i2nwi","dtmemory");
144 }
137145 }
138146
139147
141149
142150 //3 axpvuswclmi9bx3qtlh4quyah
143151 // Dtdisc_t* dtdisc(Dt_t* dt, Dtdisc_t* disc, int type)
144 public static _dtdisc_s dtdisc(_dt_s dt, _dtdisc_s disc, int type) {
152 public static ST_dtdisc_s dtdisc(ST_dt_s dt, ST_dtdisc_s disc, int type) {
145153 ENTERING("axpvuswclmi9bx3qtlh4quyah","dtdisc");
146154 try {
147155 Dtsearch_f searchf;
148 _dtlink_s r, t;
156 ST_dtlink_s r, t;
149157 CString k;
150 _dtdisc_s old;
151 if(N(old = (_dtdisc_s) dt.getPtr("disc")) ) /* initialization call from dtopen() */
158 ST_dtdisc_s old;
159 if(N(old = (ST_dtdisc_s) dt.disc) ) /* initialization call from dtopen() */
152160 { dt.setPtr("disc", disc);
153 if(N(dt.setPtr("memoryf", disc.getPtr("memoryf") )))
161 if(N(dt.setPtr("memoryf", disc.memoryf )))
154162 dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
155163 return disc;
156164 }
157165 if(N(disc)) /* only want to know current discipline */
158166 return old;
159 UNSUPPORTED("6htlkpaqff61iwmsg1be47uci"); // searchf = dt->meth->searchf;
160 UNSUPPORTED("ckjxpmega2z5oju8xk72wsy0q"); // ((dt->data->type&010000) ? dtrestore(dt,((Dtlink_t*)0)) : 0);
161 UNSUPPORTED("34klfi71a7k7iqdrvezqetdjg"); // if(old->eventf && (*old->eventf)(dt,3,(void*)disc,old) < 0)
162 UNSUPPORTED("1cft3x8zrdzefdb93v3f1tuo7"); // return ((Dtdisc_t*)0);
163 UNSUPPORTED("4e4gm32ypcbtlzkym7sh79rrd"); // dt->disc = disc;
164 UNSUPPORTED("6nr96is5y2ct55pupgycwbjmt"); // if(!(dt->memoryf = disc->memoryf) )
165 UNSUPPORTED("1prh3v6ko1v9w39hgk7wiknjc"); // dt->memoryf = dtmemory;
166 UNSUPPORTED("epetks7tchxd027a5fogh5s8y"); // if(dt->data->type&(0000040|0000100|0000020))
167 searchf = (Dtsearch_f) dt.meth.searchf;
168 if((dt.data.type&010000)!=0) dtrestore(dt,null);
169 if(old.eventf!=null && ((Integer)old.eventf.exe(dt,3, disc,old)) < 0)
170 return null;
171 dt.setPtr("disc", disc);
172 if(N(dt.setPtr("memoryf", disc.memoryf)))
173 dt.setPtr("memoryf", function(dtdisc__c.class, "dtmemory"));
174 if((dt.data.type&(0000040|0000100|0000020))!=0)
167175 UNSUPPORTED("e2tzh95k1lvjl6wbtpwizam8q"); // goto done;
168 UNSUPPORTED("9z4k8xq4t2p909fvi8gusmmww"); // else if(dt->data->type&0000002)
169 UNSUPPORTED("3q5nyguq8mgdfwmm0yrzq2br8"); // { if(type&0000002)
176 else if((dt.data.type&0000002)!=0) {
177 UNSUPPORTED("3q5nyguq8mgdfwmm0yrzq2br8"); // if(type&0000002)
170178 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
171179 UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
172 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
173 UNSUPPORTED("eu35368wm4jf6yedwkayoycx4"); // else if(dt->data->type&(0000001|0000002))
174 UNSUPPORTED("8xmm1djjds55s86jodixkp72u"); // { if((type&0000002) && (type&0000001))
180 }
181 else if((dt.data.type&(0000001|0000002))!=0) {
182 UNSUPPORTED("8xmm1djjds55s86jodixkp72u"); // if((type&0000002) && (type&0000001))
175183 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
176184 UNSUPPORTED("6d1rfacssm8768oz9fu5o66t8"); // else goto dt_renew;
177 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
178 UNSUPPORTED("1ww5saiqcss2tdx5nts4rxpou"); // else /*if(dt->data->type&(DT_OSET|DT_OBAG))*/
179 UNSUPPORTED("4582pmh67cgbsphrw05tf0hmm"); // { if(type&0000001)
185 }
186 else /*if(dt->data->type&(DT_OSET|DT_OBAG))*/ {
187 if((type&0000001)!=0)
180188 UNSUPPORTED("93q6zqzlgfz2qd0yl6koyw99c"); // goto done;
181 UNSUPPORTED("8njey2jaa662w29s8zcqbjln5"); // dt_renew:
182 UNSUPPORTED("assw6t0chu41lwws2ysqi4fgi"); // r = dtflatten(dt);
189 // dt_renew:
190 r = dtflatten(dt);
183191 UNSUPPORTED("1rry7yjzos90pgbf3li2qpa18"); // dt->data->type &= ~010000;
184192 UNSUPPORTED("6vkn7padspfbtju9g5b65b34w"); // dt->data->here = ((Dtlink_t*)0);
185193 UNSUPPORTED("2jfi30wa60xp7iqlk9yyf4k5j"); // dt->data->size = 0;
203211 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
204212 UNSUPPORTED("cerydbb7i6l7c4pgeygvwoqk2"); // done:
205213 UNSUPPORTED("bi0p581nen18ypj0ey48s6ete"); // return old;
206 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
214 }
207215
208216 throw new UnsupportedOperationException();
209217 } finally {
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h._dt_s;
50 import h._dtlink_s;
49 import h.ST_dt_s;
50 import h.ST_dtlink_s;
5151
5252 public class dtextract__c {
5353 //1 9k44uhd5foylaeoekf3llonjq
118118
119119 //3 ar89jjwhuitmbhut1o3ft3zpb
120120 // Dtlink_t* dtextract(register Dt_t* dt)
121 public static _dtlink_s dtextract(_dt_s dt) {
121 public static ST_dtlink_s dtextract(ST_dt_s dt) {
122122 ENTERING("ar89jjwhuitmbhut1o3ft3zpb","dtextract");
123123 try {
124 _dtlink_s list = null;
125 _dtlink_s s[], ends[];
126 if((dt.getPtr("data").getInt("type")&(0000004|0000010) )!=0)
127 list = (_dtlink_s) dt.getPtr("data").getPtr("here");
128 else if((dt.getPtr("data").getInt("type")&(0000001|0000002))!=0)
124 ST_dtlink_s list = null;
125 ST_dtlink_s s[], ends[];
126 if((dt.data.type&(0000004|0000010) )!=0)
127 list = (ST_dtlink_s) dt.data.here;
128 else if((dt.data.type&(0000001|0000002))!=0)
129129 { UNSUPPORTED("list = dtflatten(dt)");
130130 UNSUPPORTED("8i2mufw9f604gvj48u8nbdazp"); // for(ends = (s = dt->data->hh._htab) + dt->data->ntab; s < ends; ++s)
131131 UNSUPPORTED("4sml4zdr938yth6x815jt1dlm"); // *s = ((Dtlink_t*)0);
132132 }
133133 else /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE))*/
134 { list = (_dtlink_s) dt.getPtr("data").getPtr("hh").getPtr("_head");
135 dt.getPtr("data").getPtr("hh").setPtr("_head", null);
134 { list = (ST_dtlink_s) dt.data._head;
135 dt.data._head = null;
136136 }
137 dt.getPtr("data").setInt("type", dt.getPtr("data").getInt("type") & ~010000);
138 dt.getPtr("data").setInt("size", 0);
139 dt.getPtr("data").setPtr("here", null);
137 dt.data.setInt("type", dt.data.type & ~010000);
138 dt.data.setInt("size", 0);
139 dt.data.here = null;
140140 return list;
141141 } finally {
142142 LEAVING("ar89jjwhuitmbhut1o3ft3zpb","dtextract");
4444 */
4545 package gen.lib.cdt;
4646 import static smetana.core.Macro.UNSUPPORTED;
47 import h.ST_dt_s;
48 import h.ST_dtlink_s;
4749
4850 public class dtflatten__c {
4951 //1 9k44uhd5foylaeoekf3llonjq
114116
115117 //3 5zkzkycgp4e90pajuq4tczdbu
116118 // Dtlink_t* dtflatten(Dt_t* dt)
117 public static Object dtflatten(Object... arg) {
119 public static ST_dtlink_s dtflatten(ST_dt_s dt) {
118120 UNSUPPORTED("1u9gaaespn5nsfpluy23yon7s"); // Dtlink_t* dtflatten(Dt_t* dt)
119121 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
120122 UNSUPPORTED("82qvflv3akadrlktyouix927i"); // register Dtlink_t *t, *r, *list, *last, **s, **ends;
4848 import static smetana.core.JUtilsDebug.ENTERING;
4949 import static smetana.core.JUtilsDebug.LEAVING;
5050 import static smetana.core.Macro.N;
51 import h._dt_s;
52 import h._dtdata_s;
53 import h._dtdisc_s;
54 import h._dtmethod_s;
51 import h.ST_dt_s;
52 import h.ST_dtdata_s;
53 import h.ST_dtdisc_s;
54 import h.ST_dtmethod_s;
5555 import smetana.core.Memory;
5656
5757 public class dtopen__c {
127127
128128 //3 34nbfbdgwe34hb4vmfr5p6kbh
129129 // Dt_t* dtopen(Dtdisc_t* disc, Dtmethod_t* meth)
130 public static _dt_s dtopen(_dtdisc_s disc, _dtmethod_s meth) {
130 public static ST_dt_s dtopen(ST_dtdisc_s disc, ST_dtmethod_s meth) {
131131 ENTERING("34nbfbdgwe34hb4vmfr5p6kbh","dtopen");
132132 try {
133 _dt_s dt = null;
133 ST_dt_s dt = null;
134134 int e;
135 _dtdata_s data;
135 ST_dtdata_s data;
136136 if(N(disc) || N(meth))
137137 return null;
138138 /* allocate space for dictionary */
139 if(N(dt = (_dt_s) Memory.malloc(_dt_s.class)))
139 if(N(dt = new ST_dt_s()))
140140 return null;
141141 // /* initialize all absolutely private data */
142142 dt.setPtr("searchf", null);
148148 dt.setPtr("view", null);
149149 dt.setPtr("walk", null);
150150 dt.setPtr("user", null);
151 if(disc.getPtr("eventf")!=null)
151 if(disc.eventf!=null)
152152 { /* if shared/persistent dictionary, get existing data */
153153 throw new UnsupportedOperationException();
154154 // data = ((Dtdata_t*)0);
175175 // }
176176 }
177177 /* allocate sharable data */
178 if(N(data = (_dtdata_s) (dt.call("memoryf", dt,null,sizeof(_dtdata_s.class),disc)) ))
178 if(N(data = (ST_dtdata_s) (dt.memoryf.exe(dt,null,sizeof(ST_dtdata_s.class),disc)) ))
179179 { err_open:
180180 Memory.free(dt);
181181 return (null);
182182 }
183 data.setInt("type", meth.getInt("type"));
184 data.setPtr("here", null);
185 data.setPtr("hh._htab", null);
186 data.setInt("ntab", 0);
187 data.setInt("size", 0);
188 data.setInt("loop", 0);
189 data.setInt("minp", 0);
183 data.type = meth.type;
184 data.here = null;
185 data._htab = null;
186 data.ntab = 0;
187 data.size = 0;
188 data.loop = 0;
189 data.minp = 0;
190190 //done:
191 dt.setPtr("data", data);
192 dt.setPtr("searchf", meth.getPtr("searchf"));
193 dt.setPtr("meth", meth);
194 if(disc.getPtr("eventf")!=null)
191 dt.data = data;
192 dt.searchf = meth.searchf;
193 dt.meth = meth;
194 if(disc.eventf!=null)
195195 throw new UnsupportedOperationException();
196196 // (*disc->eventf)(dt, 5, (void*)dt, disc);
197197 return dt;
4848 import static smetana.core.Macro.N;
4949 import static smetana.core.Macro.UNSUPPORTED;
5050 import h.Dtsearch_f;
51 import h._dt_s;
52 import h._dtlink_s;
51 import h.ST_dt_s;
52 import h.ST_dtlink_s;
5353
5454 public class dtrestore__c {
5555 //1 9k44uhd5foylaeoekf3llonjq
120120
121121 //3 8dfut8799tvg4tjvn2yz48d7h
122122 // int dtrestore(register Dt_t* dt, register Dtlink_t* list)
123 public static int dtrestore(_dt_s dt, _dtlink_s list) {
123 public static int dtrestore(ST_dt_s dt, ST_dtlink_s list) {
124124 ENTERING("8dfut8799tvg4tjvn2yz48d7h","dtrestore");
125125 try {
126 _dtlink_s t;
126 ST_dtlink_s t;
127127 //Dtlink_t **s, **ends;
128128 int type;
129 Dtsearch_f searchf = (Dtsearch_f) dt.getPtr("meth").getPtr("searchf");
130 type = dt.getPtr("data").getInt("type")&010000;
129 Dtsearch_f searchf = (Dtsearch_f) dt.meth.searchf;
130 type = dt.data.type&010000;
131131 if(N(list)) /* restoring a flattened dictionary */
132132 { if(N(type))
133133 return -1;
134 list = (_dtlink_s) dt.getPtr("data").getPtr("here");
134 list = (ST_dtlink_s) dt.data.here;
135135 }
136136 else /* restoring an extracted list of elements */
137 { if(dt.getPtr("data").getInt("size") != 0)
137 { if(dt.data.size != 0)
138138 return -1;
139139 type = 0;
140140 }
141 dt.getPtr("data").setInt("type", dt.getPtr("data").getInt("type") & ~010000);
142 if((dt.getPtr("data").getInt("type")&(0000001|0000002))!=0)
141 dt.data.setInt("type", dt.data.type & ~010000);
142 if((dt.data.type&(0000001|0000002))!=0)
143143 { //dt->data->here = ((Dtlink_t*)0);
144144 UNSUPPORTED("4xawc48hce5sov89n8h4j7xw0"); // if(type) /* restoring a flattened dictionary */
145145 UNSUPPORTED("3yrjmgus9a9415ocrrtj1e733"); // { for(ends = (s = dt->data->hh._htab) + dt->data->ntab; s < ends; ++s)
160160 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
161161 }
162162 else
163 { if((dt.getPtr("data").getInt("type")&(0000004|0000010))!=0)
164 dt.getPtr("data").setPtr("here", list);
163 { if((dt.data.type&(0000004|0000010))!=0)
164 dt.data.here = list;
165165 else /*if(dt->data->type&(DT_LIST|DT_STACK|DT_QUEUE))*/
166166 {UNSUPPORTED("79wu0m7edfdq02msgoqkzb32"); // { dt->data->here = ((Dtlink_t*)0);
167167 UNSUPPORTED("c8q10nh3f6o4rjxtacmbgjxqj"); // dt->data->hh._head = list;
168168 }
169169 if(N(type))
170 dt.getPtr("data").setInt("size", -1);
170 dt.data.setInt("size", -1);
171171 }
172172 return 0;
173173 } finally {
4646 import static gen.lib.cdt.dtrestore__c.dtrestore;
4747 import static smetana.core.JUtilsDebug.ENTERING;
4848 import static smetana.core.JUtilsDebug.LEAVING;
49 import h._dt_s;
50 import h._dtlink_s;
49 import h.ST_dt_s;
50 import h.ST_dtlink_s;
5151
5252 public class dtsize__c {
5353 //1 9k44uhd5foylaeoekf3llonjq
118118
119119 //3 6j49zum5hqto1t7fyrz8qjv1u
120120 // static int treecount(register Dtlink_t* e)
121 public static int treecount(_dtlink_s e) {
121 public static int treecount(ST_dtlink_s e) {
122122 ENTERING("6j49zum5hqto1t7fyrz8qjv1u","treecount");
123123 try {
124 return e!=null ? treecount((_dtlink_s) e.getPtr("hl._left")) + treecount((_dtlink_s) e.getPtr("right")) + 1 : 0;
124 return e!=null ? treecount((ST_dtlink_s) e._left) + treecount((ST_dtlink_s) e.right) + 1 : 0;
125125 } finally {
126126 LEAVING("6j49zum5hqto1t7fyrz8qjv1u","treecount");
127127 }
132132
133133 //3 bci0ea1fa7egf4aads6gdgvsq
134134 // int dtsize(Dt_t* dt)
135 public static int dtsize_(_dt_s dt) {
135 public static int dtsize_(ST_dt_s dt) {
136136 ENTERING("bci0ea1fa7egf4aads6gdgvsq","dtsize");
137137 try {
138 _dtlink_s t;
138 ST_dtlink_s t;
139139 int size;
140 if (((dt.getPtr("data").getInt("type")&010000)!=0)) dtrestore(dt,null);
141 if(dt.getPtr("data").getInt("size") < 0) /* !(dt->data->type&(DT_SET|DT_BAG)) */
142 { if((dt.getPtr("data").getInt("type")&(0000004|0000010))!=0)
143 dt.getPtr("data").setInt("size", treecount((_dtlink_s) dt.getPtr("data").getPtr("here")));
144 else if((dt.getPtr("data").getInt("type")&(0000020|0000040|0000100))!=0)
140 if (((dt.data.type&010000)!=0)) dtrestore(dt,null);
141 if(dt.data.size < 0) /* !(dt->data->type&(DT_SET|DT_BAG)) */
142 { if((dt.data.type&(0000004|0000010))!=0)
143 dt.data.setInt("size", treecount((ST_dtlink_s) dt.data.here));
144 else if((dt.data.type&(0000020|0000040|0000100))!=0)
145145 { size=0;
146 for(t = (_dtlink_s) dt.getPtr("data").getPtr("hh").getPtr("_head"); t!=null; t = (_dtlink_s) t.getPtr("right"))
146 for(t = (ST_dtlink_s) dt.data._head; t!=null; t = (ST_dtlink_s) t.right)
147147 size += 1;
148 dt.getPtr("data").setInt("size", size);
148 dt.data.setInt("size", size);
149149 }
150150 }
151 return dt.getPtr("data").getInt("size");
151 return dt.data.size;
152152
153153 } finally {
154154 LEAVING("bci0ea1fa7egf4aads6gdgvsq","dtsize");
5353 import static smetana.core.Macro.UNSUPPORTED;
5454 import static smetana.core.Macro.UNSUPPORTED_INT;
5555 import h.Dtcompar_f;
56 import h._dt_s;
57 import h._dtdisc_s;
58 import h._dthold_s;
59 import h._dtlink_s;
56 import h.ST_dt_s;
57 import h.ST_dtdisc_s;
58 import h.ST_dthold_s;
59 import h.ST_dtlink_s;
60 import h.ST_dthold_s;
6061 import smetana.core.CFunction;
6162 import smetana.core.CString;
62 import smetana.core.JUtils;
6363 import smetana.core.__ptr__;
64 import smetana.core.__struct__;
6564
6665 public class dttree__c {
6766 //1 9k44uhd5foylaeoekf3llonjq
130129
131130
132131
133 //3 abqfzg1d1vkzk51225tcdlik5
134 // static void* dttree(Dt_t* dt, void* obj, int type)
135132 static class no_root extends RuntimeException {}
136133 static class has_root extends RuntimeException {}
137134 static class do_search extends RuntimeException {}
138135 static class dt_delete extends RuntimeException {}
139136 static class dt_insert extends RuntimeException {}
140137 static class dt_next extends RuntimeException {}
141 public static Object dttree(_dt_s dt, __ptr__ obj, int type) {
138 //3 abqfzg1d1vkzk51225tcdlik5
139 //static void* dttree(Dt_t* dt, void* obj, int type)
140 public static Object dttree(ST_dt_s dt, __ptr__ obj, int type) {
142141 ENTERING("abqfzg1d1vkzk51225tcdlik5","dttree");
143142 try {
144 _dtlink_s root, t;
143 ST_dtlink_s root, t;
145144 int cmp, lk, sz, ky;
146 _dtlink_s l, r, me=null;
147 final __struct__<_dtlink_s> link = JUtils.from(_dtlink_s.class);
145 ST_dtlink_s l, r, me=null;
146 final ST_dtlink_s link = new ST_dtlink_s();
148147 Object o, k, key = null;
149148 int n, minp; //, turn[(sizeof(size_t)*8 - 2)];
150149 Dtcompar_f cmpf;
151 _dtdisc_s disc;
152 if (((dt.getPtr("data").getInt("type")) & 010000) !=0) { dtrestore(dt,null); }
153 disc = (_dtdisc_s) dt.getPtr("disc"); ky = disc.getInt("key");
154 sz = disc.getInt("size");
155 lk = disc.getInt("link");
156 cmpf = (Dtcompar_f) disc.getPtr("comparf");
157 dt.setInt("type", dt.getInt("type")&~0100000);
158 root = (_dtlink_s) dt.getPtr("data").getPtr("here");
150 ST_dtdisc_s disc;
151 if (((dt.data.type) & 010000) !=0) { dtrestore(dt,null); }
152 disc = (ST_dtdisc_s) dt.disc; ky = disc.key;
153 sz = disc.size;
154 lk = disc.link;
155 cmpf = (Dtcompar_f) disc.comparf;
156 dt.setInt("type", dt.type&~0100000);
157 root = (ST_dtlink_s) dt.data.here;
159158 if(N(obj))
160159 { if(N(root) || N(type&(0000100|0000200|0000400)) )
161160 return null;
162161 if((type&0000100)!=0) /* delete all objects */
163162 {
164 throw new UnsupportedOperationException();
165 // if(disc->freef || disc->link < 0)
166 // { do
167 // { while((t = root->hl._left) )
168 // (((root)->hl._left = (t)->right, (t)->right = (root)), (root) = (t));
169 // t = root->right;
170 // if(disc->freef)
163 if(disc.freef!=null || disc.link < 0) {
164 do {
165 while((t = (ST_dtlink_s) root._left)!=null ) {
166 root._left = t.right;
167 t.right = root;
168 root = t;
169 }
170 t = (ST_dtlink_s) root.right;
171 if(disc.freef!=null)
172 throw new UnsupportedOperationException();
171173 // (*disc->freef)(dt,(lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ),disc);
172 // if(disc->link < 0)
173 // (*dt->memoryf)(dt,(void*)root,0,disc);
174 // } while((root = t) );
175 // }
176 // dt->data->size = 0;
177 // dt->data->here = ((Dtlink_t*)0);
178 // return ((void*)0);
174 if(disc.link < 0)
175 dt.memoryf.exe(dt, root, null, disc);
176 } while((root = t)!=null );
177 }
178 dt.data.setInt("size", 0);
179 dt.data.here = null;
180 return null;
179181 }
180182 else /* computing largest/smallest element */
181183 { if((type&0000400)!=0)
182 { while((t = (_dtlink_s) root.getPtr("right"))!=null ) {
183 root.setPtr("right", t.getPtr("hl._left"));
184 t.setPtr("hl._left", root);
184 { while((t = (ST_dtlink_s) root.right)!=null ) {
185 root.right = t._left;
186 t._left = root;
185187 root = t;
186188 }
187189 }
188190 else /* type&DT_FIRST */
189 { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
190 root.setPtr("hl._left", t.getPtr("right"));
191 t.setPtr("right", root);
191 { while((t = (ST_dtlink_s) root._left)!=null ) {
192 root._left = t.right;
193 t.right = root;
192194 root = t;
193195 }
194196 }
195 dt.getPtr("data").setPtr("here", root);
196 return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk) );
197 dt.data.here = root;
198 return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk) );
197199 }
198200 }
199201 /* note that link.right is LEFT tree and link.left is RIGHT tree */
200 l = r = link.amp();
202 l = r = link;
201203 /* allow apps to delete an object "actually" in the dictionary */
202204 try {
203 if(dt.getPtr("meth").getInt("type") == 0000010 && ((type&(0000002|0010000))!=0) ) {
205 if(dt.meth.type == 0000010 && ((type&(0000002|0010000))!=0) ) {
204206 throw new UnsupportedOperationException();
205207 // { key = (void*)(sz < 0 ? *((char**)((char*)(obj)+ky)) : ((char*)(obj)+ky));
206208 // for(o = (*(((Dt_t*)(dt))->searchf))((dt),(void*)(obj),0000004); o; o = (*(((Dt_t*)(dt))->searchf))((dt),(void*)(o),0000010) )
229231 // if(root)
230232 // goto do_search;
231233 }
232 else if(root!=null && (lk < 0 ? (root.castTo(_dthold_s.class).getPtr("obj")!=null): NEQ(root.addVirtualBytes(-lk), obj)))
234 else if(root!=null && (lk < 0 ? (root.castTo_ST_dthold_s().obj!=null): NEQ(root.addVirtualBytes(-lk), obj)))
233235 { key = (sz < 0 ? ((__ptr__)obj).addVirtualBytes(ky) : ((__ptr__)obj).addVirtualBytes(ky));
234236 throw new do_search();
235237 }
236238 } catch (do_search do_search) {
237239 // do_search:
238 if(dt.getPtr("meth").getInt("type") == 0000004 &&
239 (minp = dt.getPtr("data").getInt("minp")) != 0 && (type&(0001000|0000004))!=0)
240 if(dt.meth.type == 0000004 &&
241 (minp = dt.data.minp) != 0 && (type&(0001000|0000004))!=0)
240242 { /* simple search, note that minp should be even */
241243 // for(t = root, n = 0; n < minp; ++n)
242244 // { k = (lk < 0 ? ((Dthold_t*)(t))->obj : (void*)((char*)(t) - lk) ); k = (void*)(sz < 0 ? *((char**)((char*)(k)+ky)) : ((char*)(k)+ky));
280282 throw new UnsupportedOperationException("do_search1");
281283 }
282284 while(true) {
283 k = lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk);
285 k = lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk);
284286 k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
285287 if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc) :
286288 (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) == 0)
287289 break;
288290 else if(cmp < 0)
289 { if((t = (_dtlink_s) root.getPtr("hl._left"))!=null )
291 { if((t = (ST_dtlink_s) root._left)!=null )
290292 {
291 k = lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk);
293 k = lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk);
292294 k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
293295 if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc)
294296 : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) < 0)
295 { root.setPtr("hl._left", t.getPtr("right"));
296 t.setPtr("right", root);
297 r.setPtr("hl._left", t);
297 { root._left = t.right;
298 t.right = root;
299 r._left = t;
298300 r = t;
299 if(N(root = (_dtlink_s) t.getPtr("hl._left")) )
301 if(N(root = (ST_dtlink_s) t._left) )
300302 break;
301303 }
302304 else if(cmp == 0)
303 { r.setPtr("hl._left", root);
305 { r._left = root;
304306 r = root;
305307 root = t;
306308 break;
307309 }
308310 else /* if(cmp > 0) */
309 { l.setPtr("right", t);
311 { l.right = t;
310312 l = t;
311 r.setPtr("hl._left", root);
313 r._left = root;
312314 r = root;
313 if(N(root = (_dtlink_s) t.getPtr("right")) )
315 if(N(root = (ST_dtlink_s) t.right) )
314316 break;
315317 }
316318 }
317319 else
318320 {
319 r.setPtr("hl._left", root);
321 r._left = root;
320322 r = root;
321323 root = null;
322324 break;
323325 }
324326 }
325327 else /* if(cmp > 0) */
326 { if ((t = (_dtlink_s) root.getPtr("right"))!=null )
328 { if ((t = (ST_dtlink_s) root.right)!=null )
327329 {
328 k = (lk < 0 ? t.castTo(_dthold_s.class).getPtr("obj") : t.addVirtualBytes(-lk) );
330 k = (lk < 0 ? t.castTo_ST_dthold_s().obj : t.addVirtualBytes(-lk) );
329331 k = sz < 0 ? ((__ptr__)k).addVirtualBytes(ky) : ((__ptr__)k).addVirtualBytes(ky);
330332 if((cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(dt,key,k,disc)
331333 : (sz <= 0 ? strcmp((CString)key,(CString)k) : UNSUPPORTED_INT("memcmp(key,k,sz))") ))) > 0)
332334 {
333 root.setPtr("right", t.getPtr("hl._left"));
334 t.setPtr("hl._left", root);
335 l.setPtr("right", t);
335 root.right = t._left;
336 t._left = root;
337 l.right = t;
336338 l = t;
337 if(N(root = (_dtlink_s) t.getPtr("right") ))
339 if(N(root = (ST_dtlink_s) t.right ))
338340 break;
339341 }
340342 else if(cmp == 0)
341 { l.setPtr("right", root);
343 { l.right = root;
342344 l = root;
343345 root = t;
344346 break;
345347 }
346348 else /* if(cmp < 0) */
347 { r.setPtr("hl._left", t);
349 { r._left = t;
348350 r = t;
349 l.setPtr("right", root);
351 l.right = root;
350352 l = root;
351 if(N(root = (_dtlink_s) t.getPtr("hl._left") ))
353 if(N(root = (ST_dtlink_s) t._left ))
352354 break;
353355 }
354356 }
355357 else
356 { l.setPtr("right", root);
358 { l.right = root;
357359 l = root;
358360 root = null;
359361 break;
363365 }
364366 if(root!=null)
365367 { /* found it, now isolate it */
366 dt.setInt("type", dt.getInt("type") | 0100000);
367 l.setPtr("right", root.getPtr("hl._left"));
368 r.setPtr("hl._left", root.getPtr("right"));
368 dt.setInt("type", dt.type | 0100000);
369 l.right = root._left;
370 r._left = root.right;
369371 if((type&(0000004|0001000))!=0)
370372 { /*has_root:*/
371373 throw new has_root();
372374 }
373375 else if((type&0000010)!=0)
374 { root.setPtr("hl._left", link.getPtr("right"));
375 root.setPtr("right", null);
376 link.setPtr("right", root);
376 { root._left = link.right;
377 root.right = null;
378 link.right = root;
377379 //dt_next:
378 if((root = (_dtlink_s) link.getPtr("hl._left"))!=null )
379 { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
380 root.setPtr("hl._left", t.getPtr("right"));
381 t.setPtr("right", root);
380 if((root = (ST_dtlink_s) link._left)!=null )
381 { while((t = (ST_dtlink_s) root._left)!=null ) {
382 root._left = t.right;
383 t.right = root;
382384 root = t;
383385 }
384 link.setPtr("hl._left", root.getPtr("right"));
386 link._left = root.right;
385387 throw new has_root();
386388 }
387389 else throw new no_root();
414416 // goto no_root;
415417 }
416418 else if((type&(0000001|0004000))!=0)
417 { if((dt.getPtr("meth").getInt("type")&0000004)!=0)
419 { if((dt.meth.type&0000004)!=0)
418420 throw new has_root();
419 else throw new UnsupportedOperationException();
420 // { root->hl._left = ((Dtlink_t*)0);
421 // root->right = link.hl._left;
422 // link.hl._left = root;
423 // goto dt_insert;
424 // }
421 else
422 {
423 root._left = null;
424 root.right = link._left;
425 link._left = root;
426 /*dt_insert: DUPLICATION*/
427 if(disc.makef!=null && (type&0000001)!=0)
428 obj = (__ptr__) disc.makef.exe(dt,obj,disc);
429 if(obj!=null)
430 {
431 if(lk >= 0)
432 root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
433 else
434 {
435 root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
436 dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
437 if(root!=null)
438 root.castTo(ST_dthold_s.class).setPtr("obj", obj);
439 else if(disc.makef!=null && disc.freef!=null &&
440 ((type&0000001))!=0)
441 UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
442 }
443 }
444 if(root!=null)
445 { if(dt.data.size >= 0)
446 dt.data.setInt("size", dt.data.size+1 );
447 throw new has_root();
448 }
449 else throw new UnsupportedOperationException("goto no_root");
450 }
425451 }
426452 else if((type&0000040)!=0) /* a duplicate */ {
427453 throw new UnsupportedOperationException();
442468 }
443469 else
444470 { /* not found, finish up LEFT and RIGHT trees */
445 r.setPtr("hl._left", null);
446 l.setPtr("right", null);
471 r._left = null;
472 l.right = null;
447473 if((type&0000010)!=0)
448474 {
449475 //goto dt_next:
450 if((root = (_dtlink_s) link.getPtr("hl._left"))!=null )
451 { while((t = (_dtlink_s) root.getPtr("hl._left"))!=null ) {
452 root.setPtr("hl._left", t.getPtr("right"));
453 t.setPtr("right", root);
476 if((root = (ST_dtlink_s) link._left)!=null )
477 { while((t = (ST_dtlink_s) root._left)!=null ) {
478 root._left = t.right;
479 t.right = root;
454480 root = t;
455481 }
456 link.setPtr("hl._left", root.getPtr("right"));
482 link._left = root.right;
457483 throw new has_root();
458484 }
459485 else throw new no_root();
466492 throw new no_root();
467493 }
468494 else if((type&(0000001|0004000))!=0)
469 { /*dt_insert:*/
470 if(disc.getPtr("makef")!=null && (type&0000001)!=0)
471 obj = (__ptr__) disc.call("makef", dt,obj,disc);
495 { /*dt_insert: DUPLICATION*/
496 if(disc.makef!=null && (type&0000001)!=0)
497 obj = (__ptr__) disc.makef.exe(dt,obj,disc);
472498 if(obj!=null)
473499 {
474500 if(lk >= 0)
475 root = (_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(_dtlink_s.class);
501 root = (ST_dtlink_s) ((__ptr__)obj.addVirtualBytes(lk)).castTo(ST_dtlink_s.class);
476502 else
477503 {
478 root = (_dtlink_s)(dt.call("memoryf",
479 dt,null,sizeof(_dthold_s.class),disc));
504 root = (ST_dtlink_s)(((ST_dthold_s)dt.memoryf.exe(
505 dt,null,sizeof(ST_dthold_s.class),disc)).castTo(ST_dtlink_s.class));
480506 if(root!=null)
481 root.castTo(_dthold_s.class).setPtr("obj", obj);
482 else if(disc.getPtr("makef")!=null && disc.getPtr("freef")!=null &&
507 root.castTo(ST_dthold_s.class).setPtr("obj", obj);
508 else if(disc.makef!=null && disc.freef!=null &&
483509 ((type&0000001))!=0)
484510 UNSUPPORTED("(*disc->freef)(dt,obj,disc);");
485511 }
486512 }
487513 if(root!=null)
488 { if(dt.getPtr("data").getInt("size") >= 0)
489 dt.getPtr("data").setInt("size", dt.getPtr("data").getInt("size")+1 );
514 { if(dt.data.size >= 0)
515 dt.data.setInt("size", dt.data.size+1 );
490516 throw new has_root();
491517 }
492518 else throw new UnsupportedOperationException("goto no_root");
493519 }
494520 else if((type&0000040)!=0)
495521 { root = me;
496 dt.getPtr("data").setInt("size", dt.getPtr("data").getInt("size")+1 );
522 dt.data.setInt("size", dt.data.size+1 );
497523 throw new UnsupportedOperationException("goto has_root");
498524 }
499525 else /*if(type&DT_DELETE)*/
504530 }
505531 // return ((void*)0);
506532 } catch (has_root has_root) {
507 root = (_dtlink_s) root.castTo(_dtlink_s.class);
508 root.setPtr("hl._left", link.getPtr("right"));
509 root.setPtr("right", link.getPtr("hl._left"));
510 if((dt.getPtr("meth").getInt("type")&0000010)!=0 && (type&(0000004|0001000))!=0 )
533 root = (ST_dtlink_s) root.castTo(ST_dtlink_s.class);
534 root._left = link.right;
535 root.right = link._left;
536 if((dt.meth.type&0000010)!=0 && (type&(0000004|0001000))!=0 )
511537 { //key = (lk < 0 ? ((Dthold_t*)(root))->obj : (void*)((char*)(root) - lk) ); key = (void*)(sz < 0 ? *((char**)((char*)(key)+ky)) : ((char*)(key)+ky));
512538 throw new UnsupportedOperationException();
513539 // while((t = root->hl._left) )
522548 // (((root)->hl._left = (t)->right, (t)->right = (root)), (root) = (t));
523549 // }
524550 }
525 dt.getPtr("data").setPtr("here", root);
526 return (lk < 0 ? root.castTo(_dthold_s.class).getPtr("obj") : root.addVirtualBytes(-lk));
551 dt.data.here = root;
552 return (lk < 0 ? root.castTo_ST_dthold_s().obj : root.addVirtualBytes(-lk));
527553 } catch (no_root no_root) {
528 while((t = (_dtlink_s) r.getPtr("hl._left"))!=null)
554 while((t = (ST_dtlink_s) r._left)!=null)
529555 r = t;
530 r.setPtr("hl._left", link.getPtr("right"));
531 dt.getPtr("data").setPtr("here", link.getPtr("hl._left"));
556 r._left = link.right;
557 dt.data.here = link._left;
532558 return (type&0000002)!=0 ? obj : null;
533559 }
534560 throw new UnsupportedOperationException();
5454 import static smetana.core.Macro.UNSUPPORTED;
5555 import static smetana.core.Macro.UNSUPPORTED_INT;
5656 import h.Dtcompar_f;
57 import h._dt_s;
57 import h.ST_dt_s;
5858 import smetana.core.CFunction;
5959 import smetana.core.CString;
6060 import smetana.core.__ptr__;
128128
129129 //3 6spidg45w8teb64726drdswaa
130130 // static void* dtvsearch(Dt_t* dt, register void* obj, register int type)
131 public static __ptr__ dtvsearch(_dt_s dt, __ptr__ obj, int type) {
131 public static __ptr__ dtvsearch(ST_dt_s dt, __ptr__ obj, int type) {
132132 ENTERING("6spidg45w8teb64726drdswaa","dtvsearch");
133133 try {
134 _dt_s d, p;
134 ST_dt_s d, p;
135135 __ptr__ o=null, n, ok, nk;
136136 int cmp, lk, sz, ky;
137137 Dtcompar_f cmpf;
138138 /* these operations only happen at the top level */
139139 if ((type&(0000001|0000002|0000100|0000040))!=0)
140 return (__ptr__) dt.getPtr("meth").call("searchf", dt, obj, type);
140 return (__ptr__) dt.meth.searchf.exe(dt, obj, type);
141141 if(((type&(0001000|0000004))!=0) || /* order sets first/last done below */
142 (((type&(0000200|0000400))!=0) && N(dt.getPtr("meth").getInt("type")&(0000010|0000004)) ) )
143 { for(d = dt; d!=null; d = (_dt_s) d.getPtr("view"))
144 if((o = (__ptr__) d.getPtr("meth").call("searchf", d,obj,type))!=null )
142 (((type&(0000200|0000400))!=0) && N(dt.meth.type&(0000010|0000004)) ) )
143 { for(d = dt; d!=null; d = (ST_dt_s) d.view)
144 if((o = (__ptr__) d.meth.searchf.exe(d,obj,type))!=null )
145145 break;
146146 dt.setPtr("walk", d);
147147 return o;
148148 }
149 if((dt.getPtr("meth").getInt("type") & (0000010|0000004) )!=0)
149 if((dt.meth.type & (0000010|0000004) )!=0)
150150 { if(N(type & (0000200|0000400|0000010|0000020)) )
151151 return null;
152152 n = nk = null; p = null;
153 for(d = dt; d!=null; d = (_dt_s) d.getPtr("view"))
154 { if(N(o = (__ptr__) d.getPtr("meth").call("searchf", d, obj, type) ))
153 for(d = dt; d!=null; d = (ST_dt_s) d.view)
154 { if(N(o = (__ptr__) d.meth.searchf.exe(d, obj, type) ))
155155 continue;
156 ky = d.getPtr("disc").getInt("key");
157 sz = d.getPtr("disc").getInt("size");
158 lk = d.getPtr("disc").getInt("link");
159 cmpf = (Dtcompar_f) d.getPtr("disc").getPtr("comparf");
156 ky = d.disc.key;
157 sz = d.disc.size;
158 lk = d.disc.link;
159 cmpf = (Dtcompar_f) d.disc.comparf;
160160 ok = (__ptr__) (sz < 0 ? ((__ptr__)o).addVirtualBytes(ky) : ((__ptr__)o).addVirtualBytes(ky));
161161 if(n!=null) /* get the right one among all dictionaries */
162 { cmp = (cmpf!=null ? (Integer)((CFunction)cmpf).exe(d,ok,nk,d.getPtr("disc")) : (sz <= 0 ? strcmp((CString)ok,(CString)nk) : UNSUPPORTED_INT("memcmp(ok,nk,sz)")) );
162 { 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)")) );
163163 if(((type & (0000010|0000200))!=0 && cmp < 0) ||
164164 ((type & (0000020|0000400))!=0 && cmp > 0) )
165165 UNSUPPORTED("5o3u9aaanyd9yh74sjfkkofmo"); // goto a_dj;
213213
214214 //3 dfryioch2xz35w8nq6lxbk5kh
215215 // Dt_t* dtview(register Dt_t* dt, register Dt_t* view)
216 public static _dt_s dtview(_dt_s dt, _dt_s view) {
216 public static ST_dt_s dtview(ST_dt_s dt, ST_dt_s view) {
217217 ENTERING("dfryioch2xz35w8nq6lxbk5kh","dtview");
218218 try {
219 _dt_s d;
220 if ((dt.getPtr("data").getInt("type")&010000)!=0) dtrestore(dt,null);
219 ST_dt_s d;
220 if ((dt.data.type&010000)!=0) dtrestore(dt,null);
221221 if(view!=null)
222 { if ((view.getPtr("data").getInt("type")&010000)!=0) dtrestore(view,null);
223 if(NEQ(view.getPtr("meth"), dt.getPtr("meth"))) /* must use the same method */
222 { if ((view.data.type&010000)!=0) dtrestore(view,null);
223 if(NEQ(view.meth, dt.meth)) /* must use the same method */
224224 UNSUPPORTED("return null;");
225225 }
226226 /* make sure there won't be a cycle */
227 for(d = view; d!=null; d = (_dt_s)d.getPtr("view"))
227 for(d = view; d!=null; d = (ST_dt_s)d.view)
228228 if(EQ(d, dt))
229229 return null;
230230 /* no more viewing lower dictionary */
231 if((d = (_dt_s)dt.getPtr("view"))!=null )
232 d.setInt("nview", d.getInt("nview")-1);
231 if((d = (ST_dt_s)dt.view)!=null )
232 d.setInt("nview", d.nview-1);
233233 dt.setPtr("walk", null);
234234 dt.setPtr("view", null);
235235 if(N(view))
236 { dt.setPtr("searchf", dt.getPtr("meth").getPtr("searchf"));
236 { dt.setPtr("searchf", dt.meth.searchf);
237237 return d;
238238 }
239239 /* ok */
240240 dt.setPtr("view", view);
241241 dt.setPtr("searchf", function(dtview__c.class, "dtvsearch"));
242 view.setInt("nview", view.getInt("nview")+1 );
242 view.setInt("nview", view.nview+1 );
243243 return view;
244244 } finally {
245245 LEAVING("dfryioch2xz35w8nq6lxbk5kh","dtview");
5555 import static smetana.core.Macro.AGTYPE;
5656 import static smetana.core.Macro.N;
5757 import static smetana.core.Macro.UNSUPPORTED;
58 import h.Agobj_s;
59 import h.Agraph_s;
58 import h.ST_Agobj_s;
59 import h.ST_Agraph_s;
6060 import smetana.core.CFunction;
6161 import smetana.core.__ptr__;
6262
229229
230230 //3 95y4aknoddh42lieikrb72vxw
231231 // static Agobj_t *subgraph_search(Agraph_t * sub, Agobj_t * g)
232 public static Agobj_s subgraph_search(Agraph_s sub, Agobj_s g) {
232 public static ST_Agobj_s subgraph_search(ST_Agraph_s sub, ST_Agobj_s g) {
233233 ENTERING("95y4aknoddh42lieikrb72vxw","subgraph_search");
234234 try {
235 return (Agobj_s) sub.castTo(Agobj_s.class);
235 return (ST_Agobj_s) sub.castTo_ST_Agobj_s();
236236 } finally {
237237 LEAVING("95y4aknoddh42lieikrb72vxw","subgraph_search");
238238 }
243243
244244 //3 8s9l15wqucf1glmbeb6fmya8e
245245 // static void rec_apply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, agobjsearchfn_t objsearch, int preorder)
246 public static void rec_apply(Agraph_s g, Agobj_s obj, CFunction fn, __ptr__ arg, CFunction objsearch, boolean preorder) {
246 public static void rec_apply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, CFunction objsearch, boolean preorder) {
247247 ENTERING("8s9l15wqucf1glmbeb6fmya8e","rec_apply");
248248 try {
249 Agraph_s sub;
250 Agobj_s subobj;
249 ST_Agraph_s sub;
250 ST_Agobj_s subobj;
251251 if (preorder)
252252 fn.exe(g, obj, arg);
253253 for (sub = agfstsubg(g); sub!=null; sub = agnxtsubg(sub)) {
254 if ((subobj = (Agobj_s) objsearch.exe(sub, obj))!=null)
254 if ((subobj = (ST_Agobj_s) objsearch.exe(sub, obj))!=null)
255255 rec_apply(sub, subobj, fn, arg, objsearch, preorder);
256256 }
257257 if (N(preorder))
266266
267267 //3 9hqql178zpl8iudlf6sgnv7aj
268268 // int agapply(Agraph_t * g, Agobj_t * obj, agobjfn_t fn, void *arg, int preorder)
269 public static int agapply(Agraph_s g, Agobj_s obj, CFunction fn, __ptr__ arg, boolean preorder) {
269 public static int agapply(ST_Agraph_s g, ST_Agobj_s obj, CFunction fn, __ptr__ arg, boolean preorder) {
270270 ENTERING("9hqql178zpl8iudlf6sgnv7aj","agapply");
271271 try {
272 Agobj_s subobj;
272 ST_Agobj_s subobj;
273273 CFunction objsearch=null;
274274 switch (AGTYPE(obj)) {
275275 case AGRAPH:
287287 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
288288 break;
289289 }
290 if ((subobj = (Agobj_s) objsearch.exe(g, obj))!=null) {
290 if ((subobj = (ST_Agobj_s) objsearch.exe(g, obj))!=null) {
291291 rec_apply(g, subobj, fn, arg, objsearch, preorder);
292292 return 0;
293293 } else
7474 import static smetana.core.Macro.AGTYPE;
7575 import static smetana.core.Macro.N;
7676 import static smetana.core.Macro.UNSUPPORTED;
77 import h.Agattr_s;
78 import h.Agdatadict_s;
79 import h.Agedge_s;
80 import h.Agnode_s;
81 import h.Agobj_s;
82 import h.Agraph_s;
83 import h.Agrec_s;
84 import h.Agsym_s;
77 import h.ST_Agattr_s;
78 import h.ST_Agdatadict_s;
8579 import h.ST_Agdesc_s;
80 import h.ST_Agedge_s;
81 import h.ST_Agnode_s;
82 import h.ST_Agobj_s;
83 import h.ST_Agraph_s;
84 import h.ST_Agrec_s;
85 import h.ST_Agsym_s;
8686 import h.ST_Agtag_s;
87 import h._dt_s;
88 import h._dtdisc_s;
87 import h.ST_dt_s;
88 import h.ST_dtdisc_s;
89
90 import java.util.ArrayList;
91
8992 import smetana.core.CString;
9093 import smetana.core.Memory;
9194 import smetana.core.Z;
261264
262265 //3 4bm10isw1qq1eqcse8afbxee3
263266 // Agdatadict_t *agdatadict(Agraph_t * g, int cflag)
264 public static Agdatadict_s agdatadict(Agraph_s g, boolean cflag) {
267 public static ST_Agdatadict_s agdatadict(ST_Agraph_s g, boolean cflag) {
265268 ENTERING("4bm10isw1qq1eqcse8afbxee3","agdatadict");
266269 try {
267 Agdatadict_s rv;
268 rv = (Agdatadict_s) aggetrec(g, DataDictName, false).castTo(Agdatadict_s.class);
270 ST_Agdatadict_s rv;
271 rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class);
269272 if (rv!=null || N(cflag))
270273 return rv;
271274 init_all_attrs(g);
272 rv = (Agdatadict_s) aggetrec(g, DataDictName, false).castTo(Agdatadict_s.class);
275 rv = (ST_Agdatadict_s) aggetrec(g, DataDictName, false).castTo(ST_Agdatadict_s.class);
273276 return rv;
274277 } finally {
275278 LEAVING("4bm10isw1qq1eqcse8afbxee3","agdatadict");
281284
282285 //3 2b2cg0am9e1lwc0nqikl2wczb
283286 // Dict_t *agdictof(Agraph_t * g, int kind)
284 public static _dt_s agdictof(Agraph_s g, int kind) {
287 public static ST_dt_s agdictof(ST_Agraph_s g, int kind) {
285288 ENTERING("2b2cg0am9e1lwc0nqikl2wczb","agdictof");
286289 try {
287 Agdatadict_s dd;
288 _dt_s dict;
290 ST_Agdatadict_s dd;
291 ST_dt_s dict;
289292 dd = agdatadict(g, false);
290293 if (dd!=null)
291294 switch (kind) {
292295 case AGRAPH:
293 dict = (_dt_s) dd.getPtr("dict.g");
296 dict = (ST_dt_s) dd.dict_g;
294297 break;
295298 case AGNODE:
296 dict = (_dt_s) dd.getPtr("dict.n");
299 dict = (ST_dt_s) dd.dict_n;
297300 break;
298301 case AGINEDGE:
299302 case AGOUTEDGE:
300 dict = (_dt_s) dd.getPtr("dict.e");
303 dict = (ST_dt_s) dd.dict_e;
301304 break;
302305 default:
303306 System.err.println("agdictof: unknown kind "+ kind);
316319
317320 //3 dbhw2q2jfsz9qwawchy0hxj4i
318321 // Agsym_t *agnewsym(Agraph_t * g, char *name, char *value, int id, int kind)
319 public static Agsym_s agnewsym(Agraph_s g, CString name, CString value, int id, int kind) {
322 public static ST_Agsym_s agnewsym(ST_Agraph_s g, CString name, CString value, int id, int kind) {
320323 ENTERING("dbhw2q2jfsz9qwawchy0hxj4i","agnewsym");
321324 try {
322 Agsym_s sym;
323 sym = (Agsym_s) agalloc(g, sizeof(Agsym_s.class));
325 ST_Agsym_s sym;
326 sym = (ST_Agsym_s) agalloc(g, sizeof(ST_Agsym_s.class));
324327 sym.setInt("kind", kind);
325328 sym.setPtr("name", agstrdup(g, name));
326329 sym.setPtr("defval", agstrdup(g, value));
358361
359362 //3 alb1d5x6huba3q44ms1wt0rr5
360363 // static Agdatadict_t *agmakedatadict(Agraph_t * g)
361 public static Agdatadict_s agmakedatadict(Agraph_s g) {
364 public static ST_Agdatadict_s agmakedatadict(ST_Agraph_s g) {
362365 ENTERING("alb1d5x6huba3q44ms1wt0rr5","agmakedatadict");
363366 try {
364 Agraph_s par;
365 Agdatadict_s parent_dd, dd;
366 dd = (Agdatadict_s) agbindrec(g, DataDictName, sizeof(Agdatadict_s.class),
367 false).castTo(Agdatadict_s.class);
368 dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
369 dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc.amp(),Z.z(). Dttree));
370 dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc.amp(), Z.z().Dttree));
367 ST_Agraph_s par;
368 ST_Agdatadict_s parent_dd, dd;
369 dd = (ST_Agdatadict_s) agbindrec(g, DataDictName, sizeof(ST_Agdatadict_s.class),
370 false).castTo(ST_Agdatadict_s.class);
371 dd.setPtr("dict.n", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree));
372 dd.setPtr("dict.e", agdtopen(g, Z.z().AgDataDictDisc,Z.z(). Dttree));
373 dd.setPtr("dict.g", agdtopen(g, Z.z().AgDataDictDisc, Z.z().Dttree));
371374 if ((par = agparent(g))!=null) {
372375 parent_dd = agdatadict(par, false);
373 dtview((_dt_s)dd.getPtr("dict.n"), (_dt_s)parent_dd.getPtr("dict.n"));
374 dtview((_dt_s)dd.getPtr("dict.e"), (_dt_s)parent_dd.getPtr("dict.e"));
375 dtview((_dt_s)dd.getPtr("dict.g"), (_dt_s)parent_dd.getPtr("dict.g"));
376 dtview((ST_dt_s)dd.dict_n, (ST_dt_s)parent_dd.dict_n);
377 dtview((ST_dt_s)dd.dict_e, (ST_dt_s)parent_dd.dict_e);
378 dtview((ST_dt_s)dd.dict_g, (ST_dt_s)parent_dd.dict_g);
376379 } else {
377380 if (Z.z().ProtoGraph!=null && NEQ(g, Z.z().ProtoGraph)) {
378381 /* it's not ok to dtview here for several reasons. the proto
379382 graph could change, and the sym indices don't match */
380383 parent_dd = agdatadict(Z.z().ProtoGraph, false);
381 agcopydict(parent_dd.getPtr("dict.n"), dd.getPtr("dict.n"), g, AGNODE);
382 agcopydict(parent_dd.getPtr("dict.e"), dd.getPtr("dict.e"), g, AGEDGE);
383 agcopydict(parent_dd.getPtr("dict.g"), dd.getPtr("dict.g"), g, AGRAPH);
384 agcopydict(parent_dd.dict_n, dd.dict_n, g, AGNODE);
385 agcopydict(parent_dd.dict_e, dd.dict_e, g, AGEDGE);
386 agcopydict(parent_dd.dict_g, dd.dict_g, g, AGRAPH);
384387 }
385388 }
386389 return dd;
394397
395398 //3 50wfzq5wy8wc7vuyvs3mrx5ct
396399 // Agsym_t *agdictsym(Dict_t * dict, char *name)
397 public static Agsym_s agdictsym(_dt_s dict, CString name) {
400 public static ST_Agsym_s agdictsym(ST_dt_s dict, CString name) {
398401 ENTERING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
399402 try {
400 Agsym_s key = (Agsym_s) Memory.malloc(Agsym_s.class);
403 ST_Agsym_s key = (ST_Agsym_s) Memory.malloc(ST_Agsym_s.class);
401404 key.setPtr("name", name);
402 return (Agsym_s) dict.call("searchf", (dict),key,0000004);
405 return (ST_Agsym_s) dict.searchf.exe((dict),key,0000004);
403406 } finally {
404407 LEAVING("50wfzq5wy8wc7vuyvs3mrx5ct","agdictsym");
405408 }
410413
411414 //3 4wy4ggu70d7harhix8xnh5w4l
412415 // Agsym_t *aglocaldictsym(Dict_t * dict, char *name)
413 public static Agsym_s aglocaldictsym(_dt_s dict, CString name) {
416 public static ST_Agsym_s aglocaldictsym(ST_dt_s dict, CString name) {
414417 ENTERING("4wy4ggu70d7harhix8xnh5w4l","aglocaldictsym");
415418 try {
416 Agsym_s rv;
417 _dt_s view;
419 ST_Agsym_s rv;
420 ST_dt_s view;
418421 view = dtview(dict, null);
419422 rv = agdictsym(dict, name);
420423 dtview(dict, view);
429432
430433 //3 8hy9sl3zmwobwm960jz466ufe
431434 // Agsym_t *agattrsym(void *obj, char *name)
432 public static Agsym_s agattrsym(__ptr__ obj, CString name) {
435 public static ST_Agsym_s agattrsym(__ptr__ obj, CString name) {
433436 ENTERING("8hy9sl3zmwobwm960jz466ufe","agattrsym");
434437 try {
435 Agattr_s data;
436 Agsym_s rv;
438 ST_Agattr_s data;
439 ST_Agsym_s rv;
437440 CString arg = name;
438 data = agattrrec(obj.castTo(Agobj_s.class));
441 data = agattrrec(obj.castTo(ST_Agobj_s.class));
439442 if (data!=null)
440 rv = agdictsym((_dt_s)data.getPtr("dict"), arg);
443 rv = agdictsym((ST_dt_s)data.dict, arg);
441444 else
442445 rv = null;
443446 return rv;
455458
456459 //3 6az8xu0sgu1d6abu0xfpd89hi
457460 // static int topdictsize(Agobj_t * obj)
458 public static int topdictsize(Agobj_s obj) {
461 public static int topdictsize(ST_Agobj_s obj) {
459462 ENTERING("6az8xu0sgu1d6abu0xfpd89hi","topdictsize");
460463 try {
461 _dt_s d;
464 ST_dt_s d;
462465 d = agdictof(agroot(agraphof(obj)), AGTYPE(obj));
463466 return d!=null ? dtsize_(d) : 0;
464467 } finally {
471474
472475 //3 3wjrlyjdlz8k9nfxenxsfiqmj
473476 // static Agrec_t *agmakeattrs(Agraph_t * context, void *obj)
474 public static Agrec_s agmakeattrs(Agraph_s context, __ptr__ obj) {
477 public static ST_Agrec_s agmakeattrs(ST_Agraph_s context, __ptr__ obj) {
475478 ENTERING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs");
476479 try {
477480 int sz;
478 Agattr_s rec;
479 Agsym_s sym;
480 _dt_s datadict;
481 rec = (Agattr_s) agbindrec(obj, AgDataRecName, sizeof(Agattr_s.class), false).castTo(Agattr_s.class);
481 ST_Agattr_s rec;
482 ST_Agsym_s sym;
483 ST_dt_s datadict;
484 rec = (ST_Agattr_s) agbindrec(obj, AgDataRecName, sizeof(ST_Agattr_s.class), false).castTo(ST_Agattr_s.class);
482485 datadict = agdictof(context, AGTYPE(obj));
483486
484487
485 if (rec.getPtr("dict") == null) {
486 rec.setPtr("dict", agdictof(agroot(context), AGTYPE(obj)));
488 if (rec.dict == null) {
489 rec.dict = agdictof(agroot(context), AGTYPE(obj));
487490 /* don't malloc(0) */
488 sz = topdictsize((Agobj_s) obj);
491 sz = topdictsize((ST_Agobj_s) obj.castTo(ST_Agobj_s.class));
489492 if (sz < 4)
490493 sz = 4;
491 rec.setPtr("str", agalloc(agraphof(obj), sizeof("char*", sz)));
494 rec.str = new ArrayList<CString>(); for (int i=0; i<sz; i++) rec.str.add(null);
492495 /* doesn't call agxset() so no obj-modified callbacks occur */
493 for (sym = (Agsym_s) ((__ptr__)datadict.call("searchf", datadict,null,0000200)); sym!=null;
494 sym = (Agsym_s) ((__ptr__)datadict.call("searchf", datadict,sym,0000010)))
495 rec.getArrayOfCString("str").plus(sym.getInt("id")).setCString( agstrdup(agraphof(obj), sym.getCString("defval")));
496 for (sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,null,0000200)); sym!=null;
497 sym = (ST_Agsym_s) ((__ptr__)datadict.searchf.exe(datadict,sym,0000010)))
498 rec.str.set(sym.id, agstrdup(agraphof(obj), sym.defval));
496499 } else {
497500 }
498 return (Agrec_s) rec;
501 return (ST_Agrec_s) rec.castTo(ST_Agrec_s.class);
499502 } finally {
500503 LEAVING("3wjrlyjdlz8k9nfxenxsfiqmj","agmakeattrs");
501504 }
526529
527530 //3 6b3c2syvj23lbf7kz0aal8vmc
528531 // static void freesym(Dict_t * d, void * obj, Dtdisc_t * disc)
529 public static void freesym(_dt_s d, Object obj, _dtdisc_s disc) {
532 public static void freesym(ST_dt_s d, Object obj, ST_dtdisc_s disc) {
530533 ENTERING("6b3c2syvj23lbf7kz0aal8vmc","freesym");
531534 try {
532535 UNSUPPORTED("bf9av4xbx61835st3og3wfqr8"); // static void freesym(Dict_t * d, void * obj, Dtdisc_t * disc)
551554
552555 //3 13sfx74lme08ur04vkrqta25j
553556 // Agattr_t *agattrrec(void *obj)
554 public static Agattr_s agattrrec(__ptr__ obj) {
557 public static ST_Agattr_s agattrrec(__ptr__ obj) {
555558 ENTERING("13sfx74lme08ur04vkrqta25j","agattrrec");
556559 try {
557 return (Agattr_s) aggetrec(obj, AgDataRecName, false).castTo(Agattr_s.class);
560 return (ST_Agattr_s) aggetrec(obj, AgDataRecName, false).castTo(ST_Agattr_s.class);
558561 } finally {
559562 LEAVING("13sfx74lme08ur04vkrqta25j","agattrrec");
560563 }
565568
566569 //3 2io7b26wq70e7kwdlzsh6bw7f
567570 // static void addattr(Agraph_t * g, Agobj_t * obj, Agsym_t * sym)
568 public static void addattr(Agraph_s g, Agobj_s obj, Agsym_s sym) {
571 public static void addattr(ST_Agraph_s g, ST_Agobj_s obj, ST_Agsym_s sym) {
569572 ENTERING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
570573 try {
571 Agattr_s attr;
572 attr = (Agattr_s) agattrrec(obj);
573
574 if (sym.getInt("id") >= 4)
575 attr.setPtr("str", (__ptr__) g.getPtr("clos").getPtr("disc").getPtr("mem").call("resize", g.getPtr("clos").getPtr("state").getPtr("mem"),
576 attr.getPtr("str"),
577 sizeof("char*", sym.getInt("id")),
578 sizeof("char*", sym.getInt("id") + 1)));
579 attr.getArrayOfCString("str").plus(sym.getInt("id")).setCString(agstrdup(g, sym.getCString("defval")));
574 ST_Agattr_s attr;
575 attr = (ST_Agattr_s) agattrrec(obj);
576
577 if (sym.id >= 4)
578 // attr.str = (StarArrayOfCString) g.clos.disc.mem.call("resize", g.clos.state.mem,
579 // attr.str,
580 // sizeof("char*", sym.id),
581 // sizeof("char*", sym.id + 1));
582 attr.str.add(null);
583 attr.str.set(sym.id, agstrdup(g, sym.defval));
580584 /* agmethod_upd(g,obj,sym); JCE and GN didn't like this. */
581585 } finally {
582586 LEAVING("2io7b26wq70e7kwdlzsh6bw7f","addattr");
588592
589593 //3 a3qr8ug1rkxp6ocieyp41ly3o
590594 // static Agsym_t *setattr(Agraph_t * g, int kind, char *name, char *value)
591 public static Agsym_s setattr(Agraph_s g, int kind, CString name, CString value) {
595 public static ST_Agsym_s setattr(ST_Agraph_s g, int kind, CString name, CString value) {
592596 ENTERING("a3qr8ug1rkxp6ocieyp41ly3o","setattr");
593597 try {
594 Agdatadict_s dd;
595 _dt_s ldict, rdict;
596 Agsym_s lsym, psym, rsym, rv;
597 Agraph_s root;
598 Agnode_s n;
599 Agedge_s e;
598 ST_Agdatadict_s dd;
599 ST_dt_s ldict, rdict;
600 ST_Agsym_s lsym, psym, rsym, rv;
601 ST_Agraph_s root;
602 ST_Agnode_s n;
603 ST_Agedge_s e;
600604
601605 root = agroot(g);
602606 dd = agdatadict(g, (N(0))); /* force initialization of string attributes */
603607 ldict = agdictof(g, kind);
604608 lsym = aglocaldictsym(ldict, name);
605609 if (lsym!=null) { /* update old local definiton */
606 agstrfree(g, lsym.getCString("defval"));
610 agstrfree(g, lsym.defval);
607611 lsym.setPtr("defval", agstrdup(g, value));
608612 rv = lsym;
609613 } else {
610614 psym = agdictsym(ldict, name); /* search with viewpath up to root */
611615 if (psym!=null) { /* new local definition */
612 lsym = agnewsym(g, name, value, psym.getInt("id"), kind);
613 ldict.castTo(_dt_s.class).call("searchf",ldict,lsym,0000001);
616 lsym = agnewsym(g, name, value, psym.id, kind);
617 ldict.searchf.exe(ldict,lsym,0000001);
614618 rv = lsym;
615619 } else { /* new global definition */
616620 rdict = agdictof(root, kind);
617621 rsym = agnewsym(g, name, value, dtsize_(rdict), kind);
618 rdict.castTo(_dt_s.class).call("searchf",rdict,rsym,0000001);
622 rdict.searchf.exe(rdict,rsym,0000001);
619623 switch (kind) {
620624 case AGRAPH:
621 agapply(root, (Agobj_s) root.castTo(Agobj_s.class), function(attr__c.class, "addattr"),
625 agapply(root, (ST_Agobj_s) root.castTo(ST_Agobj_s.class), function(attr__c.class, "addattr"),
622626 rsym, (N(0)));
623627 break;
624628 case AGNODE:
625629 for (n = agfstnode(root); n!=null; n = agnxtnode(root, n))
626 addattr(g, (Agobj_s) n.castTo(Agobj_s.class), rsym);
630 addattr(g, (ST_Agobj_s) n.castTo(ST_Agobj_s.class), rsym);
627631 break;
628632 case AGINEDGE:
629633 case AGOUTEDGE:
630634 for (n = agfstnode(root); n!=null; n = agnxtnode(root, n))
631635 for (e = agfstout(root, n); e!=null; e = agnxtout(root, e))
632 addattr(g, (Agobj_s) e.castTo(Agobj_s.class), rsym);
636 addattr(g, (ST_Agobj_s) e.castTo(ST_Agobj_s.class), rsym);
633637 break;
634638 }
635639 rv = rsym;
649653
650654 //3 8f80aahwb8cqc2t9592v47ttd
651655 // static Agsym_t *getattr(Agraph_t * g, int kind, char *name)
652 public static Agsym_s getattr(Agraph_s g, int kind, CString name) {
656 public static ST_Agsym_s getattr(ST_Agraph_s g, int kind, CString name) {
653657 ENTERING("8f80aahwb8cqc2t9592v47ttd","getattr");
654658 try {
655 Agsym_s rv = null;
656 _dt_s dict;
659 ST_Agsym_s rv = null;
660 ST_dt_s dict;
657661 dict = agdictof(g, kind);
658662 if (dict!=null)
659663 rv = agdictsym(dict, name); /* viewpath up to root */
668672
669673 //3 blr3drm2hxuzwd6gpeeb84yyg
670674 // Agsym_t *agattr(Agraph_t * g, int kind, char *name, char *value)
671 public static Agsym_s agattr(Agraph_s g, int kind, CString name, CString value) {
675 public static ST_Agsym_s agattr(ST_Agraph_s g, int kind, CString name, CString value) {
672676 ENTERING("blr3drm2hxuzwd6gpeeb84yyg","agattr");
673677 try {
674 Agsym_s rv;
678 ST_Agsym_s rv;
675679 if (g == null) {
676680 if (Z.z().ProtoGraph == null)
677 Z.z().ProtoGraph = agopen(null, Z.z().ProtoDesc.copy(), null);
681 Z.z().ProtoGraph = agopen(null, (ST_Agdesc_s) Z.z().ProtoDesc.copy(), null);
678682 g = Z.z().ProtoGraph;
679683 }
680684 if (value!=null)
715719
716720 //3 ex2qtmuwz0o2e5svkujdbux78
717721 // void agraphattr_init(Agraph_t * g)
718 public static void agraphattr_init(Agraph_s g) {
722 public static void agraphattr_init(ST_Agraph_s g) {
719723 ENTERING("ex2qtmuwz0o2e5svkujdbux78","agraphattr_init");
720724 try {
721725 /* Agdatadict_t *dd; */
722726 /* Agrec_t *attr; */
723 Agraph_s context;
724 ((ST_Agdesc_s)g.getStruct("desc")).has_attrs = 1;
727 ST_Agraph_s context;
728 ((ST_Agdesc_s)g.desc).has_attrs = 1;
725729 /* dd = */ agmakedatadict(g);
726730 if (N(context = agparent(g)))
727731 context = g;
763767
764768 //3 2pp4ot3pqy71jpfvu3g398y4y
765769 // void agnodeattr_init(Agraph_t * g, Agnode_t * n)
766 public static void agnodeattr_init(Agraph_s g, Agnode_s n) {
770 public static void agnodeattr_init(ST_Agraph_s g, ST_Agnode_s n) {
767771 ENTERING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init");
768772 try {
769 Agattr_s data;
770 data = (Agattr_s) agattrrec(n);
771 if ((N(data)) || (N(data.getPtr("dict"))))
773 ST_Agattr_s data;
774 data = (ST_Agattr_s) agattrrec(n);
775 if ((N(data)) || (N(data.dict)))
772776 agmakeattrs(g, n);
773777 } finally {
774778 LEAVING("2pp4ot3pqy71jpfvu3g398y4y","agnodeattr_init");
798802
799803 //3 ckfzmnxfi0jiiayxmq38giw0r
800804 // void agedgeattr_init(Agraph_t * g, Agedge_t * e)
801 public static void agedgeattr_init(Agraph_s g, Agedge_s e) {
805 public static void agedgeattr_init(ST_Agraph_s g, ST_Agedge_s e) {
802806 ENTERING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init");
803807 try {
804 Agattr_s data;
808 ST_Agattr_s data;
805809 data = agattrrec(e);
806 if ((N(data)) || (N(data.getPtr("dict"))))
810 if ((N(data)) || (N(data.dict)))
807811 agmakeattrs(g, e);
808812 } finally {
809813 LEAVING("ckfzmnxfi0jiiayxmq38giw0r","agedgeattr_init");
836840 public static CString agget(__ptr__ obj, CString name) {
837841 ENTERING("eydjyhexv5jr6vi7uhk0cgphv","agget");
838842 try {
839 Agsym_s sym;
840 Agattr_s data;
843 ST_Agsym_s sym;
844 ST_Agattr_s data;
841845 CString rv = null;
842846 sym = agattrsym(obj, name);
843847 if (sym == null)
844848 rv = null; /* note was "", but this provides more info */
845849 else {
846 data = agattrrec(obj.castTo(Agobj_s.class));
847 rv = data.getArrayOfCString("str").plus(sym.getInt("id")).getCString();
850 data = agattrrec(obj.castTo(ST_Agobj_s.class));
851 rv = data.str.get(sym.id);
848852 }
849853 return rv;
850854 } finally {
857861
858862 //3 9h5oymhfkp6k34zl0fonn10k9
859863 // char *agxget(void *obj, Agsym_t * sym)
860 public static CString agxget(__ptr__ obj, Agsym_s sym) {
864 public static CString agxget(__ptr__ obj, ST_Agsym_s sym) {
861865 ENTERING("9h5oymhfkp6k34zl0fonn10k9","agxget");
862866 try {
863 Agattr_s data;
867 ST_Agattr_s data;
864868 CString rv;
865 data = agattrrec(obj.castTo(Agobj_s.class));
866
867 rv = data.getArrayOfCString("str").plus(sym.getInt("id")).getCString();
869 data = agattrrec(obj.castTo(ST_Agobj_s.class));
870
871 rv = data.str.get(sym.id);
868872 return rv;
869873 } finally {
870874 LEAVING("9h5oymhfkp6k34zl0fonn10k9","agxget");
897901
898902 //3 4q8xvstvl6fbijhucfd1endxc
899903 // int agxset(void *obj, Agsym_t * sym, char *value)
900 public static int agxset(__ptr__ obj, Agsym_s sym, CString value) {
904 public static int agxset(__ptr__ obj, ST_Agsym_s sym, CString value) {
901905 ENTERING("4q8xvstvl6fbijhucfd1endxc","agxset");
902906 try {
903 Agraph_s g;
904 Agobj_s hdr;
905 Agattr_s data;
906 Agsym_s lsym;
907 ST_Agraph_s g;
908 ST_Agobj_s hdr;
909 ST_Agattr_s data;
910 ST_Agsym_s lsym;
907911 g = agraphof(obj);
908 hdr = (Agobj_s) obj.castTo(Agobj_s.class);
912 hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class);
909913 data = agattrrec(hdr);
910914
911 agstrfree(g, data.getArrayOfCString("str").plus(sym.getInt("id")).getCString());
912 data.getArrayOfCString("str").plus(sym.getInt("id")).setCString(agstrdup(g, value));
913 if (((ST_Agtag_s)hdr.getStruct("tag")).objtype == AGRAPH) {
915 agstrfree(g, data.str.get(sym.id));
916 data.str.set(sym.id, agstrdup(g, value));
917 if (((ST_Agtag_s)hdr.tag).objtype == AGRAPH) {
914918 /* also update dict default */
915 _dt_s dict;
916 dict = (_dt_s) agdatadict(g, false).getPtr("dict.g");
917 if ((lsym = aglocaldictsym(dict, sym.getCString("name")))!=null) {
918 agstrfree(g, lsym.getCString("defval"));
919 ST_dt_s dict;
920 dict = (ST_dt_s) agdatadict(g, false).dict_g;
921 if ((lsym = aglocaldictsym(dict, sym.name))!=null) {
922 agstrfree(g, lsym.defval);
919923 lsym.setPtr("defval", agstrdup(g, value));
920924 } else {
921 lsym = agnewsym(g, sym.getCString("name"), value, sym.getInt("id"), AGTYPE(hdr));
922 dict.call("searchf", dict, lsym, 0000001);
925 lsym = agnewsym(g, sym.name, value, sym.id, AGTYPE(hdr));
926 dict.searchf.exe(dict, lsym, 0000001);
923927 }
924928 }
925929 agmethod_upd(g, obj, sym);
937941 public static int agsafeset(__ptr__ obj, CString name, CString value, CString def) {
938942 ENTERING("9b7vn95cin8o7mb2f21exh1qr","agsafeset");
939943 try {
940 Agsym_s a;
944 ST_Agsym_s a;
941945 a = agattr(agraphof(obj), AGTYPE(obj), name, null);
942946 if (N(a))
943947 a = agattr(agraphof(obj), AGTYPE(obj), name, def);
7878 import static smetana.core.Macro.N;
7979 import static smetana.core.Macro.NOT;
8080 import static smetana.core.Macro.UNSUPPORTED;
81 import h.Agattr_s;
82 import h.Agedge_s;
83 import h.Agedgepair_s;
84 import h.Agnode_s;
85 import h.Agraph_s;
86 import h.Agsubnode_s;
87 import h.Agtag_s;
81 import h.ST_Agattr_s;
8882 import h.ST_Agdesc_s;
83 import h.ST_Agedge_s;
84 import h.ST_Agedgepair_s;
85 import h.ST_Agnode_s;
86 import h.ST_Agraph_s;
87 import h.ST_Agsubnode_s;
8988 import h.ST_Agtag_s;
90 import h._dt_s;
91 import h._dtdisc_s;
92 import h._dtlink_s;
89 import h.ST_dt_s;
90 import h.ST_dtdisc_s;
91 import h.ST_dtlink_s;
9392 import smetana.core.ACCESS;
9493 import smetana.core.CString;
95 import smetana.core.JUtils;
96 import smetana.core.Memory;
9794 import smetana.core.STARSTAR;
9895 import smetana.core.Z;
9996 import smetana.core.__ptr__;
100 import smetana.core.__struct__;
10197
10298 public class edge__c {
10399 //1 9k44uhd5foylaeoekf3llonjq
240236
241237 //3 9vamtktowqtk4955i546z9obw
242238 // Agedge_t *agfstout(Agraph_t * g, Agnode_t * n)
243 public static Agedge_s agfstout(Agraph_s g, Agnode_s n) {
239 public static ST_Agedge_s agfstout(ST_Agraph_s g, ST_Agnode_s n) {
244240 ENTERING("9vamtktowqtk4955i546z9obw","agfstout");
245241 try {
246 Agsubnode_s sn;
247 Agedge_s e = null;
242 ST_Agsubnode_s sn;
243 ST_Agedge_s e = null;
248244 sn = agsubrep(g, n);
249245 if (sn!=null) {
250 dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("out_seq"));
251 e = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200);
252 sn.setPtr("out_seq", dtextract((_dt_s)g.getPtr("e_seq")));
246 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
247 e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
248 sn.out_seq = dtextract((ST_dt_s)g.e_seq);
253249 }
254250 return e;
255251 } finally {
262258
263259 //3 1qh7mgqwomkdqvczauv4ex1lu
264260 // Agedge_t *agnxtout(Agraph_t * g, Agedge_t * e)
265 public static Agedge_s agnxtout(Agraph_s g, Agedge_s e) {
261 public static ST_Agedge_s agnxtout(ST_Agraph_s g, ST_Agedge_s e) {
266262 ENTERING("1qh7mgqwomkdqvczauv4ex1lu","agnxtout");
267263 try {
268 Agnode_s n;
269 Agsubnode_s sn;
270 Agedge_s f = null;
264 ST_Agnode_s n;
265 ST_Agsubnode_s sn;
266 ST_Agedge_s f = null;
271267 n = AGTAIL(e);
272268 sn = agsubrep(g, n);
273269 if (sn!=null) {
274 dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("out_seq"));
275 f = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010);
276 sn.setPtr("out_seq", dtextract((_dt_s)g.getPtr("e_seq")));
270 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.out_seq);
271 f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
272 sn.out_seq = dtextract((ST_dt_s)g.e_seq);
277273 }
278274 return f;
279275 } finally {
286282
287283 //3 c60qt3ycq0xweabgtqt16xe93
288284 // Agedge_t *agfstin(Agraph_t * g, Agnode_t * n)
289 public static Agedge_s agfstin(Agraph_s g, Agnode_s n) {
285 public static ST_Agedge_s agfstin(ST_Agraph_s g, ST_Agnode_s n) {
290286 ENTERING("c60qt3ycq0xweabgtqt16xe93","agfstin");
291287 try {
292 Agsubnode_s sn;
293 Agedge_s e = null;
288 ST_Agsubnode_s sn;
289 ST_Agedge_s e = null;
294290 sn = agsubrep(g, n);
295291 if (sn!=null) {
296 dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("in_seq"));
297 e = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),null,0000200);
298 sn.setPtr("in_seq", dtextract((_dt_s)g.getPtr("e_seq")));
292 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
293 e = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,null,0000200);
294 sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
299295 }
300296 return e;
301297 } finally {
308304
309305 //3 f2af4x97mqn16npd6alsw7avs
310306 // Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e)
311 public static Agedge_s agnxtin(Agraph_s g, Agedge_s e) {
307 public static ST_Agedge_s agnxtin(ST_Agraph_s g, ST_Agedge_s e) {
312308 ENTERING("f2af4x97mqn16npd6alsw7avs","agnxtin");
313309 try {
314 Agnode_s n;
315 Agsubnode_s sn;
316 Agedge_s f = null;
310 ST_Agnode_s n;
311 ST_Agsubnode_s sn;
312 ST_Agedge_s f = null;
317313 n = AGHEAD(e);
318314 sn = agsubrep(g, n);
319315 if (sn!=null) {
320 dtrestore((_dt_s)g.getPtr("e_seq"), (_dtlink_s)sn.getPtr("in_seq"));
321 f = (Agedge_s) g.getPtr("e_seq").castTo(_dt_s.class).call("searchf", g.getPtr("e_seq"),e,0000010);
322 sn.setPtr("in_seq", dtextract((_dt_s)g.getPtr("e_seq")));
316 dtrestore((ST_dt_s)g.e_seq, (ST_dtlink_s)sn.in_seq);
317 f = (ST_Agedge_s) g.e_seq.searchf.exe(g.e_seq,e,0000010);
318 sn.setPtr("in_seq", dtextract((ST_dt_s)g.e_seq));
323319 }
324320 return f;
325321 } finally {
332328
333329 //3 6nwyo5bklramr0d093aa1h25o
334330 // Agedge_t *agfstedge(Agraph_t * g, Agnode_t * n)
335 public static Agedge_s agfstedge(Agraph_s g, Agnode_s n) {
331 public static ST_Agedge_s agfstedge(ST_Agraph_s g, ST_Agnode_s n) {
336332 ENTERING("6nwyo5bklramr0d093aa1h25o","agfstedge");
337333 try {
338 Agedge_s rv;
334 ST_Agedge_s rv;
339335 rv = agfstout(g, n);
340336 if (rv == null)
341337 rv = agfstin(g, n);
350346
351347 //3 8zy2u6gsi2xzv2ffv8o4v4uvf
352348 // Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n)
353 public static Agedge_s agnxtedge(Agraph_s g, Agedge_s e, Agnode_s n) {
349 public static ST_Agedge_s agnxtedge(ST_Agraph_s g, ST_Agedge_s e, ST_Agnode_s n) {
354350 ENTERING("8zy2u6gsi2xzv2ffv8o4v4uvf","agnxtedge");
355351 try {
356 Agedge_s rv;
352 ST_Agedge_s rv;
357353 if (AGTYPE(e) == AGOUTEDGE) {
358354 rv = agnxtout(g, e);
359355 if (rv == null) {
360356 do {
361357 rv = N(rv) ? agfstin(g, n) : agnxtin(g,rv);
362 } while (rv!=null && EQ(rv.getPtr("node"), n));
358 } while (rv!=null && EQ(rv.node, n));
363359 }
364360 } else {
365361 do {
366362 rv = agnxtin(g, e); /* so that we only see each edge once, */
367363 e = rv;
368 } while (rv!=null && EQ(rv.getPtr("node"), n)); /* ignore loops as in-edges */
364 } while (rv!=null && EQ(rv.node, n)); /* ignore loops as in-edges */
369365 }
370366 return rv;
371367 } finally {
378374
379375 //3 c175o6j61jqmfnl4o1g1h1mie
380376 // static Agedge_t *agfindedge_by_key(Agraph_t * g, Agnode_t * t, Agnode_t * h, Agtag_t key)
381 public static Agedge_s agfindedge_by_key(Agraph_s g, Agnode_s t, Agnode_s h, final __struct__<Agtag_s> key) {
377 public static ST_Agedge_s agfindedge_by_key(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, final ST_Agtag_s key) {
382378 // WARNING!! STRUCT
383 return agfindedge_by_key_w_(g, t, h, key.copy());
384 }
385 private static Agedge_s agfindedge_by_key_w_(Agraph_s g, Agnode_s t, Agnode_s h, final __struct__<Agtag_s> key) {
379 return agfindedge_by_key_w_(g, t, h, (ST_Agtag_s) key.copy());
380 }
381 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) {
386382 ENTERING("c175o6j61jqmfnl4o1g1h1mie","agfindedge_by_key");
387383 try {
388 Agedge_s e, template = (Agedge_s) Memory.malloc(Agedge_s.class);
389 Agsubnode_s sn;
384 ST_Agedge_s e;
385 final ST_Agedge_s template = new ST_Agedge_s();
386 ST_Agsubnode_s sn;
390387 if ((t == null) || (h == null))
391388 return null;
392 template.getStruct("base").setStruct("tag", key);
389 template.base.setStruct("tag", key);
393390 template.setPtr("node", t); /* guess that fan-in < fan-out */
394391 sn = agsubrep(g, h);
395392 if (N(sn)) e = null;
396393 else {
397 dtrestore((_dt_s)g.getPtr("e_id"), (_dtlink_s)sn.getPtr("in_id"));
398 e = (Agedge_s) ((__ptr__)g.getPtr("e_id").castTo(_dt_s.class).call("searchf", g.getPtr("e_id"),template,0000004));
399 if (e!=null) e = (Agedge_s) e.castTo(Agedge_s.class);
400 sn.setPtr("in_id", dtextract((_dt_s)g.getPtr("e_id")));
394 dtrestore((ST_dt_s)g.e_id, (ST_dtlink_s)sn.in_id);
395 e = ((ST_Agedge_s)g.e_id.searchf.exe(g.e_id,template,0000004));
396 sn.setPtr("in_id", dtextract((ST_dt_s)g.e_id));
401397 }
402398 return e;
403399 } finally {
429425
430426 //3 b32ssm6ex1pdz1b3nt4fwlhul
431427 // Agsubnode_t *agsubrep(Agraph_t * g, Agnode_t * n)
432 public static Agsubnode_s agsubrep(Agraph_s g, Agnode_s n) {
428 public static ST_Agsubnode_s agsubrep(ST_Agraph_s g, ST_Agnode_s n) {
433429 ENTERING("b32ssm6ex1pdz1b3nt4fwlhul","agsubrep");
434430 try {
435 Agsubnode_s sn;
436 final __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
437 if (EQ(g, n.getPtr("root"))) sn = (Agsubnode_s) n.getStruct("mainsub").amp();
431 ST_Agsubnode_s sn;
432 final ST_Agsubnode_s template = new ST_Agsubnode_s();
433 if (EQ(g, n.root)) sn = (ST_Agsubnode_s) n.mainsub;
438434 else {
439435 template.setPtr("node", n);
440 sn = (Agsubnode_s) g.getPtr("n_id").castTo(_dt_s.class).call("searchf", g.getPtr("n_id"), template.amp(), 0000004);
436 sn = (ST_Agsubnode_s) g.n_id.searchf.exe(g.n_id, template, 0000004);
441437 }
442438 return sn;
443439 } finally {
450446
451447 //3 6u0niow33w9gva780waluva4n
452448 // static void ins(Dict_t * d, Dtlink_t ** set, Agedge_t * e)
453 public static void ins(_dt_s d, STARSTAR<_dtlink_s> set, Agedge_s e) {
449 public static void ins(ST_dt_s d, STARSTAR<ST_dtlink_s> set, ST_Agedge_s e) {
454450 ENTERING("6u0niow33w9gva780waluva4n","ins");
455451 try {
456452 dtrestore(d, set.getMe());
457 d.call("searchf", d,e,0000001);
453 d.searchf.exe(d,e,0000001);
458454 set.setMe(dtextract(d));
459455 } finally {
460456 LEAVING("6u0niow33w9gva780waluva4n","ins");
484480
485481 //3 8kizmg7gziussfgx8zs3qvkfw
486482 // static void installedge(Agraph_t * g, Agedge_t * e)
487 public static void installedge(Agraph_s g, Agedge_s e) {
483 public static void installedge(ST_Agraph_s g, ST_Agedge_s e) {
488484 ENTERING("8kizmg7gziussfgx8zs3qvkfw","installedge");
489485 try {
490 Agnode_s t, h;
491 Agedge_s out, in;
492 Agsubnode_s sn;
486 ST_Agnode_s t, h;
487 ST_Agedge_s out, in;
488 ST_Agsubnode_s sn;
493489 out = AGMKOUT(e);
494490 in = AGMKIN(e);
495491 t = agtail(e);
496492 h = aghead(e);
497493 while (g!=null) {
498494 if (agfindedge_by_key(g, t, h, AGTAG(e))!=null) break;
499 sn = agsubrep(g, t); final Agsubnode_s sn1 = sn;
500 ins((_dt_s)g.getPtr("e_seq"),
501 STARSTAR.amp(new ACCESS<_dtlink_s>() {
502 public _dtlink_s get() {
503 return (_dtlink_s) sn1.getPtr("out_seq");
495 sn = agsubrep(g, t); final ST_Agsubnode_s sn1 = sn;
496 ins((ST_dt_s)g.e_seq,
497 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
498 public ST_dtlink_s get() {
499 return (ST_dtlink_s) sn1.out_seq;
504500 }
505 public void set(_dtlink_s obj) {
501 public void set(ST_dtlink_s obj) {
506502 sn1.setPtr("out_seq", obj);
507503 }})
508 , (Agedge_s)out);
509 ins((_dt_s)g.getPtr("e_id"),
510 STARSTAR.amp(new ACCESS<_dtlink_s>() {
511 public _dtlink_s get() {
512 return (_dtlink_s) sn1.getPtr("out_id");
504 , (ST_Agedge_s)out);
505 ins((ST_dt_s)g.e_id,
506 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
507 public ST_dtlink_s get() {
508 return (ST_dtlink_s) sn1.out_id;
513509 }
514 public void set(_dtlink_s obj) {
510 public void set(ST_dtlink_s obj) {
515511 sn1.setPtr("out_id", obj);
516512 }})
517 , (Agedge_s)out);
518 sn = agsubrep(g, h); final Agsubnode_s sn2 = sn;
519 ins((_dt_s)g.getPtr("e_seq"),
520 STARSTAR.amp(new ACCESS<_dtlink_s>() {
521 public _dtlink_s get() {
522 return (_dtlink_s) sn2.getPtr("in_seq");
513 , (ST_Agedge_s)out);
514 sn = agsubrep(g, h); final ST_Agsubnode_s sn2 = sn;
515 ins((ST_dt_s)g.e_seq,
516 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
517 public ST_dtlink_s get() {
518 return (ST_dtlink_s) sn2.in_seq;
523519 }
524 public void set(_dtlink_s obj) {
520 public void set(ST_dtlink_s obj) {
525521 sn2.setPtr("in_seq", obj);
526522 }})
527 , (Agedge_s)in);
528 ins((_dt_s)g.getPtr("e_id"),
529 STARSTAR.amp(new ACCESS<_dtlink_s>() {
530 public _dtlink_s get() {
531 return (_dtlink_s) sn2.getPtr("in_id");
523 , (ST_Agedge_s)in);
524 ins((ST_dt_s)g.e_id,
525 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
526 public ST_dtlink_s get() {
527 return (ST_dtlink_s) sn2.in_id;
532528 }
533 public void set(_dtlink_s obj) {
529 public void set(ST_dtlink_s obj) {
534530 sn2.setPtr("in_id", obj);
535531 }})
536 , (Agedge_s)in);
532 , (ST_Agedge_s)in);
537533 g = agparent(g);
538534 }
539535 } finally {
561557
562558 //3 4rzjui6oo0k009o64bxwgjmvq
563559 // static Agedge_t *newedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, unsigned long id)
564 public static Agedge_s newedge(Agraph_s g, Agnode_s t, Agnode_s h, int id) {
560 public static ST_Agedge_s newedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, int id) {
565561 ENTERING("4rzjui6oo0k009o64bxwgjmvq","newedge");
566562 try {
567 Agedgepair_s e2;
568 Agedge_s in, out;
563 ST_Agedgepair_s e2;
564 ST_Agedge_s in, out;
569565 int seq;
570566 agsubnode(g,t,(N(0)));
571567 agsubnode(g,h,(N(0)));
572 e2 = (Agedgepair_s) agalloc(g, sizeof(Agedgepair_s.class));
573 in = (Agedge_s) e2.getStruct("in").amp();
574 out = (Agedge_s) e2.getStruct("out").amp();
568 e2 = (ST_Agedgepair_s) agalloc(g, sizeof(ST_Agedgepair_s.class));
569 in = (ST_Agedge_s) e2.in;
570 out = (ST_Agedge_s) e2.out;
575571 seq = agnextseq(g, AGEDGE);
576572 AGTYPE(in, AGINEDGE);
577573 AGTYPE(out, AGOUTEDGE);
582578 in.setPtr("node", t);
583579 out.setPtr("node", h);
584580 installedge(g, out);
585 if (((ST_Agdesc_s)g.getStruct("desc")).has_attrs!=0) {
586 agbindrec(out, AgDataRecName, sizeof(Agattr_s.class), false);
581 if (((ST_Agdesc_s)g.desc).has_attrs!=0) {
582 agbindrec(out, AgDataRecName, sizeof(ST_Agattr_s.class), false);
587583 agedgeattr_init(g, out);
588584 }
589585 agmethod_init(g, out);
598594
599595 //3 1ufxhg5xnmll1pe5339477823
600596 // static int ok_to_make_edge(Agraph_t * g, Agnode_t * t, Agnode_t * h)
601 public static boolean ok_to_make_edge(Agraph_s g, Agnode_s t, Agnode_s h) {
597 public static boolean ok_to_make_edge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h) {
602598 ENTERING("1ufxhg5xnmll1pe5339477823","ok_to_make_edge");
603599 try {
604 final __struct__<Agtag_s> key = JUtils.from(Agtag_s.class);
600 final ST_Agtag_s key = new ST_Agtag_s();
605601 /* protect against self, multi-edges in strict graphs */
606602 if (agisstrict(g)) {
607 if (g.getPtr("desc").getBoolean("no_loop") && (EQ(t, h))) /* simple graphs */
603 if (g.desc.no_loop!=0 && (EQ(t, h))) /* simple graphs */
608604 return false;
609605 key.___(Z.z().Tag);
610606 key.setInt("objtype", 0); /* wild card */
652648
653649 //3 4361pvzr3ozft2ov0fgx6t8bo
654650 // Agedge_t *agedge(Agraph_t * g, Agnode_t * t, Agnode_t * h, char *name, int cflag)
655 public static Agedge_s agedge(Agraph_s g, Agnode_s t, Agnode_s h, CString name, boolean cflag) {
651 public static ST_Agedge_s agedge(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, CString name, boolean cflag) {
656652 ENTERING("4361pvzr3ozft2ov0fgx6t8bo","agedge");
657653 try {
658 Agedge_s e;
654 ST_Agedge_s e;
659655 int id[] = new int[1];
660656 int have_id;
661657 have_id = agmapnametoid(g, AGEDGE, name, id, false);
765761
766762 //3 30v8z3tlda81fbqbkzx6m9fkn
767763 // Agedge_t *agsubedge(Agraph_t * g, Agedge_t * e, int cflag)
768 public static Agedge_s agsubedge(Agraph_s g, Agedge_s e, boolean cflag) {
764 public static ST_Agedge_s agsubedge(ST_Agraph_s g, ST_Agedge_s e, boolean cflag) {
769765 ENTERING("30v8z3tlda81fbqbkzx6m9fkn","agsubedge");
770766 try {
771 Agnode_s t, h;
772 Agedge_s rv;
767 ST_Agnode_s t, h;
768 ST_Agedge_s rv;
773769 rv = null;
774770 t = agsubnode(g, AGTAIL(e), cflag);
775771 h = agsubnode(g, AGHEAD(e), cflag);
793789
794790 //3 avk47eh26r45qk2dtoipwiqvz
795791 // int agedgeidcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
796 public static int agedgeidcmpf(_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, _dtdisc_s disc) {
792 public static int agedgeidcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
797793 ENTERING("avk47eh26r45qk2dtoipwiqvz","agedgeidcmpf");
798794 try {
799795 int v;
800 Agedge_s e0, e1;
801 e0 = (Agedge_s) arg_e0;
802 e1 = (Agedge_s) arg_e1;
803 v = AGID(e0.getPtr("node")) - AGID(e1.getPtr("node"));
796 ST_Agedge_s e0, e1;
797 e0 = (ST_Agedge_s) arg_e0;
798 e1 = (ST_Agedge_s) arg_e1;
799 v = AGID(e0.node) - AGID(e1.node);
804800 if (v == 0) { /* same node */
805801 if ((AGTYPE(e0) == 0) || (AGTYPE(e1) == 0))
806802 v = 0;
818814
819815 //3 b6jhzc16xvrknu4e7jp6zx0ue
820816 // int agedgeseqcmpf(Dict_t * d, void *arg_e0, void *arg_e1, Dtdisc_t * disc)
821 public static int agedgeseqcmpf(_dt_s d, __ptr__ arg_e0, __ptr__ arg_e1, _dtdisc_s disc) {
817 public static int agedgeseqcmpf(ST_dt_s d, ST_Agedge_s arg_e0, ST_Agedge_s arg_e1, ST_dtdisc_s disc) {
822818 ENTERING("b6jhzc16xvrknu4e7jp6zx0ue","agedgeseqcmpf");
823819 try {
824820 int v;
825 Agedge_s e0, e1;
826 e0 = (Agedge_s) arg_e0;
827 e1 = (Agedge_s) arg_e1;
828 if (NEQ(e0.getPtr("node"), e1.getPtr("node"))) v = AGSEQ(e0.getPtr("node")) - AGSEQ(e1.getPtr("node"));
821 ST_Agedge_s e0, e1;
822 e0 = (ST_Agedge_s) arg_e0;
823 e1 = (ST_Agedge_s) arg_e1;
824 if (NEQ(e0.node, e1.node)) v = AGSEQ(e0.node) - AGSEQ(e1.node);
829825 else v = (AGSEQ(e0) - AGSEQ(e1));
830826 return ((v==0)?0:(v<0?-1:1));
831827 } finally {
899895
900896 //3 ceexs6t1q4jxwz6h0g8fszxp4
901897 // Agnode_t *agtail(Agedge_t * e)
902 public static Agnode_s agtail(Agedge_s e) {
898 public static ST_Agnode_s agtail(ST_Agedge_s e) {
903899 ENTERING("ceexs6t1q4jxwz6h0g8fszxp4","agtail");
904900 try {
905901 return AGTAIL(e);
913909
914910 //3 3tj9gj3dvrpox6grrdd3rftd8
915911 // Agnode_t *aghead(Agedge_t * e)
916 public static Agnode_s aghead(__ptr__ e) {
912 public static ST_Agnode_s aghead(__ptr__ e) {
917913 ENTERING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
918914 try {
919 return AGHEAD((Agedge_s) e);
915 return AGHEAD((ST_Agedge_s) e);
920916 } finally {
921917 LEAVING("3tj9gj3dvrpox6grrdd3rftd8","aghead");
922918 }
927923
928924 //3 15e6s5bh5hey2u79yoebir59w
929925 // Agedge_t *agopp(Agedge_t * e)
930 public static Agedge_s agopp(__ptr__ e) {
926 public static ST_Agedge_s agopp(__ptr__ e) {
931927 ENTERING("15e6s5bh5hey2u79yoebir59w","agopp");
932928 try {
933 return AGOPP((Agedge_s) e);
929 return AGOPP((ST_Agedge_s) e);
934930 } finally {
935931 LEAVING("15e6s5bh5hey2u79yoebir59w","agopp");
936932 }
6868 import static smetana.core.Macro.N;
6969 import static smetana.core.Macro.NOT;
7070 import static smetana.core.Macro.UNSUPPORTED;
71 import h.Agclos_s;
72 import h.Agdesc_s;
73 import h.Agdisc_s;
74 import h.Agmemdisc_s;
75 import h.Agnode_s;
76 import h.Agraph_s;
77 import h.Agsubnode_s;
71 import h.ST_Agclos_s;
7872 import h.ST_Agdesc_s;
79 import h._dt_s;
80 import h._dtdisc_s;
81 import h._dtlink_s;
73 import h.ST_Agdisc_s;
74 import h.ST_Agmemdisc_s;
75 import h.ST_Agnode_s;
76 import h.ST_Agraph_s;
77 import h.ST_Agsubnode_s;
78 import h.ST_dt_s;
79 import h.ST_dtdisc_s;
80 import h.ST_dtlink_s;
8281 import smetana.core.ACCESS;
8382 import smetana.core.CString;
8483 import smetana.core.STARSTAR;
8584 import smetana.core.Z;
8685 import smetana.core.__ptr__;
87 import smetana.core.__struct__;
8886
8987 public class graph__c {
9088 //1 9k44uhd5foylaeoekf3llonjq
227225
228226 //3 bb2bu9iyqx0u6xx44l282vmch
229227 // static Agclos_t *agclos(Agdisc_t * proto)
230 public static Agclos_s agclos(Agdisc_s proto) {
228 public static ST_Agclos_s agclos(ST_Agdisc_s proto) {
231229 ENTERING("bb2bu9iyqx0u6xx44l282vmch","agclos");
232230 try {
233 Agmemdisc_s memdisc;
231 ST_Agmemdisc_s memdisc;
234232 __ptr__ memclosure;
235 Agclos_s rv;
233 ST_Agclos_s rv;
236234 /* establish an allocation arena */
237 memdisc = (Agmemdisc_s) ((proto != null && proto.getPtr("mem") != null) ? proto.getPtr("mem") : Z.z().AgMemDisc.amp());
238 memclosure = (__ptr__) memdisc.call("open", proto);
239 rv = (Agclos_s) memdisc.call("alloc", memclosure, sizeof(Agclos_s.class));
240 rv.getStruct("disc").setPtr("mem", memdisc);
241 rv.getStruct("state").setPtr("mem", memclosure);
242 rv.getStruct("disc").setPtr("id", ((proto != null && proto.getPtr("id") != null) ? proto.getPtr("id") : Z.z().AgIdDisc.amp()));
235 memdisc = (ST_Agmemdisc_s) ((proto != null && proto.mem != null) ? proto.mem : Z.z().AgMemDisc);
236 memclosure = (__ptr__) memdisc.open.exe(proto);
237 rv = (ST_Agclos_s) memdisc.alloc.exe(memclosure, sizeof(ST_Agclos_s.class));
238 rv.disc.setPtr("mem", memdisc);
239 rv.state.setPtr("mem", memclosure);
240 rv.disc.setPtr("id", ((proto != null && proto.id != null) ? proto.id : Z.z().AgIdDisc));
243241 // Translation bug in next line: should be AgIoDisc and not AgIdDisc
244 // rv.getStruct("disc").setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIdDisc.amp()));
245 rv.setBoolean("callbacks_enabled", (N(0)));
242 // rv.disc.setPtr("io", ((proto != null && proto.getPtr("io") != null) ? proto.getPtr("io") : Z.z().AgIoDisc));
243 rv.callbacks_enabled = (N(0));
246244 return rv;
247245 } finally {
248246 LEAVING("bb2bu9iyqx0u6xx44l282vmch","agclos");
254252
255253 //3 d5yqn56yii8cdoahswt4n6bug
256254 // Agraph_t *agopen(char *name, Agdesc_t desc, Agdisc_t * arg_disc)
257 public static Agraph_s agopen(CString name, final __struct__<Agdesc_s> desc, Agdisc_s arg_disc) {
255 public static ST_Agraph_s agopen(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
258256 // WARNING!! STRUCT
259 return agopen_w_(name, desc.copy(), arg_disc);
260 }
261 private static Agraph_s agopen_w_(CString name, final __struct__<Agdesc_s> desc, Agdisc_s arg_disc) {
257 return agopen_w_(name, (ST_Agdesc_s) desc.copy(), arg_disc);
258 }
259 private static ST_Agraph_s agopen_w_(CString name, final ST_Agdesc_s desc, ST_Agdisc_s arg_disc) {
262260 ENTERING("d5yqn56yii8cdoahswt4n6bug","agopen");
263261 try {
264 Agraph_s g;
265 Agclos_s clos;
262 ST_Agraph_s g;
263 ST_Agclos_s clos;
266264 int gid[] = new int[1];
267265 clos = agclos(arg_disc);
268 g = (Agraph_s) clos.getStruct("disc").getPtr("mem").call("alloc", clos.getStruct("state").getPtr("mem"), sizeof(Agraph_s.class));
266 g = (ST_Agraph_s) clos.disc.mem.alloc.exe(clos.state.mem, sizeof(ST_Agraph_s.class));
269267 AGTYPE(g, AGRAPH);
270268 g.setPtr("clos", clos);
271269 g.setStruct("desc", desc);
272 ((ST_Agdesc_s)g.getStruct("desc")).maingraph = ASINT((N(0)));
270 ((ST_Agdesc_s)g.desc).maingraph = ASINT((N(0)));
273271 g.setPtr("root", g);
274 g.getPtr("clos").getStruct("state").setPtr("id", (__ptr__) g.getPtr("clos").getStruct("disc").getPtr("id").call("open", g, arg_disc));
272 g.clos.state.setPtr("id", (__ptr__) g.clos.disc.id.open.exe(g, arg_disc));
275273 if (agmapnametoid(g, AGRAPH, name, gid, (N(0)))!=0)
276274 AGID(g, gid[0]);
277275 // /* else AGID(g) = 0 because we have no alternatives */
288286
289287 //3 8jyhwfdfm0a877qfz8cjlb8rk
290288 // Agraph_t *agopen1(Agraph_t * g)
291 public static Agraph_s agopen1(Agraph_s g) {
289 public static ST_Agraph_s agopen1(ST_Agraph_s g) {
292290 ENTERING("8jyhwfdfm0a877qfz8cjlb8rk","agopen1");
293291 try {
294 Agraph_s par;
295 g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc.amp(), Z.z().Dttree));
296 g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc.amp(), Z.z().Dttree));
297 g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc.amp() : Z.z().Ag_subedge_seq_disc.amp(), Z.z().Dttree));
298 g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc.amp() : Z.z().Ag_subedge_id_disc.amp(), Z.z().Dttree));
299 g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc.amp(), Z.z().Dttree));
292 ST_Agraph_s par;
293 g.setPtr("n_seq", agdtopen(g, Z.z().Ag_subnode_seq_disc, Z.z().Dttree));
294 g.setPtr("n_id", agdtopen(g, Z.z().Ag_subnode_id_disc, Z.z().Dttree));
295 g.setPtr("e_seq", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_seq_disc : Z.z().Ag_subedge_seq_disc, Z.z().Dttree));
296 g.setPtr("e_id", agdtopen(g, EQ(g, agroot(g))? Z.z().Ag_mainedge_id_disc : Z.z().Ag_subedge_id_disc, Z.z().Dttree));
297 g.setPtr("g_dict", agdtopen(g, Z.z().Ag_subgraph_id_disc, Z.z().Dttree));
300298 par = agparent(g);
301299 if (par!=null) {
302300 AGSEQ(g, agnextseq(par, AGRAPH));
303 par.getPtr("g_dict").call("searchf", par.getPtr("g_dict"),g,0000001);
301 par.g_dict.searchf.exe(par.g_dict,g,0000001);
304302 } /* else AGSEQ=0 */
305 if (N(par) || ((ST_Agdesc_s)par.getStruct("desc")).has_attrs!=0)
303 if (N(par) || ((ST_Agdesc_s)par.desc).has_attrs!=0)
306304 agraphattr_init(g);
307305 agmethod_init(g, g);
308306 return g;
380378
381379 //3 axmdmml95l55vlp1vqmh0v5sn
382380 // unsigned long agnextseq(Agraph_t * g, int objtype)
383 public static int agnextseq(Agraph_s g, int objtype) {
381 public static int agnextseq(ST_Agraph_s g, int objtype) {
384382 ENTERING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
385383 try {
386 int tmp = g.getPtr("clos").getArrayOfInteger("seq").plus(objtype).getInt();
384 int tmp = g.clos.seq[objtype];
387385 tmp++;
388 g.getPtr("clos").getArrayOfInteger("seq").plus(objtype).setInt(tmp);
386 g.clos.seq[objtype]=tmp;
389387 return tmp;
390388 } finally {
391389 LEAVING("axmdmml95l55vlp1vqmh0v5sn","agnextseq");
397395
398396 //3 688euygrkbl10cveflgwalo2n
399397 // int agnnodes(Agraph_t * g)
400 public static int agnnodes(Agraph_s g) {
398 public static int agnnodes(ST_Agraph_s g) {
401399 ENTERING("688euygrkbl10cveflgwalo2n","agnnodes");
402400 try {
403 return dtsize_((_dt_s)g.getPtr("n_id"));
401 return dtsize_((ST_dt_s)g.n_id);
404402 } finally {
405403 LEAVING("688euygrkbl10cveflgwalo2n","agnnodes");
406404 }
411409
412410 //3 8zjne7uv8rfpmbv5t96zhnr4u
413411 // int agnedges(Agraph_t * g)
414 public static int agnedges(Agraph_s g) {
412 public static int agnedges(ST_Agraph_s g) {
415413 ENTERING("8zjne7uv8rfpmbv5t96zhnr4u","agnedges");
416414 try {
417 Agnode_s n;
415 ST_Agnode_s n;
418416 int rv = 0;
419417 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
420418 rv += agdegree(g, n, (false), (N(0))); /* must use OUT to get self-arcs */
443441
444442 //3 blvn1w3v0icnucu5m5xvbrba1
445443 // int agisdirected(Agraph_t * g)
446 public static boolean agisdirected(Agraph_s g) {
444 public static boolean agisdirected(ST_Agraph_s g) {
447445 ENTERING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
448446 try {
449 return ((ST_Agdesc_s)g.getStruct("desc")).directed!=0;
447 return ((ST_Agdesc_s)g.desc).directed!=0;
450448 } finally {
451449 LEAVING("blvn1w3v0icnucu5m5xvbrba1","agisdirected");
452450 }
457455
458456 //3 8thgds4eioot64flko26m8ns0
459457 // int agisundirected(Agraph_t * g)
460 public static boolean agisundirected(Agraph_s g) {
458 public static boolean agisundirected(ST_Agraph_s g) {
461459 ENTERING("8thgds4eioot64flko26m8ns0","agisundirected");
462460 try {
463461 return (NOT(agisdirected(g)));
471469
472470 //3 9qgdebmdfrcfjm394bg59a7y5
473471 // int agisstrict(Agraph_t * g)
474 public static boolean agisstrict(Agraph_s g) {
472 public static boolean agisstrict(ST_Agraph_s g) {
475473 ENTERING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
476474 try {
477 return ((ST_Agdesc_s)g.getStruct("desc")).strict!=0;
475 return ((ST_Agdesc_s)g.desc).strict!=0;
478476 } finally {
479477 LEAVING("9qgdebmdfrcfjm394bg59a7y5","agisstrict");
480478 }
499497
500498 //3 abaldeo2ie6zi60cazxp7rv47
501499 // static int cnt(Dict_t * d, Dtlink_t ** set)
502 public static int cnt(_dt_s d, STARSTAR<_dtlink_s> set) {
500 public static int cnt(ST_dt_s d, STARSTAR<ST_dtlink_s> set) {
503501 ENTERING("abaldeo2ie6zi60cazxp7rv47","cnt");
504502 try {
505503 int rv;
543541
544542 //3 2bz40qf0qo7pd6er1ut25gthp
545543 // int agdegree(Agraph_t * g, Agnode_t * n, int want_in, int want_out)
546 public static int agdegree(Agraph_s g, Agnode_s n, boolean want_in, boolean want_out) {
544 public static int agdegree(ST_Agraph_s g, ST_Agnode_s n, boolean want_in, boolean want_out) {
547545 ENTERING("2bz40qf0qo7pd6er1ut25gthp","agdegree");
548546 try {
549 Agsubnode_s sn;
547 ST_Agsubnode_s sn;
550548 int rv = 0;
551549 sn = agsubrep(g, n);
552 final Agsubnode_s sn1 = sn;
550 final ST_Agsubnode_s sn1 = sn;
553551 if (sn!=null) {
554 if (want_out) rv += cnt((_dt_s)g.getPtr("e_seq"),
555 STARSTAR.amp(new ACCESS<_dtlink_s>() {
556 public _dtlink_s get() {
557 return (_dtlink_s) sn1.getPtr("out_seq");
552 if (want_out) rv += cnt((ST_dt_s)g.e_seq,
553 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
554 public ST_dtlink_s get() {
555 return (ST_dtlink_s) sn1.out_seq;
558556 }
559 public void set(_dtlink_s obj) {
557 public void set(ST_dtlink_s obj) {
560558 sn1.setPtr("out_seq", obj);
561559 }})
562560 );
563 if (want_in) rv += cnt((_dt_s)g.getPtr("e_seq"),
564 STARSTAR.amp(new ACCESS<_dtlink_s>() {
565 public _dtlink_s get() {
566 return (_dtlink_s) sn1.getPtr("in_seq");
561 if (want_in) rv += cnt((ST_dt_s)g.e_seq,
562 STARSTAR.amp(new ACCESS<ST_dtlink_s>() {
563 public ST_dtlink_s get() {
564 return (ST_dtlink_s) sn1.in_seq;
567565 }
568 public void set(_dtlink_s obj) {
566 public void set(ST_dtlink_s obj) {
569567 sn1.setPtr("in_seq", obj);
570568 }})
571569 );
581579
582580 //3 dhbtfzzp8n5yygqmhmluo9bxl
583581 // int agraphidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
584 public static int agraphidcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
582 public static int agraphidcmpf(ST_dt_s d, ST_Agraph_s arg0, ST_Agraph_s arg1, ST_dtdisc_s disc) {
585583 ENTERING("dhbtfzzp8n5yygqmhmluo9bxl","agraphidcmpf");
586584 try {
587585 int v;
588 Agraph_s sg0, sg1;
589 sg0 = (Agraph_s) arg0;
590 sg1 = (Agraph_s) arg1;
586 ST_Agraph_s sg0, sg1;
587 sg0 = (ST_Agraph_s) arg0;
588 sg1 = (ST_Agraph_s) arg1;
591589 v = (AGID(sg0) - AGID(sg1));
592590 return ((v==0)?0:(v<0?-1:1));
593591 } finally {
5757 import static smetana.core.Macro.ASINT;
5858 import static smetana.core.Macro.N;
5959 import static smetana.core.Macro.UNSUPPORTED;
60 import h.Agdisc_s;
61 import h.Agobj_s;
62 import h.Agraph_s;
60 import h.ST_Agdisc_s;
61 import h.ST_Agobj_s;
62 import h.ST_Agraph_s;
6363 import smetana.core.CString;
6464 import smetana.core.Memory;
6565 import smetana.core.Z;
202202
203203 //3 a0a2zxsu8n019hzm1rwf1jc7f
204204 // static void *idopen(Agraph_t * g, Agdisc_t* disc)
205 public static Object idopen(Agraph_s g, Agdisc_s disc) {
205 public static Object idopen(ST_Agraph_s g, ST_Agdisc_s disc) {
206206 ENTERING("a0a2zxsu8n019hzm1rwf1jc7f","idopen");
207207 try {
208208 return g;
222222 try {
223223 CString s;
224224 if (str!=null) {
225 Agraph_s g;
226 g = (Agraph_s) state;
225 ST_Agraph_s g;
226 g = (ST_Agraph_s) state;
227227 if (createflag)
228228 s = agstrdup(g, str);
229229 else
335335
336336 //3 aq30wwcj4ugatsgx0zdtdmeed
337337 // int agmapnametoid(Agraph_t * g, int objtype, char *str, unsigned long *result, int createflag)
338 public static int agmapnametoid(Agraph_s g, int objtype, CString str, int result[], boolean createflag) {
338 public static int agmapnametoid(ST_Agraph_s g, int objtype, CString str, int result[], boolean createflag) {
339339 ENTERING("aq30wwcj4ugatsgx0zdtdmeed","agmapnametoid");
340340 try {
341341 int rv;
342342 if (str!=null && (str.charAt(0) != '%')) {
343 rv = (Integer) g.getPtr("clos").getStruct("disc").getPtr("id").call("map", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, str, result, createflag);
343 rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, str, result, createflag);
344344 if (rv!=0)
345345 return rv;
346346 }
353353 rv = 0;
354354 if (createflag) {
355355 /* get a new anonymous ID, and store in the internal map */
356 rv = (Integer) g.getPtr("clos").getStruct("disc").getPtr("id").call("map", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, null, result,
356 rv = (Integer) g.clos.disc.id.map.exe(g.clos.state.id, objtype, null, result,
357357 createflag);
358358 if (rv!=0 && str!=null)
359359 aginternalmapinsert(g, objtype, str, result[0]);
402402 public static CString agnameof(__ptr__ obj) {
403403 ENTERING("cctsybrl54fy799aynfej4iiy","agnameof");
404404 try {
405 Agraph_s g;
405 ST_Agraph_s g;
406406 CString rv;
407407 /* perform internal lookup first */
408408 g = agraphof(obj);
409409 if ((rv = aginternalmapprint(g, AGTYPE(obj), AGID(obj)))!=null)
410410 return rv;
411 if (g.getPtr("clos").getStruct("disc").getPtr("id").getPtr("print")!=null) {
411 if (g.clos.disc.id.print!=null) {
412412 if ((rv =
413 (CString) g.getPtr("clos").getStruct("disc").getPtr("id").call("print", g.getPtr("clos").getStruct("state").getPtr("id"),
413 (CString) g.clos.disc.id.print.exe(g.clos.state.id,
414414 AGTYPE(obj),
415415 AGID(obj)))!=null)
416416 return rv;
417417 }
418418 if (AGTYPE(obj) != AGEDGE) {
419 rv = new CString("%"+obj.castTo(Agobj_s.class).getStruct("tag").getInt("id"));
419 rv = new CString("%"+((ST_Agobj_s)obj.castTo(ST_Agobj_s.class)).tag.id);
420420 }
421421 else
422422 rv = null;
431431
432432 //3 emt63ldde99jnwe2vvjal9kt9
433433 // void agregister(Agraph_t * g, int objtype, void *obj)
434 public static void agregister(Agraph_s g, int objtype, Object obj) {
434 public static void agregister(ST_Agraph_s g, int objtype, Object obj) {
435435 ENTERING("emt63ldde99jnwe2vvjal9kt9","agregister");
436436 try {
437 g.getPtr("clos").getStruct("disc").getPtr("id").call("idregister", g.getPtr("clos").getStruct("state").getPtr("id"), objtype, obj);
437 g.clos.disc.id.idregister.exe(g.clos.state.id, objtype, obj);
438438 } finally {
439439 LEAVING("emt63ldde99jnwe2vvjal9kt9","agregister");
440440 }
4848 import static smetana.core.Macro.AGEDGE;
4949 import static smetana.core.Macro.AGINEDGE;
5050 import static smetana.core.Macro.UNSUPPORTED;
51 import h.Agraph_s;
52 import h.IMapEntry_t;
53 import h._dt_s;
51 import h.ST_Agraph_s;
52 import h.ST_IMapEntry_t;
53 import h.ST_dt_s;
5454 import smetana.core.CString;
55 import smetana.core.Memory;
5655
5756 public class imap__c {
5857 //1 9k44uhd5foylaeoekf3llonjq
238237
239238 //3 mx2krtbgfhcihopw9rw8kcv3
240239 // int aginternalmaplookup(Agraph_t * g, int objtype, char *str, unsigned long *result)
241 public static int aginternalmaplookup(Agraph_s g, int objtype, CString str, int result[]) {
240 public static int aginternalmaplookup(ST_Agraph_s g, int objtype, CString str, int result[]) {
242241 ENTERING("mx2krtbgfhcihopw9rw8kcv3","aginternalmaplookup");
243242 try {
244243 UNSUPPORTED("9xuzgjxqveawe6v2n4x48r93l"); // int aginternalmaplookup(Agraph_t * g, int objtype, char *str,
302301
303302 //3 3r16pkjiksv8i7o961ltxyge6
304303 // static IMapEntry_t *find_isym(Agraph_t * g, int objtype, unsigned long id)
305 public static IMapEntry_t find_isym(Agraph_s g, int objtype, int id) {
304 public static ST_IMapEntry_t find_isym(ST_Agraph_s g, int objtype, int id) {
306305 ENTERING("3r16pkjiksv8i7o961ltxyge6","find_isym");
307306 try {
308 _dt_s d;
309 IMapEntry_t isym, itemplate = (IMapEntry_t) Memory.malloc(IMapEntry_t.class);
307 ST_dt_s d;
308 ST_IMapEntry_t isym, itemplate = new ST_IMapEntry_t();
310309 if (objtype == AGINEDGE)
311310 objtype = AGEDGE;
312 if ((d = (_dt_s) g.getPtr("clos").getArrayOfPtr("lookup_by_id").plus(objtype).getPtr())!=null) {
311 if ((d = g.clos.lookup_by_id[objtype])!=null) {
313312 itemplate.setInt("id", id);
314 isym = (IMapEntry_t) UNSUPPORTED("(IMapEntry_t *) (*(((Dt_t*)(d))->searchf))((d),(void*)(&itemplate),0000004)");
313 isym = (ST_IMapEntry_t) UNSUPPORTED("(IMapEntry_t *) (*(((Dt_t*)(d))->searchf))((d),(void*)(&itemplate),0000004)");
315314 } else
316315 isym = null;
317316 return isym;
325324
326325 //3 foe6bvtujfevsc0f3m8aqln8
327326 // char *aginternalmapprint(Agraph_t * g, int objtype, unsigned long id)
328 public static CString aginternalmapprint(Agraph_s g, int objtype, int id) {
327 public static CString aginternalmapprint(ST_Agraph_s g, int objtype, int id) {
329328 ENTERING("foe6bvtujfevsc0f3m8aqln8","aginternalmapprint");
330329 try {
331 IMapEntry_t isym;
330 ST_IMapEntry_t isym;
332331 if ((isym = find_isym(g, objtype, id))!=null)
333 return isym.getCString("str");
332 return isym.str;
334333 return null;
335334 } finally {
336335 LEAVING("foe6bvtujfevsc0f3m8aqln8","aginternalmapprint");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.Agdisc_s;
50 import h.Agraph_s;
49 import h.ST_Agdisc_s;
50 import h.ST_Agraph_s;
5151 import smetana.core.__ptr__;
5252 import smetana.core.size_t;
5353
188188
189189 //3 akq0jgwdspf75ypeatgcnfn8w
190190 // static void *memopen(Agdisc_t* disc)
191 public static Object memopen(Agdisc_s disc) {
191 public static Object memopen(ST_Agdisc_s disc) {
192192 ENTERING("akq0jgwdspf75ypeatgcnfn8w","memopen");
193193 try {
194194 return null;
218218
219219 //3 18v2hhjculhnb3b7fc4tx3yjw
220220 // static void *memresize(void *heap, void *ptr, size_t oldsize, size_t request)
221 public static Object memresize(Object... arg) {
222 UNSUPPORTED("1s6udii0nias7f8g4vimpkefh"); // static void *memresize(void *heap, void *ptr, size_t oldsize,
223 UNSUPPORTED("8zs6530gai5ogf503wd0333qh"); // size_t request)
224 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
225 UNSUPPORTED("5ccnu5m92hidffpixzo964tna"); // void *rv;
226 UNSUPPORTED("74rq74mh7lnfr9i3qmwsbx2hd"); // (void) heap;
227 UNSUPPORTED("ebomd3babnm180zhyrfeg59wi"); // rv = realloc(ptr, request);
228 UNSUPPORTED("bzgpl0js1bzsovafg9g24v4ya"); // if (request > oldsize)
229 UNSUPPORTED("9cjvc6kya9bwic7bue6mcj8yf"); // memset((char *) rv + oldsize, 0, request - oldsize);
230 UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
231 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
232
233 throw new UnsupportedOperationException();
221 public static __ptr__ memresize(__ptr__ heap, __ptr__ ptr, size_t oldsize, size_t request) {
222 ENTERING("18v2hhjculhnb3b7fc4tx3yjw","memresize");
223 try {
224 request.realloc(ptr);
225 return ptr;
226 } finally {
227 LEAVING("18v2hhjculhnb3b7fc4tx3yjw","memresize");
228 }
229 //UNSUPPORTED("1s6udii0nias7f8g4vimpkefh"); // static void *memresize(void *heap, void *ptr, size_t oldsize,
230 //UNSUPPORTED("8zs6530gai5ogf503wd0333qh"); // size_t request)
231 //UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
232 //UNSUPPORTED("5ccnu5m92hidffpixzo964tna"); // void *rv;
233 //UNSUPPORTED("74rq74mh7lnfr9i3qmwsbx2hd"); // (void) heap;
234 //UNSUPPORTED("ebomd3babnm180zhyrfeg59wi"); // rv = realloc(ptr, request);
235 //UNSUPPORTED("bzgpl0js1bzsovafg9g24v4ya"); // if (request > oldsize)
236 //UNSUPPORTED("9cjvc6kya9bwic7bue6mcj8yf"); // memset((char *) rv + oldsize, 0, request - oldsize);
237 //UNSUPPORTED("v7vqc9l7ge2bfdwnw11z7rzi"); // return rv;
238 //UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
239 //
240 //throw new UnsupportedOperationException();
234241 }
235242
236243
264271
265272 //3 7newv1hmzvt4vtttc9cxdxfpn
266273 // void *agalloc(Agraph_t * g, size_t size)
267 public static __ptr__ agalloc(Agraph_s g, size_t size) {
274 public static __ptr__ agalloc(ST_Agraph_s g, size_t size) {
268275 ENTERING("7newv1hmzvt4vtttc9cxdxfpn","agalloc");
269276 try {
270277 __ptr__ mem;
271 mem = (__ptr__) g.getPtr("clos").getStruct("disc").getPtr("mem").call("alloc", g.getPtr("clos").getStruct("state").getPtr("mem"), size);
278 mem = (__ptr__) g.clos.disc.mem.alloc.exe(g.clos.state.mem, size);
272279 if (mem == null)
273280 System.err.println("memory allocation failure");
274281 return mem;
6767 import static smetana.core.Macro.AGTYPE;
6868 import static smetana.core.Macro.N;
6969 import static smetana.core.Macro.UNSUPPORTED;
70 import h.Agattr_s;
71 import h.Agnode_s;
72 import h.Agraph_s;
73 import h.Agsubnode_s;
70 import h.ST_Agattr_s;
7471 import h.ST_Agdesc_s;
72 import h.ST_Agnode_s;
73 import h.ST_Agraph_s;
74 import h.ST_Agsubnode_s;
7575 import h.ST_Agtag_s;
76 import h._dt_s;
77 import h._dtdisc_s;
76 import h.ST_dt_s;
77 import h.ST_dtdisc_s;
7878 import smetana.core.CString;
7979 import smetana.core.Z;
8080 import smetana.core.__ptr__;
214214
215215
216216
217 //private static __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
218 //private static __struct__<Agnode_s> dummy = JUtils.from(Agnode_s.class);
217219 //3 4w89du6uel405pm3vxsr3ayxt
218220 // Agnode_t *agfindnode_by_id(Agraph_t * g, unsigned long id)
219 //private static __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
220 //private static __struct__<Agnode_s> dummy = JUtils.from(Agnode_s.class);
221 public static Agnode_s agfindnode_by_id(Agraph_s g, int id) {
221 public static ST_Agnode_s agfindnode_by_id(ST_Agraph_s g, int id) {
222222 ENTERING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
223223 try {
224 Agsubnode_s sn;
225 ((ST_Agtag_s)Z.z().dummy.getStruct("base").getStruct("tag")).id = id;
226 Z.z().template.setPtr("node", Z.z().dummy.amp());
227 sn = (Agsubnode_s) (g.getPtr("n_id").call("searchf", g.getPtr("n_id"), Z.z().template.amp(),0000004));
228 return (Agnode_s) (sn!=null ? sn.getPtr("node") : null);
224 ST_Agsubnode_s sn;
225 ((ST_Agtag_s)Z.z().dummy.base.tag).id = id;
226 Z.z().template.node = Z.z().dummy;
227 sn = (ST_Agsubnode_s) (g.n_id.searchf.exe(g.n_id, Z.z().template,0000004));
228 return (ST_Agnode_s) (sn!=null ? sn.node : null);
229229 } finally {
230230 LEAVING("4w89du6uel405pm3vxsr3ayxt","agfindnode_by_id");
231231 }
254254
255255 //3 55wopi2gd93zpmycxoywlxm0y
256256 // Agnode_t *agfstnode(Agraph_t * g)
257 public static Agnode_s agfstnode(Agraph_s g) {
257 public static ST_Agnode_s agfstnode(ST_Agraph_s g) {
258258 ENTERING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
259259 try {
260 Agsubnode_s sn;
261 sn = (Agsubnode_s) g.getPtr("n_seq").castTo(_dt_s.class).call("searchf", g.getPtr("n_seq"),null,0000200);
262 return sn!=null ? (Agnode_s) sn.getPtr("node") : null;
260 ST_Agsubnode_s sn;
261 sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,null,0000200);
262 return sn!=null ? (ST_Agnode_s) sn.node : null;
263263 } finally {
264264 LEAVING("55wopi2gd93zpmycxoywlxm0y","agfstnode");
265265 }
271271 //3 bek79ccvjys1j9q404i3y6oh8
272272 // Agnode_t *agnxtnode(Agraph_t * g, Agnode_t * n)
273273 public static int NB = 0;
274 public static Agnode_s agnxtnode(Agraph_s g, Agnode_s n) {
274 public static ST_Agnode_s agnxtnode(ST_Agraph_s g, ST_Agnode_s n) {
275275 ENTERING("bek79ccvjys1j9q404i3y6oh8","agnxtnode");
276276 try {
277277 //ZOOTO
280280 }
281281 NB++;
282282 LOG2("NB="+NB);
283 Agsubnode_s sn;
283 ST_Agsubnode_s sn;
284284 sn = agsubrep(g, n);
285285 LOG2("sn1="+sn);
286 if (sn!=null) sn = (Agsubnode_s) g.getPtr("n_seq").castTo(_dt_s.class).call("searchf", g.getPtr("n_seq"),sn,0000010);
286 if (sn!=null) sn = (ST_Agsubnode_s) g.n_seq.searchf.exe(g.n_seq,sn,0000010);
287287 LOG2("sn2="+sn);
288 final __ptr__ result = sn!=null ? sn.getPtr("node") : null;
288 final __ptr__ result = sn!=null ? sn.node : null;
289289 LOG2("result="+result);
290 return (Agnode_s) result;
290 return (ST_Agnode_s) result;
291291 } finally {
292292 LEAVING("bek79ccvjys1j9q404i3y6oh8","agnxtnode");
293293 }
331331
332332 //3 dzb7m0p5xsngvtyr8zs912og4
333333 // static Agnode_t *newnode(Agraph_t * g, unsigned long id, unsigned long seq)
334 public static Agnode_s newnode(Agraph_s g, int id, int seq) {
334 public static ST_Agnode_s newnode(ST_Agraph_s g, int id, int seq) {
335335 ENTERING("dzb7m0p5xsngvtyr8zs912og4","newnode");
336336 try {
337 Agnode_s n;
338 n = (Agnode_s) ((__ptr__)agalloc(g, sizeof(Agnode_s.class))).castTo(Agnode_s.class);
337 ST_Agnode_s n;
338 n = (ST_Agnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agnode_s.class))).castTo(ST_Agnode_s.class);
339339 AGTYPE(n, AGNODE);
340340 AGID(n, id);
341341 AGSEQ(n, seq);
342342 n.setPtr("root", agroot(g));
343 if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0)
344 agbindrec(n, AgDataRecName, sizeof(Agattr_s.class), false);
343 if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0)
344 agbindrec(n, AgDataRecName, sizeof(ST_Agattr_s.class), false);
345345 /* nodeattr_init and method_init will be called later, from the
346346 * subgraph where the node was actually created, but first it has
347347 * to be installed in all the (sub)graphs up to root. */
356356
357357 //3 4m26dpgaiw44hcleugjy71eus
358358 // static void installnode(Agraph_t * g, Agnode_t * n)
359 public static void installnode(Agraph_s g, Agnode_s n) {
359 public static void installnode(ST_Agraph_s g, ST_Agnode_s n) {
360360 ENTERING("4m26dpgaiw44hcleugjy71eus","installnode");
361361 try {
362 Agsubnode_s sn;
362 ST_Agsubnode_s sn;
363363 int osize;
364 osize = dtsize_((_dt_s)g.getPtr("n_id"));
365 if (EQ(g, agroot(g))) sn = (Agsubnode_s) n.getStruct("mainsub").amp().castTo(Agsubnode_s.class);
366 else sn = (Agsubnode_s) ((__ptr__)agalloc(g, sizeof(Agsubnode_s.class))).castTo(Agsubnode_s.class);
364 osize = dtsize_((ST_dt_s)g.n_id);
365 if (EQ(g, agroot(g))) sn = (ST_Agsubnode_s) n.mainsub;
366 else sn = (ST_Agsubnode_s) ((__ptr__)agalloc(g, sizeof(ST_Agsubnode_s.class))).castTo(ST_Agsubnode_s.class);
367367 sn.setPtr("node", n);
368 g.getPtr("n_id").call("searchf", g.getPtr("n_id"),sn,0000001);
369 g.getPtr("n_seq").call("searchf", g.getPtr("n_seq"),sn,0000001);
368 g.n_id.searchf.exe(g.n_id,sn,0000001);
369 g.n_seq.searchf.exe(g.n_seq,sn,0000001);
370370 } finally {
371371 LEAVING("4m26dpgaiw44hcleugjy71eus","installnode");
372372 }
377377
378378 //3 3mfxjcaeepn8nitirs3yoqaed
379379 // static void installnodetoroot(Agraph_t * g, Agnode_t * n)
380 public static void installnodetoroot(Agraph_s g, Agnode_s n) {
380 public static void installnodetoroot(ST_Agraph_s g, ST_Agnode_s n) {
381381 ENTERING("3mfxjcaeepn8nitirs3yoqaed","installnodetoroot");
382382 try {
383 Agraph_s par;
383 ST_Agraph_s par;
384384 installnode(g, n);
385385 if ((par = agparent(g))!=null)
386386 installnodetoroot(par, n);
394394
395395 //3 85bb9mezhsgtzar3kqz95mq1
396396 // static void initnode(Agraph_t * g, Agnode_t * n)
397 public static void initnode(Agraph_s g, Agnode_s n) {
397 public static void initnode(ST_Agraph_s g, ST_Agnode_s n) {
398398 ENTERING("85bb9mezhsgtzar3kqz95mq1","initnode");
399399 try {
400 if (((ST_Agdesc_s)agroot(g).getStruct("desc")).has_attrs!=0)
400 if (((ST_Agdesc_s)agroot(g).desc).has_attrs!=0)
401401 agnodeattr_init(g,n);
402402 agmethod_init(g, n);
403403 } finally {
410410
411411 //3 1m6sl9df2yaolmufyq5i577a3
412412 // Agnode_t *agidnode(Agraph_t * g, unsigned long id, int cflag)
413 public static Agnode_s agidnode(Agraph_s g, int id, int cflag) {
413 public static ST_Agnode_s agidnode(ST_Agraph_s g, int id, int cflag) {
414414 ENTERING("1m6sl9df2yaolmufyq5i577a3","agidnode");
415415 try {
416 Agraph_s root;
417 Agnode_s n;
416 ST_Agraph_s root;
417 ST_Agnode_s n;
418418 n = agfindnode_by_id(g, id);
419419 if ((n == null) && cflag!=0) {
420420 UNSUPPORTED("7zol2448bccu90sqoxkvnbuif"); // root = agroot(g);
441441
442442 //3 4yh1h1cwoitzb1t8869b79e3g
443443 // Agnode_t *agnode(Agraph_t * g, char *name, int cflag)
444 public static Agnode_s agnode(Agraph_s g, CString name, boolean cflag) {
444 public static ST_Agnode_s agnode(ST_Agraph_s g, CString name, boolean cflag) {
445445 ENTERING("4yh1h1cwoitzb1t8869b79e3g","agnode");
446446 try {
447 Agraph_s root;
448 Agnode_s n;
447 ST_Agraph_s root;
448 ST_Agnode_s n;
449449 int id[] = new int[1];
450450 root = agroot(g);
451451 /* probe for existing node */
587587
588588 //3 d5farp22buvesyi4pydjam4g2
589589 // Agnode_t *agsubnode(Agraph_t * g, Agnode_t * n0, int cflag)
590 public static Agnode_s agsubnode(Agraph_s g, Agnode_s n0, boolean cflag) {
590 public static ST_Agnode_s agsubnode(ST_Agraph_s g, ST_Agnode_s n0, boolean cflag) {
591591 ENTERING("d5farp22buvesyi4pydjam4g2","agsubnode");
592592 try {
593 Agraph_s par;
594 Agnode_s n;
595 if (NEQ(agroot(g), n0.getPtr("root")))
593 ST_Agraph_s par;
594 ST_Agnode_s n;
595 if (NEQ(agroot(g), n0.root))
596596 return null;
597597 n = agfindnode_by_id(g, AGID(n0));
598598 if ((n == null) && cflag) {
615615
616616 //3 awwiazixy9c76hvyxlkvvb3vo
617617 // int agsubnodeidcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
618 public static int agsubnodeidcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
618 public static int agsubnodeidcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_dtdisc_s disc) {
619619 ENTERING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
620620 try {
621621 int v;
622 Agsubnode_s sn0, sn1;
623 sn0 = (Agsubnode_s) arg0.castTo(Agsubnode_s.class);
624 sn1 = (Agsubnode_s) arg1.castTo(Agsubnode_s.class);
625 v = (AGID(sn0.getPtr("node")) - AGID(sn1.getPtr("node")));
622 ST_Agsubnode_s sn0, sn1;
623 sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
624 sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
625 v = (AGID(sn0.node) - AGID(sn1.node));
626626 return ((v==0)?0:(v<0?-1:1));
627627 } finally {
628628 LEAVING("awwiazixy9c76hvyxlkvvb3vo","agsubnodeidcmpf");
634634
635635 //3 41fjseux0nxzpr0aq7igym9ux
636636 // int agsubnodeseqcmpf(Dict_t * d, void *arg0, void *arg1, Dtdisc_t * disc)
637 public static int agsubnodeseqcmpf(_dt_s d, __ptr__ arg0, __ptr__ arg1, _dtdisc_s disc) {
637 public static int agsubnodeseqcmpf(ST_dt_s d, __ptr__ arg0, __ptr__ arg1, ST_dtdisc_s disc) {
638638 ENTERING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf");
639639 try {
640 Agsubnode_s sn0, sn1;
640 ST_Agsubnode_s sn0, sn1;
641641 int v;
642 sn0 = (Agsubnode_s) arg0.castTo(Agsubnode_s.class);
643 sn1 = (Agsubnode_s) arg1.castTo(Agsubnode_s.class);
644 v = (AGSEQ(sn0.getPtr("node")) - AGSEQ(sn1.getPtr("node")));
642 sn0 = (ST_Agsubnode_s) arg0.castTo(ST_Agsubnode_s.class);
643 sn1 = (ST_Agsubnode_s) arg1.castTo(ST_Agsubnode_s.class);
644 v = (AGSEQ(sn0.node) - AGSEQ(sn1.node));
645645 return ((v==0)?0:(v<0?-1:1));
646646 } finally {
647647 LEAVING("41fjseux0nxzpr0aq7igym9ux","agsubnodeseqcmpf");
5757 import static smetana.core.Macro.AGTYPE;
5858 import static smetana.core.Macro.UNSUPPORTED;
5959 import h.Agcbstack_s;
60 import h.Agedge_s;
61 import h.Agnode_s;
62 import h.Agraph_s;
63 import h.Agsym_s;
60 import h.ST_Agedge_s;
61 import h.ST_Agnode_s;
62 import h.ST_Agraph_s;
63 import h.ST_Agsym_s;
6464 import h.agobjfn_t;
6565 import h.agobjupdfn_t;
6666 import smetana.core.__ptr__;
274274
275275 //3 c4ft3rxx9au29a2ns2nhod4dn
276276 // void agmethod_init(Agraph_t * g, void *obj)
277 public static void agmethod_init(Agraph_s g, __ptr__ obj) {
277 public static void agmethod_init(ST_Agraph_s g, __ptr__ obj) {
278278 ENTERING("c4ft3rxx9au29a2ns2nhod4dn","agmethod_init");
279279 try {
280 if (g.getPtr("clos").getBoolean("callbacks_enabled"))
281 aginitcb(g, obj, (Agcbstack_s) g.getPtr("clos").getPtr("cb"));
280 if (g.clos.callbacks_enabled)
281 aginitcb(g, obj, (Agcbstack_s) g.clos.cb);
282282 else
283283 agrecord_callback(g, obj, 100, null);
284284 } finally {
291291
292292 //3 eobcsheti70b9gzoi3z968zev
293293 // void aginitcb(Agraph_t * g, void *obj, Agcbstack_t * cbstack)
294 public static void aginitcb(Agraph_s g, __ptr__ obj, Agcbstack_s cbstack) {
294 public static void aginitcb(ST_Agraph_s g, __ptr__ obj, Agcbstack_s cbstack) {
295295 ENTERING("eobcsheti70b9gzoi3z968zev","aginitcb");
296296 try {
297297 agobjfn_t fn;
325325
326326 //3 29p743rx2pw81slkoaayfeael
327327 // void agmethod_upd(Agraph_t * g, void *obj, Agsym_t * sym)
328 public static void agmethod_upd(Agraph_s g, __ptr__ obj, Agsym_s sym) {
328 public static void agmethod_upd(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym) {
329329 ENTERING("29p743rx2pw81slkoaayfeael","agmethod_upd");
330330 try {
331 if (g.getPtr("clos").getBoolean("callbacks_enabled"))
332 agupdcb(g, obj, sym, (Agcbstack_s) g.getPtr("clos").getPtr("cb"));
331 if (g.clos.callbacks_enabled)
332 agupdcb(g, obj, sym, (Agcbstack_s) g.clos.cb);
333333 else
334334 agrecord_callback(g, obj, 101, sym);
335335 } finally {
342342
343343 //3 8t9rkcpdvmxph6krjvfmz3s51
344344 // void agupdcb(Agraph_t * g, void *obj, Agsym_t * sym, Agcbstack_t * cbstack)
345 public static void agupdcb(Agraph_s g, __ptr__ obj, Agsym_s sym, Agcbstack_s cbstack) {
345 public static void agupdcb(ST_Agraph_s g, __ptr__ obj, ST_Agsym_s sym, Agcbstack_s cbstack) {
346346 ENTERING("8t9rkcpdvmxph6krjvfmz3s51","agupdcb");
347347 try {
348348 agobjupdfn_t fn;
424424
425425 //3 53858x47ifwq7ldf9ukvpdc5r
426426 // Agraph_t *agroot(void* obj)
427 public static Agraph_s agroot(__ptr__ obj) {
427 public static ST_Agraph_s agroot(__ptr__ obj) {
428428 ENTERING("53858x47ifwq7ldf9ukvpdc5r","agroot");
429429 try {
430430 switch (AGTYPE(obj)) {
431431 case AGINEDGE:
432432 case AGOUTEDGE:
433 return (Agraph_s) obj.castTo(Agedge_s.class).getPtr("node").getPtr("root");
433 return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root;
434434 case AGNODE:
435 return (Agraph_s) obj.castTo(Agnode_s.class).getPtr("root");
435 return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root;
436436 case AGRAPH:
437 return (Agraph_s) obj.castTo(Agraph_s.class).getPtr("root");
437 return (ST_Agraph_s) ((ST_Agraph_s)obj.castTo(ST_Agraph_s.class)).root;
438438 default: /* actually can't occur if only 2 bit tags */
439439 System.err.println("agroot of a bad object");
440440 return null;
449449
450450 //3 brxx6qho8cw09dg7o27lc7c6z
451451 // Agraph_t *agraphof(void *obj)
452 public static Agraph_s agraphof(__ptr__ obj) {
452 public static ST_Agraph_s agraphof(__ptr__ obj) {
453453 ENTERING("brxx6qho8cw09dg7o27lc7c6z","agraphof");
454454 try {
455455 switch (AGTYPE(obj)) {
456456 case AGINEDGE:
457457 case AGOUTEDGE:
458 return (Agraph_s) obj.castTo(Agedge_s.class).getPtr("node").getPtr("root").castTo(Agraph_s.class);
458 return (ST_Agraph_s) ((ST_Agedge_s)obj.castTo(ST_Agedge_s.class)).node.root.castTo(ST_Agraph_s.class);
459459 case AGNODE:
460 return (Agraph_s) obj.castTo(Agnode_s.class).getPtr("root").castTo(Agraph_s.class);
460 return (ST_Agraph_s) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).root.castTo(ST_Agraph_s.class);
461461 case AGRAPH:
462 return (Agraph_s) obj.castTo(Agraph_s.class);
462 return (ST_Agraph_s) obj.castTo(ST_Agraph_s.class);
463463 default: /* actually can't occur if only 2 bit tags */
464464 System.err.println("agraphof a bad object");
465465 return null;
541541
542542 //3 91ej8cxcc0kzgkg2yk3pdiifs
543543 // int agcontains(Agraph_t* g, void* obj)
544 public static boolean agcontains(Agraph_s g, __ptr__ obj) {
544 public static boolean agcontains(ST_Agraph_s g, __ptr__ obj) {
545545 ENTERING("91ej8cxcc0kzgkg2yk3pdiifs","agcontains");
546546 try {
547 Agraph_s subg;
547 ST_Agraph_s subg;
548548 if (NEQ(agroot(g), agroot(obj))) return false;
549549 switch (AGTYPE(obj)) {
550550 case AGRAPH:
556556 case AGNODE:
557557 return (agidnode(g, AGID(obj), 0) != null);
558558 default:
559 return (agsubedge(g, (Agedge_s) obj, false) != null);
559 return (agsubedge(g, (ST_Agedge_s) obj, false) != null);
560560 }
561561 } finally {
562562 LEAVING("91ej8cxcc0kzgkg2yk3pdiifs","agcontains");
6262 import static smetana.core.Macro.N;
6363 import static smetana.core.Macro.NOT;
6464 import static smetana.core.Macro.UNSUPPORTED;
65 import h.Agedge_s;
66 import h.Agobj_s;
67 import h.Agraph_s;
68 import h.Agrec_s;
69 import h.ST_Agdesc_s;
65 import h.ST_Agedge_s;
66 import h.ST_Agobj_s;
67 import h.ST_Agraph_s;
68 import h.ST_Agrec_s;
7069 import h.ST_Agtag_s;
7170 import smetana.core.CString;
7271 import smetana.core.__ptr__;
209208
210209 //3 62z9z5vraa2as0c9t108j9xaf
211210 // static void set_data(Agobj_t * obj, Agrec_t * data, int mtflock)
212 public static void set_data(Agobj_s obj, Agrec_s data, int mtflock) {
211 public static void set_data(ST_Agobj_s obj, ST_Agrec_s data, int mtflock) {
213212 ENTERING("62z9z5vraa2as0c9t108j9xaf","set_data");
214213 try {
215 Agedge_s e;
214 ST_Agedge_s e;
216215 obj.setPtr("data", data);
217 ((ST_Agtag_s)obj.getStruct("tag")).mtflock = mtflock;
216 ((ST_Agtag_s)obj.tag).mtflock = mtflock;
218217 if ((AGTYPE(obj) == AGINEDGE) || (AGTYPE(obj) == AGOUTEDGE)) {
219 e = (Agedge_s) agopp(obj.castTo(Agedge_s.class));
218 e = (ST_Agedge_s) agopp(obj.castTo(ST_Agedge_s.class));
220219 AGDATA(e, data);
221 ((ST_Agtag_s)e.getStruct("base").getStruct("tag")).mtflock = mtflock;
220 ((ST_Agtag_s)e.base.tag).mtflock = mtflock;
222221 }
223222 } finally {
224223 LEAVING("62z9z5vraa2as0c9t108j9xaf","set_data");
230229
231230 //3 7p2ne3oknmyclvsw4lh3axtd8
232231 // Agrec_t *aggetrec(void *obj, char *name, int mtf)
233 public static Agrec_s aggetrec(__ptr__ obj, CString name, boolean mtf) {
232 public static ST_Agrec_s aggetrec(__ptr__ obj, CString name, boolean mtf) {
234233 ENTERING("7p2ne3oknmyclvsw4lh3axtd8","aggetrec");
235234 try {
236 Agobj_s hdr;
237 Agrec_s d, first;
238 hdr = (Agobj_s) obj.castTo(Agobj_s.class);
239 first = d = (Agrec_s) hdr.getPtr("data");
235 ST_Agobj_s hdr;
236 ST_Agrec_s d, first;
237 hdr = (ST_Agobj_s) obj.castTo(ST_Agobj_s.class);
238 first = d = (ST_Agrec_s) hdr.data;
240239 while (d!=null) {
241 if (N(strcmp(name,d.getCString("name"))))
240 if (N(strcmp(name,d.name)))
242241 break;
243 d = (Agrec_s) d.getPtr("next");
242 d = (ST_Agrec_s) d.next;
244243 if (EQ(d, first)) {
245244 d = null;
246245 break;
247246 }
248247 }
249248 if (d!=null) {
250 if (((ST_Agtag_s)hdr.getStruct("tag")).mtflock!=0) {
251 if (mtf && NEQ(hdr.getPtr("data"), d))
249 if (((ST_Agtag_s)hdr.tag).mtflock!=0) {
250 if (mtf && NEQ(hdr.data, d))
252251 System.err.println("move to front lock inconsistency");
253252 } else {
254 if (NEQ(d, first) || (mtf != ((((ST_Agtag_s)hdr.getStruct("tag")).mtflock)!=0)))
253 if (NEQ(d, first) || (mtf != ((((ST_Agtag_s)hdr.tag).mtflock)!=0)))
255254 set_data(hdr, d, ASINT(mtf)); /* Always optimize */
256255 }
257256 }
266265
267266 //3 7sk4k5ipm2jnd244556g1kr6
268267 // static void objputrec(Agraph_t * g, Agobj_t * obj, void *arg)
269 public static void objputrec(Agraph_s g, Agobj_s obj, Object arg) {
268 public static void objputrec(ST_Agraph_s g, ST_Agobj_s obj, Object arg) {
270269 ENTERING("7sk4k5ipm2jnd244556g1kr6","objputrec");
271270 try {
272 Agrec_s firstrec, newrec;
273 newrec = (Agrec_s) arg;
274 firstrec = (Agrec_s) obj.getPtr("data");
271 ST_Agrec_s firstrec, newrec;
272 newrec = (ST_Agrec_s) arg;
273 firstrec = (ST_Agrec_s) obj.data;
275274 if (firstrec == null)
276 newrec.setPtr("next", newrec); /* 0 elts */
275 newrec.next = newrec; /* 0 elts */
277276 else {
278 if (EQ(firstrec.getPtr("next"), firstrec)) {
279 firstrec.setPtr("next", newrec); /* 1 elt */
280 newrec.setPtr("next", firstrec);
277 if (EQ(firstrec.next, firstrec)) {
278 firstrec.next = newrec; /* 1 elt */
279 newrec.next = firstrec;
281280 } else {
282 newrec.setPtr("next", firstrec.getPtr("next"));
283 firstrec.setPtr("next", newrec);
281 newrec.next = firstrec.next;
282 firstrec.next = newrec;
284283 }
285284 }
286 if (NOT(((ST_Agtag_s)obj.getStruct("tag")).mtflock))
285 if (NOT(((ST_Agtag_s)obj.tag).mtflock))
287286 set_data(obj, newrec, (0));
288287 } finally {
289288 LEAVING("7sk4k5ipm2jnd244556g1kr6","objputrec");
298297 public static __ptr__ agbindrec(__ptr__ arg_obj, CString recname, size_t recsize, boolean mtf) {
299298 ENTERING("dmh5i83l15mnn1pnu6f5dfv8l","agbindrec");
300299 try {
301 Agraph_s g;
302 Agobj_s obj;
303 Agrec_s rec;
304 obj = (Agobj_s) arg_obj.castTo(Agobj_s.class);
300 ST_Agraph_s g;
301 ST_Agobj_s obj;
302 ST_Agrec_s rec;
303 obj = (ST_Agobj_s) arg_obj.castTo(ST_Agobj_s.class);
305304 g = agraphof(obj);
306305 rec = aggetrec(obj, recname, false);
307306 if ((rec == null && recsize.isStrictPositive())) {
308 rec = (Agrec_s) ((__ptr__)agalloc(g, recsize)).castTo(Agrec_s.class);
307 rec = (ST_Agrec_s) ((__ptr__)agalloc(g, recsize)).castTo(ST_Agrec_s.class);
309308 // rec = (Agrec_s) Memory.malloc(Agrec_s.class);
310309 rec.setPtr("name", agstrdup(g, recname));
311 switch (((ST_Agtag_s)obj.getStruct("tag")).objtype) {
310 switch (((ST_Agtag_s)obj.tag).objtype) {
312311 case AGRAPH:
313312 objputrec(g, obj, rec);
314313 break;
5151 import static smetana.core.JUtilsDebug.ENTERING;
5252 import static smetana.core.JUtilsDebug.LEAVING;
5353 import static smetana.core.Macro.UNSUPPORTED;
54 import h.Agraph_s;
55 import h._dt_s;
56 import h.refstr_t;
54 import h.ST_Agraph_s;
55 import h.ST_dt_s;
56 import h.ST_refstr_t;
5757 import smetana.core.ACCESS;
5858 import smetana.core.CString;
59 import smetana.core.JUtils;
60 import smetana.core.OFFSET;
6159 import smetana.core.STARSTAR;
6260 import smetana.core.Z;
63 import smetana.core.__struct__;
6461 import smetana.core.size_t;
6562
6663 public class refstr__c {
227224
228225 //3 f1nwss2xoaub1hyord232ugoj
229226 // static Dict_t *refdict(Agraph_t * g)
230 public static _dt_s refdict(final Agraph_s g) {
227 public static ST_dt_s refdict(final ST_Agraph_s g) {
231228 ENTERING("f1nwss2xoaub1hyord232ugoj","refdict");
232229 try {
233 STARSTAR<_dt_s> dictref;
230 STARSTAR<ST_dt_s> dictref;
234231 if (g != null)
235 dictref = STARSTAR.amp(new ACCESS<_dt_s>() {
236 public _dt_s get() {
237 return (_dt_s) g.getPtr("clos").getPtr("strdict");
232 dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
233 public ST_dt_s get() {
234 return (ST_dt_s) g.clos.strdict;
238235 }
239 public void set(_dt_s obj) {
240 g.getPtr("clos").setPtr("strdict", obj);
236 public void set(ST_dt_s obj) {
237 g.clos.setPtr("strdict", obj);
241238 }
242239 });
243240 else
244 dictref = STARSTAR.amp(new ACCESS<_dt_s>() {
245 public _dt_s get() {
241 dictref = STARSTAR.amp(new ACCESS<ST_dt_s>() {
242 public ST_dt_s get() {
246243 return Z.z().Refdict_default;
247244 }
248 public void set(_dt_s obj) {
245 public void set(ST_dt_s obj) {
249246 Z.z().Refdict_default = obj;
250247 }
251248 });
252249 if (dictref.getMe() == null) {
253 dictref.setMe(agdtopen(g, Z.z().Refstrdisc.amp(), Z.z().Dttree));
250 dictref.setMe(agdtopen(g, Z.z().Refstrdisc, Z.z().Dttree));
254251 }
255252 Z.z().HTML_BIT = 1 << 31;
256253 Z.z().CNT_BITS = ~Z.z().HTML_BIT;
279276
280277 //3 9ts4wqhw2xafdv3tlcilneewq
281278 // static refstr_t *refsymbind(Dict_t * strdict, char *s)
282 public static refstr_t refsymbind(_dt_s strdict, CString s) {
279 public static ST_refstr_t refsymbind(ST_dt_s strdict, CString s) {
283280 ENTERING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
284281 try {
285 final __struct__<refstr_t> key = JUtils.from(refstr_t.class);
286 refstr_t r;
282 final ST_refstr_t key = new ST_refstr_t();
283 ST_refstr_t r;
287284 // key.setPtr("s", s.duplicate());
288 key.setPtr("s", s);
289 r = (refstr_t) strdict.call("searchf", strdict, key.amp(), 0000004);
285 key.setString(s);
286 r = (ST_refstr_t) strdict.searchf.exe(strdict, key, 0000004);
290287 return r;
291288 } finally {
292289 LEAVING("9ts4wqhw2xafdv3tlcilneewq","refsymbind");
298295
299296 //3 1scntgo71z7c2v15zapiyw59w
300297 // static char *refstrbind(Dict_t * strdict, char *s)
301 public static CString refstrbind(_dt_s strdict, CString s) {
298 public static CString refstrbind(ST_dt_s strdict, CString s) {
302299 ENTERING("1scntgo71z7c2v15zapiyw59w","refstrbind");
303300 try {
304 refstr_t r;
301 ST_refstr_t r;
305302 r = refsymbind(strdict, s);
306303 if (r!=null)
307 return r.getCString("s");
304 return r.s;
308305 else
309306 return null;
310307 } finally {
317314
318315 //3 bb8aqjshw3ecae2lsmhigd0mc
319316 // char *agstrbind(Agraph_t * g, char *s)
320 public static CString agstrbind(Agraph_s g, CString s) {
317 public static CString agstrbind(ST_Agraph_s g, CString s) {
321318 ENTERING("bb8aqjshw3ecae2lsmhigd0mc","agstrbind");
322319 try {
323320 return refstrbind(refdict(g), s);
331328
332329 //3 86oznromwhn9qeym0k7pih73q
333330 // char *agstrdup(Agraph_t * g, char *s)
334 public static CString agstrdup(Agraph_s g, CString s) {
331 public static CString agstrdup(ST_Agraph_s g, CString s) {
335332 ENTERING("86oznromwhn9qeym0k7pih73q","agstrdup");
336333 try {
337 refstr_t r;
338 _dt_s strdict;
334 ST_refstr_t r;
335 ST_dt_s strdict;
339336 size_t sz;
340337 if (s == null)
341338 return null;
342339 strdict = refdict(g);
343 r = (refstr_t) refsymbind(strdict, s);
344 if (r!=null) r = (refstr_t) r.castTo(refstr_t.class);
340 r = (ST_refstr_t) refsymbind(strdict, s);
345341 if (r!=null)
346 r.setInt("refcnt", r.getInt("refcnt")+1);
342 r.refcnt++;
347343 else {
348 sz = sizeof(refstr_t.class).plus(s.length());
344 sz = sizeof(ST_refstr_t.class).plus(s.length());
349345 if (g!=null)
350 r = (refstr_t) agalloc(g, sz);
346 r = (ST_refstr_t) agalloc(g, sz);
351347 else
352 r = (refstr_t) sz.malloc();
353 r.setInt("refcnt", 1);
354 r.setPtr("s", s.duplicate());
348 r = new ST_refstr_t();
349 r.refcnt = 1;
350 r.setString(s.duplicate());
355351 // strcpy(r->store, s);
356352 // r->s = r->store;
357 strdict.call("searchf", strdict,r,0000001);
353 strdict.searchf.exe(strdict,r,0000001);
358354 }
359 return r.getCString("s");
355 return r.s;
360356 } finally {
361357 LEAVING("86oznromwhn9qeym0k7pih73q","agstrdup");
362358 }
401397
402398 //3 enhn1ajfo86a19dgm4b8lduz7
403399 // int agstrfree(Agraph_t * g, char *s)
404 public static int agstrfree(Agraph_s g, CString s) {
400 public static int agstrfree(ST_Agraph_s g, CString s) {
405401 ENTERING("enhn1ajfo86a19dgm4b8lduz7","agstrfree");
406402 try {
407 refstr_t r;
408 _dt_s strdict;
403 ST_refstr_t r;
404 ST_dt_s strdict;
409405 if (s == null)
410406 return -1;
411407 strdict = refdict(g);
412 r = refsymbind(strdict, s);
413 if (r!=null) r = (refstr_t) r.castTo(refstr_t.class);
414 if (r!=null && (EQ(r.getPtr("s"), s))) {
415 r.setInt("refcnt", r.getInt("refcnt")-1);
416 if ((r.getInt("refcnt")!=0 && Z.z().CNT_BITS!=0) == false) {
408 r = (ST_refstr_t) refsymbind(strdict, s);
409 if (r!=null && (EQ(r.s, s))) {
410 r.refcnt--;
411 if ((r.refcnt!=0 && Z.z().CNT_BITS!=0) == false) {
417412 agdtdelete(g, strdict, r);
418413 /*
419414 if (g) agfree(g,r);
437432 public static int aghtmlstr(CString s) {
438433 ENTERING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
439434 try {
440 refstr_t key;
435 ST_refstr_t key;
441436 if (s == null)
442437 return 0;
443 key = (refstr_t) s.addVirtualBytes(-OFFSET.create(refstr_t.class, "s").toInt());
444 return (key.getInt("refcnt") & Z.z().HTML_BIT);
438 key = (ST_refstr_t) s.getParent();
439 return (key.refcnt & Z.z().HTML_BIT);
445440 } finally {
446441 LEAVING("3em4wzjnpajd5d3igb90l3rml","aghtmlstr");
447442 }
5555 import static smetana.core.Macro.AGRAPH;
5656 import static smetana.core.Macro.N;
5757 import static smetana.core.Macro.UNSUPPORTED;
58 import h.Agraph_s;
5958 import h.ST_Agdesc_s;
60 import h._dt_s;
59 import h.ST_Agraph_s;
60 import h.ST_dt_s;
6161 import smetana.core.CString;
62 import smetana.core.JUtils;
6362 import smetana.core.Z;
6463 import smetana.core.__ptr__;
65 import smetana.core.__struct__;
6664
6765 public class subg__c {
6866 //1 9k44uhd5foylaeoekf3llonjq
201199
202200 //3 11ezyrsjsotjz9b3cyvb4ie8p
203201 // static Agraph_t *agfindsubg_by_id(Agraph_t * g, unsigned long id)
204 public static Agraph_s agfindsubg_by_id(Agraph_s g, int id) {
202 public static ST_Agraph_s agfindsubg_by_id(ST_Agraph_s g, int id) {
205203 ENTERING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
206204 try {
207 final __struct__<Agraph_s> template = JUtils.from(Agraph_s.class);
208 agdtdisc(g, (_dt_s) g.getPtr("g_dict"), Z.z().Ag_subgraph_id_disc.amp());
209 AGID(template.amp(), id);
210 return (Agraph_s) g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"), template.amp(), 0000004);
205 final ST_Agraph_s template = new ST_Agraph_s();
206 agdtdisc(g, (ST_dt_s) g.g_dict, Z.z().Ag_subgraph_id_disc);
207 AGID(template, id);
208 return (ST_Agraph_s) g.g_dict.searchf.exe(g.g_dict, template, 0000004);
211209 } finally {
212210 LEAVING("11ezyrsjsotjz9b3cyvb4ie8p","agfindsubg_by_id");
213211 }
218216
219217 //3 44saycxbfbr9lou0itlyewkb4
220218 // static Agraph_t *localsubg(Agraph_t * g, unsigned long id)
221 public static Agraph_s localsubg(Agraph_s g, int id) {
219 public static ST_Agraph_s localsubg(ST_Agraph_s g, int id) {
222220 ENTERING("44saycxbfbr9lou0itlyewkb4","localsubg");
223221 try {
224 Agraph_s subg;
222 ST_Agraph_s subg;
225223 subg = agfindsubg_by_id(g, id);
226224 if (subg!=null)
227225 return subg;
228 subg = (Agraph_s) agalloc(g, sizeof(Agraph_s.class));
229 subg.setPtr("clos", g.getPtr("clos"));
230 subg.setStruct("desc", g.getStruct("desc"));
231 ((ST_Agdesc_s)subg.getStruct("desc")).maingraph = 0;
226 subg = (ST_Agraph_s) agalloc(g, sizeof(ST_Agraph_s.class));
227 subg.setPtr("clos", g.clos);
228 subg.setStruct("desc", g.desc);
229 ((ST_Agdesc_s)subg.desc).maingraph = 0;
232230 subg.setPtr("parent", g);
233 subg.setPtr("root", g.getPtr("root"));
231 subg.setPtr("root", g.root);
234232 AGID(subg, id);
235233 return agopen1(subg);
236234 } finally {
261259
262260 //3 a24jd4r2sdyb4lb2hyababrda
263261 // Agraph_t *agsubg(Agraph_t * g, char *name, int cflag)
264 public static Agraph_s agsubg(Agraph_s g, CString name, boolean cflag) {
262 public static ST_Agraph_s agsubg(ST_Agraph_s g, CString name, boolean cflag) {
265263 ENTERING("a24jd4r2sdyb4lb2hyababrda","agsubg");
266264 try {
267265 int id[] = new int[]{0};
268 Agraph_s subg;
266 ST_Agraph_s subg;
269267 if (name!=null && agmapnametoid(g, AGRAPH, name, id, false)!=0) {
270268 /* might already exist */
271269 if ((subg = agfindsubg_by_id(g, id[0]))!=null)
287285
288286 //3 51eksrs0lhkgohunejlpwyc4k
289287 // Agraph_t *agfstsubg(Agraph_t * g)
290 public static Agraph_s agfstsubg(Agraph_s g) {
288 public static ST_Agraph_s agfstsubg(ST_Agraph_s g) {
291289 ENTERING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
292290 try {
293 __ptr__ tmp = (__ptr__)g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"),null,0000200);
294 if (tmp!=null) tmp = tmp.castTo(Agraph_s.class);
295 return (Agraph_s) tmp;
291 __ptr__ tmp = (__ptr__)g.g_dict.searchf.exe(g.g_dict,null,0000200);
292 if (tmp!=null) tmp = tmp.castTo(ST_Agraph_s.class);
293 return (ST_Agraph_s) tmp;
296294 } finally {
297295 LEAVING("51eksrs0lhkgohunejlpwyc4k","agfstsubg");
298296 }
303301
304302 //3 85c1qisrein0tzm2regoe61t
305303 // Agraph_t *agnxtsubg(Agraph_t * subg)
306 public static Agraph_s agnxtsubg(Agraph_s subg) {
304 public static ST_Agraph_s agnxtsubg(ST_Agraph_s subg) {
307305 ENTERING("85c1qisrein0tzm2regoe61t","agnxtsubg");
308306 try {
309 Agraph_s g;
307 ST_Agraph_s g;
310308 g = agparent(subg);
311 return g!=null ? (Agraph_s) g.getPtr("g_dict").castTo(_dt_s.class).call("searchf", g.getPtr("g_dict"), subg, 0000010) : null;
309 if (g==null) return null;
310 __ptr__ tmp = (__ptr__) g.g_dict.searchf.exe(g.g_dict, subg, 0000010);
311 if (tmp==null) return null;
312 return (ST_Agraph_s) tmp.getPtr();
312313 } finally {
313314 LEAVING("85c1qisrein0tzm2regoe61t","agnxtsubg");
314315 }
319320
320321 //3 7kbp6j03hd7u6nnlivi0vt3ja
321322 // Agraph_t *agparent(Agraph_t * g)
322 public static Agraph_s agparent(Agraph_s g) {
323 public static ST_Agraph_s agparent(ST_Agraph_s g) {
323324 ENTERING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
324325 try {
325 return (Agraph_s) g.getPtr("parent");
326 return (ST_Agraph_s) g.parent;
326327 } finally {
327328 LEAVING("7kbp6j03hd7u6nnlivi0vt3ja","agparent");
328329 }
5252 import static smetana.core.JUtilsDebug.ENTERING;
5353 import static smetana.core.JUtilsDebug.LEAVING;
5454 import static smetana.core.Macro.UNSUPPORTED;
55 import h.Agraph_s;
5655 import h.Dtmemory_f;
57 import h._dt_s;
58 import h._dtdisc_s;
59 import h._dtmethod_s;
56 import h.ST_Agraph_s;
57 import h.ST_dt_s;
58 import h.ST_dtdisc_s;
59 import h.ST_dtmethod_s;
6060 import smetana.core.Memory;
6161 import smetana.core.Z;
6262 import smetana.core.size_t;
63 import smetana.core.amiga.StarStruct;
6463
6564 public class utils__c {
6665 //1 9k44uhd5foylaeoekf3llonjq
203202
204203 //3 7dkudp41c9byhicatk2sxtxqk
205204 // void *agdictobjmem(Dict_t * dict, void * p, size_t size, Dtdisc_t * disc)
206 public static Object agdictobjmem(_dt_s dict, Object p, size_t size, _dtdisc_s disc) {
205 public static Object agdictobjmem(ST_dt_s dict, Object p, size_t size, ST_dtdisc_s disc) {
207206 ENTERING("7dkudp41c9byhicatk2sxtxqk","agdictobjmem");
208207 try {
209 Agraph_s g;
208 ST_Agraph_s g;
210209 g = Z.z().Ag_dictop_G;
211210 if (g!=null) {
212211 if (p!=null)
251250
252251 //3 48ox0bg1qmasrer8np51uwsyk
253252 // Dict_t *agdtopen(Agraph_t * g, Dtdisc_t * disc, Dtmethod_t * method)
254 public static _dt_s agdtopen(Agraph_s g, StarStruct disc, _dtmethod_s method) {
253 public static ST_dt_s agdtopen(ST_Agraph_s g, ST_dtdisc_s disc, ST_dtmethod_s method) {
255254 ENTERING("48ox0bg1qmasrer8np51uwsyk","agdtopen");
256255 try {
257256 Dtmemory_f memf;
258 _dt_s d;
259 memf = (Dtmemory_f) disc.getPtr("memoryf");
257 ST_dt_s d;
258 memf = (Dtmemory_f) disc.memoryf;
260259 disc.setPtr("memoryf", function(utils__c.class, "agdictobjmem"));
261260 Z.z().Ag_dictop_G = g;
262261 d = dtopen(disc, method);
327326
328327 //3 cym72wvu6zffc0vzoa93zha8
329328 // void agdtdisc(Agraph_t * g, Dict_t * dict, Dtdisc_t * disc)
330 public static void agdtdisc(Agraph_s g, _dt_s dict, _dtdisc_s disc) {
329 public static void agdtdisc(ST_Agraph_s g, ST_dt_s dict, ST_dtdisc_s disc) {
331330 ENTERING("cym72wvu6zffc0vzoa93zha8","agdtdisc");
332331 try {
333332 if (disc!=null && NEQ(dtdisc(dict, null, 0), disc)) {
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class block__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class blockpath__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class blocktree__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class circpos__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class circular__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class circularinit__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class deglist__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class edgelist__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class nodelist__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class nodeset__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368
369345
370346
371347 //3 1n5xl70wxuabyf97mclvilsm6
387363
388364 //3 arrsbik9b5tnfcbzsm8gr2chx
389365 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
366 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391367 // WARNING!! STRUCT
392368 return add_pointf_w_(p.copy(), q.copy()).copy();
393369 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
370 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395371 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396372 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
373 final ST_pointf r = new ST_pointf();
374 r.setDouble("x", p.x + q.x);
375 r.setDouble("y", p.y + q.y);
400376 return r;
401377 } finally {
402378 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class args__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
5656 import static smetana.core.Macro.ED_conc_opp_flag;
5757 import static smetana.core.Macro.NOT;
5858 import static smetana.core.Macro.UNSUPPORTED;
59 import h.Agedge_s;
60 import h.arrowdir_t;
61 import h.bezier;
62 import h.boxf;
63 import h.inside_t;
64 import h.pointf;
59 import h.ST_Agedge_s;
60 import h.ST_arrowdir_t;
61 import h.ST_arrowname_t;
62 import h.ST_bezier;
63 import h.ST_inside_t;
64 import h.ST_pointf;
6565 import smetana.core.CString;
66 import smetana.core.JUtils;
6766 import smetana.core.MutableDouble;
6867 import smetana.core.Z;
69 import smetana.core.__array_of_struct__;
70 import smetana.core.__array_of_struct_impl__;
71 import smetana.core.__ptr__;
72 import smetana.core.__struct__;
7368
7469 public class arrows__c {
7570 //1 2digov3edok6d5srhgtlmrycs
329324
330325 //3 c1s4k85p1cdfn176o3uryeros
331326 // static inline pointf pointfof(double x, double y)
332 public static __struct__<pointf> pointfof(double x, double y) {
327 public static ST_pointf pointfof(double x, double y) {
333328 // WARNING!! STRUCT
334329 return pointfof_w_(x, y).copy();
335330 }
336 private static __struct__<pointf> pointfof_w_(double x, double y) {
331 private static ST_pointf pointfof_w_(double x, double y) {
337332 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
338333 try {
339 final __struct__<pointf> r = JUtils.from(pointf.class);
334 final ST_pointf r = new ST_pointf();
340335 r.setDouble("x", x);
341336 r.setDouble("y", y);
342337 return r;
365360
366361
367362
368 //3 1vvsta5i8of59frav6uymguav
369 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
370 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
371 // WARNING!! STRUCT
372 return boxfof_w_(llx, lly, urx, ury).copy();
373 }
374 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
375 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
376 try {
377 final __struct__<boxf> b = JUtils.from(boxf.class);
378 b.getStruct("LL").setDouble("x", llx);
379 b.getStruct("LL").setDouble("y", lly);
380 b.getStruct("UR").setDouble("x", urx);
381 b.getStruct("UR").setDouble("y", ury);
382 return b;
383 } finally {
384 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
385 }
386 }
387363
388364
389365
407383
408384 //3 arrsbik9b5tnfcbzsm8gr2chx
409385 // static inline pointf add_pointf(pointf p, pointf q)
410 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
386 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
411387 // WARNING!! STRUCT
412388 return add_pointf_w_(p.copy(), q.copy()).copy();
413389 }
414 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
390 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
415391 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
416392 try {
417 final __struct__<pointf> r = JUtils.from(pointf.class);
418 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
419 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
393 final ST_pointf r = new ST_pointf();
394 r.setDouble("x", p.x + q.x);
395 r.setDouble("y", p.y + q.y);
420396 return r;
421397 } finally {
422398 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
766742
767743 //3 3apnay8wumntfkvud64ov7fcf
768744 // static char *arrow_match_name_frag(char *name, arrowname_t * arrownames, int *flag)
769 public static CString arrow_match_name_frag(CString name, __array_of_struct__ arrownames, int flag[]) {
745 public static CString arrow_match_name_frag(CString name, ST_arrowname_t[] arrowsynonyms, int flag[]) {
770746 ENTERING("3apnay8wumntfkvud64ov7fcf","arrow_match_name_frag");
771747 try {
772748 UNSUPPORTED("cw8t22aa6zs16jqowqjjkzywg"); // static char *arrow_match_name_frag(char *name, arrowname_t * arrownames, int *flag)
844820
845821 //3 2szgwtfieaw58pea2ohjyu8ea
846822 // void arrow_flags(Agedge_t * e, int *sflag, int *eflag)
847 public static void arrow_flags(Agedge_s e, int sflag[], int eflag[]) {
823 public static void arrow_flags(ST_Agedge_s e, int sflag[], int eflag[]) {
848824 ENTERING("2szgwtfieaw58pea2ohjyu8ea","arrow_flags");
849825 try {
850826 CString attr;
851 arrowdir_t arrowdir;
827 ST_arrowdir_t arrowdir;
852828 sflag[0] = (0);
853829 eflag[0] = agisdirected(agraphof(e)) ? 1 : (0);
854830 if (Z.z().E_dir!=null && ((attr = agxget(e, Z.z().E_dir))).charAt(0)!='\0') {
883859
884860 //3 1yk5wl46i7rlzcern0tefd24s
885861 // double arrow_length(edge_t * e, int flag)
886 public static double arrow_length(Agedge_s e, int flag) {
862 public static double arrow_length(ST_Agedge_s e, int flag) {
887863 ENTERING("1yk5wl46i7rlzcern0tefd24s","arrow_length");
888864 try {
889 __ptr__ arrowtype;
890865 double lenfact = 0.0;
891866 int f, i;
892867 for (i = 0; i < 4; i++) {
893868 /* we don't simply index with flag because arrowtypes are not necessarily sorted */
894869 f = (flag >> (i * 8)) & ((1 << 4) - 1);
895 for (arrowtype = Z.z().Arrowtypes.asPtr(); arrowtype.getPtr("gen")!=null; arrowtype=arrowtype.plus(1)) {
896 if (f == arrowtype.getInt("type")) {
897 lenfact += arrowtype.getDouble("lenfact");
870 for (int arrowtype = 0; Z.z().Arrowtypes[arrowtype].gen!=null; arrowtype++) {
871 if (f == Z.z().Arrowtypes[arrowtype].type) {
872 lenfact += Z.z().Arrowtypes[arrowtype].lenfact;
898873 break;
899874 }
900875 }
912887
913888 //3 7ymcsnwqkr1crisrga0kezh1f
914889 // static boolean inside(inside_t * inside_context, pointf p)
915 public static boolean inside(inside_t inside_context, final __struct__<pointf> p) {
890 public static boolean inside(ST_inside_t inside_context, final ST_pointf p) {
916891 // WARNING!! STRUCT
917892 return inside_w_(inside_context, p.copy());
918893 }
919 private static boolean inside_w_(inside_t inside_context, final __struct__<pointf> p) {
894 private static boolean inside_w_(ST_inside_t inside_context, final ST_pointf p) {
920895 ENTERING("7ymcsnwqkr1crisrga0kezh1f","inside");
921896 try {
922 return DIST2(p, inside_context.getPtr("a.p").plus(0).getPtr()) <= inside_context.getPtr("a.r").getDouble();
897 return DIST2(p, inside_context.a_p.get(0)) <= inside_context.a_r.getDouble();
923898 } finally {
924899 LEAVING("7ymcsnwqkr1crisrga0kezh1f","inside");
925900 }
930905
931906 //3 9eellwhg4gsa2pdszpeqihs2d
932907 // int arrowEndClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int eflag)
933 public static int arrowEndClip(Agedge_s e, __ptr__ ps, int startp, int endp, bezier spl, int eflag) {
908 public static int arrowEndClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int eflag) {
934909 ENTERING("9eellwhg4gsa2pdszpeqihs2d","arrowEndClip");
935910 try {
936 final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
937 final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
911 final ST_inside_t inside_context = new ST_inside_t();
912 final ST_pointf.Array sp = new ST_pointf.Array( 4);
938913 double elen;
939914 MutableDouble elen2 = new MutableDouble(0);
940915 elen = arrow_length(e, eflag);
941916 elen2.setValue(elen * elen);
942917 spl.setInt("eflag", eflag);
943918 spl.setStruct("ep", ps.plus(endp + 3).getStruct());
944 if (endp > startp && DIST2(ps.plus(endp).getPtr(), ps.plus(endp + 3).getPtr()) < elen2.getValue()) {
919 if (endp > startp && DIST2(ps.get(endp), ps.get(endp + 3)) < elen2.getValue()) {
945920 endp -= 3;
946921 }
947922 sp.plus(3).setStruct(ps.plus(endp).getStruct());
948923 sp.plus(2).setStruct(ps.plus(endp+1).getStruct());
949924 sp.plus(1).setStruct(ps.plus(endp+2).getStruct());
950 sp.plus(0).setStruct(spl.getStruct("ep"));
925 sp.plus(0).setStruct(spl.ep);
951926 /* ensure endpoint starts inside */
952927 inside_context.setPtr("a.p", sp.plus(0).asPtr());
953928 inside_context.setPtr("a.r", elen2.amp());
954 bezier_clip(inside_context.amp(), function(arrows__c.class, "inside"), sp, NOT(false));
929 bezier_clip(inside_context, function(arrows__c.class, "inside"), sp, NOT(false));
955930 ps.plus(endp).setStruct(sp.plus(3).getStruct());
956931 ps.plus(endp+1).setStruct(sp.plus(2).getStruct());
957932 ps.plus(endp+2).setStruct(sp.plus(1).getStruct());
967942
968943 //3 q7y4oxn0paexbgynmtg2zmiv
969944 // int arrowStartClip(edge_t* e, pointf * ps, int startp, int endp, bezier * spl, int sflag)
970 public static int arrowStartClip(Agedge_s e, __ptr__ ps, int startp, int endp, bezier spl, int sflag) {
945 public static int arrowStartClip(ST_Agedge_s e, ST_pointf.Array ps, int startp, int endp, ST_bezier spl, int sflag) {
971946 ENTERING("q7y4oxn0paexbgynmtg2zmiv","arrowStartClip");
972947 try {
973 final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
974 final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
948 final ST_inside_t inside_context = new ST_inside_t();
949 final ST_pointf.Array sp = new ST_pointf.Array( 4);
975950 double slen;
976951 MutableDouble slen2 = new MutableDouble(0);
977952 slen = arrow_length(e, sflag);
978953 slen2.setValue(slen * slen);
979954 spl.setInt("sflag", sflag);
980955 spl.setStruct("sp", ps.plus(startp).getStruct());
981 if (endp > startp && DIST2(ps.plus(startp).getPtr(), ps.plus(startp + 3).getPtr()) < slen2.getValue()) {
956 if (endp > startp && DIST2(ps.get(startp), ps.get(startp + 3)) < slen2.getValue()) {
982957 startp += 3;
983958 }
984959 sp.plus(0).setStruct(ps.plus(startp+3).getStruct());
985960 sp.plus(1).setStruct(ps.plus(startp+2).getStruct());
986961 sp.plus(2).setStruct(ps.plus(startp+1).getStruct());
987 sp.plus(3).setStruct(spl.getStruct("sp"));
962 sp.plus(3).setStruct(spl.sp);
988963 /* ensure endpoint starts inside */
989964 inside_context.setPtr("a.p", sp.plus(3).asPtr());
990965 inside_context.setPtr("a.r", slen2.amp());
991 bezier_clip(inside_context.amp(), function(arrows__c.class, "inside"), sp, false);
966 bezier_clip(inside_context, function(arrows__c.class, "inside"), sp, false);
992967 ps.plus(startp).setStruct(sp.plus(3).getStruct());
993968 ps.plus(startp+1).setStruct(sp.plus(2).getStruct());
994969 ps.plus(startp+2).setStruct(sp.plus(1).getStruct());
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class ellipse__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
5050 import static smetana.core.JUtilsDebug.LEAVING;
5151 import static smetana.core.Macro.N;
5252 import static smetana.core.Macro.UNSUPPORTED;
53 import h.Agraph_s;
54 import h.boxf;
55 import h.pointf;
53 import h.ST_Agraph_s;
54 import h.ST_boxf;
55 import h.ST_pointf;
5656 import h.xdot;
5757 import smetana.core.CString;
58 import smetana.core.JUtils;
59 import smetana.core.__array_of_struct__;
60 import smetana.core.__array_of_struct_impl__;
6158 import smetana.core.__ptr__;
62 import smetana.core.__struct__;
6359
6460 public class emit__c {
6561 //1 2digov3edok6d5srhgtlmrycs
319315
320316 //3 c1s4k85p1cdfn176o3uryeros
321317 // static inline pointf pointfof(double x, double y)
322 public static __struct__<pointf> pointfof(double x, double y) {
318 public static ST_pointf pointfof(double x, double y) {
323319 // WARNING!! STRUCT
324320 return pointfof_w_(x, y).copy();
325321 }
326 private static __struct__<pointf> pointfof_w_(double x, double y) {
322 private static ST_pointf pointfof_w_(double x, double y) {
327323 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
328324 try {
329 final __struct__<pointf> r = JUtils.from(pointf.class);
325 final ST_pointf r = new ST_pointf();
330326 r.setDouble("x", x);
331327 r.setDouble("y", y);
332328 return r;
355351
356352
357353
358 //3 1vvsta5i8of59frav6uymguav
359 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
360 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
361 // WARNING!! STRUCT
362 return boxfof_w_(llx, lly, urx, ury).copy();
363 }
364 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
365 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
366 try {
367 final __struct__<boxf> b = JUtils.from(boxf.class);
368 b.getStruct("LL").setDouble("x", llx);
369 b.getStruct("LL").setDouble("y", lly);
370 b.getStruct("UR").setDouble("x", urx);
371 b.getStruct("UR").setDouble("y", ury);
372 return b;
373 } finally {
374 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
375 }
376 }
377354
378355
379356
397374
398375 //3 arrsbik9b5tnfcbzsm8gr2chx
399376 // static inline pointf add_pointf(pointf p, pointf q)
400 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
377 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
401378 // WARNING!! STRUCT
402379 return add_pointf_w_(p.copy(), q.copy()).copy();
403380 }
404 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
381 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
405382 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
406383 try {
407 final __struct__<pointf> r = JUtils.from(pointf.class);
408 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
409 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
384 final ST_pointf r = new ST_pointf();
385 r.setDouble("x", p.x + q.x);
386 r.setDouble("y", p.y + q.y);
410387 return r;
411388 } finally {
412389 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
703680
704681 //3 7udip7yo3ddkp9ocjftokpm9y
705682 // void* init_xdot (Agraph_t* g)
706 public static __ptr__ init_xdot(Agraph_s g) {
683 public static __ptr__ init_xdot(ST_Agraph_s g) {
707684 ENTERING("7udip7yo3ddkp9ocjftokpm9y","init_xdot");
708685 try {
709686 CString p;
14001377 public static boolean check_control_points(__ptr__ cp) {
14011378 ENTERING("7nqmdkcnal35ollpstkk707t8","check_control_points");
14021379 try {
1403 double dis1 = ptToLine2 (cp.plus(0).getStruct(), cp.plus(3).getStruct(), cp.plus(1).getStruct());
1404 double dis2 = ptToLine2 (cp.plus(0).getStruct(), cp.plus(3).getStruct(), cp.plus(2).getStruct());
1380 double dis1 = ptToLine2 ((ST_pointf)cp.plus(0).getStruct(), (ST_pointf)cp.plus(3).getStruct(), (ST_pointf)cp.plus(1).getStruct());
1381 double dis2 = ptToLine2 ((ST_pointf)cp.plus(0).getStruct(), (ST_pointf)cp.plus(3).getStruct(), (ST_pointf)cp.plus(2).getStruct());
14051382 if (dis1 < 2.0*2.0 && dis2 < 2.0*2.0)
14061383 return true;
14071384 else
14161393
14171394 //3 5wldemr88fdxl6101ugewclw9
14181395 // void update_bb_bz(boxf *bb, pointf *cp)
1419 public static void update_bb_bz(__ptr__ bb, __array_of_struct__ cp) {
1396 public static void update_bb_bz(ST_boxf bb, ST_pointf.Array cp) {
14201397 ENTERING("5wldemr88fdxl6101ugewclw9","update_bb_bz");
14211398 try {
14221399 /* if any control point of the segment is outside the bounding box */
1423 if (cp.plus(0).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(0).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
1424 cp.plus(0).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(0).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
1425 cp.plus(1).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(1).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
1426 cp.plus(1).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(1).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
1427 cp.plus(2).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(2).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
1428 cp.plus(2).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(2).getDouble("y") < bb.getStruct("LL").getDouble("y") ||
1429 cp.plus(3).getDouble("x") > bb.getStruct("UR").getDouble("x") || cp.plus(3).getDouble("x") < bb.getStruct("LL").getDouble("x") ||
1430 cp.plus(3).getDouble("y") > bb.getStruct("UR").getDouble("y") || cp.plus(3).getDouble("y") < bb.getStruct("LL").getDouble("y")) {
1400 if (cp.get(0).x > bb.UR.x || cp.get(0).x < bb.LL.x ||
1401 cp.get(0).y > bb.UR.y || cp.get(0).y < bb.LL.y ||
1402 cp.get(1).x > bb.UR.x || cp.get(1).x < bb.LL.x ||
1403 cp.get(1).y > bb.UR.y || cp.get(1).y < bb.LL.y ||
1404 cp.get(2).x > bb.UR.x || cp.get(2).x < bb.LL.x ||
1405 cp.get(2).y > bb.UR.y || cp.get(2).y < bb.LL.y ||
1406 cp.get(3).x > bb.UR.x || cp.get(3).x < bb.LL.x ||
1407 cp.get(3).y > bb.UR.y || cp.get(3).y < bb.LL.y) {
14311408 /* if the segment is sufficiently refined */
14321409 if (check_control_points(cp.asPtr())) {
14331410 int i;
14341411 /* expand the bounding box */
14351412 for (i = 0; i < 4; i++) {
1436 if (cp.plus(i).getDouble("x") > bb.getStruct("UR").getDouble("x"))
1437 bb.getStruct("UR").setDouble("x", cp.plus(i).getDouble("x"));
1438 else if (cp.plus(i).getDouble("x") < bb.getStruct("LL").getDouble("x"))
1439 bb.getStruct("LL").setDouble("x", cp.plus(i).getDouble("x"));
1440 if (cp.plus(i).getDouble("y") > bb.getStruct("UR").getDouble("y"))
1441 bb.getStruct("UR").setDouble("y", cp.plus(i).getDouble("y"));
1442 else if (cp.plus(i).getDouble("y") < bb.getStruct("LL").getDouble("y"))
1443 bb.getStruct("LL").setDouble("y", cp.plus(i).getDouble("y"));
1413 if (cp.get(i).x > bb.UR.x)
1414 bb.UR.setDouble("x", cp.get(i).x);
1415 else if (cp.get(i).x < bb.LL.x)
1416 bb.LL.setDouble("x", cp.get(i).x);
1417 if (cp.get(i).y > bb.UR.y)
1418 bb.UR.setDouble("y", cp.get(i).y);
1419 else if (cp.get(i).y < bb.LL.y)
1420 bb.LL.setDouble("y", cp.get(i).y);
14441421 }
14451422 }
14461423 else { /* else refine the segment */
1447 final __array_of_struct__ left = __array_of_struct_impl__.malloc(pointf.class, 4);
1448 final __array_of_struct__ right = __array_of_struct_impl__.malloc(pointf.class, 4);
1424 final ST_pointf.Array left = new ST_pointf.Array( 4);
1425 final ST_pointf.Array right = new ST_pointf.Array( 4);
14491426 Bezier (cp, 3, 0.5, left.asPtr(), right.asPtr());
14501427 update_bb_bz(bb, left);
14511428 update_bb_bz(bb, right);
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class geom__c {
5552
7370
7471 //3 c1s4k85p1cdfn176o3uryeros
7572 // static inline pointf pointfof(double x, double y)
76 public static __struct__<pointf> pointfof(double x, double y) {
73 public static ST_pointf pointfof(double x, double y) {
7774 // WARNING!! STRUCT
7875 return pointfof_w_(x, y).copy();
7976 }
80 private static __struct__<pointf> pointfof_w_(double x, double y) {
77 private static ST_pointf pointfof_w_(double x, double y) {
8178 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
8279 try {
83 final __struct__<pointf> r = JUtils.from(pointf.class);
80 final ST_pointf r = new ST_pointf();
8481 r.setDouble("x", x);
8582 r.setDouble("y", y);
8683 return r;
109106
110107
111108
112 //3 1vvsta5i8of59frav6uymguav
113 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
114 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
115 // WARNING!! STRUCT
116 return boxfof_w_(llx, lly, urx, ury).copy();
117 }
118 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
119 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
120 try {
121 final __struct__<boxf> b = JUtils.from(boxf.class);
122 b.getStruct("LL").setDouble("x", llx);
123 b.getStruct("LL").setDouble("y", lly);
124 b.getStruct("UR").setDouble("x", urx);
125 b.getStruct("UR").setDouble("y", ury);
126 return b;
127 } finally {
128 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
129 }
130 }
131109
132110
133111
151129
152130 //3 arrsbik9b5tnfcbzsm8gr2chx
153131 // static inline pointf add_pointf(pointf p, pointf q)
154 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
132 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
155133 // WARNING!! STRUCT
156134 return add_pointf_w_(p.copy(), q.copy()).copy();
157135 }
158 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
136 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
159137 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
160138 try {
161 final __struct__<pointf> r = JUtils.from(pointf.class);
162 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
163 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
139 final ST_pointf r = new ST_pointf();
140 r.setDouble("x", p.x + q.x);
141 r.setDouble("y", p.y + q.y);
164142 return r;
165143 } finally {
166144 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
636614
637615 //3 3aiyj7urv33rvps5ds204tciu
638616 // static pointf rotatepf(pointf p, int cwrot)
639 public static __struct__<pointf> rotatepf(final __struct__<pointf> p, int cwrot) {
617 public static ST_pointf rotatepf(final ST_pointf p, int cwrot) {
640618 // WARNING!! STRUCT
641619 return rotatepf_w_(p.copy(), cwrot).copy();
642620 }
643 private static __struct__<pointf> rotatepf_w_(final __struct__<pointf> p, int cwrot) {
621 private static ST_pointf rotatepf_w_(final ST_pointf p, int cwrot) {
644622 ENTERING("3aiyj7urv33rvps5ds204tciu","rotatepf");
645623 try {
646624 UNSUPPORTED("adzi0wztceimu4ni3aonznmq7"); // static pointf rotatepf(pointf p, int cwrot)
725703
726704 //3 5q8h2tm3jifiasn423wrm0y60
727705 // pointf cwrotatepf(pointf p, int cwrot)
728 public static __struct__<pointf> cwrotatepf(final __struct__<pointf> p, int cwrot) {
706 public static ST_pointf cwrotatepf(final ST_pointf p, int cwrot) {
729707 // WARNING!! STRUCT
730708 return cwrotatepf_w_(p.copy(), cwrot).copy();
731709 }
732 private static __struct__<pointf> cwrotatepf_w_(final __struct__<pointf> p, int cwrot) {
710 private static ST_pointf cwrotatepf_w_(final ST_pointf p, int cwrot) {
733711 ENTERING("5q8h2tm3jifiasn423wrm0y60","cwrotatepf");
734712 try {
735 double x = p.getDouble("x"), y = p.getDouble("y");
713 double x = p.x, y = p.y;
736714 switch (cwrot) {
737715 case 0:
738716 break;
803781
804782 //3 6np74e9pfmv8uek8irqru2tma
805783 // pointf ccwrotatepf(pointf p, int ccwrot)
806 public static __struct__<pointf> ccwrotatepf(final __struct__<pointf> p, int ccwrot) {
784 public static ST_pointf ccwrotatepf(final ST_pointf p, int ccwrot) {
807785 // WARNING!! STRUCT
808786 return ccwrotatepf_w_(p.copy(), ccwrot).copy();
809787 }
810 private static __struct__<pointf> ccwrotatepf_w_(final __struct__<pointf> p, int ccwrot) {
788 private static ST_pointf ccwrotatepf_w_(final ST_pointf p, int ccwrot) {
811789 ENTERING("6np74e9pfmv8uek8irqru2tma","ccwrotatepf");
812790 try {
813 double x = p.getDouble("x"), y = p.getDouble("y");
791 double x = p.x, y = p.y;
814792 switch (ccwrot) {
815793 case 0:
816794 break;
894872
895873 //3 90k9l4o3khu3dw0fzkrcd97nk
896874 // double ptToLine2 (pointf a, pointf b, pointf p)
897 public static double ptToLine2(final __struct__<pointf> a, final __struct__<pointf> b, final __struct__<pointf> p) {
875 public static double ptToLine2(final ST_pointf a, final ST_pointf b, final ST_pointf p) {
898876 // WARNING!! STRUCT
899877 return ptToLine2_w_(a.copy(), b.copy(), p.copy());
900878 }
901 private static double ptToLine2_w_(final __struct__<pointf> a, final __struct__<pointf> b, final __struct__<pointf> p) {
879 private static double ptToLine2_w_(final ST_pointf a, final ST_pointf b, final ST_pointf p) {
902880 ENTERING("90k9l4o3khu3dw0fzkrcd97nk","ptToLine2");
903881 try {
904 double dx = b.getDouble("x")-a.getDouble("x");
905 double dy = b.getDouble("y")-a.getDouble("y");
906 double a2 = (p.getDouble("y")-a.getDouble("y"))*dx - (p.getDouble("x")-a.getDouble("x"))*dy;
882 double dx = b.x-a.x;
883 double dy = b.y-a.y;
884 double a2 = (p.y-a.y)*dx - (p.x-a.x)*dy;
907885 a2 *= a2; /* square - ensures that it is positive */
908886 if (a2 < 0.0000000001) return 0.; /* avoid 0/0 problems */
909887 return a2 / (dx*dx + dy*dy);
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class globals__c {
5552 //1 2digov3edok6d5srhgtlmrycs
337334
338335 //3 c1s4k85p1cdfn176o3uryeros
339336 // static inline pointf pointfof(double x, double y)
340 public static __struct__<pointf> pointfof(double x, double y) {
337 public static ST_pointf pointfof(double x, double y) {
341338 // WARNING!! STRUCT
342339 return pointfof_w_(x, y).copy();
343340 }
344 private static __struct__<pointf> pointfof_w_(double x, double y) {
341 private static ST_pointf pointfof_w_(double x, double y) {
345342 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
346343 try {
347 final __struct__<pointf> r = JUtils.from(pointf.class);
344 final ST_pointf r = new ST_pointf();
348345 r.setDouble("x", x);
349346 r.setDouble("y", y);
350347 return r;
373370
374371
375372
376 //3 1vvsta5i8of59frav6uymguav
377 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
378 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
379 // WARNING!! STRUCT
380 return boxfof_w_(llx, lly, urx, ury).copy();
381 }
382 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
383 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
384 try {
385 final __struct__<boxf> b = JUtils.from(boxf.class);
386 b.getStruct("LL").setDouble("x", llx);
387 b.getStruct("LL").setDouble("y", lly);
388 b.getStruct("UR").setDouble("x", urx);
389 b.getStruct("UR").setDouble("y", ury);
390 return b;
391 } finally {
392 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
393 }
394 }
395373
396374
397375
415393
416394 //3 arrsbik9b5tnfcbzsm8gr2chx
417395 // static inline pointf add_pointf(pointf p, pointf q)
418 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
396 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
419397 // WARNING!! STRUCT
420398 return add_pointf_w_(p.copy(), q.copy()).copy();
421399 }
422 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
400 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
423401 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
424402 try {
425 final __struct__<pointf> r = JUtils.from(pointf.class);
426 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
427 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
403 final ST_pointf r = new ST_pointf();
404 r.setDouble("x", p.x + q.x);
405 r.setDouble("y", p.y + q.y);
428406 return r;
429407 } finally {
430408 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class htmllex__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class htmlparse__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import h.textlabel_t;
52 import smetana.core.JUtils;
49 import h.ST_pointf;
50 import h.ST_textlabel_t;
5351 import smetana.core.__ptr__;
54 import smetana.core.__struct__;
5552
5653 public class htmltable__c {
5754 //1 2digov3edok6d5srhgtlmrycs
311308
312309 //3 c1s4k85p1cdfn176o3uryeros
313310 // static inline pointf pointfof(double x, double y)
314 public static __struct__<pointf> pointfof(double x, double y) {
311 public static ST_pointf pointfof(double x, double y) {
315312 // WARNING!! STRUCT
316313 return pointfof_w_(x, y).copy();
317314 }
318 private static __struct__<pointf> pointfof_w_(double x, double y) {
315 private static ST_pointf pointfof_w_(double x, double y) {
319316 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
320317 try {
321 final __struct__<pointf> r = JUtils.from(pointf.class);
318 final ST_pointf r = new ST_pointf();
322319 r.setDouble("x", x);
323320 r.setDouble("y", y);
324321 return r;
347344
348345
349346
350 //3 1vvsta5i8of59frav6uymguav
351 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
352 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
353 // WARNING!! STRUCT
354 return boxfof_w_(llx, lly, urx, ury).copy();
355 }
356 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
357 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
358 try {
359 final __struct__<boxf> b = JUtils.from(boxf.class);
360 b.getStruct("LL").setDouble("x", llx);
361 b.getStruct("LL").setDouble("y", lly);
362 b.getStruct("UR").setDouble("x", urx);
363 b.getStruct("UR").setDouble("y", ury);
364 return b;
365 } finally {
366 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
367 }
368 }
369347
370348
371349
389367
390368 //3 arrsbik9b5tnfcbzsm8gr2chx
391369 // static inline pointf add_pointf(pointf p, pointf q)
392 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
370 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
393371 // WARNING!! STRUCT
394372 return add_pointf_w_(p.copy(), q.copy()).copy();
395373 }
396 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
374 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
397375 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
398376 try {
399 final __struct__<pointf> r = JUtils.from(pointf.class);
400 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
401 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
377 final ST_pointf r = new ST_pointf();
378 r.setDouble("x", p.x + q.x);
379 r.setDouble("y", p.y + q.y);
402380 return r;
403381 } finally {
404382 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
26752653
26762654 //3 39z2hrj2uwkezxobreqxpgb10
26772655 // int make_html_label(void *obj, textlabel_t * lp)
2678 public static int make_html_label(__ptr__ obj, textlabel_t lp) {
2656 public static int make_html_label(__ptr__ obj, ST_textlabel_t lp) {
26792657 ENTERING("39z2hrj2uwkezxobreqxpgb10","make_html_label");
26802658 try {
26812659 UNSUPPORTED("3s2xr5n4swgcjctfsv6qg00p1"); // int make_html_label(void *obj, textlabel_t * lp)
5050 import static gen.lib.common.emit__c.init_xdot;
5151 import static gen.lib.common.labels__c.make_label;
5252 import static gen.lib.common.labels__c.strdup_and_subst_obj;
53 import static gen.lib.common.memory__c.zmalloc;
5453 import static gen.lib.common.utils__c.late_double;
5554 import static gen.lib.common.utils__c.late_int;
5655 import static gen.lib.common.utils__c.late_nnstring;
6362 import static smetana.core.JUtils.atoi;
6463 import static smetana.core.JUtils.enumAsInt;
6564 import static smetana.core.JUtils.getenv;
66 import static smetana.core.JUtils.sizeof;
6765 import static smetana.core.JUtils.strstr;
6866 import static smetana.core.JUtilsDebug.ENTERING;
6967 import static smetana.core.JUtilsDebug.LEAVING;
8684 import static smetana.core.Macro.N;
8785 import static smetana.core.Macro.ROUND;
8886 import static smetana.core.Macro.UNSUPPORTED;
89 import h.Agraph_s;
90 import h.boxf;
87 import h.ST_Agraph_s;
88 import h.ST_layout_t;
89 import h.ST_pointf;
9190 import h.fontname_kind;
92 import h.layout_t;
93 import h.pointf;
9491 import smetana.core.CString;
95 import smetana.core.JUtils;
9692 import smetana.core.Z;
97 import smetana.core.__struct__;
9893
9994 public class input__c {
10095 //1 2digov3edok6d5srhgtlmrycs
354349
355350 //3 c1s4k85p1cdfn176o3uryeros
356351 // static inline pointf pointfof(double x, double y)
357 public static __struct__<pointf> pointfof(double x, double y) {
352 public static ST_pointf pointfof(double x, double y) {
358353 // WARNING!! STRUCT
359354 return pointfof_w_(x, y).copy();
360355 }
361 private static __struct__<pointf> pointfof_w_(double x, double y) {
356 private static ST_pointf pointfof_w_(double x, double y) {
362357 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
363358 try {
364 final __struct__<pointf> r = JUtils.from(pointf.class);
359 final ST_pointf r = new ST_pointf();
365360 r.setDouble("x", x);
366361 r.setDouble("y", y);
367362 return r;
390385
391386
392387
393 //3 1vvsta5i8of59frav6uymguav
394 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
395 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
396 // WARNING!! STRUCT
397 return boxfof_w_(llx, lly, urx, ury).copy();
398 }
399 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
400 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
401 try {
402 final __struct__<boxf> b = JUtils.from(boxf.class);
403 b.getStruct("LL").setDouble("x", llx);
404 b.getStruct("LL").setDouble("y", lly);
405 b.getStruct("UR").setDouble("x", urx);
406 b.getStruct("UR").setDouble("y", ury);
407 return b;
408 } finally {
409 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
410 }
411 }
412388
413389
414390
432408
433409 //3 arrsbik9b5tnfcbzsm8gr2chx
434410 // static inline pointf add_pointf(pointf p, pointf q)
435 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
411 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
436412 // WARNING!! STRUCT
437413 return add_pointf_w_(p.copy(), q.copy()).copy();
438414 }
439 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
415 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
440416 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
441417 try {
442 final __struct__<pointf> r = JUtils.from(pointf.class);
443 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
444 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
418 final ST_pointf r = new ST_pointf();
419 r.setDouble("x", p.x + q.x);
420 r.setDouble("y", p.y + q.y);
445421 return r;
446422 } finally {
447423 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
11641140
11651141 //3 72no6ayfvjinlnupyn5jlmayg
11661142 // static boolean getdoubles2ptf(graph_t * g, char *name, pointf * result)
1167 public static boolean getdoubles2ptf(Agraph_s g, CString name, pointf result) {
1143 public static boolean getdoubles2ptf(ST_Agraph_s g, CString name, ST_pointf result) {
11681144 ENTERING("72no6ayfvjinlnupyn5jlmayg","getdoubles2ptf");
11691145 try {
11701146 CString p;
12671243
12681244 //3 9t08dr2ks9qz1pyfz99awla6x
12691245 // static int findCharset (graph_t * g)
1270 public static int findCharset(Agraph_s g) {
1246 public static int findCharset(ST_Agraph_s g) {
12711247 ENTERING("9t08dr2ks9qz1pyfz99awla6x","findCharset");
12721248 try {
12731249 return 0;
12811257
12821258 //3 3bnmjpvynh1j9oh2p2vi0vh2m
12831259 // static void setRatio(graph_t * g)
1284 public static void setRatio(Agraph_s g) {
1260 public static void setRatio(ST_Agraph_s g) {
12851261 ENTERING("3bnmjpvynh1j9oh2p2vi0vh2m","setRatio");
12861262 try {
12871263 CString p;
13231299
13241300
13251301
1326 //3 8gzdr3oil2d0e2o7m84wsszfg
1327 // void graph_init(graph_t * g, boolean use_rankdir)
13281302 static CString rankname[] = new CString[] { new CString("local"), new CString("global"), new CString("none"), null };
13291303 static int rankcode[] = { 100, 101, 102, 100 };
13301304 static CString fontnamenames[] = new CString[] {new CString("gd"),new CString("ps"),new CString("svg"), null};
13311305 static int fontnamecodes[] = {enumAsInt(fontname_kind.class, "NATIVEFONTS"),enumAsInt(fontname_kind.class, "PSFONTS"),
13321306 enumAsInt(fontname_kind.class, "SVGFONTS"),-1};
1333 public static void graph_init(Agraph_s g, boolean use_rankdir) {
1307 //3 8gzdr3oil2d0e2o7m84wsszfg
1308 //void graph_init(graph_t * g, boolean use_rankdir)
1309 public static void graph_init(ST_Agraph_s g, boolean use_rankdir) {
13341310 ENTERING("8gzdr3oil2d0e2o7m84wsszfg","graph_init");
13351311 try {
13361312 CString p;
13371313 double xf;
13381314 int rankdir;
1339 GD_drawing(g, zmalloc(sizeof(layout_t.class)));
1315 GD_drawing(g, new ST_layout_t());
13401316 /* set this up fairly early in case any string sizes are needed */
13411317 if ((p = agget(g, new CString("fontpath")))!=null || (p = getenv(new CString("DOTFONTPATH")))!=null) {
13421318 UNSUPPORTED("81bz3jcukzyotxiqgrlhn9cbq"); // /* overide GDFONTPATH in local environment if dot
13941370 p = late_string(g, (agattr(g,AGRAPH,new CString("fontnames"),null)), null);
13951371 GD_fontnames(g, maptoken(p, fontnamenames, fontnamecodes));
13961372 setRatio(g);
1397 GD_drawing(g).setBoolean("filled",
1398 getdoubles2ptf(g, new CString("size"), (pointf) GD_drawing(g).getStruct("size").amp()));
1399 getdoubles2ptf(g, new CString("page"), GD_drawing(g).getStruct("page").amp());
1400 GD_drawing(g).setBoolean("centered", mapbool(agget(g, new CString("center"))));
1373 GD_drawing(g).filled =
1374 getdoubles2ptf(g, new CString("size"), (ST_pointf) GD_drawing(g).size);
1375 getdoubles2ptf(g, new CString("page"), (ST_pointf) GD_drawing(g).page);
1376 GD_drawing(g).centered = mapbool(agget(g, new CString("center")));
14011377 if ((p = agget(g, new CString("rotate")))!=null)
1402 GD_drawing(g).setBoolean("landscape", (atoi(p) == 90));
1378 GD_drawing(g).landscape= (atoi(p) == 90);
14031379 else if ((p = agget(g, new CString("orientation")))!=null)
1404 GD_drawing(g).setBoolean("landscape", ((p.charAt(0) == 'l') || (p.charAt(0) == 'L')));
1380 GD_drawing(g).landscape= ((p.charAt(0) == 'l') || (p.charAt(0) == 'L'));
14051381 else if ((p = agget(g, new CString("landscape")))!=null)
1406 GD_drawing(g).setBoolean("landscape", mapbool(p));
1382 GD_drawing(g).landscape= mapbool(p);
14071383 p = agget(g, new CString("clusterrank"));
14081384 Z.z().CL_type = maptoken(p, rankname, rankcode);
14091385 p = agget(g, new CString("concentrate"));
15541530
15551531 //3 5vks1zdadu5vjinaivs0j2bkb
15561532 // void do_graph_label(graph_t * sg)
1557 public static void do_graph_label(Agraph_s sg) {
1533 public static void do_graph_label(ST_Agraph_s sg) {
15581534 ENTERING("5vks1zdadu5vjinaivs0j2bkb","do_graph_label");
15591535 try {
15601536 CString str, pos, just;
15621538 /* it would be nice to allow multiple graph labels in the future */
15631539 if ((str = agget(sg, new CString("label")))!=null && (str.charAt(0) != '\0')) {
15641540 char pos_flag=0;
1565 final __struct__<pointf> dimen = JUtils.from(pointf.class);
1566 GD_has_labels(sg.getPtr("root"), GD_has_labels(sg.getPtr("root")) | (1 << 3));
1541 final ST_pointf dimen = new ST_pointf();
1542 GD_has_labels(sg.root, GD_has_labels(sg.root) | (1 << 3));
15671543 GD_label(sg, make_label(sg, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
15681544 late_double(sg, (agattr(sg,AGRAPH,new CString("fontsize"),null)),
15691545 14.0, 1.0),
15961572 return;
15971573 /* Set border information for cluster labels to allow space
15981574 */
1599 dimen.___(GD_label(sg).getStruct("dimen"));
1600 dimen.setDouble("x", dimen.getDouble("x") + 4*4);
1601 dimen.setDouble("y", dimen.getDouble("y") + 2*4);
1575 dimen.___(GD_label(sg).dimen);
1576 dimen.setDouble("x", dimen.x + 4*4);
1577 dimen.setDouble("y", dimen.y + 2*4);
16021578 if (N(GD_flip(agroot(sg)))) {
16031579 if ((GD_label_pos(sg) & 1)!=0)
16041580 pos_ix = 2;
16051581 else
16061582 pos_ix = 0;
1607 GD_border(sg).plus(pos_ix).setStruct(dimen);
1583 GD_border(sg)[pos_ix].___(dimen);
16081584 } else {
16091585 /* when rotated, the labels will be restored to TOP or BOTTOM */
16101586 UNSUPPORTED("cabz6xbjdvz5vmjulzrhlxh48"); // if ((((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->label_pos) & 1)
6666 import static smetana.core.Macro.MAX;
6767 import static smetana.core.Macro.N;
6868 import static smetana.core.Macro.UNSUPPORTED;
69 import static smetana.core.Macro.ZALLOC;
69 import static smetana.core.Macro.ZALLOC_ST_textspan_t;
7070 import static smetana.core.Macro.agtail;
7171 import static smetana.core.Macro.hackInitDimensionFromLabel;
72 import h.Agedge_s;
73 import h.Agnode_s;
74 import h.Agnodeinfo_t;
75 import h.Agobj_s;
76 import h.Agraph_s;
77 import h.Agraphinfo_t;
78 import h.GVC_s;
72 import h.ST_Agedge_s;
73 import h.ST_Agnode_s;
74 import h.ST_Agnodeinfo_t;
75 import h.ST_Agobj_s;
76 import h.ST_Agraph_s;
77 import h.ST_Agraphinfo_t;
78 import h.ST_Agrec_s;
79 import h.ST_GVC_s;
7980 import h.ST_pointf;
8081 import h.ST_port;
81 import h.boxf;
82 import h.pointf;
83 import h.textlabel_t;
84 import h.textspan_t;
82 import h.ST_textlabel_t;
83 import h.ST_textspan_t;
8584 import smetana.core.CString;
86 import smetana.core.JUtils;
8785 import smetana.core.Memory;
8886 import smetana.core.Z;
8987 import smetana.core.__ptr__;
90 import smetana.core.__struct__;
9188
9289 public class labels__c {
9390 //1 2digov3edok6d5srhgtlmrycs
347344
348345 //3 c1s4k85p1cdfn176o3uryeros
349346 // static inline pointf pointfof(double x, double y)
350 public static __struct__<pointf> pointfof(double x, double y) {
347 public static ST_pointf pointfof(double x, double y) {
351348 // WARNING!! STRUCT
352349 return pointfof_w_(x, y).copy();
353350 }
354 private static __struct__<pointf> pointfof_w_(double x, double y) {
351 private static ST_pointf pointfof_w_(double x, double y) {
355352 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
356353 try {
357 final __struct__<pointf> r = JUtils.from(pointf.class);
354 final ST_pointf r = new ST_pointf();
358355 r.setDouble("x", x);
359356 r.setDouble("y", y);
360357 return r;
383380
384381
385382
386 //3 1vvsta5i8of59frav6uymguav
387 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
388 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
389 // WARNING!! STRUCT
390 return boxfof_w_(llx, lly, urx, ury).copy();
391 }
392 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
393 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
394 try {
395 final __struct__<boxf> b = JUtils.from(boxf.class);
396 b.getStruct("LL").setDouble("x", llx);
397 b.getStruct("LL").setDouble("y", lly);
398 b.getStruct("UR").setDouble("x", urx);
399 b.getStruct("UR").setDouble("y", ury);
400 return b;
401 } finally {
402 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
403 }
404 }
405383
406384
407385
425403
426404 //3 arrsbik9b5tnfcbzsm8gr2chx
427405 // static inline pointf add_pointf(pointf p, pointf q)
428 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
406 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
429407 // WARNING!! STRUCT
430408 return add_pointf_w_(p.copy(), q.copy()).copy();
431409 }
432 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
410 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
433411 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
434412 try {
435 final __struct__<pointf> r = JUtils.from(pointf.class);
436 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
437 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
413 final ST_pointf r = new ST_pointf();
414 r.setDouble("x", p.x + q.x);
415 r.setDouble("y", p.y + q.y);
438416 return r;
439417 } finally {
440418 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
732710 //3 4wkeqik2dt7ecr64ej6ltbnvb
733711 // static void storeline(GVC_t *gvc, textlabel_t *lp, char *line, char terminator)
734712 //private static __struct__<textfont_t> tf = JUtils.from(textfont_t.class);
735 public static void storeline(GVC_s gvc, textlabel_t lp, CString line, char terminator) {
713 public static void storeline(ST_GVC_s gvc, ST_textlabel_t lp, CString line, char terminator) {
736714 ENTERING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
737715 try {
738 final __struct__<pointf> size = JUtils.from(pointf.class);
739 __ptr__ span = null;
740 int oldsz = lp.getInt("u.txt.nspans") + 1;
741 lp.setPtr("u.txt.span", ZALLOC(oldsz + 1, lp.getPtr("u.txt.span"), textspan_t.class, oldsz));
742 span = lp.getPtr("u.txt.span").plus(lp.getInt("u.txt.nspans"));
743 span.setPtr("str", line);
744 span.setInt("just", terminator);
716 final ST_pointf size = new ST_pointf();
717 ST_textspan_t span = null;
718 int oldsz = lp.nspans + 1;
719 lp.span = ZALLOC_ST_textspan_t((ST_textspan_t.Array) lp.span, oldsz + 1);
720 span = lp.span.get(lp.nspans);
721 span.str = line;
722 span.just = terminator;
745723 if (line!=null && line.charAt(0)!='\0') {
746 Z.z().tf.setPtr("name", lp.getPtr("fontname"));
747 Z.z().tf.setDouble("size", lp.getDouble("fontsize"));
724 Z.z().tf.name = lp.fontname;
725 Z.z().tf.size = lp.fontsize;
748726 // WE CHEAT
749 ((ST_pointf) size).x = 0.0;
750 ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20);
727 size.x = 0.0;
728 size.y = (int)(lp.fontsize * 1.20);
751729 hackInitDimensionFromLabel(size, line.getContent());
752 ((ST_pointf) span.getStruct("size")).y = (int)size.getDouble("y");
730 span.size.y = (int)size.y;
753731 }
754732 else {
755733 System.err.println("YOU SHOULD NOT SEE THAT");
756 ((ST_pointf) size).x = 0.0;
757 ((ST_pointf) size).y = (int)(lp.getDouble("fontsize") * 1.20);
758 span.getStruct("size").setDouble("y", (int)(lp.getDouble("fontsize") * 1.20));
734 size.x = 0.0;
735 size.y = (int)(lp.fontsize * 1.20);
736 span.size.y = (int)(lp.fontsize * 1.20);
759737 }
760 lp.setInt("u.txt.nspans", lp.getInt("u.txt.nspans") + 1);
738 lp.nspans = lp.nspans + 1;
761739 /* width = max line width */
762 ((ST_pointf) lp.getStruct("dimen")).x = MAX(lp.getStruct("dimen").getDouble("x"), size.getDouble("x"));
740 lp.dimen.x = MAX(lp.dimen.x, size.x);
763741 /* accumulate height */
764 ((ST_pointf) lp.getStruct("dimen")).y = lp.getStruct("dimen").getDouble("y") + size.getDouble("y");
742 lp.dimen.y = lp.dimen.y + size.y;
765743 } finally {
766744 LEAVING("4wkeqik2dt7ecr64ej6ltbnvb","storeline");
767745 }
772750
773751 //3 22ar72ye93a8ntj8pagnt5b5k
774752 // void make_simple_label(GVC_t * gvc, textlabel_t * lp)
775 public static void make_simple_label(GVC_s gvc, textlabel_t lp) {
753 public static void make_simple_label(ST_GVC_s gvc, ST_textlabel_t lp) {
776754 ENTERING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");
777755 try {
778756 char c;
779 CString p, line, lineptr, str = lp.getCString("text");
757 CString p, line, lineptr, str = lp.text;
780758 char bytee = 0x00;
781 ((ST_pointf) lp.getStruct("dimen")).x = 0.0;
782 ((ST_pointf) lp.getStruct("dimen")).y = 0.0;
759 ((ST_pointf) lp.dimen).x = 0.0;
760 ((ST_pointf) lp.dimen).y = 0.0;
783761 if (str.charAt(0) == '\0')
784762 return;
785763 line = lineptr = null;
794772 * the second in 0x40-0x7e or 0xa1-0xfe. We assume that the input
795773 * is well-formed, but check that we don't go past the ending '\0'.
796774 */
797 if ((lp.getInt("charset") == 2) && 0xA1 <= bytee && bytee <= 0xFE) {
775 if ((lp.charset == 2) && 0xA1 <= bytee && bytee <= 0xFE) {
798776 UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
799777 UNSUPPORTED("ebmmarxykvf76hmfmjuk0ssjz"); // c = *p++;
800778 UNSUPPORTED("6la63t1mnqv30shyyp3yfroxb"); // *lineptr++ = c;
834812 lineptr = lineptr.plus(1);
835813 storeline(gvc, lp, line, 'n');
836814 }
837 lp.setStruct("space", lp.getStruct("dimen"));
815 lp.setStruct("space", lp.dimen);
838816 } finally {
839817 LEAVING("22ar72ye93a8ntj8pagnt5b5k","make_simple_label");
840818 }
845823
846824 //3 ecq5lydlrjrlaz8o6vm6svc8i
847825 // textlabel_t *make_label(void *obj, char *str, int kind, double fontsize, char *fontname, char *fontcolor)
848 public static textlabel_t make_label(__ptr__ obj, CString str, int kind, double fontsize, CString fontname, CString fontcolor) {
826 public static ST_textlabel_t make_label(__ptr__ obj, CString str, int kind, double fontsize, CString fontname, CString fontcolor) {
849827 ENTERING("ecq5lydlrjrlaz8o6vm6svc8i","make_label");
850828 try {
851 textlabel_t rv = (textlabel_t) Memory.malloc(textlabel_t.class);
852 Agraph_s g = null, sg = null;
853 Agnode_s n = null;
854 Agedge_s e = null;
829 ST_textlabel_t rv = new ST_textlabel_t();
830 ST_Agraph_s g = null, sg = null;
831 ST_Agnode_s n = null;
832 ST_Agedge_s e = null;
855833 CString s = null;
856834 switch (agobjkind(obj)) {
857835 case AGRAPH:
858 sg = (Agraph_s)obj;
859 g = (Agraph_s) sg.getPtr("root");
836 sg = (ST_Agraph_s)obj;
837 g = (ST_Agraph_s) sg.root;
860838 break;
861839 case AGNODE:
862 n = (Agnode_s)obj.castTo(Agnode_s.class);
840 n = (ST_Agnode_s)obj.castTo(ST_Agnode_s.class);
863841 g = agroot(agraphof(n));
864842 break;
865843 case AGEDGE:
866 e = (Agedge_s)obj.castTo(Agedge_s.class);
844 e = (ST_Agedge_s)obj.castTo(ST_Agedge_s.class);
867845 g = agroot(agraphof(aghead(e)));
868846 break;
869847 }
870848 rv.setPtr("fontname", fontname);
871849 rv.setPtr("fontcolor", fontcolor);
872850 rv.setDouble("fontsize", fontsize);
873 rv.setInt("charset", g.castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getInt("charset"));
851 rv.charset = ((ST_Agraphinfo_t)g.castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).charset;
874852 if ((kind & (2 << 1))!=0) {
875853 rv.setPtr("text", str.strdup());
876854 if ((kind & (1 << 1))!=0) {
877 rv.setBoolean("html", (N(0)));
855 rv.html = (N(0));
878856 }
879857 }
880858 else if (kind == (1 << 1)) {
881859 rv.setPtr("text", str.strdup());
882 rv.setBoolean("html", N(0));
860 rv.html = N(0);
883861 if (make_html_label(obj, rv)!=0) {
884862 switch (agobjkind(obj)) {
885863 case AGRAPH:
901879 * sequences (\n, \l, \r) are processed in make_simple_label. That call also replaces \\ with \.
902880 */
903881 rv.setPtr("text", strdup_and_subst_obj0(str, obj, 0));
904 switch (rv.getInt("charset")) {
882 switch (rv.charset) {
905883 case 1:
906884 UNSUPPORTED("s = latin1ToUTF8(rv->text);");
907885 break;
908886 default: /* UTF8 */
909 s = htmlEntityUTF8(rv.getCString("text"), g);
887 s = htmlEntityUTF8(rv.text, g);
910888 break;
911889 }
912 Memory.free(rv.getPtr("text"));
890 Memory.free(rv.text);
913891 rv.setPtr("text", s);
914 make_simple_label((GVC_s) g.castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getPtr("gvc"), rv);
892 make_simple_label(g.castTo_ST_Agobj_s().data.castTo_ST_Agraphinfo_t().gvc, rv);
915893 }
916894 return rv;
917895 } finally {
10431021 tp_len = 0, hp_len = 0;
10441022 int newlen = 0;
10451023 int isEdge = 0;
1046 textlabel_t tl;
1024 ST_textlabel_t tl;
10471025 final ST_port pt = new ST_port();
10481026 /* prepare substitution strings */
10491027 switch (agobjkind(obj)) {
10501028 case AGRAPH:
1051 g_str = agnameof((Agraph_s)obj);
1029 g_str = agnameof((ST_Agraph_s)obj);
10521030 g_len = strlen(g_str);
1053 tl = GD_label((Agraph_s)obj);
1031 tl = GD_label((ST_Agraph_s)obj);
10541032 if (tl!=null) {
1055 l_str = tl.getCString("text");
1033 l_str = tl.text;
10561034 if (str!=null) l_len = strlen(l_str);
10571035 }
10581036 break;
10591037 case AGNODE:
1060 g_str = agnameof(agraphof(obj.castTo(Agnode_s.class)));
1038 g_str = agnameof(agraphof(obj.castTo(ST_Agnode_s.class)));
10611039 g_len = strlen(g_str);
1062 n_str = agnameof(obj.castTo(Agnode_s.class));
1040 n_str = agnameof(obj.castTo(ST_Agnode_s.class));
10631041 n_len = strlen(n_str);
1064 tl = (textlabel_t) obj.castTo(Agnode_s.class).castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label");
1042 tl = (ST_textlabel_t) ((ST_Agnode_s)obj.castTo(ST_Agnode_s.class)).castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label;
10651043 if (tl!=null) {
1066 l_str = tl.getCString("text");
1044 l_str = tl.text;
10671045 if (str!=null) l_len = strlen(l_str);
10681046 }
10691047 break;
10701048 case AGEDGE:
10711049 isEdge = 1;
1072 g_str = agnameof(agroot(agraphof(agtail((obj.castTo(Agedge_s.class))))));
1050 g_str = agnameof(agroot(agraphof(agtail((obj.castTo(ST_Agedge_s.class))))));
10731051 g_len = strlen(g_str);
1074 t_str = agnameof(agtail((obj.castTo(Agedge_s.class))));
1052 t_str = agnameof(agtail((obj.castTo(ST_Agedge_s.class))));
10751053 t_len = strlen(t_str);
1076 pt.___(ED_tail_port(obj.castTo(Agedge_s.class)));
1054 pt.___(ED_tail_port(obj.castTo(ST_Agedge_s.class)));
10771055 if ((tp_str = pt.name)!=null)
10781056 tp_len = strlen(tp_str);
1079 h_str = agnameof(aghead((obj.castTo(Agedge_s.class))));
1057 h_str = agnameof(aghead((obj.castTo(ST_Agedge_s.class))));
10801058 h_len = strlen(h_str);
1081 pt.___(ED_head_port(obj.castTo(Agedge_s.class)));
1059 pt.___(ED_head_port(obj.castTo(ST_Agedge_s.class)));
10821060 if ((hp_str = pt.name)!=null)
10831061 hp_len = strlen(hp_str);
10841062 h_len = strlen(h_str);
1085 tl = ED_label(obj.castTo(Agedge_s.class));
1063 tl = ED_label(obj.castTo(ST_Agedge_s.class));
10861064 if (tl!=null) {
1087 l_str = tl.getCString("text");
1065 l_str = tl.text;
10881066 if (str!=null) l_len = strlen(l_str);
10891067 }
1090 if (agisdirected(agroot(agraphof(agtail((obj.castTo(Agedge_s.class)))))))
1068 if (agisdirected(agroot(agraphof(agtail((obj.castTo(ST_Agedge_s.class)))))))
10911069 e_str = new CString("->");
10921070 else
10931071 e_str = new CString("--");
9494
9595
9696
97 //3 4mfikqpmxyxrke46i5xakatmc
98 // void *gmalloc(size_t nbytes)
9997 public static CString gmalloc(int nbytes) {
10098 return new CString(nbytes);
10199 }
100 //3 4mfikqpmxyxrke46i5xakatmc
101 //void *gmalloc(size_t nbytes)
102102 public static __ptr__ gmalloc(size_t nbytes) {
103103 ENTERING("4mfikqpmxyxrke46i5xakatmc","gmalloc");
104104 try {
5656 import static smetana.core.JUtils.atoi;
5757 import static smetana.core.JUtils.setjmp;
5858 import static smetana.core.JUtils.size_t_array_of_integer;
59 import static smetana.core.JUtils.sizeof;
6059 import static smetana.core.JUtilsDebug.ENTERING;
6160 import static smetana.core.JUtilsDebug.LEAVING;
62 import static smetana.core.Macro.ALLOC_empty;
6361 import static smetana.core.Macro.ED_cutvalue;
6462 import static smetana.core.Macro.ED_minlen;
6563 import static smetana.core.Macro.ED_tree_index;
8785 import static smetana.core.Macro.TREE_EDGE;
8886 import static smetana.core.Macro.UNSUPPORTED;
8987 import static smetana.core.Macro.free_list;
90 import h.Agedge_s;
91 import h.Agnode_s;
92 import h.Agraph_s;
93 import h.boxf;
94 import h.nodequeue;
95 import h.pointf;
88 import h.ST_Agedge_s;
89 import h.ST_Agnode_s;
90 import h.ST_Agraph_s;
91 import h.ST_nodequeue;
92 import h.ST_pointf;
9693 import smetana.core.CString;
97 import smetana.core.JUtils;
9894 import smetana.core.Memory;
9995 import smetana.core.Z;
10096 import smetana.core.__ptr__;
101 import smetana.core.__struct__;
10297 import smetana.core.jmp_buf;
10398
10499 public class ns__c {
359354
360355 //3 c1s4k85p1cdfn176o3uryeros
361356 // static inline pointf pointfof(double x, double y)
362 public static __struct__<pointf> pointfof(double x, double y) {
357 public static ST_pointf pointfof(double x, double y) {
363358 // WARNING!! STRUCT
364359 return pointfof_w_(x, y).copy();
365360 }
366 private static __struct__<pointf> pointfof_w_(double x, double y) {
361 private static ST_pointf pointfof_w_(double x, double y) {
367362 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
368363 try {
369 final __struct__<pointf> r = JUtils.from(pointf.class);
364 final ST_pointf r = new ST_pointf();
370365 r.setDouble("x", x);
371366 r.setDouble("y", y);
372367 return r;
395390
396391
397392
398 //3 1vvsta5i8of59frav6uymguav
399 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
400 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
401 // WARNING!! STRUCT
402 return boxfof_w_(llx, lly, urx, ury).copy();
403 }
404 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
405 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
406 try {
407 final __struct__<boxf> b = JUtils.from(boxf.class);
408 b.getStruct("LL").setDouble("x", llx);
409 b.getStruct("LL").setDouble("y", lly);
410 b.getStruct("UR").setDouble("x", urx);
411 b.getStruct("UR").setDouble("y", ury);
412 return b;
413 } finally {
414 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
415 }
416 }
417
418393
419394
420395
437412
438413 //3 arrsbik9b5tnfcbzsm8gr2chx
439414 // static inline pointf add_pointf(pointf p, pointf q)
440 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
415 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
441416 // WARNING!! STRUCT
442417 return add_pointf_w_(p.copy(), q.copy()).copy();
443418 }
444 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
419 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
445420 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
446421 try {
447 final __struct__<pointf> r = JUtils.from(pointf.class);
448 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
449 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
422 final ST_pointf r = new ST_pointf();
423 r.setDouble("x", p.x + q.x);
424 r.setDouble("y", p.y + q.y);
450425 return r;
451426 } finally {
452427 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
774749
775750 //3 6au5htcaxhw0blmx5c48v03u0
776751 // static void add_tree_edge(edge_t * e)
777 public static void add_tree_edge(Agedge_s e) {
752 public static void add_tree_edge(ST_Agedge_s e) {
778753 ENTERING("6au5htcaxhw0blmx5c48v03u0","add_tree_edge");
779754 try {
780 Agnode_s n;
755 ST_Agnode_s n;
781756 if (TREE_EDGE(e)) {
782757 UNSUPPORTED("cq4nqjjxvb0dtdfy4c7pwpqai"); // agerr(AGERR, "add_tree_edge: missing tree edge\n");
783758 UNSUPPORTED("6fzmgjpkhmnx0a2cnt0q0rceg"); // longjmp (jbuf, 1);
828803
829804 //3 9b7b78pmafynmvffztrqnlxtn
830805 // static void exchange_tree_edges(edge_t * e, edge_t * f)
831 public static void exchange_tree_edges(Agedge_s e, Agedge_s f) {
806 public static void exchange_tree_edges(ST_Agedge_s e, ST_Agedge_s f) {
832807 ENTERING("9b7b78pmafynmvffztrqnlxtn","exchange_tree_edges");
833808 try {
834809 int i, j;
835 Agnode_s n;
810 ST_Agnode_s n;
836811 ED_tree_index(f, ED_tree_index(e));
837812 Z.z().Tree_edge.setInList(ED_tree_index(e), f);
838813 ED_tree_index(e, -1);
874849 ENTERING("dbxco6m0mabzhsqfo3pb8nctk","init_rank");
875850 try {
876851 int i, ctr;
877 nodequeue Q;
878 Agnode_s v;
879 Agedge_s e;
852 ST_nodequeue Q;
853 ST_Agnode_s v;
854 ST_Agedge_s e;
880855 Q = new_queue(Z.z().N_nodes);
881856 ctr = 0;
882857 for (v = GD_nlist(Z.z().G_ns); v!=null; v = ND_next(v)) {
886861 while ((v = dequeue(Q))!=null) {
887862 ND_rank(v, 0);
888863 ctr++;
889 for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++)
864 for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++)
890865 ND_rank(v, MAX(ND_rank(v), ND_rank(agtail(e)) + ED_minlen(e)));
891 for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
866 for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
892867 ND_priority(aghead(e), ND_priority(aghead(e)) -1 );
893868 if ((ND_priority(aghead(e))) <= 0)
894869 enqueue(Q, aghead(e));
911886
912887 //3 bj7ux5kz8ls2lnfh0ix6i00b9
913888 // static node_t *incident(edge_t * e)
914 public static Agnode_s incident(Agedge_s e) {
889 public static ST_Agnode_s incident(ST_Agedge_s e) {
915890 ENTERING("bj7ux5kz8ls2lnfh0ix6i00b9","incident");
916891 try {
917892 if (ND_mark(agtail(e))!=0) {
932907
933908 //3 4i9tcvid2iql874c6k70s9aqm
934909 // static edge_t *leave_edge(void)
935 public static Agedge_s leave_edge() {
910 public static ST_Agedge_s leave_edge() {
936911 ENTERING("4i9tcvid2iql874c6k70s9aqm","leave_edge");
937912 try {
938 Agedge_s f, rv = null;
913 ST_Agedge_s f, rv = null;
939914 int j, cnt = 0;
940915 j = Z.z().S_i;
941916 while (Z.z().S_i < Z.z().Tree_edge.size) {
942 if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
917 if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
943918 if (rv!=null) {
944919 if (ED_cutvalue(rv) > ED_cutvalue(f))
945920 rv = f;
946921 } else
947 rv = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
922 rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
948923 if (++cnt >= Z.z().Search_size)
949924 return rv;
950925 }
953928 if (j > 0) {
954929 Z.z().S_i = 0;
955930 while (Z.z().S_i < j) {
956 if (ED_cutvalue(f = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
931 if (ED_cutvalue(f = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i)) < 0) {
957932 if (rv!=null) {
958933 if (ED_cutvalue(rv) > ED_cutvalue(f))
959934 rv = f;
960935 } else
961 rv = (Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
936 rv = (ST_Agedge_s) Z.z().Tree_edge.getFromList(Z.z().S_i);
962937 if (++cnt >= Z.z().Search_size)
963938 return rv;
964939 }
984959
985960 //3 10lkpr4y40luvy2idlozfiva3
986961 // static void dfs_enter_outedge(node_t * v)
987 public static void dfs_enter_outedge(Agnode_s v) {
962 public static void dfs_enter_outedge(ST_Agnode_s v) {
988963 ENTERING("10lkpr4y40luvy2idlozfiva3","dfs_enter_outedge");
989964 try {
990965 int i, slack;
991 Agedge_s e;
992 for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
966 ST_Agedge_s e;
967 for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
993968 if (TREE_EDGE(e) == false) {
994969 if (N(SEQ(Z.z().Low, ND_lim(aghead(e)), Z.z().Lim))) {
995970 slack = SLACK(e);
1001976 } else if (ND_lim(aghead(e)) < ND_lim(v))
1002977 dfs_enter_outedge(aghead(e));
1003978 }
1004 for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
979 for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
1005980 if (ND_lim(agtail(e)) < ND_lim(v))
1006981 dfs_enter_outedge(agtail(e));
1007982 } finally {
1014989
1015990 //3 2z9nii6380p8qlql8nznzgvof
1016991 // static void dfs_enter_inedge(node_t * v)
1017 public static void dfs_enter_inedge(Agnode_s v) {
992 public static void dfs_enter_inedge(ST_Agnode_s v) {
1018993 ENTERING("2z9nii6380p8qlql8nznzgvof","dfs_enter_inedge");
1019994 try {
1020995 int i, slack;
1021 Agedge_s e;
1022 for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
996 ST_Agedge_s e;
997 for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
1023998 if (TREE_EDGE(e) == false) {
1024999 if (N(SEQ(Z.z().Low, ND_lim(agtail(e)), Z.z().Lim))) {
10251000 slack = SLACK(e);
10311006 } else if (ND_lim(agtail(e)) < ND_lim(v))
10321007 dfs_enter_inedge(agtail(e));
10331008 }
1034 for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
1009 for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null && (Z.z().Slack > 0); i++)
10351010 if (ND_lim(aghead(e)) < ND_lim(v))
10361011 dfs_enter_inedge(aghead(e));
10371012 } finally {
10441019
10451020 //3 aeu2po1o1rvibmafk0k8dw0fh
10461021 // static edge_t *enter_edge(edge_t * e)
1047 public static Agedge_s enter_edge(Agedge_s e) {
1022 public static ST_Agedge_s enter_edge(ST_Agedge_s e) {
10481023 ENTERING("aeu2po1o1rvibmafk0k8dw0fh","enter_edge");
10491024 try {
1050 Agnode_s v;
1025 ST_Agnode_s v;
10511026 int outsearch;
10521027 /* v is the down node */
10531028 if (ND_lim(agtail(e)) < ND_lim(aghead(e))) {
10761051
10771052 //3 1gvyafmercq92v3lg6gb33cbt
10781053 // static int treesearch(node_t * v)
1079 public static boolean treesearch(Agnode_s v) {
1054 public static boolean treesearch(ST_Agnode_s v) {
10801055 ENTERING("1gvyafmercq92v3lg6gb33cbt","treesearch");
10811056 try {
10821057 int i;
1083 Agedge_s e;
1084 for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
1058 ST_Agedge_s e;
1059 for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
10851060 if ((ND_mark(aghead(e)) == 0) && (SLACK(e) == 0)) {
10861061 add_tree_edge(e);
10871062 if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(aghead(e)))
10881063 return NOT(0);
10891064 }
10901065 }
1091 for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
1066 for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++) {
10921067 if ((ND_mark(agtail(e)) == 0) && (SLACK(e) == 0)) {
10931068 add_tree_edge(e);
10941069 if ((Z.z().Tree_edge.size == Z.z().N_nodes - 1) || treesearch(agtail(e)))
11101085 ENTERING("c98bj1u8j43cdezeczn33mec0","tight_tree");
11111086 try {
11121087 int i;
1113 Agnode_s n;
1088 ST_Agnode_s n;
11141089 for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
11151090 ND_mark(n, 0);
11161091 ND_tree_in(n).setInList(0, null);
11541129 ENTERING("756raqohoxdeiddqbyr37h7ig","feasible_tree");
11551130 try {
11561131 int i, delta;
1157 Agnode_s n;
1158 Agedge_s e, f;
1132 ST_Agnode_s n;
1133 ST_Agedge_s e, f;
11591134 if (Z.z().N_nodes <= 1)
11601135 return 0;
11611136 while (tight_tree() < Z.z().N_nodes) {
11621137 e = null;
11631138 for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
1164 for (i = 0; (f = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
1139 for (i = 0; (f = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
11651140 if ((TREE_EDGE(f) == false) && incident(f)!=null && ((e == null)
11661141 || (SLACK(f)
11671142 <
11941169
11951170 //3 49un8m43odrf89cedvin3wz3r
11961171 // static node_t *treeupdate(node_t * v, node_t * w, int cutvalue, int dir)
1197 public static Agnode_s treeupdate(Agnode_s v, Agnode_s w, int cutvalue, boolean dir) {
1172 public static ST_Agnode_s treeupdate(ST_Agnode_s v, ST_Agnode_s w, int cutvalue, boolean dir) {
11981173 ENTERING("49un8m43odrf89cedvin3wz3r","treeupdate");
11991174 try {
1200 Agedge_s e;
1175 ST_Agedge_s e;
12011176 boolean d;
12021177 while (N(SEQ(ND_low(v), ND_lim(w), ND_lim(v)))) {
1203 e = (Agedge_s) ND_par(v);
1178 e = (ST_Agedge_s) ND_par(v);
12041179 if (EQ(v, agtail(e)))
12051180 d = dir;
12061181 else
12251200
12261201 //3 e66n8gern1fejjsn8nefypo0g
12271202 // static void rerank(node_t * v, int delta)
1228 public static void rerank(Agnode_s v, int delta) {
1203 public static void rerank(ST_Agnode_s v, int delta) {
12291204 ENTERING("e66n8gern1fejjsn8nefypo0g","rerank");
12301205 try {
12311206 int i;
1232 Agedge_s e;
1207 ST_Agedge_s e;
12331208 ND_rank(v, ND_rank(v) - delta);
1234 for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
1209 for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
12351210 if (NEQ(e, ND_par(v)))
12361211 rerank(aghead(e), delta);
1237 for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
1212 for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
12381213 if (NEQ(e, ND_par(v)))
12391214 rerank(agtail(e), delta);
12401215 } finally {
12471222
12481223 //3 xww1p8bentf1qk7mgfhi1q6m
12491224 // static void update(edge_t * e, edge_t * f)
1250 public static void update(Agedge_s e, Agedge_s f) {
1225 public static void update(ST_Agedge_s e, ST_Agedge_s f) {
12511226 ENTERING("xww1p8bentf1qk7mgfhi1q6m","update");
12521227 try {
12531228 int cutvalue, delta;
1254 Agnode_s lca;
1229 ST_Agnode_s lca;
12551230 delta = SLACK(f);
12561231 /* "for (v = in nodes in tail side of e) do ND_rank(v) -= delta;" */
12571232 if (delta > 0) {
12941269 public static void scan_and_normalize() {
12951270 ENTERING("3yw7w42hz7af67d6qse3b2172","scan_and_normalize");
12961271 try {
1297 Agnode_s n;
1272 ST_Agnode_s n;
12981273 Z.z().Minrank = Integer.MAX_VALUE;
12991274 Z.z().Maxrank = -Integer.MAX_VALUE;
13001275 for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
13191294
13201295 //3 7eg6zti36nbg4tqyo8yunh86r
13211296 // static void freeTreeList (graph_t* g)
1322 public static void freeTreeList(Agraph_s g) {
1297 public static void freeTreeList(ST_Agraph_s g) {
13231298 ENTERING("7eg6zti36nbg4tqyo8yunh86r","freeTreeList");
13241299 try {
1325 Agnode_s n;
1300 ST_Agnode_s n;
13261301 for (n = GD_nlist(Z.z().G_ns); n!=null; n = ND_next(n)) {
13271302 free_list(ND_tree_in(n));
13281303 free_list(ND_tree_out(n));
13421317 ENTERING("9gx8p7md3v3mzp640xdjj814a","LR_balance");
13431318 try {
13441319 int i, delta;
1345 Agedge_s e, f;
1320 ST_Agedge_s e, f;
13461321 for (i = 0; i < Z.z().Tree_edge.size; i++) {
1347 e = (Agedge_s) Z.z().Tree_edge.getFromList(i);
1322 e = (ST_Agedge_s) Z.z().Tree_edge.getFromList(i);
13481323 if (ED_cutvalue(e) == 0) {
13491324 f = enter_edge(e);
13501325 if (f == null)
13721347 public static void TB_balance() {
13731348 ENTERING("5c01jnao2ubmy4l0vi5jol0jz","TB_balance");
13741349 try {
1375 Agnode_s n;
1376 Agedge_s e;
1350 ST_Agnode_s n;
1351 ST_Agedge_s e;
13771352 int i, low, high, choice;
13781353 __ptr__ nrank;
13791354 int inweight, outweight;
13911366 inweight = outweight = 0;
13921367 low = 0;
13931368 high = Z.z().Maxrank;
1394 for (i = 0; (e = (Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
1369 for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
13951370 inweight += ED_weight(e);
13961371 low = MAX(low, ND_rank(agtail(e)) + ED_minlen(e));
13971372 }
1398 for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
1373 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
13991374 outweight += ED_weight(e);
14001375 high = MIN(high, ND_rank(aghead(e)) - ED_minlen(e));
14011376 }
14251400
14261401 //3 37hg5w7ywmyljdiebgp5ltl22
14271402 // static int init_graph(graph_t * g)
1428 public static int init_graph(Agraph_s g) {
1403 public static int init_graph(ST_Agraph_s g) {
14291404 ENTERING("37hg5w7ywmyljdiebgp5ltl22","init_graph");
14301405 try {
14311406 int i, feasible;
1432 Agnode_s n;
1433 Agedge_s e;
1407 ST_Agnode_s n;
1408 ST_Agedge_s e;
14341409 Z.z().G_ns = g;
14351410 Z.z().N_nodes = Z.z().N_edges = Z.z().S_i = 0;
14361411 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
14371412 ND_mark(n, 0);
14381413 Z.z().N_nodes++;
1439 for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++)
1414 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++)
14401415 Z.z().N_edges++;
14411416 }
1442 Z.z().Tree_node.reallocEmpty(Z.z().N_nodes, Agnode_s.class);
1417 Z.z().Tree_node.reallocEmpty(Z.z().N_nodes);
14431418 Z.z().Tree_node.size = 0;
14441419 // Z.z().Tree_edge.setPtr("list", ALLOC_empty(Z.z().N_nodes, Z.z().Tree_edge.getPtr("list"), Agedge_s.class));
14451420 Z.z().Tree_edge.realloc(Z.z().N_nodes);
14471422 feasible = 1;
14481423 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
14491424 ND_priority(n, 0);
1450 for (i = 0; (e = (Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
1425 for (i = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(i))!=null; i++) {
14511426 ND_priority(n, 1+ND_priority(n));
14521427 ED_cutvalue(e, 0);
14531428 ED_tree_index(e, -1);
14561431 feasible = 0;
14571432 }
14581433 // ND_tree_in(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));;
1459 ND_tree_in(n).mallocEmpty(Agedge_s.class, i+1);
1434 ND_tree_in(n).mallocEmpty(i+1);
14601435 ND_tree_in(n).size = 0;
1461 for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++);
1436 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++);
14621437 // ND_tree_out(n).setPtr("list", zmalloc(sizeof(Agedge_s.class, i+1)));
1463 ND_tree_out(n).mallocEmpty(Agedge_s.class, i+1);
1438 ND_tree_out(n).mallocEmpty(i+1);
14641439 ND_tree_out(n).size = 0;
14651440 }
14661441 return feasible;
15001475
15011476 //3 5n0ipwzhr8urlx0fsdzr02gwq
15021477 // int rank2(graph_t * g, int balance, int maxiter, int search_size)
1503 public static int rank2(Agraph_s g, int balance, int maxiter, int search_size) {
1478 public static int rank2(ST_Agraph_s g, int balance, int maxiter, int search_size) {
15041479 ENTERING("5n0ipwzhr8urlx0fsdzr02gwq","rank2");
15051480 try {
15061481 int iter = 0, feasible;
15071482 CString ns = new CString("network simplex: ");
1508 Agedge_s e, f;
1483 ST_Agedge_s e, f;
15091484 /*if (Verbose) {
15101485 int nn, ne;
15111486 graphSize (g, &nn, &ne);
15741549
15751550 //3 aqly8eniwjr5bmh4hzwc7ftdr
15761551 // int rank(graph_t * g, int balance, int maxiter)
1577 public static int rank(Agraph_s g, int balance, int maxiter) {
1552 public static int rank(ST_Agraph_s g, int balance, int maxiter) {
15781553 ENTERING("aqly8eniwjr5bmh4hzwc7ftdr","rank");
15791554 try {
15801555 CString s;
15941569
15951570 //3 2q59mz8qtn0biifbezb8uxz17
15961571 // static void x_cutval(edge_t * f)
1597 public static void x_cutval(Agedge_s f) {
1572 public static void x_cutval(ST_Agedge_s f) {
15981573 ENTERING("2q59mz8qtn0biifbezb8uxz17","x_cutval");
15991574 try {
1600 Agnode_s v=null;
1601 Agedge_s e;
1575 ST_Agnode_s v=null;
1576 ST_Agedge_s e;
16021577 int i, sum, dir=0;
16031578 /* set v to the node on the side of the edge already searched */
16041579 if (EQ(ND_par(agtail(f)), f)) {
16091584 dir = -1;
16101585 }
16111586 sum = 0;
1612 for (i = 0; (e = (Agedge_s) ND_out(v).getFromList(i))!=null; i++)
1587 for (i = 0; (e = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++)
16131588 sum += x_val(e, v, dir);
1614 for (i = 0; (e = (Agedge_s) ND_in(v).getFromList(i))!=null; i++)
1589 for (i = 0; (e = (ST_Agedge_s) ND_in(v).getFromList(i))!=null; i++)
16151590 sum += x_val(e, v, dir);
16161591 ED_cutvalue(f, sum);
16171592 } finally {
16241599
16251600 //3 bfeafmsmmnblgizs37qj03dy4
16261601 // static int x_val(edge_t * e, node_t * v, int dir)
1627 public static int x_val(Agedge_s e, Agnode_s v, int dir) {
1602 public static int x_val(ST_Agedge_s e, ST_Agnode_s v, int dir) {
16281603 ENTERING("bfeafmsmmnblgizs37qj03dy4","x_val");
16291604 try {
1630 Agnode_s other;
1605 ST_Agnode_s other;
16311606 int d=0, rv=0, f=0;
16321607 if (EQ(agtail(e), v))
16331608 other = aghead(e);
16701645
16711646 //3 ah65iqmwa5j0qwotm6amhijlg
16721647 // static void dfs_cutval(node_t * v, edge_t * par)
1673 public static void dfs_cutval(Agnode_s v, Agedge_s par) {
1648 public static void dfs_cutval(ST_Agnode_s v, ST_Agedge_s par) {
16741649 ENTERING("ah65iqmwa5j0qwotm6amhijlg","dfs_cutval");
16751650 try {
16761651 int i;
1677 Agedge_s e;
1678 for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
1652 ST_Agedge_s e;
1653 for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
16791654 if (NEQ(e, par))
16801655 dfs_cutval(aghead(e), e);
1681 for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
1656 for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
16821657 if (NEQ(e, par))
16831658 dfs_cutval(agtail(e), e);
16841659 if (par!=null)
16931668
16941669 //3 cgqr48qol9p8bsqjnryo5z5x9
16951670 // static int dfs_range(node_t * v, edge_t * par, int low)
1696 public static int dfs_range(Agnode_s v, Agedge_s par, int low) {
1671 public static int dfs_range(ST_Agnode_s v, ST_Agedge_s par, int low) {
16971672 ENTERING("cgqr48qol9p8bsqjnryo5z5x9","dfs_range");
16981673 try {
1699 Agedge_s e;
1674 ST_Agedge_s e;
17001675 int i, lim;
17011676 lim = low;
17021677 ND_par(v, par);
17031678 ND_low(v, low);
1704 for (i = 0; (e = (Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
1679 for (i = 0; (e = (ST_Agedge_s) ND_tree_out(v).getFromList(i))!=null; i++)
17051680 if (NEQ(e, par))
17061681 lim = dfs_range(aghead(e), e, lim);
1707 for (i = 0; (e = (Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
1682 for (i = 0; (e = (ST_Agedge_s) ND_tree_in(v).getFromList(i))!=null; i++)
17081683 if (NEQ(e, par))
17091684 lim = dfs_range(agtail(e), e, lim);
17101685 ND_lim(v, lim);
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class output__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class pointset__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
5454 import static gen.lib.cgraph.node__c.agnxtnode;
5555 import static gen.lib.cgraph.obj__c.agroot;
5656 import static gen.lib.common.geom__c.ccwrotatepf;
57 import static gen.lib.common.memory__c.zmalloc;
57 import static gen.lib.common.splines__c.edgeMidpoint;
5858 import static gen.lib.common.splines__c.getsplinepoints;
5959 import static gen.lib.common.utils__c.late_bool;
60 import static gen.lib.common.utils__c.updateBB;
6061 import static gen.lib.label.xlabels__c.placeLabels;
6162 import static smetana.core.JUtils.NEQ;
62 import static smetana.core.JUtils.sizeof;
6363 import static smetana.core.JUtilsDebug.ENTERING;
6464 import static smetana.core.JUtilsDebug.LEAVING;
6565 import static smetana.core.Macro.AGRAPH;
8787 import static smetana.core.Macro.ND_height;
8888 import static smetana.core.Macro.ND_width;
8989 import static smetana.core.Macro.ND_xlabel;
90 import static smetana.core.Macro.NOT;
90 import static smetana.core.Macro.NOTI;
9191 import static smetana.core.Macro.UNSUPPORTED;
92 import h.Agedge_s;
93 import h.Agnode_s;
94 import h.Agraph_s;
95 import h.Agsym_s;
92 import h.ST_Agedge_s;
93 import h.ST_Agnode_s;
94 import h.ST_Agraph_s;
95 import h.ST_Agsym_s;
96 import h.ST_bezier;
9697 import h.ST_boxf;
97 import h.bezier;
98 import h.boxf;
99 import h.label_params_t;
100 import h.object_t;
101 import h.pointf;
102 import h.splines;
103 import h.textlabel_t;
104 import h.xlabel_t;
98 import h.ST_cinfo_t;
99 import h.ST_label_params_t;
100 import h.ST_object_t;
101 import h.ST_pointf;
102 import h.ST_splines;
103 import h.ST_textlabel_t;
104 import h.ST_xlabel_t;
105105 import smetana.core.CString;
106 import smetana.core.JUtils;
106 import smetana.core.Memory;
107107 import smetana.core.Z;
108 import smetana.core.__ptr__;
109 import smetana.core.__struct__;
110108
111109 public class postproc__c {
112110 //1 2digov3edok6d5srhgtlmrycs
366364
367365 //3 c1s4k85p1cdfn176o3uryeros
368366 // static inline pointf pointfof(double x, double y)
369 public static __struct__<pointf> pointfof(double x, double y) {
367 public static ST_pointf pointfof(double x, double y) {
370368 // WARNING!! STRUCT
371369 return pointfof_w_(x, y).copy();
372370 }
373 private static __struct__<pointf> pointfof_w_(double x, double y) {
371 private static ST_pointf pointfof_w_(double x, double y) {
374372 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
375373 try {
376 final __struct__<pointf> r = JUtils.from(pointf.class);
374 final ST_pointf r = new ST_pointf();
377375 r.setDouble("x", x);
378376 r.setDouble("y", y);
379377 return r;
402400
403401
404402
405 //3 1vvsta5i8of59frav6uymguav
406 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
407 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
408 // WARNING!! STRUCT
409 return boxfof_w_(llx, lly, urx, ury).copy();
410 }
411 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
412 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
413 try {
414 final __struct__<boxf> b = JUtils.from(boxf.class);
415 b.getStruct("LL").setDouble("x", llx);
416 b.getStruct("LL").setDouble("y", lly);
417 b.getStruct("UR").setDouble("x", urx);
418 b.getStruct("UR").setDouble("y", ury);
419 return b;
420 } finally {
421 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
422 }
423 }
424
425403
426404
427405
444422
445423 //3 arrsbik9b5tnfcbzsm8gr2chx
446424 // static inline pointf add_pointf(pointf p, pointf q)
447 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
425 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
448426 // WARNING!! STRUCT
449427 return add_pointf_w_(p.copy(), q.copy()).copy();
450428 }
451 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
429 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
452430 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
453431 try {
454 final __struct__<pointf> r = JUtils.from(pointf.class);
455 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
456 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
432 final ST_pointf r = new ST_pointf();
433 r.setDouble("x", p.x + q.x);
434 r.setDouble("y", p.y + q.y);
457435 return r;
458436 } finally {
459437 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
756734
757735 //1 ejooa1m5uoq0ue852wtuerpy
758736 // static pointf Offset
759 //private final static __struct__<pointf> Offset = JUtils.from(pointf.class);
737 //private final static ST_pointf Offset = new ST_pointf();
760738
761739
762740
763741 //3 dajapw16wus3rwimkrk5ihi2b
764742 // static pointf map_point(pointf p)
765 public static __struct__<pointf> map_point(final __struct__<pointf> p) {
743 public static ST_pointf map_point(final ST_pointf p) {
766744 // WARNING!! STRUCT
767745 return map_point_w_(p.copy()).copy();
768746 }
769 private static __struct__<pointf> map_point_w_(final __struct__<pointf> p) {
747 private static ST_pointf map_point_w_(final ST_pointf p) {
770748 ENTERING("dajapw16wus3rwimkrk5ihi2b","map_point");
771749 try {
772750 p.___(ccwrotatepf(p, Z.z().Rankdir * 90));
773 p.setDouble("x", p.getDouble("x") - Z.z().Offset.getDouble("x"));
774 p.setDouble("y", p.getDouble("y") - Z.z().Offset.getDouble("y"));
751 p.setDouble("x", p.x - Z.z().Offset.x);
752 p.setDouble("y", p.y - Z.z().Offset.y);
775753 return p;
776754 } finally {
777755 LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
783761
784762 //3 bvq3vvonvotn47mfe5zsvchie
785763 // static void map_edge(edge_t * e)
786 public static void map_edge(Agedge_s e) {
764 public static void map_edge(ST_Agedge_s e) {
787765 ENTERING("bvq3vvonvotn47mfe5zsvchie","map_edge");
788766 try {
789767 int j, k;
790 final __struct__<bezier> bz = JUtils.from(bezier.class);
768 final ST_bezier bz = new ST_bezier();
791769 if (ED_spl(e) == null) {
792770 if ((Z.z().Concentrate == false) && (ED_edge_type(e) != 6))
793771 System.err.println("lost %s %s edge\n"+ agnameof(agtail(e))+
794772 agnameof(aghead(e)));
795773 return;
796774 }
797 for (j = 0; j < ED_spl(e).getInt("size"); j++) {
798 bz.___(ED_spl(e).getArrayOfPtr("list").plus(j).getStruct());
799 for (k = 0; k < bz.getInt("size"); k++) {
800 bz.getArrayOfPtr("list").plus(k).setStruct(map_point(bz.getArrayOfPtr("list").plus(k).getStruct()));
775 for (j = 0; j < ED_spl(e).size; j++) {
776 bz.___(ED_spl(e).list.plus(j).getStruct());
777 for (k = 0; k < bz.size; k++) {
778 bz.list.get(k).setStruct(map_point((ST_pointf) bz.list.get(k).getStruct()));
801779 }
802 if (bz.getBoolean("sflag"))
780 if (bz.sflag!=0)
803781 UNSUPPORTED("7894dgzvk2um2w1a5ph2r0bcc"); // ED_spl(e)->list[j].sp = map_point(ED_spl(e)->list[j].sp);
804 if (bz.getBoolean("eflag")) {
805 ED_spl(e).getArrayOfPtr("list").plus(j).getStruct("ep").___(map_point(ED_spl(e).getArrayOfPtr("list").plus(j).getStruct("ep")));
782 if (bz.eflag!=0) {
783 ED_spl(e).list.get(j).ep.___(map_point((ST_pointf) ED_spl(e).list.get(j).ep));
806784 }
807785 }
808786 if (ED_label(e)!=null)
809 ED_label(e).getStruct("pos").___(map_point(ED_label(e).getStruct("pos")));
787 ED_label(e).pos.___(map_point((ST_pointf) ED_label(e).pos));
810788 if (ED_xlabel(e)!=null)
811789 UNSUPPORTED("al3tnq9zjjqeq1ll7qdxyu3ja"); // ED_xlabel(e)->pos = map_point(ED_xlabel(e)->pos);
812790 /* vladimir */
813791 if (ED_head_label(e)!=null)
814 UNSUPPORTED("6ntujaf13k6emf6cuf7ox8ath"); // ED_head_label(e)->pos = map_point(ED_head_label(e)->pos);
792 ED_head_label(e).setStruct("pos", map_point((ST_pointf) ED_head_label(e).pos));
815793 if (ED_tail_label(e)!=null)
816 UNSUPPORTED("2is3ug7jbugrkl9bu6nfnz2lt"); // ED_tail_label(e)->pos = map_point(ED_tail_label(e)->pos);
794 ED_tail_label(e).setStruct("pos", map_point((ST_pointf) ED_tail_label(e).pos));
817795 } finally {
818796 LEAVING("bvq3vvonvotn47mfe5zsvchie","map_edge");
819797 }
824802
825803 //3 a3hf82rxsojxbunj6p8a6bkse
826804 // void translate_bb(graph_t * g, int rankdir)
827 public static void translate_bb(Agraph_s g, int rankdir) {
805 public static void translate_bb(ST_Agraph_s g, int rankdir) {
828806 ENTERING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
829807 try {
830808 int c;
839817 }
840818 GD_bb(g).___(new_bb);
841819 if (GD_label(g)!=null) {
842 GD_label(g).setStruct("pos", map_point(GD_label(g).getStruct("pos")));
820 GD_label(g).setStruct("pos", map_point((ST_pointf) GD_label(g).pos));
843821 }
844822 for (c = 1; c <= GD_n_cluster(g); c++)
845 translate_bb((Agraph_s) GD_clust(g).plus(c).getPtr(), rankdir);
823 translate_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), rankdir);
846824 } finally {
847825 LEAVING("a3hf82rxsojxbunj6p8a6bkse","translate_bb");
848826 }
853831
854832 //3 h4i5qxnd7hlrew919abswd13
855833 // static void translate_drawing(graph_t * g)
856 public static void translate_drawing(Agraph_s g) {
834 public static void translate_drawing(ST_Agraph_s g) {
857835 ENTERING("h4i5qxnd7hlrew919abswd13","translate_drawing");
858836 try {
859 Agnode_s v;
860 Agedge_s e;
861 boolean shift = (Z.z().Offset.getDouble("x")!=0.0 || Z.z().Offset.getDouble("y")!=0.0);
837 ST_Agnode_s v;
838 ST_Agedge_s e;
839 boolean shift = (Z.z().Offset.x!=0.0 || Z.z().Offset.y!=0.0);
862840 if (N(shift) && N(Z.z().Rankdir))
863841 return;
864842 for (v = agfstnode(g); v!=null; v = agnxtnode(g, v)) {
910888
911889 //3 2i713kmewjct2igf3lwm80462
912890 // static pointf centerPt (xlabel_t* xlp)
913 public static Object centerPt(Object... arg) {
914 UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
915 UNSUPPORTED("1pd2hqj3zbktacr9dt2vdvkgr"); // centerPt (xlabel_t* xlp) {
916 UNSUPPORTED("3f7r93jimpwvyc6atnkppttgl"); // pointf p;
917 UNSUPPORTED("6jtpe3khjpc9oogxx6kerapem"); // p = xlp->pos;
918 UNSUPPORTED("7rsewd63gsf3h9d5aj5v7x66c"); // p.x += (xlp->sz.x)/2.0;
919 UNSUPPORTED("3c70xgshcb3nvyi64kr041yjz"); // p.y += (xlp->sz.y)/2.0;
920 UNSUPPORTED("bft6601q2uop0mu5y59jg4c81"); // return p;
921 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
922
923 throw new UnsupportedOperationException();
891 public static ST_pointf centerPt(ST_xlabel_t.Array xlp) {
892 ENTERING("2i713kmewjct2igf3lwm80462","centerPt");
893 try {
894 final ST_pointf p = new ST_pointf();
895 p.___(xlp.getStruct().pos);
896 p.setDouble("x", p.x + xlp.getStruct().sz.x/2);
897 p.setDouble("y", p.y + xlp.getStruct().sz.y/2);
898 return p;
899 } finally {
900 LEAVING("2i713kmewjct2igf3lwm80462","centerPt");
901 }
924902 }
925903
926904
963941
964942 //3 95pnpuiq4khinrz2bqkci9nfg
965943 // static pointf edgeTailpoint (Agedge_t* e)
966 public static Object edgeTailpoint(Object... arg) {
967 UNSUPPORTED("2zzd7mrm2u540dwuyzehozffj"); // static pointf
968 UNSUPPORTED("b5i1gh69zn27sn9j8kpmvtbeb"); // edgeTailpoint (Agedge_t* e)
969 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
970 UNSUPPORTED("6tl9mepc2bett364jduh2q4mf"); // splines *spl;
971 UNSUPPORTED("3hs99atzl1l857khumt6ycmbh"); // bezier *bez;
972 UNSUPPORTED("26m18ntdxgq9wp5vlh2x7auh5"); // if ((spl = getsplinepoints(e)) == NULL) {
944 public static ST_pointf edgeTailpoint(ST_Agedge_s e) {
945 ENTERING("95pnpuiq4khinrz2bqkci9nfg","edgeTailpoint");
946 try {
947 return edgeTailpoint_(e).copy();
948 } finally {
949 LEAVING("95pnpuiq4khinrz2bqkci9nfg","edgeTailpoint");
950 }
951 }
952 private static ST_pointf edgeTailpoint_(ST_Agedge_s e) {
953 ST_splines spl;
954 ST_bezier bez;
955 spl = getsplinepoints(e);
956 if (spl == null) {
973957 UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
974958 UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
975959 UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
976 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
977 UNSUPPORTED("4djdvk87infum4r43tuhnm5mp"); // bez = &spl->list[0];
978 UNSUPPORTED("45rq0m21hutb3z6f4npw7ke9f"); // if (bez->sflag) {
979 UNSUPPORTED("9ttezx014gi1oy9xopnihsnac"); // return bez->sp;
980 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
981 UNSUPPORTED("c00cyqleu301qclgim7szyf7"); // return bez->list[0];
982 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
983 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
984
985 throw new UnsupportedOperationException();
960 }
961 bez = spl.list.get(0);
962 // bez = &spl->list[0];
963 if (bez.sflag!=0) {
964 return (ST_pointf) bez.sp;
965 } else {
966 return (ST_pointf) (bez.getPtr()).list.get(0);
967 // return bez->list[0];
968 }
969
986970 }
987971
988972
990974
991975 //3 av67wf2xi70ncgl90j1ttrjjs
992976 // static pointf edgeHeadpoint (Agedge_t* e)
993 public static __struct__<pointf> edgeHeadpoint(Agedge_s e) {
977 public static ST_pointf edgeHeadpoint(ST_Agedge_s e) {
978 ENTERING("av67wf2xi70ncgl90j1ttrjjs","edgeHeadpoint");
979 try {
994980 return edgeHeadpoint_(e).copy();
995 }
996 private static __struct__<pointf> edgeHeadpoint_(Agedge_s e) {
997 splines spl;
998 __ptr__ bez;
981 } finally {
982 LEAVING("av67wf2xi70ncgl90j1ttrjjs","edgeHeadpoint");
983 }
984 }
985 private static ST_pointf edgeHeadpoint_(ST_Agedge_s e) {
986 ST_splines spl;
987 ST_bezier bez;
999988 spl = getsplinepoints(e);
1000989 if (spl == null) {
1001990 UNSUPPORTED("9wdrv4uc4c7ssn0qpmxgz5eu1"); // pointf p;
1002991 UNSUPPORTED("ezy0ey6dn5uqp6peuorn615x6"); // p.x = p.y = 0;
1003992 UNSUPPORTED("68kasxgknec72r19lohbk6n3q"); // return p;
1004993 }
1005 bez = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr();
994 bez = spl.list.plus(spl.size - 1).getPtr();
1006995 // bez = &spl->list[spl->size - 1];
1007 if (bez.getBoolean("eflag")) {
1008 return bez.getStruct("ep");
996 if (bez.eflag!=0) {
997 return (ST_pointf) bez.ep;
1009998 } else {
1010 UNSUPPORTED("6qzm0hh4pxrspfbvxearcz9z8"); // return bez->list[bez->size - 1];
1011 }
1012
1013 throw new UnsupportedOperationException();
999 return (ST_pointf) ((ST_bezier)bez.getPtr()).list.plus(bez.size - 1).getStruct();
1000 // return bez->list[bez->size - 1];
1001 }
10141002 }
10151003
10161004
10181006
10191007 //3 1ca6fh8ns5bgzfzcz8al4eh4k
10201008 // static boxf adjustBB (object_t* objp, boxf bb)
1021 public static __struct__<boxf> adjustBB(__ptr__ objp, __struct__<boxf> bb) {
1009 public static ST_boxf adjustBB(ST_object_t.Array objp, ST_boxf bb) {
1010 ENTERING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
1011 try {
10221012 return adjustBB_(objp, bb.copy()).copy();
1023 }
1024 private static __struct__<boxf> adjustBB_(__ptr__ objp, __struct__<boxf> bb) {
1025 final __struct__<pointf> ur = JUtils.from(pointf.class);
1013 } finally {
1014 LEAVING("1ca6fh8ns5bgzfzcz8al4eh4k","adjustBB");
1015 }
1016 }
1017 private static ST_boxf adjustBB_(ST_object_t.Array objp, ST_boxf bb) {
1018 final ST_pointf ur = new ST_pointf();
10261019 /* Adjust bounding box */
1027 bb.getStruct("LL").setDouble("x", MIN(bb.getStruct("LL").getDouble("x"), objp.getPtr("pos").getDouble("x")));
1028 bb.getStruct("LL").setDouble("y", MIN(bb.getStruct("LL").getDouble("y"), objp.getPtr("pos").getDouble("y")));
1029 ur.setDouble("x", objp.getPtr("pos").getDouble("x") + objp.getPtr("sz").getDouble("x"));
1030 ur.setDouble("y", objp.getPtr("pos").getDouble("y") + objp.getPtr("sz").getDouble("y"));
1031 bb.getStruct("UR").setDouble("x", MAX(bb.getStruct("UR").getDouble("x"), ur.getDouble("x")));
1032 bb.getStruct("UR").setDouble("y", MAX(bb.getStruct("UR").getDouble("y"), ur.getDouble("y")));
1020 bb.LL.setDouble("x", MIN(bb.LL.x, objp.getStruct().pos.x));
1021 bb.LL.setDouble("y", MIN(bb.LL.y, objp.getStruct().pos.y));
1022 ur.setDouble("x", objp.getStruct().pos.x + objp.getStruct().sz.x);
1023 ur.setDouble("y", objp.getStruct().pos.y + objp.getStruct().sz.y);
1024 bb.UR.setDouble("x", MAX(bb.UR.x, ur.x));
1025 bb.UR.setDouble("y", MAX(bb.UR.y, ur.y));
10331026 return bb;
10341027 }
10351028
10381031
10391032 //3 3mefe722uemyoa0czmkkw6hjb
10401033 // static void addXLabel (textlabel_t* lp, object_t* objp, xlabel_t* xlp, int initObj, pointf pos)
1041 public static void addXLabel(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
1034 public static void addXLabel(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) {
1035 ENTERING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
1036 try {
10421037 addXLabel_(lp, objp, xlp, initObj, pos.copy());
1043 }
1044 private static void addXLabel_(textlabel_t lp, __ptr__ objp, __ptr__ xlp, int initObj, __struct__<pointf> pos) {
1038 } finally {
1039 LEAVING("3mefe722uemyoa0czmkkw6hjb","addXLabel");
1040 }
1041 }
1042 private static void addXLabel_(ST_textlabel_t lp, ST_object_t.Array objp, ST_xlabel_t.Array xlp, int initObj, ST_pointf pos) {
10451043 if (initObj!=0) {
1046 objp.getStruct("sz").setDouble("x", 0);
1047 objp.getStruct("sz").setDouble("y", 0);
1044 objp.getStruct().sz.setDouble("x", 0);
1045 objp.getStruct().sz.setDouble("y", 0);
10481046 objp.setStruct("pos", pos);
10491047 }
10501048 if (Z.z().Flip) {
10521050 UNSUPPORTED("6v5t3ysaisj27bwc0r9zg3rpd"); // xlp->sz.y = lp->dimen.x;
10531051 }
10541052 else {
1055 xlp.setStruct("sz", lp.getStruct("dimen"));
1056 }
1057 xlp.setPtr("lbl", lp);
1058 xlp.setInt("set", 0);
1053 xlp.get(0).sz.___(lp.dimen);
1054 }
1055 xlp.get(0).lbl = lp;
1056 xlp.get(0).set = 0;
10591057 objp.setPtr("lbl", xlp);
10601058 }
10611059
10641062
10651063 //3 dwxd5kvlanbcxqfuncjg0ea54
10661064 // static boxf addLabelObj (textlabel_t* lp, object_t* objp, boxf bb)
1067 public static __struct__<boxf> addLabelObj(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
1065 public static ST_boxf addLabelObj(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
10681066 // WARNING!! STRUCT
10691067 return addLabelObj_(lp, objp, bb.copy()).copy();
10701068 }
1071 private static __struct__<boxf> addLabelObj_(textlabel_t lp, __ptr__ objp, __struct__<boxf> bb) {
1072 ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
1069 private static ST_boxf addLabelObj_(ST_textlabel_t lp, ST_object_t.Array objp, final ST_boxf bb) {
1070 ENTERING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
10731071 try {
10741072 if (Z.z().Flip) {
10751073 UNSUPPORTED("6z2yrwq81gtsk3q9c5pofow1x"); // objp->sz.x = lp->dimen.y;
10761074 UNSUPPORTED("8xsm9kavrekjrsydqe1wh1pu"); // objp->sz.y = lp->dimen.x;
10771075 }
10781076 else {
1079 objp.getPtr("sz").setDouble("x", lp.getStruct("dimen").getDouble("x"));
1080 objp.getPtr("sz").setDouble("y", lp.getStruct("dimen").getDouble("y"));
1077 objp.getStruct().sz.setDouble("x", lp.dimen.x);
1078 objp.getStruct().sz.setDouble("y", lp.dimen.y);
10811079 }
1082 objp.setStruct("pos", lp.getStruct("pos"));
1083 objp.getStruct("pos").setDouble("x", objp.getStruct("pos").getDouble("x") - (objp.getStruct("sz").getDouble("x") / 2.0 ));
1084 objp.getStruct("pos").setDouble("y", objp.getStruct("pos").getDouble("y") - (objp.getStruct("sz").getDouble("y") / 2.0 ));
1080 objp.setStruct("pos", lp.pos);
1081 objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - (objp.getStruct().sz.x / 2.0 ));
1082 objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - (objp.getStruct().sz.y / 2.0 ));
10851083 return adjustBB(objp, bb);
10861084 } finally {
1087 LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
1085 LEAVING("dwxd5kvlanbcxqfuncjg0ea54","addLabelObj");
10881086 }
10891087 }
10901088
10931091
10941092 //3 b8tjygxnwny5qoiir1mha1d62
10951093 // static boxf addNodeObj (node_t* np, object_t* objp, boxf bb)
1096 public static __struct__<boxf> addNodeObj(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
1094 public static ST_boxf addNodeObj(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
10971095 // WARNING!! STRUCT
10981096 return addNodeObj_(np, objp, bb.copy()).copy();
10991097 }
1100 public static __struct__<boxf> addNodeObj_(Agnode_s np, __ptr__ objp, __struct__<boxf> bb) {
1098 public static ST_boxf addNodeObj_(ST_Agnode_s np, ST_object_t.Array objp, final ST_boxf bb) {
11011099 ENTERING("b8tjygxnwny5qoiir1mha1d62","map_point");
11021100 try {
11031101 if (Z.z().Flip) {
11051103 UNSUPPORTED("6r5gwwhz3sjxrssh8yo3v5c3v"); // objp->sz.y = ((ND_width(np))*(double)72);
11061104 }
11071105 else {
1108 objp.getPtr("sz").setDouble("x", ((ND_width(np))*(double)72));
1109 objp.getPtr("sz").setDouble("y", ((ND_height(np))*(double)72));
1106 objp.getStruct().sz.setDouble("x", ((ND_width(np))*(double)72));
1107 objp.getStruct().sz.setDouble("y", ((ND_height(np))*(double)72));
11101108 }
11111109 objp.setPtr("pos", ND_coord(np));
1112 objp.getPtr("pos").setDouble("x", objp.getPtr("pos").getDouble("x") - objp.getPtr("sz").getDouble("x") / 2.0);
1113 objp.getPtr("pos").setDouble("y", objp.getPtr("pos").getDouble("y") - objp.getPtr("sz").getDouble("y") / 2.0);
1110 objp.getStruct().pos.setDouble("x", objp.getStruct().pos.x - objp.getStruct().sz.x / 2.0);
1111 objp.getStruct().pos.setDouble("y", objp.getStruct().pos.y - objp.getStruct().sz.y / 2.0);
11141112 return adjustBB(objp, bb);
11151113 } finally {
11161114 LEAVING("dajapw16wus3rwimkrk5ihi2b","map_point");
11221120
11231121 //3 6kx3lin2ig9o2otk2bqzdvd4t
11241122 // static cinfo_t addClusterObj (Agraph_t* g, cinfo_t info)
1125 public static Object addClusterObj(Object... arg) {
1126 UNSUPPORTED("91ncv8p43nko0ygysclvv77j"); // static cinfo_t
1127 UNSUPPORTED("bmfjbc1td1mizemu2aa81cyli"); // addClusterObj (Agraph_t* g, cinfo_t info)
1128 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1129 UNSUPPORTED("53xzwretgdbd0atozc0w6hagb"); // int c;
1130 UNSUPPORTED("7z5fb6iyowsosn1hiz7opeoc6"); // for (c = 1; c <= GD_n_cluster(g); c++)
1131 UNSUPPORTED("6o81thi0rqvkah0s4zkn2fcg4"); // info = addClusterObj (GD_clust(g)[c], info);
1132 UNSUPPORTED("1ke0hve63v76yb4shi7jfrp6x"); // if ((g != agroot(g)) && (GD_label(g)) && GD_label(g)->set) {
1133 UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp;
1134 UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb);
1135 UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++;
1136 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1137 UNSUPPORTED("9kt6o7m6t7fgdh41zfez84fmv"); // return info;
1138 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1139
1140 throw new UnsupportedOperationException();
1123 public static ST_cinfo_t addClusterObj(ST_Agraph_s g, ST_cinfo_t info) {
1124 ENTERING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj");
1125 try {
1126 return addClusterObj_(g, info.copy()).copy();
1127 } finally {
1128 LEAVING("6kx3lin2ig9o2otk2bqzdvd4t","addClusterObj");
1129 }
1130 }
1131 private static ST_cinfo_t addClusterObj_(ST_Agraph_s g, ST_cinfo_t info) {
1132 int c;
1133 for (c = 1; c <= GD_n_cluster(g); c++)
1134 info.___(addClusterObj ((ST_Agraph_s)GD_clust(g).get(c).castTo(ST_Agraph_s.class), info));
1135 if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && GD_label(g).set!=0) {
1136 ST_object_t.Array objp = info.objp;
1137 info.setStruct("bb", addLabelObj (GD_label(g), objp, (ST_boxf) info.bb));
1138 info.objp = info.objp.plus(1);
1139 //UNSUPPORTED("dcgq2zlh4t0m1gno12t6h7ouy"); // object_t* objp = info.objp;
1140 //UNSUPPORTED("ddz79zm5235krd6smukq1gza0"); // info.bb = addLabelObj (GD_label(g), objp, info.bb);
1141 //UNSUPPORTED("be25qc3x3muxo4l87ji01t3kd"); // info.objp++;
1142 }
1143 return info;
11411144 }
11421145
11431146
11451148
11461149 //3 2tdbzvdtkwxp75kj0iufsynm5
11471150 // static int countClusterLabels (Agraph_t* g)
1148 public static Object countClusterLabels(Object... arg) {
1149 UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
1150 UNSUPPORTED("6o4fsu24jc0ezulf31fsi9bce"); // countClusterLabels (Agraph_t* g)
1151 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1152 UNSUPPORTED("2q4dlnxpy4lj011whzcbyq3xj"); // int c, i = 0;
1153 UNSUPPORTED("68odyos1g0n4tbs7c77r0f9wn"); // if ((g != agroot(g)) && (GD_label(g)) && GD_label(g)->set)
1154 UNSUPPORTED("chd2f5z6rt19lbaye25ej7q6j"); // i++;
1155 UNSUPPORTED("7z5fb6iyowsosn1hiz7opeoc6"); // for (c = 1; c <= GD_n_cluster(g); c++)
1156 UNSUPPORTED("adgz5sd2oklf51or5uq3wduuz"); // i += countClusterLabels (GD_clust(g)[c]);
1157 UNSUPPORTED("ahwo5hst5k1gyq20ve63ahe81"); // return i;
1158 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1159
1160 throw new UnsupportedOperationException();
1151 public static int countClusterLabels(ST_Agraph_s g) {
1152 ENTERING("2tdbzvdtkwxp75kj0iufsynm5","countClusterLabels");
1153 try {
1154 int c, i = 0;
1155 if (NEQ(g, agroot(g)) && GD_label(g)!=null && GD_label(g).set!=0)
1156 i++;
1157 for (c = 1; c <= GD_n_cluster(g); c++)
1158 i += countClusterLabels((ST_Agraph_s) GD_clust(g).plus(c).castTo(ST_Agraph_s.class));
1159 return i;
1160 } finally {
1161 LEAVING("2tdbzvdtkwxp75kj0iufsynm5","countClusterLabels");
1162 }
1163
11611164 }
11621165
11631166
11651168
11661169 //3 d4215jd9wukfn6t0iknwzjcof
11671170 // static void addXLabels(Agraph_t * gp)
1168 public static void addXLabels(Agraph_s gp) {
1171 public static void addXLabels(ST_Agraph_s gp) {
11691172 ENTERING("d4215jd9wukfn6t0iknwzjcof","addXLabels");
11701173 try {
1171 Agnode_s np;
1172 Agedge_s ep;
1174 ST_Agnode_s np;
1175 ST_Agedge_s ep;
11731176 int cnt, i, n_objs, n_lbls;
11741177 int n_nlbls = 0; /* # of unset node xlabels */
11751178 int n_elbls = 0; /* # of unset edge labels or xlabels */
11761179 int n_set_lbls = 0; /* # of set xlabels and edge labels */
11771180 int n_clbls = 0; /* # of set cluster labels */
1178 final __struct__<boxf> bb = JUtils.from(boxf.class);
1179 final __struct__<pointf> ur = JUtils.from(pointf.class);
1180 textlabel_t lp;
1181 final __struct__<label_params_t> params = JUtils.from(label_params_t.class);
1182 __ptr__ objs;
1183 __ptr__ lbls;
1184 __ptr__ objp;
1185 __ptr__ xlp;
1186 Agsym_s force;
1181 final ST_boxf bb = new ST_boxf();
1182 final ST_pointf ur = new ST_pointf();
1183 ST_textlabel_t lp;
1184 final ST_label_params_t params = new ST_label_params_t();
1185 ST_object_t.Array objs;
1186 ST_xlabel_t.Array lbls;
1187 ST_object_t.Array objp;
1188 ST_xlabel_t.Array xlp;
1189 ST_Agsym_s force;
11871190 int et = (GD_flags(gp) & (7 << 1));
11881191 if (N(GD_has_labels(gp) & (1 << 4)) &&
11891192 N(GD_has_labels(gp) & (1 << 5)) &&
12061209 UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
12071210 }
12081211 if (ED_head_label(ep)!=null) {
1209 if (ED_head_label(ep).getBoolean("set"))
1212 if (ED_head_label(ep).set!=0)
12101213 n_set_lbls++;
12111214 else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
12121215 n_elbls++;
12131216 }
12141217 if (ED_tail_label(ep)!=null) {
1215 UNSUPPORTED("abwl715n01quq34u2qs1kn9xn"); // if (ED_tail_label(ep)->set)
1216 UNSUPPORTED("8k2rclvg6eaoph9r2pz4620xq"); // n_set_lbls++;
1217 UNSUPPORTED("14y6caappoxe17mogr979qf75"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL)))
1218 UNSUPPORTED("q3t8uxncrxc4n8rtuabtzxya"); // n_elbls++;
1218 if (ED_tail_label(ep).set!=0)
1219 n_set_lbls++;
1220 else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
1221 n_elbls++;
12191222 }
12201223 if (ED_label(ep)!=null) {
1221 if (ED_label(ep).getBoolean("set"))
1224 if (ED_label(ep).set!=0)
12221225 n_set_lbls++;
12231226 else if (((et != (0 << 1)) && (ED_spl(ep) != null)))
12241227 n_elbls++;
12261229 }
12271230 }
12281231 if ((GD_has_labels(gp) & (1 << 3))!=0)
1229 UNSUPPORTED("4z3bgexjlrmdrfgpdaajems8q"); // n_clbls = countClusterLabels (gp);
1232 n_clbls = countClusterLabels (gp);
12301233 /* A label for each unpositioned external label */
12311234 n_lbls = n_nlbls + n_elbls;
12321235 if (n_lbls == 0) return;
12341237 * and all unset edge labels and xlabels.
12351238 */
12361239 n_objs = agnnodes(gp) + n_set_lbls + n_clbls + n_elbls;
1237 objs = zmalloc(sizeof(object_t.class, n_objs));
1240 objs = new ST_object_t.Array(n_objs);
12381241 objp = objs;
1239 lbls = zmalloc(sizeof(xlabel_t.class, n_lbls));
1242 lbls = new ST_xlabel_t.Array(n_lbls);
12401243 xlp = lbls;
12411244 bb.setStruct("LL", pointfof(INT_MAX, INT_MAX));
12421245 bb.setStruct("UR", pointfof(-INT_MAX, -INT_MAX));
12571260 for (ep = agfstout(gp, np); ep!=null; ep = agnxtout(gp, ep)) {
12581261 lp = ED_label(ep);
12591262 if (lp != null) {
1260 if (lp.getBoolean("set")) {
1263 if (lp.set!=0) {
12611264 bb.___(addLabelObj (lp, objp, bb));
12621265 }
12631266 else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
1264 UNSUPPORTED("9ffmrymv8cg4h4b3ea97t9qbp"); // addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
1265 UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
1267 addXLabel (lp, objp, xlp, 1, edgeMidpoint(gp, ep));
1268 xlp = xlp.plus(1);
12661269 }
12671270 else {
12681271 UNSUPPORTED("3ia66n3hqrwmh3hybkoh6f8wa"); // agerr(AGWARN, "no position for edge with label %s",
12731276 }
12741277 lp = ED_tail_label(ep);
12751278 if (lp != null) {
1276 if (lp.getBoolean("set")) {
1279 if (lp.set!=0) {
12771280 UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
12781281 }
1279 UNSUPPORTED("dfnmpe0hri6ksye0gnxssi4zz"); // else if (((et != (0 << 1)) && (ED_spl(ep) != NULL))) {
1280 UNSUPPORTED("bqc6ukxlmt6l3osbpsmqbzutc"); // addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
1281 UNSUPPORTED("808184nt3k6cxj5dsg27yvpvg"); // xlp++;
1282 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
1283 UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
1282 else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
1283 addXLabel (lp, objp, xlp, 1, edgeTailpoint(ep));
1284 xlp = xlp.plus(1);
1285 }
1286 else {
12841287 UNSUPPORTED("5ixexxcbcix5hrfl43td7pj4s"); // agerr(AGWARN, "no position for edge with tail label %s",
12851288 UNSUPPORTED("cf9qaysecgkvv4165la4uu6cb"); // ED_tail_label(ep)->text);
12861289 UNSUPPORTED("2yi9az7ibt7j9bwztjilyo0v2"); // continue;
1287 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
1290 }
12881291 objp = objp.plus(1);
12891292 }
12901293 lp = ED_head_label(ep);
12911294 if (lp != null) {
1292 if (lp.getBoolean("set")) {
1295 if (lp.set!=0) {
12931296 UNSUPPORTED("7rwrlod7lkgin3rnnzy3iw2rw"); // bb = addLabelObj (lp, objp, bb);
12941297 }
12951298 else if (((et != (0 << 1)) && (ED_spl(ep) != null))) {
13221325 }
13231326 }
13241327 if (n_clbls!=0) {
1325 UNSUPPORTED("48ipxdlv7xlti99g0yhi5zuai"); // cinfo_t info;
1326 UNSUPPORTED("7c5iohb8t706p273ae1lxal8r"); // info.bb = bb;
1327 UNSUPPORTED("b1474fakrbyw7p5ja42jgv90c"); // info.objp = objp;
1328 UNSUPPORTED("6ygw8idplugc5u6w7ro3gakmb"); // info = addClusterObj (gp, info);
1329 UNSUPPORTED("1l2cwgzediv4hztjhtm052rl3"); // bb = info.bb;
1328 final ST_cinfo_t info = new ST_cinfo_t();
1329 info.setStruct("bb", bb);
1330 info.objp = objp;
1331 info.___(addClusterObj (gp, info));
1332 bb.___(info.bb);
13301333 }
13311334 force = (agattr(gp,AGRAPH,new CString("forcelabels"),null));
1332 params.setBoolean("force", late_bool(gp, force, 1));
1335 params.force = late_bool(gp, force, 1);
13331336 params.setStruct("bb", bb);
1334 placeLabels(objs, n_objs, lbls, n_lbls, params.amp());
1335 UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
1336 UNSUPPORTED("4iypau1fdov37qnq2ub6iq5ra"); // printData(objs, n_objs, lbls, n_lbls, &params);
1337 UNSUPPORTED("52mefujap7scy273ud7nyj9hn"); // xlp = lbls;
1338 UNSUPPORTED("3wtn792c3ql5yhn77alu6r5d8"); // cnt = 0;
1339 UNSUPPORTED("30yvif5t111f94y1fs2gd8crq"); // for (i = 0; i < n_lbls; i++) {
1340 UNSUPPORTED("w0kpfap6pb5scjkqkgsfira0"); // if (xlp->set) {
1341 UNSUPPORTED("7hl03wjg5yryhvbe4ar0i0b8g"); // cnt++;
1342 UNSUPPORTED("8xqwhcveb6ivragr1ebkp4pfh"); // lp = (textlabel_t *) (xlp->lbl);
1343 UNSUPPORTED("a5h8ktnl3raui7zo5kcjzd2e0"); // lp->set = 1;
1344 UNSUPPORTED("4lub8ddx8vt0gove63lajjr4s"); // lp->pos = centerPt(xlp);
1345 UNSUPPORTED("d613i6370zjpynl7n5caiorig"); // updateBB (gp, lp);
1346 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1347 UNSUPPORTED("1966qdxqc520zc0itk8al0xus"); // xlp++;
1348 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1349 UNSUPPORTED("2di5wqm6caczzl6bvqe35ry8y"); // if (Verbose)
1350 UNSUPPORTED("dy42jv2urndusl1b1jrir300t"); // fprintf (stderr, "%d out of %d labels positioned.\n", cnt, n_lbls);
1351 UNSUPPORTED("1jtgut2015ohnwt6qfisxgbs5"); // else if (cnt != n_lbls)
1337 placeLabels(objs, n_objs, lbls, n_lbls, params);
1338 // if (Verbose)
1339 // printData(objs, n_objs, lbls, n_lbls, &params);
1340 xlp = lbls;
1341 cnt = 0;
1342 for (i = 0; i < n_lbls; i++) {
1343 if (xlp.get(0).set!=0) {
1344 cnt++;
1345 lp = xlp.getStruct().lbl;
1346 lp.setInt("set", 1);
1347 lp.setStruct("pos", centerPt(xlp));
1348 updateBB (gp, lp);
1349 }
1350 xlp = xlp.plus(1);
1351 }
1352 // if (Verbose)
1353 // fprintf (stderr, "%d out of %d labels positioned.\n", cnt, n_lbls);
1354 if (cnt != n_lbls)
13521355 UNSUPPORTED("9hqu9h8q1a2xl4ty48ct0fdyp"); // agerr(AGWARN, "%d out of %d exterior labels positioned.\n", cnt, n_lbls);
1353 UNSUPPORTED("baez6nmarx9nht65vulvjojic"); // free(objs);
1354 UNSUPPORTED("ayak2o9js1lmsa5vuzul2sdxs"); // free(lbls);
1355 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1356
1357 throw new UnsupportedOperationException();
1356 Memory.free(objs);
1357 Memory.free(lbls);
13581358 } finally {
13591359 LEAVING("d4215jd9wukfn6t0iknwzjcof","addXLabels");
13601360 }
13651365
13661366 //3 8fc0zxg8y7hec3n4evx3jw6cq
13671367 // void gv_postprocess(Agraph_t * g, int allowTranslation)
1368 public static void gv_postprocess(Agraph_s g, int allowTranslation) {
1368 public static void gv_postprocess(ST_Agraph_s g, int allowTranslation) {
13691369 ENTERING("8fc0zxg8y7hec3n4evx3jw6cq","gv_postprocess");
13701370 try {
13711371 double diff;
1372 final __struct__<pointf> dimen = JUtils.from(pointf.class);
1372 final ST_pointf dimen = new ST_pointf();
13731373 Z.z().Rankdir = GD_rankdir(g);
13741374 Z.z().Flip = GD_flip(g)!=0;
13751375 /* Handle cluster labels */
13821382 */
13831383 addXLabels(g);
13841384 /* Add space for graph label if necessary */
1385 if (GD_label(g)!=null && N(GD_label(g).getPtr("set"))) {
1385 if (GD_label(g)!=null && N(GD_label(g).set)) {
13861386 UNSUPPORTED("crj0py2wme4b5l8apvbxqcmqa"); // dimen = GD_label(g)->dimen;
13871387 UNSUPPORTED("22jhn709g4c5wh0gb6v40rh19"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
13881388 UNSUPPORTED("9k69y89jybam5elefg45va3ey"); // if (Flip) {
14341434 }
14351435 translate_drawing(g);
14361436 }
1437 if (GD_label(g)!=null && N(GD_label(g).getPtr("set")))
1437 if (GD_label(g)!=null && N(GD_label(g).set))
14381438 UNSUPPORTED("6dds0zsvqw48u510zcy954fh1"); // place_root_label(g, dimen);
14391439 if (Z.z().Show_boxes!=null) {
14401440 UNSUPPORTED("8c7x8di5w36ib05qan9z4sl9"); // char buf[BUFSIZ];
14551455
14561456 //3 3qbbvlnq1b06ylgr0yj2slbhm
14571457 // void dotneato_postprocess(Agraph_t * g)
1458 public static void dotneato_postprocess(Agraph_s g) {
1458 public static void dotneato_postprocess(ST_Agraph_s g) {
14591459 ENTERING("3qbbvlnq1b06ylgr0yj2slbhm","dotneato_postprocess");
14601460 try {
14611461 gv_postprocess(g, 1);
15041504
15051505 //3 72zw1alhd5vd0g6mhum507rvx
15061506 // void place_graph_label(graph_t * g)
1507 public static void place_graph_label(Agraph_s g) {
1507 public static void place_graph_label(ST_Agraph_s g) {
15081508 ENTERING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
15091509 try {
15101510 int c;
1511 final __struct__<pointf> p = JUtils.from(pointf.class), d = JUtils.from(pointf.class);
1512 if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).getInt("set"))) {
1511 final ST_pointf p = new ST_pointf(), d = new ST_pointf();
1512 if (NEQ(g, agroot(g)) && (GD_label(g)!=null) && N(GD_label(g).set)) {
15131513 if ((GD_label_pos(g) & 1)!=0) {
1514 d.___(GD_border(g).plus(2).getStruct());
1515 p.setDouble("y", GD_bb(g).UR.y - d.getDouble("y") / 2);
1514 d.___(GD_border(g)[2].getStruct());
1515 p.setDouble("y", GD_bb(g).UR.y - d.y / 2);
15161516 } else {
15171517 UNSUPPORTED("1w38no4welthbwa0i10hei16b"); // d = GD_border(g)[0];
15181518 UNSUPPORTED("2xa4n9ca16xpf1kahaycmkl4r"); // p.y = GD_bb(g).LL.y + d.y / 2;
15251525 p.setDouble("x", (GD_bb(g).LL.x + GD_bb(g).UR.x) / 2);
15261526 }
15271527 GD_label(g).setStruct("pos", p);
1528 GD_label(g).setBoolean("set", NOT(false));
1528 GD_label(g).set= NOTI(false);
15291529 }
15301530 for (c = 1; c <= GD_n_cluster(g); c++)
1531 place_graph_label((Agraph_s) GD_clust(g).plus(c).getPtr());
1531 place_graph_label((ST_Agraph_s) GD_clust(g).get(c).getPtr());
15321532 } finally {
15331533 LEAVING("72zw1alhd5vd0g6mhum507rvx","place_graph_label");
15341534 }
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class psusershape__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4545 package gen.lib.common;
4646 import static gen.lib.cgraph.edge__c.aghead;
4747 import static gen.lib.cgraph.edge__c.agtail;
48 import static gen.lib.common.memory__c.gmalloc;
4948 import static gen.lib.pathplan.route__c.Proutespline;
5049 import static gen.lib.pathplan.shortest__c.Pshortestpath;
5150 import static gen.lib.pathplan.util__c.make_polyline;
5251 import static smetana.core.JUtils.NEQ;
5352 import static smetana.core.JUtils.cos;
5453 import static smetana.core.JUtils.sin;
55 import static smetana.core.JUtils.sizeof;
5654 import static smetana.core.JUtilsDebug.ENTERING;
5755 import static smetana.core.JUtilsDebug.LEAVING;
5856 import static smetana.core.Macro.ABS;
59 import static smetana.core.Macro.ALLOC;
60 import static smetana.core.Macro.ALLOC_allocated2;
57 import static smetana.core.Macro.ALLOC_allocated_ST_Pedge_t;
58 import static smetana.core.Macro.ALLOC_allocated_ST_pointf;
6159 import static smetana.core.Macro.ED_edge_type;
6260 import static smetana.core.Macro.ED_to_orig;
6361 import static smetana.core.Macro.INT_MAX;
6563 import static smetana.core.Macro.MIN;
6664 import static smetana.core.Macro.N;
6765 import static smetana.core.Macro.NOT;
68 import static smetana.core.Macro.RALLOC;
6966 import static smetana.core.Macro.UNSUPPORTED;
70 import h.Agedge_s;
71 import h.Pedge_t;
72 import h.Ppoly_t;
67 import h.ST_Agedge_s;
68 import h.ST_Ppoly_t;
7369 import h.ST_boxf;
74 import h.boxf;
75 import h.path;
76 import h.pointf;
77 import smetana.core.JUtils;
70 import h.ST_path;
71 import h.ST_pointf;
7872 import smetana.core.Memory;
7973 import smetana.core.Z;
80 import smetana.core.__array_of_ptr__;
81 import smetana.core.__array_of_struct__;
82 import smetana.core.__array_of_struct_impl__;
8374 import smetana.core.__ptr__;
84 import smetana.core.__struct__;
8575
8676 public class routespl__c {
8777 //1 2digov3edok6d5srhgtlmrycs
341331
342332 //3 c1s4k85p1cdfn176o3uryeros
343333 // static inline pointf pointfof(double x, double y)
344 public static __struct__<pointf> pointfof(double x, double y) {
334 public static ST_pointf pointfof(double x, double y) {
345335 // WARNING!! STRUCT
346336 return pointfof_w_(x, y).copy();
347337 }
348 private static __struct__<pointf> pointfof_w_(double x, double y) {
338 private static ST_pointf pointfof_w_(double x, double y) {
349339 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
350340 try {
351 final __struct__<pointf> r = JUtils.from(pointf.class);
341 final ST_pointf r = new ST_pointf();
352342 r.setDouble("x", x);
353343 r.setDouble("y", y);
354344 return r;
377367
378368
379369
380 //3 1vvsta5i8of59frav6uymguav
381 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
382 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
383 // WARNING!! STRUCT
384 return boxfof_w_(llx, lly, urx, ury).copy();
385 }
386 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
387 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
388 try {
389 final __struct__<boxf> b = JUtils.from(boxf.class);
390 b.getStruct("LL").setDouble("x", llx);
391 b.getStruct("LL").setDouble("y", lly);
392 b.getStruct("UR").setDouble("x", urx);
393 b.getStruct("UR").setDouble("y", ury);
394 return b;
395 } finally {
396 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
397 }
398 }
399370
400371
401372
419390
420391 //3 arrsbik9b5tnfcbzsm8gr2chx
421392 // static inline pointf add_pointf(pointf p, pointf q)
422 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
393 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
423394 // WARNING!! STRUCT
424395 return add_pointf_w_(p.copy(), q.copy()).copy();
425396 }
426 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
397 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
427398 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
428399 try {
429 final __struct__<pointf> r = JUtils.from(pointf.class);
430 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
431 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
400 final ST_pointf r = new ST_pointf();
401 r.setDouble("x", p.x + q.x);
402 r.setDouble("y", p.y + q.y);
432403 return r;
433404 } finally {
434405 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
757728
758729 //3 7ebl6qohcfpf1b9ucih5r9qgp
759730 // pointf* simpleSplineRoute (pointf tp, pointf hp, Ppoly_t poly, int* n_spl_pts, int polyline)
760 public static pointf simpleSplineRoute(final __struct__<pointf> tp, final __struct__<pointf> hp, final __struct__<Ppoly_t> poly, int[] n_spl_pts, boolean polyline) {
731 public static ST_pointf.Array simpleSplineRoute(final ST_pointf tp, final ST_pointf hp, final ST_Ppoly_t poly, int[] n_spl_pts, boolean polyline) {
761732 // WARNING!! STRUCT
762 return simpleSplineRoute_w_(tp.copy(), hp.copy(), poly.copy(), n_spl_pts, polyline);
763 }
764 private static pointf simpleSplineRoute_w_(final __struct__<pointf> tp, final __struct__<pointf> hp, final __struct__<Ppoly_t> poly, int[] n_spl_pts, boolean polyline) {
733 return simpleSplineRoute_w_(tp.copy(), hp.copy(), (ST_Ppoly_t) poly.copy(), n_spl_pts, polyline);
734 }
735 private static ST_pointf.Array simpleSplineRoute_w_(final ST_pointf tp, final ST_pointf hp, final ST_Ppoly_t poly, int[] n_spl_pts, boolean polyline) {
765736 ENTERING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
766737 try {
767 final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
768 final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
769 final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
738 final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
739 final ST_pointf.Array eps = new ST_pointf.Array( 2);
740 final ST_pointf.Array evs = new ST_pointf.Array( 2);
770741 int i;
771 eps.plus(0).setDouble("x", tp.getDouble("x"));
772 eps.plus(0).setDouble("y", tp.getDouble("y"));
773 eps.plus(1).setDouble("x", hp.getDouble("x"));
774 eps.plus(1).setDouble("y", hp.getDouble("y"));
775 if (Pshortestpath(poly.amp(), eps, pl.amp()) < 0)
742 eps.plus(0).setDouble("x", tp.x);
743 eps.plus(0).setDouble("y", tp.y);
744 eps.plus(1).setDouble("x", hp.x);
745 eps.plus(1).setDouble("y", hp.y);
746 if (Pshortestpath(poly, eps, pl) < 0)
776747 return null;
777748 if (polyline)
778 make_polyline (pl, spl.amp());
749 make_polyline (pl, spl);
779750 else {
780 if (poly.getInt("pn") > Z.z().edgen) {
781 Z.z().edges = ALLOC(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
782 Z.z().edgen = poly.getInt("pn");
783 }
784 for (i = 0; i < poly.getInt("pn"); i++) {
785 Z.z().edges.plus(i).setStruct("a", poly.getArrayOfStruct("ps").plus(i).getStruct());
786 Z.z().edges.plus(i).setStruct("b", poly.getArrayOfStruct("ps").plus((i + 1) % poly.getInt("pn")).getStruct());
751 if (poly.pn > Z.z().edgen) {
752 Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
753 Z.z().edgen = poly.pn;
754 }
755 for (i = 0; i < poly.pn; i++) {
756 Z.z().edges.plus(i).setStruct("a", poly.ps.plus(i).getStruct());
757 Z.z().edges.plus(i).setStruct("b", poly.ps.plus((i + 1) % poly.pn).getStruct());
787758 }
788759 evs.plus(0).setDouble("x", 0);
789760 evs.plus(0).setDouble("y", 0);
790761 evs.plus(1).setDouble("x", 0);
791762 evs.plus(1).setDouble("y", 0);
792 if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0)
763 if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0)
793764 return null;
794765 }
795 if (mkspacep(spl.getInt("pn")))
766 if (mkspacep(spl.pn))
796767 return null;
797 for (i = 0; i < spl.getInt("pn"); i++) {
798 Z.z().ps.plus(i).setStruct(spl.getArrayOfPtr("ps").plus(i).getStruct());
799 }
800 n_spl_pts[0] = spl.getInt("pn");
801 return (pointf) Z.z().ps;
768 for (i = 0; i < spl.pn; i++) {
769 Z.z().ps.plus(i).setStruct(spl.ps.plus(i).getStruct());
770 }
771 n_spl_pts[0] = spl.pn;
772 return Z.z().ps;
802773 } finally {
803774 LEAVING("7ebl6qohcfpf1b9ucih5r9qgp","simpleSplineRoute");
804775 }
813784 ENTERING("bfsrazjf3vkf12stnke48vc8t","routesplinesinit");
814785 try {
815786 if (++Z.z().routeinit > 1) return 0;
816 if (N(Z.z().ps = gmalloc(sizeof(pointf.class, 300)))) {
787 if (N(Z.z().ps = new ST_pointf.Array(300))) {
817788 UNSUPPORTED("2qoo3na2ur9oh7hmvt6xv1txd"); // agerr(AGERR, "routesplinesinit: cannot allocate ps\n");
818789 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
819790 }
852823
853824 //3 cu8ssjizw7ileqe9u7tcclq7k
854825 // static void limitBoxes (boxf* boxes, int boxn, pointf *pps, int pn, int delta)
855 public static void limitBoxes(__array_of_ptr__ boxes, int boxn, __ptr__ pps, int pn, int delta) {
826 public static void limitBoxes(ST_boxf boxes[], int boxn, __ptr__ pps, int pn, int delta) {
856827 ENTERING("cu8ssjizw7ileqe9u7tcclq7k","limitBoxes");
857828 try {
858829 int bi, si, splinepi;
859830 double t;
860 final __array_of_struct__ sp = __array_of_struct_impl__.malloc(pointf.class, 4);
831 final ST_pointf.Array sp = new ST_pointf.Array( 4);
861832 int num_div = delta * boxn;
862833 for (splinepi = 0; splinepi + 3 < pn; splinepi += 3) {
863834 for (si = 0; si <= num_div; si++) {
866837 sp.plus(1).getStruct().___(pps.plus(splinepi+1).getStruct());
867838 sp.plus(2).getStruct().___(pps.plus(splinepi+2).getStruct());
868839 sp.plus(3).getStruct().___(pps.plus(splinepi+3).getStruct());
869 sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
870 sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
871 sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x")));
872 sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y")));
873 sp.plus(2).setDouble("x", sp.plus(2).getDouble("x") + t * (sp.plus(3).getDouble("x") - sp.plus(2).getDouble("x")));
874 sp.plus(2).setDouble("y", sp.plus(2).getDouble("y") + t * (sp.plus(3).getDouble("y") - sp.plus(2).getDouble("y")));
875 sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
876 sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
877 sp.plus(1).setDouble("x", sp.plus(1).getDouble("x") + t * (sp.plus(2).getDouble("x") - sp.plus(1).getDouble("x")));
878 sp.plus(1).setDouble("y", sp.plus(1).getDouble("y") + t * (sp.plus(2).getDouble("y") - sp.plus(1).getDouble("y")));
879 sp.plus(0).setDouble("x", sp.plus(0).getDouble("x") + t * (sp.plus(1).getDouble("x") - sp.plus(0).getDouble("x")));
880 sp.plus(0).setDouble("y", sp.plus(0).getDouble("y") + t * (sp.plus(1).getDouble("y") - sp.plus(0).getDouble("y")));
840 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
841 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
842 sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
843 sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
844 sp.plus(2).setDouble("x", sp.get(2).x + t * (sp.get(3).x - sp.get(2).x));
845 sp.plus(2).setDouble("y", sp.get(2).y + t * (sp.get(3).y - sp.get(2).y));
846 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
847 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
848 sp.plus(1).setDouble("x", sp.get(1).x + t * (sp.get(2).x - sp.get(1).x));
849 sp.plus(1).setDouble("y", sp.get(1).y + t * (sp.get(2).y - sp.get(1).y));
850 sp.plus(0).setDouble("x", sp.get(0).x + t * (sp.get(1).x - sp.get(0).x));
851 sp.plus(0).setDouble("y", sp.get(0).y + t * (sp.get(1).y - sp.get(0).y));
881852 for (bi = 0; bi < boxn; bi++) {
882853 /* this tested ok on 64bit machines, but on 32bit we need this FUDGE
883854 * or graphs/directed/records.gv fails */
884 if (sp.plus(0).getDouble("y") <= boxes.plus(bi).getStruct("UR").getDouble("y")+.0001 && sp.plus(0).getDouble("y") >= boxes.plus(bi).getStruct("LL").getDouble("y")-.0001) {
885 if (boxes.plus(bi).getStruct("LL").getDouble("x") > sp.plus(0).getDouble("x"))
886 boxes.plus(bi).getStruct("LL").setDouble("x", sp.plus(0).getDouble("x"));
887 if (boxes.plus(bi).getStruct("UR").getDouble("x") < sp.plus(0).getDouble("x"))
888 boxes.plus(bi).getStruct("UR").setDouble("x", sp.plus(0).getDouble("x"));
855 if (sp.get(0).y <= boxes[bi].UR.y+.0001 && sp.get(0).y >= boxes[bi].LL.y-.0001) {
856 if (boxes[bi].LL.x > sp.get(0).x)
857 boxes[bi].LL.setDouble("x", sp.get(0).x);
858 if (boxes[bi].UR.x < sp.get(0).x)
859 boxes[bi].UR.setDouble("x", sp.get(0).x);
889860 }
890861 }
891862 }
900871
901872 //3 3mcnemqisisnqtd4mr72ej76y
902873 // static pointf *_routesplines(path * pp, int *npoints, int polyline)
903 public static __ptr__ _routesplines(path pp, int npoints[], int polyline) {
874 public static __ptr__ _routesplines(ST_path pp, int npoints[], int polyline) {
904875 ENTERING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
905876 try {
906 final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
907 final __struct__<Ppoly_t> pl = JUtils.from(Ppoly_t.class), spl = JUtils.from(Ppoly_t.class);
877 final ST_Ppoly_t poly = new ST_Ppoly_t();
878 final ST_Ppoly_t pl = new ST_Ppoly_t(), spl = new ST_Ppoly_t();
908879 int splinepi;
909 final __array_of_struct__ eps = __array_of_struct_impl__.malloc(pointf.class, 2);
910 final __array_of_struct__ evs = __array_of_struct_impl__.malloc(pointf.class, 2);
880 final ST_pointf.Array eps = new ST_pointf.Array( 2);
881 final ST_pointf.Array evs = new ST_pointf.Array( 2);
911882 int edgei, prev, next;
912883 int pi=0, bi;
913 __array_of_ptr__ boxes;
884 ST_boxf[] boxes;
914885 int boxn;
915 Agedge_s realedge;
886 ST_Agedge_s realedge;
916887 int flip;
917888 int loopcnt, delta = 10;
918889 boolean unbounded;
919890 Z.z().nedges++;
920 Z.z().nboxes += pp.getInt("nbox");
921 for (realedge = (Agedge_s) pp.getPtr("data").castTo(Agedge_s.class);
891 Z.z().nboxes += pp.nbox;
892 for (realedge = (ST_Agedge_s) pp.data.castTo(ST_Agedge_s.class);
922893 realedge!=null && ED_edge_type(realedge) != 0;
923894 realedge = ED_to_orig(realedge));
924895 if (N(realedge)) {
925896 UNSUPPORTED("agerr(AGERR, _in routesplines, cannot find NORMAL edge");
926897 return null;
927898 }
928 boxes = pp.getArrayOfPtr("boxes");
929 boxn = pp.getInt("nbox");
899 boxes = pp.boxes;
900 boxn = pp.nbox;
930901 if (checkpath(boxn, boxes, pp)!=0)
931902 return null;
932903 if (boxn * 8 > Z.z().polypointn) {
933 Z.z().polypoints = ALLOC_allocated2(boxn * 8, Z.z().polypoints, pointf.class);
904 Z.z().polypoints = ALLOC_allocated_ST_pointf(Z.z().polypoints, boxn * 8);
934905 Z.z().polypointn = boxn * 8;
935906 }
936 if ((boxn > 1) && (((ST_boxf)boxes.plus(0).getStruct()).LL.y > ((ST_boxf)boxes.plus(1).getStruct()).LL.y)) {
907 if ((boxn > 1) && (((ST_boxf)boxes[0]).LL.y > ((ST_boxf)boxes[1]).LL.y)) {
937908 flip = 1;
938909 for (bi = 0; bi < boxn; bi++) {
939 double v = ((ST_boxf)boxes.plus(bi).getStruct()).UR.y;
940 ((ST_boxf)boxes.plus(bi).getStruct()).UR.y= -1*((ST_boxf)boxes.plus(bi).getStruct()).LL.y;
941 ((ST_boxf)boxes.plus(bi).getStruct()).LL.y = -v;
910 double v = ((ST_boxf)boxes[bi]).UR.y;
911 ((ST_boxf)boxes[bi]).UR.y= -1*((ST_boxf)boxes[bi]).LL.y;
912 ((ST_boxf)boxes[bi]).LL.y = -v;
942913 }
943914 }
944915 else flip = 0;
948919 for (bi = 0, pi = 0; bi < boxn; bi++) {
949920 next = prev = 0;
950921 if (bi > 0)
951 prev = (((ST_boxf)boxes.plus(bi).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi-1).getStruct()).LL.y) ? -1 : 1;
922 prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi-1]).LL.y) ? -1 : 1;
952923 if (bi < boxn - 1)
953 next = (((ST_boxf)boxes.plus(bi+1).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi).getStruct()).LL.y) ? 1 : -1;
924 next = (((ST_boxf)boxes[bi+1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
954925 if (prev != next) {
955926 if (next == -1 || prev == 1) {
956 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
957 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
958 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
959 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
927 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
928 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
929 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
930 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
960931 } else {
961 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
962 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
963 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
964 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
932 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
933 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
934 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
935 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
965936 }
966937 }
967938 else if (prev == 0) { /* single box */
980951 for (bi = boxn - 1; bi >= 0; bi--) {
981952 next = prev = 0;
982953 if (bi < boxn - 1)
983 prev = (((ST_boxf)boxes.plus(bi).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi+1).getStruct()).LL.y) ? -1 : 1;
954 prev = (((ST_boxf)boxes[bi]).LL.y > ((ST_boxf)boxes[bi+1]).LL.y) ? -1 : 1;
984955 if (bi > 0)
985 next = (((ST_boxf)boxes.plus(bi-1).getStruct()).LL.y > ((ST_boxf)boxes.plus(bi).getStruct()).LL.y) ? 1 : -1;
956 next = (((ST_boxf)boxes[bi-1]).LL.y > ((ST_boxf)boxes[bi]).LL.y) ? 1 : -1;
986957 if (prev != next) {
987958 if (next == -1 || prev == 1 ) {
988 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
989 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
990 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
991 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
959 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
960 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
961 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
962 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
992963 } else {
993 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
994 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
995 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
996 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
964 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
965 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
966 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
967 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
997968 }
998969 }
999970 else if (prev == 0) { /* single box */
1008979 UNSUPPORTED("1qt7hixteu3pt64wk1sqw352a"); // agerr(AGERR, "in routesplines, illegal values of prev %d and next %d, line %d\n", prev, next, 476);
1009980 UNSUPPORTED("35untdbpd42pt4c74gjbxqx7q"); // return NULL; /* for correctness sake, it's best to just stop */
1010981 }
1011 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
1012 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
1013 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).UR.x);
1014 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
1015 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
1016 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).UR.y);
1017 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes.plus(bi).getStruct()).LL.x);
1018 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes.plus(bi).getStruct()).LL.y);
982 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
983 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
984 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).UR.x);
985 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
986 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
987 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).UR.y);
988 Z.z().polypoints.plus(pi).setDouble("x", ((ST_boxf)boxes[bi]).LL.x);
989 Z.z().polypoints.plus(pi++).setDouble("y", ((ST_boxf)boxes[bi]).LL.y);
1019990 }
1020991 }
1021992 }
1026997 if (flip!=0) {
1027998 int i;
1028999 for (bi = 0; bi < boxn; bi++) {
1029 int v = (int) ((ST_boxf)boxes.plus(bi).getStruct()).UR.y;
1030 ((ST_boxf)boxes.plus(bi).getStruct()).UR.y = -1*((ST_boxf)boxes.plus(bi).getStruct()).LL.y;
1031 ((ST_boxf)boxes.plus(bi).getStruct()).LL.y = -v;
1000 int v = (int) ((ST_boxf)boxes[bi]).UR.y;
1001 ((ST_boxf)boxes[bi]).UR.y = -1*((ST_boxf)boxes[bi]).LL.y;
1002 ((ST_boxf)boxes[bi]).LL.y = -v;
10321003 }
10331004 for (i = 0; i < pi; i++)
1034 Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.plus(i).getDouble("y"));
1005 Z.z().polypoints.plus(i).setDouble("y", -1 * Z.z().polypoints.get(i).y);
10351006 }
10361007 for (bi = 0; bi < boxn; bi++) {
1037 ((ST_boxf)boxes.plus(bi).getStruct()).LL.x = INT_MAX;
1038 ((ST_boxf)boxes.plus(bi).getStruct()).UR.x = INT_MIN;
1039 }
1040 poly.setPtr("ps", Z.z().polypoints);
1041 poly.setInt("pn", pi);
1042 eps.plus(0).getStruct().setDouble("x", pp.getStruct("start").getStruct("p").getDouble("x"));
1043 eps.plus(0).getStruct().setDouble("y", pp.getStruct("start").getStruct("p").getDouble("y"));
1044 eps.plus(1).getStruct().setDouble("x", pp.getStruct("end").getStruct("p").getDouble("x"));
1045 eps.plus(1).getStruct().setDouble("y", pp.getStruct("end").getStruct("p").getDouble("y"));
1046 if (Pshortestpath((Ppoly_t) poly.amp(), eps, (Ppoly_t) pl.amp()) < 0) {
1008 ((ST_boxf)boxes[bi]).LL.x = INT_MAX;
1009 ((ST_boxf)boxes[bi]).UR.x = INT_MIN;
1010 }
1011 poly.ps = Z.z().polypoints;
1012 poly.pn = pi;
1013 eps.plus(0).getStruct().setDouble("x", pp.start.p.x);
1014 eps.plus(0).getStruct().setDouble("y", pp.start.p.y);
1015 eps.plus(1).getStruct().setDouble("x", pp.end.p.x);
1016 eps.plus(1).getStruct().setDouble("y", pp.end.p.y);
1017 if (Pshortestpath(poly, eps, pl) < 0) {
10471018 System.err.println("in routesplines, Pshortestpath failed\n");
10481019 return null;
10491020 }
10511022 UNSUPPORTED("48veztc3k9dfw8tqolu7jsktk"); // make_polyline (pl, &spl);
10521023 }
10531024 else {
1054 if (poly.getInt("pn") > Z.z().edgen) {
1055 Z.z().edges = ALLOC_allocated2(poly.getInt("pn"), Z.z().edges, Pedge_t.class);
1056 Z.z().edgen = poly.getInt("pn");
1057 }
1058 for (edgei = 0; edgei < poly.getInt("pn"); edgei++) {
1025 if (poly.pn > Z.z().edgen) {
1026 Z.z().edges = ALLOC_allocated_ST_Pedge_t(Z.z().edges, poly.pn);
1027 Z.z().edgen = poly.pn;
1028 }
1029 for (edgei = 0; edgei < poly.pn; edgei++) {
10591030 Z.z().edges.plus(edgei).setStruct("a", Z.z().polypoints.plus(edgei).getStruct());
1060 Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.getInt("pn")).getStruct());
1061 }
1062 if (pp.getStruct("start").getBoolean("constrained")) {
1063 evs.plus(0).getStruct().setDouble("x", cos(pp.getStruct("start").getDouble("theta")));
1064 evs.plus(0).getStruct().setDouble("y", sin(pp.getStruct("start").getDouble("theta")));
1031 Z.z().edges.plus(edgei).setStruct("b", Z.z().polypoints.plus((edgei + 1) % poly.pn).getStruct());
1032 }
1033 if (pp.start.constrained!=0) {
1034 evs.plus(0).getStruct().setDouble("x", cos(pp.start.theta));
1035 evs.plus(0).getStruct().setDouble("y", sin(pp.start.theta));
10651036 } else
10661037 {
10671038 evs.plus(0).getStruct().setDouble("x", 0);
10681039 evs.plus(0).getStruct().setDouble("y", 0);
10691040 }
1070 if (pp.getStruct("end").getBoolean("constrained")) {
1071 evs.plus(1).getStruct().setDouble("x", -cos(pp.getStruct("end").getDouble("theta")));
1072 evs.plus(1).getStruct().setDouble("y", -sin(pp.getStruct("end").getDouble("theta")));
1041 if (pp.end.constrained!=0) {
1042 evs.plus(1).getStruct().setDouble("x", -cos(pp.end.theta));
1043 evs.plus(1).getStruct().setDouble("y", -sin(pp.end.theta));
10731044 } else
10741045 {
10751046 evs.plus(1).getStruct().setDouble("x", 0);
10761047 evs.plus(1).getStruct().setDouble("y", 0);
10771048 }
1078 if (Proutespline(Z.z().edges, poly.getInt("pn"), pl, evs.asPtr(), spl.amp()) < 0) {
1049 if (Proutespline(Z.z().edges, poly.pn, pl, evs.asPtr(), spl) < 0) {
10791050 UNSUPPORTED("elkeyywrfd4hq75w7toc94rzs"); // agerr(AGERR, "in routesplines, Proutespline failed\n");
10801051 UNSUPPORTED("7t3fvwp9cv90qu5bdjdglcgtk"); // return NULL;
10811052 }
10821053 }
1083 if (mkspacep(spl.getInt("pn")))
1054 if (mkspacep(spl.pn))
10841055 UNSUPPORTED("7x5kpcbvg4va887hky7ufm45y"); // return NULL; /* Bailout if no memory left */
10851056 for (bi = 0; bi < boxn; bi++) {
1086 boxes.plus(bi).getStruct("LL").setDouble("x", INT_MAX);
1087 boxes.plus(bi).getStruct("UR").setDouble("x", INT_MIN);
1057 boxes[bi].LL.setDouble("x", INT_MAX);
1058 boxes[bi].UR.setDouble("x", INT_MIN);
10881059 }
10891060 unbounded = NOT(false);
1090 for (splinepi = 0; splinepi < spl.getInt("pn"); splinepi++) {
1091 Z.z().ps.plus(splinepi).setStruct(spl.getArrayOfPtr("ps").plus(splinepi).getStruct());
1061 for (splinepi = 0; splinepi < spl.pn; splinepi++) {
1062 Z.z().ps.plus(splinepi).setStruct(spl.ps.plus(splinepi).getStruct());
10921063 }
10931064 for (loopcnt = 0; unbounded && (loopcnt < 15); loopcnt++) {
1094 limitBoxes (boxes, boxn, Z.z().ps, spl.getInt("pn"), delta);
1065 limitBoxes (boxes, boxn, Z.z().ps, spl.pn, delta);
10951066 /* The following check is necessary because if a box is not very
10961067 * high, it is possible that the sampling above might miss it.
10971068 * Therefore, we make the sample finer until all boxes have
11001071 for (bi = 0; bi < boxn; bi++) {
11011072 /* these fp equality tests are used only to detect if the
11021073 * values have been changed since initialization - ok */
1103 if ((boxes.plus(bi).getStruct("LL").getDouble("x") == INT_MAX) || (boxes.plus(bi).getStruct("UR").getDouble("x") == INT_MIN)) {
1074 if ((boxes[bi].LL.x == INT_MAX) || (boxes[bi].UR.x == INT_MIN)) {
11041075 delta *= 2; /* try again with a finer interval */
11051076 if (delta > INT_MAX/boxn) /* in limitBoxes, boxn*delta must fit in an int, so give up */
11061077 loopcnt = 15;
11161087 * to bound the boxes. This will probably mean a bad edge, but we avoid an infinite
11171088 * loop and we can see the bad edge, and even use the showboxes scaffolding.
11181089 */
1119 final __struct__<Ppoly_t> polyspl = JUtils.from(Ppoly_t.class);
1090 final ST_Ppoly_t polyspl = new ST_Ppoly_t();
11201091 System.err.println("Unable to reclaim box space in spline routing for edge \"%s\" -> \"%s\". Something is probably seriously wrong.\n");
1121 make_polyline (pl, polyspl.amp());
1122 limitBoxes (boxes, boxn, polyspl.getPtr("ps"), polyspl.getInt("pn"), 10);
1123 Memory.free (polyspl.getPtr("ps"));
1124 }
1125 npoints[0] = spl.getInt("pn");
1092 make_polyline (pl, polyspl);
1093 limitBoxes (boxes, boxn, polyspl.ps, polyspl.pn, 10);
1094 Memory.free (polyspl.ps);
1095 }
1096 npoints[0] = spl.pn;
11261097 return Z.z().ps;
11271098 } finally {
11281099 LEAVING("3mcnemqisisnqtd4mr72ej76y","_routesplines");
11341105
11351106 //3 axqoytp2rpr8crajhkuvns6q9
11361107 // pointf *routesplines(path * pp, int *npoints)
1137 public static pointf routesplines(path pp, int npoints[]) {
1108 public static ST_pointf.Array routesplines(ST_path pp, int npoints[]) {
11381109 ENTERING("axqoytp2rpr8crajhkuvns6q9","routesplines");
11391110 try {
1140 return (pointf) _routesplines (pp, npoints, 0);
1111 return (ST_pointf.Array) _routesplines (pp, npoints, 0);
11411112 } finally {
11421113 LEAVING("axqoytp2rpr8crajhkuvns6q9","routesplines");
11431114 }
11481119
11491120 //3 2v22s41xitwnnsljk9n01nrcy
11501121 // pointf *routepolylines(path * pp, int *npoints)
1151 public static pointf routepolylines(path pp, int npoints[]) {
1122 public static ST_pointf.Array routepolylines(ST_path pp, int npoints[]) {
11521123 ENTERING("2v22s41xitwnnsljk9n01nrcy","routepolylines");
11531124 try {
11541125 UNSUPPORTED("1kjkc6bl8zpf8zjcwgbyni9p3"); // pointf *routepolylines(path * pp, int *npoints)
11911162
11921163 //3 dxqjhiid5f58b9gjxp0v3j97b
11931164 // static int checkpath(int boxn, boxf* boxes, path* thepath)
1194 public static int checkpath(int boxn, __array_of_ptr__ boxes, path thepath) {
1165 public static int checkpath(int boxn, ST_boxf[] boxes, ST_path thepath) {
11951166 ENTERING("dxqjhiid5f58b9gjxp0v3j97b","checkpath");
11961167 try {
1197 boxf ba, bb;
1168 ST_boxf ba, bb;
11981169 int bi, i, errs, l, r, d, u;
11991170 int xoverlap, yoverlap;
12001171 /* remove degenerate boxes. */
12011172 i = 0;
12021173 for (bi = 0; bi < boxn; bi++) {
1203 if (ABS(((ST_boxf)boxes.plus(bi).getStruct()).LL.y - ((ST_boxf)boxes.plus(bi).getStruct()).UR.y) < .01)
1174 if (ABS(((ST_boxf)boxes[bi]).LL.y - ((ST_boxf)boxes[bi]).UR.y) < .01)
12041175 continue;
1205 if (ABS(((ST_boxf)boxes.plus(bi).getStruct()).LL.x - ((ST_boxf)boxes.plus(bi).getStruct()).UR.x) < .01)
1176 if (ABS(((ST_boxf)boxes[bi]).LL.x - ((ST_boxf)boxes[bi]).UR.x) < .01)
12061177 continue;
12071178 if (i != bi)
1208 boxes.plus(i).setStruct(boxes.plus(bi).getStruct());
1179 boxes[i].setStruct(boxes[bi]);
12091180 i++;
12101181 }
12111182 boxn = i;
1212 ba = boxes.plus(0).getStruct().amp();
1213 if (ba.getStruct("LL").getDouble("x") > ba.getStruct("UR").getDouble("x") || ba.getStruct("LL").getDouble("y") > ba.getStruct("UR").getDouble("y")) {
1183 ba = (ST_boxf) boxes[0];
1184 if (ba.LL.x > ba.UR.x || ba.LL.y > ba.UR.y) {
12141185 UNSUPPORTED("39tznwvf6k5lgj78jp32p0kfl"); // agerr(AGERR, "in checkpath, box 0 has LL coord > UR coord\n");
12151186 UNSUPPORTED("evdvb9esh16y8zeoczxhcz7xm"); // printpath(thepath);
12161187 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
12171188 }
12181189 for (bi = 0; bi < boxn - 1; bi++) {
1219 ba = boxes.plus(bi).getStruct().amp();
1220 bb = boxes.plus(bi + 1).getStruct().amp();
1221 if (bb.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x") || bb.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y")) {
1190 ba = (ST_boxf) boxes[bi];
1191 bb = (ST_boxf) boxes[bi + 1];
1192 if (bb.LL.x > bb.UR.x || bb.LL.y > bb.UR.y) {
12221193 UNSUPPORTED("c8oodo0ge4n4dglb28fvf610v"); // agerr(AGERR, "in checkpath, box %d has LL coord > UR coord\n",
12231194 UNSUPPORTED("929pkk2ob1lh7hfe4scuoo5pn"); // bi + 1);
12241195 UNSUPPORTED("2m9o6g4nneiul4gt8xb9yb9zi"); // printpath(thepath);
12251196 UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
12261197 }
1227 l = (ba.getStruct("UR").getDouble("x") < bb.getStruct("LL").getDouble("x")) ? 1 : 0;
1228 r = (ba.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x")) ? 1 : 0;
1229 d = (ba.getStruct("UR").getDouble("y") < bb.getStruct("LL").getDouble("y")) ? 1 : 0;
1230 u = (ba.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y")) ? 1 : 0;
1198 l = (ba.UR.x < bb.LL.x) ? 1 : 0;
1199 r = (ba.LL.x > bb.UR.x) ? 1 : 0;
1200 d = (ba.UR.y < bb.LL.y) ? 1 : 0;
1201 u = (ba.LL.y > bb.UR.y) ? 1 : 0;
12311202 errs = l + r + d + u;
12321203 /*if (errs > 0 && Verbose) {
12331204 fprintf(stderr, "in checkpath, boxes %d and %d don't touch\n",
12381209 int xy;
12391210 if (l == 1)
12401211 {
1241 xy = (int) ba.getStruct("UR").getDouble("x");
1242 ba.getStruct("UR").setDouble("x", bb.getStruct("LL").getDouble("x"));
1243 bb.getStruct("LL").setDouble("x", xy);
1212 xy = (int) ba.UR.x;
1213 ba.UR.setDouble("x", bb.LL.x);
1214 bb.LL.setDouble("x", xy);
12441215 l = 0;
12451216 }
12461217 else if (r == 1) {
1247 xy = (int)(ba.getStruct("LL").getDouble("x"));
1248 ba.getStruct("LL").setDouble("x", bb.getStruct("UR").getDouble("x"));
1249 bb.getStruct("UR").setDouble("x", xy);
1218 xy = (int)(ba.LL.x);
1219 ba.LL.setDouble("x", bb.UR.x);
1220 bb.UR.setDouble("x", xy);
12501221 r = 0;
12511222 }
12521223 else if (d == 1) {
1253 xy = (int)(ba.getStruct("UR").getDouble("y"));
1254 ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
1255 bb.getStruct("LL").setDouble("y", xy);
1224 xy = (int)(ba.UR.y);
1225 ba.UR.setDouble("y", bb.LL.y);
1226 bb.LL.setDouble("y", xy);
12561227 d = 0;
12571228 }
12581229 else if (u == 1)
1259 UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.getStruct("LL").getDouble("y"), ba.getStruct("LL").getDouble("y") = bb.getStruct("UR").getDouble("y"), bb.getStruct("UR").getDouble("y") = xy, u = 0;
1230 UNSUPPORTED("5kcd52bwvbxxs0md0enfs100u"); // xy = ba.LL.y, ba.LL.y = bb.UR.y, bb.UR.y = xy, u = 0;
12601231 for (i = 0; i < errs - 1; i++) {
12611232 UNSUPPORTED("as3p2ldwbg3rbgy64oxx5phar"); // if (l == 1)
1262 UNSUPPORTED("efz1z5cfywki1k6q6avldku9z"); // xy = (ba.getStruct("UR").getDouble("x") + bb.getStruct("LL").getDouble("x")) / 2.0 + 0.5, ba.getStruct("UR").getDouble("x") =
1263 UNSUPPORTED("6dfh7cf1xptapqd1mcqtxjrxa"); // bb.getStruct("LL").getDouble("x") = xy, l = 0;
1233 UNSUPPORTED("efz1z5cfywki1k6q6avldku9z"); // xy = (ba.UR.x + bb.LL.x) / 2.0 + 0.5, ba.UR.x =
1234 UNSUPPORTED("6dfh7cf1xptapqd1mcqtxjrxa"); // bb.LL.x = xy, l = 0;
12641235 UNSUPPORTED("ang3qytu77fd5owijwbnmkdav"); // else if (r == 1)
1265 UNSUPPORTED("67ehof0qqlk339zgl0sqwfu5r"); // xy = (ba.getStruct("LL").getDouble("x") + bb.getStruct("UR").getDouble("x")) / 2.0 + 0.5, ba.getStruct("LL").getDouble("x") =
1266 UNSUPPORTED("llmwvndoq1ne9c62ohtstkwa"); // bb.getStruct("UR").getDouble("x") = xy, r = 0;
1236 UNSUPPORTED("67ehof0qqlk339zgl0sqwfu5r"); // xy = (ba.LL.x + bb.UR.x) / 2.0 + 0.5, ba.LL.x =
1237 UNSUPPORTED("llmwvndoq1ne9c62ohtstkwa"); // bb.UR.x = xy, r = 0;
12671238 UNSUPPORTED("3ce9i9asrqbuog7v1tdurqo6e"); // else if (d == 1)
1268 UNSUPPORTED("3mibjrb2jtfextkg9ac5k9spl"); // xy = (ba.getStruct("UR").getDouble("y") + bb.getStruct("LL").getDouble("y")) / 2.0 + 0.5, ba.getStruct("UR").getDouble("y") =
1269 UNSUPPORTED("bccpbv2n38c5utkfh7msoc2y"); // bb.getStruct("LL").getDouble("y") = xy, d = 0;
1239 UNSUPPORTED("3mibjrb2jtfextkg9ac5k9spl"); // xy = (ba.UR.y + bb.LL.y) / 2.0 + 0.5, ba.UR.y =
1240 UNSUPPORTED("bccpbv2n38c5utkfh7msoc2y"); // bb.LL.y = xy, d = 0;
12701241 UNSUPPORTED("7302rnmwdji9n7txquk8k36to"); // else if (u == 1)
1271 UNSUPPORTED("9oqpoodvpheztihe63p40guof"); // xy = (ba.getStruct("LL").getDouble("y") + bb.getStruct("UR").getDouble("y")) / 2.0 + 0.5, ba.getStruct("LL").getDouble("y") =
1272 UNSUPPORTED("2cnb1bdjh6y26f98vonla73qa"); // bb.getStruct("UR").getDouble("y") = xy, u = 0;
1242 UNSUPPORTED("9oqpoodvpheztihe63p40guof"); // xy = (ba.LL.y + bb.UR.y) / 2.0 + 0.5, ba.LL.y =
1243 UNSUPPORTED("2cnb1bdjh6y26f98vonla73qa"); // bb.UR.y = xy, u = 0;
12731244 }
12741245 }
12751246 /* check for overlapping boxes */
1276 xoverlap = overlap(ba.getStruct("LL").getDouble("x"), ba.getStruct("UR").getDouble("x"), bb.getStruct("LL").getDouble("x"), bb.getStruct("UR").getDouble("x"));
1277 yoverlap = overlap(ba.getStruct("LL").getDouble("y"), ba.getStruct("UR").getDouble("y"), bb.getStruct("LL").getDouble("y"), bb.getStruct("UR").getDouble("y"));
1247 xoverlap = overlap(ba.LL.x, ba.UR.x, bb.LL.x, bb.UR.x);
1248 yoverlap = overlap(ba.LL.y, ba.UR.y, bb.LL.y, bb.UR.y);
12781249 if (xoverlap!=0 && yoverlap!=0) {
12791250 if (xoverlap < yoverlap) {
1280 if (ba.getStruct("UR").getDouble("x") - ba.getStruct("LL").getDouble("x") > bb.getStruct("UR").getDouble("x") - bb.getStruct("LL").getDouble("x")) {
1251 if (ba.UR.x - ba.LL.x > bb.UR.x - bb.LL.x) {
12811252 /* take space from ba */
1282 UNSUPPORTED("5dqxf3gq05pjtobtnru1g2tuj"); // if (ba.getStruct("UR").getDouble("x") < bb.getStruct("UR").getDouble("x"))
1283 UNSUPPORTED("8gz6k803qp9zyw9s459cpp039"); // ba.getStruct("UR").getDouble("x") = bb.getStruct("LL").getDouble("x");
1253 UNSUPPORTED("5dqxf3gq05pjtobtnru1g2tuj"); // if (ba.UR.x < bb.UR.x)
1254 UNSUPPORTED("8gz6k803qp9zyw9s459cpp039"); // ba.UR.x = bb.LL.x;
12841255 UNSUPPORTED("9acag2yacl63g8rg6r1alu62x"); // else
1285 UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.getStruct("LL").getDouble("x") = bb.getStruct("UR").getDouble("x");
1256 UNSUPPORTED("5r6ck8hfb1cxywn9go61se9kx"); // ba.LL.x = bb.UR.x;
12861257 } else {
12871258 /* take space from bb */
1288 if (ba.getStruct("UR").getDouble("x") < bb.getStruct("UR").getDouble("x"))
1289 bb.getStruct("LL").setDouble("x", ba.getStruct("UR").getDouble("x"));
1259 if (ba.UR.x < bb.UR.x)
1260 bb.LL.setDouble("x", ba.UR.x);
12901261 else
1291 bb.getStruct("UR").setDouble("x", ba.getStruct("LL").getDouble("x"));
1262 bb.UR.setDouble("x", ba.LL.x);
12921263 }
12931264 } else { /* symmetric for y coords */
1294 if (ba.getStruct("UR").getDouble("y") - ba.getStruct("LL").getDouble("y") > bb.getStruct("UR").getDouble("y") - bb.getStruct("LL").getDouble("y")) {
1265 if (ba.UR.y - ba.LL.y > bb.UR.y - bb.LL.y) {
12951266 /* take space from ba */
1296 if (ba.getStruct("UR").getDouble("y") < bb.getStruct("UR").getDouble("y"))
1297 ba.getStruct("UR").setDouble("y", bb.getStruct("LL").getDouble("y"));
1267 if (ba.UR.y < bb.UR.y)
1268 ba.UR.setDouble("y", bb.LL.y);
12981269 else
1299 ba.getStruct("LL").setDouble("y", bb.getStruct("UR").getDouble("y"));
1270 ba.LL.setDouble("y", bb.UR.y);
13001271 } else {
13011272 /* take space from bb */
1302 if (ba.getStruct("UR").getDouble("y") < bb.getStruct("UR").getDouble("y"))
1303 bb.getStruct("LL").setDouble("y", ba.getStruct("UR").getDouble("y"));
1273 if (ba.UR.y < bb.UR.y)
1274 bb.LL.setDouble("y", ba.UR.y);
13041275 else
1305 bb.getStruct("UR").setDouble("y", ba.getStruct("LL").getDouble("y"));
1276 bb.UR.setDouble("y", ba.LL.y);
13061277 }
13071278 }
13081279 }
13091280 }
1310 if (thepath.getStruct("start").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(0).getStruct()).LL.x
1311 || thepath.getStruct("start").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(0).getStruct()).UR.x
1312 || thepath.getStruct("start").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(0).getStruct()).LL.y
1313 || thepath.getStruct("start").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(0).getStruct()).UR.y) {
1281 if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x
1282 || thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x
1283 || thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y
1284 || thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y) {
13141285 /*if (Verbose) {
13151286 fprintf(stderr, "in checkpath, start port not in first box\n");
13161287 printpath(thepath);
13171288 }*/
1318 if (thepath.getStruct("start").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(0).getStruct()).LL.x)
1319 thepath.getStruct("start").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(0).getStruct()).LL.x);
1320 if (thepath.getStruct("start").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(0).getStruct()).UR.x)
1321 thepath.getStruct("start").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(0).getStruct()).UR.x);
1322 if (thepath.getStruct("start").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(0).getStruct()).LL.y)
1323 thepath.getStruct("start").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(0).getStruct()).LL.y);
1324 if (thepath.getStruct("start").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(0).getStruct()).UR.y)
1325 thepath.getStruct("start").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(0).getStruct()).UR.y);
1326 }
1327 if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x
1328 || thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x
1329 || thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y
1330 || thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y) {
1289 if (thepath.start.p.x < ((ST_boxf)boxes[0]).LL.x)
1290 thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).LL.x);
1291 if (thepath.start.p.x > ((ST_boxf)boxes[0]).UR.x)
1292 thepath.start.p.setDouble("x", ((ST_boxf)boxes[0]).UR.x);
1293 if (thepath.start.p.y < ((ST_boxf)boxes[0]).LL.y)
1294 thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).LL.y);
1295 if (thepath.start.p.y > ((ST_boxf)boxes[0]).UR.y)
1296 thepath.start.p.setDouble("y", ((ST_boxf)boxes[0]).UR.y);
1297 }
1298 if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x
1299 || thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x
1300 || thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y
1301 || thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y) {
13311302 /*if (Verbose) {
13321303 fprintf(stderr, "in checkpath, end port not in last box\n");
13331304 printpath(thepath);
13341305 }*/
1335 if (thepath.getStruct("end").getStruct("p").getDouble("x") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x)
1336 thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.x);
1337 if (thepath.getStruct("end").getStruct("p").getDouble("x") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x)
1338 thepath.getStruct("end").getStruct("p").setDouble("x", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.x);
1339 if (thepath.getStruct("end").getStruct("p").getDouble("y") < ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y)
1340 thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).LL.y);
1341 if (thepath.getStruct("end").getStruct("p").getDouble("y") > ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y)
1342 thepath.getStruct("end").getStruct("p").setDouble("y", ((ST_boxf)boxes.plus(boxn - 1).getStruct()).UR.y);
1306 if (thepath.end.p.x < ((ST_boxf)boxes[boxn - 1]).LL.x)
1307 thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).LL.x);
1308 if (thepath.end.p.x > ((ST_boxf)boxes[boxn - 1]).UR.x)
1309 thepath.end.p.setDouble("x", ((ST_boxf)boxes[boxn - 1]).UR.x);
1310 if (thepath.end.p.y < ((ST_boxf)boxes[boxn - 1]).LL.y)
1311 thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).LL.y);
1312 if (thepath.end.p.y > ((ST_boxf)boxes[boxn - 1]).UR.y)
1313 thepath.end.p.setDouble("y", ((ST_boxf)boxes[boxn - 1]).UR.y);
13431314 }
13441315 return 0;
13451316 } finally {
13571328 try {
13581329 if (size > Z.z().maxpn) {
13591330 int newmax = Z.z().maxpn + (size / 300 + 1) * 300;
1360 Z.z().ps = RALLOC(newmax, Z.z().ps, pointf.class);
1331 Z.z().ps = Z.z().ps.reallocJ(newmax);
13611332 if (N(Z.z().ps)) {
13621333 UNSUPPORTED("ds2v91aohji00tc7zmjuc3v6q"); // agerr(AGERR, "cannot re-allocate ps\n");
13631334 UNSUPPORTED("btmwubugs9vkexo4yb7a5nqel"); // return 1;
4646 import static gen.lib.cgraph.attr__c.agget;
4747 import static gen.lib.cgraph.obj__c.agraphof;
4848 import static gen.lib.common.geom__c.ccwrotatepf;
49 import static gen.lib.common.memory__c.zmalloc;
5049 import static gen.lib.common.utils__c.late_double;
5150 import static gen.lib.common.utils__c.late_int;
5251 import static gen.lib.common.utils__c.late_string;
5857 import static smetana.core.JUtils.cos;
5958 import static smetana.core.JUtils.enumAsInt;
6059 import static smetana.core.JUtils.sin;
61 import static smetana.core.JUtils.sizeof;
6260 import static smetana.core.JUtils.sqrt;
6361 import static smetana.core.JUtils.strcmp;
6462 import static smetana.core.JUtilsDebug.ENTERING;
8684 import static smetana.core.Macro.UNSUPPORTED;
8785 import static smetana.core.Macro.fabs;
8886 import static smetana.core.Macro.hypot;
89 import h.Agnode_s;
90 import h.Agnodeinfo_t;
91 import h.Agobj_s;
92 import h.Agraphinfo_t;
87 import h.ST_Agnode_s;
88 import h.ST_Agnodeinfo_t;
89 import h.ST_Agobj_s;
90 import h.ST_Agraphinfo_t;
9391 import h.ST_boxf;
92 import h.ST_inside_t;
93 import h.ST_point;
9494 import h.ST_pointf;
95 import h.ST_polygon_t;
9596 import h.ST_port;
96 import h.boxf;
97 import h.inside_t;
98 import h.point;
99 import h.pointf;
100 import h.polygon_t;
101 import h.port;
102 import h.shape_desc;
97 import h.ST_shape_desc;
10398 import h.shape_kind;
10499 import smetana.core.CFunctionImpl;
105100 import smetana.core.CString;
106 import smetana.core.JUtils;
107 import smetana.core.Memory;
108101 import smetana.core.Z;
109 import smetana.core.__c__fields;
110102 import smetana.core.__ptr__;
111 import smetana.core.__struct__;
112 import smetana.core.amiga.StarArrayOfPtr;
113103
114104 public class shapes__c {
115105 //1 2digov3edok6d5srhgtlmrycs
369359
370360 //3 c1s4k85p1cdfn176o3uryeros
371361 // static inline pointf pointfof(double x, double y)
372 public static __struct__<pointf> pointfof(double x, double y) {
362 public static ST_pointf pointfof(double x, double y) {
373363 // WARNING!! STRUCT
374364 return pointfof_w_(x, y).copy();
375365 }
376 private static __struct__<pointf> pointfof_w_(double x, double y) {
366 private static ST_pointf pointfof_w_(double x, double y) {
377367 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
378368 try {
379 final __struct__<pointf> r = JUtils.from(pointf.class);
369 final ST_pointf r = new ST_pointf();
380370 r.setDouble("x", x);
381371 r.setDouble("y", y);
382372 return r;
405395
406396
407397
408 //3 1vvsta5i8of59frav6uymguav
409 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
410 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
411 // WARNING!! STRUCT
412 return boxfof_w_(llx, lly, urx, ury).copy();
413 }
414 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
415 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
416 try {
417 final __struct__<boxf> b = JUtils.from(boxf.class);
418 b.getStruct("LL").setDouble("x", llx);
419 b.getStruct("LL").setDouble("y", lly);
420 b.getStruct("UR").setDouble("x", urx);
421 b.getStruct("UR").setDouble("y", ury);
422 return b;
423 } finally {
424 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
425 }
426 }
427
428398
429399
430400
447417
448418 //3 arrsbik9b5tnfcbzsm8gr2chx
449419 // static inline pointf add_pointf(pointf p, pointf q)
450 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
420 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
451421 // WARNING!! STRUCT
452422 return add_pointf_w_(p.copy(), q.copy()).copy();
453423 }
454 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
424 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
455425 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
456426 try {
457 final __struct__<pointf> r = JUtils.from(pointf.class);
458 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
459 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
427 final ST_pointf r = new ST_pointf();
428 r.setDouble("x", p.x + q.x);
429 r.setDouble("y", p.y + q.y);
460430 return r;
461431 } finally {
462432 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
753723 // static port Center =
754724 /*private final static __struct__<port> Center = JUtils.from(port.class);
755725 static {
756 Center.getStruct("p").setDouble("x", 0);
757 Center.getStruct("p").setDouble("y", 0);
726 Center.p.setDouble("x", 0);
727 Center.p.setDouble("y", 0);
758728 Center.setDouble("theta", -1);
759729 Center.setPtr("bp", null);
760730 Center.setInt("defined", 0);
10761046
10771047 //3 eb4jyrh981apg1fy13fczexdl
10781048 // static int same_side(pointf p0, pointf p1, pointf L0, pointf L1)
1079 public static boolean same_side(final __struct__<pointf> p0, final __struct__<pointf> p1, final __struct__<pointf> L0, final __struct__<pointf> L1) {
1049 public static boolean same_side(final ST_pointf p0, final ST_pointf p1, final ST_pointf L0, final ST_pointf L1) {
10801050 // WARNING!! STRUCT
10811051 return same_side_w_(p0.copy(), p1.copy(), L0.copy(), L1.copy());
10821052 }
1083 private static boolean same_side_w_(final __struct__<pointf> p0, final __struct__<pointf> p1, final __struct__<pointf> L0, final __struct__<pointf> L1) {
1053 private static boolean same_side_w_(final ST_pointf p0, final ST_pointf p1, final ST_pointf L0, final ST_pointf L1) {
10841054 ENTERING("eb4jyrh981apg1fy13fczexdl","same_side");
10851055 try {
10861056 boolean s0, s1;
10871057 double a, b, c;
10881058 /* a x + b y = c */
1089 a = -(L1.getDouble("y") - L0.getDouble("y"));
1090 b = (L1.getDouble("x") - L0.getDouble("x"));
1091 c = a * L0.getDouble("x") + b * L0.getDouble("y");
1092 s0 = (a * p0.getDouble("x") + b * p0.getDouble("y") - c >= 0);
1093 s1 = (a * p1.getDouble("x") + b * p1.getDouble("y") - c >= 0);
1059 a = -(L1.y - L0.y);
1060 b = (L1.x - L0.x);
1061 c = a * L0.x + b * L0.y;
1062 s0 = (a * p0.x + b * p0.y - c >= 0);
1063 s1 = (a * p1.x + b * p1.y - c >= 0);
10941064 return (s0 == s1);
10951065 } finally {
10961066 LEAVING("eb4jyrh981apg1fy13fczexdl","same_side");
25262496
25272497 //3 5gahokttzv65lspm84ao1le37
25282498 // shape_kind shapeOf(node_t * n)
2529 public static int shapeOf(Agnode_s n) {
2499 public static int shapeOf(ST_Agnode_s n) {
25302500 ENTERING("5gahokttzv65lspm84ao1le37","shapeOf");
25312501 try {
2532 shape_desc sh = (shape_desc) ND_shape(n);
2502 ST_shape_desc sh = (ST_shape_desc) ND_shape(n);
25332503 CFunctionImpl ifn; //void (*ifn) (node_t *);
25342504 if (N(sh))
25352505 return enumAsInt(shape_kind.class, "SH_UNSET");
2536 ifn = (CFunctionImpl) ND_shape(n).getPtr("fns").getPtr("initfn");
2506 ifn = (CFunctionImpl) ND_shape(n).fns.initfn;
25372507 if (ifn.getName().equals("poly_init"))
25382508 return enumAsInt(shape_kind.class, "SH_POLY");
25392509 UNSUPPORTED("251a710sgr57bnrs3uh7ppfpi"); // else if (ifn == record_init)
25712541
25722542 //3 a11xv6duihbr3d6gkgo2ye2j5
25732543 // static void poly_init(node_t * n)
2574 public static void poly_init(Agnode_s n) {
2544 public static void poly_init(ST_Agnode_s n) {
25752545 ENTERING("a11xv6duihbr3d6gkgo2ye2j5","poly_init");
25762546 try {
2577 final __struct__<pointf> dimen = JUtils.from(pointf.class), min_bb = JUtils.from(pointf.class), bb = JUtils.from(pointf.class);
2578 final __struct__<point> imagesize = JUtils.from(point.class);
2579 final __struct__<pointf> P = JUtils.from(pointf.class), Q = JUtils.from(pointf.class), R = JUtils.from(pointf.class);
2580 __ptr__ vertices = null;
2547 final ST_pointf dimen = new ST_pointf(), min_bb = new ST_pointf(), bb = new ST_pointf();
2548 final ST_point imagesize = new ST_point();
2549 final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf();
2550 ST_pointf.Array vertices = null;
25812551 CString p, sfile, fxd;
25822552 double temp, alpha, beta, gamma;
25832553 double orientation, distortion, skew;
25862556 double width=0, height=0, marginx, marginy, spacex;
25872557 boolean regular; int peripheries, sides;
25882558 boolean isBox; int i, j, outp;
2589 polygon_t poly = (polygon_t) Memory.malloc(polygon_t.class);
2590 regular = ND_shape(n).getPtr("polygon").getBoolean("regular");
2591 peripheries = ND_shape(n).getPtr("polygon").getInt("peripheries");
2592 sides = ND_shape(n).getPtr("polygon").getInt("sides");
2593 orientation = ND_shape(n).getPtr("polygon").getDouble("orientation");
2594 skew = ND_shape(n).getPtr("polygon").getDouble("skew");
2595 distortion = ND_shape(n).getPtr("polygon").getDouble("distortion");
2559 ST_polygon_t poly = new ST_polygon_t();
2560 regular = ND_shape(n).polygon.regular!=0;
2561 peripheries = ND_shape(n).polygon.peripheries;
2562 sides = ND_shape(n).polygon.sides;
2563 orientation = ND_shape(n).polygon.orientation;
2564 skew = ND_shape(n).polygon.skew;
2565 distortion = ND_shape(n).polygon.distortion;
25962566 regular |= mapbool(agget(n, new CString("regular")));
25972567 /* all calculations in floating point POINTS */
25982568 /* make x and y dimensions equal if node is regular
26212591 UNSUPPORTED("abmuc3vqirf3i48480fj0k14g"); // distortion = late_double(n, N_distortion, 0.0, -100.0);
26222592 }
26232593 /* get label dimensions */
2624 dimen.___(ND_label(n).getStruct("dimen"));
2594 dimen.___(ND_label(n).dimen);
26252595 /* minimal whitespace around label */
2626 if (ROUND(abs(dimen.getDouble("x")))!=0 || ROUND(abs(dimen.getDouble("y")))!=0) {
2596 if (ROUND(abs(dimen.x))!=0 || ROUND(abs(dimen.y))!=0) {
26272597 /* padding */
26282598 if ((p = agget(n, new CString("margin")))!=null) {
26292599 UNSUPPORTED("4dlqwm3pklzgz2e777dm56n03"); // marginx = marginy = 0;
26422612 UNSUPPORTED("87bdwkkwbzyswxnepdd9bj8mb"); // {((dimen).x += 4*4); ((dimen).y += 2*4);};
26432613 } else
26442614 {
2645 ((ST_pointf) dimen).x = dimen.getDouble("x") + 4*4;
2646 ((ST_pointf) dimen).y = dimen.getDouble("y") + 2*4;
2615 ((ST_pointf) dimen).x = dimen.x + 4*4;
2616 ((ST_pointf) dimen).y = dimen.y + 2*4;
26472617 };
26482618 }
2649 spacex = dimen.getDouble("x") - ND_label(n).getStruct("dimen").getDouble("x");
2619 spacex = dimen.x - ND_label(n).dimen.x;
26502620 /* quantization */
2651 if ((temp = agraphof(n).castTo(Agobj_s.class).getPtr("data").castTo(Agraphinfo_t.class).getPtr("drawing").getDouble("quantum")) > 0.0) {
2621 if ((temp = ((ST_Agraphinfo_t)agraphof(n).castTo_ST_Agobj_s().data.castTo(ST_Agraphinfo_t.class)).drawing.quantum) > 0.0) {
26522622 UNSUPPORTED("3nqb0s5rkwj3igt71vooj8asd"); // temp = ((((temp)*72>=0)?(int)((temp)*72 + .5):(int)((temp)*72 - .5)));
26532623 UNSUPPORTED("5fxtqwy8liyvnx1yvsou5hb4o"); // dimen.x = quant(dimen.x, temp);
26542624 UNSUPPORTED("et885f1jcqpske6ip856arouv"); // dimen.y = quant(dimen.y, temp);
26552625 }
26562626 imagesize.setInt("x", 0);
26572627 imagesize.setInt("y", 0);
2658 if (ND_shape(n).getBoolean("usershape")) {
2628 if (ND_shape(n).usershape) {
26592629 /* custom requires a shapefile
26602630 * not custom is an adaptable user shape such as a postscript
26612631 * function.
26882658 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
26892659 }
26902660 /* initialize node bb to labelsize */
2691 ((ST_pointf) bb).x = ((dimen.getDouble("x"))>(imagesize.getInt("x"))?(dimen.getDouble("x")):(imagesize.getInt("x")));
2692 ((ST_pointf) bb).y = ((dimen.getDouble("y"))>(imagesize.getInt("y"))?(dimen.getDouble("y")):(imagesize.getInt("y")));
2661 ((ST_pointf) bb).x = ((dimen.x)>(imagesize.x)?(dimen.x):(imagesize.x));
2662 ((ST_pointf) bb).y = ((dimen.y)>(imagesize.y)?(dimen.y):(imagesize.y));
26932663 /* I don't know how to distort or skew ellipses in postscript */
26942664 /* Convert request to a polygon with a large number of sides */
26952665 if ((sides <= 2) && ((distortion != 0.) || (skew != 0.))) {
26982668 /* extra sizing depends on if label is centered vertically */
26992669 p = agget(n, new CString("labelloc"));
27002670 if (p!=null && (p.charAt(0) == 't' || p.charAt(0) == 'b'))
2701 n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").setInt("valign", p.charAt(0));
2671 n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", p.charAt(0));
27022672 else
2703 n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").setInt("valign", 'c');
2673 n.castTo_ST_Agobj_s().data.castTo_ST_Agnodeinfo_t().label.setInt("valign", 'c');
27042674 isBox = (sides == 4 && (((orientation>=0)?(int)(orientation + .5):(int)(orientation - .5)) % 90) == 0
27052675 && distortion == 0. && skew == 0.);
27062676 if (isBox) {
27072677 /* for regular boxes the fit should be exact */
2708 } else if (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("shape").getPtr("polygon").getPtr("vertices")!=null) {
2678 } else if (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).shape.polygon.vertices!=null) {
27092679 UNSUPPORTED("4adqsyjwqwzs50ggjp57ok6u7"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices;
27102680 UNSUPPORTED("1fjwgzo5xkijo98ycmzhal8yv"); // bb = pd->size_gen(bb);
27112681 } else {
27132683 * containing bb centered on the origin, and then pad for that.
27142684 * We assume the ellipse is defined by a scaling up of bb.
27152685 */
2716 temp = bb.getDouble("y") * 1.41421356237309504880;
2717 if (height > temp && (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getInt("valign") == 'c')) {
2686 temp = bb.y * 1.41421356237309504880;
2687 if (height > temp && (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.valign == 'c')) {
27182688 /* if there is height to spare
27192689 * and the label is centered vertically
27202690 * then just pad x in proportion to the spare height */
2721 bb.setDouble("x", bb.getDouble("x") * sqrt(1. / (1. - ((bb.getDouble("y") / height) * (bb.getDouble("y") / height)))));
2691 bb.setDouble("x", bb.x * sqrt(1. / (1. - ((bb.y / height) * (bb.y / height)))));
27222692 } else {
2723 bb.setDouble("x", bb.getDouble("x") * 1.41421356237309504880);
2693 bb.setDouble("x", bb.x * 1.41421356237309504880);
27242694 bb.setDouble("y", temp);
27252695 }
27262696 if (sides > 2) {
27272697 temp = cos(3.14159265358979323846 / sides);
2728 bb.setDouble("x", bb.getDouble("x") / temp);
2729 bb.setDouble("y", bb.getDouble("y") / temp);
2698 bb.setDouble("x", bb.x / temp);
2699 bb.setDouble("y", bb.y / temp);
27302700 /* FIXME - for odd-sided polygons, e.g. triangles, there
27312701 would be a better fit with some vertical adjustment of the shape */
27322702 }
27382708 if ((fxd.charAt(0) == 's') && (N(strcmp(fxd,new CString("shape"))))) {
27392709 bb.setDouble("x", width);
27402710 bb.setDouble("y", height);
2741 poly.setInt("option", poly.getInt("option") | (1 << 11));
2711 poly.setInt("option", poly.option | (1 << 11));
27422712 } else if (mapbool(fxd)) {
27432713 /* check only label, as images we can scale to fit */
2744 if ((width < (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getDouble("dimen.x"))
2745 || (height < (n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).getPtr("label").getDouble("dimen.y")))))
2714 if ((width < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.x)
2715 || (height < (((ST_Agnodeinfo_t)n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class)).label.dimen.y))))
27462716 System.err.println(
27472717 "node '%s', graph '%s' size too small for label\n");
27482718 //agnameof(n), agnameof(agraphof(n)));
27492719 bb.setDouble("x", width);
27502720 bb.setDouble("y", height);
27512721 } else {
2752 width = MAX(width, bb.getDouble("x"));
2722 width = MAX(width, bb.x);
27532723 ((ST_pointf) bb).x = width;
2754 height = MAX(height, bb.getDouble("y"));
2724 height = MAX(height, bb.y);
27552725 ((ST_pointf) bb).y = height;
27562726 }
27572727 /* If regular, make dimensions the same.
27582728 * Need this to guarantee final node size is regular.
27592729 */
27602730 if (regular) {
2761 width = MAX(bb.getDouble("x"), bb.getDouble("y"));
2731 width = MAX(bb.x, bb.y);
27622732 height = width;
27632733 ((ST_pointf) bb).x = width;
27642734 ((ST_pointf) bb).y = width;
27662736 /* Compute space available for label. Provides the justification borders */
27672737 if (N(mapbool(late_string(n, Z.z().N_nojustify, new CString("false"))))) {
27682738 if (isBox) {
2769 ((ST_pointf) ND_label(n).getStruct("space")).x = MAX(dimen.getDouble("x"),bb.getDouble("x")) - spacex;
2739 ((ST_pointf) ND_label(n).space).x = MAX(dimen.x,bb.x) - spacex;
27702740 }
2771 else if (dimen.getDouble("y") < bb.getDouble("y")) {
2772 temp = bb.getDouble("x") * sqrt(1.0 - SQR(dimen.getDouble("y")) / SQR(bb.getDouble("y")));
2773 ND_label(n).getStruct("space").setDouble("x", MAX(dimen.getDouble("x"),temp) - spacex);
2741 else if (dimen.y < bb.y) {
2742 temp = bb.x * sqrt(1.0 - SQR(dimen.y) / SQR(bb.y));
2743 ND_label(n).space.setDouble("x", MAX(dimen.x,temp) - spacex);
27742744 }
27752745 else
2776 ND_label(n).getStruct("space").setDouble("x", dimen.getDouble("x") - spacex);
2746 ND_label(n).space.setDouble("x", dimen.x - spacex);
27772747 } else {
2778 ND_label(n).getStruct("space").setDouble("x", dimen.getDouble("x") - spacex);
2748 ND_label(n).space.setDouble("x", dimen.x - spacex);
27792749 }
2780 if ((poly.getInt("option") & (1 << 11)) == 0) {
2781 temp = bb.getDouble("y") - min_bb.getDouble("y");
2782 if (dimen.getDouble("y") < imagesize.getInt("y"))
2783 temp += imagesize.getInt("y") - dimen.getDouble("y");
2784 ((ST_pointf) ND_label(n).getStruct("space")).y = dimen.getDouble("y") + temp;
2750 if ((poly.option & (1 << 11)) == 0) {
2751 temp = bb.y - min_bb.y;
2752 if (dimen.y < imagesize.y)
2753 temp += imagesize.y - dimen.y;
2754 ((ST_pointf) ND_label(n).space).y = dimen.y + temp;
27852755 }
27862756 outp = peripheries;
27872757 if (peripheries < 1)
27882758 outp = 1;
27892759 if (sides < 3) { /* ellipses */
27902760 sides = 2;
2791 vertices = zmalloc(sizeof(pointf.class, outp * sides));
2792 P.setDouble("x", bb.getDouble("x") / 2.);
2793 P.setDouble("y", bb.getDouble("y") / 2.);
2794 vertices.setDouble("x", -P.getDouble("x"));
2795 vertices.setDouble("y", -P.getDouble("y"));
2796 vertices.plus(1).setDouble("x", P.getDouble("x"));
2797 vertices.plus(1).setDouble("y", P.getDouble("y"));
2761 vertices = new ST_pointf.Array(outp * sides);
2762 P.setDouble("x", bb.x / 2.);
2763 P.setDouble("y", bb.y / 2.);
2764 vertices.setDouble("x", -P.x);
2765 vertices.setDouble("y", -P.y);
2766 vertices.plus(1).setDouble("x", P.x);
2767 vertices.plus(1).setDouble("y", P.y);
27982768 if (peripheries > 1) {
27992769 UNSUPPORTED("4ofenmfgj7cgyf624qmugcx77"); // for (j = 1, i = 2; j < peripheries; j++) {
28002770 UNSUPPORTED("458w3r6n3nidn2j2b154phpzt"); // P.x += 4;
28222792 * It needs to find the point where the two lines, parallel to
28232793 * the current segments, and outside by GAP distance, intersect.
28242794 */
2825 vertices = zmalloc(sizeof(pointf.class, outp * sides));
2826 if (ND_shape(n).getPtr("polygon").getPtr("vertices")!=null) {
2795 vertices = new ST_pointf.Array(outp * sides);
2796 if (((ST_polygon_t)ND_shape(n).polygon).vertices!=null) {
28272797 UNSUPPORTED("3ghle84ieryaenfnlbzrfv7bw"); // poly_desc_t* pd = (poly_desc_t*)(((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->shape)->polygon->vertices;
28282798 UNSUPPORTED("227lpcg9dt83m2bm8yshb4djf"); // pd->vertex_gen (vertices, &bb);
28292799 UNSUPPORTED("cc3jvnwvbhjhro4adeet363yd"); // xmax = bb.x/2;
28442814 /*next regular vertex */
28452815 angle += sectorangle;
28462816 sinx = sin(angle); cosx = cos(angle);
2847 ((ST_pointf) R).x = R.getDouble("x") + sidelength * cosx;
2848 ((ST_pointf) R).y = R.getDouble("y") + sidelength * sinx;
2817 ((ST_pointf) R).x = R.x + sidelength * cosx;
2818 ((ST_pointf) R).y = R.y + sidelength * sinx;
28492819 /*distort and skew */
2850 ((ST_pointf) P).x = R.getDouble("x") * (skewdist + R.getDouble("y") * gdistortion) + R.getDouble("y") * gskew;
2851 ((ST_pointf) P).y = R.getDouble("y");
2820 ((ST_pointf) P).x = R.x * (skewdist + R.y * gdistortion) + R.y * gskew;
2821 ((ST_pointf) P).y = R.y;
28522822 /*orient P.x,P.y */
2853 alpha = RADIANS(orientation) + atan2(P.getDouble("y"), P.getDouble("x"));
2823 alpha = RADIANS(orientation) + atan2(P.y, P.x);
28542824 sinx = sin(alpha); cosx = cos(alpha);
2855 ((ST_pointf) P).y = hypot(P.getDouble("x"), P.getDouble("y"));
2856 ((ST_pointf) P).x = P.getDouble("y");
2857 ((ST_pointf) P).x = P.getDouble("x") * cosx;
2858 ((ST_pointf) P).y = P.getDouble("y") * sinx;
2825 ((ST_pointf) P).y = hypot(P.x, P.y);
2826 ((ST_pointf) P).x = P.y;
2827 ((ST_pointf) P).x = P.x * cosx;
2828 ((ST_pointf) P).y = P.y * sinx;
28592829 /*scale for label */
2860 ((ST_pointf) P).x = P.getDouble("x") * bb.getDouble("x");
2861 ((ST_pointf) P).y = P.getDouble("y") * bb.getDouble("y");
2830 ((ST_pointf) P).x = P.x * bb.x;
2831 ((ST_pointf) P).y = P.y * bb.y;
28622832 /*find max for bounding box */
2863 xmax = MAX(fabs(P.getDouble("x")), xmax);
2864 ymax = MAX(fabs(P.getDouble("y")), ymax);
2833 xmax = MAX(fabs(P.x), xmax);
2834 ymax = MAX(fabs(P.y), ymax);
28652835 /* store result in array of points */
28662836 vertices.plus(i).setStruct(P);
28672837 if (isBox) { /* enforce exact symmetry of box */
2868 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(1)).getInternalArray().getInternal(0)))).x = -P.getDouble("x");
2869 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(1)).getInternalArray().getInternal(0)))).y = P.getDouble("y");
2870 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(2)).getInternalArray().getInternal(0)))).x = -P.getDouble("x");
2871 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(2)).getInternalArray().getInternal(0)))).y = -P.getDouble("y");
2872 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(3)).getInternalArray().getInternal(0)))).x = P.getDouble("x");
2873 ((ST_pointf)((__c__fields)(((StarArrayOfPtr) vertices.plus(3)).getInternalArray().getInternal(0)))).y = -P.getDouble("y");
2838 vertices.get(1).x = -P.x;
2839 vertices.get(1).y = P.y;
2840 vertices.get(2).x = -P.x;
2841 vertices.get(2).y = -P.y;
2842 vertices.get(3).x = P.x;
2843 vertices.get(3).y = -P.y;
28742844 break;
28752845 }
28762846 }
28802850 ymax *= 2.;
28812851 ((ST_pointf) bb).x = MAX(width, xmax);
28822852 ((ST_pointf) bb).y = MAX(height, ymax);
2883 scalex = bb.getDouble("x") / xmax;
2884 scaley = bb.getDouble("y") / ymax;
2853 scalex = bb.x / xmax;
2854 scaley = bb.y / ymax;
28852855 for (i = 0; i < sides; i++) {
28862856 P.____(vertices.plus(i));
2887 ((ST_pointf) P).x = P.getDouble("x") * scalex;
2888 ((ST_pointf) P).y = P.getDouble("y") * scaley;
2857 ((ST_pointf) P).x = P.x * scalex;
2858 ((ST_pointf) P).y = P.y * scaley;
28892859 vertices.plus(i).setStruct(P);
28902860 }
28912861 if (peripheries > 1) {
29282898 poly.setDouble("orientation", orientation);
29292899 poly.setDouble("skew", skew);
29302900 poly.setDouble("distortion", distortion);
2931 poly.setPtr("vertices", vertices);
2932 if ((poly.getInt("option") & (1 << 11))!=0) {
2901 poly.vertices = vertices;
2902 if ((poly.option & (1 << 11))!=0) {
29332903 /* set width and height to reflect label and shape */
29342904 UNSUPPORTED("7kk8oru3b3copylmq3gssx6qx"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->width) = ((((dimen.x)>(bb.x)?(dimen.x):(bb.x)))/(double)72);
29352905 UNSUPPORTED("8oouzms2x039fhfcfxm7yc4su"); // (((Agnodeinfo_t*)(((Agobj_t*)(n))->data))->height) = ((((dimen.y)>(bb.y)?(dimen.y):(bb.y)))/(double)72);
29362906 } else {
2937 n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setDouble("width", ((bb.getDouble("x"))/(double)72));
2938 n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setDouble("height", ((bb.getDouble("y"))/(double)72));
2907 n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("width", ((bb.x)/(double)72));
2908 n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setDouble("height", ((bb.y)/(double)72));
29392909 }
2940 n.castTo(Agobj_s.class).getPtr("data").castTo(Agnodeinfo_t.class).setPtr("shape_info", poly);
2910 n.castTo_ST_Agobj_s().data.castTo(ST_Agnodeinfo_t.class).setPtr("shape_info", poly);
29412911 } finally {
29422912 LEAVING("a11xv6duihbr3d6gkgo2ye2j5","poly_init");
29432913 }
29642934
29652935
29662936
2967 //3 570t4xovyyfqipaikkf63crmk
2968 // static boolean poly_inside(inside_t * inside_context, pointf p)
29692937 //static Agnode_s lastn; /* last node argument */
29702938 //static polygon_t poly;
29712939 //static int last, outp, sides;
2972 //static final __struct__<pointf> O = JUtils.from(pointf.class); /* point (0,0) */
2940 //static final ST_pointf O = new ST_pointf(); /* point (0,0) */
29732941 //static pointf vertex;
29742942 //static double xsize, ysize, scalex, scaley, box_URx, box_URy;
2975 public static boolean poly_inside(inside_t inside_context, final __struct__<pointf> p) {
2943 //3 570t4xovyyfqipaikkf63crmk
2944 //static boolean poly_inside(inside_t * inside_context, pointf p)
2945 public static boolean poly_inside(ST_inside_t inside_context, ST_pointf p) {
29762946 // WARNING!! STRUCT
29772947 return poly_inside_w_(inside_context, p.copy());
29782948 }
2979 private static boolean poly_inside_w_(inside_t inside_context, final __struct__<pointf> p) {
2949 private static boolean poly_inside_w_(ST_inside_t inside_context, final ST_pointf p) {
29802950 ENTERING("570t4xovyyfqipaikkf63crmk","poly_inside");
29812951 try {
29822952 int i, i1, j;
29832953 boolean s;
29842954 final ST_pointf P = new ST_pointf(), Q = new ST_pointf(), R = new ST_pointf();
2985 __ptr__ bp = inside_context.getPtr("s.bp");
2986 __ptr__ n = inside_context.getPtr("s.n");
2955 ST_boxf bp = inside_context.s_bp;
2956 ST_Agnode_s n = inside_context.s_n;
29872957 P.___(ccwrotatepf(p, 90 * GD_rankdir(agraphof(n))));
29882958 /* Quick test if port rectangle is target */
29892959 if (bp!=null) {
29932963 }
29942964 if (NEQ(n, Z.z().lastn)) {
29952965 double n_width = 0, n_height = 0;
2996 Z.z().poly = (polygon_t) ND_shape_info(n);
2997 Z.z().vertex = (pointf) Z.z().poly.getPtr("vertices");
2998 Z.z().sides = Z.z().poly.getInt("sides");
2999 if ((Z.z().poly.getInt("option") & (1 << 11))!=0) {
2966 Z.z().poly = (ST_polygon_t) ND_shape_info(n);
2967 Z.z().vertex = Z.z().poly.vertices;
2968 Z.z().sides = Z.z().poly.sides;
2969 if ((Z.z().poly.option & (1 << 11))!=0) {
30002970 UNSUPPORTED("18yw1scg4sol8bhyf1vedj9kn"); // boxf bb = polyBB(poly);
30012971 UNSUPPORTED("7rz7vxyxao0efec2nvd6g19m1"); // n_width = bb.UR.x - bb.LL.x;
30022972 UNSUPPORTED("4h0k2wroz3xqx1ljokdbaqaad"); // n_height = bb.UR.y - bb.LL.y;
30303000 Z.z().box_URx = n_width / 2.0;
30313001 Z.z().box_URy = n_height / 2.0;
30323002 /* index to outer-periphery */
3033 Z.z().outp = (Z.z().poly.getInt("peripheries") - 1) * Z.z().sides;
3003 Z.z().outp = (Z.z().poly.peripheries - 1) * Z.z().sides;
30343004 if (Z.z().outp < 0)
30353005 Z.z().outp = 0;
3036 Z.z().lastn = (Agnode_s) n;
3006 Z.z().lastn = (ST_Agnode_s) n;
30373007 }
30383008 /* scale */
3039 P.setDouble("x", P.getDouble("x") * Z.z().scalex);
3040 P.setDouble("y", P.getDouble("y") * Z.z().scaley);
3009 P.setDouble("x", P.x * Z.z().scalex);
3010 P.setDouble("y", P.y * Z.z().scaley);
30413011 /* inside bounding box? */
3042 if ((fabs(P.getDouble("x")) > Z.z().box_URx) || (fabs(P.getDouble("y")) > Z.z().box_URy))
3012 if ((fabs(P.x) > Z.z().box_URx) || (fabs(P.y) > Z.z().box_URy))
30433013 return false;
30443014 /* ellipses */
30453015 if (Z.z().sides <= 2)
3046 return (hypot(P.getDouble("x") / Z.z().box_URx, P.getDouble("y") / Z.z().box_URy) < 1.);
3016 return (hypot(P.x / Z.z().box_URx, P.y / Z.z().box_URy) < 1.);
30473017 /* use fast test in case we are converging on a segment */
30483018 i = Z.z().last % Z.z().sides; /* in case last left over from larger polygon */
30493019 i1 = (i + 1) % Z.z().sides;
30503020 Q.___(Z.z().vertex.plus(i + Z.z().outp).getStruct());
30513021 R.___(Z.z().vertex.plus(i1 + Z.z().outp).getStruct());
3052 if (N(same_side(P, Z.z().O, Q, R))) /* false if outside the segment's face */
3022 if (N(same_side(P, (ST_pointf)Z.z().O, Q, R))) /* false if outside the segment's face */
30533023 return false;
30543024 /* else inside the segment face... */
3055 if ((s = same_side(P, Q, R, Z.z().O)) && (same_side(P, R, Z.z().O, Q))) /* true if between the segment's sides */
3025 if ((s = same_side(P, Q, R, (ST_pointf)Z.z().O)) && (same_side(P, R, (ST_pointf)Z.z().O, Q))) /* true if between the segment's sides */
30563026 return NOT(0);
30573027 /* else maybe in another segment */
30583028 for (j = 1; j < Z.z().sides; j++) { /* iterate over remaining segments */
30633033 i1 = i;
30643034 i = (i + Z.z().sides - 1) % Z.z().sides;
30653035 }
3066 if (N(same_side(P, Z.z().O, Z.z().vertex.plus(i + Z.z().outp).getStruct(), Z.z().vertex.plus(i1 + Z.z().outp).getStruct()))) { /* false if outside any other segment's face */
3036 if (N(same_side(P, (ST_pointf)Z.z().O, (ST_pointf)Z.z().vertex.plus(i + Z.z().outp).getStruct(), (ST_pointf)Z.z().vertex.plus(i1 + Z.z().outp).getStruct()))) { /* false if outside any other segment's face */
30673037 Z.z().last = i;
30683038 return false;
30693039 }
30813051
30823052 //3 5mmuhvq40xadw0g9mzlauyztq
30833053 // static int poly_path(node_t * n, port * p, int side, boxf rv[], int *kptr)
3084 public static int poly_path(Agnode_s n, port p, int side, Object rv, Object kptr) {
3054 public static int poly_path(ST_Agnode_s n, ST_port p, int side, Object rv, Object kptr) {
30853055 ENTERING("5mmuhvq40xadw0g9mzlauyztq","poly_path");
30863056 try {
30873057 side = 0;
3088 if (ND_label(n).getBoolean("html") && ND_has_port(n)) {
3058 if (ND_label(n).html && ND_has_port(n)) {
30893059 UNSUPPORTED("67g7bthntnw8syb6zd03ueg84"); // side = html_path(n, p, side, rv, kptr);
30903060 }
30913061 return side;
34283398
34293399 //3 5k2b9gfpwm2tj3zmzniuz9azt
34303400 // static port poly_port(node_t * n, char *portname, char *compass)
3431 public static __struct__<port> poly_port(Agnode_s n, CString portname, CString compass) {
3401 public static ST_port poly_port(ST_Agnode_s n, CString portname, CString compass) {
34323402 // WARNING!! STRUCT
34333403 return poly_port_w_(n, portname, compass).copy();
34343404 }
3435 private static __struct__<port> poly_port_w_(Agnode_s n, CString portname, CString compass) {
3405 private static ST_port poly_port_w_(ST_Agnode_s n, CString portname, CString compass) {
34363406 ENTERING("5k2b9gfpwm2tj3zmzniuz9azt","poly_port");
34373407 try {
3438 final __struct__<port> rv= JUtils.from(port.class);
3439 boxf bp;
3408 final ST_port rv= new ST_port();
3409 ST_boxf bp;
34403410 int sides; /* bitmap of which sides the port lies along */
34413411 if (portname.charAt(0) == '\0')
34423412 return Z.z().Center.copy();
45914561
45924562 //3 bmt148wdf0a7gslm7hmp043jy
45934563 // shape_desc *bind_shape(char *name, node_t * np)
4594 public static shape_desc bind_shape(CString name, Agnode_s np) {
4564 public static ST_shape_desc bind_shape(CString name, ST_Agnode_s np) {
45954565 ENTERING("bmt148wdf0a7gslm7hmp043jy","bind_shape");
45964566 try {
4597 shape_desc rv = null;
4567 ST_shape_desc rv = null;
45984568 CString str;
45994569 str = safefile(agget(np, new CString("shapefile")));
46004570 /* If shapefile is defined and not epsf, set shape = custom */
46014571 if (str!=null && UNSUPPORTED("!(*(name)==*(\"epsf\")&&!strcmp(name,\"epsf\"))")!=null)
46024572 name = new CString("custom");
46034573 if (N(name.charAt(0)=='c' && N(strcmp(name,new CString("custom"))))) {
4604 for (shape_desc ptr : Z.z().Shapes) {
4605 if ((N(strcmp(ptr.getCString("name"),name)))) {
4574 for (ST_shape_desc ptr : Z.z().Shapes) {
4575 if ((N(strcmp(ptr.name,name)))) {
46064576 rv = ptr;
46074577 break;
46084578 }
48954865
48964866 //3 ckbg1dyu9jzx7g0c9dbriez7r
48974867 // port resolvePort(node_t * n, node_t * other, port * oldport)
4898 public static ST_port resolvePort(Agnode_s n, Agnode_s other, port oldport) {
4868 public static ST_port resolvePort(ST_Agnode_s n, ST_Agnode_s other, ST_port oldport) {
48994869 // WARNING!! STRUCT
49004870 return resolvePort_w_(n, other, oldport).copy();
49014871 }
4902 private static ST_port resolvePort_w_(Agnode_s n, Agnode_s other, port oldport) {
4872 private static ST_port resolvePort_w_(ST_Agnode_s n, ST_Agnode_s other, ST_port oldport) {
49034873 ENTERING("ckbg1dyu9jzx7g0c9dbriez7r","resolvePort");
49044874 try {
49054875 UNSUPPORTED("1aa44pvk8su341rug2x5h5h9o"); // port resolvePort(node_t * n, node_t * other, port * oldport)
5050 import static gen.lib.common.arrows__c.arrowStartClip;
5151 import static gen.lib.common.arrows__c.arrow_flags;
5252 import static gen.lib.common.emit__c.update_bb_bz;
53 import static gen.lib.common.memory__c.zmalloc;
5453 import static gen.lib.common.shapes__c.resolvePort;
5554 import static gen.lib.common.utils__c.Bezier;
55 import static gen.lib.common.utils__c.dotneato_closest;
5656 import static smetana.core.JUtils.EQ;
57 import static smetana.core.JUtils.sizeof;
5857 import static smetana.core.JUtilsDebug.ENTERING;
5958 import static smetana.core.JUtilsDebug.LEAVING;
6059 import static smetana.core.Macro.ABS;
61 import static smetana.core.Macro.ALLOC;
60 import static smetana.core.Macro.ALLOC_ST_bezier;
6261 import static smetana.core.Macro.APPROXEQPT;
6362 import static smetana.core.Macro.ED_edge_type;
6463 import static smetana.core.Macro.ED_head_port;
6766 import static smetana.core.Macro.ED_tail_port;
6867 import static smetana.core.Macro.ED_to_orig;
6968 import static smetana.core.Macro.GD_bb;
69 import static smetana.core.Macro.GD_flags;
7070 import static smetana.core.Macro.GD_flip;
7171 import static smetana.core.Macro.MAX;
7272 import static smetana.core.Macro.MILLIPOINT;
7979 import static smetana.core.Macro.ND_rw;
8080 import static smetana.core.Macro.ND_shape;
8181 import static smetana.core.Macro.NOT;
82 import static smetana.core.Macro.NOTI;
8283 import static smetana.core.Macro.UNSUPPORTED;
83 import h.Agedge_s;
84 import h.Agnode_s;
85 import h.Agraph_s;
84 import h.ST_Agedge_s;
85 import h.ST_Agnode_s;
86 import h.ST_Agraph_s;
87 import h.ST_bezier;
8688 import h.ST_boxf;
89 import h.ST_inside_t;
90 import h.ST_path;
91 import h.ST_pathend_t;
8792 import h.ST_pointf;
88 import h.bezier;
89 import h.boxf;
90 import h.inside_t;
91 import h.path;
92 import h.pathend_t;
93 import h.pointf;
94 import h.splineInfo;
95 import h.splines;
96 import h.textlabel_t;
93 import h.ST_splineInfo;
94 import h.ST_splines;
95 import h.ST_textlabel_t;
9796 import smetana.core.CFunction;
98 import smetana.core.JUtils;
9997 import smetana.core.MutableDouble;
100 import smetana.core.__array_of_struct__;
101 import smetana.core.__array_of_struct_impl__;
10298 import smetana.core.__ptr__;
103 import smetana.core.__struct__;
10499
105100 public class splines__c {
106101 //1 2digov3edok6d5srhgtlmrycs
360355
361356 //3 c1s4k85p1cdfn176o3uryeros
362357 // static inline pointf pointfof(double x, double y)
363 public static __struct__<pointf> pointfof(double x, double y) {
358 public static ST_pointf pointfof(double x, double y) {
364359 // WARNING!! STRUCT
365360 return pointfof_w_(x, y).copy();
366361 }
367 private static __struct__<pointf> pointfof_w_(double x, double y) {
362 private static ST_pointf pointfof_w_(double x, double y) {
368363 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
369364 try {
370 final __struct__<pointf> r = JUtils.from(pointf.class);
365 final ST_pointf r = new ST_pointf();
371366 r.setDouble("x", x);
372367 r.setDouble("y", y);
373368 return r;
396391
397392
398393
399 //3 1vvsta5i8of59frav6uymguav
400 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
401 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
402 // WARNING!! STRUCT
403 return boxfof_w_(llx, lly, urx, ury).copy();
404 }
405 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
406 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
407 try {
408 final __struct__<boxf> b = JUtils.from(boxf.class);
409 b.getStruct("LL").setDouble("x", llx);
410 b.getStruct("LL").setDouble("y", lly);
411 b.getStruct("UR").setDouble("x", urx);
412 b.getStruct("UR").setDouble("y", ury);
413 return b;
414 } finally {
415 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
416 }
417 }
418394
419395
420396
438414
439415 //3 arrsbik9b5tnfcbzsm8gr2chx
440416 // static inline pointf add_pointf(pointf p, pointf q)
441 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
417 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
442418 // WARNING!! STRUCT
443419 return add_pointf_w_(p.copy(), q.copy()).copy();
444420 }
445 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
421 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
446422 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
447423 try {
448 final __struct__<pointf> r = JUtils.from(pointf.class);
449 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
450 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
424 final ST_pointf r = new ST_pointf();
425 r.setDouble("x", p.x + q.x);
426 r.setDouble("y", p.y + q.y);
451427 return r;
452428 } finally {
453429 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
744720
745721 //3 6izm0fbkejw7odmiw4zaw1ycp
746722 // static void arrow_clip(edge_t * fe, node_t * hn, pointf * ps, int *startp, int *endp, bezier * spl, splineInfo * info)
747 public static void arrow_clip(Agedge_s fe, Agnode_s hn, __ptr__ ps, int startp[], int endp[], bezier spl, __ptr__ info) {
723 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) {
748724 ENTERING("6izm0fbkejw7odmiw4zaw1ycp","arrow_clip");
749725 try {
750 Agedge_s e;
726 ST_Agedge_s e;
751727 int i;
752728 boolean j;
753729 int sflag[] = new int[]{0};
754730 int eflag[] = new int[]{0};
755731 for (e = fe; ED_to_orig(e)!=null; e = ED_to_orig(e));
756 if (info.getBoolean("ignoreSwap"))
732 if (info.ignoreSwap)
757733 j = false;
758734 else
759 j = (Boolean) info.call("swapEnds", e);
735 j = (Boolean) info.swapEnds.exe(e);
760736 arrow_flags(e, sflag, eflag);
761 if ((Boolean) info.call("splineMerge", hn))
737 if ((Boolean) info.splineMerge.exe(hn))
762738 eflag[0] = 0;
763 if ((Boolean) info.call("splineMerge", agtail(fe)))
739 if ((Boolean) info.splineMerge.exe(agtail(fe)))
764740 sflag[0] = 0;
765741 /* swap the two ends */
766742 if (j) {
768744 sflag[0] = eflag[0];
769745 eflag[0] = i;
770746 }
771 if (info.getBoolean("isOrtho")) {
747 if (info.isOrtho) {
772748 UNSUPPORTED("7a3lmojyfh13d6shkviuogx2c"); // if (eflag || sflag)
773749 UNSUPPORTED("dzbrwr2ulubtjkbd8j2o4yyov"); // arrowOrthoClip(e, ps, *startp, *endp, spl, sflag, eflag);
774750 }
790766
791767 //3 q4t1ywnk3wm1vyh5seoj7xye
792768 // void bezier_clip(inside_t * inside_context, boolean(*inside) (inside_t * inside_context, pointf p), pointf * sp, boolean left_inside)
793 public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, __array_of_struct__ sp, boolean left_inside) {
769 public static void bezier_clip(__ptr__ inside_context, __ptr__ inside, ST_pointf.Array sp, boolean left_inside) {
794770 ENTERING("q4t1ywnk3wm1vyh5seoj7xye","bezier_clip");
795771 try {
796 final __array_of_struct__ seg = __array_of_struct_impl__.malloc(pointf.class, 4);
797 final __array_of_struct__ best = __array_of_struct_impl__.malloc(pointf.class, 4);
798 final __struct__<pointf> pt = JUtils.from(pointf.class), opt = JUtils.from(pointf.class);
772 final ST_pointf.Array seg = new ST_pointf.Array( 4);
773 final ST_pointf.Array best = new ST_pointf.Array( 4);
774 final ST_pointf pt = new ST_pointf(), opt = new ST_pointf();
799775 __ptr__ left, right;
800776 final MutableDouble low = new MutableDouble(0), high = new MutableDouble(0);
801777 double t;
804780 int i;
805781 if (left_inside) {
806782 left = null;
807 right = (pointf) seg.asPtr();
783 right = seg.asPtr();
808784 pt.___(sp.plus(0).getStruct());
809785 idir = low;
810786 odir = high;
811787 } else {
812 left = (pointf) seg.asPtr();
788 left = seg.asPtr();
813789 right = null;
814790 pt.___(sp.plus(3).getStruct());
815791 idir = high;
830806 found = NOT(false);
831807 odir.setValue(t);
832808 }
833 } while (ABS(opt.getDouble("x") - pt.getDouble("x")) > .5 || ABS(opt.getDouble("y") - pt.getDouble("y")) > .5);
809 } while (ABS(opt.x - pt.x) > .5 || ABS(opt.y - pt.y) > .5);
834810 if (found)
835811 for (i = 0; i < 4; i++)
836812 sp.plus(i).setStruct(best.plus(i).getStruct());
847823
848824 //3 1fjkj1ydhtlf13pqj5r041orq
849825 // static void shape_clip0(inside_t * inside_context, node_t * n, pointf curve[4], boolean left_inside)
850 public static void shape_clip0(__ptr__ inside_context, Agnode_s n, __ptr__ curve, boolean left_inside) {
826 public static void shape_clip0(__ptr__ inside_context, ST_Agnode_s n, ST_pointf.Array curve, boolean left_inside) {
851827 ENTERING("1fjkj1ydhtlf13pqj5r041orq","shape_clip0");
852828 try {
853829 int i;
854830 double save_real_size;
855 final __array_of_struct__ c = __array_of_struct_impl__.malloc(pointf.class, 4);
831 final ST_pointf.Array c = new ST_pointf.Array( 4);
856832 save_real_size = ND_rw(n);
857833 for (i = 0; i < 4; i++) {
858 c.plus(i).setDouble("x", curve.plus(i).getDouble("x") - ND_coord(n).getDouble("x"));
859 c.plus(i).setDouble("y", curve.plus(i).getDouble("y") - ND_coord(n).getDouble("y"));
860 }
861 bezier_clip(inside_context, ND_shape(n).getPtr("fns").getPtr("insidefn"), c,
834 c.plus(i).setDouble("x", curve.get(i).x - ND_coord(n).x);
835 c.plus(i).setDouble("y", curve.get(i).y - ND_coord(n).y);
836 }
837 bezier_clip(inside_context, ND_shape(n).fns.insidefn, c,
862838 left_inside);
863839 for (i = 0; i < 4; i++) {
864 curve.plus(i).setDouble("x", c.plus(i).getDouble("x") + ND_coord(n).getDouble("x"));
865 curve.plus(i).setDouble("y", c.plus(i).getDouble("y") + ND_coord(n).getDouble("y"));
840 curve.plus(i).setDouble("x", c.get(i).x + ND_coord(n).x);
841 curve.plus(i).setDouble("y", c.get(i).y + ND_coord(n).y);
866842 }
867843 ND_rw(n, save_real_size);
868844 } finally {
902878
903879 //3 bdirexg1qdtophlh0ofjvsmj7
904880 // bezier *new_spline(edge_t * e, int sz)
905 public static bezier new_spline(Agedge_s e, int sz) {
881 public static ST_bezier new_spline(ST_Agedge_s e, int sz) {
906882 ENTERING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
907883 try {
908 bezier rv;
884 ST_bezier rv;
909885 while (ED_edge_type(e) != 0)
910886 e = ED_to_orig(e);
911887 if (ED_spl(e) == null)
912 ED_spl(e, zmalloc(sizeof(splines.class)));
913 ED_spl(e).setPtr("list", ALLOC(ED_spl(e).getInt("size") + 1, ED_spl(e).getPtr("list"), bezier.class));
914 rv = (bezier) ED_spl(e).getPtr("list").plus(ED_spl(e).getInt("size"));
915 ED_spl(e).setInt("size", ED_spl(e).getInt("size")+1);
916 rv.setPtr("list", zmalloc(sizeof(pointf.class, sz)));
888 ED_spl(e, new ST_splines());
889 ED_spl(e).list = ALLOC_ST_bezier(ED_spl(e).size + 1, ED_spl(e).list);
890 rv = (ST_bezier) ED_spl(e).list.plus(ED_spl(e).size).getPtr();
891 ED_spl(e).setInt("size", ED_spl(e).size+1);
892 rv.list = new ST_pointf.Array(sz);
917893 rv.setInt("size", sz);
918894 rv.setInt("sflag", 0);
919895 rv.setInt("eflag", 0);
920 rv.getStruct("sp").setDouble("x", 0);
921 rv.getStruct("sp").setDouble("y", 0);
922 rv.getStruct("ep").setDouble("x", 0);
923 rv.getStruct("ep").setDouble("y", 0);
896 rv.sp.setDouble("x", 0);
897 rv.sp.setDouble("y", 0);
898 rv.ep.setDouble("x", 0);
899 rv.ep.setDouble("y", 0);
924900 return rv;
925901 } finally {
926902 LEAVING("bdirexg1qdtophlh0ofjvsmj7","new_spline");
932908
933909 //3 duednxyuvf6xrff752uuv620f
934910 // void clip_and_install(edge_t * fe, node_t * hn, pointf * ps, int pn, splineInfo * info)
935 public static void clip_and_install(Agedge_s fe, Agnode_s hn, __ptr__ ps, int pn, __ptr__ info) {
911 public static void clip_and_install(ST_Agedge_s fe, ST_Agnode_s hn, ST_pointf.Array ps, int pn, ST_splineInfo info) {
936912 ENTERING("duednxyuvf6xrff752uuv620f","clip_and_install");
937913 try {
938 final __struct__<pointf> p2 = JUtils.from(pointf.class);
939 bezier newspl;
940 Agnode_s tn;
914 final ST_pointf p2 = new ST_pointf();
915 ST_bezier newspl;
916 ST_Agnode_s tn;
941917 int start[] = new int[] {0};
942918 int end[] = new int[] {0};
943919 int i, clipTail=0, clipHead=0;
944 Agraph_s g;
945 Agedge_s orig;
946 boxf tbox=null, hbox=null;
947 final __struct__<inside_t> inside_context = JUtils.from(inside_t.class);
920 ST_Agraph_s g;
921 ST_Agedge_s orig;
922 ST_boxf tbox=null, hbox=null;
923 final ST_inside_t inside_context = new ST_inside_t();
948924 tn = agtail(fe);
949925 g = agraphof(tn);
950926 newspl = new_spline(fe, pn);
951927 for (orig = fe; ED_edge_type(orig) != 0; orig = ED_to_orig(orig));
952928 /* may be a reversed flat edge */
953 if (N(info.getBoolean("ignoreSwap")) && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
954 Agnode_s tmp;
929 if (N(info.ignoreSwap) && (ND_rank(tn) == ND_rank(hn)) && (ND_order(tn) > ND_order(hn))) {
930 ST_Agnode_s tmp;
955931 tmp = hn;
956932 hn = tn;
957933 tn = tmp;
958934 }
959935 if (EQ(tn, agtail(orig))) {
960 clipTail = ED_tail_port(orig).getInt("clip");
961 clipHead = ED_head_port(orig).getInt("clip");
962 tbox = (boxf) ED_tail_port(orig).getPtr("bp");
963 hbox = (boxf) ED_head_port(orig).getPtr("bp");
936 clipTail = ED_tail_port(orig).clip;
937 clipHead = ED_head_port(orig).clip;
938 tbox = (ST_boxf) ED_tail_port(orig).bp;
939 hbox = (ST_boxf) ED_head_port(orig).bp;
964940 }
965941 else { /* fe and orig are reversed */
966 clipTail = ED_head_port(orig).getInt("clip");
967 clipHead = ED_tail_port(orig).getInt("clip");
968 hbox = (boxf) ED_tail_port(orig).getPtr("bp");
969 tbox = (boxf) ED_head_port(orig).getPtr("bp");
942 clipTail = ED_head_port(orig).clip;
943 clipHead = ED_tail_port(orig).clip;
944 hbox = (ST_boxf) ED_tail_port(orig).bp;
945 tbox = (ST_boxf) ED_head_port(orig).bp;
970946 }
971947 /* spline may be interior to node */
972 if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).getPtr("fns").getPtr("insidefn")!=null) {
948 if(clipHead!=0 && ND_shape(tn)!=null && ND_shape(tn).fns.insidefn!=null) {
973949 inside_context.setPtr("s.n", tn);
974950 inside_context.setPtr("s.bp", tbox);
975951 for (start[0] = 0; start[0] < pn - 4; start[0] += 3) {
976 p2.setDouble("x", ps.plus(start[0] + 3).getDouble("x") - ND_coord(tn).getDouble("x"));
977 p2.setDouble("y", ps.plus(start[0] + 3).getDouble("y") - ND_coord(tn).getDouble("y"));
978 if (((Boolean)ND_shape(tn).getPtr("fns").call("insidefn", inside_context.amp(), p2)) == false)
952 p2.setDouble("x", ps.get(start[0] + 3).x - ND_coord(tn).x);
953 p2.setDouble("y", ps.get(start[0] + 3).y - ND_coord(tn).y);
954 if (((Boolean)ND_shape(tn).fns.insidefn.exe(inside_context, p2)) == false)
979955 break;
980956 }
981 shape_clip0(inside_context.amp(), tn, ps.plus(start[0]), NOT(false));
957 shape_clip0(inside_context, tn, ps.plus(start[0]), NOT(false));
982958 } else
983959 start[0] = 0;
984 if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).getPtr("fns").getPtr("insidefn")!=null) {
960 if(clipHead!=0 && ND_shape(hn)!=null && ND_shape(hn).fns.insidefn!=null) {
985961 inside_context.setPtr("s.n", hn);
986962 inside_context.setPtr("s.bp", hbox);
987963 for (end[0] = pn - 4; end[0] > 0; end[0] -= 3) {
988 p2.setDouble("x", ps.plus(end[0]).getDouble("x") - ND_coord(hn).getDouble("x"));
989 p2.setDouble("y", ps.plus(end[0]).getDouble("y") - ND_coord(hn).getDouble("y"));
990 if (((Boolean)ND_shape(hn).getPtr("fns").call("insidefn", inside_context.amp(), p2)) == false)
964 p2.setDouble("x", ps.get(end[0]).x - ND_coord(hn).x);
965 p2.setDouble("y", ps.get(end[0]).y - ND_coord(hn).y);
966 if (((Boolean)ND_shape(hn).fns.insidefn.exe(inside_context, p2)) == false)
991967 break;
992968 }
993 shape_clip0(inside_context.amp(), hn, ps.plus(end[0]), false);
969 shape_clip0(inside_context, hn, ps.plus(end[0]), false);
994970 } else
995971 end[0] = pn - 4;
996972 for (; start[0] < pn - 4; start[0] += 3)
1001977 break;
1002978 arrow_clip(fe, hn, ps, start, end, newspl, info);
1003979 for (i = start[0]; i < end[0] + 4; ) {
1004 final __array_of_struct__ cp = __array_of_struct_impl__.malloc(pointf.class, 4);
1005 newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
980 final ST_pointf.Array cp = new ST_pointf.Array( 4);
981 newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
1006982 cp.plus(0).setStruct(ps.plus(i).getStruct());
1007983 i++;
1008984 if ( i >= end[0] + 4)
1009985 break;
1010 newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
986 newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
1011987 cp.plus(1).setStruct(ps.plus(i).getStruct());
1012988 i++;
1013 newspl.getArrayOfPtr("list").plus(i - start[0]).setStruct(ps.plus(i).getStruct());
989 newspl.list.get(i - start[0]).setStruct(ps.plus(i).getStruct());
1014990 cp.plus(2).setStruct(ps.plus(i).getStruct());
1015991 i++;
1016992 cp.plus(3).setStruct(ps.plus(i).getStruct());
1017 update_bb_bz(GD_bb(g).amp(), cp);
993 update_bb_bz(GD_bb(g), cp);
1018994 }
1019995 newspl.setInt("size", end[0] - start[0] + 4);
1020996 } finally {
10271003
10281004 //3 25ndy15kghfrogsv0b0o0xkgv
10291005 // static double conc_slope(node_t* n)
1030 public static double conc_slope(Agnode_s n) {
1006 public static double conc_slope(ST_Agnode_s n) {
10311007 ENTERING("25ndy15kghfrogsv0b0o0xkgv","conc_slope");
10321008 try {
10331009 UNSUPPORTED("e388y3vtrp8f6spgh9q4wx37w"); // static double
10621038
10631039 //3 egq4f4tmy1dhyj6jpj92r7xhu
10641040 // void add_box(path * P, boxf b)
1065 public static void add_box(path P, final ST_boxf b) {
1041 public static void add_box(ST_path P, final ST_boxf b) {
10661042 // WARNING!! STRUCT
10671043 add_box_w_(P, b.copy());
10681044 }
1069 private static void add_box_w_(path P, final ST_boxf b) {
1045 private static void add_box_w_(ST_path P, final ST_boxf b) {
10701046 ENTERING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
10711047 try {
10721048 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
10731049 {
1074 P.getArrayOfPtr("boxes").plus(P.getInt("nbox")).setStruct(b);
1075 P.setInt("nbox", P.getInt("nbox")+1);
1050 P.boxes[P.nbox].setStruct(b);
1051 P.nbox = P.nbox+1;
10761052 }
10771053 } finally {
10781054 LEAVING("egq4f4tmy1dhyj6jpj92r7xhu","add_box");
10841060
10851061 //3 7pc43ifcw5g56449d101qf590
10861062 // void beginpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
1087 public static void beginpath(path P, Agedge_s e, int et, pathend_t endp, boolean merge) {
1063 public static void beginpath(ST_path P, ST_Agedge_s e, int et, ST_pathend_t endp, boolean merge) {
10881064 ENTERING("7pc43ifcw5g56449d101qf590","beginpath");
10891065 try {
10901066 int side, mask;
1091 Agnode_s n;
1067 ST_Agnode_s n;
10921068 CFunction pboxfn;
10931069 n = agtail(e);
10941070 if (ED_tail_port(e).dyna!=0)
1095 ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e).amp()));
1071 ED_tail_port(e, resolvePort(agtail(e), aghead(e), ED_tail_port(e)));
10961072 if (ND_shape(n)!=null)
1097 pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn");
1073 pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
10981074 else
10991075 pboxfn = null;
1100 P.getStruct("start").setStruct("p", add_pointf(ND_coord(n), ED_tail_port(e).getStruct("p")));
1076 P.start.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_tail_port(e).p));
11011077 if (merge) {
11021078 /*P->start.theta = - M_PI / 2; */
1103 P.getStruct("start").setDouble("theta", conc_slope(agtail(e)));
1104 P.getStruct("start").setBoolean("constrained", NOT(false));
1079 P.start.setDouble("theta", conc_slope(agtail(e)));
1080 P.start.constrained= NOTI(false);
11051081 } else {
1106 if (ED_tail_port(e).getBoolean("constrained")) {
1107 P.getStruct("start").setDouble("theta", ED_tail_port(e).getDouble("theta"));
1108 P.getStruct("start").setBoolean("constrained", NOT(false));
1082 if (ED_tail_port(e).constrained!=0) {
1083 P.start.setDouble("theta", ED_tail_port(e).theta);
1084 P.start.constrained= NOTI(false);
11091085 } else
1110 P.getStruct("start").setBoolean("constrained", false);
1111 }
1112 P.setInt("nbox", 0);
1086 P.start.constrained= 0;
1087 }
1088 P.nbox = 0;
11131089 P.setPtr("data", e);
1114 endp.setStruct("np", P.getStruct("start").getStruct("p"));
1090 endp.setStruct("np", P.start.p);
11151091 if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_tail_port(e).side)!=0)) {
11161092 UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
11171093 UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
12451221 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
12461222 }
12471223 if (et == 1) side = (1<<0);
1248 else side = endp.getInt("sidemask"); /* for flat edges */
1224 else side = endp.sidemask; /* for flat edges */
12491225 if (pboxfn!=null
1250 && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e).amp(), side, endp.getArrayOfStruct("boxes").plus(0).getStruct().amp(), endp.getInt("boxn")))!=0)
1226 && (mask = (Integer) pboxfn.exe(n, ED_tail_port(e), side, endp.boxes[0], endp.boxn))!=0)
12511227 UNSUPPORTED("ex9kjvshm19zbu9vqonk1avd8"); // endp->sidemask = mask;
12521228 else {
1253 endp.getArrayOfStruct("boxes").plus(0).setStruct(endp.getStruct("nb"));
1229 endp.boxes[0].setStruct(endp.nb);
12541230 endp.setInt("boxn", 1);
12551231 switch (et) {
12561232 case 8:
12621238 UNSUPPORTED("auefgwb39x5hzqqc9b1zgl239"); // endp->sidemask = (1<<0);
12631239 break;
12641240 case 2:
1265 if (endp.getInt("sidemask") == (1<<2))
1266 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("start").getStruct("p").getDouble("y");
1241 if (endp.sidemask == (1<<2))
1242 ((ST_boxf)endp.boxes[0]).LL.y = P.start.p.y;
12671243 else
1268 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("start").getStruct("p").getDouble("y");
1244 ((ST_boxf)endp.boxes[0]).UR.y = P.start.p.y;
12691245 break;
12701246 case 1:
1271 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("start").getStruct("p").getDouble("y");
1247 ((ST_boxf)(endp).boxes[0]).UR.y = P.start.p.y;
12721248 endp.setInt("sidemask", (1<<0));
1273 P.getStruct("start").getStruct("p").setDouble("y", P.getStruct("start").getStruct("p").getDouble("y") - 1);
1249 P.start.p.setDouble("y", P.start.p.y - 1);
12741250 break;
12751251 }
12761252 }
12841260
12851261 //3 79dr5om55xs3n5lgai1sf58vu
12861262 // void endpath(path * P, edge_t * e, int et, pathend_t * endp, boolean merge)
1287 public static void endpath(path P, Agedge_s e, int et, pathend_t endp, boolean merge) {
1263 public static void endpath(ST_path P, ST_Agedge_s e, int et, ST_pathend_t endp, boolean merge) {
12881264 ENTERING("79dr5om55xs3n5lgai1sf58vu","endpath");
12891265 try {
12901266 int side, mask;
1291 Agnode_s n;
1267 ST_Agnode_s n;
12921268 CFunction pboxfn;
12931269 n = aghead(e);
1294 if (ED_head_port(e).getBoolean("dyna"))
1270 if (ED_head_port(e).dyna!=0)
12951271 UNSUPPORTED("9brhx94sjudx3jtzrnwa60x8"); // ED_head_port(e) = resolvePort(aghead(e), agtail(e), &ED_head_port(e));
12961272 if (ND_shape(n)!=null)
1297 pboxfn = (CFunction) ND_shape(n).getPtr("fns").getPtr("pboxfn");
1273 pboxfn = (CFunction) ND_shape(n).fns.pboxfn;
12981274 else
12991275 pboxfn = null;
1300 P.getStruct("end").setStruct("p", add_pointf(ND_coord(n), ED_head_port(e).getStruct("p")));
1276 P.end.setStruct("p", add_pointf(ND_coord(n), (ST_pointf) ED_head_port(e).p));
13011277 if (merge) {
13021278 UNSUPPORTED("cproejwusj67kuugolh6tbkwz"); // /*P->end.theta = M_PI / 2; */
13031279 UNSUPPORTED("65vhfvz1d1tub3f85tdsgg2g5"); // P->end.theta = conc_slope(aghead(e)) + M_PI;
13041280 UNSUPPORTED("du4hwt6pjf3bmkvowssm7b0uo"); // assert(P->end.theta < 2 * M_PI);
13051281 UNSUPPORTED("2w0c22i5xgcch77xd9jg104nw"); // P->end.constrained = NOT(0);
13061282 } else {
1307 if (ED_head_port(e).getBoolean("constrained")) {
1308 P.getStruct("end").setDouble("theta", ED_head_port(e).getDouble("theta"));
1309 P.getStruct("end").setInt("constrained", 1);
1283 if (ED_head_port(e).constrained!=0) {
1284 P.end.setDouble("theta", ED_head_port(e).theta);
1285 P.end.setInt("constrained", 1);
13101286 } else
1311 P.getStruct("end").setInt("constrained", 0);
1312 }
1313 endp.setStruct("np", P.getStruct("end").getStruct("p"));
1287 P.end.setInt("constrained", 0);
1288 }
1289 endp.setStruct("np", P.end.p);
13141290 if ((et == 1) && (ND_node_type(n) == 0) && ((side = ED_head_port(e).side)!=0)) {
13151291 UNSUPPORTED("a7lrhlfwr0y475aqjk6abhb3b"); // edge_t* orig;
13161292 UNSUPPORTED("ew7nyfe712nsiphifeztwxfop"); // boxf b0, b = endp->nb;
14451421 UNSUPPORTED("a7fgam0j0jm7bar0mblsv3no4"); // return;
14461422 }
14471423 if (et == 1) side = (1<<2);
1448 else side = endp.getInt("sidemask"); /* for flat edges */
1424 else side = endp.sidemask; /* for flat edges */
14491425 if (pboxfn!=null
1450 && (mask = (Integer) pboxfn.exe(n, ED_head_port(e).amp(), side, endp.getArrayOfStruct("boxes").plus(0).getStruct().amp(), endp.getInt("boxn")))!=0)
1426 && (mask = (Integer) pboxfn.exe(n, ED_head_port(e), side, endp.boxes[0], endp.boxn))!=0)
14511427 endp.setInt("sidemask", mask);
14521428 else {
1453 endp.getArrayOfStruct("boxes").plus(0).setStruct(endp.getStruct("nb"));
1429 endp.boxes[0].setStruct(endp.nb);
14541430 endp.setInt("boxn", 1);
14551431 switch (et) {
14561432 case 8:
14621438 UNSUPPORTED("1r4lctdj9z1ivlz3uqpcj1yzf"); // endp->sidemask = (1<<2);
14631439 UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
14641440 case 2:
1465 if (endp.getInt("sidemask") == (1<<2))
1466 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("end").getStruct("p").getDouble("y");
1441 if (endp.sidemask == (1<<2))
1442 endp.boxes[0].LL.y = P.end.p.y;
14671443 else
1468 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).UR.y = P.getStruct("end").getStruct("p").getDouble("y");
1444 endp.boxes[0].UR.y = P.end.p.y;
14691445 break;
14701446 case 1:
1471 ((ST_boxf)endp.getArrayOfStruct("boxes").plus(0).getStruct()).LL.y = P.getStruct("end").getStruct("p").getDouble("y");
1447 endp.boxes[0].LL.y = P.end.p.y;
14721448 endp.setInt("sidemask", (1<<2));
1473 P.getStruct("end").getStruct("p").setDouble("y", P.getStruct("end").getStruct("p").getDouble("y") +1);
1449 P.end.p.setDouble("y", P.end.p.y +1);
14741450 break;
14751451 }
14761452 }
14851461 //3 3g7alj6eirl5b2hlhluiqvaax
14861462 // static int convert_sides_to_points(int tail_side, int head_side)
14871463 public static int convert_sides_to_points(int tail_side, int head_side) {
1464 ENTERING("3g7alj6eirl5b2hlhluiqvaax","convert_sides_to_points");
14881465 int vertices[] = new int[] {12,4,6,2,3,1,9,8}; //the cumulative side value of each node point
14891466 int i, tail_i, head_i;
14901467 int pair_a[][] = new int[][] { //array of possible node point pairs
14971474 {71,72,73,74,75,76,77,78},
14981475 {81,82,83,84,85,86,87,88}
14991476 };
1500 ENTERING("3g7alj6eirl5b2hlhluiqvaax","convert_sides_to_points");
15011477 try {
15021478 tail_i = head_i = -1;
15031479 for(i=0;i< 8; i++){
17081684
17091685 //3 3sr8gvj4141qql0v12lb89cyt
17101686 // static void selfRight (edge_t* edges[], int ind, int cnt, double stepx, double sizey, splineInfo* sinfo)
1711 public static void selfRight(__ptr__ edges, int ind, int cnt, double stepx, double sizey, splineInfo sinfo) {
1687 public static void selfRight(ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double stepx, double sizey, ST_splineInfo sinfo) {
17121688 ENTERING("3sr8gvj4141qql0v12lb89cyt","selfRight");
17131689 try {
17141690 int i, sgn, point_pair;
17151691 double hx, tx, stepy, dx, dy, width, height;
17161692 final ST_pointf tp = new ST_pointf(), hp = new ST_pointf(), np = new ST_pointf();
1717 Agnode_s n;
1718 Agedge_s e;
1719 final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 1000);
1693 ST_Agnode_s n;
1694 ST_Agedge_s e;
1695 final ST_pointf.Array points = new ST_pointf.Array( 1000);
17201696 int pointn;
1721 e = (Agedge_s) edges.plus(ind).getPtr();
1697 e = (ST_Agedge_s) edges.get(ind);
17221698 n = agtail(e);
17231699 stepy = (sizey / 2.) / cnt;
17241700 stepy = MAX(stepy, 2.);
17251701 pointn = 0;
17261702 np.___(ND_coord(n));
1727 tp.___(ED_tail_port(e).getStruct("p"));
1728 tp.setDouble("x", tp.getDouble("x") + np.getDouble("x"));
1729 tp.setDouble("y", tp.getDouble("y") + np.getDouble("y"));
1730 hp.___(ED_head_port(e).getStruct("p"));
1731 hp.setDouble("x", hp.getDouble("x") + np.getDouble("x"));
1732 hp.setDouble("y", hp.getDouble("y") + np.getDouble("y"));
1733 if (tp.getDouble("y") >= hp.getDouble("y")) sgn = 1;
1703 tp.___(ED_tail_port(e).p);
1704 tp.setDouble("x", tp.x + np.x);
1705 tp.setDouble("y", tp.y + np.y);
1706 hp.___(ED_head_port(e).p);
1707 hp.setDouble("x", hp.x + np.x);
1708 hp.setDouble("y", hp.y + np.y);
1709 if (tp.y >= hp.y) sgn = 1;
17341710 else sgn = -1;
17351711 dx = ND_rw(n);
17361712 dy = 0;
17391715 point_pair = convert_sides_to_points(ED_tail_port(e).side,ED_head_port(e).side);
17401716 switch(point_pair){
17411717 case 32:
1742 case 65: if(tp.getDouble("y") == hp.getDouble("y"))
1718 case 65: if(tp.y == hp.y)
17431719 sgn = -sgn;
17441720 break;
17451721 default:
17461722 break;
17471723 }
1748 tx = MIN(dx, 3*(np.getDouble("x") + dx - tp.getDouble("x")));
1749 hx = MIN(dx, 3*(np.getDouble("x") + dx - hp.getDouble("x")));
1724 tx = MIN(dx, 3*(np.x + dx - tp.x));
1725 hx = MIN(dx, 3*(np.x + dx - hp.x));
17501726 for (i = 0; i < cnt; i++) {
1751 e = (Agedge_s) edges.plus(ind++).getPtr();
1727 e = (ST_Agedge_s) edges.plus(ind++).getPtr();
17521728 dx += stepx; tx += stepx; hx += stepx; dy += sgn*stepy;
17531729 pointn = 0;
17541730 points.plus(pointn++).setStruct(tp);
1755 points.plus(pointn++).setStruct(pointfof(tp.getDouble("x") + tx / 3, tp.getDouble("y") + dy));
1756 points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, tp.getDouble("y") + dy));
1757 points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, (tp.getDouble("y")+hp.getDouble("y"))/2));
1758 points.plus(pointn++).setStruct(pointfof(np.getDouble("x") + dx, hp.getDouble("y") - dy));
1759 points.plus(pointn++).setStruct(pointfof(hp.getDouble("x") + hx / 3, hp.getDouble("y") - dy));
1731 points.plus(pointn++).setStruct(pointfof(tp.x + tx / 3, tp.y + dy));
1732 points.plus(pointn++).setStruct(pointfof(np.x + dx, tp.y + dy));
1733 points.plus(pointn++).setStruct(pointfof(np.x + dx, (tp.y+hp.y)/2));
1734 points.plus(pointn++).setStruct(pointfof(np.x + dx, hp.y - dy));
1735 points.plus(pointn++).setStruct(pointfof(hp.x + hx / 3, hp.y - dy));
17601736 points.plus(pointn++).setStruct(hp);
17611737 if (ED_label(e)!=null) {
17621738 if (GD_flip(agraphof(agtail(e)))!=0) {
1763 width = ED_label(e).getStruct("dimen").getDouble("y");
1764 height = ED_label(e).getStruct("dimen").getDouble("x");
1739 width = ED_label(e).dimen.y;
1740 height = ED_label(e).dimen.x;
17651741 } else {
1766 width = ED_label(e).getStruct("dimen").getDouble("x");
1767 height = ED_label(e).getStruct("dimen").getDouble("y");
1742 width = ED_label(e).dimen.x;
1743 height = ED_label(e).dimen.y;
17681744 }
1769 ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + dx + width / 2.0);
1770 ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y"));
1771 ED_label(e).setBoolean("set", NOT(false));
1745 ED_label(e).pos.setDouble("x", ND_coord(n).x + dx + width / 2.0);
1746 ED_label(e).pos.setDouble("y", ND_coord(n).y);
1747 ED_label(e).set= NOTI(false);
17721748 if (width > stepx)
17731749 dx += width - stepx;
17741750 }
18631839
18641840 //3 678whq05s481ertx02jloteu3
18651841 // int selfRightSpace (edge_t* e)
1866 public static int selfRightSpace(Agedge_s e) {
1842 public static int selfRightSpace(ST_Agedge_s e) {
18671843 ENTERING("678whq05s481ertx02jloteu3","selfRightSpace");
18681844 try {
18691845 int sw=0;
18701846 double label_width;
1871 textlabel_t l = ED_label(e);
1847 ST_textlabel_t l = ED_label(e);
18721848 if ((N(ED_tail_port(e).defined) && N(ED_head_port(e).defined)) ||
18731849 (
18741850 N(ED_tail_port(e).side & (1<<3)) &&
18781854 )) {
18791855 sw = 18;
18801856 if (l!=null) {
1881 label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.getStruct("dimen").getDouble("y") : l.getStruct("dimen").getDouble("x");
1857 label_width = GD_flip(agraphof(aghead(e)))!=0 ? l.dimen.y : l.dimen.x;
18821858 sw += label_width;
18831859 }
18841860 }
18941870
18951871 //3 bt3fwgprixbc5rceeewozdqr9
18961872 // void makeSelfEdge(path * P, edge_t * edges[], int ind, int cnt, double sizex, double sizey, splineInfo * sinfo)
1897 public static void makeSelfEdge(path P, __ptr__ edges, int ind, int cnt, double sizex, double sizey, splineInfo sinfo) {
1873 public static void makeSelfEdge(ST_path P, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, double sizex, double sizey, ST_splineInfo sinfo) {
18981874 ENTERING("bt3fwgprixbc5rceeewozdqr9","makeSelfEdge");
18991875 try {
1900 Agedge_s e;
1901 e = (Agedge_s) edges.plus(ind).getPtr();
1876 ST_Agedge_s e;
1877 e = (ST_Agedge_s) edges.get(ind);
19021878 /* self edge without ports or
19031879 * self edge with all ports inside, on the right, or at most 1 on top
19041880 * and at most 1 on bottom
19641940
19651941 //3 7wyn51o9k6u7joaq9k18boffh
19661942 // static void endPoints(splines * spl, pointf * p, pointf * q)
1967 public static Object endPoints(Object... arg) {
1968 UNSUPPORTED("5r4ewx4i6zia04hwqvonnvcg9"); // static void endPoints(splines * spl, pointf * p, pointf * q)
1969 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1970 UNSUPPORTED("37thdceezsvepe7tlyfatrbcw"); // bezier bz;
1971 UNSUPPORTED("2hacb9fdt2n4mkiveluxkiu2e"); // bz = spl->list[0];
1972 UNSUPPORTED("dtt0q54ov71fji9i2ae24aeyc"); // if (bz.sflag) {
1943 public static void endPoints(ST_splines spl, ST_pointf p, ST_pointf q) {
1944 ENTERING("7wyn51o9k6u7joaq9k18boffh","endPoints");
1945 try {
1946 final ST_bezier bz = new ST_bezier();
1947 bz.____(spl.list.get(0));
1948 if (bz.sflag!=0) {
19731949 UNSUPPORTED("4wazlko0bxmzxoobqacij1btk"); // *p = bz.sp;
1974 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1975 UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
1976 UNSUPPORTED("3gwxodchk1jdid7jbltvxhnaf"); // *p = bz.list[0];
1977 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1978 UNSUPPORTED("6pj4gaguml8ocln5h92kpqk94"); // bz = spl->list[spl->size - 1];
1979 UNSUPPORTED("4o7tep38o3pxavxbzw15khp2r"); // if (bz.eflag) {
1950 }
1951 else {
1952 p.____(bz.list.get(0));
1953 }
1954 bz.____(spl.list.plus(spl.size-1).getPtr());
1955 if (bz.eflag!=0) {
19801956 UNSUPPORTED("78u9nvs8u7rxturidz5nf8hn4"); // *q = bz.ep;
1981 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1982 UNSUPPORTED("1nyzbeonram6636b1w955bypn"); // else {
1983 UNSUPPORTED("3kkyg7t050mn59a1ekp0f0lzj"); // *q = bz.list[bz.size - 1];
1984 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1985 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1986
1987 throw new UnsupportedOperationException();
1957 }
1958 else {
1959 q.____(bz.list.get(bz.size-1));
1960 }
1961 } finally {
1962 LEAVING("7wyn51o9k6u7joaq9k18boffh","endPoints");
1963 }
19881964 }
19891965
19901966
20382014
20392015 //3 8hpmwzlqbj1nii32zubbe9hru
20402016 // pointf edgeMidpoint (graph_t* g, edge_t * e)
2041 public static Object edgeMidpoint(Object... arg) {
2042 UNSUPPORTED("ddgobb6cu0307nl6cc2hm7jak"); // pointf
2043 UNSUPPORTED("8ww957bkesrmzkmuchx2pvhb2"); // edgeMidpoint (graph_t* g, edge_t * e)
2044 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
2045 UNSUPPORTED("cx1drb9eui5nioe70lvmlgm79"); // int et = (GD_flags(g) & (7 << 1));
2046 UNSUPPORTED("2auwjymmiryq94uc6spzynrvi"); // pointf d, spf, p, q;
2047 UNSUPPORTED("bpo1twbinspgdzr5k3fmntxtg"); // endPoints(ED_spl(e), &p, &q);
2048 UNSUPPORTED("4yaabujbmowa3lyxk4205gkpv"); // if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
2017 public static ST_pointf edgeMidpoint(ST_Agraph_s g, ST_Agedge_s e) {
2018 ENTERING("8hpmwzlqbj1nii32zubbe9hru","edgeMidpoint");
2019 try {
2020 return edgeMidpoint_(g, e).copy();
2021 } finally {
2022 LEAVING("8hpmwzlqbj1nii32zubbe9hru","edgeMidpoint");
2023 }
2024 }
2025
2026
2027 private static ST_pointf edgeMidpoint_(ST_Agraph_s g, ST_Agedge_s e) {
2028 int et = (GD_flags(g) & (7 << 1));
2029 final ST_pointf d = new ST_pointf();
2030 final ST_pointf spf = new ST_pointf();
2031 final ST_pointf p = new ST_pointf();
2032 final ST_pointf q = new ST_pointf();
2033 endPoints((ST_splines) ED_spl(e), p, q);
2034 if (APPROXEQPT(p, q, MILLIPOINT)) { /* degenerate spline */
20492035 UNSUPPORTED("7i8m5mpfnv7m9uqxh015zfdaj"); // spf = p;
2050 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
2051 UNSUPPORTED("bpe21xennpxofkh2a8ce70n8r"); // else if ((et == (5 << 1)) || (et == (2 << 1))) {
2052 UNSUPPORTED("6frrlsqvrym5x5bivjwo3rkg4"); // d.x = (q.x + p.x) / 2.;
2053 UNSUPPORTED("5qa6kgh9e0trsgfkiwhzxtc5n"); // d.y = (p.y + q.y) / 2.;
2054 UNSUPPORTED("dn0aho2lzwtnxuk3v45gd81fo"); // spf = dotneato_closest(ED_spl(e), d);
2055 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
2056 UNSUPPORTED("2flg4ooa026ob187pje77te28"); // else { /* ET_PLINE, ET_ORTHO or ET_LINE */
2036 }
2037 else if ((et == (5 << 1)) || (et == (2 << 1))) {
2038 d.x = (q.x + p.x) / 2.;
2039 d.y = (p.y + q.y) / 2.;
2040 spf.___(dotneato_closest((ST_splines)ED_spl(e), d));
2041 }
2042 else { /* ET_PLINE, ET_ORTHO or ET_LINE */
20572043 UNSUPPORTED("6he3hi05vusuthrchn4enk7o6"); // spf = polylineMidpoint (ED_spl(e), &p, &q);
2058 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
2059 UNSUPPORTED("56kh0ww24ygwjntzmm9q6wec3"); // return spf;
2060 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
2061
2062 throw new UnsupportedOperationException();
2044 }
2045 return spf;
20632046 }
20642047
20652048
21412124
21422125 //3 2tbz9tbkzx8os72qiyhgnby67
21432126 // splines *getsplinepoints(edge_t * e)
2144 public static splines getsplinepoints(Agedge_s e) {
2127 public static ST_splines getsplinepoints(ST_Agedge_s e) {
21452128 ENTERING("2tbz9tbkzx8os72qiyhgnby67","getsplinepoints");
21462129 try {
2147 Agedge_s le;
2148 splines sp;
2130 ST_Agedge_s le;
2131 ST_splines sp;
21492132 for (le = e; N(sp = ED_spl(le)) && ED_edge_type(le) != 0;
21502133 le = ED_to_orig(le));
21512134 if (sp == null)
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.GVC_s;
50 import h._dt_s;
51 import h.boxf;
52 import h.pointf;
53 import smetana.core.JUtils;
54 import smetana.core.__ptr__;
55 import smetana.core.__struct__;
49 import h.ST_GVC_s;
50 import h.ST_dt_s;
51 import h.ST_pointf;
52 import h.ST_textspan_t;
5653
5754 public class textspan__c {
5855 //1 9k44uhd5foylaeoekf3llonjq
312309
313310 //3 c1s4k85p1cdfn176o3uryeros
314311 // static inline pointf pointfof(double x, double y)
315 public static __struct__<pointf> pointfof(double x, double y) {
312 public static ST_pointf pointfof(double x, double y) {
316313 // WARNING!! STRUCT
317314 return pointfof_w_(x, y).copy();
318315 }
319 private static __struct__<pointf> pointfof_w_(double x, double y) {
316 private static ST_pointf pointfof_w_(double x, double y) {
320317 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
321318 try {
322 final __struct__<pointf> r = JUtils.from(pointf.class);
319 final ST_pointf r = new ST_pointf();
323320 r.setDouble("x", x);
324321 r.setDouble("y", y);
325322 return r;
348345
349346
350347
351 //3 1vvsta5i8of59frav6uymguav
352 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
353 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
354 // WARNING!! STRUCT
355 return boxfof_w_(llx, lly, urx, ury).copy();
356 }
357 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
358 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
359 try {
360 final __struct__<boxf> b = JUtils.from(boxf.class);
361 b.getStruct("LL").setDouble("x", llx);
362 b.getStruct("LL").setDouble("y", lly);
363 b.getStruct("UR").setDouble("x", urx);
364 b.getStruct("UR").setDouble("y", ury);
365 return b;
366 } finally {
367 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
368 }
369 }
370
371348
372349
373350
390367
391368 //3 arrsbik9b5tnfcbzsm8gr2chx
392369 // static inline pointf add_pointf(pointf p, pointf q)
393 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
370 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
394371 // WARNING!! STRUCT
395372 return add_pointf_w_(p.copy(), q.copy()).copy();
396373 }
397 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
374 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
398375 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
399376 try {
400 final __struct__<pointf> r = JUtils.from(pointf.class);
401 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
402 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
377 final ST_pointf r = new ST_pointf();
378 r.setDouble("x", p.x + q.x);
379 r.setDouble("y", p.y + q.y);
403380 return r;
404381 } finally {
405382 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
795772
796773 //3 n8tcl06mifdn779rzenam44z
797774 // pointf textspan_size(GVC_t *gvc, textspan_t * span)
798 public static __struct__<pointf> textspan_size(GVC_s gvc, __ptr__ span) {
775 public static ST_pointf textspan_size(ST_GVC_s gvc, ST_textspan_t span) {
799776 // WARNING!! STRUCT
800777 return textspan_size_w_(gvc, span).copy();
801778 }
802 private static __struct__<pointf> textspan_size_w_(GVC_s gvc, __ptr__ span) {
779 private static ST_pointf textspan_size_w_(ST_GVC_s gvc, ST_textspan_t span) {
803780 ENTERING("n8tcl06mifdn779rzenam44z","textspan_size");
804781 try {
805782 System.err.println("Warning:textspan_size "+span);
806 span.getStruct("size").setDouble("x", 30);
807 span.getStruct("size").setDouble("y", 20);
808 return span.getStruct("size").copy();
783 span.size.setDouble("x", 30);
784 span.size.setDouble("y", 20);
785 return span.size.copy();
809786 } finally {
810787 LEAVING("n8tcl06mifdn779rzenam44z","textspan_size");
811788 }
888865
889866 //3 9mfrgcpzz2d9f7nxfgx4nxj2q
890867 // Dt_t * textfont_dict_open(GVC_t *gvc)
891 public static _dt_s textfont_dict_open(GVC_s gvc) {
868 public static ST_dt_s textfont_dict_open(ST_GVC_s gvc) {
892869 ENTERING("9mfrgcpzz2d9f7nxfgx4nxj2q","textfont_dict_open");
893870 try {
894871 return null;
5050 import static gen.lib.cgraph.obj__c.agraphof;
5151 import static gen.lib.cgraph.refstr__c.aghtmlstr;
5252 import static gen.lib.common.labels__c.make_label;
53 import static gen.lib.common.memory__c.zmalloc;
5453 import static gen.lib.common.shapes__c.bind_shape;
5554 import static gen.lib.common.shapes__c.shapeOf;
5655 import static smetana.core.JUtils.EQ;
5958 import static smetana.core.JUtils.atoi;
6059 import static smetana.core.JUtils.enumAsInt;
6160 import static smetana.core.JUtils.isdigit;
62 import static smetana.core.JUtils.sizeof;
6361 import static smetana.core.JUtils.strchr;
6462 import static smetana.core.JUtils.strcmp;
6563 import static smetana.core.JUtils.strtod;
6765 import static smetana.core.JUtils.tolower;
6866 import static smetana.core.JUtilsDebug.ENTERING;
6967 import static smetana.core.JUtilsDebug.LEAVING;
68 import static smetana.core.Macro.DIST2;
7069 import static smetana.core.Macro.ED_head_label;
7170 import static smetana.core.Macro.ED_head_port;
7271 import static smetana.core.Macro.ED_label;
7372 import static smetana.core.Macro.ED_label_ontop;
73 import static smetana.core.Macro.ED_tail_label;
7474 import static smetana.core.Macro.ED_tail_port;
7575 import static smetana.core.Macro.GD_bb;
7676 import static smetana.core.Macro.GD_flags;
9090 import static smetana.core.Macro.ND_showboxes;
9191 import static smetana.core.Macro.ND_width;
9292 import static smetana.core.Macro.UNSUPPORTED;
93 import h.Agedge_s;
94 import h.Agnode_s;
95 import h.Agraph_s;
96 import h.Agsym_s;
93 import static smetana.core.Macro.fabs;
94 import h.ST_Agedge_s;
95 import h.ST_Agnode_s;
96 import h.ST_Agraph_s;
9797 import h.ST_Agsym_s;
98 import h.ST_bezier;
9899 import h.ST_boxf;
100 import h.ST_fontinfo;
101 import h.ST_nodequeue;
102 import h.ST_pointf;
99103 import h.ST_port;
100 import h.boxf;
101 import h.fontinfo;
102 import h.nodequeue;
103 import h.pointf;
104 import h.port;
104 import h.ST_splines;
105 import h.ST_textlabel_t;
105106 import h.shape_kind;
106 import h.textlabel_t;
107107 import smetana.core.CFunction;
108108 import smetana.core.CString;
109 import smetana.core.JUtils;
110109 import smetana.core.Memory;
111110 import smetana.core.Z;
112 import smetana.core.__array_of_struct__;
113 import smetana.core.__array_of_struct_impl__;
114111 import smetana.core.__ptr__;
115 import smetana.core.__struct__;
116112
117113 public class utils__c {
118114 //1 2digov3edok6d5srhgtlmrycs
372368
373369 //3 c1s4k85p1cdfn176o3uryeros
374370 // static inline pointf pointfof(double x, double y)
375 public static __struct__<pointf> pointfof(double x, double y) {
371 public static ST_pointf pointfof(double x, double y) {
376372 // WARNING!! STRUCT
377373 return pointfof_w_(x, y).copy();
378374 }
379 private static __struct__<pointf> pointfof_w_(double x, double y) {
375 private static ST_pointf pointfof_w_(double x, double y) {
380376 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
381377 try {
382 final __struct__<pointf> r = JUtils.from(pointf.class);
378 final ST_pointf r = new ST_pointf();
383379 r.setDouble("x", x);
384380 r.setDouble("y", y);
385381 return r;
408404
409405
410406
411 //3 1vvsta5i8of59frav6uymguav
412 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
413 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
414 // WARNING!! STRUCT
415 return boxfof_w_(llx, lly, urx, ury).copy();
416 }
417 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
418 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
419 try {
420 final __struct__<boxf> b = JUtils.from(boxf.class);
421 b.getStruct("LL").setDouble("x", llx);
422 b.getStruct("LL").setDouble("y", lly);
423 b.getStruct("UR").setDouble("x", urx);
424 b.getStruct("UR").setDouble("y", ury);
425 return b;
426 } finally {
427 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
428 }
429 }
430407
431408
432409
450427
451428 //3 arrsbik9b5tnfcbzsm8gr2chx
452429 // static inline pointf add_pointf(pointf p, pointf q)
453 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
430 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
454431 // WARNING!! STRUCT
455432 return add_pointf_w_(p.copy(), q.copy()).copy();
456433 }
457 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
434 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
458435 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
459436 try {
460 final __struct__<pointf> r = JUtils.from(pointf.class);
461 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
462 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
437 final ST_pointf r = new ST_pointf();
438 r.setDouble("x", p.x + q.x);
439 r.setDouble("y", p.y + q.y);
463440 return r;
464441 } finally {
465442 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
756733
757734 //3 c7cptalfn8k75wyfirbnptnav
758735 // nodequeue *new_queue(int sz)
759 public static nodequeue new_queue(int sz) {
736 public static ST_nodequeue new_queue(int sz) {
760737 ENTERING("c7cptalfn8k75wyfirbnptnav","new_queue");
761738 try {
762 nodequeue q = (nodequeue)zmalloc(sizeof(nodequeue.class));
739 ST_nodequeue q = new ST_nodequeue();
763740 if (sz <= 1)
764741 sz = 2;
765 final __ptr__ tmp__ = zmalloc(sizeof(Agnode_s.class, sz));
742 final ST_Agnode_s.ArrayOfStar tmp__ = new ST_Agnode_s.ArrayOfStar(sz);
766743 q.setPtr("store", tmp__);
767744 q.setPtr("tail", tmp__);
768745 q.setPtr("head", tmp__);
778755
779756 //3 1uj5nmdvwmuklnpd3v5py547f
780757 // void free_queue(nodequeue * q)
781 public static void free_queue(nodequeue q) {
758 public static void free_queue(ST_nodequeue q) {
782759 ENTERING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
783760 try {
784 Memory.free(q.getPtr("store"));
761 Memory.free(q.store);
785762 Memory.free(q);
786763 } finally {
787764 LEAVING("1uj5nmdvwmuklnpd3v5py547f","free_queue");
793770
794771 //3 20pwd6i141q3o25lfvrdqytot
795772 // void enqueue(nodequeue * q, node_t * n)
796 public static void enqueue(nodequeue q, Agnode_s n) {
773 public static void enqueue(ST_nodequeue q, ST_Agnode_s n) {
797774 ENTERING("20pwd6i141q3o25lfvrdqytot","enqueue");
798775 try {
799 q.getArrayOfPtr("tail").plus(0).setPtr(n);
800 q.setPtr("tail", q.getPtr("tail").plus(1));
801 if (q.getPtr("tail").comparePointer(q.getPtr("limit")) >= 0)
802 q.setPtr("tail", q.getPtr("store"));
776 q.tail.plus(0).setPtr(n);
777 q.setPtr("tail", q.tail.plus(1));
778 if (q.tail.comparePointer(q.limit) >= 0)
779 q.setPtr("tail", q.store);
803780 } finally {
804781 LEAVING("20pwd6i141q3o25lfvrdqytot","enqueue");
805782 }
810787
811788 //3 b612nmtf16au96ztbs8pike9r
812789 // node_t *dequeue(nodequeue * q)
813 public static Agnode_s dequeue(nodequeue q) {
790 public static ST_Agnode_s dequeue(ST_nodequeue q) {
814791 ENTERING("b612nmtf16au96ztbs8pike9r","dequeue");
815792 try {
816 Agnode_s n;
817 if (EQ(q.getPtr("head"), q.getPtr("tail")))
793 ST_Agnode_s n;
794 if (EQ(q.head, q.tail))
818795 n = null;
819796 else {
820 n = (Agnode_s) q.getArrayOfPtr("head").plus(0).getPtr();
821 q.setPtr("head", q.getPtr("head").plus(1));
822 if (q.getPtr("head").comparePointer(q.getPtr("limit")) >= 0)
823 q.setPtr("head", q.getPtr("store"));
797 n = (ST_Agnode_s) q.head.get(0);
798 q.setPtr("head", q.head.plus(1));
799 if (q.head.comparePointer(q.limit) >= 0)
800 q.setPtr("head", q.store);
824801 }
825802 return n;
826803 } finally {
833810
834811 //3 6nydxv4f2m7jcfh8ljs0neu0x
835812 // int late_int(void *obj, attrsym_t * attr, int def, int low)
836 public static int late_int(__ptr__ obj, Agsym_s attr, int def, int low) {
813 public static int late_int(__ptr__ obj, ST_Agsym_s attr, int def, int low) {
837814 ENTERING("6nydxv4f2m7jcfh8ljs0neu0x","late_int");
838815 try {
839816 CString p;
858835
859836 //3 d68314e4f20r79tt0cnmxugme
860837 // double late_double(void *obj, attrsym_t * attr, double def, double low)
861 public static double late_double(__ptr__ obj, Agsym_s attr, double def, double low) {
838 public static double late_double(__ptr__ obj, ST_Agsym_s attr, double def, double low) {
862839 ENTERING("d68314e4f20r79tt0cnmxugme","late_double");
863840 try {
864841 CString p;
901878
902879 //3 83xm6yc9q5h1bzufhsnv0v2up
903880 // char *late_string(void *obj, attrsym_t * attr, char *def)
904 public static CString late_string(__ptr__ obj, Agsym_s attr, CString def) {
881 public static CString late_string(__ptr__ obj, ST_Agsym_s attr, CString def) {
905882 ENTERING("83xm6yc9q5h1bzufhsnv0v2up","late_string");
906883 try {
907884 if (N(attr) || N(obj))
917894
918895 //3 8oon4q1mrublaru177xfntqgd
919896 // char *late_nnstring(void *obj, attrsym_t * attr, char *def)
920 public static CString late_nnstring(__ptr__ obj, Agsym_s attr, CString def) {
897 public static CString late_nnstring(__ptr__ obj, ST_Agsym_s attr, CString def) {
921898 ENTERING("8oon4q1mrublaru177xfntqgd","late_nnstring");
922899 try {
923900 CString rv = late_string(obj, attr, def);
934911
935912 //3 87ifze04q7qzigjj1fb9y9by2
936913 // boolean late_bool(void *obj, attrsym_t * attr, int def)
937 public static boolean late_bool(__ptr__ obj, Agsym_s attr, int def) {
914 public static boolean late_bool(__ptr__ obj, ST_Agsym_s attr, int def) {
915 ENTERING("87ifze04q7qzigjj1fb9y9by2","late_bool");
916 try {
938917 if (attr == null)
939918 return def!=0;
940919 UNSUPPORTED("a0kh1y5n8u59z0xo7mag3zmt6"); // return mapbool(agxget(obj, attr));
941920 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
942921
943922 throw new UnsupportedOperationException();
923 } finally {
924 LEAVING("87ifze04q7qzigjj1fb9y9by2","late_bool");
925 }
944926 }
945927
946928
948930
949931 //3 aeq0acpkhfv3gd5jx8op4jf18
950932 // node_t *UF_find(node_t * n)
951 public static Agnode_s UF_find(Agnode_s n) {
933 public static ST_Agnode_s UF_find(ST_Agnode_s n) {
952934 ENTERING("aeq0acpkhfv3gd5jx8op4jf18","UF_find");
953935 try {
954936 while (ND_UF_parent(n)!=null && NEQ(ND_UF_parent(n), n)) {
967949
968950 //3 9ldxwfr4vvijrvfcvs1hvdzrt
969951 // node_t *UF_union(node_t * u, node_t * v)
970 public static Agnode_s UF_union(Agnode_s u, Agnode_s v) {
952 public static ST_Agnode_s UF_union(ST_Agnode_s u, ST_Agnode_s v) {
971953 ENTERING("9ldxwfr4vvijrvfcvs1hvdzrt","UF_union");
972954 try {
973955 if (EQ(u, v))
1017999
10181000 //3 22k0u1imxyw06k9rizqlfz153
10191001 // void UF_singleton(node_t * u)
1020 public static void UF_singleton(Agnode_s u) {
1002 public static void UF_singleton(ST_Agnode_s u) {
10211003 ENTERING("22k0u1imxyw06k9rizqlfz153","UF_singleton");
10221004 try {
10231005 ND_UF_size(u, 1);
10331015
10341016 //3 e0fn8xuzkdt0q8xoofl6j1txb
10351017 // void UF_setname(node_t * u, node_t * v)
1036 public static void UF_setname(Agnode_s u, Agnode_s v) {
1018 public static void UF_setname(ST_Agnode_s u, ST_Agnode_s v) {
10371019 ENTERING("e0fn8xuzkdt0q8xoofl6j1txb","UF_setname");
10381020 try {
10391021 assert(EQ(u, UF_find(u)));
10661048
10671049 //3 6p0ey2c2ujk2o7h221p0b4xon
10681050 // pointf Bezier(pointf * V, int degree, double t, pointf * Left, pointf * Right)
1069 public static __struct__<pointf> Bezier(__array_of_struct__ V, int degree, double t, __ptr__ Left, __ptr__ Right) {
1051 public static ST_pointf Bezier(final ST_pointf.Array V, int degree, double t, __ptr__ Left, __ptr__ Right) {
10701052 // WARNING!! STRUCT
10711053 return Bezier_w_(V, degree, t, Left, Right).copy();
10721054 }
1073 private static __struct__<pointf> Bezier_w_(__array_of_struct__ V, int degree, double t, __ptr__ Left, __ptr__ Right) {
1055 private static ST_pointf Bezier_w_(final ST_pointf.Array V, int degree, double t, __ptr__ Left, __ptr__ Right) {
10741056 ENTERING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
10751057 try {
10761058 int i, j; /* Index variables */
1077 final __array_of_struct__ Vtemp[] = new __array_of_struct__[] { __array_of_struct_impl__.malloc(pointf.class, 5+1),
1078 __array_of_struct_impl__.malloc(pointf.class, 5+1),
1079 __array_of_struct_impl__.malloc(pointf.class, 5+1),
1080 __array_of_struct_impl__.malloc(pointf.class, 5+1),
1081 __array_of_struct_impl__.malloc(pointf.class, 5+1),
1082 __array_of_struct_impl__.malloc(pointf.class, 5+1) };
1059 final ST_pointf.Array Vtemp[] = new ST_pointf.Array[] { new ST_pointf.Array( 5+1),
1060 new ST_pointf.Array( 5+1),
1061 new ST_pointf.Array( 5+1),
1062 new ST_pointf.Array( 5+1),
1063 new ST_pointf.Array( 5+1),
1064 new ST_pointf.Array( 5+1) };
10831065 /* Copy control points */
10841066 for (j = 0; j <= degree; j++) {
10851067 Vtemp[0].plus(j).setStruct(V.plus(j).getStruct());
10881070 for (i = 1; i <= degree; i++) {
10891071 for (j = 0; j <= degree - i; j++) {
10901072 Vtemp[i].plus(j).setDouble("x",
1091 (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("x") + t * Vtemp[i - 1].plus(j + 1).getDouble("x"));
1073 (1.0 - t) * Vtemp[i - 1].get(j).x + t * Vtemp[i - 1].get(j + 1).x);
10921074 Vtemp[i].plus(j).setDouble("y",
1093 (1.0 - t) * Vtemp[i - 1].plus(j).getDouble("y") + t * Vtemp[i - 1].plus(j + 1).getDouble("y"));
1075 (1.0 - t) * Vtemp[i - 1].get(j).y + t * Vtemp[i - 1].get(j + 1).y);
10941076 }
10951077 }
10961078 if (Left != null)
10991081 if (Right != null)
11001082 for (j = 0; j <= degree; j++)
11011083 Right.plus(j).setStruct(Vtemp[degree - j].plus(j).getStruct());
1102 return (Vtemp[degree].plus(0).getStruct());
1084 return (ST_pointf) (Vtemp[degree].plus(0).getStruct());
11031085 } finally {
11041086 LEAVING("6p0ey2c2ujk2o7h221p0b4xon","Bezier");
11051087 }
11921174
11931175
11941176
1195 //3 3xll2b0v9nthwvx9dafq49t8s
1196 // const char *safefile(const char *filename)
11971177 //static boolean onetime = (!(0));
11981178 //static char *pathlist = (void *)0;
11991179 //static int maxdirlen;
12001180 //static char** dirs;
1181 //3 3xll2b0v9nthwvx9dafq49t8s
1182 // const char *safefile(const char *filename)
12011183 public static CString safefile(CString filename) {
12021184 ENTERING("3xll2b0v9nthwvx9dafq49t8s","safefile");
12031185 try {
12721254
12731255 //3 37hgj44s94wf9bmz16he85pgq
12741256 // pointf dotneato_closest(splines * spl, pointf pt)
1275 public static Object dotneato_closest(Object... arg) {
1276 UNSUPPORTED("6xi9wmswic1fv76qsqa100zrg"); // pointf dotneato_closest(splines * spl, pointf pt)
1277 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
1278 UNSUPPORTED("7vg6345lno41yawbke5qjffjx"); // int i, j, k, besti, bestj;
1279 UNSUPPORTED("7tvhpuiv2bp57tuo5a1qrptwi"); // double bestdist2, d2, dlow2, dhigh2; /* squares of distances */
1280 UNSUPPORTED("52bzzd12n2awux2b59j2jqh8x"); // double low, high, t;
1281 UNSUPPORTED("1ciwu1ibmcvutr9d4mbq8jjp"); // pointf c[4], pt2;
1282 UNSUPPORTED("37thdceezsvepe7tlyfatrbcw"); // bezier bz;
1283 UNSUPPORTED("cv0cmfkdyov0ifz46uknfgwaa"); // besti = bestj = -1;
1284 UNSUPPORTED("988ajfgcb4de6sx2d5un10g4x"); // bestdist2 = 1e+38;
1285 UNSUPPORTED("4z4l1zu33m72iirxmuhdg36iw"); // for (i = 0; i < spl->size; i++) {
1286 UNSUPPORTED("ewoeh3d6otc2rgpaxuzwm38x7"); // bz = spl->list[i];
1287 UNSUPPORTED("bdak7kaqfdpo7zuzg9fm7b6sw"); // for (j = 0; j < bz.size; j++) {
1288 UNSUPPORTED("wdh4m8cw4why11o5q87r88zj"); // pointf b;
1289 UNSUPPORTED("3tf1mdorgslv29e6azr3rzonw"); // b.x = bz.list[j].x;
1290 UNSUPPORTED("dxmmss8xn49bbq09iskmvgo1a"); // b.y = bz.list[j].y;
1291 UNSUPPORTED("d0o8y6vs1vm9qcfq5oyn2zmb5"); // d2 = DIST2(b, pt);
1292 UNSUPPORTED("5x61wak384zfu9waxz4iib38j"); // if ((bestj == -1) || (d2 < bestdist2)) {
1293 UNSUPPORTED("cmhf0aasa4t5z81xkhjsih2h3"); // besti = i;
1294 UNSUPPORTED("en6tmpmufawtaviu8s9gbiir5"); // bestj = j;
1295 UNSUPPORTED("aqecj956cthm5r94jj461cz7"); // bestdist2 = d2;
1296 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
1297 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1298 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1299 UNSUPPORTED("4o4fen9osijkuva0tyij06dff"); // bz = spl->list[besti];
1300 UNSUPPORTED("cylnfbfm0pqu1um785gk5ox0m"); // /* Pick best Bezier. If bestj is the last point in the B-spline, decrement.
1301 UNSUPPORTED("84b6e5g3wx9iisglwjcp5lno1"); // * Then set j to be the first point in the corresponding Bezier by dividing
1302 UNSUPPORTED("57jzmu3ed1g4aa00hivvreb3c"); // * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc.
1303 UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
1304 UNSUPPORTED("2oqk9suiq102615kp2p6u9pbc"); // if (bestj == bz.size-1)
1305 UNSUPPORTED("b8unnlnu1bnnhbs85vgllqltd"); // bestj--;
1306 UNSUPPORTED("34l7vean6sci8jd61jcga5t9j"); // j = 3*(bestj / 3);
1307 UNSUPPORTED("634ul430au56jfgnuq945ecev"); // for (k = 0; k < 4; k++) {
1308 UNSUPPORTED("emeum5x5u6s5wlj9pg5e18mge"); // c[k].x = bz.list[j + k].x;
1309 UNSUPPORTED("6fqdkdgvc0jr8pgud3rpf5blk"); // c[k].y = bz.list[j + k].y;
1310 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
1311 UNSUPPORTED("13ldc3scyuiddbvqn7xeazovv"); // low = 0.0;
1312 UNSUPPORTED("5diyw4rai5ul7vmjhf654bvc0"); // high = 1.0;
1313 UNSUPPORTED("v90htrjkydw3zaf6t3apnl32"); // dlow2 = DIST2(c[0], pt);
1314 UNSUPPORTED("5fvcsu2wp47fo7crx2ob0h44u"); // dhigh2 = DIST2(c[3], pt);
1315 UNSUPPORTED("53kc41p479auwcycfsbhw8xix"); // do {
1316 UNSUPPORTED("14iyya2zn31kcyo2gqfx6u181"); // t = (low + high) / 2.0;
1317 UNSUPPORTED("5rti9akx01gql0rz4afihqg0q"); // pt2 = Bezier(c, 3, t, (void *)0, (void *)0);
1318 UNSUPPORTED("1mco76xn6x54y3tzfvzeptejl"); // if (fabs(dlow2 - dhigh2) < 1.0)
1319 UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
1320 UNSUPPORTED("aaurmb2ppl2kefmdaw9njymyt"); // if (fabs(high - low) < .00001)
1321 UNSUPPORTED("ai3czg6gaaxspsmndknpyvuiu"); // break;
1257 public static ST_pointf dotneato_closest(ST_splines spl, final ST_pointf pt) {
1258 ENTERING("37hgj44s94wf9bmz16he85pgq","dotneato_closest");
1259 try {
1260 return (ST_pointf) dotneato_closest_ (spl, (ST_pointf) pt.copy()).copy();
1261 } finally {
1262 LEAVING("37hgj44s94wf9bmz16he85pgq","dotneato_closest");
1263 }
1264 }
1265 private static ST_pointf dotneato_closest_(ST_splines spl, final ST_pointf pt) {
1266 int i, j, k, besti, bestj;
1267 double bestdist2, d2, dlow2, dhigh2; /* squares of distances */
1268 double low, high, t;
1269 // final ST_pointf c[] = new ST_pointf[] {new ST_pointf(),new ST_pointf(),new ST_pointf(),new ST_pointf()};
1270 final ST_pointf.Array c = new ST_pointf.Array( 4);
1271 final ST_pointf pt2 = new ST_pointf();
1272 final ST_bezier bz = new ST_bezier();
1273 besti = bestj = -1;
1274 bestdist2 = 1e+38;
1275 for (i = 0; i < spl.size; i++) {
1276 bz.____(spl.list.get(i));
1277 for (j = 0; j < bz.size; j++) {
1278 final ST_pointf b = new ST_pointf();
1279 b.x = bz.list.get(j).x;
1280 b.y = bz.list.get(j).y;
1281 d2 = DIST2(b, pt);
1282 if ((bestj == -1) || (d2 < bestdist2)) {
1283 besti = i;
1284 bestj = j;
1285 bestdist2 = d2;
1286 }
1287 }
1288 }
1289 bz.____(spl.list.get(besti));
1290 /* Pick best Bezier. If bestj is the last point in the B-spline, decrement.
1291 * Then set j to be the first point in the corresponding Bezier by dividing
1292 * then multiplying be 3. Thus, 0,1,2 => 0; 3,4,5 => 3, etc.
1293 */
1294 if (bestj == bz.size-1)
1295 bestj--;
1296 j = 3*(bestj / 3);
1297 for (k = 0; k < 4; k++) {
1298 c.plus(k).setDouble("x", bz.list.get(j + k).x);
1299 c.plus(k).setDouble("y", bz.list.get(j + k).y);
1300 }
1301 low = 0.0;
1302 high = 1.0;
1303 dlow2 = DIST2(c.get(0), pt);
1304 dhigh2 = DIST2(c.get(3), pt);
1305 do {
1306 t = (low + high) / 2.0;
1307 pt2.___(Bezier(c, 3, t, null, null));
1308 if (fabs(dlow2 - dhigh2) < 1.0)
1309 break;
1310 if (fabs(high - low) < .00001)
1311 break;
13221312 UNSUPPORTED("6apa9aoby9j8a0eanbfhy5mn2"); // if (dlow2 < dhigh2) {
13231313 UNSUPPORTED("6jttyuryfaxa193mme86dqf58"); // high = t;
13241314 UNSUPPORTED("6avwplrum9i9qi3g9wl6yvz04"); // dhigh2 = DIST2(pt2, pt);
13261316 UNSUPPORTED("556vs5i22602clhs1p3htz7vk"); // low = t;
13271317 UNSUPPORTED("507tgq81szei2ge3miiak4b1v"); // dlow2 = DIST2(pt2, pt);
13281318 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
1329 UNSUPPORTED("bisaeb1i484iutawysrspjmfw"); // } while (1);
1330 UNSUPPORTED("9v7upfp8kp93skdlnpaz055xv"); // return pt2;
1331 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
1332
1333 throw new UnsupportedOperationException();
1319 } while (true);
1320 return pt2;
13341321 }
13351322
13361323
14491436
14501437 //3 cr81drt18h5feqzxyh3jb0u49
14511438 // void common_init_node(node_t * n)
1452 public static void common_init_node(Agnode_s n) {
1439 public static void common_init_node(ST_Agnode_s n) {
14531440 ENTERING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
14541441 try {
1455 fontinfo fi = (fontinfo) Memory.malloc(fontinfo.class);
1442 ST_fontinfo fi = new ST_fontinfo();
14561443 CString str;
14571444 ND_width(n,
14581445 late_double(n, Z.z().N_width, 0.75, 0.01));
14661453 fi.setPtr("fontcolor", late_nnstring(n, Z.z().N_fontcolor, new CString("black")));
14671454 ND_label(n, make_label(n, str,
14681455 ((aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)) | ( (shapeOf(n) == enumAsInt(shape_kind.class, "SH_RECORD")) ? (2 << 1) : (0 << 1))),
1469 fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
1456 fi.fontsize, fi.fontname, fi.fontcolor));
14701457 if (Z.z().N_xlabel!=null && (str = agxget(n, Z.z().N_xlabel))!=null && (str.charAt(0)!='\0')) {
14711458 UNSUPPORTED("4ua9vld76wpovsm1celv2ff6e"); // ND_xlabel(n) = make_label((void*)n, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
14721459 UNSUPPORTED("b0zm6fkpjlt9jacykbgugjodg"); // fi.fontsize, fi.fontname, fi.fontcolor);
14731460 UNSUPPORTED("ail0d4qmxj2aqh2q721inwgqu"); // GD_has_labels(agraphof(n)) |= (1 << 4);
14741461 }
14751462 ND_showboxes(n, late_int(n, Z.z().N_showboxes, 0, 0));
1476 ND_shape(n).getPtr("fns").call("initfn", n);
1463 ND_shape(n).fns.initfn.exe(n);
14771464 } finally {
14781465 LEAVING("cr81drt18h5feqzxyh3jb0u49","common_init_node");
14791466 }
14841471
14851472 //3 d2v8l80y27ue2fag5c0qplah8
14861473 // static void initFontEdgeAttr(edge_t * e, struct fontinfo *fi)
1487 public static void initFontEdgeAttr(Agedge_s e, fontinfo fi) {
1474 public static void initFontEdgeAttr(ST_Agedge_s e, ST_fontinfo fi) {
14881475 ENTERING("d2v8l80y27ue2fag5c0qplah8","initFontEdgeAttr");
14891476 try {
14901477 fi.setDouble("fontsize", late_double(e, Z.z().E_fontsize, 14.0, 1.0));
15001487
15011488 //3 ak3pxrdrq900wymudwnjmbito
15021489 // static void initFontLabelEdgeAttr(edge_t * e, struct fontinfo *fi, struct fontinfo *lfi)
1503 public static void initFontLabelEdgeAttr(Agedge_s e, fontinfo fi, fontinfo lfi) {
1490 public static void initFontLabelEdgeAttr(ST_Agedge_s e, ST_fontinfo fi, ST_fontinfo lfi) {
15041491 ENTERING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
15051492 try {
1506 if (N(fi.getPtr("fontname"))) initFontEdgeAttr(e, fi);
1507 lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.getDouble("fontsize"), 1.0));
1508 lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.getCString("fontname")));
1509 lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.getCString("fontcolor")));
1493 if (N(fi.fontname)) initFontEdgeAttr(e, fi);
1494 lfi.setDouble("fontsize", late_double(e, Z.z().E_labelfontsize, fi.fontsize, 1.0));
1495 lfi.setPtr("fontname", late_nnstring(e, Z.z().E_labelfontname, fi.fontname));
1496 lfi.setPtr("fontcolor", late_nnstring(e, Z.z().E_labelfontcolor, fi.fontcolor));
15101497 } finally {
15111498 LEAVING("ak3pxrdrq900wymudwnjmbito","initFontLabelEdgeAttr");
15121499 }
15171504
15181505 //3 bgnk1zwht9rwx6thmly98iofb
15191506 // static boolean noClip(edge_t *e, attrsym_t* sym)
1520 public static boolean noClip(Agedge_s e, Agsym_s sym) {
1507 public static boolean noClip(ST_Agedge_s e, ST_Agsym_s sym) {
15211508 ENTERING("bgnk1zwht9rwx6thmly98iofb","noClip");
15221509 try {
15231510 CString str;
15381525
15391526 //3 9vnr1bc7p533acazoxbhbfmx3
15401527 // static port chkPort (port (*pf)(node_t*, char*, char*), node_t* n, char* s)
1541 public static ST_port chkPort(CFunction pf, Agnode_s n, CString s) {
1528 public static ST_port chkPort(CFunction pf, ST_Agnode_s n, CString s) {
15421529 // WARNING!! STRUCT
15431530 return chkPort_w_(pf, n, s).copy();
15441531 }
1545 private static ST_port chkPort_w_(CFunction pf, Agnode_s n, CString s) {
1532 private static ST_port chkPort_w_(CFunction pf, ST_Agnode_s n, CString s) {
15461533 ENTERING("9vnr1bc7p533acazoxbhbfmx3","chkPort");
15471534 try {
15481535 final ST_port pt = new ST_port();
15561543 UNSUPPORTED("2o9oidtrr5gspl1dh6vnz7mlz"); // pt.name = cp+1;
15571544 }
15581545 else
1559 pt.___((__struct__<port>) pf.exe(n, s, null));
1546 pt.___((ST_port) pf.exe(n, s, null));
15601547 pt.name = s;
15611548 return pt;
15621549 } finally {
15691556
15701557 //3 3aqh64lxwv4da2snfe7fvr45b
15711558 // int common_init_edge(edge_t * e)
1572 public static int common_init_edge(Agedge_s e) {
1559 public static int common_init_edge(ST_Agedge_s e) {
15731560 ENTERING("3aqh64lxwv4da2snfe7fvr45b","common_init_edge");
15741561 try {
15751562 CString str;
15761563 int r = 0;
1577 final __struct__<fontinfo> fi = JUtils.from(fontinfo.class);
1578 final __struct__<fontinfo> lfi = JUtils.from(fontinfo.class);
1579 Agraph_s sg = agraphof(agtail(e));
1564 final ST_fontinfo fi = new ST_fontinfo();
1565 final ST_fontinfo lfi = new ST_fontinfo();
1566 ST_Agraph_s sg = agraphof(agtail(e));
15801567 fi.setPtr("fontname", null);
15811568 lfi.setPtr("fontname", null);
15821569 if (Z.z().E_label!=null && (str = agxget(e, Z.z().E_label))!=null && (str.charAt(0)!='\0')) {
15831570 r = 1;
1584 initFontEdgeAttr(e, fi.amp());
1571 initFontEdgeAttr(e, fi);
15851572 ED_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
1586 fi.getDouble("fontsize"), fi.getCString("fontname"), fi.getCString("fontcolor")));
1573 fi.fontsize, fi.fontname, fi.fontcolor));
15871574 GD_has_labels(sg, GD_has_labels(sg) | (1 << 0));
15881575 ED_label_ontop(e,
15891576 mapbool(late_string(e, Z.z().E_label_float, new CString("false"))));
15971584 }
15981585 /* vladimir */
15991586 if (Z.z().E_headlabel!=null && (str = agxget(e, Z.z().E_headlabel))!=null && (str.charAt(0)!='\0')) {
1600 initFontLabelEdgeAttr(e, fi.amp(), lfi.amp());
1587 initFontLabelEdgeAttr(e, fi, lfi);
16011588 ED_head_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
1602 lfi.getDouble("fontsize"), lfi.getCString("fontname"), lfi.getCString("fontcolor")));
1589 lfi.fontsize, lfi.fontname, lfi.fontcolor));
16031590 GD_has_labels(sg, GD_has_labels(sg) | (1 << 1));
16041591 }
16051592 if (Z.z().E_taillabel!=null && (str = agxget(e, Z.z().E_taillabel))!=null && (str.charAt(0)!='\0')) {
1606 UNSUPPORTED("6y6e1y496y6j6a6065nfesr8o"); // if (!lfi.fontname)
1607 UNSUPPORTED("4w2bicw8rsgyy40x0vhyzzlnm"); // initFontLabelEdgeAttr(e, &fi, &lfi);
1608 UNSUPPORTED("ans0pi92t6ou5mworb3ohiqj3"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_label) = make_label((void*)e, str, (aghtmlstr(str) ? (1 << 1) : (0 << 1)),
1609 UNSUPPORTED("eu3ztkfva2x87y72tnu7vv4re"); // lfi.fontsize, lfi.fontname, lfi.fontcolor);
1610 UNSUPPORTED("50hobbhvpqr6dj302waqr59mu"); // (((Agraphinfo_t*)(((Agobj_t*)(sg))->data))->has_labels) |= (1 << 2);
1593 initFontLabelEdgeAttr(e, fi, lfi);
1594 ED_tail_label(e, make_label(e, str, (aghtmlstr(str)!=0 ? (1 << 1) : (0 << 1)),
1595 lfi.fontsize, lfi.fontname, lfi.fontcolor));
1596 GD_has_labels(sg, GD_has_labels(sg) | (1 << 2));
16111597 }
16121598 /* end vladimir */
16131599 /* We still accept ports beginning with colons but this is deprecated
16201606 if (str!=null && str.charAt(0)!='\0')
16211607 UNSUPPORTED("j71lo2acx1ydov0uj7xjjce"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 3?(e):((e)+1))->node)))->data))->has_port) = (!(0));
16221608
1623 ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).getPtr("fns").getPtr("portfn"), agtail(e), str));
1609 ED_tail_port(e, chkPort ((CFunction) ND_shape(agtail(e)).fns.portfn, agtail(e), str));
16241610 if (noClip(e, Z.z().E_tailclip))
16251611 UNSUPPORTED("cg4z67u0dm6h9nrcx8kkalnlt"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->tail_port).clip = 0;
16261612 str = agget(e, new CString("headport"));
16291615 if (str!=null && str.charAt(0)!='\0')
16301616 UNSUPPORTED("542y57dbsosmjvsmdnzon2qb5"); // (((Agnodeinfo_t*)(((Agobj_t*)(((((((Agobj_t*)(e))->tag).objtype) == 2?(e):((e)-1))->node)))->data))->has_port) = (!(0));
16311617
1632 ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).getPtr("fns").getPtr("portfn"), aghead(e), str));
1618 ED_head_port(e, chkPort((CFunction) ND_shape(aghead(e)).fns.portfn, aghead(e), str));
16331619
16341620 if (noClip(e, Z.z().E_headclip))
16351621 UNSUPPORTED("ayqscz30ekhcje94wh4ib1hcu"); // (((Agedgeinfo_t*)(((Agobj_t*)(e))->data))->head_port).clip = 0;
16441630
16451631 //3 3mkqvtbyq9j8ktzil6t7vakg5
16461632 // static boxf addLabelBB(boxf bb, textlabel_t * lp, boolean flipxy)
1647 public static __struct__<boxf> addLabelBB(final ST_boxf bb, textlabel_t lp, boolean flipxy) {
1633 public static ST_boxf addLabelBB(final ST_boxf bb, ST_textlabel_t lp, boolean flipxy) {
16481634 // WARNING!! STRUCT
16491635 return addLabelBB_w_(bb.copy(), lp, flipxy).copy();
16501636 }
1651 private static __struct__<boxf> addLabelBB_w_(final ST_boxf bb, textlabel_t lp, boolean flipxy) {
1637 private static ST_boxf addLabelBB_w_(final ST_boxf bb, ST_textlabel_t lp, boolean flipxy) {
16521638 ENTERING("3mkqvtbyq9j8ktzil6t7vakg5","addLabelBB");
16531639 try {
16541640 double width, height;
1655 final __struct__<pointf> p = JUtils.from(pointf.class);
1656 p.___(lp.getStruct("pos"));
1641 final ST_pointf p = new ST_pointf();
1642 p.___(lp.pos);
16571643 double min, max;
16581644 if (flipxy) {
1659 height = lp.getStruct("dimen").getDouble("x");
1660 width = lp.getStruct("dimen").getDouble("y");
1645 height = lp.dimen.x;
1646 width = lp.dimen.y;
16611647 }
16621648 else {
1663 width = lp.getStruct("dimen").getDouble("x");
1664 height = lp.getStruct("dimen").getDouble("y");
1649 width = lp.dimen.x;
1650 height = lp.dimen.y;
16651651 }
1666 min = p.getDouble("x") - width / 2.;
1667 max = p.getDouble("x") + width / 2.;
1652 min = p.x - width / 2.;
1653 max = p.x + width / 2.;
16681654 if (min < bb.LL.x)
16691655 bb.LL.x = min;
16701656 if (max > bb.UR.x)
16711657 bb.UR.x = max;
1672 min = p.getDouble("y") - height / 2.;
1673 max = p.getDouble("y") + height / 2.;
1658 min = p.y - height / 2.;
1659 max = p.y + height / 2.;
16741660 if (min < bb.LL.y)
16751661 bb.LL.y = min;
16761662 if (max > bb.UR.y)
17121698
17131699 //3 bz7kjecium6a7xa39qfobwwnc
17141700 // void updateBB(graph_t * g, textlabel_t * lp)
1715 public static void updateBB(Agraph_s g, textlabel_t lp) {
1701 public static void updateBB(ST_Agraph_s g, ST_textlabel_t lp) {
17161702 ENTERING("bz7kjecium6a7xa39qfobwwnc","updateBB");
17171703 try {
17181704 GD_bb(g).___(addLabelBB(GD_bb(g), lp, GD_flip(g)!=0));
23542340
23552341 //3 9yungx7uxqkmzfh2ub6gs9l48
23562342 // char* htmlEntityUTF8 (char* s, graph_t* g)
2357 public static CString htmlEntityUTF8(CString s, Agraph_s g) {
2343 public static CString htmlEntityUTF8(CString s, ST_Agraph_s g) {
23582344 ENTERING("9yungx7uxqkmzfh2ub6gs9l48","htmlEntityUTF8");
23592345 try {
23602346 LOG2("htmlEntityUTF8 "+s);
27352721
27362722 //3 13cpqbf2ztcjdfz4a6v7nv00u
27372723 // void setEdgeType (graph_t* g, int dflt)
2738 public static void setEdgeType(Agraph_s g, int dflt) {
2724 public static void setEdgeType(ST_Agraph_s g, int dflt) {
27392725 ENTERING("13cpqbf2ztcjdfz4a6v7nv00u","setEdgeType");
27402726 try {
27412727 CString s = agget(g, new CString("splines"));
29332919
29342920 //3 80q488y0eqojtsm7osnfydmo5
29352921 // void gv_nodesize(node_t * n, boolean flip)
2936 public static void gv_nodesize(Agnode_s n, int flip) {
2922 public static void gv_nodesize(ST_Agnode_s n, int flip) {
29372923 ENTERING("80q488y0eqojtsm7osnfydmo5","gv_nodesize");
29382924 try {
29392925 double w;
5858 import static smetana.core.Macro.ND_onstack;
5959 import static smetana.core.Macro.ND_out;
6060 import static smetana.core.Macro.UNSUPPORTED;
61 import h.Agedge_s;
62 import h.Agnode_s;
63 import h.Agraph_s;
64 import h.boxf;
65 import h.pointf;
66 import smetana.core.JUtils;
67 import smetana.core.__struct__;
61 import h.ST_Agedge_s;
62 import h.ST_Agnode_s;
63 import h.ST_Agraph_s;
64 import h.ST_pointf;
6865
6966 public class acyclic__c {
7067 //1 2digov3edok6d5srhgtlmrycs
324321
325322 //3 c1s4k85p1cdfn176o3uryeros
326323 // static inline pointf pointfof(double x, double y)
327 public static __struct__<pointf> pointfof(double x, double y) {
324 public static ST_pointf pointfof(double x, double y) {
328325 // WARNING!! STRUCT
329326 return pointfof_w_(x, y).copy();
330327 }
331 private static __struct__<pointf> pointfof_w_(double x, double y) {
328 private static ST_pointf pointfof_w_(double x, double y) {
332329 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
333330 try {
334 final __struct__<pointf> r = JUtils.from(pointf.class);
331 final ST_pointf r = new ST_pointf();
335332 r.setDouble("x", x);
336333 r.setDouble("y", y);
337334 return r;
360357
361358
362359
363 //3 1vvsta5i8of59frav6uymguav
364 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
365 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
366 // WARNING!! STRUCT
367 return boxfof_w_(llx, lly, urx, ury).copy();
368 }
369 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
370 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
371 try {
372 final __struct__<boxf> b = JUtils.from(boxf.class);
373 b.getStruct("LL").setDouble("x", llx);
374 b.getStruct("LL").setDouble("y", lly);
375 b.getStruct("UR").setDouble("x", urx);
376 b.getStruct("UR").setDouble("y", ury);
377 return b;
378 } finally {
379 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
380 }
381 }
382360
383361
384362
402380
403381 //3 arrsbik9b5tnfcbzsm8gr2chx
404382 // static inline pointf add_pointf(pointf p, pointf q)
405 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
383 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
406384 // WARNING!! STRUCT
407385 return add_pointf_w_(p.copy(), q.copy()).copy();
408386 }
409 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
387 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
410388 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
411389 try {
412 final __struct__<pointf> r = JUtils.from(pointf.class);
413 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
414 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
390 final ST_pointf r = new ST_pointf();
391 r.setDouble("x", p.x + q.x);
392 r.setDouble("y", p.y + q.y);
415393 return r;
416394 } finally {
417395 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
708686
709687 //3 9hm902ya6q6bq246ewuh67h38
710688 // void reverse_edge(edge_t * e)
711 public static void reverse_edge(Agedge_s e) {
689 public static void reverse_edge(ST_Agedge_s e) {
712690 ENTERING("9hm902ya6q6bq246ewuh67h38","reverse_edge");
713691 try {
714 Agedge_s f;
692 ST_Agedge_s f;
715693 delete_fast_edge(e);
716694 if ((f = find_fast_edge(aghead(e), agtail(e)))!=null)
717695 merge_oneway(e, f);
727705
728706 //3 e9h7n52fs8rucrug9tr0zebe2
729707 // static void dfs(node_t * n)
730 public static void dfs(Agnode_s n) {
708 public static void dfs(ST_Agnode_s n) {
731709 ENTERING("e9h7n52fs8rucrug9tr0zebe2","dfs");
732710 try {
733711 int i;
734 Agedge_s e;
735 Agnode_s w;
712 ST_Agedge_s e;
713 ST_Agnode_s w;
736714 if (ND_mark(n)!=0)
737715 return;
738716 ND_mark(n, 1);
739717 ND_onstack(n, 1);
740 for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
718 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
741719 w = aghead(e);
742720 if (ND_onstack(w)) {
743721 reverse_edge(e);
758736
759737 //3 1ejgnwd7ek344caegjwg46n6h
760738 // void acyclic(graph_t * g)
761 public static void acyclic_(Agraph_s g) {
739 public static void acyclic_(ST_Agraph_s g) {
762740 ENTERING("1ejgnwd7ek344caegjwg46n6h","acyclic");
763741 try {
764742 int c;
765 Agnode_s n;
743 ST_Agnode_s n;
766744 for (c = 0; c < GD_comp(g).size; c++) {
767745 GD_nlist(g, GD_comp(g).getFromList(c));
768746 for (n = GD_nlist(g); n!=null; n = ND_next(n))
4848 import static smetana.core.JUtilsDebug.LEAVING;
4949 import static smetana.core.Macro.N;
5050 import static smetana.core.Macro.UNSUPPORTED;
51 import h.Agraph_s;
52 import h.aspect_t;
53 import h.boxf;
54 import h.pointf;
51 import h.ST_Agraph_s;
52 import h.ST_aspect_t;
53 import h.ST_pointf;
5554 import smetana.core.CString;
56 import smetana.core.JUtils;
57 import smetana.core.__struct__;
5855
5956 public class aspect__c {
6057 //1 2digov3edok6d5srhgtlmrycs
314311
315312 //3 c1s4k85p1cdfn176o3uryeros
316313 // static inline pointf pointfof(double x, double y)
317 public static __struct__<pointf> pointfof(double x, double y) {
314 public static ST_pointf pointfof(double x, double y) {
318315 // WARNING!! STRUCT
319316 return pointfof_w_(x, y).copy();
320317 }
321 private static __struct__<pointf> pointfof_w_(double x, double y) {
318 private static ST_pointf pointfof_w_(double x, double y) {
322319 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
323320 try {
324 final __struct__<pointf> r = JUtils.from(pointf.class);
321 final ST_pointf r = new ST_pointf();
325322 r.setDouble("x", x);
326323 r.setDouble("y", y);
327324 return r;
350347
351348
352349
353 //3 1vvsta5i8of59frav6uymguav
354 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
355 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
356 // WARNING!! STRUCT
357 return boxfof_w_(llx, lly, urx, ury).copy();
358 }
359 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
360 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
361 try {
362 final __struct__<boxf> b = JUtils.from(boxf.class);
363 b.getStruct("LL").setDouble("x", llx);
364 b.getStruct("LL").setDouble("y", lly);
365 b.getStruct("UR").setDouble("x", urx);
366 b.getStruct("UR").setDouble("y", ury);
367 return b;
368 } finally {
369 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
370 }
371 }
372350
373351
374352
392370
393371 //3 arrsbik9b5tnfcbzsm8gr2chx
394372 // static inline pointf add_pointf(pointf p, pointf q)
395 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
373 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
396374 // WARNING!! STRUCT
397375 return add_pointf_w_(p.copy(), q.copy()).copy();
398376 }
399 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
377 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
400378 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
401379 try {
402 final __struct__<pointf> r = JUtils.from(pointf.class);
403 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
404 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
380 final ST_pointf r = new ST_pointf();
381 r.setDouble("x", p.x + q.x);
382 r.setDouble("y", p.y + q.y);
405383 return r;
406384 } finally {
407385 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
12331211
12341212 //3 5srsfxqlego6qiyj5mm8m4ql2
12351213 // aspect_t* setAspect (Agraph_t * g, aspect_t* adata)
1236 public static aspect_t setAspect(Agraph_s g, aspect_t adata) {
1214 public static ST_aspect_t setAspect(ST_Agraph_s g, ST_aspect_t adata) {
12371215 ENTERING("5srsfxqlego6qiyj5mm8m4ql2","setAspect");
12381216 try {
12391217 double rv;
7070 import static smetana.core.Macro.ND_node_type;
7171 import static smetana.core.Macro.ND_rank;
7272 import static smetana.core.Macro.UNSUPPORTED;
73 import h.Agedge_s;
74 import h.Agnode_s;
75 import h.Agraph_s;
76 import h.boxf;
77 import h.pointf;
73 import h.ST_Agedge_s;
74 import h.ST_Agnode_s;
75 import h.ST_Agraph_s;
76 import h.ST_pointf;
7877 import smetana.core.CString;
79 import smetana.core.JUtils;
8078 import smetana.core.Z;
81 import smetana.core.__struct__;
8279
8380 public class class1__c {
8481 //1 2digov3edok6d5srhgtlmrycs
338335
339336 //3 c1s4k85p1cdfn176o3uryeros
340337 // static inline pointf pointfof(double x, double y)
341 public static __struct__<pointf> pointfof(double x, double y) {
338 public static ST_pointf pointfof(double x, double y) {
342339 // WARNING!! STRUCT
343340 return pointfof_w_(x, y).copy();
344341 }
345 private static __struct__<pointf> pointfof_w_(double x, double y) {
342 private static ST_pointf pointfof_w_(double x, double y) {
346343 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
347344 try {
348 final __struct__<pointf> r = JUtils.from(pointf.class);
345 final ST_pointf r = new ST_pointf();
349346 r.setDouble("x", x);
350347 r.setDouble("y", y);
351348 return r;
374371
375372
376373
377 //3 1vvsta5i8of59frav6uymguav
378 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
379 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
380 // WARNING!! STRUCT
381 return boxfof_w_(llx, lly, urx, ury).copy();
382 }
383 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
384 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
385 try {
386 final __struct__<boxf> b = JUtils.from(boxf.class);
387 b.getStruct("LL").setDouble("x", llx);
388 b.getStruct("LL").setDouble("y", lly);
389 b.getStruct("UR").setDouble("x", urx);
390 b.getStruct("UR").setDouble("y", ury);
391 return b;
392 } finally {
393 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
394 }
395 }
396374
397375
398376
416394
417395 //3 arrsbik9b5tnfcbzsm8gr2chx
418396 // static inline pointf add_pointf(pointf p, pointf q)
419 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
397 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
420398 // WARNING!! STRUCT
421399 return add_pointf_w_(p.copy(), q.copy()).copy();
422400 }
423 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
401 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
424402 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
425403 try {
426 final __struct__<pointf> r = JUtils.from(pointf.class);
427 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
428 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
404 final ST_pointf r = new ST_pointf();
405 r.setDouble("x", p.x + q.x);
406 r.setDouble("y", p.y + q.y);
429407 return r;
430408 } finally {
431409 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
722700
723701 //3 2luyof8ca7ewf9r08z3os3lk7
724702 // int nonconstraint_edge(edge_t * e)
725 public static boolean nonconstraint_edge(Agedge_s e) {
703 public static boolean nonconstraint_edge(ST_Agedge_s e) {
726704 ENTERING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
727705 try {
728706 CString constr;
741719
742720 //3 dpimuv55sylui7jx8fh3ic1qc
743721 // static void interclust1(graph_t * g, node_t * t, node_t * h, edge_t * e)
744 public static void interclust1(Agraph_s g, Agnode_s t, Agnode_s h, Agedge_s e) {
722 public static void interclust1(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, ST_Agedge_s e) {
745723 ENTERING("dpimuv55sylui7jx8fh3ic1qc","interclust1");
746724 try {
747 Agnode_s v, t0, h0;
725 ST_Agnode_s v, t0, h0;
748726 int offset, t_len, h_len, t_rank, h_rank;
749 Agedge_s rt, rh;
727 ST_Agedge_s rt, rh;
750728 if (ND_clust(agtail(e))!=null)
751729 t_rank = ND_rank(agtail(e)) - ND_rank(GD_leader(ND_clust(agtail(e))));
752730 else
781759
782760 //3 acy5ct6402jgf0ga5oeeskx5m
783761 // void class1(graph_t * g)
784 public static void class1_(Agraph_s g) {
762 public static void class1_(ST_Agraph_s g) {
785763 ENTERING("acy5ct6402jgf0ga5oeeskx5m","class1");
786764 try {
787 Agnode_s n, t, h;
788 Agedge_s e, rep;
765 ST_Agnode_s n, t, h;
766 ST_Agedge_s e, rep;
789767 mark_clusters(g);
790768 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
791769 for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
6868 import static smetana.core.JUtils.NEQ;
6969 import static smetana.core.JUtilsDebug.ENTERING;
7070 import static smetana.core.JUtilsDebug.LEAVING;
71 import static smetana.core.Macro.ALLOC_empty;
7271 import static smetana.core.Macro.ED_conc_opp_flag;
7372 import static smetana.core.Macro.ED_count;
7473 import static smetana.core.Macro.ED_edge_type;
9897 import static smetana.core.Macro.ND_weight_class;
9998 import static smetana.core.Macro.NOT;
10099 import static smetana.core.Macro.UNSUPPORTED;
101 import h.Agedge_s;
102 import h.Agnode_s;
103 import h.Agraph_s;
104 import h.boxf;
105 import h.pointf;
106 import smetana.core.JUtils;
100 import h.ST_Agedge_s;
101 import h.ST_Agnode_s;
102 import h.ST_Agraph_s;
103 import h.ST_pointf;
107104 import smetana.core.Z;
108 import smetana.core.__struct__;
109105
110106 public class class2__c {
111107 //1 2digov3edok6d5srhgtlmrycs
365361
366362 //3 c1s4k85p1cdfn176o3uryeros
367363 // static inline pointf pointfof(double x, double y)
368 public static __struct__<pointf> pointfof(double x, double y) {
364 public static ST_pointf pointfof(double x, double y) {
369365 // WARNING!! STRUCT
370366 return pointfof_w_(x, y).copy();
371367 }
372 private static __struct__<pointf> pointfof_w_(double x, double y) {
368 private static ST_pointf pointfof_w_(double x, double y) {
373369 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
374370 try {
375 final __struct__<pointf> r = JUtils.from(pointf.class);
371 final ST_pointf r = new ST_pointf();
376372 r.setDouble("x", x);
377373 r.setDouble("y", y);
378374 return r;
401397
402398
403399
404 //3 1vvsta5i8of59frav6uymguav
405 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
406 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
407 // WARNING!! STRUCT
408 return boxfof_w_(llx, lly, urx, ury).copy();
409 }
410 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
411 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
412 try {
413 final __struct__<boxf> b = JUtils.from(boxf.class);
414 b.getStruct("LL").setDouble("x", llx);
415 b.getStruct("LL").setDouble("y", lly);
416 b.getStruct("UR").setDouble("x", urx);
417 b.getStruct("UR").setDouble("y", ury);
418 return b;
419 } finally {
420 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
421 }
422 }
423
424
425400
426401
427402 //3 1n5xl70wxuabyf97mclvilsm6
443418
444419 //3 arrsbik9b5tnfcbzsm8gr2chx
445420 // static inline pointf add_pointf(pointf p, pointf q)
446 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
421 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
447422 // WARNING!! STRUCT
448423 return add_pointf_w_(p.copy(), q.copy()).copy();
449424 }
450 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
425 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
451426 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
452427 try {
453 final __struct__<pointf> r = JUtils.from(pointf.class);
454 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
455 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
428 final ST_pointf r = new ST_pointf();
429 r.setDouble("x", p.x + q.x);
430 r.setDouble("y", p.y + q.y);
456431 return r;
457432 } finally {
458433 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
749724
750725 //3 2zn7c6ulmwwzaibdxo127jf04
751726 // static node_t* label_vnode(graph_t * g, edge_t * orig)
752 public static Agnode_s label_vnode(Agraph_s g, Agedge_s orig) {
727 public static ST_Agnode_s label_vnode(ST_Agraph_s g, ST_Agedge_s orig) {
753728 ENTERING("2zn7c6ulmwwzaibdxo127jf04","label_vnode");
754729 try {
755 Agnode_s v;
756 final __struct__<pointf> dimen = JUtils.from(pointf.class);
757 dimen.___(ED_label(orig).getStruct("dimen"));
730 ST_Agnode_s v;
731 final ST_pointf dimen = new ST_pointf();
732 dimen.___(ED_label(orig).dimen);
758733 v = virtual_node(g);
759734 ND_label(v, ED_label(orig));
760735 ND_lw(v, GD_nodesep(agroot(v)));
761736 if (N(ED_label_ontop(orig))) {
762737 if (GD_flip(agroot(g))!=0) {
763 ND_ht(v, dimen.getDouble("x"));
764 ND_rw(v, dimen.getDouble("y"));
738 ND_ht(v, dimen.x);
739 ND_rw(v, dimen.y);
765740 } else {
766 ND_ht(v, dimen.getDouble("y"));
767 ND_rw(v, dimen.getDouble("x"));
741 ND_ht(v, dimen.y);
742 ND_rw(v, dimen.x);
768743 }
769744 }
770745 return v;
778753
779754 //3 49tji49jdm9uges7v8lf2j2rn
780755 // static void incr_width(graph_t * g, node_t * v)
781 public static void incr_width(Agraph_s g, Agnode_s v) {
756 public static void incr_width(ST_Agraph_s g, ST_Agnode_s v) {
782757 ENTERING("49tji49jdm9uges7v8lf2j2rn","incr_width");
783758 try {
784759 int width = GD_nodesep(g) / 2;
794769
795770 //3 xujihq6vep3ez275shtrbilo
796771 // static node_t* plain_vnode(graph_t * g, edge_t * orig)
797 public static Agnode_s plain_vnode(Agraph_s g, Agedge_s orig) {
772 public static ST_Agnode_s plain_vnode(ST_Agraph_s g, ST_Agedge_s orig) {
798773 ENTERING("xujihq6vep3ez275shtrbilo","plain_vnode");
799774 try {
800 Agnode_s v;
775 ST_Agnode_s v;
801776 orig = orig;
802777 v = virtual_node(g);
803778 incr_width(g, v);
812787
813788 //3 9fmfj1b2jik7skv6ms0657t8r
814789 // static node_t* leader_of(graph_t * g, node_t * v)
815 public static Agnode_s leader_of(Agraph_s g, Agnode_s v) {
790 public static ST_Agnode_s leader_of(ST_Agraph_s g, ST_Agnode_s v) {
816791 ENTERING("9fmfj1b2jik7skv6ms0657t8r","leader_of");
817792 try {
818 Agraph_s clust;
819 Agnode_s rv;
793 ST_Agraph_s clust;
794 ST_Agnode_s rv;
820795 if (ND_ranktype(v) != 7) {
821796 /*assert(v == UF_find(v)); could be leaf, so comment out */
822797 rv = UF_find(v);
823798 } else {
824799 clust = ND_clust(v);
825 rv = (Agnode_s) GD_rankleader(clust).plus(ND_rank(v)).getPtr();
800 rv = (ST_Agnode_s) GD_rankleader(clust).plus(ND_rank(v)).getPtr();
826801 }
827802 return rv;
828803 } finally {
835810
836811 //3 6sbvlvurvkodunw2qt1ug70c2
837812 // static void make_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig)
838 public static void make_chain(Agraph_s g, Agnode_s from, Agnode_s to, Agedge_s orig) {
813 public static void make_chain(ST_Agraph_s g, ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig) {
839814 ENTERING("6sbvlvurvkodunw2qt1ug70c2","make_chain");
840815 try {
841816 int r, label_rank;
842 Agnode_s u, v=null;
843 Agedge_s e;
817 ST_Agnode_s u, v=null;
818 ST_Agedge_s e;
844819 u = from;
845820 if (ED_label(orig)!=null)
846821 label_rank = (ND_rank(from) + ND_rank(to)) / 2;
871846
872847 //3 659ld5tcseo3l0hopxb3pf0vv
873848 // static void interclrep(graph_t * g, edge_t * e)
874 public static void interclrep(Agraph_s g, Agedge_s e) {
849 public static void interclrep(ST_Agraph_s g, ST_Agedge_s e) {
875850 ENTERING("659ld5tcseo3l0hopxb3pf0vv","interclrep");
876851 try {
877 Agnode_s t, h;
878 Agedge_s ve;
852 ST_Agnode_s t, h;
853 ST_Agedge_s ve;
879854 t = leader_of(g, agtail(e));
880855 h = leader_of(g, aghead(e));
881856 if (ND_rank(t) > ND_rank(h)) {
882 Agnode_s t0 = t;
857 ST_Agnode_s t0 = t;
883858 t = h;
884859 h = t0;
885860 }
893868 make_chain(g, t, h, e);
894869 /* mark as cluster edge */
895870 for (ve = ED_to_virt(e); ve!=null && (ND_rank(aghead(ve)) <= ND_rank(h));
896 ve = (Agedge_s) ND_out(aghead(ve)).getFromList(0))
871 ve = (ST_Agedge_s) ND_out(aghead(ve)).getFromList(0))
897872 ED_edge_type(ve, 5);
898873 }
899874 /* else ignore intra-cluster edges at this point */
907882
908883 //3 c0cx00ki1i1kx0bp84e7xjg8d
909884 // static int is_cluster_edge(edge_t * e)
910 public static boolean is_cluster_edge(Agedge_s e) {
885 public static boolean is_cluster_edge(ST_Agedge_s e) {
911886 ENTERING("c0cx00ki1i1kx0bp84e7xjg8d","is_cluster_edge");
912887 try {
913888 return ((ND_ranktype(agtail(e)) == 7)
922897
923898 //3 c45973dtaighb3u0auuekcs1y
924899 // void merge_chain(graph_t * g, edge_t * e, edge_t * f, int flag)
925 public static void merge_chain(Agraph_s g, Agedge_s e, Agedge_s f, boolean flag) {
900 public static void merge_chain(ST_Agraph_s g, ST_Agedge_s e, ST_Agedge_s f, boolean flag) {
926901 ENTERING("c45973dtaighb3u0auuekcs1y","merge_chain");
927902 try {
928 Agedge_s rep;
903 ST_Agedge_s rep;
929904 int lastrank = MAX(ND_rank(agtail(e)), ND_rank(aghead(e)));
930905 //assert(ED_to_virt(e) == NULL);
931906 ED_to_virt(e, f);
939914 if (ND_rank(aghead(rep)) == lastrank)
940915 break;
941916 incr_width(g, aghead(rep));
942 rep = (Agedge_s) ND_out(aghead(rep)).getFromList(0);
917 rep = (ST_Agedge_s) ND_out(aghead(rep)).getFromList(0);
943918 } while (rep!=null);
944919 } finally {
945920 LEAVING("c45973dtaighb3u0auuekcs1y","merge_chain");
951926
952927 //3 bg5r9wlego0d8pv0hr96zt45c
953928 // int mergeable(edge_t * e, edge_t * f)
954 public static boolean mergeable(Agedge_s e, Agedge_s f) {
929 public static boolean mergeable(ST_Agedge_s e, ST_Agedge_s f) {
955930 ENTERING("bg5r9wlego0d8pv0hr96zt45c","mergeable");
956931 try {
957932 if (e!=null && f!=null && EQ(agtail(e), agtail(f)) && EQ(aghead(e), aghead(f)) &&
968943
969944 //3 d0bxlkysxucmww7t74u9krrgz
970945 // void class2(graph_t * g)
971 public static void class2(Agraph_s g) {
946 public static void class2(ST_Agraph_s g) {
972947 ENTERING("d0bxlkysxucmww7t74u9krrgz","class2");
973948 try {
974949 int c;
975 Agnode_s n, t, h;
976 Agedge_s e, prev, opp;
950 ST_Agnode_s n, t, h;
951 ST_Agedge_s e, prev, opp;
977952 GD_nlist(g, null);
978953 GD_n_nodes(g, 0); /* new */
979954 mark_clusters(g);
980955 for (c = 1; c <= GD_n_cluster(g); c++)
981 build_skeleton(g, (Agraph_s) GD_clust(g).plus(c).getPtr());
956 build_skeleton(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr());
982957 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
983958 for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
984959 if (ND_weight_class(aghead(e)) <= 2)
10871062 }
10881063 /* since decompose() is not called on subgraphs */
10891064 if (NEQ(g, dot_root(g))) {
1090 GD_comp(g).reallocEmpty(1, Agnode_s.class);
1065 GD_comp(g).reallocEmpty(1);
10911066 GD_comp(g).setInList(0, GD_nlist(g));
10921067 }
10931068 } finally {
5353 import static gen.lib.cgraph.node__c.agnxtnode;
5454 import static gen.lib.cgraph.obj__c.agcontains;
5555 import static gen.lib.cgraph.obj__c.agroot;
56 import static gen.lib.common.memory__c.zmalloc;
5756 import static gen.lib.common.utils__c.UF_setname;
5857 import static gen.lib.common.utils__c.UF_singleton;
5958 import static gen.lib.dotgen.class2__c.class2;
7675 import static gen.lib.dotgen.position__c.ports_eq;
7776 import static smetana.core.JUtils.EQ;
7877 import static smetana.core.JUtils.NEQ;
79 import static smetana.core.JUtils.sizeof_starstar_empty;
8078 import static smetana.core.JUtilsDebug.ENTERING;
8179 import static smetana.core.JUtilsDebug.LEAVING;
8280 import static smetana.core.Macro.AGMKOUT;
108106 import static smetana.core.Macro.ND_rw;
109107 import static smetana.core.Macro.NOT;
110108 import static smetana.core.Macro.UNSUPPORTED;
111 import h.Agedge_s;
112 import h.Agnode_s;
113 import h.Agraph_s;
114 import h.boxf;
115 import h.nodequeue;
116 import h.pointf;
117 import smetana.core.JUtils;
109 import h.ST_Agedge_s;
110 import h.ST_Agnode_s;
111 import h.ST_Agraph_s;
112 import h.ST_nodequeue;
113 import h.ST_pointf;
118114 import smetana.core.__ptr__;
119 import smetana.core.__struct__;
120115
121116 public class cluster__c {
122117 //1 2digov3edok6d5srhgtlmrycs
376371
377372 //3 c1s4k85p1cdfn176o3uryeros
378373 // static inline pointf pointfof(double x, double y)
379 public static __struct__<pointf> pointfof(double x, double y) {
374 public static ST_pointf pointfof(double x, double y) {
380375 // WARNING!! STRUCT
381376 return pointfof_w_(x, y).copy();
382377 }
383 private static __struct__<pointf> pointfof_w_(double x, double y) {
378 private static ST_pointf pointfof_w_(double x, double y) {
384379 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
385380 try {
386 final __struct__<pointf> r = JUtils.from(pointf.class);
381 final ST_pointf r = new ST_pointf();
387382 r.setDouble("x", x);
388383 r.setDouble("y", y);
389384 return r;
412407
413408
414409
415 //3 1vvsta5i8of59frav6uymguav
416 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
417 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
418 // WARNING!! STRUCT
419 return boxfof_w_(llx, lly, urx, ury).copy();
420 }
421 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
422 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
423 try {
424 final __struct__<boxf> b = JUtils.from(boxf.class);
425 b.getStruct("LL").setDouble("x", llx);
426 b.getStruct("LL").setDouble("y", lly);
427 b.getStruct("UR").setDouble("x", urx);
428 b.getStruct("UR").setDouble("y", ury);
429 return b;
430 } finally {
431 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
432 }
433 }
434
435410
436411
437412
454429
455430 //3 arrsbik9b5tnfcbzsm8gr2chx
456431 // static inline pointf add_pointf(pointf p, pointf q)
457 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
432 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
458433 // WARNING!! STRUCT
459434 return add_pointf_w_(p.copy(), q.copy()).copy();
460435 }
461 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
436 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
462437 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
463438 try {
464 final __struct__<pointf> r = JUtils.from(pointf.class);
465 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
466 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
439 final ST_pointf r = new ST_pointf();
440 r.setDouble("x", p.x + q.x);
441 r.setDouble("y", p.y + q.y);
467442 return r;
468443 } finally {
469444 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
760735
761736 //3 8bd317q0mykfu6wpr3e4cxmh2
762737 // static node_t* map_interclust_node(node_t * n)
763 public static Agnode_s map_interclust_node(Agnode_s n) {
738 public static ST_Agnode_s map_interclust_node(ST_Agnode_s n) {
764739 ENTERING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
765740 try {
766 Agnode_s rv;
741 ST_Agnode_s rv;
767742 if ((ND_clust(n) == null) || ( GD_expanded(ND_clust(n))) )
768743 rv = n;
769744 else
770 rv = (Agnode_s) GD_rankleader(ND_clust(n)).plus(ND_rank(n)).getPtr();
745 rv = (ST_Agnode_s) GD_rankleader(ND_clust(n)).plus(ND_rank(n)).getPtr();
771746 return rv;
772747 } finally {
773748 LEAVING("8bd317q0mykfu6wpr3e4cxmh2","map_interclust_node");
779754
780755 //3 5ib4nnt2ah5fdd22zs0xds29r
781756 // static void make_slots(graph_t * root, int r, int pos, int d)
782 public static void make_slots(Agraph_s root, int r, int pos, int d) {
757 public static void make_slots(ST_Agraph_s root, int r, int pos, int d) {
783758 ENTERING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
784759 try {
785760 int i;
786 Agnode_s v;
787 __ptr__ vlist;
788 vlist = GD_rank(root).plus(r).getPtr().getArrayOfPtr("v").asPtr();
761 ST_Agnode_s v;
762 ST_Agnode_s.ArrayOfStar vlist;
763 vlist = GD_rank(root).get(r).v;
789764 if (d <= 0) {
790 for (i = pos - d + 1; i < GD_rank(root).plus(r).getInt("n"); i++) {
791 v = (Agnode_s) vlist.plus(i).getPtr();
765 for (i = pos - d + 1; i < GD_rank(root).get(r).n; i++) {
766 v = (ST_Agnode_s) vlist.get(i);
792767 ND_order(v, i + d - 1);
793768 vlist.plus(ND_order(v)).setPtr(v);
794769 }
795 for (i = GD_rank(root).plus(r).getInt("n") + d - 1; i < GD_rank(root).plus(r).getInt("n"); i++)
770 for (i = GD_rank(root).get(r).n + d - 1; i < GD_rank(root).get(r).n; i++)
796771 vlist.plus(i).setPtr(null);
797772 } else {
798773 /*assert(ND_rank(root)[r].n + d - 1 <= ND_rank(root)[r].an);*/
799 for (i = GD_rank(root).plus(r).getPtr().getInt("n") - 1; i > pos; i--) {
800 v = (Agnode_s) vlist.plus(i).getPtr();
774 for (i = GD_rank(root).get(r).n - 1; i > pos; i--) {
775 v = (ST_Agnode_s) vlist.get(i);
801776 ND_order(v, i + d - 1);
802777 vlist.plus(ND_order(v)).setPtr(v);
803778 }
804779 for (i = pos + 1; i < pos + d; i++)
805780 vlist.plus(i).setPtr(null);
806781 }
807 GD_rank(root).plus(r).getPtr().setInt("n", GD_rank(root).plus(r).getPtr().getInt("n") + d - 1);
782 GD_rank(root).get(r).setInt("n", GD_rank(root).get(r).n + d - 1);
808783 } finally {
809784 LEAVING("5ib4nnt2ah5fdd22zs0xds29r","make_slots");
810785 }
815790
816791 //3 d4mwxesl56uh9dyttg9cjlq70
817792 // static node_t* clone_vn(graph_t * g, node_t * vn)
818 public static Agnode_s clone_vn(Agraph_s g, Agnode_s vn) {
793 public static ST_Agnode_s clone_vn(ST_Agraph_s g, ST_Agnode_s vn) {
819794 ENTERING("d4mwxesl56uh9dyttg9cjlq70","clone_vn");
820795 try {
821 Agnode_s rv;
796 ST_Agnode_s rv;
822797 int r;
823798 r = ND_rank(vn);
824799 make_slots(g, r, ND_order(vn), 2);
841816
842817 //3 6o86r59v2ujlxqcw7761y6o5b
843818 // static void map_path(node_t * from, node_t * to, edge_t * orig, edge_t * ve, int type)
844 public static void map_path(Agnode_s from, Agnode_s to, Agedge_s orig, Agedge_s ve, int type) {
819 public static void map_path(ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig, ST_Agedge_s ve, int type) {
845820 ENTERING("6o86r59v2ujlxqcw7761y6o5b","map_path");
846821 try {
847822 int r;
848 Agnode_s u, v;
849 Agedge_s e;
823 ST_Agnode_s u, v;
824 ST_Agedge_s e;
850825 assert(ND_rank(from) < ND_rank(to));
851826 if (EQ(agtail(ve), from) && EQ(aghead(ve), to))
852827 return;
871846 ED_edge_type(e, type);
872847 u = v;
873848 ED_count(ve, ED_count(ve) - 1);
874 ve = (Agedge_s) ND_out(aghead(ve)).getFromList(0);
849 ve = (ST_Agedge_s) ND_out(aghead(ve)).getFromList(0);
875850 }
876851 } else {
877852 if (ND_rank(to) - ND_rank(from) == 1) {
899874 } else
900875 e = ve;
901876 while (ND_rank(aghead(e)) != ND_rank(to))
902 e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
877 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
903878 if (NEQ(aghead(e), to)) {
904879 ve = e;
905880 e = virtual_edge(agtail(e), to, orig);
918893
919894 //3 69xbflgja0gvrsl5xcv7o7dia
920895 // static void make_interclust_chain(graph_t * g, node_t * from, node_t * to, edge_t * orig)
921 public static void make_interclust_chain(Agraph_s g, Agnode_s from, Agnode_s to, Agedge_s orig) {
896 public static void make_interclust_chain(ST_Agraph_s g, ST_Agnode_s from, ST_Agnode_s to, ST_Agedge_s orig) {
922897 ENTERING("69xbflgja0gvrsl5xcv7o7dia","make_interclust_chain");
923898 try {
924899 int newtype;
925 Agnode_s u, v;
900 ST_Agnode_s u, v;
926901 u = map_interclust_node(from);
927902 v = map_interclust_node(to);
928903 if (EQ(u, from) && EQ(v, to))
940915
941916 //3 6g2m2y44x66lajznvnon2gubv
942917 // void interclexp(graph_t * subg)
943 public static void interclexp(Agraph_s subg) {
918 public static void interclexp(ST_Agraph_s subg) {
944919 ENTERING("6g2m2y44x66lajznvnon2gubv","interclexp");
945920 try {
946 Agraph_s g;
947 Agnode_s n;
948 Agedge_s e, prev, next;
921 ST_Agraph_s g;
922 ST_Agnode_s n;
923 ST_Agedge_s e, prev, next;
949924 g = dot_root(subg);
950925 for (n = agfstnode(subg); n!=null; n = agnxtnode(subg, n)) {
951926 /* N.B. n may be in a sub-cluster of subg */
970945 }
971946 /* flat edges */
972947 if (ND_rank(agtail(e)) == ND_rank(aghead(e))) {
973 Agedge_s fe;
948 ST_Agedge_s fe;
974949 if ((fe = find_flat_edge(agtail(e), aghead(e))) == null) {
975950 flat_edge(g, e);
976951 prev = e;
1008983
1009984 //3 85nhs7tnmwunw0fsjj1kxao7l
1010985 // static void merge_ranks(graph_t * subg)
1011 public static void merge_ranks(Agraph_s subg) {
986 public static void merge_ranks(ST_Agraph_s subg) {
1012987 ENTERING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
1013988 try {
1014989 int i, d, r, pos, ipos;
1015 Agnode_s v;
1016 Agraph_s root;
990 ST_Agnode_s v;
991 ST_Agraph_s root;
1017992 root = dot_root(subg);
1018993 if (GD_minrank(subg) > 0)
1019994 GD_rank(root).plus(GD_minrank(subg) - 1).getPtr().setInt("valid", 0);
1020995 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
1021 d = GD_rank(subg).plus(r).getPtr().getInt("n");
1022 ipos = pos = ND_order(GD_rankleader(subg).plus(r).getPtr());
996 d = GD_rank(subg).get(r).n;
997 ipos = pos = ND_order(GD_rankleader(subg).get(r));
1023998 make_slots(root, r, pos, d);
1024 for (i = 0; i < GD_rank(subg).plus(r).getPtr().getInt("n"); i++) {
1025 v = (Agnode_s) GD_rank(subg).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1026 GD_rank(root).plus(r).getArrayOfPtr("v").plus(pos).setPtr(v);
999 for (i = 0; i < GD_rank(subg).get(r).n; i++) {
1000 v = (ST_Agnode_s) GD_rank(subg).get(r).v.get(i);
1001 GD_rank(root).get(r).v.plus(pos).setPtr(v);
10271002 ND_order(v, pos++);
10281003 /* real nodes automatically have v->root = root graph */
10291004 if (ND_node_type(v) == 1)
10321007 fast_node(root, v);
10331008 GD_n_nodes(root, GD_n_nodes(root)+1);
10341009 }
1035 GD_rank(subg).plus(r).getPtr().setPtr("v", GD_rank(root).plus(r).getPtr().getPtr("v").plus(ipos));
1036 GD_rank(root).plus(r).getPtr().setInt("valid", 0);
1010 GD_rank(subg).get(r).setPtr("v", GD_rank(root).get(r).v.plus(ipos));
1011 GD_rank(root).get(r).setInt("valid", 0);
10371012 }
10381013 if (r < GD_maxrank(root))
1039 GD_rank(root).plus(r).getPtr().setInt("valid", 0);
1014 GD_rank(root).get(r).setInt("valid", 0);
10401015 GD_expanded(subg, NOT(false));
10411016 } finally {
10421017 LEAVING("85nhs7tnmwunw0fsjj1kxao7l","merge_ranks");
10481023
10491024 //3 c9p7dm16i13qktnh95os0sv58
10501025 // static void remove_rankleaders(graph_t * g)
1051 public static void remove_rankleaders(Agraph_s g) {
1026 public static void remove_rankleaders(ST_Agraph_s g) {
10521027 ENTERING("c9p7dm16i13qktnh95os0sv58","remove_rankleaders");
10531028 try {
10541029 int r;
1055 Agnode_s v;
1056 Agedge_s e;
1030 ST_Agnode_s v;
1031 ST_Agedge_s e;
10571032 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1058 v = (Agnode_s) GD_rankleader(g).plus(r).getPtr();
1033 v = (ST_Agnode_s) GD_rankleader(g).get(r);
10591034 /* remove the entire chain */
1060 while ((e = (Agedge_s) ND_out(v).getFromList(0))!=null)
1035 while ((e = (ST_Agedge_s) ND_out(v).getFromList(0))!=null)
10611036 delete_fast_edge(e);
1062 while ((e = (Agedge_s) ND_in(v).getFromList(0))!=null)
1037 while ((e = (ST_Agedge_s) ND_in(v).getFromList(0))!=null)
10631038 delete_fast_edge(e);
10641039 delete_fast_node(dot_root(g), v);
10651040 GD_rankleader(g).plus(r).setPtr(null);
10741049
10751050 //3 ecrplg8hsyl484f9kxc5xp0go
10761051 // void expand_cluster(graph_t * subg)
1077 public static void expand_cluster(Agraph_s subg) {
1052 public static void expand_cluster(ST_Agraph_s subg) {
10781053 ENTERING("ecrplg8hsyl484f9kxc5xp0go","expand_cluster");
10791054 try {
10801055 /* build internal structure of the cluster */
10811056 class2(subg);
10821057 GD_comp(subg).size = 1;
1083 // GD_comp(subg).getArrayOfPtr("list").plus(0).setPtr(GD_nlist(subg));
1058 // GD_comp(subg).list.plus(0).setPtr(GD_nlist(subg));
10841059 GD_comp(subg).setInList(0, GD_nlist(subg));
10851060 allocate_ranks(subg);
10861061 build_ranks(subg, 0);
10981073
10991074 //3 cxuirggihlap2iv2khmb1w5l5
11001075 // void mark_clusters(graph_t * g)
1101 public static void mark_clusters(Agraph_s g) {
1076 public static void mark_clusters(ST_Agraph_s g) {
11021077 ENTERING("cxuirggihlap2iv2khmb1w5l5","mark_clusters");
11031078 try {
11041079 int c;
1105 Agnode_s n, nn=null, vn;
1106 Agedge_s orig, e;
1107 Agraph_s clust;
1080 ST_Agnode_s n, nn=null, vn;
1081 ST_Agedge_s orig, e;
1082 ST_Agraph_s clust;
11081083 /* remove sub-clusters below this level */
11091084 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
11101085 if (ND_ranktype(n) == 7)
11121087 ND_clust(n, null);
11131088 }
11141089 for (c = 1; c <= GD_n_cluster(g); c++) {
1115 clust = (Agraph_s) GD_clust(g).plus(c).getPtr();
1090 clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
11161091 for (n = agfstnode(clust); n!=null; n = nn) {
11171092 nn = agnxtnode(clust,n);
11181093 if (ND_ranktype(n) != 0) {
11311106 if ((e = ED_to_virt(orig))!=null) {
11321107 while (e!=null && ND_node_type(vn =aghead(e)) == 1) {
11331108 ND_clust(vn, clust);
1134 e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
1109 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
11351110 /* trouble if concentrators and clusters are mixed */
11361111 }
11371112 }
11481123
11491124 //3 bwrw5u0gi2rgah1cn9h0glpse
11501125 // void build_skeleton(graph_t * g, graph_t * subg)
1151 public static void build_skeleton(Agraph_s g, Agraph_s subg) {
1126 public static void build_skeleton(ST_Agraph_s g, ST_Agraph_s subg) {
11521127 ENTERING("bwrw5u0gi2rgah1cn9h0glpse","build_skeleton");
11531128 try {
11541129 int r;
1155 Agnode_s v, prev, rl;
1156 Agedge_s e;
1130 ST_Agnode_s v, prev, rl;
1131 ST_Agedge_s e;
11571132 prev = null;
1158 GD_rankleader(subg, zmalloc(sizeof_starstar_empty(Agnode_s.class, GD_maxrank(subg) + 2)));
1133 // GD_rankleader(subg, zmalloc(sizeof_starstar_empty(Agnode_s.class, GD_maxrank(subg) + 2)));
1134 GD_rankleader(subg, new ST_Agnode_s.Array(GD_maxrank(subg) + 2));
11591135 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
11601136 v = virtual_node(g);
11611137 GD_rankleader(subg).plus(r).setPtr(v);
11701146 }
11711147 /* set the counts on virtual edges of the cluster skeleton */
11721148 for (v = agfstnode(subg); v!=null; v = agnxtnode(subg, v)) {
1173 rl = (Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
1149 rl = (ST_Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
11741150 ND_UF_size(rl, ND_UF_size(rl)+1);
11751151 for (e = agfstout(subg, v); e!=null; e = agnxtout(subg, e)) {
11761152 for (r = ND_rank(agtail(e)); r < ND_rank(aghead(e)); r++) {
11791155 }
11801156 }
11811157 for (r = GD_minrank(subg); r <= GD_maxrank(subg); r++) {
1182 rl = (Agnode_s) GD_rankleader(subg).plus(r).getPtr();
1158 rl = (ST_Agnode_s) GD_rankleader(subg).get(r);
11831159 if (ND_UF_size(rl) > 1)
11841160 ND_UF_size(rl, ND_UF_size(rl)-1);
11851161 }
11931169
11941170 //3 75yt3xwcwnxipi827t1r8zcmn
11951171 // void install_cluster(graph_t * g, node_t * n, int pass, nodequeue * q)
1196 public static void install_cluster(Agraph_s g, Agnode_s n, int pass, nodequeue q) {
1172 public static void install_cluster(ST_Agraph_s g, ST_Agnode_s n, int pass, ST_nodequeue q) {
11971173 ENTERING("75yt3xwcwnxipi827t1r8zcmn","install_cluster");
11981174 try {
11991175 int r;
1200 Agraph_s clust;
1176 ST_Agraph_s clust;
12011177 clust = ND_clust(n);
12021178 if (GD_installed(clust) != pass + 1) {
12031179 for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
1204 install_in_rank(g, (Agnode_s) GD_rankleader(clust).plus(r).getPtr());
1180 install_in_rank(g, (ST_Agnode_s) GD_rankleader(clust).get(r));
12051181 for (r = GD_minrank(clust); r <= GD_maxrank(clust); r++)
1206 enqueue_neighbors(q, (Agnode_s) GD_rankleader(clust).plus(r).getPtr(), pass);
1182 enqueue_neighbors(q, (ST_Agnode_s) GD_rankleader(clust).get(r), pass);
12071183 GD_installed(clust, pass + 1);
12081184 }
12091185 } finally {
12161192
12171193 //3 4muksvb3ec03mt6cvaqpb5c7a
12181194 // void mark_lowclusters(Agraph_t * root)
1219 public static void mark_lowclusters(Agraph_s root) {
1195 public static void mark_lowclusters(ST_Agraph_s root) {
12201196 ENTERING("4muksvb3ec03mt6cvaqpb5c7a","mark_lowclusters");
12211197 try {
1222 Agnode_s n, vn;
1223 Agedge_s orig, e;
1198 ST_Agnode_s n, vn;
1199 ST_Agedge_s orig, e;
12241200 /* first, zap any previous cluster labelings */
12251201 for (n = agfstnode(root); n!=null; n = agnxtnode(root, n)) {
12261202 ND_clust(n, null);
12281204 if ((e = ED_to_virt(orig))!=null) {
12291205 while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
12301206 ND_clust(vn, null);
1231 e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
1207 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
12321208 }
12331209 }
12341210 }
12451221
12461222 //3 48j6fdymvkcgeh4wde060ctac
12471223 // static void mark_lowcluster_basic(Agraph_t * g)
1248 public static void mark_lowcluster_basic(Agraph_s g) {
1224 public static void mark_lowcluster_basic(ST_Agraph_s g) {
12491225 ENTERING("48j6fdymvkcgeh4wde060ctac","mark_lowcluster_basic");
12501226 try {
1251 Agraph_s clust;
1252 Agnode_s n, vn;
1253 Agedge_s orig, e;
1227 ST_Agraph_s clust;
1228 ST_Agnode_s n, vn;
1229 ST_Agedge_s orig, e;
12541230 int c;
12551231 for (c = 1; c <= GD_n_cluster(g); c++) {
1256 clust = (Agraph_s) GD_clust(g).plus(c).getPtr();
1232 clust = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
12571233 mark_lowcluster_basic(clust);
12581234 }
12591235 /* see what belongs to this graph that wasn't already marked */
12651241 while (e!=null && (ND_node_type(vn = aghead(e))) == 1) {
12661242 if (ND_clust(vn) == null)
12671243 ND_clust(vn, g);
1268 e = (Agedge_s) ND_out(aghead(e)).getFromList(0);
1244 e = (ST_Agedge_s) ND_out(aghead(e)).getFromList(0);
12691245 }
12701246 }
12711247 }
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class compound__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350 import smetana.core.jmp_buf;
5451
5552 public class conc__c {
310307
311308 //3 c1s4k85p1cdfn176o3uryeros
312309 // static inline pointf pointfof(double x, double y)
313 public static __struct__<pointf> pointfof(double x, double y) {
310 public static ST_pointf pointfof(double x, double y) {
314311 // WARNING!! STRUCT
315312 return pointfof_w_(x, y).copy();
316313 }
317 private static __struct__<pointf> pointfof_w_(double x, double y) {
314 private static ST_pointf pointfof_w_(double x, double y) {
318315 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
319316 try {
320 final __struct__<pointf> r = JUtils.from(pointf.class);
317 final ST_pointf r = new ST_pointf();
321318 r.setDouble("x", x);
322319 r.setDouble("y", y);
323320 return r;
346343
347344
348345
349 //3 1vvsta5i8of59frav6uymguav
350 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
351 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
352 // WARNING!! STRUCT
353 return boxfof_w_(llx, lly, urx, ury).copy();
354 }
355 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
356 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
357 try {
358 final __struct__<boxf> b = JUtils.from(boxf.class);
359 b.getStruct("LL").setDouble("x", llx);
360 b.getStruct("LL").setDouble("y", lly);
361 b.getStruct("UR").setDouble("x", urx);
362 b.getStruct("UR").setDouble("y", ury);
363 return b;
364 } finally {
365 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
366 }
367 }
368
369346
370347
371348
388365
389366 //3 arrsbik9b5tnfcbzsm8gr2chx
390367 // static inline pointf add_pointf(pointf p, pointf q)
391 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
392369 // WARNING!! STRUCT
393370 return add_pointf_w_(p.copy(), q.copy()).copy();
394371 }
395 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
396373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
397374 try {
398 final __struct__<pointf> r = JUtils.from(pointf.class);
399 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
400 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
401378 return r;
402379 } finally {
403380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
6565 import static smetana.core.Macro.ND_prev;
6666 import static smetana.core.Macro.ND_rank;
6767 import static smetana.core.Macro.UNSUPPORTED;
68 import h.Agedge_s;
69 import h.Agnode_s;
70 import h.Agraph_s;
68 import h.ST_Agedge_s;
69 import h.ST_Agnode_s;
70 import h.ST_Agraph_s;
7171 import h.ST_elist;
72 import h.boxf;
73 import h.elist;
74 import h.pointf;
75 import smetana.core.JUtils;
72 import h.ST_pointf;
7673 import smetana.core.Z;
77 import smetana.core.__array_of_struct__;
78 import smetana.core.__array_of_struct_impl__;
79 import smetana.core.__struct__;
8074
8175 public class decomp__c {
8276 //1 2digov3edok6d5srhgtlmrycs
336330
337331 //3 c1s4k85p1cdfn176o3uryeros
338332 // static inline pointf pointfof(double x, double y)
339 public static __struct__<pointf> pointfof(double x, double y) {
333 public static ST_pointf pointfof(double x, double y) {
340334 // WARNING!! STRUCT
341335 return pointfof_w_(x, y).copy();
342336 }
343 private static __struct__<pointf> pointfof_w_(double x, double y) {
337 private static ST_pointf pointfof_w_(double x, double y) {
344338 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
345339 try {
346 final __struct__<pointf> r = JUtils.from(pointf.class);
340 final ST_pointf r = new ST_pointf();
347341 r.setDouble("x", x);
348342 r.setDouble("y", y);
349343 return r;
372366
373367
374368
375 //3 1vvsta5i8of59frav6uymguav
376 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
377 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
378 // WARNING!! STRUCT
379 return boxfof_w_(llx, lly, urx, ury).copy();
380 }
381 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
382 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
383 try {
384 final __struct__<boxf> b = JUtils.from(boxf.class);
385 b.getStruct("LL").setDouble("x", llx);
386 b.getStruct("LL").setDouble("y", lly);
387 b.getStruct("UR").setDouble("x", urx);
388 b.getStruct("UR").setDouble("y", ury);
389 return b;
390 } finally {
391 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
392 }
393 }
394369
395370
396371
414389
415390 //3 arrsbik9b5tnfcbzsm8gr2chx
416391 // static inline pointf add_pointf(pointf p, pointf q)
417 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
392 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
418393 // WARNING!! STRUCT
419394 return add_pointf_w_(p.copy(), q.copy()).copy();
420395 }
421 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
396 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
422397 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
423398 try {
424 final __struct__<pointf> r = JUtils.from(pointf.class);
425 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
426 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
399 final ST_pointf r = new ST_pointf();
400 r.setDouble("x", p.x + q.x);
401 r.setDouble("y", p.y + q.y);
427402 return r;
428403 } finally {
429404 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
744719
745720 //3 7icc6b2pvnj6te1yndbel47gg
746721 // static void add_to_component(node_t * n)
747 public static void add_to_component(Agnode_s n) {
722 public static void add_to_component(ST_Agnode_s n) {
748723 ENTERING("7icc6b2pvnj6te1yndbel47gg","add_to_component");
749724 try {
750725 GD_n_nodes(Z.z().G_decomp, 1+GD_n_nodes(Z.z().G_decomp));
774749 int i;
775750 i = GD_comp(Z.z().G_decomp).size;
776751 GD_comp(Z.z().G_decomp).size = 1+GD_comp(Z.z().G_decomp).size;
777 GD_comp(Z.z().G_decomp).reallocEmpty(GD_comp(Z.z().G_decomp).size, Agnode_s.class);
752 GD_comp(Z.z().G_decomp).reallocEmpty(GD_comp(Z.z().G_decomp).size);
778753 GD_comp(Z.z().G_decomp).setInList(i ,GD_nlist(Z.z().G_decomp));
779754 } finally {
780755 LEAVING("5o8hxpr6ppi15pinuy79m7u04","end_component");
786761
787762 //3 c5u5lnfbu0pmlk6vsvyrdj8ep
788763 // static void search_component(graph_t * g, node_t * n)
789 public static void search_component(Agraph_s g, Agnode_s n) {
764 public static void search_component(ST_Agraph_s g, ST_Agnode_s n) {
790765 ENTERING("c5u5lnfbu0pmlk6vsvyrdj8ep","search_component");
791766 try {
792767 int c, i;
793 __array_of_struct__ vec = __array_of_struct_impl__.malloc(elist.class, 4);
794 Agnode_s other;
795 Agedge_s e;
768 final ST_elist vec[] = new ST_elist[] {new ST_elist(),new ST_elist(),new ST_elist(),new ST_elist()};
769 ST_Agnode_s other;
770 ST_Agedge_s e;
796771 add_to_component(n);
797 vec.plus(0).setStruct(ND_out(n));
798 vec.plus(1).setStruct(ND_in(n));
799 vec.plus(2).setStruct(ND_flat_out(n));
800 vec.plus(3).setStruct(ND_flat_in(n));
772 vec[0].setStruct(ND_out(n));
773 vec[1].setStruct(ND_in(n));
774 vec[2].setStruct(ND_flat_out(n));
775 vec[3].setStruct(ND_flat_in(n));
801776 for (c = 0; c <= 3; c++) {
802 if (((ST_elist) vec.plus(c).getStruct()).listNotNull())
803 for (i = 0; (e = (Agedge_s) ((ST_elist) vec.plus(c).getStruct()).getFromList(i))!=null; i++) {
777 if (vec[c].listNotNull())
778 for (i = 0; (e = (ST_Agedge_s) vec[c].getFromList(i))!=null; i++) {
804779 if (EQ(other = aghead(e), n))
805780 other = agtail(e);
806781 if ((ND_mark(other) != Z.z().Cmark) && (EQ(other, UF_find(other))))
817792
818793 //3 2t7r964kqtl5qrl7i57i22tqy
819794 // void decompose(graph_t * g, int pass)
820 public static void decompose(Agraph_s g, int pass) {
795 public static void decompose(ST_Agraph_s g, int pass) {
821796 ENTERING("2t7r964kqtl5qrl7i57i22tqy","decompose");
822797 try {
823 Agraph_s subg;
824 Agnode_s n, v;
798 ST_Agraph_s subg;
799 ST_Agnode_s n, v;
825800 Z.z().G_decomp = g;
826801 if (++Z.z().Cmark == 0)
827802 Z.z().Cmark = 1;
830805 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
831806 v = n;
832807 if ((pass > 0) && (subg = ND_clust(v))!=null)
833 v = (Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
808 v = (ST_Agnode_s) GD_rankleader(subg).plus(ND_rank(v)).getPtr();
834809 else if (v != UF_find(v))
835810 continue;
836811 if (ND_mark(v) != Z.z().Cmark) {
100100 import static smetana.core.Macro.ND_out;
101101 import static smetana.core.Macro.UNSUPPORTED;
102102 import static smetana.core.Macro.alloc_elist;
103 import h.Agedge_s;
104 import h.Agedgeinfo_t;
105 import h.Agnode_s;
106 import h.Agnodeinfo_t;
107 import h.Agraph_s;
108 import h.Agraphinfo_t;
109 import h.aspect_t;
110 import h.boxf;
111 import h.pack_info;
103 import h.ST_Agedge_s;
104 import h.ST_Agedgeinfo_t;
105 import h.ST_Agnode_s;
106 import h.ST_Agnodeinfo_t;
107 import h.ST_Agraph_s;
108 import h.ST_Agraphinfo_t;
109 import h.ST_aspect_t;
110 import h.ST_pack_info;
111 import h.ST_pointf;
112112 import h.pack_mode;
113 import h.pointf;
114113 import smetana.core.CString;
115 import smetana.core.JUtils;
116 import smetana.core.Memory;
117114 import smetana.core.Z;
118115 import smetana.core.__ptr__;
119 import smetana.core.__struct__;
120116
121117 public class dotinit__c {
122118 //1 2digov3edok6d5srhgtlmrycs
376372
377373 //3 c1s4k85p1cdfn176o3uryeros
378374 // static inline pointf pointfof(double x, double y)
379 public static __struct__<pointf> pointfof(double x, double y) {
375 public static ST_pointf pointfof(double x, double y) {
380376 // WARNING!! STRUCT
381377 return pointfof_w_(x, y).copy();
382378 }
383 private static __struct__<pointf> pointfof_w_(double x, double y) {
379 private static ST_pointf pointfof_w_(double x, double y) {
384380 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
385381 try {
386 final __struct__<pointf> r = JUtils.from(pointf.class);
382 final ST_pointf r = new ST_pointf();
387383 r.setDouble("x", x);
388384 r.setDouble("y", y);
389385 return r;
412408
413409
414410
415 //3 1vvsta5i8of59frav6uymguav
416 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
417 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
418 // WARNING!! STRUCT
419 return boxfof_w_(llx, lly, urx, ury).copy();
420 }
421 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
422 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
423 try {
424 final __struct__<boxf> b = JUtils.from(boxf.class);
425 b.getStruct("LL").setDouble("x", llx);
426 b.getStruct("LL").setDouble("y", lly);
427 b.getStruct("UR").setDouble("x", urx);
428 b.getStruct("UR").setDouble("y", ury);
429 return b;
430 } finally {
431 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
432 }
433 }
434411
435412
436413
454431
455432 //3 arrsbik9b5tnfcbzsm8gr2chx
456433 // static inline pointf add_pointf(pointf p, pointf q)
457 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
434 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
458435 // WARNING!! STRUCT
459436 return add_pointf_w_(p.copy(), q.copy()).copy();
460437 }
461 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
438 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
462439 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
463440 try {
464 final __struct__<pointf> r = JUtils.from(pointf.class);
465 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
466 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
441 final ST_pointf r = new ST_pointf();
442 r.setDouble("x", p.x + q.x);
443 r.setDouble("y", p.y + q.y);
467444 return r;
468445 } finally {
469446 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
764741
765742 //3 cmr94z4p2bdeiply1d4wrqwes
766743 // static void dot_init_subg(graph_t * g, graph_t* droot)
767 public static void dot_init_subg(Agraph_s g, Agraph_s droot) {
744 public static void dot_init_subg(ST_Agraph_s g, ST_Agraph_s droot) {
768745 ENTERING("cmr94z4p2bdeiply1d4wrqwes","dot_init_subg");
769746 try {
770 Agraph_s subg;
747 ST_Agraph_s subg;
771748 if (NEQ(g, agroot(g)))
772 agbindrec(g, new CString("Agraphinfo_t"), sizeof(Agraphinfo_t.class), (N(0)));
749 agbindrec(g, new CString("Agraphinfo_t"), sizeof(ST_Agraphinfo_t.class), (N(0)));
773750 if (EQ(g, droot))
774751 GD_dotroot(agroot(g), droot);
775752 for (subg = agfstsubg(g); subg!=null; subg = agnxtsubg(subg)) {
785762
786763 //3 3hk92jbrfjmn6no3svn9jvje9
787764 // static void dot_init_node(node_t * n)
788 public static void dot_init_node(Agnode_s n) {
765 public static void dot_init_node(ST_Agnode_s n) {
789766 ENTERING("3hk92jbrfjmn6no3svn9jvje9","dot_init_node");
790767 try {
791 agbindrec(n, new CString("Agnodeinfo_t"), sizeof(Agnodeinfo_t.class), (N(0))); //graph custom data
768 agbindrec(n, new CString("Agnodeinfo_t"), sizeof(ST_Agnodeinfo_t.class), (N(0))); //graph custom data
792769 common_init_node(n);
793770 gv_nodesize(n, GD_flip(agraphof(n)));
794 alloc_elist(4, ND_in(n), Agnode_s.class);
795 alloc_elist(4, ND_out(n), Agnode_s.class);
796 alloc_elist(2, ND_flat_in(n), Agnode_s.class);
797 alloc_elist(2, ND_flat_out(n), Agnode_s.class);
798 alloc_elist(2, ND_other(n), Agnode_s.class);
771 alloc_elist(4, ND_in(n));
772 alloc_elist(4, ND_out(n));
773 alloc_elist(2, ND_flat_in(n));
774 alloc_elist(2, ND_flat_out(n));
775 alloc_elist(2, ND_other(n));
799776 ND_UF_size(n, 1);
800777 } finally {
801778 LEAVING("3hk92jbrfjmn6no3svn9jvje9","dot_init_node");
807784
808785 //3 zbvhnhd78bppq8wb872847bj
809786 // static void dot_init_edge(edge_t * e)
810 public static void dot_init_edge(Agedge_s e) {
787 public static void dot_init_edge(ST_Agedge_s e) {
811788 ENTERING("zbvhnhd78bppq8wb872847bj","dot_init_edge");
812789 try {
813790 CString tailgroup, headgroup;
814 agbindrec(e, new CString("Agedgeinfo_t"), sizeof(Agedgeinfo_t.class), (N(0))); //graph custom data
791 agbindrec(e, new CString("Agedgeinfo_t"), sizeof(ST_Agedgeinfo_t.class), (N(0))); //graph custom data
815792 common_init_edge(e);
816793 ED_weight(e, late_int(e, Z.z().E_weight, 1, 0));
817794 tailgroup = late_string(agtail(e), Z.z().N_group, new CString(""));
838815
839816 //3 2ylyhz7macit0ts1hap2tg3wy
840817 // void dot_init_node_edge(graph_t * g)
841 public static void dot_init_node_edge(Agraph_s g) {
818 public static void dot_init_node_edge(ST_Agraph_s g) {
842819 ENTERING("2ylyhz7macit0ts1hap2tg3wy","dot_init_node_edge");
843820 try {
844 Agnode_s n;
845 Agedge_s e;
821 ST_Agnode_s n;
822 ST_Agedge_s e;
846823 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
847824 dot_init_node(n);
848825 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
10711048
10721049 //3 7t18nggek2s9vvb5opwqa8rwr
10731050 // static void dotLayout(Agraph_t * g)
1074 public static void dotLayout(Agraph_s g) {
1051 public static void dotLayout(ST_Agraph_s g) {
10751052 ENTERING("7t18nggek2s9vvb5opwqa8rwr","dotLayout");
10761053 try {
1077 aspect_t aspect = (aspect_t) Memory.malloc(aspect_t.class);
1078 aspect_t asp;
1054 ST_aspect_t aspect = new ST_aspect_t();
1055 ST_aspect_t asp;
10791056 int maxphase = late_int(g, (agattr(g,AGRAPH,new CString("phase"),null)), -1, 1);
10801057 setEdgeType (g, (5 << 1));
10811058 asp = setAspect (g, aspect);
10871064 attach_phase_attrs (g, 1);
10881065 return;
10891066 }
1090 if (aspect.getBoolean("badGraph")) {
1067 if (aspect.badGraph!=0) {
10911068 UNSUPPORTED("1yu5j8tk43i6jlmu8wk9jks15"); // agerr(AGWARN, "dot does not support the aspect attribute for disconnected graphs or graphs with clusters\n");
10921069 UNSUPPORTED("5uwp9z6jkv5uc30iyfszyg6dw"); // asp = NULL;
10931070 UNSUPPORTED("28kbszyxsjoj03gb134ov4hag"); // aspect.nextIter = 0;
11021079 attach_phase_attrs (g, 2); /* positions will be attached on output */
11031080 return;
11041081 }
1105 aspect.setInt("nPasses", aspect.getInt("nPasses") -1);
1106 } while (aspect.getInt("nextIter")!=0 && aspect.getInt("nPasses")!=0);
1082 aspect.setInt("nPasses", aspect.nPasses -1);
1083 } while (aspect.nextIter!=0 && aspect.nPasses!=0);
11071084 if ((GD_flags(g) & (1 << 4))!=0)
11081085 removeFill (g);
11091086 dot_sameports(g);
11901167
11911168 //3 nedairhdof6qkmjjoh4h68zy
11921169 // static void doDot (Agraph_t* g)
1193 public static void doDot(Agraph_s g) {
1170 public static void doDot(ST_Agraph_s g) {
11941171 ENTERING("nedairhdof6qkmjjoh4h68zy","doDot");
11951172 try {
1196 Agraph_s ccs[];
1197 Agraph_s sg;
1173 ST_Agraph_s ccs[];
1174 ST_Agraph_s sg;
11981175 int ncc;
11991176 int i;
1200 pack_info pinfo = (pack_info) Memory.malloc(pack_info.class);
1177 final ST_pack_info pinfo = new ST_pack_info();
12011178 int Pack = getPack(g, -1, 8);
12021179 int mode = getPackModeInfo (g, enumAsInt(pack_mode.class, "l_undef"), pinfo);
12031180 getPackInfo(g, enumAsInt(pack_mode.class, "l_node"), 8, pinfo);
12521229
12531230 //3 euvc3uoksq3e24augkwebfkcv
12541231 // void dot_layout(Agraph_t * g)
1255 public static void dot_layout(Agraph_s g) {
1232 public static void dot_layout(ST_Agraph_s g) {
12561233 ENTERING("euvc3uoksq3e24augkwebfkcv","dot_layout");
12571234 try {
12581235 if (agnnodes(g)!=0) doDot (g);
12671244
12681245 //3 ca52dadcp7m8x0bqhaw4tvtaw
12691246 // Agraph_t * dot_root (void* p)
1270 public static Agraph_s dot_root(__ptr__ p) {
1247 public static ST_Agraph_s dot_root(__ptr__ p) {
12711248 ENTERING("ca52dadcp7m8x0bqhaw4tvtaw","dot_root");
12721249 try {
12731250 return GD_dotroot(agroot(p));
5050 import static gen.lib.cgraph.node__c.agfstnode;
5151 import static gen.lib.cgraph.node__c.agnxtnode;
5252 import static gen.lib.cgraph.obj__c.agraphof;
53 import static gen.lib.common.memory__c.gmalloc;
5453 import static gen.lib.common.memory__c.zmalloc;
5554 import static gen.lib.common.routespl__c.makeStraightEdge;
5655 import static gen.lib.common.routespl__c.routepolylines;
7271 import static smetana.core.JUtils.function;
7372 import static smetana.core.JUtils.qsort;
7473 import static smetana.core.JUtils.sizeof;
75 import static smetana.core.JUtils.sizeof_starstar_empty;
7674 import static smetana.core.JUtilsDebug.ENTERING;
7775 import static smetana.core.JUtilsDebug.LEAVING;
7876 import static smetana.core.Macro.ABS;
7977 import static smetana.core.Macro.AGSEQ;
80 import static smetana.core.Macro.ALLOC_empty;
78 import static smetana.core.Macro.ALLOC_allocated_ST_Agedge_s;
8179 import static smetana.core.Macro.BETWEEN;
8280 import static smetana.core.Macro.ED_adjacent;
8381 import static smetana.core.Macro.ED_edge_type;
120118 import static smetana.core.Macro.ND_rank;
121119 import static smetana.core.Macro.ND_rw;
122120 import static smetana.core.Macro.NOT;
121 import static smetana.core.Macro.NOTI;
123122 import static smetana.core.Macro.ROUND;
124123 import static smetana.core.Macro.UNSUPPORTED;
125 import h.Agedge_s;
126 import h.Agedgeinfo_t;
127 import h.Agedgepair_s;
128 import h.Agnode_s;
129 import h.Agraph_s;
130 import h.Ppoly_t;
124 import h.ST_Agedge_s;
125 import h.ST_Agedgeinfo_t;
126 import h.ST_Agedgepair_s;
127 import h.ST_Agnode_s;
128 import h.ST_Agraph_s;
129 import h.ST_Ppoly_t;
130 import h.ST_bezier;
131131 import h.ST_boxf;
132 import h.ST_path;
133 import h.ST_pathend_t;
134 import h.ST_pointf;
132135 import h.ST_port;
136 import h.ST_rank_t;
137 import h.ST_spline_info_t;
138 import h.ST_splines;
133139 import h.attr_state_t;
134 import h.bezier;
135 import h.boxf;
136 import h.path;
137 import h.pathend_t;
138 import h.pointf;
139 import h.spline_info_t;
140 import h.splines;
141 import smetana.core.JUtils;
142140 import smetana.core.Memory;
143141 import smetana.core.Z;
144 import smetana.core.__array_of_struct__;
145 import smetana.core.__array_of_struct_impl__;
146142 import smetana.core.__ptr__;
147 import smetana.core.__struct__;
148143
149144 public class dotsplines__c {
150145 //1 2digov3edok6d5srhgtlmrycs
404399
405400 //3 c1s4k85p1cdfn176o3uryeros
406401 // static inline pointf pointfof(double x, double y)
407 public static __struct__<pointf> pointfof(double x, double y) {
402 public static ST_pointf pointfof(double x, double y) {
408403 // WARNING!! STRUCT
409404 return pointfof_w_(x, y).copy();
410405 }
411 private static __struct__<pointf> pointfof_w_(double x, double y) {
406 private static ST_pointf pointfof_w_(double x, double y) {
412407 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
413408 try {
414 final __struct__<pointf> r = JUtils.from(pointf.class);
409 final ST_pointf r = new ST_pointf();
415410 r.setDouble("x", x);
416411 r.setDouble("y", y);
417412 return r;
482477
483478 //3 arrsbik9b5tnfcbzsm8gr2chx
484479 // static inline pointf add_pointf(pointf p, pointf q)
485 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
480 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
486481 // WARNING!! STRUCT
487482 return add_pointf_w_(p.copy(), q.copy()).copy();
488483 }
489 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
484 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
490485 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
491486 try {
492 final __struct__<pointf> r = JUtils.from(pointf.class);
493 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
494 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
487 final ST_pointf r = new ST_pointf();
488 r.setDouble("x", p.x + q.x);
489 r.setDouble("y", p.y + q.y);
495490 return r;
496491 } finally {
497492 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
792787
793788 //3 dobhmc46zwtvv8rg3ywntl91j
794789 // static edge_t* getmainedge(edge_t * e)
795 public static Agedge_s getmainedge(Agedge_s e) {
790 public static ST_Agedge_s getmainedge(ST_Agedge_s e) {
796791 ENTERING("dobhmc46zwtvv8rg3ywntl91j","getmainedge");
797792 try {
798 Agedge_s le = e;
793 ST_Agedge_s le = e;
799794 while (ED_to_virt(le)!=null)
800795 le = ED_to_virt(le);
801796 while (ED_to_orig(le)!=null)
811806
812807 //3 ddeny5ht7w8b16ztj5zt840ld
813808 // static boolean spline_merge(node_t * n)
814 public static boolean spline_merge(Agnode_s n) {
809 public static boolean spline_merge(ST_Agnode_s n) {
815810 ENTERING("ddeny5ht7w8b16ztj5zt840ld","spline_merge");
816811 try {
817812 return ((ND_node_type(n) == 1)
826821
827822 //3 36ofw2qfqlh5ci8gc8cfkqgg3
828823 // static boolean swap_ends_p(edge_t * e)
829 public static boolean swap_ends_p(Agedge_s e) {
824 public static boolean swap_ends_p(ST_Agedge_s e) {
830825 ENTERING("36ofw2qfqlh5ci8gc8cfkqgg3","swap_ends_p");
831826 try {
832827 while (ED_to_orig(e)!=null)
883878
884879 //3 10wbtt4gwnxgqutinpj4ymjpk
885880 // static void swap_bezier(bezier * old, bezier * new)
886 public static void swap_bezier(__ptr__ old, __ptr__ new_) {
881 public static void swap_bezier(ST_bezier.Array2 old, ST_bezier.Array2 new_) {
887882 ENTERING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
888883 try {
889 __ptr__ list;
890 __ptr__ lp;
891 __ptr__ olp;
884 ST_pointf.Array list;
885 ST_pointf.Array lp;
886 ST_pointf.Array olp;
892887 int i, sz;
893 sz = old.getInt("size");
894 list = gmalloc(sizeof(pointf.class, sz));
888 sz = old.getStruct().size;
889 list = new ST_pointf.Array(sz);
895890 lp = list;
896 olp = old.getArrayOfPtr("list").plus(sz - 1).asPtr();
891 olp = old.getStruct().list.plus(sz - 1);
897892 for (i = 0; i < sz; i++) { /* reverse list of points */
898893 lp.getStruct().___(olp.getStruct());
899894 lp=lp.plus(1);
901896 }
902897 new_.setPtr("list", list);
903898 new_.setInt("size", sz);
904 new_.setInt("sflag", old.getInt("eflag"));
905 new_.setInt("eflag", old.getInt("sflag"));
906 new_.setStruct("sp", old.getStruct("ep"));
907 new_.setStruct("ep", old.getStruct("sp"));
899 new_.setInt("sflag", old.getStruct().eflag);
900 new_.setInt("eflag", old.getStruct().sflag);
901 new_.setStruct("sp", old.getStruct().ep);
902 new_.setStruct("ep", old.getStruct().sp);
908903 } finally {
909904 LEAVING("10wbtt4gwnxgqutinpj4ymjpk","swap_bezier");
910905 }
915910
916911 //3 3256l3e2huarsy29dd97vqj85
917912 // static void swap_spline(splines * s)
918 public static void swap_spline(splines s) {
913 public static void swap_spline(ST_splines s) {
919914 ENTERING("3256l3e2huarsy29dd97vqj85","swap_spline");
920915 try {
921 __ptr__ list;
922 __ptr__ lp;
923 __ptr__ olp;
916 ST_bezier.Array2 list;
917 ST_bezier.Array2 lp;
918 ST_bezier.Array2 olp;
924919 int i, sz;
925 sz = s.getInt("size");
926 list = gmalloc(sizeof(bezier.class, sz));
920 sz = s.size;
921 list = new ST_bezier.Array2(sz);
927922 lp = list;
928 olp = s.getArrayOfPtr("list").plus(sz - 1).asPtr();
923 olp = s.list.plus(sz - 1);
929924 for (i = 0; i < sz; i++) { /* reverse and swap list of beziers */
930925 swap_bezier(olp, lp);
931926 olp = olp.plus(-1);
933928 }
934929 /* free old structures */
935930 for (i = 0; i < sz; i++)
936 Memory.free(s.getArrayOfPtr("list").plus(i).getPtr().getArrayOfPtr("list"));
937 Memory.free(s.getArrayOfPtr("list"));
938 s.setPtr("list", list);
931 Memory.free(((ST_bezier)s.list.get(i)).getPtr().list);
932 Memory.free(s.list);
933 s.list = (ST_bezier.Array2) list;
939934 } finally {
940935 LEAVING("3256l3e2huarsy29dd97vqj85","swap_spline");
941936 }
946941
947942 //3 dgkssqjj566ifra0xy7m46qsb
948943 // static void edge_normalize(graph_t * g)
949 public static void edge_normalize(Agraph_s g) {
944 public static void edge_normalize(ST_Agraph_s g) {
950945 ENTERING("dgkssqjj566ifra0xy7m46qsb","edge_normalize");
951946 try {
952 Agedge_s e;
953 Agnode_s n;
947 ST_Agedge_s e;
948 ST_Agnode_s n;
954949 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
955950 for (e = agfstout(g, n); e!=null; e = agnxtout(g, e)) {
956 if ((Boolean)Z.z().sinfo.call("swapEnds", e) && ED_spl(e)!=null)
951 if ((Boolean)Z.z().sinfo.swapEnds.exe(e) && ED_spl(e)!=null)
957952 swap_spline(ED_spl(e));
958953 }
959954 }
10201015
10211016 //3 6agx6m2qof9lg57co232lwakj
10221017 // static void _dot_splines(graph_t * g, int normalize)
1023 static void _dot_splines(Agraph_s g, int normalize)
1018 static void _dot_splines(ST_Agraph_s g, int normalize)
10241019 {
10251020 ENTERING("6agx6m2qof9lg57co232lwakj","_dot_splines");
10261021 try {
10271022 int i, j, k, n_nodes, n_edges, ind, cnt;
1028 Agnode_s n;
1029 final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class);
1030 final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class);
1031 Agedge_s e, e0, e1, ea, eb, le0, le1;
1032 __ptr__ edges;
1033 path P;
1034 final __struct__<spline_info_t> sd = JUtils.from(spline_info_t.class);
1023 ST_Agnode_s n;
1024 final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t();
1025 final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s();
1026 ST_Agedge_s e, e0, e1, ea, eb, le0, le1;
1027 ST_Agedge_s.ArrayOfStar edges;
1028 ST_path P;
1029 final ST_spline_info_t sd = new ST_spline_info_t();
10351030 int et = (GD_flags(g) & (7 << 1));
1036 fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
1037 fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
1031 fwdedgea.out.base.setPtr("data", fwdedgeai);
1032 fwdedgeb.out.base.setPtr("data", fwdedgebi);
10381033 if (et == (0 << 1)) return;
10391034 if (et == (2 << 1)) {
10401035 resetRW (g);
10501045 }
10511046 mark_lowclusters(g);
10521047 if (routesplinesinit()!=0) return;
1053 P = (path) zmalloc(sizeof(path.class));
1048 P = (ST_path) zmalloc(sizeof(ST_path.class));
10541049 /* FlatHeight = 2 * GD_nodesep(g); */
10551050 sd.setInt("Splinesep", GD_nodesep(g) / 4);
10561051 sd.setInt("Multisep", GD_nodesep(g));
1057 edges = zmalloc(sizeof_starstar_empty(Agedge_s.class, 128));
1052 edges = new ST_Agedge_s.ArrayOfStar(128);
10581053 /* compute boundaries and list of splines */
10591054 sd.setInt("RightBound", 0);
10601055 sd.setInt("LeftBound", 0);
10611056 n_edges = n_nodes = 0;
10621057 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
1063 n_nodes += GD_rank(g).plus(i).getInt("n");
1064 if ((n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(0).getPtr())!=null)
1065 sd.setInt("LeftBound", (int)MIN(sd.getInt("LeftBound"), (ND_coord(n).getDouble("x") - ND_lw(n))));
1066 if (GD_rank(g).plus(i).getInt("n")!=0 && (n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(GD_rank(g).plus(i).getInt("n") - 1).getPtr())!=null)
1067 sd.setInt("RightBound", (int)MAX(sd.getInt("RightBound"), (ND_coord(n).getDouble("x") + ND_rw(n))));
1068 sd.setInt("LeftBound", sd.getInt("LeftBound") - 16);
1069 sd.setInt("RightBound", sd.getInt("RightBound") + 16);
1070 for (j = 0; j < GD_rank(g).plus(i).getInt("n"); j++) {
1071 n = (Agnode_s) GD_rank(g).plus(i).getArrayOfPtr("v").plus(j).getPtr();
1058 n_nodes += GD_rank(g).get(i).n;
1059 if ((n = (ST_Agnode_s) GD_rank(g).get(i).v.get(0))!=null)
1060 sd.setInt("LeftBound", (int)MIN(sd.LeftBound, (ND_coord(n).x - ND_lw(n))));
1061 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)
1062 sd.setInt("RightBound", (int)MAX(sd.RightBound, (ND_coord(n).x + ND_rw(n))));
1063 sd.setInt("LeftBound", sd.LeftBound - 16);
1064 sd.setInt("RightBound", sd.RightBound + 16);
1065 for (j = 0; j < GD_rank(g).get(i).n; j++) {
1066 n = (ST_Agnode_s) GD_rank(g).get(i).v.get(j);
10721067 /* if n is the label of a flat edge, copy its position to
10731068 * the label.
10741069 */
10751070 if (ND_alg(n)!=null) {
1076 Agedge_s fe = (Agedge_s) ND_alg(n);
1071 ST_Agedge_s fe = (ST_Agedge_s) ND_alg(n);
10771072 assert (ED_label(fe)!=null);
10781073 ED_label(fe).setStruct("pos", ND_coord(n));
1079 ED_label(fe).setBoolean("set", NOT(false));
1074 ED_label(fe).set= NOTI(false);
10801075 }
10811076 if ((ND_node_type(n) != 0) &&
1082 ((Boolean)Z.z().sinfo.call("splineMerge", n) == false))
1077 ((Boolean)Z.z().sinfo.splineMerge.exe(n) == false))
10831078 continue;
1084 for (k = 0; (e = (Agedge_s) ND_out(n).getFromList(k))!=null; k++) {
1079 for (k = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(k))!=null; k++) {
10851080 if ((ED_edge_type(e) == 4)
10861081 || (ED_edge_type(e) == 6))
10871082 continue;
10881083 setflags(e, 1, 16, 64);
10891084 edges.plus(n_edges++).setPtr(e);
10901085 if (n_edges % 128 == 0)
1091 edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
1086 edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
10921087 }
10931088 if (ND_flat_out(n).listNotNull())
1094 for (k = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(k))!=null; k++) {
1089 for (k = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(k))!=null; k++) {
10951090 setflags(e, 2, 0, 128);
10961091 edges.plus(n_edges++).setPtr(e);
10971092 if (n_edges % 128 == 0)
1098 edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
1093 edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
10991094 }
11001095 if (ND_other(n).listNotNull()) {
11011096 /* In position, each node has its rw stored in mval and,
11081103 ND_rw(n, ND_mval(n));
11091104 ND_mval(n, tmp);
11101105 }
1111 for (k = 0; (e = (Agedge_s) ND_other(n).getFromList(k))!=null; k++) {
1106 for (k = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(k))!=null; k++) {
11121107 setflags(e, 0, 0, 128);
11131108 edges.plus(n_edges++).setPtr(e);
11141109 if (n_edges % 128 == 0)
1115 edges = ALLOC_empty (n_edges + 128, edges, Agedge_s.class);
1110 edges = ALLOC_allocated_ST_Agedge_s (edges, n_edges + 128);
11161111 }
11171112 }
11181113 }
11261121 LOG2("_dot_splines::n_edges="+n_edges);
11271122 qsort(edges,
11281123 n_edges,
1129 sizeof(edges.plus(0)),
11301124 function(dotsplines__c.class, "edgecmp"));
11311125 /* FIXME: just how many boxes can there be? */
1132 P.setPtr("boxes", zmalloc(sizeof(boxf.class, n_nodes + 20 * 2 * 9)));
1133 sd.setPtr("Rank_box", zmalloc(sizeof(boxf.class, i)));
1126 P.boxes = ST_boxf.malloc(n_nodes + 20 * 2 * 9);
1127 sd.Rank_box = ST_boxf.malloc(i);
11341128 if (et == (1 << 1)) {
11351129 /* place regular edge labels */
11361130 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
11421136 for (i = 0; i < n_edges;) {
11431137 boolean havePorts;
11441138 ind = i;
1145 le0 = getmainedge((e0 = (Agedge_s) edges.plus(i++).getPtr()));
1139 le0 = getmainedge((e0 = (ST_Agedge_s) edges.plus(i++).getPtr()));
11461140 if (ED_tail_port(e0).defined!=0 || ED_head_port(e0).defined!=0) {
11471141 havePorts = NOT(false);
11481142 ea = e0;
11511145 ea = le0;
11521146 }
11531147 if ((ED_tree_index(ea) & 32)!=0) {
1154 MAKEFWDEDGE(fwdedgea.getStruct("out").amp(), ea);
1155 ea = (Agedge_s) fwdedgea.getStruct("out").amp();
1148 MAKEFWDEDGE(fwdedgea.out, ea);
1149 ea = (ST_Agedge_s) fwdedgea.out;
11561150 }
11571151 for (cnt = 1; i < n_edges; cnt++, i++) {
1158 if (NEQ(le0, (le1 = getmainedge((e1 = (Agedge_s) edges.plus(i).getPtr())))))
1152 if (NEQ(le0, (le1 = getmainedge((e1 = (ST_Agedge_s) edges.get(i))))))
11591153 break;
11601154 if (ED_adjacent(e0)!=0) continue; /* all flat adjacent edges at once */
11611155 if (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) {
11681162 eb = le1;
11691163 }
11701164 if ((ED_tree_index(eb) & 32)!=0) {
1171 MAKEFWDEDGE(fwdedgeb.getStruct("out").amp(), eb);
1172 eb = (Agedge_s) fwdedgeb.getStruct("out").amp();
1165 MAKEFWDEDGE(fwdedgeb.out, eb);
1166 eb = (ST_Agedge_s) fwdedgeb.out;
11731167 }
11741168 if (portcmp(ED_tail_port(ea), ED_tail_port(eb))!=0)
11751169 break;
11781172 if ((ED_tree_index(e0) & 15) == 2
11791173 && NEQ(ED_label(e0), ED_label(e1)))
11801174 break;
1181 if ((ED_tree_index(edges.plus(i).getPtr()) & 64)!=0) /* Aha! -C is on */
1175 if ((ED_tree_index(edges.get(i)) & 64)!=0) /* Aha! -C is on */
11821176 break;
11831177 }
11841178 if (EQ(agtail(e0), aghead(e0))) {
11871181 r = ND_rank(n);
11881182 if (r == GD_maxrank(g)) {
11891183 if (r > 0)
1190 sizey = (int) (ND_coord(GD_rank(g).plus(r-1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y"));
1184 sizey = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y);
11911185 else
11921186 sizey = (int) ND_ht(n);
11931187 }
11941188 else if (r == GD_minrank(g)) {
1195 sizey = (int)(ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y"));
1189 sizey = (int)(ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y);
11961190 }
11971191 else {
1198 int upy = (int) (ND_coord(GD_rank(g).plus(r-1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - ND_coord(n).getDouble("y"));
1199 int dwny = (int) (ND_coord(n).getDouble("y") - ND_coord(GD_rank(g).plus(r+1).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y"));
1192 int upy = (int) (ND_coord(GD_rank(g).get(r-1).v.get(0)).y - ND_coord(n).y);
1193 int dwny = (int) (ND_coord(n).y - ND_coord(GD_rank(g).get(r+1).v.get(0)).y);
12001194 sizey = MIN(upy, dwny);
12011195 }
1202 makeSelfEdge(P, edges, ind, cnt, sd.getInt("Multisep"), sizey/2, Z.z().sinfo.amp());
1196 makeSelfEdge(P, edges, ind, cnt, sd.Multisep, sizey/2, Z.z().sinfo);
12031197 for (b = 0; b < cnt; b++) {
1204 e = (Agedge_s) edges.plus(ind+b).getPtr();
1198 e = (ST_Agedge_s) edges.plus(ind+b).getPtr();
12051199 if (ED_label(e)!=null)
12061200 updateBB(g, ED_label(e));
12071201 }
12081202 }
12091203 else if (ND_rank(agtail(e0)) == ND_rank(aghead(e0))) {
1210 make_flat_edge(g, sd.amp(), P, edges, ind, cnt, et);
1204 make_flat_edge(g, sd, P, edges, ind, cnt, et);
12111205 }
12121206 else
1213 make_regular_edge(g, sd.amp(), P, edges, ind, cnt, et);
1207 make_regular_edge(g, sd, P, edges, ind, cnt, et);
12141208 }
12151209 /* place regular edge labels */
12161210 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
12481242 /* end vladimir */
12491243 if (et != (2 << 1)) {
12501244 Memory.free(edges);
1251 Memory.free(P.getPtr("boxes"));
1245 Memory.free(P.boxes);
12521246 Memory.free(P);
1253 Memory.free(sd.getPtr("Rank_box"));
1247 Memory.free(sd.Rank_box);
12541248 routesplinesterm();
12551249 }
12561250 Z.z().State = 1;
12651259
12661260 //3 5n306wbdfjbfnimdo9lg6jjaa
12671261 // void dot_splines(graph_t * g)
1268 public static void dot_splines(Agraph_s g) {
1262 public static void dot_splines(ST_Agraph_s g) {
12691263 ENTERING("5n306wbdfjbfnimdo9lg6jjaa","dot_splines");
12701264 try {
12711265 _dot_splines (g, 1);
12791273
12801274 //3 8jja9ukzsq8tlb9yy7uzavg91
12811275 // static void place_vnlabel(node_t * n)
1282 public static void place_vnlabel(Agnode_s n) {
1276 public static void place_vnlabel(ST_Agnode_s n) {
12831277 ENTERING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
12841278 try {
1285 final __struct__<pointf> dimen = JUtils.from(pointf.class);
1279 final ST_pointf dimen = new ST_pointf();
12861280 double width;
1287 Agedge_s e;
1281 ST_Agedge_s e;
12881282 if (ND_in(n).size == 0)
12891283 return; /* skip flat edge labels here */
1290 for (e = (Agedge_s) ND_out(n).getFromList(0); ED_edge_type(e) != 0;
1284 for (e = (ST_Agedge_s) ND_out(n).getFromList(0); ED_edge_type(e) != 0;
12911285 e = ED_to_orig(e));
1292 dimen.___(ED_label(e).getStruct("dimen"));
1293 width = GD_flip(agraphof(n))!=0 ? dimen.getDouble("y") : dimen.getDouble("x");
1294 ED_label(e).getStruct("pos").setDouble("x", ND_coord(n).getDouble("x") + width / 2.0);
1295 ED_label(e).getStruct("pos").setDouble("y", ND_coord(n).getDouble("y"));
1296 ED_label(e).setBoolean("set", NOT(false));
1286 dimen.___(ED_label(e).dimen);
1287 width = GD_flip(agraphof(n))!=0 ? dimen.y : dimen.x;
1288 ED_label(e).pos.setDouble("x", ND_coord(n).x + width / 2.0);
1289 ED_label(e).pos.setDouble("y", ND_coord(n).y);
1290 ED_label(e).set= NOTI(false);
12971291 } finally {
12981292 LEAVING("8jja9ukzsq8tlb9yy7uzavg91","place_vnlabel");
12991293 }
13041298
13051299 //3 598jn37hjkm7j0kcg2nmdvlwq
13061300 // static void setflags(edge_t *e, int hint1, int hint2, int f3)
1307 public static void setflags(Agedge_s e, int hint1, int hint2, int f3) {
1301 public static void setflags(ST_Agedge_s e, int hint1, int hint2, int f3) {
13081302 ENTERING("598jn37hjkm7j0kcg2nmdvlwq","setflags");
13091303 try {
13101304 int f1, f2;
13451339 public static int edgecmp(__ptr__ ptr0, __ptr__ ptr1) {
13461340 ENTERING("1nf1s6wkn35ptjn884ii56fh","edgecmp");
13471341 try {
1348 final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class);
1349 final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class);
1350 Agedge_s e0, e1, ea, eb, le0, le1;
1342 final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t();
1343 final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s();
1344 ST_Agedge_s e0, e1, ea, eb, le0, le1;
13511345 int et0, et1, v0, v1, rv;
13521346 double t0, t1;
1353 fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
1354 fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
1355 e0 = (Agedge_s) ptr0.getPtr();
1356 e1 = (Agedge_s) ptr1.getPtr();
1347 fwdedgea.out.base.setPtr("data", fwdedgeai);
1348 fwdedgeb.out.base.setPtr("data", fwdedgebi);
1349 e0 = (ST_Agedge_s) ptr0.getPtr();
1350 e1 = (ST_Agedge_s) ptr1.getPtr();
13571351 et0 = ED_tree_index(e0) & 15;
13581352 et1 = ED_tree_index(e1) & 15;
13591353 if (et0 != et1)
13661360 v1 = ABS((int)t1);
13671361 if (v0 != v1)
13681362 return (v0 - v1);
1369 t0 = ND_coord(agtail(le0)).getDouble("x") - ND_coord(aghead(le0)).getDouble("x");
1370 t1 = ND_coord(agtail(le1)).getDouble("x") - ND_coord(aghead(le1)).getDouble("x");
1363 t0 = ND_coord(agtail(le0)).x - ND_coord(aghead(le0)).x;
1364 t1 = ND_coord(agtail(le1)).x - ND_coord(aghead(le1)).x;
13711365 v0 = ABS((int)t0);
13721366 v1 = ABS((int)t1);
13731367 if (v0 != v1)
13771371 return (AGSEQ(le0) - AGSEQ(le1));
13781372 ea = (ED_tail_port(e0).defined!=0 || ED_head_port(e0).defined!=0) ? e0 : le0;
13791373 if ((ED_tree_index(ea) & 32)!=0) {
1380 MAKEFWDEDGE(fwdedgea.getStruct("out").amp(), ea);
1381 ea = fwdedgea.getStruct("out").amp();
1374 MAKEFWDEDGE(fwdedgea.out, ea);
1375 ea = (ST_Agedge_s) fwdedgea.out;
13821376 }
13831377 eb = (ED_tail_port(e1).defined!=0 || ED_head_port(e1).defined!=0) ? e1 : le1;
13841378 if ((ED_tree_index(eb) & 32)!=0) {
1385 MAKEFWDEDGE(fwdedgeb.getStruct("out").amp(), eb);
1386 eb = fwdedgeb.getStruct("out").amp();
1379 MAKEFWDEDGE(fwdedgeb.out, eb);
1380 eb = (ST_Agedge_s) fwdedgeb.out;
13871381 }
13881382 if ((rv = portcmp(ED_tail_port(ea), ED_tail_port(eb)))!=0)
13891383 return rv;
16771671 public static int edgelblcmpfn(__ptr__ ptr0, __ptr__ ptr1) {
16781672 ENTERING("bmsa24i3avg14po4sp17yh89k","edgelblcmpfn");
16791673 try {
1680 Agedge_s e0, e1;
1681 final __struct__<pointf> sz0 = JUtils.from(pointf.class), sz1 = JUtils.from(pointf.class);
1682 e0 = (Agedge_s) ptr0.getPtr();
1683 e1 = (Agedge_s) ptr1.getPtr();
1674 ST_Agedge_s e0, e1;
1675 final ST_pointf sz0 = new ST_pointf(), sz1 = new ST_pointf();
1676 e0 = (ST_Agedge_s) ptr0.getPtr();
1677 e1 = (ST_Agedge_s) ptr1.getPtr();
16841678 if (ED_label(e0)!=null) {
16851679 if (ED_label(e1)!=null) {
1686 sz0.___(ED_label(e0).getStruct("dimen"));
1687 sz1.___(ED_label(e1).getStruct("dimen"));
1688 if (sz0.getDouble("x") > sz1.getDouble("x")) return -1;
1689 else if (sz0.getDouble("x") < sz1.getDouble("x")) return 1;
1690 else if (sz0.getDouble("y") > sz1.getDouble("y")) return -1;
1691 else if (sz0.getDouble("y") < sz1.getDouble("y")) return 1;
1680 sz0.___(ED_label(e0).dimen);
1681 sz1.___(ED_label(e1).dimen);
1682 if (sz0.x > sz1.x) return -1;
1683 else if (sz0.x < sz1.x) return 1;
1684 else if (sz0.y > sz1.y) return -1;
1685 else if (sz0.y < sz1.y) return 1;
16921686 else return 0;
16931687 }
16941688 else
17091703
17101704 //3 3xmylrnypvoqrj2yrxnomsj5k
17111705 // static void makeSimpleFlatLabels (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et, int n_lbls)
1712 public static void makeSimpleFlatLabels(Agnode_s tn, Agnode_s hn, __ptr__ edges, int ind, int cnt, int et, int n_lbls) {
1706 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) {
17131707 ENTERING("3xmylrnypvoqrj2yrxnomsj5k","makeSimpleFlatLabels");
17141708 try {
1715 pointf ps;
1716 final __struct__<Ppoly_t> poly = JUtils.from(Ppoly_t.class);
1709 ST_pointf.Array ps;
1710 final ST_Ppoly_t poly = new ST_Ppoly_t();
17171711 int pn[] = new int[1];
1718 Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
1719 final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
1720 final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
1712 ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
1713 final ST_pointf.Array points = new ST_pointf.Array(10);
1714 final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
17211715 int i, pointn;
17221716 double leftend, rightend, ctrx=0, ctry=0, miny, maxy;
17231717 double uminx=0, umaxx=0;
17241718 double lminx=0, lmaxx=0;
1725 __ptr__ earray = zmalloc(sizeof_starstar_empty(Agedge_s.class, cnt));
1719 ST_Agedge_s.ArrayOfStar earray = new ST_Agedge_s.ArrayOfStar(cnt);
17261720 for (i = 0; i < cnt; i++) {
17271721 earray.plus(i).setPtr(edges.plus(ind + i).getPtr());
17281722 }
17291723 qsort(earray,
17301724 cnt,
1731 sizeof(earray.plus(0)),
17321725 function(dotsplines__c.class, "edgelblcmpfn"));
1733 tp.___(add_pointf(ND_coord(tn), ED_tail_port(e).getStruct("p")));
1734 hp.___(add_pointf(ND_coord(hn), ED_head_port(e).getStruct("p")));
1735 leftend = tp.getDouble("x")+ND_rw(tn);
1736 rightend = hp.getDouble("x")-ND_lw(hn);
1726 tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p));
1727 hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
1728 leftend = tp.x+ND_rw(tn);
1729 rightend = hp.x-ND_lw(hn);
17371730 ctrx = (leftend + rightend)/2.0;
17381731 /* do first edge */
1739 e = (Agedge_s) earray.plus(0).getPtr();
1732 e = (ST_Agedge_s) earray.get(0);
17401733 pointn = 0;
17411734 points.plus(pointn++).setStruct(tp);
17421735 points.plus(pointn++).setStruct(tp);
17431736 points.plus(pointn++).setStruct(hp);
17441737 points.plus(pointn++).setStruct(hp);
1745 clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
1746 ED_label(e).getStruct("pos").setDouble("x", ctrx);
1747 ED_label(e).getStruct("pos").setDouble("y", tp.getDouble("y") + (ED_label(e).getStruct("dimen").getDouble("y")+6)/2.0);
1748 ED_label(e).setBoolean("set", NOT(false));
1749 miny = tp.getDouble("y") + 6/2.0;
1750 maxy = miny + ED_label(e).getStruct("dimen").getDouble("y");
1751 uminx = ctrx - (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
1752 umaxx = ctrx + (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
1738 clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo);
1739 ED_label(e).pos.setDouble("x", ctrx);
1740 ED_label(e).pos.setDouble("y", tp.y + (ED_label(e).dimen.y+6)/2.0);
1741 ED_label(e).set= NOTI(false);
1742 miny = tp.y + 6/2.0;
1743 maxy = miny + ED_label(e).dimen.y;
1744 uminx = ctrx - (ED_label(e).dimen.x)/2.0;
1745 umaxx = ctrx + (ED_label(e).dimen.x)/2.0;
17531746 for (i = 1; i < n_lbls; i++) {
1754 e = (Agedge_s) earray.plus(i).getPtr();
1747 e = (ST_Agedge_s) earray.get(i);
17551748 if (i%2!=0) { /* down */
17561749 if (i == 1) {
1757 lminx = ctrx - (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
1758 lmaxx = ctrx + (ED_label(e).getStruct("dimen").getDouble("x"))/2.0;
1750 lminx = ctrx - (ED_label(e).dimen.x)/2.0;
1751 lmaxx = ctrx + (ED_label(e).dimen.x)/2.0;
17591752 }
1760 miny -= 6 + ED_label(e).getStruct("dimen").getDouble("y");
1753 miny -= 6 + ED_label(e).dimen.y;
17611754 points.plus(0).setStruct(tp);
1762 points.plus(1).setDouble("x", tp.getDouble("x"));
1755 points.plus(1).setDouble("x", tp.x);
17631756 points.plus(1).setDouble("y", miny - 6);
1764 points.plus(2).setDouble("x", hp.getDouble("x"));
1765 points.plus(2).setDouble("y", points.plus(1).getDouble("y"));
1757 points.plus(2).setDouble("x", hp.x);
1758 points.plus(2).setDouble("y", points.get(1).y);
17661759 points.plus(3).setStruct(hp);
17671760 points.plus(4).setDouble("x", lmaxx);
1768 points.plus(4).setDouble("y", hp.getDouble("y"));
1761 points.plus(4).setDouble("y", hp.y);
17691762 points.plus(5).setDouble("x", lmaxx);
17701763 points.plus(5).setDouble("y", miny);
17711764 points.plus(6).setDouble("x", lminx);
17721765 points.plus(6).setDouble("y", miny);
17731766 points.plus(7).setDouble("x", lminx);
1774 points.plus(7).setDouble("y", tp.getDouble("y"));
1775 ctry = miny + (ED_label(e).getStruct("dimen").getDouble("y"))/2.0;
1767 points.plus(7).setDouble("y", tp.y);
1768 ctry = miny + (ED_label(e).dimen.y)/2.0;
17761769 }
17771770 else { /* up */
17781771 UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
17931786 UNSUPPORTED("ehcig8trxc4ble6pcochubv7z"); // ctry = maxy + (ED_label(e)->dimen.y)/2.0 + 6;
17941787 UNSUPPORTED("e2zgxycgqefryde9nbv6cqz1u"); // maxy += ED_label(e)->dimen.y + 6;
17951788 }
1796 poly.setInt("pn", 8);
1797 poly.setPtr("ps", points.asPtr());
1789 poly.pn = 8;
1790 poly.ps = points;
17981791 ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
17991792 if (pn[0] == 0) return;
1800 ED_label(e).getStruct("pos").setDouble("x", ctrx);
1801 ED_label(e).getStruct("pos").setDouble("y", ctry);
1802 ED_label(e).setBoolean("set", NOT(false));
1803 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
1793 ED_label(e).pos.setDouble("x", ctrx);
1794 ED_label(e).pos.setDouble("y", ctry);
1795 ED_label(e).set= NOTI(false);
1796 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
18041797 }
18051798 /* edges with no labels */
18061799 for (; i < cnt; i++) {
1807 e = (Agedge_s) earray.plus(i).getPtr();
1800 e = (ST_Agedge_s) earray.get(i);
18081801 if (i%2!=0) { /* down */
18091802 if (i == 1) {
18101803 lminx = (2*leftend + rightend)/3.0;
18121805 }
18131806 miny -= 6;
18141807 points.plus(0).setStruct(tp);
1815 points.plus(1).setDouble("x", tp.getDouble("x"));
1808 points.plus(1).setDouble("x", tp.x);
18161809 points.plus(1).setDouble("y", miny - 6);
1817 points.plus(2).setDouble("x", hp.getDouble("x"));
1818 points.plus(2).setDouble("y", points.plus(1).getDouble("y"));
1810 points.plus(2).setDouble("x", hp.x);
1811 points.plus(2).setDouble("y", points.get(1).y);
18191812 points.plus(3).setStruct(hp);
18201813 points.plus(4).setDouble("x", lmaxx);
1821 points.plus(4).setDouble("y", hp.getDouble("y"));
1814 points.plus(4).setDouble("y", hp.y);
18221815 points.plus(5).setDouble("x", lmaxx);
18231816 points.plus(5).setDouble("y", miny);
18241817 points.plus(6).setDouble("x", lminx);
18251818 points.plus(6).setDouble("y", miny);
18261819 points.plus(7).setDouble("x", lminx);
1827 points.plus(7).setDouble("y", tp.getDouble("y"));
1820 points.plus(7).setDouble("y", tp.y);
18281821 }
18291822 else { /* up */
18301823 UNSUPPORTED("7owdudualx55z2cnm9x3iio0w"); // points[0] = tp;
18441837 UNSUPPORTED("56zheeat0b8mo4uvlcbvgbu80"); // points[7].y = maxy + 6;
18451838 UNSUPPORTED("7un2qk34mmmhqi296vl50bacs"); // maxy += + 6;
18461839 }
1847 poly.setInt("pn", 8);
1848 poly.setPtr("ps", points.asPtr());
1840 poly.pn = 8;
1841 poly.ps = points;
18491842 ps = simpleSplineRoute (tp, hp, poly, pn, et == (3 << 1));
18501843 if (pn[0] == 0) return;
1851 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
1844 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
18521845 }
18531846 Memory.free (earray);
18541847 } finally {
18611854
18621855 //3 8kqyzk43ovc2sq6jegua6ytp
18631856 // static void makeSimpleFlat (node_t* tn, node_t* hn, edge_t** edges, int ind, int cnt, int et)
1864 public static void makeSimpleFlat(Agnode_s tn, Agnode_s hn, __ptr__ edges, int ind, int cnt, int et) {
1857 public static void makeSimpleFlat(ST_Agnode_s tn, ST_Agnode_s hn, ST_Agedge_s.ArrayOfStar edges, int ind, int cnt, int et) {
18651858 ENTERING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
18661859 try {
1867 Agedge_s e = (Agedge_s) edges.plus(ind).getPtr();
1868 final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 10);
1869 final __struct__<pointf> tp = JUtils.from(pointf.class), hp = JUtils.from(pointf.class);
1860 ST_Agedge_s e = (ST_Agedge_s) edges.get(ind);
1861 final ST_pointf.Array points = new ST_pointf.Array( 10);
1862 final ST_pointf tp = new ST_pointf(), hp = new ST_pointf();
18701863 int i, pointn;
18711864 double stepy, dy;
1872 tp.___(add_pointf(ND_coord(tn), ED_tail_port(e).getStruct("p")));
1873 hp.___(add_pointf(ND_coord(hn), ED_head_port(e).getStruct("p")));
1865 tp.___(add_pointf(ND_coord(tn), (ST_pointf) ED_tail_port(e).p));
1866 hp.___(add_pointf(ND_coord(hn), (ST_pointf) ED_head_port(e).p));
18741867 stepy = (cnt > 1) ? ND_ht(tn) / (double)(cnt - 1) : 0.;
1875 dy = tp.getDouble("y") - ((cnt > 1) ? ND_ht(tn) / 2. : 0.);
1868 dy = tp.y - ((cnt > 1) ? ND_ht(tn) / 2. : 0.);
18761869 for (i = 0; i < cnt; i++) {
1877 e = (Agedge_s) edges.plus(ind + i).getPtr();
1870 e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
18781871 pointn = 0;
18791872 if ((et == (5 << 1)) || (et == (1 << 1))) {
18801873 points.plus(pointn++).setStruct(tp);
1881 points.plus(pointn++).setStruct(pointfof((2 * tp.getDouble("x") + hp.getDouble("x")) / 3, dy));
1882 points.plus(pointn++).setStruct(pointfof((2 * hp.getDouble("x") + tp.getDouble("x")) / 3, dy));
1874 points.plus(pointn++).setStruct(pointfof((2 * tp.x + hp.x) / 3, dy));
1875 points.plus(pointn++).setStruct(pointfof((2 * hp.x + tp.x) / 3, dy));
18831876 points.plus(pointn++).setStruct(hp);
18841877 }
18851878 else { /* ET_PLINE */
18951888 UNSUPPORTED("59cwjy3j5e0igp278migykzi"); // points[pointn++] = hp;
18961889 }
18971890 dy += stepy;
1898 clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo.amp());
1891 clip_and_install(e, aghead(e), points.asPtr(), pointn, Z.z().sinfo);
18991892 }
19001893 } finally {
19011894 LEAVING("8kqyzk43ovc2sq6jegua6ytp","makeSimpleFlat");
19071900
19081901 //3 bhnjospwghq4plid12757c928
19091902 // static void make_flat_adj_edges(graph_t* g, path* P, edge_t** edges, int ind, int cnt, edge_t* e0, int et)
1910 public static void make_flat_adj_edges(Agraph_s g, path P, __ptr__ edges, int ind, int cnt, Agedge_s e0, int et) {
1903 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) {
19111904 ENTERING("bhnjospwghq4plid12757c928","make_flat_adj_edges");
19121905 try {
1913 Agnode_s n;
1914 Agnode_s tn, hn;
1915 Agedge_s e;
1906 ST_Agnode_s n;
1907 ST_Agnode_s tn, hn;
1908 ST_Agedge_s e;
19161909 int labels = 0, ports = 0;
1917 Agraph_s auxg;
1918 Agraph_s subg;
1919 Agnode_s auxt, auxh;
1920 Agedge_s auxe;
1910 ST_Agraph_s auxg;
1911 ST_Agraph_s subg;
1912 ST_Agnode_s auxt, auxh;
1913 ST_Agedge_s auxe;
19211914 int i, j, midx, midy, leftx, rightx;
1922 final __struct__<pointf> del = JUtils.from(pointf.class);
1923 Agedge_s hvye = null;
1915 final ST_pointf del = new ST_pointf();
1916 ST_Agedge_s hvye = null;
19241917 attr_state_t attrs;
19251918 tn = agtail(e0); hn = aghead(e0);
19261919 for (i = 0; i < cnt; i++) {
1927 e = (Agedge_s) edges.plus(ind + i).getPtr();
1920 e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
19281921 if (ED_label(e)!=null) labels++;
19291922 if (ED_tail_port(e).defined!=0 || ED_head_port(e).defined!=0) ports = 1;
19301923 }
20502043
20512044 //3 fybar4mljnmkh3kure5k1eod
20522045 // static void makeFlatEnd (graph_t* g, spline_info_t* sp, path* P, node_t* n, edge_t* e, pathend_t* endp, boolean isBegin)
2053 public static void makeFlatEnd(Agraph_s g, spline_info_t sp, path P, Agnode_s n, Agedge_s e, pathend_t endp, boolean isBegin) {
2046 public static void makeFlatEnd(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agnode_s n, ST_Agedge_s e, ST_pathend_t endp, boolean isBegin) {
20542047 ENTERING("fybar4mljnmkh3kure5k1eod","makeFlatEnd");
20552048 try {
20562049 final ST_boxf b = new ST_boxf();
20592052 endp.setInt("sidemask", 1<<2);
20602053 if (isBegin) beginpath(P, e, 2, endp, false);
20612054 else endpath(P, e, 2, endp, false);
2062 b.UR.y = ((ST_boxf)endp.getArrayOfStruct("boxes").plus(endp.getInt("boxn") - 1).getStruct()).UR.y;
2063 b.LL.y = ((ST_boxf)endp.getArrayOfStruct("boxes").plus(endp.getInt("boxn") - 1).getStruct()).LL.y;
2064 b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).getDouble("y") + GD_rank(g).plus(ND_rank(n)).getDouble("ht2")));
2055 b.UR.y = endp.boxes[endp.boxn - 1].UR.y;
2056 b.LL.y = endp.boxes[endp.boxn - 1].LL.y;
2057 b.___(makeregularend((ST_boxf) b, (1<<2), ND_coord(n).y + GD_rank(g).get(ND_rank(n)).ht2));
20652058 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
20662059 UNSUPPORTED("cmjm4y40vf7wklmgz0ae4k36v"); // endp->boxes[endp->boxn++] = b;
20672060 } finally {
20992092
21002093 //3 w8ptjibydq995d2lexg85mku
21012094 // static void make_flat_labeled_edge(graph_t* g, spline_info_t* sp, path* P, edge_t* e, int et)
2102 public static void make_flat_labeled_edge(Agraph_s g, spline_info_t sp, path P, Agedge_s e, int et) {
2095 public static void make_flat_labeled_edge(ST_Agraph_s g, ST_spline_info_t sp, ST_path P, ST_Agedge_s e, int et) {
21032096 ENTERING("w8ptjibydq995d2lexg85mku","make_flat_labeled_edge");
21042097 try {
2105 Agnode_s tn, hn, ln;
2106 pointf ps = null;
2107 final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
2098 ST_Agnode_s tn, hn, ln;
2099 ST_pointf.Array ps = null;
2100 final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
21082101 final ST_boxf lb = new ST_boxf();
21092102 int boxn, i, ydelta;
21102103 int pn[] = new int[1];
2111 Agedge_s f;
2112 final __array_of_struct__ points = __array_of_struct_impl__.malloc(pointf.class, 7);
2104 ST_Agedge_s f;
2105 final ST_pointf.Array points = new ST_pointf.Array( 7);
21132106 tn = agtail(e);
21142107 hn = aghead(e);
21152108 for (f = ED_to_virt(e); ED_to_virt(f)!=null; f = ED_to_virt(f));
21162109 ln = agtail(f);
21172110 ED_label(e).setStruct("pos", ND_coord(ln));
2118 ED_label(e).setBoolean("set", NOT(false));
2111 ED_label(e).set= NOTI(false);
21192112 if (et == (1 << 1)) {
21202113 UNSUPPORTED("ataaqkehwb736ts2x6olzqokx"); // pointf startp, endp, lp;
21212114 UNSUPPORTED("48h6vk2e5niep4dmpua377248"); // startp = add_pointf(ND_coord(tn), ED_tail_port(e).p);
21292122 UNSUPPORTED("1uunj4jbr2uhiqxwor6rzmr3j"); // pn = 7;
21302123 }
21312124 else {
2132 lb.LL.x = ND_coord(ln).getDouble("x") - ND_lw(ln);
2133 lb.UR.x = ND_coord(ln).getDouble("x") + ND_rw(ln);
2134 lb.UR.y = ND_coord(ln).getDouble("y") + ND_ht(ln)/2;
2135 ydelta = (int)(ND_coord(ln).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1") -
2136 ND_coord(tn).getDouble("y") + GD_rank(g).plus(ND_rank(tn)).getDouble("ht2"));
2125 lb.LL.x = ND_coord(ln).x - ND_lw(ln);
2126 lb.UR.x = ND_coord(ln).x + ND_rw(ln);
2127 lb.UR.y = ND_coord(ln).y + ND_ht(ln)/2;
2128 ydelta = (int)(ND_coord(ln).y - GD_rank(g).get(ND_rank(tn)).ht1 -
2129 ND_coord(tn).y + GD_rank(g).get(ND_rank(tn)).ht2);
21372130 ydelta = (int)(ydelta / 6.);
21382131 lb.LL.y = lb.UR.y - MAX(5.,ydelta);
21392132 boxn = 0;
2140 makeFlatEnd (g, sp, P, tn, e, tend.amp(), NOT(false));
2141 makeFlatEnd (g, sp, P, hn, e, hend.amp(), false);
2142 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.x;
2143 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).UR.y;
2144 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = lb.LL.x;
2145 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.LL.y;
2133 makeFlatEnd (g, sp, P, tn, e, tend, NOT(false));
2134 makeFlatEnd (g, sp, P, hn, e, hend, false);
2135 ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x;
2136 ((Z.z().boxes[boxn])).LL.y = (tend).boxes[tend.boxn - 1].UR.y;
2137 ((Z.z().boxes[boxn])).UR.x = lb.LL.x;
2138 ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
21462139 boxn++;
2147 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.x;
2148 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = lb.LL.y;
2149 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.x;
2150 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.UR.y;
2140 ((Z.z().boxes[boxn])).LL.x = (tend).boxes[tend.boxn - 1].LL.x;
2141 ((Z.z().boxes[boxn])).LL.y = lb.LL.y;
2142 ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
2143 ((Z.z().boxes[boxn])).UR.y = lb.UR.y;
21512144 boxn++;
2152 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = lb.UR.x;
2153 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = lb.LL.y;
2154 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.y;
2155 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.x;
2145 ((Z.z().boxes[boxn])).LL.x = lb.UR.x;
2146 ((Z.z().boxes[boxn])).UR.y = lb.LL.y;
2147 ((Z.z().boxes[boxn])).LL.y = (hend).boxes[hend.boxn - 1].UR.y;
2148 ((Z.z().boxes[boxn])).UR.x = (hend).boxes[hend.boxn - 1].UR.x;
21562149 boxn++;
2157 for (i = 0; i < tend.getInt("boxn"); i++) add_box(P, (ST_boxf)tend.getArrayOfStruct("boxes").plus(i).getStruct());
2158 for (i = 0; i < boxn; i++) add_box(P, (ST_boxf)Z.z().boxes.plus(i).getStruct());
2159 for (i = hend.getInt("boxn") - 1; i >= 0; i--) add_box(P, (ST_boxf)hend.getArrayOfStruct("boxes").plus(i).getStruct());
2150 for (i = 0; i < tend.boxn; i++) add_box(P, (tend).boxes[i]);
2151 for (i = 0; i < boxn; i++) add_box(P, Z.z().boxes[i]);
2152 for (i = hend.boxn - 1; i >= 0; i--) add_box(P, (hend).boxes[i]);
21602153 if (et == (5 << 1)) ps = routesplines(P, pn);
21612154 else ps = routepolylines(P, pn);
21622155 if (pn[0] == 0) return;
21632156 }
2164 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
2157 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
21652158 } finally {
21662159 LEAVING("w8ptjibydq995d2lexg85mku","make_flat_labeled_edge");
21672160 }
22412234
22422235 //3 6yr3jfkljl5w0z6dv354ryx63
22432236 // static void make_flat_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
2244 public static void make_flat_edge(Agraph_s g, spline_info_t sp, path P, __ptr__ edges, int ind, int cnt, int et) {
2237 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) {
22452238 ENTERING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
22462239 try {
2247 Agnode_s tn, hn;
2248 final __struct__<Agedgeinfo_t> fwdedgei = JUtils.from(Agedgeinfo_t.class);
2249 final __struct__<Agedgepair_s> fwdedge = JUtils.from(Agedgepair_s.class);
2250 Agedge_s e;
2240 ST_Agnode_s tn, hn;
2241 final ST_Agedgeinfo_t fwdedgei = new ST_Agedgeinfo_t();
2242 final ST_Agedgepair_s fwdedge = new ST_Agedgepair_s();
2243 ST_Agedge_s e;
22512244 int j, i, r, isAdjacent;
22522245 double stepx, stepy, vspace;
22532246 int tside, hside;
22542247 int pn[] = new int[] {0};
2255 pointf ps;
2256 final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
2257 fwdedge.getStruct("out").getStruct("base").setPtr("data", fwdedgei.amp());
2248 ST_pointf.Array ps;
2249 final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
2250 fwdedge.out.base.setPtr("data", fwdedgei);
22582251 /* Get sample edge; normalize to go from left to right */
2259 e = (Agedge_s) edges.plus(ind).getPtr();
2252 e = (ST_Agedge_s) edges.get(ind);
22602253 isAdjacent = ED_adjacent(e);
22612254 if ((ED_tree_index(e) & 32)!=0) {
2262 MAKEFWDEDGE(fwdedge.getStruct("out").amp(), e);
2263 e = (Agedge_s) fwdedge.getStruct("out").amp();
2255 MAKEFWDEDGE(fwdedge.out, e);
2256 e = (ST_Agedge_s) fwdedge.out;
22642257 }
22652258 for (i = 1; i < cnt; i++) {
22662259 if (ED_adjacent(edges.plus(ind+i).getPtr())!=0) {
22832276 makeSimpleFlat (agtail(e), aghead(e), edges, ind, cnt, et);
22842277 return;
22852278 }
2286 tside = ED_tail_port(e).getInt("side");
2287 hside = ED_head_port(e).getInt("side");
2279 tside = ED_tail_port(e).side;
2280 hside = ED_head_port(e).side;
22882281 if (((tside == (1<<0)) && (hside != (1<<2))) ||
22892282 ((hside == (1<<0)) && (tside != (1<<2)))) {
22902283 make_flat_bottom_edges (g, sp, P, edges, ind, cnt, e, et == (5 << 1));
22942287 hn = aghead(e);
22952288 r = ND_rank(tn);
22962289 if (r > 0) {
2297 __ptr__ prevr;
2290 ST_rank_t.Array2 prevr;
22982291 if ((GD_has_labels(g) & (1 << 0))!=0)
22992292 prevr = GD_rank(g).plus(r-2);
23002293 else
23012294 prevr = GD_rank(g).plus(r-1);
2302 vspace = ND_coord(prevr.getPtr().getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - prevr.getPtr().getDouble("ht1")
2303 - ND_coord(tn).getDouble("y") - GD_rank(g).plus(r).getDouble("ht2");
2295 vspace = ND_coord(prevr.getPtr().v.get(0)).y - prevr.getPtr().ht1
2296 - ND_coord(tn).y - GD_rank(g).get(r).ht2;
23042297 }
23052298 else {
23062299 vspace = GD_ranksep(g);
23072300 }
2308 stepx = ((double)sp.getInt("Multisep")) / (cnt+1);
2301 stepx = ((double)sp.Multisep) / (cnt+1);
23092302 stepy = vspace / (cnt+1);
2310 makeFlatEnd (g, sp, P, tn, e, tend.amp(), true);
2311 makeFlatEnd (g, sp, P, hn, e, hend.amp(), false);
2303 makeFlatEnd (g, sp, P, tn, e, tend, true);
2304 makeFlatEnd (g, sp, P, hn, e, hend, false);
23122305 for (i = 0; i < cnt; i++) {
23132306 int boxn;
23142307 final ST_boxf b = new ST_boxf();
2315 e = (Agedge_s) edges.plus(ind + i).getPtr();
2308 e = (ST_Agedge_s) edges.plus(ind + i).getPtr();
23162309 boxn = 0;
2317 b.___(tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct());
2318 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = b.LL.x;
2319 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = b.UR.y;
2320 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = b.UR.x + (i + 1) * stepx;
2321 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = b.UR.y + (i + 1) * stepy;
2310 b.___((tend).boxes[tend.boxn - 1]);
2311 ((Z.z().boxes[boxn])).LL.x = b.LL.x;
2312 ((Z.z().boxes[boxn])).LL.y = b.UR.y;
2313 ((Z.z().boxes[boxn])).UR.x = b.UR.x + (i + 1) * stepx;
2314 ((Z.z().boxes[boxn])).UR.y = b.UR.y + (i + 1) * stepy;
23222315 boxn++;
2323 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = ((ST_boxf)(tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct())).LL.x;
2324 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = ((ST_boxf)Z.z().boxes.plus(boxn-1).getStruct()).UR.y;
2325 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = ((ST_boxf)(hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct())).UR.x;
2326 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y + stepy;
2316 ((Z.z().boxes[boxn])).LL.x = ((ST_boxf)((tend).boxes[tend.boxn - 1])).LL.x;
2317 ((Z.z().boxes[boxn])).LL.y = (Z.z().boxes[boxn-1]).UR.y;
2318 ((Z.z().boxes[boxn])).UR.x = ((ST_boxf)((hend).boxes[hend.boxn - 1])).UR.x;
2319 ((Z.z().boxes[boxn])).UR.y = ((Z.z().boxes[boxn])).LL.y + stepy;
23272320 boxn++;
2328 b.___(hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct());
2329 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.x = b.UR.x;
2330 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.y = b.UR.y;
2331 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).LL.x = b.LL.x - (i + 1) * stepx;
2332 ((ST_boxf)Z.z().boxes.plus(boxn).getStruct()).UR.y = ((ST_boxf)Z.z().boxes.plus(boxn-1).getStruct()).LL.y;
2321 b.___((hend).boxes[hend.boxn - 1]);
2322 ((Z.z().boxes[boxn])).UR.x = b.UR.x;
2323 ((Z.z().boxes[boxn])).LL.y = b.UR.y;
2324 ((Z.z().boxes[boxn])).LL.x = b.LL.x - (i + 1) * stepx;
2325 ((Z.z().boxes[boxn])).UR.y = (Z.z().boxes[boxn-1]).LL.y;
23332326 boxn++;
2334 for (j = 0; j < tend.getInt("boxn"); j++) add_box(P, (ST_boxf)tend.getArrayOfStruct("boxes").plus(j).getStruct());
2335 for (j = 0; j < boxn; j++) add_box(P, (ST_boxf)Z.z().boxes.plus(j).getStruct());
2336 for (j = hend.getInt("boxn") - 1; j >= 0; j--) add_box(P, (ST_boxf)hend.getArrayOfStruct("boxes").plus(j).getStruct());
2337 if (et == (5 << 1)) ps = (pointf) routesplines(P, pn);
2338 else ps = (pointf) routepolylines(P, pn);
2327 for (j = 0; j < tend.boxn; j++) add_box(P, (tend).boxes[j]);
2328 for (j = 0; j < boxn; j++) add_box(P, Z.z().boxes[j]);
2329 for (j = hend.boxn - 1; j >= 0; j--) add_box(P, (hend).boxes[j]);
2330 if (et == (5 << 1)) ps = routesplines(P, pn);
2331 else ps = routepolylines(P, pn);
23392332 if (pn[0] == 0)
23402333 return;
2341 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo.amp());
2342 P.setInt("nbox", 0);
2334 clip_and_install(e, aghead(e), ps, pn[0], Z.z().sinfo);
2335 P.nbox = 0;
23432336 }
23442337 } finally {
23452338 LEAVING("6yr3jfkljl5w0z6dv354ryx63","make_flat_edge");
23692362
23702363 //3 2n9bpvx34fnukqu1f9u4v7v6n
23712364 // static int makeLineEdge(graph_t* g, edge_t* fe, pointf* points, node_t** hp)
2372 public static int makeLineEdge(Agraph_s g, Agedge_s fe, __ptr__ points, __ptr__ hp) {
2365 public static int makeLineEdge(ST_Agraph_s g, ST_Agedge_s fe, __ptr__ points, __ptr__ hp) {
23732366 ENTERING("2n9bpvx34fnukqu1f9u4v7v6n","makeLineEdge");
23742367 try {
23752368 UNSUPPORTED("d9cz56vtrl0ri6hz88cumukuf"); // static int
24402433
24412434
24422435
2443 //3 30wfq1dby4t07hft9io52nq6z
2444 // static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
24452436 //private static __ptr__ pointfs;
24462437 //private static __ptr__ pointfs2;
24472438 //private static int numpts;
24482439 //private static int numpts2;
2449 public static void make_regular_edge(Agraph_s g, spline_info_t sp, path P, __ptr__ edges, int ind, int cnt, int et) {
2440 //3 30wfq1dby4t07hft9io52nq6z
2441 // static void make_regular_edge(graph_t* g, spline_info_t* sp, path * P, edge_t ** edges, int ind, int cnt, int et)
2442 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) {
24502443 ENTERING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
24512444 try {
2452 Agnode_s tn, hn = null;
2453 final __struct__<Agedgeinfo_t> fwdedgeai = JUtils.from(Agedgeinfo_t.class), fwdedgebi = JUtils.from(Agedgeinfo_t.class), fwdedgei = JUtils.from(Agedgeinfo_t.class);
2454 final __struct__<Agedgepair_s> fwdedgea = JUtils.from(Agedgepair_s.class), fwdedgeb = JUtils.from(Agedgepair_s.class), fwdedge = JUtils.from(Agedgepair_s.class);
2455 Agedge_s e, fe, le, segfirst;
2456 pointf ps = null;
2457 final __struct__<pathend_t> tend = JUtils.from(pathend_t.class), hend = JUtils.from(pathend_t.class);
2445 ST_Agnode_s tn, hn = null;
2446 final ST_Agedgeinfo_t fwdedgeai = new ST_Agedgeinfo_t(), fwdedgebi = new ST_Agedgeinfo_t(), fwdedgei = new ST_Agedgeinfo_t();
2447 final ST_Agedgepair_s fwdedgea = new ST_Agedgepair_s(), fwdedgeb = new ST_Agedgepair_s(), fwdedge = new ST_Agedgepair_s();
2448 ST_Agedge_s e, fe, le, segfirst;
2449 ST_pointf.Array ps = null;
2450 final ST_pathend_t tend = new ST_pathend_t(), hend = new ST_pathend_t();
24582451 final ST_boxf b = new ST_boxf();
24592452 int boxn, sl, si, i, j, dx, hackflag, longedge;
24602453 boolean smode;
24612454 int pn[] = new int[] {0};
24622455 int pointn[] = new int[] {0};
2463 fwdedgea.getStruct("out").getStruct("base").setPtr("data", fwdedgeai.amp());
2464 fwdedgeb.getStruct("out").getStruct("base").setPtr("data", fwdedgebi.amp());
2465 fwdedge.getStruct("out").getStruct("base").setPtr("data", fwdedgei.amp());
2456 fwdedgea.out.base.setPtr("data", fwdedgeai);
2457 fwdedgeb.out.base.setPtr("data", fwdedgebi);
2458 fwdedge.out.base.setPtr("data", fwdedgei);
24662459 if (N(Z.z().pointfs)) {
2467 Z.z().pointfs = gmalloc(sizeof(pointf.class, 2000));
2468 Z.z().pointfs2 = gmalloc(sizeof(pointf.class, 2000));
2460 Z.z().pointfs = new ST_pointf.Array(2000);
2461 Z.z().pointfs2 = new ST_pointf.Array(2000);
24692462 Z.z().numpts = 2000;
24702463 Z.z().numpts2 = 2000;
24712464 }
24722465 sl = 0;
2473 e = (Agedge_s) edges.plus(ind).getPtr();
2466 e = (ST_Agedge_s) edges.get(ind);
24742467 hackflag = 0;
24752468 if (ABS(ND_rank(agtail(e)) - ND_rank(aghead(e))) > 1) {
24762469 UNSUPPORTED("8f17srpa5iisomehrb4b01h51"); // fwdedgeai = *(Agedgeinfo_t*)e->base.data;
24982491 UNSUPPORTED("bxkpl0bp0qhtxaj6rspd19d1k"); // hackflag = NOT(0);
24992492 } else {
25002493 if ((ED_tree_index(e) & 32)!=0) {
2501 MAKEFWDEDGE(fwdedgea.getPtr("out"), e);
2502 e = (Agedge_s) fwdedgea.getPtr("out");
2494 MAKEFWDEDGE(fwdedgea.out, e);
2495 e = fwdedgea.out;
25032496 }
25042497 }
25052498 fe = e;
25142507 tn = agtail(e);
25152508 hn = aghead(e);
25162509 b.___(maximal_bbox(g, sp, tn, null, e));
2517 tend.getStruct("nb").___(b);
2518 beginpath(P, e, 1, tend.amp(), spline_merge(tn));
2510 tend.nb.___(b);
2511 beginpath(P, e, 1, tend, spline_merge(tn));
25192512 b.UR.y =
2520 ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).UR.y;
2513 (tend).boxes[tend.boxn - 1].UR.y;
25212514 b.LL.y =
2522 ((ST_boxf)tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct()).LL.y;
2515 (tend).boxes[tend.boxn - 1].LL.y;
25232516 b.___(makeregularend(b, (1<<0),
2524 ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1")));
2517 ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1));
25252518 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
25262519 {
2527 tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn")).setStruct(b);
2528 tend.setInt("boxn", tend.getInt("boxn") + 1);
2520 tend.boxes[tend.boxn].___(b);
2521 tend.setInt("boxn", tend.boxn + 1);
25292522 }
25302523 longedge = 0;
25312524 smode = false; si = -1;
2532 while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", hn)).booleanValue())) {
2525 while (ND_node_type(hn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(hn)).booleanValue())) {
25332526 longedge = 1;
2534 Z.z().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
2527 Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
25352528 if (N(smode)
25362529 && ((sl = straight_len(hn)) >=
25372530 ((GD_has_labels(g) & (1 << 0))!=0 ? 4 + 1 : 2 + 1))) {
25402533 }
25412534 if (N(smode) || si > 0) {
25422535 si--;
2543 Z.z().boxes.plus(boxn++).setStruct( maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getFromList(0)));
2544 e = (Agedge_s) ND_out(hn).getFromList(0);
2536 Z.z().boxes[boxn++].___(maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0)));
2537 e = (ST_Agedge_s) ND_out(hn).getFromList(0);
25452538 tn = agtail(e);
25462539 hn = aghead(e);
25472540 continue;
25482541 }
2549 hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (Agedge_s) ND_out(hn).getFromList(0)));
2550 endpath(P, e, 1, hend.amp(), spline_merge(aghead(e)));
2551 b.___(makeregularend((ST_boxf) hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct(), (1<<2),
2552 ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2")));
2542 hend.setStruct("nb", maximal_bbox(g, sp, hn, e, (ST_Agedge_s) ND_out(hn).getFromList(0)));
2543 endpath(P, e, 1, hend, spline_merge(aghead(e)));
2544 b.___(makeregularend((hend).boxes[hend.boxn - 1], (1<<2),
2545 ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2));
25532546 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
25542547 UNSUPPORTED("1crhubfzekx1qi2ti9ajqsfoc"); // hend.boxes[hend.boxn++] = b;
2555 P.getStruct("end").setDouble("theta", M_PI / 2);
2556 P.getStruct("end").setBoolean("constrained", NOT(false));
2557 completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn, 1);
2548 P.end.setDouble("theta", M_PI / 2);
2549 P.end.constrained= NOTI(false);
2550 completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn, 1);
25582551 if (splines) ps = routesplines(P, pn);
25592552 else {
25602553 UNSUPPORTED("biyp75vm751j3qmqacagfej4b"); // ps = routepolylines (P, &pn);
25762569 for (i = 0; i < pn[0]; i++) {
25772570 Z.z().pointfs.plus(pointn[0]++).setStruct(ps.plus(i).getStruct());
25782571 }
2579 e = straight_path((Agedge_s)ND_out(hn).getFromList(0), sl, Z.z().pointfs, pointn);
2572 e = straight_path((ST_Agedge_s)ND_out(hn).getFromList(0), sl, Z.z().pointfs, pointn);
25802573 recover_slack(segfirst, P);
25812574 segfirst = e;
25822575 tn = agtail(e);
25832576 hn = aghead(e);
25842577 boxn = 0;
2585 tend.setStruct("nb", maximal_bbox(g, sp, tn, (Agedge_s) ND_in(tn).getFromList(0), e));
2586 beginpath(P, e, 1, tend.amp(), spline_merge(tn));
2587 b.___(makeregularend((ST_boxf) tend.getArrayOfStruct("boxes").plus(tend.getInt("boxn") - 1).getStruct(), (1<<0),
2588 ND_coord(tn).getDouble("y") - GD_rank(g).plus(ND_rank(tn)).getDouble("ht1")));
2578 tend.setStruct("nb", maximal_bbox(g, sp, tn, (ST_Agedge_s) ND_in(tn).getFromList(0), e));
2579 beginpath(P, e, 1, tend, spline_merge(tn));
2580 b.___(makeregularend((tend).boxes[tend.boxn - 1], (1<<0),
2581 ND_coord(tn).y - GD_rank(g).get(ND_rank(tn)).ht1));
25892582 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
25902583 UNSUPPORTED("cjx6tldge3otk1pk6ks1pkn2w"); // tend.boxes[tend.boxn++] = b;
2591 P.getStruct("start").setDouble("theta", -M_PI / 2);
2592 P.getStruct("start").setBoolean("constrained", NOT(false));
2584 P.start.setDouble("theta", -M_PI / 2);
2585 P.start.constrained= NOTI(false);
25932586 smode = false;
25942587 }
2595 Z.z().boxes.plus(boxn++).setStruct(rank_box(sp, g, ND_rank(tn)));
2588 Z.z().boxes[boxn++].___(rank_box(sp, g, ND_rank(tn)));
25962589 b.___(maximal_bbox(g, sp, hn, e, null));
2597 hend.getStruct("nb").___(b);
2598 endpath(P, hackflag!=0 ? fwdedgeb.getStruct("out").amp() : e, 1, hend.amp(), spline_merge(aghead(e)));
2599 b.UR.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).UR.y;
2600 b.LL.y = ((ST_boxf)hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn") - 1).getStruct()).LL.y;
2590 hend.nb.___(b);
2591 endpath(P, (ST_Agedge_s) (hackflag!=0 ? fwdedgeb.out : e), 1, hend, spline_merge(aghead(e)));
2592 b.UR.y = (hend).boxes[hend.boxn - 1].UR.y;
2593 b.LL.y = (hend).boxes[hend.boxn - 1].LL.y;
26012594 b.___(makeregularend(b, (1<<2),
2602 ND_coord(hn).getDouble("y") + GD_rank(g).plus(ND_rank(hn)).getDouble("ht2")));
2595 ND_coord(hn).y + GD_rank(g).get(ND_rank(hn)).ht2));
26032596 if (b.LL.x < b.UR.x && b.LL.y < b.UR.y)
26042597 {
2605 hend.getArrayOfStruct("boxes").plus(hend.getInt("boxn")).setStruct(b);
2606 hend.setInt("boxn", hend.getInt("boxn")+1);
2598 hend.boxes[hend.boxn].___(b);
2599 hend.setInt("boxn", hend.boxn+1);
26072600 }
2608 completeregularpath(P, segfirst, e, tend.amp(), hend.amp(), Z.z().boxes, boxn,
2601 completeregularpath(P, segfirst, e, tend, hend, Z.z().boxes, boxn,
26092602 longedge);
26102603 if (splines) ps = routesplines(P, pn);
26112604 else ps = routepolylines (P, pn);
26292622 pointn[0]++;
26302623 }
26312624 recover_slack(segfirst, P);
2632 hn = hackflag!=0 ? aghead(fwdedgeb.getStruct("out").amp()) : aghead(e);
2625 hn = hackflag!=0 ? aghead(fwdedgeb.out) : aghead(e);
26332626 }
26342627 /* make copies of the spline points, one per multi-edge */
26352628 if (cnt == 1) {
2636 clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo.amp());
2629 clip_and_install(fe, hn, Z.z().pointfs, pointn[0], Z.z().sinfo);
26372630 return;
26382631 }
2639 dx = sp.getInt("Multisep") * (cnt - 1) / 2;
2632 dx = sp.Multisep * (cnt - 1) / 2;
26402633 for (i = 1; i < pointn[0] - 1; i++)
2641 Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") - dx);
2634 Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x - dx);
26422635 if (Z.z().numpts > Z.z().numpts2) {
26432636 UNSUPPORTED("9ubr4m7bdv5f5ldk2ta6yw3up"); // numpts2 = numpts;
26442637 UNSUPPORTED("8qwp7ddy5ztgam63fzfjmu890"); // pointfs2 = RALLOC(numpts2, pointfs2, pointf);
26452638 }
26462639 for (i = 0; i < pointn[0]; i++)
26472640 Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
2648 clip_and_install(fe, hn, Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
2641 clip_and_install(fe, hn, Z.z().pointfs2, pointn[0], Z.z().sinfo);
26492642 for (j = 1; j < cnt; j++) {
2650 e = (Agedge_s) edges.plus(ind + j).getPtr();
2643 e = (ST_Agedge_s) edges.plus(ind + j).getPtr();
26512644 if ((ED_tree_index(e) & 32)!=0) {
2652 MAKEFWDEDGE(fwdedge.getStruct("out").amp(), e);
2653 e = (Agedge_s) fwdedge.getStruct("out").amp();
2645 MAKEFWDEDGE(fwdedge.out, e);
2646 e = (ST_Agedge_s) fwdedge.out;
26542647 }
26552648 for (i = 1; i < pointn[0] - 1; i++)
2656 Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.plus(i).getDouble("x") + sp.getInt("Multisep"));
2649 Z.z().pointfs.plus(i).setDouble("x", Z.z().pointfs.get(i).x + sp.Multisep);
26572650 for (i = 0; i < pointn[0]; i++)
26582651 Z.z().pointfs2.plus(i).setStruct(Z.z().pointfs.plus(i).getStruct());
2659 clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo.amp());
2652 clip_and_install(e, aghead(e), Z.z().pointfs2, pointn[0], Z.z().sinfo);
26602653 }
26612654 } finally {
26622655 LEAVING("30wfq1dby4t07hft9io52nq6z","make_regular_edge");
26682661
26692662 //3 va61hggynvb6z6j34w7otmab
26702663 // static void completeregularpath(path * P, edge_t * first, edge_t * last, pathend_t * tendp, pathend_t * hendp, boxf * boxes, int boxn, int flag)
2671 public static void completeregularpath(path P, Agedge_s first, Agedge_s last, pathend_t tendp, pathend_t hendp, __array_of_struct__ boxes, int boxn, int flag) {
2664 public static void completeregularpath(ST_path P, ST_Agedge_s first, ST_Agedge_s last, ST_pathend_t tendp, ST_pathend_t hendp, ST_boxf[] boxes, int boxn, int flag) {
26722665 ENTERING("va61hggynvb6z6j34w7otmab","completeregularpath");
26732666 try {
2674 Agedge_s uleft, uright, lleft, lright;
2667 ST_Agedge_s uleft, uright, lleft, lright;
26752668 int i, fb, lb;
2676 splines spl;
2677 pointf pp;
2669 ST_splines spl;
2670 ST_pointf.Array pp;
26782671 int pn;
26792672 fb = lb = -1;
26802673 uleft = uright = null;
26822675 uright = top_bound(first, 1);
26832676 if (uleft!=null) {
26842677 if (N(spl = getsplinepoints(uleft))) return;
2685 pp = (pointf) spl.getArrayOfPtr("list").plus(0).getPtr().getPtr("list");
2686 pn = spl.getArrayOfPtr("list").plus(0).getPtr().getInt("size");
2678 pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
2679 pn = spl.list.get(0).size;
26872680 }
26882681 if (uright!=null) {
26892682 if (N(spl = getsplinepoints(uright))) return;
2690 pp = (pointf) spl.getArrayOfPtr("list").plus(0).getPtr().getPtr("list");
2691 pn = spl.getArrayOfPtr("list").plus(0).getPtr().getInt("size");
2683 pp = ((ST_bezier)spl.list.get(0).getPtr()).list;
2684 pn = spl.list.get(0).size;
26922685 }
26932686 lleft = lright = null;
26942687 lleft = bot_bound(last, -1);
26952688 lright = bot_bound(last, 1);
26962689 if (lleft!=null) {
26972690 if (N(spl = getsplinepoints(lleft))) return;
2698 pp = (pointf) spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getPtr("list");
2699 pn = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getInt("size");
2691 pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
2692 pn = spl.list.plus(spl.size - 1).getPtr().size;
27002693 }
27012694 if (lright!=null) {
27022695 if (N(spl = getsplinepoints(lright))) return;
2703 pp = (pointf) spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getPtr("list");
2704 pn = spl.getArrayOfPtr("list").plus(spl.getInt("size") - 1).getPtr().getInt("size");
2705 }
2706 for (i = 0; i < tendp.getInt("boxn"); i++)
2707 add_box(P, (ST_boxf)tendp.getArrayOfStruct("boxes").plus(i).getStruct());
2708 fb = P.getInt("nbox") + 1;
2696 pp = ((ST_bezier)spl.list.plus(spl.size - 1).getPtr().getPtr()).list;
2697 pn = spl.list.plus(spl.size - 1).getPtr().size;
2698 }
2699 for (i = 0; i < tendp.boxn; i++)
2700 add_box(P, (tendp).boxes[i]);
2701 fb = P.nbox + 1;
27092702 lb = fb + boxn - 3;
27102703 for (i = 0; i < boxn; i++)
2711 add_box(P, (ST_boxf)boxes.plus(i).getStruct());
2712 for (i = hendp.getInt("boxn") - 1; i >= 0; i--)
2713 add_box(P, (ST_boxf)hendp.getArrayOfStruct("boxes").plus(i).getStruct());
2704 add_box(P, boxes[i]);
2705 for (i = hendp.boxn - 1; i >= 0; i--)
2706 add_box(P, (hendp).boxes[i]);
27142707 adjustregularpath(P, fb, lb);
27152708 } finally {
27162709 LEAVING("va61hggynvb6z6j34w7otmab","completeregularpath");
27222715
27232716 //3 3wwhczhpkcnflwr1l9wcga7tq
27242717 // static boxf makeregularend(boxf b, int side, double y)
2725 public static __struct__<boxf> makeregularend(final ST_boxf b, int side, double y) {
2718 public static ST_boxf makeregularend(final ST_boxf b, int side, double y) {
27262719 // WARNING!! STRUCT
27272720 return makeregularend_w_(b.copy(), side, y).copy();
27282721 }
2729 private static __struct__<boxf> makeregularend_w_(final ST_boxf b, int side, double y) {
2722 private static ST_boxf makeregularend_w_(final ST_boxf b, int side, double y) {
27302723 ENTERING("3wwhczhpkcnflwr1l9wcga7tq","makeregularend");
27312724 try {
2732 final __struct__<boxf> newb = JUtils.from(boxf.class);
2725 final ST_boxf newb = new ST_boxf();
27332726 switch (side) {
27342727 case (1<<0):
27352728 newb.___(boxfof(b.LL.x, y, b.UR.x, b.LL.y));
27492742
27502743 //3 88xrlzjovkxcnay9b2y5zyiid
27512744 // static void adjustregularpath(path * P, int fb, int lb)
2752 public static void adjustregularpath(path P, int fb, int lb) {
2745 public static void adjustregularpath(ST_path P, int fb, int lb) {
27532746 ENTERING("88xrlzjovkxcnay9b2y5zyiid","adjustregularpath");
27542747 try {
2755 boxf bp1, bp2;
2748 ST_boxf bp1, bp2;
27562749 int i, x;
27572750 for (i = fb-1; i < lb+1; i++) {
2758 bp1 = P.getArrayOfPtr("boxes").plus(i).getStruct().amp();
2751 bp1 = (ST_boxf) P.boxes[i];
27592752 if ((i - fb) % 2 == 0) {
2760 if (bp1.getStruct("LL").getDouble("x") >= bp1.getStruct("UR").getDouble("x")) {
2761 x = (int)((bp1.getStruct("LL").getDouble("x") + bp1.getStruct("UR").getDouble("x")) / 2);
2762 bp1.getStruct("LL").setDouble("x", x - 8);
2763 bp1.getStruct("UR").setDouble("x", x + 8);
2753 if (bp1.LL.x >= bp1.UR.x) {
2754 x = (int)((bp1.LL.x + bp1.UR.x) / 2);
2755 bp1.LL.setDouble("x", x - 8);
2756 bp1.UR.setDouble("x", x + 8);
27642757 }
27652758 } else {
2766 if (bp1.getStruct("LL").getDouble("x") + 16 > bp1.getStruct("UR").getDouble("x")) {
2767 x = (int)((bp1.getStruct("LL").getDouble("x") + bp1.getStruct("UR").getDouble("x")) / 2);
2768 bp1.getStruct("LL").setDouble("x", x - 8);
2769 bp1.getStruct("UR").setDouble("x", x + 8);
2759 if (bp1.LL.x + 16 > bp1.UR.x) {
2760 x = (int)((bp1.LL.x + bp1.UR.x) / 2);
2761 bp1.LL.setDouble("x", x - 8);
2762 bp1.UR.setDouble("x", x + 8);
27702763 }
27712764 }
27722765 }
2773 for (i = 0; i < P.getInt("nbox") - 1; i++) {
2774 bp1 = P.getArrayOfPtr("boxes").plus(i).getStruct().amp();
2775 bp2 = P.getArrayOfPtr("boxes").plus(i+1).getStruct().amp();
2766 for (i = 0; i < P.nbox - 1; i++) {
2767 bp1 = (ST_boxf) P.boxes[i];
2768 bp2 = (ST_boxf) P.boxes[i+1];
27762769 if (i >= fb && i <= lb && (i - fb) % 2 == 0) {
2777 if (bp1.getStruct("LL").getDouble("x") + 16 > bp2.getStruct("UR").getDouble("x"))
2778 bp2.getStruct("UR").setDouble("x", bp1.getStruct("LL").getDouble("x") + 16);
2779 if (bp1.getStruct("UR").getDouble("x") - 16 < bp2.getStruct("LL").getDouble("x"))
2780 bp2.getStruct("LL").setDouble("x", bp1.getStruct("UR").getDouble("x") - 16);
2770 if (bp1.LL.x + 16 > bp2.UR.x)
2771 bp2.UR.setDouble("x", bp1.LL.x + 16);
2772 if (bp1.UR.x - 16 < bp2.LL.x)
2773 bp2.LL.setDouble("x", bp1.UR.x - 16);
27812774 } else if (i + 1 >= fb && i < lb && (i + 1 - fb) % 2 == 0) {
2782 if (bp1.getStruct("LL").getDouble("x") + 16 > bp2.getStruct("UR").getDouble("x"))
2783 bp1.getStruct("LL").setDouble("x", bp2.getStruct("UR").getDouble("x") - 16);
2784 if (bp1.getStruct("UR").getDouble("x") - 16 < bp2.getStruct("LL").getDouble("x"))
2785 bp1.getStruct("UR").setDouble("x", bp2.getStruct("LL").getDouble("x") + 16);
2775 if (bp1.LL.x + 16 > bp2.UR.x)
2776 bp1.LL.setDouble("x", bp2.UR.x - 16);
2777 if (bp1.UR.x - 16 < bp2.LL.x)
2778 bp1.UR.setDouble("x", bp2.LL.x + 16);
27862779 }
27872780 }
27882781 } finally {
27952788
27962789 //3 bajn5vx0isu427n6dh131b985
27972790 // static boxf rank_box(spline_info_t* sp, graph_t * g, int r)
2798 public static ST_boxf rank_box(spline_info_t sp, Agraph_s g, int r) {
2791 public static ST_boxf rank_box(ST_spline_info_t sp, ST_Agraph_s g, int r) {
27992792 // WARNING!! STRUCT
28002793 return rank_box_w_(sp, g, r).copy();
28012794 }
2802 private static ST_boxf rank_box_w_(spline_info_t sp, Agraph_s g, int r) {
2795 private static ST_boxf rank_box_w_(ST_spline_info_t sp, ST_Agraph_s g, int r) {
28032796 ENTERING("bajn5vx0isu427n6dh131b985","rank_box");
28042797 try {
28052798 final ST_boxf b = new ST_boxf();
2806 Agnode_s /* *right0, *right1, */ left0, left1;
2807 b.___(sp.getPtr("Rank_box").plus(r).getStruct());
2799 ST_Agnode_s /* *right0, *right1, */ left0, left1;
2800 b.___(sp.Rank_box[r]);
28082801 if (b.LL.x == b.UR.x) {
2809 left0 = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
2802 left0 = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
28102803 /* right0 = GD_rank(g)[r].v[GD_rank(g)[r].n - 1]; */
2811 left1 = (Agnode_s) GD_rank(g).plus(r + 1).getArrayOfPtr("v").plus(0).getPtr();
2804 left1 = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(0);
28122805 /* right1 = GD_rank(g)[r + 1].v[GD_rank(g)[r + 1].n - 1]; */
2813 b.LL.x = sp.getInt("LeftBound");
2814 b.LL.y = ND_coord(left1).getDouble("y") + GD_rank(g).plus(r + 1).getDouble("ht2");
2815 b.UR.x = sp.getInt("RightBound");
2816 b.UR.y = ND_coord(left0).getDouble("y") - GD_rank(g).plus(r).getDouble("ht1");
2817 sp.getPtr("Rank_box").plus(r).setStruct(b);
2806 b.LL.x = sp.LeftBound;
2807 b.LL.y = ND_coord(left1).y + GD_rank(g).get(r + 1).ht2;
2808 b.UR.x = sp.RightBound;
2809 b.UR.y = ND_coord(left0).y - GD_rank(g).get(r).ht1;
2810 sp.Rank_box[r].setStruct(b);
28182811 }
28192812 return b;
28202813 } finally {
28272820
28282821 //3 6qwcnugx2ytjrvi5rgxzyzg5i
28292822 // static int straight_len(node_t * n)
2830 public static int straight_len(Agnode_s n) {
2823 public static int straight_len(ST_Agnode_s n) {
28312824 ENTERING("6qwcnugx2ytjrvi5rgxzyzg5i","straight_len");
28322825 try {
28332826 int cnt = 0;
2834 Agnode_s v;
2827 ST_Agnode_s v;
28352828 v = n;
28362829 while (true) {
2837 v = (Agnode_s) aghead(ND_out(v).getFromList(0));
2830 v = (ST_Agnode_s) aghead(ND_out(v).getFromList(0));
28382831 if (ND_node_type(v) != 1)
28392832 break;
28402833 if ((ND_out(v).size != 1) || (ND_in(v).size != 1))
28412834 break;
2842 if (ND_coord(v).getDouble("x") != ND_coord(n).getDouble("x"))
2835 if (ND_coord(v).x != ND_coord(n).x)
28432836 break;
28442837 cnt++;
28452838 }
28542847
28552848 //3 15pgjjuil2c1rjldu29j07gbz
28562849 // static edge_t *straight_path(edge_t * e, int cnt, pointf * plist, int *np)
2857 public static Agedge_s straight_path(Agedge_s e, int cnt, __ptr__ plist, int np[]) {
2850 public static ST_Agedge_s straight_path(ST_Agedge_s e, int cnt, __ptr__ plist, int np[]) {
28582851 ENTERING("15pgjjuil2c1rjldu29j07gbz","straight_path");
28592852 try {
28602853 int n = np[0];
2861 Agedge_s f = e;
2854 ST_Agedge_s f = e;
28622855 while ((cnt--)!=0)
2863 f = (Agedge_s) ND_out(aghead(f)).getFromList(0);
2856 f = (ST_Agedge_s) ND_out(aghead(f)).getFromList(0);
28642857 plist.plus(np[0]++).setStruct(plist.plus(n - 1).getStruct());
28652858 plist.plus(np[0]++).setStruct(plist.plus(n - 1).getStruct());
28662859 plist.plus(np[0]).setStruct(ND_coord(agtail(f))); /* will be overwritten by next spline */
28752868
28762869 //3 4ilkzqtegd5uffawb4qcjthu1
28772870 // static void recover_slack(edge_t * e, path * p)
2878 public static void recover_slack(Agedge_s e, path p) {
2871 public static void recover_slack(ST_Agedge_s e, ST_path p) {
28792872 ENTERING("4ilkzqtegd5uffawb4qcjthu1","recover_slack");
28802873 try {
28812874 int b;
2882 Agnode_s vn;
2875 ST_Agnode_s vn;
28832876 b = 0; /* skip first rank box */
28842877 for (vn = aghead(e);
2885 ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.call("splineMerge", vn)).booleanValue());
2878 ND_node_type(vn) == 1 && N(((Boolean)Z.z().sinfo.splineMerge.exe(vn)).booleanValue());
28862879 vn = aghead(ND_out(vn).getFromList(0))) {
2887 while ((b < p.getInt("nbox")) && (p.getPtr("boxes").plus(b).getStruct("LL").getDouble("y") > ND_coord(vn).getDouble("y")))
2880 while ((b < p.nbox) && (p.boxes[b].LL.y > ND_coord(vn).y))
28882881 b++;
2889 if (b >= p.getInt("nbox"))
2882 if (b >= p.nbox)
28902883 break;
2891 if (p.getPtr("boxes").plus(b).getStruct("UR").getDouble("y") < ND_coord(vn).getDouble("y"))
2884 if (p.boxes[b].UR.y < ND_coord(vn).y)
28922885 continue;
28932886 if (ND_label(vn)!=null)
2894 resize_vn(vn, (int)p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x"), (int)p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x"),
2895 (int)(p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x") + ND_rw(vn)));
2887 resize_vn(vn, (int)p.boxes[b].LL.x, (int)p.boxes[b].UR.x,
2888 (int)(p.boxes[b].UR.x + ND_rw(vn)));
28962889 else
2897 resize_vn(vn, (int)p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x"), (int)((p.getPtr("boxes").plus(b).getStruct("LL").getDouble("x") +
2898 p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x")) / 2),
2899 (int)p.getPtr("boxes").plus(b).getStruct("UR").getDouble("x"));
2890 resize_vn(vn, (int)p.boxes[b].LL.x, (int)((p.boxes[b].LL.x +
2891 p.boxes[b].UR.x) / 2),
2892 (int)p.boxes[b].UR.x);
29002893 }
29012894 } finally {
29022895 LEAVING("4ilkzqtegd5uffawb4qcjthu1","recover_slack");
29082901
29092902 //3 3vmg1q1r0eb14etvjdk4cukpd
29102903 // static void resize_vn(vn, lx, cx, rx) node_t *vn
2911 public static void resize_vn(Agnode_s vn, int lx, int cx, int rx) {
2904 public static void resize_vn(ST_Agnode_s vn, int lx, int cx, int rx) {
29122905 ENTERING("3vmg1q1r0eb14etvjdk4cukpd","resize_vn");
29132906 try {
29142907 ND_coord(vn).setDouble("x", cx);
29242917
29252918 //3 9t0v5wicmjuc3ij9hko6iawle
29262919 // static edge_t *top_bound(edge_t * e, int side)
2927 public static Agedge_s top_bound(Agedge_s e, int side) {
2920 public static ST_Agedge_s top_bound(ST_Agedge_s e, int side) {
29282921 ENTERING("9t0v5wicmjuc3ij9hko6iawle","top_bound");
29292922 try {
2930 Agedge_s f, ans = null;
2923 ST_Agedge_s f, ans = null;
29312924 int i;
2932 for (i = 0; (f = (Agedge_s) ND_out(agtail(e)).getFromList(i))!=null; i++) {
2925 for (i = 0; (f = (ST_Agedge_s) ND_out(agtail(e)).getFromList(i))!=null; i++) {
29332926 if (side * (ND_order(aghead(f)) - ND_order(aghead(e))) <= 0)
29342927 continue;
29352928 if ((ED_spl(f) == null)
29502943
29512944 //3 9fsg0uiyhtrayd4mimmc0i25e
29522945 // static edge_t *bot_bound(edge_t * e, int side)
2953 public static Agedge_s bot_bound(Agedge_s e, int side) {
2946 public static ST_Agedge_s bot_bound(ST_Agedge_s e, int side) {
29542947 ENTERING("9fsg0uiyhtrayd4mimmc0i25e","bot_bound");
29552948 try {
2956 Agedge_s f, ans = null;
2949 ST_Agedge_s f, ans = null;
29572950 int i;
2958 for (i = 0; (f = (Agedge_s) ND_in(aghead(e)).getFromList(i))!=null; i++) {
2951 for (i = 0; (f = (ST_Agedge_s) ND_in(aghead(e)).getFromList(i))!=null; i++) {
29592952 if (side * (ND_order(agtail(f)) - ND_order(agtail(e))) <= 0)
29602953 continue;
29612954 if ((ED_spl(f) == null)
29762969
29772970 //3 65uvkv1mextaah5m997ibe3qs
29782971 // static int cl_vninside(graph_t * cl, node_t * n)
2979 public static boolean cl_vninside(Agraph_s cl, Agnode_s n) {
2972 public static boolean cl_vninside(ST_Agraph_s cl, ST_Agnode_s n) {
29802973 ENTERING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
29812974 try {
2982 return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).getDouble("x")), GD_bb(cl).UR.x) &&
2983 BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).getDouble("y")), GD_bb(cl).UR.y));
2975 return (BETWEEN(GD_bb(cl).LL.x, (double)(ND_coord(n).x), GD_bb(cl).UR.x) &&
2976 BETWEEN(GD_bb(cl).LL.y, (double)(ND_coord(n).y), GD_bb(cl).UR.y));
29842977 } finally {
29852978 LEAVING("65uvkv1mextaah5m997ibe3qs","cl_vninside");
29862979 }
29912984
29922985 //3 dzvvmxkya868w5x78lkvchigk
29932986 // static Agraph_t *cl_bound(graph_t* g, node_t *n, node_t *adj)
2994 public static Agraph_s cl_bound(Agraph_s g, Agnode_s n, Agnode_s adj) {
2987 public static ST_Agraph_s cl_bound(ST_Agraph_s g, ST_Agnode_s n, ST_Agnode_s adj) {
29952988 ENTERING("dzvvmxkya868w5x78lkvchigk","cl_bound");
29962989 try {
2997 Agraph_s rv, cl, tcl, hcl;
2998 Agedge_s orig;
2990 ST_Agraph_s rv, cl, tcl, hcl;
2991 ST_Agedge_s orig;
29992992 rv = null;
30002993 if (ND_node_type(n) == 0)
30012994 tcl = hcl = ND_clust(n);
30303023
30313024 //3 6qwgl36ugfnduc5x59ohuewv1
30323025 // static boxf maximal_bbox(graph_t* g, spline_info_t* sp, node_t* vn, edge_t* ie, edge_t* oe)
3033 public static __struct__<boxf> maximal_bbox(Agraph_s g, spline_info_t sp, Agnode_s vn, Agedge_s ie, Agedge_s oe) {
3026 public static ST_boxf maximal_bbox(ST_Agraph_s g, ST_spline_info_t sp, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe) {
30343027 // WARNING!! STRUCT
30353028 return maximal_bbox_w_(g, sp, vn, ie, oe).copy();
30363029 }
3037 private static __struct__<boxf> maximal_bbox_w_(Agraph_s g, spline_info_t sp, Agnode_s vn, Agedge_s ie, Agedge_s oe) {
3030 private static ST_boxf maximal_bbox_w_(ST_Agraph_s g, ST_spline_info_t sp, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe) {
30383031 ENTERING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
30393032 try {
30403033 double b, nb;
3041 Agraph_s left_cl, right_cl;
3042 Agnode_s left, right;
3034 ST_Agraph_s left_cl, right_cl;
3035 ST_Agnode_s left, right;
30433036 final ST_boxf rv = new ST_boxf();
30443037 left_cl = right_cl = null;
30453038 /* give this node all the available space up to its neighbors */
3046 b = (double)(ND_coord(vn).getDouble("x") - ND_lw(vn) - 4);
3039 b = (double)(ND_coord(vn).x - ND_lw(vn) - 4);
30473040 if ((left = neighbor(g, vn, ie, oe, -1))!=null) {
30483041 if ((left_cl = cl_bound(g, vn, left))!=null)
3049 nb = GD_bb(left_cl).UR.x + (double)(sp.getInt("Splinesep"));
3042 nb = GD_bb(left_cl).UR.x + (double)(sp.Splinesep);
30503043 else {
3051 nb = (double)(ND_coord(left).getDouble("x") + ND_mval(left));
3044 nb = (double)(ND_coord(left).x + ND_mval(left));
30523045 if (ND_node_type(left) == 0)
30533046 nb += GD_nodesep(g) / 2.;
30543047 else
3055 nb += (double)(sp.getInt("Splinesep"));
3048 nb += (double)(sp.Splinesep);
30563049 }
30573050 if (nb < b)
30583051 b = nb;
30593052 rv.LL.x = ROUND(b);
30603053 } else
3061 rv.LL.x = MIN(ROUND(b), sp.getInt("LeftBound"));
3054 rv.LL.x = MIN(ROUND(b), sp.LeftBound);
30623055 /* we have to leave room for our own label! */
30633056 if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null))
3064 b = (double)(ND_coord(vn).getDouble("x") + 10);
3057 b = (double)(ND_coord(vn).x + 10);
30653058 else
3066 b = (double)(ND_coord(vn).getDouble("x") + ND_rw(vn) + 4);
3059 b = (double)(ND_coord(vn).x + ND_rw(vn) + 4);
30673060 if ((right = neighbor(g, vn, ie, oe, 1))!=null) {
30683061 if ((right_cl = cl_bound(g, vn, right))!=null)
3069 nb = GD_bb(right_cl).LL.x - (double)(sp.getInt("Splinesep"));
3062 nb = GD_bb(right_cl).LL.x - (double)(sp.Splinesep);
30703063 else {
3071 nb = ND_coord(right).getDouble("x") - ND_lw(right);
3064 nb = ND_coord(right).x - ND_lw(right);
30723065 if (ND_node_type(right) == 0)
30733066 nb -= GD_nodesep(g) / 2.;
30743067 else
3075 nb -= (double)(sp.getInt("Splinesep"));
3068 nb -= (double)(sp.Splinesep);
30763069 }
30773070 if (nb > b)
30783071 b = nb;
30793072 rv.UR.x = ROUND(b);
30803073 } else
3081 rv.UR.x = MAX(ROUND(b), sp.getInt("RightBound"));
3074 rv.UR.x = MAX(ROUND(b), sp.RightBound);
30823075 if ((ND_node_type(vn) == 1) && (ND_label(vn)!=null)) {
30833076 rv.UR.x = rv.UR.x - ND_rw(vn);
3084 if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).getDouble("x");
3085 }
3086 rv.LL.y = ND_coord(vn).getDouble("y") - GD_rank(g).plus(ND_rank(vn)).getDouble("ht1");
3087 rv.UR.y = ND_coord(vn).getDouble("y") + GD_rank(g).plus(ND_rank(vn)).getDouble("ht2");
3077 if (rv.UR.x < rv.LL.x) rv.UR.x = ND_coord(vn).x;
3078 }
3079 rv.LL.y = ND_coord(vn).y - GD_rank(g).get(ND_rank(vn)).ht1;
3080 rv.UR.y = ND_coord(vn).y + GD_rank(g).get(ND_rank(vn)).ht2;
30883081 return rv;
30893082 } finally {
30903083 LEAVING("6qwgl36ugfnduc5x59ohuewv1","maximal_bbox");
30963089
30973090 //3 18pm6r3xcy90f0xi5hpm9jdhk
30983091 // static node_t * neighbor(graph_t* g, node_t *vn, edge_t *ie, edge_t *oe, int dir)
3099 public static Agnode_s neighbor(Agraph_s g, Agnode_s vn, Agedge_s ie, Agedge_s oe, int dir) {
3092 public static ST_Agnode_s neighbor(ST_Agraph_s g, ST_Agnode_s vn, ST_Agedge_s ie, ST_Agedge_s oe, int dir) {
31003093 ENTERING("18pm6r3xcy90f0xi5hpm9jdhk","neighbor");
31013094 try {
31023095 int i;
3103 Agnode_s n, rv = null;
3104 __ptr__ rank = GD_rank(g).plus(ND_rank(vn));
3105 for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getInt("n"))); i += dir) {
3106 n = (Agnode_s) rank.getArrayOfPtr("v").plus(i).getPtr();
3096 ST_Agnode_s n, rv = null;
3097 ST_rank_t.Array2 rank = GD_rank(g).plus(ND_rank(vn));
3098 for (i = ND_order(vn) + dir; ((i >= 0) && (i < rank.getPtr().n)); i += dir) {
3099 n = (ST_Agnode_s) rank.getPtr().v.get(i);
31073100 if ((ND_node_type(n) == 1) && (ND_label(n)!=null)) {
31083101 rv = n;
31093102 break;
31283121
31293122 //3 f4q0oqe165s9pl5k0th5noeyv
31303123 // static boolean pathscross(n0, n1, ie1, oe1) node_t *n0, *n1
3131 public static boolean pathscross(Agnode_s n0, Agnode_s n1, Agedge_s ie1, Agedge_s oe1) {
3124 public static boolean pathscross(ST_Agnode_s n0, ST_Agnode_s n1, ST_Agedge_s ie1, ST_Agedge_s oe1) {
31323125 ENTERING("f4q0oqe165s9pl5k0th5noeyv","pathscross");
31333126 try {
3134 Agedge_s e0, e1;
3135 Agnode_s na, nb;
3127 ST_Agedge_s e0, e1;
3128 ST_Agnode_s na, nb;
31363129 boolean order;
31373130 int cnt;
31383131 order = (ND_order(n0) > ND_order(n1));
31403133 return false;
31413134 e1 = oe1;
31423135 if (ND_out(n0).size == 1 && e1!=null) {
3143 e0 = (Agedge_s) ND_out(n0).getFromList(0);
3136 e0 = (ST_Agedge_s) ND_out(n0).getFromList(0);
31443137 for (cnt = 0; cnt < 2; cnt++) {
31453138 if (EQ(na = aghead(e0), nb = aghead(e1)))
31463139 break;
31483141 return NOT(false);
31493142 if ((ND_out(na).size != 1) || (ND_node_type(na) == 0))
31503143 break;
3151 e0 = (Agedge_s) ND_out(na).getFromList(0);
3144 e0 = (ST_Agedge_s) ND_out(na).getFromList(0);
31523145 if ((ND_out(nb).size != 1) || (ND_node_type(nb) == 0))
31533146 break;
3154 e1 = (Agedge_s) ND_out(nb).getFromList(0);
3147 e1 = (ST_Agedge_s) ND_out(nb).getFromList(0);
31553148 }
31563149 }
31573150 e1 = ie1;
31583151 if (ND_in(n0).size == 1 && e1!=null) {
3159 e0 = (Agedge_s) ND_in(n0).getFromList(0);
3152 e0 = (ST_Agedge_s) ND_in(n0).getFromList(0);
31603153 for (cnt = 0; cnt < 2; cnt++) {
31613154 if (EQ(na = agtail(e0), nb = agtail(e1)))
31623155 break;
31643157 return NOT(false);
31653158 if ((ND_in(na).size != 1) || (ND_node_type(na) == 0))
31663159 break;
3167 e0 = (Agedge_s) ND_in(na).getFromList(0);
3160 e0 = (ST_Agedge_s) ND_in(na).getFromList(0);
31683161 if ((ND_in(nb).size != 1) || (ND_node_type(nb) == 0))
31693162 break;
3170 e1 = (Agedge_s) ND_in(nb).getFromList(0);
3163 e1 = (ST_Agedge_s) ND_in(nb).getFromList(0);
31713164 }
31723165 }
31733166 return false;
4646 import static gen.lib.cgraph.edge__c.aghead;
4747 import static gen.lib.cgraph.edge__c.agtail;
4848 import static gen.lib.cgraph.obj__c.agroot;
49 import static gen.lib.common.memory__c.zmalloc;
5049 import static gen.lib.dotgen.dotinit__c.dot_root;
5150 import static smetana.core.JUtils.EQ;
52 import static smetana.core.JUtils.sizeof;
5351 import static smetana.core.JUtilsDebug.ENTERING;
5452 import static smetana.core.JUtilsDebug.LEAVING;
5553 import static smetana.core.Macro.AGINEDGE;
8785 import static smetana.core.Macro.agtail;
8886 import static smetana.core.Macro.alloc_elist;
8987 import static smetana.core.Macro.elist_append;
90 import h.Agedge_s;
91 import h.Agedgeinfo_t;
92 import h.Agedgepair_s;
93 import h.Agnode_s;
94 import h.Agnodeinfo_t;
95 import h.Agraph_s;
96 import h.Agrec_s;
88 import h.ST_Agedge_s;
89 import h.ST_Agedgeinfo_t;
90 import h.ST_Agedgepair_s;
91 import h.ST_Agnode_s;
92 import h.ST_Agnodeinfo_t;
93 import h.ST_Agraph_s;
94 import h.ST_Agrec_s;
9795 import h.ST_elist;
98 import h.boxf;
99 import h.elist;
100 import h.pointf;
101 import smetana.core.JUtils;
102 import smetana.core.__struct__;
96 import h.ST_pointf;
10397
10498 public class fastgr__c {
10599 //1 2digov3edok6d5srhgtlmrycs
359353
360354 //3 c1s4k85p1cdfn176o3uryeros
361355 // static inline pointf pointfof(double x, double y)
362 public static __struct__<pointf> pointfof(double x, double y) {
356 public static ST_pointf pointfof(double x, double y) {
363357 // WARNING!! STRUCT
364358 return pointfof_w_(x, y).copy();
365359 }
366 private static __struct__<pointf> pointfof_w_(double x, double y) {
360 private static ST_pointf pointfof_w_(double x, double y) {
367361 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
368362 try {
369 final __struct__<pointf> r = JUtils.from(pointf.class);
363 final ST_pointf r = new ST_pointf();
370364 r.setDouble("x", x);
371365 r.setDouble("y", y);
372366 return r;
395389
396390
397391
398 //3 1vvsta5i8of59frav6uymguav
399 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
400 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
401 // WARNING!! STRUCT
402 return boxfof_w_(llx, lly, urx, ury).copy();
403 }
404 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
405 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
406 try {
407 final __struct__<boxf> b = JUtils.from(boxf.class);
408 b.getStruct("LL").setDouble("x", llx);
409 b.getStruct("LL").setDouble("y", lly);
410 b.getStruct("UR").setDouble("x", urx);
411 b.getStruct("UR").setDouble("y", ury);
412 return b;
413 } finally {
414 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
415 }
416 }
417392
418393
419394
437412
438413 //3 arrsbik9b5tnfcbzsm8gr2chx
439414 // static inline pointf add_pointf(pointf p, pointf q)
440 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
415 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
441416 // WARNING!! STRUCT
442417 return add_pointf_w_(p.copy(), q.copy()).copy();
443418 }
444 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
419 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
445420 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
446421 try {
447 final __struct__<pointf> r = JUtils.from(pointf.class);
448 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
449 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
422 final ST_pointf r = new ST_pointf();
423 r.setDouble("x", p.x + q.x);
424 r.setDouble("y", p.y + q.y);
450425 return r;
451426 } finally {
452427 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
743718
744719 //3 econbrl314rr46qnvvw5e32j7
745720 // static edge_t *ffe(node_t * u, elist uL, node_t * v, elist vL)
746 public static Agedge_s ffe(Agnode_s u, final ST_elist uL, Agnode_s v, final ST_elist vL) {
721 public static ST_Agedge_s ffe(ST_Agnode_s u, final ST_elist uL, ST_Agnode_s v, final ST_elist vL) {
747722 // WARNING!! STRUCT
748723 return ffe_w_(u, uL.copy(), v, vL.copy());
749724 }
750 private static Agedge_s ffe_w_(Agnode_s u, final ST_elist uL, Agnode_s v, final ST_elist vL) {
725 private static ST_Agedge_s ffe_w_(ST_Agnode_s u, final ST_elist uL, ST_Agnode_s v, final ST_elist vL) {
751726 ENTERING("econbrl314rr46qnvvw5e32j7","ffe");
752727 try {
753728 int i;
754 Agedge_s e = null;
729 ST_Agedge_s e = null;
755730 if ((uL.size > 0) && (vL.size > 0)) {
756731 if (uL.size < vL.size) {
757 for (i = 0; (e = (Agedge_s) uL.getFromList(i))!=null; i++)
732 for (i = 0; (e = (ST_Agedge_s) uL.getFromList(i))!=null; i++)
758733 if (EQ(aghead(e), v))
759734 break;
760735 } else {
761 for (i = 0; (e = (Agedge_s) vL.getFromList(i))!=null; i++)
736 for (i = 0; (e = (ST_Agedge_s) vL.getFromList(i))!=null; i++)
762737 if (EQ(agtail(e), u))
763738 break;
764739 }
775750
776751 //3 1uygfrgur73lfy9vsjozwwupm
777752 // edge_t *find_fast_edge(node_t * u, node_t * v)
778 public static Agedge_s find_fast_edge(Agnode_s u, Agnode_s v) {
753 public static ST_Agedge_s find_fast_edge(ST_Agnode_s u, ST_Agnode_s v) {
779754 ENTERING("1uygfrgur73lfy9vsjozwwupm","find_fast_edge");
780755 try {
781756 return ffe(u, ND_out(u), v, ND_in(v));
789764
790765 //3 1yw7ahdnxnexnicj552zqyyej
791766 // static node_t* find_fast_node(graph_t * g, node_t * n)
792 public static Agnode_s find_fast_node(Agraph_s g, Agnode_s n) {
767 public static ST_Agnode_s find_fast_node(ST_Agraph_s g, ST_Agnode_s n) {
793768 ENTERING("1yw7ahdnxnexnicj552zqyyej","find_fast_node");
794769 try {
795 Agnode_s v;
770 ST_Agnode_s v;
796771 for (v = GD_nlist(g); v!=null; v = ND_next(v))
797772 if (EQ(v, n))
798773 break;
807782
808783 //3 bf1j97keudu416avridkj9fpb
809784 // edge_t *find_flat_edge(node_t * u, node_t * v)
810 public static Agedge_s find_flat_edge(Agnode_s u, Agnode_s v) {
785 public static ST_Agedge_s find_flat_edge(ST_Agnode_s u, ST_Agnode_s v) {
811786 ENTERING("bf1j97keudu416avridkj9fpb","find_flat_edge");
812787 try {
813788 return ffe(u, ND_flat_out(u), v, ND_flat_in(v));
840815
841816 //3 8t6gpubo908pz1pqnt1s88lnt
842817 // edge_t *fast_edge(edge_t * e)
843 public static Agedge_s fast_edge(Agedge_s e) {
818 public static ST_Agedge_s fast_edge(ST_Agedge_s e) {
844819 ENTERING("8t6gpubo908pz1pqnt1s88lnt","fast_edge");
845820 try {
846821 elist_append(e, ND_out(agtail(e)));
856831
857832 //3 dxb0q8ajb7iv25aj6zdqnbwh5
858833 // void zapinlist(elist * L, edge_t * e)
859 public static void zapinlist(elist L, Agedge_s e) {
834 public static void zapinlist(ST_elist L, ST_Agedge_s e) {
860835 ENTERING("dxb0q8ajb7iv25aj6zdqnbwh5","zapinlist");
861836 try {
862837 int i;
863 for (i = 0; i < L.getInt("size"); i++) {
864 if (EQ(L.getArrayOfPtr("list").plus(i).getPtr(), e)) {
865 L.setInt("size", L.getInt("size")-1);
866 L.getArrayOfPtr("list").plus(i).setPtr(L.getArrayOfPtr("list").plus(L.getInt("size")).getPtr());
867 L.getArrayOfPtr("list").plus(L.getInt("size")).setPtr(null);
838 for (i = 0; i < L.size; i++) {
839 if (EQ(L.list.get(i), e)) {
840 L.size = L.size-1;
841 L.list.set(i, L.list.get(L.size));
842 L.list.set(L.size, null);
868843 break;
869844 }
870845 }
878853
879854 //3 dkv97rr4ytpehp291etaxe9gc
880855 // void delete_fast_edge(edge_t * e)
881 public static void delete_fast_edge(Agedge_s e) {
856 public static void delete_fast_edge(ST_Agedge_s e) {
882857 ENTERING("dkv97rr4ytpehp291etaxe9gc","delete_fast_edge");
883858 try {
884859 //assert(e != NULL);
885 zapinlist((ND_out(agtail(e))).amp(), e);
886 zapinlist((ND_in(aghead(e))).amp(), e);
860 zapinlist((ND_out(agtail(e))), e);
861 zapinlist((ND_in(aghead(e))), e);
887862 } finally {
888863 LEAVING("dkv97rr4ytpehp291etaxe9gc","delete_fast_edge");
889864 }
917892
918893 //3 73oebfcfiescklohgt8mddswc
919894 // void other_edge(edge_t * e)
920 public static void other_edge(Agedge_s e) {
895 public static void other_edge(ST_Agedge_s e) {
921896 ENTERING("73oebfcfiescklohgt8mddswc","other_edge");
922897 try {
923898 elist_append(e, ND_other(agtail(e)));
945920
946921 //3 4gd9tmpq70q0rij5otj0k6sn2
947922 // edge_t *new_virtual_edge(node_t * u, node_t * v, edge_t * orig)
948 public static Agedge_s new_virtual_edge(Agnode_s u, Agnode_s v, Agedge_s orig) {
923 public static ST_Agedge_s new_virtual_edge(ST_Agnode_s u, ST_Agnode_s v, ST_Agedge_s orig) {
949924 ENTERING("4gd9tmpq70q0rij5otj0k6sn2","new_virtual_edge");
950925 try {
951 Agedge_s e;
952 Agedgepair_s e2 = (Agedgepair_s)zmalloc(sizeof(Agedgepair_s.class));
953 AGTYPE(e2.getStruct("in").amp(), AGINEDGE);
954 AGTYPE(e2.getStruct("out").amp(), AGOUTEDGE);
955 e2.getStruct("out").getStruct("base").setPtr("data", zmalloc(sizeof(Agedgeinfo_t.class)).castTo(Agedgeinfo_t.class).castTo(Agrec_s.class));
956 e = (Agedge_s) e2.getStruct("out").amp();
926 ST_Agedge_s e;
927 ST_Agedgepair_s e2 = new ST_Agedgepair_s();
928 AGTYPE(e2.in, AGINEDGE);
929 AGTYPE(e2.out, AGOUTEDGE);
930 e2.out.base.setPtr("data", new ST_Agedgeinfo_t().castTo(ST_Agrec_s.class));
931 e = (ST_Agedge_s) e2.out;
957932 agtail(e, u);
958933 aghead(e, v);
959934 ED_edge_type(e, 1);
960935 if (orig!=null) {
961936 AGSEQ(e, AGSEQ(orig));
962 AGSEQ(e2.getStruct("in").amp(), AGSEQ(orig));
937 AGSEQ(e2.in, AGSEQ(orig));
963938 ED_count(e, ED_count(orig));
964939 ED_xpenalty(e, ED_xpenalty(orig));
965940 ED_weight(e, ED_weight(orig));
992967
993968 //3 9obdfflzw4cs2z9r0dng26mvw
994969 // edge_t *virtual_edge(node_t * u, node_t * v, edge_t * orig)
995 public static Agedge_s virtual_edge(Agnode_s u, Agnode_s v, Agedge_s orig) {
970 public static ST_Agedge_s virtual_edge(ST_Agnode_s u, ST_Agnode_s v, ST_Agedge_s orig) {
996971 ENTERING("9obdfflzw4cs2z9r0dng26mvw","virtual_edge");
997972 try {
998973 return fast_edge(new_virtual_edge(u, v, orig));
1006981
1007982 //3 98hkec8t6fjk10bjpstumw0ey
1008983 // void fast_node(graph_t * g, Agnode_t * n)
1009 public static void fast_node(Agraph_s g, Agnode_s n) {
984 public static void fast_node(ST_Agraph_s g, ST_Agnode_s n) {
1010985 ENTERING("98hkec8t6fjk10bjpstumw0ey","fast_node");
1011986 try {
1012987 ND_next(n, GD_nlist(g));
10451020
10461021 //3 emsq7b6s5100lscckzy3ileqd
10471022 // void delete_fast_node(graph_t * g, node_t * n)
1048 public static void delete_fast_node(Agraph_s g, Agnode_s n) {
1023 public static void delete_fast_node(ST_Agraph_s g, ST_Agnode_s n) {
10491024 ENTERING("emsq7b6s5100lscckzy3ileqd","delete_fast_node");
10501025 try {
10511026 assert(find_fast_node(g, n)!=null);
10651040
10661041 //3 eg08ajzojsm0224btmfi7kdxt
10671042 // node_t *virtual_node(graph_t * g)
1068 public static Agnode_s virtual_node(Agraph_s g) {
1043 public static ST_Agnode_s virtual_node(ST_Agraph_s g) {
10691044 ENTERING("eg08ajzojsm0224btmfi7kdxt","virtual_node");
10701045 try {
1071 Agnode_s n;
1072 n = (Agnode_s)zmalloc(sizeof(Agnode_s.class));
1046 ST_Agnode_s n;
1047 n = new ST_Agnode_s();
10731048 // agnameof(n) = "virtual";
10741049 AGTYPE(n, AGNODE);
1075 n.getStruct("base").setPtr("data", (Agnodeinfo_t)zmalloc(sizeof(Agnodeinfo_t.class)));
1050 n.base.setPtr("data", new ST_Agnodeinfo_t());
10761051 n.setPtr("root", agroot(g));
10771052 ND_node_type(n, 1);
10781053 ND_rw(n, 1);
10791054 ND_lw(n, 1);
10801055 ND_ht(n, 1);
10811056 ND_UF_size(n, 1);
1082 alloc_elist(4, ND_in(n), Agnode_s.class);
1083 alloc_elist(4, ND_out(n), Agnode_s.class);
1057 alloc_elist(4, ND_in(n));
1058 alloc_elist(4, ND_out(n));
10841059 fast_node(g, n);
10851060 GD_n_nodes(g, GD_n_nodes(g)+1);
10861061 return n;
10941069
10951070 //3 8dvukicq96g5t3xgdl0ue35mj
10961071 // void flat_edge(graph_t * g, edge_t * e)
1097 public static void flat_edge(Agraph_s g, Agedge_s e) {
1072 public static void flat_edge(ST_Agraph_s g, ST_Agedge_s e) {
10981073 ENTERING("8dvukicq96g5t3xgdl0ue35mj","flat_edge");
10991074 try {
11001075 elist_append(e, ND_flat_out(agtail(e)));
11111086
11121087 //3 clspalhiuedfnk9g9rlvfqpg7
11131088 // void delete_flat_edge(edge_t * e)
1114 public static void delete_flat_edge(Agedge_s e) {
1089 public static void delete_flat_edge(ST_Agedge_s e) {
11151090 ENTERING("clspalhiuedfnk9g9rlvfqpg7","delete_flat_edge");
11161091 try {
11171092 assert(e != null);
11181093 if (ED_to_orig(e)!=null && EQ(ED_to_virt(ED_to_orig(e)), e))
11191094 ED_to_virt(ED_to_orig(e), null);
1120 zapinlist((ND_flat_out(agtail(e))).amp(), e);
1121 zapinlist((ND_flat_in(aghead(e))).amp(), e);
1095 zapinlist((ND_flat_out(agtail(e))), e);
1096 zapinlist((ND_flat_in(aghead(e))), e);
11221097 } finally {
11231098 LEAVING("clspalhiuedfnk9g9rlvfqpg7","delete_flat_edge");
11241099 }
11291104
11301105 //3 dcfpol11cvlt6aaa6phqbp6fo
11311106 // static void basic_merge(edge_t * e, edge_t * rep)
1132 public static void basic_merge(Agedge_s e, Agedge_s rep) {
1107 public static void basic_merge(ST_Agedge_s e, ST_Agedge_s rep) {
11331108 ENTERING("dcfpol11cvlt6aaa6phqbp6fo","basic_merge");
11341109 try {
11351110 if (ED_minlen(rep) < ED_minlen(e))
11501125
11511126 //3 6dxgtoii76tmonlnvz4rmiytd
11521127 // void merge_oneway(edge_t * e, edge_t * rep)
1153 public static void merge_oneway(Agedge_s e, Agedge_s rep) {
1128 public static void merge_oneway(ST_Agedge_s e, ST_Agedge_s rep) {
11541129 ENTERING("6dxgtoii76tmonlnvz4rmiytd","merge_oneway");
11551130 try {
11561131 if (EQ(rep, ED_to_virt(e))) {
4545 package gen.lib.dotgen;
4646 import static gen.lib.cgraph.edge__c.aghead;
4747 import static gen.lib.cgraph.edge__c.agtail;
48 import static gen.lib.common.memory__c.zmalloc;
4948 import static gen.lib.dotgen.dotinit__c.dot_root;
5049 import static gen.lib.dotgen.fastgr__c.virtual_edge;
5150 import static gen.lib.dotgen.fastgr__c.virtual_node;
5251 import static gen.lib.dotgen.mincross__c.rec_reset_vlists;
5352 import static gen.lib.dotgen.mincross__c.rec_save_vlists;
5453 import static smetana.core.JUtils.EQ;
55 import static smetana.core.JUtils.sizeof_starstar_empty;
5654 import static smetana.core.JUtilsDebug.ENTERING;
5755 import static smetana.core.JUtilsDebug.LEAVING;
58 import static smetana.core.Macro.ALLOC;
56 import static smetana.core.Macro.ALLOC_Agnode_s;
57 import static smetana.core.Macro.ALLOC_ST_rank_t;
5958 import static smetana.core.Macro.ED_adjacent;
6059 import static smetana.core.Macro.ED_dist;
6160 import static smetana.core.Macro.ED_edge_type;
8988 import static smetana.core.Macro.ND_rw;
9089 import static smetana.core.Macro.NOT;
9190 import static smetana.core.Macro.UNSUPPORTED;
92 import h.Agedge_s;
93 import h.Agnode_s;
94 import h.Agraph_s;
95 import h.boxf;
96 import h.pointf;
97 import h.rank_t;
98 import smetana.core.JUtils;
91 import h.ST_Agedge_s;
92 import h.ST_Agnode_s;
93 import h.ST_Agraph_s;
94 import h.ST_pointf;
95 import h.ST_rank_t;
9996 import smetana.core.__ptr__;
100 import smetana.core.__struct__;
10197
10298 public class flat__c {
10399 //1 2digov3edok6d5srhgtlmrycs
357353
358354 //3 c1s4k85p1cdfn176o3uryeros
359355 // static inline pointf pointfof(double x, double y)
360 public static __struct__<pointf> pointfof(double x, double y) {
356 public static ST_pointf pointfof(double x, double y) {
361357 // WARNING!! STRUCT
362358 return pointfof_w_(x, y).copy();
363359 }
364 private static __struct__<pointf> pointfof_w_(double x, double y) {
360 private static ST_pointf pointfof_w_(double x, double y) {
365361 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
366362 try {
367 final __struct__<pointf> r = JUtils.from(pointf.class);
363 final ST_pointf r = new ST_pointf();
368364 r.setDouble("x", x);
369365 r.setDouble("y", y);
370366 return r;
393389
394390
395391
396 //3 1vvsta5i8of59frav6uymguav
397 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
398 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
399 // WARNING!! STRUCT
400 return boxfof_w_(llx, lly, urx, ury).copy();
401 }
402 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
403 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
404 try {
405 final __struct__<boxf> b = JUtils.from(boxf.class);
406 b.getStruct("LL").setDouble("x", llx);
407 b.getStruct("LL").setDouble("y", lly);
408 b.getStruct("UR").setDouble("x", urx);
409 b.getStruct("UR").setDouble("y", ury);
410 return b;
411 } finally {
412 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
413 }
414 }
415
416
417392
418393
419394 //3 1n5xl70wxuabyf97mclvilsm6
435410
436411 //3 arrsbik9b5tnfcbzsm8gr2chx
437412 // static inline pointf add_pointf(pointf p, pointf q)
438 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
413 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
439414 // WARNING!! STRUCT
440415 return add_pointf_w_(p.copy(), q.copy()).copy();
441416 }
442 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
417 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
443418 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
444419 try {
445 final __struct__<pointf> r = JUtils.from(pointf.class);
446 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
447 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
420 final ST_pointf r = new ST_pointf();
421 r.setDouble("x", p.x + q.x);
422 r.setDouble("y", p.y + q.y);
448423 return r;
449424 } finally {
450425 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
741716
742717 //3 e0gtvsxlvztmwu8yy44wfvf97
743718 // static node_t *make_vn_slot(graph_t * g, int r, int pos)
744 public static Agnode_s make_vn_slot(Agraph_s g, int r, int pos) {
719 public static ST_Agnode_s make_vn_slot(ST_Agraph_s g, int r, int pos) {
745720 ENTERING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
746721 try {
747722 int i;
748 __ptr__ v;
749 Agnode_s n;
750 v = ALLOC(GD_rank(g).plus(r).getInt("n") + 2, GD_rank(g).plus(r).getPtr("v"), Agnode_s.class);
723 ST_Agnode_s.ArrayOfStar v;
724 ST_Agnode_s n;
725 v = ALLOC_Agnode_s(GD_rank(g).get(r).n + 2, (ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v);
751726 GD_rank(g).plus(r).setPtr("v", v);
752 for (i = GD_rank(g).plus(r).getInt("n"); i > pos; i--) {
727 for (i = GD_rank(g).get(r).n; i > pos; i--) {
753728 v.plus(i).setPtr(v.plus(i - 1).getPtr());
754 ND_order(v.plus(i).getPtr(), ND_order(v.plus(i).getPtr())+1);
729 ND_order(v.get(i), ND_order(v.get(i))+1);
755730 }
756731 n = virtual_node(g);
757732 v.plus(pos).setPtr(n);
758733 ND_order(n, pos);
759734 ND_rank(n, r);
760 GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("n")+1);
761 v.plus(GD_rank(g).plus(r).getInt("n")).setPtr(null);
762 return (Agnode_s) v.plus(pos).getPtr();
735 GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).n+1);
736 v.plus(GD_rank(g).get(r).n).setPtr(null);
737 return (ST_Agnode_s) v.get(pos);
763738 } finally {
764739 LEAVING("e0gtvsxlvztmwu8yy44wfvf97","make_vn_slot");
765740 }
770745
771746 //3 d64wt9oqphauv3hp4axbg2ep3
772747 // static void findlr(node_t * u, node_t * v, int *lp, int *rp)
773 public static void findlr(Agnode_s u, Agnode_s v, int lp[], int rp[]) {
748 public static void findlr(ST_Agnode_s u, ST_Agnode_s v, int lp[], int rp[]) {
774749 ENTERING("d64wt9oqphauv3hp4axbg2ep3","findlr");
775750 try {
776751 int l, r;
793768
794769 //3 bwjjmaydx5a2fnpeoligkha0r
795770 // static void setbounds(node_t * v, int *bounds, int lpos, int rpos)
796 public static void setbounds(Agnode_s v, int bounds[], int lpos[], int rpos[]) {
771 public static void setbounds(ST_Agnode_s v, int bounds[], int lpos[], int rpos[]) {
797772 ENTERING("bwjjmaydx5a2fnpeoligkha0r","setbounds");
798773 try {
799774 int i, ord;
800775 int[] l = new int[1], r = new int[1];
801 Agedge_s f;
776 ST_Agedge_s f;
802777 if (ND_node_type(v) == 1) {
803778 ord = ND_order(v);
804779 if (ND_in(v).size == 0) { /* flat */
805780 assert(ND_out(v).size == 2);
806 findlr((Agnode_s) aghead(ND_out(v).getFromList(0)), (Agnode_s) aghead(ND_out(v).getFromList(1)), l,
781 findlr((ST_Agnode_s) aghead(ND_out(v).getFromList(0)), (ST_Agnode_s) aghead(ND_out(v).getFromList(1)), l,
807782 r);
808783 /* the other flat edge could be to the left or right */
809784 if (r[0] <= lpos[0])
822797 } else { /* forward */
823798 boolean onleft, onright;
824799 onleft = onright = false;
825 for (i = 0; (f = (Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
800 for (i = 0; (f = (ST_Agedge_s) ND_out(v).getFromList(i))!=null; i++) {
826801 if (ND_order(aghead(f)) <= lpos[0]) {
827802 onleft = NOT(false);
828803 continue;
848823
849824 //3 3bc4otcsxj1dujj49ydbb19oa
850825 // static int flat_limits(graph_t * g, edge_t * e)
851 public static int flat_limits(Agraph_s g, Agedge_s e) {
826 public static int flat_limits(ST_Agraph_s g, ST_Agedge_s e) {
852827 ENTERING("3bc4otcsxj1dujj49ydbb19oa","flat_limits");
853828 try {
854829 int lnode, rnode, r, pos;
855830 int[] lpos = new int[1], rpos = new int[1];
856831 int bounds[] = new int[4];
857 __ptr__ rank;
832 ST_Agnode_s.ArrayOfStar rank;
858833 r = ND_rank(agtail(e)) - 1;
859 rank = GD_rank(g).plus(r).getPtr("v");
834 rank = GD_rank(g).get(r).v;
860835 lnode = 0;
861 rnode = GD_rank(g).plus(r).getInt("n") - 1;
836 rnode = GD_rank(g).get(r).n - 1;
862837 bounds[0] = bounds[2] = lnode - 1;
863838 bounds[1] = bounds[3] = rnode + 1;
864839 findlr(agtail(e), aghead(e), lpos, rpos);
865840 while (lnode <= rnode) {
866 setbounds((Agnode_s)rank.plus(lnode).getPtr(), bounds, lpos, rpos);
841 setbounds((ST_Agnode_s)rank.get(lnode), bounds, lpos, rpos);
867842 if (lnode != rnode)
868 setbounds((Agnode_s)rank.plus(rnode).getPtr(), bounds, lpos, rpos);
843 setbounds((ST_Agnode_s)rank.get(rnode), bounds, lpos, rpos);
869844 lnode++;
870845 rnode--;
871846 if (bounds[1] - bounds[0] <= 1)
886861
887862 //3 4cw9yo9ap8ze1r873v6jat4yc
888863 // static void flat_node(edge_t * e)
889 public static void flat_node(Agedge_s e) {
864 public static void flat_node(ST_Agedge_s e) {
890865 ENTERING("4cw9yo9ap8ze1r873v6jat4yc","flat_node");
891866 try {
892867 int r, place, ypos, h2;
893 Agraph_s g;
894 Agnode_s n, vn;
895 Agedge_s ve;
896 final __struct__<pointf> dimen = JUtils.from(pointf.class);
868 ST_Agraph_s g;
869 ST_Agnode_s n, vn;
870 ST_Agedge_s ve;
871 final ST_pointf dimen = new ST_pointf();
897872 if (ED_label(e) == null)
898873 return;
899874 g = dot_root(agtail(e));
900875 r = ND_rank(agtail(e));
901876 place = flat_limits(g, e);
902877 /* grab ypos = LL.y of label box before make_vn_slot() */
903 if ((n = (Agnode_s) GD_rank(g).plus(r - 1).getArrayOfPtr("v").plus(0).getPtr())!=null)
904 ypos = (int)(ND_coord(n).getDouble("y") - GD_rank(g).plus(r - 1).getDouble("ht1"));
878 if ((n = (ST_Agnode_s) GD_rank(g).get(r - 1).v.get(0))!=null)
879 ypos = (int)(ND_coord(n).y - GD_rank(g).get(r - 1).ht1);
905880 else {
906 n = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
907 ypos = (int)(ND_coord(n).getDouble("y") + GD_rank(g).plus(r).getDouble("ht2") + GD_ranksep(g));
881 n = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
882 ypos = (int)(ND_coord(n).y + GD_rank(g).get(r).ht2 + GD_ranksep(g));
908883 }
909884 vn = make_vn_slot(g, r - 1, place);
910 dimen.___(ED_label(e).getStruct("dimen"));
885 dimen.___(ED_label(e).dimen);
911886 if (GD_flip(g)!=0) {
912 double f = dimen.getDouble("x");
913 dimen.setDouble("x", dimen.getDouble("y"));
887 double f = dimen.x;
888 dimen.setDouble("x", dimen.y);
914889 dimen.setDouble("y", f);
915890 }
916 ND_ht(vn, dimen.getDouble("y"));
891 ND_ht(vn, dimen.y);
917892 h2 = (int)(ND_ht(vn) / 2);
918 ND_rw(vn, dimen.getDouble("x") / 2);
893 ND_rw(vn, dimen.x / 2);
919894 ND_lw(vn, ND_rw(vn));
920895 ND_label(vn, ED_label(e));
921896 ND_coord(vn).setDouble("y", ypos + h2);
922897 ve = virtual_edge(vn, agtail(e), e); /* was NULL? */
923 ED_tail_port(ve).getStruct("p").setDouble("x", -ND_lw(vn));
924 ED_head_port(ve).getStruct("p").setDouble("x", ND_rw(agtail(e)));
898 ED_tail_port(ve).p.setDouble("x", -ND_lw(vn));
899 ED_head_port(ve).p.setDouble("x", ND_rw(agtail(e)));
925900 ED_edge_type(ve, 4);
926901 ve = virtual_edge(vn, aghead(e), e);
927 ED_tail_port(ve).getStruct("p").setDouble("x", ND_rw(vn));
928 ED_head_port(ve).getStruct("p").setDouble("x", ND_lw(aghead(e)));
902 ED_tail_port(ve).p.setDouble("x", ND_rw(vn));
903 ED_head_port(ve).p.setDouble("x", ND_lw(aghead(e)));
929904 ED_edge_type(ve, 4);
930905 /* another assumed symmetry of ht1/ht2 of a label node */
931 if (GD_rank(g).plus(r - 1).getDouble("ht1") < h2)
906 if (GD_rank(g).get(r - 1).ht1 < h2)
932907 GD_rank(g).plus(r - 1).setDouble("ht1", h2);
933 if (GD_rank(g).plus(r - 1).getDouble("ht2") < h2)
908 if (GD_rank(g).get(r - 1).ht2 < h2)
934909 GD_rank(g).plus(r - 1).setDouble("ht2", h2);
935910 ND_alg(vn, e);
936911 } finally {
943918
944919 //3 1lopavodoru6ee52snd5l6swd
945920 // static void abomination(graph_t * g)
946 public static void abomination(Agraph_s g) {
921 public static void abomination(ST_Agraph_s g) {
947922 ENTERING("1lopavodoru6ee52snd5l6swd","abomination");
948923 try {
949924 int r;
950 __ptr__ rptr;
925 ST_rank_t.Array2 rptr;
951926 assert(GD_minrank(g) == 0);
952927 /* 3 = one for new rank, one for sentinel, one for off-by-one */
953928 r = GD_maxrank(g) + 3;
954 rptr = ALLOC(r, GD_rank(g), rank_t.class);
929 rptr = ALLOC_ST_rank_t(r, (ST_rank_t.Array2) GD_rank(g));
955930 GD_rank(g, rptr.plus(1));
956931 for (r = GD_maxrank(g); r >= 0; r--)
957 GD_rank(g).plus(r).getPtr().setStruct(GD_rank(g).plus(r - 1).getPtr().getStruct());
932 GD_rank(g).get(r).setStruct(GD_rank(g).get(r - 1).getStruct());
958933 GD_rank(g).plus(r).setInt("n", 0);
959934 GD_rank(g).plus(r).setInt("an", 0);
960 GD_rank(g).plus(r).setPtr("v", zmalloc(sizeof_starstar_empty(Agnode_s.class, 2)));
961 GD_rank(g).plus(r).setPtr("av", GD_rank(g).plus(r).getPtr("v"));
935 GD_rank(g).plus(r).setPtr("v", new ST_Agnode_s.ArrayOfStar(2));
936 GD_rank(g).plus(r).setPtr("av", GD_rank(g).get(r).v);
962937 GD_rank(g).plus(r).setPtr("flat", null);
963938 GD_rank(g).plus(r).setDouble("ht1", 1);
964939 GD_rank(g).plus(r).setDouble("ht2", 1);
975950
976951 //3 ctujx6e8k3rzv08h6gswdcaqs
977952 // static void checkFlatAdjacent (edge_t* e)
978 public static void checkFlatAdjacent(Agedge_s e) {
953 public static void checkFlatAdjacent(ST_Agedge_s e) {
979954 ENTERING("ctujx6e8k3rzv08h6gswdcaqs","checkFlatAdjacent");
980955 try {
981 Agnode_s tn = agtail(e);
982 Agnode_s hn = aghead(e);
956 ST_Agnode_s tn = agtail(e);
957 ST_Agnode_s hn = aghead(e);
983958 int i, lo, hi;
984 Agnode_s n;
985 __ptr__ rank;
959 ST_Agnode_s n;
960 ST_rank_t.Array2 rank;
986961 if (ND_order(tn) < ND_order(hn)) {
987962 lo = ND_order(tn);
988963 hi = ND_order(hn);
993968 }
994969 rank = GD_rank(dot_root(tn)).plus(ND_rank(tn));
995970 for (i = lo + 1; i < hi; i++) {
996 n = (Agnode_s) rank.getArrayOfPtr("v").plus(i).getPtr();
971 n = (ST_Agnode_s) rank.getPtr().v.get(i);
997972 if ((ND_node_type(n) == 1 && ND_label(n)!=null) ||
998973 ND_node_type(n) == 0)
999974 break;
1014989
1015990 //3 bjwwj6ftkm0gv04cf1edqeaw6
1016991 // int flat_edges(graph_t * g)
1017 public static int flat_edges(Agraph_s g) {
992 public static int flat_edges(ST_Agraph_s g) {
1018993 ENTERING("bjwwj6ftkm0gv04cf1edqeaw6","flat_edges");
1019994 try {
1020995 int i, j, reset = 0;
1021 Agnode_s n;
1022 Agedge_s e;
996 ST_Agnode_s n;
997 ST_Agedge_s e;
1023998 int found = 0;
1024999 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
10251000 if (ND_flat_out(n).listNotNull()) {
1026 for (j = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(j))!=null; j++) {
1001 for (j = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(j))!=null; j++) {
10271002 checkFlatAdjacent (e);
10281003 }
10291004 }
10301005 for (j = 0; j < ND_other(n).size; j++) {
1031 e = (Agedge_s) ND_other(n).getFromList(j);
1006 e = (ST_Agedge_s) ND_other(n).getFromList(j);
10321007 if (ND_rank(aghead(e)) == ND_rank(agtail(e)))
10331008 checkFlatAdjacent (e);
10341009 }
10351010 }
1036 if ((GD_rank(g).plus(0).getPtr("flat")!=null) || (GD_n_cluster(g) > 0)) {
1037 for (i = 0; (n = (Agnode_s) GD_rank(g).plus(0).getArrayOfPtr("v").plus(i).getPtr())!=null; i++) {
1038 for (j = 0; (e = (Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) {
1011 if ((GD_rank(g).get(0).flat!=null) || (GD_n_cluster(g) > 0)) {
1012 for (i = 0; (n = (ST_Agnode_s) GD_rank(g).get(0).v.get(i))!=null; i++) {
1013 for (j = 0; (e = (ST_Agedge_s) ND_flat_in(n).getFromList(j))!=null; j++) {
10391014 if ((ED_label(e)!=null) && N(ED_adjacent(e))) {
10401015 abomination(g);
10411016 found = 1;
10501025 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
10511026 /* if n is the tail of any flat edge, one will be in flat_out */
10521027 if (ND_flat_out(n).listNotNull()) {
1053 for (i = 0; (e = (Agedge_s) ND_flat_out(n).getFromList(i))!=null; i++) {
1028 for (i = 0; (e = (ST_Agedge_s) ND_flat_out(n).getFromList(i))!=null; i++) {
10541029 if (ED_label(e)!=null) {
10551030 if (ED_adjacent(e)!=0) {
1056 if (GD_flip(g)!=0) ED_dist(e, ED_label(e).getStruct("dimen").getDouble("y"));
1057 else ED_dist(e, ED_label(e).getStruct("dimen").getDouble("x"));
1031 if (GD_flip(g)!=0) ED_dist(e, ED_label(e).dimen.y);
1032 else ED_dist(e, ED_label(e).dimen.x);
10581033 }
10591034 else {
10601035 reset = 1;
10641039 }
10651040 /* look for other flat edges with labels */
10661041 for (j = 0; j < ND_other(n).size; j++) {
1067 Agedge_s le;
1068 e = (Agedge_s) ND_other(n).getFromList(j);
1042 ST_Agedge_s le;
1043 e = (ST_Agedge_s) ND_other(n).getFromList(j);
10691044 if (ND_rank(agtail(e)) != ND_rank(aghead(e))) continue;
10701045 if (EQ(agtail(e), aghead(e))) continue; /* skip loops */
10711046 le = e;
10741049 if (ED_label(e)!=null) {
10751050 if (ED_adjacent(e)!=0) {
10761051 double lw;
1077 if (GD_flip(g)!=0) lw = ED_label(e).getStruct("dimen").getDouble("y");
1078 else lw = ED_label(e).getStruct("dimen").getDouble("x");
1052 if (GD_flip(g)!=0) lw = ED_label(e).dimen.y;
1053 else lw = ED_label(e).dimen.x;
10791054 ED_dist(le, MAX(lw,ED_dist(le)));
10801055 }
10811056 else {
7474 import static smetana.core.JUtils.function;
7575 import static smetana.core.JUtils.qsort;
7676 import static smetana.core.JUtils.size_t_array_of_integer;
77 import static smetana.core.JUtils.sizeof;
78 import static smetana.core.JUtils.sizeof_starstar_empty;
7977 import static smetana.core.JUtilsDebug.ENTERING;
8078 import static smetana.core.JUtilsDebug.LEAVING;
81 import static smetana.core.Macro.ALLOC;
79 import static smetana.core.Macro.ALLOC_Agnode_s;
8280 import static smetana.core.Macro.ALLOC_INT;
8381 import static smetana.core.Macro.ED_edge_type;
8482 import static smetana.core.Macro.ED_head_port;
124122 import static smetana.core.Macro.ND_weight_class;
125123 import static smetana.core.Macro.NOT;
126124 import static smetana.core.Macro.UNSUPPORTED;
127 import static smetana.core.Macro.agtail;
128125 import static smetana.core.Macro.elist_append;
129 import h.Agedge_s;
130 import h.Agnode_s;
131 import h.Agraph_s;
132 import h.adjmatrix_t;
133 import h.boxf;
134 import h.elist;
135 import h.nodequeue;
136 import h.pointf;
137 import h.rank_t;
126 import h.ST_Agedge_s;
127 import h.ST_Agnode_s;
128 import h.ST_Agraph_s;
129 import h.ST_adjmatrix_t;
130 import h.ST_elist;
131 import h.ST_nodequeue;
132 import h.ST_pointf;
133 import h.ST_rank_t;
134
135 import java.util.List;
136
138137 import smetana.core.CString;
139 import smetana.core.JUtils;
140138 import smetana.core.Memory;
141139 import smetana.core.Z;
142 import smetana.core.__array_of_ptr__;
143140 import smetana.core.__ptr__;
144 import smetana.core.__struct__;
145141
146142 public class mincross__c {
147143 //1 2digov3edok6d5srhgtlmrycs
401397
402398 //3 c1s4k85p1cdfn176o3uryeros
403399 // static inline pointf pointfof(double x, double y)
404 public static __struct__<pointf> pointfof(double x, double y) {
400 public static ST_pointf pointfof(double x, double y) {
405401 // WARNING!! STRUCT
406402 return pointfof_w_(x, y).copy();
407403 }
408 private static __struct__<pointf> pointfof_w_(double x, double y) {
404 private static ST_pointf pointfof_w_(double x, double y) {
409405 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
410406 try {
411 final __struct__<pointf> r = JUtils.from(pointf.class);
407 final ST_pointf r = new ST_pointf();
412408 r.setDouble("x", x);
413409 r.setDouble("y", y);
414410 return r;
437433
438434
439435
440 //3 1vvsta5i8of59frav6uymguav
441 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
442 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
443 // WARNING!! STRUCT
444 return boxfof_w_(llx, lly, urx, ury).copy();
445 }
446 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
447 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
448 try {
449 final __struct__<boxf> b = JUtils.from(boxf.class);
450 b.getStruct("LL").setDouble("x", llx);
451 b.getStruct("LL").setDouble("y", lly);
452 b.getStruct("UR").setDouble("x", urx);
453 b.getStruct("UR").setDouble("y", ury);
454 return b;
455 } finally {
456 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
457 }
458 }
459
460436
461437
462438
479455
480456 //3 arrsbik9b5tnfcbzsm8gr2chx
481457 // static inline pointf add_pointf(pointf p, pointf q)
482 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
458 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
483459 // WARNING!! STRUCT
484460 return add_pointf_w_(p.copy(), q.copy()).copy();
485461 }
486 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
462 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
487463 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
488464 try {
489 final __struct__<pointf> r = JUtils.from(pointf.class);
490 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
491 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
465 final ST_pointf r = new ST_pointf();
466 r.setDouble("x", p.x + q.x);
467 r.setDouble("y", p.y + q.y);
492468 return r;
493469 } finally {
494470 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
857833
858834 //3 e876vp4hgkzshluz6qk77cjwk
859835 // void dot_mincross(graph_t * g, int doBalance)
860 public static void dot_mincross(Agraph_s g, boolean doBalance) {
836 public static void dot_mincross(ST_Agraph_s g, boolean doBalance) {
861837 ENTERING("e876vp4hgkzshluz6qk77cjwk","dot_mincross");
862838 try {
863839 int c, nc;
870846 merge2(g);
871847 /* run mincross on contents of each cluster */
872848 for (c = 1; c <= GD_n_cluster(g); c++) {
873 nc += mincross_clust(g, (Agraph_s) GD_clust(g).plus(c).getPtr(), doBalance);
849 nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
874850 }
875851 if ((GD_n_cluster(g) > 0)
876852 && (N(s = agget(g, new CString("remincross"))) || (mapbool(s)))) {
889865
890866 //3 756bre1tpxb1tq68p7xhkrxkc
891867 // static adjmatrix_t *new_matrix(int i, int j)
892 public static adjmatrix_t new_matrix(int i, int j) {
868 public static ST_adjmatrix_t new_matrix(int i, int j) {
893869 ENTERING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");
894870 try {
895 adjmatrix_t rv = (adjmatrix_t) Memory.malloc(adjmatrix_t.class);
896 rv.setInt("nrows", i);
897 rv.setInt("ncols", j);
898 rv.setPtr("data", zmalloc(size_t_array_of_integer(i*j)));
871 ST_adjmatrix_t rv = new ST_adjmatrix_t();
872 rv.nrows = i;
873 rv.ncols = j;
874 rv.data = new int[i][j]; // Or maybe new int[j][i] ?
899875 return rv;
900876 } finally {
901877 LEAVING("756bre1tpxb1tq68p7xhkrxkc","new_matrix");
907883
908884 //3 1n1e0k0wtlbugwm3cb4na6av6
909885 // static void free_matrix(adjmatrix_t * p)
910 public static void free_matrix(adjmatrix_t p) {
886 public static void free_matrix(ST_adjmatrix_t p) {
911887 ENTERING("1n1e0k0wtlbugwm3cb4na6av6","free_matrix");
912888 try {
913889 if (p!=null) {
914 Memory.free(p.getPtr("data"));
890 Memory.free(p.data);
915891 Memory.free(p);
916892 }
917893 } finally {
924900
925901 //3 49vw7fkn99wbojtfksugvuruh
926902 // static void init_mccomp(graph_t * g, int c)
927 public static void init_mccomp(Agraph_s g, int c) {
903 public static void init_mccomp(ST_Agraph_s g, int c) {
928904 ENTERING("49vw7fkn99wbojtfksugvuruh","init_mccomp");
929905 try {
930906 int r;
932908 GD_nlist(g, GD_comp(g).getFromList(c));
933909 if (c > 0) {
934910 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
935 GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("v").plus(GD_rank(g).plus(r).getInt("n")));
911 GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n));
936912 GD_rank(g).plus(r).setInt("n", 0);
937913 }
938914 }
10551031
10561032 //3 hzoz2czb672i0nbjvjhbc3na
10571033 // static void ordered_edges(graph_t * g)
1058 public static void ordered_edges(Agraph_s g) {
1034 public static void ordered_edges(ST_Agraph_s g) {
10591035 ENTERING("hzoz2czb672i0nbjvjhbc3na","ordered_edges");
10601036 try {
10611037 CString ordering;
10921068
10931069 //3 crwc5qe7fmrpgcqh1a80toyvo
10941070 // static int mincross_clust(graph_t * par, graph_t * g, int doBalance)
1095 public static int mincross_clust(Agraph_s par, Agraph_s g, boolean doBalance) {
1071 public static int mincross_clust(ST_Agraph_s par, ST_Agraph_s g, boolean doBalance) {
10961072 ENTERING("crwc5qe7fmrpgcqh1a80toyvo","mincross_clust");
10971073 try {
10981074 int c, nc;
11021078 flat_reorder(g);
11031079 nc = mincross_(g, 2, 2, doBalance);
11041080 for (c = 1; c <= GD_n_cluster(g); c++)
1105 nc += mincross_clust(g, (Agraph_s) GD_clust(g).plus(c).getPtr(), doBalance);
1081 nc += mincross_clust(g, (ST_Agraph_s) GD_clust(g).get(c).getPtr(), doBalance);
11061082 save_vlist(g);
11071083 return nc;
11081084 } finally {
11151091
11161092 //3 657v773m21j5w3g3v94o7464t
11171093 // static int left2right(graph_t * g, node_t * v, node_t * w)
1118 public static boolean left2right(Agraph_s g, Agnode_s v, Agnode_s w) {
1094 public static boolean left2right(ST_Agraph_s g, ST_Agnode_s v, ST_Agnode_s w) {
11191095 ENTERING("657v773m21j5w3g3v94o7464t","left2right");
11201096 try {
1121 adjmatrix_t M;
1097 ST_adjmatrix_t M;
11221098 boolean rv=false;
11231099 /* CLUSTER indicates orig nodes of clusters, and vnodes of skeletons */
11241100 if (Z.z().ReMincross == false) {
11341110 /*return ((ND_ranktype(v) != CLUSTER) && (ND_ranktype(w) != CLUSTER)); */
11351111 }
11361112 } else {
1137 UNSUPPORTED("8lltx4lxwrqossx8qw1khzwf9"); // if ((ND_clust(v)) != (ND_clust(w)))
1138 UNSUPPORTED("9qhn9m3123s8n6wwxjfo8awlm"); // return NOT(0);
1139 }
1140 M = (adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().getPtr("flat");
1113 if (NEQ(ND_clust(v), ND_clust(w)))
1114 return NOT(0);
1115 }
1116 M = (ST_adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr().flat;
11411117 if (M == null)
11421118 rv = false;
11431119 else {
11441120 if (GD_flip(g)!=0) {
1145 Agnode_s t = v;
1121 ST_Agnode_s t = v;
11461122 v = w;
11471123 w = t;
11481124 }
1149 rv = (M.getArrayOfInteger("data").plus(((ND_low(v))*M.getInt("ncols"))+(ND_low(w))).getInt())!=0;
1125 rv = M.data[ND_low(v)][ND_low(w)]!=0;
11501126 }
11511127 return rv;
11521128 } finally {
11591135
11601136 //3 daknncpjy7g5peiicolbmh55i
11611137 // static int in_cross(node_t * v, node_t * w)
1162 public static int in_cross(Agnode_s v, Agnode_s w) {
1138 public static int in_cross(ST_Agnode_s v, ST_Agnode_s w) {
11631139 ENTERING("daknncpjy7g5peiicolbmh55i","in_cross");
11641140 try {
1165 __array_of_ptr__ e1;
1166 __array_of_ptr__ e2;
1141 List<ST_Agedge_s> e2_ = ND_in(w).list;
11671142 int inv, cross = 0, t;
1168 for (e2 = ND_in(w).getTheArray(); e2.getPtr()!=null; e2=e2.plus(1)) {
1169 int cnt = ED_xpenalty(e2.getPtr());
1170 inv = ND_order((agtail(e2.getPtr())));
1171 for (e1 = ND_in(v).getTheArray(); e1.getPtr()!=null; e1=e1.plus(1)) {
1172 t = ND_order(agtail(e1.getPtr())) - inv;
1143 for (int ie2 = 0; e2_.get(ie2)!=null; ie2++) {
1144 int cnt = ED_xpenalty(e2_.get(ie2));
1145 inv = ND_order((agtail(e2_.get(ie2))));
1146 List<ST_Agedge_s> e1_ = ND_in(v).list;
1147 for (int ie1 = 0; e1_.get(ie1)!=null; ie1++) {
1148 t = ND_order(agtail(e1_.get(ie1))) - inv;
11731149 if ((t > 0)
11741150 || ((t == 0)
1175 && ( ED_tail_port(e1.getPtr()).getStruct("p").getDouble("x") > ED_tail_port(e2.getPtr()).getStruct("p").getDouble("x"))))
1176 cross += ED_xpenalty(e1.getPtr()) * cnt;
1151 && ( ED_tail_port(e1_.get(ie1)).p.x > ED_tail_port(e2_.get(ie2)).p.x)))
1152 cross += ED_xpenalty(e1_.get(ie1)) * cnt;
11771153 }
11781154 }
11791155 return cross;
11871163
11881164 //3 b7mf74np8ewrgzwd5u0o8fqod
11891165 // static int out_cross(node_t * v, node_t * w)
1190 public static int out_cross(Agnode_s v, Agnode_s w) {
1166 public static int out_cross(ST_Agnode_s v, ST_Agnode_s w) {
11911167 ENTERING("b7mf74np8ewrgzwd5u0o8fqod","out_cross");
11921168 try {
1193 __array_of_ptr__ e1, e2;
1169 List<ST_Agedge_s> e2_ = ND_out(w).list;
11941170 int inv, cross = 0, t;
1195 for (e2 = ND_out(w).getTheArray(); e2.getPtr()!=null; e2=e2.plus(1)) {
1196 int cnt = ED_xpenalty((Agedge_s)e2.getPtr());
1197 inv = ND_order(aghead(e2.getPtr()));
1198 for (e1 = ND_out(v).getTheArray(); e1.getPtr()!=null; e1=e1.plus(1)) {
1199 t = ND_order(aghead(e1.getPtr())) - inv;
1171 for (int ie2 = 0; e2_.get(ie2)!=null; ie2++) {
1172 int cnt = ED_xpenalty(e2_.get(ie2));
1173 inv = ND_order(aghead(e2_.get(ie2)));
1174 List<ST_Agedge_s> e1_ = ND_out(v).list;
1175 for (int ie1 = 0; e1_.get(ie1)!=null; ie1++) {
1176 t = ND_order(aghead(e1_.get(ie1))) - inv;
12001177 if ((t > 0)
12011178 || ((t == 0)
1202 && ((ED_head_port(e1.getPtr())).getStruct("p").getDouble("x") > (ED_head_port(e2.getPtr())).getStruct("p").getDouble("x"))))
1203 cross += ((ED_xpenalty(e1.getPtr())) * cnt);
1179 && ((ED_head_port(e1_.get(ie1))).p.x) > (ED_head_port(e2_.get(ie2))).p.x))
1180 cross += ((ED_xpenalty(e1_.get(ie1))) * cnt);
12041181 }
12051182 }
12061183 return cross;
12141191
12151192 //3 ba4tbr57wips1dzpgxzx3b6ja
12161193 // static void exchange(node_t * v, node_t * w)
1217 public static void exchange(Agnode_s v, Agnode_s w) {
1194 public static void exchange(ST_Agnode_s v, ST_Agnode_s w) {
12181195 ENTERING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
12191196 try {
12201197 int vi, wi, r;
12221199 vi = ND_order(v);
12231200 wi = ND_order(w);
12241201 ND_order(v, wi);
1225 GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(wi).setPtr(v);
1202 GD_rank(Z.z().Root).get(r).v.plus(wi).setPtr(v);
12261203 ND_order(w, vi);
1227 GD_rank(Z.z().Root).plus(r).getArrayOfPtr("v").plus(vi).setPtr(w);
1204 GD_rank(Z.z().Root).get(r).v.plus(vi).setPtr(w);
12281205 } finally {
12291206 LEAVING("ba4tbr57wips1dzpgxzx3b6ja","exchange");
12301207 }
13601337
13611338 //3 bxwzx4m9ejausu58u7abr6fm0
13621339 // static int transpose_step(graph_t * g, int r, int reverse)
1363 public static int transpose_step(Agraph_s g, int r, boolean reverse) {
1340 public static int transpose_step(ST_Agraph_s g, int r, boolean reverse) {
13641341 ENTERING("bxwzx4m9ejausu58u7abr6fm0","transpose_step");
13651342 try {
13661343 int i, c0, c1, rv;
1367 Agnode_s v, w;
1344 ST_Agnode_s v, w;
13681345 rv = 0;
1369 GD_rank(g).plus(r).getPtr().setBoolean("candidate", false);
1370 for (i = 0; i < GD_rank(g).plus(r).getInt("n") - 1; i++) {
1371 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1372 w = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i + 1).getPtr();
1346 GD_rank(g).get(r).candidate= false;
1347 for (i = 0; i < GD_rank(g).get(r).n - 1; i++) {
1348 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
1349 w = (ST_Agnode_s) GD_rank(g).get(r).v.plus(i + 1).getPtr();
13731350 //assert(ND_order(v) < ND_order(w));
13741351 if (left2right(g, v, w))
13751352 continue;
13781355 c0 += in_cross(v, w);
13791356 c1 += in_cross(w, v);
13801357 }
1381 if (GD_rank(g).plus(r + 1).getInt("n") > 0) {
1358 if (GD_rank(g).get(r + 1).n > 0) {
13821359 c0 += out_cross(v, w);
13831360 c1 += out_cross(w, v);
13841361 }
13851362 if ((c1 < c0) || ((c0 > 0) && reverse && (c1 == c0))) {
13861363 exchange(v, w);
13871364 rv += (c0 - c1);
1388 GD_rank(Z.z().Root).plus(r).getPtr().setBoolean("valid", false);
1389 GD_rank(g).plus(r).getPtr().setBoolean("candidate", NOT(false));
1365 GD_rank(Z.z().Root).get(r).valid= 0;
1366 GD_rank(g).get(r).candidate= NOT(false);
13901367 if (r > GD_minrank(g)) {
1391 GD_rank(Z.z().Root).plus(r - 1).getPtr().setBoolean("valid", false);
1392 GD_rank(g).plus(r - 1).getPtr().setBoolean("candidate", NOT(false));
1368 GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
1369 GD_rank(g).get(r - 1).candidate= NOT(false);
13931370 }
13941371 if (r < GD_maxrank(g)) {
1395 GD_rank(Z.z().Root).plus(r + 1).getPtr().setBoolean("valid", false);
1396 GD_rank(g).plus(r + 1).getPtr().setBoolean("candidate", NOT(false));
1372 GD_rank(Z.z().Root).plus(r + 1).getPtr().valid= 0;
1373 GD_rank(g).get(r + 1).candidate= NOT(false);
13971374 }
13981375 }
13991376 }
14081385
14091386 //3 2i22bxgg5y7v5c5d40k5zppky
14101387 // static void transpose(graph_t * g, int reverse)
1411 public static void transpose(Agraph_s g, boolean reverse) {
1388 public static void transpose(ST_Agraph_s g, boolean reverse) {
14121389 ENTERING("2i22bxgg5y7v5c5d40k5zppky","transpose");
14131390 try {
14141391 int r, delta;
14151392 for (r = GD_minrank(g); r <= GD_maxrank(g); r++)
1416 GD_rank(g).plus(r).getPtr().setBoolean("candidate", NOT(false));
1393 GD_rank(g).get(r).candidate= NOT(false);
14171394 do {
14181395 delta = 0;
14191396 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1420 if (GD_rank(g).plus(r).getPtr().getBoolean("candidate")) {
1397 if (GD_rank(g).get(r).candidate) {
14211398 delta += transpose_step(g, r, reverse);
14221399 }
14231400 }
14331410
14341411 //3 7lrk2rxqnwwdau8cx85oqkpmv
14351412 // static int mincross(graph_t * g, int startpass, int endpass, int doBalance)
1436 public static int mincross_(Agraph_s g, int startpass, int endpass, boolean doBalance) {
1413 public static int mincross_(ST_Agraph_s g, int startpass, int endpass, boolean doBalance) {
14371414 ENTERING("7lrk2rxqnwwdau8cx85oqkpmv","mincross");
14381415 try {
14391416 int maxthispass=0, iter, trying, pass;
15041481
15051482 //3 520049zkz9mafaeklgvm6s8e5
15061483 // static void restore_best(graph_t * g)
1507 public static void restore_best(Agraph_s g) {
1484 public static void restore_best(ST_Agraph_s g) {
15081485 ENTERING("520049zkz9mafaeklgvm6s8e5","restore_best");
15091486 try {
1510 Agnode_s n;
1487 ST_Agnode_s n;
15111488 int r;
15121489 for (n = GD_nlist(g); n!=null; n = ND_next(n))
1513 ND_order(n, (int)ND_coord(n).getDouble("x"));
1490 ND_order(n, (int)ND_coord(n).x);
15141491 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1515 GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
1516 qsort(GD_rank(g).plus(r).getPtr("v"),
1517 GD_rank(g).plus(r).getInt("n"),
1518 sizeof(GD_rank(g).plus(r).getPtr("v").plus(0)),
1492 GD_rank(Z.z().Root).get(r).valid= 0;
1493 qsort(GD_rank(g).get(r).v,
1494 GD_rank(g).get(r).n,
15191495 function(mincross__c.class, "nodeposcmpf"));
15201496 }
15211497 } finally {
15281504
15291505 //3 8uyqc48j0oul206l3np85wj9p
15301506 // static void save_best(graph_t * g)
1531 public static void save_best(Agraph_s g) {
1507 public static void save_best(ST_Agraph_s g) {
15321508 ENTERING("8uyqc48j0oul206l3np85wj9p","save_best");
15331509 try {
1534 Agnode_s n;
1510 ST_Agnode_s n;
15351511 for (n = GD_nlist(g); n!=null; n = ND_next(n))
15361512 (ND_coord(n)).x = ND_order(n);
15371513 } finally {
15441520
15451521 //3 6d08fwi4dsk6ikk5d0gy6rq2h
15461522 // static void merge_components(graph_t * g)
1547 public static void merge_components(Agraph_s g) {
1523 public static void merge_components(ST_Agraph_s g) {
15481524 ENTERING("6d08fwi4dsk6ikk5d0gy6rq2h","merge_components");
15491525 try {
15501526 int c;
1551 Agnode_s u, v;
1527 ST_Agnode_s u, v;
15521528 if (GD_comp(g).size <= 1)
15531529 return;
15541530 u = null;
15551531 for (c = 0; c < GD_comp(g).size; c++) {
1556 v = (Agnode_s) GD_comp(g).getFromList(c);
1532 v = (ST_Agnode_s) GD_comp(g).getFromList(c);
15571533 if (u!=null)
15581534 ND_next(u, v);
15591535 ND_prev(v, u);
15761552
15771553 //3 91vebcdl3q3y0uyxef0iw71n9
15781554 // static void merge2(graph_t * g)
1579 public static void merge2(Agraph_s g) {
1555 public static void merge2(ST_Agraph_s g) {
15801556 ENTERING("91vebcdl3q3y0uyxef0iw71n9","merge2");
15811557 try {
15821558 int i, r;
1583 Agnode_s v;
1559 ST_Agnode_s v;
15841560 /* merge the components and rank limits */
15851561 merge_components(g);
15861562 /* install complete ranks */
15871563 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1588 GD_rank(g).plus(r).setInt("n", GD_rank(g).plus(r).getInt("an"));
1589 GD_rank(g).plus(r).setPtr("v", GD_rank(g).plus(r).getPtr("av"));
1590 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
1591 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1564 GD_rank(g).plus(r).setInt("n", GD_rank(g).get(r).an);
1565 GD_rank(g).plus(r).setPtr("v", GD_rank(g).get(r).av);
1566 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1567 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
15921568 if (v == null) {
15931569 /*if (Verbose)
15941570 fprintf(stderr,
16101586
16111587 //3 3cwiyyk1d1jkoo9iqwb5bge4x
16121588 // static void cleanup2(graph_t * g, int nc)
1613 public static void cleanup2(Agraph_s g, int nc) {
1589 public static void cleanup2(ST_Agraph_s g, int nc) {
16141590 ENTERING("3cwiyyk1d1jkoo9iqwb5bge4x","cleanup2");
16151591 try {
16161592 int i, j, r, c;
1617 Agnode_s v;
1618 Agedge_s e;
1593 ST_Agnode_s v;
1594 ST_Agedge_s e;
16191595 if (Z.z().TI_list!=null) {
16201596 Memory.free(Z.z().TI_list);
16211597 Z.z().TI_list = null;
16261602 }
16271603 /* fix vlists of clusters */
16281604 for (c = 1; c <= GD_n_cluster(g); c++)
1629 rec_reset_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
1605 rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
16301606 /* remove node temporary edges for ordering nodes */
16311607 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1632 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
1633 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1608 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1609 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
16341610 ND_order(v, i);
16351611 if (ND_flat_out(v).listNotNull()) {
1636 for (j = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++)
1612 for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++)
16371613 if (ED_edge_type(e) == 4) {
16381614 delete_flat_edge(e);
1639 Memory.free(e.getPtr("base.data"));
1615 Memory.free(e.base.data);
16401616 Memory.free(e);
16411617 j--;
16421618 }
16431619 }
16441620 }
1645 free_matrix((adjmatrix_t) GD_rank(g).plus(r).getPtr("flat"));
1621 free_matrix((ST_adjmatrix_t) GD_rank(g).get(r).flat);
16461622 }
16471623 /*if (Verbose)
16481624 fprintf(stderr, "mincross %s: %d crossings, %.2f secs.\n",
16571633
16581634 //3 arax68kzcf86dr2xu0gp962gq
16591635 // static node_t *neighbor(node_t * v, int dir)
1660 public static Agnode_s neighbor(Agnode_s v, int dir) {
1636 public static ST_Agnode_s neighbor(ST_Agnode_s v, int dir) {
16611637 ENTERING("arax68kzcf86dr2xu0gp962gq","neighbor");
16621638 try {
1663 Agnode_s rv;
1639 ST_Agnode_s rv;
16641640 rv = null;
16651641 assert(v!=null);
16661642 if (dir < 0) {
16671643 if (ND_order(v) > 0)
1668 rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) - 1).getPtr();
1644 rv = (ST_Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getPtr().v.plus(ND_order(v) - 1).getPtr();
16691645 } else
1670 rv = (Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getArrayOfPtr("v").plus(ND_order(v) + 1).getPtr();
1646 rv = (ST_Agnode_s) GD_rank(Z.z().Root).plus(ND_rank(v)).getPtr().v.plus(ND_order(v) + 1).getPtr();
16711647 assert((rv == null) || (ND_order(rv)-ND_order(v))*dir > 0);
16721648 return rv;
16731649 } finally {
16801656
16811657 //3 1waqm8z71hi389dt1wqh0bmhr
16821658 // static int is_a_normal_node_of(graph_t * g, node_t * v)
1683 public static boolean is_a_normal_node_of(Agraph_s g, Agnode_s v) {
1659 public static boolean is_a_normal_node_of(ST_Agraph_s g, ST_Agnode_s v) {
16841660 ENTERING("1waqm8z71hi389dt1wqh0bmhr","is_a_normal_node_of");
16851661 try {
16861662 return ((ND_node_type(v) == 0) && agcontains(g, v));
16941670
16951671 //3 9f8atyi1unmleplge3rijdt4s
16961672 // static int is_a_vnode_of_an_edge_of(graph_t * g, node_t * v)
1697 public static boolean is_a_vnode_of_an_edge_of(Agraph_s g, Agnode_s v) {
1673 public static boolean is_a_vnode_of_an_edge_of(ST_Agraph_s g, ST_Agnode_s v) {
16981674 ENTERING("9f8atyi1unmleplge3rijdt4s","is_a_vnode_of_an_edge_of");
16991675 try {
17001676 if ((ND_node_type(v) == 1)
17011677 && (ND_in(v).size == 1) && (ND_out(v).size == 1)) {
1702 Agedge_s e = (Agedge_s) ND_out(v).getFromList(0);
1678 ST_Agedge_s e = (ST_Agedge_s) ND_out(v).getFromList(0);
17031679 while (ED_edge_type(e) != 0)
17041680 e = ED_to_orig(e);
17051681 if (agcontains(g, e))
17161692
17171693 //3 eo7ulc8vwmoaig0j479yapve2
17181694 // static int inside_cluster(graph_t * g, node_t * v)
1719 public static boolean inside_cluster(Agraph_s g, Agnode_s v) {
1695 public static boolean inside_cluster(ST_Agraph_s g, ST_Agnode_s v) {
17201696 ENTERING("eo7ulc8vwmoaig0j479yapve2","inside_cluster");
17211697 try {
17221698 return (is_a_normal_node_of(g, v) | is_a_vnode_of_an_edge_of(g, v));
17301706
17311707 //3 8xkmkt4r6gfqj8gk0mokszoz0
17321708 // static node_t *furthestnode(graph_t * g, node_t * v, int dir)
1733 public static Agnode_s furthestnode(Agraph_s g, Agnode_s v, int dir) {
1709 public static ST_Agnode_s furthestnode(ST_Agraph_s g, ST_Agnode_s v, int dir) {
17341710 ENTERING("8xkmkt4r6gfqj8gk0mokszoz0","furthestnode");
17351711 try {
1736 Agnode_s u, rv;
1712 ST_Agnode_s u, rv;
17371713 rv = u = v;
17381714 while ((u = neighbor(u, dir))!=null) {
17391715 if (is_a_normal_node_of(g, u))
17521728
17531729 //3 bwmu2hkwud40601oq5vgo2f1h
17541730 // void save_vlist(graph_t * g)
1755 public static void save_vlist(Agraph_s g) {
1731 public static void save_vlist(ST_Agraph_s g) {
17561732 ENTERING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
17571733 try {
17581734 int r;
17591735 if (GD_rankleader(g)!=null)
17601736 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1761 GD_rankleader(g).plus(r).setPtr(GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr());
1737 GD_rankleader(g).plus(r).setPtr(GD_rank(g).get(r).v.get(0));
17621738 }
17631739 } finally {
17641740 LEAVING("bwmu2hkwud40601oq5vgo2f1h","save_vlist");
17701746
17711747 //3 hwdxg97sefkuyd25x2q4pgzg
17721748 // void rec_save_vlists(graph_t * g)
1773 public static void rec_save_vlists(Agraph_s g) {
1749 public static void rec_save_vlists(ST_Agraph_s g) {
17741750 ENTERING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
17751751 try {
17761752 int c;
17771753 save_vlist(g);
17781754 for (c = 1; c <= GD_n_cluster(g); c++)
1779 rec_save_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
1755 rec_save_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
17801756 } finally {
17811757 LEAVING("hwdxg97sefkuyd25x2q4pgzg","rec_save_vlists");
17821758 }
17871763
17881764 //3 f3b4wat4uxn5oil720i5mwq4v
17891765 // void rec_reset_vlists(graph_t * g)
1790 public static void rec_reset_vlists(Agraph_s g) {
1766 public static void rec_reset_vlists(ST_Agraph_s g) {
17911767 ENTERING("f3b4wat4uxn5oil720i5mwq4v","rec_reset_vlists");
17921768 try {
17931769 int r, c;
1794 Agnode_s u, v, w;
1770 ST_Agnode_s u, v, w;
17951771 /* fix vlists of sub-clusters */
17961772 for (c = 1; c <= GD_n_cluster(g); c++)
1797 rec_reset_vlists((Agraph_s) GD_clust(g).plus(c).getPtr());
1773 rec_reset_vlists((ST_Agraph_s) GD_clust(g).get(c).getPtr());
17981774 if (GD_rankleader(g)!=null)
17991775 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1800 v = (Agnode_s) GD_rankleader(g).plus(r).getPtr();
1776 v = (ST_Agnode_s) GD_rankleader(g).get(r);
18011777 u = furthestnode(g, v, -1);
18021778 w = furthestnode(g, v, 1);
18031779 GD_rankleader(g).plus(r).setPtr(u);
1804 GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).plus(r).getPtr("v").plus(ND_order(u)));
1780 GD_rank(g).plus(r).setPtr("v", GD_rank(dot_root(g)).get(r).v.plus(ND_order(u)));
18051781 GD_rank(g).plus(r).setInt("n", ND_order(w) - ND_order(u) + 1);
18061782 }
18071783 } finally {
18141790
18151791 //3 pv0rbbdopo4hmkbl5916qys1
18161792 // static Agraph_t* realFillRanks (Agraph_t* g, int rnks[], int rnks_sz, Agraph_t* sg)
1817 public static Agraph_s realFillRanks(Agraph_s g, __ptr__ rnks, int rnks_sz, Agraph_s sg) {
1793 public static ST_Agraph_s realFillRanks(ST_Agraph_s g, __ptr__ rnks, int rnks_sz, ST_Agraph_s sg) {
18181794 ENTERING("pv0rbbdopo4hmkbl5916qys1","realFillRanks");
18191795 try {
18201796 UNSUPPORTED("2o2sf6xi2aumo5k0vglp4ik2y"); // static Agraph_t*
18651841
18661842 //3 1qy9bupreg1pax62owznr98k
18671843 // static void fillRanks (Agraph_t* g)
1868 public static void fillRanks(Agraph_s g) {
1844 public static void fillRanks(ST_Agraph_s g) {
18691845 ENTERING("1qy9bupreg1pax62owznr98k","fillRanks");
18701846 try {
1871 Agraph_s sg;
1847 ST_Agraph_s sg;
18721848 int rnks_sz = GD_maxrank(g) + 2;
18731849 __ptr__ rnks = zmalloc(size_t_array_of_integer(rnks_sz));
18741850 sg = realFillRanks (g, rnks, rnks_sz, null);
18831859
18841860 //3 7fy4chyk12o7bgp1rv3h27yl3
18851861 // static void init_mincross(graph_t * g)
1886 public static void init_mincross(Agraph_s g) {
1862 public static void init_mincross(ST_Agraph_s g) {
18871863 ENTERING("7fy4chyk12o7bgp1rv3h27yl3","init_mincross");
18881864 try {
18891865 int size;
18951871 /* also, the +1 avoids attempts to alloc 0 sizes, something
18961872 that efence complains about */
18971873 size = agnedges(dot_root(g)) + 1;
1898 Z.z().TE_list = zmalloc(sizeof_starstar_empty(Agedge_s.class, size));
1874 Z.z().TE_list = new ST_Agedge_s.ArrayOfStar(size);
18991875 Z.z().TI_list = zmalloc(size_t_array_of_integer(size));
19001876 mincross_options(g);
19011877 if ((GD_flags(g) & (1 << 4))!=0)
19161892
19171893 //3 6fprrp93vmz0jn3l4ro0iropp
19181894 // void flat_rev(Agraph_t * g, Agedge_t * e)
1919 public static void flat_rev(Agraph_s g, Agedge_s e) {
1895 public static void flat_rev(ST_Agraph_s g, ST_Agedge_s e) {
19201896 ENTERING("6fprrp93vmz0jn3l4ro0iropp","flat_rev");
19211897 try {
19221898 int j;
1923 Agedge_s rev;
1899 ST_Agedge_s rev;
19241900 if (ND_flat_out(aghead(e)).listNotNull()==false)
1925 // if (N(ND_flat_out(aghead(e)).getArrayOfPtr("list")))
1901 // if (N(ND_flat_out(aghead(e)).list))
19261902 rev = null;
19271903 else
1928 for (j = 0; (rev = (Agedge_s) ND_flat_out(aghead(e)).getFromList(j))!=null; j++)
1904 for (j = 0; (rev = (ST_Agedge_s) ND_flat_out(aghead(e)).getFromList(j))!=null; j++)
19291905 if (EQ(aghead(rev), agtail(e)))
19301906 break;
19311907 if (rev!=null) {
19551931
19561932 //3 63ol0ch6cgln1nvl5oiz6n1v0
19571933 // static void flat_search(graph_t * g, node_t * v)
1958 public static void flat_search(Agraph_s g, Agnode_s v) {
1934 public static void flat_search(ST_Agraph_s g, ST_Agnode_s v) {
19591935 ENTERING("63ol0ch6cgln1nvl5oiz6n1v0","flat_search");
19601936 try {
19611937 int i;
19621938 boolean hascl;
1963 Agedge_s e;
1964 adjmatrix_t M = (adjmatrix_t) GD_rank(g).plus(ND_rank(v)).getPtr("flat");
1939 ST_Agedge_s e;
1940 ST_adjmatrix_t M = (ST_adjmatrix_t) GD_rank(g).get(ND_rank(v)).flat;
19651941 ND_mark(v, NOT(false));
19661942 ND_onstack(v, NOT(false));
19671943 hascl = (GD_n_cluster(dot_root(g)) > 0);
19681944 if (ND_flat_out(v).listNotNull())
1969 for (i = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
1945 for (i = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
19701946 if (hascl
19711947 && NOT(agcontains(g, agtail(e)) && agcontains(g, aghead(e))))
19721948 continue;
19731949 if (ED_weight(e) == 0)
19741950 continue;
19751951 if (ND_onstack(aghead(e)) == NOT(false)) {
1976 assert(ND_low(aghead(e)) < M.getInt("nrows"));
1977 assert(ND_low(agtail(e)) < M.getInt("ncols"));
1978 M.getArrayOfInteger("data").plus(ND_low(aghead(e))*M.getInt("ncols")+ND_low(agtail(e))).setInt(1);
1952 assert(ND_low(aghead(e)) < M.nrows);
1953 assert(ND_low(agtail(e)) < M.ncols);
1954 M.data[ND_low(aghead(e))][ND_low(agtail(e))]=1;
19791955 delete_flat_edge(e);
19801956 i--;
19811957 if (ED_edge_type(e) == 4)
19821958 continue;
19831959 flat_rev(g, e);
19841960 } else {
1985 assert(ND_low(aghead(e)) < M.getInt("nrows"));
1986 assert(ND_low(agtail(e)) < M.getInt("ncols"));
1987 M.getArrayOfInteger("data").plus(ND_low(agtail(e))*M.getInt("ncols")+ND_low(aghead(e))).setInt(1);
1961 assert(ND_low(aghead(e)) < M.nrows);
1962 assert(ND_low(agtail(e)) < M.ncols);
1963 M.data[ND_low(agtail(e))][ND_low(aghead(e))]=1;
19881964 if (ND_mark(aghead(e)) == 0)
19891965 flat_search(g, aghead(e));
19901966 }
20001976
20011977 //3 3v5h7z4vqivibvpt913lg8at0
20021978 // static void flat_breakcycles(graph_t * g)
2003 public static void flat_breakcycles(Agraph_s g) {
1979 public static void flat_breakcycles(ST_Agraph_s g) {
20041980 ENTERING("3v5h7z4vqivibvpt913lg8at0","flat_breakcycles");
20051981 try {
20061982 int i, r, flat;
2007 Agnode_s v;
1983 ST_Agnode_s v;
20081984 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
20091985 flat = 0;
2010 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
2011 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1986 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1987 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
20121988 ND_mark(v, 0);
20131989 ND_onstack(v, 0);
20141990 ND_low(v, i);
20151991 if ((ND_flat_out(v).size > 0) && (flat == 0)) {
20161992 GD_rank(g).plus(r).setPtr("flat",
2017 new_matrix(GD_rank(g).plus(r).getInt("n"), GD_rank(g).plus(r).getInt("n")));
1993 new_matrix(GD_rank(g).get(r).n, GD_rank(g).get(r).n));
20181994 flat = 1;
20191995 }
20201996 }
20211997 if (flat!=0) {
2022 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
2023 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1998 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1999 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
20242000 if (ND_mark(v) == 0)
20252001 flat_search(g, v);
20262002 }
20362012
20372013 //3 d5vb6jiw8mhkaa8gjwn4eqfyn
20382014 // void allocate_ranks(graph_t * g)
2039 public static void allocate_ranks(Agraph_s g) {
2015 public static void allocate_ranks(ST_Agraph_s g) {
20402016 ENTERING("d5vb6jiw8mhkaa8gjwn4eqfyn","allocate_ranks");
20412017 try {
20422018 // REVIEW 17/01/2016
20432019 int r, low, high;
20442020 __ptr__ cn;
2045 Agnode_s n;
2046 Agedge_s e;
2021 ST_Agnode_s n;
2022 ST_Agedge_s e;
20472023 cn = zmalloc(size_t_array_of_integer(GD_maxrank(g) + 2));
20482024 /* must be 0 based, not GD_minrank */
20492025 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n)) {
20602036 cn.plus(r).setInt(1+cn.plus(r).getInt());
20612037 }
20622038 }
2063 GD_rank(g, zmalloc(sizeof(rank_t.class, GD_maxrank(g) + 2)));
2039 GD_rank(g, new ST_rank_t.Array2(GD_maxrank(g) + 2));
20642040 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
20652041 GD_rank(g).plus(r).setInt("n", cn.plus(r).getInt());
20662042 GD_rank(g).plus(r).setInt("an", cn.plus(r).getInt());
2067 __ptr__ tmp = zmalloc(sizeof_starstar_empty(Agnode_s.class, cn.plus(r).getInt() + 1));
2043 ST_Agnode_s.ArrayOfStar tmp = new ST_Agnode_s.ArrayOfStar(cn.plus(r).getInt() + 1);
20682044 GD_rank(g).plus(r).setPtr("v", tmp);
20692045 GD_rank(g).plus(r).setPtr("av", tmp);
20702046 }
20792055
20802056 //3 3lxoqxhiri9fgt20zc5jz3aa5
20812057 // void install_in_rank(graph_t * g, node_t * n)
2082 public static void install_in_rank(Agraph_s g, Agnode_s n) {
2058 public static void install_in_rank(ST_Agraph_s g, ST_Agnode_s n) {
20832059 ENTERING("3lxoqxhiri9fgt20zc5jz3aa5","install_in_rank");
20842060 try {
20852061 int i, r;
20862062 r = ND_rank(n);
2087 i = GD_rank(g).plus(r).getInt("n");
2088 if (GD_rank(g).plus(r).getInt("an") <= 0) {
2063 i = GD_rank(g).get(r).n;
2064 if (GD_rank(g).get(r).an <= 0) {
20892065 UNSUPPORTED("8qk1xhvvb994zhv9aq10k4v12"); // agerr(AGERR, "install_in_rank, line %d: %s %s rank %d i = %d an = 0\n",
20902066 UNSUPPORTED("53h8d82ax23hys2k21hjswp72"); // 1034, agnameof(g), agnameof(n), r, i);
20912067 return;
20922068 }
2093 GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).setPtr(n);
2069 GD_rank(g).get(r).v.plus(i).setPtr(n);
20942070 ND_order(n, i);
2095 GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).plus(r).getInt("n"));
2071 GD_rank(g).plus(r).setInt("n", 1+GD_rank(g).get(r).n);
20962072 // assert(GD_rank(g)[r].n <= GD_rank(g)[r].an);
2097 if (ND_order(n) > GD_rank(Z.z().Root).plus(r).getInt("an")) {
2073 if (ND_order(n) > GD_rank(Z.z().Root).get(r).an) {
20982074 UNSUPPORTED("399szcw1txekt1xssyw7s2x07"); // agerr(AGERR, "install_in_rank, line %d: ND_order(%s) [%d] > GD_rank(Root)[%d].an [%d]\n",
20992075 UNSUPPORTED("9puojrmsk6vb1qc0jtr8ge4g8"); // 1052, agnameof(n), ND_order(n), r, GD_rank(Root)[r].an);
21002076 return;
21042080 UNSUPPORTED("d2ugluzf7bmj7osicgitgy3sr"); // 1057, r, GD_minrank(g), GD_maxrank(g));
21052081 return;
21062082 }
2107 if (GD_rank(g).plus(r).getPtr("v").plus(ND_order(n)).comparePointer(
2108 GD_rank(g).plus(r).getPtr("av").plus(GD_rank(Z.z().Root).plus(r).getInt("an")))>0) {
2083 if (GD_rank(g).get(r).v.plus(ND_order(n)).comparePointer(
2084 GD_rank(g).get(r).av.plus(GD_rank(Z.z().Root).get(r).an))>0) {
21092085 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",
21102086 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);
21112087 return;
21202096
21212097 //3 7t49bz6lfcbd9v63ds2x3518z
21222098 // void build_ranks(graph_t * g, int pass)
2123 public static void build_ranks(Agraph_s g, int pass) {
2099 public static void build_ranks(ST_Agraph_s g, int pass) {
21242100 ENTERING("7t49bz6lfcbd9v63ds2x3518z","build_ranks");
21252101 try {
21262102 int i, j;
2127 Agnode_s n, n0 = null;
2128 __ptr__ otheredges;
2129 nodequeue q;
2103 ST_Agnode_s n, n0 = null;
2104 List<ST_Agedge_s> otheredges;
2105 ST_nodequeue q;
21302106 q = new_queue(GD_n_nodes(g));
21312107 for (n = GD_nlist(g); n!=null; n = ND_next(n))
21322108 ND_mark(n, 0);
21332109 for (i = GD_minrank(g); i <= GD_maxrank(g); i++)
21342110 GD_rank(g).plus(i).setInt("n", 0);
21352111 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
2136 otheredges = ((pass == 0) ? ND_in(n).getTheList() : ND_out(n).getTheList());
2137 if (otheredges.plus(0).getPtr() != null)
2112 otheredges = ((pass == 0) ? ND_in(n).list : ND_out(n).list);
2113 if (otheredges.get(0)!= null)
21382114 continue;
21392115 if ((ND_mark(n)) == 0) {
21402116 ND_mark(n, 1);
21532129 UNSUPPORTED("1b3hbd5artrq77i58q2o9kgz3"); // agerr(AGERR, "surprise\n");
21542130 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
21552131 GD_rank(Z.z().Root).plus(i).setInt("valid", 0);
2156 if (GD_flip(g)!=0 && (GD_rank(g).plus(i).getInt("n") > 0)) {
2132 if (GD_flip(g)!=0 && (GD_rank(g).get(i).n > 0)) {
21572133 int nn, ndiv2;
2158 __ptr__ vlist = GD_rank(g).plus(i).getPtr("v");
2159 nn = GD_rank(g).plus(i).getInt("n") - 1;
2134 ST_Agnode_s.ArrayOfStar vlist = GD_rank(g).get(i).v;
2135 nn = GD_rank(g).get(i).n - 1;
21602136 ndiv2 = nn / 2;
21612137 for (j = 0; j <= ndiv2; j++)
2162 exchange((Agnode_s)vlist.plus(j).getPtr(), (Agnode_s)vlist.plus(nn - j).getPtr());
2138 exchange((ST_Agnode_s)vlist.get(j), (ST_Agnode_s)vlist.plus(nn - j).getPtr());
21632139 }
21642140 }
21652141 if (EQ(g, dot_root(g)) && ncross(g) > 0)
21752151
21762152 //3 bmjlneqxex6a9silzkkidkx6s
21772153 // void enqueue_neighbors(nodequeue * q, node_t * n0, int pass)
2178 public static void enqueue_neighbors(nodequeue q, Agnode_s n0, int pass) {
2154 public static void enqueue_neighbors(ST_nodequeue q, ST_Agnode_s n0, int pass) {
21792155 ENTERING("bmjlneqxex6a9silzkkidkx6s","enqueue_neighbors");
21802156 try {
21812157 int i;
2182 Agedge_s e;
2158 ST_Agedge_s e;
21832159 if (pass == 0) {
21842160 for (i = 0; i < ND_out(n0).size; i++) {
2185 e = (Agedge_s) ND_out(n0).getFromList(i);
2161 e = (ST_Agedge_s) ND_out(n0).getFromList(i);
21862162 if (((ND_mark(aghead(e)))) == 0) {
21872163 ND_mark(aghead(e), 1);
21882164 enqueue(q, aghead(e));
21902166 }
21912167 } else {
21922168 for (i = 0; i < ND_in(n0).size; i++) {
2193 e = (Agedge_s) ND_in(n0).getFromList(i);
2169 e = (ST_Agedge_s) ND_in(n0).getFromList(i);
21942170 if (((ND_mark(agtail(e)))) == 0) {
21952171 ND_mark(agtail(e), 1);
21962172 enqueue(q, agtail(e));
22072183
22082184 //3 c8nqj0v20api63pikohsbx92u
22092185 // static int constraining_flat_edge(Agraph_t *g, Agnode_t *v, Agedge_t *e)
2210 public static boolean constraining_flat_edge(Agraph_s g, Agnode_s v, Agedge_s e) {
2186 public static boolean constraining_flat_edge(ST_Agraph_s g, ST_Agnode_s v, ST_Agedge_s e) {
22112187 ENTERING("c8nqj0v20api63pikohsbx92u","constraining_flat_edge");
22122188 try {
22132189 if (ED_weight(e) == 0) return false;
22242200
22252201 //3 46to0pkk188af2dlkik2ab7e3
22262202 // static int postorder(graph_t * g, node_t * v, node_t ** list, int r)
2227 public static int postorder(Agraph_s g, Agnode_s v, __ptr__ list, int r) {
2203 public static int postorder(ST_Agraph_s g, ST_Agnode_s v, __ptr__ list, int r) {
22282204 ENTERING("46to0pkk188af2dlkik2ab7e3","postorder");
22292205 try {
2230 Agedge_s e;
2206 ST_Agedge_s e;
22312207 int i, cnt = 0;
22322208 ND_mark(v, NOT(false));
22332209 if (ND_flat_out(v).size > 0) {
2234 for (i = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
2210 for (i = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(i))!=null; i++) {
22352211 if (N(constraining_flat_edge(g,v,e))) continue;
22362212 if ((ND_mark(aghead(e))) == 0)
22372213 cnt += postorder(g, aghead(e), list.plus(cnt), r);
22502226
22512227 //3 zuxoswju917kyl08a5f0gtp6
22522228 // static void flat_reorder(graph_t * g)
2253 public static void flat_reorder(Agraph_s g) {
2229 public static void flat_reorder(ST_Agraph_s g) {
22542230 ENTERING("zuxoswju917kyl08a5f0gtp6","flat_reorder");
22552231 try {
22562232 int i, j, r, pos, n_search, local_in_cnt, local_out_cnt, base_order;
2257 Agnode_s v, t;
2233 ST_Agnode_s v, t;
22582234 __ptr__ left, right;
2259 __ptr__ temprank = null;
2260 Agedge_s flat_e, e;
2235 ST_Agnode_s.ArrayOfStar temprank = null;
2236 ST_Agedge_s flat_e, e;
22612237 if (GD_has_flat_edges(g) == 0)
22622238 return;
22632239 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
2264 if (GD_rank(g).plus(r).getInt("n") == 0) continue;
2265 base_order = ND_order(GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr());
2266 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++)
2267 ND_mark(GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr(), 0);
2268 temprank = ALLOC(i + 1, temprank, Agnode_s.class);
2240 if (GD_rank(g).get(r).n == 0) continue;
2241 base_order = ND_order(GD_rank(g).get(r).v.get(0));
2242 for (i = 0; i < GD_rank(g).get(r).n; i++)
2243 ND_mark(GD_rank(g).get(r).v.get(i), 0);
2244 temprank = ALLOC_Agnode_s(i + 1, temprank);
22692245 pos = 0;
22702246 /* construct reverse topological sort order in temprank */
2271 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
2272 if (GD_flip(g)!=0) v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
2273 else v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(GD_rank(g).plus(r).getInt("n") - i - 1).getPtr();
2247 for (i = 0; i < GD_rank(g).get(r).n; i++) {
2248 if (GD_flip(g)!=0) v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
2249 else v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - i - 1).getPtr();
22742250 local_in_cnt = local_out_cnt = 0;
22752251 for (j = 0; j < ND_flat_in(v).size; j++) {
2276 flat_e = (Agedge_s) ND_flat_in(v).getFromList(j);
2252 flat_e = (ST_Agedge_s) ND_flat_in(v).getFromList(j);
22772253 if (constraining_flat_edge(g,v,flat_e)) local_in_cnt++;
22782254 }
22792255 for (j = 0; j < ND_flat_out(v).size; j++) {
2280 flat_e = (Agedge_s) ND_flat_out(v).getFromList(j);
2256 flat_e = (ST_Agedge_s) ND_flat_out(v).getFromList(j);
22812257 if (constraining_flat_edge(g,v,flat_e)) local_out_cnt++;
22822258 }
22832259 if ((local_in_cnt == 0) && (local_out_cnt == 0))
22952271 left = temprank;
22962272 right = temprank.plus(pos - 1);
22972273 while (left.comparePointer(right) < 0) {
2298 t = (Agnode_s) left.getPtr();
2274 t = (ST_Agnode_s) left.getPtr();
22992275 left.setPtr(right.getPtr());
23002276 right.setPtr(t);
23012277 left = left.plus(1);
23022278 right = right.plus(-1);
23032279 }
23042280 }
2305 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
2306 v = (Agnode_s) temprank.plus(i).getPtr();
2307 GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).setPtr(v);
2281 for (i = 0; i < GD_rank(g).get(r).n; i++) {
2282 v = (ST_Agnode_s) temprank.get(i);
2283 GD_rank(g).get(r).v.plus(i).setPtr(v);
23082284 ND_order(v, i + base_order);
23092285 }
23102286 /* nonconstraint flat edges must be made LR */
2311 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
2312 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
2287 for (i = 0; i < GD_rank(g).get(r).n; i++) {
2288 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
23132289 if (ND_flat_out(v).listNotNull()) {
2314 for (j = 0; (e = (Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) {
2290 for (j = 0; (e = (ST_Agedge_s) ND_flat_out(v).getFromList(j))!=null; j++) {
23152291 if ( ((GD_flip(g) == 0) && (ND_order(aghead(e)) < ND_order(agtail(e)))) ||
23162292 ( (GD_flip(g)!=0) && (ND_order(aghead(e)) > ND_order(agtail(e)) ))) {
23172293 assert(constraining_flat_edge(g,v,e) == false);
23392315
23402316 //3 inv6wazjcnh4xkzzphsdcmg4
23412317 // static void reorder(graph_t * g, int r, int reverse, int hasfixed)
2342 public static void reorder(Agraph_s g, int r, boolean reverse, boolean hasfixed) {
2318 public static void reorder(ST_Agraph_s g, int r, boolean reverse, boolean hasfixed) {
23432319 ENTERING("inv6wazjcnh4xkzzphsdcmg4","reorder");
23442320 try {
23452321 boolean changed = false;
23462322 int nelt;
23472323 boolean muststay, sawclust;
2348 __ptr__ vlist = GD_rank(g).plus(r).getPtr("v");
2349 __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).plus(r).getInt("n"));
2350 for (nelt = GD_rank(g).plus(r).getInt("n") - 1; nelt >= 0; nelt--) {
2324 __ptr__ vlist = GD_rank(g).get(r).v;
2325 __ptr__ lp, rp=null, ep = vlist.plus(GD_rank(g).get(r).n);
2326 for (nelt = GD_rank(g).get(r).n - 1; nelt >= 0; nelt--) {
23512327 lp = vlist;
23522328 while (lp.comparePointer(ep)<0) {
23532329 /* find leftmost node that can be compared */
23602336 for (rp = lp.plus(1); rp.comparePointer(ep) < 0; rp=rp.plus(1)) {
23612337 if (sawclust && ND_clust(rp.getPtr())!=null)
23622338 continue; /* ### */
2363 if (left2right(g, (Agnode_s) lp.getPtr(), (Agnode_s) rp.getPtr())) {
2339 if (left2right(g, (ST_Agnode_s) lp.getPtr(), (ST_Agnode_s) rp.getPtr())) {
23642340 muststay = NOT(false);
23652341 break;
23662342 }
23752351 int p1 = (int) (ND_mval(lp.getPtr()));
23762352 int p2 = (int) (ND_mval(rp.getPtr()));
23772353 if ((p1 > p2) || ((p1 == p2) && (reverse))) {
2378 exchange((Agnode_s)lp.getPtr(), (Agnode_s)rp.getPtr());
2354 exchange((ST_Agnode_s)lp.getPtr(), (ST_Agnode_s)rp.getPtr());
23792355 changed=true;
23802356 }
23812357 }
23852361 ep = ep.plus(-1);
23862362 }
23872363 if (changed) {
2388 GD_rank(Z.z().Root).plus(r).setBoolean("valid", false);
2364 GD_rank(Z.z().Root).get(r).valid= 0;
23892365 if (r > 0)
2390 GD_rank(Z.z().Root).plus(r - 1).setBoolean("valid", false);
2366 GD_rank(Z.z().Root).plus(r - 1).getPtr().valid= 0;
23912367 }
23922368 } finally {
23932369 LEAVING("inv6wazjcnh4xkzzphsdcmg4","reorder");
23992375
24002376 //3 14t80owwvm7io4ou6czb9ba9
24012377 // static void mincross_step(graph_t * g, int pass)
2402 public static void mincross_step(Agraph_s g, int pass) {
2378 public static void mincross_step(ST_Agraph_s g, int pass) {
24032379 ENTERING("14t80owwvm7io4ou6czb9ba9","mincross_step");
24042380 try {
24052381 int r, other, first, last, dir;
24452421
24462422 //3 aq18oa4k4grixvfjx7r2qnl6r
24472423 // static int local_cross(elist l, int dir)
2448 public static int local_cross(final __struct__<elist> l, int dir) {
2424 public static int local_cross(final ST_elist l, int dir) {
24492425 // WARNING!! STRUCT
24502426 return local_cross_w_(l.copy(), dir);
24512427 }
2452 private static int local_cross_w_(final __struct__<elist> l, int dir) {
2428 private static int local_cross_w_(final ST_elist l, int dir) {
24532429 ENTERING("aq18oa4k4grixvfjx7r2qnl6r","local_cross");
24542430 try {
24552431 UNSUPPORTED("3jmndo6p8u1x5wp297qpt0jto"); // static int local_cross(elist l, int dir)
24862462
24872463
24882464
2465 //static __ptr__ Count;
2466 //static int C;
24892467 //3 bk5nklhfqgg0uwkv7tv6dn8r2
24902468 // static int rcross(graph_t * g, int r)
2491 //static __ptr__ Count;
2492 //static int C;
2493 public static int rcross(Agraph_s g, int r) {
2469 public static int rcross(ST_Agraph_s g, int r) {
24942470 ENTERING("bk5nklhfqgg0uwkv7tv6dn8r2","rcross");
24952471 try {
24962472 int top, bot, cross, max, i, k;
2497 Agnode_s v;
2498 __ptr__ rtop;
2473 ST_Agnode_s v;
2474 ST_Agnode_s.ArrayOfStar rtop;
24992475 cross = 0;
25002476 max = 0;
2501 rtop = GD_rank(g).plus(r).getPtr("v");
2502 if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getInt("n")) {
2503 Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getInt("n") + 1;
2477 rtop = GD_rank(g).get(r).v;
2478 if (Z.z().C <= GD_rank(Z.z().Root).plus(r + 1).getPtr().n) {
2479 Z.z().C = GD_rank(Z.z().Root).plus(r + 1).getPtr().n + 1;
25042480 Z.z().Count = ALLOC_INT(Z.z().C, Z.z().Count);
25052481 }
2506 for (i = 0; i < GD_rank(g).plus(r + 1).getInt("n"); i++)
2482 for (i = 0; i < GD_rank(g).get(r + 1).n; i++)
25072483 Z.z().Count.plus(i).setInt(0);
2508 for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
2509 Agedge_s e;
2484 for (top = 0; top < GD_rank(g).get(r).n; top++) {
2485 ST_Agedge_s e;
25102486 if (max > 0) {
2511 for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) {
2487 for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) {
25122488 for (k = ND_order(aghead(e)) + 1; k <= max; k++)
25132489 cross += Z.z().Count.plus(k).getInt() * ED_xpenalty(e);
25142490 }
25152491 }
2516 for (i = 0; (e = (Agedge_s) ND_out(rtop.plus(top).getPtr()).getFromList(i))!=null; i++) {
2492 for (i = 0; (e = (ST_Agedge_s) ND_out(rtop.get(top)).getFromList(i))!=null; i++) {
25172493 int inv = ND_order(aghead(e));
25182494 if (inv > max)
25192495 max = inv;
25202496 Z.z().Count.plus(inv).setInt(Z.z().Count.plus(inv).getInt() + ED_xpenalty(e));
25212497 }
25222498 }
2523 for (top = 0; top < GD_rank(g).plus(r).getInt("n"); top++) {
2524 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(top).getPtr();
2499 for (top = 0; top < GD_rank(g).get(r).n; top++) {
2500 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(top);
25252501 if (ND_has_port(v))
25262502 cross += local_cross(ND_out(v), 1);
25272503 }
2528 for (bot = 0; bot < GD_rank(g).plus(r + 1).getInt("n"); bot++) {
2529 v = (Agnode_s) GD_rank(g).plus(r + 1).getArrayOfPtr("v").plus(bot).getPtr();
2504 for (bot = 0; bot < GD_rank(g).get(r + 1).n; bot++) {
2505 v = (ST_Agnode_s) GD_rank(g).get(r + 1).v.get(bot);
25302506 if (ND_has_port(v))
25312507 cross += local_cross(ND_in(v), -1);
25322508 }
25412517
25422518 //3 dbjmz2tnii2pn9sxg26ap6w5r
25432519 // int ncross(graph_t * g)
2544 public static int ncross(Agraph_s g) {
2520 public static int ncross(ST_Agraph_s g) {
25452521 ENTERING("dbjmz2tnii2pn9sxg26ap6w5r","ncross");
25462522 try {
25472523 int r, count, nc;
25482524 g = Z.z().Root;
25492525 count = 0;
25502526 for (r = GD_minrank(g); r < GD_maxrank(g); r++) {
2551 if (GD_rank(g).plus(r).getBoolean("valid"))
2552 count += GD_rank(g).plus(r).getInt("cache_nc");
2527 if (GD_rank(g).get(r).valid!=0)
2528 count += GD_rank(g).get(r).cache_nc;
25532529 else {
25542530 nc = rcross(g, r);
2555 GD_rank(g).plus(r).getInt("cache_nc");
2531 GD_rank(g).get(r).cache_nc = nc;
25562532 count += nc;
25572533 GD_rank(g).plus(r).setInt("valid", 1);
25582534 }
25822558
25832559 //3 7397kynkpqf2m1jkpmi8pgf0n
25842560 // static int flat_mval(node_t * n)
2585 public static boolean flat_mval(Agnode_s n) {
2561 public static boolean flat_mval(ST_Agnode_s n) {
25862562 ENTERING("7397kynkpqf2m1jkpmi8pgf0n","flat_mval");
25872563 try {
25882564 int i;
2589 Agedge_s e;
2590 __ptr__ fl;
2591 Agnode_s nn;
2565 ST_Agedge_s e;
2566 List<ST_Agedge_s> fl;
2567 ST_Agnode_s nn;
25922568 if (ND_flat_in(n).size > 0) {
2593 fl = ND_flat_in(n).getTheList();
2594 nn = agtail(fl.plus(0).getPtr());
2595 for (i = 1; (e = (Agedge_s) fl.plus(i).getPtr())!=null; i++)
2569 fl = ND_flat_in(n).list;
2570 nn = agtail(fl.get(0));
2571 for (i = 1; (e = (ST_Agedge_s) fl.get(i))!=null; i++)
25962572 if (ND_order(agtail(e)) > ND_order(nn))
25972573 nn = agtail(e);
25982574 if (ND_mval(nn) >= 0) {
26002576 return false;
26012577 }
26022578 } else if (ND_flat_out(n).size > 0) {
2603 fl = ND_flat_out(n).getTheList();
2604 nn = aghead(fl.plus(0).getPtr());
2605 for (i = 1; (e = (Agedge_s) fl.plus(i).getPtr())!=null; i++)
2579 fl = ND_flat_out(n).list;
2580 nn = aghead(fl.get(0));
2581 for (i = 1; (e = (ST_Agedge_s) fl.get(i))!=null; i++)
26062582 if (ND_order(aghead(e)) < ND_order(nn))
26072583 nn = aghead(e);
26082584 if (ND_mval(nn) > 0) {
26212597
26222598 //3 azvdpixwwxspl31wp7f4k4fmh
26232599 // static boolean medians(graph_t * g, int r0, int r1)
2624 public static boolean medians(Agraph_s g, int r0, int r1) {
2600 public static boolean medians(ST_Agraph_s g, int r0, int r1) {
26252601 ENTERING("azvdpixwwxspl31wp7f4k4fmh","medians");
26262602 try {
26272603 int i, j, j0, lm, rm, lspan, rspan;
26282604 __ptr__ list;
2629 Agnode_s n;
2630 __ptr__ v;
2631 Agedge_s e;
2605 ST_Agnode_s n;
2606 ST_Agnode_s.ArrayOfStar v;
2607 ST_Agedge_s e;
26322608 boolean hasfixed = false;
26332609 list = Z.z().TI_list;
2634 v = GD_rank(g).plus(r0).getPtr("v");
2635 for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) {
2636 n = (Agnode_s) v.plus(i).getPtr();
2610 v = GD_rank(g).get(r0).v;
2611 for (i = 0; i < GD_rank(g).get(r0).n; i++) {
2612 n = (ST_Agnode_s) v.get(i);
26372613 j = 0;
26382614 if (r1 > r0)
2639 for (j0 = 0; (e = (Agedge_s) ND_out(n).getFromList(j0))!=null; j0++) {
2615 for (j0 = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(j0))!=null; j0++) {
26402616 if (ED_xpenalty(e) > 0)
2641 list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).getInt("order")));
2617 list.plus(j++).setInt((256 * ND_order(aghead(e)) + (ED_head_port(e)).order));
26422618 } else
2643 for (j0 = 0; (e = (Agedge_s) ND_in(n).getFromList(j0))!=null; j0++) {
2619 for (j0 = 0; (e = (ST_Agedge_s) ND_in(n).getFromList(j0))!=null; j0++) {
26442620 if (ED_xpenalty(e) > 0)
2645 list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).getInt("order")));
2621 list.plus(j++).setInt((256 * ND_order(agtail(e)) + (ED_tail_port(e)).order));
26462622 }
26472623 switch (j) {
26482624 case 0:
26572633 default:
26582634 qsort(list,
26592635 j,
2660 sizeof(list.plus(0)),
26612636 function(mincross__c.class, "ordercmpf"));
26622637 if (j % 2!=0)
26632638 ND_mval(n, list.plus(j / 2).getInt());
26762651 }
26772652 }
26782653 }
2679 for (i = 0; i < GD_rank(g).plus(r0).getInt("n"); i++) {
2680 n = (Agnode_s) v.plus(i).getPtr();
2654 for (i = 0; i < GD_rank(g).get(r0).n; i++) {
2655 n = (ST_Agnode_s) v.get(i);
26812656 if ((ND_out(n).size == 0) && (ND_in(n).size == 0))
26822657 hasfixed |= flat_mval(n);
26832658 }
27282703
27292704 //3 7j638prioxd97f74v1v4adbsf
27302705 // static int endpoint_class(node_t * n)
2731 public static int endpoint_class(Agnode_s n) {
2706 public static int endpoint_class(ST_Agnode_s n) {
27322707 ENTERING("7j638prioxd97f74v1v4adbsf","endpoint_class");
27332708 try {
27342709 if (ND_node_type(n) == 1)
27462721
27472722 //3 es57bn7ga4wc9tqtcixpn0451
27482723 // void virtual_weight(edge_t * e)
2749 public static void virtual_weight(Agedge_s e) {
2724 public static void virtual_weight(ST_Agedge_s e) {
27502725 ENTERING("es57bn7ga4wc9tqtcixpn0451","virtual_weight");
27512726 try {
27522727 int t;
27622737
27632738 //3 7ru09oqbudpeofsthzveig2m2
27642739 // static void mincross_options(graph_t * g)
2765 public static void mincross_options(Agraph_s g) {
2740 public static void mincross_options(ST_Agraph_s g) {
27662741 ENTERING("7ru09oqbudpeofsthzveig2m2","mincross_options");
27672742 try {
27682743 CString p;
4949 import static gen.lib.cgraph.graph__c.agnnodes;
5050 import static gen.lib.cgraph.obj__c.agcontains;
5151 import static gen.lib.cgraph.obj__c.agroot;
52 import static gen.lib.common.memory__c.zmalloc;
5352 import static gen.lib.common.ns__c.rank;
5453 import static gen.lib.common.splines__c.selfRightSpace;
5554 import static gen.lib.common.utils__c.late_int;
6665 import static smetana.core.JUtils.USHRT_MAX;
6766 import static smetana.core.JUtils.atof;
6867 import static smetana.core.JUtils.enumAsInt;
69 import static smetana.core.JUtils.sizeof;
7068 import static smetana.core.JUtilsDebug.ENTERING;
7169 import static smetana.core.JUtilsDebug.LEAVING;
7270 import static smetana.core.Macro.AGINEDGE;
7371 import static smetana.core.Macro.AGOUTEDGE;
7472 import static smetana.core.Macro.AGTYPE;
75 import static smetana.core.Macro.ALLOC_empty;
73 import static smetana.core.Macro.ALLOC_allocated_ST_Agnode_s;
7674 import static smetana.core.Macro.ED_dist;
7775 import static smetana.core.Macro.ED_head_port;
7876 import static smetana.core.Macro.ED_label;
132130 import static smetana.core.Macro.agtail;
133131 import static smetana.core.Macro.alloc_elist;
134132 import static smetana.core.Macro.free_list;
135 import h.Agedge_s;
136 import h.Agedgeinfo_t;
137 import h.Agedgepair_s;
138 import h.Agnode_s;
139 import h.Agraph_s;
133 import h.ST_Agedge_s;
134 import h.ST_Agedgeinfo_t;
135 import h.ST_Agedgepair_s;
136 import h.ST_Agnode_s;
137 import h.ST_Agraph_s;
138 import h.ST_aspect_t;
139 import h.ST_point;
140140 import h.ST_pointf;
141 import h.aspect_t;
142 import h.boxf;
143 import h.point;
144 import h.pointf;
141 import h.ST_rank_t;
145142 import h.ratio_t;
146143 import smetana.core.CString;
147 import smetana.core.JUtils;
148144 import smetana.core.Memory;
149145 import smetana.core.Z;
150 import smetana.core.__ptr__;
151 import smetana.core.__struct__;
152146
153147 public class position__c {
154148 //1 2digov3edok6d5srhgtlmrycs
408402
409403 //3 c1s4k85p1cdfn176o3uryeros
410404 // static inline pointf pointfof(double x, double y)
411 public static __struct__<pointf> pointfof(double x, double y) {
405 public static ST_pointf pointfof(double x, double y) {
412406 // WARNING!! STRUCT
413407 return pointfof_w_(x, y).copy();
414408 }
415 private static __struct__<pointf> pointfof_w_(double x, double y) {
409 private static ST_pointf pointfof_w_(double x, double y) {
416410 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
417411 try {
418 final __struct__<pointf> r = JUtils.from(pointf.class);
412 final ST_pointf r = new ST_pointf();
419413 r.setDouble("x", x);
420414 r.setDouble("y", y);
421415 return r;
444438
445439
446440
447 //3 1vvsta5i8of59frav6uymguav
448 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
449 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
450 // WARNING!! STRUCT
451 return boxfof_w_(llx, lly, urx, ury).copy();
452 }
453 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
454 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
455 try {
456 final __struct__<boxf> b = JUtils.from(boxf.class);
457 b.getStruct("LL").setDouble("x", llx);
458 b.getStruct("LL").setDouble("y", lly);
459 b.getStruct("UR").setDouble("x", urx);
460 b.getStruct("UR").setDouble("y", ury);
461 return b;
462 } finally {
463 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
464 }
465 }
466441
467442
468443
486461
487462 //3 arrsbik9b5tnfcbzsm8gr2chx
488463 // static inline pointf add_pointf(pointf p, pointf q)
489 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
464 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
490465 // WARNING!! STRUCT
491466 return add_pointf_w_(p.copy(), q.copy()).copy();
492467 }
493 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
468 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
494469 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
495470 try {
496 final __struct__<pointf> r = JUtils.from(pointf.class);
497 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
498 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
471 final ST_pointf r = new ST_pointf();
472 r.setDouble("x", p.x + q.x);
473 r.setDouble("y", p.y + q.y);
499474 return r;
500475 } finally {
501476 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
813788
814789 //3 ccowbxkwmrj75tojopmhcmubx
815790 // static void connectGraph (graph_t* g)
816 public static void connectGraph(Agraph_s g) {
791 public static void connectGraph(ST_Agraph_s g) {
817792 ENTERING("ccowbxkwmrj75tojopmhcmubx","connectGraph");
818793 try {
819794 int i, j, r, found;
820 Agnode_s tp;
821 Agnode_s hp;
822 Agnode_s sn;
823 Agedge_s e;
824 __ptr__ rp;
795 ST_Agnode_s tp;
796 ST_Agnode_s hp;
797 ST_Agnode_s sn;
798 ST_Agedge_s e;
799 ST_rank_t.Array2 rp;
825800 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
826801 rp = GD_rank(g).plus(r);
827802 found =0;
828803 tp = null;
829 for (i = 0; i < rp.getPtr().getInt("n"); i++) {
830 tp = (Agnode_s) rp.getPtr().getArrayOfPtr("v").plus(i).getPtr();
804 for (i = 0; i < rp.getPtr().n; i++) {
805 tp = (ST_Agnode_s) rp.getPtr().v.get(i);
831806 if (ND_save_out(tp).listNotNull()) {
832 for (j = 0; (e = (Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) {
807 for (j = 0; (e = (ST_Agedge_s) ND_save_out(tp).getFromList(j))!=null; j++) {
833808 if ((ND_rank(aghead(e)) > r) || (ND_rank(agtail(e)) > r)) {
834809 found = 1;
835810 break;
838813 if (found!=0) break;
839814 }
840815 if (ND_save_in(tp).listNotNull()) {
841 for (j = 0; (e = (Agedge_s) ND_save_in(tp).getFromList(j))!=null; j++) {
816 for (j = 0; (e = (ST_Agedge_s) ND_save_in(tp).getFromList(j))!=null; j++) {
842817 if ((ND_rank(agtail(e)) > r) || (ND_rank(aghead(e)) > r)) {
843818 found = 1;
844819 break;
848823 }
849824 }
850825 if (found!=0 || N(tp)) continue;
851 tp = (Agnode_s) rp.getPtr().getArrayOfPtr("v").plus(0).getPtr();
852 if (r < GD_maxrank(g)) hp = (Agnode_s) rp.plus(1).getPtr().getArrayOfPtr("v").plus(0).getPtr();
853 else hp = (Agnode_s) rp.plus(-1).getPtr().getArrayOfPtr("v").plus(0).getPtr();
826 tp = (ST_Agnode_s) rp.getPtr().v.get(0);
827 if (r < GD_maxrank(g)) hp = (ST_Agnode_s) rp.get(1).v.get(0);
828 else hp = (ST_Agnode_s) rp.plus(-1).getPtr().v.get(0);
854829 //assert (hp);
855830 sn = virtual_node(g);
856831 ND_node_type(sn, 2);
868843
869844 //3 33snzyd9z0loienur06dnily9
870845 // void dot_position(graph_t * g, aspect_t* asp)
871 public static void dot_position(Agraph_s g, aspect_t asp) {
846 public static void dot_position(ST_Agraph_s g, ST_aspect_t asp) {
872847 ENTERING("33snzyd9z0loienur06dnily9","dot_position");
873848 try {
874849 if (GD_nlist(g) == null)
900875
901876 //3 90vn63m6v0w9fn9a2dgfxxx3h
902877 // static int nsiter2(graph_t * g)
903 public static int nsiter2(Agraph_s g) {
878 public static int nsiter2(ST_Agraph_s g) {
904879 ENTERING("90vn63m6v0w9fn9a2dgfxxx3h","nsiter2");
905880 try {
906881 int maxiter = INT_MAX;
918893
919894 //3 5bax8ut6nnk4pr7yxdumk9chl
920895 // static int go(node_t * u, node_t * v)
921 public static boolean go(Agnode_s u, Agnode_s v) {
896 public static boolean go(ST_Agnode_s u, ST_Agnode_s v) {
922897 ENTERING("5bax8ut6nnk4pr7yxdumk9chl","go");
923898 try {
924899 int i;
925 Agedge_s e;
900 ST_Agedge_s e;
926901 if (EQ(u, v))
927902 return NOT(false);
928 for (i = 0; (e = (Agedge_s) ND_out(u).getFromList(i))!=null; i++) {
903 for (i = 0; (e = (ST_Agedge_s) ND_out(u).getFromList(i))!=null; i++) {
929904 if (go(aghead(e), v))
930905 return NOT(false);
931906 }
940915
941916 //3 9xz8numztzj4qsq85pziahv1k
942917 // static int canreach(node_t * u, node_t * v)
943 public static boolean canreach(Agnode_s u, Agnode_s v) {
918 public static boolean canreach(ST_Agnode_s u, ST_Agnode_s v) {
944919 ENTERING("9xz8numztzj4qsq85pziahv1k","canreach");
945920 try {
946921 return go(u, v);
954929
955930 //3 4cvgiatny97ou6mhqoq6aqwek
956931 // edge_t *make_aux_edge(node_t * u, node_t * v, double len, int wt)
957 public static Agedge_s make_aux_edge(Agnode_s u, Agnode_s v, double len, int wt) {
932 public static ST_Agedge_s make_aux_edge(ST_Agnode_s u, ST_Agnode_s v, double len, int wt) {
958933 ENTERING("4cvgiatny97ou6mhqoq6aqwek","make_aux_edge");
959934 try {
960 Agedge_s e;
961 Agedgepair_s e2 = (Agedgepair_s) zmalloc(sizeof(Agedgepair_s.class));
962 AGTYPE(e2.getStruct("in").amp(), AGINEDGE);
963 AGTYPE(e2.getStruct("out").amp(), AGOUTEDGE);
964 e2.getStruct("out").getStruct("base").setPtr("data", zmalloc(sizeof(Agedgeinfo_t.class)));
965 e = (Agedge_s) e2.getStruct("out").amp();
935 ST_Agedge_s e;
936 ST_Agedgepair_s e2 = new ST_Agedgepair_s();
937 AGTYPE(e2.in, AGINEDGE);
938 AGTYPE(e2.out, AGOUTEDGE);
939 e2.out.base.setPtr("data", new ST_Agedgeinfo_t());
940 e = (ST_Agedge_s) e2.out;
966941 agtail(e, u);
967942 aghead(e, v);
968943 if (len > USHRT_MAX)
981956
982957 //3 53fvij7oun7aezlb7x66vzuyb
983958 // static void allocate_aux_edges(graph_t * g)
984 public static void allocate_aux_edges(Agraph_s g) {
959 public static void allocate_aux_edges(ST_Agraph_s g) {
985960 ENTERING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
986961 try {
987962 int i, j, n_in;
988 Agnode_s n;
963 ST_Agnode_s n;
989964 /* allocate space for aux edge lists */
990965 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
991966 ND_save_in(n, ND_in(n));
993968 for (i = 0; ND_out(n).getFromList(i)!=null; i++);
994969 for (j = 0; ND_in(n).getFromList(j)!=null; j++);
995970 n_in = i + j;
996 alloc_elist(n_in + 3, ND_in(n), Agnode_s.class);
997 alloc_elist(3, ND_out(n), Agnode_s.class);
971 alloc_elist(n_in + 3, ND_in(n));
972 alloc_elist(3, ND_out(n));
998973 }
999974 } finally {
1000975 LEAVING("53fvij7oun7aezlb7x66vzuyb","allocate_aux_edges");
1006981
1007982 //3 ah28nr6mxpjeosr85bhmzd3si
1008983 // static void make_LR_constraints(graph_t * g)
1009 public static void make_LR_constraints(Agraph_s g) {
984 public static void make_LR_constraints(ST_Agraph_s g) {
1010985 ENTERING("ah28nr6mxpjeosr85bhmzd3si","make_LR_constraints");
1011986 try {
1012987 int i, j, k;
1015990 double width;
1016991 int sep[] = new int[2];
1017992 int nodesep; /* separation between nodes on same rank */
1018 Agedge_s e, e0, e1, ff;
1019 Agnode_s u, v, t0, h0;
1020 __ptr__ rank = GD_rank(g);
993 ST_Agedge_s e, e0, e1, ff;
994 ST_Agnode_s u, v, t0, h0;
995 ST_rank_t.Array2 rank = GD_rank(g);
1021996 /* Use smaller separation on odd ranks if g has edge labels */
1022997 if ((GD_has_labels(g) & (1 << 0))!=0) {
1023998 sep[0] = GD_nodesep(g);
10291004 /* make edges to constrain left-to-right ordering */
10301005 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
10311006 double last;
1032 ND_rank(rank.plus(i).getArrayOfPtr("v").plus(0).getPtr(), 0);
1007 ND_rank(rank.get(i).v.get(0), 0);
10331008 last = 0;
10341009 nodesep = sep[i & 1];
1035 for (j = 0; j < rank.plus(i).getInt("n"); j++) {
1036 u = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j).getPtr();
1010 for (j = 0; j < rank.get(i).n; j++) {
1011 u = (ST_Agnode_s) rank.get(i).v.get(j);
10371012 ND_mval(u, ND_rw(u)); /* keep it somewhere safe */
10381013 if (ND_other(u).size > 0) { /* compute self size */
10391014 /* FIX: dot assumes all self-edges go to the right. This
10451020 * positioning but may also affect interrank spacing.
10461021 */
10471022 sw = 0;
1048 for (k = 0; (e = (Agedge_s) ND_other(u).getFromList(k))!=null; k++) {
1023 for (k = 0; (e = (ST_Agedge_s) ND_other(u).getFromList(k))!=null; k++) {
10491024 if (EQ(agtail(e), aghead(e))) {
10501025 sw += selfRightSpace (e);
10511026 }
10521027 }
10531028 ND_rw(u, ND_rw(u) + sw); /* increment to include self edges */
10541029 }
1055 v = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j + 1).getPtr();
1030 v = (ST_Agnode_s) rank.get(i).v.plus(j + 1).getPtr();
10561031 if (v!=null) {
10571032 width = ND_rw(u) + ND_lw(v) + nodesep;
10581033 e0 = make_aux_edge(u, v, width, 0);
10601035 last = (int)(last + width);
10611036 }
10621037 /* constraints from labels of flat edges on previous rank */
1063 if ((e = (Agedge_s) ND_alg(u))!=null) {
1064 e0 = (Agedge_s) ND_save_out(u).getFromList(0);
1065 e1 = (Agedge_s) ND_save_out(u).getFromList(1);
1038 if ((e = (ST_Agedge_s) ND_alg(u))!=null) {
1039 e0 = (ST_Agedge_s) ND_save_out(u).getFromList(0);
1040 e1 = (ST_Agedge_s) ND_save_out(u).getFromList(1);
10661041 if (ND_order(aghead(e0)) > ND_order(aghead(e1))) {
10671042 ff = e0;
10681043 e0 = e1;
10821057 }
10831058 /* position flat edge endpoints */
10841059 for (k = 0; k < ND_flat_out(u).size; k++) {
1085 e = (Agedge_s) ND_flat_out(u).getFromList(k);
1060 e = (ST_Agedge_s) ND_flat_out(u).getFromList(k);
10861061 if (ND_order(agtail(e)) < ND_order(aghead(e))) {
10871062 t0 = agtail(e);
10881063 h0 = aghead(e);
11251100
11261101 //3 6uruo8mutxgcni9fm8jcrw4cr
11271102 // static void make_edge_pairs(graph_t * g)
1128 public static void make_edge_pairs(Agraph_s g) {
1103 public static void make_edge_pairs(ST_Agraph_s g) {
11291104 ENTERING("6uruo8mutxgcni9fm8jcrw4cr","make_edge_pairs");
11301105 try {
11311106 int i, m0, m1;
1132 Agnode_s n, sn;
1133 Agedge_s e;
1107 ST_Agnode_s n, sn;
1108 ST_Agedge_s e;
11341109 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
11351110 if (ND_save_out(n).listNotNull())
1136 for (i = 0; (e = (Agedge_s) ND_save_out(n).getFromList(i))!=null; i++) {
1111 for (i = 0; (e = (ST_Agedge_s) ND_save_out(n).getFromList(i))!=null; i++) {
11371112 sn = virtual_node(g);
11381113 ND_node_type(sn, 2);
11391114 m0 = (int)(ED_head_port(e).p.x - ED_tail_port(e).p.x);
11601135
11611136 //3 79v3omwzni0nm3h05l3onjsbz
11621137 // static void contain_clustnodes(graph_t * g)
1163 public static void contain_clustnodes(Agraph_s g) {
1138 public static void contain_clustnodes(ST_Agraph_s g) {
11641139 ENTERING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
11651140 try {
11661141 int c;
1167 Agedge_s e;
1142 ST_Agedge_s e;
11681143 if (NEQ(g, dot_root(g))) {
11691144 contain_nodes(g);
11701145 if ((e = find_fast_edge(GD_ln(g),GD_rn(g)))!=null) /* maybe from lrvn()?*/
11731148 make_aux_edge(GD_ln(g), GD_rn(g), 1, 128); /* clust compaction edge */
11741149 }
11751150 for (c = 1; c <= GD_n_cluster(g); c++)
1176 contain_clustnodes((Agraph_s) GD_clust(g).plus(c).getPtr());
1151 contain_clustnodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
11771152 } finally {
11781153 LEAVING("79v3omwzni0nm3h05l3onjsbz","contain_clustnodes");
11791154 }
11841159
11851160 //3 24yfgklubun581fbfyx62lzsm
11861161 // static int vnode_not_related_to(graph_t * g, node_t * v)
1187 public static boolean vnode_not_related_to(Agraph_s g, Agnode_s v) {
1162 public static boolean vnode_not_related_to(ST_Agraph_s g, ST_Agnode_s v) {
11881163 ENTERING("24yfgklubun581fbfyx62lzsm","vnode_not_related_to");
11891164 try {
1190 Agedge_s e;
1165 ST_Agedge_s e;
11911166 if (ND_node_type(v) != 1)
11921167 return false;
1193 for (e = (Agedge_s) ND_save_out(v).getFromList(0); ED_to_orig(e)!=null; e = ED_to_orig(e));
1168 for (e = (ST_Agedge_s) ND_save_out(v).getFromList(0); ED_to_orig(e)!=null; e = ED_to_orig(e));
11941169 if (agcontains(g, agtail(e)))
11951170 return false;
11961171 if (agcontains(g, aghead(e)))
12061181
12071182 //3 73cdgjl47ohty2va766evbo4
12081183 // static void keepout_othernodes(graph_t * g)
1209 public static void keepout_othernodes(Agraph_s g) {
1184 public static void keepout_othernodes(ST_Agraph_s g) {
12101185 ENTERING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
12111186 try {
12121187 int i, c, r, margin;
1213 Agnode_s u, v;
1188 ST_Agnode_s u, v;
12141189 margin = late_int (g, Z.z().G_margin, 8, 0);
12151190 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1216 if (GD_rank(g).plus(r).getInt("n") == 0)
1191 if (GD_rank(g).get(r).n == 0)
12171192 continue;
1218 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
1193 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
12191194 if (v == null)
12201195 continue;
12211196 for (i = ND_order(v) - 1; i >= 0; i--) {
1222 u = (Agnode_s) GD_rank(dot_root(g)).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1197 u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
12231198 /* can't use "is_a_vnode_of" because elists are swapped */
12241199 if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
12251200 make_aux_edge(u, GD_ln(g), margin + ND_rw(u), 0);
12261201 break;
12271202 }
12281203 }
1229 for (i = ND_order(v) + GD_rank(g).plus(r).getInt("n"); i < GD_rank(dot_root(g)).plus(r).getInt("n");
1204 for (i = ND_order(v) + GD_rank(g).get(r).n; i < GD_rank(dot_root(g)).get(r).n;
12301205 i++) {
1231 u = (Agnode_s) GD_rank(dot_root(g)).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1206 u = (ST_Agnode_s) GD_rank(dot_root(g)).get(r).v.get(i);
12321207 if ((ND_node_type(u) == 0) || vnode_not_related_to(g, u)) {
12331208 make_aux_edge(GD_rn(g), u, margin + ND_lw(u), 0);
12341209 break;
12361211 }
12371212 }
12381213 for (c = 1; c <= GD_n_cluster(g); c++)
1239 keepout_othernodes((Agraph_s) GD_clust(g).plus(c).getPtr());
1214 keepout_othernodes((ST_Agraph_s) GD_clust(g).get(c).getPtr());
12401215 } finally {
12411216 LEAVING("73cdgjl47ohty2va766evbo4","keepout_othernodes");
12421217 }
12471222
12481223 //3 c734mx1638sfqtl7vh7itaxyx
12491224 // static void contain_subclust(graph_t * g)
1250 public static void contain_subclust(Agraph_s g) {
1225 public static void contain_subclust(ST_Agraph_s g) {
12511226 ENTERING("c734mx1638sfqtl7vh7itaxyx","contain_subclust");
12521227 try {
12531228 int margin, c;
1254 Agraph_s subg;
1229 ST_Agraph_s subg;
12551230 margin = late_int (g, Z.z().G_margin, 8, 0);
12561231 make_lrvn(g);
12571232 for (c = 1; c <= GD_n_cluster(g); c++) {
1258 subg = (Agraph_s) GD_clust(g).plus(c).getPtr();
1233 subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
12591234 make_lrvn(subg);
12601235 make_aux_edge(GD_ln(g), GD_ln(subg),
1261 margin + GD_border(g).plus(3).getStruct().getDouble("x"), 0);
1236 margin + GD_border(g)[3].x, 0);
12621237 make_aux_edge(GD_rn(subg), GD_rn(g),
1263 margin + GD_border(g).plus(1).getStruct().getDouble("x"), 0);
1238 margin + GD_border(g)[1].x, 0);
12641239 contain_subclust(subg);
12651240 }
12661241 } finally {
12731248
12741249 //3 6oruu1p1b7kxr5moh3kmcmvr3
12751250 // static void separate_subclust(graph_t * g)
1276 public static void separate_subclust(Agraph_s g) {
1251 public static void separate_subclust(ST_Agraph_s g) {
12771252 ENTERING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
12781253 try {
12791254 int i, j, margin;
1280 Agraph_s low, high;
1281 Agraph_s left, right;
1255 ST_Agraph_s low, high;
1256 ST_Agraph_s left, right;
12821257 margin = late_int (g, Z.z().G_margin, 8, 0);
12831258 for (i = 1; i <= GD_n_cluster(g); i++)
1284 make_lrvn((Agraph_s) GD_clust(g).plus(i).getPtr());
1259 make_lrvn((ST_Agraph_s) GD_clust(g).get(i).getPtr());
12851260 for (i = 1; i <= GD_n_cluster(g); i++) {
12861261 for (j = i + 1; j <= GD_n_cluster(g); j++) {
1287 low = (Agraph_s) GD_clust(g).plus(i).getPtr();
1288 high = (Agraph_s) GD_clust(g).plus(j).getPtr();
1262 low = (ST_Agraph_s) GD_clust(g).get(i).getPtr();
1263 high = (ST_Agraph_s) GD_clust(g).get(j).getPtr();
12891264 if (GD_minrank(low) > GD_minrank(high)) {
1290 Agraph_s temp = low;
1265 ST_Agraph_s temp = low;
12911266 low = high;
12921267 high = temp;
12931268 }
12941269 if (GD_maxrank(low) < GD_minrank(high))
12951270 continue;
1296 if (ND_order(GD_rank(low).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())
1297 < ND_order(GD_rank(high).plus(GD_minrank(high)).getPtr("v").plus(0).getPtr())) {
1271 if (ND_order(GD_rank(low).get(GD_minrank(high)).v.get(0))
1272 < ND_order(GD_rank(high).get(GD_minrank(high)).v.get(0))) {
12981273 left = low;
12991274 right = high;
13001275 } else {
13031278 }
13041279 make_aux_edge(GD_rn(left), GD_ln(right), margin, 0);
13051280 }
1306 separate_subclust((Agraph_s) GD_clust(g).plus(i).getPtr());
1281 separate_subclust((ST_Agraph_s) GD_clust(g).get(i).getPtr());
13071282 }
13081283 } finally {
13091284 LEAVING("6oruu1p1b7kxr5moh3kmcmvr3","separate_subclust");
13151290
13161291 //3 8f8gs2zivo4pnd3hmtb9g23x4
13171292 // static void pos_clusters(graph_t * g)
1318 public static void pos_clusters(Agraph_s g) {
1293 public static void pos_clusters(ST_Agraph_s g) {
13191294 ENTERING("8f8gs2zivo4pnd3hmtb9g23x4","pos_clusters");
13201295 try {
13211296 if (GD_n_cluster(g) > 0) {
13341309
13351310 //3 fywsxto7yvl5wa2dfu7u7jj1
13361311 // static void compress_graph(graph_t * g)
1337 public static void compress_graph(Agraph_s g) {
1312 public static void compress_graph(ST_Agraph_s g) {
13381313 ENTERING("fywsxto7yvl5wa2dfu7u7jj1","compress_graph");
13391314 try {
13401315 double x;
1341 pointf p = (pointf) Memory.malloc(pointf.class);
1342 if (GD_drawing(g).getInt("ratio_kind") != enumAsInt(ratio_t.class, "R_COMPRESS"))
1316 ST_pointf p = new ST_pointf();
1317 if (GD_drawing(g).ratio_kind != enumAsInt(ratio_t.class, "R_COMPRESS"))
13431318 return;
13441319 UNSUPPORTED("79oeaf0u32si2chjcpas5whjl"); // p = GD_drawing(g)->size;
13451320 UNSUPPORTED("6a2ue1i6kvwvpgapb4z8l27jn"); // if (p.x * p.y <= 1)
13681343
13691344 //3 b7y0htx4svbhaqb1a12dihlue
13701345 // static void create_aux_edges(graph_t * g)
1371 public static void create_aux_edges(Agraph_s g) {
1346 public static void create_aux_edges(ST_Agraph_s g) {
13721347 ENTERING("b7y0htx4svbhaqb1a12dihlue","create_aux_edges");
13731348 try {
13741349 allocate_aux_edges(g);
13861361
13871362 //3 euzeilq92ry8a4tcrij5s52t5
13881363 // static void remove_aux_edges(graph_t * g)
1389 public static void remove_aux_edges(Agraph_s g) {
1364 public static void remove_aux_edges(ST_Agraph_s g) {
13901365 ENTERING("euzeilq92ry8a4tcrij5s52t5","remove_aux_edges");
13911366 try {
13921367 int i;
1393 Agnode_s n, nnext, nprev;
1394 Agedge_s e;
1368 ST_Agnode_s n, nnext, nprev;
1369 ST_Agedge_s e;
13951370 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
1396 for (i = 0; (e = (Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
1397 Memory.free(e.getStruct("base").getPtr("data"));
1371 for (i = 0; (e = (ST_Agedge_s) ND_out(n).getFromList(i))!=null; i++) {
1372 Memory.free(e.base.data);
13981373 Memory.free(e);
13991374 }
14001375 free_list(ND_out(n));
14111386 ND_next(nprev, nnext);
14121387 else
14131388 GD_nlist(g, nnext);
1414 Memory.free(n.getStruct("base").getPtr("data"));
1389 Memory.free(n.base.data);
14151390 Memory.free(n);
14161391 } else
14171392 nprev = n;
14271402
14281403 //3 1oobmglea9t819y95xeel37h8
14291404 // static void set_xcoords(graph_t * g)
1430 public static void set_xcoords(Agraph_s g) {
1405 public static void set_xcoords(ST_Agraph_s g) {
14311406 ENTERING("1oobmglea9t819y95xeel37h8","set_xcoords");
14321407 try {
14331408 int i, j;
1434 Agnode_s v;
1435 __ptr__ rank = GD_rank(g);
1409 ST_Agnode_s v;
1410 ST_rank_t.Array2 rank = GD_rank(g);
14361411 for (i = GD_minrank(g); i <= GD_maxrank(g); i++) {
1437 for (j = 0; j < rank.plus(i).getInt("n"); j++) {
1438 v = (Agnode_s) rank.plus(i).getArrayOfPtr("v").plus(j).getPtr();
1412 for (j = 0; j < rank.get(i).n; j++) {
1413 v = (ST_Agnode_s) rank.get(i).v.get(j);
14391414 ND_coord(v).x = ND_rank(v);
14401415 ND_rank(v, i);
14411416 }
15371512
15381513 //3 emtrqv582hdma5aajqtjd76m1
15391514 // static int clust_ht(Agraph_t * g)
1540 public static int clust_ht(Agraph_s g) {
1515 public static int clust_ht(ST_Agraph_s g) {
15411516 ENTERING("emtrqv582hdma5aajqtjd76m1","clust_ht");
15421517 try {
15431518 int c;
15441519 double ht1, ht2;
1545 Agraph_s subg;
1546 __ptr__ rank = GD_rank(dot_root(g));
1520 ST_Agraph_s subg;
1521 ST_rank_t.Array2 rank = GD_rank(dot_root(g));
15471522 int margin, haveClustLabel = 0;
15481523 if (EQ(g, dot_root(g)))
15491524 margin = 8;
15531528 ht2 = GD_ht2(g);
15541529 /* account for sub-clusters */
15551530 for (c = 1; c <= GD_n_cluster(g); c++) {
1556 subg = (Agraph_s) GD_clust(g).plus(c).getPtr();
1531 subg = (ST_Agraph_s) GD_clust(g).get(c).getPtr();
15571532 haveClustLabel |= clust_ht(subg);
15581533 if (GD_maxrank(subg) == GD_maxrank(g))
15591534 ht1 = MAX(ht1, GD_ht1(subg) + margin);
15651540 if (NEQ(g, dot_root(g)) && GD_label(g)!=null) {
15661541 haveClustLabel = 1;
15671542 if (N(GD_flip(agroot(g)))) {
1568 ht1 += GD_border(g).plus(0).getDouble("y");
1569 ht2 += GD_border(g).plus(2).getDouble("y");
1543 ht1 += GD_border(g)[0].y;
1544 ht2 += GD_border(g)[2].y;
15701545 }
15711546 }
15721547 GD_ht1(g, ht1);
15731548 GD_ht2(g, ht2);
15741549 /* update the global ranks */
15751550 if (NEQ(g, dot_root(g))) {
1576 rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.plus(GD_minrank(g)).getDouble("ht2"), ht2));
1577 rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.plus(GD_maxrank(g)).getDouble("ht1"), ht1));
1551 rank.plus(GD_minrank(g)).setDouble("ht2", MAX(rank.get(GD_minrank(g)).ht2, ht2));
1552 rank.plus(GD_maxrank(g)).setDouble("ht1", MAX(rank.get(GD_maxrank(g)).ht1, ht1));
15781553 }
15791554 return haveClustLabel;
15801555 } finally {
15871562
15881563 //3 bp8vmol4ncadervcfossysdtd
15891564 // static void set_ycoords(graph_t * g)
1590 public static void set_ycoords(Agraph_s g) {
1565 public static void set_ycoords(ST_Agraph_s g) {
15911566 ENTERING("bp8vmol4ncadervcfossysdtd","set_ycoords");
15921567 try {
15931568 int i, j, r;
15941569 double ht2, maxht, delta, d0, d1;
1595 Agnode_s n;
1596 Agedge_s e;
1597 __ptr__ rank = GD_rank(g);
1598 Agraph_s clust;
1570 ST_Agnode_s n;
1571 ST_Agedge_s e;
1572 ST_rank_t.Array2 rank = GD_rank(g);
1573 ST_Agraph_s clust;
15991574 int lbl;
16001575 ht2 = maxht = 0;
16011576 /* scan ranks for tallest nodes. */
16021577 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1603 for (i = 0; i < rank.plus(r).getInt("n"); i++) {
1604 n = (Agnode_s) rank.plus(r).getArrayOfPtr("v").plus(i).getPtr();
1578 for (i = 0; i < rank.get(r).n; i++) {
1579 n = (ST_Agnode_s) rank.get(r).v.get(i);
16051580 /* assumes symmetry, ht1 = ht2 */
16061581 ht2 = ND_ht(n) / 2;
16071582 /* have to look for high self-edge labels, too */
16081583 if (ND_other(n).listNotNull())
1609 for (j = 0; (e = (Agedge_s) ND_other(n).getFromList(j))!=null; j++) {
1584 for (j = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(j))!=null; j++) {
16101585 if (EQ(agtail(e), aghead(e))) {
16111586 if (ED_label(e)!=null)
1612 ht2 = MAX(ht2, ED_label(e).getStruct("dimen").getDouble("y") / 2);
1587 ht2 = MAX(ht2, ED_label(e).dimen.y / 2);
16131588 }
16141589 }
16151590 /* update global rank ht */
1616 if (rank.plus(r).getDouble("pht2") < ht2) {
1591 if (rank.get(r).pht2 < ht2) {
16171592 rank.plus(r).setDouble("ht2", ht2);
16181593 rank.plus(r).setDouble("pht2", ht2);
16191594 }
1620 if (rank.plus(r).getDouble("pht1") < ht2) {
1595 if (rank.get(r).pht1 < ht2) {
16211596 rank.plus(r).setDouble("ht1", ht2);
16221597 rank.plus(r).setDouble("pht1", ht2);
16231598 }
16361611 /* make the initial assignment of ycoords to leftmost nodes by ranks */
16371612 maxht = 0;
16381613 r = GD_maxrank(g);
1639 (ND_coord(rank.plus(r).getArrayOfPtr("v").plus(0).getPtr())).setDouble("y", rank.plus(r).getDouble("ht1"));
1614 (ND_coord(rank.get(r).v.get(0))).setDouble("y", rank.get(r).ht1);
16401615 while (--r >= GD_minrank(g)) {
1641 d0 = rank.plus(r + 1).getDouble("pht2") + rank.plus(r).getDouble("pht1") + GD_ranksep(g); /* prim node sep */
1642 d1 = rank.plus(r + 1).getDouble("ht2") + rank.plus(r).getDouble("ht1") + 8; /* cluster sep */
1616 d0 = rank.get(r + 1).pht2 + rank.get(r).pht1 + GD_ranksep(g); /* prim node sep */
1617 d1 = rank.get(r + 1).ht2 + rank.get(r).ht1 + 8; /* cluster sep */
16431618 delta = MAX(d0, d1);
1644 if (rank.plus(r).getInt("n") > 0) /* this may reflect some problem */
1645 (ND_coord(rank.plus(r).getArrayOfPtr("v").plus(0).getPtr())).setDouble("y", (ND_coord(rank.plus(r + 1).getArrayOfPtr("v").plus(0).getPtr())).getDouble("y") + delta);
1619 if (rank.get(r).n > 0) /* this may reflect some problem */
1620 (ND_coord(rank.get(r).v.get(0))).setDouble("y", (ND_coord(rank.plus(r + 1).getPtr().v.get(0))).y + delta);
16461621 maxht = MAX(maxht, delta);
16471622 }
16481623 /* If there are cluster labels and the drawing is rotated, we need special processing to
16731648 }
16741649 /* copy ycoord assignment from leftmost nodes to others */
16751650 for (n = GD_nlist(g); n!=null; n = ND_next(n))
1676 ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y");
1651 ND_coord(n).y = ND_coord(rank.plus(ND_rank(n)).getPtr().v.get(0)).y;
16771652 } finally {
16781653 LEAVING("bp8vmol4ncadervcfossysdtd","set_ycoords");
16791654 }
16841659
16851660 //3 9ay2xnnmh407i32pfokujfda5
16861661 //static void dot_compute_bb(graph_t * g, graph_t * root)
1687 public static void dot_compute_bb(Agraph_s g, Agraph_s root) {
1662 public static void dot_compute_bb(ST_Agraph_s g, ST_Agraph_s root) {
16881663 ENTERING("9ay2xnnmh407i32pfokujfda5","dot_compute_bb");
16891664 try {
16901665 int r, c;
16911666 double x, offset;
1692 Agnode_s v;
1667 ST_Agnode_s v;
16931668 final ST_pointf LL = new ST_pointf();
16941669 final ST_pointf UR = new ST_pointf();
16951670 if (EQ(g, dot_root(g))) {
16961671 LL.x = INT_MAX;
16971672 UR.x = -((double)INT_MAX);
16981673 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
1699 int rnkn = GD_rank(g).plus(r).getInt("n");
1674 int rnkn = GD_rank(g).get(r).n;
17001675 if (rnkn == 0)
17011676 continue;
1702 if ((v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr()) == null)
1677 if ((v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0)) == null)
17031678 continue;
17041679 for (c = 1; (ND_node_type(v) != 0) && c < rnkn; c++)
1705 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(c).getPtr();
1680 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
17061681 if (ND_node_type(v) == 0) {
1707 x = ND_coord(v).getDouble("x") - ND_lw(v);
1708 LL.setDouble("x", MIN(LL.getDouble("x"), x));
1682 x = ND_coord(v).x - ND_lw(v);
1683 LL.setDouble("x", MIN(LL.x, x));
17091684 }
17101685 else continue;
17111686 /* At this point, we know the rank contains a NORMAL node */
1712 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(rnkn - 1).getPtr();
1687 v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(rnkn - 1).getPtr();
17131688 for (c = rnkn-2; ND_node_type(v) != 0; c--)
1714 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(c).getPtr();
1715 x = ND_coord(v).getDouble("x") + ND_rw(v);
1716 UR.x = MAX(UR.getDouble("x"), x);
1689 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(c);
1690 x = ND_coord(v).x + ND_rw(v);
1691 UR.x = MAX(UR.x, x);
17171692 }
17181693 offset = 8;
17191694 for (c = 1; c <= GD_n_cluster(g); c++) {
17201695 x = (double)(GD_bb(GD_clust(g).plus(c)).LL.x - offset);
1721 LL.x = MIN(LL.getDouble("x"), x);
1696 LL.x = MIN(LL.x, x);
17221697 x = (double)(GD_bb(GD_clust(g).plus(c)).UR.x + offset);
1723 UR.x = MAX(UR.getDouble("x"), x);
1698 UR.x = MAX(UR.x, x);
17241699 }
17251700 } else {
17261701 LL.x = (double)(ND_rank(GD_ln(g)));
17271702 UR.x = (double)(ND_rank(GD_rn(g)));
17281703 }
1729 LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") - GD_ht1(g);
1730 UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getArrayOfPtr("v").plus(0).getPtr()).getDouble("y") + GD_ht2(g);
1704 LL.y = ND_coord(GD_rank(root).plus(GD_maxrank(g)).getPtr().v.get(0)).y - GD_ht1(g);
1705 UR.y = ND_coord(GD_rank(root).plus(GD_minrank(g)).getPtr().v.get(0)).y + GD_ht2(g);
17311706 GD_bb(g).setStruct("LL", LL);
17321707 GD_bb(g).setStruct("UR", UR);
17331708 } finally {
17411716
17421717 //3 dlbpiimh9g9ff9w7wjoabf817
17431718 // static void rec_bb(graph_t * g, graph_t * root)
1744 public static void rec_bb(Agraph_s g, Agraph_s root) {
1719 public static void rec_bb(ST_Agraph_s g, ST_Agraph_s root) {
17451720 ENTERING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
17461721 try {
17471722 int c;
17481723 for (c = 1; c <= GD_n_cluster(g); c++)
1749 rec_bb((Agraph_s) GD_clust(g).plus(c).getPtr(), root);
1724 rec_bb((ST_Agraph_s) GD_clust(g).get(c).getPtr(), root);
17501725 dot_compute_bb(g, root);
17511726 } finally {
17521727 LEAVING("dlbpiimh9g9ff9w7wjoabf817","rec_bb");
18091784
18101785 //3 7effq6z6ur101wrch6ttozr26
18111786 // static void set_aspect(graph_t * g, aspect_t* asp)
1812 public static void set_aspect(Agraph_s g, aspect_t asp) {
1787 public static void set_aspect(ST_Agraph_s g, ST_aspect_t asp) {
18131788 ENTERING("7effq6z6ur101wrch6ttozr26","set_aspect");
18141789 try {
18151790 double xf = 0.0, yf = 0.0, actual, desired;
1816 Agnode_s n;
1791 ST_Agnode_s n;
18171792 boolean scale_it, filled;
1818 point sz = (point) Memory.malloc(point.class);
1793 ST_point sz = new ST_point();
18191794 rec_bb(g, g);
1820 if ((GD_maxrank(g) > 0) && (GD_drawing(g).getInt("ratio_kind")!=0)) {
1795 if ((GD_maxrank(g) > 0) && (GD_drawing(g).ratio_kind!=0)) {
18211796 UNSUPPORTED("5wbmy4x78flo2ztfabki9lyjf"); // sz.x = GD_bb(g).UR.x - GD_bb(g).LL.x;
18221797 UNSUPPORTED("catd6eu5oc282ln95k9zz52f3"); // sz.y = GD_bb(g).UR.y - GD_bb(g).LL.y; /* normalize */
18231798 UNSUPPORTED("21zvq2qx1j34j1i1879zyhzpj"); // if (GD_flip(g)) {
19371912
19381913 //3 1lejhh3evsa10auyj7cgqj8ub
19391914 // static void make_leafslots(graph_t * g)
1940 public static void make_leafslots(Agraph_s g) {
1915 public static void make_leafslots(ST_Agraph_s g) {
19411916 ENTERING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
19421917 try {
19431918 int i, j, r;
1944 Agnode_s v;
1919 ST_Agnode_s v;
19451920 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
19461921 j = 0;
1947 for (i = 0; i < GD_rank(g).plus(r).getInt("n"); i++) {
1948 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1922 for (i = 0; i < GD_rank(g).get(r).n; i++) {
1923 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
19491924 ND_order(v, j);
19501925 if (ND_ranktype(v) == 6)
19511926 j = j + ND_UF_size(v);
19521927 else
19531928 j++;
19541929 }
1955 if (j <= GD_rank(g).plus(r).getInt("n"))
1930 if (j <= GD_rank(g).get(r).n)
19561931 continue;
1957 GD_rank(g).plus(r).setPtr("v", ALLOC_empty(j + 1, GD_rank(g).plus(r).getPtr("v"), Agnode_s.class));
1958 for (i = GD_rank(g).plus(r).getInt("n") - 1; i >= 0; i--) {
1959 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(i).getPtr();
1960 GD_rank(g).plus(r).getArrayOfPtr("v").plus(ND_order(v)).setPtr(v);
1932 GD_rank(g).plus(r).setPtr("v", ALLOC_allocated_ST_Agnode_s((ST_Agnode_s.ArrayOfStar) GD_rank(g).get(r).v, j + 1));
1933 for (i = GD_rank(g).get(r).n - 1; i >= 0; i--) {
1934 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(i);
1935 GD_rank(g).get(r).v.plus(ND_order(v)).setPtr(v);
19611936 }
19621937 GD_rank(g).plus(r).setInt("n", j);
1963 GD_rank(g).plus(r).getArrayOfPtr("v").plus(j).setPtr(null);
1938 GD_rank(g).get(r).v.plus(j).setPtr(null);
19641939 }
19651940 } finally {
19661941 LEAVING("1lejhh3evsa10auyj7cgqj8ub","make_leafslots");
20161991
20171992 //3 alpljm8o6nsam95ly6leelnbp
20181993 // int ports_eq(edge_t * e, edge_t * f)
2019 public static boolean ports_eq(Agedge_s e, Agedge_s f) {
1994 public static boolean ports_eq(ST_Agedge_s e, ST_Agedge_s f) {
20201995 ENTERING("alpljm8o6nsam95ly6leelnbp","ports_eq");
20211996 try {
20221997 return ((ED_head_port(e).defined == ED_head_port(f).defined)
20372012
20382013 //3 cfotmdif5xv7n6oauyvzv0qwa
20392014 // static void expand_leaves(graph_t * g)
2040 public static void expand_leaves(Agraph_s g) {
2015 public static void expand_leaves(ST_Agraph_s g) {
20412016 ENTERING("cfotmdif5xv7n6oauyvzv0qwa","expand_leaves");
20422017 try {
20432018 int i, d;
2044 Agnode_s n;
2045 Agedge_s e, f;
2019 ST_Agnode_s n;
2020 ST_Agedge_s e, f;
20462021 make_leafslots(g);
20472022 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
20482023 if (ND_inleaf(n)!=null)
20502025 if (ND_outleaf(n)!=null)
20512026 do_leaves(g, ND_outleaf(n));
20522027 if (ND_other(n).listNotNull())
2053 for (i = 0; (e = (Agedge_s) ND_other(n).getFromList(i))!=null; i++) {
2028 for (i = 0; (e = (ST_Agedge_s) ND_other(n).getFromList(i))!=null; i++) {
20542029 if ((d = ND_rank(aghead(e)) - ND_rank(aghead(e))) == 0)
20552030 continue;
20562031 f = ED_to_orig(e);
20572032 if (ports_eq(e, f) == false) {
2058 zapinlist(ND_other(n).amp(), e);
2033 zapinlist(ND_other(n), e);
20592034 if (d == 1)
20602035 fast_edge(e);
20612036 /*else unitize(e); ### */
20732048
20742049 //3 d4b57ugpwxy567pfmxn14ed8d
20752050 // static void make_lrvn(graph_t * g)
2076 public static void make_lrvn(Agraph_s g) {
2051 public static void make_lrvn(ST_Agraph_s g) {
20772052 ENTERING("d4b57ugpwxy567pfmxn14ed8d","make_lrvn");
20782053 try {
2079 Agnode_s ln, rn;
2054 ST_Agnode_s ln, rn;
20802055 if (GD_ln(g)!=null)
20812056 return;
20822057 ln = virtual_node(dot_root(g));
20842059 rn = virtual_node(dot_root(g));
20852060 ND_node_type(rn, 2);
20862061 if (GD_label(g)!=null && NEQ(g, dot_root(g)) && N(GD_flip(agroot(g)))) {
2087 int w = MAX((int)GD_border(g).plus(0).getDouble("x"), (int)GD_border(g).plus(2).getDouble("x"));
2062 int w = MAX((int)GD_border(g)[0].x, (int)GD_border(g)[2].x);
20882063 make_aux_edge(ln, rn, w, 0);
20892064 }
20902065 GD_ln(g, ln);
20992074
21002075 //3 daz786541idcxnywckcbncazb
21012076 // static void contain_nodes(graph_t * g)
2102 public static void contain_nodes(Agraph_s g) {
2077 public static void contain_nodes(ST_Agraph_s g) {
21032078 ENTERING("daz786541idcxnywckcbncazb","contain_nodes");
21042079 try {
21052080 int margin, r;
2106 Agnode_s ln, rn, v;
2081 ST_Agnode_s ln, rn, v;
21072082 margin = late_int (g, Z.z().G_margin, 8, 0);
21082083 make_lrvn(g);
21092084 ln = GD_ln(g);
21102085 rn = GD_rn(g);
21112086 for (r = GD_minrank(g); r <= GD_maxrank(g); r++) {
2112 if (GD_rank(g).plus(r).getInt("n") == 0)
2087 if (GD_rank(g).get(r).n == 0)
21132088 continue;
2114 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(0).getPtr();
2089 v = (ST_Agnode_s) GD_rank(g).get(r).v.get(0);
21152090 if (v == null) {
21162091 UNSUPPORTED("1f2esoodtcrdhljk1cq1klyao"); // agerr(AGERR, "contain_nodes clust %s rank %d missing node\n",
21172092 UNSUPPORTED("7w6lv4ywtczwz2y1mg0p3jdav"); // agnameof(g), r);
21182093 UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
21192094 }
21202095 make_aux_edge(ln, v,
2121 ND_lw(v) + margin + GD_border(g).plus(3).getStruct().getDouble("x"), 0);
2122 v = (Agnode_s) GD_rank(g).plus(r).getArrayOfPtr("v").plus(GD_rank(g).plus(r).getInt("n") - 1).getPtr();
2096 ND_lw(v) + margin + GD_border(g)[3].x, 0);
2097 v = (ST_Agnode_s) GD_rank(g).get(r).v.plus(GD_rank(g).get(r).n - 1).getPtr();
21232098 make_aux_edge(v, rn,
2124 ND_rw(v) + margin + GD_border(g).plus(1).getStruct().getDouble("x"), 0);
2099 ND_rw(v) + margin + GD_border(g)[1].x, 0);
21252100 }
21262101 } finally {
21272102 LEAVING("daz786541idcxnywckcbncazb","contain_nodes");
100100 import static smetana.core.Macro.ND_rank;
101101 import static smetana.core.Macro.ND_ranktype;
102102 import static smetana.core.Macro.UNSUPPORTED;
103 import static smetana.core.Macro.ZALLOC;
104 import h.Agedge_s;
105 import h.Agnode_s;
106 import h.Agraph_s;
107 import h.aspect_t;
108 import h.boxf;
109 import h.elist;
110 import h.point;
111 import h.pointf;
103 import static smetana.core.Macro.ZALLOC_ST_Agraph_s;
104 import h.ST_Agedge_s;
105 import h.ST_Agnode_s;
106 import h.ST_Agraph_s;
107 import h.ST_aspect_t;
108 import h.ST_elist;
109 import h.ST_point;
110 import h.ST_pointf;
112111 import smetana.core.CString;
113 import smetana.core.JUtils;
114112 import smetana.core.Memory;
115113 import smetana.core.Z;
116 import smetana.core.__struct__;
117114
118115 public class rank__c {
119116 //1 2digov3edok6d5srhgtlmrycs
373370
374371 //3 c1s4k85p1cdfn176o3uryeros
375372 // static inline pointf pointfof(double x, double y)
376 public static __struct__<pointf> pointfof(double x, double y) {
373 public static ST_pointf pointfof(double x, double y) {
377374 // WARNING!! STRUCT
378375 return pointfof_w_(x, y).copy();
379376 }
380 private static __struct__<pointf> pointfof_w_(double x, double y) {
377 private static ST_pointf pointfof_w_(double x, double y) {
381378 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
382379 try {
383 final __struct__<pointf> r = JUtils.from(pointf.class);
380 final ST_pointf r = new ST_pointf();
384381 r.setDouble("x", x);
385382 r.setDouble("y", y);
386383 return r;
409406
410407
411408
412 //3 1vvsta5i8of59frav6uymguav
413 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
414 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
415 // WARNING!! STRUCT
416 return boxfof_w_(llx, lly, urx, ury).copy();
417 }
418 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
419 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
420 try {
421 final __struct__<boxf> b = JUtils.from(boxf.class);
422 b.getStruct("LL").setDouble("x", llx);
423 b.getStruct("LL").setDouble("y", lly);
424 b.getStruct("UR").setDouble("x", urx);
425 b.getStruct("UR").setDouble("y", ury);
426 return b;
427 } finally {
428 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
429 }
430 }
431409
432410
433411
451429
452430 //3 arrsbik9b5tnfcbzsm8gr2chx
453431 // static inline pointf add_pointf(pointf p, pointf q)
454 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
432 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
455433 // WARNING!! STRUCT
456434 return add_pointf_w_(p.copy(), q.copy()).copy();
457435 }
458 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
436 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
459437 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
460438 try {
461 final __struct__<pointf> r = JUtils.from(pointf.class);
462 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
463 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
439 final ST_pointf r = new ST_pointf();
440 r.setDouble("x", p.x + q.x);
441 r.setDouble("y", p.y + q.y);
464442 return r;
465443 } finally {
466444 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
757735
758736 //3 3f1re3nfkhxwjjb90kppwuupr
759737 // static void renewlist(elist * L)
760 public static void renewlist(elist L) {
738 public static void renewlist(ST_elist L) {
761739 ENTERING("3f1re3nfkhxwjjb90kppwuupr","renewlist");
762740 try {
763741 int i;
764 for (i = L.getInt("size"); i >= 0; i--)
765 L.getArrayOfPtr("list").plus(i).setPtr(null);
766 L.setInt("size", 0);
742 for (i = L.size; i >= 0; i--)
743 L.list.set(i, null);
744 L.size = 0;
767745 } finally {
768746 LEAVING("3f1re3nfkhxwjjb90kppwuupr","renewlist");
769747 }
774752
775753 //3 1xov2qhuxj1f9nbzu3xsa6679
776754 // static void cleanup1(graph_t * g)
777 public static void cleanup1(Agraph_s g) {
755 public static void cleanup1(ST_Agraph_s g) {
778756 ENTERING("1xov2qhuxj1f9nbzu3xsa6679","cleanup1");
779757 try {
780 Agnode_s n;
781 Agedge_s e, f;
758 ST_Agnode_s n;
759 ST_Agedge_s e, f;
782760 int c;
783761 for (c = 0; c < GD_comp(g).size; c++) {
784762 GD_nlist(g, GD_comp(g).getFromList(c));
785763 for (n = GD_nlist(g); n!=null; n = ND_next(n)) {
786 renewlist(ND_in(n).amp());
787 renewlist(ND_out(n).amp());
764 renewlist(ND_in(n));
765 renewlist(ND_out(n));
788766 ND_mark(n, 0);
789767 }
790768 }
796774 * share a virtual edge.
797775 */
798776 if (f!=null && (EQ(e, ED_to_orig(f)))) {
799 Agedge_s e1, f1;
800 Agnode_s n1;
777 ST_Agedge_s e1, f1;
778 ST_Agnode_s n1;
801779 for (n1 = agfstnode(g); n1!=null; n1 = agnxtnode(g, n1)) {
802780 for (e1 = agfstout(g, n1); e1!=null; e1 = agnxtout(g, e1)) {
803781 if (NEQ(e, e1)) {
808786 }
809787 }
810788 }
811 Memory.free(f.getStruct("base").getPtr("data"));
789 Memory.free(f.base.data);
812790 Memory.free(f);
813791 }
814792 ED_to_virt(e, null);
826804
827805 //3 bxjf5g7g953ii1hfodl1j0y4u
828806 // static void edgelabel_ranks(graph_t * g)
829 public static void edgelabel_ranks(Agraph_s g) {
807 public static void edgelabel_ranks(ST_Agraph_s g) {
830808 ENTERING("bxjf5g7g953ii1hfodl1j0y4u","edgelabel_ranks");
831809 try {
832 Agnode_s n;
833 Agedge_s e;
810 ST_Agnode_s n;
811 ST_Agedge_s e;
834812 if ((GD_has_labels(g) & (1 << 0))!=0) {
835813 for (n = agfstnode(g); n!=null; n = agnxtnode(g, n))
836814 for (e = agfstout(g, n); e!=null; e = agnxtout(g, e))
894872
895873 //3 65qi5f0bxp6d6vahhlcolpk88
896874 // static int rank_set_class(graph_t * g)
897 public static int rank_set_class(Agraph_s g) {
875 public static int rank_set_class(ST_Agraph_s g) {
898876 ENTERING("65qi5f0bxp6d6vahhlcolpk88","rank_set_class");
899877 try {
900878 CString name[] = new CString[] { new CString("same"), new CString("min"), new CString("source"), new CString("max"), new CString("sink"), null };
915893
916894 //3 5189iviqj57iztftckz86y6jj
917895 // static int make_new_cluster(graph_t * g, graph_t * subg)
918 public static int make_new_cluster(Agraph_s g, Agraph_s subg) {
896 public static int make_new_cluster(ST_Agraph_s g, ST_Agraph_s subg) {
919897 ENTERING("5189iviqj57iztftckz86y6jj","make_new_cluster");
920898 try {
921899 int cno;
922900 GD_n_cluster(g, GD_n_cluster(g)+1);
923901 cno = GD_n_cluster(g);
924 GD_clust(g, ZALLOC(cno + 1, GD_clust(g), Agraph_s.class, GD_n_cluster(g)));
902 GD_clust(g, ZALLOC_ST_Agraph_s((ST_Agraph_s.Array) GD_clust(g), cno + 1));
925903 GD_clust(g).plus(cno).setPtr(subg);
926904 do_graph_label(subg);
927905 return cno;
935913
936914 //3 9lvm2ufqjzl2bsbpo0zg9go58
937915 // static void node_induce(graph_t * par, graph_t * g)
938 public static void node_induce(Agraph_s par, Agraph_s g) {
916 public static void node_induce(ST_Agraph_s par, ST_Agraph_s g) {
939917 ENTERING("9lvm2ufqjzl2bsbpo0zg9go58","node_induce");
940918 try {
941 Agnode_s n, nn;
942 Agedge_s e;
919 ST_Agnode_s n, nn;
920 ST_Agedge_s e;
943921 int i;
944922 LOG2("node_induce");
945923 /* enforce that a node is in at most one cluster at this level */
950928 continue;
951929 }
952930 for (i = 1; i < GD_n_cluster(par); i++)
953 if (agcontains((Agraph_s) GD_clust(par).plus(i).getPtr(), n))
931 if (agcontains((ST_Agraph_s) GD_clust(par).get(i).getPtr(), n))
954932 break;
955933 if (i < GD_n_cluster(par))
956934 agdelete(g, n);
1002980
1003981 //3 2rbs5deyvlh5s7lkhv6zouqbe
1004982 // static void cluster_leader(graph_t * clust)
1005 public static void cluster_leader(Agraph_s clust) {
983 public static void cluster_leader(ST_Agraph_s clust) {
1006984 ENTERING("2rbs5deyvlh5s7lkhv6zouqbe","cluster_leader");
1007985 try {
1008 Agnode_s leader, n;
986 ST_Agnode_s leader, n;
1009987 int maxrank = 0;
1010988 /* find number of ranks and select a leader */
1011989 leader = null;
10321010
10331011 //3 f3sl627dqmre3kru883bpdxc3
10341012 // static void collapse_cluster(graph_t * g, graph_t * subg)
1035 public static void collapse_cluster(Agraph_s g, Agraph_s subg) {
1013 public static void collapse_cluster(ST_Agraph_s g, ST_Agraph_s subg) {
10361014 ENTERING("f3sl627dqmre3kru883bpdxc3","collapse_cluster");
10371015 try {
10381016 if (GD_parent(subg)!=null) {
10581036
10591037 //3 din4qnipewrwnelaimzvlplft
10601038 // static void collapse_sets(graph_t *rg, graph_t *g)
1061 public static void collapse_sets(Agraph_s rg, Agraph_s g) {
1039 public static void collapse_sets(ST_Agraph_s rg, ST_Agraph_s g) {
10621040 ENTERING("din4qnipewrwnelaimzvlplft","collapse_sets");
10631041 try {
10641042 int c;
1065 Agraph_s subg;
1043 ST_Agraph_s subg;
10661044 for (subg = agfstsubg(g); subg!=null; subg = agnxtsubg(subg)) {
10671045 c = rank_set_class(subg);
10681046 if (c!=0) {
11021080
11031081 //3 12fw0esv4unfin6waf9mknc1o
11041082 // static void set_minmax(graph_t * g)
1105 public static void set_minmax(Agraph_s g) {
1083 public static void set_minmax(ST_Agraph_s g) {
11061084 ENTERING("12fw0esv4unfin6waf9mknc1o","set_minmax");
11071085 try {
11081086 int c;
11091087 GD_minrank(g, GD_minrank(g) + ND_rank(GD_leader(g)));
11101088 GD_maxrank(g, GD_maxrank(g) + ND_rank(GD_leader(g)));
11111089 for (c = 1; c <= GD_n_cluster(g); c++)
1112 set_minmax((Agraph_s) GD_clust(g).plus(c).getPtr());
1090 set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
11131091 } finally {
11141092 LEAVING("12fw0esv4unfin6waf9mknc1o","set_minmax");
11151093 }
11201098
11211099 //3 3bcr1748gqnu8ogb73jeja7ly
11221100 // static point minmax_edges(graph_t * g)
1123 public static __struct__<point> minmax_edges(Agraph_s g) {
1101 public static ST_point minmax_edges(ST_Agraph_s g) {
11241102 // WARNING!! STRUCT
1125 return minmax_edges_w_(g).copy();
1126 }
1127 private static __struct__<point> minmax_edges_w_(Agraph_s g) {
1103 return (ST_point) minmax_edges_w_(g).copy();
1104 }
1105 private static ST_point minmax_edges_w_(ST_Agraph_s g) {
11281106 ENTERING("3bcr1748gqnu8ogb73jeja7ly","minmax_edges");
11291107 try {
1130 Agnode_s n;
1131 Agedge_s e;
1132 final __struct__<point> slen = JUtils.from(point.class);
1108 ST_Agnode_s n;
1109 ST_Agedge_s e;
1110 final ST_point slen = new ST_point();
11331111 slen.setInt("x", 0);
11341112 slen.setInt("y", 0);
11351113 if ((GD_maxset(g) == null) && (GD_minset(g) == null))
11661144
11671145 //3 1rmlm1wo3t94wyet9rlwrmith
11681146 // static int minmax_edges2(graph_t * g, point slen)
1169 public static boolean minmax_edges2(Agraph_s g, final __struct__<point> slen) {
1147 public static boolean minmax_edges2(ST_Agraph_s g, final ST_point slen) {
11701148 // WARNING!! STRUCT
1171 return minmax_edges2_w_(g, slen.copy());
1172 }
1173 private static boolean minmax_edges2_w_(Agraph_s g, final __struct__<point> slen) {
1149 return minmax_edges2_w_(g, (ST_point) slen.copy());
1150 }
1151 private static boolean minmax_edges2_w_(ST_Agraph_s g, final ST_point slen) {
11741152 ENTERING("1rmlm1wo3t94wyet9rlwrmith","minmax_edges2");
11751153 try {
1176 Agnode_s n;
1177 Agedge_s e = null;
1154 ST_Agnode_s n;
1155 ST_Agedge_s e = null;
11781156 if ((GD_maxset(g)!=null) || (GD_minset(g)!=null)) {
11791157 UNSUPPORTED("attp4bsjqe99xnhi7lr7pszar"); // for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
11801158 UNSUPPORTED("8y47p29z0c2f1xpkrsb8w8re8"); // if (n != UF_find(n))
12021180
12031181 //3 3vpthwso788idvycelpnqijys
12041182 // void rank1(graph_t * g)
1205 public static void rank1(Agraph_s g) {
1183 public static void rank1(ST_Agraph_s g) {
12061184 ENTERING("3vpthwso788idvycelpnqijys","rank1");
12071185 try {
12081186 int maxiter = Integer.MAX_VALUE;
12111189 if ((s = agget(g, new CString("nslimit1")))!=null)
12121190 UNSUPPORTED("9tp2zk1tsr4ce9rwsr0is9u3o"); // maxiter = atof(s) * agnnodes(g);
12131191 for (c = 0; c < GD_comp(g).size; c++) {
1214 //GD_nlist(g, GD_comp(g).getArrayOfPtr("list").plus(c).getPtr());
1192 //GD_nlist(g, GD_comp(g).list.get(c));
12151193 GD_nlist(g, GD_comp(g).getFromList(c));
12161194 rank(g, (GD_n_cluster(g) == 0 ? 1 : 0), maxiter); /* TB balance */
12171195 }
12251203
12261204 //3 cdh8wnb99v90dy6efpbzmrjix
12271205 // static void expand_ranksets(graph_t * g, aspect_t* asp)
1228 public static void expand_ranksets(Agraph_s g, aspect_t asp) {
1206 public static void expand_ranksets(ST_Agraph_s g, ST_aspect_t asp) {
12291207 ENTERING("cdh8wnb99v90dy6efpbzmrjix","expand_ranksets");
12301208 try {
12311209 int c;
1232 Agnode_s n, leader;
1210 ST_Agnode_s n, leader;
12331211 if ((n = agfstnode(g))!=null) {
12341212 GD_minrank(g, MAXSHORT);
12351213 GD_maxrank(g, -1);
12511229 if (EQ(g, dot_root(g))) {
12521230 if (Z.z().CL_type == 100) {
12531231 for (c = 1; c <= GD_n_cluster(g); c++)
1254 set_minmax((Agraph_s) GD_clust(g).plus(c).getPtr());
1232 set_minmax((ST_Agraph_s) GD_clust(g).get(c).getPtr());
12551233 } else {
12561234 find_clusters(g);
12571235 }
12701248
12711249 //3 2o4rmb4o6f6zh46ak3se91rwr
12721250 // static void dot1_rank(graph_t * g, aspect_t* asp)
1273 public static void dot1_rank(Agraph_s g, aspect_t asp) {
1251 public static void dot1_rank(ST_Agraph_s g, ST_aspect_t asp) {
12741252 ENTERING("2o4rmb4o6f6zh46ak3se91rwr","dot1_rank");
12751253 try {
1276 final __struct__<point> p = JUtils.from(point.class);
1254 final ST_point p = new ST_point();
12771255 edgelabel_ranks(g);
12781256 if (asp!=null) {
12791257 UNSUPPORTED("kh7e20nqwuserrnpf3zpvuyl"); // init_UF_size(g);
12841262 class1_(g);
12851263 p.___(minmax_edges(g));
12861264 decompose(g, 0);
1287 if (asp!=null && ((GD_comp(g).getInt("size") > 1)||(GD_n_cluster(g) > 0))) {
1265 if (asp!=null && ((GD_comp(g).size > 1)||(GD_n_cluster(g) > 0))) {
12881266 UNSUPPORTED("evcjt85irnaa02v8cam07i009"); // asp->badGraph = 1;
12891267 UNSUPPORTED("45nxv6kczal9hnytkfcyt2jk8"); // asp = NULL;
12901268 }
13071285
13081286 //3 asyfujgwqa407ffvqn5psbtsc
13091287 // void dot_rank(graph_t * g, aspect_t* asp)
1310 public static void dot_rank(Agraph_s g, aspect_t asp) {
1288 public static void dot_rank(ST_Agraph_s g, ST_aspect_t asp) {
13111289 ENTERING("asyfujgwqa407ffvqn5psbtsc","dot_rank");
13121290 try {
13131291 if (agget (g, new CString("newrank"))!=null) {
13281306
13291307 //3 cdncou6d2ng5i48rd1mk2cpnw
13301308 // int is_cluster(graph_t * g)
1331 public static boolean is_cluster(Agraph_s g) {
1309 public static boolean is_cluster(ST_Agraph_s g) {
13321310 ENTERING("cdncou6d2ng5i48rd1mk2cpnw","is_cluster");
13331311 try {
13341312 return (strncmp(agnameof(g), new CString("cluster"), 7) == 0);
4949 import static smetana.core.Macro.AGEDGE;
5050 import static smetana.core.Macro.N;
5151 import static smetana.core.Macro.UNSUPPORTED;
52 import h.Agedge_s;
53 import h.Agnode_s;
54 import h.Agraph_s;
55 import h.boxf;
56 import h.pointf;
52 import h.ST_Agedge_s;
53 import h.ST_Agnode_s;
54 import h.ST_Agraph_s;
55 import h.ST_pointf;
5756 import smetana.core.CString;
58 import smetana.core.JUtils;
5957 import smetana.core.Z;
60 import smetana.core.__struct__;
6158
6259 public class sameport__c {
6360 //1 2digov3edok6d5srhgtlmrycs
317314
318315 //3 c1s4k85p1cdfn176o3uryeros
319316 // static inline pointf pointfof(double x, double y)
320 public static __struct__<pointf> pointfof(double x, double y) {
317 public static ST_pointf pointfof(double x, double y) {
321318 // WARNING!! STRUCT
322319 return pointfof_w_(x, y).copy();
323320 }
324 private static __struct__<pointf> pointfof_w_(double x, double y) {
321 private static ST_pointf pointfof_w_(double x, double y) {
325322 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
326323 try {
327 final __struct__<pointf> r = JUtils.from(pointf.class);
324 final ST_pointf r = new ST_pointf();
328325 r.setDouble("x", x);
329326 r.setDouble("y", y);
330327 return r;
353350
354351
355352
356 //3 1vvsta5i8of59frav6uymguav
357 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
358 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
359 // WARNING!! STRUCT
360 return boxfof_w_(llx, lly, urx, ury).copy();
361 }
362 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
363 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
364 try {
365 final __struct__<boxf> b = JUtils.from(boxf.class);
366 b.getStruct("LL").setDouble("x", llx);
367 b.getStruct("LL").setDouble("y", lly);
368 b.getStruct("UR").setDouble("x", urx);
369 b.getStruct("UR").setDouble("y", ury);
370 return b;
371 } finally {
372 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
373 }
374 }
375
376
377353
378354
379355 //3 1n5xl70wxuabyf97mclvilsm6
395371
396372 //3 arrsbik9b5tnfcbzsm8gr2chx
397373 // static inline pointf add_pointf(pointf p, pointf q)
398 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
374 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
399375 // WARNING!! STRUCT
400376 return add_pointf_w_(p.copy(), q.copy()).copy();
401377 }
402 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
378 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
403379 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
404380 try {
405 final __struct__<pointf> r = JUtils.from(pointf.class);
406 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
407 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
381 final ST_pointf r = new ST_pointf();
382 r.setDouble("x", p.x + q.x);
383 r.setDouble("y", p.y + q.y);
408384 return r;
409385 } finally {
410386 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
701677
702678 //3 eu2yvovb9xx4rzic3gllij2bv
703679 // void dot_sameports(graph_t * g)
704 public static void dot_sameports(Agraph_s g) {
680 public static void dot_sameports(ST_Agraph_s g) {
705681 ENTERING("eu2yvovb9xx4rzic3gllij2bv","dot_sameports");
706682 try {
707 Agnode_s n;
708 Agedge_s e;
683 ST_Agnode_s n;
684 ST_Agedge_s e;
709685 CString id;
710686 //same_t samehead[5];
711687 //same_t sametail[5];
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class clusteredges__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class comp__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class fdpinit__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368345
369346
370347
387364
388365 //3 arrsbik9b5tnfcbzsm8gr2chx
389366 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
367 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391368 // WARNING!! STRUCT
392369 return add_pointf_w_(p.copy(), q.copy()).copy();
393370 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
371 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395372 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396373 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
374 final ST_pointf r = new ST_pointf();
375 r.setDouble("x", p.x + q.x);
376 r.setDouble("y", p.y + q.y);
400377 return r;
401378 } finally {
402379 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class grid__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350 import smetana.core.jmp_buf;
5451
5552 public class layout__c {
310307
311308 //3 c1s4k85p1cdfn176o3uryeros
312309 // static inline pointf pointfof(double x, double y)
313 public static __struct__<pointf> pointfof(double x, double y) {
310 public static ST_pointf pointfof(double x, double y) {
314311 // WARNING!! STRUCT
315312 return pointfof_w_(x, y).copy();
316313 }
317 private static __struct__<pointf> pointfof_w_(double x, double y) {
314 private static ST_pointf pointfof_w_(double x, double y) {
318315 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
319316 try {
320 final __struct__<pointf> r = JUtils.from(pointf.class);
317 final ST_pointf r = new ST_pointf();
321318 r.setDouble("x", x);
322319 r.setDouble("y", y);
323320 return r;
346343
347344
348345
349 //3 1vvsta5i8of59frav6uymguav
350 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
351 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
352 // WARNING!! STRUCT
353 return boxfof_w_(llx, lly, urx, ury).copy();
354 }
355 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
356 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
357 try {
358 final __struct__<boxf> b = JUtils.from(boxf.class);
359 b.getStruct("LL").setDouble("x", llx);
360 b.getStruct("LL").setDouble("y", lly);
361 b.getStruct("UR").setDouble("x", urx);
362 b.getStruct("UR").setDouble("y", ury);
363 return b;
364 } finally {
365 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
366 }
367 }
368
369346
370347
371348
388365
389366 //3 arrsbik9b5tnfcbzsm8gr2chx
390367 // static inline pointf add_pointf(pointf p, pointf q)
391 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
392369 // WARNING!! STRUCT
393370 return add_pointf_w_(p.copy(), q.copy()).copy();
394371 }
395 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
396373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
397374 try {
398 final __struct__<pointf> r = JUtils.from(pointf.class);
399 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
400 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
401378 return r;
402379 } finally {
403380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class tlayout__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class xlayout__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367345
368346
369347
387365
388366 //3 arrsbik9b5tnfcbzsm8gr2chx
389367 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391369 // WARNING!! STRUCT
392370 return add_pointf_w_(p.copy(), q.copy()).copy();
393371 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396374 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
400378 return r;
401379 } finally {
402380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
5252 import static smetana.core.Macro.AGNODE;
5353 import static smetana.core.Macro.NOT;
5454 import static smetana.core.Macro.UNSUPPORTED;
55 import h.GVC_s;
55 import h.ST_GVC_s;
5656 import smetana.core.CString;
5757
5858 public class gvc__c {
160160
161161 //3 f3vdhir2c7dz3pvmx9d3m4lx1
162162 // GVC_t *gvContext(void)
163 public static GVC_s gvContext(Object... arg) {
163 public static ST_GVC_s gvContext(Object... arg) {
164164 ENTERING("f3vdhir2c7dz3pvmx9d3m4lx1","gvContext");
165165 try {
166 GVC_s gvc;
166 ST_GVC_s gvc;
167167 agattr(null, AGNODE, new CString("label"), new CString("\\N"));
168168 /* default to no builtins, demand loading enabled */
169 gvc = (GVC_s) gvNEWcontext(null, (NOT(0)));
169 gvc = (ST_GVC_s) gvNEWcontext(null, (NOT(0)));
170170 /* builtins don't require LTDL */
171171 gvc.setInt("config_found", 0);
172172 gvtextlayout_select(gvc); /* choose best available textlayout plugin immediately */
4343 *
4444 */
4545 package gen.lib.gvc;
46 import static gen.lib.common.memory__c.zmalloc;
4746 import static smetana.core.JUtils.function;
48 import static smetana.core.JUtils.sizeof;
4947 import static smetana.core.JUtilsDebug.ENTERING;
5048 import static smetana.core.JUtilsDebug.LEAVING;
5149 import static smetana.core.Macro.UNSUPPORTED;
52 import h.GVC_s;
50 import h.ST_GVC_s;
5351 import h.lt_symlist_t;
5452 import smetana.core.__ptr__;
5553
167165
168166 //3 8jwauh4lo3kcvxhomy40s94b
169167 // GVC_t *gvNEWcontext(const lt_symlist_t *builtins, int demand_loading)
170 public static GVC_s gvNEWcontext(lt_symlist_t builtins, boolean demand_loading) {
168 public static ST_GVC_s gvNEWcontext(lt_symlist_t builtins, boolean demand_loading) {
171169 ENTERING("8jwauh4lo3kcvxhomy40s94b","gvNEWcontext");
172170 try {
173 GVC_s gvc = (GVC_s) zmalloc(sizeof(GVC_s.class));
171 ST_GVC_s gvc = new ST_GVC_s();
174172 if (gvc!=null) {
175 gvc.getStruct("common").setPtr("info", LibInfo);
176 gvc.getStruct("common").setPtr("errorfn", function(gen.lib.cgraph.agerror__c.class, "agerrorf"));
177 gvc.getStruct("common").setPtr("builtins", builtins);
178 gvc.getStruct("common").setBoolean("demand_loading", demand_loading);
173 gvc.common.setPtr("info", LibInfo);
174 gvc.common.setPtr("errorfn", function(gen.lib.cgraph.agerror__c.class, "agerrorf"));
175 gvc.common.setPtr("builtins", builtins);
176 gvc.common.demand_loading = demand_loading;
179177 }
180178 return gvc;
181179 } finally {
5959 import static smetana.core.Macro.GD_gvc;
6060 import static smetana.core.Macro.N;
6161 import static smetana.core.Macro.UNSUPPORTED;
62 import h.Agraph_s;
63 import h.Agraphinfo_t;
64 import h.GVC_s;
65 import h.gvlayout_engine_s;
66 import h.gvlayout_features_t;
67 import h.gvplugin_installed_t;
62 import h.ST_Agraph_s;
63 import h.ST_Agraphinfo_t;
64 import h.ST_GVC_s;
65 import h.ST_gvlayout_engine_s;
66 import h.ST_gvlayout_features_t;
67 import h.ST_gvplugin_installed_t;
6868 import h.layout_type;
6969 import smetana.core.CString;
70 import smetana.core.JUtils;
71 import smetana.core.Memory;
72 import smetana.core.__struct__;
7370
7471 public class gvlayout__c {
7572 //1 2digov3edok6d5srhgtlmrycs
174171
175172
176173
177 //3 2g20jitdi8afuoei8p1mcfg9l
178 // int gvlayout_select(GVC_t * gvc, const char *layout)
179 private final static __struct__<gvlayout_features_t> dotgen_features = JUtils.from(gvlayout_features_t.class);
180 private final static __struct__<gvlayout_engine_s> dotgen_engine = JUtils.from(gvlayout_engine_s.class);
174 private final static ST_gvlayout_features_t dotgen_features = new ST_gvlayout_features_t();
175 private final static ST_gvlayout_engine_s dotgen_engine = new ST_gvlayout_engine_s();
181176 static {
182177 dotgen_features.setInt("flags", 1<<0);
183178 dotgen_engine.setPtr("layout", function(gen.lib.dotgen.dotinit__c.class, "dot_layout"));
184179 dotgen_engine.setPtr("cleanup", function(gen.lib.dotgen.dotinit__c.class, "dot_cleanup"));
185180 }
186 public static int gvlayout_select(GVC_s gvc, CString layout) {
181 //3 2g20jitdi8afuoei8p1mcfg9l
182 //int gvlayout_select(GVC_t * gvc, const char *layout)
183 public static int gvlayout_select(ST_GVC_s gvc, CString layout) {
187184 ENTERING("2g20jitdi8afuoei8p1mcfg9l","gvlayout_select");
188185 try {
189 gvplugin_installed_t gvlayout_dot_layout = (gvplugin_installed_t) Memory.malloc(gvplugin_installed_t.class);
186 ST_gvplugin_installed_t gvlayout_dot_layout = new ST_gvplugin_installed_t();
190187 gvlayout_dot_layout.setInt("id", enumAsInt(layout_type.class, "LAYOUT_DOT"));
191188 gvlayout_dot_layout.setPtr("type", new CString("dot"));
192189 gvlayout_dot_layout.setInt("quality", 0);
193 gvlayout_dot_layout.setPtr("engine", dotgen_engine.amp());
194 gvlayout_dot_layout.setPtr("features", dotgen_features.amp());
190 gvlayout_dot_layout.setPtr("engine", dotgen_engine);
191 gvlayout_dot_layout.setPtr("features", dotgen_features);
195192
196193 // gvplugin_available_t *plugin;
197 gvplugin_installed_t typeptr = gvlayout_dot_layout;
194 ST_gvplugin_installed_t typeptr = gvlayout_dot_layout;
198195 // plugin = gvplugin_load(gvc, API_layout, layout);
199196 // if (plugin) {
200197 // typeptr = plugin->typeptr;
201 gvc.getStruct("layout").setPtr("type", typeptr.getPtr("type"));
202 gvc.getStruct("layout").setPtr("engine", typeptr.getPtr("engine"));
203 gvc.getStruct("layout").setInt("id", typeptr.getInt("id"));
204 gvc.getStruct("layout").setPtr("features", typeptr.getPtr("features"));
198 gvc.layout.setPtr("type", typeptr.type);
199 gvc.layout.setPtr("engine", typeptr.engine);
200 gvc.layout.setInt("id", typeptr.id);
201 gvc.layout.setPtr("features", typeptr.features);
205202 return 300; /* FIXME - need better return code */
206203 // }
207204 // return 999;
215212
216213 //3 991b7t7n0x8ifkp49zotjs78x
217214 // int gvLayoutJobs(GVC_t * gvc, Agraph_t * g)
218 public static int gvLayoutJobs(GVC_s gvc, Agraph_s g) {
215 public static int gvLayoutJobs(ST_GVC_s gvc, ST_Agraph_s g) {
219216 ENTERING("991b7t7n0x8ifkp49zotjs78x","gvLayoutJobs");
220217 try {
221 gvlayout_engine_s gvle;
218 ST_gvlayout_engine_s gvle;
222219 CString p = null;
223220 int rc;
224 agbindrec(g, new CString("Agraphinfo_t"), sizeof(Agraphinfo_t.class), (N(0)));
221 agbindrec(g, new CString("Agraphinfo_t"), sizeof(ST_Agraphinfo_t.class), (N(0)));
225222 GD_gvc(g, gvc);
226223 if (NEQ(g, agroot(g)))
227224 UNSUPPORTED("ah9ygbaap1fyxr97z734juk0j"); // (((Agraphinfo_t*)(((Agobj_t*)(agroot(g)))->data))->gvc) = gvc;
237234
238235 rc = gvlayout_select(gvc, p); //Let's force things
239236
240 gvle = (gvlayout_engine_s) gvc.getStruct("layout").getPtr("engine");
237 gvle = (ST_gvlayout_engine_s) gvc.layout.engine;
241238 if (N(gvle))
242239 UNSUPPORTED("return -1;");
243240 gv_fixLocale (1);
244 graph_init(g, (gvc.getStruct("layout").getPtr("features").getInt("flags") & (1<<0))!=0);
241 graph_init(g, (gvc.layout.features.flags & (1<<0))!=0);
245242 GD_drawing(agroot(g), GD_drawing(g));
246 if (gvle!=null && gvle.getPtr("layout")!=null) {
247 gvle.call("layout", g);
248 if (gvle.getPtr("cleanup")!=null)
243 if (gvle!=null && gvle.layout!=null) {
244 gvle.layout.exe(g);
245 if (gvle.cleanup!=null)
249246 if (GD_cleanup(g)==null)
250247 LOG2("WARNING WE CHEAT GD_cleanup(g) is NULL"); else
251 GD_cleanup(g).setPtr(gvle.getPtr("cleanup"));
248 GD_cleanup(g).setPtr(gvle.cleanup);
252249 }
253250 gv_fixLocale (0);
254251 return 0;
4949 import static smetana.core.JUtilsDebug.ENTERING;
5050 import static smetana.core.JUtilsDebug.LEAVING;
5151 import static smetana.core.Macro.UNSUPPORTED;
52 import h.GVC_s;
52 import h.ST_GVC_s;
53 import h.ST_gvplugin_available_s;
54 import h.ST_gvplugin_installed_t;
5355 import h.api_t;
5456 import h.gvplugin_api_t;
55 import h.gvplugin_available_s;
56 import h.gvplugin_installed_t;
5757 import h.gvplugin_library_t;
5858 import smetana.core.CString;
5959
293293
294294 //3 dh7wri9ra8xvm9ur14gd95xjj
295295 // gvplugin_available_t *gvplugin_load(GVC_t * gvc, api_t api, const char *str)
296 public static gvplugin_available_s gvplugin_load(GVC_s gvc, int api, CString str) {
296 public static ST_gvplugin_available_s gvplugin_load(ST_GVC_s gvc, int api, CString str) {
297297 ENTERING("dh7wri9ra8xvm9ur14gd95xjj","gvplugin_load");
298298 try {
299299 //gvplugin_available_s **pnext;
300300 //gvplugin_available_s rv;
301301 gvplugin_library_t library;
302302 gvplugin_api_t apis;
303 gvplugin_installed_t types;
303 ST_gvplugin_installed_t types;
304304 CString reqtyp = new CString(64), typ = new CString(64);
305305 CString reqdep, dep , reqpkg;
306306 int i;
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class gvrender__c {
5552 //1 2digov3edok6d5srhgtlmrycs
173170
174171 //3 c1s4k85p1cdfn176o3uryeros
175172 // static inline pointf pointfof(double x, double y)
176 public static __struct__<pointf> pointfof(double x, double y) {
173 public static ST_pointf pointfof(double x, double y) {
177174 // WARNING!! STRUCT
178175 return pointfof_w_(x, y).copy();
179176 }
180 private static __struct__<pointf> pointfof_w_(double x, double y) {
177 private static ST_pointf pointfof_w_(double x, double y) {
181178 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
182179 try {
183 final __struct__<pointf> r = JUtils.from(pointf.class);
180 final ST_pointf r = new ST_pointf();
184181 r.setDouble("x", x);
185182 r.setDouble("y", y);
186183 return r;
209206
210207
211208
212 //3 1vvsta5i8of59frav6uymguav
213 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
214 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
215 // WARNING!! STRUCT
216 return boxfof_w_(llx, lly, urx, ury).copy();
217 }
218 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
219 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
220 try {
221 final __struct__<boxf> b = JUtils.from(boxf.class);
222 b.getStruct("LL").setDouble("x", llx);
223 b.getStruct("LL").setDouble("y", lly);
224 b.getStruct("UR").setDouble("x", urx);
225 b.getStruct("UR").setDouble("y", ury);
226 return b;
227 } finally {
228 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
229 }
230 }
231
232209
233210
234211
251228
252229 //3 arrsbik9b5tnfcbzsm8gr2chx
253230 // static inline pointf add_pointf(pointf p, pointf q)
254 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
231 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
255232 // WARNING!! STRUCT
256233 return add_pointf_w_(p.copy(), q.copy()).copy();
257234 }
258 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
235 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
259236 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
260237 try {
261 final __struct__<pointf> r = JUtils.from(pointf.class);
262 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
263 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
238 final ST_pointf r = new ST_pointf();
239 r.setDouble("x", p.x + q.x);
240 r.setDouble("y", p.y + q.y);
264241 return r;
265242 } finally {
266243 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4848 import static smetana.core.JUtilsDebug.ENTERING;
4949 import static smetana.core.JUtilsDebug.LEAVING;
5050 import static smetana.core.Macro.UNSUPPORTED;
51 import h.GVC_s;
51 import h.ST_GVC_s;
52 import h.ST_gvplugin_available_s;
53 import h.ST_gvplugin_installed_t;
5254 import h.api_t;
53 import h.gvplugin_available_s;
54 import h.gvplugin_installed_t;
5555 import smetana.core.CString;
5656
5757 public class gvtextlayout__c {
159159
160160 //3 f1oiyeonoigwygyq8c88wl8tz
161161 // int gvtextlayout_select(GVC_t * gvc)
162 public static int gvtextlayout_select(GVC_s gvc) {
162 public static int gvtextlayout_select(ST_GVC_s gvc) {
163163 ENTERING("f1oiyeonoigwygyq8c88wl8tz","gvtextlayout_select");
164164 try {
165 gvplugin_available_s plugin;
166 gvplugin_installed_t typeptr;
165 ST_gvplugin_available_s plugin;
166 ST_gvplugin_installed_t typeptr;
167167 plugin = gvplugin_load(gvc, enumAsInt(api_t.class, "API_textlayout"), new CString("textlayout"));
168168 if (plugin!=null) {
169169 UNSUPPORTED("8cnmkxanogd09zc24faarugvo"); // typeptr = plugin->typeptr;
4343 *
4444 */
4545 package gen.lib.label;
46 import static gen.lib.label.node__c.*;
47 import static gen.lib.common.memory__c.zmalloc;
48 import static smetana.core.JUtils.sizeof;
46 import static gen.lib.label.node__c.AddBranch;
47 import static gen.lib.label.node__c.DisconBranch;
48 import static gen.lib.label.node__c.NodeCover;
49 import static gen.lib.label.node__c.PickBranch;
50 import static gen.lib.label.node__c.RTreeNewNode;
51 import static gen.lib.label.rectangle__c.CombineRect;
52 import static gen.lib.label.rectangle__c.Overlap;
53 import static smetana.core.JUtilsDebug.ENTERING;
54 import static smetana.core.JUtilsDebug.LEAVING;
55 import static smetana.core.Macro.N;
4956 import static smetana.core.Macro.UNSUPPORTED;
50 import h.RTree;
51 import h._Node_t___;
57 import h.ST_Branch_t;
58 import h.ST_LeafList_t;
59 import h.ST_Node_t___;
60 import h.ST_Node_t___or_object_t;
61 import h.ST_RTree;
62 import h.ST_Rect_t;
63 import smetana.core.Memory;
5264 import smetana.core.__ptr__;
5365
5466 public class index__c {
5668
5769 //3 1rfaqe5urty5uyp5xb2r0idce
5870 // LeafList_t *RTreeNewLeafList(Leaf_t * lp)
59 public static Object RTreeNewLeafList(Object... arg) {
60 UNSUPPORTED("bu04wzk5vh5g14rcm11j6y1bc"); // LeafList_t *RTreeNewLeafList(Leaf_t * lp)
61 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
62 UNSUPPORTED("8mcrniwafqlmy5ysg6jeand6o"); // LeafList_t *llp;
63 UNSUPPORTED("3b215c61vcll0rkorzyelp40j"); // if ((llp = (LeafList_t*)zmalloc(sizeof(LeafList_t)))) {
64 UNSUPPORTED("48u04cv4b40c0avzy99mdycx5"); // llp->leaf = lp;
65 UNSUPPORTED("bbvk7v1s0z6yw1xdoq99v233w"); // llp->next = 0;
66 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
67 UNSUPPORTED("5a1d3zolzdjict0gus6vz04a2"); // return llp;
68 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
69
70 throw new UnsupportedOperationException();
71 public static ST_LeafList_t RTreeNewLeafList(ST_Branch_t lp) {
72 ENTERING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
73 try {
74 ST_LeafList_t llp;
75 llp = new ST_LeafList_t();
76 llp.leaf = lp;
77 llp.next = null;
78 return llp;
79 //UNSUPPORTED("3b215c61vcll0rkorzyelp40j"); // if ((llp = (LeafList_t*)zmalloc(sizeof(LeafList_t)))) {
80 //UNSUPPORTED("48u04cv4b40c0avzy99mdycx5"); // llp->leaf = lp;
81 //UNSUPPORTED("bbvk7v1s0z6yw1xdoq99v233w"); // llp->next = 0;
82 //UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
83 //UNSUPPORTED("5a1d3zolzdjict0gus6vz04a2"); // return llp;
84 //UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
85 //
86 //throw new UnsupportedOperationException();
87 } finally {
88 LEAVING("1rfaqe5urty5uyp5xb2r0idce","RTreeNewLeafList");
89 }
7190 }
7291
7392
7594
7695 //3 6pvstz7axi8a7saeqe3nrrmg5
7796 // LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp)
78 public static Object RTreeLeafListAdd(Object... arg) {
79 UNSUPPORTED("eiwtmfygcnm8i2i38dywdrxvu"); // LeafList_t *RTreeLeafListAdd(LeafList_t * llp, Leaf_t * lp)
80 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
81 UNSUPPORTED("c8jefspkzejjwynx8rg8zejbx"); // LeafList_t *nlp;
82 UNSUPPORTED("5whcehr1j26r7aahssfvo2dxa"); // if (!lp)
83 UNSUPPORTED("1sxqq75kqdqzr0enoukqqx3m1"); // return llp;
84 UNSUPPORTED("adl5lp3lwoh3u5zssznsdnxms"); // nlp = RTreeNewLeafList(lp);
85 UNSUPPORTED("373n3s0slcur0mj477nbkp2z9"); // nlp->next = llp;
86 UNSUPPORTED("c398zm44c0kp59y82avlt28qs"); // return nlp;
87 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
88
89 throw new UnsupportedOperationException();
97 public static ST_LeafList_t RTreeLeafListAdd(ST_LeafList_t llp, ST_Branch_t lp) {
98 ENTERING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
99 try {
100 ST_LeafList_t nlp;
101 if (N(lp))
102 return llp;
103 nlp = RTreeNewLeafList(lp);
104 nlp.next = llp;
105 return nlp;
106 } finally {
107 LEAVING("6pvstz7axi8a7saeqe3nrrmg5","RTreeLeafListAdd");
108 }
90109 }
91110
92111
94113
95114 //3 6zraor7x44vrnm19d2igkvow2
96115 // void RTreeLeafListFree(LeafList_t * llp)
97 public static Object RTreeLeafListFree(Object... arg) {
98 UNSUPPORTED("cwsuv5x6hz2atkriag0lyrwpq"); // void RTreeLeafListFree(LeafList_t * llp)
99 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
100 UNSUPPORTED("96shepyp7pgdusod9eu04oqsa"); // LeafList_t *tlp;
101 UNSUPPORTED("66etdhvz2fmsepzj2nfiioze9"); // while (llp->next) {
102 UNSUPPORTED("aa7iqc08758zwe37qyy2wffec"); // tlp = llp->next;
103 UNSUPPORTED("efbq5hg14ncf3x5du5wro1m6d"); // free(llp);
104 UNSUPPORTED("6qcaq7a673zdej3uu1ke2kz0a"); // llp = tlp;
105 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
106 UNSUPPORTED("41smjtwh6jsdofomjdbd76o7j"); // free(llp);
107 UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
108 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
109
110 throw new UnsupportedOperationException();
116 public static void RTreeLeafListFree(ST_LeafList_t llp) {
117 ENTERING("6zraor7x44vrnm19d2igkvow2","RTreeLeafListFree");
118 try {
119 ST_LeafList_t tlp;
120 while (llp.next!=null) {
121 tlp = (ST_LeafList_t) llp.next;
122 Memory.free(llp);
123 llp = tlp;
124 }
125 Memory.free(llp);
126 } finally {
127 LEAVING("6zraor7x44vrnm19d2igkvow2","RTreeLeafListFree");
128 }
111129 }
112130
113131 ///* Allocate space for a node in the list used in DeletRect to
121139 ///* Add a node to the reinsertion list. All its branches will later
122140 // * be reinserted into the index structure.
123141 // */
142 //3 aa19m7d7qc06m8id896e60lkg
124143 //static int RTreeReInsert(RTree_t * rtp, Node_t * n, struct ListNode **ee)
125144 //{
145 // WARNING!! STRUCT
126146 // register struct ListNode *l;
127147 //
128148 // if (!(l = RTreeNewListNode()))
133153 // return 0;
134154 //}
135155 //
156 //3 aa29m7d7qc06m8id896e60lkg
136157 //RTree_t *RTreeOpen()
137158 public static __ptr__ RTreeOpen() {
138 RTree rtp;
139 rtp = (RTree) zmalloc(sizeof(RTree.class));
159 ENTERING("aa29m7d7qc06m8id896e60lkg","RTreeOpen");
160 try {
161 ST_RTree rtp;
162 rtp = new ST_RTree();
140163 if (rtp!=null)
141164 rtp.setPtr("root", RTreeNewIndex(rtp));
142165 return rtp;
143 }
144
145 ///* Make a new index, empty. Consists of a single node. */
166 } finally {
167 LEAVING("aa29m7d7qc06m8id896e60lkg","RTreeOpen");
168 }
169 }
170
171 /* Make a new index, empty. Consists of a single node. */
172 //3 aa39m7d7qc06m8id896e60lkg
146173 //Node_t *RTreeNewIndex(RTree_t * rtp)
147 public static _Node_t___ RTreeNewIndex(RTree rtp) {
148 _Node_t___ x;
174 public static ST_Node_t___ RTreeNewIndex(ST_RTree rtp) {
175 ENTERING("aa39m7d7qc06m8id896e60lkg","RTreeNewIndex");
176 try {
177 ST_Node_t___ x;
149178 x = RTreeNewNode(rtp);
150 // x->level = 0; /* leaf */
151 // rtp->LeafCount++;
152 // return x;
153 //}
154 throw new UnsupportedOperationException();
155 }
156 //
179 x.setInt("level", 0); /* leaf */
180 rtp.setInt("LeafCount", rtp.LeafCount+1);
181 return x;
182 } finally {
183 LEAVING("aa39m7d7qc06m8id896e60lkg","RTreeNewIndex");
184 }
185 }
186
187 //3 aa49m7d7qc06m8id896e60lkg
157188 //static int RTreeClose2(RTree_t * rtp, Node_t * n)
158 //{
159 // int i;
160 //
161 // if (n->level > 0) {
162 // for (i = 0; i < 64; i++) {
163 // if (!n->branch[i].child)
164 // continue;
165 // if (!RTreeClose2(rtp, n->branch[i].child)) {
166 // free(n->branch[i].child);
167 // DisconBranch(n, i);
168 // rtp->EntryCount--;
169 // if (rtp->StatFlag)
170 // rtp->ElimCount++;
171 // }
172 // }
173 // } else {
174 // for (i = 0; i < 64; i++) {
175 // if (!n->branch[i].child)
176 // continue;
177 // // free(n->branch[i].child);
178 // DisconBranch(n, i);
179 // rtp->EntryCount--;
180 // if (rtp->StatFlag)
181 // rtp->ElimCount++;
182 // }
183 // //free(n);
184 // }
185 // return 0;
186 //}
187 //
189 public static int RTreeClose2(ST_RTree rtp, ST_Node_t___ n) {
190 ENTERING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
191 try {
192 int i;
193
194 if (n.level > 0) {
195 for (i = 0; i < 64; i++) {
196 if (N(n.branch[i].child))
197 continue;
198 if (N(RTreeClose2(rtp, (ST_Node_t___) n.branch[i].child))) {
199 Memory.free(n.branch[i].child);
200 DisconBranch(n, i);
201 rtp.setInt("EntryCount", rtp.EntryCount-1);
202 if (rtp.StatFlag!=0)
203 rtp.setInt("ElimCount", rtp.ElimCount+1);
204 }
205 }
206 } else {
207 for (i = 0; i < 64; i++) {
208 if (N(n.branch[i].child))
209 continue;
210 // free(n->branch[i].child);
211 DisconBranch(n, i);
212 rtp.setInt("EntryCount", rtp.EntryCount-1);
213 if (rtp.StatFlag!=0)
214 rtp.setInt("ElimCount", rtp.ElimCount+1);
215 }
216 //free(n);
217 }
218 return 0;
219 } finally {
220 LEAVING("aa49m7d7qc06m8id896e60lkg","RTreeClose2");
221 }
222 }
223
224 //3 aa59m7d7qc06m8id896e60lkg
188225 //int RTreeClose(RTree_t * rtp)
189 //{
190 // RTreeClose2(rtp, rtp->root);
191 // free(rtp->root);
192 // free(rtp);
193 // return 0;
194 //}
195 //
196 //
197 ///* RTreeSearch in an index tree or subtree for all data retangles that
198 //** overlap the argument rectangle.
199 //** Returns the number of qualifying data rects.
200 //*/
226 public static int RTreeClose(ST_RTree rtp) {
227 ENTERING("aa59m7d7qc06m8id896e60lkg","RTreeClose");
228 try {
229 RTreeClose2(rtp, (ST_Node_t___) rtp.root);
230 Memory.free(rtp.root);
231 Memory.free(rtp);
232 return 0;
233 } finally {
234 LEAVING("aa59m7d7qc06m8id896e60lkg","RTreeClose");
235 }
236 }
237
238
239
240 /* RTreeSearch in an index tree or subtree for all data retangles that
241 ** overlap the argument rectangle.
242 ** Returns the number of qualifying data rects.
243 */
244 //3 aa69m7d7qc06m8id896e60lkg
201245 //LeafList_t *RTreeSearch(RTree_t * rtp, Node_t * n, Rect_t * r)
202 //{
203 // register int i;
204 // LeafList_t *llp = 0;
205 //
246 public static ST_LeafList_t RTreeSearch(ST_RTree rtp, ST_Node_t___ n, ST_Rect_t r) {
247 ENTERING("aa69m7d7qc06m8id896e60lkg","RTreeSearch");
248 try {
249 int i;
250 ST_LeafList_t llp = null;
251
206252 // assert(n);
207253 // assert(n->level >= 0);
208254 // assert(r);
209 //
210 // rtp->SeTouchCount++;
211 //
212 // if (n->level > 0) { /* this is an internal node in the tree */
213 // for (i = 0; i < 64; i++)
214 // if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
215 // LeafList_t *tlp = RTreeSearch(rtp, n->branch[i].child, r);
216 // if (llp) {
217 // LeafList_t *xlp = llp;
218 // while (xlp->next)
219 // xlp = xlp->next;
220 // xlp->next = tlp;
221 // } else
222 // llp = tlp;
223 // }
224 // } else { /* this is a leaf node */
225 // for (i = 0; i < 64; i++) {
226 // if (n->branch[i].child && Overlap(r, &n->branch[i].rect)) {
227 // llp = RTreeLeafListAdd(llp, (Leaf_t *) & n->branch[i]);
228 //
229 //
230 //
231 // }
232 // }
233 // }
234 // return llp;
255
256 rtp.setInt("SeTouchCount", rtp.SeTouchCount+1);
257
258 if (n.level > 0) { /* this is an internal node in the tree */
259 for (i = 0; i < 64; i++)
260 if (n.branch[i].child!=null &&
261 Overlap(r, n.branch[i].rect)) {
262 ST_LeafList_t tlp = RTreeSearch(rtp, (ST_Node_t___) n.branch[i].child, r);
263 if (llp!=null) {
264 ST_LeafList_t xlp = llp;
265 while (xlp.next!=null)
266 xlp = (ST_LeafList_t) xlp.next;
267 xlp.next = tlp;
268 } else
269 llp = tlp;
270 }
271 } else { /* this is a leaf node */
272 for (i = 0; i < 64; i++) {
273 if (n.branch[i].child!=null && Overlap(r, n.branch[i].rect)) {
274 llp = RTreeLeafListAdd(llp, /*(Leaf_t *)*/ n.branch[i]);
275 }
276 }
277 }
278 return llp;
279 } finally {
280 LEAVING("aa69m7d7qc06m8id896e60lkg","RTreeSearch");
281 }
282 }
283
235284 //}
236285 //
237286 ///* Insert a data rectangle into an index structure.
249298
250299 //3 3wss9r0zgt5k06j8ovjv7hq0d
251300 // int RTreeInsert(RTree_t * rtp, Rect_t * r, void *data, Node_t ** n, int level)
252 public static Object RTreeInsert(Object... arg) {
253 UNSUPPORTED("etrjsq5w49uo9jq5pzifohkqw"); // int
254 UNSUPPORTED("4vefy88zis2pcgmerh9m6nllk"); // RTreeInsert(RTree_t * rtp, Rect_t * r, void *data, Node_t ** n, int level)
255 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
256 UNSUPPORTED("8ey3knwkpac8aeth9v8pxu3jo"); // /* RTreeInsert(RTree_t*rtp, Rect_t*r, int data, Node_t**n, int level) { */
257 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
258 UNSUPPORTED("bp3fw6x5k0c1muih5wl2fmk9n"); // register Node_t *newroot;
259 UNSUPPORTED("k2d14nu7r2g4yefydufxqa6l"); // Node_t *newnode=0;
260 UNSUPPORTED("8jhu5fyksz5wgdvvak4rqzjog"); // Branch_t b;
261 UNSUPPORTED("1dfkfq72ilaevpylx2giyequh"); // int result = 0;
262 UNSUPPORTED("3lp95fcfxfbsb08w5umj6mjxb"); // assert(r && n);
263 UNSUPPORTED("jakzrkbz09r9gvlx5yfqsq4t"); // assert(level >= 0 && level <= (*n)->level);
264 UNSUPPORTED("1acecsj25mg52d6624llst9la"); // for (i = 0; i < 2; i++)
265 UNSUPPORTED("au1dzglobtl3y92py1o59k29w"); // assert(r->boundary[i] <= r->boundary[2 + i]);
266 UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
301 public static int RTreeInsert(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n[], int level) {
302 ENTERING("3wss9r0zgt5k06j8ovjv7hq0d","RTreeInsert");
303 try {
304 int i;
305 ST_Node_t___ newroot;
306 ST_Node_t___ newnode[] = new ST_Node_t___[1];
307 final ST_Branch_t b = new ST_Branch_t();
308 int result = 0;
309 // assert(r && n);
310 // assert(level >= 0 && level <= (*n)->level);
311 // for (i = 0; i < 2; i++)
312 // assert(r->boundary[i] <= r->boundary[2 + i]);
313 if (rtp.StatFlag!=0) {
267314 UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
268315 UNSUPPORTED("bzb1oqc35evr96528iv16glb0"); // rtp->ReInsertCount++;
269316 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
270317 UNSUPPORTED("3kxquse3qg2crme5dzybg9jxe"); // rtp->InsertCount++;
271 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
272 UNSUPPORTED("872g4yc6sa8rtep8wdqiys74d"); // if (!rtp->Deleting)
273 UNSUPPORTED("4kv2cwozm6o06e73mjdidn17p"); // rtp->RectCount++;
274 UNSUPPORTED("p721o575619ujgj5774sswe4"); // if (RTreeInsert2(rtp, r, data, *n, &newnode, level)) { /* root was split */
275 UNSUPPORTED("dhd7sfbis7klukcyf8rg2skvp"); // if (rtp->StatFlag) {
318 }
319 if (N(rtp.Deleting))
320 rtp.setInt("RectCount", rtp.RectCount+1);
321 if (RTreeInsert2(rtp, r, data, n[0], newnode, level)!=0) { /* root was split */
322 if (rtp.StatFlag!=0) {
276323 UNSUPPORTED("2y8kv6b3ysrr61q7tqn76rhhc"); // if (rtp->Deleting)
277324 UNSUPPORTED("dn4oynmx9ugizzs5pkxiyptbi"); // rtp->DeTouchCount++;
278325 UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
279326 UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
280 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
281 UNSUPPORTED("f1ubx3a7wizvjmsawzdn97nwy"); // newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */
282 UNSUPPORTED("cb1h5p8jnxwwzvaoyg1k27xmf"); // rtp->NonLeafCount++;
283 UNSUPPORTED("1611m4hdihz2ns6tzb00du4f"); // newroot->level = (*n)->level + 1;
284 UNSUPPORTED("7abewx8c16vuk9ksc6dh0co53"); // b.rect = NodeCover(*n);
285 UNSUPPORTED("465b8w8j2mnvocx78bsxgs0si"); // b.child = *n;
286 UNSUPPORTED("8lf6tafgpibucjtrng2bzhqt"); // AddBranch(rtp, &b, newroot, (void *)0);
287 UNSUPPORTED("5ncet5h2bsh7p0gqx0zcjk8zs"); // b.rect = NodeCover(newnode);
288 UNSUPPORTED("2iec9n0l9utuq5wm6188trocr"); // b.child = newnode;
289 UNSUPPORTED("8lf6tafgpibucjtrng2bzhqt"); // AddBranch(rtp, &b, newroot, (void *)0);
290 UNSUPPORTED("9kv07evealck0kkd4uos4gkz"); // *n = newroot;
291 UNSUPPORTED("6s4qssw97iu3cy7cu2z00dnd"); // // rtp->root = newroot;
292 UNSUPPORTED("5iff078lko2zs9b2cm7erd5kj"); // rtp->EntryCount += 2;
293 UNSUPPORTED("akq58xm5u8sg03eunssjzl44f"); // result = 1;
294 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
295 UNSUPPORTED("e73y2609z2557xahrcvzmcb8e"); // return result;
296 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
297
298 throw new UnsupportedOperationException();
299 }
300
301
302
327 }
328 newroot = RTreeNewNode(rtp); /* grow a new root, make tree taller */
329 rtp.setInt("NonLeafCount", rtp.NonLeafCount+1);
330 newroot.setInt("level", n[0].level + 1);
331 b.setStruct("rect", NodeCover(n[0]));
332 b.child = n[0];
333 AddBranch(rtp, b, newroot, null);
334 b.setStruct("rect", NodeCover(newnode[0]));
335 b.child = newnode[0];
336 AddBranch(rtp, b, newroot, null);
337 n[0] = newroot;
338 // rtp->root = newroot;
339 rtp.setInt("EntryCount", rtp.EntryCount + 2);
340 result = 1;
341 }
342 return result;
343 } finally {
344 LEAVING("3wss9r0zgt5k06j8ovjv7hq0d","RTreeInsert");
345 }
346 }
347
348
349
350 // public static int RTreeInsert(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n[], int level) {
303351
304352 //3 bsc9m7d7qc06m8id896e60lkg
305353 // static int RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data, Node_t * n, Node_t ** new, int level)
306 public static Object RTreeInsert2(Object... arg) {
307 UNSUPPORTED("eyp5xkiyummcoc88ul2b6tkeg"); // static int
308 UNSUPPORTED("e1c7cm1mq875co9obwzzyyxt"); // RTreeInsert2(RTree_t * rtp, Rect_t * r, void *data,
309 UNSUPPORTED("4errdslfbv5x54v81wpgk55l7"); // Node_t * n, Node_t ** new, int level)
310 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
311 UNSUPPORTED("d5termnm5bwrhia82rw6jvi00"); // /*static int */
312 UNSUPPORTED("12ickqloxyobilus63e3bdi65"); // /* RTreeInsert2(RTree_t*rtp, Rect_t*r,
313 UNSUPPORTED("e27l28tilpvjc3y9m1iz6c51k"); // int data, Node_t*n, Node_t**new, int level) {
314 UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
315 UNSUPPORTED("6crctkpvpno5y1bsv7yuqjnm2"); // register int i=0;
316 UNSUPPORTED("8jhu5fyksz5wgdvvak4rqzjog"); // Branch_t b;
317 UNSUPPORTED("4dqkrcduvdmv3d5fgv1enjacs"); // Node_t *n2=0;
318 UNSUPPORTED("bsrr9pvjfr4ki5il3quxx4rqg"); // assert(r && n && new);
319 UNSUPPORTED("5xudi4txe3k13af1mbe43tgbn"); // assert(level >= 0 && level <= n->level);
320 UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
354 public static int RTreeInsert2(ST_RTree rtp, ST_Rect_t r, __ptr__ data, ST_Node_t___ n, ST_Node_t___ new_[], int level) {
355 ENTERING("bsc9m7d7qc06m8id896e60lkg","RTreeInsert2");
356 try {
357 /*static int */
358 /* RTreeInsert2(RTree_t*rtp, Rect_t*r,
359 int data, Node_t*n, Node_t**new, int level) {
360 */
361 int i=0;
362 final ST_Branch_t b = new ST_Branch_t();
363 ST_Node_t___ n2[]=new ST_Node_t___[1];
364 // assert(r && n && new);
365 // assert(level >= 0 && level <= n->level);
366 if (rtp.StatFlag!=0) {
321367 UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
322368 UNSUPPORTED("8k1kgaoa4b2mcye1xthc3f1kf"); // rtp->DeTouchCount++;
323369 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
324370 UNSUPPORTED("1um729vqiy3529kbsrzyl9u3y"); // rtp->InTouchCount++;
325 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
326 UNSUPPORTED("6bsiysfcc9wix18ej9zs9z659"); // /* Still above level for insertion, go down tree recursively */
327 UNSUPPORTED("4hz5jfabrdewpogbs7ahesjld"); // if (n->level > level) {
328 UNSUPPORTED("2sz071aqfm5owiilsfyuw76rn"); // i = PickBranch(r, n);
329 UNSUPPORTED("9qcjfckv31n1pds6m7zevi25p"); // if (!RTreeInsert2(rtp, r, data, n->branch[i].child, &n2, level)) { /* recurse: child was not split */
330 UNSUPPORTED("8yht6usxlnq2ubp9xeqjz71o"); // n->branch[i].rect = CombineRect(r, &(n->branch[i].rect));
331 UNSUPPORTED("6f1138i13x0xz1bf1thxgjgka"); // return 0;
332 UNSUPPORTED("99yufmtztzeyeo68jo3yftbcf"); // } else { /* child was split */
371 }
372 /* Still above level for insertion, go down tree recursively */
373 if (n.level > level) {
374 i = PickBranch(r, n);
375 if (N(RTreeInsert2(rtp, r, data, (ST_Node_t___) n.branch[i].child, n2, level))) {
376 /* recurse: child was not split */
377 n.branch[i].setStruct("rect",
378 CombineRect((ST_Rect_t)r, (ST_Rect_t) n.branch[i].rect));
379 return 0;
380 } else { /* child was split */
333381 UNSUPPORTED("7evrfdq7uc1smqislqm9d82l6"); // n->branch[i].rect = NodeCover(n->branch[i].child);
334382 UNSUPPORTED("echuth2qnq0o4n5gkzgtu5bgs"); // b.child = n2;
335383 UNSUPPORTED("50z4r9qcomgi4o7vvwq0v0xs"); // b.rect = NodeCover(n2);
336384 UNSUPPORTED("451qw2ioqybj69k9abzvqw4mk"); // rtp->EntryCount++;
337385 UNSUPPORTED("9uz11nbvh6yp6yq2axvo7e0fb"); // return AddBranch(rtp, &b, n, new);
338 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
339 UNSUPPORTED("3uu0fkl3xw648hn9rehmuq54y"); // } else if (n->level == level) { /* at level for insertion. */
340 UNSUPPORTED("cwtg3er5fpt2rr0k2efjapdmq"); // /*Add rect, split if necessary */
341 UNSUPPORTED("1xql4kr4r981y1whzdo5zavad"); // b.rect = *r;
342 UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data;
343 UNSUPPORTED("7476ssw2oyxxzrqtz24g9cecp"); // rtp->EntryCount++;
344 UNSUPPORTED("8gejxq93li6nilezate9nd078"); // return AddBranch(rtp, &b, n, new);
345 UNSUPPORTED("an9bctf9o42m97fmlr7tb3xd5"); // } else { /* Not supposed to happen */
386 }
387 } else if (n.level == level) { /* at level for insertion. */
388 /*Add rect, split if necessary */
389 b.rect.___(r);
390 b.child = /*(Node_t *)*/(ST_Node_t___or_object_t) data; // THIS CAST IS A BIG ISSUE
391 // UNSUPPORTED("7w1b5nw2bj3zmo70m9bczwwov"); // b.child = (Node_t *) data;
392 rtp.setInt("EntryCount", rtp.EntryCount+1);
393 return AddBranch(rtp, b, n, new_);
394 } else { /* Not supposed to happen */
346395 UNSUPPORTED("22oqraxnqrjall7fj6pooexmi"); // assert((0));
347396 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
348 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
349 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
350
397 }
351398 throw new UnsupportedOperationException();
399 } finally {
400 LEAVING("bsc9m7d7qc06m8id896e60lkg","RTreeInsert2");
401 }
352402 }
353403
354404
4343 *
4444 */
4545 package gen.lib.label;
46 import static gen.lib.label.rectangle__c.CombineRect;
47 import static gen.lib.label.rectangle__c.InitRect;
48 import static gen.lib.label.rectangle__c.RectArea;
49 import static gen.lib.label.split_q__c.SplitNode;
50 import static smetana.core.JUtilsDebug.ENTERING;
51 import static smetana.core.JUtilsDebug.LEAVING;
4652 import static smetana.core.Macro.UNSUPPORTED;
47 import h.RTree;
48 import h._Node_t___;
49 import smetana.core.Memory;
53 import h.ST_Branch_t;
54 import h.ST_Node_t___;
55 import h.ST_RTree;
56 import h.ST_Rect_t;
5057
5158 public class node__c {
5259
5360
5461 //3 9uj7ni1m6q6drtoh56w82d6m4
5562 // Node_t *RTreeNewNode(RTree_t * rtp)
56 public static _Node_t___ RTreeNewNode(RTree rtp) {
57 _Node_t___ n;
58 rtp.setInt("NodeCount", rtp.getInt("NodeCount") + 1);
59 n = (_Node_t___) Memory.malloc(_Node_t___.class);
60 UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
61 UNSUPPORTED("69hc24ic55i66g8tf2ne42327"); // return n;
62 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
63
64 throw new UnsupportedOperationException();
63 public static ST_Node_t___ RTreeNewNode(ST_RTree rtp) {
64 ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
65 try {
66 ST_Node_t___ n;
67 rtp.setInt("NodeCount", rtp.NodeCount + 1);
68 n = new ST_Node_t___();
69 InitNode(n);
70 return n;
71 } finally {
72 LEAVING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
73 }
6574 }
6675
6776
8897
8998 //3 4qk9wkm05q2pwf20ud6g2tufg
9099 // void InitNode(Node_t * n)
91 public static Object InitNode(Object... arg) {
92 UNSUPPORTED("dlpky13v9fa11z9uukagldaj1"); // void InitNode(Node_t * n)
93 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
94 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
95 UNSUPPORTED("7rbjc9psqd4hoib2lezl7pnh"); // n->count = 0;
96 UNSUPPORTED("55ukro5lb2mre4owzaww8q2hc"); // n->level = -1;
97 UNSUPPORTED("8v5nz5apd36odx9nwrk8p8jow"); // for (i = 0; i < 64; i++)
98 UNSUPPORTED("80i9o3c1pvhadp8xg5nka4k0z"); // InitBranch(&(n->branch[i]));
99 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
100
101 throw new UnsupportedOperationException();
100 public static void InitNode(ST_Node_t___ n) {
101 ENTERING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
102 try {
103 int i;
104 n.setInt("count", 0);
105 n.setInt("level", -1);
106 for (i = 0; i < 64; i++)
107 InitBranch(n.branch[i]);
108 // InitBranch(&(n->branch[i]));
109 } finally {
110 LEAVING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
111 }
102112 }
103113
104114
106116
107117 //3 ruhxixxei7au9z1iaj0zggwo
108118 // void InitBranch(Branch_t * b)
109 public static Object InitBranch(Object... arg) {
110 UNSUPPORTED("2ds4g44o2u9jlcjegxiplx78k"); // void InitBranch(Branch_t * b)
111 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
112 UNSUPPORTED("7tixqnx33892tw39ys6j048c9"); // InitRect(&(b->rect));
113 UNSUPPORTED("6rffpszutr9tr32hwasnosx1l"); // b->child = NULL;
114 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
115
116 throw new UnsupportedOperationException();
119 public static void InitBranch(ST_Branch_t b) {
120 ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
121 try {
122 InitRect(b.rect);
123 b.child = null;
124 } finally {
125 LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
126 }
117127 }
118128
119129
121131
122132 //3 42vjqe8n5yeq2jjby00xzrotk
123133 // Rect_t NodeCover(Node_t * n)
124 public static Object NodeCover(Object... arg) {
125 UNSUPPORTED("2khwamjri7uz3vu8fhl4bz8yr"); // Rect_t NodeCover(Node_t * n)
126 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
127 UNSUPPORTED("e4wfnyowhq6r7cll9ebbr5pcr"); // register int i, flag;
128 UNSUPPORTED("9jotn4njsd13qx406m9otorg4"); // Rect_t r;
129 UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
130 UNSUPPORTED("7t0m2a3824uy7f5r4wu3p2no9"); // InitRect(&r);
131 UNSUPPORTED("e0yg2emzy8u4jgn9z7jdfpziq"); // flag = 1;
132 UNSUPPORTED("8v5nz5apd36odx9nwrk8p8jow"); // for (i = 0; i < 64; i++)
133 UNSUPPORTED("1ro7ykl3rxfkkcyghzozikkfc"); // if (n->branch[i].child) {
134 UNSUPPORTED("ycid67impnxkwa9mvvkvdu0q"); // if (flag) {
135 UNSUPPORTED("ektombc80083wiu0lsj6kto83"); // r = n->branch[i].rect;
136 UNSUPPORTED("6bejndin7u1ns7xicz114gqtn"); // flag = 0;
137 UNSUPPORTED("afk9bpom7x393euamnvwwkx6b"); // } else
138 UNSUPPORTED("31n3s0xk5l7s3rhi9xeraiklo"); // r = CombineRect(&r, &(n->branch[i].rect));
139 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
140 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
141 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
142
143 throw new UnsupportedOperationException();
134 public static ST_Rect_t NodeCover(ST_Node_t___ n) {
135 ENTERING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
136 try {
137 int i, flag;
138 final ST_Rect_t r = new ST_Rect_t();
139 // assert(n);
140 InitRect(r);
141 flag = 1;
142 for (i = 0; i < 64; i++)
143 if (n.branch[i].child!=null) {
144 if (flag!=0) {
145 r.___(n.branch[i].rect);
146 flag = 0;
147 } else
148 r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect));
149 }
150 return r;
151 } finally {
152 LEAVING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
153 }
144154 }
145155
146156
148158
149159 //3 bek56v2skz6jfvw4uggy2h5w3
150160 // int PickBranch(Rect_t * r, Node_t * n)
151 public static Object PickBranch(Object... arg) {
152 UNSUPPORTED("efxc8619milx7pkmu113b8cl0"); // int PickBranch(Rect_t * r, Node_t * n)
153 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
154 UNSUPPORTED("4rx3my7ninlw252mkhq0t72v7"); // register Rect_t *rr=0;
155 UNSUPPORTED("cu5ueogqdqm7ym79nlop077f9"); // register int i=0, flag=1, increase=0, bestIncr=0, area=0, bestArea=0;
156 UNSUPPORTED("b5pkdhy36omd5ubfol2jsyr2z"); // int best=0;
157 UNSUPPORTED("3lp95fcfxfbsb08w5umj6mjxb"); // assert(r && n);
158 UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
159 UNSUPPORTED("1ro7ykl3rxfkkcyghzozikkfc"); // if (n->branch[i].child) {
160 UNSUPPORTED("4wt347mvef1i2kr5h5z9l0g8i"); // Rect_t rect;
161 UNSUPPORTED("ak8qz4z2mipw1i6img1tvc3hk"); // rr = &n->branch[i].rect;
162 UNSUPPORTED("d4pnse7tksvywt9f6rcaluv8e"); // area = RectArea(rr);
163 UNSUPPORTED("4wsrjtivlov1p70rt8tn4dt9v"); // /* increase = RectArea(&CombineRect(r, rr)) - area; */
164 UNSUPPORTED("8b9or9d0f959zrx6zrd0o9noj"); // rect = CombineRect(r, rr);
165 UNSUPPORTED("a1p1sz58nzxnj53fxzzkut6cm"); // increase = RectArea(&rect) - area;
166 UNSUPPORTED("6k6tiifs973t6iordeclfqygk"); // if (increase < bestIncr || flag) {
167 UNSUPPORTED("93dpfupbht4p3y9bsui3n8km4"); // best = i;
168 UNSUPPORTED("apb6b50as71d87ge91yfjwr33"); // bestArea = area;
169 UNSUPPORTED("45tyhbogdetuq767acgw0cvyg"); // bestIncr = increase;
170 UNSUPPORTED("6bejndin7u1ns7xicz114gqtn"); // flag = 0;
171 UNSUPPORTED("1wqm4msrcepk5ixg5ab8polj7"); // } else if (increase == bestIncr && area < bestArea) {
172 UNSUPPORTED("93dpfupbht4p3y9bsui3n8km4"); // best = i;
173 UNSUPPORTED("apb6b50as71d87ge91yfjwr33"); // bestArea = area;
174 UNSUPPORTED("45tyhbogdetuq767acgw0cvyg"); // bestIncr = increase;
175 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
176 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
177 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
178 UNSUPPORTED("3kkxvbiqcsdmtjhhw3b2jcqcy"); // return best;
179 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
180
181 throw new UnsupportedOperationException();
161 public static int PickBranch(ST_Rect_t r, ST_Node_t___ n) {
162 ENTERING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
163 try {
164 ST_Rect_t rr=null;
165 int i=0, flag=1, increase=0, bestIncr=0, area=0, bestArea=0;
166 int best=0;
167 // assert(r && n);
168 for (i = 0; i < 64; i++) {
169 if (n.branch[i].child!=null) {
170 final ST_Rect_t rect = new ST_Rect_t();
171 rr = (ST_Rect_t) n.branch[i].rect;
172 area = RectArea((ST_Rect_t) rr);
173 /* increase = RectArea(&CombineRect(r, rr)) - area; */
174 rect.___(CombineRect((ST_Rect_t) r, rr));
175 increase = RectArea((ST_Rect_t) rect) - area;
176 if (increase < bestIncr || flag!=0) {
177 best = i;
178 bestArea = area;
179 bestIncr = increase;
180 flag = 0;
181 } else if (increase == bestIncr && area < bestArea) {
182 best = i;
183 bestArea = area;
184 bestIncr = increase;
185 }
186 }
187 }
188 return best;
189 } finally {
190 LEAVING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
191 }
182192 }
183193
184194
186196
187197 //3 2njctcrpeff95ysmv9ji34x4s
188198 // int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new)
189 public static Object AddBranch(Object... arg) {
190 UNSUPPORTED("abswgz0jexhhyl0we1x68i5gl"); // int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new)
191 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
192 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
193 UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
194 UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
195 UNSUPPORTED("8irlja6ar7hjh8mel91hltz17"); // if (n->count < 64) { /* split won't be necessary */
196 UNSUPPORTED("8vlryher8oaw4h715yfzs4h0"); // for (i = 0; i < 64; i++) { /* find empty branch */
197 UNSUPPORTED("3eaeba8b8yt8gq9074wtep0e0"); // if (n->branch[i].child == NULL) {
198 UNSUPPORTED("9newc1m7r062crcakg2dn00kp"); // n->branch[i] = *b;
199 UNSUPPORTED("b4orzj362grzvud5mj73w1cb1"); // n->count++;
200 UNSUPPORTED("9ekmvj13iaml5ndszqyxa8eq"); // break;
201 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
202 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
203 UNSUPPORTED("2gjzrafpfll8afj90mhedcnnq"); // assert(i < 64);
204 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
205 UNSUPPORTED("c07up7zvrnu2vhzy6d7zcu94g"); // } else {
206 UNSUPPORTED("dhd7sfbis7klukcyf8rg2skvp"); // if (rtp->StatFlag) {
199 public static int AddBranch(ST_RTree rtp, ST_Branch_t b, ST_Node_t___ n, ST_Node_t___ new_[]) {
200 ENTERING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
201 try {
202 int i;
203 // assert(b);
204 // assert(n);
205 if (n.count < 64) { /* split won't be necessary */
206 for (i = 0; i < 64; i++) { /* find empty branch */
207 if (n.branch[i].child == null) {
208 n.branch[i].___(b.getStruct());
209 n.setInt("count", n.count+1);
210 break;
211 }
212 }
213 // assert(i < 64);
214 return 0;
215 } else {
216 if (rtp.StatFlag!=0) {
207217 UNSUPPORTED("2y8kv6b3ysrr61q7tqn76rhhc"); // if (rtp->Deleting)
208218 UNSUPPORTED("dn4oynmx9ugizzs5pkxiyptbi"); // rtp->DeTouchCount++;
209219 UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // else
210220 UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // rtp->InTouchCount++;
211 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
212 UNSUPPORTED("chipmsvc1hum7sbmvzrfmewz6"); // assert(new);
213 UNSUPPORTED("91mdffv90jr6ypnu3u1bmc972"); // SplitNode(rtp, n, b, new);
214 UNSUPPORTED("1t8cl7q3utcr23gvhtgc1cp0u"); // if (n->level == 0)
215 UNSUPPORTED("b2cc70cq7gpras4l3rbz241at"); // rtp->LeafCount++;
216 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
221 }
222 // assert(new);
223 SplitNode(rtp, n, b, new_);
224 if (n.level == 0)
225 rtp.setInt("LeafCount", rtp.LeafCount+1);
226 else
217227 UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // rtp->NonLeafCount++;
218 UNSUPPORTED("eleqpc2p2r3hvma6tipoy7tr"); // return 1;
219 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
220 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
221
222 throw new UnsupportedOperationException();
228 return 1;
229 }
230 } finally {
231 LEAVING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
232 }
223233 }
224234
225235
227237
228238 //3 eqzamflj58f43cflwns9cemnk
229239 // void DisconBranch(Node_t * n, int i)
230 public static Object DisconBranch(Object... arg) {
231 UNSUPPORTED("1gbs5xw4y9htfbc5suxq1rdm4"); // void DisconBranch(Node_t * n, int i)
232 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
233 UNSUPPORTED("ays33wicr9a5qwu2dr9g8t1h2"); // assert(n && i >= 0 && i < 64);
234 UNSUPPORTED("29zl8z52z6bh8yxdkmezbs82l"); // assert(n->branch[i].child);
235 UNSUPPORTED("3rvakcl9f71ez4zya83f1vvgx"); // InitBranch(&(n->branch[i]));
236 UNSUPPORTED("4a3m9b5jmmhd18oa8nzovalys"); // n->count--;
237 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
238
239 throw new UnsupportedOperationException();
240 }
241
242
243 }
240 public static void DisconBranch(ST_Node_t___ n, int i) {
241 ENTERING("eqzamflj58f43cflwns9cemnk","DisconBranch");
242 try {
243 // assert(n && i >= 0 && i < 64);
244 // assert(n->branch[i].child);
245 InitBranch(n.branch[i]);
246 n.setInt("count", n.count-1);
247 } finally {
248 LEAVING("eqzamflj58f43cflwns9cemnk","DisconBranch");
249 }
250 }
251
252
253 }
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.pointf;
50 import smetana.core.JUtils;
51 import smetana.core.__struct__;
49 import h.ST_pointf;
5250
5351 public class nrtmain__c {
5452 //1 2digov3edok6d5srhgtlmrycs
163161
164162 //3 c1s4k85p1cdfn176o3uryeros
165163 // static inline pointf pointfof(double x, double y)
166 public static __struct__<pointf> pointfof(double x, double y) {
164 public static ST_pointf pointfof(double x, double y) {
167165 // WARNING!! STRUCT
168166 return pointfof_w_(x, y).copy();
169167 }
170 private static __struct__<pointf> pointfof_w_(double x, double y) {
168 private static ST_pointf pointfof_w_(double x, double y) {
171169 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
172170 try {
173 final __struct__<pointf> r = JUtils.from(pointf.class);
171 final ST_pointf r = new ST_pointf();
174172 r.setDouble("x", x);
175173 r.setDouble("y", y);
176174 return r;
4343 *
4444 */
4545 package gen.lib.label;
46 import static smetana.core.JUtilsDebug.ENTERING;
47 import static smetana.core.JUtilsDebug.LEAVING;
48 import static smetana.core.Macro.N;
4649 import static smetana.core.Macro.UNSUPPORTED;
50 import h.ST_Rect_t;
4751
4852 public class rectangle__c {
4953 //1 9k44uhd5foylaeoekf3llonjq
146150
147151 //3 1wtvfzwbzj03e6w5rw4k7qdax
148152 // void InitRect(Rect_t * r)
149 public static Object InitRect(Object... arg) {
150 UNSUPPORTED("bfynnbut17s29886tfi4hmp71"); // void InitRect(Rect_t * r)
151 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
152 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
153 UNSUPPORTED("6v26zqmzay64h92bxd4qt6qgs"); // for (i = 0; i < 2*2; i++)
154 UNSUPPORTED("d3uknh6sy0xxecd62dbcemd5p"); // r->boundary[i] = 0;
155 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
156
157 throw new UnsupportedOperationException();
153 public static void InitRect(ST_Rect_t r) {
154 ENTERING("1wtvfzwbzj03e6w5rw4k7qdax","InitRect");
155 try {
156 int i;
157 for (i = 0; i < 2*2; i++)
158 r.boundary[i]=0;
159 } finally {
160 LEAVING("1wtvfzwbzj03e6w5rw4k7qdax","InitRect");
161 }
158162 }
159163
160164
162166
163167 //3 bvazxgli5q4yxvzl5kn1vjqpm
164168 // Rect_t NullRect()
165 public static Object NullRect(Object... arg) {
166 UNSUPPORTED("7bfeg4qbgfa72qeao4zmwznat"); // Rect_t NullRect()
167 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
168 UNSUPPORTED("9jotn4njsd13qx406m9otorg4"); // Rect_t r;
169 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
170 UNSUPPORTED("4cmj0swptez35tqafqf86bskl"); // r.boundary[0] = 1;
171 UNSUPPORTED("6lzrqh8r1olplqcbtz1n5dow7"); // r.boundary[2] = -1;
172 UNSUPPORTED("ol4wmdbmn9kjw3hpmp2gwavz"); // for (i = 1; i < 2; i++)
173 UNSUPPORTED("9xr8ijrn07laqlacrzelzczxa"); // r.boundary[i] = r.boundary[i + 2] = 0;
174 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
175 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
176
177 throw new UnsupportedOperationException();
169 public static ST_Rect_t NullRect() {
170 ENTERING("bvazxgli5q4yxvzl5kn1vjqpm","NullRect");
171 try {
172 ST_Rect_t r = new ST_Rect_t();
173 int i;
174 r.boundary[0]=1;
175 r.boundary[2]=-1;
176 for (i = 1; i < 2; i++) {
177 r.boundary[i]=0;
178 r.boundary[i+2]=0;
179 }
180 return r;
181 } finally {
182 LEAVING("bvazxgli5q4yxvzl5kn1vjqpm","NullRect");
183 }
178184 }
179185
180186
182188
183189 //3 1ijarur71gcahchxz8vqf69na
184190 // unsigned int RectArea(Rect_t * r)
185 public static Object RectArea(Object... arg) {
186 UNSUPPORTED("dt9366zeifsgcei4onz0fdt4i"); // unsigned int RectArea(Rect_t * r)
187 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
188 UNSUPPORTED("9cyat6ft4tmgpumn70l9fwydy"); // register int i;
189 UNSUPPORTED("eep6ne1fnwvxrzmao6aq2e80t"); // unsigned int area=1, a=1;
190 UNSUPPORTED("bxtlpefe142w9pb81aa0gkkcj"); // assert(r);
191 UNSUPPORTED("7xe9zz3f2fwhfptig6esqvb1t"); // if (((r)->boundary[0] > (r)->boundary[2])) return 0;
192 UNSUPPORTED("9gsgfs2guis9c3c3oi57mxpq2"); // /*
193 UNSUPPORTED("asaz8qrby7qugc5m3ylnjg6o7"); // * XXX add overflow checks
194 UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
195 UNSUPPORTED("17o3f4aat9tkp17wsngm29nst"); // area = 1;
196 UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
197 UNSUPPORTED("6g0ik6vssf9px33quo2z9ferr"); // unsigned int b = r->boundary[i + 2] - r->boundary[i];
198 UNSUPPORTED("7tqqzmxu3tsfxccs53evs54me"); // a *= b;
199 UNSUPPORTED("3u7h4981b69nu4w80bhv3s4q"); // if( (a / b ) != area) {
191 public static int RectArea(ST_Rect_t r) {
192 ENTERING("1ijarur71gcahchxz8vqf69na","RectArea");
193 try {
194 int i;
195 int area=1, a=1;
196 // assert(r);
197 if (r.boundary[0] > r.boundary[2]) return 0;
198 /*
199 * XXX add overflow checks
200 */
201 area = 1;
202 for (i = 0; i < 2; i++) {
203 int b = r.boundary[i+2] - r.boundary[i];
204 a *= b;
205 if( (a / b ) != area) {
200206 UNSUPPORTED("6qc59bm54jy4hv9gw8a50rk0u"); // agerr (AGERR, "label: area too large for rtree\n");
201207 UNSUPPORTED("awx87c59fwl0w8r64jfd86jrd"); // return UINT_MAX;
202 UNSUPPORTED("dquo3qofk56ds5xl95lhvcthf"); // }
203 UNSUPPORTED("b34qh5cr4ie1y00nbl91sn2km"); // area = a;
204 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
205 UNSUPPORTED("9ww3ox2wqjgbtsin4e26qgoyx"); // return area;
206 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
207
208 throw new UnsupportedOperationException();
208 }
209 area = a;
210 }
211 return area;
212 } finally {
213 LEAVING("1ijarur71gcahchxz8vqf69na","RectArea");
214 }
209215 }
210216
211217
213219
214220 //3 tgmhi1wshyhqky2pappb6w6w
215221 // Rect_t CombineRect(Rect_t * r, Rect_t * rr)
216 public static Object CombineRect(Object... arg) {
217 UNSUPPORTED("18ebi8xfcz225jqpfk5vtp9hf"); // Rect_t CombineRect(Rect_t * r, Rect_t * rr)
218 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
219 UNSUPPORTED("7gcww32g3xx6yjb9m2tgq8f7c"); // register int i, j;
220 UNSUPPORTED("ep1c21oj5vdbkci5nklq26u6d"); // Rect_t new;
221 UNSUPPORTED("8woqwn01hzllzlrb8an6apviw"); // assert(r && rr);
222 UNSUPPORTED("61el74qdlszr9b7htgajgnncw"); // if (((r)->boundary[0] > (r)->boundary[2]))
223 UNSUPPORTED("26gbreijuodtzexgobqd73u1p"); // return *rr;
224 UNSUPPORTED("9c5jzil5a7hm4bfzytn0e7aww"); // if (((rr)->boundary[0] > (rr)->boundary[2]))
225 UNSUPPORTED("h0psmi4ydywx720mvhp33x5g"); // return *r;
226 UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
227 UNSUPPORTED("1p51ro3v4iw4nogctzk3y0bts"); // new.boundary[i] = MIN(r->boundary[i], rr->boundary[i]);
228 UNSUPPORTED("2h0ee6s8hk7srb6xqmnfluf52"); // j = i + 2;
229 UNSUPPORTED("3cljcok8kw06fphxnu0183g4"); // new.boundary[j] = MAX(r->boundary[j], rr->boundary[j]);
230 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
231 UNSUPPORTED("4b8pgvy3c1dhlanxwmafau4pt"); // return new;
232 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
233
234 throw new UnsupportedOperationException();
222 public static ST_Rect_t CombineRect(ST_Rect_t r, ST_Rect_t rr) {
223 ENTERING("tgmhi1wshyhqky2pappb6w6w","CombineRect");
224 try {
225 int i, j;
226 ST_Rect_t new_ = new ST_Rect_t();
227 // assert(r && rr);
228 if (r.boundary[0] > r.boundary[2])
229 return (ST_Rect_t) rr.copy();
230 if (rr.boundary[0] > rr.boundary[2])
231 return (ST_Rect_t) r.copy();
232 for (i = 0; i < 2; i++) {
233 new_.boundary[i] = Math.min(r.boundary[i], rr.boundary[i]);
234 j = i + 2;
235 new_.boundary[j] = Math.max(r.boundary[j], rr.boundary[j]);
236 }
237 return new_;
238 } finally {
239 LEAVING("tgmhi1wshyhqky2pappb6w6w","CombineRect");
240 }
235241 }
236242
237243
239245
240246 //3 9glce34jzknoqj98agg96k03o
241247 // int Overlap(Rect_t * r, Rect_t * s)
242 public static Object Overlap(Object... arg) {
243 UNSUPPORTED("75f545jos6v3su84hbt728wxr"); // int Overlap(Rect_t * r, Rect_t * s)
244 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
245 UNSUPPORTED("7gcww32g3xx6yjb9m2tgq8f7c"); // register int i, j;
246 UNSUPPORTED("3ilt6jfw7dcaebocva6xawiui"); // assert(r && s);
247 UNSUPPORTED("6xp61z8h2baoxnlm757q289e3"); // for (i = 0; i < 2; i++) {
248 UNSUPPORTED("71gqfx1xze9ccjzy9ids9x8cj"); // j = i + 2; /* index for high sides */
249 UNSUPPORTED("b41yx5qm8jqsnyojyaztg6wy1"); // if (r->boundary[i] > s->boundary[j]
250 UNSUPPORTED("cjb3lqf10yggej4b0uh9acc72"); // || s->boundary[i] > r->boundary[j])
251 UNSUPPORTED("8tnlb2txucdutal7665h0v68g"); // return (0);
252 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
253 UNSUPPORTED("4si0cf97a5sfd9ozuunds9goz"); // return (!(0));
254 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
255
256 throw new UnsupportedOperationException();
248 public static boolean Overlap(ST_Rect_t r, ST_Rect_t s) {
249 ENTERING("9glce34jzknoqj98agg96k03o","Overlap");
250 try {
251 int i, j;
252 // assert(r && s);
253 for (i = 0; i < 2; i++) {
254 j = i + 2; /* index for high sides */
255 if (r.boundary[i] > s.boundary[j]
256 || s.boundary[i] > r.boundary[j])
257 return false;
258 }
259 return (N(0));
260 } finally {
261 LEAVING("9glce34jzknoqj98agg96k03o","Overlap");
262 }
257263 }
258264
259265
4343 *
4444 */
4545 package gen.lib.label;
46 import static gen.lib.label.node__c.AddBranch;
47 import static gen.lib.label.node__c.InitNode;
48 import static gen.lib.label.node__c.RTreeNewNode;
49 import static gen.lib.label.rectangle__c.CombineRect;
50 import static gen.lib.label.rectangle__c.NullRect;
51 import static gen.lib.label.rectangle__c.RectArea;
52 import static smetana.core.JUtilsDebug.ENTERING;
53 import static smetana.core.JUtilsDebug.LEAVING;
54 import static smetana.core.Macro.N;
4655 import static smetana.core.Macro.UNSUPPORTED;
56 import h.Branch_t;
57 import h.ST_Branch_t;
58 import h.ST_Node_t___;
59 import h.ST_PartitionVars;
60 import h.ST_RTree;
61 import h.ST_Rect_t;
4762
4863 public class split_q__c {
4964
5065
5166 //3 6vl3snxd6k95gamfkwfsfdguc
5267 // void SplitNode(RTree_t * rtp, Node_t * n, Branch_t * b, Node_t ** nn)
53 public static Object SplitNode(Object... arg) {
54 UNSUPPORTED("78ce6yisssjvu8419g3hps65l"); // void SplitNode(RTree_t * rtp, Node_t * n, Branch_t * b, Node_t ** nn)
55 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
56 UNSUPPORTED("ajyfxc076ll1tzroielljxa4s"); // register struct PartitionVars *p;
57 UNSUPPORTED("8jufm5xh68khkqy7z1kcdmesw"); // register int level;
58 UNSUPPORTED("7bskhxl3c4vhiobuvlm02c79c"); // int area;
59 UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
60 UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
61 UNSUPPORTED("21ol6vbghnu1ewovfs645sts7"); // if (rtp->StatFlag) {
68 public static void SplitNode(ST_RTree rtp, ST_Node_t___ n, ST_Branch_t b, ST_Node_t___ nn[]) {
69 ENTERING("6vl3snxd6k95gamfkwfsfdguc","SplitNode");
70 try {
71 ST_PartitionVars p;
72 int level;
73 int area;
74 // assert(n);
75 // assert(b);
76 if (rtp.StatFlag!=0) {
6277 UNSUPPORTED("akhni40ndam0u9c6i7raxw4mp"); // if (rtp->Deleting)
6378 UNSUPPORTED("4g80zdlbvunm838x8g3ic9tex"); // rtp->DeSplitCount++;
6479 UNSUPPORTED("9352ql3e58qs4fzapgjfrms2s"); // else
6580 UNSUPPORTED("2cjo6wz1rmxfm5k7u7rw5dqpj"); // rtp->InSplitCount++;
66 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
67 UNSUPPORTED("8396srmzb1jm8lij0ngslpcrf"); // /* load all the branches into a buffer, initialize old node */
68 UNSUPPORTED("21fuexra37tdi6sx7rtjdg1nj"); // level = n->level;
69 UNSUPPORTED("bqz4krdoll1zhnuqj6zgotbcu"); // GetBranches(rtp, n, b);
70 UNSUPPORTED("hdjjn3pouo1k1eq8y4x0nmxs"); // /* find partition */
71 UNSUPPORTED("prf503ssj57ewtg2w9ypvt6"); // p = &rtp->split.Partitions[0];
72 UNSUPPORTED("e5s838qmpxfzesnb90fmga2th"); // MethodZero(rtp);
73 UNSUPPORTED("e2qxl0u7yon3spy2kr56ah1lx"); // area = RectArea(&p->cover[0]) + RectArea(&p->cover[1]);
74 UNSUPPORTED("bqvd9kyv5qlcddypjudg6lwpl"); // /* record how good the split was for statistics */
75 UNSUPPORTED("9isnpzrwseyh76rz7fawgkdyw"); // if (rtp->StatFlag && !rtp->Deleting && area)
81 }
82 /* load all the branches into a buffer, initialize old node */
83 level = n.level;
84 GetBranches(rtp, n, b);
85 /* find partition */
86 p = rtp.split.Partitions[0];
87 MethodZero(rtp);
88 area = RectArea((ST_Rect_t)p.cover[0]) + RectArea((ST_Rect_t)p.cover[1]);
89 /* record how good the split was for statistics */
90 if (rtp.StatFlag!=0 && N(rtp.Deleting) && area!=0)
7691 UNSUPPORTED("z7xk6s3hzi3qcoiq2exj9hpv"); // rtp->SplitMeritSum += (float) rtp->split.CoverSplitArea / area;
77 UNSUPPORTED("dytz8fm640zs5ercfjtork8u2"); // /* put branches from buffer into 2 nodes according to chosen partition */
78 UNSUPPORTED("3vka4yfkd2kilsogvopxmh6ry"); // *nn = RTreeNewNode(rtp);
79 UNSUPPORTED("3wybhajryp9yjj3lxvzuiv7p9"); // (*nn)->level = n->level = level;
80 UNSUPPORTED("izrbnvm6p45dy2xfr3265jdf"); // LoadNodes(rtp, n, *nn, p);
81 UNSUPPORTED("e0lxlkm80cy0577wy8jdxbhq9"); // assert(n->count + (*nn)->count == 64 + 1);
82 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
83
84 throw new UnsupportedOperationException();
92 /* put branches from buffer into 2 nodes according to chosen partition */
93 nn[0] = RTreeNewNode(rtp);
94 n.setInt("level", level);
95 nn[0].setInt("level", level);
96 LoadNodes(rtp, n, nn[0], p);
97 // assert(n->count + (*nn)->count == 64 + 1);
98 } finally {
99 LEAVING("6vl3snxd6k95gamfkwfsfdguc","SplitNode");
100 }
85101 }
86102
87103
89105
90106 //3 al7lyin008m7kvrvuxhcuvn61
91107 // static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
92 public static Object GetBranches(Object... arg) {
93 UNSUPPORTED("378qaodt9k6ytly4svwl41z9w"); // static void GetBranches(RTree_t * rtp, Node_t * n, Branch_t * b)
94 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
95 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
96 UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
97 UNSUPPORTED("5xtwc50ov4mxby7k6gahwv12t"); // assert(b);
98 UNSUPPORTED("4oznkldmd6dyb0i9hwec78vcs"); // /* load the branch buffer */
99 UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
100 UNSUPPORTED("8q6h71l7igid38ccu2eiu2u59"); // assert(n->branch[i].child); /* node should have every entry full */
101 UNSUPPORTED("gimqiz18hbjhs9folzw2kmv9"); // rtp->split.BranchBuf[i] = n->branch[i];
102 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
103 UNSUPPORTED("e53m9mpp58nv3640vo2p82rdv"); // rtp->split.BranchBuf[64] = *b;
104 UNSUPPORTED("277onaphbigykl17b8k9ucsw3"); // /* calculate rect containing all in the set */
105 UNSUPPORTED("ea4y9kg2yx11whdarwr9up60y"); // rtp->split.CoverSplit = rtp->split.BranchBuf[0].rect;
106 UNSUPPORTED("27yzy7ezx5w65cas3232s6j4m"); // for (i = 1; i < 64 + 1; i++) {
107 UNSUPPORTED("4qq8r3ecwl603g3xs97658ebu"); // rtp->split.CoverSplit = CombineRect(&rtp->split.CoverSplit,
108 UNSUPPORTED("8fgchf6ahna7tcxprht01sodq"); // &rtp->split.BranchBuf[i].rect);
109 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
110 UNSUPPORTED("8kobdqnp7t9xhtshqkemby6us"); // rtp->split.CoverSplitArea = RectArea(&rtp->split.CoverSplit);
111 UNSUPPORTED("a4ey5uckjqallol1ktyqe35bv"); // InitNode(n);
112 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
113
114 throw new UnsupportedOperationException();
108 public static void GetBranches(ST_RTree rtp, ST_Node_t___ n, ST_Branch_t b) {
109 ENTERING("al7lyin008m7kvrvuxhcuvn61","GetBranches");
110 try {
111 int i;
112 // assert(n);
113 // assert(b);
114 /* load the branch buffer */
115 for (i = 0; i < 64; i++) {
116 // assert(n->branch[i].child); /* node should have every entry full */
117 rtp.split.BranchBuf[i].___(n.branch[i]);
118 }
119 rtp.split.BranchBuf[64].___(b);
120 /* calculate rect containing all in the set */
121 rtp.split.CoverSplit.___(rtp.split.BranchBuf[0].rect);
122 for (i = 1; i < 64 + 1; i++) {
123 rtp.split.setStruct("CoverSplit",
124 CombineRect((ST_Rect_t)rtp.split.CoverSplit,
125 (ST_Rect_t)rtp.split.BranchBuf[i].castTo(ST_Rect_t.class)));
126 }
127 rtp.split.setInt("CoverSplitArea", RectArea((ST_Rect_t)rtp.split.CoverSplit));
128 InitNode(n);
129 } finally {
130 LEAVING("al7lyin008m7kvrvuxhcuvn61","GetBranches");
131 }
115132 }
116133
117134
119136
120137 //3 4woz5xy4gjlahoj7no3ljxmex
121138 // static void MethodZero(RTree_t * rtp)
122 public static Object MethodZero(Object... arg) {
123 UNSUPPORTED("4skckzef98x4fz6mws7s1ya15"); // static void MethodZero(RTree_t * rtp)
124 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
125 UNSUPPORTED("cdtuwprcw1d3bn91v9sde844l"); // register Rect_t *r;
126 UNSUPPORTED("ackphjde797dk6rshtiyv1ydx"); // register int i, growth0, growth1, diff, biggestDiff;
127 UNSUPPORTED("5lh1z9jfdefgm50i9fgjjzf8q"); // register int group, chosen, betterGroup;
128 UNSUPPORTED("6y4x18eeg7eay10tbawh6myhr"); // InitPVars(rtp);
129 UNSUPPORTED("5tz02egfuze5n9nquye65i9lr"); // PickSeeds(rtp);
130 UNSUPPORTED("59gdg3tgr5tyx6gkffgutcpn7"); // while (rtp->split.Partitions[0].count[0] +
131 UNSUPPORTED("7e0o94342ckw0syu4j0m8vyml"); // rtp->split.Partitions[0].count[1] < 64 + 1 &&
132 UNSUPPORTED("3kmgnkrx7ku1nnb7vprgwnfvt"); // rtp->split.Partitions[0].count[0] < 64 + 1 - rtp->MinFill
133 UNSUPPORTED("9efzei446ga5t6kd5zstv3mat"); // && rtp->split.Partitions[0].count[1] <
134 UNSUPPORTED("cxlhyya4bw33nn0kxhwtgj7ni"); // 64 + 1 - rtp->MinFill) {
135 UNSUPPORTED("1e60en5izveud5k83xw9vkxwy"); // biggestDiff = -1;
136 UNSUPPORTED("2x1nx9nsne4x3ygmcywl1m3og"); // for (i = 0; i < 64 + 1; i++) {
137 UNSUPPORTED("4c65v1kbz8jvl3tmy8gyj66qi"); // if (!rtp->split.Partitions[0].taken[i]) {
138 UNSUPPORTED("6qli7mcgtgb1ne6pl33r3okkj"); // Rect_t rect;
139 UNSUPPORTED("9tqgad4ybio0vj8j5qgol8sqe"); // r = &rtp->split.BranchBuf[i].rect;
140 UNSUPPORTED("9xitbkq1bfy3lqwrboyzd3wk0"); // /* growth0 = RectArea(&CombineRect(r,
141 UNSUPPORTED("bqznmsnmx0j2z1sfi1s0rtx0t"); // &rtp->split.Partitions[0].cover[0])) -
142 UNSUPPORTED("6tdjjnpjjde476wvn4ez9gy0h"); // rtp->split.Partitions[0].area[0];
143 UNSUPPORTED("edw1ss2r31mqgsvca2gowi52v"); // */
144 UNSUPPORTED("b2awl1bpq2krcq7yjahwzc77s"); // /* growth1 = RectArea(&CombineRect(r,
145 UNSUPPORTED("bkjabgaskndtlequuc8ahat39"); // &rtp->split.Partitions[0].cover[1])) -
146 UNSUPPORTED("567lkxsqa5bu7d4nibvr4tpe1"); // rtp->split.Partitions[0].area[1];
147 UNSUPPORTED("edw1ss2r31mqgsvca2gowi52v"); // */
148 UNSUPPORTED("5046nw6shbhk2m5dtt3itg1qf"); // rect = CombineRect(r, &rtp->split.Partitions[0].cover[0]);
149 UNSUPPORTED("nc6om9tl3e7nixzkvrf0etup"); // growth0 =
150 UNSUPPORTED("ed7mreakvazgougj1ls6ioj33"); // RectArea(&rect) - rtp->split.Partitions[0].area[0];
151 UNSUPPORTED("eh4bst7jlzxrquw8wrweiosfn"); // rect = CombineRect(r, &rtp->split.Partitions[0].cover[1]);
152 UNSUPPORTED("9jwgrynpgu0d39tmz3uvb0f5o"); // growth1 =
153 UNSUPPORTED("i0duy3nph3k4msny0ibs81ph"); // RectArea(&rect) - rtp->split.Partitions[0].area[1];
154 UNSUPPORTED("b9ktilnf5m1wc70yqwf4mdq9e"); // diff = growth1 - growth0;
155 UNSUPPORTED("81ij2fgplw64rbpouql9na7a1"); // if (diff >= 0)
156 UNSUPPORTED("b49dtkykbufvv3lk5trobmbw5"); // group = 0;
157 UNSUPPORTED("d28blrbmwwqp80cyksuz7dwx9"); // else {
158 UNSUPPORTED("7sge254zb30sgd45k1os7fw3y"); // group = 1;
159 UNSUPPORTED("adlw9es1w2znqr4h71hd9k1j8"); // diff = -diff;
160 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
161 UNSUPPORTED("7qd8i0mpxxu4wueggpmmx9704"); // if (diff > biggestDiff) {
162 UNSUPPORTED("cc2jxkxp6wf0y4a6er7iildb4"); // biggestDiff = diff;
163 UNSUPPORTED("4gq0kbfwv4ls5gbqaxqusd6k"); // chosen = i;
164 UNSUPPORTED("dwalhyg0t90zo8gdq7pstef8a"); // betterGroup = group;
165 UNSUPPORTED("71bce3js2b0lpi50misxff7uy"); // } else if (diff == biggestDiff &&
166 UNSUPPORTED("fjvt87on1mhn9dyt0b9vp3jg"); // rtp->split.Partitions[0].count[group] <
167 UNSUPPORTED("1v2g0u9t6ou9xeajwcl3u2nr4"); // rtp->split.Partitions[0].count[betterGroup]) {
168 UNSUPPORTED("4gq0kbfwv4ls5gbqaxqusd6k"); // chosen = i;
169 UNSUPPORTED("dwalhyg0t90zo8gdq7pstef8a"); // betterGroup = group;
170 UNSUPPORTED("6eq5kf0bj692bokt0bixy1ixh"); // }
171 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
172 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
173 UNSUPPORTED("967zxvkt7liyzfgjy03xrpwf2"); // Classify(rtp, chosen, betterGroup);
174 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
175 UNSUPPORTED("15gmufvsx34eo7l2gxmf9sjph"); // /* if one group too full, put remaining rects in the other */
176 UNSUPPORTED("bz0f1s1b90c4mqpxr24oamywd"); // if (rtp->split.Partitions[0].count[0] +
177 UNSUPPORTED("d6a1dolgcf9n4go7fsk616dlz"); // rtp->split.Partitions[0].count[1] < 64 + 1) {
178 UNSUPPORTED("9xvua0lzynx3u05pjeoibo9tt"); // group = 0;
139 public static void MethodZero(ST_RTree rtp) {
140 ENTERING("4woz5xy4gjlahoj7no3ljxmex","MethodZero");
141 try {
142 ST_Rect_t r;
143 int i, growth0, growth1, diff, biggestDiff;
144 int group, chosen=0, betterGroup=0;
145 InitPVars(rtp);
146 PickSeeds(rtp);
147 while (rtp.split.Partitions[0].count[0] +
148 rtp.split.Partitions[0].count[1] < 64 + 1 &&
149 rtp.split.Partitions[0].count[0] < 64 + 1 - rtp.MinFill
150 && rtp.split.Partitions[0].count[1] <
151 64 + 1 - rtp.MinFill) {
152 biggestDiff = -1;
153 for (i = 0; i < 64 + 1; i++) {
154 if (N(rtp.split.Partitions[0].taken[i])) {
155 final ST_Rect_t rect = new ST_Rect_t();
156 r = (ST_Rect_t) rtp.split.BranchBuf[i].castTo(ST_Rect_t.class);
157 /* growth0 = RectArea(&CombineRect(r,
158 &rtp->split.Partitions[0].cover[0])) -
159 rtp->split.Partitions[0].area[0];
160 */
161 /* growth1 = RectArea(&CombineRect(r,
162 &rtp->split.Partitions[0].cover[1])) -
163 rtp->split.Partitions[0].area[1];
164 */
165 rect.___(CombineRect(r, (ST_Rect_t) rtp.split.Partitions[0].cover[0]));
166 growth0 =
167 RectArea((ST_Rect_t)rect) - rtp.split.Partitions[0].area[0];
168 rect.___(CombineRect(r, (ST_Rect_t) rtp.split.Partitions[0].cover[1]));
169 growth1 =
170 RectArea((ST_Rect_t)rect) - rtp.split.Partitions[0].area[1];
171 diff = growth1 - growth0;
172 if (diff >= 0)
173 group = 0;
174 else {
175 group = 1;
176 diff = -diff;
177 }
178 if (diff > biggestDiff) {
179 biggestDiff = diff;
180 chosen = i;
181 betterGroup = group;
182 } else if (diff == biggestDiff &&
183 rtp.split.Partitions[0].count[group] <
184 rtp.split.Partitions[0].count[betterGroup]) {
185 chosen = i;
186 betterGroup = group;
187 }
188 }
189 }
190 Classify(rtp, chosen, betterGroup);
191 }
192 /* if one group too full, put remaining rects in the other */
193 if (rtp.split.Partitions[0].count[0] +
194 rtp.split.Partitions[0].count[1] < 64 + 1) {
195 group = 0;
179196 UNSUPPORTED("4edp65b21liyii0fj1ikco7o0"); // if (rtp->split.Partitions[0].count[0] >=
180197 UNSUPPORTED("20lpsuiyepr2ujozaf6gp4cc"); // 64 + 1 - rtp->MinFill)
181198 UNSUPPORTED("9qtt6i40h8vtjp2cvqyb8ycaz"); // group = 1;
183200 UNSUPPORTED("jdepsnmrs3ghh78ql301sfvu"); // if (!rtp->split.Partitions[0].taken[i])
184201 UNSUPPORTED("gqfhorilvtlogp6f2ozx5akf"); // Classify(rtp, i, group);
185202 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
186 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
187 UNSUPPORTED("5r5xug64f1z60bggncz1pne3f"); // assert(rtp->split.Partitions[0].count[0] +
188 UNSUPPORTED("1whhfnenwvqqzfd4kkosc09z"); // rtp->split.Partitions[0].count[1] == 64 + 1);
189 UNSUPPORTED("c4k8arobh90w9e9sk4s8zx6a5"); // assert(rtp->split.Partitions[0].count[0] >= rtp->MinFill
190 UNSUPPORTED("2lio9rd6ztigudntp9gohkge9"); // && rtp->split.Partitions[0].count[1] >= rtp->MinFill);
191 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
192
193 throw new UnsupportedOperationException();
203 }
204 // assert(rtp->split.Partitions[0].count[0] +
205 // rtp->split.Partitions[0].count[1] == 64 + 1);
206 // assert(rtp->split.Partitions[0].count[0] >= rtp->MinFill
207 // && rtp->split.Partitions[0].count[1] >= rtp->MinFill);
208 } finally {
209 LEAVING("4woz5xy4gjlahoj7no3ljxmex","MethodZero");
210 }
194211 }
195212
196213
198215
199216 //3 8rui4cun4tvq5xy6ke6r3p55e
200217 // static void PickSeeds(RTree_t * rtp)
201 public static Object PickSeeds(Object... arg) {
202 UNSUPPORTED("4lrul9ern8gc76sno14wqgtne"); // static void PickSeeds(RTree_t * rtp)
203 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
204 UNSUPPORTED("vshrs98l6la9fwui89y20ji3"); // register int i, j;
205 UNSUPPORTED("cz82o6423cha33x8v31g7lhso"); // unsigned int waste, worst;
206 UNSUPPORTED("8glrb479bftuwm5m4w4eqy3id"); // int seed0, seed1;
207 UNSUPPORTED("em2tlievesov4lr9nkas30k2p"); // unsigned int area[64 + 1];
208 UNSUPPORTED("1rer9hfsfz4to936cdqosy26h"); // for (i = 0; i < 64 + 1; i++)
209 UNSUPPORTED("2f701q18yaasbx3zewp4pc3i3"); // area[i] = RectArea(&rtp->split.BranchBuf[i].rect);
210 UNSUPPORTED("5aj4ab555713s4o7hsg305y2c"); // //worst = -rtp->split.CoverSplitArea - 1;
211 UNSUPPORTED("b2ayju4kcpmgel4or2zbz0dyr"); // worst=0;
212 UNSUPPORTED("82kuymnzv3rubrwutx9bcz4xs"); // for (i = 0; i < 64; i++) {
213 UNSUPPORTED("dw3tar5d5xv4kxcnkcevzm9iw"); // for (j = i + 1; j < 64 + 1; j++) {
214 UNSUPPORTED("4wt347mvef1i2kr5h5z9l0g8i"); // Rect_t rect;
215 UNSUPPORTED("d5jmdkycgoaq3d846xryh0wtz"); // /* waste = RectArea(&CombineRect(&rtp->split.BranchBuf[i].rect,
216 UNSUPPORTED("1d3xkv54rko81ltklwjdtrmj1"); // // &rtp->split.BranchBuf[j].rect)) - area[i] - area[j];
217 UNSUPPORTED("20m1lc1moer8x00tx9ceto0iw"); // */
218 UNSUPPORTED("8vf1f6q13lthe8sasqcvpatr3"); // rect = CombineRect(&rtp->split.BranchBuf[i].rect,
219 UNSUPPORTED("5wjck74u7gv0xbv7a01rp3eia"); // &rtp->split.BranchBuf[j].rect);
220 UNSUPPORTED("bzjsjoq354eduv4f511rmjmtk"); // waste = RectArea(&rect) - area[i] - area[j];
221 UNSUPPORTED("7g3m0cplrcsffy7f3iqsrwztc"); // if (waste > worst) {
222 UNSUPPORTED("1irem1gz77fx5eym990j8l9v5"); // worst = waste;
223 UNSUPPORTED("29q6pzycm1gb2gukvicejmmks"); // seed0 = i;
224 UNSUPPORTED("11wyv1lzvxs0lyd59xqrp77lb"); // seed1 = j;
225 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
226 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
227 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
228 UNSUPPORTED("c1o6jr885s70ej9txo4zjtk3k"); // Classify(rtp, seed0, 0);
229 UNSUPPORTED("bf0ov5eigcyw1mhs6rlnwt7g"); // Classify(rtp, seed1, 1);
230 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
231
232 throw new UnsupportedOperationException();
218 public static void PickSeeds(ST_RTree rtp) {
219 ENTERING("8rui4cun4tvq5xy6ke6r3p55e","PickSeeds");
220 try {
221 int i, j;
222 int waste, worst;
223 int seed0=0, seed1=0;
224 int area[] = new int[64 + 1];
225 for (i = 0; i < 64 + 1; i++)
226 area[i] = RectArea((ST_Rect_t) rtp.split.BranchBuf[i].rect);
227 //worst = -rtp->split.CoverSplitArea - 1;
228 worst=0;
229 for (i = 0; i < 64; i++) {
230 for (j = i + 1; j < 64 + 1; j++) {
231 final ST_Rect_t rect = new ST_Rect_t();
232 /* waste = RectArea(&CombineRect(&rtp->split.BranchBuf[i].rect,
233 &rtp->split.BranchBuf[j].rect)) - area[i] - area[j];
234 */
235 rect.___(
236 CombineRect((ST_Rect_t)rtp.split.BranchBuf[i].rect,
237 (ST_Rect_t)rtp.split.BranchBuf[j].rect));
238 waste = RectArea((ST_Rect_t)rect) - area[i] - area[j];
239 if (waste > worst) {
240 worst = waste;
241 seed0 = i;
242 seed1 = j;
243 }
244 }
245 }
246 Classify(rtp, seed0, 0);
247 Classify(rtp, seed1, 1);
248 } finally {
249 LEAVING("8rui4cun4tvq5xy6ke6r3p55e","PickSeeds");
250 }
233251 }
234252
235253
237255
238256 //3 4qyy2dpbkziuubssvfwb8u1sh
239257 // static void Classify(RTree_t * rtp, int i, int group)
240 public static Object Classify(Object... arg) {
241 UNSUPPORTED("8ml9djski25i25i59wyn3dld9"); // static void Classify(RTree_t * rtp, int i, int group)
242 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
243 UNSUPPORTED("2ulo1dpl3kexdah5mcmnqpzdl"); // assert(!rtp->split.Partitions[0].taken[i]);
244 UNSUPPORTED("i4edl48bp8pljcmtxd1rep7a"); // rtp->split.Partitions[0].partition[i] = group;
245 UNSUPPORTED("ackdd63x1sev2rjvlsh0xgqbo"); // rtp->split.Partitions[0].taken[i] = (!(0));
246 UNSUPPORTED("7bethw7ebtjrhmrrq3004xvhh"); // if (rtp->split.Partitions[0].count[group] == 0)
247 UNSUPPORTED("cyhkvve52l3mzao5x0u5df13f"); // rtp->split.Partitions[0].cover[group] =
248 UNSUPPORTED("9mprl7dpvobrbs232soqoyv62"); // rtp->split.BranchBuf[i].rect;
249 UNSUPPORTED("div10atae09n36x269sl208r1"); // else
250 UNSUPPORTED("cyhkvve52l3mzao5x0u5df13f"); // rtp->split.Partitions[0].cover[group] =
251 UNSUPPORTED("7ez406d998w0vpfm3e5tbc0qq"); // CombineRect(&rtp->split.BranchBuf[i].rect,
252 UNSUPPORTED("e0r4nqeeu1jmir6akus7bjggm"); // &rtp->split.Partitions[0].cover[group]);
253 UNSUPPORTED("3n9txb7nb3kh2v0bsy0fufx1e"); // rtp->split.Partitions[0].area[group] =
254 UNSUPPORTED("anowu5wmi1sw0e8v669a1obek"); // RectArea(&rtp->split.Partitions[0].cover[group]);
255 UNSUPPORTED("d8ahf9tcusfmm5zeecg8pmdxb"); // rtp->split.Partitions[0].count[group]++;
256 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
257
258 throw new UnsupportedOperationException();
258 public static void Classify(ST_RTree rtp, int i, int group) {
259 ENTERING("4qyy2dpbkziuubssvfwb8u1sh","Classify");
260 try {
261 // assert(!rtp->split.Partitions[0].taken[i]);
262 rtp.split.Partitions[0].partition[i]=group;
263 rtp.split.Partitions[0].taken[i]=1;
264 if (rtp.split.Partitions[0].count[group] == 0)
265 rtp.split.Partitions[0].cover[group].___(
266 rtp.split.BranchBuf[i].rect);
267 else
268 rtp.split.Partitions[0].cover[group].___(
269 CombineRect((ST_Rect_t)rtp.split.BranchBuf[i].rect,
270 (ST_Rect_t)rtp.split.Partitions[0].cover[group]));
271 rtp.split.Partitions[0].area[group]=
272 RectArea((ST_Rect_t)rtp.split.Partitions[0].cover[group]);
273
274 rtp.split.Partitions[0].count[group]=
275 rtp.split.Partitions[0].count[group]+1;
276 } finally {
277 LEAVING("4qyy2dpbkziuubssvfwb8u1sh","Classify");
278 }
259279 }
260280
261281
263283
264284 //3 ay7l4setwyl3hbx4o2jpa7vyz
265285 // static void LoadNodes(RTree_t * rtp, Node_t * n, Node_t * q, struct PartitionVars *p)
266 public static Object LoadNodes(Object... arg) {
267 UNSUPPORTED("d0dvfornj5165j53js6eyidii"); // static void LoadNodes(RTree_t * rtp, Node_t * n, Node_t * q,
268 UNSUPPORTED("an9dlrefy1hbusq999x8s9qgf"); // struct PartitionVars *p)
269 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
270 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
271 UNSUPPORTED("25fhmphgra40j368i6b09n5xz"); // assert(n);
272 UNSUPPORTED("30uxqb850wr1s0f0jg8uipd4m"); // assert(q);
273 UNSUPPORTED("eh686hxootmu11yk2foc2tmr2"); // assert(p);
274 UNSUPPORTED("83olszqrugs1dppzl6flgshr5"); // for (i = 0; i < 64 + 1; i++) {
275 UNSUPPORTED("46lk8hxsutpzodwl5udrq4tik"); // assert(rtp->split.Partitions[0].partition[i] == 0 ||
276 UNSUPPORTED("8jebrifw0oq30vs4i2wf1cbse"); // rtp->split.Partitions[0].partition[i] == 1);
277 UNSUPPORTED("56sxhs1suv0k6iod6sl1w72dw"); // if (rtp->split.Partitions[0].partition[i] == 0)
278 UNSUPPORTED("cwda9vt3f43bi23igyzgossds"); // AddBranch(rtp, &rtp->split.BranchBuf[i], n, (void *)0);
279 UNSUPPORTED("9m8w97hthfczabpgdcm7xah33"); // else if (rtp->split.Partitions[0].partition[i] == 1)
280 UNSUPPORTED("2f02d8m6p439gevwt7mxtyo4p"); // AddBranch(rtp, &rtp->split.BranchBuf[i], q, (void *)0);
281 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
282 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
283
284 throw new UnsupportedOperationException();
286 public static void LoadNodes(ST_RTree rtp, ST_Node_t___ n, ST_Node_t___ q, ST_PartitionVars p) {
287 ENTERING("ay7l4setwyl3hbx4o2jpa7vyz","LoadNodes");
288 try {
289 int i;
290 // assert(n);
291 // assert(q);
292 // assert(p);
293 for (i = 0; i < 64 + 1; i++) {
294 // assert(rtp->split.Partitions[0].partition[i] == 0 ||
295 // rtp->split.Partitions[0].partition[i] == 1);
296 if (rtp.split.Partitions[0].partition[i] == 0)
297 AddBranch(rtp, (ST_Branch_t)rtp.split.BranchBuf[i].castTo(Branch_t.class), n, null);
298 else if (rtp.split.Partitions[0].partition[i] == 1)
299 AddBranch(rtp, (ST_Branch_t)rtp.split.BranchBuf[i].castTo(Branch_t.class), q, null);
300 }
301 } finally {
302 LEAVING("ay7l4setwyl3hbx4o2jpa7vyz","LoadNodes");
303 }
285304 }
286305
287306
289308
290309 //3 dvgjc83sogjhzf5kxpir405rh
291310 // static void InitPVars(RTree_t * rtp)
292 public static Object InitPVars(Object... arg) {
293 UNSUPPORTED("18v3kgq3ud3q6c0nu07xyv8wa"); // static void InitPVars(RTree_t * rtp)
294 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
295 UNSUPPORTED("pp6gyv6pecd6kik4hoguluwp"); // register int i;
296 UNSUPPORTED("2yvv0x8uir74h718l313i7it6"); // rtp->split.Partitions[0].count[0] = rtp->split.Partitions[0].count[1] =
297 UNSUPPORTED("556sry61ttzbp13quuzhes74v"); // 0;
298 UNSUPPORTED("bvhvtlpo10lxy8rquegyfg5jb"); // rtp->split.Partitions[0].cover[0] = rtp->split.Partitions[0].cover[1] =
299 UNSUPPORTED("5bf9thav82syw0gzxp8b9p5ou"); // NullRect();
300 UNSUPPORTED("8avyuhj51jxnpeujd7fmgcgtq"); // rtp->split.Partitions[0].area[0] = rtp->split.Partitions[0].area[1] =
301 UNSUPPORTED("556sry61ttzbp13quuzhes74v"); // 0;
302 UNSUPPORTED("83olszqrugs1dppzl6flgshr5"); // for (i = 0; i < 64 + 1; i++) {
303 UNSUPPORTED("5dttrbxrjqa1omiz2oovpe18k"); // rtp->split.Partitions[0].taken[i] = (0);
304 UNSUPPORTED("324vwwpg2hf07ejcj9w02evkm"); // rtp->split.Partitions[0].partition[i] = -1;
305 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
306 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
307
308 throw new UnsupportedOperationException();
309 }
310
311
312 }
311 public static void InitPVars(ST_RTree rtp) {
312 ENTERING("dvgjc83sogjhzf5kxpir405rh","InitPVars");
313 int i;
314 rtp.split.Partitions[0].count[0]=0;
315 rtp.split.Partitions[0].count[1]=0;
316 rtp.split.Partitions[0].cover[0].___(NullRect());
317 rtp.split.Partitions[0].cover[1].___(NullRect());
318 rtp.split.Partitions[0].area[0]=0;
319 rtp.split.Partitions[0].area[1]=0;
320 for (i = 0; i < 64 + 1; i++) {
321 rtp.split.Partitions[0].taken[i]=0;
322 rtp.split.Partitions[0].partition[i]=-1;
323 }
324 try {
325 } finally {
326 LEAVING("dvgjc83sogjhzf5kxpir405rh","InitPVars");
327 }
328 }
329
330
331 }
4343 *
4444 */
4545 package gen.lib.label;
46 import static gen.lib.cdt.dtclose__c.dtclose;
4647 import static gen.lib.cdt.dtopen__c.dtopen;
47 import static gen.lib.common.memory__c.zmalloc;
48 import static gen.lib.label.index__c.RTreeClose;
49 import static gen.lib.label.index__c.RTreeInsert;
50 import static gen.lib.label.index__c.RTreeLeafListFree;
4851 import static gen.lib.label.index__c.RTreeOpen;
49 import static smetana.core.JUtils.sizeof;
52 import static gen.lib.label.index__c.RTreeSearch;
53 import static smetana.core.JUtils.EQ;
54 import static smetana.core.JUtilsDebug.ENTERING;
55 import static smetana.core.JUtilsDebug.LEAVING;
5056 import static smetana.core.Macro.N;
5157 import static smetana.core.Macro.UNSUPPORTED;
52 import h.BestPos_t;
53 import h.XLabels_t;
54 import h._dt_s;
55 import h._dtdisc_s;
56 import h.label_params_t;
58 import h.ST_BestPos_t;
59 import h.ST_HDict_t;
60 import h.ST_LeafList_t;
61 import h.ST_Node_t___;
62 import h.ST_RTree;
63 import h.ST_Rect_t;
64 import h.ST_XLabels_t;
65 import h.ST_dt_s;
66 import h.ST_dtdisc_s;
67 import h.ST_label_params_t;
68 import h.ST_object_t;
69 import h.ST_point;
70 import h.ST_pointf;
71 import h.ST_xlabel_t;
72 import smetana.core.Memory;
5773 import smetana.core.Z;
5874 import smetana.core.__ptr__;
59
6075 public class xlabels__c {
6176 //1 9k44uhd5foylaeoekf3llonjq
6277 // extern Dtmethod_t* Dtset
134149
135150 //3 5p3ac8qk4gnne5hj1dc21ysi
136151 // static int icompare(Dt_t * dt, void * v1, void * v2, Dtdisc_t * disc)
137 public static int icompare(_dt_s dt, __ptr__ v1, __ptr__ v2, _dtdisc_s disc) {
138 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
139 UNSUPPORTED("ehks25fxahyjbjd4lm6ryh9su"); // int k1 = *((int *) v1), k2 = *((int *) v2);
140 UNSUPPORTED("6in30ubiocmaih693f0arymgc"); // return k1 - k2;
141 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
142
143 throw new UnsupportedOperationException();
152 public static int icompare(ST_dt_s dt, Object v1, Object v2, ST_dtdisc_s disc) {
153 ENTERING("5p3ac8qk4gnne5hj1dc21ysi","icompare");
154 try {
155 Integer k1 = (Integer) v1;
156 Integer k2 = (Integer) v2;
157 return k1 - k2;
158 } finally {
159 LEAVING("5p3ac8qk4gnne5hj1dc21ysi","icompare");
160 }
144161 }
145162
146163
148165
149166 //3 88mbfm305igsr7cew5qx6yldp
150167 // static XLabels_t *xlnew(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
151 public static XLabels_t xlnew(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
152 __ptr__ xlp;
153 xlp = zmalloc(sizeof(XLabels_t.class));
168 public static ST_XLabels_t xlnew(ST_object_t.Array objs, int n_objs, ST_xlabel_t.Array lbls, int n_lbls, ST_label_params_t params) {
169 ENTERING("88mbfm305igsr7cew5qx6yldp","xlnew");
170 try {
171 ST_XLabels_t xlp;
172 xlp = new ST_XLabels_t();
154173 /* used to load the rtree in hilbert space filling curve order */
155 xlp.setPtr("hdx", dtopen(Z.z().Hdisc.amp(), Z.z().Dtobag));
156 if (N(xlp.getPtr("hdx"))) {
174 xlp.setPtr("hdx", dtopen(Z.z().Hdisc, Z.z().Dtobag));
175 if (N(xlp.hdx)) {
157176 UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
158177 UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
159178 }
160179 /* for querying intersection candidates */
161180 xlp.setPtr("spdx", RTreeOpen());
162 UNSUPPORTED("7elrkgy2129t2ut4mi03dhf75"); // if (!(xlp->spdx = RTreeOpen())) {
181 if (N(xlp.spdx)) {
163182 UNSUPPORTED("4t1y5iinm4310lkpvbal1spve"); // fprintf(stderr, "out of memory\n");
164183 UNSUPPORTED("3m406diamp5s5kwcqtwo4pshf"); // goto bad;
165 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
184 }
166185 /* save arg pointers in the handle */
167 UNSUPPORTED("ava6c0wrmq2d6j1i4j7bd1lpp"); // xlp->objs = objs;
168 UNSUPPORTED("85sh2ov52z31nsy9mk5su9p5p"); // xlp->n_objs = n_objs;
169 UNSUPPORTED("3et8g76wlkf60sgxrmi3z1vom"); // xlp->lbls = lbls;
170 UNSUPPORTED("2pwe3sog0n7styjgekuhrnd5e"); // xlp->n_lbls = n_lbls;
171 UNSUPPORTED("52j9u0n44sdpwexr3bunb46zi"); // xlp->params = params;
172 UNSUPPORTED("64t9yhsoz02rjp8vy1as25a5n"); // return xlp;
173 UNSUPPORTED("98zx7s9vt8t1s5x9l35evcxnz"); // bad:
174 UNSUPPORTED("66s40csd2ivd8rx4h2ut8oai5"); // if (xlp->hdx)
175 UNSUPPORTED("8mg8tqxa78f1nfk4jh9drw2n0"); // dtclose(xlp->hdx);
176 UNSUPPORTED("b9uy03exphaovgyz5t4gru409"); // if (xlp->spdx)
177 UNSUPPORTED("4cfpl6hom6vo3btrjlhfmn6mi"); // RTreeClose(xlp->spdx);
178 UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
179 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
180 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
181
182 throw new UnsupportedOperationException();
186 xlp.objs = objs;
187 xlp.setInt("n_objs", n_objs);
188 xlp.lbls = lbls;
189 xlp.setInt("n_lbls", n_lbls);
190 xlp.setPtr("params", params);
191 return (ST_XLabels_t) xlp;
192 } finally {
193 LEAVING("88mbfm305igsr7cew5qx6yldp","xlnew");
194 }
195 //UNSUPPORTED("98zx7s9vt8t1s5x9l35evcxnz"); // bad:
196 //UNSUPPORTED("66s40csd2ivd8rx4h2ut8oai5"); // if (xlp->hdx)
197 //UNSUPPORTED("8mg8tqxa78f1nfk4jh9drw2n0"); // dtclose(xlp->hdx);
198 //UNSUPPORTED("b9uy03exphaovgyz5t4gru409"); // if (xlp->spdx)
199 //UNSUPPORTED("4cfpl6hom6vo3btrjlhfmn6mi"); // RTreeClose(xlp->spdx);
200 //UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
201 //UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
202 //UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
183203 }
184204
185205
187207
188208 //3 apvhod2s1yjb8717rb7gie2kb
189209 // static void xlfree(XLabels_t * xlp)
190 public static Object xlfree(Object... arg) {
191 UNSUPPORTED("7jv3t0oxe54lacl7qn1meznth"); // static void xlfree(XLabels_t * xlp)
192 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
193 UNSUPPORTED("3120ftcrfb2pccpafsxzl14te"); // RTreeClose(xlp->spdx);
194 UNSUPPORTED("dms04fhv1vao18v2p0lmk80xf"); // free(xlp);
195 UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
196 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
197
198 throw new UnsupportedOperationException();
210 public static void xlfree(ST_XLabels_t xlp) {
211 ENTERING("apvhod2s1yjb8717rb7gie2kb","xlfree");
212 try {
213 RTreeClose((ST_RTree) xlp.spdx);
214 Memory.free(xlp);
215 } finally {
216 LEAVING("apvhod2s1yjb8717rb7gie2kb","xlfree");
217 }
199218 }
200219
201220
203222
204223 //3 6lz36gkh8fla3z6f0lxniy368
205224 // static int floorLog2(unsigned int n)
206 public static Object floorLog2(Object... arg) {
207 UNSUPPORTED("dhjwlofpfy5gop5y81eemv6i4"); // static int floorLog2(unsigned int n)
208 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
209 UNSUPPORTED("3xzujk207ipx0d60nbbrwyjez"); // int pos = 0;
210 UNSUPPORTED("f0os7tzuki1s9mllsml3zu2fd"); // if (n == 0)
211 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
212 UNSUPPORTED("4b22up0qcghijti04gz41jqiz"); // if (n >= 1 << 16) {
213 UNSUPPORTED("b8h1lnvuhauq15z5k0fs5u2l1"); // n >>= 16;
214 UNSUPPORTED("e1kd6x1c70e7l8ml3qgzahq34"); // pos += 16;
215 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
216 UNSUPPORTED("a7hxj1hb2pc8py8ywsfit3q4n"); // if (n >= 1 << 8) {
217 UNSUPPORTED("aioe8c94e5sluu8n00fdgq128"); // n >>= 8;
218 UNSUPPORTED("b5apnzow59vwb4z38m0bgaxuj"); // pos += 8;
219 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
220 UNSUPPORTED("8ln2bn60t9zq7iigfqy9wa5dk"); // if (n >= 1 << 4) {
221 UNSUPPORTED("albua8gefgieknhiuhr1cook"); // n >>= 4;
222 UNSUPPORTED("5ivee6b3gs2khi9h8mpbr20g9"); // pos += 4;
223 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
224 UNSUPPORTED("930rjgw6ueudlb4emmrfw8y8w"); // if (n >= 1 << 2) {
225 UNSUPPORTED("3p8vzi941bcva583xzhk2o7qb"); // n >>= 2;
226 UNSUPPORTED("3t90pfuwl7kz4zpjrsa99cof8"); // pos += 2;
227 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
228 UNSUPPORTED("8b1fqmv1sxvuyxs3dcp7aas0k"); // if (n >= 1 << 1) {
229 UNSUPPORTED("nx53w89cor5x9akadlbw5et8"); // pos += 1;
230 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
231 UNSUPPORTED("2kr5zds5y6oiaubm8wiunqccr"); // return pos;
232 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
233
234 throw new UnsupportedOperationException();
225 public static int floorLog2(int n) {
226 ENTERING("6lz36gkh8fla3z6f0lxniy368","floorLog2");
227 try {
228 int pos = 0;
229 if (n == 0)
230 return -1;
231 if (n >= 1 << 16) {
232 n >>= 16;
233 pos += 16;
234 }
235 if (n >= 1 << 8) {
236 n >>= 8;
237 pos += 8;
238 }
239 if (n >= 1 << 4) {
240 n >>= 4;
241 pos += 4;
242 }
243 if (n >= 1 << 2) {
244 n >>= 2;
245 pos += 2;
246 }
247 if (n >= 1 << 1) {
248 pos += 1;
249 }
250 return pos;
251 } finally {
252 LEAVING("6lz36gkh8fla3z6f0lxniy368","floorLog2");
253 }
235254 }
236255
237256
239258
240259 //3 uvnzthcpf4xiih05gxie2rx1
241260 // unsigned int xlhorder(XLabels_t * xlp)
242 public static Object xlhorder(Object... arg) {
243 UNSUPPORTED("9rtsoeopc1glcmntqwf7hz6x7"); // unsigned int xlhorder(XLabels_t * xlp)
244 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
245 UNSUPPORTED("7w1e4a6q9gftmlsxkc4v7eq9d"); // double maxx = xlp->params->bb.UR.x, maxy = xlp->params->bb.UR.y;
246 UNSUPPORTED("147h47bz0sqql0238qat4fdky"); // return floorLog2(maxx > maxy ? maxx : maxy) + 1;
247 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
248
249 throw new UnsupportedOperationException();
261 public static int xlhorder(ST_XLabels_t xlp) {
262 ENTERING("uvnzthcpf4xiih05gxie2rx1","xlhorder");
263 try {
264 double maxx = xlp.params.bb.UR.x;
265 double maxy = xlp.params.bb.UR.y;
266 return floorLog2(maxx > maxy ? (int)maxx : (int)maxy) + 1;
267 } finally {
268 LEAVING("uvnzthcpf4xiih05gxie2rx1","xlhorder");
269 }
250270 }
251271
252272
254274
255275 //3 9lkyvq87bawe3yon7bdwvcjzq
256276 // static unsigned int hd_hil_s_from_xy(point p, int n)
257 public static Object hd_hil_s_from_xy(Object... arg) {
258 UNSUPPORTED("9zi37w33fe5wi8h5d2dymr0tt"); // static unsigned int hd_hil_s_from_xy(point p, int n)
259 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
260 UNSUPPORTED("65resmfdu81d1xg2em5l84y82"); // int i, x = p.x, y = p.y, xi, yi;
261 UNSUPPORTED("3s2drtfrrzifwhrt8rk6kq5gq"); // unsigned s;
262 UNSUPPORTED("bd5j4s2m9y2fcgu9giqi9qrhy"); // s = 0; /* Initialize. */
263 UNSUPPORTED("9d7993w9kft7mplobqeb9boaz"); // for (i = n - 1; i >= 0; i--) {
264 UNSUPPORTED("c1xqmgsdfzeebwk2yfoz65pue"); // xi = (x >> i) & 1; /* Get bit i of x. */
265 UNSUPPORTED("270wzledmbxq3z8mp5tz7ezib"); // yi = (y >> i) & 1; /* Get bit i of y. */
266 UNSUPPORTED("3d69e96cdg4apqijubufzse5z"); // s = 4 * s + 2 * xi + (xi ^ yi); /* Append two bits to s. */
267 UNSUPPORTED("c4cig8vru225s8qy4aj21mfe0"); // x = x ^ y; /* These 3 lines swap */
268 UNSUPPORTED("7r0w00av090u8a4vi14al4ct6"); // y = y ^ (x & (yi - 1)); /* x and y if yi = 0. */
269 UNSUPPORTED("cpz7xdfh4gvp5hufdb1ij5amy"); // x = x ^ y;
270 UNSUPPORTED("7i7jygllv89x29npu61cfn74p"); // x = x ^ (-xi & (yi - 1)); /* Complement x and y if */
271 UNSUPPORTED("5p8kbkyzcbsr9m1b1fl7z3q0h"); // y = y ^ (-xi & (yi - 1)); /* xi = 1 and yi = 0. */
272 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
273 UNSUPPORTED("3y6wj3ntgmr1qkdpm7wp1dsch"); // return s;
274 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
275
276 throw new UnsupportedOperationException();
277 }
277 public static int hd_hil_s_from_xy(ST_point p, int n) {
278 ENTERING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy");
279 try {
280 return hd_hil_s_from_xy_((ST_point) p.copy(), n);
281 } finally {
282 LEAVING("9lkyvq87bawe3yon7bdwvcjzq","hd_hil_s_from_xy");
283 }
284 }
285 private static int hd_hil_s_from_xy_(ST_point p, int n) {
286 int i, x = p.x, y = p.y, xi, yi;
287 int s;
288 s = 0; /* Initialize. */
289 for (i = n - 1; i >= 0; i--) {
290 xi = (x >> i) & 1; /* Get bit i of x. */
291 yi = (y >> i) & 1; /* Get bit i of y. */
292 s = 4 * s + 2 * xi + (xi ^ yi); /* Append two bits to s. */
293 x = x ^ y; /* These 3 lines swap */
294 y = y ^ (x & (yi - 1)); /* x and y if yi = 0. */
295 x = x ^ y;
296 x = x ^ (-xi & (yi - 1)); /* Complement x and y if */
297 y = y ^ (-xi & (yi - 1)); /* xi = 1 and yi = 0. */
298 }
299 return s;
300 }
278301
279302
280303
281304
282305 //3 bpkzwylrchx5wta1qhytfgbtr
283306 // static double aabbaabb(Rect_t * r, Rect_t * s)
284 public static Object aabbaabb(Object... arg) {
285 UNSUPPORTED("21oyvapf2qfnxqid5aolv4mmr"); // static double aabbaabb(Rect_t * r, Rect_t * s)
286 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
287 UNSUPPORTED("dywr73ggaui4ayztq3tmljs4z"); // /* per dimension if( max < omin || min > omax) */
288 UNSUPPORTED("981pm44oz7wkhcspjabhjqpmq"); // double iminx, iminy, imaxx, imaxy;
289 UNSUPPORTED("60uso6twsxyml3pff70yndkys"); // if (r->boundary[2] < s->boundary[0] || r->boundary[0] > s->boundary[2])
290 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
291 UNSUPPORTED("1tavt6umo55xyoarc64k3dxs0"); // if (r->boundary[3] < s->boundary[1] || r->boundary[1] > s->boundary[3])
292 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
293 UNSUPPORTED("ls92qicz53qcx6cwst6f8om3"); // /* if we get here we have an intersection */
294 UNSUPPORTED("31cw8fo82001qx6nsg22hugnf"); // /* rightmost left edge of the 2 rectangles */
295 UNSUPPORTED("7d66kym3m7c0ya8b4kt7vjtvv"); // iminx =
296 UNSUPPORTED("2ohiqb8vdv4gbnzqigtqd47c3"); // r->boundary[0] > s->boundary[0] ? r->boundary[0] : s->boundary[0];
297 UNSUPPORTED("2bf3t8qfsxq7y4d98hc3p59gv"); // /* upmost bottom edge */
298 UNSUPPORTED("cvk4ll2zvw3sljlm63j6bcjr8"); // iminy =
299 UNSUPPORTED("13n8uz9c82r3pkg85oh43qf74"); // r->boundary[1] > s->boundary[1] ? r->boundary[1] : s->boundary[1];
300 UNSUPPORTED("dsfdevf6xy6buo0sydh3h3fis"); // /* leftmost right edge */
301 UNSUPPORTED("8rdxlzisdq5iw8b07usm1toc9"); // imaxx =
302 UNSUPPORTED("a8uyhcvpgmwrihxaaa5u77i69"); // r->boundary[2] < s->boundary[2] ? r->boundary[2] : s->boundary[2];
303 UNSUPPORTED("cr403g6ud2h0cyys19fti84tb"); // /* downmost top edge */
304 UNSUPPORTED("cqszcttk6vqvj0hezy1t1bsig"); // imaxy =
305 UNSUPPORTED("41qdog59oicvy8ku3n9vbzhj6"); // r->boundary[3] < s->boundary[3] ? r->boundary[3] : s->boundary[3];
306 UNSUPPORTED("cxtiz800rb16yy2u6burhy6mi"); // return (imaxx - iminx) * (imaxy - iminy);
307 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
308
309 throw new UnsupportedOperationException();
307 public static double aabbaabb(ST_Rect_t r, ST_Rect_t s) {
308 ENTERING("bpkzwylrchx5wta1qhytfgbtr","aabbaabb");
309 try {
310 /* per dimension if( max < omin || min > omax) */
311 double iminx, iminy, imaxx, imaxy;
312 if (r.boundary[2] < s.boundary[0] || r.boundary[0] > s.boundary[2])
313 return 0;
314 if (r.boundary[3] < s.boundary[1] || r.boundary[1] > s.boundary[3])
315 return 0;
316 /* if we get here we have an intersection */
317 /* rightmost left edge of the 2 rectangles */
318 iminx =
319 r.boundary[0] > s.boundary[0] ? r.boundary[0] : s.boundary[0];
320 /* upmost bottom edge */
321 iminy =
322 r.boundary[1] > s.boundary[1] ? r.boundary[1] : s.boundary[1];
323 /* leftmost right edge */
324 imaxx =
325 r.boundary[2] < s.boundary[2] ? r.boundary[2] : s.boundary[2];
326 /* downmost top edge */
327 imaxy =
328 r.boundary[3] < s.boundary[3] ? r.boundary[3] : s.boundary[3];
329 return (imaxx - iminx) * (imaxy - iminy);
330 } finally {
331 LEAVING("bpkzwylrchx5wta1qhytfgbtr","aabbaabb");
332 }
310333 }
311334
312335
314337
315338 //3 2g71cq6f8w5jbmbnn2x9y5qfq
316339 // static int lblenclosing(object_t * objp, object_t * objp1)
317 public static Object lblenclosing(Object... arg) {
318 UNSUPPORTED("96fk2h2cameoldx630f8490ei"); // static int lblenclosing(object_t * objp, object_t * objp1)
319 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
320 UNSUPPORTED("2uf1ispemhfeg8c7qhy0fbq2j"); // xlabel_t * xlp = objp->lbl;;
321 UNSUPPORTED("txl92fx6l8dzi4yeuegwqirj"); // assert(objp1->sz.x == 0 && objp1->sz.y == 0);
322 UNSUPPORTED("ek6g4dsfb8puipbh006mizket"); // if(! xlp) return 0;
323 UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x &&
324 UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) &&
325 UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y &&
326 UNSUPPORTED("29g3tye8vebllnv9b91xyntzi"); // objp1->pos.y < (xlp->pos.y + xlp->sz.y);
327 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
328
329 throw new UnsupportedOperationException();
330 }
340 public static boolean lblenclosing(ST_object_t objp, ST_object_t objp1) {
341 ENTERING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing");
342 try {
343 ST_xlabel_t.Array xlp = (ST_xlabel_t.Array) objp.lbl;
344 // assert(objp1->sz.x == 0 && objp1->sz.y == 0);
345 if(N(xlp)) return false;
346 return objp1.pos.x > xlp.getStruct().pos.x &&
347 objp1.pos.x < (xlp.getStruct().pos.x + xlp.getStruct().sz.y) &&
348 objp1.pos.y > xlp.getStruct().pos.y &&
349 objp1.pos.y < (xlp.getStruct().pos.y + xlp.getStruct().sz.y);
350 // UNSUPPORTED("exdts7f2bpam5122kabq2b86c"); // return objp1->pos.x > xlp->pos.x &&
351 // UNSUPPORTED("99uxf5dqw5nzdymlzfj764uol"); // objp1->pos.x < (xlp->pos.x + xlp->sz.x) &&
352 // UNSUPPORTED("epx7s3oiw75fuioasz208w1k1"); // objp1->pos.y > xlp->pos.y &&
353 // UNSUPPORTED("29g3tye8vebllnv9b91xyntzi"); // objp1->pos.y < (xlp->pos.y + xlp->sz.y);
354 // UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
355 } finally {
356 LEAVING("2g71cq6f8w5jbmbnn2x9y5qfq","lblenclosing");
357 }
358 }
359
331360
332361
333362
334363
335364 //3 dq1wkb4oxshdggv6cwtgas6m
336365 // static void objp2rect(object_t * op, Rect_t * r)
337 public static Object objp2rect(Object... arg) {
338 UNSUPPORTED("bmdr5joxjahq30nkb15r6rf41"); // static void objp2rect(object_t * op, Rect_t * r)
339 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
340 UNSUPPORTED("cdtyz1w6cga7n2jo2fbh8c6ro"); // r->boundary[0] = op->pos.x;
341 UNSUPPORTED("9ir52jgzphc4cgyevo2o2ltjs"); // r->boundary[1] = op->pos.y;
342 UNSUPPORTED("cz4cc7haeit4u59so96vv80ch"); // r->boundary[2] = op->pos.x + op->sz.x;
343 UNSUPPORTED("3m857h9kn35205vsumkenc0dx"); // r->boundary[3] = op->pos.y + op->sz.y;
344 UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
345 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
346
347 throw new UnsupportedOperationException();
366 public static void objp2rect(ST_object_t op, ST_Rect_t r) {
367 ENTERING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
368 try {
369 r.boundary[0]=((int)op.pos.x);
370 r.boundary[1]=((int)op.pos.y);
371 r.boundary[2]=((int)(op.pos.x+op.sz.x));
372 r.boundary[3]=((int)(op.pos.y+op.sz.y));
373 } finally {
374 LEAVING("dq1wkb4oxshdggv6cwtgas6m","objp2rect");
375 }
348376 }
349377
350378
352380
353381 //3 71b5ttp3xs7lo9fqgb7ypyqgx
354382 // static void objplp2rect(object_t * objp, Rect_t * r)
355 public static Object objplp2rect(Object... arg) {
356 UNSUPPORTED("5giyzyeu3hmuyo2r06ushsohy"); // static void objplp2rect(object_t * objp, Rect_t * r)
357 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
358 UNSUPPORTED("3wparjbgs7cft1xsjcztm8bdh"); // xlabel_t *lp = objp->lbl;
359 UNSUPPORTED("5abhryoldlbjfzt4lh63gmcb4"); // r->boundary[0] = lp->pos.x;
360 UNSUPPORTED("acpv39vcusl8yzf591aja97a0"); // r->boundary[1] = lp->pos.y;
361 UNSUPPORTED("flr92u77dscu4d286xzfwhzs"); // r->boundary[2] = lp->pos.x + lp->sz.x;
362 UNSUPPORTED("beq6fj10iaic6pf2z8xgb1atm"); // r->boundary[3] = lp->pos.y + lp->sz.y;
363 UNSUPPORTED("b9185t6i77ez1ac587ul8ndnc"); // return;
364 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
365
366 throw new UnsupportedOperationException();
383 public static void objplp2rect(ST_object_t objp, ST_Rect_t r) {
384 ENTERING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
385 try {
386 ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl;
387 r.boundary[0]=((int)lp.getStruct().pos.x);
388 r.boundary[1]=((int)lp.getStruct().pos.y);
389 r.boundary[2]=((int)(lp.getStruct().pos.x+lp.getStruct().sz.x));
390 r.boundary[3]=((int)(lp.getStruct().pos.y+lp.getStruct().sz.y));
391 } finally {
392 LEAVING("71b5ttp3xs7lo9fqgb7ypyqgx","objplp2rect");
393 }
367394 }
368395
369396
371398
372399 //3 ksqjbiie0e6vvaeawdxriie5
373400 // static Rect_t objplpmks(XLabels_t * xlp, object_t * objp)
374 public static Object objplpmks(Object... arg) {
375 UNSUPPORTED("56xi0kf7c3v2wjn9pgxjfd6h"); // static Rect_t objplpmks(XLabels_t * xlp, object_t * objp)
376 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
377 UNSUPPORTED("1xpsng8cc6f4327hr9iybol18"); // Rect_t rect;
378 UNSUPPORTED("2bghyit203pd6xw2ihhenzyn8"); // pointf p;
379 UNSUPPORTED("44i0d8rb96ptawj2nb9zhyuzq"); // p.x = p.y = 0.0;
380 UNSUPPORTED("3dwj4u821y9ogiqj7n51lyoag"); // if (objp->lbl)
381 UNSUPPORTED("43e7r8tcv1i4842l88wzlv8oh"); // p = objp->lbl->sz;
382 UNSUPPORTED("5vkhq86nkkgbben2zw7acts5t"); // rect.boundary[0] = (int) floor(objp->pos.x - p.x);
383 UNSUPPORTED("3smh87oiqzvpexhjkfsvfqk9x"); // rect.boundary[1] = (int) floor(objp->pos.y - p.y);
384 UNSUPPORTED("2qxkma0x5w0j667gciafl1erp"); // rect.boundary[2] = (int) ceil(objp->pos.x + objp->sz.x + p.x);
385 UNSUPPORTED("6jltyhrpm228xlstvy1cij4b"); // assert(rect.boundary[2] < INT_MAX);
386 UNSUPPORTED("aczubaaqymb9ns1q4t70v16a2"); // rect.boundary[3] = (int) ceil(objp->pos.y + objp->sz.y + p.y);
387 UNSUPPORTED("560x8steudix953y8g7kyqgph"); // assert(rect.boundary[3] < INT_MAX);
388 UNSUPPORTED("5r5gm69aqx2rcthvo0oaisz5n"); // return rect;
389 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
390
391 throw new UnsupportedOperationException();
401 public static ST_Rect_t objplpmks(ST_XLabels_t xlp, ST_object_t objp) {
402 ENTERING("ksqjbiie0e6vvaeawdxriie5","objplpmks");
403 try {
404 final ST_Rect_t rect = new ST_Rect_t();
405 final ST_pointf p = new ST_pointf();
406 p.setDouble("x", 0);
407 p.setDouble("y", 0);
408 if (objp.lbl!=null)
409 p.___(objp.lbl.getStruct().sz);
410 rect.boundary[0]=((int) Math.floor(objp.pos.x - p.x));
411 rect.boundary[1]=((int) Math.floor(objp.pos.y - p.y));
412 rect.boundary[2]=((int) Math.ceil(objp.pos.x + objp.sz.x + p.x));
413 // assert(rect.boundary[2] < INT_MAX);
414 rect.boundary[3]=((int) Math.ceil(objp.pos.y + objp.sz.y + p.y));
415 // assert(rect.boundary[3] < INT_MAX);
416 return rect;
417 } finally {
418 LEAVING("ksqjbiie0e6vvaeawdxriie5","objplpmks");
419 }
392420 }
393421
394422
396424
397425 //3 calnhom3s9dqvvi6crrz3h2wp
398426 // static int getintrsxi(XLabels_t * xlp, object_t * op, object_t * cp)
399 public static Object getintrsxi(Object... arg) {
400 UNSUPPORTED("a9fedvxwftar39hm6zje929tj"); // static int getintrsxi(XLabels_t * xlp, object_t * op, object_t * cp)
401 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
402 UNSUPPORTED("451bp6msra12odk32g38u2p4l"); // int i = -1;
403 UNSUPPORTED("6ve3kvakrupo08cfuexjzim3j"); // xlabel_t *lp = op->lbl, *clp = cp->lbl;
404 UNSUPPORTED("bot9xncc749y7iruelw2v96mm"); // assert(lp != clp);
405 UNSUPPORTED("95np7ge1zv1ws57dp9wu3twm8"); // if (lp->set == 0 || clp->set == 0)
406 UNSUPPORTED("11drvggon8u61uz4iw75insly"); // return i;
427 public static int getintrsxi(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp) {
428 ENTERING("calnhom3s9dqvvi6crrz3h2wp","getintrsxi");
429 try {
430 int i = -1;
431 ST_xlabel_t.Array lp = (ST_xlabel_t.Array) op.lbl, clp = (ST_xlabel_t.Array) cp.lbl;
432 assert(lp != clp);
433 if (lp.getStruct().set == 0 || clp.getStruct().set == 0)
434 return i;
407435 UNSUPPORTED("bofpvwtmumoe1ckgnlgbwg8bt"); // if ((op->pos.x == 0.0 && op->pos.y == 0.0) ||
408436 UNSUPPORTED("f039op8rn0jopi9r8kora4cwz"); // (cp->pos.x == 0.0 && cp->pos.y == 0.0))
409437 UNSUPPORTED("11drvggon8u61uz4iw75insly"); // return i;
429457 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
430458
431459 throw new UnsupportedOperationException();
460 } finally {
461 LEAVING("calnhom3s9dqvvi6crrz3h2wp","getintrsxi");
462 }
432463 }
433464
434465
436467
437468 //3 52awwxu810dg9a2pjq45aomam
438469 // static double recordointrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp, double a, object_t * intrsx[9])
439 public static Object recordointrsx(Object... arg) {
440 UNSUPPORTED("lt6cippjix5bbvyhkcpl8g7g"); // static double
441 UNSUPPORTED("2zz9cixco1u51p503mmbdrgwj"); // recordointrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp,
442 UNSUPPORTED("apwjxkvmqelrsmtxwca7febp5"); // double a, object_t * intrsx[9])
443 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
444 UNSUPPORTED("ejj0lh0dxc3weinkmoqplvk87"); // int i = getintrsxi(xlp, op, cp);
445 UNSUPPORTED("7jqpiltkvdvvkjldnxqmz4nfw"); // if (i < 0)
446 UNSUPPORTED("cmp9l0lizmu0ars1jf1oxdms"); // i = 5;
447 UNSUPPORTED("b3zyhtz43kkfxl6c8kovnaukv"); // if (intrsx[i] != (void *)0) {
448 UNSUPPORTED("908eps96desp6goewhn8nkz4v"); // double sa, maxa = 0.0;
449 UNSUPPORTED("cz5yjl642c9a3c7quub0ndp2a"); // Rect_t srect;
450 UNSUPPORTED("aq0f27u636o0qqw392noohjgj"); // /* keep maximally overlapping object */
451 UNSUPPORTED("5vocmgb870od0q18046qxkydh"); // objp2rect(intrsx[i], &srect);
452 UNSUPPORTED("3by02iwc6g6vz00qca2gs8af1"); // sa = aabbaabb(rp, &srect);
453 UNSUPPORTED("77dloi6nsmguqzpi413an26qc"); // if (sa > a)
454 UNSUPPORTED("8e6d6m12amff6diyc58bdpzap"); // maxa = sa;
455 UNSUPPORTED("2d4heu1iudrpn42muf8z4aedr"); // /*keep maximally overlapping label */
456 UNSUPPORTED("5g3p1wh0h43afgmy1ttrgr1jv"); // if (intrsx[i]->lbl) {
457 UNSUPPORTED("e5ldv4apogj6g1ixv62v7fqn7"); // objplp2rect(intrsx[i], &srect);
458 UNSUPPORTED("6h73h574xwo051r2xjepln3kk"); // sa = aabbaabb(rp, &srect);
459 UNSUPPORTED("cl94uq2flao8cddtvg02oliwb"); // if (sa > a)
460 UNSUPPORTED("d9hnc5ox6fsga1e2336gg1fwv"); // maxa = sa > maxa ? sa : maxa;
461 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
462 UNSUPPORTED("6nmie1l1f5g573kzykn3266zd"); // if (maxa > 0.0)
463 UNSUPPORTED("dm9264t4efl70h617d1apqrlj"); // return maxa;
464 UNSUPPORTED("3vems3bwps1fshis117u06l2l"); // /*replace overlapping label/object pair */
465 UNSUPPORTED("c3ewj48u0ngzq2xd8g3238ays"); // intrsx[i] = cp;
466 UNSUPPORTED("efte22brajv8hm98pgq1oyjc5"); // return a;
467 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
468 UNSUPPORTED("2u8wtbwfirvx570l7nhbkqwmn"); // intrsx[i] = cp;
469 UNSUPPORTED("3gfohtnqgemf2e1akg4je944a"); // return a;
470 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
471
472 throw new UnsupportedOperationException();
470 public static double recordointrsx(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp, ST_Rect_t rp, double a, ST_object_t[] intrsx) {
471 ENTERING("52awwxu810dg9a2pjq45aomam","recordointrsx");
472 try {
473 int i = getintrsxi(xlp, op, cp);
474 if (i < 0)
475 i = 5;
476 if (intrsx[i] != null) {
477 double sa, maxa = 0.0;
478 final ST_Rect_t srect = new ST_Rect_t();
479 /* keep maximally overlapping object */
480 objp2rect(intrsx[i], srect);
481 sa = aabbaabb(rp, srect);
482 if (sa > a)
483 maxa = sa;
484 /*keep maximally overlapping label */
485 if (intrsx[i].lbl!=null) {
486 objplp2rect(intrsx[i], srect);
487 sa = aabbaabb(rp, srect);
488 if (sa > a)
489 maxa = sa > maxa ? sa : maxa;
490 }
491 if (maxa > 0.0)
492 return maxa;
493 /*replace overlapping label/object pair */
494 intrsx[i] = cp;
495 return a;
496 }
497 intrsx[i] = cp;
498 return a;
499 } finally {
500 LEAVING("52awwxu810dg9a2pjq45aomam","recordointrsx");
501 }
473502 }
474503
475504
477506
478507 //3 2umrncgkunxoyeuc8i9hd5pwa
479508 // static double recordlintrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp, double a, object_t * intrsx[9])
480 public static Object recordlintrsx(Object... arg) {
481 UNSUPPORTED("lt6cippjix5bbvyhkcpl8g7g"); // static double
482 UNSUPPORTED("a36vanbvru4xq84pujn0rdpr5"); // recordlintrsx(XLabels_t * xlp, object_t * op, object_t * cp, Rect_t * rp,
483 UNSUPPORTED("apwjxkvmqelrsmtxwca7febp5"); // double a, object_t * intrsx[9])
484 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
485 UNSUPPORTED("ejj0lh0dxc3weinkmoqplvk87"); // int i = getintrsxi(xlp, op, cp);
486 UNSUPPORTED("7jqpiltkvdvvkjldnxqmz4nfw"); // if (i < 0)
487 UNSUPPORTED("cmp9l0lizmu0ars1jf1oxdms"); // i = 5;
488 UNSUPPORTED("b3zyhtz43kkfxl6c8kovnaukv"); // if (intrsx[i] != (void *)0) {
489 UNSUPPORTED("908eps96desp6goewhn8nkz4v"); // double sa, maxa = 0.0;
490 UNSUPPORTED("cz5yjl642c9a3c7quub0ndp2a"); // Rect_t srect;
491 UNSUPPORTED("aq0f27u636o0qqw392noohjgj"); // /* keep maximally overlapping object */
492 UNSUPPORTED("5vocmgb870od0q18046qxkydh"); // objp2rect(intrsx[i], &srect);
493 UNSUPPORTED("3by02iwc6g6vz00qca2gs8af1"); // sa = aabbaabb(rp, &srect);
494 UNSUPPORTED("77dloi6nsmguqzpi413an26qc"); // if (sa > a)
495 UNSUPPORTED("8e6d6m12amff6diyc58bdpzap"); // maxa = sa;
496 UNSUPPORTED("2d4heu1iudrpn42muf8z4aedr"); // /*keep maximally overlapping label */
497 UNSUPPORTED("5g3p1wh0h43afgmy1ttrgr1jv"); // if (intrsx[i]->lbl) {
498 UNSUPPORTED("e5ldv4apogj6g1ixv62v7fqn7"); // objplp2rect(intrsx[i], &srect);
499 UNSUPPORTED("6h73h574xwo051r2xjepln3kk"); // sa = aabbaabb(rp, &srect);
500 UNSUPPORTED("cl94uq2flao8cddtvg02oliwb"); // if (sa > a)
501 UNSUPPORTED("d9hnc5ox6fsga1e2336gg1fwv"); // maxa = sa > maxa ? sa : maxa;
502 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
503 UNSUPPORTED("6nmie1l1f5g573kzykn3266zd"); // if (maxa > 0.0)
504 UNSUPPORTED("dm9264t4efl70h617d1apqrlj"); // return maxa;
505 UNSUPPORTED("3vems3bwps1fshis117u06l2l"); // /*replace overlapping label/object pair */
506 UNSUPPORTED("c3ewj48u0ngzq2xd8g3238ays"); // intrsx[i] = cp;
507 UNSUPPORTED("efte22brajv8hm98pgq1oyjc5"); // return a;
508 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
509 UNSUPPORTED("2u8wtbwfirvx570l7nhbkqwmn"); // intrsx[i] = cp;
510 UNSUPPORTED("3gfohtnqgemf2e1akg4je944a"); // return a;
511 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
512
513 throw new UnsupportedOperationException();
509 public static double recordlintrsx(ST_XLabels_t xlp, ST_object_t op, ST_object_t cp, ST_Rect_t rp, double a, ST_object_t intrsx[]) {
510 ENTERING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx");
511 try {
512 int i = getintrsxi(xlp, op, cp);
513 if (i < 0)
514 i = 5;
515 if (intrsx[i] != null) {
516 double sa, maxa = 0.0;
517 final ST_Rect_t srect = new ST_Rect_t();
518 /* keep maximally overlapping object */
519 objp2rect(intrsx[i], srect);
520 sa = aabbaabb(rp, srect);
521 if (sa > a)
522 maxa = sa;
523 /*keep maximally overlapping label */
524 if (intrsx[i].lbl!=null) {
525 objplp2rect(intrsx[i], srect);
526 sa = aabbaabb(rp, srect);
527 if (sa > a)
528 maxa = sa > maxa ? sa : maxa;
529 }
530 if (maxa > 0.0)
531 return maxa;
532 /*replace overlapping label/object pair */
533 intrsx[i] = cp;
534 return a;
535 }
536 intrsx[i] = cp;
537 return a;
538 } finally {
539 LEAVING("2umrncgkunxoyeuc8i9hd5pwa","recordlintrsx");
540 }
514541 }
515542
516543
518545
519546 //3 2td62i5hus8obwt8j1lo3ddj9
520547 // static BestPos_t xlintersections(XLabels_t * xlp, object_t * objp, object_t * intrsx[9])
521 public static Object xlintersections(Object... arg) {
522 UNSUPPORTED("5d1nc0otrpz1jjsig9p42wcdx"); // static BestPos_t
523 UNSUPPORTED("6wd33niscsg9gaphvjj2k27mk"); // xlintersections(XLabels_t * xlp, object_t * objp, object_t * intrsx[9])
524 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
525 UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
526 UNSUPPORTED("3zfiovc9yy1ux6pn9mcga1mhx"); // LeafList_t *ilp, *llp;
527 UNSUPPORTED("a1j5r089evbgqbrk12ebcposk"); // Rect_t rect, srect;
528 UNSUPPORTED("ac14qcqjljksbh1ulqbhsnrnb"); // BestPos_t bp;
529 UNSUPPORTED("cep99zzwrn6h0kw9g90d0bcx5"); // assert(objp->lbl);
530 UNSUPPORTED("at98kl98nqfoglwklw8bmf8dy"); // bp.n = 0;
531 UNSUPPORTED("6umte8r5yaoo1st9aa3ak69vv"); // bp.area = 0.0;
532 UNSUPPORTED("6lbd8rbktjb11npai18mqgehg"); // bp.pos = objp->lbl->pos;
533 UNSUPPORTED("bu059qij9p4jrq3c2fc3dv1tc"); // for(i=0; i<xlp->n_objs; i++) {
534 UNSUPPORTED("2ju28cg7zhx8a22r2nngjed1z"); // if(objp == &xlp->objs[i]) continue;
535 UNSUPPORTED("8y5ea7egphfppbq3tbxnqvszd"); // if(xlp->objs[i].sz.x > 0 && xlp->objs[i].sz.y > 0) continue;
536 UNSUPPORTED("8kr7yfnz75qb1mcurk9ikvqm4"); // if(lblenclosing(objp, &xlp->objs[i]) ) {
537 UNSUPPORTED("4szbt8bacnec4eh6741w9202k"); // bp.n++;
538 UNSUPPORTED("dquo3qofk56ds5xl95lhvcthf"); // }
539 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
540 UNSUPPORTED("3kxhpoylut0o1vn46d51xaxmm"); // objplp2rect(objp, &rect);
541 UNSUPPORTED("2oyraxz5ikxma3gbfbygvqyfb"); // llp = RTreeSearch(xlp->spdx, xlp->spdx->root, &rect);
542 UNSUPPORTED("5gmvhcq1f7m3vaw99uu5u2lhh"); // if (!llp)
543 UNSUPPORTED("6t20fkj318tjhdok8hlpbsnf7"); // return bp;
544 UNSUPPORTED("cu0fy461wercnkus2c5pix4y9"); // for (ilp = llp; ilp; ilp = ilp->next) {
545 UNSUPPORTED("694r1mgceoxxp4ktbci1h2qnm"); // double a, ra;
546 UNSUPPORTED("6sqdh7rdwpg33jt0ecjx3yobj"); // object_t *cp = ilp->leaf->data;
547 UNSUPPORTED("7wl0z6xy4danjs21muyt94sm7"); // if (cp == objp)
548 UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
549 UNSUPPORTED("91gncffnouukjk2940jfpcll4"); // /*label-object intersect */
550 UNSUPPORTED("8gzbd1z9dm5uszv31wx6una1n"); // objp2rect(cp, &srect);
551 UNSUPPORTED("c5t1kwupnkevwfpx3deb42y52"); // a = aabbaabb(&rect, &srect);
552 UNSUPPORTED("9zmfoo91yy2c8v5o1x9tul9a5"); // if (a > 0.0) {
553 UNSUPPORTED("di2i1k0ht9d4tbn1d0os7lj44"); // ra = recordointrsx(xlp, objp, cp, &rect, a, intrsx);
554 UNSUPPORTED("20fp32yan59vu7bbp6jc1t8fn"); // bp.n++;
555 UNSUPPORTED("asfx7fyb1rvar23xmjcttxkyc"); // bp.area += ra;
556 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
557 UNSUPPORTED("6pabj7ne9s1dinxh7rgynt84r"); // /*label-label intersect */
558 UNSUPPORTED("6azbae5tbds7g6ytolv14300v"); // if (!cp->lbl || !cp->lbl->set)
559 UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
560 UNSUPPORTED("4jw7tfl9ltqgflydxukej7r0d"); // objplp2rect(cp, &srect);
561 UNSUPPORTED("c5t1kwupnkevwfpx3deb42y52"); // a = aabbaabb(&rect, &srect);
562 UNSUPPORTED("9zmfoo91yy2c8v5o1x9tul9a5"); // if (a > 0.0) {
563 UNSUPPORTED("db5ir72mk4a23hg0pqyapmdav"); // ra = recordlintrsx(xlp, objp, cp, &rect, a, intrsx);
564 UNSUPPORTED("20fp32yan59vu7bbp6jc1t8fn"); // bp.n++;
565 UNSUPPORTED("asfx7fyb1rvar23xmjcttxkyc"); // bp.area += ra;
566 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
567 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
568 UNSUPPORTED("6q4puajbcusq4jhaq2i60nlt4"); // RTreeLeafListFree(llp);
569 UNSUPPORTED("bgo7070e5cs998w6zp1ma85ad"); // return bp;
570 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
571
572 throw new UnsupportedOperationException();
548 public static ST_BestPos_t xlintersections(ST_XLabels_t xlp, ST_object_t objp, ST_object_t intrsx[]) {
549 ENTERING("2td62i5hus8obwt8j1lo3ddj9","xlintersections");
550 try {
551 return (ST_BestPos_t) xlintersections_(xlp, objp, intrsx).copy();
552 } finally {
553 LEAVING("2td62i5hus8obwt8j1lo3ddj9","xlintersections");
554 }
555 }
556
557 private static ST_BestPos_t xlintersections_(ST_XLabels_t xlp, ST_object_t objp, ST_object_t intrsx[]) {
558 int i;
559 ST_LeafList_t ilp, llp;
560 final ST_Rect_t rect = new ST_Rect_t();
561 final ST_Rect_t srect = new ST_Rect_t();
562 final ST_BestPos_t bp = new ST_BestPos_t();
563 // assert(objp->lbl);
564 bp.setInt("n", 0);
565 bp.setDouble("area", 0.0);
566 bp.setStruct("pos", objp.lbl.getStruct().pos);
567 for(i=0; i<xlp.n_objs; i++) {
568 if (EQ(objp, xlp.objs.plus(i).getStruct())) continue;
569 if(xlp.objs.get(i).sz.x > 0 && xlp.objs.get(i).sz.y > 0) continue;
570 if(lblenclosing(objp, (ST_object_t) xlp.objs.plus(i).getStruct())) {
571 bp.setInt("n", bp.n+1);
572 }
573 }
574 objplp2rect((ST_object_t) objp.getStruct(), rect);
575 llp = RTreeSearch((ST_RTree)xlp.spdx, (ST_Node_t___)xlp.spdx.root, rect);
576 if (N(llp))
577 return bp;
578 for (ilp = llp; ilp!=null; ilp = (ST_LeafList_t) ilp.next) {
579 double a, ra;
580 // WARNING FOR TRANSLATION
581 // In the C code, "data" was used. However ST_Branch_t is very close to ST_Leaf_t
582 // So in Java version, ST_Leaf_t has been removed and ST_Branch_t is used instead
583 ST_object_t cp = (ST_object_t) ilp.leaf.child;
584 if (EQ(cp, objp))
585 continue;
586 /*label-object intersect */
587 objp2rect((ST_object_t) cp.getStruct(), srect);
588 a = aabbaabb(rect, srect);
589 if (a > 0.0) {
590 ra = recordointrsx(xlp, objp, cp, rect, a, intrsx);
591 bp.setInt("n", bp.n+1);
592 bp.setDouble("area", bp.area+ra);
593 }
594 /*label-label intersect */
595 if (N(cp.lbl) || N(cp.lbl.getStruct().set))
596 continue;
597 objplp2rect((ST_object_t) cp.getStruct(), srect);
598 a = aabbaabb(rect, srect);
599 if (a > 0.0) {
600 ra = recordlintrsx(xlp, objp, cp, rect, a, intrsx);
601 bp.setInt("n", bp.n+1);
602 bp.setDouble("area", bp.area+ra);
603 }
604 }
605 RTreeLeafListFree(llp);
606 return bp;
573607 }
574608
575609
577611
578612 //3 8rxvucqsqnqej6h8p1osfnk4b
579613 // static BestPos_t xladjust(XLabels_t * xlp, object_t * objp)
580 public static Object xladjust(Object... arg) {
581 UNSUPPORTED("855u8yvlwgwm8xrgmk8yd4q2g"); // static BestPos_t xladjust(XLabels_t * xlp, object_t * objp)
582 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
583 UNSUPPORTED("3wparjbgs7cft1xsjcztm8bdh"); // xlabel_t *lp = objp->lbl;
584 UNSUPPORTED("3z9wizs5r8uuyz9r6zxqmltyr"); // double xincr = ((2 * lp->sz.x) + objp->sz.x) / 8;
585 UNSUPPORTED("6y5jbcs5zcnghcye723x4gerv"); // double yincr = ((2 * lp->sz.y) + objp->sz.y) / 2;
586 UNSUPPORTED("75ucply06uar4cxvlazotnq23"); // object_t *intrsx[9];
587 UNSUPPORTED("9akjtu5ebkpokhkmmtkmz7alu"); // BestPos_t bp, nbp;
588 UNSUPPORTED("cep99zzwrn6h0kw9g90d0bcx5"); // assert(objp->lbl);
589 UNSUPPORTED("8imr23u6gekt0djjf1kronrfn"); // memset(intrsx, 0, sizeof(intrsx));
590 UNSUPPORTED("1yhd7hlhm8avh8zzfa6szjhz"); // /*x left */
591 UNSUPPORTED("9j4u90wq1z4maw7hj3ecfdm76"); // lp->pos.x = objp->pos.x - lp->sz.x;
592 UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
593 UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
594 UNSUPPORTED("4ol5wxgvom71bm5d6x8u1uhce"); // bp = xlintersections(xlp, objp, intrsx);
595 UNSUPPORTED("b2di2eiikxmj7aprwrglzmouu"); // if (bp.n == 0)
596 UNSUPPORTED("6t20fkj318tjhdok8hlpbsnf7"); // return bp;
597 UNSUPPORTED("aagnln5mk16fd69wnvh7p5m33"); // /*mid */
598 UNSUPPORTED("b7imuebo95ow7fl42ukl08csq"); // lp->pos.y = objp->pos.y;
599 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
600 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
601 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
602 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
603 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
604 UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
605 UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
606 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
607 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
608 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
609 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
610 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
611 UNSUPPORTED("7fnjcyugtimcpcfm4309c9tdm"); // /*x mid */
612 UNSUPPORTED("321pfgsh01nbsjro6xmf2ayfz"); // lp->pos.x = objp->pos.x;
613 UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
614 UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
615 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
616 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
617 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
618 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
619 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
620 UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
621 UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
622 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
623 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
624 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
625 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
626 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
627 UNSUPPORTED("630ofptck59xowlm1hcwiue59"); // /*x right */
628 UNSUPPORTED("3zrvv0dmz98537x06egk4mwsj"); // lp->pos.x = objp->pos.x + objp->sz.x;
629 UNSUPPORTED("dximv1vws8eaor4idmmxl4cxm"); // /*top */
630 UNSUPPORTED("2fqhd5bouvdzxkjo7cb26f1be"); // lp->pos.y = objp->pos.y + objp->sz.y;
631 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
632 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
633 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
634 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
635 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
636 UNSUPPORTED("aagnln5mk16fd69wnvh7p5m33"); // /*mid */
637 UNSUPPORTED("b7imuebo95ow7fl42ukl08csq"); // lp->pos.y = objp->pos.y;
638 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
639 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
640 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
641 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
642 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
643 UNSUPPORTED("d0vrsmmihdqn5mrg1ukoz4opr"); // /*bottom */
644 UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
645 UNSUPPORTED("4a8niot6lun3zef1tls6aomot"); // nbp = xlintersections(xlp, objp, intrsx);
646 UNSUPPORTED("5d0zdvxl3sgzkryeuli9o53y8"); // if (nbp.n == 0)
647 UNSUPPORTED("6a6aos5zy43mcgqak0sb6pm5f"); // return nbp;
648 UNSUPPORTED("anqn2ghhjsx21704j9hnkxqle"); // if (nbp.area < bp.area)
649 UNSUPPORTED("ct5bwjy62uv01c11htvtjj68p"); // bp = nbp;
650 UNSUPPORTED("6eft7mmbcin2x9bhx6gvtc33b"); // /*sliding from top left */
651 UNSUPPORTED("2lmnvn101cpkt9b1cwipe71gz"); // if (intrsx[6] || intrsx[7] || intrsx[8] || intrsx[3] || intrsx[0]) { /* have to move */
614 public static ST_BestPos_t xladjust(ST_XLabels_t xlp, ST_object_t objp) {
615 ENTERING("8rxvucqsqnqej6h8p1osfnk4b","xladjust");
616 try {
617 return (ST_BestPos_t) xladjust_(xlp, objp).copy();
618 } finally {
619 LEAVING("8rxvucqsqnqej6h8p1osfnk4b","xladjust");
620 }
621 }
622 private static ST_BestPos_t xladjust_(ST_XLabels_t xlp, ST_object_t objp) {
623 ST_xlabel_t.Array lp = (ST_xlabel_t.Array) objp.lbl; // ST_xlabel_t
624 double xincr = ((2 * lp.getStruct().sz.x + objp.sz.x)) / 8;
625 double yincr = ((2 * lp.getStruct().sz.y + objp.sz.y)) / 2;
626 ST_object_t intrsx[] = new ST_object_t[9];
627 final ST_BestPos_t bp = new ST_BestPos_t();
628 final ST_BestPos_t nbp = new ST_BestPos_t();
629 // assert(objp->lbl);
630 // memset(intrsx, 0, sizeof(intrsx));
631 /*x left */
632 lp.getStruct().pos.setDouble("x", objp.pos.x - lp.getStruct().sz.x);
633 /*top */
634 lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
635 bp.___(xlintersections(xlp, objp, intrsx));
636 if (bp.n == 0)
637 return bp;
638 /*mid */
639 lp.getStruct().pos.setDouble("y", objp.pos.y);
640 nbp.___(xlintersections(xlp, objp, intrsx));
641 if (nbp.n == 0)
642 return nbp;
643 if (nbp.area < bp.area)
644 bp.___(nbp);
645 /*bottom */
646 lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
647 nbp.___(xlintersections(xlp, objp, intrsx));
648 if (nbp.n == 0)
649 return nbp;
650 if (nbp.area < bp.area)
651 bp.___(nbp);
652 /*x mid */
653 lp.getStruct().pos.setDouble("x", objp.pos.x);
654 /*top */
655 lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
656 nbp.___(xlintersections(xlp, objp, intrsx));
657 if (nbp.n == 0)
658 return nbp;
659 if (nbp.area < bp.area)
660 bp.___(nbp);
661 /*bottom */
662 lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
663 nbp.___(xlintersections(xlp, objp, intrsx));
664 if (nbp.n == 0)
665 return nbp;
666 if (nbp.area < bp.area)
667 bp.___(nbp);
668 /*x right */
669 lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
670 /*top */
671 lp.getStruct().pos.setDouble("y", objp.pos.y + objp.sz.y);
672 nbp.___(xlintersections(xlp, objp, intrsx));
673 if (nbp.n == 0)
674 return nbp;
675 if (nbp.area < bp.area)
676 bp.___(nbp);
677 /*mid */
678 lp.getStruct().pos.setDouble("y", objp.pos.y);
679 nbp.___(xlintersections(xlp, objp, intrsx));
680 if (nbp.n == 0)
681 return nbp;
682 if (nbp.area < bp.area)
683 bp.___(nbp);
684 /*bottom */
685 lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
686 nbp.___(xlintersections(xlp, objp, intrsx));
687 if (nbp.n == 0)
688 return nbp;
689 if (nbp.area < bp.area)
690 bp.___(nbp);
691 /*sliding from top left */
692 if (intrsx[6]!=null || intrsx[7]!=null || intrsx[8]!=null || intrsx[3]!=null || intrsx[0]!=null) { /* have to move */
652693 UNSUPPORTED("c5acs4cl77hgu5j6nmhk090uz"); // if (!intrsx[7] && !intrsx[8]) { /* some room right? */
653694 UNSUPPORTED("ez8sbh237xdqdjeewev2ys74y"); // /* slide along upper edge */
654695 UNSUPPORTED("ajgw2jggmwmofm77lgbx5eo2n"); // for (lp->pos.x = objp->pos.x - lp->sz.x,
675716 UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
676717 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
677718 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
678 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
679 UNSUPPORTED("8nu4s12gyh52h2ot9r2mlueuv"); // /*sliding from bottom right */
680 UNSUPPORTED("3zrvv0dmz98537x06egk4mwsj"); // lp->pos.x = objp->pos.x + objp->sz.x;
681 UNSUPPORTED("f5b4ggww4fzy0j1ustukdd023"); // lp->pos.y = objp->pos.y - lp->sz.y;
682 UNSUPPORTED("9bzyoo2lc0pw2w76mz7eeduvc"); // if (intrsx[2] || intrsx[1] || intrsx[0] || intrsx[5] || intrsx[8]) { /* have to move */
683 UNSUPPORTED("dq7ul34gznvszkqhgqlz4fihm"); // if (!intrsx[1] && !intrsx[0]) { /* some room left? */
684 UNSUPPORTED("ahn6dk8lj2by2umnd8pceb83d"); // /* slide along lower edge */
685 UNSUPPORTED("7natp0873pfsvymhhhvki1sev"); // for (lp->pos.x = objp->pos.x + objp->sz.x,
686 UNSUPPORTED("56ycmo0ljb7e86mnezdx3regh"); // lp->pos.y = objp->pos.y - lp->sz.y;
687 UNSUPPORTED("3wro576dh2vj9wpmfxx4rldbm"); // lp->pos.x >= (objp->pos.x - lp->sz.x);
688 UNSUPPORTED("bvw5pjd7v4j796l8hhh1zrln6"); // lp->pos.x -= xincr) {
689 UNSUPPORTED("8pbum2o0fs86ceaiuxv4efbb6"); // nbp = xlintersections(xlp, objp, intrsx);
690 UNSUPPORTED("5xx7o143ftoj0rhyhg1hqgioa"); // if (nbp.n == 0)
691 UNSUPPORTED("eqanxe9w90oki7yqvwyzpfcw1"); // return nbp;
692 UNSUPPORTED("8yd6g3a3f0g09gmu5f67vah0x"); // if (nbp.area < bp.area)
693 UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
694 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
695 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
696 UNSUPPORTED("4owpyb9p8esm06ttngj1arl5c"); // if (!intrsx[5] && !intrsx[8]) { /* some room up? */
719 }
720 /*sliding from bottom right */
721 lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x);
722 lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
723 if (intrsx[2]!=null || intrsx[1]!=null || intrsx[0]!=null || intrsx[5]!=null || intrsx[8]!=null) { /* have to move */
724 if (N(intrsx[1]) && N(intrsx[0])) { /* some room left? */
725 /* slide along lower edge */
726 for (lp.getStruct().pos.setDouble("x", objp.pos.x + objp.sz.x),
727 lp.getStruct().pos.setDouble("y", objp.pos.y - lp.getStruct().sz.y);
728 lp.getStruct().pos.x >= (objp.pos.x - lp.getStruct().sz.x);
729 lp.getStruct().pos.setDouble("x", lp.getStruct().pos.x - xincr)) {
730 nbp.___(xlintersections(xlp, objp, intrsx));
731 if (nbp.n == 0)
732 return nbp;
733 if (nbp.area < bp.area)
734 bp.___(nbp);
735 }
736 }
737 if (N(intrsx[5]) && N(intrsx[8])) { /* some room up? */
697738 UNSUPPORTED("4bcpk3ixfwrlr0yzrjv2efigj"); // /* slide up right edge */
698739 UNSUPPORTED("7natp0873pfsvymhhhvki1sev"); // for (lp->pos.x = objp->pos.x + objp->sz.x,
699740 UNSUPPORTED("56ycmo0ljb7e86mnezdx3regh"); // lp->pos.y = objp->pos.y - lp->sz.y;
705746 UNSUPPORTED("8yd6g3a3f0g09gmu5f67vah0x"); // if (nbp.area < bp.area)
706747 UNSUPPORTED("d6ac36j6lh6qspxwnn3vi0uc3"); // bp = nbp;
707748 UNSUPPORTED("6t98dcecgbvbvtpycwiq2ynnj"); // }
708 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
709 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
710 UNSUPPORTED("bgo7070e5cs998w6zp1ma85ad"); // return bp;
711 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
712
713 throw new UnsupportedOperationException();
749 }
750 }
751 return bp;
714752 }
715753
716754
718756
719757 //3 e29g2hwlogx0zchsnvi464c7t
720758 // static int xlhdxload(XLabels_t * xlp)
721 public static Object xlhdxload(Object... arg) {
722 UNSUPPORTED("ttxmlo99ck9eo0jae04cg2v0"); // static int xlhdxload(XLabels_t * xlp)
723 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
724 UNSUPPORTED("b17di9c7wgtqm51bvsyxz6e2f"); // int i;
725 UNSUPPORTED("5qghcwlht7sxz3cthtja5f043"); // int order = xlhorder(xlp);
726 UNSUPPORTED("eali4r93mgkm937waq6to82sj"); // for (i = 0; i < xlp->n_objs; i++) {
727 UNSUPPORTED("aves0wxiz65s447kr8wukl6zr"); // HDict_t *hp;
728 UNSUPPORTED("43j1m17g0mjbn69pbx7ph6omt"); // point pi;
729 UNSUPPORTED("bn6ewrzw1x1whedilfc6kobal"); // hp = (HDict_t*)zmalloc(sizeof(HDict_t));
730 UNSUPPORTED("5wresbe1bm8eff0j10in23a8b"); // hp->d.data = &xlp->objs[i];
731 UNSUPPORTED("7syosspcm4ygedrsu0c1gaqop"); // hp->d.rect = objplpmks(xlp, &xlp->objs[i]);
732 UNSUPPORTED("6mb29odwxakb6cqdulhhed9j5"); // /* center of the labeling area */
733 UNSUPPORTED("83ihi4lf580lzo4gdus20wr2w"); // pi.x = hp->d.rect.boundary[0] +
734 UNSUPPORTED("ao944ocofv44otdeh08kl4u8o"); // (hp->d.rect.boundary[2] - hp->d.rect.boundary[0]) / 2;
735 UNSUPPORTED("3igtyiyl8cpovcwukpm44iquw"); // pi.y = hp->d.rect.boundary[1] +
736 UNSUPPORTED("3r4kfmd4lw5d0osh14sf4cjwg"); // (hp->d.rect.boundary[3] - hp->d.rect.boundary[1]) / 2;
737 UNSUPPORTED("42x3x9vgkald7xdpbxyxih2zj"); // hp->key = hd_hil_s_from_xy(pi, order);
738 UNSUPPORTED("4apoyv2n3t2fcv72hom4owvgj"); // if (!((*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(hp),0000001)))
739 UNSUPPORTED("aivfd7ajlfz8o8oi68d4u5s5z"); // return -1;
740 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
741 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
742 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
743
744 throw new UnsupportedOperationException();
759 public static int xlhdxload(ST_XLabels_t xlp) {
760 ENTERING("e29g2hwlogx0zchsnvi464c7t","xlhdxload");
761 try {
762 int i;
763 int order = xlhorder(xlp);
764 for (i = 0; i < xlp.n_objs; i++) {
765 ST_HDict_t hp;
766 final ST_point pi = new ST_point();
767 hp = new ST_HDict_t();
768 hp.d.child = xlp.objs.get(i);
769 hp.d.setStruct("rect", objplpmks(xlp, (ST_object_t) xlp.objs.plus(i).getStruct()));
770 /* center of the labeling area */
771 pi.setInt("x", hp.d.rect.boundary[0] +
772 (hp.d.rect.boundary[2] - hp.d.rect.boundary[0]) / 2);
773 pi.setInt("y", hp.d.rect.boundary[1] +
774 (hp.d.rect.boundary[3] - hp.d.rect.boundary[1]) / 2);
775 hp.setInt("key", hd_hil_s_from_xy(pi, order));
776 if (N(xlp.hdx.searchf.exe(xlp.hdx, hp, 0000001)))
777 return -1;
778 }
779 return 0;
780 } finally {
781 LEAVING("e29g2hwlogx0zchsnvi464c7t","xlhdxload");
782 }
745783 }
746784
747785
749787
750788 //3 26qpvnyd6tmdut8i2wo4itza3
751789 // static void xlhdxunload(XLabels_t * xlp)
752 public static Object xlhdxunload(Object... arg) {
753 UNSUPPORTED("4bsnj74f63qe288s6be1xmrzw"); // static void xlhdxunload(XLabels_t * xlp)
754 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
755 UNSUPPORTED("9sqtid8yyo2ws8avf33utdebf"); // int size=dtsize(xlp->hdx), freed=0;
756 UNSUPPORTED("dm7bmt2fwlkdskmcebdm1ctqj"); // while(dtsize(xlp->hdx) ) {
757 UNSUPPORTED("a3jz6ykhoarsdfviidq7beb9z"); // void*vp=(((Dt_t*)(xlp->hdx))->data->here ? (((Dt_t*)((xlp->hdx)))->disc->link < 0 ? ((Dthold_t*)((((Dt_t*)(xlp->hdx))->data->here)))->obj : (void*)((char*)((((Dt_t*)(xlp->hdx))->data->here)) - ((Dt_t*)((xlp->hdx)))->disc->link) ):(void*)(0));
758 UNSUPPORTED("2covsywkzvpkysnjf34nmr1uw"); // assert(vp);
759 UNSUPPORTED("a9jmr8hmnwcky7f1e1qorwnjv"); // if(vp) {
760 UNSUPPORTED("d2vfgb4tj6x8x7cq0kv0qgk23"); // (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(vp),0010000);
761 UNSUPPORTED("7f4abg2jsf465jjlnp95d9sk6"); // free(vp);
762 UNSUPPORTED("5hklxkrkvjgi37kkm6v9xajwc"); // freed++;
763 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
764 UNSUPPORTED("7ijd6pszsxnoopppf6xwo8wdl"); // }
765 UNSUPPORTED("bifp41eoqo8l51crrab087z21"); // assert(size==freed);
766 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
767
768 throw new UnsupportedOperationException();
790 public static void xlhdxunload(ST_XLabels_t xlp) {
791 ENTERING("26qpvnyd6tmdut8i2wo4itza3","xlhdxunload");
792 try {
793 //UNSUPPORTED("4bsnj74f63qe288s6be1xmrzw"); // static void xlhdxunload(XLabels_t * xlp)
794 //UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
795 //UNSUPPORTED("9sqtid8yyo2ws8avf33utdebf"); // int size=dtsize(xlp->hdx), freed=0;
796 //UNSUPPORTED("dm7bmt2fwlkdskmcebdm1ctqj"); // while(dtsize(xlp->hdx) ) {
797 //UNSUPPORTED("a3jz6ykhoarsdfviidq7beb9z"); // void*vp=(((Dt_t*)(xlp->hdx))->data->here ? (((Dt_t*)((xlp->hdx)))->disc->link < 0 ? ((Dthold_t*)((((Dt_t*)(xlp->hdx))->data->here)))->obj : (void*)((char*)((((Dt_t*)(xlp->hdx))->data->here)) - ((Dt_t*)((xlp->hdx)))->disc->link) ):(void*)(0));
798 //UNSUPPORTED("2covsywkzvpkysnjf34nmr1uw"); // assert(vp);
799 //UNSUPPORTED("a9jmr8hmnwcky7f1e1qorwnjv"); // if(vp) {
800 //UNSUPPORTED("d2vfgb4tj6x8x7cq0kv0qgk23"); // (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(vp),0010000);
801 //UNSUPPORTED("7f4abg2jsf465jjlnp95d9sk6"); // free(vp);
802 //UNSUPPORTED("5hklxkrkvjgi37kkm6v9xajwc"); // freed++;
803 //UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
804 //UNSUPPORTED("7ijd6pszsxnoopppf6xwo8wdl"); // }
805 //UNSUPPORTED("bifp41eoqo8l51crrab087z21"); // assert(size==freed);
806 //UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
807 } finally {
808 LEAVING("26qpvnyd6tmdut8i2wo4itza3","xlhdxunload");
809 }
769810 }
770811
771812
773814
774815 //3 3wrxwwd3y5ts0ekr32o8vhuvv
775816 // static int xlspdxload(XLabels_t * xlp)
776 public static Object xlspdxload(Object... arg) {
777 UNSUPPORTED("87f4jxirnq7mx28zcremgaezf"); // static int xlspdxload(XLabels_t * xlp)
778 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
779 UNSUPPORTED("eoerd3bf05xvvfj7aisz4slcs"); // HDict_t *op=0;
780 UNSUPPORTED("2ub4kt9g1hlj02ucnbi3as0ps"); // for (op = (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(0),0000200); op; op = (*(((Dt_t*)(xlp->hdx))->searchf))((xlp->hdx),(void*)(op),0000010)) {
781 UNSUPPORTED("cklsugu3v9hzi5pvl4dqcq7gf"); // /* tree rectangle data node lvl */
782 UNSUPPORTED("b49ahflq7xke1g6eoxv0jw2tg"); // RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0);
783 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
784 UNSUPPORTED("5oxhd3fvp0gfmrmz12vndnjt"); // return 0;
785 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
786
787 throw new UnsupportedOperationException();
817 public static int xlspdxload(ST_XLabels_t xlp) {
818 ENTERING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload");
819 try {
820 ST_HDict_t op=null;
821 for (op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, null, 0000200); op!=null;
822 op = (ST_HDict_t) xlp.hdx.searchf.exe(xlp.hdx, op, 0000010)) {
823 /* tree rectangle data node lvl */
824 // RTreeInsert(xlp->spdx, &op->d.rect, op->d.data, &xlp->spdx->root, 0);
825 // WARNING ARRAY
826 final ST_Node_t___[] tmp = new ST_Node_t___[] {(ST_Node_t___) xlp.spdx.root};
827 RTreeInsert((ST_RTree) xlp.spdx, (ST_Rect_t)op.d.rect,
828 op.d.child,
829 tmp, 0);
830 xlp.spdx.setPtr("root", tmp[0]);
831 }
832 return 0;
833 } finally {
834 LEAVING("3wrxwwd3y5ts0ekr32o8vhuvv","xlspdxload");
835 }
788836 }
789837
790838
792840
793841 //3 6d3fqrllm55toeo3wscwvv4ty
794842 // static int xlinitialize(XLabels_t * xlp)
795 public static Object xlinitialize(Object... arg) {
796 UNSUPPORTED("732719k3woyiirridxkwkzxoo"); // static int xlinitialize(XLabels_t * xlp)
797 UNSUPPORTED("erg9i1970wdri39osu8hx2a6e"); // {
798 UNSUPPORTED("4s45njph0l3mj07r60fuv2k3y"); // int r=0;
799 UNSUPPORTED("ez5mifho06mx5h3ncausptuzp"); // if ((r = xlhdxload(xlp)) < 0)
800 UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
801 UNSUPPORTED("f2rrvhf7kqopq3w2vk3a66gqq"); // if ((r = xlspdxload(xlp)) < 0)
802 UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
803 UNSUPPORTED("5stn8d1urg4jlet1hh0it6cnh"); // xlhdxunload(xlp);
804 UNSUPPORTED("bevdavatk2tsg3i7wugaqk0ta"); // return dtclose(xlp->hdx);
805 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
806
807 throw new UnsupportedOperationException();
843 public static int xlinitialize(ST_XLabels_t xlp) {
844 ENTERING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize");
845 try {
846 int r=0;
847 if ((r = xlhdxload(xlp)) < 0)
848 return r;
849 if ((r = xlspdxload(xlp)) < 0)
850 return r;
851 xlhdxunload(xlp);
852 return dtclose((ST_dt_s) xlp.hdx);
853 } finally {
854 LEAVING("6d3fqrllm55toeo3wscwvv4ty","xlinitialize");
855 }
808856 }
809857
810858
812860
813861 //3 brqgbskh3z4ah8infjompibvu
814862 // int placeLabels(object_t * objs, int n_objs, xlabel_t * lbls, int n_lbls, label_params_t * params)
815 public static int placeLabels(__ptr__ objs, int n_objs, __ptr__ lbls, int n_lbls, label_params_t params) {
863 public static int placeLabels(ST_object_t.Array objs, int n_objs, ST_xlabel_t.Array lbls, int n_lbls, ST_label_params_t params) {
864 ENTERING("brqgbskh3z4ah8infjompibvu","placeLabels");
865 try {
816866 int r, i;
817 BestPos_t bp;
818 XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
819 UNSUPPORTED("dm5w2lmehr2rv6b2yi2v83i3g"); // if ((r = xlinitialize(xlp)) < 0)
820 UNSUPPORTED("bt8wt6mqb316pv7egiekltb74"); // return r;
821 UNSUPPORTED("8izrf1sxed8y2dmpz5ju27b6h"); // /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left
822 UNSUPPORTED("dy7wplw95swrlkv1ne5udmbk4"); // * corner is lp->pos, and size is lp->sz does not intersect any object
823 UNSUPPORTED("8x5vdo798lnffr7xy14gs8x50"); // * in objs (by convention, an object consisting of a single point
824 UNSUPPORTED("9gxb8rlhafdv5g89oagw3add7"); // * intersects nothing) nor any other label, if possible. On input,
825 UNSUPPORTED("4w8t3nbzjsvab8g9jpodkwd8m"); // * lp->set is 0.
826 UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
827 UNSUPPORTED("z4vevdpoynmn19xji08qzk3g"); // * On output, any label with a position should have this stored in
828 UNSUPPORTED("4v5b9m6g4uktmdpnsll0erj7z"); // * lp->pos and have lp->set non-zero.
829 UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
830 UNSUPPORTED("3lkc8tv6lv7r7ufa9evyti04j"); // * If params->force is true, all labels must be positioned, even if
831 UNSUPPORTED("4lybka8gtaqneks34nylp952d"); // * overlaps are necessary.
832 UNSUPPORTED("e715w78m2sgdlih8srgyerdiv"); // *
833 UNSUPPORTED("5frb7jkllwey3jie0brk7sexw"); // * Return 0 if all labels could be placed without overlap;
834 UNSUPPORTED("b8t343yuuec8v0l5c25l9lpi9"); // * non-zero otherwise.
835 UNSUPPORTED("795vpnc8yojryr8b46aidsu69"); // */
836 UNSUPPORTED("dfy198s0balu93ez4di7muow9"); // r = 0;
837 UNSUPPORTED("bznihqrwh4167vo2mn4du53da"); // for (i = 0; i < n_objs; i++) {
838 UNSUPPORTED("1kray7p45i859cpqe20uu98y6"); // if (objs[i].lbl == 0)
839 UNSUPPORTED("6hqli9m8yickz1ox1qfgtdbnd"); // continue;
840 UNSUPPORTED("572cl1ylp2iqus4kjdigoqut3"); // bp = xladjust(xlp, &objs[i]);
841 UNSUPPORTED("dr8tnm5vyr6b4kb5le39f33s9"); // if (bp.n == 0) {
842 UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
843 UNSUPPORTED("crlmrxaiu6t07d3ztas7pwfoi"); // } else if(bp.area == 0) {
844 UNSUPPORTED("djsgfzak14js9ukvgmoqnkm8v"); // objs[i].lbl->pos.x = bp.pos.x;
845 UNSUPPORTED("5s2aq4djc0l3xyilkowd7ri1r"); // objs[i].lbl->pos.y = bp.pos.y;
846 UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
847 UNSUPPORTED("19st2bzrcserz5r5280g8iwb8"); // } else if (params->force == 1) {
848 UNSUPPORTED("djsgfzak14js9ukvgmoqnkm8v"); // objs[i].lbl->pos.x = bp.pos.x;
849 UNSUPPORTED("5s2aq4djc0l3xyilkowd7ri1r"); // objs[i].lbl->pos.y = bp.pos.y;
850 UNSUPPORTED("1wsz4ptoxskyulgu7czf059sf"); // objs[i].lbl->set = 1;
851 UNSUPPORTED("7yhr8hn3r6wohafwxrt85b2j2"); // } else {
852 UNSUPPORTED("cqgdtl138trieiu5el4upwpg0"); // r = 1;
853 UNSUPPORTED("flupwh3kosf3fkhkxllllt1"); // }
854 UNSUPPORTED("dvgyxsnyeqqnyzq696k3vskib"); // }
855 UNSUPPORTED("6oy0ry9luo305no4iuqqxcdjr"); // xlfree(xlp);
856 UNSUPPORTED("a2hk6w52njqjx48nq3nnn2e5i"); // return r;
857 UNSUPPORTED("c24nfmv9i7o5eoqaymbibp7m7"); // }
858
859 throw new UnsupportedOperationException();
860 }
861
862
863 }
867 final ST_BestPos_t bp = new ST_BestPos_t();
868 ST_XLabels_t xlp = xlnew(objs, n_objs, lbls, n_lbls, params);
869 if ((r = xlinitialize(xlp)) < 0)
870 return r;
871 /* Place xlabel_t* lp near lp->obj so that the rectangle whose lower-left
872 * corner is lp->pos, and size is lp->sz does not intersect any object
873 * in objs (by convention, an object consisting of a single point
874 * intersects nothing) nor any other label, if possible. On input,
875 * lp->set is 0.
876 *
877 * On output, any label with a position should have this stored in
878 * lp->pos and have lp->set non-zero.
879 *
880 * If params->force is true, all labels must be positioned, even if
881 * overlaps are necessary.
882 *
883 * Return 0 if all labels could be placed without overlap;
884 * non-zero otherwise.
885 */
886 r = 0;
887 for (i = 0; i < n_objs; i++) {
888 if (objs.get(i).lbl == null)
889 continue;
890 xladjust(xlp, (ST_object_t) objs.get(i).getStruct());
891 bp.___(xladjust(xlp, (ST_object_t) objs.get(i).getStruct()));
892 if (bp.n == 0) {
893 objs.get(i).lbl.setInt("set", 1);
894 } else if(bp.area == 0) {
895 objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x);
896 objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y);
897 objs.get(i).lbl.setInt("set", 1);
898 } else if (params.force) {
899 objs.get(i).lbl.getStruct().pos.setDouble("x", bp.pos.x);
900 objs.get(i).lbl.getStruct().pos.setDouble("y", bp.pos.y);
901 objs.get(i).lbl.setInt("set", 1);
902 } else {
903 r = 1;
904 }
905 }
906 xlfree(xlp);
907 return r;
908 } finally {
909 LEAVING("brqgbskh3z4ah8infjompibvu","placeLabels");
910 }
911 }
912
913
914 }
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350 import smetana.core.jmp_buf;
5451
5552 public class ortho__c {
178175
179176 //3 c1s4k85p1cdfn176o3uryeros
180177 // static inline pointf pointfof(double x, double y)
181 public static __struct__<pointf> pointfof(double x, double y) {
178 public static ST_pointf pointfof(double x, double y) {
182179 // WARNING!! STRUCT
183180 return pointfof_w_(x, y).copy();
184181 }
185 private static __struct__<pointf> pointfof_w_(double x, double y) {
182 private static ST_pointf pointfof_w_(double x, double y) {
186183 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
187184 try {
188 final __struct__<pointf> r = JUtils.from(pointf.class);
185 final ST_pointf r = new ST_pointf();
189186 r.setDouble("x", x);
190187 r.setDouble("y", y);
191188 return r;
214211
215212
216213
217 //3 1vvsta5i8of59frav6uymguav
218 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
219 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
220 // WARNING!! STRUCT
221 return boxfof_w_(llx, lly, urx, ury).copy();
222 }
223 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
224 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
225 try {
226 final __struct__<boxf> b = JUtils.from(boxf.class);
227 b.getStruct("LL").setDouble("x", llx);
228 b.getStruct("LL").setDouble("y", lly);
229 b.getStruct("UR").setDouble("x", urx);
230 b.getStruct("UR").setDouble("y", ury);
231 return b;
232 } finally {
233 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
234 }
235 }
236
237214
238215
239216
256233
257234 //3 arrsbik9b5tnfcbzsm8gr2chx
258235 // static inline pointf add_pointf(pointf p, pointf q)
259 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
236 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
260237 // WARNING!! STRUCT
261238 return add_pointf_w_(p.copy(), q.copy()).copy();
262239 }
263 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
240 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
264241 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
265242 try {
266 final __struct__<pointf> r = JUtils.from(pointf.class);
267 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
268 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
243 final ST_pointf r = new ST_pointf();
244 r.setDouble("x", p.x + q.x);
245 r.setDouble("y", p.y + q.y);
269246 return r;
270247 } finally {
271248 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350 import smetana.core.jmp_buf;
5451
5552 public class ccomps__c {
310307
311308 //3 c1s4k85p1cdfn176o3uryeros
312309 // static inline pointf pointfof(double x, double y)
313 public static __struct__<pointf> pointfof(double x, double y) {
310 public static ST_pointf pointfof(double x, double y) {
314311 // WARNING!! STRUCT
315312 return pointfof_w_(x, y).copy();
316313 }
317 private static __struct__<pointf> pointfof_w_(double x, double y) {
314 private static ST_pointf pointfof_w_(double x, double y) {
318315 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
319316 try {
320 final __struct__<pointf> r = JUtils.from(pointf.class);
317 final ST_pointf r = new ST_pointf();
321318 r.setDouble("x", x);
322319 r.setDouble("y", y);
323320 return r;
346343
347344
348345
349 //3 1vvsta5i8of59frav6uymguav
350 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
351 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
352 // WARNING!! STRUCT
353 return boxfof_w_(llx, lly, urx, ury).copy();
354 }
355 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
356 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
357 try {
358 final __struct__<boxf> b = JUtils.from(boxf.class);
359 b.getStruct("LL").setDouble("x", llx);
360 b.getStruct("LL").setDouble("y", lly);
361 b.getStruct("UR").setDouble("x", urx);
362 b.getStruct("UR").setDouble("y", ury);
363 return b;
364 } finally {
365 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
366 }
367 }
368
369346
370347
371348
388365
389366 //3 arrsbik9b5tnfcbzsm8gr2chx
390367 // static inline pointf add_pointf(pointf p, pointf q)
391 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
368 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
392369 // WARNING!! STRUCT
393370 return add_pointf_w_(p.copy(), q.copy()).copy();
394371 }
395 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
372 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
396373 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
397374 try {
398 final __struct__<pointf> r = JUtils.from(pointf.class);
399 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
400 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
375 final ST_pointf r = new ST_pointf();
376 r.setDouble("x", p.x + q.x);
377 r.setDouble("y", p.y + q.y);
401378 return r;
402379 } finally {
403380 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4747 import static smetana.core.JUtilsDebug.ENTERING;
4848 import static smetana.core.JUtilsDebug.LEAVING;
4949 import static smetana.core.Macro.UNSUPPORTED;
50 import h.Agraph_s;
51 import h.boxf;
52 import h.pack_info;
53 import h.pointf;
50 import h.ST_Agraph_s;
51 import h.ST_pack_info;
52 import h.ST_pointf;
5453 import smetana.core.CString;
55 import smetana.core.JUtils;
56 import smetana.core.__struct__;
5754
5855 public class pack__c {
5956 //1 2digov3edok6d5srhgtlmrycs
313310
314311 //3 c1s4k85p1cdfn176o3uryeros
315312 // static inline pointf pointfof(double x, double y)
316 public static __struct__<pointf> pointfof(double x, double y) {
313 public static ST_pointf pointfof(double x, double y) {
317314 // WARNING!! STRUCT
318315 return pointfof_w_(x, y).copy();
319316 }
320 private static __struct__<pointf> pointfof_w_(double x, double y) {
317 private static ST_pointf pointfof_w_(double x, double y) {
321318 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
322319 try {
323 final __struct__<pointf> r = JUtils.from(pointf.class);
320 final ST_pointf r = new ST_pointf();
324321 r.setDouble("x", x);
325322 r.setDouble("y", y);
326323 return r;
349346
350347
351348
352 //3 1vvsta5i8of59frav6uymguav
353 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
354 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
355 // WARNING!! STRUCT
356 return boxfof_w_(llx, lly, urx, ury).copy();
357 }
358 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
359 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
360 try {
361 final __struct__<boxf> b = JUtils.from(boxf.class);
362 b.getStruct("LL").setDouble("x", llx);
363 b.getStruct("LL").setDouble("y", lly);
364 b.getStruct("UR").setDouble("x", urx);
365 b.getStruct("UR").setDouble("y", ury);
366 return b;
367 } finally {
368 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
369 }
370 }
371
372349
373350
374351
391368
392369 //3 arrsbik9b5tnfcbzsm8gr2chx
393370 // static inline pointf add_pointf(pointf p, pointf q)
394 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
371 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
395372 // WARNING!! STRUCT
396373 return add_pointf_w_(p.copy(), q.copy()).copy();
397374 }
398 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
375 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
399376 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
400377 try {
401 final __struct__<pointf> r = JUtils.from(pointf.class);
402 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
403 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
378 final ST_pointf r = new ST_pointf();
379 r.setDouble("x", p.x + q.x);
380 r.setDouble("y", p.y + q.y);
404381 return r;
405382 } finally {
406383 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
19061883
19071884 //3 dyb1n3lhbi0wnr9kvmu6onux9
19081885 // pack_mode parsePackModeInfo(char* p, pack_mode dflt, pack_info* pinfo)
1909 public static int parsePackModeInfo(CString p, int dflt, pack_info pinfo) {
1886 public static int parsePackModeInfo(CString p, int dflt, ST_pack_info pinfo) {
19101887 ENTERING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
19111888 try {
19121889 float v;
19561933 //fprintf (stderr, " size %d\n", pinfo->sz);
19571934 //fprintf (stderr, " flags %d\n", pinfo->flags);
19581935 //}
1959 return pinfo.getInt("mode");
1936 return pinfo.mode;
19601937 } finally {
19611938 LEAVING("dyb1n3lhbi0wnr9kvmu6onux9","parsePackModeInfo");
19621939 }
19671944
19681945 //3 bnxqpsmvz6tyekstfjte4pzwj
19691946 // pack_mode getPackModeInfo(Agraph_t * g, pack_mode dflt, pack_info* pinfo)
1970 public static int getPackModeInfo(Agraph_s g, int dflt, pack_info pinfo) {
1947 public static int getPackModeInfo(ST_Agraph_s g, int dflt, ST_pack_info pinfo) {
19711948 ENTERING("bnxqpsmvz6tyekstfjte4pzwj","getPackModeInfo");
19721949 try {
19731950 return parsePackModeInfo (agget(g, new CString("packmode")), dflt, pinfo);
19971974
19981975 //3 ata97fmix5q1oikrmk5pezvrf
19991976 // int getPack(Agraph_t * g, int not_def, int dflt)
2000 public static int getPack(Agraph_s g, int not_def, int dflt) {
1977 public static int getPack(ST_Agraph_s g, int not_def, int dflt) {
20011978 ENTERING("ata97fmix5q1oikrmk5pezvrf","getPack");
20021979 try {
20031980 CString p;
20201997
20211998 //3 ce4a70w8ddkj4l9efi74h61s6
20221999 // pack_mode getPackInfo(Agraph_t * g, pack_mode dflt, int dfltMargin, pack_info* pinfo)
2023 public static int getPackInfo(Agraph_s g, int dflt, int dfltMargin, pack_info pinfo) {
2000 public static int getPackInfo(ST_Agraph_s g, int dflt, int dfltMargin, ST_pack_info pinfo) {
20242001 ENTERING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
20252002 try {
20262003 //assert (pinfo);
20312008 pinfo.setInt("doSplines", 0);
20322009 pinfo.setInt("fixed", 0);
20332010 getPackModeInfo(g, dflt, pinfo);
2034 return pinfo.getInt("mode");
2011 return pinfo.mode;
20352012 } finally {
20362013 LEAVING("ce4a70w8ddkj4l9efi74h61s6","getPackInfo");
20372014 }
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.boxf;
50 import h.pointf;
51 import smetana.core.JUtils;
52 import smetana.core.__struct__;
49 import h.ST_pointf;
5350
5451 public class ptest__c {
5552 //1 2digov3edok6d5srhgtlmrycs
309306
310307 //3 c1s4k85p1cdfn176o3uryeros
311308 // static inline pointf pointfof(double x, double y)
312 public static __struct__<pointf> pointfof(double x, double y) {
309 public static ST_pointf pointfof(double x, double y) {
313310 // WARNING!! STRUCT
314311 return pointfof_w_(x, y).copy();
315312 }
316 private static __struct__<pointf> pointfof_w_(double x, double y) {
313 private static ST_pointf pointfof_w_(double x, double y) {
317314 ENTERING("c1s4k85p1cdfn176o3uryeros","pointfof");
318315 try {
319 final __struct__<pointf> r = JUtils.from(pointf.class);
316 final ST_pointf r = new ST_pointf();
320317 r.setDouble("x", x);
321318 r.setDouble("y", y);
322319 return r;
345342
346343
347344
348 //3 1vvsta5i8of59frav6uymguav
349 // static inline boxf boxfof(double llx, double lly, double urx, double ury)
350 public static __struct__<boxf> boxfof(double llx, double lly, double urx, double ury) {
351 // WARNING!! STRUCT
352 return boxfof_w_(llx, lly, urx, ury).copy();
353 }
354 private static __struct__<boxf> boxfof_w_(double llx, double lly, double urx, double ury) {
355 ENTERING("1vvsta5i8of59frav6uymguav","boxfof");
356 try {
357 final __struct__<boxf> b = JUtils.from(boxf.class);
358 b.getStruct("LL").setDouble("x", llx);
359 b.getStruct("LL").setDouble("y", lly);
360 b.getStruct("UR").setDouble("x", urx);
361 b.getStruct("UR").setDouble("y", ury);
362 return b;
363 } finally {
364 LEAVING("1vvsta5i8of59frav6uymguav","boxfof");
365 }
366 }
367
368
369345
370346
371347 //3 1n5xl70wxuabyf97mclvilsm6
387363
388364 //3 arrsbik9b5tnfcbzsm8gr2chx
389365 // static inline pointf add_pointf(pointf p, pointf q)
390 public static __struct__<pointf> add_pointf(final __struct__<pointf> p, final __struct__<pointf> q) {
366 public static ST_pointf add_pointf(final ST_pointf p, final ST_pointf q) {
391367 // WARNING!! STRUCT
392368 return add_pointf_w_(p.copy(), q.copy()).copy();
393369 }
394 private static __struct__<pointf> add_pointf_w_(final __struct__<pointf> p, final __struct__<pointf> q) {
370 private static ST_pointf add_pointf_w_(final ST_pointf p, final ST_pointf q) {
395371 ENTERING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
396372 try {
397 final __struct__<pointf> r = JUtils.from(pointf.class);
398 r.setDouble("x", p.getDouble("x") + q.getDouble("x"));
399 r.setDouble("y", p.getDouble("y") + q.getDouble("y"));
373 final ST_pointf r = new ST_pointf();
374 r.setDouble("x", p.x + q.x);
375 r.setDouble("y", p.y + q.y);
400376 return r;
401377 } finally {
402378 LEAVING("arrsbik9b5tnfcbzsm8gr2chx","add_pointf");
4646 import static smetana.core.JUtilsDebug.ENTERING;
4747 import static smetana.core.JUtilsDebug.LEAVING;
4848 import static smetana.core.Macro.UNSUPPORTED;
49 import h.pointf;
50 import smetana.core.__struct__;
49 import h.ST_pointf;
5150
5251 public class cvt__c {
5352 //1 baedz5i9est5csw3epz3cv7z
247246
248247 //3 3xaxtxslceffm0wx9zcpiqjgb
249248 // static ilcoord_t Bezier(ilcoord_t * V, int degree, double t, ilcoord_t * Left, ilcoord_t * Right)
250 public static __struct__<pointf> Bezier(pointf V, int degree, double t, pointf Left, pointf Right) {
249 public static ST_pointf Bezier(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
251250 // WARNING!! STRUCT
252251 return Bezier_w_(V, degree, t, Left, Right).copy();
253252 }
254 private static __struct__<pointf> Bezier_w_(pointf V, int degree, double t, pointf Left, pointf Right) {
253 private static ST_pointf Bezier_w_(ST_pointf V, int degree, double t, ST_pointf Left, ST_pointf Right) {
255254 ENTERING("3xaxtxslceffm0wx9zcpiqjgb","Bezier");
256255 try {
257256 int i, j; /* Index variables */
4545 package gen.lib.pathplan;
4646 import static gen.lib.pathplan.solvers__c.solve3;
4747 import static smetana.core.JUtils.setjmp;
48 import static smetana.core.JUtils.sizeof;
4948 import static smetana.core.JUtils.sqrt;
5049 import static smetana.core.JUtilsDebug.ENTERING;
5150 import static smetana.core.JUtilsDebug.LEAVING;
5251 import static smetana.core.Macro.DISTSQ;
5352 import static smetana.core.Macro.N;
5453 import static smetana.core.Macro.UNSUPPORTED;
55 import h.Ppoly_t;
56 import h.pointf;
57 import h.tna_t;
58 import smetana.core.JUtils;
59 import smetana.core.Memory;
54 import h.ST_Pedge_t;
55 import h.ST_Ppoly_t;
56 import h.ST_pointf;
57 import h.ST_tna_t;
6058 import smetana.core.Z;
61 import smetana.core.__array_of_struct__;
62 import smetana.core.__array_of_struct_impl__;
6359 import smetana.core.__ptr__;
64 import smetana.core.__struct__;
6560 import smetana.core.jmp_buf;
6661
6762 public class route__c {
9085
9186 //3 9stmrdqlmufyk2wutp3totr5j
9287 // int Proutespline(Pedge_t * edges, int edgen, Ppolyline_t input, Ppoint_t * evs, Ppolyline_t * output)
93 public static int Proutespline(__ptr__ edges, int edgen, final __struct__<Ppoly_t> input, __ptr__ evs, __ptr__ output) {
94 // WARNING!! STRUCT
95 return Proutespline_w_(edges, edgen, input.copy(), evs, output);
96 }
97 private static int Proutespline_w_(__ptr__ edges, int edgen, final __struct__<Ppoly_t> input, __ptr__ evs, __ptr__ output) {
88 public static int Proutespline(ST_Pedge_t.Array edges, int edgen, ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) {
89 // WARNING!! STRUCT
90 return Proutespline_w_(edges, edgen, (ST_Ppoly_t) input.copy(), evs, output);
91 }
92 private static int Proutespline_w_(ST_Pedge_t.Array edges, int edgen, final ST_Ppoly_t input, __ptr__ evs, ST_Ppoly_t output) {
9893 ENTERING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
9994 try {
100 __ptr__ inps;
95 ST_pointf.Array inps;
10196 int inpn;
10297 /* unpack into previous format rather than modify legacy code */
103 inps = input.getPtr("ps");
104 inpn = input.getInt("pn");
98 inps = input.ps;
99 inpn = input.pn;
105100 if (setjmp(jbuf)!=0)
106101 UNSUPPORTED("8d9xfgejx5vgd6shva5wk5k06"); // return -1;
107102 /* generate the splines */
108 evs.plus(0).getStruct().___(normv(evs.plus(0).getStruct()));
109 evs.plus(1).getStruct().___(normv(evs.plus(1).getStruct()));
103 evs.plus(0).getStruct().___(normv((ST_pointf) evs.plus(0).getStruct()));
104 evs.plus(1).getStruct().___(normv((ST_pointf) evs.plus(1).getStruct()));
110105 Z.z().opl = 0;
111106 growops(4);
112107 Z.z().ops_route.plus(Z.z().opl).setStruct(inps.plus(0).getStruct());
113108 Z.z().opl++;
114 if (reallyroutespline(edges, edgen, inps, inpn, evs.plus(0).getStruct(), evs.plus(1).getStruct()) == -1)
109 if (reallyroutespline(edges, edgen, inps, inpn, (ST_pointf)evs.plus(0).getStruct(), (ST_pointf)evs.plus(1).getStruct()) == -1)
115110 return -1;
116111 output.setInt("pn", Z.z().opl);
117 output.setPtr("ps", Z.z().ops_route);
112 output.ps = Z.z().ops_route;
118113 return 0;
119114 } finally {
120115 LEAVING("9stmrdqlmufyk2wutp3totr5j","Proutespline");
128123 // static int reallyroutespline(Pedge_t * edges, int edgen, Ppoint_t * inps, int inpn, Ppoint_t ev0, Ppoint_t ev1)
129124 //private static __ptr__ tnas;
130125 //private static int tnan;
131 public static int reallyroutespline(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final __struct__<pointf> ev0, final __struct__<pointf> ev1) {
126 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) {
132127 // WARNING!! STRUCT
133128 return reallyroutespline_w_(edges, edgen, inps, inpn, ev0.copy(), ev1.copy());
134129 }
135 private static int reallyroutespline_w_(__ptr__ edges, int edgen, __ptr__ inps, int inpn, final __struct__<pointf> ev0, final __struct__<pointf> ev1) {
130 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) {
136131 ENTERING("13dxqzbgtpl4ubnnvw6ehzzi9","reallyroutespline");
137132 try {
138 final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), cp1 = JUtils.from(pointf.class), cp2 = JUtils.from(pointf.class), p = JUtils.from(pointf.class);
139 final __struct__<pointf> v1 = JUtils.from(pointf.class), v2 = JUtils.from(pointf.class), splitv = JUtils.from(pointf.class), splitv1 = JUtils.from(pointf.class), splitv2 = JUtils.from(pointf.class);
133 final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(), cp1 = new ST_pointf(), cp2 = new ST_pointf(), p = new ST_pointf();
134 final ST_pointf v1 = new ST_pointf(), v2 = new ST_pointf(), splitv = new ST_pointf(), splitv1 = new ST_pointf(), splitv2 = new ST_pointf();
140135 double maxd, d, t;
141136 int maxi, i, spliti;
142137 if (Z.z().tnan < inpn) {
143138 if (N(Z.z().tnas)) {
144 if (N(Z.z().tnas = Memory.malloc(sizeof(tna_t.class, inpn))))
139 if (N(Z.z().tnas = new ST_tna_t.Array(inpn)))
145140 return -1;
146141 } else {
147 if (N(Z.z().tnas = Memory.realloc(Z.z().tnas, sizeof(tna_t.class, inpn))))
142 if (N(Z.z().tnas = Z.z().tnas.reallocJ(inpn)))
148143 return -1;
149144 }
150145 Z.z().tnan = inpn;
151146 }
152147 Z.z().tnas.plus(0).getStruct().setDouble("t", 0);
153148 for (i = 1; i < inpn; i++)
154 Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i-1).getStruct().getDouble("t") + dist(inps.plus(i).getStruct(), inps.plus(i-1).getStruct()));
149 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()));
155150 for (i = 1; i < inpn; i++)
156 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"));
151 Z.z().tnas.plus(i).getStruct().setDouble("t", Z.z().tnas.plus(i).getStruct().t / Z.z().tnas.plus(inpn - 1).getStruct().t);
157152 for (i = 0; i < inpn; i++) {
158 Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).setStruct(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
159 Z.z().tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).setStruct(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().getDouble("t"))));
160 }
161 if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1.amp(), v1.amp(), p2.amp(), v2.amp()) == -1)
153 ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[0].____(scale(ev0, B1(Z.z().tnas.plus(i).getStruct().t)));
154 ((ST_tna_t)Z.z().tnas.plus(i).getStruct()).a[1].____(scale(ev1, B2(Z.z().tnas.plus(i).getStruct().t)));
155 }
156 if (mkspline(inps, inpn, Z.z().tnas, ev0, ev1, p1, v1, p2, v2) == -1)
162157 return -1;
163158 if (splinefits(edges, edgen, p1, v1, p2, v2, inps, inpn)!=0)
164159 return 0;
165160 cp1.___(add(p1, scale(v1, 1 / 3.0)));
166161 cp2.___(sub(p2, scale(v2, 1 / 3.0)));
167162 for (maxd = -1, maxi = -1, i = 1; i < inpn - 1; i++) {
168 t = Z.z().tnas.plus(i).getDouble("t");
169 p.setDouble("x", B0(t) * p1.getDouble("x") + B1(t) * cp1.getDouble("x") + B2(t) * cp2.getDouble("x") + B3(t) * p2.getDouble("x"));
170 p.setDouble("y", B0(t) * p1.getDouble("y") + B1(t) * cp1.getDouble("y") + B2(t) * cp2.getDouble("y") + B3(t) * p2.getDouble("y"));
171 if ((d = dist(p, inps.plus(i).getStruct())) > maxd)
163 t = Z.z().tnas.get(i).t;
164 p.setDouble("x", B0(t) * p1.x + B1(t) * cp1.x + B2(t) * cp2.x + B3(t) * p2.x);
165 p.setDouble("y", B0(t) * p1.y + B1(t) * cp1.y + B2(t) * cp2.y + B3(t) * p2.y);
166 if ((d = dist(p, (ST_pointf) inps.plus(i).getStruct())) > maxd)
172167 {maxd = d; maxi = i;}
173168 }
174169 spliti = maxi;
175 splitv1.___(normv(sub(inps.plus(spliti).getStruct(), inps.plus(spliti - 1).getStruct())));
176 splitv2.___(normv(sub(inps.plus(spliti + 1).getStruct(), inps.plus(spliti).getStruct())));
170 splitv1.___(normv(sub((ST_pointf)inps.plus(spliti).getStruct(), (ST_pointf)inps.plus(spliti - 1).getStruct())));
171 splitv2.___(normv(sub((ST_pointf)inps.plus(spliti + 1).getStruct(), (ST_pointf)inps.plus(spliti).getStruct())));
177172 splitv.___(normv(add(splitv1, splitv2)));
178173 reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv);
179174 reallyroutespline(edges, edgen, inps.plus(spliti), inpn - spliti, splitv,
189184
190185 //3 29sok6jkfyobf83q130snkhmh
191186 // 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)
192 public static int mkspline(__ptr__ inps, int inpn, __ptr__ tnas, final __struct__<pointf> ev0, final __struct__<pointf> ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
187 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) {
193188 // WARNING!! STRUCT
194189 return mkspline_w_(inps, inpn, tnas, ev0.copy(), ev1.copy(), sp0, sv0, sp1, sv1);
195190 }
196 private static int mkspline_w_(__ptr__ inps, int inpn, __ptr__ tnas, final __struct__<pointf> ev0, final __struct__<pointf> ev1, __ptr__ sp0, __ptr__ sv0, __ptr__ sp1, __ptr__ sv1) {
191 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) {
197192 ENTERING("29sok6jkfyobf83q130snkhmh","mkspline");
198193 try {
199 final __struct__<pointf> tmp = JUtils.from(pointf.class);
194 final ST_pointf tmp = new ST_pointf();
200195 double c[][] = new double[2][2];
201196 double x[] = new double[2];
202197 double det01, det0X, detX1;
206201 c[0][0] = c[0][1] = c[1][0] = c[1][1] = 0.0;
207202 x[0] = x[1] = 0.0;
208203 for (i = 0; i < inpn; i++) {
209 c[0][0] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct());
210 c[0][1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct());
204 c[0][0] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[0]);
205 c[0][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]);
211206 c[1][0] = c[0][1];
212 c[1][1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct(), tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct());
213 tmp.___(sub(inps.plus(i).getStruct(), add(scale(inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().getDouble("t"))),
214 scale(inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().getDouble("t"))))));
215 x[0] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(0).getStruct(), tmp);
216 x[1] += dot(tnas.plus(i).getStruct().getArrayOfStruct("a").plus(1).getStruct(), tmp);
207 c[1][1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], ((ST_tna_t)tnas.plus(i).getStruct()).a[1]);
208 tmp.___(sub((ST_pointf) inps.plus(i).getStruct(), add(scale((ST_pointf) inps.plus(0).getStruct(), B01(tnas.plus(i).getStruct().t)),
209 scale((ST_pointf) inps.plus(inpn - 1).getStruct(), B23(tnas.plus(i).getStruct().t)))));
210 x[0] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[0], tmp);
211 x[1] += dot(((ST_tna_t)tnas.plus(i).getStruct()).a[1], tmp);
217212 }
218213 det01 = c[0][0] * c[1][1] - c[1][0] * c[0][1];
219214 det0X = c[0][0] * x[1] - c[0][1] * x[0];
223218 scale3 = det0X / det01;
224219 }
225220 if (((det01) >= 0 ? (det01) : -(det01)) < 1e-6 || scale0 <= 0.0 || scale3 <= 0.0) {
226 d01 = dist(inps.plus(0).getStruct(), inps.plus(inpn - 1).getStruct()) / 3.0;
221 d01 = dist((ST_pointf)inps.plus(0).getStruct(), (ST_pointf)inps.plus(inpn - 1).getStruct()) / 3.0;
227222 scale0 = d01;
228223 scale3 = d01;
229224 }
242237
243238 //3 ea6jsc0rwfyjtmmuxax6r5ngk
244239 // static double dist_n(Ppoint_t * p, int n)
245 public static double dist_n(__ptr__ p, int n) {
240 public static double dist_n(ST_pointf.Array p, int n) {
246241 ENTERING("ea6jsc0rwfyjtmmuxax6r5ngk","dist_n");
247242 try {
248243 int i;
250245 rv = 0.0;
251246 for (i = 1; i < n; i++) {
252247 rv +=
253 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"))+
254 (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")));
248 sqrt((p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x) * (p.plus(i).getStruct().x - p.plus(i - 1).getStruct().x)+
249 (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y) * (p.plus(i).getStruct().y - p.plus(i - 1).getStruct().y));
255250 }
256251 return rv;
257252 } finally {
264259
265260 //3 987ednrgu5qo9dzhpiox47mhb
266261 // 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)
267 public static int splinefits(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
262 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) {
268263 // WARNING!! STRUCT
269264 return splinefits_w_(edges, edgen, pa.copy(), va.copy(), pb.copy(), vb.copy(), inps, inpn);
270265 }
271 private static int splinefits_w_(__ptr__ edges, int edgen, final __struct__<pointf> pa, final __struct__<pointf> va, final __struct__<pointf> pb, final __struct__<pointf> vb, __ptr__ inps, int inpn) {
266 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) {
272267 ENTERING("987ednrgu5qo9dzhpiox47mhb","splinefits");
273268 try {
274 final __array_of_struct__ sps = __array_of_struct_impl__.malloc(pointf.class, 4);
269 final ST_pointf.Array sps = new ST_pointf.Array( 4);
275270 double a, b;
276271 int pi;
277272 int forceflag;
279274 forceflag = (inpn == 2 ? 1 : 0);
280275 a = b = 4;
281276 for (;;) {
282 sps.plus(0).getStruct().setDouble("x", pa.getDouble("x"));
283 sps.plus(0).getStruct().setDouble("y", pa.getDouble("y"));
284 sps.plus(1).getStruct().setDouble("x", pa.getDouble("x") + a * va.getDouble("x") / 3.0);
285 sps.plus(1).getStruct().setDouble("y", pa.getDouble("y") + a * va.getDouble("y") / 3.0);
286 sps.plus(2).getStruct().setDouble("x", pb.getDouble("x") - b * vb.getDouble("x") / 3.0);
287 sps.plus(2).getStruct().setDouble("y", pb.getDouble("y") - b * vb.getDouble("y") / 3.0);
288 sps.plus(3).getStruct().setDouble("x", pb.getDouble("x"));
289 sps.plus(3).getStruct().setDouble("y", pb.getDouble("y"));
277 sps.plus(0).getStruct().setDouble("x", pa.x);
278 sps.plus(0).getStruct().setDouble("y", pa.y);
279 sps.plus(1).getStruct().setDouble("x", pa.x + a * va.x / 3.0);
280 sps.plus(1).getStruct().setDouble("y", pa.y + a * va.y / 3.0);
281 sps.plus(2).getStruct().setDouble("x", pb.x - b * vb.x / 3.0);
282 sps.plus(2).getStruct().setDouble("y", pb.y - b * vb.y / 3.0);
283 sps.plus(3).getStruct().setDouble("x", pb.x);
284 sps.plus(3).getStruct().setDouble("y", pb.y);
290285 /* shortcuts (paths shorter than the shortest path) not allowed -
291286 * they must be outside the constraint polygon. this can happen
292287 * if the candidate spline intersects the constraint polygon exactly
300295 if (splineisinside(edges, edgen, sps)) {
301296 growops(Z.z().opl + 4);
302297 for (pi = 1; pi < 4; pi++) {
303 Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
304 Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
298 Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x);
299 Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y);
305300 Z.z().opl++;
306301 }
307302 return 1;
311306 growops(Z.z().opl + 4);
312307 for (pi = 1; pi < 4; pi++)
313308 {
314 Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().getDouble("x"));
315 Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().getDouble("y"));
309 Z.z().ops_route.plus(Z.z().opl).setDouble("x", sps.plus(pi).getStruct().x);
310 Z.z().ops_route.plus(Z.z().opl).setDouble("y", sps.plus(pi).getStruct().y);
316311 Z.z().opl++;
317312 }
318313 return 1;
338333
339334 //3 b6eghkeu16aum3l778ig52ht1
340335 // static int splineisinside(Pedge_t * edges, int edgen, Ppoint_t * sps)
341 public static boolean splineisinside(__ptr__ edges, int edgen, __array_of_struct__ sps) {
336 public static boolean splineisinside(ST_Pedge_t.Array edges, int edgen, ST_pointf.Array sps) {
342337 ENTERING("b6eghkeu16aum3l778ig52ht1","splineisinside");
343338 try {
344339 double roots[] = new double[4];
345340 int rooti, rootn;
346341 int ei;
347 final __array_of_struct__ lps = __array_of_struct_impl__.malloc(pointf.class, 2);
348 final __struct__<pointf> ip = JUtils.from(pointf.class);
342 final ST_pointf.Array lps = new ST_pointf.Array( 2);
343 final ST_pointf ip = new ST_pointf();
349344 double t, ta, tb, tc, td;
350345 for (ei = 0; ei < edgen; ei++) {
351 lps.plus(0).setStruct(edges.plus(ei).getStruct("a"));
352 lps.plus(1).setStruct(edges.plus(ei).getStruct("b"));
346 lps.plus(0).setStruct(edges.get(ei).a);
347 lps.plus(1).setStruct(edges.get(ei).b);
353348 /* if ((rootn = splineintersectsline (sps, lps, roots)) == 4)
354349 return 1; */
355350 if ((rootn = splineintersectsline(sps, lps, roots)) == 4)
362357 tc = 3 * t * t * (1 - t);
363358 tb = 3 * t * (1 - t) * (1 - t);
364359 ta = (1 - t) * (1 - t) * (1 - t);
365 ip.setDouble("x", ta * sps.plus(0).getDouble("x") + tb * sps.plus(1).getDouble("x") +
366 tc * sps.plus(2).getDouble("x") + td * sps.plus(3).getDouble("x"));
367 ip.setDouble("y", ta * sps.plus(0).getDouble("y") + tb * sps.plus(1).getDouble("y") +
368 tc * sps.plus(2).getDouble("y") + td * sps.plus(3).getDouble("y"));
360 ip.setDouble("x", ta * sps.get(0).x + tb * sps.get(1).x +
361 tc * sps.get(2).x + td * sps.get(3).x);
362 ip.setDouble("y", ta * sps.get(0).y + tb * sps.get(1).y +
363 tc * sps.get(2).y + td * sps.get(3).y);
369364 if (DISTSQ(ip, lps.plus(0).getStruct()) < 1E-3 ||
370365 DISTSQ(ip, lps.plus(1).getStruct()) < 1E-3)
371366 continue;
383378
384379 //3 32nc8itszi77u36la8npt2870
385380 // static int splineintersectsline(Ppoint_t * sps, Ppoint_t * lps, double *roots)
386 public static int splineintersectsline(__array_of_struct__ sps, __array_of_struct__ lps, double roots[]) {
381 public static int splineintersectsline(ST_pointf.Array sps, ST_pointf.Array lps, double roots[]) {
387382 ENTERING("32nc8itszi77u36la8npt2870","splineintersectsline");
388383 try {
389384 double scoeff[] = new double[4];
394389 double tv, sv, rat;
395390 int rootn[] = new int[]{0};
396391 int xrootn, yrootn, i, j;
397 xcoeff[0] = lps.plus(0).getStruct().getDouble("x");
398 xcoeff[1] = lps.plus(1).getStruct().getDouble("x") - lps.plus(0).getStruct().getDouble("x");
399 ycoeff[0] = lps.plus(0).getStruct().getDouble("y");
400 ycoeff[1] = lps.plus(1).getStruct().getDouble("y") - lps.plus(0).getStruct().getDouble("y");
392 xcoeff[0] = lps.plus(0).getStruct().x;
393 xcoeff[1] = lps.plus(1).getStruct().x - lps.plus(0).getStruct().x;
394 ycoeff[0] = lps.plus(0).getStruct().y;
395 ycoeff[1] = lps.plus(1).getStruct().y - lps.plus(0).getStruct().y;
401396 rootn[0] = 0;
402397 if (xcoeff[1] == 0) {
403398 if (ycoeff[1] == 0) {
404 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);
399 points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff);
405400 scoeff[0] -= xcoeff[0];
406401 xrootn = solve3(scoeff, xroots);
407 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);
402 points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y, scoeff);
408403 scoeff[0] -= ycoeff[0];
409404 yrootn = solve3(scoeff, yroots);
410405 if (xrootn == 4)
423418 addroot(xroots[i], roots, rootn);
424419 return rootn[0];
425420 } else {
426 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);
421 points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x, scoeff);
427422 scoeff[0] -= xcoeff[0];
428423 xrootn = solve3(scoeff, xroots);
429424 if (xrootn == 4)
431426 for (i = 0; i < xrootn; i++) {
432427 tv = xroots[i];
433428 if (tv >= 0 && tv <= 1) {
434 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"),
429 points2coeff(sps.plus(0).getStruct().y, sps.plus(1).getStruct().y, sps.plus(2).getStruct().y, sps.plus(3).getStruct().y,
435430 scoeff);
436431 sv = scoeff[0] + tv * (scoeff[1] + tv *
437432 (scoeff[2] + tv * scoeff[3]));
444439 }
445440 } else {
446441 rat = ycoeff[1] / xcoeff[1];
447 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"),
448 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"),
442 points2coeff(sps.plus(0).getStruct().y - rat * sps.plus(0).getStruct().x, sps.plus(1).getStruct().y - rat * sps.plus(1).getStruct().x,
443 sps.plus(2).getStruct().y - rat * sps.plus(2).getStruct().x, sps.plus(3).getStruct().y - rat * sps.plus(3).getStruct().x,
449444 scoeff);
450445 scoeff[0] += rat * xcoeff[0] - ycoeff[0];
451446 xrootn = solve3(scoeff, xroots);
454449 for (i = 0; i < xrootn; i++) {
455450 tv = xroots[i];
456451 if (tv >= 0 && tv <= 1) {
457 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"),
452 points2coeff(sps.plus(0).getStruct().x, sps.plus(1).getStruct().x, sps.plus(2).getStruct().x, sps.plus(3).getStruct().x,
458453 scoeff);
459454 sv = scoeff[0] + tv * (scoeff[1] +
460455 tv * (scoeff[2] + tv * scoeff[3]));
509504
510505 //3 3i8m1m9fg7qmnt8jloorwlu8e
511506 // static Pvector_t normv(Pvector_t v)
512 public static __struct__<pointf> normv(final __struct__<pointf> v) {
507 public static ST_pointf normv(final ST_pointf v) {
513508 // WARNING!! STRUCT
514509 return normv_w_(v.copy()).copy();
515510 }
516 private static __struct__<pointf> normv_w_(final __struct__<pointf> v) {
511 private static ST_pointf normv_w_(final ST_pointf v) {
517512 ENTERING("3i8m1m9fg7qmnt8jloorwlu8e","normv");
518513 try {
519514 double d;
520 d = v.getDouble("x") * v.getDouble("x") + v.getDouble("y") * v.getDouble("y");
515 d = v.x * v.x + v.y * v.y;
521516 if (d > 1e-6) {
522517 d = sqrt(d);
523 v.setDouble("x", v.getDouble("x") / d);
524 v.setDouble("y", v.getDouble("y") / d);
518 v.setDouble("x", v.x / d);
519 v.setDouble("y", v.y / d);
525520 }
526521 return v;
527522 } finally {
540535 if (newopn <= Z.z().opn_route)
541536 return;
542537 if (N(Z.z().ops_route)) {
543 if (N(Z.z().ops_route = Memory.malloc(sizeof (pointf.class, newopn)))) {
538 if (N(Z.z().ops_route = new ST_pointf.Array(newopn))) {
544539 UNSUPPORTED("413an1hqgkb4ezaec6qdsdplx"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot malloc ops"));
545540 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
546541 }
547542 } else {
548 if (N(Z.z().ops_route = Memory.realloc(Z.z().ops_route,
549 sizeof (pointf.class, newopn)))) {
543 if (N(Z.z().ops_route = Z.z().ops_route.reallocJ(newopn))) {
550544 UNSUPPORTED("8u0qgahxvk5pplf90thmhwxhl"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\route.c", 32, ("cannot realloc ops"));
551545 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
552546 }
562556
563557 //3 f4a7nt247bokdwr2owda050of
564558 // static Ppoint_t add(Ppoint_t p1, Ppoint_t p2)
565 public static __struct__<pointf> add(final __struct__<pointf> p1, final __struct__<pointf> p2) {
559 public static ST_pointf add(final ST_pointf p1, final ST_pointf p2) {
566560 // WARNING!! STRUCT
567561 return add_w_(p1.copy(), p2.copy()).copy();
568562 }
569 private static __struct__<pointf> add_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
563 private static ST_pointf add_w_(final ST_pointf p1, final ST_pointf p2) {
570564 ENTERING("f4a7nt247bokdwr2owda050of","add");
571565 try {
572 p1.setDouble("x", p1.getDouble("x") + p2.getDouble("x"));
573 p1.setDouble("y", p1.getDouble("y") + p2.getDouble("y"));
566 p1.setDouble("x", p1.x + p2.x);
567 p1.setDouble("y", p1.y + p2.y);
574568 return p1;
575569 } finally {
576570 LEAVING("f4a7nt247bokdwr2owda050of","add");
582576
583577 //3 c4l1gvlkv2s4mi6os7r9dh89f
584578 // static Ppoint_t sub(Ppoint_t p1, Ppoint_t p2)
585 public static __struct__<pointf> sub(final __struct__<pointf> p1, final __struct__<pointf> p2) {
579 public static ST_pointf sub(final ST_pointf p1, final ST_pointf p2) {
586580 // WARNING!! STRUCT
587581 return sub_w_(p1.copy(), p2.copy()).copy();
588582 }
589 private static __struct__<pointf> sub_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
583 private static ST_pointf sub_w_(final ST_pointf p1, final ST_pointf p2) {
590584 ENTERING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
591585 try {
592 p1.setDouble("x", p1.getDouble("x") - p2.getDouble("x"));
593 p1.setDouble("y", p1.getDouble("y") - p2.getDouble("y"));
586 p1.setDouble("x", p1.x - p2.x);
587 p1.setDouble("y", p1.y - p2.y);
594588 return p1;
595589 } finally {
596590 LEAVING("c4l1gvlkv2s4mi6os7r9dh89f","sub");
602596
603597 //3 dqnlz0tceriykws4ngudl94w9
604598 // static double dist(Ppoint_t p1, Ppoint_t p2)
605 public static double dist(final __struct__<pointf> p1, final __struct__<pointf> p2) {
599 public static double dist(final ST_pointf p1, final ST_pointf p2) {
606600 // WARNING!! STRUCT
607601 return dist_w_(p1.copy(), p2.copy());
608602 }
609 private static double dist_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
603 private static double dist_w_(final ST_pointf p1, final ST_pointf p2) {
610604 ENTERING("dqnlz0tceriykws4ngudl94w9","dist");
611605 try {
612606 double dx, dy;
613 dx = p2.getDouble("x") - p1.getDouble("x");
614 dy = p2.getDouble("y") - p1.getDouble("y");
607 dx = p2.x - p1.x;
608 dy = p2.y - p1.y;
615609 return sqrt(dx * dx + dy * dy);
616610 } finally {
617611 LEAVING("dqnlz0tceriykws4ngudl94w9","dist");
623617
624618 //3 19149pdllzhplvew0bsh5v6hy
625619 // static Ppoint_t scale(Ppoint_t p, double c)
626 public static __struct__<pointf> scale(final __struct__<pointf> p, double c) {
620 public static ST_pointf scale(final ST_pointf p, double c) {
627621 // WARNING!! STRUCT
628622 return scale_w_(p.copy(), c).copy();
629623 }
630 private static __struct__<pointf> scale_w_(final __struct__<pointf> p, double c) {
624 private static ST_pointf scale_w_(final ST_pointf p, double c) {
631625 ENTERING("19149pdllzhplvew0bsh5v6hy","scale");
632626 try {
633 p.setDouble("x", p.getDouble("x") * c);
634 p.setDouble("y", p.getDouble("y") * c);
627 p.setDouble("x", p.x * c);
628 p.setDouble("y", p.y * c);
635629 return p;
636630 } finally {
637631 LEAVING("19149pdllzhplvew0bsh5v6hy","scale");
643637
644638 //3 7ebsa2s1eoopqj1pp43bh5fw
645639 // static double dot(Ppoint_t p1, Ppoint_t p2)
646 public static double dot(final __struct__<pointf> p1, final __struct__<pointf> p2) {
640 public static double dot(final ST_pointf p1, final ST_pointf p2) {
647641 // WARNING!! STRUCT
648642 return dot_w_(p1.copy(), p2.copy());
649643 }
650 private static double dot_w_(final __struct__<pointf> p1, final __struct__<pointf> p2) {
644 private static double dot_w_(final ST_pointf p1, final ST_pointf p2) {
651645 ENTERING("7ebsa2s1eoopqj1pp43bh5fw","dot");
652646 try {
653 return p1.getDouble("x") * p2.getDouble("x") + p1.getDouble("y") * p2.getDouble("y");
647 return p1.x * p2.x + p1.y * p2.y;
654648 } finally {
655649 LEAVING("7ebsa2s1eoopqj1pp43bh5fw","dot");
656650 }
4747 import static smetana.core.JUtils.LOG2;
4848 import static smetana.core.JUtils.NEQ;
4949 import static smetana.core.JUtils.setjmp;
50 import static smetana.core.JUtils.sizeof;
51 import static smetana.core.JUtils.sizeof_starstar_empty;
5250 import static smetana.core.JUtilsDebug.ENTERING;
5351 import static smetana.core.JUtilsDebug.LEAVING;
5452 import static smetana.core.Macro.HUGE_VAL;
5553 import static smetana.core.Macro.N;
5654 import static smetana.core.Macro.UNSUPPORTED;
57 import h.Ppoly_t;
58 import h.pointf;
59 import h.pointnlink_t;
60 import h.triangle_t;
61 import smetana.core.JUtils;
62 import smetana.core.Memory;
55 import h.ST_Ppoly_t;
56 import h.ST_pointf;
57 import h.ST_pointnlink_t;
58 import h.ST_triangle_t;
6359 import smetana.core.Z;
64 import smetana.core.__array_of_struct__;
65 import smetana.core.__array_of_struct_impl__;
6660 import smetana.core.__ptr__;
67 import smetana.core.__struct__;
6861 import smetana.core.jmp_buf;
6962
7063 public class shortest__c {
113106
114107 //3 2gub5b19vo2qexn56nw23wage
115108 // int Pshortestpath(Ppoly_t * polyp, Ppoint_t * eps, Ppolyline_t * output)
116 public static int Pshortestpath(Ppoly_t polyp, __array_of_struct__ eps, Ppoly_t output) {
109 public static int Pshortestpath(ST_Ppoly_t polyp, ST_pointf.Array eps, ST_Ppoly_t output) {
117110 ENTERING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
118111 try {
119112 int pi, minpi;
120113 double minx;
121 final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class), p3 = JUtils.from(pointf.class);
114 final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf(), p3 = new ST_pointf();
122115 int trii, trij, ftrii, ltrii;
123116 int ei;
124 final __array_of_struct__ epnls = __array_of_struct_impl__.malloc(pointnlink_t.class, 2);
125 pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
126 triangle_t trip;
117 final ST_pointnlink_t[] epnls = new ST_pointnlink_t[] {new ST_pointnlink_t(),new ST_pointnlink_t()};
118 ST_pointnlink_t lpnlp=null, rpnlp=null, pnlp=null;
119 ST_triangle_t.Array trip;
127120 int splitindex;
128121 if (setjmp(jbuf)!=0)
129122 return -2;
130123 /* make space */
131 growpnls(polyp.getInt("pn"));
124 growpnls(polyp.pn);
132125 Z.z().pnll = 0;
133126 Z.z().tril = 0;
134 growdq(polyp.getInt("pn") * 2);
135 Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("pnlpn") / 2);
136 Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("fpnlpi") - 1);
127 growdq(polyp.pn * 2);
128 Z.z().dq.fpnlpi = Z.z().dq.pnlpn / 2;
129 Z.z().dq.lpnlpi = Z.z().dq.fpnlpi - 1;
137130 /* make sure polygon is CCW and load pnls array */
138 for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.getInt("pn"); pi++) {
139 if (minx > polyp.getPtr("ps").plus(pi).getDouble("x"))
140 { minx = polyp.getPtr("ps").plus(pi).getDouble("x");
131 for (pi = 0, minx = HUGE_VAL, minpi = -1; pi < polyp.pn; pi++) {
132 if (minx > polyp.ps.get(pi).x)
133 { minx = polyp.ps.get(pi).x;
141134 minpi = pi; }
142135 }
143 p2.____(polyp.getPtr("ps").plus(minpi));
144 p1.____(polyp.getPtr("ps").plus(((minpi == 0) ? polyp.getInt("pn") - 1 : minpi - 1)));
145 p3.____(polyp.getPtr("ps").plus(((minpi == polyp.getInt("pn") - 1) ? 0 : minpi + 1)));
146 if (((p1.getDouble("x") == p2.getDouble("x") && p2.getDouble("x") == p3.getDouble("x")) && (p3.getDouble("y") > p2.getDouble("y"))) ||
147 ccw(p1.amp(), p2.amp(), p3.amp()) != 1) {
148 for (pi = polyp.getInt("pn") - 1; pi >= 0; pi--) {
149 if (pi < polyp.getInt("pn") - 1
150 && polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi+1).getDouble("x")
151 && polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi+1).getDouble("y"))
136 p2.____(polyp.ps.plus(minpi));
137 p1.____(polyp.ps.plus(((minpi == 0) ? polyp.pn - 1 : minpi - 1)));
138 p3.____(polyp.ps.plus(((minpi == polyp.pn - 1) ? 0 : minpi + 1)));
139 if (((p1.x == p2.x && p2.x == p3.x) && (p3.y > p2.y)) ||
140 ccw(p1, p2, p3) != 1) {
141 for (pi = polyp.pn - 1; pi >= 0; pi--) {
142 if (pi < polyp.pn - 1
143 && polyp.ps.get(pi).x == polyp.ps.get(pi+1).x
144 && polyp.ps.get(pi).y == polyp.ps.get(pi+1).y)
152145 continue;
153 Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
154 Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
155 Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll).getPtr());
146 Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi));
147 Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn];
148 Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
156149 Z.z().pnll++;
157150 }
158151 } else {
159 for (pi = 0; pi < polyp.getInt("pn"); pi++) {
160 if (pi > 0 && polyp.getPtr("ps").plus(pi).getDouble("x") == polyp.getPtr("ps").plus(pi - 1).getDouble("x") &&
161 polyp.getPtr("ps").plus(pi).getDouble("y") == polyp.getPtr("ps").plus(pi - 1).getDouble("y"))
152 for (pi = 0; pi < polyp.pn; pi++) {
153 if (pi > 0 && polyp.ps.get(pi).x == polyp.ps.get(pi - 1).x &&
154 polyp.ps.get(pi).y == polyp.ps.get(pi - 1).y)
162155 continue;
163 Z.z().pnls.plus(Z.z().pnll).setPtr("pp", polyp.getPtr("ps").plus(pi));
164 Z.z().pnls.plus(Z.z().pnll).setPtr("link", Z.z().pnls.plus(Z.z().pnll % polyp.getInt("pn")));
165 Z.z().pnlps.plus(Z.z().pnll).setPtr(Z.z().pnls.plus(Z.z().pnll));
156 Z.z().pnls[Z.z().pnll].pp = (ST_pointf) ((ST_pointf)polyp.ps.get(pi));
157 Z.z().pnls[Z.z().pnll].link = Z.z().pnls[Z.z().pnll % polyp.pn];
158 Z.z().pnlps[Z.z().pnll] = Z.z().pnls[Z.z().pnll];
166159 Z.z().pnll++;
167160 }
168161 }
174167 connecttris(trii, trij);
175168 /* find first and last triangles */
176169 for (trii = 0; trii < Z.z().tril; trii++)
177 if (pointintri(trii, eps.plus(0).getStruct().amp()))
170 if (pointintri(trii, eps.plus(0).getStruct()))
178171 break;
179172 if (trii == Z.z().tril) {
180173 UNSUPPORTED("4ma3y8l4lmjcsw49kmsgknig6"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("source point not in any triangle"));
182175 }
183176 ftrii = trii;
184177 for (trii = 0; trii < Z.z().tril; trii++)
185 if (pointintri(trii, eps.plus(1).getStruct().amp()))
178 if (pointintri(trii, eps.plus(1).getStruct()))
186179 break;
187180 if (trii == Z.z().tril) {
188181 System.err.println("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("destination point not in any triangle"));
194187 System.err.println("libpath/%s:%d: %s" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("cannot find triangle path"));
195188 /* a straight line is better than failing */
196189 growops(2);
197 output.setInt("pn", 2);
190 output.pn = 2;
198191 Z.z().ops_shortest.plus(0).setStruct(eps.plus(0).getStruct());
199192 Z.z().ops_shortest.plus(1).setStruct(eps.plus(1).getStruct());
200193 output.setPtr("ps", Z.z().ops_shortest);
209202 UNSUPPORTED("c9ckhc8veujmwcw0ar3u3zld4"); // return 0;
210203 }
211204 /* build funnel and shortest path linked list (in add2dq) */
212 epnls.plus(0).getStruct().setPtr("pp", eps.plus(0).asPtr());
213 epnls.plus(0).getStruct().setPtr("link", null);
214 epnls.plus(1).getStruct().setPtr("pp", eps.plus(1).asPtr());
215 epnls.plus(1).getStruct().setPtr("link", null);
216 add2dq(1, epnls.plus(0).asPtr());
217 Z.z().dq.setInt("apex", Z.z().dq.getInt("fpnlpi"));
205 epnls[0].pp = eps.get(0);
206 epnls[0].link = null;
207 epnls[1].pp = eps.get(1);
208 epnls[1].link = null;
209 add2dq(1, epnls[0]);
210 Z.z().dq.apex = Z.z().dq.fpnlpi;
218211 trii = ftrii;
219212 while (trii != -1) {
220 trip = (triangle_t) Z.z().tris.plus(trii);
221 trip.setInt("mark", 2);
213 trip = Z.z().tris.plusJ(trii);
214 trip.get(0).mark = 2;
222215 /* find the left and right points of the exiting edge */
223216 for (ei = 0; ei < 3; ei++)
224 if (trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
225 trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1)
217 if (trip.get(0).e[ei].rtp!=null &&
218 trip.get(0).e[ei].rtp.get(0).mark == 1)
226219 break;
227220 if (ei == 3) { /* in last triangle */
228 if (ccw(eps.plus(1).asPtr(), Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr().getPtr("pp"),
229 Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr().getPtr("pp")) == 1)
221 if (ccw(eps.get(1), Z.z().dq.pnlps[Z.z().dq.fpnlpi].pp,
222 Z.z().dq.pnlps[Z.z().dq.lpnlpi].pp) == 1)
230223 {
231 lpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
232 rpnlp = (pointnlink_t) epnls.plus(1).asPtr();
224 lpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
225 rpnlp = epnls[1];
233226 } else {
234 lpnlp = (pointnlink_t) epnls.plus(1).asPtr();
235 rpnlp = (pointnlink_t) Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr();
227 lpnlp = epnls[1];
228 rpnlp = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
236229 }
237230 } else {
238 pnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus((ei + 1) % 3).getStruct().getPtr("pnl1p");
239 if (ccw(trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"), pnlp.getPtr("pp"),
240 trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp")) == 1)
231 pnlp = trip.get(0).e[(ei + 1) % 3].pnl1p;
232 if (ccw(trip.get(0).e[ei].pnl0p.pp, pnlp.pp,
233 trip.get(0).e[ei].pnl1p.pp) == 1)
241234 UNSUPPORTED("2cii65lhw4wb8nyvjv702v7md"); // lpnlp = trip->e[ei].pnl1p, rpnlp = trip->e[ei].pnl0p;
242235 else
243236 {
244 lpnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p");
245 rpnlp = (pointnlink_t) trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p");
237 lpnlp = trip.get(0).e[ei].pnl0p;
238 rpnlp = trip.get(0).e[ei].pnl1p;
246239 }
247240 }
248241 /* update deque */
250243 add2dq(2, lpnlp);
251244 add2dq(1, rpnlp);
252245 } else {
253 if (NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr(), rpnlp)
254 && NEQ(Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr(), rpnlp)) {
246 if (NEQ(Z.z().dq.pnlps[Z.z().dq.fpnlpi], rpnlp)
247 && NEQ(Z.z().dq.pnlps[Z.z().dq.lpnlpi], rpnlp)) {
255248 /* add right point to deque */
256249 splitindex = finddqsplit(rpnlp);
257250 splitdq(2, splitindex);
258251 add2dq(1, rpnlp);
259252 /* if the split is behind the apex, then reset apex */
260 if (splitindex > Z.z().dq.getInt("apex"))
261 Z.z().dq.setInt("apex", splitindex);
253 if (splitindex > Z.z().dq.apex)
254 Z.z().dq.apex = splitindex;
262255 } else {
263256 /* add left point to deque */
264257 splitindex = finddqsplit(lpnlp);
265258 splitdq(1, splitindex);
266259 add2dq(2, lpnlp);
267260 /* if the split is in front of the apex, then reset apex */
268 if (splitindex < Z.z().dq.getInt("apex"))
269 Z.z().dq.setInt("apex", splitindex);
261 if (splitindex < Z.z().dq.apex)
262 Z.z().dq.apex = splitindex;
270263 }
271264 }
272265 trii = -1;
273266 for (ei = 0; ei < 3; ei++)
274 if (trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
275 trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").getInt("mark") == 1) {
276 trii = trip.getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris);
267 if (trip.get(0).e[ei].rtp!=null &&
268 trip.get(0).e[ei].rtp.get(0).mark == 1) {
269 trii = trip.get(0).e[ei].rtp.minus(Z.z().tris);
277270 break;
278271 }
279272 }
280 for (pi = 0, pnlp = (pointnlink_t) epnls.plus(1).asPtr(); pnlp!=null; pnlp = (pointnlink_t) pnlp.getPtr("link"))
273 for (pi = 0, pnlp = epnls[1]; pnlp!=null; pnlp = pnlp.link)
281274 pi++;
282275 growops(pi);
283 output.setInt("pn", pi);
284 for (pi = pi - 1, pnlp = (pointnlink_t) epnls.plus(1).asPtr(); pnlp!=null; pi--, pnlp = (pointnlink_t) pnlp.getPtr("link"))
285 Z.z().ops_shortest.plus(pi).setPtr(pnlp.getPtr("pp"));
286 output.setPtr("ps", Z.z().ops_shortest);
276 output.pn = pi;
277 for (pi = pi - 1, pnlp = epnls[1]; pnlp!=null; pi--, pnlp = pnlp.link)
278 Z.z().ops_shortest.get(pi).____(pnlp.pp);
279 output.ps = Z.z().ops_shortest;
287280 return 0;
288281 } finally {
289282 LEAVING("2gub5b19vo2qexn56nw23wage","Pshortestpath");
295288
296289 //3 73cr7m3mqvtuotpzrmaw2y8zm
297290 // static void triangulate(pointnlink_t ** pnlps, int pnln)
298 public static void triangulate(__ptr__ pnlps, int pnln) {
291 public static void triangulate(ST_pointnlink_t pnlps[], int pnln) {
299292 ENTERING("73cr7m3mqvtuotpzrmaw2y8zm","triangulate");
300293 try {
301294 int pnli, pnlip1, pnlip2;
308301 pnlip2 = (pnli + 2) % pnln;
309302 if (isdiagonal(pnli, pnlip2, pnlps, pnln))
310303 {
311 loadtriangle(pnlps.plus(pnli).getPtr(), pnlps.plus(pnlip1).getPtr(), pnlps.plus(pnlip2).getPtr());
304 loadtriangle(pnlps[pnli], pnlps[pnlip1], pnlps[pnlip2]);
312305 for (pnli = pnlip1; pnli < pnln - 1; pnli++)
313 pnlps.plus(pnli).setPtr(pnlps.plus(pnli + 1).getPtr());
306 pnlps[pnli] = pnlps[pnli + 1];
314307 triangulate(pnlps, pnln - 1);
315308 return;
316309 }
318311 throw new IllegalStateException("libpath/%s:%d: %s\n" + "graphviz-2.38.0\\lib\\pathplan\\shortest.c" + 26 + ("triangulation failed"));
319312 }
320313 else
321 loadtriangle(pnlps.plus(0).getPtr(), pnlps.plus(1).getPtr(), pnlps.plus(2).getPtr());
314 loadtriangle(pnlps[0], pnlps[1], pnlps[2]);
322315 } finally {
323316 LEAVING("73cr7m3mqvtuotpzrmaw2y8zm","triangulate");
324317 }
329322
330323 //3 72of3cd7shtwokglxapw04oe9
331324 // static int isdiagonal(int pnli, int pnlip2, pointnlink_t ** pnlps, int pnln)
332 public static boolean isdiagonal(int pnli, int pnlip2, __ptr__ pnlps, int pnln) {
325 public static boolean isdiagonal(int pnli, int pnlip2, ST_pointnlink_t[] pnlps, int pnln) {
333326 ENTERING("72of3cd7shtwokglxapw04oe9","isdiagonal");
334327 try {
335328 int pnlip1, pnlim1, pnlj, pnljp1;
338331 pnlip1 = (pnli + 1) % pnln;
339332 pnlim1 = (pnli + pnln - 1) % pnln;
340333 /* If P[pnli] is a convex vertex [ pnli+1 left of (pnli-1,pnli) ]. */
341 if (ccw(pnlps.plus(pnlim1).getPtr("pp"), pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip1).getPtr("pp")) ==
334 if (ccw(pnlps[pnlim1].pp, pnlps[pnli].pp, pnlps[pnlip1].pp) ==
342335 1)
343336 res =
344 (ccw(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"), pnlps.plus(pnlim1).getPtr("pp")) ==
337 (ccw(pnlps[pnli].pp, pnlps[pnlip2].pp, pnlps[pnlim1].pp) ==
345338 1)
346 && (ccw(pnlps.plus(pnlip2).getPtr("pp"), pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip1).getPtr("pp"))
339 && (ccw(pnlps[pnlip2].pp, pnlps[pnli].pp, pnlps[pnlip1].pp)
347340 == 1);
348341 /* Assume (pnli - 1, pnli, pnli + 1) not collinear. */
349342 else
350 res = (ccw(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"),
351 pnlps.plus(pnlip1).getPtr("pp")) == 2);
343 res = (ccw(pnlps[pnli].pp, pnlps[pnlip2].pp,
344 pnlps[pnlip1].pp) == 2);
352345 if (N(res))
353346 return false;
354347 /* check against all other edges */
356349 pnljp1 = (pnlj + 1) % pnln;
357350 if (N((pnlj == pnli) || (pnljp1 == pnli) ||
358351 (pnlj == pnlip2) || (pnljp1 == pnlip2)))
359 if (intersects(pnlps.plus(pnli).getPtr("pp"), pnlps.plus(pnlip2).getPtr("pp"),
360 pnlps.plus(pnlj).getPtr("pp"), pnlps.plus(pnljp1).getPtr("pp")))
352 if (intersects(pnlps[pnli].pp, pnlps[pnlip2].pp,
353 pnlps[pnlj].pp, pnlps[pnljp1].pp))
361354 return false;
362355 }
363356 return ((N(false)));
374367 public static void loadtriangle(__ptr__ pnlap, __ptr__ pnlbp, __ptr__ pnlcp) {
375368 ENTERING("7vf9jtj9i8rg0cxrstbqswuck","loadtriangle");
376369 try {
377 triangle_t trip;
370 ST_triangle_t.Array trip;
378371 int ei;
379372 /* make space */
380373 if (Z.z().tril >= Z.z().trin)
381374 growtris(Z.z().trin + 20);
382 trip = (triangle_t) Z.z().tris.plus(Z.z().tril++);
383 trip.setInt("mark", 0);
384 trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl0p", pnlap);
385 trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("pnl1p", pnlbp);
386 trip.getArrayOfStruct("e").plus(0).getStruct().setPtr("rtp", null);
387 trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("pnl0p", pnlbp);
388 trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("pnl1p", pnlcp);
389 trip.getArrayOfStruct("e").plus(1).getStruct().setPtr("rtp", null);
390 trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("pnl0p", pnlcp);
391 trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("pnl1p", pnlap);
392 trip.getArrayOfStruct("e").plus(2).getStruct().setPtr("rtp", null);
375 trip = Z.z().tris.plusJ(Z.z().tril++);
376 trip.get(0).mark = 0;
377 trip.get(0).e[0].pnl0p = (ST_pointnlink_t) pnlap;
378 trip.get(0).e[0].pnl1p = (ST_pointnlink_t) pnlbp;
379 trip.get(0).e[0].rtp = null;
380 trip.get(0).e[1].pnl0p = (ST_pointnlink_t) pnlbp;
381 trip.get(0).e[1].pnl1p = (ST_pointnlink_t) pnlcp;
382 trip.get(0).e[1].rtp = null;
383 trip.get(0).e[2].pnl0p = (ST_pointnlink_t) pnlcp;
384 trip.get(0).e[2].pnl1p = (ST_pointnlink_t) pnlap;
385 trip.get(0).e[2].rtp = null;
393386 for (ei = 0; ei < 3; ei++)
394 trip.getArrayOfStruct("e").plus(ei).getStruct().setPtr("ltp", trip);
387 trip.get(0).e[ei].lrp = trip;
395388 } finally {
396389 LEAVING("7vf9jtj9i8rg0cxrstbqswuck","loadtriangle");
397390 }
405398 public static void connecttris(int tri1, int tri2) {
406399 ENTERING("6coujw0qksrgu5sxj0r39qm1u","connecttris");
407400 try {
408 triangle_t tri1p, tri2p;
401 ST_triangle_t.Array tri1p;
402 ST_triangle_t.Array tri2p;
409403 int ei, ej;
410404 for (ei = 0; ei < 3; ei++) {
411405 for (ej = 0; ej < 3; ej++) {
412 tri1p = (triangle_t) Z.z().tris.plus(tri1);
413 tri2p = (triangle_t) Z.z().tris.plus(tri2);
414 if ((EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
415 tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl0p").getPtr("pp")) &&
416 EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"),
417 tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl1p").getPtr("pp"))) ||
418 (EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
419 tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl1p").getPtr("pp")) &&
420 EQ(tri1p.getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"),
421 tri2p.getArrayOfStruct("e").plus(ej).getStruct().getPtr("pnl0p").getPtr("pp"))))
406 tri1p = Z.z().tris.plusJ(tri1);
407 tri2p = Z.z().tris.plusJ(tri2);
408 if ((EQ(tri1p.get(0).e[ei].pnl0p.pp,
409 tri2p.get(0).e[ej].pnl0p.pp) &&
410 EQ(tri1p.get(0).e[ei].pnl1p.pp,
411 tri2p.get(0).e[ej].pnl1p.pp)) ||
412 (EQ(tri1p.get(0).e[ei].pnl0p.pp,
413 tri2p.get(0).e[ej].pnl1p.pp) &&
414 EQ(tri1p.get(0).e[ei].pnl1p.pp,
415 tri2p.get(0).e[ej].pnl0p.pp)))
422416 {
423 tri1p.getArrayOfStruct("e").plus(ei).getStruct().setPtr("rtp", tri2p);
424 tri2p.getArrayOfStruct("e").plus(ej).getStruct().setPtr("rtp", tri1p);
417 tri1p.get(0).e[ei].rtp = tri2p;
418 tri2p.get(0).e[ej].rtp = tri1p;
425419 }
426420 }
427421 }
439433 ENTERING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
440434 try {
441435 int ei;
442 if (Z.z().tris.plus(trii).getBoolean("mark"))
436 if (Z.z().tris.plusJ(trii).get(0).mark!=0)
443437 return false;
444 Z.z().tris.plus(trii).setInt("mark", 1);
438 Z.z().tris.plusJ(trii).get(0).mark = 1;
445439 if (trii == trij)
446440 return ((!(false)));
447441 for (ei = 0; ei < 3; ei++)
448 if (Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp")!=null &&
449 marktripath(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("rtp").minus(Z.z().tris), trij))
442 if ((Z.z().tris.plusJ(trii).get(0).e[ei].rtp!=null &&
443 marktripath(Z.z().tris.plusJ(trii).get(0).e[ei].rtp.minus(Z.z().tris), trij)))
450444 return ((!(false)));
451 Z.z().tris.plus(trii).setInt("mark", 0);
445 Z.z().tris.plusJ(trii).get(0).mark = 0;
452446 return false;
453447 } finally {
454448 LEAVING("3waxf5wy3mwt12wpg5hxg3o9c","marktripath");
460454
461455 //3 44szdl31mg8mt5qrfj70kb2sn
462456 // static void add2dq(int side, pointnlink_t * pnlp)
463 public static void add2dq(int side, __ptr__ pnlp) {
457 public static void add2dq(int side, ST_pointnlink_t pnlp) {
464458 ENTERING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
465459 try {
466460 if (side == 1) {
467 if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
468 pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).getPtr());
461 if (Z.z().dq.lpnlpi - Z.z().dq.fpnlpi >= 0)
462 pnlp.link = Z.z().dq.pnlps[Z.z().dq.fpnlpi];
469463 /* shortest path links */
470 Z.z().dq.setInt("fpnlpi", Z.z().dq.getInt("fpnlpi")-1);
471 Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("fpnlpi")).setPtr(pnlp);
464 Z.z().dq.fpnlpi = Z.z().dq.fpnlpi-1;
465 Z.z().dq.pnlps[Z.z().dq.fpnlpi] = pnlp;
472466 } else {
473 if (Z.z().dq.getInt("lpnlpi") - Z.z().dq.getInt("fpnlpi") >= 0)
474 pnlp.setPtr("link", Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).getPtr());
467 if (Z.z().dq.lpnlpi - Z.z().dq.fpnlpi >= 0)
468 pnlp.link = Z.z().dq.pnlps[Z.z().dq.lpnlpi];
475469 /* shortest path links */
476 Z.z().dq.setInt("lpnlpi", Z.z().dq.getInt("lpnlpi")+1);
477 Z.z().dq.getPtr("pnlps").plus(Z.z().dq.getInt("lpnlpi")).setPtr(pnlp);
470 Z.z().dq.lpnlpi = Z.z().dq.lpnlpi+1;
471 Z.z().dq.pnlps[Z.z().dq.lpnlpi] = pnlp;
478472 }
479473 } finally {
480474 LEAVING("44szdl31mg8mt5qrfj70kb2sn","add2dq");
490484 ENTERING("572sssdz1se16w790xceiy5vr","splitdq");
491485 try {
492486 if (side == 1)
493 Z.z().dq.setInt("lpnlpi", index);
487 Z.z().dq.lpnlpi = index;
494488 else
495 Z.z().dq.setInt("fpnlpi", index);
489 Z.z().dq.fpnlpi = index;
496490 } finally {
497491 LEAVING("572sssdz1se16w790xceiy5vr","splitdq");
498492 }
503497
504498 //3 9dnrc8vqpffp5t3bmsackgqtl
505499 // static int finddqsplit(pointnlink_t * pnlp)
506 public static int finddqsplit(pointnlink_t pnlp) {
500 public static int finddqsplit(ST_pointnlink_t pnlp) {
507501 ENTERING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
508502 try {
509503 int index;
510 for (index = Z.z().dq.getInt("fpnlpi"); index < Z.z().dq.getInt("apex"); index++)
511 if (ccw(Z.z().dq.getPtr("pnlps").plus(index + 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
504 for (index = Z.z().dq.fpnlpi; index < Z.z().dq.apex; index++)
505 if (ccw(Z.z().dq.pnlps[index + 1].pp, Z.z().dq.pnlps[index].pp, pnlp.pp) ==
512506 1)
513507 return index;
514 for (index = Z.z().dq.getInt("lpnlpi"); index > Z.z().dq.getInt("apex"); index--)
515 if (ccw(Z.z().dq.getPtr("pnlps").plus(index - 1).getPtr().getPtr("pp"), Z.z().dq.getPtr("pnlps").plus(index).getPtr().getPtr("pp"), pnlp.getPtr("pp")) ==
508 for (index = Z.z().dq.lpnlpi; index > Z.z().dq.apex; index--)
509 if (ccw(Z.z().dq.pnlps[index - 1].pp, Z.z().dq.pnlps[index].pp, pnlp.pp) ==
516510 2)
517511 return index;
518 return Z.z().dq.getInt("apex");
512 return Z.z().dq.apex;
519513 } finally {
520514 LEAVING("9dnrc8vqpffp5t3bmsackgqtl","finddqsplit");
521515 }
526520
527521 //3 72h03s8inxtto2ekvmuqjtj3d
528522 // static int ccw(Ppoint_t * p1p, Ppoint_t * p2p, Ppoint_t * p3p)
529 public static int ccw(__ptr__ p1p, __ptr__ p2p, __ptr__ p3p) {
523 public static int ccw(ST_pointf p1p, ST_pointf p2p, ST_pointf p3p) {
530524 ENTERING("72h03s8inxtto2ekvmuqjtj3d","ccw");
531525 try {
532526 double d;
533 d = ((p1p.getDouble("y") - p2p.getDouble("y")) * (p3p.getDouble("x") - p2p.getDouble("x"))) -
534 ((p3p.getDouble("y") - p2p.getDouble("y")) * (p1p.getDouble("x") - p2p.getDouble("x")));
527 d = ((p1p.y - p2p.y) * (p3p.x - p2p.x)) -
528 ((p3p.y - p2p.y) * (p1p.x - p2p.x));
535529 return (d > 0) ? 1 : ((d < 0) ? 2 : 3);
536530 } finally {
537531 LEAVING("72h03s8inxtto2ekvmuqjtj3d","ccw");
543537
544538 //3 22a9ajg9t8ovqsigk3tyu3rkd
545539 // static int intersects(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp, Ppoint_t * pdp)
546 public static boolean intersects(__ptr__ pap, __ptr__ pbp, __ptr__ pcp, __ptr__ pdp) {
540 public static boolean intersects(ST_pointf pap, ST_pointf pbp, ST_pointf pcp, ST_pointf pdp) {
547541 ENTERING("22a9ajg9t8ovqsigk3tyu3rkd","intersects");
548542 try {
549543 int ccw1, ccw2, ccw3, ccw4;
570564
571565 //3 uh5n18rzyevtb4cwpni70qpc
572566 // static int between(Ppoint_t * pap, Ppoint_t * pbp, Ppoint_t * pcp)
573 public static boolean between(__ptr__ pap, __ptr__ pbp, __ptr__ pcp) {
567 public static boolean between(ST_pointf pap, ST_pointf pbp, ST_pointf pcp) {
574568 ENTERING("uh5n18rzyevtb4cwpni70qpc","between");
575569 try {
576 final __struct__<pointf> p1 = JUtils.from(pointf.class), p2 = JUtils.from(pointf.class);
577 p1.setDouble("x", pbp.getDouble("x") - pap.getDouble("x"));
578 p1.setDouble("y", pbp.getDouble("y") - pap.getDouble("y"));
579 p2.setDouble("x", pcp.getDouble("x") - pap.getDouble("x"));
580 p2.setDouble("y", pcp.getDouble("y") - pap.getDouble("y"));
570 final ST_pointf p1 = new ST_pointf(), p2 = new ST_pointf();
571 p1.setDouble("x", pbp.x - pap.x);
572 p1.setDouble("y", pbp.y - pap.y);
573 p2.setDouble("x", pcp.x - pap.x);
574 p2.setDouble("y", pcp.y - pap.y);
581575 if (ccw(pap, pbp, pcp) != 3)
582576 return false;
583 return (p2.getDouble("x") * p1.getDouble("x") + p2.getDouble("y") * p1.getDouble("y") >= 0) &&
584 (p2.getDouble("x") * p2.getDouble("x") + p2.getDouble("y") * p2.getDouble("y") <= p1.getDouble("x") * p1.getDouble("x") + p1.getDouble("y") * p1.getDouble("y"));
577 return (p2.x * p1.x + p2.y * p1.y >= 0) &&
578 (p2.x * p2.x + p2.y * p2.y <= p1.x * p1.x + p1.y * p1.y);
585579 } finally {
586580 LEAVING("uh5n18rzyevtb4cwpni70qpc","between");
587581 }
592586
593587 //3 zti1mzm2m7tr2xwnbf7e8u3d
594588 // static int pointintri(int trii, Ppoint_t * pp)
595 public static boolean pointintri(int trii, __ptr__ pp) {
589 public static boolean pointintri(int trii, ST_pointf pp) {
596590 ENTERING("zti1mzm2m7tr2xwnbf7e8u3d","pointintri");
597591 try {
598592 int ei, sum;
599593 for (ei = 0, sum = 0; ei < 3; ei++)
600 if (ccw(Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl0p").getPtr("pp"),
601 Z.z().tris.plus(trii).getArrayOfStruct("e").plus(ei).getStruct().getPtr("pnl1p").getPtr("pp"), pp) != 2)
594 if (ccw(Z.z().tris.plusJ(trii).get(0).e[ei].pnl0p.pp,
595 Z.z().tris.plusJ(trii).get(0).e[ei].pnl1p.pp, pp) != 2)
602596 sum++;
603597 return (sum == 3 || sum == 0);
604598 } finally {
617611 if (newpnln <= Z.z().pnln)
618612 return;
619613 if (N(Z.z().pnls)) {
620 if (N(Z.z().pnls = (pointnlink_t) Memory.malloc(sizeof (pointnlink_t.class, newpnln)))) {
614 if (N(Z.z().pnls = malloc(newpnln))) {
621615 UNSUPPORTED("9zyfc4bjg3i6rrna9vqf8doys"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnls"));
622616 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
623617 }
624 if (N(Z.z().pnlps = Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
618 if (N(Z.z().pnlps = malloc(newpnln))) {
625619 UNSUPPORTED("1etar0wd2cbbvqo4jnmbvjiz4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc pnlps"));
626620 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
627621 }
628622 } else {
629 if (N(Z.z().pnls = (pointnlink_t) Memory.realloc(Z.z().pnls,
630 sizeof (pointnlink_t.class, newpnln)))) {
623 if (N(Z.z().pnls = realloc(Z.z().pnls, newpnln))) {
631624 UNSUPPORTED("105nogpkt0qqut0yu4alvkk1u"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnls"));
632625 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
633626 }
634 if (N(Z.z().pnlps = Memory.realloc(Z.z().pnlps,
635 sizeof_starstar_empty(pointnlink_t.class, newpnln)))) {
627 if (N(Z.z().pnlps = realloc(Z.z().pnlps, newpnln))) {
636628 UNSUPPORTED("be84alh84ub40x4um989aj20d"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc pnlps"));
637629 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
638630 }
643635 }
644636 }
645637
638 private static ST_pointnlink_t[] malloc(int nb) {
639 ST_pointnlink_t result[] = new ST_pointnlink_t[nb];
640 for (int i = 0; i < result.length; i++) {
641 result[i] = new ST_pointnlink_t();
642 }
643 return result;
644 }
645 private static ST_pointnlink_t[] realloc(ST_pointnlink_t orig[], int nb) {
646 if (orig.length >= nb) {
647 return orig;
648 }
649 ST_pointnlink_t result[] = malloc(nb);
650 for (int i = 0; i < orig.length; i++) {
651 result[i] = orig[i];
652 }
653 return result;
654 }
646655
647656
648657
654663 if (newtrin <= Z.z().trin)
655664 return;
656665 if (N(Z.z().tris)) {
657 if (N(Z.z().tris = Memory.malloc(sizeof(triangle_t.class, newtrin)))) {
666 if (N(Z.z().tris = new ST_triangle_t.Array(newtrin))) {
658667 UNSUPPORTED("5782e28cjpaa3dpf8up4zmtq7"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc tris"));
659668 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
660669 }
661670 } else {
662 if (N(Z.z().tris = Memory.realloc(Z.z().tris, sizeof (triangle_t.class, newtrin)))) {
671 if (N(Z.z().tris = Z.z().tris.reallocJ(newtrin))) {
663672 UNSUPPORTED("d3fgu54pn5tydfhn7z73v73ra"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc tris"));
664673 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
665674 }
670679 }
671680 }
672681
682
683 private static ST_triangle_t[] malloc2(int nb) {
684 ST_triangle_t result[] = new ST_triangle_t[nb];
685 for (int i = 0; i < result.length; i++) {
686 result[i] = new ST_triangle_t();
687 }
688 return result;
689 }
690 private static ST_triangle_t[] realloc2(ST_triangle_t orig[], int nb) {
691 if (orig.length >= nb) {
692 return orig;
693 }
694 ST_triangle_t result[] = malloc2(nb);
695 for (int i = 0; i < orig.length; i++) {
696 result[i] = orig[i];
697 }
698 return result;
699 }
673700
674701
675702
678705 public static void growdq(int newdqn) {
679706 ENTERING("bzym9u6dtatii1vp4hcmofc80","growdq");
680707 try {
681 if (newdqn <= Z.z().dq.getInt("pnlpn"))
708 if (newdqn <= Z.z().dq.pnlpn)
682709 return;
683 if (N(Z.z().dq.getPtr("pnlps"))) {
710 if (N(Z.z().dq.pnlps)) {
684711 if (N
685 (Z.z().dq.setPtr("pnlps",
686 (__ptr__) Memory.malloc(sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
712 (Z.z().dq.malloc(newdqn))) {
687713 UNSUPPORTED("88fwpb40wz9jc8jiz7u032s4t"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc dq.pnls"));
688714 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
689715 }
690716 } else {
691 if (N(Z.z().dq.setPtr("pnlps", (__ptr__) Memory.realloc(Z.z().dq.getPtr("pnlps"),
692 sizeof_starstar_empty(pointnlink_t.class, newdqn))))) {
717 if (N(Z.z().dq.realloc(newdqn))) {
693718 UNSUPPORTED("exqx4ck7h15m8whgip6xpnhoo"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc dq.pnls"));
694719 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
695720 }
696721 }
697 Z.z().dq.setInt("pnlpn", newdqn);
722 Z.z().dq.pnlpn = newdqn;
698723 } finally {
699724 LEAVING("bzym9u6dtatii1vp4hcmofc80","growdq");
700725 }
711736 if (newopn <= Z.z().opn_shortest)
712737 return;
713738 if (N(Z.z().ops_shortest)) {
714 if (N(Z.z().ops_shortest = Memory.malloc(sizeof(pointf.class, newopn)))) {
739 if (N(Z.z().ops_shortest = new ST_pointf.Array(newopn))) {
715740 UNSUPPORTED("7wxgcgah7iy6vetj5yszoq4k4"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot malloc ops"));
716741 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
717742 }
718743 } else {
719 if (N(Z.z().ops_shortest = Memory.realloc(Z.z().ops_shortest,
720 sizeof(pointf.class, newopn)))) {
744 if (N(Z.z().ops_shortest = Z.z().ops_shortest.reallocJ(newopn))) {
721745 UNSUPPORTED("7azrdo5s3kc44taqmtmeu1s33"); // fprintf (stderr, "libpath/%s:%d: %s\n", "graphviz-2.38.0\\lib\\pathplan\\shortest.c", 26, ("cannot realloc ops"));
722746 UNSUPPORTED("1r6uhbnmxv8c6msnscw07w0qx"); // longjmp(jbuf,1);
723747 }
+0
-68
src/h/Agattr_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 bhyg6b8o9rt02pkq0cw5v7v8l
52
53 public interface Agattr_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agattr_s",
56 "{",
57 "Agrec_t h",
58 "Dict_t *dict",
59 "char **str",
60 "}");
61 }
62
63 // struct Agattr_s { /* dynamic string attributes */
64 // Agrec_t h; /* common data header */
65 // Dict_t *dict; /* shared dict to interpret attr field */
66 // char **str; /* the attribute string values */
67 // };
+0
-57
src/h/Agattr_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 4eab8jpwd22sxwe7231h81ak7
50
51 public interface Agattr_t extends Agattr_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agattr_s Agattr_t");
54 }
55
56 // typedef struct Agattr_s Agattr_t;
+0
-74
src/h/Agcbdisc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4bs0remcyjtoc7ic0ezb77hjt
52
53 public interface Agcbdisc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agcbdisc_s",
56 "{",
57 "struct",
58 "{",
59 "agobjfn_t ins",
60 "agobjupdfn_t mod",
61 "agobjfn_t del",
62 "}",
63 "graph, node, edge",
64 "}");
65 }
66
67 // struct Agcbdisc_s {
68 // struct {
69 // agobjfn_t ins;
70 // agobjupdfn_t mod;
71 // agobjfn_t del;
72 // } graph, node, edge;
73 // };
+0
-57
src/h/Agcbdisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 5yq6nwzfy7wrzq92i583nbcxk
50
51 public interface Agcbdisc_t extends Agcbdisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agcbdisc_s Agcbdisc_t");
54 }
55
56 // typedef struct Agcbdisc_s Agcbdisc_t;
+0
-78
src/h/Agclos_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 eo8sfsh5lby147igpryzvitu7
52
53 public interface Agclos_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agclos_s",
56 "{",
57 "Agdisc_t disc",
58 "Agdstate_t state",
59 "Dict_t *strdict",
60 "unsigned long seq[3]",
61 "Agcbstack_t *cb",
62 "unsigned char callbacks_enabled",
63 "Dict_t *lookup_by_name[3]",
64 "Dict_t *lookup_by_id[3]",
65 "}");
66 }
67
68 // struct Agclos_s {
69 // Agdisc_t disc; /* resource discipline functions */
70 // Agdstate_t state; /* resource closures */
71 // Dict_t *strdict; /* shared string dict */
72 // unsigned long seq[3]; /* local object sequence number counter */
73 // Agcbstack_t *cb; /* user and system callback function stacks */
74 // unsigned char callbacks_enabled; /* issue user callbacks or hold them? */
75 // Dict_t *lookup_by_name[3];
76 // Dict_t *lookup_by_id[3];
77 // };
+0
-57
src/h/Agclos_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 b7spmxawwjlyako5bvwhmto82
50
51 public interface Agclos_t extends Agclos_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agclos_s Agclos_t");
54 }
55
56 // typedef struct Agclos_s Agclos_t;
+0
-67
src/h/Agcmpedge_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aaoij3s9ltd2qv1eegfydx2a3
52
53 public interface Agcmpedge_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agcmpedge_s",
56 "{",
57 "Agrec_t hdr",
58 "save_stack_t stack[2]",
59 "}",
60 "Agcmpedge_t");
61 }
62
63 // typedef struct Agcmpedge_s {
64 // Agrec_t hdr;
65 // save_stack_t stack[2]; /* IN and OUT save stacks */
66 // } Agcmpedge_t;
+0
-69
src/h/Agcmpgraph_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5vqgch0hhxdt8uyrsm383989v
52
53 public interface Agcmpgraph_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agcmpgraph_s",
56 "{",
57 "Agrec_t hdr",
58 "Agnode_t *node",
59 "Dict_t *hidden_node_set",
60 "}",
61 "Agcmpgraph_t");
62 }
63
64 // typedef struct Agcmpgraph_s {
65 // Agrec_t hdr;
66 // Agnode_t *node; /* its associated node */
67 // Dict_t *hidden_node_set;
68 // } Agcmpgraph_t;
+0
-69
src/h/Agcmpnode_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 cym8pkipa9u10pg85jps0y6fj
52
53 public interface Agcmpnode_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agcmpnode_s",
56 "{",
57 "Agrec_t hdr",
58 "Agraph_t *subg",
59 "int collapsed",
60 "}",
61 "Agcmpnode_t");
62 }
63
64 // typedef struct Agcmpnode_s {
65 // Agrec_t hdr;
66 // Agraph_t *subg;
67 // int collapsed;
68 // } Agcmpnode_t;
+0
-72
src/h/Agdatadict_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 1wbtv41cwqamseppeo0vb4kjf
52
53 public interface Agdatadict_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agdatadict_s",
56 "{",
57 "Agrec_t h",
58 "struct",
59 "{",
60 "Dict_t *n, *e, *g",
61 "}",
62 "dict",
63 "}");
64 }
65
66 // struct Agdatadict_s { /* set of dictionaries per graph */
67 // Agrec_t h; /* installed in list of graph recs */
68 // struct {
69 // Dict_t *n, *e, *g;
70 // } dict;
71 // };
+0
-57
src/h/Agdatadict_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 cx24b8rdaygr5mrcvg063ostp
50
51 public interface Agdatadict_t extends Agdatadict_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agdatadict_s Agdatadict_t");
54 }
55
56 // typedef struct Agdatadict_s Agdatadict_t;
+0
-78
src/h/Agdesc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 drqmj6wswekevi9i4ghve61wj
52
53 public interface Agdesc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agdesc_s",
56 "{",
57 "unsigned directed:1",
58 "unsigned strict:1",
59 "unsigned no_loop:1",
60 "unsigned maingraph:1",
61 "unsigned flatlock:1",
62 "unsigned no_write:1",
63 "unsigned has_attrs:1",
64 "unsigned has_cmpnd:1",
65 "}");
66 }
67
68 // struct Agdesc_s { /* graph descriptor */
69 // unsigned directed:1; /* if edges are asymmetric */
70 // unsigned strict:1; /* if multi-edges forbidden */
71 // unsigned no_loop:1; /* if no loops */
72 // unsigned maingraph:1; /* if this is the top level graph */
73 // unsigned flatlock:1; /* if sets are flattened into lists in cdt */
74 // unsigned no_write:1; /* if a temporary subgraph */
75 // unsigned has_attrs:1; /* if string attr tables should be initialized */
76 // unsigned has_cmpnd:1; /* if may contain collapsed nodes */
77 // };
+0
-57
src/h/Agdesc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 2nxdbvy3uxd7hzq9yspewhiy2
50
51 public interface Agdesc_t extends Agdesc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agdesc_s Agdesc_t");
54 }
55
56 // typedef struct Agdesc_s Agdesc_t;
+0
-68
src/h/Agdisc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 88aohxn7kudu5j4oxbyvcxvz9
52
53 public interface Agdisc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agdisc_s",
56 "{",
57 "Agmemdisc_t *mem",
58 "Agiddisc_t *id",
59 "Agiodisc_t *io",
60 "}");
61 }
62
63 // struct Agdisc_s { /* user's discipline */
64 // Agmemdisc_t *mem;
65 // Agiddisc_t *id;
66 // Agiodisc_t *io;
67 // };
+0
-57
src/h/Agdisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 a75fiuk7wedgsbsb3dymg9c1c
50
51 public interface Agdisc_t extends Agdisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agdisc_s Agdisc_t");
54 }
55
56 // typedef struct Agdisc_s Agdisc_t;
+0
-57
src/h/Agdstate_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 5kp1ggrs1pvfbdfrnl42a1l69
50
51 public interface Agdstate_t extends Agdstate_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agdstate_s Agdstate_t");
54 }
55
56 // typedef struct Agdstate_s Agdstate_t;
+0
-70
src/h/Agedge_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5g85sn734cnzkqf8sdgtdesgl
52
53 public interface Agedge_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agedge_s",
56 "{",
57 "Agobj_t base",
58 "Dtlink_t id_link",
59 "Dtlink_t seq_link",
60 "Agnode_t *node",
61 "}");
62 }
63
64 // struct Agedge_s {
65 // Agobj_t base;
66 // Dtlink_t id_link; /* main graph only */
67 // Dtlink_t seq_link;
68 // Agnode_t *node; /* the endpoint node */
69 // };
+0
-57
src/h/Agedge_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 at817e3s1icc92sqipan1gjl9
50
51 public interface Agedge_t extends Agedge_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agedge_s Agedge_t");
54 }
55
56 // typedef struct Agedge_s Agedge_t;
+0
-110
src/h/Agedgeinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c1b3tf6cmbwk2cvu1u6j2rduc
52
53 public interface Agedgeinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agedgeinfo_t",
56 "{",
57 "Agrec_t hdr",
58 "splines *spl",
59 "port tail_port, head_port",
60 "textlabel_t *label, *head_label, *tail_label, *xlabel",
61 "char edge_type",
62 "char adjacent",
63 "char label_ontop",
64 "unsigned char gui_state",
65 "edge_t *to_orig",
66 "void *alg",
67 "double factor",
68 "double dist",
69 "Ppolyline_t path",
70 "unsigned char showboxes",
71 "boolean conc_opp_flag",
72 "short xpenalty",
73 "int weight",
74 "int cutvalue, tree_index",
75 "short count",
76 "unsigned short minlen",
77 "edge_t *to_virt",
78 "}",
79 "Agedgeinfo_t");
80 }
81
82 // typedef struct Agedgeinfo_t {
83 // Agrec_t hdr;
84 // splines *spl;
85 // port tail_port, head_port;
86 // textlabel_t *label, *head_label, *tail_label, *xlabel;
87 // char edge_type;
88 // char adjacent; /* true for flat edge with adjacent nodes */
89 // char label_ontop;
90 // unsigned char gui_state; /* Edge state for GUI ops */
91 // edge_t *to_orig; /* for dot's shapes.c */
92 // void *alg;
93 //
94 //
95 // double factor;
96 // double dist;
97 // Ppolyline_t path;
98 //
99 //
100 // unsigned char showboxes;
101 // boolean conc_opp_flag;
102 // short xpenalty;
103 // int weight;
104 // int cutvalue, tree_index;
105 // short count;
106 // unsigned short minlen;
107 // edge_t *to_virt;
108 //
109 // } Agedgeinfo_t;
+0
-64
src/h/Agedgepair_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 57xqkv3rhmm29ure1eqi4xjwm
52
53 public interface Agedgepair_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agedgepair_s",
56 "{",
57 "Agedge_t out, in",
58 "}");
59 }
60
61 // struct Agedgepair_s {
62 // Agedge_t out, in;
63 // };
+0
-57
src/h/Agedgepair_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 9y2h3138nynj283jcxucqmaib
50
51 public interface Agedgepair_t extends Agedgepair_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agedgepair_s Agedgepair_t");
54 }
55
56 // typedef struct Agedgepair_s Agedgepair_t;
+0
-77
src/h/Agiddisc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9v8qggm3xqq7ok84lmnkhvpv8
52
53 public interface Agiddisc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agiddisc_s",
56 "{",
57 "void *(*open) (Agraph_t * g, Agdisc_t*)",
58 "long (*map) (void *state, int objtype, char *str, unsigned long *id, int createflag)",
59 "long (*alloc) (void *state, int objtype, unsigned long id)",
60 "void (*free) (void *state, int objtype, unsigned long id)",
61 "char *(*print) (void *state, int objtype, unsigned long id)",
62 "void (*close) (void *state)",
63 "void (*idregister) (void *state, int objtype, void *obj)",
64 "}");
65 }
66
67 // struct Agiddisc_s { /* object ID allocator */
68 // void *(*open) (Agraph_t * g, Agdisc_t*); /* associated with a graph */
69 // long (*map) (void *state, int objtype, char *str, unsigned long *id,
70 // int createflag);
71 // long (*alloc) (void *state, int objtype, unsigned long id);
72 // void (*free) (void *state, int objtype, unsigned long id);
73 // char *(*print) (void *state, int objtype, unsigned long id);
74 // void (*close) (void *state);
75 // void (*idregister) (void *state, int objtype, void *obj);
76 // };
+0
-57
src/h/Agiddisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 7fbm9w57ywtqk4kw5c3z6zwm1
50
51 public interface Agiddisc_t extends Agiddisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agiddisc_s Agiddisc_t");
54 }
55
56 // typedef struct Agiddisc_s Agiddisc_t;
+0
-57
src/h/Agiodisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 63k1fn4amvhaud4remizhg2ks
50
51 public interface Agiodisc_t extends Agiodisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agiodisc_s Agiodisc_t");
54 }
55
56 // typedef struct Agiodisc_s Agiodisc_t;
+0
-72
src/h/Agmemdisc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 366ph8t7jvjosq0zlqhb1g26x
52
53 public interface Agmemdisc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agmemdisc_s",
56 "{",
57 "void *(*open) (Agdisc_t*)",
58 "void *(*alloc) (void *state, size_t req)",
59 "void *(*resize) (void *state, void *ptr, size_t old, size_t req)",
60 "void (*free) (void *state, void *ptr)",
61 "void (*close) (void *state)",
62 "}");
63 }
64
65 // struct Agmemdisc_s { /* memory allocator */
66 // void *(*open) (Agdisc_t*); /* independent of other resources */
67 // void *(*alloc) (void *state, size_t req);
68 // void *(*resize) (void *state, void *ptr, size_t old, size_t req);
69 // void (*free) (void *state, void *ptr);
70 // void (*close) (void *state);
71 // };
+0
-57
src/h/Agmemdisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 e2u8m7bby3ay236un81y217mm
50
51 public interface Agmemdisc_t extends Agmemdisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agmemdisc_s Agmemdisc_t");
54 }
55
56 // typedef struct Agmemdisc_s Agmemdisc_t;
+0
-68
src/h/Agnode_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5h58ys5dc8q21vir1hk2r7xr7
52
53 public interface Agnode_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agnode_s",
56 "{",
57 "Agobj_t base",
58 "Agraph_t *root",
59 "Agsubnode_t mainsub",
60 "}");
61 }
62
63 // struct Agnode_s {
64 // Agobj_t base;
65 // Agraph_t *root;
66 // Agsubnode_t mainsub; /* embedded for main graph */
67 // };
+0
-57
src/h/Agnode_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 8eeq5jtusu1u57hjz90nc9i9m
50
51 public interface Agnode_t extends Agnode_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agnode_s Agnode_t");
54 }
55
56 // typedef struct Agnode_s Agnode_t;
+0
-150
src/h/Agnodeinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 da1kcmh9tvz6n7xaqw78dn4h8
52
53 public interface Agnodeinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agnodeinfo_t",
56 "{",
57 "Agrec_t hdr",
58 "shape_desc *shape",
59 "void *shape_info",
60 "pointf coord",
61 "double width, height",
62 "boxf bb",
63 "double ht, lw, rw",
64 "textlabel_t *label",
65 "textlabel_t *xlabel",
66 "void *alg",
67 "char state",
68 "unsigned char gui_state",
69 "boolean clustnode",
70 "unsigned char pinned",
71 "int id, heapindex, hops",
72 "double *pos, dist",
73 "unsigned char showboxes",
74 "boolean has_port",
75 "node_t* rep",
76 "node_t *set",
77 "char node_type, mark, onstack",
78 "char ranktype, weight_class",
79 "node_t *next, *prev",
80 "elist in, out, flat_out, flat_in, other",
81 "graph_t *clust",
82 "int UF_size",
83 "node_t *UF_parent",
84 "node_t *inleaf, *outleaf",
85 "int rank, order",
86 "double mval",
87 "elist save_in, save_out",
88 "elist tree_in, tree_out",
89 "edge_t *par",
90 "int low, lim",
91 "int priority",
92 "double pad[1]",
93 "}",
94 "Agnodeinfo_t");
95 }
96
97 // typedef struct Agnodeinfo_t {
98 // Agrec_t hdr;
99 // shape_desc *shape;
100 // void *shape_info;
101 // pointf coord;
102 // double width, height; /* inches */
103 // boxf bb;
104 // double ht, lw, rw;
105 // textlabel_t *label;
106 // textlabel_t *xlabel;
107 // void *alg;
108 // char state;
109 // unsigned char gui_state; /* Node state for GUI ops */
110 // boolean clustnode;
111 //
112 //
113 // unsigned char pinned;
114 // int id, heapindex, hops;
115 // double *pos, dist;
116 //
117 //
118 // unsigned char showboxes;
119 // boolean has_port;
120 // node_t* rep;
121 // node_t *set;
122 //
123 // /* fast graph */
124 // char node_type, mark, onstack;
125 // char ranktype, weight_class;
126 // node_t *next, *prev;
127 // elist in, out, flat_out, flat_in, other;
128 // graph_t *clust;
129 //
130 // /* for union-find and collapsing nodes */
131 // int UF_size;
132 // node_t *UF_parent;
133 // node_t *inleaf, *outleaf;
134 //
135 // /* for placing nodes */
136 // int rank, order; /* initially, order = 1 for ordered edges */
137 // double mval;
138 // elist save_in, save_out;
139 //
140 // /* for network-simplex */
141 // elist tree_in, tree_out;
142 // edge_t *par;
143 // int low, lim;
144 // int priority;
145 //
146 // double pad[1];
147 //
148 //
149 // } Agnodeinfo_t;
+0
-66
src/h/Agobj_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7fv7yqhmqaa7u2qszrcz1x603
52
53 public interface Agobj_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agobj_s",
56 "{",
57 "Agtag_t tag",
58 "Agrec_t *data",
59 "}");
60 }
61
62 // struct Agobj_s {
63 // Agtag_t tag;
64 // Agrec_t *data;
65 // };
+0
-57
src/h/Agobj_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 cxj639s7ndfjcf3ku07ins96y
50
51 public interface Agobj_t extends Agobj_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agobj_s Agobj_t");
54 }
55
56 // typedef struct Agobj_s Agobj_t;
+0
-80
src/h/Agraph_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5ho0f0m8hitlfq9j032lww947
52
53 public interface Agraph_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agraph_s",
56 "{",
57 "Agobj_t base",
58 "Agdesc_t desc",
59 "Dtlink_t link",
60 "Dict_t *n_seq",
61 "Dict_t *n_id",
62 "Dict_t *e_seq, *e_id",
63 "Dict_t *g_dict",
64 "Agraph_t *parent, *root",
65 "Agclos_t *clos",
66 "}");
67 }
68
69 // struct Agraph_s {
70 // Agobj_t base;
71 // Agdesc_t desc;
72 // Dtlink_t link;
73 // Dict_t *n_seq; /* the node set in sequence */
74 // Dict_t *n_id; /* the node set indexed by ID */
75 // Dict_t *e_seq, *e_id; /* holders for edge sets */
76 // Dict_t *g_dict; /* subgraphs - descendants */
77 // Agraph_t *parent, *root; /* subgraphs - ancestors */
78 // Agclos_t *clos; /* shared resources */
79 // };
+0
-57
src/h/Agraph_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 aqw3i7b3unkie2w709gyzy18f
50
51 public interface Agraph_t extends Agraph_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agraph_s Agraph_t");
54 }
55
56 // typedef struct Agraph_s Agraph_t;
+0
-171
src/h/Agraphinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2mtqmob86ayzjvuxgvhlg4ctl
52
53 public interface Agraphinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agraphinfo_t",
56 "{",
57 "Agrec_t hdr",
58 "layout_t *drawing",
59 "textlabel_t *label",
60 "boxf bb",
61 "pointf border[4]",
62 "unsigned char gui_state",
63 "unsigned char has_labels",
64 "boolean has_images",
65 "unsigned char charset",
66 "int rankdir",
67 "double ht1, ht2",
68 "unsigned short flags",
69 "void *alg",
70 "GVC_t *gvc",
71 "void (*cleanup) (graph_t * g)",
72 "node_t **neato_nlist",
73 "int move",
74 "double **dist, **spring, **sum_t, ***t",
75 "unsigned short ndim",
76 "unsigned short odim",
77 "int n_cluster",
78 "graph_t **clust",
79 "graph_t *dotroot",
80 "node_t *nlist",
81 "rank_t *rank",
82 "graph_t *parent",
83 "int level",
84 "node_t *minrep, *maxrep",
85 "nlist_t comp",
86 "node_t *minset, *maxset",
87 "long n_nodes",
88 "short minrank, maxrank",
89 "boolean has_flat_edges",
90 "boolean has_sourcerank",
91 "boolean has_sinkrank",
92 "unsigned char showboxes",
93 "fontname_kind fontnames",
94 "int nodesep, ranksep",
95 "node_t *ln, *rn",
96 "node_t *leader, **rankleader",
97 "boolean expanded",
98 "char installed",
99 "char set_type",
100 "char label_pos",
101 "boolean exact_ranksep",
102 "}",
103 "Agraphinfo_t");
104 }
105
106 // typedef struct Agraphinfo_t {
107 // Agrec_t hdr;
108 // /* to generate code */
109 // layout_t *drawing;
110 // textlabel_t *label; /* if the cluster has a title */
111 // boxf bb; /* bounding box */
112 // pointf border[4]; /* sizes of margins for graph labels */
113 // unsigned char gui_state; /* Graph state for GUI ops */
114 // unsigned char has_labels;
115 // boolean has_images;
116 // unsigned char charset; /* input character set */
117 // int rankdir;
118 // double ht1, ht2; /* below and above extremal ranks */
119 // unsigned short flags;
120 // void *alg;
121 // GVC_t *gvc; /* context for "globals" over multiple graphs */
122 // void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
123 //
124 //
125 // /* to place nodes */
126 // node_t **neato_nlist;
127 // int move;
128 // double **dist, **spring, **sum_t, ***t;
129 // unsigned short ndim;
130 // unsigned short odim;
131 //
132 //
133 // /* to have subgraphs */
134 // int n_cluster;
135 // graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
136 // graph_t *dotroot;
137 // node_t *nlist;
138 // rank_t *rank;
139 // graph_t *parent; /* containing cluster (not parent subgraph) */
140 // int level; /* cluster nesting level (not node level!) */
141 // node_t *minrep, *maxrep; /* set leaders for min and max rank */
142 //
143 // /* fast graph node list */
144 // nlist_t comp;
145 // /* connected components */
146 // node_t *minset, *maxset; /* set leaders */
147 // long n_nodes;
148 // /* includes virtual */
149 // short minrank, maxrank;
150 //
151 // /* various flags */
152 // boolean has_flat_edges;
153 // boolean has_sourcerank;
154 // boolean has_sinkrank;
155 // unsigned char showboxes;
156 // fontname_kind fontnames; /* to override mangling in SVG */
157 //
158 // int nodesep, ranksep;
159 // node_t *ln, *rn; /* left, right nodes of bounding box */
160 //
161 // /* for clusters */
162 // node_t *leader, **rankleader;
163 // boolean expanded;
164 // char installed;
165 // char set_type;
166 // char label_pos;
167 // boolean exact_ranksep;
168 //
169 //
170 // } Agraphinfo_t;
+0
-67
src/h/Agrec_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 87jgefxbqnrx426i1quuhv9a1
52
53 public interface Agrec_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agrec_s",
56 "{",
57 "char *name",
58 "Agrec_t *next",
59 "}");
60 }
61
62 // struct Agrec_s {
63 // char *name;
64 // Agrec_t *next;
65 // /* following this would be any programmer-defined data */
66 // };
+0
-57
src/h/Agrec_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 6w4pxxbi3ief76hgbmcde192u
50
51 public interface Agrec_t extends Agrec_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agrec_s Agrec_t");
54 }
55
56 // typedef struct Agrec_s Agrec_t;
+0
-67
src/h/Agsplice_arg_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 6utnqddi1e85hs0re8q6xa1vy
52
53 public interface Agsplice_arg_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Agsplice_arg_s",
56 "{",
57 "int head_side",
58 "Agnode_t *target",
59 "}",
60 "Agsplice_arg_t");
61 }
62
63 // typedef struct Agsplice_arg_s {
64 // int head_side;
65 // Agnode_t *target;
66 // } Agsplice_arg_t;
+0
-72
src/h/Agsubnode_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 eykrclzau59zmxissqegaiilg
52
53 public interface Agsubnode_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agsubnode_s",
56 "{",
57 "Dtlink_t seq_link",
58 "Dtlink_t id_link",
59 "Agnode_t *node",
60 "Dtlink_t *in_id, *out_id",
61 "Dtlink_t *in_seq, *out_seq",
62 "}");
63 }
64
65 // struct Agsubnode_s { /* the node-per-graph-or-subgraph record */
66 // Dtlink_t seq_link; /* must be first */
67 // Dtlink_t id_link;
68 // Agnode_t *node; /* the object */
69 // Dtlink_t *in_id, *out_id; /* by node/ID for random access */
70 // Dtlink_t *in_seq, *out_seq; /* by node/sequence for serial access */
71 // };
+0
-57
src/h/Agsubnode_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 df23022lk4w8conzi4uihoqpu
50
51 public interface Agsubnode_t extends Agsubnode_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agsubnode_s Agsubnode_t");
54 }
55
56 // typedef struct Agsubnode_s Agsubnode_t;
+0
-76
src/h/Agsym_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 38c2s12koxcpi2c7vwl72qrsp
52
53 public interface Agsym_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agsym_s",
56 "{",
57 "Dtlink_t link",
58 "char *name",
59 "char *defval",
60 "int id",
61 "unsigned char kind",
62 "unsigned char fixed",
63 "unsigned char print",
64 "}");
65 }
66
67 // struct Agsym_s { /* symbol in one of the above dictionaries */
68 // Dtlink_t link;
69 // char *name; /* attribute's name */
70 // char *defval; /* its default value for initialization */
71 // int id; /* its index in attr[] */
72 // unsigned char kind; /* referent object type */
73 // unsigned char fixed; /* immutable value */
74 // unsigned char print; /* always print */
75 // };
+0
-57
src/h/Agsym_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 c6lodtp6m9o7i924kguh8py09
50
51 public interface Agsym_t extends Agsym_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agsym_s Agsym_t");
54 }
55
56 // typedef struct Agsym_s Agsym_t;
+0
-72
src/h/Agtag_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 f4eovs59su6ztmd1h9rq229c2
52
53 public interface Agtag_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct Agtag_s",
56 "{",
57 "unsigned objtype:2",
58 "unsigned mtflock:1",
59 "unsigned attrwf:1",
60 "unsigned seq:(sizeof(unsigned) * 8 - 4)",
61 "unsigned long id",
62 "}");
63 }
64
65 // struct Agtag_s {
66 // unsigned objtype:2; /* see literal tags below */
67 // unsigned mtflock:1; /* move-to-front lock, see above */
68 // unsigned attrwf:1; /* attrs written (parity, write.c) */
69 // unsigned seq:(sizeof(unsigned) * 8 - 4); /* sequence no. */
70 // unsigned long id; /* client ID */
71 // };
+0
-57
src/h/Agtag_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 bfyeakqg0xg9gqt8ssajorir5
50
51 public interface Agtag_t extends Agtag_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agtag_s Agtag_t");
54 }
55
56 // typedef struct Agtag_s Agtag_t;
+0
-69
src/h/BestPos_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 42vrsrrzqoc36nrw8vum1390l
52
53 public interface BestPos_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct best_p_s",
56 "{",
57 "int n",
58 "double area",
59 "pointf pos",
60 "}",
61 "BestPos_t");
62 }
63
64 // typedef struct best_p_s {
65 // int n;
66 // double area;
67 // pointf pos;
68 // } BestPos_t;
+0
-57
src/h/Dict_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 2ggfcdw1rvmiwttzvdn3ew5b9
50
51 public interface Dict_t extends _dt_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dt_s Dict_t");
54 }
55
56 // typedef struct _dt_s Dict_t;
+0
-57
src/h/Dt_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 u1i3hxdborawdyw7d778quhw
50
51 public interface Dt_t extends _dt_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dt_s Dt_t");
54 }
55
56 // typedef struct _dt_s Dt_t;
+0
-57
src/h/Dtdata_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 864wtxvrdrty5k31pa1h7jqki
50
51 public interface Dtdata_t extends _dtdata_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dtdata_s Dtdata_t");
54 }
55
56 // typedef struct _dtdata_s Dtdata_t;
+0
-57
src/h/Dtdisc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 3n3lg4dzicyo9pzjj6bv0krf5
50
51 public interface Dtdisc_t extends _dtdisc_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dtdisc_s Dtdisc_t");
54 }
55
56 // typedef struct _dtdisc_s Dtdisc_t;
+0
-57
src/h/Dthold_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 1tob3f90syune1bxwbffctfmj
50
51 public interface Dthold_t extends _dthold_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dthold_s Dthold_t");
54 }
55
56 // typedef struct _dthold_s Dthold_t;
+0
-57
src/h/Dtlink_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 8y38rtlesz0zzh2ncgic680by
50
51 public interface Dtlink_t extends _dtlink_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dtlink_s Dtlink_t");
54 }
55
56 // typedef struct _dtlink_s Dtlink_t;
+0
-57
src/h/Dtmethod_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 14xcg8o7gvv98a59xu3dtokd
50
51 public interface Dtmethod_t extends _dtmethod_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _dtmethod_s Dtmethod_t");
54 }
55
56 // typedef struct _dtmethod_s Dtmethod_t;
+0
-173
src/h/GVC_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 clpjw996k49ieh47hl09lwwq1
52
53 public interface GVC_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct GVC_s",
56 "{",
57 "GVCOMMON_t common",
58 "char *config_path",
59 "boolean config_found",
60 "char **input_filenames",
61 "GVG_t *gvgs",
62 "GVG_t *gvg",
63 "gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]",
64 "gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]",
65 "gvplugin_package_t *packages",
66 "size_t (*write_fn) (GVJ_t *job, const char *s, size_t len)",
67 "Dtdisc_t textfont_disc",
68 "Dt_t *textfont_dt",
69 "gvplugin_active_textlayout_t textlayout",
70 "GVJ_t *jobs",
71 "GVJ_t *job",
72 "graph_t *g",
73 "gvplugin_active_layout_t layout",
74 "char *graphname",
75 "GVJ_t *active_jobs",
76 "char *pagedir",
77 "pointf margin",
78 "pointf pad",
79 "pointf pageSize",
80 "point pb",
81 "boxf bb",
82 "int rotation",
83 "boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation",
84 "char *layerDelims",
85 "char *layerListDelims",
86 "char *layers",
87 "char **layerIDs",
88 "int numLayers",
89 "int *layerlist",
90 "char *defaultfontname",
91 "double defaultfontsize",
92 "char **defaultlinestyle",
93 "gvcolor_t bgcolor",
94 "int fontrenaming",
95 "}");
96 }
97
98 // struct GVC_s {
99 // GVCOMMON_t common;
100 //
101 // char *config_path;
102 // boolean config_found;
103 //
104 // /* gvParseArgs */
105 // char **input_filenames; /* null terminated array of input filenames */
106 //
107 // /* gvNextInputGraph() */
108 // GVG_t *gvgs; /* linked list of graphs */
109 // GVG_t *gvg; /* current graph */
110 //
111 // /* plugins */
112 //
113 // /* APIS expands to "+1 +1 ... +1" to give the number of APIs */
114 // gvplugin_available_t *apis[ +1 +1 +1 +1 +1 ]; /* array of linked-list of plugins per api */
115 // gvplugin_available_t *api[ +1 +1 +1 +1 +1 ]; /* array of current plugins per api */
116 //
117 // gvplugin_package_t *packages; /* list of available packages */
118 //
119 // /* externally provided write() displine */
120 // size_t (*write_fn) (GVJ_t *job, const char *s, size_t len);
121 //
122 // /* fonts and textlayout */
123 // Dtdisc_t textfont_disc;
124 // Dt_t *textfont_dt;
125 // gvplugin_active_textlayout_t textlayout; /* always use best avail for all jobs */
126 // // void (*free_layout) (void *layout); /* function for freeing layouts (mostly used by pango) */
127 //
128 // /* FIXME - everything below should probably move to GVG_t */
129 //
130 // /* gvrender_config() */
131 // GVJ_t *jobs; /* linked list of jobs */
132 // GVJ_t *job; /* current job */
133 //
134 // graph_t *g; /* current graph */
135 //
136 // /* gvrender_begin_job() */
137 // gvplugin_active_layout_t layout;
138 //
139 // char *graphname; /* name from graph */
140 // GVJ_t *active_jobs; /* linked list of active jobs */
141 //
142 // /* pagination */
143 // char *pagedir; /* pagination order */
144 // pointf margin; /* margins in graph units */
145 // pointf pad; /* pad in graph units */
146 // pointf pageSize; /* pageSize in graph units, not including margins */
147 // point pb; /* page size - including margins (inches) */
148 // boxf bb; /* graph bb in graph units, not including margins */
149 // int rotation; /* rotation - 0 = portrait, 90 = landscape */
150 // boolean graph_sets_pad, graph_sets_margin, graph_sets_pageSize, graph_sets_rotation;
151 //
152 // /* layers */
153 // char *layerDelims; /* delimiters in layer names */
154 // char *layerListDelims; /* delimiters between layer ranges */
155 // char *layers; /* null delimited list of layer names */
156 // char **layerIDs; /* array of layer names */
157 // int numLayers; /* number of layers */
158 // int *layerlist;
159 //
160 // /* default font */
161 // char *defaultfontname;
162 // double defaultfontsize;
163 //
164 // /* default line style */
165 // char **defaultlinestyle;
166 //
167 // /* render defaults set from graph */
168 // gvcolor_t bgcolor; /* background color */
169 //
170 // /* whether to mangle font names (at least in SVG), usually false */
171 // int fontrenaming;
172 // };
+0
-57
src/h/GVC_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 fg8z912mbk6t13fn38q7zn7l
50
51 public interface GVC_t extends GVC_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct GVC_s GVC_t");
54 }
55
56 // typedef struct GVC_s GVC_t;
+0
-73
src/h/GVG_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 cvpkcmk8fwmnuwmcjl85zzkxc
52
53 public interface GVG_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct GVG_s",
56 "{",
57 "GVC_t *gvc",
58 "GVG_t *next",
59 "char *input_filename",
60 "int graph_index",
61 "graph_t *g",
62 "}");
63 }
64
65 // struct GVG_s {
66 // GVC_t *gvc; /* parent gvc */
67 // GVG_t *next; /* next gvg in list */
68 //
69 // char *input_filename; /* or NULL if stdin */
70 // int graph_index; /* index of graph within input_file */
71 // graph_t *g;
72 // };
+0
-57
src/h/GVG_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 3h2jjekexv13eg90o5lqy1d0j
50
51 public interface GVG_t extends GVG_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct GVG_s GVG_t");
54 }
55
56 // typedef struct GVG_s GVG_t;
+0
-230
src/h/GVJ_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dg8cqsmppn0zl04sycueci9yw
52
53 public interface GVJ_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct GVJ_s",
56 "{",
57 "GVC_t *gvc",
58 "GVJ_t *next",
59 "GVJ_t *next_active",
60 "GVCOMMON_t *common",
61 "obj_state_t *obj",
62 "char *input_filename",
63 "int graph_index",
64 "const char *layout_type",
65 "const char *output_filename",
66 "FILE *output_file",
67 "char *output_data",
68 "unsigned int output_data_allocated",
69 "unsigned int output_data_position",
70 "const char *output_langname",
71 "int output_lang",
72 "gvplugin_active_render_t render",
73 "gvplugin_active_device_t device",
74 "gvplugin_active_loadimage_t loadimage",
75 "gvdevice_callbacks_t *callbacks",
76 "pointf device_dpi",
77 "boolean device_sets_dpi",
78 "void *display",
79 "int screen",
80 "void *context",
81 "boolean external_context",
82 "char *imagedata",
83 "int flags",
84 "int numLayers",
85 "int layerNum",
86 "point pagesArraySize",
87 "point pagesArrayFirst",
88 "point pagesArrayMajor",
89 "point pagesArrayMinor",
90 "point pagesArrayElem",
91 "int numPages",
92 "boxf bb",
93 "pointf pad",
94 "boxf clip",
95 "boxf pageBox",
96 "pointf pageSize",
97 "pointf focus",
98 "double zoom",
99 "int rotation",
100 "pointf view",
101 "boxf canvasBox",
102 "pointf margin",
103 "pointf dpi",
104 "unsigned int width",
105 "unsigned int height",
106 "box pageBoundingBox",
107 "box boundingBox",
108 "pointf scale",
109 "pointf translation",
110 "pointf devscale",
111 "boolean fit_mode, needs_refresh, click, has_grown, has_been_rendered",
112 "unsigned char button",
113 "pointf pointer",
114 "pointf oldpointer",
115 "void *current_obj",
116 "void *selected_obj",
117 "char *active_tooltip",
118 "char *selected_href",
119 "gv_argvlist_t selected_obj_type_name",
120 "gv_argvlist_t selected_obj_attributes",
121 "void *window",
122 "gvevent_key_binding_t *keybindings",
123 "int numkeys",
124 "void *keycodes",
125 "}");
126 }
127
128 // struct GVJ_s {
129 // GVC_t *gvc; /* parent gvc */
130 // GVJ_t *next; /* linked list of jobs */
131 // GVJ_t *next_active; /* linked list of active jobs (e.g. multiple windows) */
132 //
133 // GVCOMMON_t *common;
134 //
135 // obj_state_t *obj; /* objects can be nested (at least clusters can)
136 // so keep object state on a stack */
137 // char *input_filename;
138 // int graph_index;
139 //
140 // const char *layout_type;
141 //
142 // const char *output_filename;
143 // FILE *output_file;
144 // char *output_data;
145 // unsigned int output_data_allocated;
146 // unsigned int output_data_position;
147 //
148 // const char *output_langname;
149 // int output_lang;
150 //
151 // gvplugin_active_render_t render;
152 // gvplugin_active_device_t device;
153 // gvplugin_active_loadimage_t loadimage;
154 // gvdevice_callbacks_t *callbacks;
155 // pointf device_dpi;
156 // boolean device_sets_dpi;
157 //
158 // void *display;
159 // int screen;
160 //
161 // void *context; /* gd or cairo surface */
162 // boolean external_context; /* context belongs to caller */
163 // char *imagedata; /* location of imagedata */
164 //
165 // int flags; /* emit_graph flags */
166 //
167 // int numLayers; /* number of layers */
168 // int layerNum; /* current layer - 1 based*/
169 //
170 // point pagesArraySize; /* 2D size of page array */
171 // point pagesArrayFirst;/* 2D starting corner in */
172 // point pagesArrayMajor;/* 2D major increment */
173 // point pagesArrayMinor;/* 2D minor increment */
174 // point pagesArrayElem; /* 2D coord of current page - 0,0 based */
175 // int numPages; /* number of pages */
176 //
177 // boxf bb; /* graph bb with padding - graph units */
178 // pointf pad; /* padding around bb - graph units */
179 // boxf clip; /* clip region in graph units */
180 // boxf pageBox; /* current page in graph units */
181 // pointf pageSize; /* page size in graph units */
182 // pointf focus; /* viewport focus - graph units */
183 //
184 // double zoom; /* viewport zoom factor (points per graph unit) */
185 // int rotation; /* viewport rotation (degrees) 0=portrait, 90=landscape */
186 //
187 // pointf view; /* viewport size - points */
188 // boxf canvasBox; /* viewport area - points */
189 // pointf margin; /* job-specific margin - points */
190 //
191 // pointf dpi; /* device resolution device-units-per-inch */
192 //
193 // unsigned int width; /* device width - device units */
194 // unsigned int height; /* device height - device units */
195 // box pageBoundingBox;/* rotated boundingBox - device units */
196 // box boundingBox; /* cumulative boundingBox over all pages - device units */
197 //
198 // pointf scale; /* composite device to graph units (zoom and dpi) */
199 // pointf translation; /* composite translation */
200 // pointf devscale; /* composite device to points: dpi, y_goes_down */
201 //
202 // boolean fit_mode,
203 // needs_refresh,
204 // click,
205 // has_grown,
206 // has_been_rendered;
207 //
208 // unsigned char button; /* active button */
209 // pointf pointer; /* pointer position in device units */
210 // pointf oldpointer; /* old pointer position in device units */
211 //
212 // void *current_obj; /* graph object that pointer is in currently */
213 //
214 // void *selected_obj; /* graph object that has been selected */
215 // /* (e.g. button 1 clicked on current obj) */
216 // char *active_tooltip; /* tooltip of active object - or NULL */
217 // char *selected_href; /* href of selected object - or NULL */
218 // gv_argvlist_t selected_obj_type_name; /* (e.g. "edge" "node3" "e" "->" "node5" "") */
219 // gv_argvlist_t selected_obj_attributes; /* attribute triplets: name, value, type */
220 // /* e.g. "color", "red", GVATTR_COLOR,
221 // "style", "filled", GVATTR_BOOL, */
222 //
223 // void *window; /* display-specific data for gvrender plugin */
224 //
225 // /* keybindings for keyboard events */
226 // gvevent_key_binding_t *keybindings;
227 // int numkeys;
228 // void *keycodes;
229 // };
+0
-57
src/h/GVJ_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 1emyokhi9lvf2dq2tz1mt5lq6
50
51 public interface GVJ_t extends GVJ_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct GVJ_s GVJ_t");
54 }
55
56 // typedef struct GVJ_s GVJ_t;
+0
-57
src/h/Grid.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 4i6l1ddogjsyl2pt4s30fqmwy
50
51 public interface Grid extends _grid {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct _grid Grid");
54 }
55
56 // typedef struct _grid Grid;
+0
-69
src/h/HDict_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 d6n85f1kdf00c97r9x4uf3hdy
52
53 public interface HDict_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct obyh",
56 "{",
57 "Dtlink_t link",
58 "int key",
59 "Leaf_t d",
60 "}",
61 "HDict_t");
62 }
63
64 // typedef struct obyh {
65 // Dtlink_t link;
66 // int key;
67 // Leaf_t d;
68 // } HDict_t;
+0
-71
src/h/IMapEntry_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 et72dr7wfb74xjns0mtbfof0b
52
53 public interface IMapEntry_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct IMapEntry_s",
56 "{",
57 "Dtlink_t namedict_link",
58 "Dtlink_t iddict_link",
59 "unsigned long id",
60 "char *str",
61 "}",
62 "IMapEntry_t");
63 }
64
65 // typedef struct IMapEntry_s {
66 // Dtlink_t namedict_link;
67 // Dtlink_t iddict_link;
68 // unsigned long id;
69 // char *str;
70 // } IMapEntry_t;
+0
-65
src/h/Pedge_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2nvsp26kuu9u7ogyjj0s4xc6g
52
53 public interface Pedge_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Pedge_t",
56 "{",
57 "Ppoint_t a, b",
58 "}",
59 "Pedge_t");
60 }
61
62 // typedef struct Pedge_t {
63 // Ppoint_t a, b;
64 // } Pedge_t;
+0
-67
src/h/Ppoly_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e64uez8phkm446sopxainj3um
52
53 public interface Ppoly_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Ppoly_t",
56 "{",
57 "Ppoint_t *ps",
58 "int pn",
59 "}",
60 "Ppoly_t");
61 }
62
63 // typedef struct Ppoly_t {
64 // Ppoint_t *ps;
65 // int pn;
66 // } Ppoly_t;
+0
-124
src/h/RTree.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 6erg9dnjb8l3vavlty90aui6v
52
53 public interface RTree extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct RTree",
56 "{",
57 "Node_t *root",
58 "SplitQ_t split",
59 "int MinFill",
60 "long ElapsedTime",
61 "float UserTime, SystemTime",
62 "int Deleting",
63 "int StatFlag",
64 "int InsertCount",
65 "int DeleteCount",
66 "int ReInsertCount",
67 "int InSplitCount",
68 "int DeSplitCount",
69 "int ElimCount",
70 "int EvalCount",
71 "int InTouchCount",
72 "int DeTouchCount",
73 "int SeTouchCount",
74 "int CallCount",
75 "float SplitMeritSum",
76 "int RectCount",
77 "int NodeCount",
78 "int LeafCount, NonLeafCount",
79 "int EntryCount",
80 "int SearchCount",
81 "int HitCount",
82 "}");
83 }
84
85 // struct RTree {
86 // Node_t *root;
87 //
88 // SplitQ_t split;
89 //
90 // /* balance criterion for node splitting */
91 // int MinFill;
92 //
93 // /* times */
94 // long ElapsedTime;
95 // float UserTime, SystemTime;
96 //
97 // int Deleting;
98 //
99 // /* variables for statistics */
100 // int StatFlag; /* tells if we are counting or not */
101 // /* counters affected only when StatFlag set */
102 // int InsertCount;
103 // int DeleteCount;
104 // int ReInsertCount;
105 // int InSplitCount;
106 // int DeSplitCount;
107 // int ElimCount;
108 // int EvalCount;
109 // int InTouchCount;
110 // int DeTouchCount;
111 // int SeTouchCount;
112 // int CallCount;
113 // float SplitMeritSum;
114 //
115 // /* counters used even when StatFlag not set */
116 // int RectCount;
117 // int NodeCount;
118 // int LeafCount, NonLeafCount;
119 // int EntryCount;
120 // int SearchCount;
121 // int HitCount;
122 //
123 // };
+0
-57
src/h/RTree_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 2mpm2fft75drx0k0by8s54asw
50
51 public interface RTree_t extends RTree {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct RTree RTree_t");
54 }
55
56 // typedef struct RTree RTree_t;
+0
-65
src/h/Rect_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 32vghhci9sc1tdk0jb8p5rlhk
52
53 public interface Rect_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Rect",
56 "{",
57 "int boundary[2*2]",
58 "}",
59 "Rect_t");
60 }
61
62 // typedef struct Rect {
63 // int boundary[2*2];
64 // } Rect_t;
+0
-156
src/h/STArray.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.UnsupportedArrayOfPtr;
51 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_ptr__;
53 import smetana.core.__ptr__;
54 import smetana.core.__struct__;
55 import smetana.core.size_t;
56 import smetana.core.amiga.Area;
57 import smetana.core.amiga.StarArrayOfPtr;
58
59 public class STArray<O extends UnsupportedStructAndPtr> extends UnsupportedArrayOfPtr {
60
61 private final int pos;
62 private final List<O> list;
63 private final Class clazz;
64
65 public STArray(int pos, List<O> list, Class clazz) {
66 this.pos = pos;
67 this.list = list;
68 this.clazz = clazz;
69 }
70
71 @Override
72 public int comparePointerInternal(__array_of_ptr__ other) {
73 STArray<O> other2 = (STArray<O>) other;
74 if (this.list != other2.list) {
75 throw new IllegalArgumentException();
76 }
77 return this.pos - other2.pos;
78 }
79
80 public STArray(int size, int pos, Class clazz) {
81 this.pos = pos;
82 this.list = new ArrayList<O>();
83 this.clazz = clazz;
84 for (int i = 0; i < size; i++) {
85 try {
86 this.list.add((O) clazz.newInstance());
87 } catch (Exception e) {
88 throw new IllegalStateException(e.toString());
89 }
90 }
91 }
92
93 @Override
94 public void realloc(size_t nb) {
95 realloc(nb.getInternalNb());
96 }
97
98 @Override
99 public void realloc(int nb) {
100 while (list.size() < nb) {
101 try {
102 this.list.add((O) clazz.newInstance());
103 } catch (Exception e) {
104 throw new IllegalStateException(e.toString());
105 }
106 }
107 }
108
109 @Override
110 public __array_of_ptr__ plus(int delta) {
111 return new STArray(pos + delta, this.list, clazz);
112 }
113
114 @Override
115 public __array_of_ptr__ move(int delta) {
116 return new STArray(pos + delta, this.list, clazz);
117 }
118
119 @Override
120 public void setStruct(__struct__ value) {
121 list.get(pos).setStruct(value);
122 }
123
124 @Override
125 public __struct__ getStruct() {
126 return list.get(pos).getStruct();
127 // return list.get(pos);
128 }
129
130 @Override
131 public __struct__ getStruct(String fieldName) {
132 return list.get(pos).getStruct(fieldName);
133 }
134
135 @Override
136 public __ptr__ getPtr() {
137 return list.get(pos).amp();
138 }
139
140 @Override
141 public __ptr__ asPtr() {
142 return new StarArrayOfPtr(this);
143 }
144
145 @Override
146 public void setPtr(__ptr__ value) {
147 list.set(pos, (O) value.getStruct());
148 }
149
150 @Override
151 public Area getInternal(final int idx) {
152 return list.get(pos + idx);
153 }
154
155 }
+0
-117
src/h/STStarArrayOfPointer.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.UnsupportedC;
51 import smetana.core.__array_of_integer__;
52 import smetana.core.__ptr__;
53 import smetana.core.amiga.Area;
54
55 public class STStarArrayOfPointer extends UnsupportedC {
56
57 private final int pos;
58 private final List<__ptr__> data;
59
60 public void realloc(int nb) {
61 while (data.size() < nb) {
62 data.add(null);
63 }
64 }
65
66 public static STStarArrayOfPointer malloc(int size) {
67 List<__ptr__> data = new ArrayList<__ptr__>();
68 for (int i = 0; i < size; i++) {
69 data.add(null);
70 }
71 return new STStarArrayOfPointer(0, data);
72 }
73
74 private STStarArrayOfPointer(int pos, List<__ptr__> data) {
75 this.pos = pos;
76 this.data = data;
77 }
78
79 @Override
80 public int comparePointer(__ptr__ other) {
81 final STStarArrayOfPointer this2 = (STStarArrayOfPointer) other;
82 if (this.data != this2.data) {
83 throw new IllegalArgumentException();
84 }
85 return this.pos - this2.pos;
86 }
87
88 @Override
89 public __ptr__ plus(int pointerMove) {
90 return new STStarArrayOfPointer(pos + pointerMove, data);
91 }
92
93 @Override
94 public void setPtr(__ptr__ value) {
95 data.set(pos, value);
96 }
97
98 @Override
99 public __ptr__ getPtr(String fieldName) {
100 return data.get(pos).getPtr(fieldName);
101 }
102
103 @Override
104 public __ptr__ getPtr() {
105 return data.get(pos);
106 }
107
108 public void swap(int i, int j) {
109 __ptr__ e1 = data.get(i);
110 __ptr__ e2 = data.get(j);
111 data.set(i, e2);
112 data.set(j, e1);
113
114 }
115
116 }
4444 */
4545 package h;
4646
47 import java.util.List;
48
49 import smetana.core.CString;
4750 import smetana.core.UnsupportedStructAndPtr;
48 import smetana.core.__array_of_cstring__;
4951 import smetana.core.__ptr__;
50 import smetana.core.amiga.StarArrayOfCString;
5152 import smetana.core.amiga.StarStruct;
5253
5354 public class ST_Agattr_s extends UnsupportedStructAndPtr {
5455
5556 private final ST_Agrec_s h = new ST_Agrec_s(this); /* common data header */
5657 public ST_dt_s dict; /* shared dict to interpret attr field */
57 public StarArrayOfCString str; /* the attribute string values */
58 public List<CString> str; /* the attribute string values */
5859
5960 private final StarStruct parent;
6061
7172 }
7273
7374 @Override
74 public __ptr__ getPtr(String fieldName) {
75 if (fieldName.equals("dict")) {
76 return dict;
77 }
78 return super.getPtr(fieldName);
79 }
80
81 @Override
82 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
83 if (fieldName.equals("dict")) {
84 this.dict = (ST_dt_s) newData;
85 return dict;
86 }
87 if (fieldName.equals("str")) {
88 this.str = (StarArrayOfCString) newData;
89 return str;
90 }
91 return super.setPtr(fieldName, newData);
92 }
93
94 @Override
95 public __array_of_cstring__ getArrayOfCString(String fieldName) {
96 if (fieldName.equals("str")) {
97 return str.getInternalArray();
98 }
99 return super.getArrayOfCString(fieldName);
100 }
101
102 @Override
10375 public __ptr__ castTo(Class dest) {
104 if (dest == Agrec_s.class) {
76 if (dest == ST_Agrec_s.class) {
10577 return h;
10678 // return h.amp();
10779 }
4444 */
4545 package h;
4646
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.ArrayOfInteger;
51 import smetana.core.UnsupportedArrayOfPtr;
5247 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__array_of_integer__;
54 import smetana.core.__array_of_ptr__;
5548 import smetana.core.__ptr__;
56 import smetana.core.__struct__;
5749 import smetana.core.amiga.StarStruct;
5850
5951 public class ST_Agclos_s extends UnsupportedStructAndPtr {
52 private final StarStruct parent;
53
6054 public final ST_Agdisc_s disc = new ST_Agdisc_s(this); /* resource discipline functions */
6155 public final ST_Agdstate_s state = new ST_Agdstate_s(this); /* resource closures */
6256 public ST_dt_s strdict;
63 private final int[] seq = new int[3];
57 public final int[] seq = new int[3];
6458 // "unsigned long seq[3]",
6559 public ST_Agcbstack_s cb;
6660 public boolean callbacks_enabled; /* issue user callbacks or hold them? */
6761
6862 // "Dict_t *lookup_by_name[3]",
6963 // "Dict_t *lookup_by_id[3]",
70 private final ArrayOfThreePtrDict_t lookup_by_id = new ArrayOfThreePtrDict_t();
71
72 static class ArrayOfThreePtrDict_t extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
73 private final List<Dict_t> list;
74 private final int pos;
75
76 private ArrayOfThreePtrDict_t(List<Dict_t> list, int pos) {
77 this.list = list;
78 this.pos = pos;
79 }
80
81 ArrayOfThreePtrDict_t() {
82 this(new ArrayList<Dict_t>(), 0);
83 for (int i = 0; i < 3; i++) {
84 list.add(null);
85 }
86 }
87
88 @Override
89 public __array_of_ptr__ plus(int delta) {
90 return new ArrayOfThreePtrDict_t(list, pos + delta);
91 }
92
93 @Override
94 public __ptr__ getPtr() {
95 return list.get(0);
96 }
97
98 }
99
100 private final StarStruct parent;
64 public final ST_dt_s[] lookup_by_id = new ST_dt_s[3];
10165
10266 public ST_Agclos_s() {
10367 this(null);
11175 return parent;
11276 }
11377
114 @Override
115 public boolean getBoolean(String fieldName) {
116 if (fieldName.equals("callbacks_enabled")) {
117 return callbacks_enabled;
118 }
119 return super.getBoolean(fieldName);
120 }
121
122 @Override
123 public __ptr__ getPtr(String fieldName) {
124 if (fieldName.equals("strdict")) {
125 return strdict;
126 }
127 if (fieldName.equals("cb")) {
128 return cb;
129 }
130 return super.getPtr(fieldName);
131 }
13278
13379 @Override
13480 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
13783 return strdict;
13884 }
13985 return super.setPtr(fieldName, newData);
140 }
141
142 @Override
143 public __struct__ getStruct(String fieldName) {
144 if (fieldName.equals("disc")) {
145 return disc;
146 }
147 if (fieldName.equals("state")) {
148 return state;
149 }
150 return super.getStruct(fieldName);
151 }
152
153 @Override
154 public void setBoolean(String fieldName, boolean data) {
155 if (fieldName.equals("callbacks_enabled")) {
156 this.callbacks_enabled = data;
157 return;
158 }
159 super.setBoolean(fieldName, data);
160 }
161
162 @Override
163 public __array_of_integer__ getArrayOfInteger(String fieldName) {
164 if (fieldName.equals("seq")) {
165 return new ArrayOfInteger(seq, 0);
166 }
167 return super.getArrayOfInteger(fieldName);
168 }
169
170 @Override
171 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
172 if (fieldName.equals("lookup_by_id")) {
173 return lookup_by_id;
174 }
175 return super.getArrayOfPtr(fieldName);
17686 }
17787
17888 // public interface ST_Agclos_s extends __ptr__ {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
5049 import smetana.core.amiga.StarStruct;
5251 public class ST_Agdatadict_s extends UnsupportedStructAndPtr {
5352
5453 private final ST_Agrec_s h = new ST_Agrec_s(this); /* installed in list of graph recs */
55 public ST_dt_s n;
56 public ST_dt_s e;
57 public ST_dt_s g;
54 public ST_dt_s dict_n;
55 public ST_dt_s dict_e;
56 public ST_dt_s dict_g;
5857
5958 private final StarStruct parent;
6059
7170 }
7271
7372 @Override
74 public StarStruct amp() {
75 return new Amp();
76 }
77
78 public class Amp extends UnsupportedStarStruct {
79
80 }
81
82 @Override
8373 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
8474 if (fieldName.equals("dict.n")) {
85 this.n = (ST_dt_s) newData;
86 return n;
75 this.dict_n = (ST_dt_s) newData;
76 return dict_n;
8777 }
8878 if (fieldName.equals("dict.e")) {
89 this.e = (ST_dt_s) newData;
90 return e;
79 this.dict_e = (ST_dt_s) newData;
80 return dict_e;
9181 }
9282 if (fieldName.equals("dict.g")) {
93 this.g = (ST_dt_s) newData;
94 return g;
83 this.dict_g = (ST_dt_s) newData;
84 return dict_g;
9585 }
9686 return super.setPtr(fieldName, newData);
9787 }
9888
9989 @Override
100 public __ptr__ getPtr(String fieldName) {
101 if (fieldName.equals("dict.n")) {
102 return n;
103 }
104 if (fieldName.equals("dict.e")) {
105 return e;
106 }
107 if (fieldName.equals("dict.g")) {
108 return g;
109 }
110 return super.getPtr(fieldName);
111 }
112
113 @Override
11490 public __ptr__ castTo(Class dest) {
115 if (dest == Agrec_s.class) {
116 return h.amp();
91 if (dest == ST_Agrec_s.class) {
92 return h;
11793 }
11894 return super.castTo(dest);
11995 }
5050
5151 public class ST_Agdisc_s extends UnsupportedStructAndPtr {
5252
53 public ST_Agmemdisc_s.Amp mem;
54 public ST_Agiddisc_s.Amp id;
55 public ST_Agiodisc_s.Amp io;
53 public ST_Agmemdisc_s mem;
54 public ST_Agiddisc_s id;
55 public ST_Agiodisc_s io;
5656
5757 private final StarStruct parent;
5858
7171 @Override
7272 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
7373 if (fieldName.equals("mem")) {
74 this.mem = (ST_Agmemdisc_s.Amp) newData;
74 this.mem = (ST_Agmemdisc_s) newData;
7575 return mem;
7676 }
7777 if (fieldName.equals("id")) {
78 this.id = (ST_Agiddisc_s.Amp) newData;
78 this.id = (ST_Agiddisc_s) newData;
7979 return id;
8080 }
8181 // if (fieldName.equals("io")) {
8585 return super.setPtr(fieldName, newData);
8686 }
8787
88 @Override
89 public __ptr__ getPtr(String fieldName) {
90 if (fieldName.equals("mem")) {
91 return mem;
92 }
93 if (fieldName.equals("id")) {
94 return id;
95 }
96 return super.getPtr(fieldName);
97 }
9888
9989 // public static List<String> DEFINITION = Arrays.asList(
10090 // "struct Agdisc_s",
8080 return super.setPtr(fieldName, newData);
8181 }
8282
83 @Override
84 public __ptr__ getPtr(String fieldName) {
85 if (fieldName.equals("mem")) {
86 return mem;
87 }
88 if (fieldName.equals("id")) {
89 return id;
90 }
91 return super.getPtr(fieldName);
92 }
9383
9484 // public static List<String> DEFINITION = Arrays.asList(
9585 // "struct Agdstate_s",
4444 */
4545 package h;
4646
47 import h.ST_Agrec_s.Amp;
47 import java.util.ArrayList;
48 import java.util.List;
49
4850 import smetana.core.HardcodedStruct;
4951 import smetana.core.OFFSET;
50 import smetana.core.UnsupportedSize_t;
51 import smetana.core.UnsupportedStarStruct;
52 import smetana.core.UnsupportedArrayOfPtr;
5253 import smetana.core.UnsupportedStructAndPtr;
54 import smetana.core.__array_of_ptr__;
5355 import smetana.core.__ptr__;
5456 import smetana.core.__struct__;
55 import smetana.core.size_t;
56 import smetana.core.amiga.StarArrayOfPtr;
5757 import smetana.core.amiga.StarStruct;
5858
5959 public class ST_Agedge_s extends UnsupportedStructAndPtr implements HardcodedStruct {
6060
61 private final ST_Agobj_s base = new ST_Agobj_s(this);
62 private final ST_dtlink_s id_link = new ST_dtlink_s(this);
63 private final ST_dtlink_s seq_link = new ST_dtlink_s(this);
64 private ST_Agnode_s node;
61 private final StarStruct parent;
62
63 public final ST_Agobj_s base = new ST_Agobj_s(this);
64 public final ST_dtlink_s id_link = new ST_dtlink_s(this);
65 public final ST_dtlink_s seq_link = new ST_dtlink_s(this);
66 public ST_Agnode_s node;
67
68 public static class ArrayOfStar extends UnsupportedArrayOfPtr implements __ptr__, __array_of_ptr__ {
69
70 private final List<ST_Agedge_s> data;
71 private final int pos;
72
73 public ArrayOfStar(int size) {
74 this.data = new ArrayList<ST_Agedge_s>();
75 this.pos = 0;
76 for (int i = 0; i < size; i++) {
77 data.add(null);
78 }
79 }
80
81 public void swap(int i, int j) {
82 ST_Agedge_s e1 = data.get(i);
83 ST_Agedge_s e2 = data.get(j);
84 data.set(i, e2);
85 data.set(j, e1);
86 }
87
88 public ArrayOfStar(List<ST_Agedge_s> data, int pos) {
89 this.data = data;
90 this.pos = pos;
91 }
92
93 public ArrayOfStar reallocJ(int newsize) {
94 while (data.size() < newsize) {
95 data.add(null);
96 }
97 return this;
98 }
99
100 @Override
101 public ArrayOfStar plus(int delta) {
102 return new ArrayOfStar(data, pos + delta);
103 }
104
105 public ST_Agedge_s get(int i) {
106 return plus(i).getPtr();
107 }
108
109
110 @Override
111 public ArrayOfStar asPtr() {
112 return this;
113 }
114
115 @Override
116 public void setPtr(__ptr__ value) {
117 this.data.set(pos, (ST_Agedge_s) value);
118 }
119
120 @Override
121 public ST_Agedge_s getPtr() {
122 return this.data.get(pos);
123 }
124
125 @Override
126 public int comparePointer(__ptr__ other) {
127 final ArrayOfStar this2 = (ArrayOfStar) other;
128 if (this.data != this2.data) {
129 throw new IllegalArgumentException();
130 }
131 return this.pos - this2.pos;
132 }
133
134 public boolean isSameThan2(ArrayOfStar other) {
135 if (this.data != other.data) {
136 throw new IllegalArgumentException();
137 }
138 return this.pos == other.pos;
139 }
140
141 }
65142
66143 @Override
67144 public void copyDataFrom(__ptr__ arg) {
68 if (arg instanceof Amp) {
69 arg = ((Amp) arg).getObject();
70 }
71145 ST_Agedge_s this2 = (ST_Agedge_s) arg;
72146 this.base.copyDataFrom((__struct__) this2.base);
73147 this.id_link.copyDataFrom((__struct__) this2.id_link);
75149 this.node = this2.node;
76150 }
77151
78 private final StarStruct parent;
79
80152 public ST_Agedge_s() {
81153 this(null);
82154 }
87159
88160 @Override
89161 public boolean isSameThan(StarStruct other) {
90 if (other instanceof Amp) {
91 Amp other2 = (Amp) other;
92 return this == other2.me;
93 }
94162 ST_Agedge_s other2 = (ST_Agedge_s) other;
95163 return this == other2;
96164 }
97165
98166 @Override
99 public StarStruct amp() {
100 return new Amp(this);
101 }
102
103 public class Amp extends UnsupportedStarStruct {
104
105 private final ST_Agedge_s me;
106
107 public Amp(ST_Agedge_s me) {
108 this.me = me;
109 }
110
111 public ST_Agedge_s getObject() {
112 return me;
113 }
114
115 @Override
116 public boolean isSameThan(StarStruct other) {
117 if (other instanceof ST_Agedge_s) {
118 ST_Agedge_s other2 = (ST_Agedge_s) other;
119 return this.me == other2;
120 }
121 Amp other2 = (Amp) other;
122 return this.me == other2.me;
123 }
124
125 @Override
126 public __ptr__ castTo(Class dest) {
127 return ST_Agedge_s.this.castTo(dest);
128 }
129
130 @Override
131 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
132 return ST_Agedge_s.this.setPtr(fieldName, newData);
133 }
134
135 @Override
136 public void copyDataFrom(__struct__ other) {
137 ST_Agedge_s.this.copyDataFrom(other);
138 }
139
140 @Override
141 public void copyDataFrom(__ptr__ other) {
142 ST_Agedge_s.this.copyDataFrom(other);
143 }
144
145 @Override
146 public __ptr__ getPtr(String fieldName) {
147 return ST_Agedge_s.this.getPtr(fieldName);
148 }
149
150 @Override
151 public __struct__ getStruct(String fieldName) {
152 return ST_Agedge_s.this.getStruct(fieldName);
153 }
154
155 @Override
156 public __ptr__ plus(int pointerMove) {
157 ST_Agedgepair_s pair = (ST_Agedgepair_s) me.parent;
158 // Order=out, in
159 if (pair.out == me && pointerMove == 1) {
160 return pair.in;
161 }
162 if (pair.in == me && pointerMove == -1) {
163 return pair.out;
164 }
165 return super.plus(pointerMove);
166 }
167
168 @Override
169 public Object addVirtualBytes(int virtualBytes) {
170 if (virtualBytes == 0) {
171 return this;
172 }
173 OFFSET offset = OFFSET.fromInt(virtualBytes);
174 if (offset.toString().equals("h.Agedge_s::seq_link")) {
175 return seq_link;
176 }
177 if (offset.toString().equals("h.Agedge_s::id_link")) {
178 return id_link;
179 }
180 System.err.println("offset1=" + offset);
181 return super.addVirtualBytes(virtualBytes);
182 }
183
184 }
185
186 @Override
187167 public Object addVirtualBytes(int virtualBytes) {
188168 if (virtualBytes == 0) {
189169 return this;
190170 }
191171 OFFSET offset = OFFSET.fromInt(virtualBytes);
192 if (offset.toString().equals("h.Agedge_s::seq_link")) {
172 if (offset.toString().equals("h.ST_Agedge_s::seq_link")) {
193173 return seq_link;
194174 }
195 if (offset.toString().equals("h.Agedge_s::id_link")) {
175 if (offset.toString().equals("h.ST_Agedge_s::id_link")) {
196176 return id_link;
197177 }
198178 System.err.println("offset2=" + offset);
200180 }
201181
202182 @Override
203 public __ptr__ plus(int pointerMove) {
183 public ST_Agedge_s plus(int pointerMove) {
204184 ST_Agedgepair_s pair = (ST_Agedgepair_s) parent;
205185 // Order=out, in
206186 if (pair.out == this && pointerMove == 1) {
209189 if (pair.in == this && pointerMove == -1) {
210190 return pair.out;
211191 }
212 return super.plus(pointerMove);
192 throw new UnsupportedOperationException();
213193 }
214194
215195 @Override
216196 public __ptr__ castTo(Class dest) {
217 if (dest == Agobj_s.class) {
197 if (dest == ST_Agobj_s.class) {
218198 return base;
219199 }
220 if (dest == Agedge_s.class) {
200 if (dest == ST_Agedge_s.class) {
221201 return this;
222202 }
223203 return super.castTo(dest);
224204 }
205
206 public ST_Agobj_s castTo_ST_Agobj_s() {
207 return base;
208 }
209
225210
226211 @Override
227212 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
228213 if (fieldName.equals("node")) {
229 if (newData instanceof ST_Agnode_s.Amp) {
230 this.node = ((ST_Agnode_s.Amp) newData).getObject();
231 } else {
232 this.node = (ST_Agnode_s) newData;
233 }
214 this.node = (ST_Agnode_s) newData;
234215 return node;
235216 }
236217 return super.setPtr(fieldName, newData);
237218 }
238219
239220 @Override
240 public __ptr__ getPtr(String fieldName) {
241 if (fieldName.equals("node")) {
242 return node;
243 }
244 return super.getPtr(fieldName);
245 }
246
247 @Override
248 public __struct__ getStruct(String fieldName) {
249 if (fieldName.equals("base")) {
250 return base;
251 }
252 return super.getStruct(fieldName);
221 public ST_Agedge_s getPtr() {
222 return this;
253223 }
254224
255225 public StarStruct from_seq_link(ST_dtlink_s from) {
256226 if (from == seq_link) {
257 return amp();
227 return this;
258228 }
259229 throw new IllegalArgumentException();
260230 }
261231
262232 public StarStruct from_id_link(ST_dtlink_s from) {
263233 if (from == id_link) {
264 return amp();
234 return this;
265235 }
266236 throw new IllegalArgumentException();
267237 }
268238
269 public static size_t sizeof_starstar_empty(final int nb) {
270 return new UnsupportedSize_t(nb) {
271 @Override
272 public Object malloc() {
273 return STStarArrayOfPointer.malloc(nb);
274 }
275
276 @Override
277 public Object realloc(Object old) {
278 if (old instanceof STStarArrayOfPointer) {
279 STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
280 old2.realloc(nb);
281 return old2;
282 }
283 // if (old instanceof StarArrayOfPtr) {
284 // StarArrayOfPtr old2 = (StarArrayOfPtr) old;
285 // old2.realloc(nb);
286 // return old2;
287 // }
288 return super.realloc(old);
289 }
290
291 @Override
292 public int getInternalNb() {
293 return nb;
294 }
295 };
296 }
297239
298240 // public interface ST_Agedge_s extends __ptr__ {
299241 // public static List<String> DEFINITION = Arrays.asList(
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
5049 import smetana.core.__struct__;
6261 this.parent = parent;
6362 }
6463
65 private final ST_Agrec_s hdr = new ST_Agrec_s(this);
66
67 private ST_splines spl;
68 private final ST_port tail_port = new ST_port(this), head_port = new ST_port(this);
69 private ST_textlabel_t label, head_label, tail_label, xlabel;
70 private int edge_type;
71 private int adjacent;
72 private boolean label_ontop;
64 public final ST_Agrec_s hdr = new ST_Agrec_s(this);
65
66 public ST_splines spl;
67 public final ST_port tail_port = new ST_port(this), head_port = new ST_port(this);
68 public ST_textlabel_t label, head_label, tail_label, xlabel;
69 public int edge_type;
70 public int adjacent;
71 public boolean label_ontop;
7372 // "unsigned char gui_state",
74 private ST_Agedge_s to_orig;
73 public ST_Agedge_s to_orig;
7574 // "void *alg",
7675 // "double factor",
77 private double dist;
76 public double dist;
7877 // "Ppolyline_t path",
79 private int showboxes;
80 private boolean conc_opp_flag;
81 private int xpenalty;
82 private int weight;
83 private int cutvalue, tree_index;
84 private int count;
85 private int minlen;
86
87 private ST_Agedge_s to_virt;
78 public int showboxes;
79 public boolean conc_opp_flag;
80 public int xpenalty;
81 public int weight;
82 public int cutvalue, tree_index;
83 public int count;
84 public int minlen;
85
86 public ST_Agedge_s to_virt;
8887
8988 @Override
9089 public void copyDataFrom(__struct__ other) {
114113 }
115114
116115 @Override
117 public StarStruct amp() {
118 return new Amp();
119 }
120
121 public class Amp extends UnsupportedStarStruct {
122 @Override
123 public __ptr__ castTo(Class dest) {
124 return ST_Agedgeinfo_t.this.castTo(dest);
125 }
126
127 }
128
129 @Override
130116 public __ptr__ castTo(Class dest) {
131 if (dest == Agrec_s.class) {
117 if (dest == ST_Agrec_s.class) {
132118 return hdr;
133119 }
134 if (dest == Agedgeinfo_t.class) {
120 if (dest == ST_Agedgeinfo_t.class) {
135121 return this;
136122 }
137123 return super.castTo(dest);
151137 }
152138
153139 @Override
154 public void setBoolean(String fieldName, boolean data) {
155 if (fieldName.equals("label_ontop")) {
156 this.label_ontop = data;
157 return;
158 }
159 super.setBoolean(fieldName, data);
160 }
161
162 @Override
163140 public void setDouble(String fieldName, double data) {
164141 if (fieldName.equals("dist")) {
165142 this.dist = data;
209186 super.setInt(fieldName, data);
210187 }
211188
212 @Override
213 public double getDouble(String fieldName) {
214 if (fieldName.equals("dist")) {
215 return this.dist;
216 }
217 return super.getDouble(fieldName);
218 }
219
220 @Override
221 public boolean getBoolean(String fieldName) {
222 if (fieldName.equals("conc_opp_flag")) {
223 return this.conc_opp_flag;
224 }
225 if (fieldName.equals("label_ontop")) {
226 return this.label_ontop;
227 }
228 return super.getBoolean(fieldName);
229 }
230
231 @Override
232 public int getInt(String fieldName) {
233 if (fieldName.equals("minlen")) {
234 return this.minlen;
235 }
236 if (fieldName.equals("weight")) {
237 return this.weight;
238 }
239 if (fieldName.equals("cutvalue")) {
240 return this.cutvalue;
241 }
242 if (fieldName.equals("tree_index")) {
243 return this.tree_index;
244 }
245 if (fieldName.equals("count")) {
246 return this.count;
247 }
248 if (fieldName.equals("xpenalty")) {
249 return this.xpenalty;
250 }
251 if (fieldName.equals("showboxes")) {
252 return this.showboxes;
253 }
254 if (fieldName.equals("edge_type")) {
255 return this.edge_type;
256 }
257 if (fieldName.equals("adjacent")) {
258 return this.adjacent;
259 }
260 return super.getInt(fieldName);
261 }
262
263 @Override
264 public __ptr__ getPtr(String fieldName) {
265 if (fieldName.equals("to_virt")) {
266 return this.to_virt;
267 }
268 if (fieldName.equals("to_orig")) {
269 return this.to_orig;
270 }
271 if (fieldName.equals("label")) {
272 return this.label;
273 }
274 if (fieldName.equals("spl")) {
275 return this.spl;
276 }
277 if (fieldName.equals("xlabel")) {
278 return this.xlabel;
279 }
280 if (fieldName.equals("head_label")) {
281 return this.head_label;
282 }
283 if (fieldName.equals("tail_label")) {
284 return this.tail_label;
285 }
286 return super.getPtr(fieldName);
287 }
288
289 @Override
290 public __struct__ getStruct(String fieldName) {
291 if (fieldName.equals("tail_port")) {
292 return this.tail_port;
293 }
294 if (fieldName.equals("head_port")) {
295 return this.head_port;
296 }
297 return super.getStruct(fieldName);
298 }
299189
300190 @Override
301191 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
302192 if (fieldName.equals("to_virt")) {
303 if (newData instanceof ST_Agedge_s.Amp) {
304 this.to_virt = ((ST_Agedge_s.Amp) newData).getObject();
305 } else {
306193 this.to_virt = (ST_Agedge_s) newData;
307 }
308194 return this.to_virt;
309195 }
310196 if (fieldName.equals("to_orig")) {
311 if (newData instanceof ST_Agedge_s.Amp) {
312 this.to_orig = ((ST_Agedge_s.Amp) newData).getObject();
313 } else {
314197 this.to_orig = (ST_Agedge_s) newData;
315 }
316198 return this.to_orig;
317199 }
318200 if (fieldName.equals("spl")) {
326208 if (fieldName.equals("head_label")) {
327209 this.head_label = (ST_textlabel_t) newData;
328210 return this.head_label;
211 }
212 if (fieldName.equals("tail_label")) {
213 this.tail_label = (ST_textlabel_t) newData;
214 return this.tail_label;
329215 }
330216 return super.setPtr(fieldName, newData);
331217 }
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
50 import smetana.core.__struct__;
5149 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_Agedgepair_s extends UnsupportedStructAndPtr implements HardcodedStruct {
6563 this.parent = parent;
6664 }
6765
68 @Override
69 public StarStruct amp() {
70 return new Amp();
71 }
72
73 public class Amp extends UnsupportedStarStruct {
74 }
75
76 @Override
77 public __struct__ getStruct(String fieldName) {
78 if (fieldName.equals("out")) {
79 return out;
80 }
81 if (fieldName.equals("in")) {
82 return in;
83 }
84 return super.getStruct(fieldName);
85 }
86
8766 // public static List<String> DEFINITION = Arrays.asList(
8867 // "struct Agedgepair_s",
8968 // "{",
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
49 import smetana.core.UnsupportedStruct;
50 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarStruct;
48 import smetana.core.UnsupportedStructAndPtr;
5249
53 public class ST_Agiddisc_s extends UnsupportedStruct {
50 public class ST_Agiddisc_s extends UnsupportedStructAndPtr {
5451
5552 public CFunction open;
5653 public CFunction map;
6057 public CFunction close;
6158 public CFunction idregister;
6259
63 @Override
64 public StarStruct amp() {
65 return new Amp();
66 }
67
68 public class Amp extends UnsupportedStarStruct {
69 @Override
70 public Object call(String fieldName, Object... args) {
71 if (fieldName.equals("open")) {
72 return open.exe(args);
73 }
74 if (fieldName.equals("map")) {
75 return map.exe(args);
76 }
77 if (fieldName.equals("idregister")) {
78 return idregister.exe(args);
79 }
80 if (fieldName.equals("print")) {
81 return print.exe(args);
82 }
83 return super.call(fieldName, args);
84 }
85
86 @Override
87 public __ptr__ getPtr(String fieldName) {
88 if (fieldName.equals("print")) {
89 return print;
90 }
91 return super.getPtr(fieldName);
92 }
93 }
9460
9561 // public static List<String> DEFINITION = Arrays.asList(
9662 // "struct Agiddisc_s",
4444 */
4545 package h;
4646 import smetana.core.CFunction;
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStruct;
49 import smetana.core.amiga.StarStruct;
5048
5149 public class ST_Agiodisc_s extends UnsupportedStruct {
5250
5452 public CFunction putstr;
5553 public CFunction flush;
5654
57 @Override
58 public StarStruct amp() {
59 return new Amp();
60 }
61
62 public class Amp extends UnsupportedStarStruct {
63 // @Override
64 // public Object call(String fieldName, Object... args) {
65 // if (fieldName.equals("open")) {
66 // return open.exe(args);
67 // }
68 // if (fieldName.equals("map")) {
69 // return map.exe(args);
70 // }
71 // if (fieldName.equals("idregister")) {
72 // return idregister.exe(args);
73 // }
74 // if (fieldName.equals("print")) {
75 // return print.exe(args);
76 // }
77 // return super.call(fieldName, args);
78 // }
79 //
80 // @Override
81 // public __ptr__ getPtr(String fieldName) {
82 // if (fieldName.equals("print")) {
83 // return print;
84 // }
85 // return super.getPtr(fieldName);
86 // }
87 }
8855
8956
9057 // public static List<String> DEFINITION = Arrays.asList(
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
49 import smetana.core.UnsupportedStruct;
50 import smetana.core.amiga.StarStruct;
48 import smetana.core.UnsupportedStructAndPtr;
5149
52 public class ST_Agmemdisc_s extends UnsupportedStruct {
50 public class ST_Agmemdisc_s extends UnsupportedStructAndPtr {
5351
5452 public CFunction open;
5553 public CFunction alloc;
5654 public CFunction resize;
5755 public CFunction free;
5856 public CFunction close;
59
60 @Override
61 public StarStruct amp() {
62 return new Amp();
63 }
64
65 public class Amp extends UnsupportedStarStruct {
66 @Override
67 public Object call(String fieldName, Object... args) {
68 if (fieldName.equals("open")) {
69 return open.exe(args);
70 }
71 if (fieldName.equals("alloc")) {
72 return alloc.exe(args);
73 }
74 return super.call(fieldName, args);
75 }
76 }
7757
7858 // public static List<String> DEFINITION = Arrays.asList(
7959 // "struct Agmemdisc_s",
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedSize_t;
48 import smetana.core.UnsupportedStarStruct;
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.UnsupportedArrayOfPtr;
51 import smetana.core.UnsupportedArrayOfStruct2;
4952 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__array_of_ptr__;
5054 import smetana.core.__ptr__;
5155 import smetana.core.__struct__;
5256 import smetana.core.size_t;
53 import smetana.core.amiga.StarArrayOfPtr;
5457 import smetana.core.amiga.StarStruct;
5558
5659 public class ST_Agnode_s extends UnsupportedStructAndPtr {
5760
58 private final ST_Agobj_s base = new ST_Agobj_s(this);
59 private ST_Agraph_s root;
60 private ST_Agsubnode_s mainsub = new ST_Agsubnode_s(this);
61 public final ST_Agobj_s base = new ST_Agobj_s(this);
62 public ST_Agraph_s root;
63 public final ST_Agsubnode_s mainsub = new ST_Agsubnode_s(this);
6164
6265 private final StarStruct parent;
66
67 public static class ArrayOfStar extends UnsupportedArrayOfPtr implements __ptr__, __array_of_ptr__ {
68
69 private final List<ST_Agnode_s> data;
70 private final int pos;
71
72 public ArrayOfStar(int size) {
73 this.data = new ArrayList<ST_Agnode_s>();
74 this.pos = 0;
75 for (int i = 0; i < size; i++) {
76 data.add(null);
77 }
78 }
79
80 public void swap(int i, int j) {
81 ST_Agnode_s e1 = data.get(i);
82 ST_Agnode_s e2 = data.get(j);
83 data.set(i, e2);
84 data.set(j, e1);
85 }
86
87 public ArrayOfStar(List<ST_Agnode_s> data, int pos) {
88 this.data = data;
89 this.pos = pos;
90 }
91
92 public ArrayOfStar reallocJ(int newsize) {
93 while (data.size() < newsize) {
94 data.add(null);
95 }
96 return this;
97 }
98
99 @Override
100 public ArrayOfStar plus(int delta) {
101 return new ArrayOfStar(data, pos + delta);
102 }
103
104 @Override
105 public ArrayOfStar asPtr() {
106 return this;
107 }
108
109 @Override
110 public void setPtr(__ptr__ value) {
111 this.data.set(pos, (ST_Agnode_s) value);
112 }
113
114 public ST_Agnode_s get(int i) {
115 return plus(i).getPtr();
116 }
117
118 @Override
119 public ST_Agnode_s getPtr() {
120 return this.data.get(pos);
121 }
122
123 @Override
124 public int comparePointer(__ptr__ other) {
125 final ArrayOfStar this2 = (ArrayOfStar) other;
126 if (this.data != this2.data) {
127 throw new IllegalArgumentException();
128 }
129 return this.pos - this2.pos;
130 }
131
132 public boolean isSameThan2(ArrayOfStar other) {
133 if (this.data != other.data) {
134 throw new IllegalArgumentException();
135 }
136 return this.pos == other.pos;
137 }
138 }
139
140 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ {
141
142 private final List<ST_Agnode_s> data;
143 private final int pos;
144
145 @Override
146 public void setStruct(__struct__ value) {
147 get(0).___(value);
148 }
149
150 @Override
151 public Array asPtr() {
152 return this;
153 }
154
155 public Array(int size) {
156 this.data = new ArrayList<ST_Agnode_s>();
157 this.pos = 0;
158 for (int i = 0; i < size; i++) {
159 data.add(new ST_Agnode_s());
160 }
161 }
162
163 public Array reallocJ(int newsize) {
164 while (data.size() < newsize) {
165 data.add(new ST_Agnode_s());
166 }
167 return this;
168 }
169
170 public Array plus(int delta) {
171 return plusJ(delta);
172 }
173
174 @Override
175 public void setPtr(__ptr__ value) {
176 this.data.set(pos, (ST_Agnode_s) value);
177 }
178
179 @Override
180 public ST_Agnode_s getPtr() {
181 return this.data.get(pos);
182 }
183
184 private Array(List<ST_Agnode_s> data, int pos) {
185 this.data = data;
186 this.pos = pos;
187 }
188
189 public ST_Agnode_s get(int i) {
190 return this.data.get(pos + i);
191 }
192
193 public Array plusJ(int i) {
194 return new Array(data, pos + i);
195 }
196
197 public int minus(Array other) {
198 if (this.data != other.data) {
199 throw new IllegalArgumentException();
200 }
201 return this.pos - other.pos;
202 }
203
204 public Array move(int delta) {
205 throw new UnsupportedOperationException(getClass().toString());
206 }
207
208 public void realloc(size_t nb) {
209 throw new UnsupportedOperationException(getClass().toString());
210 }
211
212 public int comparePointerInternal(__array_of_ptr__ other) {
213 throw new UnsupportedOperationException(getClass().toString());
214 }
215
216
217 }
63218
64219 public ST_Agnode_s() {
65220 this(null);
74229 }
75230
76231 @Override
77 public StarStruct amp() {
78 return new Amp(this);
79 }
80
81 public class Amp extends UnsupportedStarStruct {
82
83 private final ST_Agnode_s me;
84
85 public Amp(ST_Agnode_s me) {
86 this.me = me;
87 }
88
89 @Override
90 public __ptr__ castTo(Class dest) {
91 if (dest == Agobj_s.class) {
92 return base.amp();
93 }
94 if (dest == Agnode_s.class) {
95 return me;
96 }
97 return super.castTo(dest);
98 }
99
100 @Override
101 public __struct__ getStruct() {
102 return ST_Agnode_s.this.getStruct();
103 }
104
105 @Override
106 public __ptr__ getPtr(String fieldName) {
107 return ST_Agnode_s.this.getPtr(fieldName);
108 }
109
110 @Override
111 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
112 return ST_Agnode_s.this.setPtr(fieldName, newData);
113 }
114
115 public ST_Agnode_s getObject() {
116 return me;
117 }
118
119 }
120
121 @Override
122232 public __ptr__ castTo(Class dest) {
123 if (dest == Agnode_s.class) {
124 return this;
125 }
126 if (dest == Agobj_s.class) {
233 if (dest == ST_Agnode_s.class) {
234 return this;
235 }
236 if (dest == ST_Agobj_s.class) {
127237 return base;
128238 }
129239 return super.castTo(dest);
130240 }
241
242 public ST_Agobj_s castTo_ST_Agobj_s() {
243 return base;
244 }
131245
132246 @Override
133247 public boolean isSameThan(StarStruct other) {
134 if (other instanceof Amp) {
135 Amp other2 = (Amp) other;
136 return this == other2.me;
137 }
138248 ST_Agnode_s other2 = (ST_Agnode_s) other;
139249 return this == other2;
140 }
141
142 @Override
143 public __struct__ getStruct(String fieldName) {
144 if (fieldName.equals("base")) {
145 return base;
146 }
147 if (fieldName.equals("mainsub")) {
148 return mainsub;
149 }
150 return super.getStruct(fieldName);
151250 }
152251
153252 @Override
160259 }
161260
162261 @Override
163 public __ptr__ getPtr(String fieldName) {
164 if (fieldName.equals("root")) {
165 return root;
166 }
167 return super.getPtr(fieldName);
168 }
169
170 @Override
171 public __struct__ getStruct() {
262 public ST_Agnode_s getStruct() {
172263 return this;
173264 }
174265
175 public static size_t sizeof_starstar_empty(final int nb) {
176 return new UnsupportedSize_t(nb) {
177 @Override
178 public Object malloc() {
179 return STStarArrayOfPointer.malloc(nb);
180 }
181
182 @Override
183 public int getInternalNb() {
184 return nb;
185 }
186 };
187 }
188
189 public static size_t sizeof(final int nb) {
190 return new UnsupportedSize_t(nb) {
191 @Override
192 public Object malloc() {
193 return new StarArrayOfPtr(new STArray<ST_Agnode_s>(nb, 0, ST_Agnode_s.class));
194 }
195
196 @Override
197 public int getInternalNb() {
198 return nb;
199 }
200
201 @Override
202 public Object realloc(Object old) {
203 if (old instanceof STStarArrayOfPointer) {
204 STStarArrayOfPointer old2 = (STStarArrayOfPointer) old;
205 old2.realloc(nb);
206 return old2;
207 }
208 if (old instanceof StarArrayOfPtr) {
209 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
210 old2.realloc(nb);
211 return old2;
212 }
213 return super.realloc(old);
214 }
215 };
216 }
217266 // public static List<String> DEFINITION = Arrays.asList(
218267 // "struct Agnode_s",
219268 // "{",
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
5049 import smetana.core.__struct__;
6261 this.parent = parent;
6362 }
6463
65 private final ST_Agrec_s hdr = new ST_Agrec_s(this);
66
67 private ST_shape_desc shape;
68 private ST_polygon_t shape_info;
69 private final ST_pointf coord = new ST_pointf(this);
70 private double width, height;
64 public final ST_Agrec_s hdr = new ST_Agrec_s(this);
65
66 public ST_shape_desc shape;
67 public ST_polygon_t shape_info;
68 public final ST_pointf coord = new ST_pointf(this);
69 public double width, height;
7170
7271 // "boxf bb",
73 private double ht, lw, rw;
74 private ST_textlabel_t label;
75 private ST_textlabel_t xlabel;
72 public double ht, lw, rw;
73 public ST_textlabel_t label;
74 public ST_textlabel_t xlabel;
7675 // "void *alg",
77 private ST_Agedge_s alg = null;
76 public ST_Agedge_s alg = null;
7877 // "char state",
7978 // "unsigned char gui_state",
8079 // "boolean clustnode",
8180 // "unsigned char pinned",
82 private int id, heapindex, hops;
81 public int id, heapindex, hops;
8382 // "double *pos, dist",
84 private int showboxes;
85
86 private boolean has_port;
83 public int showboxes;
84
85 public boolean has_port;
8786 // "node_t* rep",
8887 // "node_t *set",
89 private int node_type, mark, onstack;
90 private int ranktype, weight_class;
91 private ST_Agnode_s next;
92 private ST_Agnode_s prev;
88 public int node_type, mark, onstack;
89 public int ranktype, weight_class;
90 public ST_Agnode_s next;
91 public ST_Agnode_s prev;
9392 // "elist in, out, flat_out, flat_in, other",
94 private final ST_elist in = new ST_elist(this);
95 private final ST_elist out = new ST_elist(this);
96 private final ST_elist flat_out = new ST_elist(this);
97 private final ST_elist flat_in = new ST_elist(this);
98 private final ST_elist other = new ST_elist(this);
99 private ST_Agraph_s.Amp clust;
100 private int UF_size;
101
102 private ST_Agnode_s UF_parent;
103
104 private ST_Agnode_s inleaf, outleaf;
105 private int rank, order;
106 private double mval;
107 private final ST_elist save_in = new ST_elist(this);
108 private final ST_elist save_out = new ST_elist(this);
109 private final ST_elist tree_in = new ST_elist(this);
110 private final ST_elist tree_out = new ST_elist(this);
111 private ST_Agedge_s par;
112 private int low, lim;
113 private int priority;
93 public final ST_elist in = new ST_elist(this);
94 public final ST_elist out = new ST_elist(this);
95 public final ST_elist flat_out = new ST_elist(this);
96 public final ST_elist flat_in = new ST_elist(this);
97 public final ST_elist other = new ST_elist(this);
98 public ST_Agraph_s clust;
99 public int UF_size;
100
101 public ST_Agnode_s UF_parent;
102
103 public ST_Agnode_s inleaf, outleaf;
104 public int rank, order;
105 public double mval;
106 public final ST_elist save_in = new ST_elist(this);
107 public final ST_elist save_out = new ST_elist(this);
108 public final ST_elist tree_in = new ST_elist(this);
109 public final ST_elist tree_out = new ST_elist(this);
110 public ST_Agedge_s par;
111 public int low, lim;
112 public int priority;
114113
115114 // "double pad[1]",
116115 // "}",
117116 // "Agnodeinfo_t");
118117
119118 @Override
120 public StarStruct amp() {
121 return new Amp();
122 }
123
124 public class Amp extends UnsupportedStarStruct {
125
126 }
127
128 @Override
129119 public __ptr__ castTo(Class dest) {
130 if (dest == Agrec_s.class) {
120 if (dest == ST_Agrec_s.class) {
131121 return hdr;
132122 }
133123 return super.castTo(dest);
163153 }
164154
165155 @Override
166 public double getDouble(String fieldName) {
167 if (fieldName.equals("width")) {
168 return this.width;
169 }
170 if (fieldName.equals("height")) {
171 return this.height;
172 }
173 if (fieldName.equals("ht")) {
174 return this.ht;
175 }
176 if (fieldName.equals("lw")) {
177 return this.lw;
178 }
179 if (fieldName.equals("rw")) {
180 return this.rw;
181 }
182 if (fieldName.equals("mval")) {
183 return this.mval;
184 }
185 return super.getDouble(fieldName);
186 }
187
188 @Override
189 public void setBoolean(String fieldName, boolean data) {
190 if (fieldName.equals("mark")) {
191 this.mark = data ? 1 : 0;
192 return;
193 }
194 if (fieldName.equals("onstack")) {
195 this.onstack = data ? 1 : 0;
196 return;
197 }
198 super.setBoolean(fieldName, data);
199 }
200
201 @Override
202156 public void setInt(String fieldName, int data) {
203157 if (fieldName.equals("showboxes")) {
204158 this.showboxes = data;
249203 return;
250204 }
251205 super.setInt(fieldName, data);
252 }
253
254 @Override
255 public int getInt(String fieldName) {
256 if (fieldName.equals("UF_size")) {
257 return this.UF_size;
258 }
259 if (fieldName.equals("ranktype")) {
260 return this.ranktype;
261 }
262 if (fieldName.equals("mark")) {
263 return this.mark;
264 }
265 if (fieldName.equals("onstack")) {
266 return this.onstack;
267 }
268 if (fieldName.equals("priority")) {
269 return this.priority;
270 }
271 if (fieldName.equals("node_type")) {
272 return this.node_type;
273 }
274 if (fieldName.equals("rank")) {
275 return this.rank;
276 }
277 if (fieldName.equals("order")) {
278 return this.order;
279 }
280 if (fieldName.equals("ranktype")) {
281 return this.ranktype;
282 }
283 if (fieldName.equals("low")) {
284 return this.low;
285 }
286 if (fieldName.equals("lim")) {
287 return this.lim;
288 }
289 if (fieldName.equals("weight_class")) {
290 return this.weight_class;
291 }
292 if (fieldName.equals("id")) {
293 return this.id;
294 }
295 if (fieldName.equals("heapindex")) {
296 return this.heapindex;
297 }
298 if (fieldName.equals("hops")) {
299 return this.hops;
300 }
301 return super.getInt(fieldName);
302 }
303
304 @Override
305 public boolean getBoolean(String fieldName) {
306 if (fieldName.equals("onstack")) {
307 return this.onstack != 0;
308 }
309 if (fieldName.equals("has_port")) {
310 return this.has_port;
311 }
312 return super.getBoolean(fieldName);
313206 }
314207
315208 @Override
327220 return label;
328221 }
329222 if (fieldName.equals("clust")) {
330 if (newData instanceof ST_Agraph_s) {
331 this.clust = (h.ST_Agraph_s.Amp) ((ST_Agraph_s) newData).amp();
332 } else {
333 this.clust = (ST_Agraph_s.Amp) newData;
334 }
223 this.clust = (ST_Agraph_s) newData;
335224 return clust;
336225 }
337226 if (fieldName.equals("next")) {
339228 return next;
340229 }
341230 if (fieldName.equals("prev")) {
342 if (newData instanceof ST_Agnode_s.Amp) {
343 this.prev = ((ST_Agnode_s.Amp) newData).getObject();
344 } else {
345231 this.prev = (ST_Agnode_s) newData;
346 }
347232 return prev;
348233 }
349234 if (fieldName.equals("UF_parent")) {
351236 return UF_parent;
352237 }
353238 if (fieldName.equals("par")) {
354 if (newData instanceof ST_Agedge_s.Amp) {
355 this.par = ((ST_Agedge_s.Amp) newData).getObject();
356 } else {
357 this.par = (ST_Agedge_s) newData;
358 }
239 this.par = (ST_Agedge_s) newData;
359240 return par;
360241 }
361242 if (fieldName.equals("alg")) {
365246 return super.setPtr(fieldName, newData);
366247 }
367248
368 @Override
369 public __ptr__ getPtr(String fieldName) {
370 if (fieldName.equals("shape")) {
371 return shape;
372 }
373 if (fieldName.equals("label")) {
374 return label;
375 }
376 if (fieldName.equals("UF_parent")) {
377 return UF_parent;
378 }
379 if (fieldName.equals("next")) {
380 return next;
381 }
382 if (fieldName.equals("prev")) {
383 return prev;
384 }
385 if (fieldName.equals("clust")) {
386 return clust;
387 }
388 if (fieldName.equals("inleaf")) {
389 return inleaf;
390 }
391 if (fieldName.equals("outleaf")) {
392 return outleaf;
393 }
394 if (fieldName.equals("alg")) {
395 return alg;
396 }
397 if (fieldName.equals("par")) {
398 return par;
399 }
400 if (fieldName.equals("xlabel")) {
401 return xlabel;
402 }
403 if (fieldName.equals("shape_info")) {
404 return shape_info;
405 }
406 return super.getPtr(fieldName);
407 }
408
409 @Override
410 public __struct__ getStruct(String fieldName) {
411 if (fieldName.equals("in")) {
412 return in;
413 }
414 if (fieldName.equals("out")) {
415 return out;
416 }
417 if (fieldName.equals("flat_out")) {
418 return flat_out;
419 }
420 if (fieldName.equals("flat_in")) {
421 return flat_in;
422 }
423 if (fieldName.equals("other")) {
424 return other;
425 }
426 if (fieldName.equals("save_in")) {
427 return save_in;
428 }
429 if (fieldName.equals("save_out")) {
430 return save_out;
431 }
432 if (fieldName.equals("tree_in")) {
433 return tree_in;
434 }
435 if (fieldName.equals("tree_out")) {
436 return tree_out;
437 }
438 if (fieldName.equals("coord")) {
439 return coord;
440 }
441 return super.getStruct(fieldName);
442 }
249
443250
444251 @Override
445252 public void setStruct(String fieldName, __struct__ newData) {
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.__struct__;
5453 public class ST_Agobj_s extends UnsupportedStructAndPtr implements WithParent, HardcodedStruct {
5554
5655 public final ST_Agtag_s tag = new ST_Agtag_s(this);
57 public ST_Agrec_s.Amp data;
56 public ST_Agrec_s data;
5857
5958 @Override
6059 public void copyDataFrom(__struct__ other) {
7574 }
7675
7776 @Override
78 public StarStruct amp() {
79 return new Amp();
80 }
81
82 public class Amp extends UnsupportedStarStruct {
83
84 @Override
85 public __struct__ getStruct(String fieldName) {
86 return ST_Agobj_s.this.getStruct(fieldName);
87 }
88
89 @Override
90 public __ptr__ getPtr(String fieldName) {
91 return ST_Agobj_s.this.getPtr(fieldName);
92 }
93
94 @Override
95 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
96 return ST_Agobj_s.this.setPtr(fieldName, newData);
97 }
98
99 @Override
100 public __ptr__ castTo(Class dest) {
101 return ST_Agobj_s.this.castTo(dest);
102 }
103 }
104
105 @Override
10677 public __ptr__ castTo(Class dest) {
107 if (dest == Agobj_s.class) {
78 if (dest == ST_Agobj_s.class) {
10879 return this;
10980 }
110 if (dest == Agraph_s.class && parent instanceof ST_Agraph_s) {
81 if (dest == ST_Agraph_s.class && parent instanceof ST_Agraph_s) {
11182 return (ST_Agraph_s) parent;
11283 }
113 if (dest == Agnode_s.class && parent instanceof ST_Agnode_s) {
84 if (dest == ST_Agnode_s.class && parent instanceof ST_Agnode_s) {
11485 return (ST_Agnode_s) parent;
11586 }
116 if (dest == Agedge_s.class && parent instanceof ST_Agedge_s) {
87 if (dest == ST_Agedge_s.class && parent instanceof ST_Agedge_s) {
11788 return (ST_Agedge_s) parent;
11889 }
11990 return super.castTo(dest);
12495 if (fieldName.equals("data")) {
12596 if (newData instanceof ST_Agnodeinfo_t) {
12697 ST_Agnodeinfo_t info = (ST_Agnodeinfo_t) newData;
127 newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
98 newData = (ST_Agrec_s) info.castTo(ST_Agrec_s.class);
12899 } else if (newData instanceof ST_Agedgeinfo_t) {
129100 ST_Agedgeinfo_t info = (ST_Agedgeinfo_t) newData;
130 newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
131 } else if (newData instanceof ST_Agedgeinfo_t.Amp) {
132 ST_Agedgeinfo_t.Amp info = (ST_Agedgeinfo_t.Amp) newData;
133 newData = (ST_Agrec_s) info.castTo(Agrec_s.class);
101 newData = (ST_Agrec_s) info.castTo(ST_Agrec_s.class);
102 } else if (newData instanceof ST_Agedgeinfo_t) {
103 ST_Agedgeinfo_t info = (ST_Agedgeinfo_t) newData;
104 newData = (ST_Agrec_s) info.castTo(ST_Agrec_s.class);
134105 }
135106 if (newData instanceof ST_Agrec_s) {
136 this.data = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
137 } else {
138 this.data = (ST_Agrec_s.Amp) newData;
107 this.data = (ST_Agrec_s) newData;
139108 }
140109 return data;
141110 }
142111 return super.setPtr(fieldName, newData);
143 }
144
145 @Override
146 public __ptr__ getPtr(String fieldName) {
147 if (fieldName.equals("data")) {
148 return data;
149 }
150 return super.getPtr(fieldName);
151 }
152
153 @Override
154 public __struct__ getStruct(String fieldName) {
155 if (fieldName.equals("tag")) {
156 return tag;
157 }
158 return super.getStruct(fieldName);
159112 }
160113
161114 @Override
4444 */
4545 package h;
4646
47 import java.util.ArrayList;
48 import java.util.List;
49
4750 import smetana.core.OFFSET;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
51 import smetana.core.UnsupportedArrayOfStruct2;
5052 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__array_of_ptr__;
5154 import smetana.core.__ptr__;
5255 import smetana.core.__struct__;
5356 import smetana.core.size_t;
54 import smetana.core.amiga.StarArrayOfPtr;
5557 import smetana.core.amiga.StarStruct;
5658
5759 public class ST_Agraph_s extends UnsupportedStructAndPtr {
8385 public StarStruct getParent() {
8486 return _parent;
8587 }
86
87 @Override
88 public __struct__ getStruct() {
88
89 @Override
90 public ST_Agraph_s getStruct() {
8991 return this;
9092 }
9193
99101 }
100102
101103 @Override
102 public StarStruct amp() {
103 return new Amp(this);
104 }
105
106 public class Amp extends UnsupportedStarStruct {
107
108 private final ST_Agraph_s me;
109
110 public Amp(ST_Agraph_s me) {
111 this.me = me;
112 }
113
114 @Override
115 public __ptr__ getPtr(String fieldName) {
116 return ST_Agraph_s.this.getPtr(fieldName);
117 }
118
119 @Override
120 public __struct__ getStruct() {
121 return ST_Agraph_s.this.getStruct();
122 }
123
124 @Override
125 public __struct__ getStruct(String fieldName) {
126 return ST_Agraph_s.this.getStruct(fieldName);
127 }
128
129 @Override
130 public boolean isSameThan(StarStruct other) {
131 if (other instanceof Amp) {
132 Amp other2 = (Amp) other;
133 return this.me == other2.me;
104 public ST_Agraph_s getPtr() {
105 return this;
106 }
107
108 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ {
109
110 private final List<ST_Agraph_s> data;
111 private final int pos;
112
113 @Override
114 public void setStruct(String fieldName, __struct__ data) {
115 getStruct().setStruct(fieldName, data);
116 }
117
118 @Override
119 public __ptr__ castTo(Class dest) {
120 return getStruct().castTo(dest);
121 }
122
123 @Override
124 public void setPtr(__ptr__ value) {
125 this.data.set(pos, (ST_Agraph_s) value);
126 }
127
128 @Override
129 public ST_Agraph_s getPtr() {
130 return this.data.get(pos);
131 }
132
133 @Override
134 public Array asPtr() {
135 return this;
136 }
137
138 @Override
139 public ST_Agraph_s getStruct() {
140 return data.get(pos);
141 }
142
143 public Array(int size) {
144 this.data = new ArrayList<ST_Agraph_s>();
145 this.pos = 0;
146 for (int i = 0; i < size; i++) {
147 data.add(null);
134148 }
135 if (other instanceof ST_Agraph_s) {
136 ST_Agraph_s other2 = (ST_Agraph_s) other;
137 return this.me == other2;
149 }
150
151 public Array reallocJ(int newsize) {
152 while (data.size() < newsize) {
153 data.add(null);
138154 }
139 return super.isSameThan(other);
140 }
141
142 @Override
143 public __ptr__ castTo(Class dest) {
144 if (dest == Agobj_s.class) {
145 return base.amp();
155 return this;
156 }
157
158 public Array plus(int delta) {
159 return plusJ(delta);
160 }
161
162 private Array(List<ST_Agraph_s> data, int pos) {
163 this.data = data;
164 this.pos = pos;
165 }
166
167 public ST_Agraph_s get(int i) {
168 return this.data.get(pos + i);
169 }
170
171 public Array plusJ(int i) {
172 return new Array(data, pos + i);
173 }
174
175 public int minus(Array other) {
176 if (this.data != other.data) {
177 throw new IllegalArgumentException();
146178 }
147 if (dest == Agraph_s.class) {
148 return ST_Agraph_s.this;
149 }
150
151 return super.castTo(dest);
152 }
153
154 @Override
155 public Object addVirtualBytes(int virtualBytes) {
156 if (virtualBytes == 0) {
157 return this;
158 }
159 OFFSET offset = OFFSET.fromInt(virtualBytes);
160 // if (offset.toString().equals("h.Agedge_s::seq_link")) {
161 // return seq_link;
162 // }
163 if (offset.toString().equals("h.Agraph_s::link")) {
164 return link;
165 }
166 System.err.println("offset176=" + offset);
167 return super.addVirtualBytes(virtualBytes);
168 }
169
170 public ST_Agraph_s getObject() {
171 return me;
179 return this.pos - other.pos;
180 }
181
182 public Array move(int delta) {
183 throw new UnsupportedOperationException(getClass().toString());
184 }
185
186 public void realloc(size_t nb) {
187 throw new UnsupportedOperationException(getClass().toString());
188 }
189
190 public int comparePointerInternal(__array_of_ptr__ other) {
191 throw new UnsupportedOperationException(getClass().toString());
172192 }
173193
174194 }
182202 // if (offset.toString().equals("h.Agedge_s::seq_link")) {
183203 // return seq_link;
184204 // }
185 if (offset.toString().equals("h.Agraph_s::link")) {
205 if (offset.toString().equals("h.ST_Agraph_s::link")) {
186206 return link;
187207 }
188208 System.err.println("offset156=" + offset);
189209 return super.addVirtualBytes(virtualBytes);
190 }
191
192 @Override
193 public __struct__ getStruct(String fieldName) {
194 if (fieldName.equals("desc")) {
195 return desc;
196 }
197 return super.getStruct(fieldName);
198210 }
199211
200212 @Override
235247 }
236248
237249 @Override
238 public __ptr__ getPtr(String fieldName) {
239 if (fieldName.equals("clos")) {
240 return clos;
241 }
242 if (fieldName.equals("root")) {
243 return root;
244 }
245 if (fieldName.equals("parent")) {
246 return parent;
247 }
248 if (fieldName.equals("n_id")) {
249 return n_id;
250 }
251 if (fieldName.equals("n_seq")) {
252 return n_seq;
253 }
254 if (fieldName.equals("e_id")) {
255 return e_id;
256 }
257 if (fieldName.equals("e_seq")) {
258 return e_seq;
259 }
260 if (fieldName.equals("g_dict")) {
261 return g_dict;
262 }
263 return super.getPtr(fieldName);
264 }
265
266 @Override
267250 public __ptr__ castTo(Class dest) {
268 if (dest == Agobj_s.class) {
251 if (dest == ST_Agobj_s.class) {
269252 return base;
270253 }
271 if (dest == Agraph_s.class) {
254 if (dest == ST_Agraph_s.class) {
272255 return this;
273256 }
274257 return super.castTo(dest);
258 }
259
260 public ST_Agobj_s castTo_ST_Agobj_s() {
261 return base;
275262 }
276263
277264 @Override
282269
283270 public StarStruct from_link(ST_dtlink_s from) {
284271 if (from == link) {
285 return amp();
272 return this;
286273 }
287274 throw new IllegalArgumentException();
288275 }
289
290
291 public static size_t sizeof(final int nb) {
292 return new UnsupportedSize_t(nb) {
293 @Override
294 public Object malloc() {
295 return new StarArrayOfPtr(new STArray<ST_Agraph_s>(nb, 0, ST_Agraph_s.class));
296 }
297
298 @Override
299 public int getInternalNb() {
300 return nb;
301 }
302
303 @Override
304 public Object realloc(Object old) {
305 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
306 old2.realloc(nb);
307 return old2;
308 }
309 };
310 }
311
312276
313277 //
314278 // public interface ST_Agraph_s extends __ptr__ {
4747 import smetana.core.CFunction;
4848 import smetana.core.HardcodedStruct;
4949 import smetana.core.UnsupportedArrayOfStruct;
50 import smetana.core.UnsupportedStarStruct;
5150 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_struct__;
5351 import smetana.core.__ptr__;
5452 import smetana.core.__struct__;
55 import smetana.core.amiga.StarArrayOfPtr;
5653 import smetana.core.amiga.StarStruct;
5754
5855 public class ST_Agraphinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct {
5956
60 private final ST_Agrec_s hdr = new ST_Agrec_s(this);
57 public final ST_Agrec_s hdr = new ST_Agrec_s(this);
6158 // /* to generate code */
62 private ST_layout_t drawing;
63 private ST_textlabel_t label; /* if the cluster has a title */
64 private final ST_boxf bb = new ST_boxf(this); /* bounding box */
59 public ST_layout_t drawing;
60 public ST_textlabel_t label; /* if the cluster has a title */
61 public final ST_boxf bb = new ST_boxf(this); /* bounding box */
6562 // pointf border[4]; /* sizes of margins for graph labels */
66 private final ST_pointf border[] = new ST_pointf[] { new ST_pointf(), new ST_pointf(), new ST_pointf(),
63 public final ST_pointf border[] = new ST_pointf[] { new ST_pointf(), new ST_pointf(), new ST_pointf(),
6764 new ST_pointf() };
6865 // unsigned char gui_state; /* Graph state for GUI ops */
69 private int has_labels;
66 public int has_labels;
7067 // boolean has_images;
71 private int charset; /* input character set */
72 private int rankdir;
73 private double ht1, ht2; /* below and above extremal ranks */
74 private int flags;
68 public int charset; /* input character set */
69 public int rankdir;
70 public double ht1, ht2; /* below and above extremal ranks */
71 public int flags;
7572 // void *alg;
76 private ST_GVC_s gvc; /* context for "globals" over multiple graphs */
77 private CFunction cleanup;
73 public ST_GVC_s gvc; /* context for "globals" over multiple graphs */
74 public CFunction cleanup;
7875 // void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */
7976 //
8077 //
8784 //
8885 //
8986 // /* to have subgraphs */
90 private int n_cluster;
87 public int n_cluster;
9188 // graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */
92 private StarArrayOfPtr clust;
93 private ST_Agraph_s dotroot;
94 private ST_Agnode_s nlist;
95 private StarArrayOfPtr rank;
96 private ST_Agraph_s parent; /* containing cluster (not parent subgraph) */
89 public ST_Agraph_s.Array clust;
90 public ST_Agraph_s dotroot;
91 public ST_Agnode_s nlist;
92 public ST_rank_t.Array2 rank;
93 public ST_Agraph_s parent; /* containing cluster (not parent subgraph) */
9794 // int level; /* cluster nesting level (not node level!) */
9895 // node_t *minrep, *maxrep; /* set leaders for min and max rank */
9996 //
10097 // /* fast graph node list */
101 private final ST_nlist_t comp = new ST_nlist_t(this);
98 public final ST_nlist_t comp = new ST_nlist_t(this);
10299 // /* connected components */
103 private ST_Agnode_s minset, maxset; /* set leaders */
104 private int n_nodes;
100 public ST_Agnode_s minset, maxset; /* set leaders */
101 public int n_nodes;
105102 // /* includes virtual */
106 private int minrank, maxrank;
103 public int minrank, maxrank;
107104 //
108105 // /* various flags */
109 private int has_flat_edges;
106 public int has_flat_edges;
110107 // boolean has_sourcerank;
111108 // boolean has_sinkrank;
112 private int showboxes;
113 private int fontnames; /* to override mangling in SVG */
114 //
115 private int nodesep, ranksep;
116 private ST_Agnode_s ln, rn; /* left, right nodes of bounding box */
109 public int showboxes;
110 public int fontnames; /* to override mangling in SVG */
111 //
112 public int nodesep, ranksep;
113 public ST_Agnode_s ln, rn; /* left, right nodes of bounding box */
117114 //
118115 // /* for clusters */
119116 // node_t *leader, **rankleader;
120 private ST_Agnode_s leader;
121 private STStarArrayOfPointer rankleader;
122 private boolean expanded;
123 private int installed;
124 // char set_type;
125 private int label_pos;
126 private int exact_ranksep;
117 public ST_Agnode_s leader;
118 public ST_Agnode_s.Array rankleader;
119 public boolean expanded;
120 public int installed;
121 public int set_type;
122 public int label_pos;
123 public int exact_ranksep;
127124
128125 private final StarStruct parent_;
129126
135132 this.parent_ = parent;
136133 }
137134
138 @Override
139 public StarStruct amp() {
140 return new Amp();
141 }
142
143 public class Amp extends UnsupportedStarStruct {
144 }
145
146135 class ArrayOfFour extends UnsupportedArrayOfStruct {
147136
148137 final private int pos;
151140 this.pos = pos;
152141 }
153142
154 @Override
155 public __array_of_struct__ plus(int delta) {
143 public ArrayOfFour plus(int delta) {
156144 return new ArrayOfFour(pos + delta);
157145 }
158146
166154 border[pos].copyDataFrom(value);
167155 }
168156
169 @Override
170 public double getDouble(String fieldName) {
171 return getStruct().getDouble(fieldName);
172 }
173
174 }
175
176 @Override
177 public __array_of_struct__ getArrayOfStruct(String fieldName) {
178 if (fieldName.equals("border")) {
179 return new ArrayOfFour(0);
180 }
181 return super.getArrayOfStruct(fieldName);
182 }
183
184 @Override
185 public __struct__ getStruct(String fieldName) {
186 if (fieldName.equals("comp")) {
187 return this.comp;
188 }
189 if (fieldName.equals("bb")) {
190 return this.bb;
191 }
192 return super.getStruct(fieldName);
193157 }
194158
195159 @Override
196160 public __ptr__ castTo(Class dest) {
197 if (dest == Agrec_s.class) {
198 return hdr.amp();
161 if (dest == ST_Agrec_s.class) {
162 return hdr;
199163 }
200164 return super.castTo(dest);
201165 }
215179 return dotroot;
216180 }
217181 if (fieldName.equals("parent")) {
218 if (newData instanceof ST_Agraph_s.Amp) {
219 this.parent = ((ST_Agraph_s.Amp) newData).getObject();
220 } else {
221 this.parent = (ST_Agraph_s) newData;
222 }
182 this.parent = (ST_Agraph_s) newData;
223183 return parent;
224184 }
225185 if (fieldName.equals("clust")) {
226 this.clust = (StarArrayOfPtr) newData;
186 this.clust = (ST_Agraph_s.Array) newData;
227187 return clust;
228188 }
229189 if (fieldName.equals("label")) {
239199 return minset;
240200 }
241201 if (fieldName.equals("nlist")) {
242 if (newData instanceof ST_Agnode_s.Amp) {
243 this.nlist = ((ST_Agnode_s.Amp) newData).getObject();
244 } else {
245 this.nlist = (ST_Agnode_s) newData;
246 }
202 this.nlist = (ST_Agnode_s) newData;
247203 return nlist;
248204 }
249205 if (fieldName.equals("leader")) {
251207 return leader;
252208 }
253209 if (fieldName.equals("rankleader")) {
254 this.rankleader = (STStarArrayOfPointer) newData;
210 this.rankleader = (ST_Agnode_s.Array) newData;
255211 return rankleader;
256212 }
257213 if (fieldName.equals("rank")) {
258 this.rank = (StarArrayOfPtr) newData;
214 this.rank = (ST_rank_t.Array2) newData;
259215 return rank;
260216 }
261217 if (fieldName.equals("ln")) {
267223 return rn;
268224 }
269225 return super.setPtr(fieldName, newData);
270 }
271
272 @Override
273 public __ptr__ getPtr(String fieldName) {
274 if (fieldName.equals("drawing")) {
275 return drawing;
276 }
277 if (fieldName.equals("gvc")) {
278 return gvc;
279 }
280 if (fieldName.equals("parent")) {
281 return parent;
282 }
283 if (fieldName.equals("dotroot")) {
284 return dotroot;
285 }
286 if (fieldName.equals("clust")) {
287 return clust;
288 }
289 if (fieldName.equals("label")) {
290 return label;
291 }
292 if (fieldName.equals("maxset")) {
293 return maxset;
294 }
295 if (fieldName.equals("minset")) {
296 return minset;
297 }
298 if (fieldName.equals("nlist")) {
299 return nlist;
300 }
301 if (fieldName.equals("leader")) {
302 return leader;
303 }
304 if (fieldName.equals("rankleader")) {
305 return rankleader;
306 }
307 if (fieldName.equals("rank")) {
308 return rank;
309 }
310 if (fieldName.equals("ln")) {
311 return ln;
312 }
313 if (fieldName.equals("rn")) {
314 return rn;
315 }
316 if (fieldName.equals("cleanup")) {
317 return cleanup;
318 }
319 return super.getPtr(fieldName);
320 }
321
322 @Override
323 public void setBoolean(String fieldName, boolean data) {
324 if (fieldName.equals("expanded")) {
325 this.expanded = data;
326 return;
327 }
328 if (fieldName.equals("has_flat_edges")) {
329 this.has_flat_edges = data ? 1 : 0;
330 return;
331 }
332 super.setBoolean(fieldName, data);
333226 }
334227
335228 @Override
393286 super.setInt(fieldName, data);
394287 }
395288
396 @Override
397 public boolean getBoolean(String fieldName) {
398 if (fieldName.equals("expanded")) {
399 return expanded;
400 }
401 return super.getBoolean(fieldName);
402 }
403
404 @Override
405 public int getInt(String fieldName) {
406 if (fieldName.equals("flags")) {
407 return flags;
408 }
409 if (fieldName.equals("charset")) {
410 return charset;
411 }
412 if (fieldName.equals("rankdir")) {
413 return rankdir;
414 }
415 if (fieldName.equals("has_labels")) {
416 return has_labels;
417 }
418 if (fieldName.equals("n_cluster")) {
419 return n_cluster;
420 }
421 if (fieldName.equals("label_pos")) {
422 return label_pos;
423 }
424 if (fieldName.equals("n_nodes")) {
425 return n_nodes;
426 }
427 if (fieldName.equals("maxrank")) {
428 return maxrank;
429 }
430 if (fieldName.equals("minrank")) {
431 return minrank;
432 }
433 if (fieldName.equals("has_flat_edges")) {
434 return has_flat_edges;
435 }
436 if (fieldName.equals("installed")) {
437 return installed;
438 }
439 if (fieldName.equals("exact_ranksep")) {
440 return exact_ranksep;
441 }
442 if (fieldName.equals("nodesep")) {
443 return nodesep;
444 }
445 if (fieldName.equals("ranksep")) {
446 return ranksep;
447 }
448 return super.getInt(fieldName);
449 }
450
451 @Override
452 public double getDouble(String fieldName) {
453 if (fieldName.equals("ht1")) {
454 return ht1;
455 }
456 if (fieldName.equals("ht2")) {
457 return ht2;
458 }
459 return super.getDouble(fieldName);
460 }
461289
462290 @Override
463291 public void setDouble(String fieldName, double data) {
4545 package h;
4646
4747 import smetana.core.CString;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.__struct__;
5453 public class ST_Agrec_s extends UnsupportedStructAndPtr implements WithParent {
5554
5655 public CString name;
57 public ST_Agrec_s.Amp next;
56 public ST_Agrec_s next;
5857
5958 private final StarStruct parent;
6059
8281 }
8382
8483 @Override
85 public StarStruct amp() {
86 return new Amp(this);
87 }
88
89 public class Amp extends UnsupportedStarStruct {
90
91 private final ST_Agrec_s me;
92
93 public Amp(ST_Agrec_s me) {
94 this.me = me;
95 }
96
97 @Override
98 public boolean isSameThan(StarStruct other) {
99 Amp other2 = (Amp) other;
100 return this.me == other2.me;
101 }
102
103 @Override
104 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
105 return ST_Agrec_s.this.setPtr(fieldName, newData);
106 }
107
108 @Override
109 public __ptr__ getPtr(String fieldName) {
110 return ST_Agrec_s.this.getPtr(fieldName);
111 }
112
113 @Override
114 public __ptr__ castTo(Class dest) {
115 return ST_Agrec_s.this.castTo(dest);
116 }
117
118 @Override
119 public CString getCString(String fieldName) {
120 return ST_Agrec_s.this.getCString(fieldName);
121 }
122
123 @Override
124 public void copyDataFrom(__struct__ other) {
125 ST_Agrec_s.this.copyDataFrom(other);
126 }
127 }
128
129 @Override
130 public CString getCString(String fieldName) {
131 if (fieldName.equals("name")) {
132 return name;
133 }
134 return super.getCString(fieldName);
84 public boolean isSameThan(StarStruct other) {
85 ST_Agrec_s other2 = (ST_Agrec_s) other;
86 return this == other2;
13587 }
13688
13789 @Override
13890 public __ptr__ castTo(Class dest) {
139 if (dest == Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) {
91 if (dest == ST_Agdatadict_s.class && getParent() instanceof ST_Agdatadict_s) {
14092 return (ST_Agdatadict_s) getParent();
14193 }
142 if (dest == Agattr_s.class && getParent() instanceof ST_Agattr_s) {
94 if (dest == ST_Agattr_s.class && getParent() instanceof ST_Agattr_s) {
14395 return (ST_Agattr_s) getParent();
14496 }
145 if (dest == Agraphinfo_t.class && getParent() instanceof ST_Agraphinfo_t) {
97 if (dest == ST_Agraphinfo_t.class && getParent() instanceof ST_Agraphinfo_t) {
14698 return (ST_Agraphinfo_t) getParent();
14799 }
148 if (dest == Agnodeinfo_t.class && getParent() instanceof ST_Agnodeinfo_t) {
100 if (dest == ST_Agnodeinfo_t.class && getParent() instanceof ST_Agnodeinfo_t) {
149101 return (ST_Agnodeinfo_t) getParent();
150102 }
151 if (dest == Agedgeinfo_t.class && getParent() instanceof ST_Agedgeinfo_t) {
103 if (dest == ST_Agedgeinfo_t.class && getParent() instanceof ST_Agedgeinfo_t) {
152104 return (ST_Agedgeinfo_t) getParent();
153105 }
154106 System.err.println("dest=" + dest);
155107 System.err.println("getParent=" + getParent().getClass());
156108 return super.castTo(dest);
109 }
110
111 public ST_Agnodeinfo_t castTo_ST_Agnodeinfo_t() {
112 if (getParent() instanceof ST_Agnodeinfo_t) {
113 return (ST_Agnodeinfo_t) getParent();
114 }
115 throw new UnsupportedOperationException();
116 }
117
118
119
120 public ST_Agraphinfo_t castTo_ST_Agraphinfo_t() {
121 if (getParent() instanceof ST_Agraphinfo_t) {
122 return (ST_Agraphinfo_t) getParent();
123 }
124 throw new UnsupportedOperationException();
157125 }
158126
159127 @Override
164132 }
165133 if (fieldName.equals("next")) {
166134 if (newData instanceof ST_Agrec_s) {
167 this.next = (ST_Agrec_s.Amp) ((ST_Agrec_s) newData).amp();
168 } else {
169 this.next = (ST_Agrec_s.Amp) newData;
135 this.next = (ST_Agrec_s) newData;
170136 }
171137 return next;
172138 }
173139 return super.setPtr(fieldName, newData);
174 }
175
176 @Override
177 public __ptr__ getPtr(String fieldName) {
178 if (fieldName.equals("next")) {
179 return next;
180 }
181 return super.getPtr(fieldName);
182140 }
183141
184142 // public static List<String> DEFINITION = Arrays.asList(
4444 */
4545 package h;
4646
47 import h.ST_splineInfo.Amp;
4847 import smetana.core.HardcodedStruct;
4948 import smetana.core.OFFSET;
50 import smetana.core.UnsupportedStarStruct;
5149 import smetana.core.UnsupportedStructAndPtr;
5250 import smetana.core.__ptr__;
5351 import smetana.core.amiga.StarStruct;
5654
5755 public final ST_dtlink_s seq_link = new ST_dtlink_s(this);
5856 public final ST_dtlink_s id_link = new ST_dtlink_s(this);
59 public Agnode_s node;
60 public ST_dtlink_s.Amp in_id;
61 public ST_dtlink_s.Amp out_id;
62 public ST_dtlink_s.Amp in_seq;
63 public ST_dtlink_s.Amp out_seq;
57 public ST_Agnode_s node;
58 public ST_dtlink_s in_id;
59 public ST_dtlink_s out_id;
60 public ST_dtlink_s in_seq;
61 public ST_dtlink_s out_seq;
6462
6563 public ST_Agsubnode_s() {
6664 this(null);
6967 public ST_Agsubnode_s(StarStruct parent) {
7068 }
7169
72 public StarStruct from_id_link(ST_dtlink_s from) {
70 public ST_Agsubnode_s from_id_link(ST_dtlink_s from) {
7371 if (from == id_link) {
74 return amp();
72 return this;
7573 }
7674 throw new IllegalArgumentException();
7775 }
7876
79 public StarStruct from_seq_link(ST_dtlink_s from) {
77 public ST_Agsubnode_s from_seq_link(ST_dtlink_s from) {
8078 if (from == seq_link) {
81 return amp();
79 return this;
8280 }
8381 throw new IllegalArgumentException();
8482 }
8583
86 public class Amp extends UnsupportedStarStruct {
84 @Override
85 public boolean isSameThan(StarStruct other) {
86 return this == (ST_Agsubnode_s) other;
87 }
8788
88 private final ST_Agsubnode_s me;
89
90 public Amp(ST_Agsubnode_s me) {
91 this.me = me;
92 }
93
94 @Override
95 public boolean isSameThan(StarStruct other) {
96 Amp other2 = (Amp) other;
97 return this.me == other2.me;
98 }
99
100 @Override
101 public Object addVirtualBytes(int virtualBytes) {
102 if (virtualBytes == 0) {
103 return this;
104 }
105 final OFFSET offset = OFFSET.fromInt(virtualBytes);
106 if (offset.toString().equals("h.Agsubnode_s::id_link")) {
107 return id_link.amp();
108 }
109 if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
110 return seq_link.amp();
111 }
112 System.err.println("virtualBytes=" + virtualBytes);
113 System.err.println("offset=" + offset);
114 return super.addVirtualBytes(virtualBytes);
115 }
116
117 @Override
118 public __ptr__ castTo(Class dest) {
119 if (dest == Agsubnode_s.class) {
120 return this;
121 }
122 System.err.println("dest=" + dest);
123 return super.castTo(dest);
124 }
125
126 @Override
127 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
128 return ST_Agsubnode_s.this.setPtr(fieldName, newData);
129 }
130
131 @Override
132 public __ptr__ getPtr(String fieldName) {
133 return ST_Agsubnode_s.this.getPtr(fieldName);
134 }
135 }
136
13789 @Override
13890 public Object addVirtualBytes(int virtualBytes) {
13991 if (virtualBytes == 0) {
14092 return this;
14193 }
14294 final OFFSET offset = OFFSET.fromInt(virtualBytes);
143 if (offset.toString().equals("h.Agsubnode_s::id_link")) {
144 return id_link.amp();
95 if (offset.toString().equals("h.ST_Agsubnode_s::id_link")) {
96 return id_link;
14597 }
146 if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
147 return seq_link.amp();
98 if (offset.toString().equals("h.ST_Agsubnode_s::seq_link")) {
99 return seq_link;
148100 }
149101 System.err.println("virtualBytes=" + virtualBytes);
150102 System.err.println("offset=" + offset);
151103 return super.addVirtualBytes(virtualBytes);
152104 }
153105
154
155 @Override
156 public StarStruct amp() {
157 return new Amp(this);
158 }
159
160106 @Override
161107 public __ptr__ castTo(Class dest) {
162 if (dest == Agsubnode_s.class) {
163 return this;
108 if (dest == ST_Agsubnode_s.class) {
109 return ST_Agsubnode_s.this;
164110 }
165111 System.err.println("dest=" + dest);
166112 return super.castTo(dest);
169115 @Override
170116 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
171117 if (fieldName.equals("node")) {
172 this.node = (Agnode_s) newData;
118 this.node = (ST_Agnode_s) newData;
173119 return node;
174120 }
175121 if (fieldName.equals("in_id")) {
176 this.in_id = (h.ST_dtlink_s.Amp) newData;
122 this.in_id = (h.ST_dtlink_s) newData;
177123 return in_id;
178124 }
179125 if (fieldName.equals("out_seq")) {
180 this.out_seq = (h.ST_dtlink_s.Amp) newData;
126 this.out_seq = (h.ST_dtlink_s) newData;
181127 return out_seq;
182128 }
183129 if (fieldName.equals("out_id")) {
184 this.out_id = (h.ST_dtlink_s.Amp) newData;
130 this.out_id = (h.ST_dtlink_s) newData;
185131 return out_id;
186132 }
187133 if (fieldName.equals("seq_link")) {
189135 return seq_link;
190136 }
191137 if (fieldName.equals("in_seq")) {
192 this.in_seq = (h.ST_dtlink_s.Amp) newData;
138 this.in_seq = (h.ST_dtlink_s) newData;
193139 return in_seq;
194140 }
195141 return super.setPtr(fieldName, newData);
196142 }
197143
198 @Override
199 public __ptr__ getPtr(String fieldName) {
200 if (fieldName.equals("node")) {
201 return node;
202 }
203 if (fieldName.equals("in_id")) {
204 return in_id;
205 }
206 if (fieldName.equals("out_seq")) {
207 return out_seq;
208 }
209 if (fieldName.equals("out_id")) {
210 return out_id;
211 }
212 if (fieldName.equals("in_seq")) {
213 return in_seq;
214 }
215 return super.getPtr(fieldName);
216 }
217
218144
219145 // public interface ST_Agsubnode_s extends __ptr__ {
220146 // public static List<String> DEFINITION = Arrays.asList(
4747 import smetana.core.CString;
4848 import smetana.core.HardcodedStruct;
4949 import smetana.core.OFFSET;
50 import smetana.core.UnsupportedStarStruct;
5150 import smetana.core.UnsupportedStructAndPtr;
5251 import smetana.core.__ptr__;
5352 import smetana.core.amiga.StarStruct;
7473 return this;
7574 }
7675 final OFFSET offset = OFFSET.fromInt(virtualBytes);
77 if (offset.toString().equals("h.Agsym_s::name")) {
76 if (offset.toString().equals("h.ST_Agsym_s::name")) {
7877 return name;
7978 }
80 if (offset.toString().equals("h.Agsym_s::link")) {
79 if (offset.toString().equals("h.ST_Agsym_s::link")) {
8180 return link;
8281 }
8382 System.err.println("virtualBytes=" + virtualBytes);
8887 public ST_Agsym_s() {
8988 this(null);
9089 }
91
92 public class Amp extends UnsupportedStarStruct {
93
94 private final ST_Agsym_s me;
95
96 public Amp(ST_Agsym_s me) {
97 this.me = me;
98 }
99
100 @Override
101 public boolean isSameThan(StarStruct other) {
102 Amp other2 = (Amp) other;
103 return this.me == other2.me;
104 }
105
106 @Override
107 public Object addVirtualBytes(int virtualBytes) {
108 if (virtualBytes == 0) {
109 return this;
110 }
111 final OFFSET offset = OFFSET.fromInt(virtualBytes);
112 if (offset.toString().equals("h.Agsym_s::name")) {
113 return name;
114 }
115 System.err.println("virtualBytes=" + virtualBytes);
116 System.err.println("offset=" + offset);
117 return super.addVirtualBytes(virtualBytes);
118 }
119
120 @Override
121 public int getInt(String fieldName) {
122 return ST_Agsym_s.this.getInt(fieldName);
123 }
124
125 @Override
126 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
127 return ST_Agsym_s.this.setPtr(fieldName, newData);
128 }
129
130 @Override
131 public CString getCString(String fieldName) {
132 return ST_Agsym_s.this.getCString(fieldName);
133 }
90
91 @Override
92 public boolean isSameThan(StarStruct other) {
93 ST_Agsym_s other2 = (ST_Agsym_s) other;
94 return this == other2;
13495 }
13596
136 @Override
137 public StarStruct amp() {
138 return new Amp(this);
139 }
14097
14198 @Override
14299 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
164121 super.setInt(fieldName, data);
165122 }
166123
167 @Override
168 public int getInt(String fieldName) {
169 if (fieldName.equals("kind")) {
170 return kind;
171 }
172 if (fieldName.equals("id")) {
173 return id;
174 }
175 return super.getInt(fieldName);
176 }
177
178 @Override
179 public CString getCString(String fieldName) {
180 if (fieldName.equals("defval")) {
181 return defval;
182 }
183 if (fieldName.equals("name")) {
184 return name;
185 }
186 return super.getCString(fieldName);
187 }
188
189124 public StarStruct from_link(ST_dtlink_s from) {
190125 if (from == link) {
191 return amp();
126 return this;
192127 }
193128 throw new IllegalArgumentException();
194129 }
6969
7070 @Override
7171 public Class getRealClass() {
72 return Agtag_s.class;
72 return ST_Agtag_s.class;
7373 }
7474
7575 @Override
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedStructAndPtr;
48 import smetana.core.__struct__;
49 import smetana.core.amiga.StarStruct;
50
51 public class ST_BestPos_t extends UnsupportedStructAndPtr {
52
53 private final StarStruct parent;
54
55 public int n;
56 public double area;
57 public final ST_pointf pos = new ST_pointf(this);
58
59 public ST_BestPos_t() {
60 this(null);
61 }
62
63 public ST_BestPos_t(StarStruct parent) {
64 this.parent = parent;
65 }
66
67 @Override
68 public __struct__ copy() {
69 final ST_BestPos_t result = new ST_BestPos_t();
70 result.n = this.n;
71 result.area = this.area;
72 result.pos.copyDataFrom((__struct__) this.pos);
73 return result;
74 }
75
76 public void ___(__struct__ other) {
77 ST_BestPos_t this2 = (ST_BestPos_t) other;
78 this.n = this2.n;
79 this.area = this2.area;
80 this.pos.copyDataFrom((__struct__) this2.pos);
81 }
82
83
84 @Override
85 public void setStruct(String fieldName, __struct__ newData) {
86 if (fieldName.equals("pos")) {
87 pos.copyDataFrom(newData);
88 return;
89 }
90 super.setStruct(fieldName, newData);
91 }
92
93 @Override
94 public void setInt(String fieldName, int data) {
95 if (fieldName.equals("n")) {
96 this.n = data;
97 return;
98 }
99 super.setInt(fieldName, data);
100 }
101
102 @Override
103 public void setDouble(String fieldName, double data) {
104 if (fieldName.equals("area")) {
105 this.area = data;
106 return;
107 }
108 super.setDouble(fieldName, data);
109 }
110
111 // typedef struct best_p_s {
112 // int n;
113 // double area;
114 // pointf pos;
115 // } BestPos_t;
116 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__ptr__;
50 import smetana.core.__struct__;
51
52 public class ST_Branch_t extends UnsupportedStructAndPtr implements HardcodedStruct {
53
54 // Warning : could be a "ST_Leaf_t" from C Version
55 public final ST_Rect_t rect = new ST_Rect_t(this);
56 public ST_Node_t___or_object_t child; // "data" : ST_object_t
57
58 public ST_Branch_t() {
59 }
60
61 @Override
62 public void copyDataFrom(__struct__ other) {
63 ST_Branch_t this2 = (ST_Branch_t) other;
64 this.rect.copyDataFrom((__struct__) this2.rect);
65 this.child = this2.child;
66 }
67
68 @Override
69 public __ptr__ castTo(Class dest) {
70 if (dest == Branch_t.class) {
71 return ST_Branch_t.this;
72 }
73 if (dest == ST_Rect_t.class) {
74 return rect;
75 }
76 return super.castTo(dest);
77 }
78
79 public __struct__ getStruct() {
80 return this;
81 }
82
83 @Override
84 public void ___(__struct__ other) {
85 this.copyDataFrom(other);
86 }
87
88 @Override
89 public void setStruct(String fieldName, __struct__ newData) {
90 if (fieldName.equals("rect")) {
91 this.rect.copyDataFrom(newData);
92 return;
93 }
94 super.setStruct(fieldName, newData);
95 }
96
97 @Override
98 public ST_Node_t___or_object_t setPtr(String fieldName, __ptr__ newData) {
99 if (fieldName.equals("child")) {
100 this.child = (ST_Node_t___or_object_t) newData;
101 return this.child;
102 }
103 throw new UnsupportedOperationException();
104 }
105
106 // typedef struct Branch {
107 // Rect_t rect;
108 // struct Node *child;
109 // } Branch_t;
110 }
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.amiga.StarStruct;
5049
6059 this.parent = parent;
6160 }
6261
63 @Override
64 public StarStruct amp() {
65 return new Amp();
66 }
67
68 public class Amp extends UnsupportedStarStruct {
69
70 }
71
7262 }
4646
4747 import smetana.core.CFunction;
4848 import smetana.core.HardcodedStruct;
49 import smetana.core.UnsupportedStarStruct;
5049 import smetana.core.UnsupportedStructAndPtr;
5150 import smetana.core.__ptr__;
5251 import smetana.core.amiga.StarStruct;
5554
5655 // "typedef struct GVCOMMON_s",
5756 // "{",
58 private __ptr__ info;
57 public __ptr__ info;
5958 // "char *cmdname",
6059 // "int verbose",
6160 // "boolean config, auto_outfile_names",
6261 // "void (*errorfn) (const char *fmt, ...)",
63 private CFunction errorfn;
62 public CFunction errorfn;
6463 // "const char **show_boxes",
6564 // "const char **lib",
6665 // "int viewNum",
6766 // "const lt_symlist_t *builtins",
68 private __ptr__ builtins;
69 private boolean demand_loading;
67 public __ptr__ builtins;
68 public boolean demand_loading;
7069 // "}",
7170 // "GVCOMMON_t");
7271
7877
7978 public ST_GVCOMMON_t(StarStruct parent) {
8079 this.parent = parent;
81 }
82
83 @Override
84 public StarStruct amp() {
85 return new Amp();
86 }
87
88 public class Amp extends UnsupportedStarStruct {
8980 }
9081
9182 @Override
10596 return super.setPtr(fieldName, newData);
10697 }
10798
108 @Override
109 public __ptr__ getPtr(String fieldName) {
110 if (fieldName.equals("builtins") && builtins == null) {
111 return builtins;
112 }
113 return super.getPtr(fieldName);
114 }
115
116 @Override
117 public void setBoolean(String fieldName, boolean data) {
118 if (fieldName.equals("demand_loading")) {
119 this.demand_loading = data;
120 return;
121 }
122 super.setBoolean(fieldName, data);
123 }
124
12599 }
126100
127101 // typedef struct GVCOMMON_s {
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
50 import smetana.core.__struct__;
5149 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_GVC_s extends UnsupportedStructAndPtr implements HardcodedStruct {
5452
5553 // "struct GVC_s",
5654 // "{",
57 private final ST_GVCOMMON_t common = new ST_GVCOMMON_t(this);
55 public final ST_GVCOMMON_t common = new ST_GVCOMMON_t(this);
5856 // "char *config_path",
59 private int config_found;
57 public int config_found;
6058 // "char **input_filenames",
6159 // "GVG_t *gvgs",
6260 // "GVG_t *gvg",
7068 // "GVJ_t *jobs",
7169 // "GVJ_t *job",
7270 // "graph_t *g",
73 private final ST_gvplugin_active_layout_t layout = new ST_gvplugin_active_layout_t();
71 public final ST_gvplugin_active_layout_t layout = new ST_gvplugin_active_layout_t();
7472 // "char *graphname",
7573 // "GVJ_t *active_jobs",
7674 // "char *pagedir",
102100
103101 public ST_GVC_s(StarStruct parent) {
104102 this.parent = parent;
105 }
106
107 @Override
108 public StarStruct amp() {
109 return new Amp();
110 }
111
112 public class Amp extends UnsupportedStarStruct {
113 }
114
115 @Override
116 public __struct__ getStruct(String fieldName) {
117 if (fieldName.equals("common")) {
118 return common;
119 }
120 if (fieldName.equals("layout")) {
121 return layout;
122 }
123 return super.getStruct(fieldName);
124103 }
125104
126105 @Override
4444 */
4545 package h;
4646
47 import h.ST_HDict_t.Amp;
48
49 import java.util.Arrays;
50 import java.util.List;
51
52 import smetana.core.UnsupportedStarStruct;
47 import smetana.core.OFFSET;
5348 import smetana.core.UnsupportedStructAndPtr;
54 import smetana.core.__ptr__;
5549 import smetana.core.amiga.StarStruct;
5650
5751 public class ST_HDict_t extends UnsupportedStructAndPtr {
5852
5953 private final StarStruct parent;
6054
55 public final ST_dtlink_s link = new ST_dtlink_s(this);
56 public int key;
57 public final ST_Branch_t d = new ST_Branch_t(); /* Should be ST_Leaf_t */
58
6159 public ST_HDict_t() {
6260 this(null);
6361 }
6765 }
6866
6967 @Override
70 public StarStruct amp() {
71 return new Amp();
68 public Object addVirtualBytes(int virtualBytes) {
69 if (virtualBytes == 0) {
70 return this;
71 }
72 OFFSET offset = OFFSET.fromInt(virtualBytes);
73 if (offset.toString().equals("h.ST_HDict_t::key")) {
74 return key;
75 }
76 System.err.println("offset="+offset);
77
78 // TODO Auto-generated method stub
79 return super.addVirtualBytes(virtualBytes);
7280 }
7381
74 public class Amp extends UnsupportedStarStruct {
75
82 // @Override
83 // public __ptr__ getPtr(String fieldName) {
84 // if (fieldName.equals("d")) {
85 // return this.d;
86 // }
87 // return super.getPtr(fieldName);
88 // }
89
90 @Override
91 public void setInt(String fieldName, int data) {
92 if (fieldName.equals("key")) {
93 this.key = data;
94 return;
95 }
96 super.setInt(fieldName, data);
7697 }
98
99
77100 // "typedef struct obyh",
78101 // "{",
79102 // "Dtlink_t link",
4444 */
4545 package h;
4646
47 import h.ST_IMapEntry_t.Amp;
48
49 import java.util.Arrays;
50 import java.util.List;
51
52 import smetana.core.UnsupportedStarStruct;
47 import smetana.core.CString;
5348 import smetana.core.UnsupportedStructAndPtr;
54 import smetana.core.__ptr__;
5549 import smetana.core.amiga.StarStruct;
5650
5751 public class ST_IMapEntry_t extends UnsupportedStructAndPtr {
5852
5953 private final StarStruct parent;
54
55 public final CString str = null;
6056
6157 public ST_IMapEntry_t() {
6258 this(null);
6662 this.parent = parent;
6763 }
6864
69 @Override
70 public StarStruct amp() {
71 return new Amp();
72 }
73
74 public class Amp extends UnsupportedStarStruct {
75
76 }
7765 // "typedef struct IMapEntry_s",
7866 // "{",
7967 // "Dtlink_t namedict_link",
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedStructAndPtr;
48
49 public class ST_LeafList_t extends UnsupportedStructAndPtr {
50
51 public ST_LeafList_t next;
52 public ST_Branch_t /* ST_Leaf_t */leaf;
53
54 public ST_LeafList_t() {
55 }
56
57
58 // typedef struct LeafList {
59 // struct LeafList *next;
60 // Leaf_t *leaf;
61 // } LeafList_t;
62
63 }
4343 *
4444 */
4545 package h;
46 import h.ST_Node_t___.Amp;
4746
48 import java.util.Arrays;
49 import java.util.List;
50
51 import smetana.core.UnsupportedStarStruct;
47 import smetana.core.UnsupportedArrayOfStruct;
5248 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__ptr__;
49 import smetana.core.__struct__;
5450 import smetana.core.amiga.StarStruct;
5551
56 public class ST_Node_t___ extends UnsupportedStructAndPtr {
52 public class ST_Node_t___ extends UnsupportedStructAndPtr implements ST_Node_t___or_object_t {
5753
5854 private final StarStruct parent;
55 public int count;
56 public int level;
57 // Sorry guys :-)
58 public final ST_Branch_t branch[] = new ST_Branch_t[] { new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
59 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
60 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
61 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
62 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
63 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
64 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
65 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
66 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
67 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
68 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
69 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
70 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
71 new ST_Branch_t() };
5972
6073 public ST_Node_t___() {
6174 this(null);
6578 this.parent = parent;
6679 }
6780
68 @Override
69 public StarStruct amp() {
70 return new Amp();
81 class ArrayOfSixtyFor extends UnsupportedArrayOfStruct {
82
83 final private int pos;
84
85 public ArrayOfSixtyFor(int pos) {
86 this.pos = pos;
87 }
88
89 public ArrayOfSixtyFor plus(int delta) {
90 return new ArrayOfSixtyFor(pos + delta);
91 }
92
93 @Override
94 public __struct__ getStruct() {
95 return branch[pos];
96 }
97
98 @Override
99 public void setStruct(__struct__ value) {
100 branch[pos].copyDataFrom(value);
101 }
102
71103 }
72104
73 public class Amp extends UnsupportedStarStruct {
105 @Override
106 public void setInt(String fieldName, int data) {
107 if (fieldName.equals("count")) {
108 this.count = data;
109 return;
110 }
111 if (fieldName.equals("level")) {
112 this.level = data;
113 return;
114 }
115 super.setInt(fieldName, data);
116 }
74117
75 }
76 //"typedef struct Node",
77 //"{",
78 //"int count",
79 //"int level",
80 //"struct Branch branch[64]",
81 //"}",
82 //"Node_t");
118
119 // "typedef struct Node",
120 // "{",
121 // "int count",
122 // "int level",
123 // "struct Branch branch[64]",
124 // "}",
125 // "Node_t");
83126 }
84127
85128 // typedef struct Node {
86 // int count;
87 // int level; /* 0 is leaf, others positive */
88 // struct Branch branch[64];
129 // int count;
130 // int level; /* 0 is leaf, others positive */
131 // struct Branch branch[64];
89132 // } Node_t;
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.__ptr__;
48
49 public interface ST_Node_t___or_object_t extends __ptr__ {
50
51 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedArrayOfStruct;
48 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__struct__;
50 import smetana.core.amiga.StarStruct;
51
52 public class ST_PartitionVars extends UnsupportedStructAndPtr {
53
54 private final StarStruct parent;
55
56 public final int[] partition = new int[64 + 1];
57 public final int[] taken = new int[64 + 1];
58 public final int[] count = new int[2];
59 public final ST_Rect_t[] cover = new ST_Rect_t[] { new ST_Rect_t(), new ST_Rect_t() };
60 public final int[] area = new int[2];
61
62 // int partition[64 + 1];
63 // int taken[64 + 1];
64 // int count[2];
65 // struct Rect cover[2];
66 // int area[2];
67
68 class ArrayOfTwo extends UnsupportedArrayOfStruct {
69
70 final private int pos;
71
72 public ArrayOfTwo(int pos) {
73 this.pos = pos;
74 }
75
76 public ArrayOfTwo plus(int delta) {
77 return new ArrayOfTwo(pos + delta);
78 }
79
80 @Override
81 public __struct__ getStruct() {
82 return cover[pos];
83 }
84
85 @Override
86 public void setStruct(__struct__ value) {
87 cover[pos].copyDataFrom(value);
88 }
89
90 }
91
92
93 public ST_PartitionVars() {
94 this(null);
95 }
96
97 public ST_PartitionVars(StarStruct parent) {
98 this.parent = parent;
99 }
100
101 // struct PartitionVars {
102 // int partition[64 + 1];
103 // int taken[64 + 1];
104 // int count[2];
105 // struct Rect cover[2];
106 // int area[2];
107 // };
108
109 }
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedSize_t;
48 import smetana.core.UnsupportedStarStruct;
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.UnsupportedArrayOfStruct2;
4951 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_ptr__;
53 import smetana.core.__ptr__;
5054 import smetana.core.__struct__;
5155 import smetana.core.size_t;
52 import smetana.core.amiga.StarArrayOfPtr;
5356 import smetana.core.amiga.StarStruct;
5457
5558 public class ST_Pedge_t extends UnsupportedStructAndPtr {
6770 // "typedef struct Pedge_t",
6871 // "{",
6972 // "Ppoint_t a, b",
70 private final ST_pointf a = new ST_pointf(this);
71 private final ST_pointf b = new ST_pointf(this);
73 public final ST_pointf a = new ST_pointf(this);
74 public final ST_pointf b = new ST_pointf(this);
7275
7376 // "}",
7477 // "Pedge_t");
7578
76 @Override
77 public StarStruct amp() {
78 return new Amp();
79
80 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{
81
82 private final List<ST_Pedge_t> data;
83 private final int pos;
84
85 @Override
86 public void setStruct(String fieldName, __struct__ data) {
87 getStruct().setStruct(fieldName, data);
88 }
89
90 @Override
91 public Array asPtr() {
92 return this;
93 }
94
95 @Override
96 public ST_Pedge_t getStruct() {
97 return data.get(pos);
98 }
99
100 public Array(int size) {
101 this.data = new ArrayList<ST_Pedge_t>();
102 this.pos = 0;
103 for (int i = 0; i < size; i++) {
104 data.add(new ST_Pedge_t());
105 }
106 }
107
108 public Array reallocJ(int newsize) {
109 while (data.size() < newsize) {
110 data.add(new ST_Pedge_t());
111 }
112 return this;
113 }
114
115 public Array plus(int delta) {
116 return plusJ(delta);
117 }
118
119 private Array(List<ST_Pedge_t> data, int pos) {
120 this.data = data;
121 this.pos = pos;
122 }
123
124 public ST_Pedge_t get(int i) {
125 return this.data.get(pos + i);
126 }
127
128 public Array plusJ(int i) {
129 return new Array(data, pos + i);
130 }
131
132 public int minus(Array other) {
133 if (this.data != other.data) {
134 throw new IllegalArgumentException();
135 }
136 return this.pos - other.pos;
137 }
138
139 public Array move(int delta) {
140 throw new UnsupportedOperationException(getClass().toString());
141 }
142
143 public void realloc(size_t nb) {
144 throw new UnsupportedOperationException(getClass().toString());
145 }
146
147 public int comparePointerInternal(__array_of_ptr__ other) {
148 throw new UnsupportedOperationException(getClass().toString());
149 }
150
151
79152 }
80153
81 public class Amp extends UnsupportedStarStruct {
82154
83 }
84
85 @Override
86 public __struct__ getStruct(String fieldName) {
87 if (fieldName.equals("a")) {
88 return a;
89 }
90 if (fieldName.equals("b")) {
91 return b;
92 }
93 return super.getStruct(fieldName);
94 }
95
96155 @Override
97156 public void setStruct(String fieldName, __struct__ newData) {
98157 if (fieldName.equals("a")) {
106165 super.setStruct(fieldName, newData);
107166 }
108167
109 public static size_t sizeof(final int nb) {
110 return new UnsupportedSize_t(nb) {
111 @Override
112 public Object malloc() {
113 return new StarArrayOfPtr(new STArray<ST_Pedge_t>(nb, 0, ST_Pedge_t.class));
114 }
115
116 @Override
117 public int getInternalNb() {
118 return nb;
119 }
120
121 @Override
122 public Object realloc(Object old) {
123 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
124 old2.realloc(nb);
125 return old2;
126 }
127 };
128 }
129168
130169 }
131170
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedArrayOfPtr;
4948 import smetana.core.UnsupportedArrayOfStruct;
50 import smetana.core.UnsupportedStarStruct;
5149 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_ptr__;
53 import smetana.core.__array_of_struct__;
54 import smetana.core.__ptr__;
5550 import smetana.core.__struct__;
5651 import smetana.core.amiga.Area;
57 import smetana.core.amiga.StarArrayOfPtr;
58 import smetana.core.amiga.StarArrayOfStruct;
5952 import smetana.core.amiga.StarStruct;
6053
6154 public class ST_Ppoly_t extends UnsupportedStructAndPtr implements HardcodedStruct {
6255
63 // public List ps1;
64 public StarArrayOfPtr ps2;
56 // public StarArrayOfPtr ps;
57 public ST_pointf.Array ps;
6558 public int pn;
6659
6760 public ST_Ppoly_t() {
7467 @Override
7568 public __struct__ copy() {
7669 ST_Ppoly_t result = new ST_Ppoly_t();
77 result.ps2 = this.ps2;
70 result.ps = this.ps;
7871 result.pn = this.pn;
7972 return result;
8073 }
8174
82 class Adaptor extends UnsupportedArrayOfPtr {
83
84 final private StarArrayOfStruct newData2;
85 final private int pos;
86
87 public Adaptor(StarArrayOfStruct newData2, int pos) {
88 this.newData2 = newData2;
89 this.pos = pos;
90 }
91
92 @Override
93 public __array_of_ptr__ move(int delta) {
94 return new Adaptor(newData2, pos + delta);
95 }
96
97 @Override
98 public Area getInternal(int idx) {
99 return newData2.getInternalArray().getInternal(pos + idx);
100 }
101
102 @Override
103 public __ptr__ getPtr() {
104 return newData2.plus(pos).getPtr();
105 }
106
107 @Override
108 public __struct__ getStruct() {
109 return newData2.plus(pos).getStruct();
110 }
111
112 @Override
113 public int comparePointerInternal(__array_of_ptr__ other) {
114 return super.comparePointerInternal(other);
115 }
116
117 }
11875
11976 class Adaptor2 extends UnsupportedArrayOfStruct {
12077
12481 this.pos = pos;
12582 }
12683
127 @Override
128 public __array_of_struct__ plus(int delta) {
84 public Adaptor2 plus(int delta) {
12985 return new Adaptor2(pos + delta);
13086 }
131
87
13288 @Override
13389 public __struct__ getStruct() {
134 return ps2.plus(pos).getStruct();
90 return ps.plus(pos).getStruct();
13591 }
13692
13793 }
13894
13995 @Override
140 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
141 if (fieldName.equals("ps")) {
142 if (newData instanceof StarArrayOfStruct) {
143 StarArrayOfStruct newData2 = (StarArrayOfStruct) newData;
144 System.err.println("newData2B=" + newData2);
145 this.ps2 = new StarArrayOfPtr(new Adaptor(newData2, 0));
146 return ps2;
147 }
148 this.ps2 = (StarArrayOfPtr) newData;
149 return ps2;
150 }
151 return super.setPtr(fieldName, newData);
152 }
153
154 @Override
155 public __ptr__ getPtr(String fieldName) {
156 if (fieldName.equals("ps")) {
157 return ps2;
158 }
159 return super.getPtr(fieldName);
160 }
161
162 @Override
163 public __array_of_struct__ getArrayOfStruct(String fieldName) {
164 if (fieldName.equals("ps")) {
165 return new Adaptor2(0);
166 // return ps2.getArrayOfStruct("ps");
167 }
168 return super.getArrayOfStruct(fieldName);
169 }
170
171 @Override
172 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
173 if (fieldName.equals("ps")) {
174 return ps2.getInternalArray();
175 }
176 return super.getArrayOfPtr(fieldName);
177 }
178
179 @Override
18096 public void memcopyFrom(Area source) {
18197 ST_Ppoly_t source2 = (ST_Ppoly_t) source;
182 this.ps2 = source2.ps2;
98 this.ps = source2.ps;
18399 this.pn = source2.pn;
184100 }
185101
190106 return;
191107 }
192108 super.setInt(fieldName, data);
193 }
194
195 @Override
196 public int getInt(String fieldName) {
197 if (fieldName.equals("pn")) {
198 return pn;
199 }
200 return super.getInt(fieldName);
201 }
202
203 public class Amp extends UnsupportedStarStruct {
204
205 @Override
206 public int getInt(String fieldName) {
207 if (fieldName.equals("pn")) {
208 return pn;
209 }
210 return super.getInt(fieldName);
211 }
212
213 @Override
214 public void setInt(String fieldName, int data) {
215 if (fieldName.equals("pn")) {
216 pn = data;
217 return;
218 }
219 super.setInt(fieldName, data);
220 }
221
222 @Override
223 public __ptr__ getPtr(String fieldName) {
224 if (fieldName.equals("ps")) {
225 return ps2;
226 }
227 return super.getPtr(fieldName);
228 }
229
230 @Override
231 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
232 if (fieldName.equals("ps")) {
233 ps2 = (StarArrayOfPtr) newData;
234 return newData;
235 }
236 return super.setPtr(fieldName, newData);
237 }
238 }
239
240 @Override
241 public StarStruct amp() {
242 return new Amp();
243109 }
244110
245111 // public static List<String> DEFINITION = Arrays.asList(
4444 */
4545 package h;
4646
47 import h.ST_RTree.Amp;
48
49 import java.util.Arrays;
50 import java.util.List;
51
52 import smetana.core.UnsupportedStarStruct;
5347 import smetana.core.UnsupportedStructAndPtr;
5448 import smetana.core.__ptr__;
5549 import smetana.core.amiga.StarStruct;
6862
6963 // "struct RTree",
7064 // "{",
65 public ST_Node_t___ root;
7166 // "Node_t *root",
72 // "SplitQ_t split",
73 // "int MinFill",
67 public final ST_SplitQ_t split = new ST_SplitQ_t(this);
68 public int MinFill;
7469 // "long ElapsedTime",
7570 // "float UserTime, SystemTime",
76 // "int Deleting",
77 // "int StatFlag",
71 public int Deleting;
72 public int StatFlag;
7873 // "int InsertCount",
7974 // "int DeleteCount",
8075 // "int ReInsertCount",
8176 // "int InSplitCount",
8277 // "int DeSplitCount",
83 // "int ElimCount",
78 public int ElimCount;
8479 // "int EvalCount",
8580 // "int InTouchCount",
8681 // "int DeTouchCount",
87 // "int SeTouchCount",
82 public int SeTouchCount;
8883 // "int CallCount",
8984 // "float SplitMeritSum",
90 // "int RectCount",
91 private int NodeCount;
92 // "int LeafCount, NonLeafCount",
93 // "int EntryCount",
85 public int RectCount;
86 public int NodeCount;
87 public int LeafCount, NonLeafCount;
88
89 public int EntryCount;
9490 // "int SearchCount",
9591 // "int HitCount",
9692 // "}");
9793
9894 @Override
99 public StarStruct amp() {
100 return new Amp();
95 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
96 if (fieldName.equals("root")) {
97 this.root = (ST_Node_t___) newData;
98 return root;
99 }
100 return super.setPtr(fieldName, newData);
101101 }
102102
103 public class Amp extends UnsupportedStarStruct {
104
105 }
106
107 @Override
108 public int getInt(String fieldName) {
109 if (fieldName.equals("NodeCount")) {
110 return NodeCount;
111 }
112 return super.getInt(fieldName);
113 }
114
115103 @Override
116104 public void setInt(String fieldName, int data) {
117105 if (fieldName.equals("NodeCount")) {
118106 this.NodeCount = data;
107 return;
108 }
109 if (fieldName.equals("LeafCount")) {
110 this.LeafCount = data;
111 return;
112 }
113 if (fieldName.equals("RectCount")) {
114 this.RectCount = data;
115 return;
116 }
117 if (fieldName.equals("EntryCount")) {
118 this.EntryCount = data;
119 return;
120 }
121 if (fieldName.equals("SeTouchCount")) {
122 this.SeTouchCount = data;
123 return;
124 }
125 if (fieldName.equals("NonLeafCount")) {
126 this.NonLeafCount = data;
119127 return;
120128 }
121129 super.setInt(fieldName, data);
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__struct__;
50 import smetana.core.amiga.StarStruct;
51
52 public class ST_Rect_t extends UnsupportedStructAndPtr implements HardcodedStruct {
53
54 public final int[] boundary = new int[2 * 2];
55
56 public ST_Rect_t(StarStruct parent) {
57 }
58
59 public ST_Rect_t() {
60 }
61
62 @Override
63 public void ___(__struct__ other) {
64 this.copyDataFrom(other);
65 }
66
67 @Override
68 public void copyDataFrom(__struct__ other) {
69 ST_Rect_t other2 = (ST_Rect_t) other;
70 this.boundary[0] = other2.boundary[0];
71 this.boundary[1] = other2.boundary[1];
72 this.boundary[2] = other2.boundary[2];
73 this.boundary[3] = other2.boundary[3];
74 }
75
76 // typedef struct Rect {
77 // int boundary[2*2];
78 // } Rect_t;
79 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedArrayOfStruct;
48 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__struct__;
50 import smetana.core.amiga.StarStruct;
51
52 public class ST_SplitQ_t extends UnsupportedStructAndPtr {
53
54 private final StarStruct parent;
55
56 // typedef struct split_q_s {
57 // struct Branch BranchBuf[64 + 1];
58 // Sorry guys :-)
59 public final ST_Branch_t BranchBuf[] = new ST_Branch_t[] { new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
60 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
61 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
62 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
63 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
64 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
65 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
66 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
67 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
68 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
69 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
70 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
71 new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(), new ST_Branch_t(),
72 new ST_Branch_t(), new ST_Branch_t() };
73
74 public final ST_Rect_t CoverSplit = new ST_Rect_t(this);
75 public int CoverSplitArea;
76
77 public final ST_PartitionVars Partitions[] = new ST_PartitionVars[] { new ST_PartitionVars() };
78
79 // struct PartitionVars Partitions[1];
80 // } SplitQ_t;
81
82 public ST_SplitQ_t() {
83 this(null);
84 }
85
86 @Override
87 public ST_Rect_t castTo(Class dest) {
88 if (dest == ST_Rect_t.class) {
89 return CoverSplit;
90 }
91 throw new UnsupportedOperationException();
92 }
93
94 public ST_SplitQ_t(StarStruct parent) {
95 this.parent = parent;
96 }
97
98 class ArrayOfSixtyFive extends UnsupportedArrayOfStruct {
99
100 final private int pos;
101
102 public ArrayOfSixtyFive(int pos) {
103 this.pos = pos;
104 }
105
106 public ArrayOfSixtyFive plus(int delta) {
107 return new ArrayOfSixtyFive(pos + delta);
108 }
109
110 @Override
111 public __struct__ getStruct() {
112 return BranchBuf[pos];
113 }
114
115 @Override
116 public void setStruct(__struct__ value) {
117 BranchBuf[pos].copyDataFrom(value);
118 }
119
120 }
121
122 class ArrayOfOne extends UnsupportedArrayOfStruct {
123
124 final private int pos;
125
126 public ArrayOfOne(int pos) {
127 this.pos = pos;
128 }
129
130 public ArrayOfOne plus(int delta) {
131 return new ArrayOfOne(pos + delta);
132 }
133
134 @Override
135 public __struct__ getStruct() {
136 return Partitions[pos];
137 }
138
139 @Override
140 public void setStruct(__struct__ value) {
141 Partitions[pos].copyDataFrom(value);
142 }
143
144 }
145
146 @Override
147 public void setInt(String fieldName, int data) {
148 if (fieldName.equals("CoverSplitArea")) {
149 this.CoverSplitArea = data;
150 return;
151 }
152 super.setInt(fieldName, data);
153 }
154
155 @Override
156 public void setStruct(String fieldName, __struct__ newData) {
157 if (fieldName.equals("CoverSplit")) {
158 this.CoverSplit.copyDataFrom(newData);
159 return;
160 }
161 super.setStruct(fieldName, newData);
162 }
163
164 // typedef struct split_q_s {
165 // struct Branch BranchBuf[64 + 1];
166 // struct Rect CoverSplit;
167 // unsigned int CoverSplitArea;
168 // struct PartitionVars Partitions[1];
169 // } SplitQ_t;
170 }
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
5049 import smetana.core.amiga.StarStruct;
6362
6463 // "typedef struct XLabels_s",
6564 // "{",
66 // "object_t *objs",
67 // "int n_objs",
68 // "xlabel_t *lbls",
69 // "int n_lbls",
70 // "label_params_t *params",
71 private ST_dt_s hdx;
72
73 // "RTree_t *spdx",
65 public ST_object_t.Array /*ST_object_t*/ objs;
66 public int n_objs;
67 public ST_xlabel_t.Array /*ST_xlabel_t*/ lbls;
68 public int n_lbls;
69 public ST_label_params_t /*ST_label_params_t*/ params;
70 public ST_dt_s hdx;
71 public ST_RTree spdx;
7472 // "}",
7573 // "XLabels_t");
7674
7775 @Override
78 public StarStruct amp() {
79 return new Amp();
76 public void setInt(String fieldName, int data) {
77 if (fieldName.equals("n_objs")) {
78 this.n_objs = data;
79 return;
80 }
81 if (fieldName.equals("n_lbls")) {
82 this.n_lbls = data;
83 return;
84 }
85 super.setInt(fieldName, data);
8086 }
8187
82 public class Amp extends UnsupportedStarStruct {
8388
84 }
85
86 @Override
87 public __ptr__ getPtr(String fieldName) {
88 if (fieldName.equals("hdx")) {
89 return this.hdx;
90 }
91 return super.getPtr(fieldName);
92 }
9389
9490 @Override
9591 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
9692 if (fieldName.equals("hdx")) {
9793 this.hdx = (ST_dt_s) newData;
9894 return this.hdx;
95 }
96 if (fieldName.equals("spdx")) {
97 this.spdx = (ST_RTree) newData;
98 return this.spdx;
99 }
100 // if (fieldName.equals("objs")) {
101 // this.objs = newData;
102 // return this.objs;
103 // }
104 // if (fieldName.equals("lbls")) {
105 // this.lbls = newData;
106 // return this.lbls;
107 // }
108 if (fieldName.equals("params")) {
109 this.params = (ST_label_params_t) newData;
110 return this.params;
99111 }
100112 return super.setPtr(fieldName, newData);
101113 }
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__array_of_integer__;
50 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarArrayOfInteger;
5248 import smetana.core.amiga.StarStruct;
5349
5450 public class ST_adjmatrix_t extends UnsupportedStructAndPtr {
6359 this.parent = parent;
6460 }
6561
66 @Override
67 public StarStruct amp() {
68 return new Amp();
69 }
70
71 public class Amp extends UnsupportedStarStruct {
72
73 }
74
7562 // "typedef struct adjmatrix_t",
7663 // "{",
77 private int nrows, ncols;
64 public int nrows, ncols;
7865
7966 // "char *data",
80 private StarArrayOfInteger data;
67 public int[][] data;
8168
8269 // "}",
8370 // "adjmatrix_t");
9582 super.setInt(fieldName, data);
9683 }
9784
98 @Override
99 public int getInt(String fieldName) {
100 if (fieldName.equals("nrows")) {
101 return this.nrows;
102 }
103 if (fieldName.equals("ncols")) {
104 return this.ncols;
105 }
106 return super.getInt(fieldName);
107 }
108
109 @Override
110 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
111 if (fieldName.equals("data")) {
112 this.data = (StarArrayOfInteger) newData;
113 return data;
114 }
115 return super.setPtr(fieldName, newData);
116 }
117
118 @Override
119 public __array_of_integer__ getArrayOfInteger(String fieldName) {
120 if (fieldName.equals("data")) {
121 return data.getInternalArray();
122 }
123 return super.getArrayOfInteger(fieldName);
124 }
125
126 @Override
127 public __ptr__ getPtr(String fieldName) {
128 if (fieldName.equals("data")) {
129 return data;
130 }
131 return super.getPtr(fieldName);
132 }
13385 }
13486
13587 // typedef struct adjmatrix_t {
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedStructAndPtr;
48 import smetana.core.amiga.StarStruct;
49
50 public class ST_arrowdir_t extends UnsupportedStructAndPtr {
51
52 // char *dir;
53 public int sflag;
54 public int eflag;
55
56 private final StarStruct parent;
57
58 public ST_arrowdir_t() {
59 this(null);
60 }
61
62 public ST_arrowdir_t(StarStruct parent) {
63 this.parent = parent;
64 }
65
66 // typedef struct arrowdir_t {
67 // char *dir;
68 // int sflag;
69 // int eflag;
70 // } arrowdir_t;
71
72 }
4646
4747 import smetana.core.CFunction;
4848 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__ptr__;
5049 import smetana.core.__struct__;
5150
5251 public class ST_arrowtype_t extends UnsupportedStructAndPtr {
6362 gen = other2.gen;
6463 }
6564
66 @Override
67 public int getInt(String fieldName) {
68 if (fieldName.equals("type")) {
69 return type;
70 }
71 return super.getInt(fieldName);
72 }
73
74 @Override
75 public double getDouble(String fieldName) {
76 if (fieldName.equals("lenfact")) {
77 return lenfact;
78 }
79 return super.getDouble(fieldName);
80 }
81
82 @Override
83 public __ptr__ getPtr(String fieldName) {
84 if (fieldName.equals("gen")) {
85 return gen;
86 }
87 return super.getPtr(fieldName);
88 }
65 // @Override
66 // public int getInt(String fieldName) {
67 // if (fieldName.equals("type")) {
68 // return type;
69 // }
70 // return super.getInt(fieldName);
71 // }
72 //
73 // @Override
74 // public double getDouble(String fieldName) {
75 // if (fieldName.equals("lenfact")) {
76 // return lenfact;
77 // }
78 // return super.getDouble(fieldName);
79 // }
80 //
81 // @Override
82 // public __ptr__ getPtr(String fieldName) {
83 // if (fieldName.equals("gen")) {
84 // return gen;
85 // }
86 // return super.getPtr(fieldName);
87 // }
8988
9089 // public static List<String> DEFINITION = Arrays.asList(
9190 // "typedef struct arrowtype_t",
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.amiga.StarStruct;
5049
6059 this.parent = parent;
6160 }
6261
63 @Override
64 public StarStruct amp() {
65 return new Amp();
66 }
67
68 public class Amp extends UnsupportedStarStruct {
69
70 }
71
7262 // "typedef struct aspect_t",
7363 // "{",
7464 // "double targetAR",
7565 // "double combiAR",
76 private int prevIterations;
77 private int curIterations;
78 private int nextIter;
79 private int nPasses;
80 private int badGraph;
66 public int prevIterations;
67 public int curIterations;
68 public int nextIter;
69 public int nPasses;
70 public int badGraph;
8171
8272 // "}",
8373 // "aspect_t");
84
85 @Override
86 public int getInt(String fieldName) {
87 if (fieldName.equals("nextIter")) {
88 return this.nextIter;
89 }
90 if (fieldName.equals("nPasses")) {
91 return this.nPasses;
92 }
93 return super.getInt(fieldName);
94 }
9574
9675 @Override
9776 public void setInt(String fieldName, int data) {
11089 super.setInt(fieldName, data);
11190 }
11291
113 @Override
114 public boolean getBoolean(String fieldName) {
115 if (fieldName.equals("badGraph")) {
116 return this.badGraph != 0;
117 }
118 return super.getBoolean(fieldName);
119 }
120
12192 }
12293
12394 // typedef struct aspect_t {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedSize_t;
48 import smetana.core.UnsupportedStarStruct;
47 import h.ST_pointf.Array;
48
49 import java.util.ArrayList;
50 import java.util.List;
51
52 import smetana.core.UnsupportedArrayOfPtr;
4953 import smetana.core.UnsupportedStructAndPtr;
5054 import smetana.core.__array_of_ptr__;
5155 import smetana.core.__ptr__;
5256 import smetana.core.__struct__;
53 import smetana.core.size_t;
54 import smetana.core.amiga.StarArrayOfPtr;
5557 import smetana.core.amiga.StarStruct;
5658
5759 public class ST_bezier extends UnsupportedStructAndPtr {
6870
6971 // "{",
7072 // "pointf *list",
71 private StarArrayOfPtr list;
72
73 private int size;
74 private int sflag, eflag;
75
76 private final ST_pointf sp = new ST_pointf(this), ep = new ST_pointf(this);
73 public ST_pointf.Array list;
74
75 public int size;
76 public int sflag, eflag;
77
78 public final ST_pointf sp = new ST_pointf(this), ep = new ST_pointf(this);
79
80 public static class Array2 extends UnsupportedArrayOfPtr implements __ptr__, __array_of_ptr__ {
81
82 private final List<ST_bezier> data;
83 private final int pos;
84
85 public Array2(int size) {
86 this.data = new ArrayList<ST_bezier>();
87 this.pos = 0;
88 for (int i = 0; i < size; i++) {
89 data.add(new ST_bezier());
90 }
91 }
92
93 @Override
94 public ST_bezier getStruct() {
95 return data.get(pos);
96 }
97
98 @Override
99 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
100 return getStruct().setPtr(fieldName, newData);
101 }
102
103 @Override
104 public void setStruct(String fieldName, __struct__ newData) {
105 getStruct().setStruct(fieldName, newData);
106 }
107
108 @Override
109 public void setInt(String fieldName, int data) {
110 getStruct().setInt(fieldName, data);
111 }
112
113 // public void swap(int i, int j) {
114 // ST_bezier e1 = data.get(i);
115 // ST_bezier e2 = data.get(j);
116 // data.set(i, e2);
117 // data.set(j, e1);
118 // }
119
120 public Array2(List<ST_bezier> data, int pos) {
121 this.data = data;
122 this.pos = pos;
123 }
124
125 public Array2 reallocJ(int newsize) {
126 while (data.size() < newsize) {
127 data.add(new ST_bezier());
128 }
129 return this;
130 }
131
132 @Override
133 public Array2 plus(int delta) {
134 return new Array2(data, pos + delta);
135 }
136
137 @Override
138 public Array2 asPtr() {
139 return this;
140 }
141
142 @Override
143 public void setPtr(__ptr__ value) {
144 this.data.set(pos, (ST_bezier) value);
145 }
146
147 @Override
148 public ST_bezier getPtr() {
149 return this.data.get(pos);
150 }
151
152 public ST_bezier get(int i) {
153 return this.plus(i).getPtr();
154 }
155
156 @Override
157 public int comparePointer(__ptr__ other) {
158 final Array2 this2 = (Array2) other;
159 if (this.data != this2.data) {
160 throw new IllegalArgumentException();
161 }
162 return this.pos - this2.pos;
163 }
164
165 public boolean isSameThan2(Array2 other) {
166 if (this.data != other.data) {
167 throw new IllegalArgumentException();
168 }
169 return this.pos == other.pos;
170 }
171 }
77172
78173 // "}",
79174 // "bezier");
90185 }
91186
92187 @Override
93 public StarStruct amp() {
94 return new Amp();
95 }
96
97 public class Amp extends UnsupportedStarStruct {
98
99 @Override
100 public __ptr__ getPtr(String fieldName) {
101 return ST_bezier.this.getPtr(fieldName);
102 }
103
104 @Override
105 public int getInt(String fieldName) {
106 return ST_bezier.this.getInt(fieldName);
107 }
108
109 @Override
110 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
111 return ST_bezier.this.getArrayOfPtr(fieldName);
112 }
113
114 @Override
115 public boolean getBoolean(String fieldName) {
116 return ST_bezier.this.getBoolean(fieldName);
117 }
118
119 @Override
120 public __struct__ getStruct(String fieldName) {
121 return ST_bezier.this.getStruct(fieldName);
122 }
123
124 }
125
126 @Override
127 public boolean getBoolean(String fieldName) {
128 if (fieldName.equals("sflag")) {
129 return this.sflag != 0;
130 }
131 if (fieldName.equals("eflag")) {
132 return this.eflag != 0;
133 }
134 return super.getBoolean(fieldName);
135 }
136
137 @Override
138 public __ptr__ getPtr(String fieldName) {
139 if (fieldName.equals("list")) {
140 return list;
141 }
142 return super.getPtr(fieldName);
143 }
144
145 @Override
146 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
147 if (fieldName.equals("list")) {
148 this.list = (StarArrayOfPtr) newData;
149 return list;
150 }
151 return super.setPtr(fieldName, newData);
188 public void ____(__ptr__ other) {
189 ___(((ST_bezier) other).getStruct());
152190 }
153191
154192 @Override
182220 }
183221
184222 @Override
185 public int getInt(String fieldName) {
186 if (fieldName.equals("size")) {
187 return this.size;
188 }
189 if (fieldName.equals("sflag")) {
190 return this.sflag;
191 }
192 if (fieldName.equals("eflag")) {
193 return this.eflag;
194 }
195 return super.getInt(fieldName);
196 }
197
198 @Override
199 public __struct__ getStruct(String fieldName) {
200 if (fieldName.equals("sp")) {
201 return this.sp;
202 }
203 if (fieldName.equals("ep")) {
204 return this.ep;
205 }
206 return super.getStruct(fieldName);
207 }
208
209 @Override
210 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
223 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
211224 if (fieldName.equals("list")) {
212 return this.list.getInternalArray();
213 }
214 return super.getArrayOfPtr(fieldName);
215 }
216
217 @Override
218 public __struct__ getStruct() {
225 this.list = (Array) newData;
226 return this.list;
227 }
228 return super.setPtr(fieldName, newData);
229 }
230
231 @Override
232 public ST_bezier getStruct() {
219233 return this;
220234 }
221235
222 public static size_t sizeof(final int nb) {
223 return new UnsupportedSize_t(nb) {
224 @Override
225 public Object malloc() {
226 return new StarArrayOfPtr(new STArray<ST_bezier>(nb, 0, ST_bezier.class));
227 }
228
229 @Override
230 public int getInternalNb() {
231 return nb;
232 }
233
234 @Override
235 public Object realloc(Object old) {
236 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
237 old2.realloc(nb);
238 return old2;
239 }
240 };
236 @Override
237 public ST_bezier getPtr() {
238 return this;
241239 }
242240
243241 }
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
5048 import smetana.core.UnsupportedStructAndPtr;
5149 import smetana.core.__struct__;
52 import smetana.core.size_t;
53 import smetana.core.amiga.StarArrayOfPtr;
5450 import smetana.core.amiga.StarStruct;
5551
5652 public class ST_boxf extends UnsupportedStructAndPtr implements HardcodedStruct {
7167 // this.UR.setStruct(other.UR);
7268 // }
7369
70 public static ST_boxf[] malloc(int nb) {
71 final ST_boxf result[] = new ST_boxf[nb];
72 for (int i = 0; i < nb; i++) {
73 result[i] = new ST_boxf();
74 }
75 return result;
76 }
77
7478 @Override
7579 public __struct__ getStruct() {
7680 return this;
7983 @Override
8084 public void setStruct(__struct__ value) {
8185 copyDataFrom(value);
82 }
83
84 @Override
85 public __struct__ getStruct(String fieldName) {
86 if (fieldName.equals("LL")) {
87 return LL;
88 }
89 if (fieldName.equals("UR")) {
90 return UR;
91 }
92 return super.getStruct(fieldName);
9386 }
9487
9588 public __struct__ getStructInternal(String fieldName) {
130123 this.UR.setStruct(other.UR);
131124 }
132125
133 // @Override
134 // public void copyDataFrom(__ptr__ value) {
135 // final ST_boxf other = (ST_boxf) value;
136 // this.LL.setStruct(other.LL);
137 // this.UR.setStruct(other.UR);
138 // }
139
140126 @Override
141127 public void ___(__struct__ value) {
142128 final ST_boxf other = (ST_boxf) value;
144130 this.UR.setStruct(other.UR);
145131 }
146132
147 class Amp extends UnsupportedStarStruct {
148133
149 @Override
150 public __struct__ getStruct(String fieldName) {
151 if (fieldName.equals("LL")) {
152 return LL;
153 }
154 if (fieldName.equals("UR")) {
155 return UR;
156 }
157 return super.getStruct(fieldName);
158 }
159
160 @Override
161 public __struct__ getStruct() {
162 return ST_boxf.this;
163 }
164
165 }
166
167 @Override
168 public StarStruct amp() {
169 return new Amp();
170 }
171
172 public static size_t sizeof(final int nb) {
173 return new UnsupportedSize_t(nb) {
174 @Override
175 public Object malloc() {
176 return new StarArrayOfPtr(new STArray<ST_boxf>(nb, 0, ST_boxf.class));
177 }
178 };
179 }
180134
181135 // public interface ST_boxf extends __ptr__ {
182136 // public static List<String> DEFINITION = Arrays.asList(
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__struct__;
50 import smetana.core.amiga.StarStruct;
51
52 public class ST_cinfo_t extends UnsupportedStructAndPtr implements HardcodedStruct {
53
54 public final ST_boxf bb = new ST_boxf(this);
55 public ST_object_t.Array objp;
56
57 public ST_cinfo_t(StarStruct parent) {
58 }
59
60 public ST_cinfo_t() {
61 }
62
63 @Override
64 public void ___(__struct__ value) {
65 final ST_cinfo_t other = (ST_cinfo_t) value;
66 this.bb.setStruct(other.bb);
67 this.objp = other.objp;
68 }
69
70 @Override
71 public void setStruct(String fieldName, __struct__ newData) {
72 if (fieldName.equals("bb")) {
73 this.bb.setStruct(newData);
74 return;
75 }
76 super.setStruct(fieldName, newData);
77 }
78
79
80 @Override
81 public ST_cinfo_t copy() {
82 final ST_cinfo_t result = new ST_cinfo_t();
83 result.bb.copyDataFrom((__struct__) this.bb);
84 result.objp = this.objp;
85 return result;
86 }
87
88
89
90
91 }
92
93 // typedef struct {
94 // boxf bb;
95 // object_t* objp;
96 // } cinfo_t;
4646
4747 import smetana.core.HardcodedStruct;
4848 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__ptr__;
5049 import smetana.core.amiga.StarStruct;
5150
5251 public class ST_deque_t extends UnsupportedStructAndPtr implements HardcodedStruct {
5352
53 // ---------------
54 public ST_pointnlink_t pnlps[];
55
56 public boolean malloc(int newdqn) {
57 this.pnlps = new ST_pointnlink_t[newdqn];
58 return true;
59 }
60
61 public boolean realloc(int newdqn) {
62 if (pnlps.length >= newdqn) {
63 return true;
64 }
65 ST_pointnlink_t pnlps2[] = new ST_pointnlink_t[newdqn];
66 for (int i = 0; i < pnlps.length; i++) {
67 pnlps2[i] = pnlps[i];
68 }
69 this.pnlps = pnlps2;
70 return true;
71 }
72 // ---------------
73
74
5475 // "pointnlink_t **pnlps",
55 public __ptr__ pnlps;
76 // public __ptr__ pnlps;
5677 public int pnlpn, fpnlpi, lpnlpi, apex;
5778
5879 public ST_deque_t() {
6283 public ST_deque_t(StarStruct parent) {
6384 }
6485
65 @Override
66 public __ptr__ getPtr(String fieldName) {
67 if (fieldName.equals("pnlps")) {
68 return pnlps;
69 }
70 return super.getPtr(fieldName);
71 }
86 // @Override
87 // public __ptr__ getPtr(String fieldName) {
88 // if (fieldName.equals("pnlps")) {
89 // return pnlps;
90 // }
91 // return super.getPtr(fieldName);
92 // }
93 //
94 // @Override
95 // public __ptr__ setPtr(String fieldName, __ptr__ newData) {
96 // if (fieldName.equals("pnlps")) {
97 // pnlps = newData;
98 // return pnlps;
99 // }
100 // return super.setPtr(fieldName, newData);
101 // }
72102
73 @Override
74 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
75 if (fieldName.equals("pnlps")) {
76 pnlps = newData;
77 return pnlps;
78 }
79 return super.setPtr(fieldName, newData);
80 }
103 // @Override
104 // public int getInt(String fieldName) {
105 // if (fieldName.equals("pnlpn")) {
106 // return pnlpn;
107 // }
108 // if (fieldName.equals("fpnlpi")) {
109 // return fpnlpi;
110 // }
111 // if (fieldName.equals("lpnlpi")) {
112 // return lpnlpi;
113 // }
114 // if (fieldName.equals("apex")) {
115 // return apex;
116 // }
117 // return super.getInt(fieldName);
118 // }
81119
82 @Override
83 public int getInt(String fieldName) {
84 if (fieldName.equals("pnlpn")) {
85 return pnlpn;
86 }
87 if (fieldName.equals("fpnlpi")) {
88 return fpnlpi;
89 }
90 if (fieldName.equals("lpnlpi")) {
91 return lpnlpi;
92 }
93 if (fieldName.equals("apex")) {
94 return apex;
95 }
96 return super.getInt(fieldName);
97 }
98
99 @Override
100 public void setInt(String fieldName, int data) {
101 if (fieldName.equals("pnlpn")) {
102 pnlpn = data;
103 return;
104 }
105 if (fieldName.equals("fpnlpi")) {
106 fpnlpi = data;
107 return;
108 }
109 if (fieldName.equals("lpnlpi")) {
110 lpnlpi = data;
111 return;
112 }
113 if (fieldName.equals("apex")) {
114 apex = data;
115 return;
116 }
117 super.setInt(fieldName, data);
118 }
120 // @Override
121 // public void setInt(String fieldName, int data) {
122 // if (fieldName.equals("pnlpn")) {
123 // pnlpn = data;
124 // return;
125 // }
126 // if (fieldName.equals("fpnlpi")) {
127 // fpnlpi = data;
128 // return;
129 // }
130 // if (fieldName.equals("lpnlpi")) {
131 // lpnlpi = data;
132 // return;
133 // }
134 // if (fieldName.equals("apex")) {
135 // apex = data;
136 // return;
137 // }
138 // super.setInt(fieldName, data);
139 // }
119140
120141 // public static List<String> DEFINITION = Arrays.asList(
121142 // "typedef struct deque_t",
5454
5555 public CFunction searchf;/* search function */
5656
57 public ST_dtdisc_s.Amp disc; /* method to manipulate objs */
57 public ST_dtdisc_s disc; /* method to manipulate objs */
5858 public ST_dtdata_s data; /* sharable data */
5959 public CFunction memoryf;/* function to alloc/free memory */
60 public ST_dtmethod_s.Amp meth; /* dictionary method */
60 public ST_dtmethod_s meth; /* dictionary method */
6161
6262 public int type; /* type information */
6363 public int nview; /* number of parent view dictionaries */
7979 return searchf;
8080 }
8181 if (fieldName.equals("meth")) {
82 this.meth = (ST_dtmethod_s.Amp) newData;
82 this.meth = (ST_dtmethod_s) newData;
8383 return meth;
8484 }
8585 if (fieldName.equals("disc")) {
86 this.disc = (ST_dtdisc_s.Amp) newData;
86 this.disc = (ST_dtdisc_s) newData;
8787 return disc;
8888 }
8989 if (fieldName.equals("memoryf")) {
110110 }
111111
112112 @Override
113 public __ptr__ getPtr(String fieldName) {
114 if (fieldName.equals("disc")) {
115 return disc;
116 }
117 if (fieldName.equals("data")) {
118 return data;
119 }
120 if (fieldName.equals("meth")) {
121 return meth;
122 }
123 if (fieldName.equals("view")) {
124 return view;
125 }
126 return super.getPtr(fieldName);
127 }
128
129 @Override
130 public Object call(String fieldName, Object... args) {
131 if (fieldName.equals("memoryf")) {
132 return this.memoryf.exe(args);
133 }
134 if (fieldName.equals("searchf")) {
135 return this.searchf.exe(args);
136 }
137 return super.call(fieldName, args);
138 }
139
140 @Override
141 public __ptr__ castTo(Class dest) {
142 if (dest == _dt_s.class) {
143 return this;
144 }
145 return super.castTo(dest);
146 }
147
148 @Override
149113 public void setInt(String fieldName, int data) {
150114 if (fieldName.equals("type")) {
151115 this.type = data;
158122 super.setInt(fieldName, data);
159123 }
160124
161 @Override
162 public int getInt(String fieldName) {
163 if (fieldName.equals("type")) {
164 return type;
165 }
166 if (fieldName.equals("nview")) {
167 return nview;
168 }
169 return super.getInt(fieldName);
170 }
171
172125 @Override
173126 public boolean isSameThan(StarStruct other) {
174127 ST_dt_s other2 = (ST_dt_s) other;
4444 */
4545 package h;
4646
47 import h.ST_dtdisc_s.Amp;
48 import smetana.core.UnsupportedStarStruct;
4947 import smetana.core.UnsupportedStructAndPtr;
5048 import smetana.core.__ptr__;
5149 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_dtdata_s extends UnsupportedStructAndPtr {
5452
53 private final StarStruct parent;
54
5555 public int type; /* type of dictionary */
56 public ST_dtlink_s.Amp here; /* finger to last search element */
57 private __ptr__ _htab; /* hash table */
56 public ST_dtlink_s here; /* finger to last search element */
57 public __ptr__ _htab; /* hash table */
58 public ST_dtlink_s _head = null;
5859 // Dtlink_t* _head; /* linked list */
5960 // } hh;
6061 public int ntab; /* number of hash slots */
6263 public int loop; /* number of nested loops */
6364 public int minp; /* min path before splay, always even */
6465
65 private final StarStruct parent;
6666
6767 public ST_dtdata_s() {
6868 this(null);
7474
7575 public StarStruct getParent() {
7676 return parent;
77 }
78
79 @Override
80 public StarStruct amp() {
81 return new Amp();
82 }
83
84 public class Amp extends UnsupportedStarStruct {
85 }
86
87 @Override
88 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
89 if (fieldName.equals("here")) {
90 if (newData instanceof ST_dtlink_s) {
91 this.here = (ST_dtlink_s.Amp) ((ST_dtlink_s) newData).amp();
92 } else {
93 this.here = (ST_dtlink_s.Amp) newData;
94 }
95 return here;
96 }
97 if (fieldName.equals("hh._htab")) {
98 this._htab = newData;
99 return _htab;
100 }
101 return super.setPtr(fieldName, newData);
102 }
103
104 @Override
105 public __ptr__ getPtr(String fieldName) {
106 if (fieldName.equals("here")) {
107 return here;
108 }
109 return super.getPtr(fieldName);
11077 }
11178
11279 @Override
13299 return;
133100 }
134101 super.setInt(fieldName, data);
135 }
136
137 @Override
138 public int getInt(String fieldName) {
139 if (fieldName.equals("type")) {
140 return type;
141 }
142 if (fieldName.equals("size")) {
143 return size;
144 }
145 if (fieldName.equals("minp")) {
146 return minp;
147 }
148 return super.getInt(fieldName);
149102 }
150103
151104 // public interface ST_dtdata_s extends __ptr__ {
4444 */
4545 package h;
4646
47 import h.ST_dtmethod_s.Amp;
4847 import smetana.core.CFunction;
49 import smetana.core.UnsupportedStarStruct;
5048 import smetana.core.UnsupportedStructAndPtr;
5149 import smetana.core.__ptr__;
5250 import smetana.core.amiga.StarStruct;
7169 }
7270
7371 @Override
74 public StarStruct amp() {
75 return new Amp(this);
72 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
73 if (fieldName.equals("memoryf")) {
74 memoryf = (CFunction) newData;
75 return newData;
76 }
77 return super.setPtr(fieldName, newData);
7678 }
7779
78 public class Amp extends UnsupportedStarStruct {
79 private final ST_dtdisc_s parent;
80
81 public Amp(ST_dtdisc_s me) {
82 parent = me;
83 }
84
85 @Override
86 public boolean isSameThan(StarStruct other) {
87 final Amp other2 = (Amp) other;
88 return parent == other2.parent;
89 }
90
91 @Override
92 public __ptr__ getPtr(String fieldName) {
93 if (fieldName.equals("memoryf")) {
94 return memoryf;
95 }
96 if (fieldName.equals("eventf")) {
97 return eventf;
98 }
99 if (fieldName.equals("comparf")) {
100 return comparf;
101 }
102 if (fieldName.equals("makef")) {
103 return makef;
104 }
105 return super.getPtr(fieldName);
106 }
107
108 @Override
109 public int getInt(String fieldName) {
110 if (fieldName.equals("key")) {
111 return key;
112 }
113 if (fieldName.equals("size")) {
114 return size;
115 }
116 if (fieldName.equals("link")) {
117 return link;
118 }
119 return super.getInt(fieldName);
120 }
121
122 @Override
123 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
124 if (fieldName.equals("memoryf")) {
125 memoryf = (CFunction) newData;
126 return newData;
127 }
128 return super.setPtr(fieldName, newData);
129 }
130 }
13180
13281 }
13382
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
5049 import smetana.core.amiga.StarStruct;
6564 // "{",
6665 // "Dtlink_t hdr",
6766 // "void* obj",
68 private final ST_dtlink_s hdr = new ST_dtlink_s(this);
69 private __ptr__ obj;
67 public final ST_dtlink_s hdr = new ST_dtlink_s(this);
68 public __ptr__ obj;
7069
7170 // "}");
7271
7372 @Override
74 public StarStruct amp() {
75 return new Amp();
76 }
77
78 public class Amp extends UnsupportedStarStruct {
79
80 }
81
82 @Override
8373 public __ptr__ castTo(Class dest) {
84 if (dest == _dthold_s.class) {
74 if (dest == ST_dthold_s.class) {
8575 return this;
8676 }
87 if (dest == _dtlink_s.class) {
77 if (dest == ST_dtlink_s.class) {
8878 return hdr;
8979 }
9080 return super.castTo(dest);
9989 return super.setPtr(fieldName, newData);
10090 }
10191
102 @Override
103 public __ptr__ getPtr(String fieldName) {
104 if (fieldName.equals("obj")) {
105 return this.obj;
106 }
107 return super.getPtr(fieldName);
108 }
10992 }
11093
11194 // struct _dthold_s
4545 package h;
4646
4747 import smetana.core.OFFSET;
48 import smetana.core.UnsupportedC;
49 import smetana.core.UnsupportedStarStruct;
5048 import smetana.core.UnsupportedStructAndPtr;
5149 import smetana.core.__ptr__;
5250 import smetana.core.__struct__;
5452
5553 public class ST_dtlink_s extends UnsupportedStructAndPtr implements WithParent {
5654
57 public ST_dtlink_s.Amp right;
58 public ST_dtlink_s.Amp _left;
55 public ST_dtlink_s right;
56 public ST_dtlink_s _left;
5957 private final StarStruct parent;
60
58
6159 @Override
6260 public void copyDataFrom(__struct__ other) {
6361 ST_dtlink_s this2 = (ST_dtlink_s) other;
7775 return parent;
7876 }
7977
78 // @Override
79 // public __ptr__ castTo(Class dest) {
80 // if (dest == ST_dtlink_s.class) {
81 // // return amp();
82 // return this;
83 // }
84 // if (dest == _dthold_s.class) {
85 // return new LinkTo_dthold_s();
86 // }
87 // return super.castTo(dest);
88 // }
89
8090 @Override
8191 public __ptr__ castTo(Class dest) {
82 if (dest == _dtlink_s.class) {
83 return amp();
84 // return this;
85 }
86 if (dest == _dthold_s.class) {
87 return new LinkTo_dthold_s();
88 }
92 if (dest == ST_dtlink_s.class) {
93 return this;
94 }
95 // if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) {
96 // return (ST_refstr_t) getParent();
97 // }
98 if (dest == ST_dthold_s.class && getParent() instanceof ST_dthold_s) {
99 // System.err.println("ITSME");
100 // System.err.println("getParent()=" + getParent());
101 return (ST_dthold_s) getParent();
102
103 }
104 System.err.println("dest=" + dest);
89105 return super.castTo(dest);
90106 }
91107
108 public ST_dthold_s castTo_ST_dthold_s() {
109 if (getParent() instanceof ST_dthold_s) {
110 return (ST_dthold_s) getParent();
111 }
112 throw new UnsupportedOperationException();
113 }
114
92115 class LinkTo_dthold_s extends UnsupportedStructAndPtr {
93116
94 @Override
95 public __ptr__ getPtr(String fieldName) {
96 if (fieldName.equals("obj")) {
97 return new LinkTo_Obj();
98 }
99 return super.getPtr(fieldName);
100 }
101
102117 }
103118
104119 class LinkTo_Obj extends UnsupportedStructAndPtr {
106121 }
107122
108123 @Override
109 public StarStruct amp() {
110 return new Amp();
111 }
112
113 public class Amp extends UnsupportedStarStruct {
114 @Override
115 public __ptr__ castTo(Class dest) {
116 if (dest == _dtlink_s.class) {
117 return this;
118 }
119 if (dest == refstr_t.class && getParent() instanceof ST_refstr_t) {
120 return (ST_refstr_t) getParent();
121 }
122 if (dest == _dthold_s.class && getParent() instanceof ST_dthold_s) {
123 // System.err.println("ITSME");
124 // System.err.println("getParent()=" + getParent());
125 return (ST_dthold_s) getParent();
126
127 }
128 System.err.println("dest=" + dest);
129 return super.castTo(dest);
130 }
131
132 @Override
133 public Object addVirtualBytes(int virtualBytes) {
134 if (virtualBytes == 0) {
135 return this;
136 }
137 if (virtualBytes < 0) {
138 final OFFSET offset = OFFSET.fromInt(-virtualBytes);
139 if (offset.toString().equals("h.Agsubnode_s::id_link")) {
140 return ((ST_Agsubnode_s) parent).from_id_link(ST_dtlink_s.this);
141 }
142 if (offset.toString().equals("h.Agsubnode_s::seq_link")) {
143 return ((ST_Agsubnode_s) parent).from_seq_link(ST_dtlink_s.this);
144 }
145 if (offset.toString().equals("h.Agsym_s::link")) {
146 return ((ST_Agsym_s) parent).from_link(ST_dtlink_s.this);
147 }
148 if (offset.toString().equals("h.Agedge_s::seq_link")) {
149 return ((ST_Agedge_s) parent).from_seq_link(ST_dtlink_s.this);
150 }
151 if (offset.toString().equals("h.Agedge_s::id_link")) {
152 return ((ST_Agedge_s) parent).from_id_link(ST_dtlink_s.this);
153 }
154 if (offset.toString().equals("h.Agraph_s::link")) {
155 return ((ST_Agraph_s) parent).from_link(ST_dtlink_s.this);
156 }
157 System.err.println("virtualBytes=" + virtualBytes);
158 System.err.println("offset=" + offset);
159 return super.addVirtualBytes(virtualBytes);
160 }
161 final OFFSET offset = OFFSET.fromInt(virtualBytes);
162 if (offset.toString().equals("h.refstr_t::s") && parent instanceof ST_refstr_t) {
163 return ((ST_refstr_t) parent).to_s(ST_dtlink_s.this);
164
124 public Object addVirtualBytes(int virtualBytes) {
125 if (virtualBytes == 0) {
126 return this;
127 }
128 if (virtualBytes < 0) {
129 final OFFSET offset = OFFSET.fromInt(-virtualBytes);
130 if (offset.toString().equals("h.ST_Agsubnode_s::id_link")) {
131 return ((ST_Agsubnode_s) parent).from_id_link(ST_dtlink_s.this);
132 }
133 if (offset.toString().equals("h.ST_Agsubnode_s::seq_link")) {
134 return ((ST_Agsubnode_s) parent).from_seq_link(ST_dtlink_s.this);
135 }
136 if (offset.toString().equals("h.ST_Agsym_s::link")) {
137 return ((ST_Agsym_s) parent).from_link(ST_dtlink_s.this);
138 }
139 if (offset.toString().equals("h.ST_Agedge_s::seq_link")) {
140 return ((ST_Agedge_s) parent).from_seq_link(ST_dtlink_s.this);
141 }
142 if (offset.toString().equals("h.ST_Agedge_s::id_link")) {
143 return ((ST_Agedge_s) parent).from_id_link(ST_dtlink_s.this);
144 }
145 if (offset.toString().equals("h.ST_Agraph_s::link")) {
146 return ((ST_Agraph_s) parent).from_link(ST_dtlink_s.this);
165147 }
166148 System.err.println("virtualBytes=" + virtualBytes);
167149 System.err.println("offset=" + offset);
168150 return super.addVirtualBytes(virtualBytes);
169151 }
170
171 @Override
172 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
173 return ST_dtlink_s.this.setPtr(fieldName, newData);
174 }
175
176 @Override
177 public __ptr__ getPtr(String fieldName) {
178 return ST_dtlink_s.this.getPtr(fieldName);
179 }
180 }
181
182 @Override
183 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
184 if (fieldName.equals("hl._left")) {
185 this._left = (ST_dtlink_s.Amp) newData;
186 return _left;
187 }
188 if (fieldName.equals("right")) {
189 this.right = (ST_dtlink_s.Amp) newData;
190 return right;
191 }
192 return super.setPtr(fieldName, newData);
193 }
194
195 @Override
196 public __ptr__ getPtr(String fieldName) {
197 if (fieldName.equals("hl._left")) {
198 return _left;
199 }
200 if (fieldName.equals("right")) {
201 return right;
202 }
203 return super.getPtr(fieldName);
204 }
152 final OFFSET offset = OFFSET.fromInt(virtualBytes);
153 if (offset.toString().equals("h.ST_refstr_t::s") && parent instanceof ST_refstr_t) {
154 return ((ST_refstr_t) parent).to_s(ST_dtlink_s.this);
155
156 }
157 System.err.println("virtualBytes=" + virtualBytes);
158 System.err.println("offset=" + offset);
159 return super.addVirtualBytes(virtualBytes);
160 }
161
162 // @Override
163 // public __ptr__ setPtr(String fieldName, __ptr__ newData) {
164 // if (fieldName.equals("hl._left")) {
165 // this._left = (ST_dtlink_s) newData;
166 // return _left;
167 // }
168 // if (fieldName.equals("right")) {
169 // this.right = (ST_dtlink_s) newData;
170 // return right;
171 // }
172 // return super.setPtr(fieldName, newData);
173 // }
174
175 // @Override
176 // public __ptr__ getPtr(String fieldName) {
177 // // if (fieldName.equals("hl._left")) {
178 // // return _left;
179 // // }
180 // if (fieldName.equals("right")) {
181 // return right;
182 // }
183 // return super.getPtr(fieldName);
184 // }
205185
206186 // public interface ST_dtlink_s extends __ptr__ {
207187 // public static List<String> DEFINITION = Arrays.asList(
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_dtmethod_s extends UnsupportedStructAndPtr {
5452
6967 return result;
7068 }
7169
72 @Override
73 public StarStruct amp() {
74 return new Amp();
75 }
76
77 public class Amp extends UnsupportedStarStruct {
78 @Override
79 public int getInt(String fieldName) {
80 if (fieldName.equals("type")) {
81 return type;
82 }
83 return super.getInt(fieldName);
84 }
85
86 @Override
87 public __ptr__ getPtr(String fieldName) {
88 if (fieldName.equals("searchf")) {
89 return searchf;
90 }
91 return super.getPtr(fieldName);
92 }
93
94 @Override
95 public Object call(String fieldName, Object... args) {
96 if (fieldName.equals("searchf")) {
97 return searchf.exe(args);
98 }
99 return super.call(fieldName, args);
100 }
101 }
102
10370 }
4848 import java.util.List;
4949
5050 import smetana.core.HardcodedStruct;
51 import smetana.core.UnsupportedArrayOfPtr;
52 import smetana.core.UnsupportedStarStruct;
5351 import smetana.core.UnsupportedStructAndPtr;
54 import smetana.core.__array_of_ptr__;
5552 import smetana.core.__ptr__;
5653 import smetana.core.__struct__;
5754 import smetana.core.amiga.StarStruct;
5956 public class ST_elist extends UnsupportedStructAndPtr implements HardcodedStruct {
6057
6158 public int size;
62 private List list;
59 public List<ST_Agedge_s> list;
6360
6461 public ST_elist() {
6562 this(null);
7370 ST_elist other2 = (ST_elist) other;
7471 this.size = other2.size;
7572 this.list = other2.list;
73 }
74
75 @Override
76 public void setStruct(__struct__ value) {
77 copyDataFrom(value);
7678 }
7779
7880 @Override
9496 return list != null;
9597 }
9698
97 public void mallocEmpty(Class cl, int nb) {
98 list = new ArrayList();
99 public void mallocEmpty(int nb) {
100 list = new ArrayList<ST_Agedge_s>();
99101 while (list.size() < nb) {
100102 list.add(null);
101103 }
102104 }
103105
104 class ArrayOfPtr extends UnsupportedArrayOfPtr {
105
106 private int pos;
107
108 private ArrayOfPtr(int pos) {
109 this.pos = pos;
110 }
111
112 @Override
113 public __array_of_ptr__ plus(int delta) {
114 return new ArrayOfPtr(pos + delta);
115 }
116
117 @Override
118 public void setPtr(__ptr__ value) {
119 list.set(pos, value);
120 }
121
122 @Override
123 public __ptr__ getPtr() {
124 return (__ptr__) list.get(pos);
125 }
126
127 }
128
129 class Amp extends UnsupportedStarStruct {
130
131 @Override
132 public int getInt(String fieldName) {
133 if (fieldName.equals("size")) {
134 return size;
135 }
136 return ST_elist.this.getInt(fieldName);
137 }
138
139 @Override
140 public void setInt(String fieldName, int data) {
141 if (fieldName.equals("size")) {
142 size = data;
143 return;
144 }
145 ST_elist.this.setInt(fieldName, data);
146 }
147
148 @Override
149 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
150 if (fieldName.equals("list")) {
151 if (list == null) {
152 return null;
153 }
154 return new ArrayOfPtr(0);
155 }
156 return ST_elist.this.getArrayOfPtr(fieldName);
157 }
158
159 }
160
161 @Override
162 public StarStruct amp() {
163 return new Amp();
164 }
165106
166107 public void realloc(int nb) {
167108 if (list == null) {
168 list = new ArrayList();
109 list = new ArrayList<ST_Agedge_s>();
169110 }
170111 while (list.size() < nb) {
171112 list.add(null);
172113 }
173114 }
174115
175 class Ptr extends UnsupportedStructAndPtr {
176
177 private final int pos;
178
179 public Ptr(int pos) {
180 this.pos = pos;
181 }
182
183 @Override
184 public __ptr__ plus(int pointerMove) {
185 return new Ptr(pos + pointerMove);
186 }
187
188 @Override
189 public __ptr__ getPtr() {
190 return (__ptr__) list.get(pos);
191 }
192
193 }
194116
195117 public void free() {
196118 list = null;
197119 }
198120
199121 public void setInList(int idx, Object value) {
200 list.set(idx, value);
122 list.set(idx, (ST_Agedge_s) value);
201123 }
202124
203125 public __ptr__ getFromList(int i) {
204126 return (__ptr__) list.get(i);
205127 }
206128
207 public __ptr__ getTheList() {
208 if (list == null) {
209 throw new IllegalStateException();
210 }
211 return new Ptr(0);
212 }
213
214 public __array_of_ptr__ getTheArray() {
215 if (list == null) {
216 throw new IllegalStateException();
217 }
218 return new ArrayOfPtr(0);
219 }
220129
221130 // public static List<String> DEFINITION = Arrays.asList(
222131 // "typedef struct elist",
4545 package h;
4646
4747 import smetana.core.CString;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.amiga.StarStruct;
6261 this.parent = parent;
6362 }
6463
65 @Override
66 public StarStruct amp() {
67 return new Amp();
68 }
69
70 public class Amp extends UnsupportedStarStruct {
71
72 @Override
73 public void setDouble(String fieldName, double data) {
74 ST_fontinfo.this.setDouble(fieldName, data);
75 }
76
77 @Override
78 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
79 return ST_fontinfo.this.setPtr(fieldName, newData);
80 }
81
82 @Override
83 public __ptr__ getPtr(String fieldName) {
84 return ST_fontinfo.this.getPtr(fieldName);
85 }
86
87 @Override
88 public double getDouble(String fieldName) {
89 return ST_fontinfo.this.getDouble(fieldName);
90 }
91
92 @Override
93 public CString getCString(String fieldName) {
94 return ST_fontinfo.this.getCString(fieldName);
95 }
96
97 }
98
9964 // "struct fontinfo",
10065 // "{",
101 private double fontsize;
102 private CString fontname;
103 private CString fontcolor;
66 public double fontsize;
67 public CString fontname;
68 public CString fontcolor;
10469
10570 // "}");
106
107 @Override
108 public double getDouble(String fieldName) {
109 if (fieldName.equals("fontsize")) {
110 return this.fontsize;
111 }
112 return super.getDouble(fieldName);
113 }
11471
11572 @Override
11673 public void setDouble(String fieldName, double data) {
12178 super.setDouble(fieldName, data);
12279 }
12380
124 @Override
125 public CString getCString(String fieldName) {
126 if (fieldName.equals("fontname")) {
127 return this.fontname;
128 }
129 if (fieldName.equals("fontcolor")) {
130 return this.fontcolor;
131 }
132 return super.getCString(fieldName);
133 }
134
135 @Override
136 public __ptr__ getPtr(String fieldName) {
137 if (fieldName.equals("fontname")) {
138 return this.fontname;
139 }
140 if (fieldName.equals("fontcolor")) {
141 return this.fontcolor;
142 }
143 return super.getPtr(fieldName);
144 }
14581
14682 @Override
14783 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_gvlayout_engine_s extends UnsupportedStructAndPtr {
5452
55 private CFunction layout;
56 private CFunction cleanup;
53 public CFunction layout;
54 public CFunction cleanup;
5755
5856 // "struct gvlayout_engine_s",
5957 // "{",
7472 return super.setPtr(fieldName, newData);
7573 }
7674
77 @Override
78 public __ptr__ getPtr(String fieldName) {
79 if (fieldName.equals("layout")) {
80 return layout;
81 }
82 if (fieldName.equals("cleanup")) {
83 return cleanup;
84 }
85 return super.getPtr(fieldName);
86 }
8775
88 @Override
89 public StarStruct amp() {
90 return new Amp();
91 }
92
93 public class Amp extends UnsupportedStarStruct {
94
95 @Override
96 public __ptr__ getPtr(String fieldName) {
97 return ST_gvlayout_engine_s.this.getPtr(fieldName);
98 }
99
100 @Override
101 public Object call(String fieldName, Object... args) {
102 if (fieldName.equals("layout")) {
103 return layout.exe(args);
104 }
105 if (fieldName.equals("cleanup")) {
106 return cleanup.exe(args);
107 }
108 return super.call(fieldName, args);
109 }
110 }
11176 }
11277
11378 // struct gvlayout_engine_s {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.amiga.StarStruct;
5048
5149 public class ST_gvlayout_features_t extends UnsupportedStructAndPtr {
5250
5351 // "typedef struct",
5452 // "{",
55 private int flags;
53 public int flags;
5654
5755 // "}",
5856 // "gvlayout_features_t");
6664 super.setInt(fieldName, data);
6765 }
6866
69 @Override
70 public StarStruct amp() {
71 return new Amp();
72 }
73
74 public class Amp extends UnsupportedStarStruct {
75
76 @Override
77 public int getInt(String fieldName) {
78 if (fieldName.equals("flags")) {
79 return flags;
80 }
81 return super.getInt(fieldName);
82 }
83 }
8467
8568 }
8669
5050
5151 public class ST_gvplugin_active_layout_t extends UnsupportedStructAndPtr {
5252
53 private ST_gvlayout_engine_s.Amp engine;
53 public ST_gvlayout_engine_s engine;
5454 private int id;
55 private ST_gvlayout_features_t.Amp features;
56 private CString type;
55 public ST_gvlayout_features_t features;
56 public CString type;
5757
5858 // "}",
5959
6464 return newData;
6565 }
6666 if (fieldName.equals("engine")) {
67 this.engine = (ST_gvlayout_engine_s.Amp) newData;
67 this.engine = (ST_gvlayout_engine_s) newData;
6868 return newData;
6969 }
7070 if (fieldName.equals("features")) {
71 this.features = (ST_gvlayout_features_t.Amp) newData;
71 this.features = (ST_gvlayout_features_t) newData;
7272 return newData;
7373 }
7474 return super.setPtr(fieldName, newData);
7575 }
7676
77 @Override
78 public __ptr__ getPtr(String fieldName) {
79 if (fieldName.equals("engine")) {
80 return engine;
81 }
82 if (fieldName.equals("features")) {
83 return features;
84 }
85 return super.getPtr(fieldName);
86 }
87
8877 @Override
8978 public void setInt(String fieldName, int data) {
9079 if (fieldName.equals("id")) {
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46
47 import smetana.core.UnsupportedStructAndPtr;
48 import smetana.core.amiga.StarStruct;
49
50 public class ST_gvplugin_available_s extends UnsupportedStructAndPtr {
51
52 private final StarStruct parent;
53
54 // gvplugin_available_t *next; /* next plugin in linked list, or NULL */
55 // const char *typestr; /* type string, e.g. "png" or "ps" */
56 // int quality; /* Programmer assigned quality ranking within type (+ve or -ve int).
57 // First implementation of type should be given "0" quality */
58 // gvplugin_package_t *package; /* details of library containing plugin */
59 // gvplugin_installed_t *typeptr; /* pointer to jumptable for plugin,
60 // or NULL if not yet loaded */
61
62 public ST_gvplugin_available_s() {
63 this(null);
64 }
65
66 public ST_gvplugin_available_s(StarStruct parent) {
67 this.parent = parent;
68 }
69
70 // struct gvplugin_available_s {
71 // gvplugin_available_t *next; /* next plugin in linked list, or NULL */
72 // const char *typestr; /* type string, e.g. "png" or "ps" */
73 // int quality; /* Programmer assigned quality ranking within type (+ve or -ve int).
74 // First implementation of type should be given "0" quality */
75 // gvplugin_package_t *package; /* details of library containing plugin */
76 // gvplugin_installed_t *typeptr; /* pointer to jumptable for plugin,
77 // or NULL if not yet loaded */
78 // };
79
80 }
6161 this.parent = parent;
6262 }
6363
64 private int id;
65 private CString type;
66 private int quality;
64 public int id;
65 public CString type;
66 public int quality;
6767
68 private ST_gvlayout_engine_s.Amp engine;
69 private ST_gvlayout_features_t.Amp features;
68 public ST_gvlayout_engine_s engine;
69 public ST_gvlayout_features_t features;
7070
7171 @Override
7272 public void setInt(String fieldName, int data) {
8181 super.setInt(fieldName, data);
8282 }
8383
84 @Override
85 public int getInt(String fieldName) {
86 if (fieldName.equals("id")) {
87 return this.id;
88 }
89 return super.getInt(fieldName);
90 }
9184
9285 @Override
9386 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
9689 return newData;
9790 }
9891 if (fieldName.equals("engine")) {
99 this.engine = (ST_gvlayout_engine_s.Amp) newData;
92 this.engine = (ST_gvlayout_engine_s) newData;
10093 return newData;
10194 }
10295 if (fieldName.equals("features")) {
103 this.features = (ST_gvlayout_features_t.Amp) newData;
96 this.features = (ST_gvlayout_features_t) newData;
10497 return newData;
10598 }
10699 return super.setPtr(fieldName, newData);
107 }
108
109 @Override
110 public __ptr__ getPtr(String fieldName) {
111 if (fieldName.equals("type")) {
112 return type;
113 }
114 if (fieldName.equals("engine")) {
115 return engine;
116 }
117 if (fieldName.equals("features")) {
118 return features;
119 }
120 return super.getPtr(fieldName);
121100 }
122101
123102 }
4545 package h;
4646
4747 import smetana.core.MutableDoublePtr;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarArrayOfStruct;
5250 import smetana.core.amiga.StarStruct;
5351
5452 public class ST_inside_t extends UnsupportedStructAndPtr {
6866 // "struct",
6967 // "{",
7068 // "pointf* p",
71 private StarArrayOfStruct p;
72 private MutableDoublePtr r;
69 public ST_pointf.Array a_p;
70 public MutableDoublePtr a_r;
7371 // "double* r",
7472 // "}",
7573 // "a",
7674 // "struct",
7775 // "{",
7876 // "node_t* n",
79 private ST_Agnode_s n;
80 private ST_boxf bp;
77 public ST_Agnode_s s_n;
78 public ST_boxf s_bp;
8179
8280 // "boxf* bp",
8381 // "}",
8583 // "}",
8684 // "inside_t");
8785
88 @Override
89 public StarStruct amp() {
90 return new Amp();
91 }
92
93 public class Amp extends UnsupportedStarStruct {
94 @Override
95 public __ptr__ getPtr(String fieldName) {
96 return ST_inside_t.this.getPtr(fieldName);
97 }
98 }
9986
10087 @Override
10188 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
10289 if (fieldName.equals("s.n")) {
103 this.n = (ST_Agnode_s) newData;
104 return this.n;
90 this.s_n = (ST_Agnode_s) newData;
91 return this.s_n;
10592 }
10693 if (fieldName.equals("s.bp")) {
107 this.bp = (ST_boxf) newData;
108 return this.bp;
94 this.s_bp = (ST_boxf) newData;
95 return this.s_bp;
10996 }
11097 if (fieldName.equals("a.p")) {
111 this.p = (StarArrayOfStruct) newData;
112 return this.p;
98 this.a_p = (ST_pointf.Array) newData;
99 return this.a_p;
113100 }
114101 if (fieldName.equals("a.r")) {
115 this.r = (MutableDoublePtr) newData;
116 return this.r;
102 this.a_r = (MutableDoublePtr) newData;
103 return this.a_r;
117104 }
118105 return super.setPtr(fieldName, newData);
119106 }
120107
121 @Override
122 public __ptr__ getPtr(String fieldName) {
123 if (fieldName.equals("s.n")) {
124 return this.n;
125 }
126 if (fieldName.equals("s.bp")) {
127 return this.bp;
128 }
129 if (fieldName.equals("a.p")) {
130 return this.p;
131 }
132 if (fieldName.equals("a.r")) {
133 return this.r;
134 }
135 return super.getPtr(fieldName);
136 }
137108
138109 }
139110
4444 */
4545 package h;
4646
47 import h.ST_label_params_t.Amp;
48
49 import java.util.Arrays;
50 import java.util.List;
51
52 import smetana.core.UnsupportedStarStruct;
5347 import smetana.core.UnsupportedStructAndPtr;
54 import smetana.core.__ptr__;
5548 import smetana.core.__struct__;
5649 import smetana.core.amiga.StarStruct;
5750
6962
7063 // "typedef struct",
7164 // "{",
72 private final ST_boxf bb = new ST_boxf(this);
73 private boolean force;
65 public final ST_boxf bb = new ST_boxf(this);
66 public boolean force;
7467
7568 // "}",
7669 // "label_params_t");
77
78 @Override
79 public StarStruct amp() {
80 return new Amp();
81 }
82
83 public class Amp extends UnsupportedStarStruct {
84
85 }
8670
8771 @Override
8872 public void setStruct(String fieldName, __struct__ newData) {
9276 }
9377 super.setStruct(fieldName, newData);
9478 }
95
96 @Override
97 public void setBoolean(String fieldName, boolean data) {
98 if (fieldName.equals("force")) {
99 this.force = data;
100 return;
101 }
102 super.setBoolean(fieldName, data);
103 }
79
10480 }
10581
10682 // typedef struct {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__ptr__;
50 import smetana.core.__struct__;
5149 import smetana.core.amiga.StarStruct;
5250
5351 public class ST_layout_t extends UnsupportedStructAndPtr {
6260 this.parent = parent;
6361 }
6462
65 @Override
66 public StarStruct amp() {
67 return new Amp();
68 }
63 public double quantum;
64 public double scale;
65 public double ratio;
66 public double dpi;
6967
70 public class Amp extends UnsupportedStarStruct {
71 }
68 public ST_pointf margin = new ST_pointf(this);
69 public ST_pointf page = new ST_pointf(this);
70 public ST_pointf size = new ST_pointf(this);
7271
73 private double quantum;
74 private double scale;
75 private double ratio;
76 private double dpi;
77
78 private ST_pointf margin = new ST_pointf(this);
79 private ST_pointf page = new ST_pointf(this);
80 private ST_pointf size = new ST_pointf(this);
81
82 private boolean filled;
83 private boolean landscape;
84 private boolean centered;
72 public boolean filled;
73 public boolean landscape;
74 public boolean centered;
8575
8676 // "ratio_t ratio_kind",
87 private int ratio_kind;
77 public int ratio_kind;
8878 // "void* xdots",
8979 // "char* id",
9080
9484 return null;
9585 }
9686 return super.setPtr(fieldName, newData);
97 }
98
99 @Override
100 public __struct__ getStruct(String fieldName) {
101 if (fieldName.equals("margin")) {
102 return margin;
103 }
104 if (fieldName.equals("page")) {
105 return page;
106 }
107 if (fieldName.equals("size")) {
108 return size;
109 }
110 return super.getStruct(fieldName);
111 }
112
113 @Override
114 public void setBoolean(String fieldName, boolean data) {
115 if (fieldName.equals("filled")) {
116 this.filled = data;
117 return;
118 }
119 if (fieldName.equals("landscape")) {
120 this.landscape = data;
121 return;
122 }
123 if (fieldName.equals("centered")) {
124 this.centered = data;
125 return;
126 }
127 super.setBoolean(fieldName, data);
128 }
129
130 @Override
131 public double getDouble(String fieldName) {
132 if (fieldName.equals("quantum")) {
133 return this.quantum;
134 }
135 if (fieldName.equals("scale")) {
136 return this.scale;
137 }
138 if (fieldName.equals("ratio")) {
139 return this.ratio;
140 }
141 if (fieldName.equals("dpi")) {
142 return this.dpi;
143 }
144 return super.getDouble(fieldName);
14587 }
14688
14789 @Override
165107 super.setDouble(fieldName, data);
166108 }
167109
168 @Override
169 public int getInt(String fieldName) {
170 if (fieldName.equals("ratio_kind")) {
171 return this.ratio_kind;
172 }
173 return super.getInt(fieldName);
174 }
175110 }
176111
177112 // typedef struct layout_t {
4949
5050 import smetana.core.HardcodedStruct;
5151 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__ptr__;
5352 import smetana.core.amiga.StarStruct;
5453
5554 public class ST_nlist_t extends UnsupportedStructAndPtr implements HardcodedStruct {
5655
5756 // public __ptr__ list;
5857 public int size;
59 private final List data = new ArrayList();
58 private final List<ST_Agnode_s> data = new ArrayList<ST_Agnode_s>();
6059
6160 public ST_nlist_t(StarStruct parent) {
6261 }
6564 this(null);
6665 }
6766
68 public void reallocEmpty(int n_nodes, Class<Agnode_s> class1) {
67 public void reallocEmpty(int n_nodes) {
6968 while (data.size() < n_nodes) {
7069 data.add(null);
7170 }
7271 }
7372
74 public void allocEmpty(int n_nodes, Class<Agnode_s> class1) {
73 public void allocEmpty(int n_nodes) {
7574 data.clear();
76 reallocEmpty(n_nodes, class1);
75 reallocEmpty(n_nodes);
7776 }
7877
79 public void setInList(int idx, Agnode_s value) {
78 public void setInList(int idx, ST_Agnode_s value) {
8079 data.set(idx, value);
8180 }
8281
83 public __ptr__ getFromList(int i) {
84 return (__ptr__) data.get(i);
82 public ST_Agnode_s getFromList(int i) {
83 return data.get(i);
8584 }
8685
8786 public void resetList() {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__array_of_ptr__;
5048 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarArrayOfPtr;
5249 import smetana.core.amiga.StarStruct;
5350
5451 public class ST_nodequeue extends UnsupportedStructAndPtr {
6360 this.parent = parent;
6461 }
6562
66 @Override
67 public StarStruct amp() {
68 return new Amp();
69 }
70
71 public class Amp extends UnsupportedStarStruct {
72
73 }
74
7563 // "typedef struct nodequeue",
7664 // "{",
7765 // "node_t **store, **limit, **head, **tail",
78 private StarArrayOfPtr store;
79 private StarArrayOfPtr tail;
80 private StarArrayOfPtr head;
81 private StarArrayOfPtr limit;
66 public ST_Agnode_s.ArrayOfStar store;
67 public ST_Agnode_s.ArrayOfStar tail;
68 public ST_Agnode_s.ArrayOfStar head;
69 public ST_Agnode_s.ArrayOfStar limit;
8270
8371 // "}",
8472 // "nodequeue");
8674 @Override
8775 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
8876 if (fieldName.equals("store")) {
89 this.store = (StarArrayOfPtr) newData;
77 this.store = (ST_Agnode_s.ArrayOfStar) newData;
9078 return this.store;
9179 }
9280 if (fieldName.equals("tail")) {
93 this.tail = (StarArrayOfPtr) newData;
81 this.tail = (ST_Agnode_s.ArrayOfStar) newData;
9482 return this.tail;
9583 }
9684 if (fieldName.equals("head")) {
97 this.head = (StarArrayOfPtr) newData;
85 this.head = (ST_Agnode_s.ArrayOfStar) newData;
9886 return this.head;
9987 }
10088 if (fieldName.equals("limit")) {
101 this.limit = (StarArrayOfPtr) newData;
89 this.limit = (ST_Agnode_s.ArrayOfStar) newData;
10290 return this.limit;
10391 }
10492 return super.setPtr(fieldName, newData);
10593 }
10694
107 @Override
108 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
109 if (fieldName.equals("store")) {
110 return this.store.getInternalArray();
111 }
112 if (fieldName.equals("tail")) {
113 return this.tail.getInternalArray();
114 }
115 if (fieldName.equals("head")) {
116 return this.head.getInternalArray();
117 }
118 if (fieldName.equals("limit")) {
119 return this.limit.getInternalArray();
120 }
121 return super.getArrayOfPtr(fieldName);
122 }
123
124 @Override
125 public __ptr__ getPtr(String fieldName) {
126 if (fieldName.equals("store")) {
127 return this.store;
128 }
129 if (fieldName.equals("tail")) {
130 return this.tail;
131 }
132 if (fieldName.equals("head")) {
133 return this.head;
134 }
135 if (fieldName.equals("limit")) {
136 return this.limit;
137 }
138 return super.getPtr(fieldName);
139 }
14095 }
14196
14297 // typedef struct nodequeue {
4444 */
4545 package h;
4646
47 import h.ST_object_t.Amp;
48
49 import java.util.Arrays;
47 import java.util.ArrayList;
5048 import java.util.List;
5149
52 import smetana.core.UnsupportedSize_t;
53 import smetana.core.UnsupportedStarStruct;
50 import smetana.core.UnsupportedArrayOfStruct2;
5451 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_ptr__;
5553 import smetana.core.__ptr__;
5654 import smetana.core.__struct__;
5755 import smetana.core.size_t;
58 import smetana.core.amiga.StarArrayOfPtr;
5956 import smetana.core.amiga.StarStruct;
6057
61 public class ST_object_t extends UnsupportedStructAndPtr {
58 public class ST_object_t extends UnsupportedStructAndPtr implements ST_Node_t___or_object_t {
6259
6360 private final StarStruct parent;
6461
7269
7370 // "typedef struct",
7471 // "{",
75 private final ST_pointf pos = new ST_pointf(this);
76 private final ST_pointf sz = new ST_pointf(this);
72 public final ST_pointf pos = new ST_pointf(this);
73 public final ST_pointf sz = new ST_pointf(this);
7774 // "xlabel_t *lbl",
78 private StarArrayOfPtr lbl;
75 public ST_xlabel_t.Array lbl;
7976
8077 // "}",
8178 // "object_t");
8279
8380 @Override
84 public StarStruct amp() {
85 return new Amp();
86 }
87
88 public class Amp extends UnsupportedStarStruct {
81 public ST_object_t getStruct() {
82 return this;
83 }
84
85 @Override
86 public ST_object_t getPtr() {
87 return this;
88 }
89
90 @Override
91 public boolean isSameThan(StarStruct other) {
92 ST_object_t other2 = (ST_object_t) other;
93 return this == other2;
94 }
95
96 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__ {
97
98 private final List<ST_object_t> data;
99 private final int pos;
100
101 @Override
102 public Array asPtr() {
103 return this;
104 }
105
106 @Override
107 public ST_object_t getStruct() {
108 return get(0);
109 }
110
111
112 @Override
113 public __ptr__ setPtr(String fieldName, __ptr__ data) {
114 return get(0).setPtr(fieldName, data);
115 }
116
117 @Override
118 public void setStruct(String fieldName, __struct__ data) {
119 get(0).setStruct(fieldName, data);
120 }
121
122 public Array(int size) {
123 this.data = new ArrayList<ST_object_t>();
124 this.pos = 0;
125 for (int i = 0; i < size; i++) {
126 data.add(new ST_object_t());
127 }
128 }
129
130 public Array reallocJ(int newsize) {
131 while (data.size() < newsize) {
132 data.add(new ST_object_t());
133 }
134 return this;
135 }
136
137 public Array plus(int delta) {
138 return plusJ(delta);
139 }
140
141 private Array(List<ST_object_t> data, int pos) {
142 this.data = data;
143 this.pos = pos;
144 }
145
146 public ST_object_t get(int i) {
147 return this.data.get(pos + i);
148 }
149
150 public Array plusJ(int i) {
151 return new Array(data, pos + i);
152 }
153
154 public int minus(Array other) {
155 if (this.data != other.data) {
156 throw new IllegalArgumentException();
157 }
158 return this.pos - other.pos;
159 }
160
161 public Array move(int delta) {
162 throw new UnsupportedOperationException(getClass().toString());
163 }
164
165 public void realloc(size_t nb) {
166 throw new UnsupportedOperationException(getClass().toString());
167 }
168
169 public int comparePointerInternal(__array_of_ptr__ other) {
170 throw new UnsupportedOperationException(getClass().toString());
171 }
172
89173
90174 }
91175
96180 return newData;
97181 }
98182 if (fieldName.equals("lbl")) {
99 this.lbl = (StarArrayOfPtr) newData;
183 this.lbl = (ST_xlabel_t.Array) newData;
100184 return this.lbl;
101185 }
102186 return super.setPtr(fieldName, newData);
103 }
104
105 @Override
106 public __struct__ getStruct(String fieldName) {
107 if (fieldName.equals("pos")) {
108 return this.pos;
109 }
110 if (fieldName.equals("sz")) {
111 return this.sz;
112 }
113 return super.getStruct(fieldName);
114187 }
115188
116189 @Override
124197 return;
125198 }
126199 super.setStruct(fieldName, newData);
127 }
128
129 @Override
130 public __ptr__ getPtr(String fieldName) {
131 if (fieldName.equals("pos")) {
132 return this.pos;
133 }
134 if (fieldName.equals("sz")) {
135 return this.sz;
136 }
137 return super.getPtr(fieldName);
138 }
139
140 public static size_t sizeof(final int nb) {
141 return new UnsupportedSize_t(nb) {
142 @Override
143 public Object malloc() {
144 return new StarArrayOfPtr(new STArray<ST_object_t>(nb, 0, ST_object_t.class));
145 }
146
147 @Override
148 public int getInternalNb() {
149 return nb;
150 }
151
152 @Override
153 public Object realloc(Object old) {
154 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
155 old2.realloc(nb);
156 return old2;
157 }
158 };
159200 }
160201
161202 }
4444 */
4545 package h;
4646
47 import h.ST_pack_info.Amp;
48
49 import java.util.Arrays;
50 import java.util.List;
51
52 import smetana.core.UnsupportedStarStruct;
5347 import smetana.core.UnsupportedStructAndPtr;
5448 import smetana.core.__ptr__;
5549 import smetana.core.amiga.StarStruct;
6660 this.parent = parent;
6761 }
6862
69 @Override
70 public StarStruct amp() {
71 return new Amp();
72 }
73
74 public class Amp extends UnsupportedStarStruct {
75
76 }
77
7863 // "typedef struct",
7964 // "{",
8065 // "float aspect",
81 private int sz;
82 private int margin;
66 public int sz;
67 public int margin;
8368 private int doSplines;
8469 // "pack_mode mode",
85 private int mode;
70 public int mode;
8671 private __ptr__ fixed;
8772 // "boolean *fixed",
8873 // "packval_t* vals",
89 private __ptr__ vals;
90 private int flags;
74 public __ptr__ vals;
75 public int flags;
9176
9277 // "}",
9378 // "pack_info");
94
95 @Override
96 public int getInt(String fieldName) {
97 if (fieldName.equals("flags")) {
98 return this.flags;
99 }
100 if (fieldName.equals("mode")) {
101 return this.mode;
102 }
103 if (fieldName.equals("sz")) {
104 return this.sz;
105 }
106 if (fieldName.equals("margin")) {
107 return this.margin;
108 }
109 return super.getInt(fieldName);
110 }
11179
11280 @Override
11381 public void setInt(String fieldName, int data) {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__array_of_ptr__;
5048 import smetana.core.__ptr__;
51 import smetana.core.__struct__;
52 import smetana.core.amiga.StarArrayOfPtr;
5349 import smetana.core.amiga.StarStruct;
5450
5551 public class ST_path extends UnsupportedStructAndPtr {
6460 this.parent = parent;
6561 }
6662
67 @Override
68 public StarStruct amp() {
69 return new Amp();
70 }
71
72 public class Amp extends UnsupportedStarStruct {
73
74 }
75
7663 // "typedef struct path",
7764 // "{",
78 final ST_port start = new ST_port(this), end = new ST_port(this);
79 private int nbox;
65 final public ST_port start = new ST_port(this), end = new ST_port(this);
66 public int nbox;
8067 // "boxf *boxes",
81 private StarArrayOfPtr boxes;
68 public ST_boxf boxes[];
8269
83 private ST_Agedge_s.Amp data;
70 public ST_Agedge_s data;
8471
8572 // "void *data",
8673 // "}",
8875
8976 @Override
9077 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
91 if (fieldName.equals("boxes")) {
92 this.boxes = (StarArrayOfPtr) newData;
93 return this.boxes;
94 }
9578 if (fieldName.equals("data")) {
96 if (newData instanceof ST_Agedge_s) {
97 newData = ((ST_Agedge_s) newData).amp();
98 }
99 this.data = (ST_Agedge_s.Amp) newData;
79 this.data = (ST_Agedge_s) newData;
10080 return this.data;
10181 }
10282 return super.setPtr(fieldName, newData);
103 }
104
105 @Override
106 public __ptr__ getPtr(String fieldName) {
107 if (fieldName.equals("data")) {
108 return this.data;
109 }
110 if (fieldName.equals("boxes")) {
111 return this.boxes;
112 }
113 return super.getPtr(fieldName);
114 }
115
116 @Override
117 public __struct__ getStruct(String fieldName) {
118 if (fieldName.equals("start")) {
119 return start;
120 }
121 if (fieldName.equals("end")) {
122 return end;
123 }
124 return super.getStruct(fieldName);
125 }
126
127 @Override
128 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
129 if (fieldName.equals("boxes")) {
130 return boxes.getInternalArray();
131 }
132 return super.getArrayOfPtr(fieldName);
133 }
134
135 @Override
136 public int getInt(String fieldName) {
137 if (fieldName.equals("nbox")) {
138 return this.nbox;
139 }
140 return super.getInt(fieldName);
141 }
142
143 @Override
144 public void setInt(String fieldName, int data) {
145 if (fieldName.equals("nbox")) {
146 this.nbox = data;
147 return;
148 }
149 super.setInt(fieldName, data);
15083 }
15184
15285 }
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedArrayOfStruct;
48 import smetana.core.UnsupportedStarStruct;
4947 import smetana.core.UnsupportedStructAndPtr;
50 import smetana.core.__array_of_struct__;
48 import smetana.core.__ptr__;
5149 import smetana.core.__struct__;
5250 import smetana.core.amiga.StarStruct;
5351
6563
6664 // "typedef struct pathend_t",
6765 // "{",
68 private final ST_boxf nb = new ST_boxf(this);
69 private final ST_pointf np = new ST_pointf(this);
70 private int sidemask;
71 private int boxn;
66 public final ST_boxf nb = new ST_boxf(this);
67 public final ST_pointf np = new ST_pointf(this);
68 public int sidemask;
69 public int boxn;
7270
73 private final ST_boxf boxes[] = new ST_boxf[] { new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
71 public final ST_boxf boxes[] = new ST_boxf[] { new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
7472 new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
7573 new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(), new ST_boxf(),
7674 new ST_boxf(), new ST_boxf() };
7977 // "}",
8078 // "pathend_t");
8179
82 class ArrayOfTwenty extends UnsupportedArrayOfStruct {
83
84 final private int pos;
85
86 public ArrayOfTwenty(int pos) {
87 this.pos = pos;
88 }
89
90 @Override
91 public __array_of_struct__ plus(int delta) {
92 return new ArrayOfTwenty(pos + delta);
93 }
94
95 @Override
96 public __struct__ getStruct() {
97 return boxes[pos];
98 }
99
100 @Override
101 public void setStruct(__struct__ value) {
102 boxes[pos].copyDataFrom(value);
103 }
104
105 @Override
106 public double getDouble(String fieldName) {
107 return getStruct().getDouble(fieldName);
108 }
109
110 }
111
11280 @Override
113 public StarStruct amp() {
114 return new Amp();
115 }
116
117 public class Amp extends UnsupportedStarStruct {
118 @Override
119 public void setStruct(String fieldName, __struct__ newData) {
120 ST_pathend_t.this.setStruct(fieldName, newData);
121 }
122
123 @Override
124 public __array_of_struct__ getArrayOfStruct(String fieldName) {
125 return ST_pathend_t.this.getArrayOfStruct(fieldName);
126 }
127
128 @Override
129 public int getInt(String fieldName) {
130 return ST_pathend_t.this.getInt(fieldName);
131 }
132
133 @Override
134 public void setInt(String fieldName, int data) {
135 ST_pathend_t.this.setInt(fieldName, data);
136 }
137
138 @Override
139 public __struct__ getStruct(String fieldName) {
140 return ST_pathend_t.this.getStruct(fieldName);
141 }
142
81 public __ptr__ getPtr() {
82 return this;
14383 }
14484
14585 @Override
15696 }
15797
15898 @Override
159 public __struct__ getStruct(String fieldName) {
160 if (fieldName.equals("nb")) {
161 return this.nb;
162 }
163 if (fieldName.equals("np")) {
164 return this.np;
165 }
166 return super.getStruct(fieldName);
167 }
168
169 @Override
170 public int getInt(String fieldName) {
171 if (fieldName.equals("boxn")) {
172 return this.boxn;
173 }
174 if (fieldName.equals("sidemask")) {
175 return this.sidemask;
176 }
177 return super.getInt(fieldName);
178 }
179
180 @Override
18199 public void setInt(String fieldName, int data) {
182100 if (fieldName.equals("boxn")) {
183101 this.boxn = data;
190108 super.setInt(fieldName, data);
191109 }
192110
193 @Override
194 public __array_of_struct__ getArrayOfStruct(String fieldName) {
195 if (fieldName.equals("boxes")) {
196 return new ArrayOfTwenty(0);
197 }
198 return super.getArrayOfStruct(fieldName);
199 }
200
201111 }
202112
203113 // typedef struct pathend_t {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
4948 import smetana.core.__struct__;
5049 import smetana.core.amiga.StarStruct;
6160 this.parent = parent;
6261 }
6362
64 @Override
65 public StarStruct amp() {
66 return new Amp();
67 }
68
69 public class Amp extends UnsupportedStarStruct {
70
71 }
7263
7364 // "typedef struct",
7465 // "{",
75 private int x, y;
66 public int x, y;
7667
7768 // "}",
7869 // "point");
9384 }
9485
9586 @Override
96 public int getInt(String fieldName) {
97 if (fieldName.equals("x")) {
98 return this.x;
99 }
100 if (fieldName.equals("y")) {
101 return this.y;
102 }
103 return super.getInt(fieldName);
104 }
105
106 @Override
10787 public void setInt(String fieldName, int data) {
10888 if (fieldName.equals("x")) {
10989 this.x = data;
4444 */
4545 package h;
4646
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.CString;
4751 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
52 import smetana.core.UnsupportedArrayOfStruct2;
5053 import smetana.core.UnsupportedStructAndPtr;
5154 import smetana.core.__array_of_ptr__;
5255 import smetana.core.__ptr__;
5356 import smetana.core.__struct__;
5457 import smetana.core.size_t;
5558 import smetana.core.amiga.Area;
56 import smetana.core.amiga.StarArrayOfPtr;
57 import smetana.core.amiga.StarArrayOfStruct;
5859 import smetana.core.amiga.StarStruct;
5960
6061 public class ST_pointf extends UnsupportedStructAndPtr implements HardcodedStruct {
6162
6263 public double x;
6364 public double y;
65
66 @Override
67 public boolean isSameThan(StarStruct other) {
68 return this==(ST_pointf)other;
69 }
70
71 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__,
72 __array_of_ptr__ {
73
74 private final List<ST_pointf> data;
75 private final int pos;
76
77 @Override
78 public void setStruct(__struct__ value) {
79 getStruct().___(value);
80 }
81
82 @Override
83 public Array asPtr() {
84 return this;
85 }
86
87 @Override
88 public void setDouble(String fieldName, double value) {
89 getStruct().setDouble(fieldName, value);
90 }
91
92 @Override
93 public ST_pointf getStruct() {
94 return get(0).getStruct();
95 }
96
97 @Override
98 public ST_pointf getPtr() {
99 return get(0);
100 }
101
102 public Array(int size) {
103 this.data = new ArrayList<ST_pointf>();
104 this.pos = 0;
105 for (int i = 0; i < size; i++) {
106 data.add(new ST_pointf());
107 }
108 }
109
110 public Array reallocJ(int newsize) {
111 while (data.size() < newsize) {
112 data.add(new ST_pointf());
113 }
114 return this;
115 }
116
117 public Array plus(int delta) {
118 return plusJ(delta);
119 }
120
121 private Array(List<ST_pointf> data, int pos) {
122 this.data = data;
123 this.pos = pos;
124 }
125
126 public ST_pointf get(int i) {
127 return this.data.get(pos + i);
128 }
129
130 public Array plusJ(int i) {
131 return new Array(data, pos + i);
132 }
133
134 public int minus(Array other) {
135 if (this.data != other.data) {
136 throw new IllegalArgumentException();
137 }
138 return this.pos - other.pos;
139 }
140
141 public Array move(int delta) {
142 throw new UnsupportedOperationException(getClass().toString());
143 }
144
145 public void realloc(size_t nb) {
146 throw new UnsupportedOperationException(getClass().toString());
147 }
148
149 public int comparePointerInternal(__array_of_ptr__ other) {
150 throw new UnsupportedOperationException(getClass().toString());
151 }
152
153 public void setCString(CString value) {
154 throw new UnsupportedOperationException(getClass().toString());
155 }
156
157 }
158
159 public static ST_pointf[] malloc(int nb) {
160 final ST_pointf result[] = new ST_pointf[nb];
161 for (int i = 0; i < nb; i++) {
162 result[i] = new ST_pointf();
163 }
164 return result;
165 }
166
167 public static ST_pointf[] realloc(ST_pointf[] old, int nb) {
168 if (nb <= old.length) {
169 return old;
170 }
171 final ST_pointf result[] = new ST_pointf[nb];
172 for (int i = 0; i < nb; i++) {
173 result[i] = i < old.length ? old[i] : new ST_pointf();
174 }
175 return result;
176 }
64177
65178 public ST_pointf() {
66179 this(null);
67180 }
68181
69 public class Amp extends UnsupportedStarStruct {
70
71 public double getX() {
72 return x;
73 }
74
75 public double getY() {
76 return y;
77 }
78
79 public void setX(double value) {
80 x = value;
81 }
82
83 public void setY(double value) {
84 y = value;
85 }
86
87 @Override
88 public __struct__ getStruct() {
89 return ST_pointf.this;
90 }
91
92 @Override
93 public double getDouble(String fieldName) {
94 return ST_pointf.this.getDouble(fieldName);
95 }
96
97 @Override
98 public void setStruct(__struct__ value) {
99 ST_pointf.this.setStruct(value);
100 }
101
102 @Override
103 public boolean isSameThan(StarStruct other) {
104 ST_pointf.Amp other2 = (Amp) other;
105 return this.getStruct() == other2.getStruct();
106 }
107 }
108
109 @Override
110 public __struct__ copy() {
182
183 @Override
184 public ST_pointf copy() {
111185 final ST_pointf result = new ST_pointf();
112186 result.x = this.x;
113187 result.y = this.y;
120194 this.x = other2.x;
121195 this.y = other2.y;
122196 }
123
197
124198 @Override
125199 public void copyDataFrom(__ptr__ value) {
126200 final ST_pointf other2 = (ST_pointf) value;
127201 this.x = other2.x;
128202 this.y = other2.y;
129203 }
130
131 @Override
132 public __struct__ getStruct() {
204
205 @Override
206 public ST_pointf getStruct() {
133207 return this;
134208 }
135209
136210 @Override
137211 public void memcopyFrom(Area source) {
138 if (source instanceof StarArrayOfPtr) {
139 final Amp other2 = (Amp) ((StarArrayOfPtr) source).getPtr();
140 this.x = other2.getX();
141 this.y = other2.getY();
142 return;
143
144 }
212 // if (source instanceof StarArrayOfPtr) {
213 // final Amp other2 = (Amp) ((StarArrayOfPtr) source).getPtr();
214 // this.x = other2.getX();
215 // this.y = other2.getY();
216 // return;
217 //
218 // }
145219 final ST_pointf other2 = (ST_pointf) source;
146220 this.x = other2.x;
147221 this.y = other2.y;
156230
157231 @Override
158232 public void ____(__ptr__ other) {
159 if (other instanceof __array_of_ptr__) {
160 Amp other2 = (Amp) other.getPtr();
161 this.x = other2.getX();
162 this.y = other2.getY();
233 if (other instanceof ST_pointf.Array) {
234 ST_pointf.Array other2 = (ST_pointf.Array) other;
235 this.x = other2.get(0).x;
236 this.y = other2.get(0).y;
163237 return;
164238 }
165 if (other instanceof StarArrayOfPtr) {
166 Amp other2 = (Amp) other.getPtr();
167 this.x = other2.getX();
168 this.y = other2.getY();
169 return;
170 }
171 if (other instanceof StarArrayOfStruct) {
172 Amp other2 = (Amp) other.getPtr();
173 this.x = other2.getX();
174 this.y = other2.getY();
239 // if (other instanceof __array_of_ptr__) {
240 // Amp other2 = (Amp) other.getPtr();
241 // this.x = other2.getX();
242 // this.y = other2.getY();
243 // return;
244 // }
245 // if (other instanceof StarArrayOfPtr) {
246 // Amp other2 = (Amp) other.getPtr();
247 // this.x = other2.getX();
248 // this.y = other2.getY();
249 // return;
250 // }
251 // if (other instanceof Amp) {
252 // Amp other2 = (Amp) other;
253 // this.x = other2.getX();
254 // this.y = other2.getY();
255 // return;
256 // }
257 if (other instanceof ST_pointf) {
258 ST_pointf other2 = (ST_pointf) other;
259 this.x = other2.x;
260 this.y = other2.y;
175261 return;
176262 }
177263 System.err.println("other=" + other.getClass());
184270 final ST_pointf other2 = (ST_pointf) other;
185271 this.x = other2.x;
186272 this.y = other2.y;
187 }
188
189 @Override
190 public StarStruct amp() {
191 return new Amp();
192 }
193
194 @Override
195 public double getDouble(String fieldName) {
196 if (fieldName.equals("x")) {
197 return x;
198 }
199 if (fieldName.equals("y")) {
200 return y;
201 }
202 return super.getDouble(fieldName);
203273 }
204274
205275 @Override
216286 }
217287
218288 public ST_pointf(StarStruct parent) {
219 }
220
221 public static size_t sizeof(final int nb) {
222 return new UnsupportedSize_t(nb) {
223 @Override
224 public Object malloc() {
225 return new StarArrayOfPtr(new STArray<ST_pointf>(nb, 0, ST_pointf.class));
226 }
227
228 @Override
229 public int getInternalNb() {
230 return nb;
231 }
232
233 @Override
234 public Object realloc(Object old) {
235 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
236 old2.realloc(nb);
237 return old2;
238 }
239 };
240289 }
241290
242291 // public interface ST_pointf extends __ptr__ {
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
5048 import smetana.core.UnsupportedStructAndPtr;
5149 import smetana.core.__ptr__;
52 import smetana.core.__struct__;
53 import smetana.core.size_t;
54 import smetana.core.amiga.StarArrayOfPtr;
55 import smetana.core.amiga.StarArrayOfStruct;
5650 import smetana.core.amiga.StarStruct;
5751
5852 public class ST_pointnlink_t extends UnsupportedStructAndPtr implements HardcodedStruct {
5953
60 public ST_pointf.Amp pp;
61 public ST_pointnlink_t.Amp link;
54 public ST_pointf pp;
55 public ST_pointnlink_t link;
6256
6357 public ST_pointnlink_t() {
6458 this(null);
6761 public ST_pointnlink_t(StarStruct parent) {
6862 }
6963
70 public class Amp extends UnsupportedStarStruct {
71
72 @Override
73 public __ptr__ getPtr(String fieldName) {
74 if (fieldName.equals("pp")) {
75 return pp;
76 }
77 if (fieldName.equals("link")) {
78 return link;
79 }
80 return super.getPtr(fieldName);
81 }
82
83 @Override
84 public __struct__ getStruct() {
85 return ST_pointnlink_t.this;
86 }
87
88 @Override
89 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
90 return ST_pointnlink_t.this.setPtr(fieldName, newData);
91 }
92
93 @Override
94 public boolean isSameThan(StarStruct other) {
95 ST_pointnlink_t.Amp other2 = (Amp) other;
96 return this.getStruct() == other2.getStruct();
97 }
98
99 @Override
100 public Class getRealClass() {
101 return ST_pointnlink_t.class;
102 }
103
104 }
105
10664 @Override
107 public __ptr__ getPtr(String fieldName) {
108 if (fieldName.equals("pp")) {
109 return pp;
110 }
111 if (fieldName.equals("link")) {
112 return link;
113 }
114 return super.getPtr(fieldName);
65 public boolean isSameThan(StarStruct other) {
66 ST_pointnlink_t other2 = (ST_pointnlink_t) other;
67 return this == other2;
11568 }
11669
11770 @Override
11871 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
11972 if (fieldName.equals("pp")) {
120 if (newData instanceof StarArrayOfPtr) {
121 StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
122 ST_pointf data = (ST_pointf) tmp.getStruct();
123 pp = (ST_pointf.Amp) data.amp();
124 return pp;
125 }
126 if (newData instanceof StarArrayOfStruct) {
127 StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
128 ST_pointf data = (ST_pointf) tmp.getStruct();
129 pp = (ST_pointf.Amp) data.amp();
130 return pp;
131 }
13273 System.err.println("newData1=" + newData.getClass());
133 pp = (ST_pointf.Amp) newData;
74 pp = (ST_pointf) newData;
13475 return pp;
13576 }
13677 if (fieldName.equals("link")) {
13879 link = null;
13980 return link;
14081 }
141 if (newData instanceof StarArrayOfPtr) {
142 StarArrayOfPtr tmp = (StarArrayOfPtr) newData;
143 ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
144 link = (ST_pointnlink_t.Amp) data.amp();
145 return link;
146 }
147 if (newData instanceof StarArrayOfStruct) {
148 StarArrayOfStruct tmp = (StarArrayOfStruct) newData;
149 ST_pointnlink_t data = (ST_pointnlink_t) tmp.getStruct();
150 link = (ST_pointnlink_t.Amp) data.amp();
151 return link;
152 }
153 if (newData instanceof ST_pointnlink_t.Amp) {
154 ST_pointnlink_t.Amp tmp = (ST_pointnlink_t.Amp) newData;
82 if (newData instanceof ST_pointnlink_t) {
83 ST_pointnlink_t tmp = (ST_pointnlink_t) newData;
15584 link = tmp;
15685 return link;
15786 }
16190 }
16291
16392 @Override
164 public StarStruct amp() {
165 return new Amp();
166 }
167
168 public static size_t sizeof(final int nb) {
169 return new UnsupportedSize_t(nb) {
170 @Override
171 public Object malloc() {
172 return new StarArrayOfPtr(new STArray<ST_pointnlink_t>(nb, 0, ST_pointnlink_t.class));
173 }
174
175 @Override
176 public int getInternalNb() {
177 return nb;
178 }
179 };
180 }
181
182 @Override
183 public __struct__ getStruct() {
93 public ST_pointnlink_t getStruct() {
18494 return this;
185 }
186
187 class StarStructAdaptor extends UnsupportedStarStruct {
188 private final ST_pointnlink_t me;
189
190 public StarStructAdaptor(ST_pointnlink_t me) {
191 this.me = me;
192 }
193
194 @Override
195 public boolean isSameThan(StarStruct other) {
196 StarStructAdaptor other2 = (StarStructAdaptor) other;
197 return this.me == other2.me;
198 }
199 }
200
201 @Override
202 public StarStruct getInternalData() {
203 return new StarStructAdaptor(this);
204 }
205
206 public static size_t sizeof_starstar_empty(final int nb) {
207 return new UnsupportedSize_t(nb) {
208 @Override
209 public Object malloc() {
210 return STStarArrayOfPointer.malloc(nb);
211 }
212
213 @Override
214 public int getInternalNb() {
215 return nb;
216 }
217 };
21895 }
21996
22097 // public static List<String> DEFINITION = Arrays.asList(
4545 package h;
4646
4747 import smetana.core.HardcodedStruct;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
50 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarArrayOfPtr;
5249 import smetana.core.amiga.StarStruct;
5350
5451 public class ST_polygon_t extends UnsupportedStructAndPtr implements HardcodedStruct {
6057 public double distortion;
6158 public double skew;
6259 public int option;
63 private StarArrayOfPtr vertices;
60 public ST_pointf.Array vertices;
6461
6562 // "pointf *vertices",
6663
7168 public ST_polygon_t(StarStruct parent) {
7269 }
7370
74 public class Amp extends UnsupportedStarStruct {
7571
76 @Override
77 public boolean getBoolean(String fieldName) {
78 if (fieldName.equals("regular")) {
79 return regular != 0;
80 }
81 return super.getBoolean(fieldName);
82 }
83
84 @Override
85 public int getInt(String fieldName) {
86 if (fieldName.equals("peripheries")) {
87 return peripheries;
88 }
89 if (fieldName.equals("sides")) {
90 return sides;
91 }
92 return super.getInt(fieldName);
93 }
94
95 @Override
96 public double getDouble(String fieldName) {
97 if (fieldName.equals("orientation")) {
98 return orientation;
99 }
100 if (fieldName.equals("skew")) {
101 return skew;
102 }
103 if (fieldName.equals("distortion")) {
104 return distortion;
105 }
106 return super.getDouble(fieldName);
107 }
108
109 @Override
110 public __ptr__ getPtr(String fieldName) {
111 return ST_polygon_t.this.getPtr(fieldName);
112 }
113 }
114
115 @Override
116 public StarStruct amp() {
117 return new Amp();
118 }
11972
12073 @Override
12174 public void setInt(String fieldName, int data) {
13588 }
13689
13790 @Override
138 public int getInt(String fieldName) {
139 if (fieldName.equals("option")) {
140 return option;
141 }
142 if (fieldName.equals("sides")) {
143 return sides;
144 }
145 if (fieldName.equals("peripheries")) {
146 return peripheries;
147 }
148 return super.getInt(fieldName);
149 }
150
151 @Override
15291 public void setDouble(String fieldName, double data) {
15392 if (fieldName.equals("orientation")) {
15493 this.orientation = data;
165104 super.setDouble(fieldName, data);
166105 }
167106
168 private __ptr__ getVertices() {
169 if (vertices == null) {
170 return null;
171 }
172 throw new IllegalStateException();
173 }
174
175 @Override
176 public __ptr__ getPtr(String fieldName) {
177 if (fieldName.equals("vertices")) {
178 return vertices;
179 }
180 return super.getPtr(fieldName);
181 }
182
183 @Override
184 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
185 if (fieldName.equals("vertices") && newData == null) {
186 this.vertices = null;
187 return null;
188 }
189 if (fieldName.equals("vertices") && newData instanceof StarArrayOfPtr) {
190 this.vertices = (StarArrayOfPtr) newData;
191 return null;
192 }
193 return super.setPtr(fieldName, newData);
194 }
195107
196108 // public static List<String> DEFINITION = Arrays.asList(
197109 // "typedef struct polygon_t",
4646
4747 import smetana.core.CString;
4848 import smetana.core.HardcodedStruct;
49 import smetana.core.UnsupportedStarStruct;
5049 import smetana.core.UnsupportedStructAndPtr;
5150 import smetana.core.__ptr__;
5251 import smetana.core.__struct__;
5756
5857 public final ST_pointf p = new ST_pointf(this);
5958 public double theta;
60 public ST_boxf.Amp bp;
59 public ST_boxf bp;
6160 public int defined;
6261 public int constrained;
6362 public int clip;
134133 }
135134
136135 @Override
137 public __struct__ getStruct(String fieldName) {
138 if (fieldName.equals("p")) {
139 return p;
140 }
141 return super.getStruct(fieldName);
142 }
143
144 @Override
145136 public void setStruct(String fieldName, __struct__ newData) {
146137 if (fieldName.equals("p")) {
147138 p.copyDataFrom(newData);
148139 return;
149140 }
150141 super.setStruct(fieldName, newData);
151 }
152
153 @Override
154 public boolean getBoolean(String fieldName) {
155 if (fieldName.equals("constrained")) {
156 return constrained != 0;
157 }
158 if (fieldName.equals("dyna")) {
159 return dyna != 0;
160 }
161 return super.getBoolean(fieldName);
162 }
163
164 @Override
165 public void setBoolean(String fieldName, boolean data) {
166 if (fieldName.equals("constrained")) {
167 constrained = data ? 1 : 0;
168 return;
169 }
170 super.setBoolean(fieldName, data);
171142 }
172143
173144 @Override
179150 super.setInt(fieldName, data);
180151 }
181152
182 @Override
183 public int getInt(String fieldName) {
184 if (fieldName.equals("clip")) {
185 return clip;
186 }
187 if (fieldName.equals("order")) {
188 return order;
189 }
190 if (fieldName.equals("side")) {
191 return side;
192 }
193 return super.getInt(fieldName);
194 }
195
196 public class Amp extends UnsupportedStarStruct {
197 }
198
199 @Override
200 public StarStruct amp() {
201 return new Amp();
202 }
203
204 @Override
205 public __ptr__ getPtr(String fieldName) {
206 if (fieldName.equals("bp")) {
207 return bp;
208 }
209 return super.getPtr(fieldName);
210 }
211153
212154 @Override
213155 public void setDouble(String fieldName, double data) {
216158 return;
217159 }
218160 super.setDouble(fieldName, data);
219 }
220
221 @Override
222 public double getDouble(String fieldName) {
223 if (fieldName.equals("theta")) {
224 return theta;
225 }
226 return super.getDouble(fieldName);
227161 }
228162
229163 // "typedef struct port",
4444 */
4545 package h;
4646
47 import java.util.ArrayList;
48 import java.util.List;
49
4750 import smetana.core.UnsupportedArrayOfPtr;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
5051 import smetana.core.UnsupportedStructAndPtr;
5152 import smetana.core.__array_of_ptr__;
5253 import smetana.core.__ptr__;
5354 import smetana.core.__struct__;
54 import smetana.core.size_t;
55 import smetana.core.amiga.StarArrayOfPtr;
5655 import smetana.core.amiga.StarStruct;
5756
5857 public class ST_rank_t extends UnsupportedStructAndPtr {
6766 this.parent = parent;
6867 }
6968
70 private int n;
69 public int n;
7170
7271 // "node_t **v",
73 private STStarArrayOfPointer v;
74 private int an;
72 public ST_Agnode_s.ArrayOfStar v;
73 public int an;
7574 // "node_t **av",
76 private STStarArrayOfPointer av;
77
78 private double ht1, ht2;
79 private double pht1, pht2;
80 private boolean candidate;
81 private int valid;
82
83 private int cache_nc;
84 private ST_adjmatrix_t flat;
75 public ST_Agnode_s.ArrayOfStar av;
76
77 public double ht1, ht2;
78 public double pht1, pht2;
79 public boolean candidate;
80 public int valid;
81
82 public int cache_nc;
83 public ST_adjmatrix_t flat;
8584
8685 // "}",
8786 // "rank_t");
87
88
89 public static class Array2 extends UnsupportedArrayOfPtr implements __ptr__, __array_of_ptr__ {
90
91 private final List<ST_rank_t> data;
92 private final int pos;
93
94 public Array2(int size) {
95 this.data = new ArrayList<ST_rank_t>();
96 this.pos = 0;
97 for (int i = 0; i < size; i++) {
98 data.add(new ST_rank_t());
99 }
100 }
101
102 @Override
103 public void setInt(String fieldName, int data) {
104 getPtr().setInt(fieldName, data);
105 }
106
107 @Override
108 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
109 return getPtr().setPtr(fieldName, newData);
110 }
111
112 @Override
113 public void setDouble(String fieldName, double data) {
114 getPtr().setDouble(fieldName, data);
115 }
116
117 public ST_rank_t get(int i) {
118 return plus(i).getPtr();
119 }
120
121 public void swap(int i, int j) {
122 ST_rank_t e1 = data.get(i);
123 ST_rank_t e2 = data.get(j);
124 data.set(i, e2);
125 data.set(j, e1);
126 }
127
128 public Array2(List<ST_rank_t> data, int pos) {
129 this.data = data;
130 this.pos = pos;
131 }
132
133 public Array2 reallocJ(int newsize) {
134 while (data.size() < newsize) {
135 data.add(new ST_rank_t());
136 }
137 return this;
138 }
139
140 @Override
141 public Array2 plus(int delta) {
142 return new Array2(data, pos + delta);
143 }
144
145 @Override
146 public Array2 asPtr() {
147 return this;
148 }
149
150 @Override
151 public void setPtr(__ptr__ value) {
152 // if (value instanceof Amp) {
153 // value = value.getPtr();
154 // }
155 this.data.set(pos, (ST_rank_t) value);
156 }
157
158 @Override
159 public ST_rank_t getPtr() {
160 return this.data.get(pos);
161 }
162
163 @Override
164 public int comparePointer(__ptr__ other) {
165 final Array2 this2 = (Array2) other;
166 if (this.data != this2.data) {
167 throw new IllegalArgumentException();
168 }
169 return this.pos - this2.pos;
170 }
171
172 public boolean isSameThan2(Array2 other) {
173 if (this.data != other.data) {
174 throw new IllegalArgumentException();
175 }
176 return this.pos == other.pos;
177 }
178 }
179
88180
89181 @Override
90182 public void setStruct(__struct__ value) {
103195 this.flat = this2.flat;
104196 }
105197
106 @Override
107 public StarStruct amp() {
108 return new Amp();
109 }
110
111 public class Amp extends UnsupportedStarStruct {
112 @Override
113 public int getInt(String fieldName) {
114 return ST_rank_t.this.getInt(fieldName);
115 }
116
117 @Override
118 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
119 return ST_rank_t.this.getArrayOfPtr(fieldName);
120 }
121
122 @Override
123 public __ptr__ getPtr(String fieldName) {
124 return ST_rank_t.this.getPtr(fieldName);
125 }
126
127 @Override
128 public __struct__ getStruct() {
129 return ST_rank_t.this.getStruct();
130 }
131
132 @Override
133 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
134 return ST_rank_t.this.setPtr(fieldName, newData);
135 }
136
137 @Override
138 public void setBoolean(String fieldName, boolean data) {
139 ST_rank_t.this.setBoolean(fieldName, data);
140 }
141
142 @Override
143 public boolean getBoolean(String fieldName) {
144 return ST_rank_t.this.getBoolean(fieldName);
145 }
146
147 @Override
148 public void setInt(String fieldName, int data) {
149 ST_rank_t.this.setInt(fieldName, data);
150 }
151
152 @Override
153 public double getDouble(String fieldName) {
154 return ST_rank_t.this.getDouble(fieldName);
155 }
156
157 @Override
158 public void setStruct(__struct__ value) {
159 ST_rank_t.this.setStruct(value);
160 }
161
162 }
163
164 @Override
165 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
166 if (fieldName.equals("v")) {
167 return new ArrayOfPtr(v, 0);
168 }
169 return super.getArrayOfPtr(fieldName);
170 }
171
172 static class ArrayOfPtr extends UnsupportedArrayOfPtr {
173
174 private final int pos;
175 private final STStarArrayOfPointer tab;
176
177 private ArrayOfPtr(STStarArrayOfPointer tab, int pos) {
178 this.pos = pos;
179 this.tab = tab;
180 }
181
182 @Override
183 public __array_of_ptr__ plus(int delta) {
184 return new ArrayOfPtr(tab, pos + delta);
185 }
186
187 @Override
188 public void setPtr(__ptr__ value) {
189 tab.plus(pos).setPtr(value);
190 }
191
192 @Override
193 public __ptr__ getPtr() {
194 return tab.plus(pos).getPtr();
195 }
196
197 @Override
198 public __ptr__ asPtr() {
199 if (pos == 0) {
200 return tab;
201 }
202 return super.asPtr();
203 }
204
205 }
206
207 @Override
208 public int getInt(String fieldName) {
209 if (fieldName.equals("n")) {
210 return n;
211 }
212 if (fieldName.equals("an")) {
213 return an;
214 }
215 if (fieldName.equals("cache_nc")) {
216 return cache_nc;
217 }
218 return super.getInt(fieldName);
219 }
220
221 @Override
222 public __ptr__ getPtr(String fieldName) {
223 if (fieldName.equals("v")) {
224 return v;
225 }
226 if (fieldName.equals("av")) {
227 return av;
228 }
229 if (fieldName.equals("flat")) {
230 return flat;
231 }
232 return super.getPtr(fieldName);
233 }
234
235 @Override
236 public void setBoolean(String fieldName, boolean data) {
237 if (fieldName.equals("candidate")) {
238 this.candidate = data;
239 return;
240 }
241 if (fieldName.equals("valid")) {
242 this.valid = data ? 1 : 0;
243 return;
244 }
245 super.setBoolean(fieldName, data);
246 }
247198
248199 @Override
249200 public void setInt(String fieldName, int data) {
267218 }
268219
269220 @Override
270 public boolean getBoolean(String fieldName) {
271 if (fieldName.equals("valid")) {
272 return valid != 0;
273 }
274 if (fieldName.equals("candidate")) {
275 return candidate;
276 }
277 return super.getBoolean(fieldName);
278 }
279
280 @Override
281 public double getDouble(String fieldName) {
282 if (fieldName.equals("pht1")) {
283 return pht1;
284 }
285 if (fieldName.equals("pht2")) {
286 return pht2;
287 }
288 if (fieldName.equals("ht1")) {
289 return ht1;
290 }
291 if (fieldName.equals("ht2")) {
292 return ht2;
293 }
294 return super.getDouble(fieldName);
295 }
296
297 @Override
298221 public void setDouble(String fieldName, double data) {
299222 if (fieldName.equals("pht1")) {
300223 this.pht1 = data;
323246 @Override
324247 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
325248 if (fieldName.equals("v")) {
326 this.v = (STStarArrayOfPointer) newData;
249 this.v = (ST_Agnode_s.ArrayOfStar) newData;
327250 return v;
328251 }
329252 if (fieldName.equals("av")) {
330 this.av = (STStarArrayOfPointer) newData;
253 this.av = (ST_Agnode_s.ArrayOfStar) newData;
331254 return av;
332255 }
333256 if (fieldName.equals("flat")) {
337260 return super.setPtr(fieldName, newData);
338261 }
339262
340 public static size_t sizeof(final int nb) {
341 return new UnsupportedSize_t(nb) {
342 @Override
343 public Object malloc() {
344 return new StarArrayOfPtr(new STArray<ST_rank_t>(nb, 0, ST_rank_t.class));
345 }
346
347 @Override
348 public int getInternalNb() {
349 return nb;
350 }
351
352 @Override
353 public Object realloc(Object old) {
354 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
355 old2.realloc(nb);
356 return old2;
357 }
358 };
359 }
263 // public static size_t sizeof(final int nb) {
264 // return new UnsupportedSize_t(nb) {
265 // @Override
266 // public Array2 malloc() {
267 // return new Array2(nb);
268 // }
269 //
270 // @Override
271 // public int getInternalNb() {
272 // return nb;
273 // }
274 //
275 // @Override
276 // public Array2 realloc(Object old) {
277 // Array2 old2 = (Array2) old;
278 // old2.reallocJ(nb);
279 // return old2;
280 // }
281 // };
282 // }
360283
361284 }
362285
4646
4747 import smetana.core.CString;
4848 import smetana.core.OFFSET;
49 import smetana.core.UnsupportedStarStruct;
50 import smetana.core.UnsupportedStructAndPtr;
51 import smetana.core.__ptr__;
52 import smetana.core.amiga.StarStruct;
5349
54 public class ST_refstr_t extends UnsupportedStructAndPtr /* implements WithParent */{
50 public class ST_refstr_t extends ST_dtlink_s /* implements WithParent */{
5551
56 public final ST_dtlink_s link = new ST_dtlink_s(this);
5752 public int refcnt;
5853 public CString s;
5954
60 private final StarStruct parent;
61
62 public ST_refstr_t() {
63 this(null);
64 }
65
66 public ST_refstr_t(StarStruct parent) {
67 this.parent = parent;
68 }
69
70 @Override
71 public void setInt(String fieldName, int data) {
72 if (fieldName.equals("refcnt")) {
73 this.refcnt = data;
74 return;
75 }
76 super.setInt(fieldName, data);
77 }
78
79 @Override
80 public int getInt(String fieldName) {
81 if (fieldName.equals("refcnt")) {
82 return refcnt;
83 }
84 return super.getInt(fieldName);
85 }
86
87 @Override
88 public __ptr__ getPtr(String fieldName) {
89 if (fieldName.equals("s")) {
90 return s;
91 }
92 return super.getPtr(fieldName);
93 }
94
95 public class Amp extends UnsupportedStarStruct {
96
97 @Override
98 public Object addVirtualBytes(int virtualBytes) {
99 if (virtualBytes == 0) {
100 return this;
101 }
102 final OFFSET offset = OFFSET.fromInt(virtualBytes);
103 if (offset.toString().equals("h.refstr_t::s")) {
104 return s;
105 }
106 System.err.println("virtualBytes=" + virtualBytes);
107 System.err.println("offset=" + offset);
108 return super.addVirtualBytes(virtualBytes);
109 }
110
111 }
112
113 @Override
114 public StarStruct amp() {
115 return new Amp();
116 }
11755
11856 @Override
11957 public Object addVirtualBytes(int virtualBytes) {
12159 return this;
12260 }
12361 final OFFSET offset = OFFSET.fromInt(virtualBytes);
124 if (offset.toString().equals("h.refstr_t::s")) {
62 if (offset.toString().equals("h.ST_refstr_t::s")) {
12563 return s;
12664 }
12765 System.err.println("virtualBytes=" + virtualBytes);
12967 return super.addVirtualBytes(virtualBytes);
13068 }
13169
132 @Override
133 public __ptr__ castTo(Class dest) {
134 // if (dest == refstr_t.class) {
135 // return this;
136 // }
137 if (dest == _dtlink_s.class) {
138 return link;
139 }
140 return super.castTo(dest);
141 }
142
143 @Override
144 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
145 if (fieldName.equals("s")) {
146 this.s = (CString) newData;
147 this.s.setMyFather(this);
148 return s;
149 }
150 return super.setPtr(fieldName, newData);
151 }
152
153 @Override
154 public CString getCString(String fieldName) {
155 if (fieldName.equals("s")) {
156 return s;
157 }
158 return super.getCString(fieldName);
70 public void setString(CString newData) {
71 this.s = newData;
72 this.s.setParent(this);
15973 }
16074
16175 public CString to_s(ST_dtlink_s from) {
162 if (from == link) {
76 // if (from == link) {
16377 return s;
164 }
165 throw new IllegalArgumentException();
78 // }
79 // throw new IllegalArgumentException();
16680 }
16781
16882 @Override
16983 public Class getRealClass() {
170 return refstr_t.class;
84 return ST_refstr_t.class;
17185 }
172
173 // public static List<String> DEFINITION = Arrays.asList(
174 // "typedef struct refstr_t",
175 // "{",
176 // "Dtlink_t link",
177 // "unsigned long refcnt",
178 // "char *s",
179 // "char store[1]",
180 // "}",
181 // "refstr_t");
18286 }
18387
18488 // typedef struct refstr_t {
6060 }
6161
6262 public CString name;
63 public ST_shape_functions.Amp fns;
64 public ST_polygon_t.Amp polygon;
63 public ST_shape_functions fns;
64 public ST_polygon_t polygon;
6565 public boolean usershape;
6666
6767 @Override
7171 return newData;
7272 }
7373 if (fieldName.equals("fns")) {
74 this.fns = (ST_shape_functions.Amp) newData;
74 this.fns = (ST_shape_functions) newData;
7575 return newData;
7676 }
7777 if (fieldName.equals("polygon")) {
78 this.polygon = (ST_polygon_t.Amp) newData;
78 this.polygon = (ST_polygon_t) newData;
7979 return newData;
8080 }
8181 return super.setPtr(fieldName, newData);
82 }
83
84 @Override
85 public CString getCString(String fieldName) {
86 if (fieldName.equals("name")) {
87 return name;
88 }
89 return super.getCString(fieldName);
90 }
91
92 @Override
93 public __ptr__ getPtr(String fieldName) {
94 if (fieldName.equals("fns")) {
95 return fns;
96 }
97 if (fieldName.equals("polygon")) {
98 return polygon;
99 }
100 return super.getPtr(fieldName);
101 }
102
103 @Override
104 public boolean getBoolean(String fieldName) {
105 if (fieldName.equals("usershape")) {
106 return usershape;
107 }
108 return super.getBoolean(fieldName);
10982 }
11083
11184 // public static List<String> DEFINITION = Arrays.asList(
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.amiga.StarStruct;
6463 }
6564
6665 public ST_shape_functions(StarStruct parent) {
67 }
68
69 @Override
70 public StarStruct amp() {
71 return new Amp();
72 }
73
74 public class Amp extends UnsupportedStarStruct {
75
76 @Override
77 public __ptr__ getPtr(String fieldName) {
78 return ST_shape_functions.this.getPtr(fieldName);
79 }
80
81 @Override
82 public Object call(String fieldName, Object... args) {
83 return ((CFunction) getPtr(fieldName)).exe(args);
84 }
85 }
86
87 @Override
88 public __ptr__ getPtr(String fieldName) {
89 if (fieldName.equals("initfn")) {
90 return initfn;
91 }
92 if (fieldName.equals("freefn")) {
93 return freefn;
94 }
95 if (fieldName.equals("portfn")) {
96 return portfn;
97 }
98 if (fieldName.equals("insidefn")) {
99 return insidefn;
100 }
101 if (fieldName.equals("pboxfn")) {
102 return pboxfn;
103 }
104 if (fieldName.equals("codefn")) {
105 return codefn;
106 }
107 return super.getPtr(fieldName);
10866 }
10967
11068 @Override
4545 package h;
4646
4747 import smetana.core.CFunction;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.amiga.StarStruct;
6564 }
6665
6766 @Override
68 public StarStruct amp() {
69 return new Amp();
70 }
71
72 public class Amp extends UnsupportedStarStruct {
73
74 @Override
75 public boolean getBoolean(String fieldName) {
76 return ST_splineInfo.this.getBoolean(fieldName);
77 }
78
79 @Override
80 public Object call(String fieldName, Object... args) {
81 return ST_splineInfo.this.call(fieldName, args);
82 }
83 }
84
85 @Override
8667 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
8768 if (fieldName.equals("swapEnds")) {
8869 this.swapEnds = (CFunction) newData;
9374 return splineMerge;
9475 }
9576 return super.setPtr(fieldName, newData);
96 }
97
98 @Override
99 public Object call(String fieldName, Object... args) {
100 if (fieldName.equals("swapEnds")) {
101 return swapEnds.exe(args);
102 }
103 if (fieldName.equals("splineMerge")) {
104 return splineMerge.exe(args);
105 }
106 return super.call(fieldName, args);
107 }
108
109 @Override
110 public boolean getBoolean(String fieldName) {
111 if (fieldName.equals("ignoreSwap")) {
112 return ignoreSwap;
113 }
114 if (fieldName.equals("isOrtho")) {
115 return isOrtho;
116 }
117 return super.getBoolean(fieldName);
11877 }
11978
12079 // public interface ST_splineInfo extends __ptr__ {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__ptr__;
50 import smetana.core.amiga.StarArrayOfPtr;
5148 import smetana.core.amiga.StarStruct;
5249
5350 public class ST_spline_info_t extends UnsupportedStructAndPtr {
6259 this.parent = parent;
6360 }
6461
65 // public static List<String> DEFINITION = Arrays.asList(
6662 // "typedef struct",
6763 // "{",
68 private int LeftBound, RightBound, Splinesep, Multisep;
69 private StarArrayOfPtr Rank_box;
64 public int LeftBound, RightBound, Splinesep, Multisep;
65 public ST_boxf Rank_box[];
7066
7167 // "}",
7268 // "spline_info_t");
73
74 @Override
75 public StarStruct amp() {
76 return new Amp();
77 }
78
79 public class Amp extends UnsupportedStarStruct {
80 @Override
81 public int getInt(String fieldName) {
82 return ST_spline_info_t.this.getInt(fieldName);
83 }
84
85 @Override
86 public __ptr__ getPtr(String fieldName) {
87 return ST_spline_info_t.this.getPtr(fieldName);
88 }
89
90 }
91
92 @Override
93 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
94 if (fieldName.equals("Rank_box")) {
95 this.Rank_box = (StarArrayOfPtr) newData;
96 return this.Rank_box;
97 }
98 return super.setPtr(fieldName, newData);
99 }
100
101 @Override
102 public __ptr__ getPtr(String fieldName) {
103 if (fieldName.equals("Rank_box")) {
104 return this.Rank_box;
105 }
106 return super.getPtr(fieldName);
107 }
108
109 @Override
110 public int getInt(String fieldName) {
111 if (fieldName.equals("LeftBound")) {
112 return this.LeftBound;
113 }
114 if (fieldName.equals("RightBound")) {
115 return this.RightBound;
116 }
117 if (fieldName.equals("Splinesep")) {
118 return this.Splinesep;
119 }
120 if (fieldName.equals("Multisep")) {
121 return this.Multisep;
122 }
123 return super.getInt(fieldName);
124 }
12569
12670 @Override
12771 public void setInt(String fieldName, int data) {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedStarStruct;
4847 import smetana.core.UnsupportedStructAndPtr;
49 import smetana.core.__array_of_ptr__;
50 import smetana.core.__ptr__;
51 import smetana.core.amiga.StarArrayOfPtr;
5248 import smetana.core.amiga.StarStruct;
5349
5450 public class ST_splines extends UnsupportedStructAndPtr {
6359 this.parent = parent;
6460 }
6561
66 @Override
67 public StarStruct amp() {
68 return new Amp();
69 }
70
71 public class Amp extends UnsupportedStarStruct {
72
73 }
74
7562 // "typedef struct splines",
7663 // "{",
7764 // bezier *list;
78 private StarArrayOfPtr list;
79 private int size;
65 public ST_bezier.Array2 list;
66 public int size;
8067
8168 // "boxf bb",
8269 // "}",
9178 super.setInt(fieldName, data);
9279 }
9380
94 @Override
95 public int getInt(String fieldName) {
96 if (fieldName.equals("size")) {
97 return this.size;
98 }
99 return super.getInt(fieldName);
100 }
101
102 @Override
103 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
104 if (fieldName.equals("list")) {
105 this.list = (StarArrayOfPtr) newData;
106 return list;
107 }
108 return super.setPtr(fieldName, newData);
109 }
110
111 @Override
112 public __ptr__ getPtr(String fieldName) {
113 if (fieldName.equals("list")) {
114 return this.list;
115 }
116 return super.getPtr(fieldName);
117 }
118
119 @Override
120 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
121 if (fieldName.equals("list")) {
122 return this.list.getInternalArray();
123 }
124 return super.getArrayOfPtr(fieldName);
125 }
12681 }
12782
12883 // typedef struct splines {
4444 */
4545 package h;
4646
47 import h.ST_Agclos_s.ArrayOfThreePtrDict_t;
48
49 import java.util.ArrayList;
50 import java.util.List;
51
52 import smetana.core.UnsupportedArrayOfPtr;
53 import smetana.core.UnsupportedStarStruct;
5447 import smetana.core.UnsupportedStructAndPtr;
55 import smetana.core.__array_of_ptr__;
5648 import smetana.core.__ptr__;
57 import smetana.core.amiga.Area;
58 import smetana.core.amiga.StarArrayOfPtr;
5949 import smetana.core.amiga.StarStruct;
6050
6151 public class ST_tedge_t extends UnsupportedStructAndPtr {
7060 this.parent = parent;
7161 }
7262
73 @Override
74 public StarStruct amp() {
75 return new Amp();
76 }
77
78 public class Amp extends UnsupportedStarStruct {
79
80 }
81
8263 // "typedef struct tedge_t",
8364 // "{",
84 private __ptr__ pnl0p;
85 private __ptr__ pnl1p;
86 // private ST_pointnlink_t.Amp pnl0p;
87 // private ST_pointnlink_t.Amp pnl1p;
65 public ST_pointnlink_t pnl0p;
66 public ST_pointnlink_t pnl1p;
8867
89 private StarArrayOfPtr ltp;
90 private StarArrayOfPtr rtp;
68 public ST_triangle_t.Array lrp;
69 public ST_triangle_t.Array rtp;
70
71 // public StarArrayOfPtr ltp;
72 // public StarArrayOfPtr rtp;
9173
9274 // "struct triangle_t *ltp",
9375 // "struct triangle_t *rtp",
9476 // "}",
9577 // "tedge_t");
9678
79
9780 @Override
98 public __ptr__ getPtr(String fieldName) {
81 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
9982 if (fieldName.equals("pnl0p")) {
83 this.pnl0p = ((ST_pointnlink_t) newData);
10084 return this.pnl0p;
10185 }
10286 if (fieldName.equals("pnl1p")) {
87 this.pnl1p = ((ST_pointnlink_t) newData);
10388 return this.pnl1p;
10489 }
105 if (fieldName.equals("ltp")) {
106 return this.ltp;
107 }
108 if (fieldName.equals("rtp")) {
109 return this.rtp;
110 }
111 return super.getPtr(fieldName);
90 return super.setPtr(fieldName, newData);
11291 }
11392
11493 // class Singleton extends UnsupportedArrayOfPtr implements __array_of_ptr__ {
152131 //
153132 // }
154133
155 @Override
156 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
157 // if (fieldName.equals("pnl0p")) {
158 // this.pnl0p = (ST_pointnlink_t.Amp) newData;
159 // return this.pnl0p;
160 // }
161 if (fieldName.equals("pnl0p")) {
162 if (newData instanceof ST_pointnlink_t.Amp) {
163 this.pnl0p = (ST_pointnlink_t.Amp) newData;
164 // newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
165 } else {
166 this.pnl0p = (StarArrayOfPtr) newData;
167 }
168 return this.pnl0p;
169 }
170 if (fieldName.equals("pnl1p")) {
171 if (newData instanceof ST_pointnlink_t.Amp) {
172 // newData = new StarArrayOfPtr(new Singleton((h.ST_pointnlink_t.Amp) newData));
173 this.pnl1p = (ST_pointnlink_t.Amp) newData;
174 } else {
175 this.pnl1p = (StarArrayOfPtr) newData;
176 }
177 return this.pnl1p;
178 }
179 // if (fieldName.equals("pnl1p")) {
180 // this.pnl1p = (ST_pointnlink_t.Amp) newData;
181 // return this.pnl1p;
182 // }
183 if (fieldName.equals("ltp")) {
184 this.ltp = (StarArrayOfPtr) newData;
185 return this.ltp;
186 }
187 if (fieldName.equals("rtp")) {
188 this.rtp = (StarArrayOfPtr) newData;
189 return this.rtp;
190 }
191 return super.setPtr(fieldName, newData);
192 }
193
194 public String foo(StarArrayOfPtr data) {
195 __array_of_ptr__ array = data.getInternalArray();
196 return array.toString();
197 }
198134 }
199135
200136 // typedef struct tedge_t {
4545 package h;
4646
4747 import smetana.core.CString;
48 import smetana.core.UnsupportedStarStruct;
4948 import smetana.core.UnsupportedStructAndPtr;
5049 import smetana.core.__ptr__;
5150 import smetana.core.__struct__;
6362 this.parent = parent;
6463 }
6564
66 private CString text, fontname, fontcolor;
67 private int charset;
68 private double fontsize;
65 public CString text, fontname, fontcolor;
66 public int charset;
67 public double fontsize;
6968
70 private final ST_pointf dimen = new ST_pointf(this);
71 private final ST_pointf space = new ST_pointf(this);
72 private final ST_pointf pos = new ST_pointf(this);
69 public final ST_pointf dimen = new ST_pointf(this);
70 public final ST_pointf space = new ST_pointf(this);
71 public final ST_pointf pos = new ST_pointf(this);
7372
7473 // "union",
7574 // "{",
7675 // "struct",
7776 // "{",
7877 // private ST_textspan_t span;
79 private __ptr__ span;
80 private int nspans;
78 public ST_textspan_t.Array span;
79 public int nspans;
8180
8281 // "}",
8382 // "txt",
8483 // "htmllabel_t *html",
85 private final __ptr__ html = null;
84 public final __ptr__ html__ = null;
8685 // "}",
8786 // "u",
88 private int valign;
87 public int valign;
8988
90 private int set;
89 public int set;
9190
91 public boolean html;
9292 // "boolean html",
9393 // "}",
9494 // "textlabel_t");
95
96 @Override
97 public StarStruct amp() {
98 return new Amp();
99 }
100
101 public class Amp extends UnsupportedStarStruct {
102
103 }
104
105 @Override
106 public __struct__ getStruct(String fieldName) {
107 if (fieldName.equals("dimen")) {
108 return dimen;
109 }
110 if (fieldName.equals("space")) {
111 return space;
112 }
113 if (fieldName.equals("pos")) {
114 return pos;
115 }
116 return super.getStruct(fieldName);
117 }
11895
11996 @Override
12097 public void setStruct(String fieldName, __struct__ newData) {
144121 return fontcolor;
145122 }
146123 if (fieldName.equals("u.txt.span")) {
147 this.span = newData;
124 this.span = (ST_textspan_t.Array) newData;
148125 return span;
149126 }
150127 return super.setPtr(fieldName, newData);
151 }
152
153 @Override
154 public CString getCString(String fieldName) {
155 if (fieldName.equals("text")) {
156 return text;
157 }
158 return super.getCString(fieldName);
159 }
160
161 @Override
162 public __ptr__ getPtr(String fieldName) {
163 if (fieldName.equals("text")) {
164 return text;
165 }
166 if (fieldName.equals("u.txt.span")) {
167 return span;
168 }
169 if (fieldName.equals("fontname")) {
170 return fontname;
171 }
172 return super.getPtr(fieldName);
173 }
174
175 @Override
176 public boolean getBoolean(String fieldName) {
177 if (fieldName.equals("html")) {
178 return html != null;
179 }
180 if (fieldName.equals("set")) {
181 return set != 0;
182 }
183 return super.getBoolean(fieldName);
184128 }
185129
186130 @Override
190134 return;
191135 }
192136 super.setDouble(fieldName, data);
193 }
194
195 @Override
196 public double getDouble(String fieldName) {
197 if (fieldName.equals("fontsize")) {
198 return this.fontsize;
199 }
200 return super.getDouble(fieldName);
201137 }
202138
203139 @Override
214150 this.nspans = data;
215151 return;
216152 }
153 if (fieldName.equals("set")) {
154 this.set = data;
155 return;
156 }
217157 super.setInt(fieldName, data);
218158 }
219159
220 @Override
221 public void setBoolean(String fieldName, boolean data) {
222 if (fieldName.equals("set")) {
223 this.set = data ? 1 : 0;
224 return;
225 }
226 super.setBoolean(fieldName, data);
227 }
228
229160 @Override
230161 public boolean isSameThan(StarStruct other) {
231162 ST_textlabel_t other2 = (ST_textlabel_t) other;
233164 }
234165
235166
236 @Override
237 public int getInt(String fieldName) {
238 if (fieldName.equals("charset")) {
239 return this.charset;
240 }
241 if (fieldName.equals("valign")) {
242 return this.valign;
243 }
244 if (fieldName.equals("u.txt.nspans")) {
245 return this.nspans;
246 }
247 if (fieldName.equals("set")) {
248 return this.set;
249 }
250 return super.getInt(fieldName);
251 }
252
253167 }
254168
255169 // typedef struct textlabel_t {
4444 */
4545 package h;
4646
47 import java.util.ArrayList;
48 import java.util.List;
49
4750 import smetana.core.CString;
48 import smetana.core.UnsupportedSize_t;
49 import smetana.core.UnsupportedStarStruct;
51 import smetana.core.UnsupportedArrayOfStruct2;
5052 import smetana.core.UnsupportedStructAndPtr;
53 import smetana.core.__array_of_ptr__;
5154 import smetana.core.__ptr__;
5255 import smetana.core.__struct__;
5356 import smetana.core.size_t;
54 import smetana.core.amiga.StarArrayOfPtr;
5557 import smetana.core.amiga.StarStruct;
5658
59 // UNUSED ?
5760 public class ST_textspan_t extends UnsupportedStructAndPtr {
5861
5962 private final StarStruct parent;
6669 this.parent = parent;
6770 }
6871
69 private CString str;
72 public CString str;
7073
7174 // "textfont_t *font",
7275 // "void *layout",
7376 // "void (*free_layout) (void *layout)",
7477 // "double yoffset_layout, yoffset_centerline",
75 private final ST_pointf size = new ST_pointf(this);
76 private int just;
78 public final ST_pointf size = new ST_pointf(this);
79 public int just;
7780
78 @Override
79 public StarStruct amp() {
80 return new Amp();
81 }
81 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{
8282
83 public class Amp extends UnsupportedStarStruct {
83 private final List<ST_textspan_t> data;
84 private final int pos;
85
86 @Override
87 public __ptr__ setPtr(String fieldName, __ptr__ data) {
88 return getStruct().setPtr(fieldName, data);
89 }
90
91 @Override
92 public void setInt(String fieldName, int data) {
93 getStruct().setInt(fieldName, data);
94 }
95
96 @Override
97 public void setStruct(String fieldName, __struct__ data) {
98 getStruct().setStruct(fieldName, data);
99 }
100
101 @Override
102 public Array asPtr() {
103 return this;
104 }
105
106 @Override
107 public ST_textspan_t getStruct() {
108 return data.get(pos);
109 }
110
111 public Array(int size) {
112 this.data = new ArrayList<ST_textspan_t>();
113 this.pos = 0;
114 for (int i = 0; i < size; i++) {
115 data.add(new ST_textspan_t());
116 }
117 }
118
119 public Array reallocJ(int newsize) {
120 while (data.size() < newsize) {
121 data.add(new ST_textspan_t());
122 }
123 return this;
124 }
125
126 public Array plus(int delta) {
127 return plusJ(delta);
128 }
129
130 private Array(List<ST_textspan_t> data, int pos) {
131 this.data = data;
132 this.pos = pos;
133 }
134
135 public ST_textspan_t get(int i) {
136 return this.data.get(pos + i);
137 }
138
139 public Array plusJ(int i) {
140 return new Array(data, pos + i);
141 }
142
143 public int minus(Array other) {
144 if (this.data != other.data) {
145 throw new IllegalArgumentException();
146 }
147 return this.pos - other.pos;
148 }
149
150 public Array move(int delta) {
151 throw new UnsupportedOperationException(getClass().toString());
152 }
153
154 public void realloc(size_t nb) {
155 throw new UnsupportedOperationException(getClass().toString());
156 }
157
158 public int comparePointerInternal(__array_of_ptr__ other) {
159 throw new UnsupportedOperationException(getClass().toString());
160 }
161
84162
85163 }
86164
87 @Override
88 public __struct__ getStruct(String fieldName) {
89 if (fieldName.equals("size")) {
90 return size;
91 }
92 return super.getStruct(fieldName);
93 }
94165
95166 @Override
96167 public void setInt(String fieldName, int data) {
102173 }
103174
104175 @Override
105 public int getInt(String fieldName) {
106 if (fieldName.equals("just")) {
107 return this.just;
108 }
109 return super.getInt(fieldName);
110 }
111
112 @Override
113176 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
114177 if (fieldName.equals("str")) {
115178 this.str = (CString) newData;
116179 return str;
117180 }
118181 return super.setPtr(fieldName, newData);
119 }
120
121 public static size_t sizeof(final int nb) {
122 return new UnsupportedSize_t(nb) {
123 @Override
124 public Object malloc() {
125 return new StarArrayOfPtr(new STArray<ST_textspan_t>(nb, 0, ST_textspan_t.class));
126 }
127
128 @Override
129 public int getInternalNb() {
130 return nb;
131 }
132
133 @Override
134 public Object realloc(Object old) {
135 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
136 old2.realloc(nb);
137 return old2;
138 }
139 };
140182 }
141183
142184 }
4444 */
4545 package h;
4646
47 import h.ST_tna_t.Amp;
48 import h.ST_triangle_t.ArrayOfThree;
49
50 import java.util.Arrays;
47 import java.util.ArrayList;
5148 import java.util.List;
5249
53 import smetana.core.UnsupportedArrayOfStruct;
54 import smetana.core.UnsupportedSize_t;
55 import smetana.core.UnsupportedStarStruct;
50 import smetana.core.UnsupportedArrayOfStruct2;
5651 import smetana.core.UnsupportedStructAndPtr;
57 import smetana.core.__array_of_struct__;
52 import smetana.core.__array_of_ptr__;
5853 import smetana.core.__ptr__;
5954 import smetana.core.__struct__;
6055 import smetana.core.size_t;
61 import smetana.core.amiga.StarArrayOfPtr;
6256 import smetana.core.amiga.StarStruct;
6357
6458 public class ST_tna_t extends UnsupportedStructAndPtr {
7367 this.parent = parent;
7468 }
7569
76 @Override
77 public StarStruct amp() {
78 return new Amp();
79 }
80
81 public class Amp extends UnsupportedStarStruct {
82
83 }
84
8570 // "typedef struct tna_t",
8671 // "{",
8772 // "Ppoint_t a[2]",
8873 // "}",
8974 // "tna_t");
90 private double t;
91 private final ST_pointf a[] = new ST_pointf[] { new ST_pointf(), new ST_pointf() };
75 public double t;
76 public final ST_pointf a[] = new ST_pointf[] { new ST_pointf(), new ST_pointf() };
77
78 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{
9279
93 class ArrayOfTwo extends UnsupportedArrayOfStruct {
80 private final List<ST_tna_t> data;
81 private final int pos;
82
83
84 @Override
85 public Array asPtr() {
86 return this;
87 }
88
89 @Override
90 public ST_tna_t getStruct() {
91 return data.get(pos);
92 }
93
94 public Array(int size) {
95 this.data = new ArrayList<ST_tna_t>();
96 this.pos = 0;
97 for (int i = 0; i < size; i++) {
98 data.add(new ST_tna_t());
99 }
100 }
94101
95 final private int pos;
102 public Array reallocJ(int newsize) {
103 while (data.size() < newsize) {
104 data.add(new ST_tna_t());
105 }
106 return this;
107 }
108
109 public Array plus(int delta) {
110 return plusJ(delta);
111 }
96112
97 public ArrayOfTwo(int pos) {
113 private Array(List<ST_tna_t> data, int pos) {
114 this.data = data;
98115 this.pos = pos;
99116 }
100117
101 @Override
102 public __array_of_struct__ plus(int delta) {
103 return new ArrayOfTwo(pos + delta);
118 public ST_tna_t get(int i) {
119 return this.data.get(pos + i);
104120 }
105121
106 @Override
107 public __struct__ getStruct() {
108 return a[pos];
122 public Array plusJ(int i) {
123 return new Array(data, pos + i);
109124 }
110125
111 @Override
112 public void setStruct(__struct__ value) {
113 a[pos].copyDataFrom(value);
126 public int minus(Array other) {
127 if (this.data != other.data) {
128 throw new IllegalArgumentException();
129 }
130 return this.pos - other.pos;
114131 }
115132
116 @Override
117 public double getDouble(String fieldName) {
118 return getStruct().getDouble(fieldName);
133 public Array move(int delta) {
134 throw new UnsupportedOperationException(getClass().toString());
119135 }
136
137 public void realloc(size_t nb) {
138 throw new UnsupportedOperationException(getClass().toString());
139 }
140
141 public int comparePointerInternal(__array_of_ptr__ other) {
142 throw new UnsupportedOperationException(getClass().toString());
143 }
144
120145
121146 }
122147
123 @Override
124 public __array_of_struct__ getArrayOfStruct(String fieldName) {
125 if (fieldName.equals("a")) {
126 return new ArrayOfTwo(0);
127 }
128 return super.getArrayOfStruct(fieldName);
129 }
130
131 @Override
132 public double getDouble(String fieldName) {
133 if (fieldName.equals("t")) {
134 return this.t;
135 }
136 return super.getDouble(fieldName);
137 }
138148
139149 @Override
140150 public void setDouble(String fieldName, double data) {
150160 return this;
151161 }
152162
153 public static size_t sizeof(final int nb) {
154 return new UnsupportedSize_t(nb) {
155 @Override
156 public Object malloc() {
157 return new StarArrayOfPtr(new STArray<ST_tna_t>(nb, 0, ST_tna_t.class));
158 }
159
160 @Override
161 public int getInternalNb() {
162 return nb;
163 }
164
165 @Override
166 public Object realloc(Object old) {
167 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
168 old2.realloc(nb);
169 return old2;
170 }
171 };
172 }
173
174163 }
175164
176165 // typedef struct tna_t {
4444 */
4545 package h;
4646
47 import h.ST_pathend_t.ArrayOfTwenty;
48 import smetana.core.UnsupportedArrayOfStruct;
49 import smetana.core.UnsupportedSize_t;
50 import smetana.core.UnsupportedStarStruct;
47 import java.util.ArrayList;
48 import java.util.List;
49
5150 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_struct__;
53 import smetana.core.__struct__;
54 import smetana.core.size_t;
55 import smetana.core.amiga.StarArrayOfPtr;
5651 import smetana.core.amiga.StarStruct;
5752
5853 public class ST_triangle_t extends UnsupportedStructAndPtr {
6762 this.parent = parent;
6863 }
6964
70 @Override
71 public StarStruct amp() {
72 return new Amp();
73 }
65 public static class Array {
7466
75 public class Amp extends UnsupportedStarStruct {
67 private final List<ST_triangle_t> data;
68 private final int pos;
69
70 public Array(int size) {
71 this.data = new ArrayList<ST_triangle_t>();
72 this.pos = 0;
73 for (int i = 0; i < size; i++) {
74 data.add(new ST_triangle_t());
75 }
76 }
77
78 public Array reallocJ(int newsize) {
79 while (data.size() < newsize) {
80 data.add(new ST_triangle_t());
81 }
82 return this;
83 }
84
85 private Array(List<ST_triangle_t> data, int pos) {
86 this.data = data;
87 this.pos = pos;
88 }
89
90 public ST_triangle_t get(int i) {
91 return this.data.get(pos + i);
92 }
93
94 public Array plusJ(int i) {
95 return new Array(data, pos + i);
96 }
97
98 public int minus(Array other) {
99 if (this.data != other.data) {
100 throw new IllegalArgumentException();
101 }
102 return this.pos - other.pos;
103 }
76104
77105 }
78106
79107 // "typedef struct triangle_t",
80108 // "{",
81 private int mark;
109 public int mark;
82110
83 private final ST_tedge_t e[] = new ST_tedge_t[] { new ST_tedge_t(), new ST_tedge_t(), new ST_tedge_t() };
84
85 class ArrayOfThree extends UnsupportedArrayOfStruct {
86
87 final private int pos;
88
89 public ArrayOfThree(int pos) {
90 this.pos = pos;
91 }
92
93 @Override
94 public __array_of_struct__ plus(int delta) {
95 return new ArrayOfThree(pos + delta);
96 }
97
98 @Override
99 public __struct__ getStruct() {
100 return e[pos];
101 }
102
103 @Override
104 public void setStruct(__struct__ value) {
105 e[pos].copyDataFrom(value);
106 }
107
108 @Override
109 public double getDouble(String fieldName) {
110 return getStruct().getDouble(fieldName);
111 }
112
113 }
111 public final ST_tedge_t e[] = new ST_tedge_t[] { new ST_tedge_t(), new ST_tedge_t(), new ST_tedge_t() };
114112
115113 // "struct tedge_t e[3]",
116114 // "}",
117115 // "triangle_t");
118
119 @Override
120 public int getInt(String fieldName) {
121 if (fieldName.equals("mark")) {
122 return this.mark;
123 }
124 return super.getInt(fieldName);
125 }
126116
127117 @Override
128118 public void setInt(String fieldName, int data) {
133123 super.setInt(fieldName, data);
134124 }
135125
136 @Override
137 public boolean getBoolean(String fieldName) {
138 if (fieldName.equals("mark")) {
139 return this.mark != 0;
140 }
141 return super.getBoolean(fieldName);
142 }
143
144 @Override
145 public __array_of_struct__ getArrayOfStruct(String fieldName) {
146 if (fieldName.equals("e")) {
147 return new ArrayOfThree(0);
148 }
149 return super.getArrayOfStruct(fieldName);
150 }
151
152 public static size_t sizeof(final int nb) {
153 return new UnsupportedSize_t(nb) {
154 @Override
155 public Object malloc() {
156 return new StarArrayOfPtr(new STArray<ST_triangle_t>(nb, 0, ST_triangle_t.class));
157 }
158
159 @Override
160 public int getInternalNb() {
161 return nb;
162 }
163
164 @Override
165 public Object realloc(Object old) {
166 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
167 old2.realloc(nb);
168 return old2;
169 }
170 };
171 }
172
173126 }
174127
175128 // typedef struct triangle_t {
4444 */
4545 package h;
4646
47 import smetana.core.UnsupportedSize_t;
48 import smetana.core.UnsupportedStarStruct;
47 import java.util.ArrayList;
48 import java.util.List;
49
50 import smetana.core.UnsupportedArrayOfStruct2;
4951 import smetana.core.UnsupportedStructAndPtr;
52 import smetana.core.__array_of_ptr__;
5053 import smetana.core.__ptr__;
5154 import smetana.core.__struct__;
5255 import smetana.core.size_t;
53 import smetana.core.amiga.StarArrayOfPtr;
5456 import smetana.core.amiga.StarStruct;
5557
5658 public class ST_xlabel_t extends UnsupportedStructAndPtr {
6567 this.parent = parent;
6668 }
6769
68 @Override
69 public StarStruct amp() {
70 return new Amp();
71 }
72
73 public class Amp extends UnsupportedStarStruct {
74
75 }
76
7770 // "typedef struct",
7871 // "{",
79 final private ST_pointf sz = new ST_pointf(this);
80 final private ST_pointf pos = new ST_pointf(this);
72 final public ST_pointf sz = new ST_pointf(this);
73 final public ST_pointf pos = new ST_pointf(this);
8174
8275 // "void *lbl",
83 private ST_textlabel_t lbl;
84 private int set;
76 public ST_textlabel_t lbl;
77 public int set;
8578
8679 // "unsigned char set",
8780 // "}",
8881 // "xlabel_t");
82
83 public static class Array extends UnsupportedArrayOfStruct2 implements __ptr__, __array_of_ptr__{
84
85 private final List<ST_xlabel_t> data;
86 private final int pos_;
87
88 @Override
89 public void setInt(String fieldName, int data) {
90 get(0).setInt(fieldName, data);
91 }
92
93 @Override
94 public void setStruct(__struct__ value) {
95 get(0).___(value);
96 }
97
98 @Override
99 public Array asPtr() {
100 return this;
101 }
102
103 @Override
104 public void setDouble(String fieldName, double value) {
105 get(0).setDouble(fieldName, value);
106 }
107
108 @Override
109 public ST_xlabel_t getStruct() {
110 return get(0).getStruct();
111 }
112
113 @Override
114 public __ptr__ getPtr() {
115 return get(0);
116 }
117
118 public Array(int size) {
119 this.data = new ArrayList<ST_xlabel_t>();
120 this.pos_ = 0;
121 for (int i = 0; i < size; i++) {
122 data.add(new ST_xlabel_t());
123 }
124 }
125
126 public Array reallocJ(int newsize) {
127 while (data.size() < newsize) {
128 data.add(new ST_xlabel_t());
129 }
130 return this;
131 }
132
133 public Array plus(int delta) {
134 return plusJ(delta);
135 }
136
137 private Array(List<ST_xlabel_t> data, int pos) {
138 this.data = data;
139 this.pos_ = pos;
140 }
141
142 public ST_xlabel_t get(int i) {
143 return this.data.get(pos_ + i);
144 }
145
146 public Array plusJ(int i) {
147 return new Array(data, pos_ + i);
148 }
149
150 public int minus(Array other) {
151 if (this.data != other.data) {
152 throw new IllegalArgumentException();
153 }
154 return this.pos_ - other.pos_;
155 }
156
157 public Array move(int delta) {
158 throw new UnsupportedOperationException(getClass().toString());
159 }
160
161
162 public void realloc(size_t nb) {
163 throw new UnsupportedOperationException(getClass().toString());
164 }
165
166 public int comparePointerInternal(__array_of_ptr__ other) {
167 throw new UnsupportedOperationException(getClass().toString());
168 }
169
170
171 }
172
89173
90174 @Override
91175 public void setInt(String fieldName, int data) {
95179 }
96180 super.setInt(fieldName, data);
97181 }
98
182
99183 @Override
100184 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
101185 if (fieldName.equals("lbl")) {
104188 }
105189 return super.setPtr(fieldName, newData);
106190 }
107
108 @Override
109 public __struct__ getStruct(String fieldName) {
110 if (fieldName.equals("sz")) {
111 return this.sz;
112 }
113 if (fieldName.equals("pos")) {
114 return this.pos;
115 }
116 return super.getStruct(fieldName);
191
192 @Override
193 public ST_xlabel_t getStruct() {
194 return this;
117195 }
118196
119197 @Override
129207 super.setStruct(fieldName, newData);
130208 }
131209
132 public static size_t sizeof(final int nb) {
133 return new UnsupportedSize_t(nb) {
134 @Override
135 public Object malloc() {
136 return new StarArrayOfPtr(new STArray<ST_xlabel_t>(nb, 0, ST_xlabel_t.class));
137 }
138
139 @Override
140 public int getInternalNb() {
141 return nb;
142 }
143
144 @Override
145 public Object realloc(Object old) {
146 StarArrayOfPtr old2 = (StarArrayOfPtr) old;
147 old2.realloc(nb);
148 return old2;
149 }
150 };
151 }
210 // public static size_t sizeof(final int nb) {
211 // return new UnsupportedSize_t(nb) {
212 // @Override
213 // public Object malloc() {
214 // return new StarArrayOfPtr(new STArray<ST_xlabel_t>(nb, 0, ST_xlabel_t.class));
215 // }
216 //
217 // @Override
218 // public int getInternalNb() {
219 // return nb;
220 // }
221 //
222 // @Override
223 // public Object realloc(Object old) {
224 // StarArrayOfPtr old2 = (StarArrayOfPtr) old;
225 // old2.realloc(nb);
226 // return old2;
227 // }
228 // };
229 // }
152230
153231 }
154232
+0
-71
src/h/SplitQ_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5la7qmeq461s77rfwh637x31k
52
53 public interface SplitQ_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct split_q_s",
56 "{",
57 "struct Branch BranchBuf[64 + 1]",
58 "struct Rect CoverSplit",
59 "unsigned int CoverSplitArea",
60 "struct PartitionVars Partitions[1]",
61 "}",
62 "SplitQ_t");
63 }
64
65 // typedef struct split_q_s {
66 // struct Branch BranchBuf[64 + 1];
67 // struct Rect CoverSplit;
68 // unsigned int CoverSplitArea;
69 // struct PartitionVars Partitions[1];
70 // } SplitQ_t;
+0
-79
src/h/XLabels_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5g5jopfxwib4iq0tncmxengai
52
53 public interface XLabels_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct XLabels_s",
56 "{",
57 "object_t *objs",
58 "int n_objs",
59 "xlabel_t *lbls",
60 "int n_lbls",
61 "label_params_t *params",
62 "Dt_t *hdx",
63 "RTree_t *spdx",
64 "}",
65 "XLabels_t");
66 }
67
68 // typedef struct XLabels_s {
69 // object_t *objs;
70 // int n_objs;
71 // xlabel_t *lbls;
72 // int n_lbls;
73 // label_params_t *params;
74 //
75 // Dt_t *hdx; // splay tree keyed with hilbert spatial codes
76 // RTree_t *spdx; // rtree
77 //
78 // } XLabels_t;
+0
-69
src/h/_Node_t___.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aqoki3wwzhqcy2mpz21vzdona
52
53 public interface _Node_t___ extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct Node",
56 "{",
57 "int count",
58 "int level",
59 "struct Branch branch[64]",
60 "}",
61 "Node_t");
62 }
63
64 // typedef struct Node {
65 // int count;
66 // int level; /* 0 is leaf, others positive */
67 // struct Branch branch[64];
68 // } Node_t;
+0
-82
src/h/_dt_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 926gualwyh744kklf86qw5qsj
52
53 public interface _dt_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dt_s",
56 "{",
57 "Dtsearch_f searchf",
58 "Dtdisc_t* disc",
59 "Dtdata_t* data",
60 "Dtmemory_f memoryf",
61 "Dtmethod_t* meth",
62 "int type",
63 "int nview",
64 "Dt_t* view",
65 "Dt_t* walk",
66 "void* user",
67 "}");
68 }
69
70 // struct _dt_s
71 // { Dtsearch_f searchf;/* search function */
72 // Dtdisc_t* disc; /* method to manipulate objs */
73 // Dtdata_t* data; /* sharable data */
74 // Dtmemory_f memoryf;/* function to alloc/free memory */
75 // Dtmethod_t* meth; /* dictionary method */
76 // int type; /* type information */
77 // int nview; /* number of parent view dictionaries */
78 // Dt_t* view; /* next on viewpath */
79 // Dt_t* walk; /* dictionary being walked */
80 // void* user; /* for user's usage */
81 // };
+0
-85
src/h/_dtdata_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2ncfjhm10yijctdn20pwnelos
52
53 public interface _dtdata_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dtdata_s",
56 "{",
57 "int type",
58 "Dtlink_t* here",
59 "union",
60 "{",
61 "Dtlink_t** _htab",
62 "Dtlink_t* _head",
63 "}",
64 "hh",
65 "int ntab",
66 "int size",
67 "int loop",
68 "int minp",
69 "}");
70 }
71
72 // struct _dtdata_s
73 // { int type; /* type of dictionary */
74 // Dtlink_t* here; /* finger to last search element */
75 // union
76 // { Dtlink_t** _htab; /* hash table */
77 // Dtlink_t* _head; /* linked list */
78 // } hh;
79 // int ntab; /* number of hash slots */
80 // int size; /* number of objects */
81 // int loop; /* number of nested loops */
82 // int minp; /* min path before splay, always even */
83 // /* for hash dt, > 0: fixed table size */
84 // };
+0
-80
src/h/_dtdisc_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7uiwhqnseej0oaqiv35vi47k1
52
53 public interface _dtdisc_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dtdisc_s",
56 "{",
57 "int key",
58 "int size",
59 "int link",
60 "Dtmake_f makef",
61 "Dtfree_f freef",
62 "Dtcompar_f comparf",
63 "Dthash_f hashf",
64 "Dtmemory_f memoryf",
65 "Dtevent_f eventf",
66 "}");
67 }
68
69 // struct _dtdisc_s
70 // { int key; /* where the key begins in an object */
71 // int size; /* key size and type */
72 // int link; /* offset to Dtlink_t field */
73 // Dtmake_f makef; /* object constructor */
74 // Dtfree_f freef; /* object destructor */
75 // Dtcompar_f comparf;/* to compare two objects */
76 // Dthash_f hashf; /* to compute hash value of an object */
77 // Dtmemory_f memoryf;/* to allocate/free memory */
78 // Dtevent_f eventf; /* to process events */
79 // };
+0
-66
src/h/_dthold_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 bj5vks4vb3mb95f68v6qwe1q
52
53 public interface _dthold_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dthold_s",
56 "{",
57 "Dtlink_t hdr",
58 "void* obj",
59 "}");
60 }
61
62 // struct _dthold_s
63 // { Dtlink_t hdr; /* header */
64 // void* obj; /* user object */
65 // };
+0
-74
src/h/_dtlink_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 6b881ar4wz3iwu5spghy0ocnj
52
53 public interface _dtlink_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dtlink_s",
56 "{",
57 "Dtlink_t* right",
58 "union",
59 "{",
60 "unsigned int _hash",
61 "Dtlink_t* _left",
62 "}",
63 "hl",
64 "}");
65 }
66
67 // struct _dtlink_s
68 // { Dtlink_t* right; /* right child */
69 // union
70 // { unsigned int _hash; /* hash value */
71 // Dtlink_t* _left; /* left child */
72 // } hl;
73 // };
+0
-66
src/h/_dtmethod_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4djfx98e5oxk0jjryvk4600wt
52
53 public interface _dtmethod_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct _dtmethod_s",
56 "{",
57 "Dtsearch_f searchf",
58 "int type",
59 "}");
60 }
61
62 // struct _dtmethod_s
63 // { Dtsearch_f searchf; /* search function */
64 // int type; /* type of operation */
65 // };
+0
-59
src/h/aag_buffer_state.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e7lgo132acoi1iqay15jxdzl9
52
53 public interface aag_buffer_state extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct aag_buffer_state *YY_BUFFER_STATE");
56 }
57
58 // typedef struct aag_buffer_state *YY_BUFFER_STATE;
+0
-67
src/h/aag_trans_info.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8hrh4p1c1600bqkq54h8v51u7
52
53 public interface aag_trans_info extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct aag_trans_info",
56 "{",
57 "flex_int32_t aag_verify",
58 "flex_int32_t aag_nxt",
59 "}");
60 }
61
62 // struct aag_trans_info
63 // {
64 // flex_int32_t aag_verify;
65 // flex_int32_t aag_nxt;
66 // };
+0
-67
src/h/adjmatrix_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 lba1kw4oxusponhglgarjnj1
52
53 public interface adjmatrix_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct adjmatrix_t",
56 "{",
57 "int nrows, ncols",
58 "char *data",
59 "}",
60 "adjmatrix_t");
61 }
62
63 // typedef struct adjmatrix_t {
64 // int nrows, ncols;
65 // char *data;
66 // } adjmatrix_t;
+0
-63
src/h/agerrlevel_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 eplx3pd5fkm68aeae4k6rwmj7
52
53 public interface agerrlevel_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "AGWARN, AGERR, AGMAX, AGPREV",
58 "}",
59 "agerrlevel_t");
60 }
61
62 // typedef enum { AGWARN, AGERR, AGMAX, AGPREV } agerrlevel_t;
+0
-59
src/h/agobjsearchfn_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dr9rtwhzssf8aypcenb0z3tfy
52
53 public interface agobjsearchfn_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef Agobj_t *(*agobjsearchfn_t) (Agraph_t * g, Agobj_t * obj)");
56 }
57
58 // typedef Agobj_t *(*agobjsearchfn_t) (Agraph_t * g, Agobj_t * obj);
+0
-59
src/h/agusererrf.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dar3eyxi2ee4qldba8o9a54az
52
53 public interface agusererrf extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef int (*agusererrf) (char*)");
56 }
57
58 // typedef int (*agusererrf) (char*);
+0
-71
src/h/agxbuf.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2bvk4wwyb3pp3ygpa39hp9xqw
52
53 public interface agxbuf extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "unsigned char *buf",
58 "unsigned char *ptr",
59 "unsigned char *eptr",
60 "int dyna",
61 "}",
62 "agxbuf");
63 }
64
65 // typedef struct {
66 // unsigned char *buf; /* start of buffer */
67 // unsigned char *ptr; /* next place to write */
68 // unsigned char *eptr; /* end of buffer */
69 // int dyna; /* true if buffer is malloc'ed */
70 // } agxbuf;
+0
-67
src/h/ainfo.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aqlnras6a8pluk7ulr2jzajlz
52
53 public interface ainfo extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "double width, height",
58 "int index",
59 "}",
60 "ainfo");
61 }
62
63 // typedef struct {
64 // double width, height;
65 // int index; /* index in original array */
66 // } ainfo;
+0
-69
src/h/arrowdir_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5ghieyxthirf2pc6x8z6vuj05
52
53 public interface arrowdir_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct arrowdir_t",
56 "{",
57 "char *dir",
58 "int sflag",
59 "int eflag",
60 "}",
61 "arrowdir_t");
62 }
63
64 // typedef struct arrowdir_t {
65 // char *dir;
66 // int sflag;
67 // int eflag;
68 // } arrowdir_t;
+0
-67
src/h/arrowname_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9xua47nwla43qv3cmy92tx1mr
52
53 public interface arrowname_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct arrowname_t",
56 "{",
57 "char *name",
58 "int type",
59 "}",
60 "arrowname_t");
61 }
62
63 // typedef struct arrowname_t {
64 // char *name;
65 // int type;
66 // } arrowname_t;
+0
-69
src/h/arrowtype_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 cvw01xnbdvcxj00pawmicyx3p
52
53 public interface arrowtype_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct arrowtype_t",
56 "{",
57 "int type",
58 "double lenfact",
59 "void (*gen) (GVJ_t * job, pointf p, pointf u, double arrowsize, double penwidth, int flag)",
60 "}",
61 "arrowtype_t");
62 }
63
64 // typedef struct arrowtype_t {
65 // int type;
66 // double lenfact; /* ratio of length of this arrow type to standard arrow */
67 // void (*gen) (GVJ_t * job, pointf p, pointf u, double arrowsize, double penwidth, int flag); /* generator function for type */
68 // } arrowtype_t;
+0
-78
src/h/aspect_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7ric227rdgzts8ajl8qu4g4r3
52
53 public interface aspect_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct aspect_t",
56 "{",
57 "double targetAR",
58 "double combiAR",
59 "int prevIterations",
60 "int curIterations",
61 "int nextIter",
62 "int nPasses",
63 "int badGraph",
64 "}",
65 "aspect_t");
66 }
67
68 // typedef struct aspect_t {
69 // double targetAR; /* target aspect ratio */
70 // double combiAR;
71 // int prevIterations; /* no. of iterations in previous pass */
72 // int curIterations; /* no. of iterations in current pass */
73 // int nextIter; /* dynamically adjusted no. of iterations */
74 // int nPasses; /* bound on no. of top-level passes */
75 // int badGraph; /* hack: set if graph is disconnected or has
76 // * clusters. If so, turn off aspect */
77 // } aspect_t;
+0
-57
src/h/attrsym_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 d4orkcxq0xaek87mt94led8jv
50
51 public interface attrsym_t extends Agsym_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agsym_s attrsym_t");
54 }
55
56 // typedef struct Agsym_s attrsym_t;
+0
-63
src/h/bend.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5vksevapsq3dmbrs630cwnpqp
52
53 public interface bend extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "B_NODE, B_UP, B_LEFT, B_DOWN, B_RIGHT",
58 "}",
59 "bend");
60 }
61
62 // typedef enum {B_NODE, B_UP, B_LEFT, B_DOWN, B_RIGHT} bend;
+0
-71
src/h/bezier.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2rm8pcuhkjly1xk9haledn1k9
52
53 public interface bezier extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct bezier",
56 "{",
57 "pointf *list",
58 "int size",
59 "int sflag, eflag",
60 "pointf sp, ep",
61 "}",
62 "bezier");
63 }
64
65 // typedef struct bezier {
66 // pointf *list;
67 // int size;
68 // int sflag, eflag;
69 // pointf sp, ep;
70 // } bezier;
+0
-71
src/h/blk_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 az8jvz0appwxv09fzo6ia7pw2
52
53 public interface blk_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct blk_t",
56 "{",
57 "Agnode_t **data",
58 "Agnode_t **endp",
59 "struct blk_t *prev",
60 "struct blk_t *next",
61 "}",
62 "blk_t");
63 }
64
65 // typedef struct blk_t {
66 // Agnode_t **data;
67 // Agnode_t **endp;
68 // struct blk_t *prev;
69 // struct blk_t *next;
70 // } blk_t;
+0
-80
src/h/block.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aeiesb8xknt6qv58gj7tdny3l
52
53 public interface block extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct block",
56 "{",
57 "Agnode_t *child",
58 "block_t *next",
59 "Agraph_t *sub_graph",
60 "double radius",
61 "double rad0",
62 "nodelist_t *circle_list",
63 "blocklist_t children",
64 "double parent_pos",
65 "int flags",
66 "}");
67 }
68
69 // struct block {
70 // Agnode_t *child; /* if non-null, points to node in parent block */
71 // block_t *next; /* sibling block */
72 // Agraph_t *sub_graph; /* nodes and edges in this block */
73 // double radius; /* radius of block and subblocks */
74 // double rad0; /* radius of block */
75 // nodelist_t *circle_list; /* ordered list of nodes in block */
76 // blocklist_t children; /* child blocks */
77 // double parent_pos; /* if block has 1 node, angle to place parent */
78 // int flags;
79 // };
+0
-57
src/h/block_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 9hb5i7kwpg2hbs4jpz9n14is
50
51 public interface block_t extends block {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct block block_t");
54 }
55
56 // typedef struct block block_t;
+0
-67
src/h/blocklist_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4fuyio1lh8xw103g3n4akljx4
52
53 public interface blocklist_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "block_t *first",
58 "block_t *last",
59 "}",
60 "blocklist_t");
61 }
62
63 // typedef struct {
64 // block_t *first;
65 // block_t *last;
66 // } blocklist_t;
+0
-63
src/h/box.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 ecciois6ttiu20v5ds6ne801k
52
53 public interface box extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "point LL, UR",
58 "}",
59 "box");
60 }
61
62 // typedef struct { point LL, UR; } box;
+0
-63
src/h/boxf.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5ixaxdj4kxutnllqftpefs67r
52
53 public interface boxf extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "pointf LL, UR",
58 "}",
59 "boxf");
60 }
61
62 // typedef struct { pointf LL, UR; } boxf;
+0
-69
src/h/bport_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 enjd0328nmx4raj6kmm6ktq7y
52
53 public interface bport_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct bport_s",
56 "{",
57 "edge_t *e",
58 "node_t *n",
59 "double alpha",
60 "}",
61 "bport_t");
62 }
63
64 // typedef struct bport_s {
65 // edge_t *e;
66 // node_t *n;
67 // double alpha;
68 // } bport_t;
+0
-59
src/h/bsearch_cmpf.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dw2o83im6nk4bxd64xd6z2z00
52
53 public interface bsearch_cmpf extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef int (*bsearch_cmpf) (const void *, const void *)");
56 }
57
58 // typedef int (*bsearch_cmpf) (const void *, const void *);
+0
-68
src/h/buff_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 f33zs2sbhgsvvrelmw2nq6vt3
52
53 public interface buff_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct buff_s",
56 "{",
57 "int fd",
58 "fpos_t pos",
59 "char *template",
60 "}");
61 }
62
63 // struct buff_s {
64 // int fd;
65 // fpos_t pos;
66 // char *template;
67 // };
+0
-79
src/h/ccgnodeinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e6r3vblqbmjwwqavuqcrl06zb
52
53 public interface ccgnodeinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Agrec_t h",
58 "char mark",
59 "union",
60 "{",
61 "Agraph_t* g",
62 "Agnode_t* n",
63 "void* v",
64 "}",
65 "ptr",
66 "}",
67 "ccgnodeinfo_t");
68 }
69
70 // typedef struct {
71 // Agrec_t h;
72 // char mark;
73 // union {
74 // Agraph_t* g;
75 // Agnode_t* n;
76 // void* v;
77 // } ptr;
78 // } ccgnodeinfo_t;
+0
-67
src/h/ccgraphinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 b28r73e4bd3fdpfewruggsvk1
52
53 public interface ccgraphinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Agrec_t h",
58 "char cc_subg",
59 "}",
60 "ccgraphinfo_t");
61 }
62
63 // typedef struct {
64 // Agrec_t h;
65 // char cc_subg; /* true iff subgraph corresponds to a component */
66 // } ccgraphinfo_t;
+0
-125
src/h/cdata.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 39c66ffd2kgahvaaf8e61dspv
52
53 public interface cdata extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "union",
58 "{",
59 "Agraph_t *g",
60 "Agnode_t *np",
61 "}",
62 "orig",
63 "int flags",
64 "node_t *parent",
65 "block_t *block",
66 "union",
67 "{",
68 "struct",
69 "{",
70 "node_t *next",
71 "int val",
72 "int low_val",
73 "}",
74 "bc",
75 "node_t *clone",
76 "struct",
77 "{",
78 "node_t *tparent",
79 "node_t *first",
80 "node_t *second",
81 "int fdist",
82 "int sdist",
83 "}",
84 "t",
85 "struct",
86 "{",
87 "int pos",
88 "double psi",
89 "}",
90 "f",
91 "}",
92 "u",
93 "}",
94 "cdata");
95 }
96
97 // typedef struct {
98 // union { /* Pointer to node/cluster in original graph */
99 // Agraph_t *g;
100 // Agnode_t *np;
101 // } orig;
102 // int flags;
103 // node_t *parent; /* parent in block-cutpoint traversal (1,2,4) */
104 // block_t *block; /* Block containing node (1,2,3,4) */
105 // union {
106 // struct { /* Pass 1 */
107 // node_t *next; /* used for stack */
108 // int val;
109 // int low_val;
110 // } bc;
111 // node_t *clone; /* Cloned node (3a) */
112 // struct { /* Spanning tree and longest path (3b) */
113 // node_t *tparent; /* Parent in tree */
114 // node_t *first; /* Leaf on longest path from node */
115 // node_t *second; /* Leaf on 2nd longest path from node */
116 // int fdist; /* Length of longest path from node */
117 // int sdist; /* Length of 2nd longest path from node */
118 // } t;
119 // struct {
120 // int pos; /* Index of node in block circle (3c,4) */
121 // double psi; /* Offset angle of children (4) */
122 // } f;
123 // } u;
124 // } cdata;
+0
-69
src/h/cell.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5st453umnwqp8rukqzc30apk6
52
53 public interface cell extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "gridpt p",
58 "node_list *nodes",
59 "Dtlink_t link",
60 "}",
61 "cell");
62 }
63
64 // typedef struct {
65 // gridpt p; /* index of cell */
66 // node_list *nodes; /* nodes in cell */
67 // Dtlink_t link; /* cdt data */
68 // } cell;
+0
-69
src/h/chanItem.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 caod2kxpi4xwamq1g7wm3mm6o
52
53 public interface chanItem extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Dtlink_t link",
58 "double v",
59 "Dt_t* chans",
60 "}",
61 "chanItem");
62 }
63
64 // typedef struct {
65 // Dtlink_t link;
66 // double v;
67 // Dt_t* chans;
68 // } chanItem;
+0
-75
src/h/channel.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 71crbqpwuxwtsnppsp39wccqp
52
53 public interface channel extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Dtlink_t link",
58 "paird p",
59 "int cnt",
60 "segment** seg_list",
61 "rawgraph* G",
62 "struct cell* cp",
63 "}",
64 "channel");
65 }
66
67 // typedef struct {
68 // Dtlink_t link;
69 // paird p; /* extrema of channel */
70 // int cnt; /* number of segments */
71 // segment** seg_list; /* array of segment pointers */
72 // rawgraph* G;
73 // struct cell* cp;
74 // } channel;
+0
-67
src/h/cinfo_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9i2jwknpgmej0gz38zz670oa
52
53 public interface cinfo_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "boxf bb",
58 "object_t* objp",
59 "}",
60 "cinfo_t");
61 }
62
63 // typedef struct {
64 // boxf bb;
65 // object_t* objp;
66 // } cinfo_t;
+0
-77
src/h/circ_state.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3lnrtud6sukofbfngncbfav33
52
53 public interface circ_state extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "blocklist_t bl",
58 "int orderCount",
59 "int blockCount",
60 "attrsym_t *N_artpos",
61 "attrsym_t *N_root",
62 "char *rootname",
63 "double min_dist",
64 "}",
65 "circ_state");
66 }
67
68 // typedef struct {
69 // blocklist_t bl;
70 // int orderCount;
71 // int blockCount;
72 // attrsym_t *N_artpos;
73 // attrsym_t *N_root;
74 // char *rootname;
75 // double min_dist;
76 // } circ_state;
+0
-69
src/h/clist_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2ibe0en9njq1f3z4y5g2kzaj2
52
53 public interface clist_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "graph_t **cl",
58 "int sz",
59 "int cnt",
60 "}",
61 "clist_t");
62 }
63
64 // typedef struct {
65 // graph_t **cl;
66 // int sz;
67 // int cnt;
68 // } clist_t;
+0
-67
src/h/deque_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 15n6mbjkpo4mjswqo3d30dej6
52
53 public interface deque_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct deque_t",
56 "{",
57 "pointnlink_t **pnlps",
58 "int pnlpn, fpnlpi, lpnlpi, apex",
59 "}",
60 "deque_t");
61 }
62
63 // typedef struct deque_t {
64 // pointnlink_t **pnlps;
65 // int pnlpn, fpnlpi, lpnlpi, apex;
66 // } deque_t;
+0
-57
src/h/edge_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 1fsfdd86c8isg6ylp15pwknbu
50
51 public interface edge_t extends Agedge_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agedge_s edge_t");
54 }
55
56 // typedef struct Agedge_s edge_t;
+0
-67
src/h/elist.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8lw80si2xjoivlskhxdmff5mu
52
53 public interface elist extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct elist",
56 "{",
57 "edge_t **list",
58 "int size",
59 "}",
60 "elist");
61 }
62
63 // typedef struct elist {
64 // edge_t **list;
65 // int size;
66 // } elist;
+0
-67
src/h/elist_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8ya2p1uqesbvs87po5upckzn0
52
53 public interface elist_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct elist_t",
56 "{",
57 "Pedge_t *ep",
58 "struct elist_t *next, *prev",
59 "}",
60 "elist_t");
61 }
62
63 // typedef struct elist_t {
64 // Pedge_t *ep;
65 // struct elist_t *next, *prev;
66 // } elist_t;
+0
-70
src/h/fail_stack_type.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 el5ktmij22s6d4cvfe81842jd
52
53 public interface fail_stack_type extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "fail_stack_elt_t *stack",
58 "unsigned size",
59 "unsigned avail",
60 "}",
61 "fail_stack_type");
62 }
63
64 // typedef struct
65 // {
66 // fail_stack_elt_t *stack;
67 // unsigned size;
68 // unsigned avail; /* Offset of next open position. */
69 // } fail_stack_type;
+0
-78
src/h/fdpParms_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 f7uv7vj69dm0khl1b380tapm
52
53 public interface fdpParms_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct fdpParms_s",
56 "{",
57 "int useGrid",
58 "int useNew",
59 "int numIters",
60 "int unscaled",
61 "double C",
62 "double Tfact",
63 "double K",
64 "double T0",
65 "}");
66 }
67
68 // struct fdpParms_s {
69 // int useGrid; /* use grid for speed up */
70 // int useNew; /* encode x-K into attractive force */
71 // int numIters; /* actual iterations in layout */
72 // int unscaled; /* % of iterations used in pass 1 */
73 // double C; /* Repulsion factor in xLayout */
74 // double Tfact; /* scale temp from default expression */
75 // double K; /* spring constant; ideal distance */
76 // double T0; /* initial temperature */
77 // };
+0
-57
src/h/fdpParms_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 8unwxxsfji1yz0v4p07nrybhu
50
51 public interface fdpParms_t extends fdpParms_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct fdpParms_s fdpParms_t");
54 }
55
56 // typedef struct fdpParms_s fdpParms_t;
+0
-79
src/h/field_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5slbuxsxkyuboijzrnorwqjk4
52
53 public interface field_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct field_t",
56 "{",
57 "pointf size",
58 "boxf b",
59 "int n_flds",
60 "textlabel_t *lp",
61 "struct field_t **fld",
62 "char *id",
63 "unsigned char LR",
64 "unsigned char sides",
65 "}",
66 "field_t");
67 }
68
69 // typedef struct field_t {
70 // pointf size; /* its dimension */
71 // boxf b; /* its placement in node's coordinates */
72 // int n_flds;
73 // textlabel_t *lp; /* n_flds == 0 */
74 // struct field_t **fld; /* n_flds > 0 */
75 // char *id; /* user's identifier */
76 // unsigned char LR; /* if box list is horizontal (left to right) */
77 // unsigned char sides; /* sides of node exposed to field */
78 // } field_t;
+0
-63
src/h/fill_type.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7yr1sspvlqw3sgiyhkr854cd
52
53 public interface fill_type extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "FILL_NONE, FILL_SOLID, FILL_LINEAR, FILL_RADIAL",
58 "}",
59 "fill_type");
60 }
61
62 // typedef enum { FILL_NONE, FILL_SOLID, FILL_LINEAR, FILL_RADIAL } fill_type;
+0
-67
src/h/fitem.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2w2z3tmg7hmxrqko2dt5rsqag
52
53 public interface fitem extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Dtlink_t link",
58 "textspan_t ti",
59 "}",
60 "fitem");
61 }
62
63 // typedef struct {
64 // Dtlink_t link;
65 // textspan_t ti;
66 // } fitem;
+0
-59
src/h/flushfn.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 6co8gnhn5xjhq4c6lyebol0jr
52
53 public interface flushfn extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef int (*flushfn) (void *chan)");
56 }
57
58 // typedef int (*flushfn) (void *chan);
+0
-63
src/h/font_type.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2xdqtc3a2c3n08rywh1rm8cjw
52
53 public interface font_type extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "FONT_REGULAR, FONT_BOLD, FONT_ITALIC",
58 "}",
59 "font_type");
60 }
61
62 // typedef enum { FONT_REGULAR, FONT_BOLD, FONT_ITALIC } font_type;
+0
-68
src/h/fontinfo.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 964775l6tcok47z2sykyt451v
52
53 public interface fontinfo extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct fontinfo",
56 "{",
57 "double fontsize",
58 "char *fontname",
59 "char *fontcolor",
60 "}");
61 }
62
63 // struct fontinfo {
64 // double fontsize;
65 // char *fontname;
66 // char *fontcolor;
67 // };
+0
-73
src/h/format_type.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 48gvd3f5a7qs6f6eid493tvyl
52
53 public interface format_type extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "FORMAT_PNG_XDOT, FORMAT_GIF_XDOT, FORMAT_JPEG_XDOT, FORMAT_SVG_XDOT, FORMAT_PS_XDOT, FORMAT_PNG_DOT, FORMAT_GIF_DOT, FORMAT_JPEG_DOT, FORMAT_SVG_DOT, FORMAT_PS_DOT, FORMAT_PNG_MAP, FORMAT_GIF_MAP, FORMAT_JPEG_MAP, FORMAT_SVG_MAP, FORMAT_PS_MAP, FORMAT_PNG_SVG, FORMAT_GIF_SVG, FORMAT_JPEG_SVG, FORMAT_SVG_SVG, FORMAT_PNG_FIG, FORMAT_GIF_FIG, FORMAT_JPEG_FIG, FORMAT_PNG_VRML, FORMAT_GIF_VRML, FORMAT_JPEG_VRML, FORMAT_PS_PS, FORMAT_PSLIB_PS, FORMAT_PNG_VML, FORMAT_GIF_VML, FORMAT_JPEG_VML, FORMAT_GIF_TK,",
58 "}",
59 "format_type");
60 }
61
62 // typedef enum {
63 // FORMAT_PNG_XDOT, FORMAT_GIF_XDOT, FORMAT_JPEG_XDOT, FORMAT_SVG_XDOT, FORMAT_PS_XDOT,
64 // FORMAT_PNG_DOT, FORMAT_GIF_DOT, FORMAT_JPEG_DOT, FORMAT_SVG_DOT, FORMAT_PS_DOT,
65 // FORMAT_PNG_MAP, FORMAT_GIF_MAP, FORMAT_JPEG_MAP, FORMAT_SVG_MAP, FORMAT_PS_MAP,
66 // FORMAT_PNG_SVG, FORMAT_GIF_SVG, FORMAT_JPEG_SVG, FORMAT_SVG_SVG,
67 // FORMAT_PNG_FIG, FORMAT_GIF_FIG, FORMAT_JPEG_FIG,
68 // FORMAT_PNG_VRML, FORMAT_GIF_VRML, FORMAT_JPEG_VRML,
69 // FORMAT_PS_PS, FORMAT_PSLIB_PS,
70 // FORMAT_PNG_VML, FORMAT_GIF_VML, FORMAT_JPEG_VML,
71 // FORMAT_GIF_TK,
72 // } format_type;
+0
-59
src/h/freefunc_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e8aa7nh48ajm604b51pz19bub
52
53 public interface freefunc_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef void (*freefunc_t)(xdot_op*)");
56 }
57
58 // typedef void (*freefunc_t)(xdot_op*);
+0
-67
src/h/fspan.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 ey73hen3l0l82tzpokzw8heu4
52
53 public interface fspan extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "Dtlink_t link",
58 "htextspan_t lp",
59 "}",
60 "fspan");
61 }
62
63 // typedef struct {
64 // Dtlink_t link;
65 // htextspan_t lp;
66 // } fspan;
+0
-78
src/h/gdata.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2ruxso0qdpjclz5edssp197zm
52
53 public interface gdata extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "bport_t *ports",
58 "int nports",
59 "boxf bb",
60 "int flags",
61 "int level",
62 "graph_t *parent",
63 "}",
64 "gdata");
65 }
66
67 // typedef struct {
68 // bport_t *ports; /* boundary ports. 0-terminated */
69 // int nports; /* no. of ports */
70 // boxf bb; /* bounding box of graph */
71 // int flags;
72 // int level; /* depth in graph hierarchy */
73 // graph_t *parent; /* smallest containing cluster */
74 //
75 //
76 //
77 // } gdata;
+0
-71
src/h/ginfo.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 49o2f0vj6o2k7glkg59q1t341
52
53 public interface ginfo extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int perim",
58 "point *cells",
59 "int nc",
60 "int index",
61 "}",
62 "ginfo");
63 }
64
65 // typedef struct {
66 // int perim; /* half size of bounding rectangle perimeter */
67 // point *cells; /* cells in covering polyomino */
68 // int nc; /* no. of cells */
69 // int index; /* index in original array */
70 // } ginfo;
+0
-57
src/h/graph_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 ebapqf0991e4p4fqcr0tva8qa
50
51 public interface graph_t extends Agraph_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agraph_s graph_t");
54 }
55
56 // typedef struct Agraph_s graph_t;
+0
-65
src/h/gridpt.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 bh966kf6yzel6b62omfkro2sw
52
53 public interface gridpt extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int i, j",
58 "}",
59 "gridpt");
60 }
61
62 // typedef struct {
63 // int i, j;
64 // } gridpt;
+0
-71
src/h/gstack_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the Eclipse Public License.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 *************************************************************************
35 * Copyright (c) 2011 AT&T Intellectual Property
36 * All rights reserved. This program and the accompanying materials
37 * are made available under the terms of the Eclipse Public License v1.0
38 * which accompanies this distribution, and is available at
39 * http://www.eclipse.org/legal/epl-v10.html
40 *
41 * Contributors: See CVS logs. Details at http://www.graphviz.org/
42 *************************************************************************
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 831302imlb2pb01kdebykh623
52
53 public interface gstack_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gstack_s",
56 "{",
57 "Agraph_t *g",
58 "Agraph_t *subg",
59 "list_t nodelist,edgelist,attrlist",
60 "struct gstack_s *down",
61 "}",
62 "gstack_t");
63 }
64
65 // typedef struct gstack_s {
66 // Agraph_t *g;
67 // Agraph_t *subg;
68 // list_t nodelist,edgelist,attrlist;
69 // struct gstack_s *down;
70 // } gstack_t;
+0
-69
src/h/gv_argvlist_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 ed9gxxtmujpu6gyrtmhxdut42
52
53 public interface gv_argvlist_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gv_argvlist_s",
56 "{",
57 "char **argv",
58 "int argc",
59 "int alloc",
60 "}",
61 "gv_argvlist_t");
62 }
63
64 // typedef struct gv_argvlist_s {
65 // char **argv;
66 // int argc;
67 // int alloc;
68 // } gv_argvlist_t;
+0
-63
src/h/gvattr_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2sx3fd85hu0bac6ji75ngovnu
52
53 public interface gvattr_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "GVATTR_STRING, GVATTR_BOOL, GVATTR_COLOR",
58 "}",
59 "gvattr_t");
60 }
61
62 // typedef enum { GVATTR_STRING, GVATTR_BOOL, GVATTR_COLOR } gvattr_t;
+0
-85
src/h/gvcolor_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9xilv9or3ptvy3gupp6t2ql19
52
53 public interface gvcolor_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct color_s",
56 "{",
57 "union",
58 "{",
59 "double RGBA[4]",
60 "double HSVA[4]",
61 "unsigned char rgba[4]",
62 "unsigned char cmyk[4]",
63 "int rrggbbaa[4]",
64 "char *string",
65 "int index",
66 "}",
67 "u",
68 "color_type_t type",
69 "}",
70 "gvcolor_t");
71 }
72
73 // typedef struct color_s {
74 // union {
75 // double RGBA[4];
76 // double HSVA[4];
77 // unsigned char rgba[4];
78 // unsigned char cmyk[4];
79 // int rrggbbaa[4];
80 // char *string;
81 // int index;
82 // } u;
83 // color_type_t type;
84 // } gvcolor_t;
+0
-81
src/h/gvdevice_callbacks_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 f3e0bdxm3k2e7dwusmutjfhyg
52
53 public interface gvdevice_callbacks_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvdevice_callbacks_s",
56 "{",
57 "void (*refresh) (GVJ_t * job)",
58 "void (*button_press) (GVJ_t * job, int button, pointf pointer)",
59 "void (*button_release) (GVJ_t * job, int button, pointf pointer)",
60 "void (*motion) (GVJ_t * job, pointf pointer)",
61 "void (*modify) (GVJ_t * job, const char *name, const char *value)",
62 "void (*del) (GVJ_t * job)",
63 "void (*read) (GVJ_t * job, const char *filename, const char *layout)",
64 "void (*layout) (GVJ_t * job, const char *layout)",
65 "void (*render) (GVJ_t * job, const char *format, const char *filename)",
66 "}",
67 "gvdevice_callbacks_t");
68 }
69
70 // typedef struct gvdevice_callbacks_s {
71 // void (*refresh) (GVJ_t * job);
72 // void (*button_press) (GVJ_t * job, int button, pointf pointer);
73 // void (*button_release) (GVJ_t * job, int button, pointf pointer);
74 // void (*motion) (GVJ_t * job, pointf pointer);
75 // void (*modify) (GVJ_t * job, const char *name, const char *value);
76 // void (*del) (GVJ_t * job); /* can't use "delete" 'cos C++ stole it */
77 // void (*read) (GVJ_t * job, const char *filename, const char *layout);
78 // void (*layout) (GVJ_t * job, const char *layout);
79 // void (*render) (GVJ_t * job, const char *format, const char *filename);
80 // } gvdevice_callbacks_t;
+0
-68
src/h/gvdevice_engine_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 z4n2hij703yppdzze03zzgi6
52
53 public interface gvdevice_engine_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvdevice_engine_s",
56 "{",
57 "void (*initialize) (GVJ_t * firstjob)",
58 "void (*format) (GVJ_t * firstjob)",
59 "void (*finalize) (GVJ_t * firstjob)",
60 "}");
61 }
62
63 // struct gvdevice_engine_s {
64 // void (*initialize) (GVJ_t * firstjob);
65 // void (*format) (GVJ_t * firstjob);
66 // void (*finalize) (GVJ_t * firstjob);
67 // };
+0
-57
src/h/gvdevice_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 3xl6s6o9sk6ni7l5g3amrl4p3
50
51 public interface gvdevice_engine_t extends gvdevice_engine_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvdevice_engine_s gvdevice_engine_t");
54 }
55
56 // typedef struct gvdevice_engine_s gvdevice_engine_t;
+0
-71
src/h/gvdevice_features_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7mtrzu9286sibihpev6m1kq0d
52
53 public interface gvdevice_features_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int flags",
58 "pointf default_margin",
59 "pointf default_pagesize",
60 "pointf default_dpi",
61 "}",
62 "gvdevice_features_t");
63 }
64
65 // typedef struct {
66 // int flags;
67 // pointf default_margin; /* left/right, top/bottom - points */
68 // pointf default_pagesize;/* default page width, height - points */
69 // pointf default_dpi;
70 // } gvdevice_features_t;
+0
-67
src/h/gvevent_key_binding_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 36q7p68bw2kihtosgcli2ebnl
52
53 public interface gvevent_key_binding_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvevent_key_binding_s",
56 "{",
57 "char *keystring",
58 "gvevent_key_callback_t callback",
59 "}",
60 "gvevent_key_binding_t");
61 }
62
63 // typedef struct gvevent_key_binding_s {
64 // char *keystring;
65 // gvevent_key_callback_t callback;
66 // } gvevent_key_binding_t;
+0
-59
src/h/gvevent_key_callback_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8od0u0s38rvhqrafwy4nh1i0
52
53 public interface gvevent_key_callback_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef int (*gvevent_key_callback_t) (GVJ_t * job)");
56 }
57
58 // typedef int (*gvevent_key_callback_t) (GVJ_t * job);
+0
-59
src/h/gvformatter_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.gvformatter_engine_s;
50
51 //2 3vj53t416qxwn8efaetlwcvoc
52
53 public interface gvformatter_engine_t extends gvformatter_engine_s {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvformatter_engine_s gvformatter_engine_t");
56 }
57
58 // typedef struct gvformatter_engine_s gvformatter_engine_t;
+0
-66
src/h/gvlayout_engine_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aufqatak555umhtr2zwzdxcam
52
53 public interface gvlayout_engine_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvlayout_engine_s",
56 "{",
57 "void (*layout) (graph_t * g)",
58 "void (*cleanup) (graph_t * g)",
59 "}");
60 }
61
62 // struct gvlayout_engine_s {
63 // void (*layout) (graph_t * g);
64 // void (*cleanup) (graph_t * g);
65 // };
+0
-57
src/h/gvlayout_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 6neg5ydx7okjqcbqz9nndxl88
50
51 public interface gvlayout_engine_t extends gvlayout_engine_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvlayout_engine_s gvlayout_engine_t");
54 }
55
56 // typedef struct gvlayout_engine_s gvlayout_engine_t;
+0
-65
src/h/gvlayout_features_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5ixrh5lzf6cgqakcirp2uozbb
52
53 public interface gvlayout_features_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int flags",
58 "}",
59 "gvlayout_features_t");
60 }
61
62 // typedef struct {
63 // int flags;
64 // } gvlayout_features_t;
+0
-64
src/h/gvloadimage_engine_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9857ym486lfba1vbejkz0jesv
52
53 public interface gvloadimage_engine_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvloadimage_engine_s",
56 "{",
57 "void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, boolean filled)",
58 "}");
59 }
60
61 // struct gvloadimage_engine_s {
62 // void (*loadimage) (GVJ_t *job, usershape_t *us, boxf b, boolean filled);
63 // };
+0
-57
src/h/gvloadimage_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 2ribkbowigqfs0otd9wwditp5
50
51 public interface gvloadimage_engine_t extends gvloadimage_engine_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvloadimage_engine_s gvloadimage_engine_t");
54 }
55
56 // typedef struct gvloadimage_engine_s gvloadimage_engine_t;
+0
-71
src/h/gvplugin_active_device_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c5u1u6iz4msxf9y4q5w78w22
52
53 public interface gvplugin_active_device_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvplugin_active_device_s",
56 "{",
57 "gvdevice_engine_t *engine",
58 "int id",
59 "gvdevice_features_t *features",
60 "const char *type",
61 "}",
62 "gvplugin_active_device_t");
63 }
64
65 // typedef struct gvplugin_active_device_s {
66 // gvdevice_engine_t *engine;
67 // int id;
68 // gvdevice_features_t *features;
69 // const char *type;
70 // } gvplugin_active_device_t;
+0
-71
src/h/gvplugin_active_layout_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 13w4wtxe0z0sh446ur163yvhf
52
53 public interface gvplugin_active_layout_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvplugin_active_layout_s",
56 "{",
57 "gvlayout_engine_t *engine",
58 "int id",
59 "gvlayout_features_t *features",
60 "const char *type",
61 "}",
62 "gvplugin_active_layout_t");
63 }
64
65 // typedef struct gvplugin_active_layout_s {
66 // gvlayout_engine_t *engine;
67 // int id;
68 // gvlayout_features_t *features;
69 // const char *type;
70 // } gvplugin_active_layout_t;
+0
-69
src/h/gvplugin_active_loadimage_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 633mt1gwzq159n5j6n0lzgzam
52
53 public interface gvplugin_active_loadimage_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvplugin_active_loadimage_t",
56 "{",
57 "gvloadimage_engine_t *engine",
58 "int id",
59 "const char *type",
60 "}",
61 "gvplugin_active_loadimage_t");
62 }
63
64 // typedef struct gvplugin_active_loadimage_t {
65 // gvloadimage_engine_t *engine;
66 // int id;
67 // const char *type;
68 // } gvplugin_active_loadimage_t;
+0
-71
src/h/gvplugin_active_render_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4af9oysh9wk1u0m5wjc60jcr3
52
53 public interface gvplugin_active_render_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvplugin_active_render_s",
56 "{",
57 "gvrender_engine_t *engine",
58 "int id",
59 "gvrender_features_t *features",
60 "const char *type",
61 "}",
62 "gvplugin_active_render_t");
63 }
64
65 // typedef struct gvplugin_active_render_s {
66 // gvrender_engine_t *engine;
67 // int id;
68 // gvrender_features_t *features;
69 // const char *type;
70 // } gvplugin_active_render_t;
+0
-69
src/h/gvplugin_active_textlayout_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4ht0rt62yul08h6v5kje6jk1x
52
53 public interface gvplugin_active_textlayout_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct gvplugin_active_textlayout_s",
56 "{",
57 "gvtextlayout_engine_t *engine",
58 "int id",
59 "char *type",
60 "}",
61 "gvplugin_active_textlayout_t");
62 }
63
64 // typedef struct gvplugin_active_textlayout_s {
65 // gvtextlayout_engine_t *engine;
66 // int id;
67 // char *type;
68 // } gvplugin_active_textlayout_t;
+0
-74
src/h/gvplugin_available_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4mff7kl30vs5cmzxe47j17hex
52
53 public interface gvplugin_available_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvplugin_available_s",
56 "{",
57 "gvplugin_available_t *next",
58 "const char *typestr",
59 "int quality",
60 "gvplugin_package_t *package",
61 "gvplugin_installed_t *typeptr",
62 "}");
63 }
64
65 // struct gvplugin_available_s {
66 // gvplugin_available_t *next; /* next plugin in linked list, or NULL */
67 // const char *typestr; /* type string, e.g. "png" or "ps" */
68 // int quality; /* Programmer assigned quality ranking within type (+ve or -ve int).
69 // First implementation of type should be given "0" quality */
70 // gvplugin_package_t *package; /* details of library containing plugin */
71 // gvplugin_installed_t *typeptr; /* pointer to jumptable for plugin,
72 // or NULL if not yet loaded */
73 // };
+0
-57
src/h/gvplugin_available_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 6ct699hskqmknua7dg0fdwvmz
50
51 public interface gvplugin_available_t extends gvplugin_available_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvplugin_available_s gvplugin_available_t");
54 }
55
56 // typedef struct gvplugin_available_s gvplugin_available_t;
+0
-81
src/h/gvplugin_installed_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dcmpl8ruksxab5p8161qcvxcw
52
53 public interface gvplugin_installed_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int id",
58 "const char *type",
59 "int quality",
60 "void *engine",
61 "void *features",
62 "}",
63 "gvplugin_installed_t");
64 }
65
66 // typedef struct {
67 // int id; /* an id that is only unique within a package
68 // of plugins of the same api.
69 // A renderer-type such as "png" in the cairo package
70 // has an id that is different from the "ps" type
71 // in the same package */
72 // const char *type; /* a string name, such as "png" or "ps" that
73 // distinguishes different types withing the same
74 // (renderer in this case) */
75 // int quality; /* an arbitrary integer used for ordering plugins of
76 // the same type from different packages */
77 // void *engine; /* pointer to the jump table for the plugin */
78 // void *features; /* pointer to the feature description
79 // void* because type varies by api */
80 // } gvplugin_installed_t;
+0
-68
src/h/gvplugin_package_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4x42jt53r4w0hua6kytv25z05
52
53 public interface gvplugin_package_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvplugin_package_s",
56 "{",
57 "gvplugin_package_t *next",
58 "char *path",
59 "char *name",
60 "}");
61 }
62
63 // struct gvplugin_package_s {
64 // gvplugin_package_t *next;
65 // char *path;
66 // char *name;
67 // };
+0
-57
src/h/gvplugin_package_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 4mfo0bv62esvw8qme2tplg7k
50
51 public interface gvplugin_package_t extends gvplugin_package_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvplugin_package_s gvplugin_package_t");
54 }
55
56 // typedef struct gvplugin_package_s gvplugin_package_t;
+0
-125
src/h/gvrender_engine_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c9lcfmvndhmluehnjakiea1ei
52
53 public interface gvrender_engine_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvrender_engine_s",
56 "{",
57 "void (*begin_job) (GVJ_t * job)",
58 "void (*end_job) (GVJ_t * job)",
59 "void (*begin_graph) (GVJ_t * job)",
60 "void (*end_graph) (GVJ_t * job)",
61 "void (*begin_layer) (GVJ_t * job, char *layername, int layerNum, int numLayers)",
62 "void (*end_layer) (GVJ_t * job)",
63 "void (*begin_page) (GVJ_t * job)",
64 "void (*end_page) (GVJ_t * job)",
65 "void (*begin_cluster) (GVJ_t * job)",
66 "void (*end_cluster) (GVJ_t * job)",
67 "void (*begin_nodes) (GVJ_t * job)",
68 "void (*end_nodes) (GVJ_t * job)",
69 "void (*begin_edges) (GVJ_t * job)",
70 "void (*end_edges) (GVJ_t * job)",
71 "void (*begin_node) (GVJ_t * job)",
72 "void (*end_node) (GVJ_t * job)",
73 "void (*begin_edge) (GVJ_t * job)",
74 "void (*end_edge) (GVJ_t * job)",
75 "void (*begin_anchor) (GVJ_t * job, char *href, char *tooltip, char *target, char *id)",
76 "void (*end_anchor) (GVJ_t * job)",
77 "void (*begin_label) (GVJ_t * job, label_type type)",
78 "void (*end_label) (GVJ_t * job)",
79 "void (*textspan) (GVJ_t * job, pointf p, textspan_t * span)",
80 "void (*resolve_color) (GVJ_t * job, gvcolor_t * color)",
81 "void (*ellipse) (GVJ_t * job, pointf * A, int filled)",
82 "void (*polygon) (GVJ_t * job, pointf * A, int n, int filled)",
83 "void (*beziercurve) (GVJ_t * job, pointf * A, int n, int arrow_at_start, int arrow_at_end, int)",
84 "void (*polyline) (GVJ_t * job, pointf * A, int n)",
85 "void (*comment) (GVJ_t * job, char *comment)",
86 "void (*library_shape) (GVJ_t * job, char *name, pointf * A, int n, int filled)",
87 "}");
88 }
89
90 // struct gvrender_engine_s {
91 // void (*begin_job) (GVJ_t * job);
92 // void (*end_job) (GVJ_t * job);
93 // void (*begin_graph) (GVJ_t * job);
94 // void (*end_graph) (GVJ_t * job);
95 // void (*begin_layer) (GVJ_t * job, char *layername,
96 // int layerNum, int numLayers);
97 // void (*end_layer) (GVJ_t * job);
98 // void (*begin_page) (GVJ_t * job);
99 // void (*end_page) (GVJ_t * job);
100 // void (*begin_cluster) (GVJ_t * job);
101 // void (*end_cluster) (GVJ_t * job);
102 // void (*begin_nodes) (GVJ_t * job);
103 // void (*end_nodes) (GVJ_t * job);
104 // void (*begin_edges) (GVJ_t * job);
105 // void (*end_edges) (GVJ_t * job);
106 // void (*begin_node) (GVJ_t * job);
107 // void (*end_node) (GVJ_t * job);
108 // void (*begin_edge) (GVJ_t * job);
109 // void (*end_edge) (GVJ_t * job);
110 // void (*begin_anchor) (GVJ_t * job,
111 // char *href, char *tooltip, char *target, char *id);
112 // void (*end_anchor) (GVJ_t * job);
113 // void (*begin_label) (GVJ_t * job, label_type type);
114 // void (*end_label) (GVJ_t * job);
115 // void (*textspan) (GVJ_t * job, pointf p, textspan_t * span);
116 // void (*resolve_color) (GVJ_t * job, gvcolor_t * color);
117 // void (*ellipse) (GVJ_t * job, pointf * A, int filled);
118 // void (*polygon) (GVJ_t * job, pointf * A, int n, int filled);
119 // void (*beziercurve) (GVJ_t * job, pointf * A, int n,
120 // int arrow_at_start, int arrow_at_end, int);
121 // void (*polyline) (GVJ_t * job, pointf * A, int n);
122 // void (*comment) (GVJ_t * job, char *comment);
123 // void (*library_shape) (GVJ_t * job, char *name, pointf * A, int n, int filled);
124 // };
+0
-57
src/h/gvrender_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 5bxr6kqlo53bavjt2xfhgd4p8
50
51 public interface gvrender_engine_t extends gvrender_engine_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvrender_engine_s gvrender_engine_t");
54 }
55
56 // typedef struct gvrender_engine_s gvrender_engine_t;
+0
-73
src/h/gvrender_features_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 b5pxs48fv8n5ovo8dntg7yyiw
52
53 public interface gvrender_features_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int flags",
58 "double default_pad",
59 "char **knowncolors",
60 "int sz_knowncolors",
61 "color_type_t color_type",
62 "}",
63 "gvrender_features_t");
64 }
65
66 // typedef struct {
67 // int flags;
68 // double default_pad; /* graph units */
69 // char **knowncolors;
70 // int sz_knowncolors;
71 // color_type_t color_type;
72 // } gvrender_features_t;
+0
-64
src/h/gvtextlayout_engine_s.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 btpkmksp5qljd7s3c2whxtupr
52
53 public interface gvtextlayout_engine_s extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct gvtextlayout_engine_s",
56 "{",
57 "boolean (*textlayout) (textspan_t *span, char** fontpath)",
58 "}");
59 }
60
61 // struct gvtextlayout_engine_s {
62 // boolean (*textlayout) (textspan_t *span, char** fontpath);
63 // };
+0
-57
src/h/gvtextlayout_engine_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 6ftez1uvnskvljccs3z0sfspf
50
51 public interface gvtextlayout_engine_t extends gvtextlayout_engine_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct gvtextlayout_engine_s gvtextlayout_engine_t");
54 }
55
56 // typedef struct gvtextlayout_engine_s gvtextlayout_engine_t;
+0
-69
src/h/hsvrgbacolor_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 a81kzkq5n7k0bft1xpxzn8sof
52
53 public interface hsvrgbacolor_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct hsvrgbacolor_t",
56 "{",
57 "char *name",
58 "unsigned char h, s, v",
59 "unsigned char r, g, b, a",
60 "}",
61 "hsvrgbacolor_t");
62 }
63
64 // typedef struct hsvrgbacolor_t {
65 // char *name;
66 // unsigned char h, s, v;
67 // unsigned char r, g, b, a;
68 // } hsvrgbacolor_t;
+0
-73
src/h/htextspan_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 73dlf2ef4p53l8j1jla74ryhq
52
53 public interface htextspan_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "textspan_t *items",
58 "short nitems",
59 "char just",
60 "double size",
61 "double lfsize",
62 "}",
63 "htextspan_t");
64 }
65
66 // typedef struct {
67 // textspan_t *items;
68 // short nitems;
69 // char just;
70 // double size; /* width of span */
71 // double lfsize; /* offset from previous baseline to current one */
72 // } htextspan_t;
+0
-59
src/h/htmlcell_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c3fdy8b5qt90u4c5ss75lcguu
52
53 public interface htmlcell_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct htmlcell_t htmlcell_t");
56 }
57
58 // typedef struct htmlcell_t htmlcell_t;
+0
-97
src/h/htmldata_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3ndpf3koymkortrl6lwwvih5k
52
53 public interface htmldata_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "char *href",
58 "char *port",
59 "char *target",
60 "char *title",
61 "char *id",
62 "char *bgcolor",
63 "char *pencolor",
64 "int gradientangle",
65 "signed char space",
66 "unsigned char border",
67 "unsigned char pad",
68 "unsigned char sides",
69 "unsigned short flags",
70 "unsigned short width",
71 "unsigned short height",
72 "unsigned short style",
73 "boxf box",
74 "}",
75 "htmldata_t");
76 }
77
78 // typedef struct {
79 // char *href; /* pointer to an external resource */
80 // char *port;
81 // char *target;
82 // char *title;
83 // char *id;
84 // char *bgcolor;
85 // char *pencolor;
86 // int gradientangle;
87 // signed char space;
88 // unsigned char border;
89 // unsigned char pad;
90 // unsigned char sides; /* set of sides exposed to field */
91 // unsigned short flags;
92 // unsigned short width;
93 // unsigned short height;
94 // unsigned short style;
95 // boxf box; /* its geometric placement in points */
96 // } htmldata_t;
+0
-77
src/h/htmlenv_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c1g03t0hv8uptocwfcdelqwqa
52
53 public interface htmlenv_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "pointf pos",
58 "textfont_t finfo",
59 "void *obj",
60 "graph_t *g",
61 "char *imgscale",
62 "char *objid",
63 "boolean objid_set",
64 "}",
65 "htmlenv_t");
66 }
67
68 // typedef struct {
69 // pointf pos;
70 // textfont_t finfo;
71 // void *obj;
72 // graph_t *g;
73 // char *imgscale;
74 // char *objid;
75 // boolean objid_set;
76 // } htmlenv_t;
+0
-69
src/h/htmlimg_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 2qx8kiwbmyh61vxkplyhzp0i7
52
53 public interface htmlimg_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "boxf box",
58 "char *src",
59 "char *scale",
60 "}",
61 "htmlimg_t");
62 }
63
64 // typedef struct {
65 // boxf box;
66 // char *src;
67 // char *scale;
68 // } htmlimg_t;
+0
-77
src/h/htmlmap_data_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 d20oliwp4ordsbln3u0w8ovgu
52
53 public interface htmlmap_data_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "char *url",
58 "char *tooltip",
59 "char *target",
60 "char *id",
61 "boolean explicit_tooltip",
62 "point LL",
63 "point UR",
64 "}",
65 "htmlmap_data_t");
66 }
67
68 // typedef struct {
69 // char *url;
70 // char *tooltip;
71 // char *target;
72 // char *id;
73 // boolean explicit_tooltip;
74 // point LL;
75 // point UR;
76 // } htmlmap_data_t;
+0
-59
src/h/htmltbl_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4l8qax3cpj0f9m5mv6n7ijuw3
52
53 public interface htmltbl_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct htmltbl_t htmltbl_t");
56 }
57
58 // typedef struct htmltbl_t htmltbl_t;
+0
-71
src/h/htmltxt_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9d3jp17twvv6zmypz9ry6ulqm
52
53 public interface htmltxt_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "htextspan_t *spans",
58 "short nspans",
59 "char simple",
60 "boxf box",
61 "}",
62 "htmltxt_t");
63 }
64
65 // typedef struct {
66 // htextspan_t *spans;
67 // short nspans;
68 // char simple;
69 // boxf box;
70 // } htmltxt_t;
+0
-83
src/h/inside_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 1ntxl46xf9k1rah2wosqhcdno
52
53 public interface inside_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef union inside_t",
56 "{",
57 "struct",
58 "{",
59 "pointf* p",
60 "double* r",
61 "}",
62 "a",
63 "struct",
64 "{",
65 "node_t* n",
66 "boxf* bp",
67 "}",
68 "s",
69 "}",
70 "inside_t");
71 }
72
73 // typedef union inside_t {
74 // struct {
75 // pointf* p;
76 // double* r;
77 // } a;
78 // struct {
79 // node_t* n;
80 // boxf* bp;
81 // } s;
82 // } inside_t;
+0
-67
src/h/label_params_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 hnxz1757w4pts48w055n1a2r
52
53 public interface label_params_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "boxf bb",
58 "unsigned char force",
59 "}",
60 "label_params_t");
61 }
62
63 // typedef struct {
64 // boxf bb; /* Bounding box of all objects */
65 // unsigned char force; /* If true, all labels must be placed */
66 // } label_params_t;
+0
-67
src/h/nlist_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 21yt3x3ukjw41rbx7gc4w7ebj
52
53 public interface nlist_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct nlist_t",
56 "{",
57 "node_t **list",
58 "int size",
59 "}",
60 "nlist_t");
61 }
62
63 // typedef struct nlist_t {
64 // node_t **list;
65 // int size;
66 // } nlist_t;
+0
-67
src/h/node_list.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 vma2gttg3cuyksw8xvwfgf30
52
53 public interface node_list extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct _node_list",
56 "{",
57 "Agnode_t *node",
58 "struct _node_list *next",
59 "}",
60 "node_list");
61 }
62
63 // typedef struct _node_list {
64 // Agnode_t *node;
65 // struct _node_list *next;
66 // } node_list;
+0
-57
src/h/node_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 9eay2w1ulq4b60xf1edcfkkmi
50
51 public interface node_t extends Agnode_s {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct Agnode_s node_t");
54 }
55
56 // typedef struct Agnode_s node_t;
+0
-65
src/h/nodequeue.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 aevkl4zsbstj3pc33rpzrocul
52
53 public interface nodequeue extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct nodequeue",
56 "{",
57 "node_t **store, **limit, **head, **tail",
58 "}",
59 "nodequeue");
60 }
61
62 // typedef struct nodequeue {
63 // node_t **store, **limit, **head, **tail;
64 // } nodequeue;
+0
-69
src/h/object_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3ll53gc239t205eaimof9u6ah
52
53 public interface object_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "pointf pos",
58 "pointf sz",
59 "xlabel_t *lbl",
60 "}",
61 "object_t");
62 }
63
64 // typedef struct {
65 // pointf pos; /* Position of lower-left corner of object */
66 // pointf sz; /* Size of object; may be zero for a point */
67 // xlabel_t *lbl; /* Label attached to object, or NULL */
68 // } object_t;
+0
-79
src/h/pack_info.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 95stwmwomxnw1qea4q6lmeekb
52
53 public interface pack_info extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "float aspect",
58 "int sz",
59 "unsigned int margin",
60 "int doSplines",
61 "pack_mode mode",
62 "boolean *fixed",
63 "packval_t* vals",
64 "int flags",
65 "}",
66 "pack_info");
67 }
68
69 // typedef struct {
70 // float aspect; /* desired aspect ratio */
71 // int sz; /* row/column size size */
72 // unsigned int margin; /* margin left around objects, in points */
73 // int doSplines; /* use splines in constructing graph shape */
74 // pack_mode mode; /* granularity and method */
75 // boolean *fixed; /* fixed[i] == true implies g[i] should not be moved */
76 // packval_t* vals; /* for arrays, sort numbers */
77 // int flags;
78 // } pack_info;
+0
-71
src/h/path.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 ccnx75vstszprxk6fxhq89rpu
52
53 public interface path extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct path",
56 "{",
57 "port start, end",
58 "int nbox",
59 "boxf *boxes",
60 "void *data",
61 "}",
62 "path");
63 }
64
65 // typedef struct path { /* internal specification for an edge spline */
66 // port start, end;
67 // int nbox; /* number of subdivisions */
68 // boxf *boxes; /* rectangular regions of subdivision */
69 // void *data;
70 // } path;
+0
-73
src/h/pathend_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 42vd8ru4xms0dzzipvkxpb5xt
52
53 public interface pathend_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct pathend_t",
56 "{",
57 "boxf nb",
58 "pointf np",
59 "int sidemask",
60 "int boxn",
61 "boxf boxes[20]",
62 "}",
63 "pathend_t");
64 }
65
66 // typedef struct pathend_t {
67 // boxf nb; /* the node box */
68 // pointf np; /* node port */
69 // int sidemask;
70 // int boxn;
71 // boxf boxes[20];
72 // } pathend_t;
+0
-63
src/h/point.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 axpj7c8u90q3k5tbk9sy03qy6
52
53 public interface point extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int x, y",
58 "}",
59 "point");
60 }
61
62 // typedef struct { int x, y; } point;
+0
-63
src/h/pointf.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c2dqy43vdg0rr841peh6gqytj
52
53 public interface pointf extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct pointf_s",
56 "{",
57 "double x, y",
58 "}",
59 "pointf");
60 }
61
62 // typedef struct pointf_s { double x, y; } pointf;
+0
-67
src/h/pointnlink_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3pqj1ldfe9xn0d28j7xc7apm0
52
53 public interface pointnlink_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct pointnlink_t",
56 "{",
57 "Ppoint_t *pp",
58 "struct pointnlink_t *link",
59 "}",
60 "pointnlink_t");
61 }
62
63 // typedef struct pointnlink_t {
64 // Ppoint_t *pp;
65 // struct pointnlink_t *link;
66 // } pointnlink_t;
+0
-79
src/h/polygon_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 23el548cy5m8f5wz8b2x5tihx
52
53 public interface polygon_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct polygon_t",
56 "{",
57 "int regular",
58 "int peripheries",
59 "int sides",
60 "double orientation",
61 "double distortion",
62 "double skew",
63 "int option",
64 "pointf *vertices",
65 "}",
66 "polygon_t");
67 }
68
69 // typedef struct polygon_t { /* mutable shape information for a node */
70 // int regular; /* true for symmetric shapes */
71 // int peripheries; /* number of periphery lines */
72 // int sides; /* number of sides */
73 // double orientation; /* orientation of shape (+ve degrees) */
74 // double distortion; /* distortion factor - as in trapezium */
75 // double skew; /* skew factor - as in parallelogram */
76 // int option; /* ROUNDED, DIAGONAL corners, etc. */
77 // pointf *vertices; /* array of vertex points */
78 // } polygon_t;
+0
-88
src/h/port.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 71w78cxaan0929s365t8kncr6
52
53 public interface port extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct port",
56 "{",
57 "pointf p",
58 "double theta",
59 "boxf *bp",
60 "boolean defined",
61 "boolean constrained",
62 "boolean clip",
63 "boolean dyna",
64 "unsigned char order",
65 "unsigned char side",
66 "char *name",
67 "}",
68 "port");
69 }
70
71 // typedef struct port { /* internal edge endpoint specification */
72 // pointf p; /* aiming point relative to node center */
73 // double theta; /* slope in radians */
74 // boxf *bp; /* if not null, points to bbox of
75 // * rectangular area that is port target
76 // */
77 // boolean defined; /* if true, edge has port info at this end */
78 // boolean constrained; /* if true, constraints such as theta are set */
79 // boolean clip; /* if true, clip end to node/port shape */
80 // boolean dyna; /* if true, assign compass point dynamically */
81 // unsigned char order; /* for mincross */
82 // unsigned char side; /* if port is on perimeter of node, this
83 // * contains the bitwise OR of the sides (TOP,
84 // * BOTTOM, etc.) it is on.
85 // */
86 // char *name; /* port name, if it was explicitly given, otherwise NULL */
87 // } port;
+0
-67
src/h/rawgraph.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3gcy12n7txwt4m8zgbj4peo1e
52
53 public interface rawgraph extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int nvs",
58 "vertex* vertices",
59 "}",
60 "rawgraph");
61 }
62
63 // typedef struct {
64 // int nvs;
65 // vertex* vertices;
66 // } rawgraph;
+0
-69
src/h/rdr_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8ps8r8mtrw6f5dhflc33s2dtg
52
53 public interface rdr_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "const char *data",
58 "int len",
59 "int cur",
60 "}",
61 "rdr_t");
62 }
63
64 // typedef struct {
65 // const char *data;
66 // int len;
67 // int cur;
68 // } rdr_t;
+0
-223
src/h/re_opcode_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e3hfh80mtu75t9spasjqrsdrh
52
53 public interface re_opcode_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "no_op = 0,",
58 "succeed,",
59 "exactn,",
60 "anychar,",
61 "charset,",
62 "charset_not,",
63 "start_memory,",
64 "stop_memory,",
65 "duplicate,",
66 "begline,",
67 "endline,",
68 "begbuf,",
69 "endbuf,",
70 "jump,",
71 "jump_past_alt,",
72 "on_failure_jump,",
73 "on_failure_keep_string_jump,",
74 "pop_failure_jump,",
75 "maybe_pop_jump,",
76 "dummy_failure_jump,",
77 "push_dummy_failure,",
78 "succeed_n,",
79 "jump_n,",
80 "set_number_at, wordchar,",
81 "notwordchar,",
82 "wordbeg,",
83 "wordend,",
84 "wordbound,",
85 "notwordbound",
86 "}",
87 "re_opcode_t");
88 }
89
90 // typedef enum
91 // {
92 // no_op = 0,
93 //
94 // /* Succeed right away--no more backtracking. */
95 // succeed,
96 //
97 // /* Followed by one byte giving n, then by n literal bytes. */
98 // exactn,
99 //
100 // /* Matches any (more or less) character. */
101 // anychar,
102 //
103 // /* Matches any one char belonging to specified set. First
104 // following byte is number of bitmap bytes. Then come bytes
105 // for a bitmap saying which chars are in. Bits in each byte
106 // are ordered low-bit-first. A character is in the set if its
107 // bit is 1. A character too large to have a bit in the map is
108 // automatically not in the set. */
109 // charset,
110 //
111 // /* Same parameters as charset, but match any character that is
112 // not one of those specified. */
113 // charset_not,
114 //
115 // /* Start remembering the text that is matched, for storing in a
116 // register. Followed by one byte with the register number, in
117 // the range 0 to one less than the pattern buffer's re_nsub
118 // field. Then followed by one byte with the number of groups
119 // inner to this one. (This last has to be part of the
120 // start_memory only because we need it in the on_failure_jump
121 // of re_match_2.) */
122 // start_memory,
123 //
124 // /* Stop remembering the text that is matched and store it in a
125 // memory register. Followed by one byte with the register
126 // number, in the range 0 to one less than `re_nsub' in the
127 // pattern buffer, and one byte with the number of inner groups,
128 // just like `start_memory'. (We need the number of inner
129 // groups here because we don't have any easy way of finding the
130 // corresponding start_memory when we're at a stop_memory.) */
131 // stop_memory,
132 //
133 // /* Match a duplicate of something remembered. Followed by one
134 // byte containing the register number. */
135 // duplicate,
136 //
137 // /* Fail unless at beginning of line. */
138 // begline,
139 //
140 // /* Fail unless at end of line. */
141 // endline,
142 //
143 // /* Succeeds if at beginning of buffer (if emacs) or at beginning
144 // of string to be matched (if not). */
145 // begbuf,
146 //
147 // /* Analogously, for end of buffer/string. */
148 // endbuf,
149 //
150 // /* Followed by two byte relative address to which to jump. */
151 // jump,
152 //
153 // /* Same as jump, but marks the end of an alternative. */
154 // jump_past_alt,
155 //
156 // /* Followed by two-byte relative address of place to resume at
157 // in case of failure. */
158 // on_failure_jump,
159 //
160 // /* Like on_failure_jump, but pushes a placeholder instead of the
161 // current string position when executed. */
162 // on_failure_keep_string_jump,
163 //
164 // /* Throw away latest failure point and then jump to following
165 // two-byte relative address. */
166 // pop_failure_jump,
167 //
168 // /* Change to pop_failure_jump if know won't have to backtrack to
169 // match; otherwise change to jump. This is used to jump
170 // back to the beginning of a repeat. If what follows this jump
171 // clearly won't match what the repeat does, such that we can be
172 // sure that there is no use backtracking out of repetitions
173 // already matched, then we change it to a pop_failure_jump.
174 // Followed by two-byte address. */
175 // maybe_pop_jump,
176 //
177 // /* Jump to following two-byte address, and push a dummy failure
178 // point. This failure point will be thrown away if an attempt
179 // is made to use it for a failure. A `+' construct makes this
180 // before the first repeat. Also used as an intermediary kind
181 // of jump when compiling an alternative. */
182 // dummy_failure_jump,
183 //
184 // /* Push a dummy failure point and continue. Used at the end of
185 // alternatives. */
186 // push_dummy_failure,
187 //
188 // /* Followed by two-byte relative address and two-byte number n.
189 // After matching N times, jump to the address upon failure. */
190 // succeed_n,
191 //
192 // /* Followed by two-byte relative address, and two-byte number n.
193 // Jump to the address N times, then fail. */
194 // jump_n,
195 //
196 // /* Set the following two-byte relative address to the
197 // subsequent two-byte number. The address *includes* the two
198 // bytes of number. */
199 // set_number_at,
200 //
201 // wordchar, /* Matches any word-constituent character. */
202 // notwordchar, /* Matches any char that is not a word-constituent. */
203 //
204 // wordbeg, /* Succeeds if at word beginning. */
205 // wordend, /* Succeeds if at word end. */
206 //
207 // wordbound, /* Succeeds if at a word boundary. */
208 // notwordbound /* Succeeds if not at a word boundary. */
209 //
210 //
211 //
212 //
213 //
214 //
215 //
216 //
217 //
218 //
219 //
220 //
221 //
222 // } re_opcode_t;
+0
-141
src/h/re_pattern_buffer.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3hom62aciieyjg8pgbfmp1qik
52
53 public interface re_pattern_buffer extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct re_pattern_buffer",
56 "{",
57 "unsigned char *buffer",
58 "unsigned long int allocated",
59 "unsigned long int used",
60 "reg_syntax_t syntax",
61 "char *fastmap",
62 "char * translate",
63 "size_t re_nsub",
64 "unsigned can_be_null : 1",
65 "unsigned regs_allocated : 2",
66 "unsigned fastmap_accurate : 1",
67 "unsigned no_sub : 1",
68 "unsigned not_bol : 1",
69 "unsigned not_eol : 1",
70 "unsigned newline_anchor : 1",
71 "}");
72 }
73
74 // struct re_pattern_buffer
75 // {
76 // /* [[[begin pattern_buffer]]] */
77 // /* Space that holds the compiled pattern. It is declared as
78 // `unsigned char *' because its elements are
79 // sometimes used as array indexes. */
80 // unsigned char *buffer;
81 //
82 // /* Number of bytes to which `buffer' points. */
83 // unsigned long int allocated;
84 //
85 // /* Number of bytes actually used in `buffer'. */
86 // unsigned long int used;
87 //
88 // /* Syntax setting with which the pattern was compiled. */
89 // reg_syntax_t syntax;
90 //
91 // /* Pointer to a fastmap, if any, otherwise zero. re_search uses
92 // the fastmap, if there is one, to skip over impossible
93 // starting points for matches. */
94 // char *fastmap;
95 //
96 // /* Either a translate table to apply to all characters before
97 // comparing them, or zero for no translation. The translation
98 // is applied to a pattern when it is compiled and to a string
99 // when it is matched. */
100 // char * translate;
101 //
102 // /* Number of subexpressions found by the compiler. */
103 // size_t re_nsub;
104 //
105 // /* Zero if this pattern cannot match the empty string, one else.
106 // Well, in truth it's used only in `re_search_2', to see
107 // whether or not we should use the fastmap, so we don't set
108 // this absolutely perfectly; see `re_compile_fastmap' (the
109 // `duplicate' case). */
110 // unsigned can_be_null : 1;
111 //
112 // /* If REGS_UNALLOCATED, allocate space in the `regs' structure
113 // for `max (RE_NREGS, re_nsub + 1)' groups.
114 // If REGS_REALLOCATE, reallocate space if necessary.
115 // If REGS_FIXED, use what's there. */
116 //
117 //
118 //
119 // unsigned regs_allocated : 2;
120 //
121 // /* Set to zero when `regex_compile' compiles a pattern; set to one
122 // by `re_compile_fastmap' if it updates the fastmap. */
123 // unsigned fastmap_accurate : 1;
124 //
125 // /* If set, `re_match_2' does not return information about
126 // subexpressions. */
127 // unsigned no_sub : 1;
128 //
129 // /* If set, a beginning-of-line anchor doesn't match at the
130 // beginning of the string. */
131 // unsigned not_bol : 1;
132 //
133 // /* Similarly for an end-of-line anchor. */
134 // unsigned not_eol : 1;
135 //
136 // /* If true, an anchor at a newline matches. */
137 // unsigned newline_anchor : 1;
138 //
139 // /* [[[end pattern_buffer]]] */
140 // };
+0
-69
src/h/re_registers.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 c6l7vumjull8d6poh7y1xqrct
52
53 public interface re_registers extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "struct re_registers",
56 "{",
57 "unsigned num_regs",
58 "regoff_t *start",
59 "regoff_t *end",
60 "}");
61 }
62
63 // struct re_registers
64 // {
65 // unsigned num_regs;
66 // regoff_t *start;
67 // regoff_t *end;
68 // };
+0
-71
src/h/refstr_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 61ughvl20d1mf5vtkmd94wfy
52
53 public interface refstr_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct refstr_t",
56 "{",
57 "Dtlink_t link",
58 "unsigned long refcnt",
59 "char *s",
60 "char store[1]",
61 "}",
62 "refstr_t");
63 }
64
65 // typedef struct refstr_t {
66 // Dtlink_t link;
67 // unsigned long refcnt;
68 // char *s;
69 // char store[1]; /* this is actually a dynamic array */
70 // } refstr_t;
+0
-103
src/h/reg_errcode_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 ap7c4ii9ux7nlggs68fm76fy6
52
53 public interface reg_errcode_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "REG_NOERROR = 0,",
58 "REG_NOMATCH,",
59 "REG_BADPAT,",
60 "REG_ECOLLATE,",
61 "REG_ECTYPE,",
62 "REG_EESCAPE,",
63 "REG_ESUBREG,",
64 "REG_EBRACK,",
65 "REG_EPAREN,",
66 "REG_EBRACE,",
67 "REG_BADBR,",
68 "REG_ERANGE,",
69 "REG_ESPACE,",
70 "REG_BADRPT,",
71 "REG_EEND,",
72 "REG_ESIZE,",
73 "REG_ERPAREN",
74 "}",
75 "reg_errcode_t");
76 }
77
78 // typedef enum
79 // {
80 // REG_NOERROR = 0, /* Success. */
81 // REG_NOMATCH, /* Didn't find a match (for regexec). */
82 //
83 // /* POSIX regcomp return error codes. (In the order listed in the
84 // standard.) */
85 // REG_BADPAT, /* Invalid pattern. */
86 // REG_ECOLLATE, /* Not implemented. */
87 // REG_ECTYPE, /* Invalid character class name. */
88 // REG_EESCAPE, /* Trailing backslash. */
89 // REG_ESUBREG, /* Invalid back reference. */
90 // REG_EBRACK, /* Unmatched left bracket. */
91 // REG_EPAREN, /* Parenthesis imbalance. */
92 // REG_EBRACE, /* Unmatched \{. */
93 // REG_BADBR, /* Invalid contents of \{\}. */
94 // REG_ERANGE, /* Invalid range end. */
95 // REG_ESPACE, /* Ran out of memory. */
96 // REG_BADRPT, /* No preceding re for repetition op. */
97 //
98 // /* Error codes we've added. */
99 // REG_EEND, /* Premature end. */
100 // REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
101 // REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
102 // } reg_errcode_t;
+0
-57
src/h/regex_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 //2 a0207gwp8wnf6l2kb9poka4m4
50
51 public interface regex_t extends re_pattern_buffer {
52 public static List<String> DEFINITION = Arrays.asList(
53 "typedef struct re_pattern_buffer regex_t");
54 }
55
56 // typedef struct re_pattern_buffer regex_t;
+0
-84
src/h/register_info_type.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 32aq50hgdk3miqrwc4915dj1o
52
53 public interface register_info_type extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef union",
56 "{",
57 "fail_stack_elt_t word",
58 "struct",
59 "{",
60 "unsigned match_null_string_p : 2",
61 "unsigned is_active : 1",
62 "unsigned matched_something : 1",
63 "unsigned ever_matched_something : 1",
64 "}",
65 "bits",
66 "}",
67 "register_info_type");
68 }
69
70 // typedef union
71 // {
72 // fail_stack_elt_t word;
73 // struct
74 // {
75 // /* This field is one if this group can match the empty string,
76 // zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
77 //
78 // unsigned match_null_string_p : 2;
79 // unsigned is_active : 1;
80 // unsigned matched_something : 1;
81 // unsigned ever_matched_something : 1;
82 // } bits;
83 // } register_info_type;
+0
-68
src/h/regmatch_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 pj9qzzazlscp3s43o8lug1br
52
53 public interface regmatch_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "regoff_t rm_so",
58 "regoff_t rm_eo",
59 "}",
60 "regmatch_t");
61 }
62
63 // typedef struct
64 // {
65 // regoff_t rm_so; /* Byte offset from string's start to substring's start. */
66 // regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
67 // } regmatch_t;
+0
-67
src/h/route.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5fq657all5l5bqizkuz5ggrdj
52
53 public interface route extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int n",
58 "segment* segs",
59 "}",
60 "route");
61 }
62
63 // typedef struct {
64 // int n;
65 // segment* segs;
66 // } route;
+0
-71
src/h/same_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8c359dwrpz9nffi3rk433ukjt
52
53 public interface same_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct same_t",
56 "{",
57 "char *id",
58 "elist l",
59 "int n_arr",
60 "double arr_len",
61 "}",
62 "same_t");
63 }
64
65 // typedef struct same_t {
66 // char *id; /* group id */
67 // elist l; /* edges in the group */
68 // int n_arr; /* number of edges with arrows */
69 // double arr_len; /* arrow length of an edge in the group */
70 // } same_t;
+0
-65
src/h/save_e_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 24xdytkhdvt79rfwsa7gp6do2
52
53 public interface save_e_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct save_e_s",
56 "{",
57 "Agnode_t *from, *to",
58 "}",
59 "save_e_t");
60 }
61
62 // typedef struct save_e_s {
63 // Agnode_t *from, *to;
64 // } save_e_t;
+0
-67
src/h/save_stack_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9a1whydr7ixbfnkje6ytmde8t
52
53 public interface save_stack_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct save_stack_s",
56 "{",
57 "save_e_t *mem",
58 "int stacksize",
59 "}",
60 "save_stack_t");
61 }
62
63 // typedef struct save_stack_s {
64 // save_e_t *mem;
65 // int stacksize;
66 // } save_stack_t;
+0
-59
src/h/sedge.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 15ruicbgesimuhfhph6r72639
52
53 public interface sedge extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct sedge sedge");
56 }
57
58 // typedef struct sedge sedge;
+0
-65
src/h/seedMode.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7n29466qjouzyf7izmjndudt5
52
53 public interface seedMode extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef enum",
56 "{",
57 "seed_unset, seed_val, seed_time, seed_regular",
58 "}",
59 "seedMode");
60 }
61
62 // typedef enum {
63 // seed_unset, seed_val, seed_time, seed_regular
64 // } seedMode;
+0
-67
src/h/segitem_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 btsf9u7kgq9gvrmm3ikqza2ix
52
53 public interface segitem_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct segitem_s",
56 "{",
57 "pointf p",
58 "struct segitem_s* next",
59 "}",
60 "segitem_t");
61 }
62
63 // typedef struct segitem_s {
64 // pointf p;
65 // struct segitem_s* next;
66 // } segitem_t;
+0
-81
src/h/segment.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 chpljvx1wjvc6a9wott6pl7mo
52
53 public interface segment extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct segment",
56 "{",
57 "boolean isVert",
58 "boolean flipped",
59 "double comm_coord",
60 "paird p",
61 "bend l1, l2",
62 "int ind_no",
63 "int track_no",
64 "struct segment* prev",
65 "struct segment* next",
66 "}",
67 "segment");
68 }
69
70 // typedef struct segment {
71 // boolean isVert;
72 // boolean flipped;
73 // double comm_coord; /* the common coordinate */
74 // paird p; /* end points */
75 // bend l1, l2;
76 // int ind_no; /* index number of this segment in its channel */
77 // int track_no; /* track number assigned in the channel */
78 // struct segment* prev;
79 // struct segment* next;
80 // } segment;
+0
-73
src/h/segment_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 4p5dhxpx14ooxgkym0hnv7g04
52
53 public interface segment_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "pointf v0, v1",
58 "int is_inserted",
59 "int root0, root1",
60 "int next",
61 "int prev",
62 "}",
63 "segment_t");
64 }
65
66 // typedef struct {
67 // pointf v0, v1; /* two endpoints */
68 // int is_inserted; /* inserted in trapezoidation yet ? */
69 // int root0, root1; /* root nodes in Q */
70 // int next; /* Next logical segment */
71 // int prev; /* Previous segment */
72 // } segment_t;
+0
-67
src/h/sfont_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 e0z0hnt02wemy4xf87o17z7cp
52
53 public interface sfont_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct sfont_t",
56 "{",
57 "textfont_t *cfont",
58 "struct sfont_t *pfont",
59 "}",
60 "sfont_t");
61 }
62
63 // typedef struct sfont_t {
64 // textfont_t *cfont;
65 // struct sfont_t *pfont;
66 // } sfont_t;
+0
-71
src/h/sgraph.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dxskpbv74lxltj165fmgf70cp
52
53 public interface sgraph extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int nnodes, nedges",
58 "int save_nnodes, save_nedges",
59 "snode* nodes",
60 "sedge* edges",
61 "}",
62 "sgraph");
63 }
64
65 // typedef struct {
66 // int nnodes, nedges;
67 // int save_nnodes, save_nedges;
68 // snode* nodes;
69 // sedge* edges;
70 // } sgraph;
+0
-71
src/h/shape_desc.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8ger4o0h260ys1ca9fc7x46eq
52
53 public interface shape_desc extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct shape_desc",
56 "{",
57 "char *name",
58 "shape_functions *fns",
59 "polygon_t *polygon",
60 "boolean usershape",
61 "}",
62 "shape_desc");
63 }
64
65 // typedef struct shape_desc { /* read-only shape descriptor */
66 // char *name; /* as read from graph file */
67 // shape_functions *fns;
68 // polygon_t *polygon; /* base polygon info */
69 // boolean usershape;
70 // } shape_desc;
+0
-75
src/h/shape_functions.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5mip14tura2l8b750vykgeun3
52
53 public interface shape_functions extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct shape_functions",
56 "{",
57 "void (*initfn) (node_t *)",
58 "void (*freefn) (node_t *)",
59 "port(*portfn) (node_t *, char *, char *)",
60 "boolean(*insidefn) (inside_t * inside_context, pointf)",
61 "int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr)",
62 "void (*codefn) (GVJ_t * job, node_t * n)",
63 "}",
64 "shape_functions");
65 }
66
67 // typedef struct shape_functions { /* read-only shape functions */
68 // void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */
69 // void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */
70 // port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */
71 // boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */
72 // int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */
73 // void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */
74 // } shape_functions;
+0
-69
src/h/shape_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 a6qcq27iylfbrgiga37cxkr9t
52
53 public interface shape_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct shape_t",
56 "{",
57 "int nstrokes",
58 "stroke_t *strokes",
59 "}",
60 "shape_t");
61 }
62
63 // typedef struct shape_t { /* mutable shape information for a node */
64 // int nstrokes; /* number of strokes in array */
65 // stroke_t *strokes; /* array of strokes */
66 // /* The last stroke must always be closed, but can be pen_up.
67 // * It is used as the clipping path */
68 // } shape_t;
+0
-59
src/h/snode.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 dp60xuei2ue2x586frihti3gr
52
53 public interface snode extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct snode snode");
56 }
57
58 // typedef struct snode snode;
+0
-69
src/h/snodeitem.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 d89g0gupg4cmbfbww7yqebufn
52
53 public interface snodeitem extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "snode* np",
58 "pointf p",
59 "Dtlink_t link",
60 "}",
61 "snodeitem");
62 }
63
64 // typedef struct {
65 // snode* np;
66 // pointf p;
67 // Dtlink_t link;
68 // } snodeitem;
+0
-71
src/h/splineInfo.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8u1r3c3d0g8hn19fq04x9z0ht
52
53 public interface splineInfo extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "boolean(*swapEnds) (edge_t * e)",
58 "boolean(*splineMerge) (node_t * n)",
59 "boolean ignoreSwap",
60 "boolean isOrtho",
61 "}",
62 "splineInfo");
63 }
64
65 // typedef struct {
66 // boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */
67 // boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */
68 // boolean ignoreSwap; /* Test for swapped edges if false */
69 // boolean isOrtho; /* Orthogonal routing used */
70 // } splineInfo;
+0
-67
src/h/spline_info_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 368du94hwpmwj2vxjibw1kyxw
52
53 public interface spline_info_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "int LeftBound, RightBound, Splinesep, Multisep",
58 "boxf* Rank_box",
59 "}",
60 "spline_info_t");
61 }
62
63 // typedef struct {
64 // int LeftBound, RightBound, Splinesep, Multisep;
65 // boxf* Rank_box;
66 // } spline_info_t;
+0
-69
src/h/splines.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 966xu1ddmyus6hb8a0jpk0mxv
52
53 public interface splines extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct splines",
56 "{",
57 "bezier *list",
58 "int size",
59 "boxf bb",
60 "}",
61 "splines");
62 }
63
64 // typedef struct splines {
65 // bezier *list;
66 // int size;
67 // boxf bb;
68 // } splines;
+0
-75
src/h/textfont_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 7eimedro6z0j21rhmmxbqdssy
52
53 public interface textfont_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "char* name",
58 "char* color",
59 "PostscriptAlias *postscript_alias",
60 "double size",
61 "unsigned int flags:7",
62 "unsigned int cnt:(sizeof(unsigned int) * 8 - 7)",
63 "}",
64 "textfont_t");
65 }
66
67 // typedef struct {
68 // char* name;
69 // char* color;
70 // PostscriptAlias *postscript_alias;
71 // double size;
72 // unsigned int flags:7; /* HTML_UL, HTML_IF, HTML_BF, etc. */
73 // unsigned int cnt:(sizeof(unsigned int) * 8 - 7); /* reference count */
74 // } textfont_t;
+0
-101
src/h/textlabel_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 9qqo4pt0x97lv7fp9yneflgkr
52
53 public interface textlabel_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct textlabel_t",
56 "{",
57 "char *text, *fontname, *fontcolor",
58 "int charset",
59 "double fontsize",
60 "pointf dimen",
61 "pointf space",
62 "pointf pos",
63 "union",
64 "{",
65 "struct",
66 "{",
67 "textspan_t *span",
68 "short nspans",
69 "}",
70 "txt",
71 "htmllabel_t *html",
72 "}",
73 "u",
74 "char valign",
75 "boolean set",
76 "boolean html",
77 "}",
78 "textlabel_t");
79 }
80
81 // typedef struct textlabel_t {
82 // char *text, *fontname, *fontcolor;
83 // int charset;
84 // double fontsize;
85 // pointf dimen; /* the diagonal size of the label (estimated by layout) */
86 // pointf space; /* the diagonal size of the space for the label */
87 // /* the rendered label is aligned in this box */
88 // /* space does not include pad or margin */
89 // pointf pos; /* the center of the space for the label */
90 // union {
91 // struct {
92 // textspan_t *span;
93 // short nspans;
94 // } txt;
95 // htmllabel_t *html;
96 // } u;
97 // char valign; /* 't' 'c' 'b' */
98 // boolean set; /* true if position is set */
99 // boolean html; /* true if html label */
100 // } textlabel_t;
+0
-77
src/h/textspan_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 3u5j54p26whh9zkbxuboqgjl8
52
53 public interface textspan_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "char *str",
58 "textfont_t *font",
59 "void *layout",
60 "void (*free_layout) (void *layout)",
61 "double yoffset_layout, yoffset_centerline",
62 "pointf size",
63 "char just",
64 "}",
65 "textspan_t");
66 }
67
68 // typedef struct {
69 // char *str; /* stored in utf-8 */
70 // textfont_t *font;
71 // void *layout;
72 // void (*free_layout) (void *layout); /* FIXME - this is ugly */
73 // double yoffset_layout, yoffset_centerline;
74 // pointf size;
75 // char just; /* 'l' 'n' 'r' */ /* FIXME */
76 // } textspan_t;
+0
-67
src/h/tna_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 8b2ok0k4502ln9ebjmmz8i24b
52
53 public interface tna_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct tna_t",
56 "{",
57 "double t",
58 "Ppoint_t a[2]",
59 "}",
60 "tna_t");
61 }
62
63 // typedef struct tna_t {
64 // double t;
65 // Ppoint_t a[2];
66 // } tna_t;
+0
-67
src/h/triangle_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 5ecxnf8ebe9n3gyiow712oltk
52
53 public interface triangle_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct triangle_t",
56 "{",
57 "int mark",
58 "struct tedge_t e[3]",
59 "}",
60 "triangle_t");
61 }
62
63 // typedef struct triangle_t {
64 // int mark;
65 // struct tedge_t e[3];
66 // } triangle_t;
+0
-71
src/h/xlabel_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program:
17 *
18 *************************************************************************
19 * Copyright (c) 2011 AT&T Intellectual Property
20 * All rights reserved. This program and the accompanying materials
21 * are made available under the terms of the Eclipse Public License v1.0
22 * which accompanies this distribution, and is available at
23 * http://www.eclipse.org/legal/epl-v10.html
24 *
25 * Contributors: See CVS logs. Details at http://www.graphviz.org/
26 *************************************************************************
27 *
28 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
29 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
30 *
31 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
32 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
33 *
34 * You may obtain a copy of the License at
35 *
36 * http://www.eclipse.org/legal/epl-v10.html
37 *
38 * Unless required by applicable law or agreed to in writing, software
39 * distributed under the License is distributed on an "AS IS" BASIS,
40 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
41 * See the License for the specific language governing permissions and
42 * limitations under the License.
43 *
44 */
45 package h;
46 import java.util.Arrays;
47 import java.util.List;
48
49 import smetana.core.__ptr__;
50
51 //2 cguvocw1bak2n3x4pc98z410a
52
53 public interface xlabel_t extends __ptr__ {
54 public static List<String> DEFINITION = Arrays.asList(
55 "typedef struct",
56 "{",
57 "pointf sz",
58 "pointf pos",
59 "void *lbl",
60 "unsigned char set",
61 "}",
62 "xlabel_t");
63 }
64
65 // typedef struct {
66 // pointf sz; /* Size of label (input) */
67 // pointf pos; /* Position of lower-left corner of label (output) */
68 // void *lbl; /* Pointer to label in the graph */
69 // unsigned char set; /* True if the position has been set (input/output) */
70 // } xlabel_t;
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.File;
38 import java.io.IOException;
39 import java.io.InputStream;
40
41 public interface AFile {
42
43 public InputStream open() throws IOException;
44
45 public boolean isOk();
46
47 public AParentFolder getParentFile();
48
49 public String getAbsolutePath();
50
51 public File getUnderlyingFile();
52
53 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.IOException;
40 import java.io.InputStream;
41
42 public class AFileRegular implements AFile {
43
44 private final File file;
45
46 @Override
47 public String toString() {
48 return "AFileRegular::" + file;
49 }
50
51 public AFileRegular(File file) {
52 this.file = file;
53 }
54
55 public InputStream open() throws IOException {
56 return new FileInputStream(file);
57 }
58
59 public boolean isOk() {
60 return file.exists() && file.isDirectory() == false;
61 }
62
63 @Override
64 public int hashCode() {
65 return file.hashCode();
66 }
67
68 @Override
69 public boolean equals(Object obj) {
70 if (obj instanceof AFileRegular == false) {
71 return false;
72 }
73 return this.file.equals(((AFileRegular) obj).file);
74 }
75
76 public AParentFolder getParentFile() {
77 return new AParentFolderRegular(file.getParentFile());
78 }
79
80 public String getAbsolutePath() {
81 return file.getAbsolutePath();
82 }
83
84 public File getUnderlyingFile() {
85 return file;
86 }
87
88 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.IOException;
40 import java.io.InputStream;
41 import java.util.zip.ZipEntry;
42 import java.util.zip.ZipInputStream;
43
44 public class AFileZipEntry implements AFile {
45
46 private final File zipFile;
47 private final String entry;
48
49 public AFileZipEntry(File file, String entry) {
50 this.zipFile = file;
51 this.entry = entry;
52 }
53
54 @Override
55 public String toString() {
56 return "AFileZipEntry::" + zipFile + " " + entry;
57 }
58
59 public InputStream open() throws IOException {
60 final ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFile));
61 ZipEntry ze = zis.getNextEntry();
62
63 while (ze != null) {
64 final String fileName = ze.getName();
65 if (ze.isDirectory()) {
66 } else if (fileName.trim().equalsIgnoreCase(entry.trim())) {
67 return zis;
68 }
69 ze = zis.getNextEntry();
70 }
71 zis.closeEntry();
72 zis.close();
73 throw new IOException();
74 }
75
76 public boolean isOk() {
77 if (zipFile.exists() && zipFile.isDirectory() == false) {
78 InputStream is = null;
79 try {
80 is = open();
81 return true;
82 } catch (IOException e) {
83 // e.printStackTrace();
84 } finally {
85 try {
86 if (is != null) {
87 is.close();
88 }
89 } catch (IOException e1) {
90 e1.printStackTrace();
91 }
92 }
93 }
94 return false;
95 }
96
97 @Override
98 public int hashCode() {
99 return zipFile.hashCode() + entry.hashCode();
100 }
101
102 @Override
103 public boolean equals(Object obj) {
104 if (obj instanceof AFileZipEntry == false) {
105 return false;
106 }
107 final AFileZipEntry other = (AFileZipEntry) obj;
108 return this.zipFile.equals(other.zipFile) && this.entry.equals(other.entry);
109 }
110
111 public AParentFolder getParentFile() {
112 return new AParentFolderZip(zipFile, entry);
113 }
114
115 public String getAbsolutePath() {
116 return zipFile.getAbsolutePath() + "~" + entry;
117 }
118
119 public File getUnderlyingFile() {
120 return zipFile;
121 }
122
123 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.IOException;
38
39 public interface AParentFolder {
40
41 public AFile getAFile(String nameOrPath) throws IOException;
42
43 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.File;
38 import java.io.IOException;
39
40 public class AParentFolderRegular implements AParentFolder {
41
42 private final File dir;
43
44 public AParentFolderRegular(File dir) {
45 this.dir = dir;
46 Log.info("Creating AParentFolderRegular " + dir);
47 }
48
49 @Override
50 public String toString() {
51 return "AParentFolderRegular::" + (dir == null ? "NULL" : dir.getAbsolutePath());
52 }
53
54 public AFile getAFile(String nameOrPath) throws IOException {
55 final File filecurrent;
56 Log.info("AParentFolderRegular::looking for " + nameOrPath);
57 Log.info("AParentFolderRegular::dir = " + dir);
58 if (dir == null) {
59 filecurrent = new File(nameOrPath);
60 } else {
61 filecurrent = new File(dir.getAbsoluteFile(), nameOrPath);
62 }
63 Log.info("AParentFolderRegular::Filecurrent " + filecurrent);
64 if (filecurrent.exists()) {
65 return new AFileRegular(filecurrent.getCanonicalFile());
66 }
67 return null;
68 }
69
70 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 import java.io.File;
38 import java.io.IOException;
39
40 public class AParentFolderZip implements AParentFolder {
41
42 private final File zipFile;
43 private final String parent;
44
45 @Override
46 public String toString() {
47 return "AParentFolderZip::" + zipFile + " " + parent;
48 }
49
50 public AParentFolderZip(File zipFile, String entry) {
51 this.zipFile = zipFile;
52 final int idx = entry.lastIndexOf('/');
53 if (idx == -1) {
54 parent = "";
55 } else {
56 parent = entry.substring(0, idx + 1);
57 }
58 }
59
60 public AFile getAFile(String nameOrPath) throws IOException {
61 return new AFileZipEntry(zipFile, merge(parent + nameOrPath));
62 }
63
64 String merge(String full) {
65 // full = full.replaceFirst("\\.", "Z");
66 while (true) {
67 int len = full.length();
68 full = full.replaceFirst("[^/]+/\\.\\./", "");
69 if (full.length() == len) {
70 return full;
71 }
72 }
73 }
74
75 }
3434 */
3535 package net.sourceforge.plantuml;
3636
37 import net.sourceforge.plantuml.cucadiagram.Display;
3738 import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
3839 import net.sourceforge.plantuml.cucadiagram.DisplaySection;
3940
4950
5051 public DisplaySection getFooter();
5152
53 public Display getMainFrame();
54
5255 }
3434 */
3535 package net.sourceforge.plantuml;
3636
37 import java.awt.geom.Dimension2D;
38 import java.awt.geom.Rectangle2D;
39
3740 import net.sourceforge.plantuml.activitydiagram3.ftile.EntityImageLegend;
41 import net.sourceforge.plantuml.cucadiagram.Display;
3842 import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
3943 import net.sourceforge.plantuml.cucadiagram.DisplaySection;
4044 import net.sourceforge.plantuml.graphic.FontConfiguration;
4145 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
46 import net.sourceforge.plantuml.graphic.HtmlColor;
47 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
48 import net.sourceforge.plantuml.graphic.InnerStrategy;
49 import net.sourceforge.plantuml.graphic.StringBounder;
50 import net.sourceforge.plantuml.graphic.SymbolContext;
4251 import net.sourceforge.plantuml.graphic.TextBlock;
4352 import net.sourceforge.plantuml.graphic.TextBlockUtils;
53 import net.sourceforge.plantuml.graphic.USymbol;
4454 import net.sourceforge.plantuml.svek.DecorateEntityImage;
4555 import net.sourceforge.plantuml.svek.TextBlockBackcolored;
56 import net.sourceforge.plantuml.ugraphic.MinMax;
57 import net.sourceforge.plantuml.ugraphic.UGraphic;
58 import net.sourceforge.plantuml.ugraphic.UTranslate;
4659
4760 public class AnnotatedWorker {
4861
4962 private final Annotated annotated;
5063 private final ISkinParam skinParam;
64 private final StringBounder stringBounder;
5165
52 public AnnotatedWorker(Annotated annotated, ISkinParam skinParam) {
66 public AnnotatedWorker(Annotated annotated, ISkinParam skinParam, StringBounder stringBounder) {
5367 this.annotated = annotated;
5468 this.skinParam = skinParam;
55
69 this.stringBounder = stringBounder;
5670 }
5771
5872 public TextBlockBackcolored addAdd(TextBlock result) {
73 result = addTitle(result);
74 result = addFrame(result);
5975 result = addLegend(result);
60 result = addTitle(result);
6176 result = addCaption(result);
6277 result = addHeaderAndFooter(result);
6378 return (TextBlockBackcolored) result;
79 }
80
81 public TextBlock addFrame(final TextBlock original) {
82 final Display mainFrame = annotated.getMainFrame();
83 if (mainFrame == null) {
84 return original;
85 }
86
87 final double x1 = 5;
88 final double x2 = 7;
89 final double y1 = 10;
90 final double y2 = 10;
91
92 final SymbolContext symbolContext = new SymbolContext(getSkinParam().getBackgroundColor(), HtmlColorUtils.BLACK)
93 .withShadow(getSkinParam().shadowing(null));
94 final TextBlock title = mainFrame.create(new FontConfiguration(getSkinParam(), FontParam.CAPTION, null),
95 HorizontalAlignment.CENTER, getSkinParam());
96 final Dimension2D dimTitle = title.calculateDimension(stringBounder);
97 final Dimension2D dimOriginal = original.calculateDimension(stringBounder);
98 final double width = x1 + Math.max(dimOriginal.getWidth(), dimTitle.getWidth()) + x2;
99 final double height = dimTitle.getHeight() + y1 + dimOriginal.getHeight() + y2;
100 final TextBlock result = USymbol.FRAME.asBig(title, HorizontalAlignment.LEFT, TextBlockUtils.empty(0, 0),
101 width, height, symbolContext);
102
103 return new TextBlockBackcolored() {
104
105 public void drawU(UGraphic ug) {
106 result.drawU(ug);
107 original.drawU(ug.apply(new UTranslate(x1, y1 + dimTitle.getHeight())));
108 }
109
110 public MinMax getMinMax(StringBounder stringBounder) {
111 return TextBlockUtils.getMinMax(result, stringBounder);
112 }
113
114 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
115 return result.getInnerPosition(member, stringBounder, strategy);
116 }
117
118 public Dimension2D calculateDimension(StringBounder stringBounder) {
119 return result.calculateDimension(stringBounder);
120 }
121
122 public HtmlColor getBackcolor() {
123 return symbolContext.getBackColor();
124 }
125 };
64126 }
65127
66128 private TextBlock addLegend(TextBlock original) {
116178 }
117179 TextBlock textFooter = null;
118180 if (footer.isNull() == false) {
119 textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null), getSkinParam());
181 textFooter = footer.createRibbon(new FontConfiguration(getSkinParam(), FontParam.FOOTER, null),
182 getSkinParam());
120183 }
121184 TextBlock textHeader = null;
122185 if (header.isNull() == false) {
123 textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null), getSkinParam());
186 textHeader = header.createRibbon(new FontConfiguration(getSkinParam(), FontParam.HEADER, null),
187 getSkinParam());
124188 }
125189
126190 return DecorateEntityImage.addTopAndBottom(original, textHeader, header.getHorizontalAlignment(), textFooter,
9595 if (s == null) {
9696 return null;
9797 }
98 // final String tmps = s.toString();
99 // if (tmps.indexOf('\\') == -1) {
100 // return tmps;
101 // }
98102 final StringBuilder result = new StringBuilder();
99103 for (int i = 0; i < s.length(); i++) {
100104 final char c = s.charAt(i);
5353 public class BlockUml {
5454
5555 private final List<CharSequence2> data;
56 private final int startLine;
5756 private Diagram system;
5857 private final Defines localDefines;
5958
6059 BlockUml(String... strings) {
61 this(convert(strings), 0, Defines.createEmpty());
60 this(convert(strings), Defines.createEmpty());
6261 }
6362
6463 public String getEncodedUrl() throws IOException {
9291 return result;
9392 }
9493
95 public BlockUml(List<CharSequence2> strings, int startLine, Defines defines) {
96 this.startLine = startLine;
94 public BlockUml(List<CharSequence2> strings, Defines defines) {
9795 this.localDefines = defines;
9896 final CharSequence2 s0 = strings.get(0).trin();
9997 if (StartUtils.startsWithSymbolAnd("start", s0) == false) {
131129
132130 public Diagram getDiagram() {
133131 if (system == null) {
134 system = new PSystemBuilder().createPSystem(data, startLine);
132 system = new PSystemBuilder().createPSystem(data);
135133 }
136134 return system;
137 }
138
139 public final int getStartLine() {
140 return startLine;
141135 }
142136
143137 public final List<CharSequence2> getData() {
4444 import java.util.Set;
4545
4646 import net.sourceforge.plantuml.preproc.Defines;
47 import net.sourceforge.plantuml.preproc.DefinesGet;
4748 import net.sourceforge.plantuml.preproc.FileWithSuffix;
48 import net.sourceforge.plantuml.preproc.Preprocessor;
49 import net.sourceforge.plantuml.preproc.ImportedFiles;
50 import net.sourceforge.plantuml.preproc.ReadLineNumbered;
4951 import net.sourceforge.plantuml.preproc.ReadLineReader;
5052 import net.sourceforge.plantuml.preproc.UncommentReadLine;
53 import net.sourceforge.plantuml.preproc2.Preprocessor2;
5154 import net.sourceforge.plantuml.utils.StartUtils;
5255
5356 public final class BlockUmlBuilder implements DefinitionsContainer {
5962
6063 public BlockUmlBuilder(List<String> config, String charset, Defines defines, Reader reader, File newCurrentDir,
6164 String desc) throws IOException {
62 Preprocessor includer = null;
65 ReadLineNumbered includer = null;
6366 this.defines = defines;
6467 try {
6568 reader2 = new UncommentReadLine(ReadLineReader.create(reader, desc));
66 includer = new Preprocessor(config, reader2, charset, defines, newCurrentDir, this);
69 includer = new Preprocessor2(config, reader2, charset, defines, this,
70 ImportedFiles.createImportedFiles(new AParentFolderRegular(newCurrentDir)));
6771 init(includer);
6872 } finally {
6973 if (includer != null) {
7781 this(config, charset, defines, reader, null, null);
7882 }
7983
80 private void init(Preprocessor includer) throws IOException {
84 private void init(ReadLineNumbered includer) throws IOException {
8185 CharSequence2 s = null;
8286 List<CharSequence2> current2 = null;
8387 boolean paused = false;
84 int startLine = 0;
88
8589 while ((s = includer.readLine()) != null) {
8690 if (StartUtils.isArobaseStartDiagram(s)) {
8791 current2 = new ArrayList<CharSequence2>();
8892 paused = false;
89 startLine = includer.getLineNumber();
9093 }
9194 if (StartUtils.isArobasePauseDiagram(s)) {
9295 paused = true;
113116 if (paused) {
114117 current2.add(s);
115118 }
116 blocks.add(new BlockUml(current2, startLine/* - config.size() */, defines.cloneMe()));
119 blocks.add(new BlockUml(current2, defines.cloneMe()));
117120 current2 = null;
118121 reader2.setPaused(false);
119122 }
4343 private final ErrorUmlType type;
4444 private SuggestEngineResult suggest;
4545 private final LineLocation lineLocation;
46 // private final int startLine;
4746
4847 public ErrorUml(ErrorUmlType type, String error, LineLocation lineLocation) {
49 if (error == null || type == null || StringUtils.isEmpty(error)) {
48 if (error == null || type == null) {
5049 throw new IllegalArgumentException();
5150 }
52 // this.startLine = startLine;
5351 this.error = error;
5452 this.type = type;
5553 this.lineLocation = lineLocation;
5555 }
5656
5757 public void setCurrentDir(File dir) {
58 if (dir == null) {
59 throw new IllegalArgumentException();
60 }
58 // if (dir == null) {
59 // throw new IllegalArgumentException();
60 // }
6161 Log.info("Setting current dir: " + dir);
6262 this.currentDir.set(dir);
6363 }
7575 if (filecurrent.exists()) {
7676 return filecurrent.getCanonicalFile();
7777 }
78 for (File d : getPath("plantuml.include.path")) {
79 final File file = new File(d, nameOrPath);
80 if (file.exists()) {
81 return file.getCanonicalFile();
78 for (File d : getPath("plantuml.include.path", true)) {
79 if (d.isDirectory()) {
80 final File file = new File(d, nameOrPath);
81 if (file.exists()) {
82 return file.getCanonicalFile();
83 }
8284 }
8385 }
84 for (File d : getPath("java.class.path")) {
85 final File file = new File(d, nameOrPath);
86 if (file.exists()) {
87 return file.getCanonicalFile();
86 for (File d : getPath("java.class.path", true)) {
87 if (d.isDirectory()) {
88 final File file = new File(d, nameOrPath);
89 if (file.exists()) {
90 return file.getCanonicalFile();
91 }
8892 }
8993 }
9094 return filecurrent;
9195 }
9296
93 private List<File> getPath(String prop) {
97 public static List<File> getPath(String prop, boolean onlyDir) {
9498 final List<File> result = new ArrayList<File>();
9599 String paths = System.getProperty(prop);
96100 if (paths == null) {
100104 final StringTokenizer st = new StringTokenizer(paths, System.getProperty("path.separator"));
101105 while (st.hasMoreTokens()) {
102106 final File f = new File(st.nextToken());
103 if (f.exists() && f.isDirectory()) {
107 if (f.exists() && (onlyDir == false || f.isDirectory())) {
104108 result.add(f);
105109 }
106110 }
4444 }
4545
4646 public enum FontParam {
47 TIMING(12, Font.PLAIN), //
4748 ACTIVITY(12, Font.PLAIN), //
4849 ACTIVITY_DIAMOND(11, Font.PLAIN), //
4950 // ACTIVITY_ARROW(11, Font.PLAIN), //
117118 STACK_STEREOTYPE(14, Font.ITALIC), //
118119 ACTOR_STEREOTYPE(14, Font.ITALIC), //
119120 SEQUENCE_STEREOTYPE(14, Font.ITALIC), //
120 PARTITION(14, Font.PLAIN),
121 DESIGNED_DOMAIN(12, Font.PLAIN), //
121 PARTITION(14, Font.PLAIN), DESIGNED_DOMAIN(12, Font.PLAIN), //
122122 DESIGNED_DOMAIN_STEREOTYPE(12, Font.ITALIC), //
123123 DOMAIN(12, Font.PLAIN), //
124124 DOMAIN_STEREOTYPE(12, Font.ITALIC), //
4444 import net.sourceforge.plantuml.skin.ArrowDirection;
4545 import net.sourceforge.plantuml.svek.ConditionStyle;
4646 import net.sourceforge.plantuml.svek.PackageStyle;
47 import net.sourceforge.plantuml.ugraphic.ColorMapper;
4847 import net.sourceforge.plantuml.ugraphic.UFont;
4948 import net.sourceforge.plantuml.ugraphic.UStroke;
5049
6867
6968 public UFont getFont(Stereotype stereotype, boolean inPackageTitle, FontParam... fontParam);
7069
71 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection);
70 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection, boolean isReverseDefine);
7271
7372 public HorizontalAlignment getDefaultTextAlignment(HorizontalAlignment defaultValue);
7473
7877
7978 public int classAttributeIconSize();
8079
81 public ColorMapper getColorMapper();
82
8380 public DotSplines getDotSplines();
8481
8582 public String getDotExecutable();
8683
87 public boolean shadowing();
84 public boolean shadowing(Stereotype stereotype);
8885
8986 public boolean shadowingForNote(Stereotype stereotype);
9087
91 public boolean shadowing2(SkinParameter skinParameter);
88 public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter);
9289
9390 public PackageStyle getPackageStyle();
9491
159156 public boolean responseMessageBelowArrow();
160157
161158 public boolean svgDimensionStyle();
159
160 public boolean fixCircleLabelOverlapping();
162161
163162 }
3535 package net.sourceforge.plantuml;
3636
3737 import net.sourceforge.plantuml.graphic.IHtmlColorSet;
38 import net.sourceforge.plantuml.ugraphic.ColorMapper;
3839
3940 public interface ISkinSimple extends SpriteContainer {
4041
4950 public IHtmlColorSet getIHtmlColorSet();
5051
5152 public int getDpi();
53
54 public LineBreakStrategy wrapWidth();
55
56 public ColorMapper getColorMapper();
5257
5358 }
8181 return parent;
8282 }
8383
84 private boolean isStandardLibrary() {
85 return desc.startsWith("<");
86 }
87
8488 public int compareTo(LineLocation other) {
8589 final LineLocationImpl other2 = (LineLocationImpl) other;
90 if (this.isStandardLibrary() && other2.isStandardLibrary() == false) {
91 return -1;
92 }
93 if (this.isStandardLibrary() == false && other2.isStandardLibrary()) {
94 return 1;
95 }
8696 return this.position - other2.position;
8797 }
8898
280280 OptionPrint.printLicense();
281281 } else if (s.equalsIgnoreCase("-checkversion")) {
282282 OptionPrint.checkVersion();
283 } else if (s.startsWith("-DPLANTUML_LIMIT_SIZE=")) {
284 final String v = s.substring("-DPLANTUML_LIMIT_SIZE=".length());
285 if (v.matches("\\d+")) {
286 System.setProperty("PLANTUML_LIMIT_SIZE", v);
287 }
283288 } else if (s.startsWith("-D")) {
284289 manageDefine(s.substring(2));
285290 } else if (s.startsWith("-S")) {
8686 }
8787
8888 private void reset(boolean exit) {
89 // keepTmpFiles = false;
9089 verbose = false;
9190 extractFromMetadata = false;
9291 word = false;
9594 quiet = false;
9695 checkDotError = false;
9796 printFonts = false;
98 // useSuggestEngine = true;
9997 // failOnError = false;
10098 encodesprite = false;
10199 // PIC_LINE = false;
105103 return false;
106104 }
107105
108 // private boolean keepTmpFiles;
109106 private boolean verbose;
110107 private boolean extractFromMetadata;
111108 private boolean word;
114111 private boolean quiet;
115112 private boolean checkDotError;
116113 private boolean printFonts;
117 // private boolean useSuggestEngine;
118114 private boolean encodesprite;
119115 private boolean dumpHtmlStats;
120116 private boolean dumpStats;
122118 private boolean overwrite;
123119 private boolean enableStats = defaultForStats();
124120 private boolean stdLib;
121 private boolean silentlyCompletelyIgnoreErrors;
125122 private boolean extractStdLib;
126123 private boolean clipboardLoop;
127124 private boolean clipboard;
256253 return false;
257254 }
258255
259 // public final boolean isUseSuggestEngine() {
260 // return useSuggestEngine;
261 // }
262 //
263 // public final void setUseSuggestEngine(boolean useSuggestEngine) {
264 // this.useSuggestEngine = useSuggestEngine;
265 // }
266
267256 public final boolean isEncodesprite() {
268257 return encodesprite;
269258 }
367356 public final void setStdLib(boolean stdLib) {
368357 this.stdLib = stdLib;
369358 }
359
360 public final boolean isSilentlyCompletelyIgnoreErrors() {
361 return silentlyCompletelyIgnoreErrors;
362 }
363
364 public final void setSilentlyCompletelyIgnoreErrors(boolean silentlyCompletelyIgnoreErrors) {
365 this.silentlyCompletelyIgnoreErrors = silentlyCompletelyIgnoreErrors;
366 }
370367 }
145145 System.out.println(" -extractstdlib\tTo extract PlantUML Standard Library into stdlib folder");
146146 System.out.println(" -filename \"example.puml\"\tTo override %filename% variable");
147147 System.out.println(" -preproc\t\tTo output preprocessor text of diagrams");
148 System.out.println(" -cypher\t\tTo cypher texts of diagrams so that you can share them");
148149 System.out.println();
149150 System.out.println("If needed, you can setup the environment variable GRAPHVIZ_DOT.");
150151 exit();
158159 }
159160
160161 public static void printLicense() throws InterruptedException {
161 for (String s : License.getCurrent().getText()) {
162 for (String s : License.getCurrent().getText(false)) {
162163 System.out.println(s);
163164 }
164165 exit();
7272 import net.sourceforge.plantuml.logo.PSystemLogoFactory;
7373 import net.sourceforge.plantuml.math.PSystemLatexFactory;
7474 import net.sourceforge.plantuml.math.PSystemMathFactory;
75 import net.sourceforge.plantuml.nwdiag.NwDiagramFactory;
7576 import net.sourceforge.plantuml.openiconic.PSystemListOpenIconicFactory;
7677 import net.sourceforge.plantuml.openiconic.PSystemOpenIconicFactory;
7778 import net.sourceforge.plantuml.oregon.PSystemOregonFactory;
9394
9495 public static final long startTime = System.currentTimeMillis();
9596
96 final public Diagram createPSystem(final List<CharSequence2> strings2, int startLine) {
97 final public Diagram createPSystem(final List<CharSequence2> strings2) {
9798
9899 final long now = System.currentTimeMillis();
99100
100101 Diagram result = null;
101102 try {
102103 final DiagramType type = DiagramType.getTypeFromArobaseStart(strings2.get(0).toString2());
103 final UmlSource umlSource = new UmlSource(strings2, type == DiagramType.UML, startLine);
104 final UmlSource umlSource = new UmlSource(strings2, type == DiagramType.UML);
104105
105106 // int cpt = 0;
106107 for (CharSequence2 s : strings2) {
166167 factories.add(new PSystemSaltFactory(DiagramType.UML));
167168 factories.add(new PSystemDotFactory(DiagramType.DOT));
168169 factories.add(new PSystemDotFactory(DiagramType.UML));
170 factories.add(new NwDiagramFactory());
169171 if (License.getCurrent() == License.GPL || License.getCurrent() == License.GPLV2) {
170172 factories.add(new PSystemDitaaFactory(DiagramType.DITAA));
171173 factories.add(new PSystemDitaaFactory(DiagramType.UML));
3636 import java.awt.Color;
3737 import java.awt.geom.Dimension2D;
3838 import java.awt.geom.Rectangle2D;
39 import java.awt.image.BufferedImage;
3940 import java.io.IOException;
4041 import java.io.OutputStream;
4142 import java.io.PrintStream;
5253 import net.sourceforge.plantuml.core.DiagramDescription;
5354 import net.sourceforge.plantuml.core.ImageData;
5455 import net.sourceforge.plantuml.core.UmlSource;
56 import net.sourceforge.plantuml.cucadiagram.Display;
5557 import net.sourceforge.plantuml.eggs.PSystemWelcome;
58 import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
59 import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
60 import net.sourceforge.plantuml.graphic.FontConfiguration;
5661 import net.sourceforge.plantuml.graphic.GraphicPosition;
5762 import net.sourceforge.plantuml.graphic.GraphicStrings;
5863 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
5964 import net.sourceforge.plantuml.graphic.HtmlColor;
65 import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
6066 import net.sourceforge.plantuml.graphic.HtmlColorSimple;
67 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
6168 import net.sourceforge.plantuml.graphic.InnerStrategy;
6269 import net.sourceforge.plantuml.graphic.StringBounder;
6370 import net.sourceforge.plantuml.graphic.TextBlock;
6471 import net.sourceforge.plantuml.graphic.TextBlockUtils;
72 import net.sourceforge.plantuml.graphic.VerticalAlignment;
6573 import net.sourceforge.plantuml.svek.TextBlockBackcolored;
6674 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
6775 import net.sourceforge.plantuml.ugraphic.ImageBuilder;
6876 import net.sourceforge.plantuml.ugraphic.MinMax;
77 import net.sourceforge.plantuml.ugraphic.UFont;
6978 import net.sourceforge.plantuml.ugraphic.UGraphic;
7079 import net.sourceforge.plantuml.ugraphic.UImage;
7180 import net.sourceforge.plantuml.ugraphic.UTranslate;
144153 } else {
145154 udrawable = result;
146155 }
147 if (LicenseInfo.retrieveQuick().isValid() == false) {
148 final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
149 if (min == 0) {
150 udrawable = addMessage(udrawable);
151 }
156 final int min = (int) (System.currentTimeMillis() / 60000L) % 60;
157 if (min == 1 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) {
158 udrawable = addMessagePatreon(udrawable);
159 } else if (min == 15 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) {
160 udrawable = addMessageLiberapay(udrawable);
161 } else if (min == 30 && LicenseInfo.retrieveNamedOrDistributorQuickIsValid() == false) {
162 udrawable = addMessageDedication(udrawable);
163 } else if (getSource().containsIgnoreCase("arecibo")) {
164 udrawable = addMessageArecibo(udrawable);
152165 }
153166 imageBuilder.setUDrawable(udrawable);
154167 final ImageData imageData = imageBuilder.writeImageTOBEMOVED(fileFormat, seed(), os);
165178 return TextBlockUtils.mergeTB(welcome, result, HorizontalAlignment.LEFT);
166179 }
167180
168 private TextBlock addMessage(final TextBlock source) throws IOException {
169 final TextBlock message = getMessage();
181 private TextBlock addMessageLiberapay(final TextBlock source) throws IOException {
182 final TextBlock message = getMessageLiberapay();
170183 TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT);
171184 result = TextBlockUtils.mergeTB(result, message, HorizontalAlignment.LEFT);
172185 return result;
173186 }
174187
175 private TextBlockBackcolored getMessage() {
176 final UImage message = new UImage(PSystemVersion.getTime());
177 final HtmlColor backImage = new HtmlColorSimple(new Color(message.getImage().getRGB(0, 0)), false);
178 final double imWidth = message.getWidth();
179 final double imHeight = message.getHeight();
188 private TextBlock addMessagePatreon(final TextBlock source) throws IOException {
189 final TextBlock message = getMessagePatreon();
190 TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT);
191 result = TextBlockUtils.mergeTB(result, message, HorizontalAlignment.LEFT);
192 return result;
193 }
194
195 private TextBlock addMessageDedication(final TextBlock source) throws IOException {
196 final TextBlock message = getMessageDedication();
197 TextBlock result = TextBlockUtils.mergeTB(message, source, HorizontalAlignment.LEFT);
198 return result;
199 }
200
201 private TextBlock addMessageArecibo(final TextBlock source) throws IOException {
202 final UImage message = new UImage(PSystemVersion.getArecibo());
203 TextBlock result = TextBlockUtils.mergeLR(source, TextBlockUtils.fromUImage(message), VerticalAlignment.TOP);
204 return result;
205 }
206
207 private TextBlockBackcolored getMessageDedication() {
208 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
209 final HtmlColorSimple backColor = (HtmlColorSimple) new HtmlColorSetSimple().getColorIfValid("#DFDCD3");
210
211 final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/dedication", Color.BLACK,
212 backColor.getColor999()));
213 final Display disp = Display.create("<b>Add your own dedication into PlantUML", " ", "For just $5 per month!",
214 "Details on <i>[[http://plantuml.com/dedication]]");
215
216 final UFont font = UFont.sansSerif(14);
217 final FontConfiguration fc = new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
218 final TextBlock text = TextBlockUtils.withMargin(
219 disp.create(fc, HorizontalAlignment.LEFT, new SpriteContainerEmpty()), 10, 0);
220 final TextBlock result;
221 if (qrcode == null) {
222 result = text;
223 } else {
224 final UImage qr = new UImage(qrcode).scaleNearestNeighbor(3);
225 result = TextBlockUtils.mergeLR(text, TextBlockUtils.fromUImage(qr), VerticalAlignment.CENTER);
226 }
227 return TextBlockUtils.addBackcolor(result, backColor);
228
229 }
230
231 private TextBlockBackcolored getMessagePatreon() {
232 final UImage message = new UImage(PSystemVersion.getTime01());
233 final Color back = new Color(message.getImage().getRGB(0, 0));
234 final HtmlColor backColor = new HtmlColorSimple(back, false);
235
236 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
237 final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/patreon", Color.BLACK,
238 Color.WHITE));
239
240 final int scale = 2;
241
242 final double imWidth = message.getWidth() + (qrcode == null ? 0 : qrcode.getWidth() * scale + 20);
243 final double imHeight = qrcode == null ? message.getHeight() : Math.max(message.getHeight(), qrcode.getHeight()
244 * scale + 10);
180245 return new TextBlockBackcolored() {
181246
182247 public void drawU(UGraphic ug) {
183 ug.apply(new UTranslate(1, 1)).draw(message);
248 if (qrcode == null) {
249 ug.apply(new UTranslate(1, 1)).draw(message);
250 } else {
251 final UImage qr = new UImage(qrcode).scaleNearestNeighbor(scale);
252 ug.apply(new UTranslate(1, (imHeight - message.getHeight()) / 2)).draw(message);
253 ug.apply(new UTranslate(1 + message.getWidth(), (imHeight - qr.getHeight()) / 2)).draw(qr);
254 }
184255 }
185256
186257 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
196267 }
197268
198269 public HtmlColor getBackcolor() {
199 return backImage;
270 return backColor;
200271 }
201272 };
202273
274 }
275
276 private TextBlockBackcolored getMessageLiberapay() {
277 final UImage message = new UImage(PSystemVersion.getTime15());
278 final Color back = new Color(message.getImage().getRGB(0, 0));
279 final HtmlColor backColor = new HtmlColorSimple(back, false);
280
281 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
282 final BufferedImage qrcode = smaller(utils.exportFlashcode("http://plantuml.com/lp", Color.BLACK, Color.WHITE));
283
284 final int scale = 2;
285
286 final double imWidth = message.getWidth() + (qrcode == null ? 0 : qrcode.getWidth() * scale + 20);
287 final double imHeight = qrcode == null ? message.getHeight() : Math.max(message.getHeight(), qrcode.getHeight()
288 * scale + 10);
289 return new TextBlockBackcolored() {
290
291 public void drawU(UGraphic ug) {
292 if (qrcode == null) {
293 ug.apply(new UTranslate(1, 1)).draw(message);
294 } else {
295 final UImage qr = new UImage(qrcode).scaleNearestNeighbor(scale);
296 ug.apply(new UTranslate(1, (imHeight - message.getHeight()) / 2)).draw(message);
297 ug.apply(new UTranslate(1 + message.getWidth(), (imHeight - qr.getHeight()) / 2)).draw(qr);
298 }
299 }
300
301 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
302 return null;
303 }
304
305 public Dimension2D calculateDimension(StringBounder stringBounder) {
306 return new Dimension2DDouble(imWidth + 1, imHeight + 1);
307 }
308
309 public MinMax getMinMax(StringBounder stringBounder) {
310 return MinMax.fromMax(imWidth + 1, imHeight + 1);
311 }
312
313 public HtmlColor getBackcolor() {
314 return backColor;
315 }
316 };
317
318 }
319
320 private BufferedImage smaller(BufferedImage im) {
321 if (im == null) {
322 return null;
323 }
324 final int nb = 1;
325 return im.getSubimage(nb, nb, im.getWidth() - 2 * nb, im.getHeight() - 2 * nb);
203326 }
204327
205328 private List<String> getTextStrings() {
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml;
36
37 public class QString {
38
39 private final String data;
40 private final long mask;
41
42 public QString(String data) {
43 this.data = data;
44 this.mask = getMask(data);
45 }
46
47 @Override
48 public String toString() {
49 return data;
50 }
51
52 public boolean containsQ(QString other) {
53 if ((this.mask & other.mask) != other.mask) {
54 return false;
55 }
56 return this.data.contains(other.data);
57 }
58
59 static long getMask(String s) {
60 long result = 0;
61 for (int i = 0; i < s.length(); i++) {
62 result |= getMask(s.charAt(i));
63 }
64 return result;
65 }
66
67 static long getMask(char c) {
68 if (c >= '0' && c <= '9') {
69 final int n = c - '0';
70 return 1L << n;
71 }
72 if (c >= 'a' && c <= 'z') {
73 final int n = c - 'a' + 10;
74 return 1L << n;
75 }
76 if (c >= 'A' && c <= 'Z') {
77 final int n = c - 'A' + 10 + 26;
78 return 1L << n;
79 }
80 if (c == '_') {
81 return 1L << (10 + 26 + 26);
82 }
83 if (c == '(') {
84 return 1L << 63;
85 }
86 return 0;
87 }
88
89 }
459459 System.out.println(f);
460460 // new Metadata().readAndDisplayMetadata(f);
461461 System.out.println();
462 System.out.println(new MetadataTag(f, "plantuml").getData());
462 final String data = new MetadataTag(f, "plantuml").getData();
463 // File file = new File("tmp.txt");
464 // PrintWriter pw = new PrintWriter(file, "UTF-8");
465 // pw.println(NastyEncoder.fromISO_8859_1(data));
466 // pw.close();
467
468 System.out.println(data);
463469 System.out.println("------------------------");
464470 return false;
465471 }
490496 return false;
491497 }
492498 final List<GeneratedImage> result = sourceFileReader.getGeneratedImages();
499 if (result.size() == 0) {
500 Log.error("Warning: no image in " + f.getCanonicalPath());
501 }
493502
494503 return hasErrors(f, result);
495504 }
5151
5252 public class SignatureUtils {
5353
54 public static byte[] salting(String pass, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException,
55 UnsupportedEncodingException {
54 // private static byte[] salting(String pass, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException,
55 // UnsupportedEncodingException {
56 // final byte[] tmp = salting2(pass, salt);
57 // return SignatureUtils.getSHA512raw(tmp);
58 // }
59
60 public static byte[] salting(String pass, byte[] salt) throws NoSuchAlgorithmException, InvalidKeySpecException {
5661 final int iterations = 10000;
5762 final int keyLength = 512;
5863 final SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
5964 final PBEKeySpec spec = new PBEKeySpec(pass.toCharArray(), salt, iterations, keyLength);
6065 final SecretKey key = skf.generateSecret(spec);
61 return SignatureUtils.getSHA512raw(key.getEncoded());
66 final byte[] tmp = key.getEncoded();
67 return tmp;
6268 }
6369
6470 public static String getSignature(String s) {
414414 result.add("SameClassWidth");
415415 result.add("HyperlinkUnderline");
416416 result.add("Padding");
417 result.add("BoxPadding");
418 result.add("ParticipantPadding");
417419 result.add("Guillemet");
418420 result.add("SvglinkTarget");
419421 result.add("DefaultMonospacedFontName");
430432 result.add("WrapWidth");
431433 result.add("SwimlaneWidth");
432434 result.add("SwimlaneWrapTitleWidth");
435 result.add("FixCircleLabelOverlapping");
433436
434437 for (FontParam p : EnumSet.allOf(FontParam.class)) {
435438 final String h = humanName(p.name());
476479 return DotSplines.SPLINES;
477480 }
478481
479 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) {
482 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection,
483 boolean isReverseDefine) {
480484 final String value;
481485 switch (param) {
482486 case sequenceMessageAlignment:
488492 default:
489493 value = getValue(param.name());
490494 }
495 if ("first".equalsIgnoreCase(value)) {
496 if (arrowDirection == ArrowDirection.RIGHT_TO_LEFT_REVERSE) {
497 if (isReverseDefine) {
498 return HorizontalAlignment.LEFT;
499 }
500 return HorizontalAlignment.RIGHT;
501 } else {
502 if (isReverseDefine) {
503 return HorizontalAlignment.RIGHT;
504 }
505 return HorizontalAlignment.LEFT;
506 }
507 }
491508 if ("direction".equalsIgnoreCase(value)) {
492509 if (arrowDirection == ArrowDirection.LEFT_TO_RIGHT_NORMAL) {
493510 return HorizontalAlignment.LEFT;
558575 return new ColorMapperReverse(order);
559576 }
560577
561 public boolean shadowing() {
578 public boolean shadowing(Stereotype stereotype) {
579 if (stereotype != null) {
580 checkStereotype(stereotype);
581 final String value2 = getValue("shadowing" + stereotype.getLabel(false));
582 if (value2 != null) {
583 return value2.equalsIgnoreCase("true");
584 }
585 }
562586 final String value = getValue("shadowing");
563587 if ("false".equalsIgnoreCase(value)) {
564588 return false;
584608 if (value2 != null) {
585609 return value2.equalsIgnoreCase("true");
586610 }
587 return shadowing();
588 }
589
590 public boolean shadowing2(SkinParameter skinParameter) {
611 return shadowing(stereotype);
612 }
613
614 public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
591615 if (skinParameter == null) {
592616 throw new IllegalArgumentException();
593617 }
594618 final String name = skinParameter.getUpperCaseName();
619 if (stereotype != null) {
620 checkStereotype(stereotype);
621 final String value2 = getValue(name + "shadowing" + stereotype.getLabel(false));
622 if (value2 != null) {
623 return value2.equalsIgnoreCase("true");
624 }
625 }
626
595627 final String value = getValue(name + "shadowing");
596628 if (value == null) {
597 return shadowing();
629 return shadowing(stereotype);
598630 }
599631 if ("false".equalsIgnoreCase(value)) {
600632 return false;
10051037 return true;
10061038 }
10071039
1040 public boolean fixCircleLabelOverlapping() {
1041 final String value = getValue("fixcirclelabeloverlapping");
1042 if ("true".equalsIgnoreCase(value)) {
1043 return true;
1044 }
1045 return false;
1046 }
1047
10081048 }
5454 }
5555
5656 @Override
57 public boolean shadowing() {
57 public boolean shadowing(Stereotype stereotype) {
5858 if (colors.getShadowing() == null) {
59 return super.shadowing();
59 return super.shadowing(stereotype);
6060 }
6161 return colors.getShadowing();
6262 }
102102 return skinParam.getDotExecutable();
103103 }
104104
105 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection) {
106 return skinParam.getHorizontalAlignment(param, arrowDirection);
105 public HorizontalAlignment getHorizontalAlignment(AlignmentParam param, ArrowDirection arrowDirection, boolean isReverseDefine) {
106 return skinParam.getHorizontalAlignment(param, arrowDirection, isReverseDefine);
107107 }
108108
109109 public ColorMapper getColorMapper() {
110110 return skinParam.getColorMapper();
111111 }
112112
113 public boolean shadowing() {
114 return skinParam.shadowing();
115 }
116
117 public boolean shadowing2(SkinParameter skinParameter) {
118 return skinParam.shadowing2(skinParameter);
113 public boolean shadowing(Stereotype stereotype) {
114 return skinParam.shadowing(stereotype);
115 }
116
117 public boolean shadowing2(Stereotype stereotype, SkinParameter skinParameter) {
118 return skinParam.shadowing2(stereotype, skinParameter);
119119 }
120120
121121 public PackageStyle getPackageStyle() {
298298 return skinParam.swimlaneWrapTitleWidth();
299299 }
300300
301 public boolean fixCircleLabelOverlapping() {
302 return skinParam.fixCircleLabelOverlapping();
303 }
304
301305 }
4040 import java.util.List;
4141
4242 import net.sourceforge.plantuml.preproc.Defines;
43 import net.sourceforge.plantuml.preproc.FileWithSuffix;
4344
4445 public class SourceFileReader extends SourceFileReaderAbstract implements ISourceFileReader {
4546
8283 this.outputDirectory = outputDirectory;
8384
8485 builder = new BlockUmlBuilder(config, charset, defines, getReader(charset), file.getAbsoluteFile()
85 .getParentFile(), file.getAbsolutePath());
86 .getParentFile(), FileWithSuffix.getFileName(file));
8687 }
8788
8889 private File getDirIfDirectory(String newName) {
3939 import java.util.List;
4040
4141 import net.sourceforge.plantuml.preproc.Defines;
42 import net.sourceforge.plantuml.preproc.FileWithSuffix;
4243
4344 public class SourceFileReader2 extends SourceFileReaderAbstract implements ISourceFileReader {
4445
5354 FileSystem.getInstance().setCurrentDir(file.getAbsoluteFile().getParentFile());
5455
5556 builder = new BlockUmlBuilder(config, charset, defines, getReader(charset), file.getAbsoluteFile()
56 .getParentFile(), file.getAbsolutePath());
57 .getParentFile(), FileWithSuffix.getFileName(file));
5758 }
5859
5960 @Override
148148 return getCrashedImage(blockUml, t, suggested.getFile(0));
149149 }
150150
151 if (OptionFlags.getInstance().isSilentlyCompletelyIgnoreErrors() && system instanceof PSystemError) {
152 continue;
153 }
154
151155 OptionFlags.getInstance().logData(file, system);
152156 final List<FileImageData> exportDiagrams = PSystemUtils.exportDiagrams(system, suggested, fileFormatOption,
153157 checkMetadata);
7474 }
7575
7676 public SourceStringReader(Defines defines, String source, String charset, List<String> config) {
77 this(defines, source, charset, config, null);
77 this(defines, source, charset, config, FileSystem.getInstance().getCurrentDir());
7878 }
7979
8080 public SourceStringReader(Defines defines, String source, String charset, List<String> config, File newCurrentDir) {
81 // WARNING GLOBAL LOCK HERE
82 synchronized (SourceStringReader.class) {
83 try {
84 final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source),
85 newCurrentDir, "string");
86 this.blocks = builder.getBlockUmls();
87 } catch (IOException e) {
88 Log.error("error " + e);
89 throw new IllegalStateException(e);
90 }
91 }
81 // // WARNING GLOBAL LOCK HERE
82 // synchronized (SourceStringReader.class) {
83 try {
84 final BlockUmlBuilder builder = new BlockUmlBuilder(config, charset, defines, new StringReader(source),
85 newCurrentDir, "string");
86 this.blocks = builder.getBlockUmls();
87 } catch (IOException e) {
88 Log.error("error " + e);
89 throw new IllegalStateException(e);
90 }
91 // }
9292 }
9393
9494 @Deprecated
3737 import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
3838 import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
3939 import net.sourceforge.plantuml.graphic.IHtmlColorSet;
40 import net.sourceforge.plantuml.ugraphic.ColorMapper;
41 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
4042 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
4143 import net.sourceforge.plantuml.ugraphic.sprite.SpriteImage;
4244
7476 return 96;
7577 }
7678
79 public LineBreakStrategy wrapWidth() {
80 return LineBreakStrategy.NONE;
81 }
82
83 public ColorMapper getColorMapper() {
84 return new ColorMapperIdentity();
85 }
86
7787 }
314314
315315 public static int getHeight(Display stringsToDisplay) {
316316 return stringsToDisplay.size();
317 }
318
319 private static boolean isSpaceOrTab(char c) {
320 return c == ' ' || c == '\t';
321317 }
322318
323319 public static boolean isDiagramCacheable(String uml) {
489485 return arg.toString();
490486 }
491487 int i = 0;
492 while (i < arg.length() && isSpaceOrTab(arg.charAt(i))) {
488 while (i < arg.length() && isSpaceOrTabOrNull(arg.charAt(i))) {
493489 i++;
494490 }
495491 int j = arg.length() - 1;
496 while (j >= i && isSpaceOrTab(arg.charAt(j))) {
492 while (j >= i && isSpaceOrTabOrNull(arg.charAt(j))) {
497493 j--;
498494 }
499495 if (i == 0 && j == arg.length() - 1) {
502498 return arg.subSequence(i, j + 1).toString();
503499 }
504500
501 private static boolean isSpaceOrTabOrNull(char c) {
502 return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\0';
503 }
504
505505 // http://docs.oracle.com/javase/tutorial/i18n/format/dateFormat.html
506506 }
3434 */
3535 package net.sourceforge.plantuml;
3636
37 import java.awt.Color;
3738 import java.awt.geom.AffineTransform;
3839 import java.awt.geom.Dimension2D;
3940 import java.awt.image.BufferedImage;
5859 import net.sourceforge.plantuml.core.Diagram;
5960 import net.sourceforge.plantuml.core.ImageData;
6061 import net.sourceforge.plantuml.core.UmlSource;
62 import net.sourceforge.plantuml.cucadiagram.Display;
6163 import net.sourceforge.plantuml.cucadiagram.DisplayPositionned;
6264 import net.sourceforge.plantuml.cucadiagram.DisplaySection;
6365 import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException;
9698 private DisplayPositionned legend = DisplayPositionned.none(HorizontalAlignment.CENTER, VerticalAlignment.BOTTOM);
9799 private final DisplaySection header = DisplaySection.none();
98100 private final DisplaySection footer = DisplaySection.none();
101 private Display mainFrame;
99102
100103 private final Pragma pragma = new Pragma();
101104 private Animation animation;
107110 return;
108111 }
109112 this.title = title;
113 }
114
115 final public void setMainFrame(Display mainFrame) {
116 this.mainFrame = mainFrame;
110117 }
111118
112119 final public void setCaption(DisplayPositionned caption) {
208215 throws IOException {
209216
210217 final HtmlColor hover = getSkinParam().getHoverPathColor();
211 fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
218 if (fileFormatOption.getSvgLinkTarget() == null || fileFormatOption.getSvgLinkTarget().equals("_top")) {
219 fileFormatOption = fileFormatOption.withSvgLinkTarget(getSkinParam().getSvgLinkTarget());
220 }
212221 fileFormatOption = fileFormatOption.withTikzFontDistortion(getSkinParam().getTikzFontDistortion());
213222 if (hover != null) {
214223 fileFormatOption = fileFormatOption.withHoverColor(StringUtils.getAsHtml(getSkinParam().getColorMapper()
253262 metadata, null, 0, 0, null, false);
254263
255264 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
256 final BufferedImage im = utils.exportFlashcode(flash);
265 final BufferedImage im = utils.exportFlashcode(flash, Color.BLACK, Color.WHITE);
257266 if (im != null) {
258267 GraphvizCrash.addDecodeHint(strings);
259268 }
427436 this.useJDot = useJDot;
428437 }
429438
439 public static final boolean FORCE_JDOT = false;
440
430441 public boolean isUseJDot() {
442 if (FORCE_JDOT)
443 return true;
431444 return useJDot;
432445 }
433446
434 public void setDotExecutable(String dotExecutable) {
447 private void setDotExecutable(String dotExecutable) {
435448 skinParam.setDotExecutable(dotExecutable);
436449 }
450
451 public final Display getMainFrame() {
452 return mainFrame;
453 }
437454 }
3535 package net.sourceforge.plantuml;
3636
3737 public enum UmlDiagramType {
38 SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM
38 SEQUENCE, STATE, CLASS, OBJECT, ACTIVITY, DESCRIPTION, COMPOSITE, FLOW, TIMING, BPM, NWDIAG
3939 }
5656 import net.sourceforge.plantuml.graphic.Rainbow;
5757 import net.sourceforge.plantuml.graphic.TextBlock;
5858 import net.sourceforge.plantuml.graphic.TextBlockRecentred;
59 import net.sourceforge.plantuml.graphic.USymbol;
5960 import net.sourceforge.plantuml.graphic.color.Colors;
6061 import net.sourceforge.plantuml.sequencediagram.NotePosition;
6162 import net.sourceforge.plantuml.sequencediagram.NoteType;
193194 // COMPRESSION
194195 TextBlock result = swinlanes;
195196 // result = new TextBlockCompressedOnY(CompressionMode.ON_Y, result);
196 // result = new TextBlockCompressedOnXorY(CompressionMode.ON_X, result);
197 result = new TextBlockCompressedOnXorY(CompressionMode.ON_X, result);
197198 result = new TextBlockCompressedOnXorY(CompressionMode.ON_Y, result);
198199 result = new TextBlockRecentred(result);
199200 final ISkinParam skinParam = getSkinParam();
200 result = new AnnotatedWorker(this, skinParam).addAdd(result);
201 result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder()).addAdd(result);
201202 // final Dimension2D dim = TextBlockUtils.getMinMax(result, fileFormatOption.getDefaultStringBounder())
202203 // .getDimension();
203204 final Dimension2D dim = result.getMinMax(fileFormatOption.getDefaultStringBounder()).getDimension();
388389 return CommandExecutionResult.ok();
389390 }
390391
391 public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor) {
392 public void startGroup(Display name, HtmlColor backColor, HtmlColor titleColor, HtmlColor borderColor,
393 USymbol type, double roundCorner) {
392394 manageSwimlaneStrategy();
393395 final InstructionGroup instructionGroup = new InstructionGroup(current(), name, backColor, titleColor,
394 swinlanes.getCurrentSwimlane(), borderColor, nextLinkRenderer());
396 swinlanes.getCurrentSwimlane(), borderColor, nextLinkRenderer(), type, roundCorner);
395397 current().add(instructionGroup);
396398 setCurrent(instructionGroup);
397399 }
7575 this.labelPositive = labelPositive;
7676 this.color = color;
7777 }
78
78
7979 public Collection<WeldingPoint> getWeldingPoints() {
8080 return ftile.getWeldingPoints();
8181 }
82
8382
8483 public void add(Instruction ins) {
8584 list.add(ins);
152151 return list.isOnlySingleStopOrSpot();
153152 }
154153
154 private LinkRendering special;
155
156 public void setSpecial(LinkRendering link) {
157 this.special = link;
158 }
159
160 public final LinkRendering getSpecial() {
161 return special;
162 }
163
155164 }
4343 import net.sourceforge.plantuml.activitydiagram3.ftile.vcompact.FtileWithNotes;
4444 import net.sourceforge.plantuml.cucadiagram.Display;
4545 import net.sourceforge.plantuml.graphic.HtmlColor;
46 import net.sourceforge.plantuml.graphic.USymbol;
4647 import net.sourceforge.plantuml.graphic.color.Colors;
4748 import net.sourceforge.plantuml.sequencediagram.NotePosition;
4849 import net.sourceforge.plantuml.sequencediagram.NoteType;
5556 private final HtmlColor borderColor;
5657 private final HtmlColor titleColor;
5758 private final LinkRendering linkRendering;
59 private final USymbol type;
5860
5961 private final Display test;
62 private final double roundCorner;
6063 private PositionedNote note = null;
6164
6265 public InstructionGroup(Instruction parent, Display test, HtmlColor backColor, HtmlColor titleColor,
63 Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering) {
66 Swimlane swimlane, HtmlColor borderColor, LinkRendering linkRendering, USymbol type, double roundCorner) {
6467 this.list = new InstructionList(swimlane);
68 this.type = type;
6569 this.linkRendering = linkRendering;
6670 this.parent = parent;
6771 this.test = test;
6872 this.borderColor = borderColor;
6973 this.backColor = backColor;
7074 this.titleColor = titleColor;
75 this.roundCorner = roundCorner;
7176 }
7277
7378 public void add(Instruction ins) {
7984 if (note != null) {
8085 tmp = new FtileWithNotes(tmp, Collections.singleton(note), factory.skinParam());
8186 }
82 return factory.createGroup(tmp, test, backColor, titleColor, null, borderColor);
87 return factory.createGroup(tmp, test, backColor, titleColor, null, borderColor, type, roundCorner);
8388 }
8489
8590 public Instruction getParent() {
127127 if (elseBranch != null) {
128128 return false;
129129 }
130 this.current.setInlinkRendering(nextLinkRenderer);
130 // this.current.setInlinkRendering(nextLinkRenderer);
131 this.current.setSpecial(nextLinkRenderer);
131132 this.current = new Branch(swimlane, whenThen, test, color, inlabel);
132133 this.thens.add(current);
133134 return true;
139140 if (elseBranch == null) {
140141 this.elseBranch = new Branch(swimlane, Display.NULL, Display.NULL, null, Display.NULL);
141142 }
143 this.elseBranch.setSpecial(nextLinkRenderer);
142144 this.current.setInlinkRendering(nextLinkRenderer);
143145 }
144146
148150 if (branch.getLast().kill() == false) {
149151 return false;
150152 }
151 if (elseBranch != null && elseBranch.getLast()!=null && elseBranch.getLast().kill() == false) {
153 if (elseBranch != null && elseBranch.getLast() != null && elseBranch.getLast().kill() == false) {
152154 return false;
153155 }
154156 return true;
4141 import net.sourceforge.plantuml.command.regex.RegexLeaf;
4242 import net.sourceforge.plantuml.command.regex.RegexResult;
4343 import net.sourceforge.plantuml.cucadiagram.Display;
44 import net.sourceforge.plantuml.graphic.USymbol;
4445
4546 public class CommandGroup3 extends SingleLineCommand2<ActivityDiagram3> {
4647
5859
5960 @Override
6061 protected CommandExecutionResult executeArg(ActivityDiagram3 diagram, RegexResult arg) {
61 diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null);
62 diagram.startGroup(Display.getWithNewlines(arg.get("NAME", 0)), null, null, null, USymbol.FRAME, 0);
6263 return CommandExecutionResult.ok();
6364 }
6465
4444 import net.sourceforge.plantuml.command.regex.RegexOptional;
4545 import net.sourceforge.plantuml.command.regex.RegexResult;
4646 import net.sourceforge.plantuml.cucadiagram.Display;
47 import net.sourceforge.plantuml.cucadiagram.Stereotype;
4748 import net.sourceforge.plantuml.graphic.HtmlColor;
4849 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
50 import net.sourceforge.plantuml.graphic.USymbol;
4951 import net.sourceforge.plantuml.graphic.color.ColorParser;
5052 import net.sourceforge.plantuml.graphic.color.ColorType;
5153 import net.sourceforge.plantuml.graphic.color.Colors;
5860
5961 static RegexConcat getRegexConcat() {
6062 return new RegexConcat(new RegexLeaf("^"), //
61 new RegexLeaf("partition"), //
63 new RegexLeaf("TYPE", "(partition|package|rectangle|card)"), //
6264 new RegexLeaf("[%s]+"), //
6365 new RegexOptional(//
6466 new RegexConcat( //
6971 new RegexConcat( //
7072 new RegexLeaf("[%s]+"), //
7173 color("BACK2").getRegex())), //
72 new RegexLeaf("[%s]*\\{?$"));
74 new RegexLeaf("[%s]*"), //
75 new RegexLeaf("STEREO", "(\\<{2}.*\\>{2})?"), //
76 new RegexLeaf("[%s]*"), //
77 new RegexLeaf("\\{?$"));
78 }
79
80 private USymbol getUSymbol(String type) {
81 if ("card".equalsIgnoreCase(type)) {
82 return USymbol.CARD;
83 }
84 if ("package".equalsIgnoreCase(type)) {
85 return USymbol.PACKAGE;
86 }
87 if ("rectangle".equalsIgnoreCase(type)) {
88 return USymbol.RECTANGLE;
89 }
90 return USymbol.FRAME;
91 }
92
93 private ColorParam getColorParamBorder(final USymbol symbol) {
94 if (symbol == USymbol.FRAME) {
95 return ColorParam.partitionBorder;
96 }
97 return symbol.getColorParamBorder();
98 }
99
100 private ColorParam getColorParamBack(final USymbol symbol) {
101 if (symbol == USymbol.FRAME) {
102 return ColorParam.partitionBackground;
103 }
104 return symbol.getColorParamBack();
73105 }
74106
75107 private static ColorParser color(String id) {
84116 final Colors colors = color(b1 == null ? "BACK2" : "BACK1").getColor(arg,
85117 diagram.getSkinParam().getIHtmlColorSet());
86118
87 final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBackground,
88 null, false);
119 final USymbol symbol = getUSymbol(arg.get("TYPE", 0));
120 final String stereo = arg.get("STEREO", 0);
121 final Stereotype stereotype = stereo == null ? null : new Stereotype(stereo);
122
123 final HtmlColor backColorInSkinparam = diagram.getSkinParam().getHtmlColor(getColorParamBack(symbol),
124 stereotype, false);
89125 final HtmlColor backColor;
90126 if (backColorInSkinparam == null) {
91127 backColor = colors.getColor(ColorType.BACK);
95131 final HtmlColor titleColor = colors.getColor(ColorType.HEADER);
96132
97133 // Warning : titleColor unused in FTileGroupW
98 HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(ColorParam.partitionBorder, null, false);
134 HtmlColor borderColor = diagram.getSkinParam().getHtmlColor(getColorParamBorder(symbol), stereotype, false);
99135 if (borderColor == null) {
100136 borderColor = HtmlColorUtils.BLACK;
101137 }
138 final double roundCorner = symbol.getSkinParameter().getRoundCorner(diagram.getSkinParam(), stereotype);
102139
103 diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor);
140 diagram.startGroup(Display.getWithNewlines(partitionTitle), backColor, titleColor, borderColor, symbol,
141 roundCorner);
104142
105143 return CommandExecutionResult.ok();
106144 }
145
107146 }
9797 }
9898
9999 public HorizontalAlignment arrowHorizontalAlignment() {
100 return skinParam.getHorizontalAlignment(AlignmentParam.arrowMessageAlignment, null);
100 return skinParam.getHorizontalAlignment(AlignmentParam.arrowMessageAlignment, null, false);
101101 }
102102
103103 private FtileGeometry cachedGeometry;
4747 import net.sourceforge.plantuml.cucadiagram.Display;
4848 import net.sourceforge.plantuml.graphic.HtmlColor;
4949 import net.sourceforge.plantuml.graphic.StringBounder;
50 import net.sourceforge.plantuml.graphic.USymbol;
5051 import net.sourceforge.plantuml.graphic.color.Colors;
5152
5253 public interface FtileFactory {
8889 public Ftile createParallel(Swimlane swimlane, List<Ftile> all, ForkStyle style, String label);
8990
9091 public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
91 HtmlColor borderColor);
92 HtmlColor borderColor, USymbol type, double roundCorner);
9293
9394 }
5454 import net.sourceforge.plantuml.graphic.Rainbow;
5555 import net.sourceforge.plantuml.graphic.StringBounder;
5656 import net.sourceforge.plantuml.graphic.TextBlock;
57 import net.sourceforge.plantuml.graphic.USymbol;
5758 import net.sourceforge.plantuml.graphic.color.Colors;
5859 import net.sourceforge.plantuml.skin.rose.Rose;
5960
166167 }
167168
168169 public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
169 HtmlColor borderColor) {
170 return factory.createGroup(list, name, backColor, titleColor, note, borderColor);
170 HtmlColor borderColor, USymbol type, double roundCorner) {
171 return factory.createGroup(list, name, backColor, titleColor, note, borderColor, type, roundCorner);
171172 }
172173
173174 public StringBounder getStringBounder() {
7575 skinParam, CreoleMode.FULL).createSheet(note);
7676 final SheetBlock2 sheetBlock2 = new SheetBlock2(new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()), this,
7777 new UStroke(1));
78 this.opale = new Opale(borderColor, noteBackgroundColor, sheetBlock2, skinParam.shadowing(), false);
78 this.opale = new Opale(borderColor, noteBackgroundColor, sheetBlock2, skinParam.shadowing(null), false);
7979
8080 // this.text = sheetBlock2;
8181
6464 if (note.getColors() != null) {
6565 skinParam = note.getColors().mute(skinParam);
6666 }
67 return new FtileNoteAlone(skinParam.shadowing(), note.getDisplay(), skinParam,
67 return new FtileNoteAlone(skinParam.shadowing(null), note.getDisplay(), skinParam,
6868 note.getType() == NoteType.NOTE, swimlane);
6969 }
7070 return FtileWithNoteOpale.create(ftile, notes, skinParam, true);
4343 import net.sourceforge.plantuml.activitydiagram3.ftile.FtileFactoryDelegator;
4444 import net.sourceforge.plantuml.cucadiagram.Display;
4545 import net.sourceforge.plantuml.graphic.HtmlColor;
46 import net.sourceforge.plantuml.graphic.USymbol;
4647 import net.sourceforge.plantuml.skin.rose.Rose;
4748
4849 public class FtileFactoryDelegatorCreateGroup extends FtileFactoryDelegator {
5556
5657 @Override
5758 public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
58 HtmlColor borderColor) {
59 HtmlColor borderColor, USymbol type, double roundCorner) {
5960 final HtmlColor arrowColor = rose.getHtmlColor(skinParam(), ColorParam.arrow);
60 Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor);
61 Ftile result = new FtileGroup(list, name, null, arrowColor, backColor, titleColor, skinParam(), borderColor,
62 type, roundCorner);
6163 if (note != null) {
6264 result = new FtileWithNotes(result, Collections.singleton(note), skinParam());
6365 }
7474 final Rainbow arrowColor = HtmlColorAndStyle.build(skinParam());
7575
7676 final FontConfiguration fcArrow = new FontConfiguration(skinParam(), FontParam.ARROW, null);
77 // .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
77
78 final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
79 : FontParam.ARROW;
80 final FontConfiguration fcTest = new FontConfiguration(skinParam(), testParam, null)
81 .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
82
7883 if (thens.size() > 1) {
7984 if (pragma.useVerticalIf()/* OptionFlags.USE_IF_VERTICAL */)
8085 return FtileIfLongVertical.create(swimlane, borderColor, backColor, arrowColor, getFactory(),
8186 conditionStyle, thens, elseBranch, fcArrow, topInlinkRendering, afterEndwhile);
8287 return FtileIfLongHorizontal.create(swimlane, borderColor, backColor, arrowColor, getFactory(),
83 conditionStyle, thens, elseBranch, fcArrow, topInlinkRendering, afterEndwhile);
88 conditionStyle, thens, elseBranch, fcArrow, topInlinkRendering, afterEndwhile, fcTest);
8489 }
85 final FontParam testParam = conditionStyle == ConditionStyle.INSIDE ? FontParam.ACTIVITY_DIAMOND
86 : FontParam.ARROW;
87 final FontConfiguration fcTest = new FontConfiguration(skinParam(), testParam, null)
88 .changeColor(fontColor(FontParam.ACTIVITY_DIAMOND));
89
9090 return ConditionalBuilder.create(swimlane, borderColor, backColor, arrowColor, getFactory(), conditionStyle,
9191 thens.get(0), elseBranch, skinParam(), getStringBounder(), fcArrow, fcTest);
9292 }
7676 private final HtmlColor borderColor;
7777 private final HtmlColor backColor;
7878 private final UStroke stroke;
79 private final USymbol type;
80 private final double roundCorner;
7981
8082 public FtileGroup(Ftile inner, Display title, Display displayNote, HtmlColor arrowColor, HtmlColor backColor,
81 HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor) {
83 HtmlColor titleColor, ISkinParam skinParam, HtmlColor borderColor, USymbol type, double roundCorner) {
8284 super(inner.skinParam());
85 this.roundCorner = roundCorner;
86 this.type = type;
8387 this.backColor = backColor == null ? HtmlColorUtils.WHITE : backColor;
8488 this.inner = FtileUtils.addHorizontalMargin(inner, 10);
8589 this.borderColor = borderColor == null ? HtmlColorUtils.BLACK : borderColor;
193197 final StringBounder stringBounder = ug.getStringBounder();
194198 final Dimension2D dimTotal = calculateDimension(stringBounder);
195199
196 final SymbolContext symbolContext = new SymbolContext(backColor, borderColor).withShadow(
197 skinParam().shadowing()).withStroke(stroke);
198 USymbol.FRAME.asBig(name, inner.skinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null),
200 // final double roundCorner = type.getSkinParameter().getRoundCorner(skinParam(), null);
201 final SymbolContext symbolContext = new SymbolContext(backColor, borderColor)
202 .withShadow(skinParam().shadowing(null)).withStroke(stroke).withCorner(roundCorner, 0);
203
204 type.asBig(name, inner.skinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false),
199205 TextBlockUtils.empty(0, 0), dimTotal.getWidth(), dimTotal.getHeight(), symbolContext).drawU(ug);
200206
201207 final Dimension2D dimHeaderNote = headerNote.calculateDimension(stringBounder);
4444 import java.util.Set;
4545
4646 import net.sourceforge.plantuml.Dimension2DDouble;
47 import net.sourceforge.plantuml.ISkinParam;
4748 import net.sourceforge.plantuml.activitydiagram3.Branch;
4849 import net.sourceforge.plantuml.activitydiagram3.LinkRendering;
4950 import net.sourceforge.plantuml.activitydiagram3.ftile.AbstractConnection;
141142
142143 static Ftile create(Swimlane swimlane, HtmlColor borderColor, HtmlColor backColor, Rainbow arrowColor,
143144 FtileFactory ftileFactory, ConditionStyle conditionStyle, List<Branch> thens, Branch branch2,
144 FontConfiguration fc, LinkRendering topInlinkRendering, LinkRendering afterEndwhile) {
145 FontConfiguration fcArrow, LinkRendering topInlinkRendering, LinkRendering afterEndwhile,
146 FontConfiguration fcTest) {
145147 if (afterEndwhile == null) {
146148 throw new IllegalArgumentException();
147149 }
156158 List<Ftile> diamonds = new ArrayList<Ftile>();
157159 List<Double> inlabelSizes = new ArrayList<Double>();
158160 for (Branch branch : thens) {
159 final TextBlock tb1 = branch.getLabelPositive().create(fc, HorizontalAlignment.LEFT,
161 final TextBlock tb1 = branch.getLabelPositive().create(fcArrow, HorizontalAlignment.LEFT,
160162 ftileFactory.skinParam());
161 final TextBlock tbTest = branch.getLabelTest().create(fc, HorizontalAlignment.LEFT,
163 final TextBlock tbTest = branch.getLabelTest().create(fcTest, HorizontalAlignment.LEFT,
162164 ftileFactory.skinParam());
163165 final HtmlColor diamondColor = branch.getColor() == null ? backColor : branch.getColor();
164166
168170 if (Display.isNull(branch.getInlabel())) {
169171 inlabelSizes.add(0.0);
170172 } else {
171 tbInlabel = branch.getInlabel().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
173 tbInlabel = branch.getInlabel().create(fcArrow, HorizontalAlignment.LEFT, ftileFactory.skinParam());
172174 inlabelSizes.add(tbInlabel.calculateDimension(ftileFactory.getStringBounder()).getWidth());
173175 diamond = diamond.withWest(tbInlabel);
174176 }
176178 diamonds.add(diamond);
177179 }
178180
179 final TextBlock tb2 = branch2.getLabelPositive().create(fc, HorizontalAlignment.LEFT, ftileFactory.skinParam());
181 final TextBlock tb2 = branch2.getLabelPositive().create(fcArrow, HorizontalAlignment.LEFT,
182 ftileFactory.skinParam());
180183 final int last = diamonds.size() - 1;
181184 diamonds.set(last, ((FtileDiamondInside2) diamonds.get(last)).withEast(tb2));
182185
192195 final Rainbow rainbowIn = FtileIfWithLinks.getInColor(thens.get(i), arrowColor);
193196 final Branch branch = thens.get(i);
194197 final Rainbow rainbowOut = branch.getInlinkRenderingColorAndStyle();
198 TextBlock out2 = null;
199 if (branch.getSpecial() != null) {
200 out2 = branch.getSpecial().getDisplay()
201 .create(fcTest, HorizontalAlignment.LEFT, ftileFactory.skinParam());
202 }
195203 conns.add(result.new ConnectionVerticalIn(diam, ftile, rainbowIn.size() == 0 ? arrowColor : rainbowIn));
196 conns.add(result.new ConnectionVerticalOut(ftile, rainbowOut.size() == 0 ? arrowColor : rainbowOut));
204 conns.add(result.new ConnectionVerticalOut(ftile, rainbowOut.size() == 0 ? arrowColor : rainbowOut, out2));
197205 }
198206
199207 final Rainbow topInColor = topInlinkRendering.getRainbow(arrowColor);
203211 conns.add(result.new ConnectionHorizontal(diam1, diam2, arrowColor));
204212 }
205213 conns.add(result.new ConnectionIn(topInColor));
214 TextBlock out2 = null;
215 if (branch2.getSpecial() != null) {
216 out2 = branch2.getSpecial().getDisplay().create(fcTest, HorizontalAlignment.LEFT, ftileFactory.skinParam());
217 }
218
206219 conns.add(result.new ConnectionLastElseIn(FtileIfWithLinks.getInColor(branch2, arrowColor)));
207 conns.add(result.new ConnectionLastElseOut(arrowColor));
220 conns.add(result.new ConnectionLastElseOut(arrowColor, out2));
208221 final Rainbow horizontalOutColor = afterEndwhile.getRainbow(arrowColor);
209222 conns.add(result.new ConnectionHline(horizontalOutColor));
210223 // conns.add(result.new ConnectionHline(HtmlColorUtils.BLUE));
211224
212225 return FtileUtils.addConnection(result, conns);
226 }
227
228 static private TextBlock getSpecial(Branch branch, FontConfiguration fcTest, ISkinParam skinParam) {
229 if (branch.getSpecial() == null) {
230 return null;
231 }
232 return branch.getSpecial().getDisplay().create(fcTest, HorizontalAlignment.LEFT, skinParam);
213233 }
214234
215235 class ConnectionHorizontal extends AbstractConnection {
307327 class ConnectionLastElseOut extends AbstractConnection {
308328
309329 private final Rainbow arrowColor;
310
311 public ConnectionLastElseOut(Rainbow arrowColor) {
330 private final TextBlock out2;
331
332 public ConnectionLastElseOut(Rainbow arrowColor, TextBlock out2) {
312333 super(tile2, null);
313334 this.arrowColor = arrowColor;
335 this.out2 = out2;
314336 }
315337
316338 public void drawU(UGraphic ug) {
325347 final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
326348
327349 final Snake snake = new Snake(arrowHorizontalAlignment(), arrowColor, Arrows.asToDown());
350 snake.setLabel(out2);
328351 snake.addPoint(p1);
329352 snake.addPoint(p2);
330353 ug.draw(snake);
383406 class ConnectionVerticalOut extends AbstractConnection {
384407
385408 private final Rainbow color;
386
387 public ConnectionVerticalOut(Ftile tile, Rainbow color) {
409 private final TextBlock out2;
410
411 public ConnectionVerticalOut(Ftile tile, Rainbow color, TextBlock out2) {
388412 super(tile, null);
389413 this.color = color;
414 this.out2 = out2;
390415 }
391416
392417 public void drawU(UGraphic ug) {
399424 final Point2D p2 = new Point2D.Double(p1.getX(), totalHeight);
400425
401426 final Snake snake = new Snake(arrowHorizontalAlignment(), color, Arrows.asToDown());
427 snake.setLabel(out2);
402428 snake.addPoint(p1);
403429 snake.addPoint(p2);
404430 ug.draw(snake);
476502 return Collections.unmodifiableList(result);
477503 }
478504
479
480505 @Override
481506 public UTranslate getTranslateFor(Ftile child, StringBounder stringBounder) {
482507 if (child == tile2) {
104104 final Sheet sheet = new CreoleParser(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
105105 skinParam, CreoleMode.FULL).createSheet(note);
106106 final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()), this, new UStroke(1));
107 opale = new Opale(borderColor, noteBackgroundColor, text, skinParam.shadowing(), false);
107 opale = new Opale(borderColor, noteBackgroundColor, text, skinParam.shadowing(null), false);
108108
109109 }
110110
521521 final FtileGeometry dimDiamond1 = diamond1.calculateDimension(stringBounder);
522522 final double half = (dimDiamond1.getOutY() - dimDiamond1.getInY()) / 2;
523523 final double y1 = Math.max(3 * half, 4 * Diamond.diamondHalfSize);
524 final double x1 = getTranslateForWhile(stringBounder).getDx() - xDeltaBecauseSpecial(stringBounder);
524 final double xWhile = getTranslateForWhile(stringBounder).getDx() - Diamond.diamondHalfSize;
525 final double xDiamond = getTranslateDiamond1(stringBounder).getDx();
526 // final double x1 = xWhile - xDeltaBecauseSpecial(stringBounder);
527 final double x1 = Math.min(xWhile, xDiamond) - xDeltaBecauseSpecial(stringBounder);
528 // final double x1 = getTranslateForWhile(stringBounder).getDx() - dimDiamond1.getWidth()
529 // - xDeltaBecauseSpecial(stringBounder);
525530 return new UTranslate(x1, y1);
526531 }
527532
134134
135135 final Sheet sheet = new CreoleParser(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
136136 skinParam, CreoleMode.FULL).createSheet(note.getDisplay());
137 final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding()),
137 final TextBlock text = new SheetBlock2(new SheetBlock1(sheet, skinParam.wrapWidth() , skinParam.getPadding()),
138138 this, new UStroke(1));
139 opale = new Opale(borderColor, noteBackgroundColor, text, skinParam.shadowing(), withLink);
139 opale = new Opale(borderColor, noteBackgroundColor, text, skinParam.shadowing(null), withLink);
140140
141141 }
142142
115115 }
116116 }, new UStroke());
117117
118 final Opale opale = new Opale(borderColor, noteBackgroundColor, sheet2, skinParam.shadowing(), false);
118 final Opale opale = new Opale(borderColor, noteBackgroundColor, sheet2, skinParam.shadowing(null), false);
119119 final TextBlock opaleMarged = TextBlockUtils.withMargin(opale, 10, 10);
120120 if (note.getNotePosition() == NotePosition.LEFT) {
121121 if (left == null) {
7777 for (Ftile tmp : getList()) {
7878 final FtileGeometry dim = tmp.calculateDimension(getStringBounder());
7979 if (first == 0) {
80 first = dim.getLeft();
80 first = x + dim.getLeft();
8181 }
8282 last = x + dim.getLeft();
8383 conns.add(new ConnectionIn(thin, tmp, x, tmp.getInLinkRendering().getRainbow(
122122 final FtileGeometry dim = tmp.calculateDimension(getStringBounder());
123123 if (dim.hasPointOut()) {
124124 if (first == 0) {
125 first = dim.getLeft();
125 first = x + dim.getLeft();
126126 }
127127 last = x + dim.getLeft();
128128 }
132132 }
133133 if (last < geom.getLeft()) {
134134 last = geom.getLeft();
135 }
136 if (first > geom.getLeft()) {
137 first = geom.getLeft();
135138 }
136139 ((FtileThinSplit) out).setGeom(first, last, geom.getWidth());
137140 result = FtileUtils.addConnection(result, conns);
6262 import net.sourceforge.plantuml.cucadiagram.Display;
6363 import net.sourceforge.plantuml.graphic.HtmlColor;
6464 import net.sourceforge.plantuml.graphic.StringBounder;
65 import net.sourceforge.plantuml.graphic.USymbol;
6566 import net.sourceforge.plantuml.graphic.color.Colors;
6667 import net.sourceforge.plantuml.skin.rose.Rose;
6768 import net.sourceforge.plantuml.ugraphic.UFont;
148149 }
149150
150151 public Ftile createGroup(Ftile list, Display name, HtmlColor backColor, HtmlColor titleColor, PositionedNote note,
151 HtmlColor borderColor) {
152 HtmlColor borderColor, USymbol type, double roundCorner) {
152153 return list;
153154 }
154155
9191
9292 public void drawU(UGraphic ug) {
9393 final URectangle rect = new URectangle(width, height, 5, 5);
94 if (skinParam().shadowing()) {
94 if (skinParam().shadowing(null)) {
9595 rect.setDeltaShadow(3);
9696 }
9797 ug.apply(new UChangeColor(colorBar)).apply(new UChangeBackColor(colorBar)).draw(rect);
139139 final Dimension2D dimTotal = calculateDimension(ug.getStringBounder());
140140 final double widthTotal = dimTotal.getWidth();
141141 final double heightTotal = dimTotal.getHeight();
142 final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, skinParam().shadowing());
142 final UDrawable rect = style.getUDrawable(widthTotal, heightTotal, skinParam().shadowing(null));
143143
144144 final HtmlColor borderColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBorder, null);
145145 final HtmlColor backColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBackground, null);
9494 yTheoricalPosition = Math.round(yTheoricalPosition);
9595
9696 final UEllipse circle = new UEllipse(SIZE, SIZE);
97 if (skinParam().shadowing()) {
97 if (skinParam().shadowing(null)) {
9898 circle.setDeltaShadow(3);
9999 }
100100 ug = ug.apply(new UChangeColor(backColor));
9999 final HtmlColor backColor = SkinParamUtils.getColor(skinParam(), ColorParam.activityBackground, null);
100100
101101 final UEllipse circle = new UEllipse(SIZE, SIZE);
102 if (skinParam().shadowing()) {
102 if (skinParam().shadowing(null)) {
103103 circle.setDeltaShadow(3);
104104 }
105105 ug.apply(new UChangeColor(borderColor)).apply(new UChangeBackColor(backColor)).apply(getThickness())
8585
8686 public void drawU(UGraphic ug) {
8787 final UEllipse circle = new UEllipse(SIZE, SIZE);
88 if (skinParam().shadowing()) {
88 if (skinParam().shadowing(null)) {
8989 circle.setDeltaShadow(3);
9090 }
9191 ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor)).draw(circle);
9191 yTheoricalPosition = Math.round(yTheoricalPosition);
9292
9393 final UEllipse circle = new UEllipse(SIZE, SIZE);
94 if (skinParam().shadowing()) {
94 if (skinParam().shadowing(null)) {
9595 circle.setDeltaShadow(3);
9696 }
9797 ug.apply(new UChangeColor(backColor)).apply(new UChangeBackColor(null))
9999
100100 final double delta = 4;
101101 final UEllipse circleSmall = new UEllipse(SIZE - delta * 2, SIZE - delta * 2);
102 if (skinParam().shadowing()) {
102 if (skinParam().shadowing(null)) {
103103 circleSmall.setDeltaShadow(3);
104104 }
105105 ug.apply(new UChangeColor(null)).apply(new UChangeBackColor(backColor))
129129 final double suppY1 = north.calculateDimension(ug.getStringBounder()).getHeight();
130130 ug = ug.apply(new UTranslate(0, suppY1));
131131 ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor))
132 .draw(Diamond.asPolygon(skinParam().shadowing()));
132 .draw(Diamond.asPolygon(skinParam().shadowing(null)));
133133 // final Dimension2D dimNorth = north.calculateDimension(ug.getStringBounder());
134134 north.drawU(ug.apply(new UTranslate(Diamond.diamondHalfSize * 1.5, -suppY1)));
135135
113113 final Dimension2D dimLabel = label.calculateDimension(stringBounder);
114114 final Dimension2D dimTotal = calculateDimensionInternal(stringBounder);
115115 ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
116 ug.draw(Diamond.asPolygonFoo1(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
116 ug.draw(Diamond.asPolygonFoo1(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
117117
118118 north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
119119
130130 final Dimension2D dimLabel = label.calculateDimension(stringBounder);
131131 final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
132132 ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
133 ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
133 ug.draw(Diamond.asPolygon(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
134134
135135 north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
136136 south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
119119 final Dimension2D dimLabel = label.calculateDimension(stringBounder);
120120 final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
121121 ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
122 ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
122 ug.draw(Diamond.asPolygon(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
123123
124124 north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
125125 south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
121121 final Dimension2D dimLabel = label.calculateDimension(stringBounder);
122122 final Dimension2D dimTotal = calculateDimensionAlone(stringBounder);
123123 ug = ug.apply(new UChangeColor(borderColor)).apply(getThickness()).apply(new UChangeBackColor(backColor));
124 ug.draw(Diamond.asPolygon(skinParam().shadowing(), dimTotal.getWidth(), dimTotal.getHeight()));
124 ug.draw(Diamond.asPolygon(skinParam().shadowing(null), dimTotal.getWidth(), dimTotal.getHeight()));
125125
126126 north.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
127127 south.drawU(ug.apply(new UTranslate(4 + dimTotal.getWidth() / 2, dimTotal.getHeight())));
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.ant;
36
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.IOException;
40 import java.io.PrintWriter;
41 import java.util.ArrayList;
42 import java.util.List;
43 import java.util.zip.ZipEntry;
44 import java.util.zip.ZipInputStream;
45
46 import org.apache.tools.ant.BuildException;
47 import org.apache.tools.ant.Task;
48 import org.apache.tools.ant.types.FileList;
49 import org.apache.tools.ant.types.FileSet;
50
51 public class CheckZipTask extends Task {
52
53 private String zipfile = null;
54 private List<FileSet> filesets = new ArrayList<FileSet>();
55 private List<FileList> filelists = new ArrayList<FileList>();
56
57 /**
58 * Add a set of files to touch
59 */
60 public void addFileset(FileSet set) {
61 filesets.add(set);
62 }
63
64 /**
65 * Add a filelist to touch
66 */
67 public void addFilelist(FileList list) {
68 filelists.add(list);
69 }
70
71 // The method executing the task
72 @Override
73 public void execute() throws BuildException {
74
75 myLog("Check " + zipfile);
76
77 try {
78 loadZipFile(new File(zipfile));
79 for (FileList fileList : filelists) {
80 manageFileList(fileList);
81 }
82 } catch (IOException e) {
83 e.printStackTrace();
84 throw new BuildException(e.toString());
85 }
86 }
87
88 private void manageFileList(FileList fileList) {
89 boolean error = false;
90 final String[] srcFiles = fileList.getFiles(getProject());
91 for (String s : srcFiles) {
92 if (isPresentInFile(s) == false) {
93 myLog("Missing " + s);
94 error = true;
95 }
96 }
97 if (error) {
98 throw new BuildException("Some entries are missing in the zipfile");
99 }
100 }
101
102 private boolean isPresentInFile(String s) {
103 return entries.contains(s);
104 }
105
106 private final List<String> entries = new ArrayList<String>();
107
108 private void loadZipFile(File file) throws IOException {
109
110 this.entries.clear();
111 final PrintWriter pw = new PrintWriter("tmp.txt");
112 final ZipInputStream zis = new ZipInputStream(new FileInputStream(file));
113 ZipEntry ze = zis.getNextEntry();
114
115 while (ze != null) {
116 final String fileName = ze.getName();
117 this.entries.add(fileName);
118 if (fileName.endsWith("/") == false) {
119 pw.println("<file name=\"" + fileName + "\" />");
120 }
121 ze = zis.getNextEntry();
122 }
123 pw.close();
124 zis.close();
125 }
126
127 private synchronized void myLog(String s) {
128 this.log(s);
129 }
130
131 public void setZipfile(String s) {
132 this.zipfile = s;
133 }
134
135 }
4646 import net.sourceforge.plantuml.classdiagram.command.CommandCreateElementFull2.Mode;
4747 import net.sourceforge.plantuml.classdiagram.command.CommandDiamondAssociation;
4848 import net.sourceforge.plantuml.classdiagram.command.CommandHideShow2;
49 import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificClass;
50 import net.sourceforge.plantuml.classdiagram.command.CommandHideShowSpecificStereotype;
5149 import net.sourceforge.plantuml.classdiagram.command.CommandImport;
5250 import net.sourceforge.plantuml.classdiagram.command.CommandLayoutNewLine;
5351 import net.sourceforge.plantuml.classdiagram.command.CommandLinkClass;
5050 private static RegexConcat getRegexConcat() {
5151
5252 return new RegexConcat(new RegexLeaf("^"), //
53 new RegexLeaf("allow_mixing"), //
53 new RegexLeaf("allow_?mixing"), //
5454 new RegexLeaf("$"));
5555 }
5656
7474 private static RegexConcat getRegexConcat() {
7575 return new RegexConcat(new RegexLeaf("^"), //
7676 new RegexLeaf("TYPE", //
77 "(interface|enum|annotation|abstract[%s]+class|abstract|class|entity|circle)[%s]+"), //
77 "(interface|enum|annotation|abstract[%s]+class|abstract|class|entity|circle|diamond)[%s]+"), //
7878 new RegexOr(//
7979 new RegexConcat(//
8080 new RegexLeaf("DISPLAY1", DISPLAY_WITH_GENERIC), //
112112 protected CommandExecutionResult executeArg(ClassDiagram diagram, RegexResult arg) {
113113 if (mode == Mode.NORMAL_KEYWORD && diagram.isAllowMixing() == false) {
114114 return CommandExecutionResult
115 .error("Use 'allow_mixing' if you want to mix classes and other UML elements.");
115 .error("Use 'allowmixing' if you want to mix classes and other UML elements.");
116116 }
117117 String codeRaw = arg.getLazzy("CODE", 0);
118118 final String displayRaw = arg.getLazzy("DISPLAY", 0);
4949
5050 static RegexConcat getRegexConcat() {
5151 return new RegexConcat(new RegexLeaf("^"), //
52 new RegexLeaf("COMMAND", "(hide|show)"), //
52 new RegexLeaf("COMMAND", "(hide|hide-class|show|show-class)"), //
5353 new RegexLeaf("[%s]+"), //
5454 new RegexLeaf("WHAT", "(.+)"), //
5555 new RegexLeaf("$"));
5858 @Override
5959 protected CommandExecutionResult executeArg(CucaDiagram diagram, RegexResult arg) {
6060
61 final boolean show = arg.get("COMMAND", 0).equalsIgnoreCase("show");
61 final char tmp = arg.get("COMMAND", 0).charAt(0);
62 final boolean show = tmp == 's' || tmp == 'S';
6263 final String what = arg.get("WHAT", 0).trim();
6364 diagram.hideOrShow2(what, show);
6465 return CommandExecutionResult.ok();
101101 }
102102
103103 private String clean(String s) {
104 s = s.replace("\0", "");
104 // s = s.replace("\0", "");
105105 s = StringUtils.trin(s);
106106 s = clean1(s);
107107 s = s.replaceAll("@enduml[^\\n\\r]*", "");
4949 }
5050
5151 private String clean2(String s) {
52 s = s.replace("\0", "");
52 // s = s.replace("\0", "");
5353 s = StringUtils.trin(s);
54 s = s.replace("\r", "").replaceAll("\n+$", "");
54 // s = s.replace("\r", "").replaceAll("\n+$", "");
5555 if (s.startsWith("@start")) {
5656 return s;
5757 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.command;
36
37 import java.util.List;
38
39 import net.sourceforge.plantuml.UmlDiagram;
40 import net.sourceforge.plantuml.cucadiagram.Display;
41
42 public class CommandMainframe extends SingleLineCommand<UmlDiagram> {
43
44 public CommandMainframe() {
45 super("(?i)^mainframe(?:[%s]*:[%s]*|[%s]+)(.*[\\p{L}0-9_.].*)$");
46 }
47
48 @Override
49 protected CommandExecutionResult executeArg(UmlDiagram diagram, List<String> arg) {
50 final Display label = Display.getWithNewlines(arg.get(0));
51 diagram.setMainFrame(label);
52 return CommandExecutionResult.ok();
53 }
54 }
7878 if (alignment == null) {
7979 alignment = HorizontalAlignment.CENTER;
8080 }
81 diagram.setLegend(DisplayPositionned.single(strings, alignment, valignment));
81 diagram.setLegend(DisplayPositionned.single(strings.replaceBackslashT(), alignment, valignment));
8282 return CommandExecutionResult.ok();
8383 }
8484 return CommandExecutionResult.error("No legend defined");
5656 lines = lines.removeEmptyColumns();
5757 final Display strings = lines.toDisplay();
5858 if (strings.size() > 0) {
59 diagram.setTitle(DisplayPositionned.single(strings, HorizontalAlignment.CENTER, VerticalAlignment.TOP));
59 diagram.setTitle(DisplayPositionned.single(strings.replaceBackslashT(), HorizontalAlignment.CENTER, VerticalAlignment.TOP));
6060 return CommandExecutionResult.ok();
6161 }
6262 return CommandExecutionResult.error("No title defined");
5252 system.getPragma().define(name, value);
5353 if (name.equalsIgnoreCase("graphviz_dot") && value.equalsIgnoreCase("jdot")) {
5454 system.setUseJDot(true);
55 } else if (name.equalsIgnoreCase("graphviz_dot")) {
56 system.setDotExecutable(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value));
5755 }
56 // else if (name.equalsIgnoreCase("graphviz_dot") && OptionFlags.ALLOW_INCLUDE) {
57 // final String cmd = StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(value);
58 // if (cmd.toLowerCase().endsWith("dot") || cmd.toLowerCase().endsWith("dot.exe")) {
59 // system.setDotExecutable(cmd);
60 // }
61 // }
5862 return CommandExecutionResult.ok();
5963 }
6064
5050 import net.sourceforge.plantuml.command.regex.RegexConcat;
5151 import net.sourceforge.plantuml.command.regex.RegexLeaf;
5252 import net.sourceforge.plantuml.command.regex.RegexResult;
53 import net.sourceforge.plantuml.preproc.FileWithSuffix;
5354 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
5455 import net.sourceforge.plantuml.ugraphic.sprite.SpriteImage;
5556 import net.sourceforge.plantuml.ugraphic.sprite.SpriteSvg;
9091 final String name = src.substring(idx + 1);
9192 sprite = getImageFromZip(f, name);
9293 if (sprite == null) {
93 return CommandExecutionResult.error("No image " + name + " in " + f.getAbsolutePath());
94 return CommandExecutionResult.error("No image " + name + " in " + FileWithSuffix.getFileName(f));
9495 }
9596 } else {
9697 final File f = FileSystem.getInstance().getFile(src);
6666 }
6767
6868 final public Diagram createSystem(UmlSource source) {
69 source = source.removeInitialSkinparam();
6970 final IteratorCounter2 it = source.iterator2();
7071 final CharSequence2 startLine = it.next();
7172 P system = init(startLine.toString2());
8788 }
8889 system = executeLine(system, s.toString2());
8990 if (system == null) {
90 final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?",
91 /* it.currentNum() - 1, */s.getLocation());
91 final ErrorUml err = new ErrorUml(ErrorUmlType.SYNTAX_ERROR, "Syntax Error?", s.getLocation());
9292 return new PSystemError(source, err, null);
9393 }
9494 }
208208 // cmds.add(new CommandMultilinesComment());
209209 cmds.add(new CommandPragma());
210210 cmds.add(new CommandTitle());
211 cmds.add(new CommandMainframe());
211212 cmds.add(new CommandCaption());
212213 cmds.add(new CommandMultilinesTitle());
213214 cmds.add(new CommandMultilinesLegend());
5050 import net.sourceforge.plantuml.command.regex.RegexConcat;
5151 import net.sourceforge.plantuml.command.regex.RegexLeaf;
5252 import net.sourceforge.plantuml.command.regex.RegexResult;
53 import net.sourceforge.plantuml.cucadiagram.Display;
5354 import net.sourceforge.plantuml.cucadiagram.Stereotype;
5455 import net.sourceforge.plantuml.graphic.color.ColorParser;
5556 import net.sourceforge.plantuml.graphic.color.ColorType;
135136
136137 if (strings.size() > 0) {
137138 final boolean tryMerge = arg.get("VMERGE", 0) != null;
138 final Note note = new Note(p, position, strings.toDisplay());
139 final Display display = diagram.manageVariable(strings.toDisplay());
140 final Note note = new Note(p, position, display);
139141 Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
140142 final String stereotypeString = arg.get("STEREO", 0);
141143 if (stereotypeString != null) {
3737 import net.sourceforge.plantuml.utils.StartUtils;
3838
3939 public enum DiagramType {
40 UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, UNKNOWN;
40 UML, BPM, DITAA, DOT, PROJECT, JCCKIT, SALT, FLOW, CREOLE, JUNGLE, CUTE, MATH, LATEX, DEFINITION, GANTT, NW, UNKNOWN;
4141
4242 static public DiagramType getTypeFromArobaseStart(String s) {
4343 s = s.toLowerCase();
8989 if (StartUtils.startsWithSymbolAnd("startgantt", s)) {
9090 return GANTT;
9191 }
92 if (StartUtils.startsWithSymbolAnd("startnwdiag", s)) {
93 return NW;
94 }
9295 return UNKNOWN;
9396 }
9497 }
3535 package net.sourceforge.plantuml.core;
3636
3737 import java.util.ArrayList;
38 import java.util.Collections;
3938 import java.util.List;
4039 import java.util.regex.Matcher;
4140 import java.util.regex.Pattern;
6463 */
6564 final public class UmlSource {
6665
67 final private List<String> source;
68 final private List<CharSequence2> source2;
69
70 // final private int startLine;
71 // final private LineLocation startLocation;
66 final private List<CharSequence2> source;
67
68 public UmlSource removeInitialSkinparam() {
69 if (hasInitialSkinparam(source) == false) {
70 return this;
71 }
72 final List<CharSequence2> copy = new ArrayList<CharSequence2>(source);
73 while (hasInitialSkinparam(copy)) {
74 copy.remove(1);
75 }
76 return new UmlSource(copy);
77 }
78
79 public boolean containsIgnoreCase(String searched) {
80 for (CharSequence2 s : source) {
81 if (StringUtils.goLowerCase(s.toString()).contains(searched)) {
82 return true;
83 }
84 }
85 return false;
86 }
87
88 private static boolean hasInitialSkinparam(final List<CharSequence2> copy) {
89 return copy.size() > 1 && (copy.get(1).startsWith("skinparam ") || copy.get(1).startsWith("skinparamlocked "));
90 }
91
92 private UmlSource(List<CharSequence2> source) {
93 this.source = source;
94 }
7295
7396 /**
7497 * Build the source from a text.
7598 *
76 * @param source
99 * @param data
77100 * the source of the diagram
78101 * @param checkEndingBackslash
79102 * <code>true</code> if an ending backslash means that a line has to be collapsed with the following one.
80 * @param startLine
81 */
82 public UmlSource(List<CharSequence2> source, boolean checkEndingBackslash, int startLine) {
83 // this.startLocation = source.get(0).getLocation();
84 // this.startLine = startLine;
85 final List<String> tmp = new ArrayList<String>();
86 final List<CharSequence2> tmp2 = new ArrayList<CharSequence2>();
103 */
104 public UmlSource(List<CharSequence2> data, boolean checkEndingBackslash) {
105 this(new ArrayList<CharSequence2>());
87106
88107 if (checkEndingBackslash) {
89108 final StringBuilder pending = new StringBuilder();
90 for (CharSequence2 cs : source) {
109 for (CharSequence2 cs : data) {
91110 final String s = cs.toString2();
92111 if (StringUtils.endsWithBackslash(s)) {
93112 pending.append(s.substring(0, s.length() - 1));
94113 } else {
95114 pending.append(s);
96 tmp.add(pending.toString());
97 tmp2.add(new CharSequence2Impl(pending.toString(), cs.getLocation()));
115 this.source.add(new CharSequence2Impl(pending.toString(), cs.getLocation()));
98116 pending.setLength(0);
99117 }
100118 }
101119 } else {
102 for (CharSequence2 s : source) {
103 tmp.add(s.toString2());
104 tmp2.add(s);
105 }
106 }
107 this.source = Collections.unmodifiableList(tmp);
108 this.source2 = Collections.unmodifiableList(tmp2);
120 this.source.addAll(data);
121 }
109122 }
110123
111124 /**
114127 * @return the type of the diagram.
115128 */
116129 public DiagramType getDiagramType() {
117 return DiagramType.getTypeFromArobaseStart(source.get(0));
130 return DiagramType.getTypeFromArobaseStart(source.get(0).toString2());
118131 }
119132
120133 /**
123136 * @return a iterator that allow counting line number.
124137 */
125138 public IteratorCounter2 iterator2() {
126 return new IteratorCounter2Impl(source2);
139 return new IteratorCounter2Impl(source);
127140 }
128141
129142 /**
133146 */
134147 public String getPlainString() {
135148 final StringBuilder sb = new StringBuilder();
136 for (String s : source) {
149 for (CharSequence2 s : source) {
137150 sb.append(s);
138151 sb.append('\r');
139152 sb.append(BackSlash.CHAR_NEWLINE);
152165 return h;
153166 }
154167
155 /**
156 * Return a specific line of the diagram description.
157 *
158 * @param n
159 * line number, starting at 0
160 * @return
161 */
162 private String getLine(int n) {
163 if (n < 0 || n >= source.size()) {
164 return "";
165 }
166 return source.get(n);
167 }
168
169168 public String getLine(LineLocation n) {
170 for (CharSequence2 s : source2) {
169 for (CharSequence2 s : source) {
171170 if (s.getLocation().compareTo(n) == 0) {
172171 return s.toString();
173172 }
190189 * @return <code>true<code> if the diagram does not contain information.
191190 */
192191 public boolean isEmpty() {
193 for (String s : source) {
192 for (CharSequence2 s : source) {
194193 if (StartUtils.isArobaseStartDiagram(s)) {
195194 continue;
196195 }
197196 if (StartUtils.isArobaseEndDiagram(s)) {
198197 continue;
199198 }
200 if (s.matches("\\s*'.*")) {
199 if (s.toString().matches("\\s*'.*")) {
201200 continue;
202201 }
203202 if (StringUtils.trin(s).length() != 0) {
214213 */
215214 public Display getTitle() {
216215 final Pattern2 p = MyPattern.cmpile("(?i)^[%s]*title[%s]+(.+)$");
217 for (String s : source) {
216 for (CharSequence2 s : source) {
218217 final Matcher2 m = p.matcher(s);
219218 final boolean ok = m.matches();
220219 if (ok) {
237236 return null;
238237 }
239238
240 // public final int getStartLine() {
241 // return startLine;
242 // }
243239 }
126126 // }
127127 //
128128 private Diagram getSystem() throws IOException, InterruptedException {
129 final BlockUml blockUml = new BlockUml(lines2, 0, Defines.createEmpty());
129 final BlockUml blockUml = new BlockUml(lines2, Defines.createEmpty());
130130 return blockUml.getDiagram();
131131 }
132132
3434 */
3535 package net.sourceforge.plantuml.creole;
3636
37 import java.awt.Color;
3738 import java.awt.geom.Dimension2D;
3839 import java.awt.image.BufferedImage;
3940 import java.io.ByteArrayInputStream;
5051 import net.sourceforge.plantuml.FileSystem;
5152 import net.sourceforge.plantuml.FileUtils;
5253 import net.sourceforge.plantuml.code.Base64Coder;
54 import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
55 import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
5356 import net.sourceforge.plantuml.graphic.FontConfiguration;
5457 import net.sourceforge.plantuml.graphic.ImgValign;
5558 import net.sourceforge.plantuml.graphic.StringBounder;
6770 private AtomImg(BufferedImage image, double scale) {
6871 this.image = image;
6972 this.scale = scale;
73 }
74
75 public static Atom createQrcode(String flash, double scale) {
76 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
77 BufferedImage im = utils.exportFlashcode(flash, Color.BLACK, Color.WHITE);
78 if (im == null) {
79 im = new BufferedImage(10, 10, BufferedImage.TYPE_INT_RGB);
80 }
81 return new AtomImg(new UImage(im).scaleNearestNeighbor(scale).getImage(), 1);
7082 }
7183
7284 public static Atom create(String src, final ImgValign valign, final int vspace, final double scale) {
157169
158170 public void drawU(UGraphic ug) {
159171 // final double h = calculateDimension(ug.getStringBounder()).getHeight();
160 ug.draw(new UImage(image).scale(scale * ug.dpiFactor()));
172 ug.draw(new UImage(image).scale(scale));
161173 // tileImage.drawU(ug.apply(new UTranslate(0, -h)));
162174 }
163175
4444 import net.sourceforge.plantuml.graphic.HtmlColorSimple;
4545 import net.sourceforge.plantuml.graphic.StringBounder;
4646 import net.sourceforge.plantuml.math.ScientificEquationSafe;
47 import net.sourceforge.plantuml.ugraphic.ColorMapper;
4748 import net.sourceforge.plantuml.ugraphic.UGraphic;
4849 import net.sourceforge.plantuml.ugraphic.UImage;
4950 import net.sourceforge.plantuml.ugraphic.UImageSvg;
5455 private final ScientificEquationSafe math;
5556 private final HtmlColor foreground;
5657 private final HtmlColor background;
58 private final ColorMapper colorMapper;
5759
58 public AtomMath(ScientificEquationSafe math, HtmlColor foreground, HtmlColor background, double scale) {
60 public AtomMath(ScientificEquationSafe math, HtmlColor foreground, HtmlColor background, double scale,
61 ColorMapper colorMapper) {
5962 this.math = math;
63 this.colorMapper = colorMapper;
6064 this.foreground = foreground;
6165 this.background = background;
6266 this.scale = scale;
8387 public void drawU(UGraphic ug) {
8488 final boolean isSvg = ug.matchesProperty("SVG");
8589 final Color back;
86 if (isSvg && background == null) {
90 if (background == null) {
8791 back = null;
8892 } else {
89 back = getColor(background == null ? ug.getParam().getBackcolor() : background, Color.WHITE);
93 back = getColor(background, Color.WHITE);
9094 }
9195 final Color fore = getColor(foreground, Color.BLACK);
92 final double dpiFactor = ug.dpiFactor();
96 // final double dpiFactor = ug.dpiFactor();
9397 if (isSvg) {
9498 final SvgString svg = math.getSvg(scale, fore, back);
9599 ug.draw(new UImageSvg(svg));
96100 } else {
97 ug.draw(new UImage(math.getImage(scale * dpiFactor, fore, back)));
101 final UImage image = new UImage(math.getImage(scale, fore, back), math.getFormula());
102 ug.draw(image);
98103 }
99104 }
100105
101106 private Color getColor(HtmlColor color, Color defaultValue) {
102107 if (color instanceof HtmlColorSimple) {
103 return ((HtmlColorSimple) color).getColor999();
108 return colorMapper.getMappedColor(color);
109 // return ((HtmlColorSimple) color).getColor999();
104110 }
105111 return defaultValue;
106112
5151 private final double factor;
5252 private final Url url;
5353
54 public AtomOpenIcon(OpenIcon openIcon, FontConfiguration fontConfiguration) {
55 this(openIcon, fontConfiguration, null);
56 }
57
5854 public AtomOpenIcon(OpenIcon openIcon, FontConfiguration fontConfiguration, Url url) {
5955 this.url = url;
6056 this.openIcon = openIcon;
3636
3737 import java.awt.geom.Dimension2D;
3838
39 import net.sourceforge.plantuml.Url;
3940 import net.sourceforge.plantuml.graphic.FontConfiguration;
4041 import net.sourceforge.plantuml.graphic.StringBounder;
4142 import net.sourceforge.plantuml.ugraphic.UGraphic;
4647 private final FontConfiguration fontConfiguration;
4748 private final Sprite sprite;
4849 private final double scale;
50 private final Url url;
4951
50 public AtomSprite(double scale, FontConfiguration fontConfiguration, Sprite sprite) {
52 public AtomSprite(double scale, FontConfiguration fontConfiguration, Sprite sprite, Url url) {
5153 this.scale = scale;
5254 this.fontConfiguration = fontConfiguration;
5355 this.sprite = sprite;
56 this.url = url;
5457 }
5558
5659 public Dimension2D calculateDimension(StringBounder stringBounder) {
6265 }
6366
6467 public void drawU(UGraphic ug) {
65 sprite.asTextBlock(fontConfiguration.getColor(), scale * ug.dpiFactor()).drawU(ug);
68 if (url != null) {
69 ug.startUrl(url);
70 }
71 sprite.asTextBlock(fontConfiguration.getColor(), scale).drawU(ug);
72 if (url != null) {
73 ug.closeAction();
74 }
6675 }
6776
6877 }
4545
4646 import net.sourceforge.plantuml.BackSlash;
4747 import net.sourceforge.plantuml.Dimension2DDouble;
48 import net.sourceforge.plantuml.ISkinSimple;
4849 import net.sourceforge.plantuml.LineBreakStrategy;
4950 import net.sourceforge.plantuml.Log;
5051 import net.sourceforge.plantuml.StringUtils;
6162 import net.sourceforge.plantuml.ugraphic.UGraphic;
6263 import net.sourceforge.plantuml.ugraphic.UText;
6364 import net.sourceforge.plantuml.ugraphic.UTranslate;
65 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
6466 import net.sourceforge.plantuml.utils.CharHidder;
6567
6668 public class AtomText implements Atom {
8587 return new AtomText(text, fontConfiguration, null, ZERO, ZERO);
8688 }
8789
88 public static Atom createUrl(Url url, FontConfiguration fontConfiguration) {
90 public static Atom createUrl(Url url, FontConfiguration fontConfiguration, ISkinSimple skinSimple) {
8991 fontConfiguration = fontConfiguration.hyperlink();
9092 final Display display = Display.getWithNewlines(url.getLabel());
9193 if (display.size() > 1) {
9294 final List<Atom> all = new ArrayList<Atom>();
9395 for (CharSequence s : display.as()) {
94 all.add(createAtomText(s.toString(), url, fontConfiguration));
96 all.add(createAtomText(s.toString(), url, fontConfiguration, skinSimple));
9597 }
9698 return new AtomVerticalTexts(all);
9799
98100 }
99 return createAtomText(url.getLabel(), url, fontConfiguration);
100 }
101
102 private static Atom createAtomText(final String text, Url url, FontConfiguration fontConfiguration) {
103 final Pattern p = Pattern.compile(Splitter.openiconPattern);
101 return createAtomText(url.getLabel(), url, fontConfiguration, skinSimple);
102 }
103
104 private static Atom createAtomText(final String text, Url url, FontConfiguration fontConfiguration,
105 ISkinSimple skinSimple) {
106 final Pattern p = Pattern.compile(Splitter.openiconPattern + "|" + Splitter.spritePattern2);
104107 final Matcher m = p.matcher(text);
105108 final List<Atom> result = new ArrayList<Atom>();
106
107109 while (m.find()) {
108 final String val = m.group(1);
109110 final StringBuffer sb = new StringBuffer();
110111 m.appendReplacement(sb, "");
111112 if (sb.length() > 0) {
112113 result.add(new AtomText(sb.toString(), fontConfiguration, url, ZERO, ZERO));
113114 }
114 final OpenIcon openIcon = OpenIcon.retrieve(val);
115 if (openIcon != null) {
116 result.add(new AtomOpenIcon(openIcon, fontConfiguration, url));
115 final String valOpenicon = m.group(1);
116 final String valSprite = m.group(2);
117 if (valOpenicon != null) {
118 final OpenIcon openIcon = OpenIcon.retrieve(valOpenicon);
119 if (openIcon != null) {
120 result.add(new AtomOpenIcon(openIcon, fontConfiguration, url));
121 }
122 } else if (valSprite != null) {
123 final Sprite sprite = skinSimple.getSprite(valSprite);
124 if (sprite != null) {
125 final double scale = CommandCreoleImg.getScale(m.group(3), 1);
126 result.add(new AtomSprite(scale, fontConfiguration, sprite, url));
127 }
128
117129 }
118130 }
119131 final StringBuffer sb = new StringBuffer();
6969 throw new IllegalStateException();
7070 }
7171 String src = m.group(2);
72 final double scale = getScale(m.group(3));
72 final double scale = getScale(m.group(3), 1);
7373 if (src.toLowerCase().startsWith("src=")) {
7474 src = src.substring(4);
7575 }
7878 return line.substring(m.group(1).length());
7979 }
8080
81 public static double getScale(String s) {
81 public static double getScale(String s, double def) {
8282 if (s == null) {
83 return 1;
83 return def;
8484 }
8585 final Pattern p = Pattern.compile("(?:scale=|\\*)([0-9.]+)");
8686 final Matcher m = p.matcher(s);
8787 if (m.find()) {
8888 return Double.parseDouble(m.group(1));
8989 }
90 return 1;
90 return def;
9191 }
9292
9393 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.creole;
36
37 import net.sourceforge.plantuml.command.regex.Matcher2;
38 import net.sourceforge.plantuml.command.regex.MyPattern;
39 import net.sourceforge.plantuml.command.regex.Pattern2;
40 import net.sourceforge.plantuml.graphic.Splitter;
41
42 public class CommandCreoleQrcode implements Command {
43
44 private final Pattern2 pattern;
45
46 private CommandCreoleQrcode(String p) {
47 this.pattern = MyPattern.cmpile(p);
48 }
49
50 public static Command create() {
51 return new CommandCreoleQrcode("^(?i)(" + Splitter.qrcodePattern + ")");
52 }
53
54 public int matchingSize(String line) {
55 final Matcher2 m = pattern.matcher(line);
56 if (m.find() == false) {
57 return 0;
58 }
59 return m.group(1).length();
60 }
61
62 public String executeAndGetRemaining(String line, StripeSimple stripe) {
63 final Matcher2 m = pattern.matcher(line);
64 if (m.find() == false) {
65 throw new IllegalStateException();
66 }
67 final String src = m.group(2);
68 final double scale = CommandCreoleImg.getScale(m.group(3), 3);
69 stripe.addQrcode(src, scale);
70 return line.substring(m.group(1).length());
71 }
72
73 }
6565 throw new IllegalStateException();
6666 }
6767 final String src = m.group(2);
68 final double scale = CommandCreoleImg.getScale(m.group(3));
68 final double scale = CommandCreoleImg.getScale(m.group(3), 1);
6969 stripe.addSprite(src, scale);
7070 return line.substring(m.group(1).length());
7171 }
112112 this.commands.add(CommandCreoleExposantChange.create(FontPosition.EXPOSANT));
113113 this.commands.add(CommandCreoleExposantChange.create(FontPosition.INDICE));
114114 this.commands.add(CommandCreoleImg.create());
115 this.commands.add(CommandCreoleQrcode.create());
115116 this.commands.add(CommandCreoleOpenIcon.create());
116117 final double scale = skinParam.getDpi() / 96.0;
117118 this.commands.add(CommandCreoleMath.create(scale));
167168 atoms.add(AtomImg.create(src, ImgValign.TOP, 0, scale));
168169 }
169170
171 public void addQrcode(String src, double scale) {
172 atoms.add(AtomImg.createQrcode(src, scale));
173 }
174
170175 public void addSpace(int size) {
171176 atoms.add(AtomSpace.create(size));
172177 }
173178
174179 public void addUrl(Url url) {
175 atoms.add(AtomText.createUrl(url, fontConfiguration));
180 atoms.add(AtomText.createUrl(url, fontConfiguration, skinParam));
176181 }
177182
178183 public void addSprite(String src, double scale) {
179184 final Sprite sprite = skinParam.getSprite(src);
180185 if (sprite != null) {
181 atoms.add(new AtomSprite(scale, fontConfiguration, sprite));
186 atoms.add(new AtomSprite(scale, fontConfiguration, sprite, null));
182187 }
183188 }
184189
185190 public void addOpenIcon(String src) {
186191 final OpenIcon openIcon = OpenIcon.retrieve(src);
187192 if (openIcon != null) {
188 atoms.add(new AtomOpenIcon(openIcon, fontConfiguration));
193 atoms.add(new AtomOpenIcon(openIcon, fontConfiguration, null));
189194 }
190195 }
191196
192197 public void addMath(ScientificEquationSafe math, double scale) {
193 atoms.add(new AtomMath(math, fontConfiguration.getColor(), fontConfiguration.getExtendedColor(), scale));
198 atoms.add(new AtomMath(math, fontConfiguration.getColor(), fontConfiguration.getExtendedColor(), scale,
199 skinParam.getColorMapper()));
194200 }
195201
196202 private void modifyStripe(String line) {
6969 import net.sourceforge.plantuml.graphic.TextBlockUtils;
7070 import net.sourceforge.plantuml.graphic.VerticalAlignment;
7171 import net.sourceforge.plantuml.sequencediagram.MessageNumber;
72 import net.sourceforge.plantuml.skin.VisibilityModifier;
7273 import net.sourceforge.plantuml.ugraphic.UFont;
7374 import net.sourceforge.plantuml.ugraphic.UStroke;
7475 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
8182 private final CreoleMode defaultCreoleMode;
8283
8384 public final static Display NULL = new Display(null, null, true, CreoleMode.FULL);
85
86 public Display replaceBackslashT() {
87 final Display result = new Display(this, defaultCreoleMode);
88 for (int i = 0; i < result.display.size(); i++) {
89 final CharSequence s = display.get(i);
90 if (s.toString().contains("\\t")) {
91 result.display.set(i, s.toString().replace("\\t", "\t"));
92 }
93 }
94 return result;
95 }
8496
8597 public Display replace(String src, String dest) {
8698 final List<CharSequence> newDisplay = new ArrayList<CharSequence>();
206218
207219 public Display manageGuillemet() {
208220 final List<CharSequence> result = new ArrayList<CharSequence>();
221 boolean first = true;
209222 for (CharSequence line : display) {
210 final String withGuillement = StringUtils.manageGuillemet(line.toString());
211 if (withGuillement.equals(line.toString())) {
212 result.add(line);
213 } else {
214 result.add(withGuillement);
215 }
223 String lineString = line.toString();
224 if (first && VisibilityModifier.isVisibilityCharacter(line)) {
225 lineString = lineString.substring(1).trim();
226 }
227 final String withGuillement = StringUtils.manageGuillemet(lineString);
228 // if (withGuillement.equals(lineString)) {
229 // result.add(lineString);
230 // } else {
231 result.add(withGuillement);
232 // }
233 first = false;
216234 }
217235 return new Display(result, this.naturalHorizontalAlignment, this.isNull, this.defaultCreoleMode);
218236 }
6363 if (type.startsWith("ABSTRACT")) {
6464 return LeafType.ABSTRACT_CLASS;
6565 }
66 if (type.startsWith("DIAMOND")) {
67 return LeafType.STATE_CHOICE;
68 }
6669 return LeafType.valueOf(type);
6770 }
6871
4545 import net.sourceforge.plantuml.graphic.FontConfiguration;
4646 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
4747 import net.sourceforge.plantuml.graphic.HtmlColor;
48 import net.sourceforge.plantuml.graphic.HtmlColorSet;
4948 import net.sourceforge.plantuml.graphic.StringBounder;
5049 import net.sourceforge.plantuml.graphic.TextBlock;
5150 import net.sourceforge.plantuml.graphic.USymbolInterface;
5251 import net.sourceforge.plantuml.graphic.color.Colors;
52 import net.sourceforge.plantuml.skin.VisibilityModifier;
5353 import net.sourceforge.plantuml.svek.Bibliotekon;
5454 import net.sourceforge.plantuml.ugraphic.UFont;
5555 import net.sourceforge.plantuml.utils.UniqueSequence;
8787 private boolean opale;
8888 private boolean horizontalSolitary;
8989 private String sametail;
90 private VisibilityModifier visibilityModifier;
9091
9192 private Url url;
9293
121122 // this.label = label.removeHeadingUrl(url).manageGuillemet();
122123 } else {
123124 this.label = label.manageGuillemet();
125 if (VisibilityModifier.isVisibilityCharacter(label.get(0))) {
126 visibilityModifier = VisibilityModifier.getVisibilityModifier(label.get(0), false);
127 }
128
124129 }
125130 this.length = length;
126131 this.qualifier1 = qualifier1;
521526 }
522527 }
523528
529 public final VisibilityModifier getVisibilityModifier() {
530 return visibilityModifier;
531 }
532
524533 }
261261 } else if (align == HorizontalAlignment.CENTER) {
262262 placementStrategy = new PlacementStrategyY1Y2Center(stringBounder);
263263 } else {
264 throw new IllegalStateException();
264 placementStrategy = new PlacementStrategyY1Y2Left(stringBounder);
265265 }
266266 group = new ULayoutGroup(placementStrategy);
267267 for (Member att : members) {
4545
4646 protected LinkType type;
4747 protected boolean hidden = false;
48 private boolean single = false;
4849
4950 private Colors colors = Colors.empty();
5051
8687 type = type.goBold();
8788 }
8889
90 public final void goSingle() {
91 this.single = true;
92 }
93
94 public boolean isSingle() {
95 return single;
96 }
97
8998 public void applyStyle(String arrowStyle) {
9099 if (arrowStyle == null) {
91100 return;
101110 this.goDotted();
102111 } else if (s.equalsIgnoreCase("hidden")) {
103112 this.goHidden();
113 } else if (s.equalsIgnoreCase("single")) {
114 this.goSingle();
104115 } else if (s.equalsIgnoreCase("plain")) {
105116 // Do nothing
106117 } else if (s.equalsIgnoreCase("norank")) {
6565 }
6666
6767 public static final void setDotExecutable(String value) {
68 dotExecutable = value;
68 dotExecutable = value == null ? null : value.trim();
6969 }
7070
7171 public static Graphviz create(ISkinParam skinParam, String dotString, String... type) {
179179 }
180180
181181 public void addLink(Link link) {
182 if (link.isSingle() && containsSimilarLink(link)) {
183 return;
184 }
182185 links.add(link);
186 }
187
188 private boolean containsSimilarLink(Link other) {
189 for (Link link : links) {
190 if (other.sameConnections(link)) {
191 return true;
192 }
193 }
194 return false;
183195 }
184196
185197 public void removeLink(Link link) {
469469 if (getLeafType() == LeafType.CIRCLE) {
470470 return USymbol.INTERFACE;
471471 }
472 if (symbol != null && stereotype != null && stereotype.getSprite() != null) {
473 return symbol.withStereoAlignment(HorizontalAlignment.RIGHT);
474 }
472 // if (symbol != null && stereotype != null && stereotype.getSprite() != null) {
473 // return symbol.withStereoAlignment(HorizontalAlignment.RIGHT);
474 // }
475475 return symbol;
476476 }
477477
519519 }
520520 return isRemovedInternal();
521521 }
522
522
523523 private boolean isRemovedInternal() {
524524 if (isGroup()) {
525525 if (entityFactory.isRemoved(this)) {
542542 }
543543 return entityFactory.isRemoved(this);
544544 }
545
546
547545
548546 private int layer;
549547
6969 return new ByteArrayInputStream(baos.toByteArray());
7070 }
7171
72 public BufferedImage getBufferedImage(String keepLetter) {
72 public static BufferedImage getBufferedImage(InputStream is) {
7373 try {
7474 final Class<?> clVP8Decoder = Class.forName("net.sourceforge.plantuml.webp.VP8Decoder");
7575 final Object vp8Decoder = clVP8Decoder.newInstance();
7676 // final VP8Decoder vp8Decoder = new VP8Decoder();
7777 final Method decodeFrame = clVP8Decoder.getMethod("decodeFrame", ImageInputStream.class);
78 final InputStream is = getInputStream(keepLetter);
7978 final ImageInputStream iis = ImageIO.createImageInputStream(is);
8079 decodeFrame.invoke(vp8Decoder, iis);
8180 // vp8Decoder.decodeFrame(iis);
9089 }
9190 }
9291
92 public BufferedImage getBufferedImage(String keepLetter) {
93 try {
94 final InputStream is = getInputStream(keepLetter);
95 return getBufferedImage(is);
96 } catch (Exception e) {
97 e.printStackTrace();
98 return null;
99 }
100 }
101
93102 }
5252 import net.sourceforge.plantuml.command.regex.RegexLeaf;
5353 import net.sourceforge.plantuml.command.regex.RegexOr;
5454 import net.sourceforge.plantuml.descdiagram.command.CommandArchimate;
55 import net.sourceforge.plantuml.descdiagram.command.CommandArchimateMultilines;
5556 import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementFull;
5657 import net.sourceforge.plantuml.descdiagram.command.CommandCreateElementMultilines;
5758 import net.sourceforge.plantuml.descdiagram.command.CommandLinkElement;
115116 // cmds.add(new CommandHideShowSpecificClass());
116117
117118 cmds.add(new CommandArchimate());
119 cmds.add(new CommandArchimateMultilines());
118120 cmds.add(new CommandCreateDomain());
119121
120122 return cmds;
108108 final public void drawU(UGraphic ug) {
109109 final StringBounder stringBounder = ug.getStringBounder();
110110 final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
111 if (getSkinParam().shadowing2(SkinParameter.USECASE)) {
111 if (getSkinParam().shadowing2(getStereo(), SkinParameter.USECASE)) {
112112 ellipse.setDeltaShadow(3);
113113 }
114114
117117 FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));
118118 }
119119
120 Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
120 final Colors colors = color().getColor(arg, diagram.getSkinParam().getIHtmlColorSet());
121121 entity.setColors(colors);
122122
123123 return CommandExecutionResult.ok();
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.descdiagram.command;
36
37 import net.sourceforge.plantuml.FontParam;
38 import net.sourceforge.plantuml.StringUtils;
39 import net.sourceforge.plantuml.UrlBuilder;
40 import net.sourceforge.plantuml.classdiagram.AbstractEntityDiagram;
41 import net.sourceforge.plantuml.command.BlocLines;
42 import net.sourceforge.plantuml.command.CommandExecutionResult;
43 import net.sourceforge.plantuml.command.CommandMultilines2;
44 import net.sourceforge.plantuml.command.MultilinesStrategy;
45 import net.sourceforge.plantuml.command.regex.RegexConcat;
46 import net.sourceforge.plantuml.command.regex.RegexLeaf;
47 import net.sourceforge.plantuml.command.regex.RegexResult;
48 import net.sourceforge.plantuml.cucadiagram.Code;
49 import net.sourceforge.plantuml.cucadiagram.Display;
50 import net.sourceforge.plantuml.cucadiagram.IEntity;
51 import net.sourceforge.plantuml.cucadiagram.LeafType;
52 import net.sourceforge.plantuml.cucadiagram.Stereotype;
53 import net.sourceforge.plantuml.graphic.USymbol;
54 import net.sourceforge.plantuml.graphic.color.ColorParser;
55 import net.sourceforge.plantuml.graphic.color.ColorType;
56 import net.sourceforge.plantuml.graphic.color.Colors;
57
58 public class CommandArchimateMultilines extends CommandMultilines2<AbstractEntityDiagram> {
59
60 public CommandArchimateMultilines() {
61 super(getRegexConcat(), MultilinesStrategy.REMOVE_STARTING_QUOTE);
62 }
63
64 @Override
65 public String getPatternEnd() {
66 return "(?i)^(.*)\\]$";
67 }
68
69 private static RegexConcat getRegexConcat() {
70 return new RegexConcat(new RegexLeaf("^"), //
71 new RegexLeaf("archimate"), //
72 new RegexLeaf("[%s]+"), //
73 color().getRegex(), //
74 new RegexLeaf("[%s]+"), //
75 new RegexLeaf("CODE", "([\\p{L}0-9_.]+)"), //
76 new RegexLeaf("[%s]*"), //
77 new RegexLeaf("STEREOTYPE", "(?:[%s]+(?:\\<\\<([-\\w]+)\\>\\>))?"), //
78 new RegexLeaf("[%s]*"), //
79 new RegexLeaf("URL", "(" + UrlBuilder.getRegexp() + ")?"), //
80 new RegexLeaf("[%s]*"), //
81 ColorParser.exp1(), //
82 new RegexLeaf("[%s]*"), //
83 new RegexLeaf("DESC", "\\[(.*)$"));
84 }
85
86 private static ColorParser color() {
87 return ColorParser.simpleColor(ColorType.BACK);
88 }
89
90 @Override
91 protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) {
92 lines = lines.trim(false);
93 final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
94 final String codeRaw = line0.getLazzy("CODE", 0);
95
96 final Code code = Code.of(StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(codeRaw));
97 final String icon = line0.getLazzy("STEREOTYPE", 0);
98
99 final IEntity entity = diagram.getOrCreateLeaf(code, LeafType.DESCRIPTION, USymbol.RECTANGLE);
100
101 lines = lines.subExtract(1, 1);
102 Display display = lines.toDisplay();
103
104 entity.setDisplay(display);
105 entity.setUSymbol(USymbol.RECTANGLE);
106 if (icon != null) {
107 entity.setStereotype(new Stereotype("<<$archimate/" + icon + ">>", diagram.getSkinParam()
108 .getCircledCharacterRadius(), diagram.getSkinParam().getFont(null, false,
109 FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));
110 }
111
112 final Colors colors = color().getColor(line0, diagram.getSkinParam().getIHtmlColorSet());
113 entity.setColors(colors);
114
115 return CommandExecutionResult.ok();
116 }
117
118 }
113113 throw new IllegalArgumentException();
114114 }
115115
116 @Override
116117 protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) {
117118 lines = lines.trim(false);
118119 final RegexResult line0 = getStartingPattern().matcher(StringUtils.trin(lines.getFirst499()));
6161
6262 public class CommandLinkElement extends SingleLineCommand2<DescriptionDiagram> {
6363
64 static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|thickness=\\d+";
65 static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,thickness=\\d+";
64 static private final String KEY1 = "dotted|dashed|plain|bold|hidden|norank|single|thickness=\\d+";
65 static private final String KEY2 = ",dotted|,dashed|,plain|,bold|,hidden|,norank|,single|,thickness=\\d+";
6666 static public final String LINE_STYLE = "(?:#\\w+|" + CommandLinkElement.KEY1 + ")(?:,#\\w+|"
6767 + CommandLinkElement.KEY2 + ")*";
6868
6666 import net.sourceforge.plantuml.version.PSystemVersion;
6767
6868 public class PSystemDonors extends AbstractPSystem {
69
70 public static final String DONORS = "6wW70AmEU9ELAuNYZT_MZn6AGOgeeHNOWjgQuZoZA1P0SxnDhXdMoRgDdR45mND5SGKL8Az2C-THCiPX"
71 + "qGYJjjcQVk6-VTu2CLLilsL2UtyTQ4BoLZ2km4tbpF_b0XiJv0R8GZti1NIZZNlZcZIc_NyMPXz_WHRm"
72 + "DBfiMLGwq5cTNHLD233np1odb9A7OjnVaSBNZIs0buu7kTfO7U4RgRFlr0AQj6RJa9are5X6YaJpiT7Q"
73 + "SO3jOnWuqM5T7JOGEvGuw1kC0-eRCKh65JJ8ZE9cRAZcdIS4J3YXmavyKPAQeuLaHXawq65jWGAyFnC4"
74 + "n3uffoHdAsy32hR85ZKDahhmkZDTx1-MKe7yqd0ATB0Sj0Ae0F8Vw8O_PvkvnBcENL4pv5qPvx9no6kz"
75 + "Lx6_UQ2liwuCb9VDYvdnMdvKjnRIEUMwng-k1lcX8IjxUnXhlBA4yFnlBeNsnG8wFe2EjOQAyVV3-Sr2"
76 + "6eJ7bBgGWtFopdOJ0R7AKbZeNLnIBV3pBccnkbWUpLayH_lNXLOoi8Ch5fkXZsi5irldZ9AgeVvvoQkk"
77 + "urFacg1PtfVeHx9fIFp_BSqCqXsqteGFrwM8KgMlhAh5HHU1qw1_Gsu1kGFLq-JHTLg-9Bxt1-JUUv50"
78 + "53OJx9-wPjIdtBo4UM9Bfwfu01Zl4kr6X_CWCuYg0rq7bMTas5s_tQHdsBGnTcxqYdhJRWnT7zDfoitq"
79 + "tLpWCmo3icWE7DRUuYZWFfnG3gsMRwleDjVmRbkanZiPxAzXpWYapuXo76bBfazrb9dbiUHDNUBTt2x-"
80 + "F7JnJ-yMjT1vT_j7wljDVYMrr2F6esimz9PTrczjikXOG6prZ0Kk0tPgjnkJ0vNSGgSsd1KznGbOzxRE"
81 + "mN4jWukcTREIdQcT73Dh1nskINx8qO1HqPr83hwsEoFFU1G5zYVddLZrKD-757yNK2o62PvIeMmZfEWA"
82 + "czF9f76hPzmTl8zRcozKj_7DXIS4XH-RQDDoWzUd0FSK-a5J1v0wgrNoqiR42E1tVFq6FS-j3ZpAQ6cL"
83 + "SNQv8PRIf_S8y1ioyahsjhkX10q0";
69 public static final String DONORS = "6rK809m7nctnXhJewjSHZX8n3MVAYw086_hm054IjRdwqUp4_JWT81c0qvE5N5zqDfkGDMFIpNEMyuoY"
70 + "M3uDM2zrsEPcFuYbilsNYTjr7R2bcYiX7iHwwS_VkmUE0bdSfipZmCR6EPRTasMlw6Rt1Lf0zRVHovPz"
71 + "IWKtWSqlH9CQulutnzUhP56CxXGfihgn1SYueqQmRtIEyGNrnd_K8ZLfpQOXxZM0M4OAMVEsokHnaFqd"
72 + "C50Y9r5tC8250uc3Vv63lZ-X05AnQjZmZs8orbgzvma799HG8GN_o4brRY7XKGOFv2Ik1W8oFu4HWBrM"
73 + "K4dCrkm6P6aHBP8Q17N5Ui4Zih-OcZBdISDvv0w925e1LG2v2Bh0LsapboZNiIiiUFokZ7Ux542kiWO0"
74 + "wSc2ljgwCc3-rqzchBgygMyjf7FATOv_dGtmh24pztOpkdXaCHRpnrmAmnSBa5-0JcqRBCRpY_FEGWm4"
75 + "nvIweCpPStoTHC2ainGMVX5BMZF_hKlLMb74jsOi-W_xwugXX644LoAk0NnDo-8adIyKTmtrxqEkTXtV"
76 + "8jPO9DIReMUdpEdizx9RYXcb6sXn4pfCbqUO6_QLLQ9OD14O0Vezu259xgJws-HHVLi-nDxs9y6yQU60"
77 + "v3PZxE-gCnn53giW2zAsjui5m6ILQ1ToKZVYXaCTw2get4CZtFNNJRg7JHaJvutUyLWFCmRr9Jf6ll2u"
78 + "c4j6SKEBp9lDXxItE0gu4L-SruzzgCzL0ElgtbMBq7W50_eUvWn3UWt9nv6snAEemumijmNFwcBFpUta"
79 + "vg4ZVpXcjgZdZUCF7dyUCXDgtzkdbhf5cBi6GzyQapNPorEKMrWDrL616f5n7t0-CpbIoH5oOiEP3e6O"
80 + "926txRns5DJWaYSM-dNBzjIq1Dcxh-u2tS4FoniPgFWxvY3YxE-KEAFNAB9VCU_Ch9lwFgJ4kO2SCKHm"
81 + "bmhcDaAAQjYSHeRi-wYdEphvp9SsMqXiuvSjZoaKFY6YTOiD1fj2DEhmRzX50AxVfavUp9W80NoFqs_G"
82 + "qqzraBEDbbOH1t1pIGY42drxr1_6ZZ9jjwQmBj7hjctxM3R--i-SPGMda5_6gWEaAaZl_sm8B1DsKzPT"
83 + "qVU2JvkJMiWC7EfaErREZ9uAC2IeTqi0";
8484
8585 @Override
8686 final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
9393 }
9494
9595 private UDrawable getGraphicStrings() throws IOException {
96 final List<TextBlock> cols = getCols(getDonors(), 4, 5);
96 final List<TextBlock> cols = getCols(getDonors(), 6, 5);
9797 return new UDrawable() {
9898 public void drawU(UGraphic ug) {
9999 final TextBlockBackcolored header = GraphicStrings.createBlackOnWhite(Arrays
3535 package net.sourceforge.plantuml.eggs;
3636
3737 import java.awt.image.BufferedImage;
38 import java.io.ByteArrayInputStream;
3938 import java.io.IOException;
40 import java.io.InputStream;
4139 import java.io.OutputStream;
4240 import java.util.ArrayList;
4341 import java.util.List;
44
45 import javax.imageio.ImageIO;
4642
4743 import net.sourceforge.plantuml.AbstractPSystem;
4844 import net.sourceforge.plantuml.FileFormatOption;
5349 import net.sourceforge.plantuml.svek.TextBlockBackcolored;
5450 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
5551 import net.sourceforge.plantuml.ugraphic.ImageBuilder;
52 import net.sourceforge.plantuml.version.PSystemVersion;
5653
5754 public class PSystemAppleTwo extends AbstractPSystem {
5855
6057 private final BufferedImage image;
6158
6259 public PSystemAppleTwo() throws IOException {
63 strings.add(" <b><size:18>Apple //e for ever ! ");
60 strings.add(" <b><size:18>Apple //e for ever ! ");
6461 strings.add(" ");
6562
66 final InputStream is = new ByteArrayInputStream(imm);
67 image = ImageIO.read(is);
68 is.close();
63 image = PSystemVersion.getApple2Image();
6964 }
7065
7166 @Override
9186 return new DiagramDescription("(Apple //e)");
9287 }
9388
94 private static final byte imm[] = new byte[] { (byte) 255, (byte) 216, (byte) 255, (byte) 224, (byte) 0, (byte) 16,
95 (byte) 74, (byte) 70, (byte) 73, (byte) 70, (byte) 0, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 96,
96 (byte) 0, (byte) 96, (byte) 0, (byte) 0, (byte) 255, (byte) 219, (byte) 0, (byte) 67, (byte) 0, (byte) 10,
97 (byte) 7, (byte) 7, (byte) 8, (byte) 7, (byte) 6, (byte) 10, (byte) 8, (byte) 8, (byte) 8, (byte) 11,
98 (byte) 10, (byte) 10, (byte) 11, (byte) 14, (byte) 24, (byte) 16, (byte) 14, (byte) 13, (byte) 13,
99 (byte) 14, (byte) 29, (byte) 21, (byte) 22, (byte) 17, (byte) 24, (byte) 35, (byte) 31, (byte) 37,
100 (byte) 36, (byte) 34, (byte) 31, (byte) 34, (byte) 33, (byte) 38, (byte) 43, (byte) 55, (byte) 47,
101 (byte) 38, (byte) 41, (byte) 52, (byte) 41, (byte) 33, (byte) 34, (byte) 48, (byte) 65, (byte) 49,
102 (byte) 52, (byte) 57, (byte) 59, (byte) 62, (byte) 62, (byte) 62, (byte) 37, (byte) 46, (byte) 68,
103 (byte) 73, (byte) 67, (byte) 60, (byte) 72, (byte) 55, (byte) 61, (byte) 62, (byte) 59, (byte) 255,
104 (byte) 219, (byte) 0, (byte) 67, (byte) 1, (byte) 10, (byte) 11, (byte) 11, (byte) 14, (byte) 13,
105 (byte) 14, (byte) 28, (byte) 16, (byte) 16, (byte) 28, (byte) 59, (byte) 40, (byte) 34, (byte) 40,
106 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59,
107 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59,
108 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59,
109 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59,
110 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59,
111 (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 59, (byte) 255, (byte) 192, (byte) 0, (byte) 17,
112 (byte) 8, (byte) 0, (byte) 136, (byte) 0, (byte) 200, (byte) 3, (byte) 1, (byte) 34, (byte) 0, (byte) 2,
113 (byte) 17, (byte) 1, (byte) 3, (byte) 17, (byte) 1, (byte) 255, (byte) 196, (byte) 0, (byte) 31, (byte) 0,
114 (byte) 0, (byte) 1, (byte) 5, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0,
115 (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 1, (byte) 2, (byte) 3,
116 (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10, (byte) 11, (byte) 255, (byte) 196,
117 (byte) 0, (byte) 181, (byte) 16, (byte) 0, (byte) 2, (byte) 1, (byte) 3, (byte) 3, (byte) 2, (byte) 4,
118 (byte) 3, (byte) 5, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 0, (byte) 1, (byte) 125, (byte) 1,
119 (byte) 2, (byte) 3, (byte) 0, (byte) 4, (byte) 17, (byte) 5, (byte) 18, (byte) 33, (byte) 49, (byte) 65,
120 (byte) 6, (byte) 19, (byte) 81, (byte) 97, (byte) 7, (byte) 34, (byte) 113, (byte) 20, (byte) 50,
121 (byte) 129, (byte) 145, (byte) 161, (byte) 8, (byte) 35, (byte) 66, (byte) 177, (byte) 193, (byte) 21,
122 (byte) 82, (byte) 209, (byte) 240, (byte) 36, (byte) 51, (byte) 98, (byte) 114, (byte) 130, (byte) 9,
123 (byte) 10, (byte) 22, (byte) 23, (byte) 24, (byte) 25, (byte) 26, (byte) 37, (byte) 38, (byte) 39,
124 (byte) 40, (byte) 41, (byte) 42, (byte) 52, (byte) 53, (byte) 54, (byte) 55, (byte) 56, (byte) 57,
125 (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70, (byte) 71, (byte) 72, (byte) 73, (byte) 74,
126 (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87, (byte) 88, (byte) 89, (byte) 90, (byte) 99,
127 (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104, (byte) 105, (byte) 106, (byte) 115, (byte) 116,
128 (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121, (byte) 122, (byte) 131, (byte) 132, (byte) 133,
129 (byte) 134, (byte) 135, (byte) 136, (byte) 137, (byte) 138, (byte) 146, (byte) 147, (byte) 148, (byte) 149,
130 (byte) 150, (byte) 151, (byte) 152, (byte) 153, (byte) 154, (byte) 162, (byte) 163, (byte) 164, (byte) 165,
131 (byte) 166, (byte) 167, (byte) 168, (byte) 169, (byte) 170, (byte) 178, (byte) 179, (byte) 180, (byte) 181,
132 (byte) 182, (byte) 183, (byte) 184, (byte) 185, (byte) 186, (byte) 194, (byte) 195, (byte) 196, (byte) 197,
133 (byte) 198, (byte) 199, (byte) 200, (byte) 201, (byte) 202, (byte) 210, (byte) 211, (byte) 212, (byte) 213,
134 (byte) 214, (byte) 215, (byte) 216, (byte) 217, (byte) 218, (byte) 225, (byte) 226, (byte) 227, (byte) 228,
135 (byte) 229, (byte) 230, (byte) 231, (byte) 232, (byte) 233, (byte) 234, (byte) 241, (byte) 242, (byte) 243,
136 (byte) 244, (byte) 245, (byte) 246, (byte) 247, (byte) 248, (byte) 249, (byte) 250, (byte) 255, (byte) 196,
137 (byte) 0, (byte) 31, (byte) 1, (byte) 0, (byte) 3, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 1,
138 (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0, (byte) 0,
139 (byte) 1, (byte) 2, (byte) 3, (byte) 4, (byte) 5, (byte) 6, (byte) 7, (byte) 8, (byte) 9, (byte) 10,
140 (byte) 11, (byte) 255, (byte) 196, (byte) 0, (byte) 181, (byte) 17, (byte) 0, (byte) 2, (byte) 1, (byte) 2,
141 (byte) 4, (byte) 4, (byte) 3, (byte) 4, (byte) 7, (byte) 5, (byte) 4, (byte) 4, (byte) 0, (byte) 1,
142 (byte) 2, (byte) 119, (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 17, (byte) 4, (byte) 5, (byte) 33,
143 (byte) 49, (byte) 6, (byte) 18, (byte) 65, (byte) 81, (byte) 7, (byte) 97, (byte) 113, (byte) 19,
144 (byte) 34, (byte) 50, (byte) 129, (byte) 8, (byte) 20, (byte) 66, (byte) 145, (byte) 161, (byte) 177,
145 (byte) 193, (byte) 9, (byte) 35, (byte) 51, (byte) 82, (byte) 240, (byte) 21, (byte) 98, (byte) 114,
146 (byte) 209, (byte) 10, (byte) 22, (byte) 36, (byte) 52, (byte) 225, (byte) 37, (byte) 241, (byte) 23,
147 (byte) 24, (byte) 25, (byte) 26, (byte) 38, (byte) 39, (byte) 40, (byte) 41, (byte) 42, (byte) 53,
148 (byte) 54, (byte) 55, (byte) 56, (byte) 57, (byte) 58, (byte) 67, (byte) 68, (byte) 69, (byte) 70,
149 (byte) 71, (byte) 72, (byte) 73, (byte) 74, (byte) 83, (byte) 84, (byte) 85, (byte) 86, (byte) 87,
150 (byte) 88, (byte) 89, (byte) 90, (byte) 99, (byte) 100, (byte) 101, (byte) 102, (byte) 103, (byte) 104,
151 (byte) 105, (byte) 106, (byte) 115, (byte) 116, (byte) 117, (byte) 118, (byte) 119, (byte) 120, (byte) 121,
152 (byte) 122, (byte) 130, (byte) 131, (byte) 132, (byte) 133, (byte) 134, (byte) 135, (byte) 136, (byte) 137,
153 (byte) 138, (byte) 146, (byte) 147, (byte) 148, (byte) 149, (byte) 150, (byte) 151, (byte) 152, (byte) 153,
154 (byte) 154, (byte) 162, (byte) 163, (byte) 164, (byte) 165, (byte) 166, (byte) 167, (byte) 168, (byte) 169,
155 (byte) 170, (byte) 178, (byte) 179, (byte) 180, (byte) 181, (byte) 182, (byte) 183, (byte) 184, (byte) 185,
156 (byte) 186, (byte) 194, (byte) 195, (byte) 196, (byte) 197, (byte) 198, (byte) 199, (byte) 200, (byte) 201,
157 (byte) 202, (byte) 210, (byte) 211, (byte) 212, (byte) 213, (byte) 214, (byte) 215, (byte) 216, (byte) 217,
158 (byte) 218, (byte) 226, (byte) 227, (byte) 228, (byte) 229, (byte) 230, (byte) 231, (byte) 232, (byte) 233,
159 (byte) 234, (byte) 242, (byte) 243, (byte) 244, (byte) 245, (byte) 246, (byte) 247, (byte) 248, (byte) 249,
160 (byte) 250, (byte) 255, (byte) 218, (byte) 0, (byte) 12, (byte) 3, (byte) 1, (byte) 0, (byte) 2, (byte) 17,
161 (byte) 3, (byte) 17, (byte) 0, (byte) 63, (byte) 0, (byte) 246, (byte) 106, (byte) 40, (byte) 162,
162 (byte) 128, (byte) 10, (byte) 40, (byte) 162, (byte) 128, (byte) 43, (byte) 221, (byte) 92, (byte) 253,
163 (byte) 153, (byte) 3, (byte) 121, (byte) 79, (byte) 41, (byte) 39, (byte) 133, (byte) 66, (byte) 185,
164 (byte) 253, (byte) 72, (byte) 21, (byte) 145, (byte) 115, (byte) 173, (byte) 106, (byte) 157, (byte) 45,
165 (byte) 180, (byte) 146, (byte) 191, (byte) 237, (byte) 73, (byte) 42, (byte) 31, (byte) 208, (byte) 55,
166 (byte) 245, (byte) 173, (byte) 59, (byte) 225, (byte) 157, (byte) 159, (byte) 83, (byte) 92, (byte) 61,
167 (byte) 182, (byte) 181, (byte) 169, (byte) 181, (byte) 149, (byte) 188, (byte) 243, (byte) 223, (byte) 91,
168 (byte) 71, (byte) 44, (byte) 209, (byte) 171, (byte) 149, (byte) 54, (byte) 228, (byte) 129, (byte) 144,
169 (byte) 9, (byte) 254, (byte) 44, (byte) 247, (byte) 245, (byte) 172, (byte) 165, (byte) 39, (byte) 114,
170 (byte) 210, (byte) 69, (byte) 251, (byte) 155, (byte) 239, (byte) 19, (byte) 78, (byte) 113, (byte) 135,
171 (byte) 133, (byte) 79, (byte) 240, (byte) 196, (byte) 168, (byte) 63, (byte) 92, (byte) 147, (byte) 250,
172 (byte) 213, (byte) 80, (byte) 254, (byte) 34, (byte) 67, (byte) 129, (byte) 53, (byte) 222, (byte) 115,
173 (byte) 221, (byte) 203, (byte) 127, (byte) 141, (byte) 52, (byte) 107, (byte) 183, (byte) 185, (byte) 192,
174 (byte) 213, (byte) 180, (byte) 188, (byte) 142, (byte) 205, (byte) 106, (byte) 223, (byte) 252, (byte) 120,
175 (byte) 84, (byte) 131, (byte) 90, (byte) 212, (byte) 63, (byte) 232, (byte) 41, (byte) 164, (byte) 127,
176 (byte) 224, (byte) 51, (byte) 127, (byte) 241, (byte) 250, (byte) 139, (byte) 190, (byte) 229, (byte) 104,
177 (byte) 39, (byte) 159, (byte) 226, (byte) 64, (byte) 120, (byte) 158, (byte) 232, (byte) 255, (byte) 0,
178 (byte) 192, (byte) 88, (byte) 255, (byte) 0, (byte) 74, (byte) 67, (byte) 121, (byte) 226, (byte) 96,
179 (byte) 121, (byte) 158, (byte) 243, (byte) 131, (byte) 198, (byte) 32, (byte) 110, (byte) 127, (byte) 241,
180 (byte) 202, (byte) 144, (byte) 107, (byte) 119, (byte) 223, (byte) 244, (byte) 16, (byte) 210, (byte) 88,
181 (byte) 250, (byte) 8, (byte) 136, (byte) 255, (byte) 0, (byte) 218, (byte) 198, (byte) 158, (byte) 53,
182 (byte) 203, (byte) 220, (byte) 224, (byte) 73, (byte) 167, (byte) 183, (byte) 209, (byte) 138, (byte) 255,
183 (byte) 0, (byte) 83, (byte) 74, (byte) 236, (byte) 44, (byte) 66, (byte) 53, (byte) 63, (byte) 18,
184 (byte) 131, (byte) 180, (byte) 205, (byte) 121, (byte) 248, (byte) 218, (byte) 31, (byte) 254, (byte) 34,
185 (byte) 156, (byte) 53, (byte) 143, (byte) 16, (byte) 142, (byte) 179, (byte) 207, (byte) 199, (byte) 247,
186 (byte) 173, (byte) 64, (byte) 254, (byte) 105, (byte) 86, (byte) 6, (byte) 181, (byte) 169, (byte) 127,
187 (byte) 207, (byte) 173, (byte) 131, (byte) 255, (byte) 0, (byte) 219, (byte) 211, (byte) 47, (byte) 254,
188 (byte) 211, (byte) 52, (byte) 241, (byte) 172, (byte) 234, (byte) 196, (byte) 241, (byte) 166, (byte) 88,
189 (byte) 48, (byte) 246, (byte) 191, (byte) 147, (byte) 255, (byte) 0, (byte) 140, (byte) 83, (byte) 187,
190 (byte) 2, (byte) 161, (byte) 215, (byte) 181, (byte) 213, (byte) 25, (byte) 55, (byte) 79, (byte) 248,
191 (byte) 194, (byte) 131, (byte) 255, (byte) 0, (byte) 101, (byte) 163, (byte) 254, (byte) 18, (byte) 61,
192 (byte) 100, (byte) 114, (byte) 110, (byte) 112, (byte) 61, (byte) 227, (byte) 65, (byte) 253, (byte) 42,
193 (byte) 231, (byte) 246, (byte) 206, (byte) 168, (byte) 57, (byte) 109, (byte) 46, (byte) 215, (byte) 254,
194 (byte) 3, (byte) 122, (byte) 231, (byte) 255, (byte) 0, (byte) 104, (byte) 138, (byte) 81, (byte) 175,
195 (byte) 95, (byte) 15, (byte) 189, (byte) 166, (byte) 1, (byte) 254, (byte) 237, (byte) 206, (byte) 127,
196 (byte) 154, (byte) 138, (byte) 46, (byte) 251, (byte) 133, (byte) 151, (byte) 98, (byte) 160, (byte) 241,
197 (byte) 54, (byte) 172, (byte) 188, (byte) 153, (byte) 227, (byte) 56, (byte) 245, (byte) 9, (byte) 82,
198 (byte) 47, (byte) 136, (byte) 181, (byte) 210, (byte) 55, (byte) 36, (byte) 45, (byte) 34, (byte) 255,
199 (byte) 0, (byte) 121, (byte) 45, (byte) 139, (byte) 143, (byte) 204, (byte) 86, (byte) 134, (byte) 153,
200 (byte) 172, (byte) 46, (byte) 177, (byte) 101, (byte) 117, (byte) 34, (byte) 197, (byte) 36, (byte) 45,
201 (byte) 4, (byte) 175, (byte) 4, (byte) 138, (byte) 236, (byte) 15, (byte) 204, (byte) 160, (byte) 19,
202 (byte) 211, (byte) 168, (byte) 230, (byte) 132, (byte) 211, (byte) 165, (byte) 142, (byte) 118, (byte) 104,
203 (byte) 239, (byte) 25, (byte) 119, (byte) 73, (byte) 189, (byte) 129, (byte) 81, (byte) 202, (byte) 231,
204 (byte) 59, (byte) 126, (byte) 152, (byte) 226, (byte) 142, (byte) 103, (byte) 220, (byte) 44, (byte) 140,
205 (byte) 209, (byte) 226, (byte) 173, (byte) 88, (byte) 16, (byte) 79, (byte) 144, (byte) 65, (byte) 231,
206 (byte) 5, (byte) 63, (byte) 250, (byte) 249, (byte) 167, (byte) 127, (byte) 194, (byte) 95, (byte) 169,
207 (byte) 47, (byte) 38, (byte) 43, (byte) 102, (byte) 3, (byte) 146, (byte) 54, (byte) 48, (byte) 255,
208 (byte) 0, (byte) 217, (byte) 171, (byte) 50, (byte) 225, (byte) 118, (byte) 201, (byte) 34, (byte) 246,
209 (byte) 87, (byte) 35, (byte) 167, (byte) 185, (byte) 170, (byte) 237, (byte) 83, (byte) 205, (byte) 46,
210 (byte) 227, (byte) 178, (byte) 61, (byte) 58, (byte) 55, (byte) 89, (byte) 35, (byte) 87, (byte) 83,
211 (byte) 149, (byte) 97, (byte) 144, (byte) 125, (byte) 69, (byte) 62, (byte) 178, (byte) 252, (byte) 61,
212 (byte) 113, (byte) 246, (byte) 141, (byte) 14, (byte) 217, (byte) 179, (byte) 146, (byte) 139, (byte) 229,
213 (byte) 159, (byte) 248, (byte) 9, (byte) 199, (byte) 242, (byte) 197, (byte) 106, (byte) 87, (byte) 74,
214 (byte) 119, (byte) 70, (byte) 33, (byte) 69, (byte) 20, (byte) 83, (byte) 0, (byte) 162, (byte) 138,
215 (byte) 40, (byte) 0, (byte) 162, (byte) 138, (byte) 40, (byte) 0, (byte) 162, (byte) 138, (byte) 40,
216 (byte) 0, (byte) 162, (byte) 138, (byte) 40, (byte) 2, (byte) 181, (byte) 224, (byte) 253, (byte) 218,
217 (byte) 253, (byte) 107, (byte) 202, (byte) 245, (byte) 112, (byte) 97, (byte) 142, (byte) 201, (byte) 84,
218 (byte) 227, (byte) 98, (byte) 178, (byte) 140, (byte) 123, (byte) 96, (byte) 127, (byte) 74, (byte) 245,
219 (byte) 91, (byte) 177, (byte) 152, (byte) 135, (byte) 177, (byte) 175, (byte) 46, (byte) 241, (byte) 26,
220 (byte) 20, (byte) 158, (byte) 37, (byte) 56, (byte) 225, (byte) 229, (byte) 0, (byte) 99, (byte) 253,
221 (byte) 161, (byte) 88, (byte) 207, (byte) 114, (byte) 227, (byte) 177, (byte) 199, (byte) 94, (byte) 11,
222 (byte) 155, (byte) 251, (byte) 249, (byte) 101, (byte) 121, (byte) 164, (byte) 42, (byte) 174, (byte) 81,
223 (byte) 20, (byte) 49, (byte) 194, (byte) 237, (byte) 249, (byte) 78, (byte) 7, (byte) 185, (byte) 6,
224 (byte) 180, (byte) 52, (byte) 125, (byte) 58, (byte) 53, (byte) 156, (byte) 25, (byte) 162, (byte) 71,
225 (byte) 207, (byte) 247, (byte) 192, (byte) 111, (byte) 231, (byte) 78, (byte) 181, (byte) 69, (byte) 49,
226 (byte) 22, (byte) 199, (byte) 223, (byte) 146, (byte) 70, (byte) 252, (byte) 221, (byte) 143, (byte) 245,
227 (byte) 171, (byte) 208, (byte) 29, (byte) 146, (byte) 2, (byte) 43, (byte) 101, (byte) 162, (byte) 49,
228 (byte) 111, (byte) 83, (byte) 164, (byte) 131, (byte) 72, (byte) 181, (byte) 104, (byte) 195, (byte) 44,
229 (byte) 17, (byte) 129, (byte) 140, (byte) 240, (byte) 130, (byte) 164, (byte) 146, (byte) 194, (byte) 203,
230 (byte) 162, (byte) 194, (byte) 83, (byte) 28, (byte) 96, (byte) 128, (byte) 217, (byte) 231, (byte) 175,
231 (byte) 229, (byte) 69, (byte) 133, (byte) 223, (byte) 238, (byte) 128, (byte) 207, (byte) 106, (byte) 145,
232 (byte) 229, (byte) 6, (byte) 168, (byte) 30, (byte) 166, (byte) 117, (byte) 214, (byte) 159, (byte) 0,
233 (byte) 145, (byte) 188, (byte) 164, (byte) 194, (byte) 103, (byte) 140, (byte) 129, (byte) 156, (byte) 126,
234 (byte) 21, (byte) 151, (byte) 113, (byte) 96, (byte) 64, (byte) 37, (byte) 93, (byte) 212, (byte) 255,
235 (byte) 0, (byte) 178, (byte) 228, (byte) 127, (byte) 90, (byte) 218, (byte) 185, (byte) 151, (byte) 142,
236 (byte) 43, (byte) 53, (byte) 230, (byte) 39, (byte) 140, (byte) 210, (byte) 29, (byte) 236, (byte) 97,
237 (byte) 77, (byte) 29, (byte) 228, (byte) 71, (byte) 228, (byte) 185, (byte) 153, (byte) 123, (byte) 242,
238 (byte) 217, (byte) 254, (byte) 117, (byte) 99, (byte) 64, (byte) 188, (byte) 212, (byte) 134, (byte) 187,
239 (byte) 107, (byte) 12, (byte) 215, (byte) 38, (byte) 104, (byte) 100, (byte) 44, (byte) 25, (byte) 89,
240 (byte) 20, (byte) 17, (byte) 242, (byte) 147, (byte) 144, (byte) 64, (byte) 29, (byte) 197, (byte) 93,
241 (byte) 145, (byte) 65, (byte) 228, (byte) 210, (byte) 105, (byte) 113, (byte) 168, (byte) 214, (byte) 109,
242 (byte) 155, (byte) 28, (byte) 135, (byte) 63, (byte) 250, (byte) 9, (byte) 169, (byte) 146, (byte) 86,
243 (byte) 8, (byte) 201, (byte) 220, (byte) 234, (byte) 124, (byte) 34, (byte) 127, (byte) 119, (byte) 173,
244 (byte) 199, (byte) 233, (byte) 168, (byte) 74, (byte) 223, (byte) 154, (byte) 175, (byte) 248, (byte) 87,
245 (byte) 79, (byte) 92, (byte) 199, (byte) 132, (byte) 191, (byte) 227, (byte) 243, (byte) 93, (byte) 143,
246 (byte) 176, (byte) 187, (byte) 45, (byte) 215, (byte) 212, (byte) 176, (byte) 254, (byte) 149, (byte) 211,
247 (byte) 175, (byte) 32, (byte) 31, (byte) 106, (byte) 230, (byte) 55, (byte) 56, (byte) 219, (byte) 209,
248 (byte) 139, (byte) 139, (byte) 128, (byte) 58, (byte) 9, (byte) 152, (byte) 126, (byte) 166, (byte) 170,
249 (byte) 53, (byte) 93, (byte) 212, (byte) 70, (byte) 46, (byte) 238, (byte) 127, (byte) 235, (byte) 187,
250 (byte) 255, (byte) 0, (byte) 232, (byte) 77, (byte) 84, (byte) 24, (byte) 212, (byte) 148, (byte) 117,
251 (byte) 126, (byte) 12, (byte) 184, (byte) 6, (byte) 11, (byte) 155, (byte) 98, (byte) 126, (byte) 235,
252 (byte) 135, (byte) 25, (byte) 247, (byte) 24, (byte) 254, (byte) 131, (byte) 243, (byte) 174, (byte) 162,
253 (byte) 184, (byte) 63, (byte) 10, (byte) 220, (byte) 121, (byte) 26, (byte) 226, (byte) 33, (byte) 56,
254 (byte) 19, (byte) 163, (byte) 39, (byte) 63, (byte) 159, (byte) 244, (byte) 174, (byte) 238, (byte) 186,
255 (byte) 105, (byte) 187, (byte) 196, (byte) 202, (byte) 75, (byte) 81, (byte) 104, (byte) 162, (byte) 138,
256 (byte) 178, (byte) 66, (byte) 138, (byte) 40, (byte) 160, (byte) 2, (byte) 138, (byte) 40, (byte) 160,
257 (byte) 2, (byte) 138, (byte) 40, (byte) 160, (byte) 2, (byte) 138, (byte) 40, (byte) 160, (byte) 10,
258 (byte) 247, (byte) 127, (byte) 234, (byte) 9, (byte) 244, (byte) 34, (byte) 188, (byte) 215, (byte) 197,
259 (byte) 75, (byte) 139, (byte) 248, (byte) 135, (byte) 253, (byte) 52, (byte) 148, (byte) 127, (byte) 227,
260 (byte) 194, (byte) 189, (byte) 50, (byte) 228, (byte) 102, (byte) 221, (byte) 171, (byte) 205, (byte) 124,
261 (byte) 87, (byte) 197, (byte) 236, (byte) 39, (byte) 254, (byte) 154, (byte) 74, (byte) 127, (byte) 85,
262 (byte) 172, (byte) 103, (byte) 185, (byte) 113, (byte) 216, (byte) 229, (byte) 108, (byte) 159, (byte) 253,
263 (byte) 10, (byte) 220, (byte) 250, (byte) 198, (byte) 191, (byte) 202, (byte) 174, (byte) 198, (byte) 220,
264 (byte) 138, (byte) 205, (byte) 180, (byte) 56, (byte) 180, (byte) 128, (byte) 122, (byte) 32, (byte) 31,
265 (byte) 149, (byte) 91, (byte) 141, (byte) 186, (byte) 86, (byte) 199, (byte) 59, (byte) 220, (byte) 232,
266 (byte) 109, (byte) 37, (byte) 2, (byte) 33, (byte) 207, (byte) 52, (byte) 247, (byte) 185, (byte) 219,
267 (byte) 222, (byte) 179, (byte) 160, (byte) 124, (byte) 39, (byte) 90, (byte) 116, (byte) 143, (byte) 129,
268 (byte) 78, (byte) 227, (byte) 38, (byte) 146, (byte) 125, (byte) 245, (byte) 3, (byte) 250, (byte) 211,
269 (byte) 21, (byte) 179, (byte) 77, (byte) 145, (byte) 248, (byte) 160, (byte) 67, (byte) 36, (byte) 147,
270 (byte) 60, (byte) 84, (byte) 186, (byte) 79, (byte) 58, (byte) 189, (byte) 184, (byte) 245, (byte) 111,
271 (byte) 232, (byte) 106, (byte) 163, (byte) 18, (byte) 77, (byte) 90, (byte) 210, (byte) 71, (byte) 252,
272 (byte) 77, (byte) 109, (byte) 191, (byte) 223, (byte) 254, (byte) 148, (byte) 158, (byte) 195, (byte) 91,
273 (byte) 157, (byte) 79, (byte) 132, (byte) 255, (byte) 0, (byte) 228, (byte) 51, (byte) 174, (byte) 175,
274 (byte) 253, (byte) 54, (byte) 67, (byte) 249, (byte) 188, (byte) 191, (byte) 225, (byte) 93, (byte) 60,
275 (byte) 99, (byte) 247, (byte) 106, (byte) 79, (byte) 112, (byte) 43, (byte) 150, (byte) 240, (byte) 153,
276 (byte) 198, (byte) 187, (byte) 173, (byte) 251, (byte) 200, (byte) 191, (byte) 250, (byte) 28, (byte) 191,
277 (byte) 227, (byte) 93, (byte) 76, (byte) 103, (byte) 247, (byte) 72, (byte) 48, (byte) 79, (byte) 202,
278 (byte) 58, (byte) 125, (byte) 43, (byte) 152, (byte) 232, (byte) 103, (byte) 35, (byte) 170, (byte) 140,
279 (byte) 94, (byte) 220, (byte) 15, (byte) 250, (byte) 106, (byte) 199, (byte) 245, (byte) 53, (byte) 154,
280 (byte) 213, (byte) 161, (byte) 172, (byte) 200, (byte) 201, (byte) 172, (byte) 79, (byte) 27, (byte) 40,
281 (byte) 40, (byte) 228, (byte) 237, (byte) 97, (byte) 215, (byte) 119, (byte) 4, (byte) 254, (byte) 24,
282 (byte) 34, (byte) 179, (byte) 92, (byte) 212, (byte) 50, (byte) 209, (byte) 53, (byte) 140, (byte) 205,
283 (byte) 14, (byte) 161, (byte) 109, (byte) 34, (byte) 156, (byte) 21, (byte) 153, (byte) 79, (byte) 235,
284 (byte) 94, (byte) 159, (byte) 94, (byte) 79, (byte) 19, (byte) 133, (byte) 184, (byte) 141, (byte) 137,
285 (byte) 198, (byte) 28, (byte) 28, (byte) 231, (byte) 222, (byte) 189, (byte) 96, (byte) 86, (byte) 244,
286 (byte) 182, (byte) 51, (byte) 152, (byte) 180, (byte) 81, (byte) 69, (byte) 106, (byte) 64, (byte) 81,
287 (byte) 69, (byte) 20, (byte) 0, (byte) 81, (byte) 69, (byte) 20, (byte) 0, (byte) 81, (byte) 69, (byte) 20,
288 (byte) 0, (byte) 81, (byte) 69, (byte) 20, (byte) 1, (byte) 28, (byte) 195, (byte) 48, (byte) 191,
289 (byte) 210, (byte) 188, (byte) 215, (byte) 198, (byte) 3, (byte) 253, (byte) 34, (byte) 31, (byte) 247,
290 (byte) 165, (byte) 255, (byte) 0, (byte) 217, (byte) 107, (byte) 210, (byte) 228, (byte) 25, (byte) 141,
291 (byte) 135, (byte) 168, (byte) 175, (byte) 55, (byte) 241, (byte) 136, (byte) 255, (byte) 0, (byte) 72,
292 (byte) 132, (byte) 255, (byte) 0, (byte) 181, (byte) 39, (byte) 254, (byte) 201, (byte) 89, (byte) 79,
293 (byte) 114, (byte) 226, (byte) 112, (byte) 240, (byte) 182, (byte) 17, (byte) 151, (byte) 251, (byte) 146,
294 (byte) 200, (byte) 191, (byte) 147, (byte) 176, (byte) 171, (byte) 49, (byte) 190, (byte) 42, (byte) 175,
295 (byte) 221, (byte) 185, (byte) 158, (byte) 62, (byte) 226, (byte) 82, (byte) 199, (byte) 254, (byte) 5,
296 (byte) 134, (byte) 255, (byte) 0, (byte) 217, (byte) 170, (byte) 236, (byte) 54, (byte) 238, (byte) 216,
297 (byte) 35, (byte) 161, (byte) 173, (byte) 86, (byte) 198, (byte) 13, (byte) 106, (byte) 93, (byte) 134,
298 (byte) 76, (byte) 12, (byte) 158, (byte) 148, (byte) 231, (byte) 155, (byte) 119, (byte) 21, (byte) 25,
299 (byte) 2, (byte) 40, (byte) 241, (byte) 222, (byte) 171, (byte) 249, (byte) 148, (byte) 192, (byte) 176,
300 (byte) 37, (byte) 197, (byte) 33, (byte) 147, (byte) 53, (byte) 84, (byte) 189, (byte) 39, (byte) 155,
301 (byte) 72, (byte) 46, (byte) 88, (byte) 105, (byte) 0, (byte) 171, (byte) 122, (byte) 83, (byte) 143,
302 (byte) 237, (byte) 75, (byte) 111, (byte) 250, (byte) 232, (byte) 5, (byte) 101, (byte) 51, (byte) 213,
303 (byte) 253, (byte) 24, (byte) 238, (byte) 213, (byte) 109, (byte) 6, (byte) 122, (byte) 201, (byte) 252,
304 (byte) 129, (byte) 63, (byte) 210, (byte) 147, (byte) 216, (byte) 22, (byte) 231, (byte) 85, (byte) 225,
305 (byte) 118, (byte) 199, (byte) 136, (byte) 245, (byte) 81, (byte) 234, (byte) 73, (byte) 252, (byte) 164,
306 (byte) 111, (byte) 241, (byte) 174, (byte) 186, (byte) 48, (byte) 60, (byte) 181, (byte) 200, (byte) 228,
307 (byte) 10, (byte) 227, (byte) 60, (byte) 52, (byte) 216, (byte) 241, (byte) 93, (byte) 242, (byte) 250,
308 (byte) 199, (byte) 43, (byte) 126, (byte) 82, (byte) 175, (byte) 248, (byte) 215, (byte) 103, (byte) 23,
309 (byte) 220, (byte) 252, (byte) 127, (byte) 173, (byte) 115, (byte) 35, (byte) 162, (byte) 71, (byte) 39,
310 (byte) 173, (byte) 32, (byte) 26, (byte) 165, (byte) 219, (byte) 115, (byte) 146, (byte) 16, (byte) 117,
311 (byte) 246, (byte) 83, (byte) 254, (byte) 126, (byte) 130, (byte) 177, (byte) 166, (byte) 32, (byte) 119,
312 (byte) 226, (byte) 182, (byte) 124, (byte) 69, (byte) 32, (byte) 139, (byte) 81, (byte) 186, (byte) 245,
313 (byte) 33, (byte) 14, (byte) 63, (byte) 5, (byte) 172, (byte) 24, (byte) 109, (byte) 47, (byte) 53,
314 (byte) 55, (byte) 253, (byte) 218, (byte) 236, (byte) 132, (byte) 28, (byte) 25, (byte) 24, (byte) 113,
315 (byte) 248, (byte) 122, (byte) 159, (byte) 242, (byte) 113, (byte) 72, (byte) 181, (byte) 177, (byte) 93,
316 (byte) 167, (byte) 253, (byte) 224, (byte) 84, (byte) 203, (byte) 49, (byte) 56, (byte) 0, (byte) 117,
317 (byte) 39, (byte) 210, (byte) 189, (byte) 58, (byte) 231, (byte) 196, (byte) 54, (byte) 176, (byte) 79,
318 (byte) 229, (byte) 162, (byte) 60, (byte) 216, (byte) 234, (byte) 202, (byte) 64, (byte) 31, (byte) 175,
319 (byte) 90, (byte) 229, (byte) 116, (byte) 253, (byte) 34, (byte) 11, (byte) 33, (byte) 242, (byte) 21,
320 (byte) 18, (byte) 145, (byte) 204, (byte) 178, (byte) 2, (byte) 73, (byte) 250, (byte) 96, (byte) 112,
321 (byte) 61, (byte) 191, (byte) 60, (byte) 213, (byte) 209, (byte) 106, (byte) 63, (byte) 231, (byte) 162,
322 (byte) 49, (byte) 250, (byte) 31, (byte) 234, (byte) 42, (byte) 226, (byte) 218, (byte) 37, (byte) 171,
323 (byte) 238, (byte) 110, (byte) 175, (byte) 136, (byte) 45, (byte) 207, (byte) 222, (byte) 133, (byte) 199,
324 (byte) 210, (byte) 88, (byte) 207, (byte) 254, (byte) 205, (byte) 82, (byte) 13, (byte) 114, (byte) 212,
325 (byte) 255, (byte) 0, (byte) 4, (byte) 191, (byte) 130, (byte) 134, (byte) 254, (byte) 68, (byte) 215,
326 (byte) 62, (byte) 45, (byte) 155, (byte) 213, (byte) 63, (byte) 25, (byte) 20, (byte) 127, (byte) 51,
327 (byte) 71, (byte) 217, (byte) 155, (byte) 217, (byte) 190, (byte) 142, (byte) 15, (byte) 245, (byte) 167,
328 (byte) 207, (byte) 33, (byte) 114, (byte) 163, (byte) 164, (byte) 26, (byte) 189, (byte) 169, (byte) 237,
329 (byte) 48, (byte) 250, (byte) 192, (byte) 255, (byte) 0, (byte) 225, (byte) 75, (byte) 253, (byte) 175,
330 (byte) 99, (byte) 156, (byte) 25, (byte) 246, (byte) 159, (byte) 246, (byte) 145, (byte) 135, (byte) 243,
331 (byte) 21, (byte) 203, (byte) 152, (byte) 121, (byte) 195, (byte) 46, (byte) 8, (byte) 235, (byte) 145,
332 (byte) 72, (byte) 242, (byte) 164, (byte) 67, (byte) 229, (byte) 33, (byte) 219, (byte) 182, (byte) 41,
333 (byte) 169, (byte) 177, (byte) 114, (byte) 163, (byte) 174, (byte) 183, (byte) 189, (byte) 182, (byte) 186,
334 (byte) 37, (byte) 96, (byte) 157, (byte) 36, (byte) 101, (byte) 25, (byte) 32, (byte) 30, (byte) 69,
335 (byte) 21, (byte) 129, (byte) 225, (byte) 167, (byte) 102, (byte) 212, (byte) 102, (byte) 220, (byte) 73,
336 (byte) 38, (byte) 46, (byte) 191, (byte) 66, (byte) 63, (byte) 198, (byte) 138, (byte) 210, (byte) 46,
337 (byte) 234, (byte) 228, (byte) 181, (byte) 99, (byte) 168, (byte) 162, (byte) 138, (byte) 42, (byte) 132,
338 (byte) 20, (byte) 81, (byte) 69, (byte) 0, (byte) 53, (byte) 134, (byte) 65, (byte) 30, (byte) 162,
339 (byte) 184, (byte) 63, (byte) 17, (byte) 216, (byte) 75, (byte) 125, (byte) 118, (byte) 60, (byte) 160,
340 (byte) 27, (byte) 203, (byte) 39, (byte) 43, (byte) 144, (byte) 51, (byte) 144, (byte) 190, (byte) 191,
341 (byte) 74, (byte) 239, (byte) 24, (byte) 133, (byte) 4, (byte) 146, (byte) 0, (byte) 3, (byte) 36,
342 (byte) 154, (byte) 228, (byte) 117, (byte) 41, (byte) 188, (byte) 61, (byte) 125, (byte) 40, (byte) 55,
343 (byte) 83, (byte) 72, (byte) 207, (byte) 16, (byte) 40, (byte) 36, (byte) 141, (byte) 102, (byte) 78,
344 (byte) 255, (byte) 0, (byte) 222, (byte) 80, (byte) 1, (byte) 233, (byte) 235, (byte) 89, (byte) 84,
345 (byte) 42, (byte) 39, (byte) 23, (byte) 123, (byte) 225, (byte) 171, (byte) 201, (byte) 231, (byte) 19,
346 (byte) 165, (byte) 179, (byte) 68, (byte) 224, (byte) 96, (byte) 149, (byte) 145, (byte) 8, (byte) 108,
347 (byte) 116, (byte) 200, (byte) 207, (byte) 63, (byte) 134, (byte) 63, (byte) 149, (byte) 39, (byte) 246,
348 (byte) 118, (byte) 167, (byte) 18, (byte) 5, (byte) 22, (byte) 146, (byte) 57, (byte) 232, (byte) 74,
349 (byte) 198, (byte) 216, (byte) 253, (byte) 51, (byte) 93, (byte) 71, (byte) 217, (byte) 124, (byte) 49,
350 (byte) 252, (byte) 26, (byte) 244, (byte) 144, (byte) 158, (byte) 152, (byte) 125, (byte) 102, (byte) 81,
351 (byte) 250, (byte) 59, (byte) 212, (byte) 145, (byte) 233, (byte) 118, (byte) 115, (byte) 241, (byte) 103,
352 (byte) 226, (byte) 121, (byte) 219, (byte) 61, (byte) 60, (byte) 185, (byte) 160, (byte) 155, (byte) 255,
353 (byte) 0, (byte) 66, (byte) 86, (byte) 169, (byte) 83, (byte) 104, (byte) 171, (byte) 38, (byte) 113,
354 (byte) 83, (byte) 218, (byte) 223, (byte) 15, (byte) 191, (byte) 105, (byte) 34, (byte) 253, (byte) 84,
355 (byte) 143, (byte) 253, (byte) 8, (byte) 10, (byte) 164, (byte) 203, (byte) 42, (byte) 253, (byte) 232,
356 (byte) 219, (byte) 240, (byte) 32, (byte) 255, (byte) 0, (byte) 42, (byte) 244, (byte) 143, (byte) 248,
357 (byte) 71, (byte) 245, (byte) 56, (byte) 190, (byte) 104, (byte) 245, (byte) 105, (byte) 95, (byte) 143,
358 (byte) 249, (byte) 109, (byte) 111, (byte) 30, (byte) 63, (byte) 241, (byte) 213, (byte) 90, (byte) 67,
359 (byte) 166, (byte) 107, (byte) 153, (byte) 255, (byte) 0, (byte) 143, (byte) 251, (byte) 22, (byte) 29,
360 (byte) 54, (byte) 155, (byte) 103, (byte) 255, (byte) 0, (byte) 227, (byte) 148, (byte) 253, (byte) 161,
361 (byte) 62, (byte) 205, (byte) 30, (byte) 108, (byte) 86, (byte) 99, (byte) 210, (byte) 9, (byte) 143,
362 (byte) 210, (byte) 38, (byte) 255, (byte) 0, (byte) 10, (byte) 102, (byte) 38, (byte) 255, (byte) 0,
363 (byte) 158, (byte) 19, (byte) 127, (byte) 223, (byte) 166, (byte) 255, (byte) 0, (byte) 10, (byte) 244,
364 (byte) 71, (byte) 211, (byte) 117, (byte) 126, (byte) 127, (byte) 208, (byte) 52, (byte) 185, (byte) 207,
365 (byte) 171, (byte) 59, (byte) 39, (byte) 254, (byte) 200, (byte) 213, (byte) 3, (byte) 216, (byte) 234,
366 (byte) 73, (byte) 247, (byte) 252, (byte) 57, (byte) 167, (byte) 185, (byte) 207, (byte) 252, (byte) 177,
367 (byte) 185, (byte) 25, (byte) 253, (byte) 98, (byte) 20, (byte) 253, (byte) 160, (byte) 189, (byte) 154,
368 (byte) 56, (byte) 34, (byte) 179, (byte) 127, (byte) 207, (byte) 9, (byte) 191, (byte) 239, (byte) 211,
369 (byte) 127, (byte) 133, (byte) 106, (byte) 248, (byte) 126, (byte) 25, (byte) 155, (byte) 92, (byte) 180,
370 (byte) 38, (byte) 25, (byte) 2, (byte) 161, (byte) 102, (byte) 102, (byte) 101, (byte) 35, (byte) 31,
371 (byte) 35, (byte) 122, (byte) 245, (byte) 231, (byte) 21, (byte) 209, (byte) 73, (byte) 107, (byte) 56,
372 (byte) 255, (byte) 0, (byte) 91, (byte) 225, (byte) 75, (byte) 156, (byte) 122, (byte) 197, (byte) 60,
373 (byte) 68, (byte) 127, (byte) 232, (byte) 98, (byte) 155, (byte) 11, (byte) 219, (byte) 90, (byte) 74,
374 (byte) 37, (byte) 254, (byte) 195, (byte) 213, (byte) 33, (byte) 96, (byte) 15, (byte) 34, (byte) 35,
375 (byte) 39, (byte) 111, (byte) 246, (byte) 93, (byte) 168, (byte) 117, (byte) 52, (byte) 26, (byte) 133,
376 (byte) 152, (byte) 190, (byte) 26, (byte) 111, (byte) 248, (byte) 172, (byte) 46, (byte) 125, (byte) 224,
377 (byte) 159, (byte) 255, (byte) 0, (byte) 70, (byte) 199, (byte) 93, (byte) 188, (byte) 127, (byte) 112,
378 (byte) 253, (byte) 79, (byte) 243, (byte) 174, (byte) 19, (byte) 195, (byte) 2, (byte) 87, (byte) 241,
379 (byte) 91, (byte) 74, (byte) 109, (byte) 174, (byte) 163, (byte) 83, (byte) 4, (byte) 191, (byte) 52,
380 (byte) 182, (byte) 242, (byte) 70, (byte) 57, (byte) 116, (byte) 56, (byte) 249, (byte) 128, (byte) 231,
381 (byte) 143, (byte) 210, (byte) 187, (byte) 57, (byte) 110, (byte) 227, (byte) 180, (byte) 143, (byte) 116,
382 (byte) 188, (byte) 41, (byte) 220, (byte) 217, (byte) 200, (byte) 236, (byte) 195, (byte) 143, (byte) 215,
383 (byte) 244, (byte) 172, (byte) 139, (byte) 145, (byte) 201, (byte) 248, (byte) 171, (byte) 82, (byte) 139,
384 (byte) 79, (byte) 213, (byte) 247, (byte) 203, (byte) 100, (byte) 46, (byte) 132, (byte) 135, (byte) 104,
385 (byte) 87, (byte) 144, (byte) 168, (byte) 27, (byte) 85, (byte) 14, (byte) 72, (byte) 193, (byte) 207,
386 (byte) 222, (byte) 233, (byte) 237, (byte) 223, (byte) 60, (byte) 81, (byte) 79, (byte) 25, (byte) 67,
387 (byte) 128, (byte) 26, (byte) 192, (byte) 160, (byte) 3, (byte) 133, (byte) 73, (byte) 65, (byte) 254,
388 (byte) 130, (byte) 163, (byte) 248, (byte) 147, (byte) 58, (byte) 90, (byte) 223, (byte) 219, (byte) 187,
389 (byte) 134, (byte) 101, (byte) 33, (byte) 219, (byte) 228, (byte) 93, (byte) 199, (byte) 145, (byte) 24,
390 (byte) 254, (byte) 149, (byte) 196, (byte) 255, (byte) 0, (byte) 107, (byte) 91, (byte) 19, (byte) 203,
391 (byte) 72, (byte) 163, (byte) 253, (byte) 168, (byte) 95, (byte) 252, (byte) 43, (byte) 120, (byte) 194,
392 (byte) 45, (byte) 106, (byte) 67, (byte) 108, (byte) 239, (byte) 215, (byte) 198, (byte) 186, (byte) 104,
393 (byte) 225, (byte) 237, (byte) 238, (byte) 198, (byte) 61, (byte) 21, (byte) 63, (byte) 248, (byte) 161,
394 (byte) 82, (byte) 199, (byte) 227, (byte) 13, (byte) 33, (byte) 241, (byte) 151, (byte) 120, (byte) 243,
395 (byte) 211, (byte) 112, (byte) 207, (byte) 254, (byte) 131, (byte) 154, (byte) 224, (byte) 132, (byte) 158,
396 (byte) 110, (byte) 217, (byte) 85, (byte) 91, (byte) 100, (byte) 136, (byte) 25, (byte) 24, (byte) 169,
397 (byte) 27, (byte) 128, (byte) 102, (byte) 25, (byte) 25, (byte) 247, (byte) 4, (byte) 126, (byte) 6,
398 (byte) 131, (byte) 46, (byte) 196, (byte) 203, (byte) 182, (byte) 213, (byte) 4, (byte) 100, (byte) 147,
399 (byte) 199, (byte) 90, (byte) 175, (byte) 103, (byte) 17, (byte) 115, (byte) 51, (byte) 209, (byte) 87,
400 (byte) 196, (byte) 250, (byte) 43, (byte) 112, (byte) 47, (byte) 9, (byte) 63, (byte) 245, (byte) 198,
401 (byte) 79, (byte) 234, (byte) 181, (byte) 98, (byte) 29, (byte) 91, (byte) 79, (byte) 185, (byte) 144,
402 (byte) 71, (byte) 21, (byte) 204, (byte) 108, (byte) 228, (byte) 18, (byte) 23, (byte) 112, (byte) 207,
403 (byte) 3, (byte) 39, (byte) 3, (byte) 169, (byte) 224, (byte) 19, (byte) 248, (byte) 87, (byte) 155,
404 (byte) 69, (byte) 34, (byte) 56, (byte) 249, (byte) 27, (byte) 119, (byte) 161, (byte) 21, (byte) 167,
405 (byte) 161, (byte) 182, (byte) 221, (byte) 102, (byte) 220, (byte) 247, (byte) 219, (byte) 40, (byte) 252,
406 (byte) 227, (byte) 97, (byte) 253, (byte) 105, (byte) 58, (byte) 106, (byte) 195, (byte) 82, (byte) 103,
407 (byte) 111, (byte) 52, (byte) 172, (byte) 252, (byte) 46, (byte) 85, (byte) 125, (byte) 61, (byte) 106,
408 (byte) 12, (byte) 96, (byte) 99, (byte) 240, (byte) 169, (byte) 202, (byte) 212, (byte) 101, (byte) 107,
409 (byte) 3, (byte) 67, (byte) 83, (byte) 195, (byte) 7, (byte) 254, (byte) 38, (byte) 50, (byte) 231,
410 (byte) 254, (byte) 120, (byte) 159, (byte) 253, (byte) 8, (byte) 81, (byte) 75, (byte) 225, (byte) 180,
411 (byte) 35, (byte) 82, (byte) 118, (byte) 231, (byte) 2, (byte) 18, (byte) 9, (byte) 199, (byte) 251,
412 (byte) 75, (byte) 69, (byte) 111, (byte) 13, (byte) 140, (byte) 158, (byte) 231, (byte) 83, (byte) 69,
413 (byte) 20, (byte) 85, (byte) 8, (byte) 41, (byte) 172, (byte) 202, (byte) 168, (byte) 89, (byte) 136,
414 (byte) 10, (byte) 7, (byte) 36, (byte) 210, (byte) 59, (byte) 172, (byte) 104, (byte) 89, (byte) 206,
415 (byte) 0, (byte) 234, (byte) 107, (byte) 50, (byte) 123, (byte) 212, (byte) 153, (byte) 202, (byte) 188,
416 (byte) 37, (byte) 226, (byte) 237, (byte) 243, (byte) 17, (byte) 248, (byte) 241, (byte) 82, (byte) 221,
417 (byte) 134, (byte) 149, (byte) 200, (byte) 239, (byte) 47, (byte) 26, (byte) 228, (byte) 152, (byte) 227,
418 (byte) 202, (byte) 197, (byte) 233, (byte) 221, (byte) 170, (byte) 151, (byte) 151, (byte) 20, (byte) 201,
419 (byte) 204, (byte) 104, (byte) 87, (byte) 28, (byte) 54, (byte) 7, (byte) 205, (byte) 255, (byte) 0,
420 (byte) 214, (byte) 255, (byte) 0, (byte) 61, (byte) 58, (byte) 217, (byte) 117, (byte) 180, (byte) 158,
421 (byte) 65, (byte) 31, (byte) 149, (byte) 60, (byte) 104, (byte) 6, (byte) 231, (byte) 97, (byte) 200,
422 (byte) 62, (byte) 220, (byte) 245, (byte) 255, (byte) 0, (byte) 235, (byte) 115, (byte) 193, (byte) 230,
423 (byte) 95, (byte) 46, (byte) 208, (byte) 253, (byte) 219, (byte) 163, (byte) 207, (byte) 170, (byte) 19,
424 (byte) 89, (byte) 61, (byte) 77, (byte) 17, (byte) 158, (byte) 108, (byte) 237, (byte) 143, (byte) 88,
425 (byte) 23, (byte) 240, (byte) 36, (byte) 127, (byte) 42, (byte) 175, (byte) 54, (byte) 143, (byte) 167,
426 (byte) 78, (byte) 49, (byte) 37, (byte) 170, (byte) 48, (byte) 247, (byte) 231, (byte) 249, (byte) 230,
427 (byte) 181, (byte) 205, (byte) 164, (byte) 103, (byte) 238, (byte) 221, (byte) 196, (byte) 126, (byte) 191,
428 (byte) 45, (byte) 31, (byte) 96, (byte) 145, (byte) 190, (byte) 228, (byte) 145, (byte) 55, (byte) 209,
429 (byte) 243, (byte) 253, (byte) 41, (byte) 89, (byte) 133, (byte) 209, (byte) 203, (byte) 220, (byte) 105,
430 (byte) 30, (byte) 28, (byte) 177, (byte) 144, (byte) 44, (byte) 162, (byte) 218, (byte) 217, (byte) 200,
431 (byte) 200, (byte) 201, (byte) 69, (byte) 63, (byte) 94, (byte) 153, (byte) 20, (byte) 244, (byte) 181,
432 (byte) 211, (byte) 179, (byte) 182, (byte) 13, (byte) 126, (byte) 72, (byte) 200, (byte) 63, (byte) 118,
433 (byte) 27, (byte) 246, (byte) 31, (byte) 160, (byte) 113, (byte) 90, (byte) 18, (byte) 120, (byte) 78,
434 (byte) 79, (byte) 53, (byte) 230, (byte) 89, (byte) 239, (byte) 11, (byte) 200, (byte) 114, (byte) 205,
435 (byte) 231, (byte) 1, (byte) 159, (byte) 110, (byte) 48, (byte) 106, (byte) 164, (byte) 158, (byte) 18,
436 (byte) 186, (byte) 199, (byte) 55, (byte) 37, (byte) 143, (byte) 253, (byte) 52, (byte) 181, (byte) 14,
437 (byte) 127, (byte) 70, (byte) 231, (byte) 252, (byte) 105, (byte) 217, (byte) 245, (byte) 27, (byte) 113,
438 (byte) 182, (byte) 132, (byte) 137, (byte) 166, (byte) 94, (byte) 227, (byte) 117, (byte) 174, (byte) 175,
439 (byte) 118, (byte) 71, (byte) 247, (byte) 153, (byte) 203, (byte) 255, (byte) 0, (byte) 232, (byte) 91,
440 (byte) 169, (byte) 77, (byte) 182, (byte) 186, (byte) 135, (byte) 141, (byte) 105, (byte) 155, (byte) 31,
441 (byte) 194, (byte) 97, (byte) 139, (byte) 255, (byte) 0, (byte) 141, (byte) 131, (byte) 250, (byte) 214,
442 (byte) 115, (byte) 248, (byte) 70, (byte) 97, (byte) 255, (byte) 0, (byte) 44, (byte) 108, (byte) 206,
443 (byte) 14, (byte) 114, (byte) 208, (byte) 24, (byte) 255, (byte) 0, (byte) 161, (byte) 173, (byte) 29,
444 (byte) 39, (byte) 74, (byte) 26, (byte) 126, (byte) 247, (byte) 149, (byte) 209, (byte) 166, (byte) 147,
445 (byte) 130, (byte) 35, (byte) 56, (byte) 69, (byte) 95, (byte) 65, (byte) 211, (byte) 63, (byte) 92,
446 (byte) 127, (byte) 92, (byte) 161, (byte) 33, (byte) 124, (byte) 207, (byte) 17, (byte) 39, (byte) 11,
447 (byte) 45, (byte) 148, (byte) 131, (byte) 214, (byte) 72, (byte) 73, (byte) 63, (byte) 163, (byte) 143,
448 (byte) 229, (byte) 74, (byte) 47, (byte) 245, (byte) 216, (byte) 190, (byte) 245, (byte) 157, (byte) 180,
449 (byte) 196, (byte) 127, (byte) 207, (byte) 48, (byte) 201, (byte) 253, (byte) 90, (byte) 180, (byte) 48,
450 (byte) 126, (byte) 180, (byte) 224, (byte) 15, (byte) 231, (byte) 72, (byte) 101, (byte) 1, (byte) 173,
451 (byte) 106, (byte) 163, (byte) 253, (byte) 102, (byte) 134, (byte) 20, (byte) 122, (byte) 173, (byte) 211,
452 (byte) 31, (byte) 231, (byte) 24, (byte) 254, (byte) 116, (byte) 198, (byte) 215, (byte) 81, (byte) 198,
453 (byte) 219, (byte) 173, (byte) 26, (byte) 241, (byte) 186, (byte) 224, (byte) 175, (byte) 150, (byte) 71,
454 (byte) 39, (byte) 61, (byte) 75, (byte) 131, (byte) 255, (byte) 0, (byte) 234, (byte) 173, (byte) 46,
455 (byte) 248, (byte) 252, (byte) 205, (byte) 57, (byte) 229, (byte) 16, (byte) 199, (byte) 187, (byte) 156,
456 (byte) 14, (byte) 128, (byte) 127, (byte) 42, (byte) 5, (byte) 99, (byte) 138, (byte) 241, (byte) 77,
457 (byte) 192, (byte) 212, (byte) 110, (byte) 32, (byte) 157, (byte) 109, (byte) 228, (byte) 137, (byte) 22,
458 (byte) 63, (byte) 44, (byte) 9, (byte) 217, (byte) 50, (byte) 79, (byte) 83, (byte) 209, (byte) 142,
459 (byte) 56, (byte) 199, (byte) 83, (byte) 216, (byte) 215, (byte) 57, (byte) 60, (byte) 16, (byte) 164,
460 (byte) 139, (byte) 27, (byte) 199, (byte) 9, (byte) 103, (byte) 206, (byte) 54, (byte) 149, (byte) 113,
461 (byte) 198, (byte) 123, (byte) 174, (byte) 64, (byte) 233, (byte) 252, (byte) 143, (byte) 66, (byte) 43,
462 (byte) 168, (byte) 215, (byte) 230, (byte) 55, (byte) 183, (byte) 10, (byte) 3, (byte) 65, (byte) 186,
463 (byte) 55, (byte) 70, (byte) 223, (byte) 59, (byte) 98, (byte) 54, (byte) 251, (byte) 223, (byte) 41,
464 (byte) 245, (byte) 206, (byte) 56, (byte) 3, (byte) 168, (byte) 13, (byte) 233, (byte) 85, (byte) 103,
465 (byte) 179, (byte) 188, (byte) 189, (byte) 71, (byte) 242, (byte) 116, (byte) 171, (byte) 50, (byte) 204,
466 (byte) 191, (byte) 122, (byte) 198, (byte) 9, (byte) 64, (byte) 31, (byte) 48, (byte) 111, (byte) 226,
467 (byte) 24, (byte) 29, (byte) 8, (byte) 227, (byte) 28, (byte) 55, (byte) 126, (byte) 49, (byte) 211,
468 (byte) 77, (byte) 251, (byte) 166, (byte) 82, (byte) 90, (byte) 156, (byte) 133, (byte) 236, (byte) 12,
469 (byte) 183, (byte) 150, (byte) 235, (byte) 109, (byte) 251, (byte) 165, (byte) 116, (byte) 145, (byte) 164,
470 (byte) 218, (byte) 163, (byte) 230, (byte) 198, (byte) 192, (byte) 58, (byte) 143, (byte) 246, (byte) 169,
471 (byte) 5, (byte) 169, (byte) 152, (byte) 136, (byte) 166, (byte) 145, (byte) 165, (byte) 141, (byte) 136,
472 (byte) 12, (byte) 164, (byte) 46, (byte) 15, (byte) 62, (byte) 192, (byte) 86, (byte) 244, (byte) 186,
473 (byte) 93, (byte) 228, (byte) 92, (byte) 203, (byte) 28, (byte) 113, (byte) 251, (byte) 60, (byte) 241,
474 (byte) 131, (byte) 249, (byte) 110, (byte) 205, (byte) 71, (byte) 30, (byte) 159, (byte) 117, (byte) 47,
475 (byte) 250, (byte) 171, (byte) 57, (byte) 165, (byte) 199, (byte) 59, (byte) 162, (byte) 132, (byte) 183,
476 (byte) 234, (byte) 5, (byte) 105, (byte) 161, (byte) 55, (byte) 118, (byte) 51, (byte) 101, (byte) 209,
477 (byte) 45, (byte) 47, (byte) 103, (byte) 6, (byte) 68, (byte) 105, (byte) 102, (byte) 147, (byte) 10,
478 (byte) 25, (byte) 216, (byte) 51, (byte) 30, (byte) 138, (byte) 6, (byte) 79, (byte) 62, (byte) 128,
479 (byte) 126, (byte) 21, (byte) 111, (byte) 64, (byte) 210, (byte) 109, (byte) 173, (byte) 53, (byte) 120,
480 (byte) 37, (byte) 129, (byte) 202, (byte) 228, (byte) 227, (byte) 29, (byte) 71, (byte) 63, (byte) 141,
481 (byte) 109, (byte) 233, (byte) 26, (byte) 129, (byte) 209, (byte) 94, (byte) 113, (byte) 117, (byte) 246,
482 (byte) 155, (byte) 101, (byte) 152, (byte) 47, (byte) 42, (byte) 160, (byte) 19, (byte) 130, (byte) 120,
483 (byte) 33, (byte) 177, (byte) 235, (byte) 80, (byte) 45, (byte) 228, (byte) 55, (byte) 94, (byte) 35,
484 (byte) 89, (byte) 161, (byte) 152, (byte) 202, (byte) 178, (byte) 93, (byte) 33, (byte) 220, (byte) 196,
485 (byte) 100, (byte) 229, (byte) 134, (byte) 123, (byte) 250, (byte) 231, (byte) 30, (byte) 216, (byte) 168,
486 (byte) 247, (byte) 155, (byte) 105, (byte) 173, (byte) 7, (byte) 100, (byte) 146, (byte) 119, (byte) 215,
487 (byte) 177, (byte) 214, (byte) 176, (byte) 228, (byte) 213, (byte) 121, (byte) 164, (byte) 218, (byte) 226,
488 (byte) 56, (byte) 212, (byte) 201, (byte) 41, (byte) 25, (byte) 10, (byte) 14, (byte) 49, (byte) 238,
489 (byte) 79, (byte) 97, (byte) 254, (byte) 7, (byte) 0, (byte) 224, (byte) 225, (byte) 210, (byte) 76,
490 (byte) 242, (byte) 187, (byte) 69, (byte) 109, (byte) 141, (byte) 192, (byte) 225, (byte) 229, (byte) 35,
491 (byte) 33, (byte) 61, (byte) 135, (byte) 171, (byte) 126, (byte) 131, (byte) 190, (byte) 113, (byte) 180,
492 (byte) 190, (byte) 24, (byte) 86, (byte) 8, (byte) 202, (byte) 140, (byte) 156, (byte) 156, (byte) 150,
493 (byte) 39, (byte) 37, (byte) 142, (byte) 7, (byte) 39, (byte) 215, (byte) 255, (byte) 0, (byte) 172,
494 (byte) 43, (byte) 152, (byte) 216, (byte) 185, (byte) 225, (byte) 200, (byte) 60, (byte) 173, (byte) 87,
495 (byte) 204, (byte) 119, (byte) 50, (byte) 74, (byte) 209, (byte) 48, (byte) 45, (byte) 140, (byte) 0,
496 (byte) 50, (byte) 188, (byte) 1, (byte) 216, (byte) 127, (byte) 128, (byte) 201, (byte) 39, (byte) 154,
497 (byte) 42, (byte) 93, (byte) 12, (byte) 255, (byte) 0, (byte) 196, (byte) 208, (byte) 127, (byte) 184,
498 (byte) 194, (byte) 138, (byte) 214, (byte) 27, (byte) 25, (byte) 189, (byte) 206, (byte) 158, (byte) 152,
499 (byte) 238, (byte) 168, (byte) 165, (byte) 152, (byte) 224, (byte) 10, (byte) 29, (byte) 213, (byte) 20,
500 (byte) 179, (byte) 28, (byte) 1, (byte) 89, (byte) 151, (byte) 51, (byte) 180, (byte) 242, (byte) 99,
501 (byte) 149, (byte) 3, (byte) 166, (byte) 123, (byte) 127, (byte) 245, (byte) 255, (byte) 0, (byte) 207,
502 (byte) 213, (byte) 202, (byte) 86, (byte) 4, (byte) 174, (byte) 54, (byte) 230, (byte) 225, (byte) 238,
503 (byte) 31, (byte) 28, (byte) 170, (byte) 131, (byte) 211, (byte) 211, (byte) 255, (byte) 0, (byte) 175,
504 (byte) 254, (byte) 126, (byte) 180, (byte) 53, (byte) 43, (byte) 248, (byte) 244, (byte) 219, (byte) 38,
505 (byte) 153, (byte) 204, (byte) 69, (byte) 254, (byte) 236, (byte) 105, (byte) 38, (byte) 62, (byte) 118,
506 (byte) 244, (byte) 232, (byte) 79, (byte) 191, (byte) 3, (byte) 160, (byte) 53, (byte) 120, (byte) 0,
507 (byte) 56, (byte) 3, (byte) 35, (byte) 182, (byte) 43, (byte) 151, (byte) 214, (byte) 32, (byte) 186,
508 (byte) 184, (byte) 251, (byte) 68, (byte) 177, (byte) 45, (byte) 203, (byte) 179, (byte) 137, (byte) 4,
509 (byte) 34, (byte) 9, (byte) 140, (byte) 160, (byte) 28, (byte) 124, (byte) 167, (byte) 98, (byte) 18,
510 (byte) 6, (byte) 62, (byte) 92, (byte) 241, (byte) 233, (byte) 156, (byte) 214, (byte) 90, (byte) 189,
511 (byte) 77, (byte) 52, (byte) 71, (byte) 63, (byte) 172, (byte) 107, (byte) 115, (byte) 107, (byte) 22,
512 (byte) 242, (byte) 51, (byte) 181, (byte) 178, (byte) 136, (byte) 207, (byte) 151, (byte) 19, (byte) 67,
513 (byte) 41, (byte) 92, (byte) 177, (byte) 56, (byte) 222, (byte) 20, (byte) 156, (byte) 119, (byte) 199,
514 (byte) 174, (byte) 51, (byte) 239, (byte) 78, (byte) 142, (byte) 246, (byte) 255, (byte) 0, (byte) 251,
515 (byte) 68, (byte) 132, (byte) 184, (byte) 188, (byte) 40, (byte) 97, (byte) 12, (byte) 203, (byte) 21,
516 (byte) 217, (byte) 113, (byte) 184, (byte) 177, (byte) 231, (byte) 61, (byte) 73, (byte) 249, (byte) 72,
517 (byte) 252, (byte) 61, (byte) 14, (byte) 40, (byte) 184, (byte) 211, (byte) 210, (byte) 214, (byte) 91,
518 (byte) 85, (byte) 197, (byte) 223, (byte) 151, (byte) 2, (byte) 54, (byte) 67, (byte) 68, (byte) 9,
519 (byte) 83, (byte) 133, (byte) 11, (byte) 213, (byte) 112, (byte) 6, (byte) 55, (byte) 113, (byte) 236,
520 (byte) 181, (byte) 71, (byte) 201, (byte) 141, (byte) 173, (byte) 164, (byte) 6, (byte) 72, (byte) 196,
521 (byte) 211, (byte) 92, (byte) 130, (byte) 223, (byte) 185, (byte) 31, (byte) 42, (byte) 121, (byte) 157,
522 (byte) 114, (byte) 15, (byte) 63, (byte) 39, (byte) 59, (byte) 70, (byte) 59, (byte) 129, (byte) 72,
523 (byte) 11, (byte) 208, (byte) 107, (byte) 186, (byte) 180, (byte) 80, (byte) 89, (byte) 187, (byte) 92,
524 (byte) 207, (byte) 153, (byte) 78, (byte) 11, (byte) 60, (byte) 10, (byte) 251, (byte) 151, (byte) 4,
525 (byte) 228, (byte) 119, (byte) 35, (byte) 145, (byte) 201, (byte) 237, (byte) 223, (byte) 140, (byte) 84,
526 (byte) 237, (byte) 226, (byte) 205, (byte) 66, (byte) 56, (byte) 238, (byte) 143, (byte) 155, (byte) 4,
527 (byte) 173, (byte) 9, (byte) 253, (byte) 216, (byte) 146, (byte) 50, (byte) 9, (byte) 24, (byte) 29,
528 (byte) 74, (byte) 225, (byte) 122, (byte) 231, (byte) 211, (byte) 159, (byte) 65, (byte) 129, (byte) 84,
529 (byte) 163, (byte) 130, (byte) 36, (byte) 189, (byte) 105, (byte) 35, (byte) 104, (byte) 22, (byte) 59,
530 (byte) 120, (byte) 151, (byte) 203, (byte) 0, (byte) 186, (byte) 6, (byte) 56, (byte) 108, (byte) 237,
531 (byte) 4, (byte) 17, (byte) 156, (byte) 96, (byte) 115, (byte) 237, (byte) 239, (byte) 76, (byte) 91,
532 (byte) 105, (byte) 222, (byte) 210, (byte) 218, (byte) 220, (byte) 202, (byte) 210, (byte) 53, (byte) 227,
533 (byte) 111, (byte) 153, (byte) 86, (byte) 225, (byte) 91, (byte) 113, (byte) 10, (byte) 9, (byte) 220,
534 (byte) 27, (byte) 1, (byte) 79, (byte) 11, (byte) 199, (byte) 177, (byte) 29, (byte) 133, (byte) 49,
535 (byte) 155, (byte) 145, (byte) 120, (byte) 190, (byte) 228, (byte) 92, (byte) 172, (byte) 97, (byte) 108,
536 (byte) 217, (byte) 36, (byte) 66, (byte) 200, (byte) 233, (byte) 33, (byte) 64, (byte) 57, (byte) 28,
537 (byte) 100, (byte) 245, (byte) 56, (byte) 201, (byte) 237, (byte) 248, (byte) 98, (byte) 172, (byte) 65,
538 (byte) 227, (byte) 137, (byte) 140, (byte) 16, (byte) 74, (byte) 246, (byte) 115, (byte) 42, (byte) 203,
539 (byte) 32, (byte) 143, (byte) 11, (byte) 114, (byte) 25, (byte) 129, (byte) 44, (byte) 71, (byte) 76,
540 (byte) 122, (byte) 14, (byte) 228, (byte) 117, (byte) 252, (byte) 107, (byte) 157, (byte) 144, (byte) 92,
541 (byte) 43, (byte) 222, (byte) 223, (byte) 58, (byte) 22, (byte) 22, (byte) 160, (byte) 196, (byte) 26,
542 (byte) 72, (byte) 17, (byte) 151, (byte) 43, (byte) 134, (byte) 195, (byte) 31, (byte) 169, (byte) 198,
543 (byte) 125, (byte) 198, (byte) 15, (byte) 81, (byte) 81, (byte) 53, (byte) 160, (byte) 133, (byte) 45,
544 (byte) 237, (byte) 36, (byte) 72, (byte) 198, (byte) 73, (byte) 146, (byte) 67, (byte) 36, (byte) 82,
545 (byte) 70, (byte) 207, (byte) 131, (byte) 247, (byte) 88, (byte) 117, (byte) 193, (byte) 207, (byte) 233,
546 (byte) 138, (byte) 44, (byte) 35, (byte) 179, (byte) 143, (byte) 199, (byte) 10, (byte) 30, (byte) 84,
547 (byte) 146, (byte) 43, (byte) 196, (byte) 120, (byte) 66, (byte) 153, (byte) 23, (byte) 201, (byte) 86,
548 (byte) 218, (byte) 8, (byte) 39, (byte) 57, (byte) 207, (byte) 160, (byte) 255, (byte) 0, (byte) 12,
549 (byte) 243, (byte) 86, (byte) 35, (byte) 241, (byte) 197, (byte) 131, (byte) 136, (byte) 183, (byte) 220,
550 (byte) 5, (byte) 89, (byte) 64, (byte) 43, (byte) 230, (byte) 196, (byte) 70, (byte) 114, (byte) 51,
551 (byte) 142, (byte) 7, (byte) 167, (byte) 225, (byte) 232, (byte) 77, (byte) 112, (byte) 161, (byte) 227,
552 (byte) 243, (byte) 47, (byte) 38, (byte) 85, (byte) 82, (byte) 71, (byte) 238, (byte) 149, (byte) 97,
553 (byte) 148, (byte) 118, (byte) 249, (byte) 115, (byte) 176, (byte) 142, (byte) 65, (byte) 36, (byte) 30,
554 (byte) 123, (byte) 103, (byte) 165, (byte) 77, (byte) 30, (byte) 200, (byte) 18, (byte) 218, (byte) 216,
555 (byte) 153, (byte) 62, (byte) 210, (byte) 177, (byte) 147, (byte) 27, (byte) 9, (byte) 183, (byte) 34,
556 (byte) 54, (byte) 210, (byte) 48, (byte) 48, (byte) 64, (byte) 3, (byte) 57, (byte) 29, (byte) 248,
557 (byte) 35, (byte) 182, (byte) 40, (byte) 11, (byte) 30, (byte) 133, (byte) 105, (byte) 173, (byte) 217,
558 (byte) 95, (byte) 150, (byte) 16, (byte) 165, (byte) 188, (byte) 204, (byte) 167, (byte) 5, (byte) 76,
559 (byte) 101, (byte) 24, (byte) 113, (byte) 232, (byte) 220, (byte) 254, (byte) 149, (byte) 108, (byte) 205,
560 (byte) 22, (byte) 15, (byte) 250, (byte) 24, (byte) 83, (byte) 219, (byte) 14, (byte) 71, (byte) 242,
561 (byte) 172, (byte) 15, (byte) 11, (byte) 104, (byte) 247, (byte) 54, (byte) 22, (byte) 242, (byte) 94,
562 (byte) 94, (byte) 51, (byte) 139, (byte) 155, (byte) 189, (byte) 164, (byte) 198, (byte) 78, (byte) 54,
563 (byte) 168, (byte) 233, (byte) 145, (byte) 221, (byte) 185, (byte) 231, (byte) 250, (byte) 115, (byte) 157,
564 (byte) 226, (byte) 63, (byte) 217, (byte) 95, (byte) 251, (byte) 228, (byte) 127, (byte) 133, (byte) 23,
565 (byte) 21, (byte) 134, (byte) 198, (byte) 246, (byte) 113, (byte) 68, (byte) 136, (byte) 240, (byte) 200,
566 (byte) 48, (byte) 48, (byte) 88, (byte) 177, (byte) 228, (byte) 250, (byte) 253, (byte) 127, (byte) 198,
567 (byte) 178, (byte) 53, (byte) 235, (byte) 216, (byte) 6, (byte) 32, (byte) 183, (byte) 82, (byte) 175,
568 (byte) 143, (byte) 152, (byte) 150, (byte) 206, (byte) 1, (byte) 254, (byte) 167, (byte) 249, (byte) 84,
569 (byte) 154, (byte) 165, (byte) 202, (byte) 136, (byte) 252, (byte) 161, (byte) 134, (byte) 207, (byte) 64,
570 (byte) 123, (byte) 251, (byte) 214, (byte) 20, (byte) 185, (byte) 98, (byte) 89, (byte) 137, (byte) 44,
571 (byte) 78, (byte) 73, (byte) 39, (byte) 169, (byte) 160, (byte) 102, (byte) 7, (byte) 138, (byte) 142,
572 (byte) 52, (byte) 66, (byte) 115, (byte) 130, (byte) 110, (byte) 98, (byte) 239, (byte) 232, (byte) 178,
573 (byte) 255, (byte) 0, (byte) 241, (byte) 85, (byte) 201, (byte) 196, (byte) 98, (byte) 126, (byte) 89,
574 (byte) 85, (byte) 143, (byte) 184, (byte) 174, (byte) 195, (byte) 196, (byte) 177, (byte) 121, (byte) 186,
575 (byte) 28, (byte) 153, (byte) 255, (byte) 0, (byte) 150, (byte) 114, (byte) 43, (byte) 244, (byte) 247,
576 (byte) 11, (byte) 255, (byte) 0, (byte) 179, (byte) 87, (byte) 22, (byte) 150, (byte) 11, (byte) 213,
577 (byte) 102, (byte) 157, (byte) 125, (byte) 196, (byte) 135, (byte) 250, (byte) 154, (byte) 222, (byte) 27,
578 (byte) 25, (byte) 200, (byte) 212, (byte) 183, (byte) 185, (byte) 184, (byte) 135, (byte) 30, (byte) 69,
579 (byte) 204, (byte) 208, (byte) 143, (byte) 250, (byte) 98, (byte) 251, (byte) 127, (byte) 149, (byte) 91,
580 (byte) 254, (byte) 209, (byte) 191, (byte) 63, (byte) 52, (byte) 151, (byte) 215, (byte) 19, (byte) 96,
581 (byte) 103, (byte) 247, (byte) 242, (byte) 180, (byte) 159, (byte) 204, (byte) 226, (byte) 178, (byte) 213,
582 (byte) 150, (byte) 217, (byte) 34, (byte) 71, (byte) 18, (byte) 76, (byte) 207, (byte) 38, (byte) 208,
583 (byte) 217, (byte) 203, (byte) 156, (byte) 140, (byte) 128, (byte) 121, (byte) 0, (byte) 1, (byte) 180,
584 (byte) 246, (byte) 207, (byte) 60, (byte) 231, (byte) 140, (byte) 77, (byte) 43, (byte) 19, (byte) 19,
585 (byte) 132, (byte) 141, (byte) 214, (byte) 77, (byte) 135, (byte) 104, (byte) 32, (byte) 156, (byte) 156,
586 (byte) 113, (byte) 156, (byte) 86, (byte) 150, (byte) 68, (byte) 154, (byte) 209, (byte) 107, (byte) 26,
587 (byte) 132, (byte) 35, (byte) 17, (byte) 204, (byte) 136, (byte) 63, (byte) 217, (byte) 130, (byte) 32,
588 (byte) 127, (byte) 61, (byte) 185, (byte) 253, (byte) 106, (byte) 253, (byte) 134, (byte) 181, (byte) 117,
589 (byte) 115, (byte) 168, (byte) 90, (byte) 219, (byte) 204, (byte) 161, (byte) 214, (byte) 73, (byte) 146,
590 (byte) 51, (byte) 151, (byte) 144, (byte) 99, (byte) 115, (byte) 1, (byte) 192, (byte) 12, (byte) 6,
591 (byte) 121, (byte) 244, (byte) 197, (byte) 114, (byte) 210, (byte) 182, (byte) 162, (byte) 187, (byte) 124,
592 (byte) 152, (byte) 226, (byte) 101, (byte) 11, (byte) 243, (byte) 229, (byte) 246, (byte) 252, (byte) 222,
593 (byte) 221, (byte) 120, (byte) 171, (byte) 218, (byte) 20, (byte) 215, (byte) 103, (byte) 95, (byte) 211,
594 (byte) 146, (byte) 107, (byte) 95, (byte) 45, (byte) 126, (byte) 215, (byte) 15, (byte) 204, (byte) 31,
595 (byte) 112, (byte) 255, (byte) 0, (byte) 88, (byte) 190, (byte) 194, (byte) 165, (byte) 164, (byte) 23,
596 (byte) 61, (byte) 49, (byte) 34, (byte) 72, (byte) 163, (byte) 84, (byte) 69, (byte) 10, (byte) 160,
597 (byte) 96, (byte) 40, (byte) 24, (byte) 0, (byte) 82, (byte) 17, (byte) 252, (byte) 234, (byte) 96,
598 (byte) 50, (byte) 128, (byte) 251, (byte) 85, (byte) 123, (byte) 169, (byte) 225, (byte) 182, (byte) 129,
599 (byte) 230, (byte) 158, (byte) 69, (byte) 138, (byte) 40, (byte) 198, (byte) 89, (byte) 152, (byte) 224,
600 (byte) 10, (byte) 230, (byte) 53, (byte) 47, (byte) 104, (byte) 132, (byte) 13, (byte) 81, (byte) 51,
601 (byte) 221, (byte) 88, (byte) 15, (byte) 202, (byte) 138, (byte) 161, (byte) 225, (byte) 221, (byte) 62,
602 (byte) 255, (byte) 0, (byte) 87, (byte) 212, (byte) 33, (byte) 213, (byte) 231, (byte) 243, (byte) 44,
603 (byte) 244, (byte) 248, (byte) 78, (byte) 235, (byte) 104, (byte) 72, (byte) 195, (byte) 206, (byte) 113,
604 (byte) 141, (byte) 205, (byte) 232, (byte) 190, (byte) 131, (byte) 243, (byte) 246, (byte) 43, (byte) 88,
605 (byte) 232, (byte) 181, (byte) 33, (byte) 157, (byte) 85, (byte) 237, (byte) 220, (byte) 22, (byte) 216,
606 (byte) 251, (byte) 66, (byte) 72, (byte) 83, (byte) 25, (byte) 222, (byte) 177, (byte) 150, (byte) 11,
607 (byte) 245, (byte) 199, (byte) 74, (byte) 170, (byte) 154, (byte) 158, (byte) 143, (byte) 41, (byte) 194,
608 (byte) 222, (byte) 70, (byte) 173, (byte) 220, (byte) 59, (byte) 21, (byte) 35, (byte) 240, (byte) 61,
609 (byte) 43, (byte) 86, (byte) 177, (byte) 117, (byte) 63, (byte) 13, (byte) 165, (byte) 235, (byte) 249,
610 (byte) 182, (byte) 183, (byte) 114, (byte) 88, (byte) 200, (byte) 78, (byte) 91, (byte) 98, (byte) 171,
611 (byte) 163, (byte) 127, (byte) 192, (byte) 72, (byte) 224, (byte) 253, (byte) 49, (byte) 78, (byte) 200,
612 (byte) 69, (byte) 216, (byte) 141, (byte) 165, (byte) 193, (byte) 255, (byte) 0, (byte) 71, (byte) 186,
613 (byte) 142, (byte) 67, (byte) 219, (byte) 99, (byte) 131, (byte) 252, (byte) 169, (byte) 205, (byte) 103,
614 (byte) 201, (byte) 109, (byte) 192, (byte) 177, (byte) 234, (byte) 72, (byte) 228, (byte) 215, (byte) 51,
615 (byte) 55, (byte) 133, (byte) 181, (byte) 193, (byte) 247, (byte) 47, (byte) 244, (byte) 251, (byte) 128,
616 (byte) 58, (byte) 9, (byte) 173, (byte) 221, (byte) 79, (byte) 232, (byte) 216, (byte) 253, (byte) 42,
617 (byte) 31, (byte) 236, (byte) 175, (byte) 18, (byte) 218, (byte) 255, (byte) 0, (byte) 171, (byte) 211,
618 (byte) 173, (byte) 155, (byte) 31, (byte) 197, (byte) 109, (byte) 122, (byte) 99, (byte) 63, (byte) 150,
619 (byte) 223, (byte) 235, (byte) 71, (byte) 42, (byte) 29, (byte) 217, (byte) 208, (byte) 79, (byte) 161,
620 (byte) 199, (byte) 60, (byte) 134, (byte) 82, (byte) 89, (byte) 93, (byte) 186, (byte) 178, (byte) 185,
621 (byte) 244, (byte) 199, (byte) 126, (byte) 59, (byte) 85, (byte) 89, (byte) 60, (byte) 58, (byte) 88,
622 (byte) 96, (byte) 79, (byte) 43, (byte) 15, (byte) 250, (byte) 106, (byte) 21, (byte) 135, (byte) 233,
623 (byte) 138, (byte) 199, (byte) 55, (byte) 190, (byte) 35, (byte) 182, (byte) 63, (byte) 61, (byte) 142,
624 (byte) 176, (byte) 152, (byte) 234, (byte) 35, (byte) 242, (byte) 231, (byte) 95, (byte) 204, (byte) 146,
625 (byte) 105, (byte) 195, (byte) 197, (byte) 247, (byte) 86, (byte) 223, (byte) 241, (byte) 242, (byte) 215,
626 (byte) 49, (byte) 30, (byte) 255, (byte) 0, (byte) 104, (byte) 177, (byte) 112, (byte) 63, (byte) 48,
627 (byte) 160, (byte) 126, (byte) 180, (byte) 185, (byte) 16, (byte) 249, (byte) 153, (byte) 106, (byte) 79,
628 (byte) 11, (byte) 47, (byte) 95, (byte) 46, (byte) 217, (byte) 207, (byte) 253, (byte) 123, (byte) 108,
629 (byte) 253, (byte) 121, (byte) 170, (byte) 146, (byte) 120, (byte) 85, (byte) 59, (byte) 219, (byte) 64,
630 (byte) 73, (byte) 254, (byte) 228, (byte) 207, (byte) 159, (byte) 200, (byte) 224, (byte) 85, (byte) 136,
631 (byte) 188, (byte) 117, (byte) 1, (byte) 225, (byte) 174, (byte) 244, (byte) 246, (byte) 99, (byte) 252,
632 (byte) 38, (byte) 79, (byte) 44, (byte) 254, (byte) 68, (byte) 154, (byte) 209, (byte) 139, (byte) 196,
633 (byte) 194, (byte) 84, (byte) 207, (byte) 216, (byte) 252, (byte) 193, (byte) 216, (byte) 67, (byte) 40,
634 (byte) 124, (byte) 254, (byte) 96, (byte) 15, (byte) 214, (byte) 151, (byte) 32, (byte) 115, (byte) 28,
635 (byte) 228, (byte) 190, (byte) 18, (byte) 5, (byte) 24, (byte) 27, (byte) 107, (byte) 133, (byte) 82,
636 (byte) 48, (byte) 64, (byte) 146, (byte) 50, (byte) 63, (byte) 46, (byte) 77, (byte) 55, (byte) 73,
637 (byte) 240, (byte) 230, (byte) 172, (byte) 111, (byte) 110, (byte) 110, (byte) 103, (byte) 185, (byte) 48,
638 (byte) 172, (byte) 108, (byte) 241, (byte) 192, (byte) 38, (byte) 82, (byte) 204, (byte) 232, (byte) 72,
639 (byte) 231, (byte) 253, (byte) 145, (byte) 242, (byte) 143, (byte) 199, (byte) 61, (byte) 59, (byte) 245,
640 (byte) 81, (byte) 248, (byte) 130, (byte) 193, (byte) 254, (byte) 253, (byte) 172, (byte) 209, (byte) 99,
641 (byte) 174, (byte) 228, (byte) 94, (byte) 63, (byte) 34, (byte) 106, (byte) 117, (byte) 213, (byte) 180,
642 (byte) 167, (byte) 255, (byte) 0, (byte) 150, (byte) 165, (byte) 127, (byte) 222, (byte) 71, (byte) 31,
643 (byte) 210, (byte) 151, (byte) 35, (byte) 31, (byte) 49, (byte) 206, (byte) 71, (byte) 225, (byte) 235,
644 (byte) 232, (byte) 99, (byte) 49, (byte) 175, (byte) 216, (byte) 221, (byte) 76, (byte) 143, (byte) 38,
645 (byte) 30, (byte) 70, (byte) 234, (byte) 204, (byte) 91, (byte) 166, (byte) 223, (byte) 124, (byte) 126,
646 (byte) 21, (byte) 47, (byte) 135, (byte) 188, (byte) 48, (byte) 154, (byte) 76, (byte) 179, (byte) 93,
647 (byte) 207, (byte) 181, (byte) 238, (byte) 100, (byte) 118, (byte) 217, (byte) 180, (byte) 252, (byte) 177,
648 (byte) 169, (byte) 61, (byte) 184, (byte) 228, (byte) 145, (byte) 140, (byte) 159, (byte) 192, (byte) 119,
649 (byte) 39, (byte) 163, (byte) 91, (byte) 189, (byte) 57, (byte) 248, (byte) 75, (byte) 216, (byte) 24,
650 (byte) 158, (byte) 194, (byte) 85, (byte) 205, (byte) 76, (byte) 45, (byte) 209, (byte) 134, (byte) 84,
651 (byte) 130, (byte) 15, (byte) 124, (byte) 102, (byte) 151, (byte) 43, (byte) 14, (byte) 100, (byte) 84,
652 (byte) 219, (byte) 207, (byte) 184, (byte) 170, (byte) 151, (byte) 247, (byte) 43, (byte) 12, (byte) 100,
653 (byte) 117, (byte) 61, (byte) 14, (byte) 63, (byte) 149, (byte) 106, (byte) 61, (byte) 190, (byte) 216,
654 (byte) 216, (byte) 134, (byte) 3, (byte) 3, (byte) 60, (byte) 10, (byte) 229, (byte) 238, (byte) 93,
655 (byte) 166, (byte) 148, (byte) 147, (byte) 156, (byte) 3, (byte) 128, (byte) 42, (byte) 90, (byte) 177,
656 (byte) 73, (byte) 220, (byte) 169, (byte) 41, (byte) 105, (byte) 92, (byte) 187, (byte) 117, (byte) 53,
657 (byte) 3, (byte) 165, (byte) 91, (byte) 43, (byte) 219, (byte) 244, (byte) 172, (byte) 248, (byte) 228,
658 (byte) 187, (byte) 214, (byte) 47, (byte) 26, (byte) 195, (byte) 68, (byte) 69, (byte) 145, (byte) 208,
659 (byte) 226, (byte) 107, (byte) 182, (byte) 25, (byte) 138, (byte) 15, (byte) 254, (byte) 41, (byte) 189,
660 (byte) 191, (byte) 62, (byte) 132, (byte) 80, (byte) 149, (byte) 193, (byte) 153, (byte) 186, (byte) 246,
661 (byte) 211, (byte) 164, (byte) 94, (byte) 219, (byte) 161, (byte) 221, (byte) 57, (byte) 133, (byte) 29,
662 (byte) 34, (byte) 31, (byte) 120, (byte) 129, (byte) 52, (byte) 121, (byte) 56, (byte) 244, (byte) 255,
663 (byte) 0, (byte) 3, (byte) 88, (byte) 87, (byte) 54, (byte) 90, (byte) 91, (byte) 70, (byte) 162,
664 (byte) 29, (byte) 118, (byte) 25, (byte) 153, (byte) 3, (byte) 62, (byte) 193, (byte) 98, (byte) 97,
665 (byte) 125, (byte) 193, (byte) 51, (byte) 140, (byte) 224, (byte) 100, (byte) 18, (byte) 161, (byte) 112,
666 (byte) 79, (byte) 4, (byte) 231, (byte) 28, (byte) 147, (byte) 94, (byte) 181, (byte) 166, (byte) 120,
667 (byte) 67, (byte) 75, (byte) 177, (byte) 179, (byte) 120, (byte) 102, (byte) 139, (byte) 237, (byte) 147,
668 (byte) 79, (byte) 131, (byte) 61, (byte) 196, (byte) 220, (byte) 188, (byte) 135, (byte) 235, (byte) 216,
669 (byte) 123, (byte) 10, (byte) 124, (byte) 222, (byte) 19, (byte) 211, (byte) 93, (byte) 54, (byte) 196,
670 (byte) 247, (byte) 80, (byte) 127, (byte) 185, (byte) 59, (byte) 17, (byte) 244, (byte) 195, (byte) 100,
671 (byte) 126, (byte) 149, (byte) 180, (byte) 116, (byte) 86, (byte) 51, (byte) 111, (byte) 83, (byte) 197,
672 (byte) 26, (byte) 12, (byte) 188, (byte) 108, (byte) 73, (byte) 83, (byte) 27, (byte) 110, (byte) 7,
673 (byte) 29, (byte) 240, (byte) 71, (byte) 245, (byte) 171, (byte) 34, (byte) 95, (byte) 246, (byte) 114,
674 (byte) 58, (byte) 115, (byte) 197, (byte) 122, (byte) 140, (byte) 190, (byte) 2, (byte) 183, (byte) 111,
675 (byte) 185, (byte) 120, (byte) 157, (byte) 115, (byte) 137, (byte) 44, (byte) 45, (byte) 219, (byte) 245,
676 (byte) 8, (byte) 15, (byte) 235, (byte) 84, (byte) 102, (byte) 248, (byte) 124, (byte) 255, (byte) 0,
677 (byte) 193, (byte) 253, (byte) 157, (byte) 39, (byte) 185, (byte) 142, (byte) 116, (byte) 63, (byte) 248,
678 (byte) 236, (byte) 184, (byte) 253, (byte) 42, (byte) 249, (byte) 137, (byte) 177, (byte) 196, (byte) 232,
679 (byte) 250, (byte) 116, (byte) 26, (byte) 133, (byte) 196, (byte) 177, (byte) 207, (byte) 36, (byte) 232,
680 (byte) 171, (byte) 30, (byte) 71, (byte) 145, (byte) 24, (byte) 115, (byte) 156, (byte) 129, (byte) 158,
681 (byte) 189, (byte) 6, (byte) 106, (byte) 118, (byte) 183, (byte) 142, (byte) 203, (byte) 197, (byte) 22,
682 (byte) 241, (byte) 195, (byte) 191, (byte) 202, (byte) 23, (byte) 49, (byte) 58, (byte) 110, (byte) 77,
683 (byte) 188, (byte) 22, (byte) 7, (byte) 212, (byte) 156, (byte) 3, (byte) 145, (byte) 215, (byte) 181,
684 (byte) 116, (byte) 167, (byte) 193, (byte) 23, (byte) 246, (byte) 239, (byte) 190, (byte) 11, (byte) 82,
685 (byte) 174, (byte) 58, (byte) 61, (byte) 174, (byte) 163, (byte) 229, (byte) 159, (byte) 195, (byte) 116,
686 (byte) 68, (byte) 255, (byte) 0, (byte) 227, (byte) 213, (byte) 93, (byte) 188, (byte) 35, (byte) 173,
687 (byte) 155, (byte) 184, (byte) 238, (byte) 166, (byte) 183, (byte) 184, (byte) 118, (byte) 71, (byte) 83,
688 (byte) 243, (byte) 92, (byte) 164, (byte) 206, (byte) 66, (byte) 158, (byte) 57, (byte) 37, (byte) 106,
689 (byte) 44, (byte) 249, (byte) 249, (byte) 175, (byte) 167, (byte) 99, (byte) 75, (byte) 195, (byte) 146,
690 (byte) 214, (byte) 215, (byte) 189, (byte) 255, (byte) 0, (byte) 67, (byte) 110, (byte) 238, (byte) 242,
691 (byte) 223, (byte) 79, (byte) 178, (byte) 251, (byte) 69, (byte) 204, (byte) 155, (byte) 16, (byte) 0,
692 (byte) 56, (byte) 25, (byte) 44, (byte) 79, (byte) 64, (byte) 7, (byte) 114, (byte) 125, (byte) 41,
693 (byte) 52, (byte) 127, (byte) 14, (byte) 220, (byte) 106, (byte) 247, (byte) 17, (byte) 234, (byte) 154,
694 (byte) 236, (byte) 94, (byte) 92, (byte) 40, (byte) 119, (byte) 91, (byte) 88, (byte) 30, (byte) 139,
695 (byte) 232, (byte) 242, (byte) 122, (byte) 183, (byte) 183, (byte) 111, (byte) 207, (byte) 55, (byte) 52,
696 (byte) 95, (byte) 13, (byte) 204, (byte) 247, (byte) 73, (byte) 171, (byte) 107, (byte) 155, (byte) 94,
697 (byte) 237, (byte) 127, (byte) 212, (byte) 91, (byte) 41, (byte) 204, (byte) 118, (byte) 163, (byte) 219,
698 (byte) 213, (byte) 189, (byte) 91, (byte) 250, (byte) 99, (byte) 29, (byte) 53, (byte) 76, (byte) 99,
699 (byte) 97, (byte) 54, (byte) 0, (byte) 1, (byte) 192, (byte) 224, (byte) 81, (byte) 75, (byte) 69,
700 (byte) 89, (byte) 33, (byte) 69, (byte) 20, (byte) 80, (byte) 1, (byte) 73, (byte) 69, (byte) 20, (byte) 0,
701 (byte) 180, (byte) 152, (byte) 207, (byte) 90, (byte) 40, (byte) 160, (byte) 10, (byte) 243, (byte) 88,
702 (byte) 89, (byte) 220, (byte) 12, (byte) 77, (byte) 105, (byte) 4, (byte) 128, (byte) 255, (byte) 0,
703 (byte) 122, (byte) 48, (byte) 107, (byte) 54, (byte) 111, (byte) 7, (byte) 120, (byte) 114, (byte) 115,
704 (byte) 185, (byte) 244, (byte) 123, (byte) 96, (byte) 222, (byte) 168, (byte) 155, (byte) 79, (byte) 233,
705 (byte) 69, (byte) 20, (byte) 1, (byte) 89, (byte) 188, (byte) 17, (byte) 165, (byte) 143, (byte) 248,
706 (byte) 247, (byte) 184, (byte) 212, (byte) 45, (byte) 135, (byte) 101, (byte) 138, (byte) 241, (byte) 246,
707 (byte) 143, (byte) 192, (byte) 146, (byte) 42, (byte) 7, (byte) 240, (byte) 93, (byte) 194, (byte) 255,
708 (byte) 0, (byte) 199, (byte) 182, (byte) 191, (byte) 118, (byte) 163, (byte) 178, (byte) 205, (byte) 20,
709 (byte) 114, (byte) 126, (byte) 187, (byte) 115, (byte) 69, (byte) 20, (byte) 92, (byte) 8, (byte) 31,
710 (byte) 194, (byte) 254, (byte) 32, (byte) 143, (byte) 136, (byte) 181, (byte) 27, (byte) 9, (byte) 215,
711 (byte) 210, (byte) 88, (byte) 29, (byte) 79, (byte) 232, (byte) 216, (byte) 253, (byte) 42, (byte) 164,
712 (byte) 154, (byte) 39, (byte) 136, (byte) 225, (byte) 231, (byte) 251, (byte) 54, (byte) 218, (byte) 95,
713 (byte) 246, (byte) 173, (byte) 175, (byte) 154, (byte) 35, (byte) 255, (byte) 0, (byte) 160, (byte) 231,
714 (byte) 245, (byte) 162, (byte) 138, (byte) 119, (byte) 1, (byte) 26, (byte) 125, (byte) 122, (byte) 216,
715 (byte) 98, (byte) 77, (byte) 47, (byte) 88, (byte) 140, (byte) 142, (byte) 134, (byte) 23, (byte) 89,
716 (byte) 64, (byte) 252, (byte) 11, (byte) 16, (byte) 127, (byte) 21, (byte) 52, (byte) 209, (byte) 173,
717 (byte) 100, (byte) 236, (byte) 187, (byte) 211, (byte) 111, (byte) 195, (byte) 147, (byte) 247, (byte) 163,
718 (byte) 178, (byte) 144, (byte) 17, (byte) 245, (byte) 24, (byte) 193, (byte) 247, (byte) 32, (byte) 253,
719 (byte) 5, (byte) 20, (byte) 82, (byte) 105, (byte) 49, (byte) 167, (byte) 97, (byte) 214, (byte) 218,
720 (byte) 62, (byte) 163, (byte) 226, (byte) 89, (byte) 74, (byte) 186, (byte) 207, (byte) 167, (byte) 105,
721 (byte) 32, (byte) 225, (byte) 153, (byte) 148, (byte) 164, (byte) 247, (byte) 62, (byte) 192, (byte) 117,
722 (byte) 69, (byte) 253, (byte) 79, (byte) 183, (byte) 34, (byte) 187, (byte) 75, (byte) 13, (byte) 62,
723 (byte) 211, (byte) 75, (byte) 179, (byte) 142, (byte) 210, (byte) 202, (byte) 4, (byte) 130, (byte) 24,
724 (byte) 198, (byte) 21, (byte) 84, (byte) 81, (byte) 69, (byte) 36, (byte) 172, (byte) 13, (byte) 220,
725 (byte) 181, (byte) 69, (byte) 20, (byte) 83, (byte) 16, (byte) 81, (byte) 69, (byte) 20, (byte) 0,
726 (byte) 148, (byte) 81, (byte) 69, (byte) 0, (byte) 45, (byte) 20, (byte) 81, (byte) 64, (byte) 5,
727 (byte) 20, (byte) 81, (byte) 64, (byte) 31, (byte) 255, (byte) 217
728
729 };
730
73189 }
3434 */
3535 package net.sourceforge.plantuml.flashcode;
3636
37 import java.awt.Color;
3738 import java.awt.image.BufferedImage;
3839
3940 public interface FlashCodeUtils {
4041
41 public BufferedImage exportFlashcode(String s);
42 public BufferedImage exportFlashcode(String s, Color fore, Color back);
4243
4344 }
3434 */
3535 package net.sourceforge.plantuml.flashcode;
3636
37 import java.awt.Color;
3738 import java.awt.image.BufferedImage;
3839
3940 public class FlashCodeUtilsNone implements FlashCodeUtils {
4041
41 public BufferedImage exportFlashcode(String s) {
42 public BufferedImage exportFlashcode(String s, Color fore, Color back) {
4243 return null;
4344 }
4445
3434 */
3535 package net.sourceforge.plantuml.flashcode;
3636
37 import java.awt.Color;
3738 import java.awt.image.BufferedImage;
3839 import java.util.Hashtable;
3940
4041 import net.sourceforge.plantuml.Log;
41
4242 import ext.plantuml.com.google.zxing.BarcodeFormat;
4343 import ext.plantuml.com.google.zxing.EncodeHintType;
4444 import ext.plantuml.com.google.zxing.WriterException;
4949
5050 public class FlashCodeUtilsZxing implements FlashCodeUtils {
5151
52 public BufferedImage exportFlashcode(String s) {
52 private static final boolean USE_FLASH = true;
53
54 public BufferedImage exportFlashcode(String s, Color fore, Color back) {
55 if (USE_FLASH == false) {
56 return null;
57 }
5358 try {
5459 final QRCodeWriter writer = new QRCodeWriter();
5560 final Hashtable hints = new Hashtable();
5762 hints.put(EncodeHintType.CHARACTER_SET, "UTF8");
5863 final int multiple = 1;
5964 final BitMatrix bit = writer.encode(s, BarcodeFormat.QR_CODE, multiple, hints);
60 return MatrixToImageWriter.toBufferedImage(bit);
65 return MatrixToImageWriter.toBufferedImage(bit, fore.getRGB() | 0xFF000000, back.getRGB() | 0xFF000000);
6166 } catch (WriterException e) {
62 Log.debug("Cannot create flashcode " + e);
67 Log.debug("Cannot create qrcode " + e);
6368 // e.printStackTrace();
6469 return null;
6570 }
104104 }
105105
106106 private Diagram getSystem() throws IOException, InterruptedException {
107 final BlockUml blockUml = new BlockUml(lines2, 0, Defines.createEmpty());
107 final BlockUml blockUml = new BlockUml(lines2, Defines.createEmpty());
108108 return blockUml.getDiagram();
109109
110110 }
4747 if (color1 == null || color2 == null) {
4848 throw new IllegalArgumentException();
4949 }
50 if (color1 instanceof HtmlColorGradient) {
51 color1 = ((HtmlColorGradient) color1).color1;
52 }
53 if (color2 instanceof HtmlColorGradient) {
54 color2 = ((HtmlColorGradient) color2).color2;
55 }
5056 this.color1 = color1;
5157 this.color2 = color2;
5258 this.policy = policy;
253253 "Lbh xabj jung fhecevfrq zr gur zbfg? Vg jnfa'g zrrgvat gurz. Vg jnf zrrgvat lbh.",
254254 "Va jne gurer ner ab jvaaref, bayl jvqbjf",
255255 "Vs lbh guvax guvf Havirefr vf onq, lbh fubhyq frr fbzr bs gur bguref", "Cnp-Zna'f n onq thl?",
256 "Zl ernyvgl vf whfg qvssrerag guna lbhef",
257 "Uvfgbel vf n avtugzner sebz juvpu V nz gelvat gb njnxr",
258 "L'ra n dh'bag rffnlr, vyf bag rh qrf ceboyrzrf",
259 "Gb ree vf uhzna, ohg gb ernyyl sbhy guvatf hc erdhverf n pbzchgre.");
256 "Zl ernyvgl vf whfg qvssrerag guna lbhef", "L'ra n dh'bag rffnlr, vyf bag rh qrf ceboyrzrf",
257 "Gb ree vf uhzna, ohg gb ernyyl sbhy guvatf hc erdhverf n pbzchgre.",
258 "Vs lbh oryvrir rirelguvat lbh ernq, lbh orggre abg ernq",
259 "Gurer vf ab ceboyrz fb onq lbh pna'g znxr vg jbefr", "Pn p'rfg qh ybheq... Ha gehp qr znynqr.",
260 "V qb abg guvax, gung V guvax.. V guvax.", "Gurer ner cynprf ybjre guna gur onfrzrag",
261 "Gurer ner 10 glcrf bs crbcyr: gubfr jub haqrefgnaq ovanel, naq gubfr jub qba'g.",
262 "Cyrnfr zvaq gur tnc orgjrra gur genva naq gur cyngsbez", "Nfuvzbgb av tb-puhv xhqnfnv",
263 "Vs lbh'er erprvivat guvf genafzvffvba, znxr ab nggrzcg gb pbzr gb vgf cbvag bs bevtva.",
264 "Obl, qb V ungr orvat evtug nyy gur gvzr!",
265 "Jub funirf gur oneore jub funirf nyy gur zra jub qba'g funir gurzfryirf?",
266 "V haqrefgnaq uhzna rzbgvbaf, nygubhtu V qb abg srry gurz zlfrys.",
267 "Lbh qvqa'g fnl gur zntvp jbeq!");
260268
261269 private QuoteUtils() {
262270 }
5656 public static final String fontSizePattern2 = "\\<size[\\s:]+(\\d+)[%s]*\\>";
5757 static final String fontSup = "\\<sup\\>";
5858 static final String fontSub = "\\<sub\\>";
59 public static final String qrcodePattern = "\\<qrcode[\\s:]+([^>{}]+)" + "(\\{scale=(?:[0-9.]+)\\})?" + "\\>";
5960 static final String imgPattern = "\\<img\\s+(src[%s]*=[%s]*[%q%g]?[^\\s%g>]+[%q%g]?[%s]*|vspace\\s*=\\s*[%q%g]?\\d+[%q%g]?\\s*|valign[%s]*=[%s]*[%q%g]?(top|middle|bottom)[%q%g]?[%s]*)+\\>";
6061 public static final String imgPatternNoSrcColon = "\\<img[\\s:]+([^>{}]+)" + "(\\{scale=(?:[0-9.]+)\\})?" + "\\>";
6162 public static final String fontFamilyPattern = "\\<font[\\s:]+([^>]+)/?\\>";
9596 sb.append(endFontPattern);
9697 sb.append('|');
9798 sb.append(endSupSub);
99 sb.append('|');
100 sb.append(qrcodePattern);
98101 sb.append('|');
99102 sb.append(imgPattern);
100103 sb.append('|');
7777 }
7878
7979 public HtmlColor getBackcolor() {
80 return ((TextBlockBackcolored) textBlock).getBackcolor();
80 if (textBlock instanceof TextBlockBackcolored) {
81 return ((TextBlockBackcolored) textBlock).getBackcolor();
82 }
83 return null;
8184 }
8285
8386 }
5353 import net.sourceforge.plantuml.posimo.Positionable;
5454 import net.sourceforge.plantuml.posimo.PositionableImpl;
5555 import net.sourceforge.plantuml.skin.rose.Rose;
56 import net.sourceforge.plantuml.svek.TextBlockBackcolored;
5657 import net.sourceforge.plantuml.ugraphic.LimitFinder;
5758 import net.sourceforge.plantuml.ugraphic.MinMax;
5859 import net.sourceforge.plantuml.ugraphic.UFont;
5960 import net.sourceforge.plantuml.ugraphic.UGraphic;
61 import net.sourceforge.plantuml.ugraphic.UImage;
6062 import net.sourceforge.plantuml.ugraphic.UStroke;
6163
6264 public class TextBlockUtils {
164166 public Dimension2D calculateDimension(StringBounder stringBounder) {
165167 return bloc.calculateDimension(stringBounder);
166168 }
167
169
168170 public MinMax getMinMax(StringBounder stringBounder) {
169171 return bloc.getMinMax(stringBounder);
170172 }
180182 };
181183 }
182184
185 public static TextBlockBackcolored addBackcolor(final TextBlock text, final HtmlColor backColor) {
186 return new TextBlockBackcolored() {
187 public void drawU(UGraphic ug) {
188 text.drawU(ug);
189 }
190
191 public MinMax getMinMax(StringBounder stringBounder) {
192 return text.getMinMax(stringBounder);
193 }
194
195 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
196 return text.getInnerPosition(member, stringBounder, strategy);
197 }
198
199 public Dimension2D calculateDimension(StringBounder stringBounder) {
200 return text.calculateDimension(stringBounder);
201 }
202
203 public HtmlColor getBackcolor() {
204 return backColor;
205 }
206 };
207 }
208
209 public static TextBlock fromUImage(final UImage image) {
210 return new TextBlock() {
211
212 public void drawU(UGraphic ug) {
213 ug.draw(image);
214 }
215
216 public Dimension2D calculateDimension(StringBounder stringBounder) {
217 return new Dimension2DDouble(image.getWidth(), image.getHeight());
218 }
219
220 public MinMax getMinMax(StringBounder stringBounder) {
221 return MinMax.fromMax(image.getWidth(), image.getHeight());
222 }
223
224 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
225 return null;
226 }
227
228 };
229 }
230
183231 }
4444
4545 final private UGraphic ug;
4646
47 @Override
48 public String toString() {
49 return super.toString() + " " + getUg().toString();
50 }
51
52
4753 public final boolean matchesProperty(String propertyName) {
4854 return ug.matchesProperty(propertyName);
49 }
50
51 public double dpiFactor() {
52 return ug.dpiFactor();
5355 }
5456
5557 public UGraphicDelegator(UGraphic ug) {
5656 public final static USymbol NODE = record("NODE", SkinParameter.NODE, new USymbolNode());
5757 public final static USymbol ARTIFACT = record("ARTIFACT", SkinParameter.ARTIFACT, new USymbolArtifact());
5858 public final static USymbol PACKAGE = record("PACKAGE", SkinParameter.PACKAGE, new USymbolFolder(
59 SkinParameter.PACKAGE));
60 public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER));
59 SkinParameter.PACKAGE, true));
60 public final static USymbol FOLDER = record("FOLDER", SkinParameter.FOLDER, new USymbolFolder(SkinParameter.FOLDER, false));
6161 public final static USymbol FILE = record("FILE", SkinParameter.FILE, new USymbolFile());
6262 public final static USymbol RECTANGLE = record("RECTANGLE", SkinParameter.RECTANGLE, new USymbolRect(
6363 SkinParameter.RECTANGLE, HorizontalAlignment.CENTER));
5757 private final static int marginTitleY2 = 3;
5858
5959 private final SkinParameter skinParameter;
60 private final boolean showTitle;
6061
61 public USymbolFolder(SkinParameter skinParameter) {
62 public USymbolFolder(SkinParameter skinParameter, boolean showTitle) {
6263 this.skinParameter = skinParameter;
64 this.showTitle = showTitle;
6365 }
6466
6567 @Override
141143 final Dimension2D dim = calculateDimension(ug.getStringBounder());
142144 ug = UGraphicStencil.create(ug, getRectangleStencil(dim), new UStroke());
143145 ug = symbolContext.apply(ug);
144 final Dimension2D dimName = name.calculateDimension(ug.getStringBounder());
146 final Dimension2D dimName = showTitle ? name.calculateDimension(ug.getStringBounder())
147 : new Dimension2DDouble(40, 15);
145148 drawFolder(ug, dim.getWidth(), dim.getHeight(), dimName, symbolContext.isShadowing(),
146149 symbolContext.getRoundCorner());
147150 final Margin margin = getMargin();
148151 final TextBlock tb = TextBlockUtils.mergeTB(stereotype, label, HorizontalAlignment.CENTER);
149 name.drawU(ug.apply(new UTranslate(4, 3)));
152 if (showTitle) {
153 name.drawU(ug.apply(new UTranslate(4, 3)));
154 }
150155 tb.drawU(ug.apply(new UTranslate(margin.getX1(), margin.getY1() + dimName.getHeight())));
151156 }
152157
5353 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
5454 import net.sourceforge.plantuml.skin.rose.Rose;
5555 import net.sourceforge.plantuml.svek.CucaDiagramFileMaker;
56 import net.sourceforge.plantuml.svek.DotDataImageBuilder;
56 import net.sourceforge.plantuml.svek.GeneralImageBuilder;
5757 import net.sourceforge.plantuml.svek.IEntityImage;
5858 import net.sourceforge.plantuml.ugraphic.MinMax;
5959 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
161161 }
162162
163163 private IEntityImage computeImage(final ILeaf leaf) {
164 final IEntityImage image = DotDataImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
164 final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
165165 false, diagram, null, null, null, diagram.getLinks());
166166 return image;
167167 }
4242 import net.sourceforge.plantuml.cucadiagram.ILeaf;
4343 import net.sourceforge.plantuml.graphic.StringBounder;
4444 import net.sourceforge.plantuml.hector2.layering.Layer;
45 import net.sourceforge.plantuml.svek.DotDataImageBuilder;
45 import net.sourceforge.plantuml.svek.GeneralImageBuilder;
4646 import net.sourceforge.plantuml.svek.IEntityImage;
4747
4848 public class Foo1 {
5858 }
5959
6060 private static IEntityImage computeImage(final ILeaf leaf, CucaDiagram diagram) {
61 final IEntityImage image = DotDataImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
61 final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
6262 false, diagram, null, null, null, diagram.getLinks());
6363 return image;
6464 }
4646 import net.sourceforge.plantuml.hector2.MinMax;
4747 import net.sourceforge.plantuml.hector2.layering.Layer;
4848 import net.sourceforge.plantuml.hector2.mpos.Distribution;
49 import net.sourceforge.plantuml.svek.DotDataImageBuilder;
49 import net.sourceforge.plantuml.svek.GeneralImageBuilder;
5050 import net.sourceforge.plantuml.svek.IEntityImage;
5151 import net.sourceforge.plantuml.ugraphic.UGraphic;
5252 import net.sourceforge.plantuml.ugraphic.UTranslate;
9999 }
100100
101101 private IEntityImage computeImage(final ILeaf leaf) {
102 final IEntityImage image = DotDataImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
102 final IEntityImage image = GeneralImageBuilder.createEntityImageBlock(leaf, diagram.getSkinParam(),
103103 false, diagram, null, null, null, diagram.getLinks());
104104 return image;
105105 }
4141 import static gen.lib.cgraph.subg__c.agsubg;
4242 import static gen.lib.gvc.gvc__c.gvContext;
4343 import static gen.lib.gvc.gvlayout__c.gvLayoutJobs;
44 import h.Agedge_s;
45 import h.Agnode_s;
46 import h.Agnodeinfo_t;
47 import h.Agraph_s;
48 import h.Agraphinfo_t;
49 import h.GVC_s;
44 import h.ST_Agraph_s;
45 import h.ST_Agraphinfo_t;
46 import h.ST_Agedge_s;
47 import h.ST_Agnode_s;
48 import h.ST_Agnodeinfo_t;
49 import h.ST_Agraphinfo_t;
50 import h.ST_GVC_s;
5051 import h.ST_boxf;
51 import h.boxf;
5252
5353 import java.awt.geom.Dimension2D;
5454 import java.awt.geom.Point2D;
9898 import net.sourceforge.plantuml.svek.Bibliotekon;
9999 import net.sourceforge.plantuml.svek.Cluster;
100100 import net.sourceforge.plantuml.svek.CucaDiagramFileMaker;
101 import net.sourceforge.plantuml.svek.DotDataImageBuilder;
102101 import net.sourceforge.plantuml.svek.DotStringFactory;
102 import net.sourceforge.plantuml.svek.GeneralImageBuilder;
103103 import net.sourceforge.plantuml.svek.GraphvizCrash;
104104 import net.sourceforge.plantuml.svek.IEntityImage;
105105 import net.sourceforge.plantuml.svek.Shape;
110110 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
111111 import smetana.core.CString;
112112 import smetana.core.JUtils;
113 import smetana.core.JUtilsDebug;
113114 import smetana.core.Macro;
114115 import smetana.core.Z;
115 import smetana.core.__ptr__;
116 import smetana.core.__struct__;
117116
118117 public class CucaDiagramFileMakerJDot implements CucaDiagramFileMaker {
119118
120119 private final CucaDiagram diagram;
121120
122121 private final StringBounder stringBounder;
123 private final Map<ILeaf, Agnode_s> nodes = new LinkedHashMap<ILeaf, Agnode_s>();
124 private final Map<Link, Agedge_s> edges = new LinkedHashMap<Link, Agedge_s>();
125 private final Map<IGroup, Agraph_s> clusters = new LinkedHashMap<IGroup, Agraph_s>();
122 private final Map<ILeaf, ST_Agnode_s> nodes = new LinkedHashMap<ILeaf, ST_Agnode_s>();
123 private final Map<Link, ST_Agedge_s> edges = new LinkedHashMap<Link, ST_Agedge_s>();
124 private final Map<IGroup, ST_Agraph_s> clusters = new LinkedHashMap<IGroup, ST_Agraph_s>();
126125 private Map<IGroup, ILeaf> emptyGroups = new HashMap<IGroup, ILeaf>();
127126
128127 private final DotStringFactory dotStringFactory;
137136
138137 public void drawU(UGraphic ug) {
139138
140 for (Map.Entry<IGroup, Agraph_s> ent : clusters.entrySet()) {
139 for (Map.Entry<IGroup, ST_Agraph_s> ent : clusters.entrySet()) {
141140 drawGroup(ug, ymirror, ent.getKey(), ent.getValue());
142141 }
143142
144 for (Map.Entry<ILeaf, Agnode_s> ent : nodes.entrySet()) {
143 for (Map.Entry<ILeaf, ST_Agnode_s> ent : nodes.entrySet()) {
145144 final ILeaf leaf = ent.getKey();
146 final Agnode_s node = ent.getValue();
145 final ST_Agnode_s node = ent.getValue();
147146 final Point2D corner = getCorner(node);
148147
149148 final Shape shape = dotStringFactory.getBibliotekon().getShape(leaf);
151150 image.drawU(ug.apply(new UTranslate(corner)));
152151 }
153152
154 for (Map.Entry<Link, Agedge_s> ent : edges.entrySet()) {
153 for (Map.Entry<Link, ST_Agedge_s> ent : edges.entrySet()) {
155154 final Link link = ent.getKey();
156 final Agedge_s edge = ent.getValue();
157 new JDotPath(link, edge, ymirror, diagram, getLabel(link)).drawU(ug);
158 }
159 }
160
161 private Point2D getCorner(Agnode_s n) {
162 final Agnodeinfo_t data = (Agnodeinfo_t) Macro.AGDATA(n).castTo(Agnodeinfo_t.class);
163 final double width = data.getDouble("width") * 72;
164 final double height = data.getDouble("height") * 72;
165 final double x = data.getStruct("coord").getDouble("x");
166 final double y = data.getStruct("coord").getDouble("y");
155 final ST_Agedge_s edge = ent.getValue();
156 new JDotPath(link, edge, ymirror, diagram, getLabel(link), getQualifier(link, 1), getQualifier(link, 2)).drawU(ug);
157 }
158 }
159
160 private Point2D getCorner(ST_Agnode_s n) {
161 final ST_Agnodeinfo_t data = (ST_Agnodeinfo_t) Macro.AGDATA(n).castTo(ST_Agnodeinfo_t.class);
162 final double width = data.width * 72;
163 final double height = data.height * 72;
164 final double x = data.coord.x;
165 final double y = data.coord.y;
167166
168167 if (ymirror == null) {
169168 return new Point2D.Double(x - width / 2, y - height / 2);
183182
184183 }
185184
186 public void drawGroup(UGraphic ug, YMirror ymirror, IGroup group, Agraph_s gr) {
185 public void drawGroup(UGraphic ug, YMirror ymirror, IGroup group, ST_Agraph_s gr) {
187186 JUtils.LOG2("drawGroup");
188 final __ptr__ data = Macro.AGDATA(gr).castTo(Agraphinfo_t.class);
189 final ST_boxf bb = (ST_boxf) data.getStruct("bb");
187 final ST_Agraphinfo_t data = (ST_Agraphinfo_t) Macro.AGDATA(gr).castTo(ST_Agraphinfo_t.class);
188 final ST_boxf bb = (ST_boxf) data.bb;
190189 final double llx = bb.LL.x;
191190 double lly = bb.LL.y;
192191 final double urx = bb.UR.x;
282281 }
283282 }
284283
285 private void exportEntities(Agraph_s g, Collection<ILeaf> entities2) {
284 private void exportEntities(ST_Agraph_s g, Collection<ILeaf> entities2) {
286285 for (ILeaf ent : entities2) {
287286 if (ent.isRemoved()) {
288287 continue;
291290 }
292291 }
293292
294 private void exportEntity(Agraph_s g, ILeaf leaf) {
293 private void exportEntity(ST_Agraph_s g, ILeaf leaf) {
295294 final Shape shape = dotStringFactory.getBibliotekon().getShape(leaf);
296295 // System.err.println("exportEntity " + leaf);
297 final Agnode_s node = agnode(g, new CString(shape.getUid()), true);
296 final ST_Agnode_s node = agnode(g, new CString(shape.getUid()), true);
298297 agsafeset(node, new CString("shape"), new CString("box"), new CString(""));
299298 final String width = "" + (shape.getWidth() / 72);
300299 final String height = "" + (shape.getHeight() / 72);
363362 return result;
364363 }
365364
366 private void printCluster(Agraph_s g, Cluster cluster) {
365 private void printCluster(ST_Agraph_s g, Cluster cluster) {
367366 for (Shape shape : cluster.getShapes()) {
368 final Agnode_s node = agnode(g, new CString(shape.getUid()), true);
367 final ST_Agnode_s node = agnode(g, new CString(shape.getUid()), true);
369368 agsafeset(node, new CString("shape"), new CString("box"), new CString(""));
370369 final String width = "" + (shape.getWidth() / 72);
371370 final String height = "" + (shape.getHeight() / 72);
398397
399398 Z.open();
400399 try {
401 final Agraph_s g = agopen(new CString("g"), Z.z().Agdirected, null);
400 final ST_Agraph_s g = agopen(new CString("g"), Z.z().Agdirected, null);
402401
403402 // printCluster(g, root);
404403 exportEntities(g, getUnpackagedEntities());
419418 //
420419 for (Link link : diagram.getLinks()) {
421420 // System.err.println("link=" + link);
422 final Agedge_s e = createEdge(g, link);
421 final ST_Agedge_s e = createEdge(g, link);
423422 // System.err.println("Agedge_s=" + e);
424423 if (e != null) {
425424 edges.put(link, e);
426425 }
427426 }
428427
429 final GVC_s gvc = gvContext();
428 final ST_GVC_s gvc = gvContext();
429 JUtilsDebug.reset();
430430 gvLayoutJobs(gvc, g);
431 JUtilsDebug.printMe();
431432
432433 // for (Agedge_s e : edges.values()) {
433434 // DebugUtils.printDebugEdge(e);
446447
447448 return imageBuilder.writeImageTOBEMOVED(fileFormatOption, diagram.seed(), os);
448449 } catch (Throwable e) {
450 JUtilsDebug.printMe();
449451 UmlDiagram.exportDiagramError(os, e, fileFormatOption, diagram.seed(), diagram.getMetadata(),
450452 diagram.getFlashData(), getFailureText3(e));
451453 return ImageDataSimple.error();
454456 }
455457 }
456458
457 private void exportGroups(Agraph_s graph, IGroup parent) {
459 private void exportGroups(ST_Agraph_s graph, IGroup parent) {
458460 for (IGroup g : diagram.getChildrenGroups(parent)) {
459461 if (g.isRemoved()) {
460462 continue;
469471
470472 }
471473
472 private void exportGroup(Agraph_s graph, IGroup group) {
474 private void exportGroup(ST_Agraph_s graph, IGroup group) {
473475 final Cluster cluster = getBibliotekon().getCluster(group);
474476 JUtils.LOG2("cluster = " + cluster.getClusterId());
475 final Agraph_s cluster1 = agsubg(graph, new CString(cluster.getClusterId()), true);
477 final ST_Agraph_s cluster1 = agsubg(graph, new CString(cluster.getClusterId()), true);
476478 if (cluster.isLabel()) {
477479 final double width = cluster.getTitleAndAttributeWidth();
478480 final double height = cluster.getTitleAndAttributeHeight() - 5;
494496 return label;
495497 }
496498 return TextBlockUtils.withMargin(label, marginLabel, marginLabel);
497
498 }
499
500 private Agnode_s getAgnodeFromLeaf(IEntity entity) {
501 final Agnode_s n = nodes.get(entity);
499 }
500
501 private TextBlock getQualifier(Link link, int n) {
502 final String tmp = n == 1 ? link.getQualifier1() : link.getQualifier2();
503 if (tmp == null) {
504 return null;
505 }
506 final double marginLabel = 1; // startUid.equals(endUid) ? 6 : 1;
507 ISkinParam skinParam = diagram.getSkinParam();
508 final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.ARROW, null);
509 final TextBlock label = Display.getWithNewlines(tmp).create(labelFont,
510 skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam);
511 if (TextBlockUtils.isEmpty(label, stringBounder)) {
512 return label;
513 }
514 return TextBlockUtils.withMargin(label, marginLabel, marginLabel);
515 }
516
517 private ST_Agnode_s getAgnodeFromLeaf(IEntity entity) {
518 final ST_Agnode_s n = nodes.get(entity);
502519 if (n != null) {
503520 return n;
504521 }
505522 final String id = getBibliotekon().getShapeUid((ILeaf) entity);
506 for (Map.Entry<ILeaf, Agnode_s> ent : nodes.entrySet()) {
523 for (Map.Entry<ILeaf, ST_Agnode_s> ent : nodes.entrySet()) {
507524 if (id.equals(getBibliotekon().getShapeUid(ent.getKey()))) {
508525 return ent.getValue();
509526 }
512529
513530 }
514531
515 private Agedge_s createEdge(final Agraph_s g, Link link) {
516 final Agnode_s n = getAgnodeFromLeaf(link.getEntity1());
517 final Agnode_s m = getAgnodeFromLeaf(link.getEntity2());
532 private ST_Agedge_s createEdge(final ST_Agraph_s g, Link link) {
533 final ST_Agnode_s n = getAgnodeFromLeaf(link.getEntity1());
534 final ST_Agnode_s m = getAgnodeFromLeaf(link.getEntity2());
518535 if (n == null) {
519536 return null;
520537 }
521538 if (m == null) {
522539 return null;
523540 }
524 final Agedge_s e = agedge(g, n, m, null, true);
541 final ST_Agedge_s e = agedge(g, n, m, null, true);
525542 // System.err.println("createEdge " + link);
526543 agsafeset(e, new CString("arrowtail"), new CString("none"), new CString(""));
527544 agsafeset(e, new CString("arrowhead"), new CString("none"), new CString(""));
542559 (int) dimLabel.getHeight());
543560 agsafeset(e, new CString("label"), hackDim, new CString(""));
544561 // System.err.print("label=" + hackDim.getContent());
562 }
563 final TextBlock q1 = getQualifier(link, 1);
564 if (q1 != null) {
565 final Dimension2D dimLabel = q1.calculateDimension(stringBounder);
566 // System.err.println("dimLabel = " + dimLabel);
567 final CString hackDim = Macro.createHackInitDimensionFromLabel((int) dimLabel.getWidth(),
568 (int) dimLabel.getHeight());
569 agsafeset(e, new CString("taillabel"), hackDim, new CString(""));
570 }
571 final TextBlock q2 = getQualifier(link, 2);
572 if (q2 != null) {
573 final Dimension2D dimLabel = q2.calculateDimension(stringBounder);
574 // System.err.println("dimLabel = " + dimLabel);
575 final CString hackDim = Macro.createHackInitDimensionFromLabel((int) dimLabel.getWidth(),
576 (int) dimLabel.getHeight());
577 agsafeset(e, new CString("headlabel"), hackDim, new CString(""));
545578 }
546579 // System.err.println();
547580 return e;
593626 // skinParam = new SkinParamSameClassWidth(dotData.getSkinParam(), width);
594627 }
595628
596 return DotDataImageBuilder.createEntityImageBlock(ent, skinParam, diagram.isHideEmptyDescriptionForState(),
629 return GeneralImageBuilder.createEntityImageBlock(ent, skinParam, diagram.isHideEmptyDescriptionForState(),
597630 diagram, getBibliotekon(), null, diagram.getUmlDiagramType(), diagram.getLinks());
598631 }
599632 return ent.getSvekImage();
3333 */
3434 package net.sourceforge.plantuml.jdot;
3535
36 import h.Agedge_s;
37 import h.Agedgeinfo_t;
38 import h.Agnode_s;
39 import h.Agnodeinfo_t;
40 import h.bezier;
41 import h.boxf;
42 import h.pointf;
43 import h.splines;
44 import h.textlabel_t;
36 import h.ST_Agedge_s;
37 import h.ST_Agedgeinfo_t;
38 import h.ST_Agnode_s;
39 import h.ST_Agnodeinfo_t;
40 import h.ST_bezier;
41 import h.ST_boxf;
42 import h.ST_pointf;
43 import h.ST_splines;
44 import h.ST_textlabel_t;
4545 import smetana.core.Macro;
4646 import smetana.core.__ptr__;
47 import smetana.core.__struct__;
48 import smetana.core.amiga.StarArrayOfPtr;
4947 import smetana.core.amiga.StarStruct;
5048
5149 public class DebugUtils {
5250
53 public static void printDebugEdge(Agedge_s e) {
51 public static void printDebugEdge(ST_Agedge_s e) {
5452 System.err.println("*********** PRINT EDGE ********** " + getUID(e));
55 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
56 final splines splines = (splines) data.getPtr("spl");
57 __struct__<boxf> bb = splines.getStruct("bb");
53 final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(e).castTo(ST_Agedgeinfo_t.class);
54 final ST_splines splines = (ST_splines) data.spl;
55 //ST_boxf bb = (ST_boxf) splines.bb;
5856 // final bezier list = (bezier) splines.getPtr("list");
5957 System.err.println("splines.UID=" + ((StarStruct) splines).getUID36());
60 System.err.println("splines.size=" + splines.getInt("size"));
61 System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
62 System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
63 printDebugBezier((bezier) splines.getPtr("list").getPtr());
58 System.err.println("splines.size=" + splines.size);
59 //System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.LL));
60 //System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.UR));
61 printDebugBezier(splines.list.getPtr());
6462
65 textlabel_t label = (textlabel_t) data.getPtr("label");
63 ST_textlabel_t label = data.label;
6664 if (label != null) {
67 System.err.println("LABEL dimen=" + pointftoString(label.getStruct("dimen")));
68 System.err.println("LABEL space=" + pointftoString(label.getStruct("space")));
69 System.err.println("LABEL pos=" + pointftoString(label.getStruct("pos")));
65 System.err.println("LABEL dimen=" + pointftoString(label.dimen));
66 System.err.println("LABEL space=" + pointftoString(label.space));
67 System.err.println("LABEL pos=" + pointftoString(label.pos));
7068 }
7169
7270 }
7371
7472 public static String getUID(Object o) {
75 if (o instanceof StarArrayOfPtr) {
76 return ((StarArrayOfPtr) o).getUID36();
77 }
7873 return ((StarStruct) o).getUID36();
7974 }
8075
81 public static void printDebugBezier(bezier bezier) {
82 System.err.println("bezier.size=" + bezier.getInt("size"));
83 System.err.println("bezier.sflag=" + bezier.getInt("sflag"));
84 System.err.println("splines.eflag=" + bezier.getInt("eflag"));
85 System.err.println("bezier.sp=" + pointftoString(bezier.getStruct("sp")));
86 System.err.println("bezier.ep=" + pointftoString(bezier.getStruct("ep")));
87 System.err.println("bezier.list=" + getUID(bezier.getPtr("list")));
88 for (int i = 0; i < bezier.getInt("size"); i++) {
89 final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr();
76 public static void printDebugBezier(ST_bezier bezier) {
77 System.err.println("bezier.size=" + bezier.size);
78 System.err.println("bezier.sflag=" + bezier.sflag);
79 System.err.println("splines.eflag=" + bezier.eflag);
80 System.err.println("bezier.sp=" + pointftoString((ST_pointf) bezier.sp));
81 System.err.println("bezier.ep=" + pointftoString((ST_pointf) bezier.ep));
82 System.err.println("bezier.list=" + getUID(bezier.list.getPtr()));
83 for (int i = 0; i < bezier.size; i++) {
84 final ST_pointf pt = bezier.list.get(i);
9085 System.err.println("pt=" + pointftoString(pt));
9186 }
9287
9388 }
9489
95 public static void printDebugNode(Agnode_s n) {
90 public static void printDebugNode(ST_Agnode_s n) {
9691 System.err.println("*********** PRINT NODE ********** ");
97 final Agnodeinfo_t data = (Agnodeinfo_t) Macro.AGDATA(n).castTo(Agnodeinfo_t.class);
98 System.err.println("width=" + data.getDouble("width"));
99 System.err.println("height=" + data.getDouble("height"));
100 System.err.println("ht=" + data.getDouble("ht"));
101 System.err.println("lw=" + data.getDouble("lw"));
102 System.err.println("rw=" + data.getDouble("rw"));
103 System.err.println("coord=" + pointftoString(data.getStruct("coord")));
92 final ST_Agnodeinfo_t data = (ST_Agnodeinfo_t) Macro.AGDATA(n).castTo(ST_Agnodeinfo_t.class);
93 System.err.println("width=" + data.width);
94 System.err.println("height=" + data.height);
95 System.err.println("ht=" + data.ht);
96 System.err.println("lw=" + data.lw);
97 System.err.println("rw=" + data.rw);
98 System.err.println("coord=" + pointftoString((ST_pointf) data.coord));
10499
105 __struct__<boxf> bb = data.getStruct("bb");
106 System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
107 System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
100 //ST_boxf bb = (ST_boxf) data.bb;
101 //System.err.println("bb.LL=" + pointftoString((ST_pointf) bb.LL));
102 //System.err.println("bb.UR=" + pointftoString((ST_pointf) bb.UR));
108103 // TODO Auto-generated method stub
109104 }
110105
111 public static String pointftoString(__struct__<pointf> point) {
106 public static String pointftoString(ST_pointf point) {
112107 final StringBuilder sb = new StringBuilder();
113108 sb.append("(");
114 sb.append(point.getDouble("x"));
109 sb.append(point.x);
115110 sb.append(" ; ");
116 sb.append(point.getDouble("y"));
111 sb.append(point.y);
117112 sb.append(")");
118113 return sb.toString();
119114
120115 }
121
122 public static String pointftoString(__ptr__ point) {
123 final StringBuilder sb = new StringBuilder();
124 sb.append("(");
125 sb.append(point.getDouble("x"));
126 sb.append(" ; ");
127 sb.append(point.getDouble("y"));
128 sb.append(")");
129 return sb.toString();
130 }
131116 }
3434 */
3535 package net.sourceforge.plantuml.jdot;
3636
37 import h.Agedge_s;
38 import h.Agedgeinfo_t;
39 import h.bezier;
40 import h.pointf;
41 import h.splines;
42 import h.textlabel_t;
37 import h.ST_Agedge_s;
38 import h.ST_Agedgeinfo_t;
39 import h.ST_bezier;
40 import h.ST_pointf;
41 import h.ST_textlabel_t;
42 import h.ST_splines;
4343
4444 import java.awt.geom.Point2D;
4545
6262 import net.sourceforge.plantuml.ugraphic.UTranslate;
6363 import smetana.core.Macro;
6464 import smetana.core.__ptr__;
65 import smetana.core.__struct__;
6665
6766 public class JDotPath implements UDrawable {
6867
6968 private final Link link;
70 private final Agedge_s edge;
69 private final ST_Agedge_s edge;
7170 private final YMirror ymirror;
7271 private final CucaDiagram diagram;
7372 private final TextBlock label;
73 private final TextBlock headLabel;
74 private final TextBlock tailLabel;
7475 private final Rose rose = new Rose();
7576
76 public JDotPath(Link link, Agedge_s edge, YMirror ymirror, CucaDiagram diagram, TextBlock label) {
77 public JDotPath(Link link, ST_Agedge_s edge, YMirror ymirror, CucaDiagram diagram, TextBlock label,
78 TextBlock tailLabel, TextBlock headLabel) {
7779 this.link = link;
7880 this.edge = edge;
7981 this.ymirror = ymirror;
8082 this.diagram = diagram;
8183 this.label = label;
84 this.tailLabel = tailLabel;
85 this.headLabel = headLabel;
8286 }
8387
8488 private ColorParam getArrowColorParam() {
118122 if (dotPath != null) {
119123 ug.apply(new UChangeColor(color)).draw(dotPath);
120124 }
121 if (getLabelRectangleTranslate() != null) {
122 label.drawU(ug.apply(getLabelRectangleTranslate()));
125 if (getLabelRectangleTranslate("label") != null) {
126 label.drawU(ug.apply(getLabelRectangleTranslate("label")));
127 }
128 if (getLabelRectangleTranslate("head_label") != null) {
129 headLabel.drawU(ug.apply(getLabelRectangleTranslate("head_label")));
130 }
131 if (getLabelRectangleTranslate("tail_label") != null) {
132 tailLabel.drawU(ug.apply(getLabelRectangleTranslate("tail_label")));
123133 }
124134 // printDebug(ug);
125135
127137
128138 private void printDebug(UGraphic ug) {
129139 ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(HtmlColorUtils.BLUE));
130 final splines splines = getSplines(edge);
131 final bezier beziers = (bezier) splines.getPtr("list");
132 for (int i = 0; i < beziers.getInt("size"); i++) {
140 final ST_splines splines = getSplines(edge);
141 final ST_bezier beziers = splines.list.getPtr();
142 for (int i = 0; i < beziers.size; i++) {
133143 Point2D pt = getPoint(splines, i);
134144 if (ymirror != null) {
135145 pt = ymirror.getMirrored(pt);
136146 }
137147 ug.apply(new UTranslate(pt).compose(new UTranslate(-1, -1))).draw(new UEllipse(3, 3));
138148 }
139 if (getLabelRectangleTranslate() != null && getLabelURectangle() != null) {
149 if (getLabelRectangleTranslate("label") != null && getLabelURectangle() != null) {
140150 ug = ug.apply(new UChangeColor(HtmlColorUtils.BLUE)).apply(new UChangeBackColor(null));
141 ug.apply(getLabelRectangleTranslate()).draw(getLabelURectangle());
151 ug.apply(getLabelRectangleTranslate("label")).draw(getLabelURectangle());
142152 }
143153
144154 }
145155
146156 private URectangle getLabelURectangle() {
147 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(edge).castTo(Agedgeinfo_t.class);
148 textlabel_t label = (textlabel_t) data.getPtr("label");
157 final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(edge).castTo(ST_Agedgeinfo_t.class);
158 ST_textlabel_t label = (ST_textlabel_t) data.label;
149159 if (label == null) {
150160 return null;
151161 }
152 final __struct__<pointf> dimen = label.getStruct("dimen");
153 final __struct__<pointf> space = label.getStruct("space");
154 final __struct__<pointf> pos = label.getStruct("pos");
155 final double x = pos.getDouble("x");
156 final double y = pos.getDouble("y");
157 final double width = dimen.getDouble("x");
158 final double height = dimen.getDouble("y");
162 final ST_pointf dimen = (ST_pointf) label.dimen;
163 final ST_pointf space = (ST_pointf) label.space;
164 final ST_pointf pos = (ST_pointf) label.pos;
165 final double x = pos.x;
166 final double y = pos.y;
167 final double width = dimen.x;
168 final double height = dimen.y;
159169 return new URectangle(width, height);
160170 }
161171
162 private UTranslate getLabelRectangleTranslate() {
163 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(edge).castTo(Agedgeinfo_t.class);
164 textlabel_t label = (textlabel_t) data.getPtr("label");
172 private UTranslate getLabelRectangleTranslate(String fieldName) {
173 // final String fieldName = "label";
174 final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(edge).castTo(ST_Agedgeinfo_t.class);
175 ST_textlabel_t label = null;
176 if (fieldName.equals("label")) {
177 label = data.label;
178 } else if (fieldName.equals("head_label")) {
179 label = data.head_label;
180 } else if (fieldName.equals("tail_label")) {
181 label = data.tail_label;
182 }
165183 if (label == null) {
166184 return null;
167185 }
168 final __struct__<pointf> dimen = label.getStruct("dimen");
169 final __struct__<pointf> space = label.getStruct("space");
170 final __struct__<pointf> pos = label.getStruct("pos");
171 final double x = pos.getDouble("x");
172 final double y = pos.getDouble("y");
173 final double width = dimen.getDouble("x");
174 final double height = dimen.getDouble("y");
186 final ST_pointf dimen = (ST_pointf) label.dimen;
187 final ST_pointf space = (ST_pointf) label.space;
188 final ST_pointf pos = (ST_pointf) label.pos;
189 final double x = pos.x;
190 final double y = pos.y;
191 final double width = dimen.x;
192 final double height = dimen.y;
175193
176194 if (ymirror == null) {
177195 return new UTranslate(x - width / 2, y - height / 2);
179197 return ymirror.getMirrored(new UTranslate(x - width / 2, y + height / 2));
180198 }
181199
182 public DotPath getDotPath(Agedge_s e) {
183 final splines splines = getSplines(e);
200 public DotPath getDotPath(ST_Agedge_s e) {
201 final ST_splines splines = getSplines(e);
184202 return getDotPath(splines);
185203 }
186204
187 private splines getSplines(Agedge_s e) {
188 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
189 final splines splines = (splines) data.getPtr("spl");
205 private ST_splines getSplines(ST_Agedge_s e) {
206 final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(e).castTo(ST_Agedgeinfo_t.class);
207 final ST_splines splines = (ST_splines) data.spl;
190208 return splines;
191209 }
192210
193 private DotPath getDotPath(splines splines) {
211 private DotPath getDotPath(ST_splines splines) {
194212 if (splines == null) {
195213 System.err.println("ERROR, no splines for getDotPath");
196214 return null;
197215 }
198216 DotPath result = new DotPath();
199 final bezier beziers = (bezier) splines.getPtr("list");
217 final ST_bezier beziers = (ST_bezier) splines.list.getPtr();
200218 final Point2D pt1 = getPoint(splines, 0);
201219 final Point2D pt2 = getPoint(splines, 1);
202220 final Point2D pt3 = getPoint(splines, 2);
203221 final Point2D pt4 = getPoint(splines, 3);
204222 result = result.addCurve(pt1, pt2, pt3, pt4);
205 final int n = beziers.getInt("size");
223 final int n = beziers.size;
206224 for (int i = 4; i < n; i += 3) {
207225 final Point2D ppt2 = getPoint(splines, i);
208226 final Point2D ppt3 = getPoint(splines, i + 1);
212230 return result;
213231 }
214232
215 private Point2D getPoint(splines splines, int i) {
216 final bezier beziers = (bezier) splines.getPtr("list");
217 final __ptr__ pt = beziers.getPtr("list").plus(i).getPtr();
218 return new Point2D.Double(pt.getDouble("x"), pt.getDouble("y"));
233 private Point2D getPoint(ST_splines splines, int i) {
234 final ST_bezier beziers = (ST_bezier) splines.list.getPtr();
235 final ST_pointf pt = beziers.list.get(i);
236 return new Point2D.Double(pt.x, pt.y);
219237 }
220238
221239 }
152152 return null;
153153 }
154154
155 public final String getFormula() {
156 return formula;
157 }
158
155159 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandComment extends SingleLineCommand2<NwDiagram> {
44
45 public CommandComment() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*//.*"), //
52 new RegexLeaf("$"));
53 }
54
55 @Override
56 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
57 return CommandExecutionResult.ok();
58 }
59
60 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandElement extends SingleLineCommand2<NwDiagram> {
44
45 public CommandElement() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("NAME", "([\\p{L}0-9_]+)"), //
53 new RegexLeaf("[%s]*"), //
54 new RegexLeaf("DEFINITION", "(\\[(.*)\\])?"), //
55 new RegexLeaf(";?"), //
56 new RegexLeaf("$"));
57 }
58
59 @Override
60 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
61 return diagram.addElement(arg.get("NAME", 0), arg.get("DEFINITION", 1));
62 }
63
64 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandEndSomething extends SingleLineCommand2<NwDiagram> {
44
45 public CommandEndSomething() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("\\}"), //
53 new RegexLeaf("[%s]*"), //
54 new RegexLeaf("$"));
55 }
56
57 @Override
58 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
59 return diagram.endSomething();
60 }
61
62 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandGroup extends SingleLineCommand2<NwDiagram> {
44
45 public CommandGroup() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("group"), //
53 new RegexLeaf("[%s]*"), //
54 new RegexLeaf("NAME", "([\\p{L}0-9_]+)?"), //
55 new RegexLeaf("[%s]*"), //
56 new RegexLeaf("\\{"), //
57 new RegexLeaf("$"));
58 }
59
60
61 @Override
62 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
63 return diagram.openGroup(arg.get("NAME", 0));
64 }
65
66 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandLink extends SingleLineCommand2<NwDiagram> {
44
45 public CommandLink() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("NAME1", "[\\p{L}0-9_]+"), //
53 new RegexLeaf("[%s]*--[%s]*"), //
54 new RegexLeaf("NAME2", "[\\p{L}0-9_]+"), //
55 new RegexLeaf("[%s]*"), //
56 new RegexLeaf(";?"), //
57 new RegexLeaf("$"));
58 }
59
60
61 @Override
62 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
63 return diagram.link();
64 }
65
66 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandNetwork extends SingleLineCommand2<NwDiagram> {
44
45 public CommandNetwork() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("network"), //
53 new RegexLeaf("[%s]*"), //
54 new RegexLeaf("NAME", "([\\p{L}0-9_]+)?"), //
55 new RegexLeaf("[%s]*"), //
56 new RegexLeaf("\\{"), //
57 new RegexLeaf("$"));
58 }
59
60 @Override
61 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
62 return diagram.openNetwork(arg.get("NAME", 0));
63 }
64
65 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandNwDiagInit extends SingleLineCommand2<NwDiagram> {
44
45 public CommandNwDiagInit() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("TYPE", "nwdiag"), //
52 new RegexLeaf("[%s]+"), //
53 new RegexLeaf("\\{"), //
54 new RegexLeaf("$"));
55 }
56
57 @Override
58 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
59 diagram.init();
60 return CommandExecutionResult.ok();
61 }
62
63 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import net.sourceforge.plantuml.command.CommandExecutionResult;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
42
43 public class CommandProperty extends SingleLineCommand2<NwDiagram> {
44
45 public CommandProperty() {
46 super(getRegexConcat());
47 }
48
49 static RegexConcat getRegexConcat() {
50 return new RegexConcat(new RegexLeaf("^"), //
51 new RegexLeaf("[%s]*"), //
52 new RegexLeaf("NAME", "(address|color)"), //
53 new RegexLeaf("[%s]*"), //
54 new RegexLeaf("="), //
55 new RegexLeaf("[%s]*"), //
56 new RegexLeaf("VALUE", "\"(.*)\""), //
57 new RegexLeaf("[%s]*"), //
58 new RegexLeaf(";?"), //
59 new RegexLeaf("$"));
60 }
61
62 @Override
63 protected CommandExecutionResult executeArg(NwDiagram diagram, RegexResult arg) {
64 return diagram.setProperty(arg.get("NAME", 0), arg.get("VALUE", 0));
65 }
66
67 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import net.sourceforge.plantuml.ColorParam;
37 import net.sourceforge.plantuml.SpriteContainerEmpty;
38 import net.sourceforge.plantuml.cucadiagram.Display;
39 import net.sourceforge.plantuml.graphic.FontConfiguration;
40 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
41 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
42 import net.sourceforge.plantuml.graphic.SymbolContext;
43 import net.sourceforge.plantuml.graphic.TextBlock;
44 import net.sourceforge.plantuml.graphic.TextBlockUtils;
45 import net.sourceforge.plantuml.graphic.USymbol;
46 import net.sourceforge.plantuml.ugraphic.UFont;
47
48 public class DiagElement {
49
50 private USymbol shape = USymbol.RECTANGLE;
51 private final String name;
52 private String description;
53 private final Network mainNetwork;
54
55 @Override
56 public String toString() {
57 return name;
58 }
59
60 public DiagElement(String name, Network network) {
61 this.description = name;
62 this.mainNetwork = network;
63 this.name = name;
64 }
65
66 private TextBlock toTextBlock(String s) {
67 if (s == null) {
68 return null;
69 }
70 if (s.length() == 0) {
71 return TextBlockUtils.empty(0, 0);
72 }
73 s = s.replace(", ", "\\n");
74 return Display.getWithNewlines(s).create(getFontConfiguration(), HorizontalAlignment.LEFT,
75 new SpriteContainerEmpty());
76 }
77
78 private FontConfiguration getFontConfiguration() {
79 final UFont font = UFont.serif(11);
80 return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
81 }
82
83 public LinkedElement asTextBlock(final String adress1, final String adress2) {
84 final TextBlock ad1 = toTextBlock(adress1);
85 final TextBlock ad2 = toTextBlock(adress2);
86 final SymbolContext symbolContext = new SymbolContext(ColorParam.activityBackground.getDefaultValue(),
87 ColorParam.activityBorder.getDefaultValue()).withShadow(true);
88 final TextBlock desc = toTextBlock(description);
89 final TextBlock box = shape
90 .asSmall(TextBlockUtils.empty(0, 0), desc, TextBlockUtils.empty(0, 0), symbolContext);
91 return new LinkedElement(ad1, box, ad2, mainNetwork, this);
92 }
93
94 public String getDescription() {
95 return description;
96 }
97
98 public final Network getMainNetwork() {
99 return mainNetwork;
100 }
101
102 public void setDescription(String description) {
103 this.description = description;
104 }
105
106 public String getName() {
107 return name;
108 }
109
110 public final void setShape(String shapeName) {
111 if ("database".equalsIgnoreCase(shapeName)) {
112 this.shape = USymbol.DATABASE;
113 }
114 if ("node".equalsIgnoreCase(shapeName)) {
115 this.shape = USymbol.NODE;
116 }
117 }
118
119 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.util.HashSet;
37 import java.util.Set;
38
39 import net.sourceforge.plantuml.graphic.HtmlColor;
40
41 public class DiagGroup {
42
43 private final String name;
44 private final Network network;
45 private final Set<String> elements = new HashSet<String>();
46 private HtmlColor color;
47
48 @Override
49 public String toString() {
50 return name + " " + network + " " + elements;
51 }
52
53 public DiagGroup(String name, Network network) {
54 this.name = name;
55 this.network = network;
56 }
57
58 public final String getName() {
59 return name;
60 }
61
62 public void addElement(String name) {
63 this.elements.add(name);
64 }
65
66 public boolean matches(LinkedElement tested) {
67 if (network != null && network != tested.getNetwork()) {
68 return false;
69 }
70 return elements.contains(tested.getElement().getName());
71 }
72
73 public final HtmlColor getColor() {
74 return color;
75 }
76
77 public final void setColor(HtmlColor color) {
78 this.color = color;
79 }
80
81 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.util.Collection;
37
38 import net.sourceforge.plantuml.graphic.HtmlColor;
39 import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
40 import net.sourceforge.plantuml.graphic.StringBounder;
41 import net.sourceforge.plantuml.ugraphic.MinMax;
42 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
43 import net.sourceforge.plantuml.ugraphic.UGraphic;
44 import net.sourceforge.plantuml.ugraphic.URectangle;
45 import net.sourceforge.plantuml.ugraphic.UTranslate;
46
47 public class GridTextBlockDecorated extends GridTextBlockSimple {
48
49 public static final HtmlColorSetSimple colors = new HtmlColorSetSimple();
50
51 public static final int NETWORK_THIN = 5;
52
53 private final Collection<DiagGroup> groups;
54
55 public GridTextBlockDecorated(int lines, int cols, Collection<DiagGroup> groups) {
56 super(lines, cols);
57 this.groups = groups;
58 }
59
60 @Override
61 public void drawGrid(UGraphic ug) {
62 for (DiagGroup group : groups) {
63 drawGroups(ug, group);
64 }
65 drawNetworkTube(ug);
66 }
67
68 private void drawGroups(UGraphic ug, DiagGroup group) {
69 final StringBounder stringBounder = ug.getStringBounder();
70
71 MinMax size = null;
72 double y = 0;
73 for (int i = 0; i < data.length; i++) {
74 final double lineHeight = lineHeight(stringBounder, i);
75 double x = 0;
76 for (int j = 0; j < data[i].length; j++) {
77 final double colWidth = colWidth(stringBounder, j);
78 final LinkedElement element = data[i][j];
79 if (element != null && group.matches(element)) {
80 final MinMax minMax = element.getMinMax(stringBounder, colWidth, lineHeight).translate(
81 new UTranslate(x, y));
82 size = size == null ? minMax : size.addMinMax(minMax);
83 }
84 x += colWidth;
85 }
86 y += lineHeight;
87 }
88 if (size != null) {
89 HtmlColor color = group.getColor();
90 if (color == null) {
91 color = colors.getColorIfValid("#AAA");
92 }
93 size.draw(ug, color);
94 }
95
96 }
97
98 private void drawNetworkTube(final UGraphic ug) {
99 final StringBounder stringBounder = ug.getStringBounder();
100 double y = 0;
101 for (int i = 0; i < data.length; i++) {
102 final Network network = getNetwork(i);
103 double x = 0;
104 double xmin = -1;
105 double xmax = 0;
106 for (int j = 0; j < data[i].length; j++) {
107 final boolean hline = isPresent(i, j) || isPresent(i - 1, j);
108 if (hline && xmin < 0) {
109 xmin = x;
110 }
111 x += colWidth(stringBounder, j);
112 if (hline) {
113 xmax = x;
114 }
115 }
116 final URectangle rect = new URectangle(xmax - xmin, NETWORK_THIN);
117 rect.setDeltaShadow(1.0);
118 UGraphic ug2 = ug.apply(new UTranslate(xmin, y));
119 if (network != null && network.getColor() != null) {
120 ug2 = ug2.apply(new UChangeBackColor(network.getColor()));
121 }
122 ug2.draw(rect);
123 y += lineHeight(stringBounder, i);
124 }
125 }
126
127 private Network getNetwork(int i) {
128 for (int j = 0; j < data[i].length; j++) {
129 if (isPresent(i, j)) {
130 return data[i][j].getNetwork();
131 }
132 }
133 return null;
134 }
135 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.awt.geom.Dimension2D;
37 import java.awt.geom.Rectangle2D;
38
39 import net.sourceforge.plantuml.Dimension2DDouble;
40 import net.sourceforge.plantuml.graphic.InnerStrategy;
41 import net.sourceforge.plantuml.graphic.StringBounder;
42 import net.sourceforge.plantuml.graphic.TextBlock;
43 import net.sourceforge.plantuml.ugraphic.MinMax;
44 import net.sourceforge.plantuml.ugraphic.UGraphic;
45 import net.sourceforge.plantuml.ugraphic.UTranslate;
46
47 public class GridTextBlockSimple implements TextBlock {
48
49 protected final LinkedElement data[][];
50
51 public GridTextBlockSimple(int lines, int cols) {
52 this.data = new LinkedElement[lines][cols];
53 }
54
55 protected boolean isPresent(int i, int j) {
56 if (i == -1) {
57 return false;
58 }
59 return data[i][j] != null;
60 }
61
62 public void drawGrid(UGraphic ug) {
63 }
64
65 public void drawU(UGraphic ug) {
66 drawGrid(ug);
67 final StringBounder stringBounder = ug.getStringBounder();
68 double y = 0;
69 for (int i = 0; i < data.length; i++) {
70 final double lineHeight = lineHeight(stringBounder, i);
71 double x = 0;
72 for (int j = 0; j < data[i].length; j++) {
73 final double colWidth = colWidth(stringBounder, j);
74 if (data[i][j] != null) {
75 data[i][j].drawMe(ug.apply(new UTranslate(x, y)), colWidth, lineHeight);
76 }
77 x += colWidth;
78 }
79 y += lineHeight;
80 }
81 }
82
83 protected double colWidth(StringBounder stringBounder, final int j) {
84 double width = 0;
85 for (int i = 0; i < data.length; i++) {
86 if (data[i][j] != null) {
87 width = Math.max(width, data[i][j].naturalDimension(stringBounder).getWidth());
88 }
89 }
90 return width;
91 }
92
93 public double lineHeight(StringBounder stringBounder, final int i) {
94 double height = 0;
95 for (int j = 0; j < data[i].length; j++) {
96 if (data[i][j] != null) {
97 height = Math.max(height, data[i][j].naturalDimension(stringBounder).getHeight());
98 }
99 }
100 return height;
101 }
102
103 public Dimension2D calculateDimension(StringBounder stringBounder) {
104 if (data.length == 0) {
105 return new Dimension2DDouble(0, 0);
106 }
107 double height = 0;
108 for (int i = 0; i < data.length; i++) {
109 height += lineHeight(stringBounder, i);
110 }
111 double width = 0;
112 for (int j = 0; j < data[0].length; j++) {
113 width += colWidth(stringBounder, j);
114 }
115 return new Dimension2DDouble(width, height);
116 }
117
118 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
119 throw new UnsupportedOperationException("member=" + member + " " + getClass().toString());
120 }
121
122 public MinMax getMinMax(StringBounder stringBounder) {
123 throw new UnsupportedOperationException(getClass().toString());
124 }
125
126 public void add(int i, int j, LinkedElement value) {
127 data[i][j] = value;
128 }
129
130 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.awt.geom.Dimension2D;
37
38 import net.sourceforge.plantuml.ColorParam;
39 import net.sourceforge.plantuml.Dimension2DDouble;
40 import net.sourceforge.plantuml.graphic.HtmlColor;
41 import net.sourceforge.plantuml.graphic.StringBounder;
42 import net.sourceforge.plantuml.graphic.TextBlock;
43 import net.sourceforge.plantuml.ugraphic.MinMax;
44 import net.sourceforge.plantuml.ugraphic.UChangeColor;
45 import net.sourceforge.plantuml.ugraphic.UGraphic;
46 import net.sourceforge.plantuml.ugraphic.ULine;
47 import net.sourceforge.plantuml.ugraphic.UTranslate;
48 import net.sourceforge.plantuml.utils.MathUtils;
49
50 public class LinkedElement {
51
52 private final TextBlock ad1;
53 private final TextBlock box;
54 private final TextBlock ad2;
55 private final Network network;
56 private final DiagElement element;
57
58 public LinkedElement(TextBlock ad1, TextBlock box, TextBlock ad2, Network network, DiagElement element) {
59 this.ad1 = ad1;
60 this.box = box;
61 this.ad2 = ad2;
62 this.network = network;
63 this.element = element;
64 }
65
66 private final double marginAd = 10;
67 private final double marginBox = 15;
68
69 public MinMax getMinMax(StringBounder stringBounder, double width, double height) {
70 final double xMiddle = width / 2;
71 final double yMiddle = height / 2;
72 final Dimension2D dimBox = box.calculateDimension(stringBounder);
73
74 final double x1 = xMiddle - dimBox.getWidth() / 2;
75 final double y1 = yMiddle - dimBox.getHeight() / 2;
76 final double x2 = xMiddle + dimBox.getWidth() / 2;
77 final double y2 = yMiddle + dimBox.getHeight() / 2;
78 return MinMax.getEmpty(false).addPoint(x1 - 5, y1 - 5).addPoint(x2 + 5, y2 + 5);
79 }
80
81 public void drawMe(UGraphic ug, double width, double height) {
82 final double xMiddle = width / 2;
83 final double yMiddle = height / 2;
84 final StringBounder stringBounder = ug.getStringBounder();
85 final Dimension2D dimBox = box.calculateDimension(stringBounder);
86
87 final double y1 = yMiddle - dimBox.getHeight() / 2;
88 final double y2 = yMiddle + dimBox.getHeight() / 2;
89
90 drawCenter(ug, box, xMiddle, yMiddle);
91
92 final HtmlColor color = ColorParam.activityBorder.getDefaultValue();
93 ug = ug.apply(new UChangeColor(color));
94 drawHLine(ug, xMiddle, GridTextBlockDecorated.NETWORK_THIN, y1);
95 if (ad2 != null) {
96 drawHLine(ug, xMiddle, y2, height);
97 }
98
99 drawCenter(ug, ad1, xMiddle, (GridTextBlockDecorated.NETWORK_THIN + y1) / 2);
100 if (ad2 != null) {
101 drawCenter(ug, ad2, xMiddle, (y2 + height - GridTextBlockDecorated.NETWORK_THIN) / 2);
102 }
103 }
104
105 private void drawCenter(UGraphic ug, TextBlock block, double x, double y) {
106 final Dimension2D dim = block.calculateDimension(ug.getStringBounder());
107 block.drawU(ug.apply(new UTranslate(x - dim.getWidth() / 2, y - dim.getHeight() / 2)));
108
109 }
110
111 private void drawHLine(UGraphic ug, double x, double y1, double y2) {
112 final ULine line = new ULine(0, y2 - y1);
113 ug.apply(new UTranslate(x, y1)).draw(line);
114 }
115
116 public Dimension2D naturalDimension(StringBounder stringBounder) {
117 final Dimension2D dim1 = ad1.calculateDimension(stringBounder);
118 final Dimension2D dimBox = box.calculateDimension(stringBounder);
119 final Dimension2D dim2 = ad2 == null ? new Dimension2DDouble(0, 0) : ad2.calculateDimension(stringBounder);
120 final double width = MathUtils.max(dim1.getWidth() + 2 * marginAd, dimBox.getWidth() + 2 * marginBox,
121 dim2.getWidth() + 2 * marginAd);
122 final double height = dim1.getHeight() + 2 * marginAd + dimBox.getHeight() + 2 * marginBox + dim2.getHeight()
123 + 2 * marginAd;
124 return new Dimension2DDouble(width, height);
125 }
126
127 public final Network getNetwork() {
128 return network;
129 }
130
131 public final DiagElement getElement() {
132 return element;
133 }
134
135 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.util.LinkedHashMap;
37 import java.util.Map;
38
39 import net.sourceforge.plantuml.graphic.HtmlColor;
40
41 public class Network {
42
43 private final String name;
44 private final Map<DiagElement, String> localElements = new LinkedHashMap<DiagElement, String>();
45 private HtmlColor color;
46
47 private String ownAdress;
48
49 @Override
50 public String toString() {
51 return name;
52 }
53
54 public Network(String name) {
55 this.name = name;
56 }
57
58 public String getAdress(DiagElement element) {
59 return localElements.get(element);
60 }
61
62 public void addElement(DiagElement element, Map<String, String> props) {
63 String address = props.get("address");
64 if (address == null) {
65 address = "";
66 }
67 if (address.length() == 0 && localElements.containsKey(element)) {
68 return;
69 }
70 localElements.put(element, address);
71 }
72
73 public boolean constainsLocally(String name) {
74 for (DiagElement element : localElements.keySet()) {
75 if (element.getName().equals(name)) {
76 return true;
77 }
78 }
79 return false;
80 }
81
82 public final String getOwnAdress() {
83 return ownAdress;
84 }
85
86 public final void setOwnAdress(String ownAdress) {
87 this.ownAdress = ownAdress;
88 }
89
90 public final String getName() {
91 return name;
92 }
93
94 public final HtmlColor getColor() {
95 return color;
96 }
97
98 public final void setColor(HtmlColor color) {
99 this.color = color;
100 }
101
102 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.nwdiag;
35
36 import java.awt.geom.Dimension2D;
37 import java.io.IOException;
38 import java.io.OutputStream;
39 import java.util.ArrayList;
40 import java.util.HashMap;
41 import java.util.LinkedHashMap;
42 import java.util.List;
43 import java.util.Map;
44 import java.util.regex.Matcher;
45 import java.util.regex.Pattern;
46
47 import net.sourceforge.plantuml.ColorParam;
48 import net.sourceforge.plantuml.FileFormatOption;
49 import net.sourceforge.plantuml.Scale;
50 import net.sourceforge.plantuml.SpriteContainerEmpty;
51 import net.sourceforge.plantuml.UmlDiagram;
52 import net.sourceforge.plantuml.UmlDiagramType;
53 import net.sourceforge.plantuml.command.CommandExecutionResult;
54 import net.sourceforge.plantuml.core.DiagramDescription;
55 import net.sourceforge.plantuml.core.ImageData;
56 import net.sourceforge.plantuml.cucadiagram.Display;
57 import net.sourceforge.plantuml.graphic.FontConfiguration;
58 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
59 import net.sourceforge.plantuml.graphic.HtmlColor;
60 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
61 import net.sourceforge.plantuml.graphic.StringBounder;
62 import net.sourceforge.plantuml.graphic.TextBlock;
63 import net.sourceforge.plantuml.graphic.UDrawable;
64 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
65 import net.sourceforge.plantuml.ugraphic.ImageBuilder;
66 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
67 import net.sourceforge.plantuml.ugraphic.UChangeColor;
68 import net.sourceforge.plantuml.ugraphic.UEmpty;
69 import net.sourceforge.plantuml.ugraphic.UFont;
70 import net.sourceforge.plantuml.ugraphic.UGraphic;
71 import net.sourceforge.plantuml.ugraphic.UTranslate;
72
73 public class NwDiagram extends UmlDiagram {
74
75 private boolean initDone;
76 private final Map<String, DiagElement> elements = new LinkedHashMap<String, DiagElement>();
77 private final List<Network> networks = new ArrayList<Network>();
78 private final List<DiagGroup> groups = new ArrayList<DiagGroup>();
79 private DiagGroup currentGroup = null;
80
81 public DiagramDescription getDescription() {
82 return new DiagramDescription("(Nwdiag)");
83 }
84
85 @Override
86 public UmlDiagramType getUmlDiagramType() {
87 return UmlDiagramType.NWDIAG;
88 }
89
90 public void init() {
91 initDone = true;
92 }
93
94 private Network currentNetwork() {
95 if (networks.size() == 0) {
96 return null;
97 }
98 return networks.get(networks.size() - 1);
99 }
100
101 public CommandExecutionResult openGroup(String name) {
102 if (initDone == false) {
103 return error();
104 }
105 currentGroup = new DiagGroup(name, currentNetwork());
106 groups.add(currentGroup);
107 return CommandExecutionResult.ok();
108 }
109
110 public CommandExecutionResult openNetwork(String name) {
111 if (initDone == false) {
112 return error();
113 }
114 final Network network = new Network(name);
115 networks.add(network);
116 return CommandExecutionResult.ok();
117 }
118
119 public CommandExecutionResult endSomething() {
120 if (initDone == false) {
121 return error();
122 }
123 this.currentGroup = null;
124 return CommandExecutionResult.ok();
125 }
126
127 public CommandExecutionResult addElement(String name, String definition) {
128 if (initDone == false) {
129 return error();
130 }
131 if (currentGroup != null) {
132 currentGroup.addElement(name);
133 }
134 if (currentNetwork() != null) {
135 DiagElement element = elements.get(name);
136 if (element == null) {
137 element = new DiagElement(name, currentNetwork());
138 elements.put(name, element);
139 }
140 final Map<String, String> props = toSet(definition);
141 final String description = props.get("description");
142 if (description != null) {
143 element.setDescription(description);
144 }
145 final String shape = props.get("shape");
146 if (shape != null) {
147 element.setShape(shape);
148 }
149 currentNetwork().addElement(element, props);
150 }
151 return CommandExecutionResult.ok();
152 }
153
154 private CommandExecutionResult error() {
155 return CommandExecutionResult.error("");
156 }
157
158 private Map<String, String> toSet(String definition) {
159 final Map<String, String> result = new HashMap<String, String>();
160 if (definition == null) {
161 return result;
162 }
163 final Pattern p = Pattern.compile("\\s*(\\w+)\\s*=\\s*(\"([^\"]*)\"|[^\\s,]+)");
164 final Matcher m = p.matcher(definition);
165 while (m.find()) {
166 final String name = m.group(1);
167 final String value = m.group(3) == null ? m.group(2) : m.group(3);
168 result.put(name, value);
169 }
170 return result;
171
172 }
173
174 @Override
175 protected ImageData exportDiagramInternal(OutputStream os, int index, FileFormatOption fileFormatOption)
176 throws IOException {
177 final Scale scale = getScale();
178
179 final double dpiFactor = scale == null ? 1 : scale.getScale(100, 100);
180 final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), dpiFactor, null, "", "", 0, 0,
181 null, false);
182 final UDrawable result = getUDrawable();
183 imageBuilder.setUDrawable(result);
184
185 return imageBuilder.writeImageTOBEMOVED(fileFormatOption, 0, os);
186 }
187
188 private UDrawable getUDrawable() {
189 return new UDrawable() {
190 public void drawU(UGraphic ug) {
191 drawMe(ug);
192 }
193 };
194 }
195
196 private TextBlock toTextBlock(String name, String s) {
197 if (s != null) {
198 name += "\\n" + s;
199 }
200 return Display.getWithNewlines(name).create(getFontConfiguration(), HorizontalAlignment.RIGHT,
201 new SpriteContainerEmpty());
202 }
203
204 private FontConfiguration getFontConfiguration() {
205 final UFont font = UFont.serif(11);
206 return new FontConfiguration(font, HtmlColorUtils.BLACK, HtmlColorUtils.BLACK, false);
207 }
208
209 private void drawMe(UGraphic ug) {
210 final double margin = 5;
211 ug = ug.apply(new UTranslate(margin, margin));
212
213 final StringBounder stringBounder = ug.getStringBounder();
214 final GridTextBlockDecorated grid = new GridTextBlockDecorated(networks.size(), elements.size(), groups);
215
216 for (int i = 0; i < networks.size(); i++) {
217 final Network current = networks.get(i);
218 final Network next = i + 1 < networks.size() ? networks.get(i + 1) : null;
219 int j = 0;
220 for (Map.Entry<String, DiagElement> ent : elements.entrySet()) {
221 final DiagElement element = ent.getValue();
222 if (element.getMainNetwork() == current && current.constainsLocally(ent.getKey())) {
223 final String ad1 = current.getAdress(element);
224 final String ad2 = next == null ? null : next.getAdress(element);
225 grid.add(i, j, element.asTextBlock(ad1, ad2));
226 }
227 j++;
228 }
229 }
230
231 double deltaX = 0;
232 double deltaY = 0;
233 for (int i = 0; i < networks.size(); i++) {
234 final Network current = networks.get(i);
235 final String address = current.getOwnAdress();
236 final TextBlock desc = toTextBlock(current.getName(), address);
237 final Dimension2D dim = desc.calculateDimension(stringBounder);
238 if (i == 0) {
239 deltaY = (dim.getHeight() - GridTextBlockDecorated.NETWORK_THIN) / 2;
240 }
241 deltaX = Math.max(deltaX, dim.getWidth());
242 }
243 double y = 0;
244 for (int i = 0; i < networks.size(); i++) {
245 final Network current = networks.get(i);
246 final String address = current.getOwnAdress();
247 final TextBlock desc = toTextBlock(current.getName(), address);
248 final Dimension2D dim = desc.calculateDimension(stringBounder);
249 desc.drawU(ug.apply(new UTranslate(deltaX - dim.getWidth(), y)));
250
251 y += grid.lineHeight(stringBounder, i);
252 }
253 deltaX += 5;
254
255 grid.drawU(ug.apply(new UChangeColor(ColorParam.activityBorder.getDefaultValue()))
256 .apply(new UChangeBackColor(ColorParam.activityBackground.getDefaultValue()))
257 .apply(new UTranslate(deltaX, deltaY)));
258 final Dimension2D dimGrid = grid.calculateDimension(stringBounder);
259
260 ug.apply(new UTranslate(dimGrid.getWidth() + deltaX + margin, dimGrid.getHeight() + deltaY + margin)).draw(
261 new UEmpty(1, 1));
262
263 }
264
265 public CommandExecutionResult setProperty(String property, String value) {
266 if (initDone == false) {
267 return error();
268 }
269 if ("address".equalsIgnoreCase(property) && currentNetwork() != null) {
270 currentNetwork().setOwnAdress(value);
271 }
272 if ("color".equalsIgnoreCase(property)) {
273 final HtmlColor color = GridTextBlockDecorated.colors.getColorIfValid(value);
274 if (currentGroup != null) {
275 currentGroup.setColor(color);
276 } else if (currentNetwork() != null) {
277 currentNetwork().setColor(color);
278 }
279 }
280 return CommandExecutionResult.ok();
281 }
282
283 public CommandExecutionResult link() {
284 if (initDone == false) {
285 return error();
286 }
287 return CommandExecutionResult.ok();
288 }
289
290 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.nwdiag;
36
37 import java.util.ArrayList;
38 import java.util.List;
39
40 import net.sourceforge.plantuml.command.Command;
41 import net.sourceforge.plantuml.command.UmlDiagramFactory;
42
43 public class NwDiagramFactory extends UmlDiagramFactory {
44
45 @Override
46 public NwDiagram createEmptyDiagram() {
47 return new NwDiagram();
48 }
49
50 @Override
51 protected List<Command> createCommands() {
52
53 final List<Command> cmds = new ArrayList<Command>();
54 addCommonCommands(cmds);
55 cmds.add(new CommandNwDiagInit());
56 cmds.add(new CommandComment());
57 cmds.add(new CommandElement());
58 cmds.add(new CommandGroup());
59 cmds.add(new CommandNetwork());
60 cmds.add(new CommandLink());
61 cmds.add(new CommandProperty());
62 cmds.add(new CommandEndSomething());
63 return cmds;
64 }
65
66 }
7878 }
7979
8080 if (metadata != null) {
81 pngMetadata.zTXt_keyword.add("plantuml");
82 pngMetadata.zTXt_compressionMethod.add(new Integer(0));
83 pngMetadata.zTXt_text.add(metadata);
81 // pngMetadata.zTXt_keyword.add("plantuml");
82 // pngMetadata.zTXt_compressionMethod.add(new Integer(0));
83 // pngMetadata.zTXt_text.add(metadata);
84
85 pngMetadata.iTXt_compressionFlag.add(new Boolean(true));
86 pngMetadata.iTXt_compressionMethod.add(new Integer(0));
87 pngMetadata.iTXt_keyword.add("plantuml");
88 pngMetadata.iTXt_languageTag.add("");
89 pngMetadata.iTXt_text.add(metadata);
90 pngMetadata.iTXt_translatedKeyword.add("");
91
8492 }
8593
8694 if (debugData != null) {
0 @startuml
1 interface Positionable {
2 + Dimension2D getSize();
3 + Point2D getPosition();
4 }
5
6 interface Clusterable {
7 +Cluster getParent();
8 }
9
10 Positionable <|-- Clusterable
11
12 class Cluster
13
14 Cluster *-- Cluster : subclusters
15 Clusterable <|.. Cluster
16 Cluster *-- Block
17 Clusterable <|.. Block
18
19 Path *-- "2" Cluster
20 Path --> Label : has one
21 Positionable <|-- Label
22
23 SimpleDrawer --> Cluster
24 SimpleDrawer *--> Path
25
26 class GraphvizSolver {
27 + Dimension2D solve(Cluster root, Collection<Path> paths)
28 }
29 GraphvizSolver --> Cluster
30 GraphvizSolver *--> Path
31
32
33 'Clusterable --> Cluster : Parent
34
35
36
37 @enduml
3737 import java.util.Iterator;
3838 import java.util.List;
3939 import java.util.regex.Matcher;
40 import java.util.regex.Pattern;
4041
4142 import net.sourceforge.plantuml.BackSlash;
4243
4647 private final String definition;
4748 private final String definitionQuoted;
4849 private final boolean emptyParentheses;
50 private Pattern pattern;
4951
5052 public Define(String key, List<String> lines, boolean emptyParentheses) {
5153 this.emptyParentheses = emptyParentheses;
6466 this.definitionQuoted = Matcher.quoteReplacement(definition);
6567 }
6668 this.signature = new DefineSignature(key, this.definitionQuoted);
69
6770 }
6871
6972 @Override
7578 if (definition == null) {
7679 return line;
7780 }
81 // if (getFunctionName().indexOf('_') >= 0 && line.indexOf('_') == -1) {
82 // return line;
83 // }
84 if (/* line.length() < getFunctionName().length() || */line.contains(getFunctionName()) == false) {
85 return line;
86 }
7887 if (signature.isMethod()) {
79 for (Variables vars : signature.getVariationVariables()) {
80 line = vars.applyOn(line);
88 if (line.indexOf('(') == -1) {
89 return line;
8190 }
91 line = apply1(line);
8292 } else {
83 final String regex = "\\b" + signature.getKey() + "\\b" + (emptyParentheses ? "(\\(\\))?" : "");
84 line = BackSlash.translateBackSlashes(line);
85 line = line.replaceAll(regex, definitionQuoted);
86 line = BackSlash.untranslateBackSlashes(line);
93 line = apply2(line);
8794 }
8895 return line;
8996 }
9097
98 private String apply2(String line) {
99 if (pattern == null) {
100 final String regex = "\\b" + signature.getKey() + "\\b" + (emptyParentheses ? "(\\(\\))?" : "");
101 pattern = Pattern.compile(regex);
102 }
103
104 line = BackSlash.translateBackSlashes(line);
105 line = pattern.matcher(line).replaceAll(definitionQuoted);
106 line = BackSlash.untranslateBackSlashes(line);
107 return line;
108 }
109
110 private String apply1(String line) {
111 for (Variables vars : signature.getVariationVariables()) {
112 line = vars.applyOn(line);
113 }
114 return line;
115 }
116
117 public final String getFunctionName() {
118 return signature.getFonctionName();
119 }
120
91121 }
4444 private final String key;
4545 private final String fonctionName;
4646 private final List<Variables> variables = new ArrayList<Variables>();
47 private final boolean isMethod;
4748
4849 public DefineSignature(String key, String definitionQuoted) {
4950 this.key = key;
51 this.isMethod = key.contains("(");
5052
5153 final StringTokenizer st = new StringTokenizer(key, "(),");
5254 this.fonctionName = st.nextToken().trim();
6971 }
7072
7173 public boolean isMethod() {
72 return key.contains("(");
74 return isMethod;
7375 }
7476
7577 public String getKey() {
8082 return Collections.unmodifiableList(variables);
8183 }
8284
85 public final String getFonctionName() {
86 return fonctionName;
87 }
88
8389 }
3636
3737 import java.io.File;
3838 import java.text.SimpleDateFormat;
39 import java.util.ArrayList;
3940 import java.util.Arrays;
41 import java.util.Collection;
4042 import java.util.Date;
43 import java.util.HashSet;
4144 import java.util.LinkedHashMap;
4245 import java.util.List;
4346 import java.util.Map;
47 import java.util.Set;
4448 import java.util.regex.Matcher;
4549 import java.util.regex.Pattern;
4650
6266
6367 @Override
6468 public String toString() {
65 return values.keySet().toString();
69 return values.keySet().toString() + " " + environment.keySet();
6670 }
6771
6872 public static Defines createEmpty() {
7983 public void importFrom(Defines other) {
8084 this.environment.putAll(other.environment);
8185 this.values.putAll(other.values);
86 magic = null;
8287 }
8388
8489 public Defines cloneMe() {
110115
111116 public void define(String name, List<String> value, boolean emptyParentheses) {
112117 values.put(name, new Define(name, value, emptyParentheses));
118 magic = null;
113119 }
114120
115121 public boolean isDefine(String expression) {
133139
134140 public void undefine(String name) {
135141 values.remove(name);
142 magic = null;
136143 }
137144
138145 public List<String> applyDefines(String line) {
146 // System.err.println("line=" + line + " " + values.size());
139147 line = manageDate(line);
140148 line = manageEnvironment(line);
141 for (Map.Entry<String, Define> ent : values.entrySet()) {
142 final Define def = ent.getValue();
149 line = method1(line);
150 // line = values.size() < 10 ? method1(line) : method2(line);
151 return Arrays.asList(line.split("\n"));
152 }
153
154 private String method1(String line) {
155 for (Define def : values.values()) {
143156 line = def.apply(line);
144157 }
145 return Arrays.asList(line.split("\n"));
158 return line;
159 }
160
161 private Map<String, Collection<Define>> getAll() {
162 final Map<String, Collection<Define>> result = new LinkedHashMap<String, Collection<Define>>();
163 for (Define def : values.values()) {
164 Collection<Define> tmp = result.get(def.getFunctionName());
165 if (tmp == null) {
166 tmp = new ArrayList<Define>();
167 result.put(def.getFunctionName(), tmp);
168 }
169 tmp.add(def);
170 }
171 return result;
172 }
173
174 private Map<String, Collection<Define>> magic;
175
176 private String method2(String line) {
177 final Set<String> words = words(line);
178 if (magic == null) {
179 magic = getAll();
180
181 }
182 for (String w : words) {
183 Collection<Define> tmp = magic.get(w);
184 if (tmp == null) {
185 continue;
186 }
187 for (Define def : tmp) {
188 line = def.apply(line);
189 }
190 }
191 return line;
192 }
193
194 private Set<String> words(String line) {
195 final String ID = "[A-Za-z_][A-Za-z_0-9]*";
196 Pattern p = Pattern.compile(ID);
197 Matcher m = p.matcher(line);
198 final Set<String> words = new HashSet<String>();
199 while (m.find()) {
200 words.add(m.group(0));
201 }
202 return words;
146203 }
147204
148205 private String manageEnvironment(String line) {
175232 return line;
176233 }
177234
178 public void saveState() {
179 if (savedState.size() > 0) {
180 throw new IllegalStateException();
181 }
235 public void saveState1() {
182236 this.savedState.putAll(values);
183237
184238 }
185239
186 public void restoreState() {
240 public void restoreState1() {
187241 this.values.clear();
188242 this.values.putAll(savedState);
189
243 magic = null;
190244 }
191245
192246 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 public class DefinesGet {
38
39 private final Defines defines;
40
41 public DefinesGet(Defines defines) {
42 this.defines = defines;
43 }
44
45 public final Defines get() {
46 return defines;
47 }
48
49 public void saveState() {
50 this.defines.saveState1();
51 }
52
53 public void restoreState() {
54 this.defines.restoreState1();
55 }
56
57 }
3636 package net.sourceforge.plantuml.preproc;
3737
3838 import java.io.File;
39 import java.io.IOException;
40 import java.io.InputStream;
41 import java.io.InputStreamReader;
42 import java.io.Reader;
3943 import java.util.HashSet;
4044 import java.util.Set;
45 import java.util.zip.ZipEntry;
46 import java.util.zip.ZipInputStream;
47
48 import net.sourceforge.plantuml.AFile;
49 import net.sourceforge.plantuml.AFileRegular;
50 import net.sourceforge.plantuml.AParentFolder;
51 import net.sourceforge.plantuml.Log;
4152
4253 public class FileWithSuffix {
4354
44 private final File file;
55 private final AFile file;
4556 private final String suffix;
57 private final String entry;
58 private final String description;
4659
47 public FileWithSuffix(File file, String suffix) {
48 this.file = file;
60 public Reader getReader(String charset) throws IOException {
61 if (entry == null) {
62 if (charset == null) {
63 Log.info("Using default charset");
64 return new InputStreamReader(file.open());
65 }
66 Log.info("Using charset " + charset);
67 return new InputStreamReader(file.open(), charset);
68 }
69 final InputStream is = getDataFromZip(file.open(), entry);
70 if (is == null) {
71 return null;
72 }
73 if (charset == null) {
74 Log.info("Using default charset");
75 return new InputStreamReader(is);
76 }
77 Log.info("Using charset " + charset);
78 return new InputStreamReader(is, charset);
79 }
80
81 private InputStream getDataFromZip(InputStream is, String name) throws IOException {
82 final ZipInputStream zis = new ZipInputStream(is);
83 ZipEntry ze = zis.getNextEntry();
84
85 while (ze != null) {
86 final String fileName = ze.getName();
87 if (ze.isDirectory()) {
88 } else if (fileName.equals(name)) {
89 return zis;
90 }
91 ze = zis.getNextEntry();
92 }
93 zis.closeEntry();
94 zis.close();
95 return null;
96 }
97
98 public boolean fileOk() {
99 return file != null && file.isOk();
100 }
101
102 FileWithSuffix(File file, String suffix) {
103 this.file = new AFileRegular(file);
49104 this.suffix = suffix;
105 this.entry = null;
106 // this.description = file.getAbsolutePath();
107 this.description = getFileName(file);
108 }
109
110 public static String getFileName(File file) {
111 return file.getName();
112 }
113
114 public static String getAbsolutePath(File file) {
115 return file.getAbsolutePath();
116 }
117
118 public FileWithSuffix(ImportedFiles importedFiles, String fileName, String suffix) throws IOException {
119 final int idx = fileName.indexOf('~');
120 this.suffix = suffix;
121 if (idx == -1) {
122 this.file = importedFiles.getAFile(fileName);
123 this.entry = null;
124 } else {
125 this.file = importedFiles.getAFile(fileName.substring(0, idx));
126 this.entry = fileName.substring(idx + 1);
127 }
128
129 if (file == null) {
130 this.description = fileName;
131 } else if (entry == null) {
132 // this.description = file.getAbsolutePath();
133 this.description = fileName;
134 } else {
135 // this.description = file.getAbsolutePath() + "~" + entry;
136 this.description = fileName;
137 }
138
50139 }
51140
52141 @Override
53142 public int hashCode() {
54 return file.hashCode() + (suffix == null ? 0 : suffix.hashCode() * 43);
143 return (file == null ? 0 : file.hashCode()) + (suffix == null ? 0 : suffix.hashCode() * 43)
144 + (entry == null ? 0 : entry.hashCode());
55145 }
56146
57147 @Override
58148 public boolean equals(Object arg) {
59149 final FileWithSuffix other = (FileWithSuffix) arg;
60 return this.file.equals(other.file) && equals(suffix, other.suffix);
150 return this.file.equals(other.file) && equals(suffix, other.suffix) && same(entry, other.entry);
151 }
152
153 private static boolean same(String s1, String s2) {
154 if (s1 == null && s2 == null) {
155 return true;
156 }
157 if (s1 != null && s2 != null) {
158 return s1.equals(s2);
159 }
160 return false;
61161 }
62162
63163 private static boolean equals(String s1, String s2) {
74174 public static Set<File> convert(Set<FileWithSuffix> all) {
75175 final Set<File> result = new HashSet<File>();
76176 for (FileWithSuffix f : all) {
77 result.add(f.file);
177 result.add(f.file.getUnderlyingFile());
78178 }
79179 return result;
80180 }
81181
182 public AParentFolder getParentFile() {
183 Log.info("Getting parent of " + file);
184 Log.info("-->The parent is " + file.getParentFile());
185 return file.getParentFile();
186 }
187
188 public String getDescription() {
189 return description;
190 }
191
192 public final String getSuffix() {
193 return suffix;
194 }
195
82196 }
4242 import net.sourceforge.plantuml.command.regex.Pattern2;
4343 import net.sourceforge.plantuml.version.Version;
4444
45 class IfManager extends ReadLineInstrumented implements ReadLine {
45 public class IfManager extends ReadLineInstrumented implements ReadLine {
4646
4747 protected static final Pattern2 ifdefPattern = MyPattern.cmpile("^[%s]*!if(n)?def[%s]+(.+)$");
4848 protected static final Pattern2 ifcomparePattern = MyPattern
5050 protected static final Pattern2 elsePattern = MyPattern.cmpile("^[%s]*!else[%s]*$");
5151 protected static final Pattern2 endifPattern = MyPattern.cmpile("^[%s]*!endif[%s]*$");
5252
53 private final Defines defines;
53 private final DefinesGet defines;
5454 private final ReadLine source;
5555
5656 private IfManager child;
5757
58 public IfManager(ReadLine source, Defines defines) {
58 public IfManager(ReadLine source, DefinesGet defines) {
5959 this.defines = defines;
6060 this.source = source;
6161 }
9595
9696 m = ifdefPattern.matcher(s);
9797 if (m.find()) {
98 boolean ok = defines.isDefine(m.group(2));
98 boolean ok = defines.get().isDefine(m.group(2));
9999 if (m.group(1) != null) {
100100 ok = !ok;
101101 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.IOException;
38
39 import net.sourceforge.plantuml.CharSequence2;
40 import net.sourceforge.plantuml.preproc2.ReadFilter;
41
42 public class IfManagerFilter implements ReadFilter {
43
44 private final DefinesGet defines;
45
46 public IfManagerFilter(DefinesGet defines) {
47 this.defines = defines;
48 }
49
50 public ReadLine applyFilter(final ReadLine source) {
51 return new ReadLine() {
52
53 final IfManager ifManager = new IfManager(source, defines);
54
55 public void close() throws IOException {
56 source.close();
57 }
58
59 public CharSequence2 readLine() throws IOException {
60 return ifManager.readLine();
61 }
62 };
63 }
64
65 }
4343
4444 private boolean skippingDone = false;
4545
46 public IfManagerNegatif(ReadLine source, Defines defines) {
46 public IfManagerNegatif(ReadLine source, DefinesGet defines) {
4747 super(source, defines);
4848 }
4949
4141
4242 class IfManagerPositif extends IfManager {
4343
44 public IfManagerPositif(ReadLine source, Defines defines) {
44 public IfManagerPositif(ReadLine source, DefinesGet defines) {
4545 super(source, defines);
4646 }
4747
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 * Modified by: Nicolas Jouanin
33 *
34 *
35 */
36 package net.sourceforge.plantuml.preproc;
37
38 import java.io.File;
39 import java.io.IOException;
40 import java.util.ArrayList;
41 import java.util.List;
42
43 import net.sourceforge.plantuml.AFile;
44 import net.sourceforge.plantuml.AFileRegular;
45 import net.sourceforge.plantuml.AFileZipEntry;
46 import net.sourceforge.plantuml.AParentFolder;
47 import net.sourceforge.plantuml.FileSystem;
48 import net.sourceforge.plantuml.Log;
49
50 public class ImportedFiles {
51
52 private final List<File> imported;
53 private final AParentFolder currentDir;
54
55 private ImportedFiles(List<File> imported, AParentFolder currentDir) {
56 this.imported = imported;
57 this.currentDir = currentDir;
58 }
59
60 public ImportedFiles withCurrentDir(AParentFolder newCurrentDir) {
61 if (newCurrentDir == null) {
62 return this;
63 }
64 return new ImportedFiles(imported, newCurrentDir);
65 }
66
67 public static ImportedFiles createImportedFiles(AParentFolder newCurrentDir) {
68 return new ImportedFiles(new ArrayList<File>(), newCurrentDir);
69 }
70
71 @Override
72 public String toString() {
73 return "ImportedFiles=" + imported + " currentDir=" + currentDir;
74 }
75
76 public AFile getAFile(String nameOrPath) throws IOException {
77 Log.info("ImportedFiles::getAFile nameOrPath = " + nameOrPath);
78 Log.info("ImportedFiles::getAFile currentDir = " + currentDir);
79 final AParentFolder dir = currentDir;
80 if (dir == null || isAbsolute(nameOrPath)) {
81 return new AFileRegular(new File(nameOrPath).getCanonicalFile());
82 }
83 // final File filecurrent = new File(dir.getAbsoluteFile(), nameOrPath);
84 final AFile filecurrent = dir.getAFile(nameOrPath);
85 Log.info("ImportedFiles::getAFile filecurrent = " + filecurrent);
86 if (filecurrent != null && filecurrent.isOk()) {
87 return filecurrent;
88 }
89 for (File d : getPath()) {
90 if (d.isDirectory()) {
91 final File file = new File(d, nameOrPath);
92 if (file.exists()) {
93 return new AFileRegular(file.getCanonicalFile());
94 }
95 } else if (d.isFile()) {
96 final AFileZipEntry zipEntry = new AFileZipEntry(d, nameOrPath);
97 if (zipEntry.isOk()) {
98 return zipEntry;
99 }
100 }
101 }
102 return filecurrent;
103 }
104
105 public List<File> getPath() {
106 final List<File> result = new ArrayList<File>(imported);
107 result.addAll(FileSystem.getPath("plantuml.include.path", true));
108 result.addAll(FileSystem.getPath("java.class.path", true));
109 return result;
110 }
111
112 private boolean isAbsolute(String nameOrPath) {
113 final File f = new File(nameOrPath);
114 return f.isAbsolute();
115 }
116
117 public void add(File file) {
118 this.imported.add(file);
119 }
120
121 public AParentFolder getCurrentDir() {
122 return currentDir;
123 }
124
125 }
+0
-98
src/net/sourceforge/plantuml/preproc/Preprocessor.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.File;
38 import java.io.IOException;
39 import java.util.Collections;
40 import java.util.List;
41 import java.util.Set;
42
43 import net.sourceforge.plantuml.CharSequence2;
44 import net.sourceforge.plantuml.DefinitionsContainer;
45 import net.sourceforge.plantuml.Log;
46
47 public class Preprocessor extends ReadLineInstrumented implements ReadLine {
48
49 private final PreprocessorInclude include;
50 private final SubPreprocessor subPreprocessor;
51 private final String description;
52
53 public Sub getSub(String blocname) {
54 return subPreprocessor.getSub(blocname);
55 }
56
57 // public Preprocessor(List<String> config, ReadLine reader, String charset, Defines defines, File newCurrentDir,
58 // DefinitionsContainer definitionsContainer) {
59 //
60 // final ReadLine source2 = new IfManager(reader, defines);
61 // final ReadLineInsertable source3 = new ReadLineInsertable(source2);
62 // final ReadLine source4 = new PreprocessorDefine(defines, source3);
63 // this.include = new PreprocessorInclude(config, source4, defines, charset, newCurrentDir, definitionsContainer);
64 // this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, include);
65 // }
66
67 public Preprocessor(List<String> config, ReadLine reader, String charset, Defines defines, File newCurrentDir,
68 DefinitionsContainer definitionsContainer) {
69 this.description = reader.toString();
70 this.include = new PreprocessorInclude(config, reader, defines, charset, newCurrentDir, definitionsContainer);
71 final ReadLine source2 = new IfManager(include, defines);
72 final ReadLineInsertable source3 = new ReadLineInsertable(source2);
73 final ReadLine source4 = new PreprocessorDefine(defines, source3);
74 this.subPreprocessor = new SubPreprocessor(config, charset, defines, definitionsContainer, source4);
75 }
76
77 @Override
78 CharSequence2 readLineInst() throws IOException {
79 return subPreprocessor.readLine();
80 }
81
82 public int getLineNumber() {
83 return include.getLineNumber();
84 }
85
86 @Override
87 void closeInst() throws IOException {
88 // Log.info("Closing preprocessor of " + description);
89 include.close();
90 subPreprocessor.close();
91 }
92
93 public Set<FileWithSuffix> getFilesUsed() {
94 return Collections.unmodifiableSet(include.getFilesUsedGlobal());
95 }
96
97 }
+0
-201
src/net/sourceforge/plantuml/preproc/PreprocessorDefine.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.IOException;
38 import java.util.ArrayList;
39 import java.util.List;
40
41 import net.sourceforge.plantuml.CharSequence2;
42 import net.sourceforge.plantuml.CharSequence2Impl;
43 import net.sourceforge.plantuml.StringUtils;
44 import net.sourceforge.plantuml.command.regex.Matcher2;
45 import net.sourceforge.plantuml.command.regex.MyPattern;
46 import net.sourceforge.plantuml.command.regex.Pattern2;
47 import net.sourceforge.plantuml.utils.StartUtils;
48
49 public class PreprocessorDefine extends ReadLineInstrumented implements ReadLine {
50
51 private static final String END_DEFINE_LONG = "!enddefinelong";
52 private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
53 private static final String ID_ARG = "\\s*[A-Za-z_][A-Za-z_0-9]*\\s*(?:=\\s*(?:\"[^\"]*\"|'[^']*')\\s*)?";
54 private static final String ARG = "(?:\\(" + ID_ARG + "(?:," + ID_ARG + ")*?\\))?";
55 private static final Pattern2 definePattern = MyPattern.cmpile("^[%s]*!define[%s]+(" + ID + ARG + ")"
56 + "(?:[%s]+(.*))?$");
57 private static final Pattern2 filenamePattern = MyPattern.cmpile("^[%s]*!filename[%s]+(.+)$");
58 private static final Pattern2 undefPattern = MyPattern.cmpile("^[%s]*!undef[%s]+(" + ID + ")$");
59 private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")");
60 private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$");
61
62 private final Defines defines;
63
64 private final ReadLineInsertable source;
65
66 public PreprocessorDefine(Defines defines, ReadLineInsertable source) {
67 this.defines = defines;
68 this.defines.saveState();
69 this.source = source;
70 }
71
72 @Override
73 CharSequence2 readLineInst() throws IOException {
74 final CharSequence2 s = source.readLine();
75 if (s == null) {
76 return null;
77 }
78 if (StartUtils.isArobaseStartDiagram(s)) {
79 this.defines.restoreState();
80 }
81
82 Matcher2 m = filenamePattern.matcher(s);
83 if (m.find()) {
84 return manageFilename(m);
85 }
86 m = definePattern.matcher(s);
87 if (m.find()) {
88 return manageDefine(m, s.toString().trim().endsWith("()"));
89 }
90
91 m = definelongPattern.matcher(s);
92 if (m.find()) {
93 return manageDefineLong(m, s.toString().trim().endsWith("()"));
94 }
95
96 m = undefPattern.matcher(s);
97 if (m.find()) {
98 return manageUndef(m);
99 }
100
101 if (ignoreDefineDuringSeveralLines > 0) {
102 ignoreDefineDuringSeveralLines--;
103 return s;
104 }
105
106 List<String> result = defines.applyDefines(s.toString2());
107 if (result.size() > 1) {
108 result = cleanEndDefineLong(result);
109 final List<String> inserted = cleanEndDefineLong(result.subList(1, result.size()));
110 ignoreDefineDuringSeveralLines = inserted.size();
111 source.insert(inserted, s.getLocation());
112 }
113 return new CharSequence2Impl(result.get(0), s.getLocation(), s.getPreprocessorError());
114 }
115
116 private List<String> cleanEndDefineLong(List<String> data) {
117 final List<String> result = new ArrayList<String>();
118 for (String s : data) {
119 final String clean = cleanEndDefineLong(s);
120 if (clean != null) {
121 result.add(clean);
122 }
123 }
124 return result;
125
126 }
127
128 private String cleanEndDefineLong(String s) {
129 if (s.trim().startsWith(END_DEFINE_LONG)) {
130 s = s.trim().substring(END_DEFINE_LONG.length());
131 if (s.length() == 0) {
132 return null;
133 }
134 }
135 return s;
136 }
137
138 private int ignoreDefineDuringSeveralLines = 0;
139
140 private CharSequence2 manageUndef(Matcher2 m) throws IOException {
141 defines.undefine(m.group(1));
142 return this.readLine();
143 }
144
145 private CharSequence2 manageDefineLong(Matcher2 m, boolean emptyParentheses) throws IOException {
146 final String group1 = m.group(1);
147 final List<String> def = new ArrayList<String>();
148 while (true) {
149 final CharSequence2 read = this.readLine();
150 if (read == null) {
151 return null;
152 }
153 if (enddefinelongPattern.matcher(read).find()) {
154 defines.define(group1, def, emptyParentheses);
155 return this.readLine();
156 }
157 def.add(read.toString2());
158 }
159 }
160
161 private CharSequence2 manageFilename(Matcher2 m) throws IOException {
162 final String group1 = m.group(1);
163 this.defines.overrideFilename(group1);
164 return this.readLine();
165 }
166
167 private CharSequence2 manageDefine(Matcher2 m, boolean emptyParentheses) throws IOException {
168 final String group1 = m.group(1);
169 final String group2 = m.group(2);
170 if (group2 == null) {
171 defines.define(group1, null, emptyParentheses);
172 } else {
173 final List<String> strings = defines.applyDefines(group2);
174 if (strings.size() > 1) {
175 defines.define(group1, strings, emptyParentheses);
176 } else {
177 final StringBuilder value = new StringBuilder(strings.get(0));
178 while (StringUtils.endsWithBackslash(value.toString())) {
179 value.setLength(value.length() - 1);
180 final CharSequence2 read = this.readLine();
181 value.append(read.toString2());
182 }
183 final List<String> li = new ArrayList<String>();
184 li.add(value.toString());
185 defines.define(group1, li, emptyParentheses);
186 }
187 }
188 return this.readLine();
189 }
190
191 // public int getLineNumber() {
192 // return source.getLineNumber();
193 // }
194
195 @Override
196 void closeInst() throws IOException {
197 source.close();
198 }
199
200 }
+0
-343
src/net/sourceforge/plantuml/preproc/PreprocessorInclude.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 * Modified by: Nicolas Jouanin
33 *
34 *
35 */
36 package net.sourceforge.plantuml.preproc;
37
38 import java.io.File;
39 import java.io.FileInputStream;
40 import java.io.FileReader;
41 import java.io.IOException;
42 import java.io.InputStream;
43 import java.io.InputStreamReader;
44 import java.net.MalformedURLException;
45 import java.net.URL;
46 import java.util.ArrayList;
47 import java.util.Collections;
48 import java.util.HashSet;
49 import java.util.List;
50 import java.util.Set;
51 import java.util.regex.Matcher;
52 import java.util.regex.Pattern;
53
54 import net.sourceforge.plantuml.CharSequence2;
55 import net.sourceforge.plantuml.DefinitionsContainer;
56 import net.sourceforge.plantuml.FileSystem;
57 import net.sourceforge.plantuml.Log;
58 import net.sourceforge.plantuml.OptionFlags;
59 import net.sourceforge.plantuml.StringUtils;
60 import net.sourceforge.plantuml.command.regex.Matcher2;
61 import net.sourceforge.plantuml.command.regex.MyPattern;
62 import net.sourceforge.plantuml.command.regex.Pattern2;
63 import net.sourceforge.plantuml.utils.StartUtils;
64
65 public class PreprocessorInclude extends ReadLineInstrumented implements ReadLine {
66
67 private static final Pattern2 includeDefPattern = MyPattern.cmpile("^[%s]*!includedef[%s]+[%g]?([^%g]+)[%g]?$");
68 private static final Pattern2 includePattern = MyPattern.cmpile("^[%s]*!include[%s]+[%g]?([^%g]+)[%g]?$");
69 private static final Pattern2 includePatternStdlib = MyPattern.cmpile("^[%s]*!include[%s]+(\\<[^%g]+\\>)$");
70 private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$");
71 private static final Pattern2 includeURLPattern = MyPattern.cmpile("^[%s]*!includeurl[%s]+[%g]?([^%g]+)[%g]?$");
72
73 private final ReadLine reader2;
74 private final String charset;
75 private final Defines defines;
76 private final List<String> config;
77 private final DefinitionsContainer definitionsContainer;
78
79 private int numLine = 0;
80
81 private PreprocessorInclude included = null;
82
83 private final File oldCurrentDir;
84 private final Set<FileWithSuffix> filesUsedCurrent;
85 private final Set<FileWithSuffix> filesUsedGlobal;
86
87 public PreprocessorInclude(List<String> config, ReadLine reader, Defines defines, String charset,
88 File newCurrentDir, DefinitionsContainer definitionsContainer) {
89 this(config, reader, defines, charset, newCurrentDir, new HashSet<FileWithSuffix>(),
90 new HashSet<FileWithSuffix>(), definitionsContainer);
91 }
92
93 public Set<FileWithSuffix> getFilesUsedGlobal() {
94 return Collections.unmodifiableSet(filesUsedGlobal);
95 }
96
97 private PreprocessorInclude(List<String> config, ReadLine reader, Defines defines, String charset,
98 File newCurrentDir, Set<FileWithSuffix> filesUsedCurrent, Set<FileWithSuffix> filesUsedGlobal,
99 DefinitionsContainer definitionsContainer) {
100 this.config = config;
101 this.defines = defines;
102 this.charset = charset;
103 this.reader2 = new ReadLineQuoteComment(reader);
104 this.definitionsContainer = definitionsContainer;
105 this.filesUsedCurrent = filesUsedCurrent;
106 this.filesUsedGlobal = filesUsedGlobal;
107 if (newCurrentDir == null) {
108 oldCurrentDir = null;
109 } else {
110 oldCurrentDir = FileSystem.getInstance().getCurrentDir();
111 FileSystem.getInstance().setCurrentDir(newCurrentDir);
112 }
113 }
114
115 private void restoreCurrentDir() {
116 if (oldCurrentDir != null) {
117 FileSystem.getInstance().setCurrentDir(oldCurrentDir);
118 }
119 }
120
121 @Override
122 CharSequence2 readLineInst() throws IOException {
123 final CharSequence2 result = readLineInternal();
124 if (result != null && StartUtils.isArobaseStartDiagram(result) && config.size() > 0) {
125 final List<String> empty = new ArrayList<String>();
126 included = new PreprocessorInclude(empty, new ReadLineList(config, result.getLocation()), defines, charset,
127 null, filesUsedCurrent, filesUsedGlobal, definitionsContainer);
128 }
129 if (result != null && (StartUtils.isArobaseEndDiagram(result) || StartUtils.isArobaseStartDiagram(result))) {
130 // http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram
131 filesUsedCurrent.clear();
132 }
133 return result;
134 }
135
136 private CharSequence2 readLineInternal() throws IOException {
137 if (included != null) {
138 final CharSequence2 s = included.readLine();
139 if (s != null) {
140 return s;
141 }
142 included.close();
143 included = null;
144 }
145
146 final CharSequence2 s = reader2.readLine();
147 numLine++;
148 if (s == null) {
149 return null;
150 }
151 if (OptionFlags.ALLOW_INCLUDE) {
152 assert included == null;
153 final Matcher2 m1 = includePattern.matcher(s);
154 if (m1.find()) {
155 return manageFileInclude(s, m1, false);
156 }
157 final Matcher2 m2 = includeManyPattern.matcher(s);
158 if (m2.find()) {
159 return manageFileInclude(s, m2, true);
160 }
161 final Matcher2 m3 = includeDefPattern.matcher(s);
162 if (m3.find()) {
163 return manageDefinitionInclude(s, m3);
164 }
165 } else {
166 final Matcher2 m1 = includePatternStdlib.matcher(s);
167 if (m1.find()) {
168 return manageFileInclude(s, m1, false);
169 }
170 }
171 final Matcher2 mUrl = includeURLPattern.matcher(s);
172 if (s.getPreprocessorError() == null && mUrl.find()) {
173 return manageUrlInclude(s, mUrl);
174 }
175 return s;
176 }
177
178 private CharSequence2 manageUrlInclude(CharSequence2 s, Matcher2 m) throws IOException {
179 String urlString = m.group(1);
180 urlString = defines.applyDefines(urlString).get(0);
181 //
182 final int idx = urlString.lastIndexOf('!');
183 String suf = null;
184 if (idx != -1) {
185 suf = urlString.substring(idx + 1);
186 urlString = urlString.substring(0, idx);
187 }
188 try {
189 final URL url = new URL(urlString);
190 included = new PreprocessorInclude(config, getReaderInclude(s, url, suf), defines, charset, null,
191 filesUsedCurrent, filesUsedGlobal, definitionsContainer);
192 } catch (MalformedURLException e) {
193 return s.withErrorPreprocessor("Cannot include url " + urlString);
194 }
195 return this.readLine();
196 }
197
198 private CharSequence2 manageDefinitionInclude(CharSequence2 s, Matcher2 matcher) throws IOException {
199 final String definitionName = matcher.group(1);
200 final List<? extends CharSequence> definition = definitionsContainer.getDefinition(definitionName);
201 included = new PreprocessorInclude(config, new ReadLineList(definition, s.getLocation()), defines, charset,
202 null, filesUsedCurrent, filesUsedGlobal, definitionsContainer);
203 return this.readLine();
204 }
205
206 private CharSequence2 manageFileInclude(CharSequence2 s, Matcher2 matcher, boolean allowMany) throws IOException {
207 String fileName = matcher.group(1);
208 fileName = defines.applyDefines(fileName).get(0);
209 if (fileName.startsWith("<") && fileName.endsWith(">")) {
210 final ReadLine strlibReader = getReaderStdlibInclude(s, fileName.substring(1, fileName.length() - 1));
211 if (strlibReader == null) {
212 return s.withErrorPreprocessor("Cannot include " + fileName);
213 }
214 included = new PreprocessorInclude(config, strlibReader, defines, charset, null, filesUsedCurrent,
215 filesUsedGlobal, definitionsContainer);
216 return this.readLine();
217 }
218 final int idx = fileName.lastIndexOf('!');
219 String suf = null;
220 if (idx != -1) {
221 suf = fileName.substring(idx + 1);
222 fileName = fileName.substring(0, idx);
223 }
224 final File f = FileSystem.getInstance().getFile(withEnvironmentVariable(fileName));
225 final FileWithSuffix f2 = new FileWithSuffix(f, suf);
226 if (f.exists() == false || f.isDirectory()) {
227 return s.withErrorPreprocessor("Cannot include " + f.getAbsolutePath());
228 } else if (allowMany == false && filesUsedCurrent.contains(f2)) {
229 // return CharSequence2Impl.errorPreprocessor("File already included " + f.getAbsolutePath(), lineLocation);
230 return this.readLine();
231 }
232 filesUsedCurrent.add(f2);
233 filesUsedGlobal.add(f2);
234 included = new PreprocessorInclude(config, getReaderInclude(s, f, suf), defines, charset, f.getParentFile(),
235 filesUsedCurrent, filesUsedGlobal, definitionsContainer);
236 return this.readLine();
237 }
238
239 static String withEnvironmentVariable(String s) {
240 final Pattern p = Pattern.compile("%(\\w+)%");
241
242 final Matcher m = p.matcher(s);
243 final StringBuffer sb = new StringBuffer();
244 while (m.find()) {
245 final String var = m.group(1);
246 final String value = getenv(var);
247 if (value != null) {
248 m.appendReplacement(sb, Matcher.quoteReplacement(value));
249 }
250 }
251 m.appendTail(sb);
252 s = sb.toString();
253 return s;
254 }
255
256 public static String getenv(String var) {
257 final String env = System.getProperty(var);
258 if (StringUtils.isNotEmpty(env)) {
259 return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(env);
260 }
261 final String getenv = System.getenv(var);
262 if (StringUtils.isNotEmpty(getenv)) {
263 return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(getenv);
264 }
265 return null;
266 }
267
268 private InputStream getStdlibInputStream(String filename) {
269 final InputStream result = Stdlib.getResourceAsStream(filename);
270 // Log.info("Loading sdlib " + filename + " ok");
271 return result;
272 }
273
274 private ReadLine getReaderStdlibInclude(CharSequence2 s, String filename) {
275 Log.info("Loading sdlib " + filename);
276 InputStream is = getStdlibInputStream(filename);
277 if (is == null) {
278 return null;
279 }
280 final String description = "<" + filename + ">";
281 try {
282 if (StartDiagramExtractReader.containsStartDiagram(s, is, description)) {
283 is = getStdlibInputStream(filename);
284 return new StartDiagramExtractReader(s, is, description);
285 }
286 is = getStdlibInputStream(filename);
287 if (is == null) {
288 return null;
289 }
290 return ReadLineReader.create(new InputStreamReader(is), description);
291 } catch (IOException e) {
292 return new ReadLineSimple(s, e.toString());
293 }
294 }
295
296 private ReadLine getReaderInclude(CharSequence2 s, final File f, String suf) {
297 try {
298 if (StartDiagramExtractReader.containsStartDiagram(s, f, charset)) {
299 return new StartDiagramExtractReader(s, f, suf, charset);
300 }
301 if (charset == null) {
302 Log.info("Using default charset");
303 return ReadLineReader.create(new FileReader(f), f.getAbsolutePath(), s.getLocation());
304 }
305 Log.info("Using charset " + charset);
306 return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(),
307 s.getLocation());
308 } catch (IOException e) {
309 return new ReadLineSimple(s, e.toString());
310 }
311
312 }
313
314 private ReadLine getReaderInclude(CharSequence2 s, final URL url, String suf) {
315 try {
316 if (StartDiagramExtractReader.containsStartDiagram(s, url, charset)) {
317 return new StartDiagramExtractReader(s, url, suf, charset);
318 }
319 final InputStream is = url.openStream();
320 if (charset == null) {
321 Log.info("Using default charset");
322 return ReadLineReader.create(new InputStreamReader(is), url.toString(), s.getLocation());
323 }
324 Log.info("Using charset " + charset);
325 return ReadLineReader.create(new InputStreamReader(is, charset), url.toString(), s.getLocation());
326 } catch (IOException e) {
327 return new ReadLineSimple(s, e.toString());
328 }
329
330 }
331
332 public int getLineNumber() {
333 return numLine;
334 }
335
336 @Override
337 void closeInst() throws IOException {
338 restoreCurrentDir();
339 reader2.close();
340 }
341
342 }
+0
-72
src/net/sourceforge/plantuml/preproc/ReadLineConcat.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.IOException;
38
39 import net.sourceforge.plantuml.CharSequence2;
40
41 public class ReadLineConcat implements ReadLine {
42
43 private ReadLine file1;
44 final private ReadLine file2;
45
46 public ReadLineConcat(ReadLine file1, ReadLine file2) {
47 this.file1 = file1;
48 this.file2 = file2;
49 }
50
51 public void close() throws IOException {
52 if (file1 != null) {
53 throw new IllegalStateException();
54 }
55 file2.close();
56 }
57
58 public CharSequence2 readLine() throws IOException {
59 CharSequence2 result = null;
60 if (file1 != null) {
61 result = file1.readLine();
62 if (result == null) {
63 file1.close();
64 file1 = null;
65 }
66 return readLine();
67 }
68 return file2.readLine();
69 }
70
71 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import net.sourceforge.plantuml.CharSequence2;
38
39 public class ReadLineEmpty implements ReadLine {
40
41 public void close() {
42 }
43
44 public CharSequence2 readLine() {
45 return null;
46 }
47
48 }
+0
-80
src/net/sourceforge/plantuml/preproc/ReadLineInsertable.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.IOException;
38 import java.util.Iterator;
39 import java.util.LinkedList;
40 import java.util.List;
41
42 import net.sourceforge.plantuml.CharSequence2;
43 import net.sourceforge.plantuml.CharSequence2Impl;
44 import net.sourceforge.plantuml.LineLocation;
45
46 class ReadLineInsertable implements ReadLine {
47
48 private final ReadLine source;
49 private final List<CharSequence2> inserted = new LinkedList<CharSequence2>();
50
51 public ReadLineInsertable(ReadLine source) {
52 this.source = source;
53 }
54
55 public void close() throws IOException {
56 source.close();
57 }
58
59 public CharSequence2 readLine() throws IOException {
60 if (inserted.size() > 0) {
61 final Iterator<CharSequence2> it = inserted.iterator();
62 final CharSequence2 result = it.next();
63 it.remove();
64 return result;
65 }
66 return source.readLine();
67 }
68
69 public void insert(List<? extends CharSequence> data, LineLocation location) {
70 for (CharSequence s : data) {
71 insert(s, location);
72 }
73 }
74
75 public void insert(CharSequence s, LineLocation location) {
76 inserted.add(new CharSequence2Impl(s, location));
77 }
78
79 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.util.Set;
38
39 public interface ReadLineNumbered extends ReadLine {
40
41 public Set<FileWithSuffix> getFilesUsed();
42 }
+0
-86
src/net/sourceforge/plantuml/preproc/ReadLineQuoteComment.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.IOException;
38
39 import net.sourceforge.plantuml.CharSequence2;
40 import net.sourceforge.plantuml.CharSequence2Impl;
41
42 public class ReadLineQuoteComment extends ReadLineInstrumented implements ReadLine {
43
44 private final ReadLine raw;
45 private boolean longComment = false;
46
47 public ReadLineQuoteComment(ReadLine source) {
48 this.raw = source;
49 }
50
51 @Override
52 void closeInst() throws IOException {
53 raw.close();
54 }
55
56 @Override
57 CharSequence2 readLineInst() throws IOException {
58 while (true) {
59 final CharSequence2 result = raw.readLine();
60 if (result == null) {
61 return null;
62 }
63 final String trim = result.toString().replace('\t', ' ').trim();
64 if (this.longComment && trim.endsWith("'/")) {
65 this.longComment = false;
66 continue;
67 }
68 if (this.longComment) {
69 continue;
70 }
71 if (trim.startsWith("'")) {
72 continue;
73 }
74 if (trim.startsWith("/'") && trim.endsWith("'/")) {
75 continue;
76 }
77 if (trim.startsWith("/'") && trim.contains("'/") == false) {
78 this.longComment = true;
79 continue;
80 }
81 return ((CharSequence2Impl) result).removeInnerComment();
82 }
83 }
84
85 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import net.sourceforge.plantuml.CharSequence2;
38
39 public class ReadLineSingle implements ReadLine {
40
41 private final CharSequence2 data;
42 private int current = 0;
43
44 public ReadLineSingle(CharSequence2 s2) {
45 this.data = s2;
46 }
47
48 public void close() {
49 }
50
51 public CharSequence2 readLine() {
52 if (current > 0) {
53 return null;
54 }
55 current++;
56 return data;
57 }
58
59 }
3434 */
3535 package net.sourceforge.plantuml.preproc;
3636
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.FileReader;
4037 import java.io.IOException;
4138 import java.io.InputStream;
4239 import java.io.InputStreamReader;
40 import java.io.Reader;
4341 import java.net.URL;
4442
4543 import net.sourceforge.plantuml.CharSequence2;
5149 private final ReadLine raw;
5250 private boolean finished = false;
5351
54 public StartDiagramExtractReader(CharSequence2 s, File f, String uid, String charset) {
55 this(getReadLine(s, f, charset), uid);
52 public static StartDiagramExtractReader build(FileWithSuffix f2, CharSequence2 s, String charset) {
53 return new StartDiagramExtractReader(getReadLine(f2, s, charset), f2.getSuffix());
5654 }
5755
58 public StartDiagramExtractReader(CharSequence2 s, URL url, String uid, String charset) {
59 this(getReadLine(s, url, charset), uid);
56 public static StartDiagramExtractReader build(URL url, CharSequence2 s, String uid, String charset) {
57 return new StartDiagramExtractReader(getReadLine(url, s, charset), uid);
6058 }
6159
62 public StartDiagramExtractReader(CharSequence2 s, InputStream is, String desc) {
63 this(getReadLine(s, is, desc), null);
60 public static StartDiagramExtractReader build(InputStream is, CharSequence2 s, String desc) {
61 return new StartDiagramExtractReader(getReadLine(is, s, desc), null);
6462 }
6563
6664 private StartDiagramExtractReader(ReadLine raw, String suf) {
102100 return false;
103101 }
104102
105 private static ReadLine getReadLine(CharSequence2 s, File f, String charset) {
103 private static ReadLine getReadLine(FileWithSuffix f2, CharSequence2 s, String charset) {
106104 try {
107 if (charset == null) {
108 Log.info("Using default charset");
109 return new UncommentReadLine(ReadLineReader.create(new FileReader(f), f.getAbsolutePath()));
105 final Reader tmp1 = f2.getReader(charset);
106 if (tmp1 == null) {
107 return new ReadLineSimple(s, "Cannot open " + f2.getDescription());
110108 }
111 Log.info("Using charset " + charset);
112 return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset),
113 f.getAbsolutePath()));
109 return new UncommentReadLine(ReadLineReader.create(tmp1, f2.getDescription()));
114110 } catch (IOException e) {
115111 return new ReadLineSimple(s, e.toString());
116112 }
117113 }
118114
119 private static ReadLine getReadLine(CharSequence2 s, InputStream is, String description) {
115 private static ReadLine getReadLine(InputStream is, CharSequence2 s, String description) {
120116 return new UncommentReadLine(ReadLineReader.create(new InputStreamReader(is), description));
121117 }
122118
123 private static ReadLine getReadLine(CharSequence2 s, URL url, String charset) {
119 private static ReadLine getReadLine(URL url, CharSequence2 s, String charset) {
124120 try {
125121 if (charset == null) {
126122 Log.info("Using default charset");
135131 }
136132 }
137133
138 static public boolean containsStartDiagram(CharSequence2 s, File f, String charset) throws IOException {
139 final ReadLine r = getReadLine(s, f, charset);
134 static public boolean containsStartDiagram(FileWithSuffix f2, CharSequence2 s, String charset) throws IOException {
135 final ReadLine r = getReadLine(f2, s, charset);
140136 return containsStartDiagram(r);
141137 }
142138
143 static public boolean containsStartDiagram(CharSequence2 s, URL url, String charset) throws IOException {
144 final ReadLine r = getReadLine(s, url, charset);
139 static public boolean containsStartDiagram(URL url, CharSequence2 s, String charset) throws IOException {
140 final ReadLine r = getReadLine(url, s, charset);
145141 return containsStartDiagram(r);
146142 }
147143
148 static public boolean containsStartDiagram(CharSequence2 s, InputStream is, String description) throws IOException {
149 final ReadLine r = getReadLine(s, is, description);
144 static public boolean containsStartDiagram(InputStream is, CharSequence2 s, String description) throws IOException {
145 final ReadLine r = getReadLine(is, s, description);
150146 return containsStartDiagram(r);
151147 }
152148
+0
-185
src/net/sourceforge/plantuml/preproc/SubPreprocessor.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc;
36
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.FileReader;
40 import java.io.IOException;
41 import java.io.InputStreamReader;
42 import java.util.HashMap;
43 import java.util.List;
44 import java.util.Map;
45
46 import net.sourceforge.plantuml.CharSequence2;
47 import net.sourceforge.plantuml.DefinitionsContainer;
48 import net.sourceforge.plantuml.FileSystem;
49 import net.sourceforge.plantuml.Log;
50 import net.sourceforge.plantuml.command.regex.Matcher2;
51 import net.sourceforge.plantuml.command.regex.MyPattern;
52 import net.sourceforge.plantuml.command.regex.Pattern2;
53
54 public class SubPreprocessor extends ReadLineInstrumented implements ReadLine {
55
56 private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
57
58 private static final Pattern2 includeSubPattern = MyPattern.cmpile("^[%s]*!includesub[%s]+[%g]?([^%g]+)[%g]?$");
59
60 private static final Pattern2 startsub = MyPattern.cmpile("^[%s]*!startsub[%s]+(" + ID + ")");
61 private static final Pattern2 endsub = MyPattern.cmpile("^[%s]*!endsub[%s]*");
62
63 private final ReadLine source;
64 private final Defines defines;
65 private final DefinitionsContainer definitionsContainer;
66 private final String charset;
67 private final Map<String, Sub> subs = new HashMap<String, Sub>();
68 private final List<String> config;
69 private Sub learningSub;
70 private ReadLine includedSub;
71
72 public SubPreprocessor(List<String> config, String charset, Defines defines,
73 DefinitionsContainer definitionsContainer, ReadLine source) {
74 this.config = config;
75 this.source = source;
76 this.charset = charset;
77 this.defines = defines;
78 this.definitionsContainer = definitionsContainer;
79 }
80
81 @Override
82 CharSequence2 readLineInst() throws IOException {
83 if (includedSub != null) {
84 final CharSequence2 s = includedSub.readLine();
85 if (s != null) {
86 eventuallyLearn(s);
87 return s;
88 }
89 includedSub = null;
90 }
91
92 final CharSequence2 s = source.readLine();
93 if (s == null) {
94 return null;
95 }
96
97 final Matcher2 m1 = includeSubPattern.matcher(s);
98 if (m1.find()) {
99 return manageIncludeSub(s, m1);
100 }
101
102 Matcher2 m = startsub.matcher(s);
103 if (m.find()) {
104 return manageStartsub(m);
105 }
106
107 m = endsub.matcher(s);
108 if (m.find()) {
109 return manageEndsub(m);
110 }
111 eventuallyLearn(s);
112 return s;
113 }
114
115 private void eventuallyLearn(final CharSequence2 s) {
116 if (learningSub != null) {
117 learningSub.add(s);
118 }
119 }
120
121 private CharSequence2 manageIncludeSub(CharSequence2 s, Matcher2 m) throws IOException {
122 final String name = m.group(1);
123 final int idx = name.indexOf('!');
124 if (idx != -1) {
125 final String filename = name.substring(0, idx);
126 final String blocname = name.substring(idx + 1);
127 final File f = FileSystem.getInstance().getFile(PreprocessorInclude.withEnvironmentVariable(filename));
128 if (f.exists() == false || f.isDirectory()) {
129 return s.withErrorPreprocessor("Cannot include " + f.getAbsolutePath());
130 }
131 final Preprocessor data = new Preprocessor(config, getReaderInclude(s, f), charset, defines, null,
132 definitionsContainer);
133 while (data.readLine() != null) {
134 // Read file
135 }
136 data.close();
137 this.includedSub = data.getSub(blocname).getReadLine(s.getLocation());
138 } else {
139 this.includedSub = getSub(name).getReadLine(s.getLocation());
140 }
141 return this.readLine();
142 }
143
144 private ReadLine getReaderInclude(CharSequence2 s, final File f) {
145 try {
146 if (charset == null) {
147 Log.info("Using default charset");
148 return ReadLineReader.create(new FileReader(f), f.getAbsolutePath(), s.getLocation());
149 }
150 Log.info("Using charset " + charset);
151 return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), f.getAbsolutePath(),
152 s.getLocation());
153 } catch (IOException e) {
154 return new ReadLineSimple(s, e.toString());
155 }
156
157 }
158
159 private CharSequence2 manageStartsub(Matcher2 m) throws IOException {
160 final String name = m.group(1);
161 this.learningSub = getSub(name);
162 return this.readLine();
163 }
164
165 private CharSequence2 manageEndsub(Matcher2 m) throws IOException {
166 this.learningSub = null;
167 return this.readLine();
168 }
169
170 Sub getSub(String name) {
171 Sub result = subs.get(name);
172 if (result == null) {
173 result = new Sub(name);
174 subs.put(name, result);
175 }
176 return result;
177 }
178
179 @Override
180 void closeInst() throws IOException {
181 source.close();
182 }
183
184 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38 import java.util.Collections;
39 import java.util.HashSet;
40 import java.util.List;
41 import java.util.Set;
42
43 import net.sourceforge.plantuml.CharSequence2;
44 import net.sourceforge.plantuml.DefinitionsContainer;
45 import net.sourceforge.plantuml.preproc.Defines;
46 import net.sourceforge.plantuml.preproc.DefinesGet;
47 import net.sourceforge.plantuml.preproc.FileWithSuffix;
48 import net.sourceforge.plantuml.preproc.IfManagerFilter;
49 import net.sourceforge.plantuml.preproc.ImportedFiles;
50 import net.sourceforge.plantuml.preproc.ReadLine;
51 import net.sourceforge.plantuml.preproc.ReadLineNumbered;
52
53 public class Preprocessor2 implements ReadLineNumbered {
54
55 private final ReadLine source;
56 private final PreprocessorInclude3 include;
57
58 public Preprocessor2(List<String> config, ReadLine reader, String charset, Defines defines,
59 DefinitionsContainer definitionsContainer, ImportedFiles importedFiles) throws IOException {
60 this(config, reader, charset, new DefinesGet(defines), definitionsContainer, new HashSet<FileWithSuffix>(),
61 importedFiles);
62 }
63
64 Preprocessor2(List<String> config, ReadLine reader, String charset, DefinesGet defines,
65 DefinitionsContainer definitionsContainer, Set<FileWithSuffix> filesUsedGlobal, ImportedFiles importedFiles)
66 throws IOException {
67 final ReadFilterAnd2 filters = new ReadFilterAnd2();
68 defines.saveState();
69
70 filters.add(new ReadLineQuoteComment2());
71 include = new PreprocessorInclude3(config, charset, defines, definitionsContainer, importedFiles,
72 filesUsedGlobal);
73 filters.add(new ReadLineAddConfig2(config));
74 filters.add(new IfManagerFilter(defines));
75 filters.add(new PreprocessorDefine4Apply(defines));
76 filters.add(new SubPreprocessor2(charset, definitionsContainer));
77 filters.add(new PreprocessorDefine3Learner(defines));
78 filters.add(include);
79
80 this.source = filters.applyFilter(reader);
81 }
82
83 public CharSequence2 readLine() throws IOException {
84 return source.readLine();
85 }
86
87 public void close() throws IOException {
88 this.source.close();
89 }
90
91 public Set<FileWithSuffix> getFilesUsed() {
92 // System.err.println("************************** WARNING **************************");
93 // return Collections.emptySet();
94 return Collections.unmodifiableSet(include.getFilesUsedGlobal());
95 }
96 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38 import java.util.ArrayList;
39 import java.util.List;
40
41 import net.sourceforge.plantuml.CharSequence2;
42 import net.sourceforge.plantuml.StringUtils;
43 import net.sourceforge.plantuml.command.regex.Matcher2;
44 import net.sourceforge.plantuml.command.regex.MyPattern;
45 import net.sourceforge.plantuml.command.regex.Pattern2;
46 import net.sourceforge.plantuml.preproc.Defines;
47 import net.sourceforge.plantuml.preproc.DefinesGet;
48 import net.sourceforge.plantuml.preproc.ReadLine;
49 import net.sourceforge.plantuml.utils.StartUtils;
50
51 public class PreprocessorDefine3Learner implements ReadFilter {
52
53 private static final String END_DEFINE_LONG = "!enddefinelong";
54 private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
55 private static final String ID_ARG = "\\s*[A-Za-z_][A-Za-z_0-9]*\\s*(?:=\\s*(?:\"[^\"]*\"|'[^']*')\\s*)?";
56 private static final String ARG = "(?:\\(" + ID_ARG + "(?:," + ID_ARG + ")*?\\))?";
57 private static final Pattern2 definePattern = MyPattern.cmpile("^[%s]*!define[%s]+(" + ID + ARG + ")"
58 + "(?:[%s]+(.*))?$");
59 private static final Pattern2 filenamePattern = MyPattern.cmpile("^[%s]*!filename[%s]+(.+)$");
60 private static final Pattern2 undefPattern = MyPattern.cmpile("^[%s]*!undef[%s]+(" + ID + ")$");
61 private static final Pattern2 definelongPattern = MyPattern.cmpile("^[%s]*!definelong[%s]+(" + ID + ARG + ")");
62 private static final Pattern2 enddefinelongPattern = MyPattern.cmpile("^[%s]*" + END_DEFINE_LONG + "[%s]*$");
63
64 private final DefinesGet defines;
65
66 public PreprocessorDefine3Learner(DefinesGet defines) {
67 this.defines = defines;
68 }
69
70 public static boolean isLearningLine(CharSequence2 s) {
71 Matcher2 m = definePattern.matcher(s);
72 if (m.find()) {
73 return true;
74 }
75 m = definelongPattern.matcher(s);
76 if (m.find()) {
77 return true;
78 }
79 m = undefPattern.matcher(s);
80 if (m.find()) {
81 return true;
82 }
83 return false;
84 }
85
86 public ReadLine applyFilter(final ReadLine source) {
87 return new ReadLine() {
88
89 public void close() throws IOException {
90 source.close();
91 }
92
93 public CharSequence2 readLine() throws IOException {
94 while (true) {
95 final CharSequence2 s = source.readLine();
96 if (s == null || s.getPreprocessorError() != null) {
97 return s;
98 }
99 if (StartUtils.isArobaseStartDiagram(s)) {
100 defines.restoreState();
101 return s;
102 }
103
104 Matcher2 m = filenamePattern.matcher(s);
105 if (m.find()) {
106 manageFilename(m);
107 continue;
108 }
109 m = definePattern.matcher(s);
110 if (m.find()) {
111 manageDefine(source, m, s.toString().trim().endsWith("()"));
112 continue;
113 }
114 m = definelongPattern.matcher(s);
115 if (m.find()) {
116 manageDefineLong(source, m, s.toString().trim().endsWith("()"));
117 continue;
118 }
119
120 m = undefPattern.matcher(s);
121 if (m.find()) {
122 manageUndef(m);
123 continue;
124 }
125 return s;
126 }
127 }
128 };
129 }
130
131 private void manageUndef(Matcher2 m) throws IOException {
132 defines.get().undefine(m.group(1));
133 }
134
135 private void manageDefineLong(ReadLine source, Matcher2 m, boolean emptyParentheses) throws IOException {
136 final String group1 = m.group(1);
137 final List<String> def = new ArrayList<String>();
138 while (true) {
139 final CharSequence2 read = source.readLine();
140 if (read == null) {
141 return;
142 }
143 if (enddefinelongPattern.matcher(read).find()) {
144 defines.get().define(group1, def, emptyParentheses);
145 return;
146 }
147 def.add(read.toString2());
148 }
149 }
150
151 private void manageFilename(Matcher2 m) {
152 final String group1 = m.group(1);
153 this.defines.get().overrideFilename(group1);
154 }
155
156 private void manageDefine(ReadLine source, Matcher2 m, boolean emptyParentheses) throws IOException {
157 final String group1 = m.group(1);
158 final String group2 = m.group(2);
159 if (group2 == null) {
160 defines.get().define(group1, null, emptyParentheses);
161 } else {
162 final List<String> strings = defines.get().applyDefines(group2);
163 if (strings.size() > 1) {
164 defines.get().define(group1, strings, emptyParentheses);
165 } else {
166 final StringBuilder value = new StringBuilder(strings.get(0));
167 while (StringUtils.endsWithBackslash(value.toString())) {
168 value.setLength(value.length() - 1);
169 final CharSequence2 read = source.readLine();
170 value.append(read.toString2());
171 }
172 final List<String> li = new ArrayList<String>();
173 li.add(value.toString());
174 defines.get().define(group1, li, emptyParentheses);
175 }
176 }
177 }
178
179 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38 import java.util.List;
39
40 import net.sourceforge.plantuml.CharSequence2;
41 import net.sourceforge.plantuml.CharSequence2Impl;
42 import net.sourceforge.plantuml.preproc.DefinesGet;
43 import net.sourceforge.plantuml.preproc.ReadLine;
44 import net.sourceforge.plantuml.preproc.ReadLineList;
45
46 public class PreprocessorDefine4Apply implements ReadFilter {
47
48 private final DefinesGet defines;
49
50 public PreprocessorDefine4Apply(DefinesGet defines) throws IOException {
51 this.defines = defines;
52 }
53
54 public ReadLine applyFilter(final ReadLine source) {
55 return new Inner(source);
56 }
57
58 class Inner extends ReadLineInsertable {
59
60 final ReadLine source;
61
62 Inner(ReadLine source) {
63 this.source = source;
64 }
65
66 @Override
67 void closeInternal() throws IOException {
68 source.close();
69 }
70
71 @Override
72 CharSequence2 readLineInternal() throws IOException {
73 final CharSequence2 s = this.source.readLine();
74 if (s == null || s.getPreprocessorError() != null) {
75 return s;
76 }
77 if (PreprocessorDefine3Learner.isLearningLine(s)) {
78 return s;
79 }
80 final List<String> result = defines.get().applyDefines(s.toString2());
81 if (result.size() > 1) {
82 insert(new ReadLineList(result, s.getLocation()));
83 return readLine();
84 }
85 String tmp = result.get(0);
86 return new CharSequence2Impl(tmp, s.getLocation(), s.getPreprocessorError());
87 }
88
89 }
90
91 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 * Modified by: Nicolas Jouanin
33 *
34 *
35 */
36 package net.sourceforge.plantuml.preproc2;
37
38 import java.io.File;
39 import java.io.IOException;
40 import java.io.InputStream;
41 import java.io.InputStreamReader;
42 import java.io.Reader;
43 import java.net.MalformedURLException;
44 import java.net.URL;
45 import java.util.HashSet;
46 import java.util.List;
47 import java.util.Set;
48 import java.util.regex.Matcher;
49 import java.util.regex.Pattern;
50
51 import net.sourceforge.plantuml.CharSequence2;
52 import net.sourceforge.plantuml.DefinitionsContainer;
53 import net.sourceforge.plantuml.FileSystem;
54 import net.sourceforge.plantuml.Log;
55 import net.sourceforge.plantuml.OptionFlags;
56 import net.sourceforge.plantuml.StringUtils;
57 import net.sourceforge.plantuml.command.regex.Matcher2;
58 import net.sourceforge.plantuml.command.regex.MyPattern;
59 import net.sourceforge.plantuml.command.regex.Pattern2;
60 import net.sourceforge.plantuml.preproc.Defines;
61 import net.sourceforge.plantuml.preproc.DefinesGet;
62 import net.sourceforge.plantuml.preproc.FileWithSuffix;
63 import net.sourceforge.plantuml.preproc.ImportedFiles;
64 import net.sourceforge.plantuml.preproc.ReadLine;
65 import net.sourceforge.plantuml.preproc.ReadLineEmpty;
66 import net.sourceforge.plantuml.preproc.ReadLineList;
67 import net.sourceforge.plantuml.preproc.ReadLineReader;
68 import net.sourceforge.plantuml.preproc.ReadLineSimple;
69 import net.sourceforge.plantuml.preproc.ReadLineSingle;
70 import net.sourceforge.plantuml.preproc.StartDiagramExtractReader;
71 import net.sourceforge.plantuml.preproc.Stdlib;
72 import net.sourceforge.plantuml.utils.StartUtils;
73
74 public class PreprocessorInclude3 implements ReadFilter {
75
76 private static final Pattern2 includeDefPattern = MyPattern.cmpile("^[%s]*!includedef[%s]+[%g]?([^%g]+)[%g]?$");
77
78 private static final Pattern2 includeDefaultStrategy = MyPattern.cmpile("^[%s]*!default_include[%s]+(once|many)$");
79
80 private static final Pattern2 includePattern = MyPattern.cmpile("^[%s]*!include[%s]+[%g]?([^%g]+)[%g]?$");
81 private static final Pattern2 includeManyPattern = MyPattern.cmpile("^[%s]*!include_many[%s]+[%g]?([^%g]+)[%g]?$");
82 private static final Pattern2 includeOncePattern = MyPattern.cmpile("^[%s]*!include_once[%s]+[%g]?([^%g]+)[%g]?$");
83
84 private static final Pattern2 importPattern = MyPattern.cmpile("^[%s]*!import[%s]+[%g]?([^%g]+)[%g]?$");
85 private static final Pattern2 includePatternStdlib = MyPattern.cmpile("^[%s]*!include[%s]+(\\<[^%g]+\\>)$");
86 private static final Pattern2 includeURLPattern = MyPattern.cmpile("^[%s]*!includeurl[%s]+[%g]?([^%g]+)[%g]?$");
87
88 private final String charset;
89 private final DefinesGet defines;
90 private final List<String> config;
91 private final DefinitionsContainer definitionsContainer;
92 private final ImportedFiles importedFiles;
93
94 private final Set<FileWithSuffix> filesUsedCurrent = new HashSet<FileWithSuffix>();
95 private final Set<FileWithSuffix> filesUsedGlobal;
96 private PreprocessorIncludeStrategy strategy = PreprocessorIncludeStrategy.ONCE;
97
98 public PreprocessorInclude3(List<String> config, String charset, DefinesGet defines,
99 DefinitionsContainer definitionsContainer, ImportedFiles importedFiles, Set<FileWithSuffix> filesUsedGlobal) {
100 this.charset = charset;
101 this.config = config;
102 this.defines = defines;
103 this.definitionsContainer = definitionsContainer;
104 this.importedFiles = importedFiles;
105 this.filesUsedGlobal = filesUsedGlobal;
106 }
107
108 public ReadLine applyFilter(ReadLine source) {
109 return new Inner(source);
110 }
111
112 class Inner extends ReadLineInsertable {
113
114 final ReadLine source;
115
116 Inner(ReadLine source) {
117 this.source = source;
118 }
119
120 @Override
121 void closeInternal() throws IOException {
122 source.close();
123 }
124
125 @Override
126 CharSequence2 readLineInternal() throws IOException {
127 final CharSequence2 s = source.readLine();
128 if (s == null || s.getPreprocessorError() != null) {
129 return s;
130 }
131 if (s != null && StartUtils.startOrEnd(s)) {
132 // http://plantuml.sourceforge.net/qa/?qa=3389/error-generating-when-same-file-included-different-diagram
133 filesUsedCurrent.clear();
134 strategy = PreprocessorIncludeStrategy.ONCE;
135 return s;
136 }
137 if (s.getPreprocessorError() == null && OptionFlags.ALLOW_INCLUDE) {
138 final Matcher2 m0 = importPattern.matcher(s);
139 if (m0.find()) {
140 final CharSequence2 err = manageFileImport(s, m0);
141 if (err != null) {
142 insert(new ReadLineSingle(err));
143 }
144 return readLine();
145 }
146 final Matcher2 m1 = includePattern.matcher(s);
147 if (m1.find()) {
148 insert(manageFileInclude(s, m1, strategy));
149 return readLine();
150 }
151 final Matcher2 m2 = includeManyPattern.matcher(s);
152 if (m2.find()) {
153 insert(manageFileInclude(s, m2, PreprocessorIncludeStrategy.MANY));
154 return readLine();
155 }
156 final Matcher2 m3 = includeOncePattern.matcher(s);
157 if (m3.find()) {
158 insert(manageFileInclude(s, m3, PreprocessorIncludeStrategy.ONCE));
159 return readLine();
160 }
161 final Matcher2 m4 = includeDefPattern.matcher(s);
162 if (m4.find()) {
163 insert(manageDefinitionInclude(s, m4));
164 return readLine();
165 }
166 } else {
167 final Matcher2 m1 = includePatternStdlib.matcher(s);
168 if (m1.find()) {
169 insert(manageFileInclude(s, m1, PreprocessorIncludeStrategy.ONCE));
170 return readLine();
171 }
172 }
173 final Matcher2 mUrl = includeURLPattern.matcher(s);
174 if (s.getPreprocessorError() == null && mUrl.find()) {
175 insert(manageUrlInclude(s, mUrl));
176 return readLine();
177 }
178 final Matcher2 m2 = includeDefaultStrategy.matcher(s);
179 if (m2.find()) {
180 strategy = PreprocessorIncludeStrategy.fromString(m2.group(1));
181 return readLine();
182 }
183
184 return s;
185 }
186
187 }
188
189 private CharSequence2 manageFileImport(CharSequence2 s, Matcher2 m) throws IOException {
190 final String fileName = m.group(1);
191 final File file = FileSystem.getInstance().getFile(withEnvironmentVariable(fileName));
192 if (file.exists() && file.isDirectory() == false) {
193 importedFiles.add(file);
194 return null;
195 }
196 return s.withErrorPreprocessor("Cannot import " + FileWithSuffix.getFileName(file));
197
198 }
199
200 private ReadLine manageUrlInclude(CharSequence2 s, Matcher2 m) throws IOException {
201 String urlString = m.group(1);
202 urlString = defines.get().applyDefines(urlString).get(0);
203
204 final int idx = urlString.lastIndexOf('!');
205 String suf = null;
206 if (idx != -1) {
207 suf = urlString.substring(idx + 1);
208 urlString = urlString.substring(0, idx);
209 }
210 try {
211 if (urlString.toLowerCase().startsWith("https://") == false
212 && urlString.toLowerCase().startsWith("http://") == false) {
213 return new ReadLineSingle(s.withErrorPreprocessor("Cannot include url " + urlString));
214 }
215 final URL url = new URL(urlString);
216 return new Preprocessor2(config, getReaderInclude(url, s, suf), charset, defines, definitionsContainer,
217 filesUsedGlobal, importedFiles);
218
219 } catch (MalformedURLException e) {
220 return new ReadLineSingle(s.withErrorPreprocessor("Cannot include url " + urlString));
221 }
222 }
223
224 private ReadLine manageDefinitionInclude(CharSequence2 s, Matcher2 matcher) throws IOException {
225 final String definitionName = matcher.group(1);
226 final List<? extends CharSequence> definition = definitionsContainer.getDefinition(definitionName);
227 return new Preprocessor2(config, new ReadLineList(definition, s.getLocation()), charset, defines,
228 definitionsContainer, filesUsedGlobal, importedFiles);
229 }
230
231 private ReadLine manageFileInclude(CharSequence2 s, Matcher2 matcher, PreprocessorIncludeStrategy allowMany)
232 throws IOException {
233 String fileName = matcher.group(1);
234 fileName = defines.get().applyDefines(fileName).get(0);
235 if (fileName.startsWith("<") && fileName.endsWith(">")) {
236 final ReadLine strlibReader = getReaderStdlibInclude(s, fileName.substring(1, fileName.length() - 1));
237 if (strlibReader == null) {
238 return new ReadLineSingle(s.withErrorPreprocessor("Cannot include " + fileName));
239 }
240 return new Preprocessor2(config, strlibReader, charset, defines, definitionsContainer, filesUsedGlobal,
241 importedFiles);
242 }
243 final int idx = fileName.lastIndexOf('!');
244 String suf = null;
245 if (idx != -1) {
246 suf = fileName.substring(idx + 1);
247 fileName = fileName.substring(0, idx);
248 }
249 final FileWithSuffix f2 = new FileWithSuffix(importedFiles, withEnvironmentVariable(fileName), suf);
250 if (f2.fileOk() == false) {
251 Log.error("Current path is " + FileWithSuffix.getAbsolutePath(new File(".")));
252 Log.error("Cannot include " + f2.getDescription());
253 return new ReadLineSingle(s.withErrorPreprocessor("Cannot include " + f2.getDescription()));
254 } else if (allowMany == PreprocessorIncludeStrategy.ONCE && filesUsedCurrent.contains(f2)) {
255 // return new ReadLineSimple(s, "File already included " + f2.getDescription());
256 return new ReadLineEmpty();
257 }
258 filesUsedCurrent.add(f2);
259 filesUsedGlobal.add(f2);
260
261 return new Preprocessor2(config, getReaderInclude(f2, s), charset, defines, definitionsContainer,
262 filesUsedGlobal, importedFiles.withCurrentDir(f2.getParentFile()));
263 }
264
265 public static String withEnvironmentVariable(String s) {
266 final Pattern p = Pattern.compile("%(\\w+)%");
267
268 final Matcher m = p.matcher(s);
269 final StringBuffer sb = new StringBuffer();
270 while (m.find()) {
271 final String var = m.group(1);
272 final String value = getenv(var);
273 if (value != null) {
274 m.appendReplacement(sb, Matcher.quoteReplacement(value));
275 }
276 }
277 m.appendTail(sb);
278 s = sb.toString();
279 return s;
280 }
281
282 public static String getenv(String var) {
283 final String env = System.getProperty(var);
284 if (StringUtils.isNotEmpty(env)) {
285 return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(env);
286 }
287 final String getenv = System.getenv(var);
288 if (StringUtils.isNotEmpty(getenv)) {
289 return StringUtils.eventuallyRemoveStartingAndEndingDoubleQuote(getenv);
290 }
291 return null;
292 }
293
294 private InputStream getStdlibInputStream(String filename) {
295 final InputStream result = Stdlib.getResourceAsStream(filename);
296 // Log.info("Loading sdlib " + filename + " ok");
297 return result;
298 }
299
300 private ReadLine getReaderStdlibInclude(CharSequence2 s, String filename) {
301 Log.info("Loading sdlib " + filename);
302 InputStream is = getStdlibInputStream(filename);
303 if (is == null) {
304 return null;
305 }
306 final String description = "<" + filename + ">";
307 try {
308 if (StartDiagramExtractReader.containsStartDiagram(is, s, description)) {
309 is = getStdlibInputStream(filename);
310 return StartDiagramExtractReader.build(is, s, description);
311 }
312 is = getStdlibInputStream(filename);
313 if (is == null) {
314 return null;
315 }
316 return ReadLineReader.create(new InputStreamReader(is), description);
317 } catch (IOException e) {
318 e.printStackTrace();
319 return new ReadLineSimple(s, e.toString());
320 }
321 }
322
323 private ReadLine getReaderInclude(FileWithSuffix f2, CharSequence2 s) {
324 try {
325 if (StartDiagramExtractReader.containsStartDiagram(f2, s, charset)) {
326 return StartDiagramExtractReader.build(f2, s, charset);
327 }
328 final Reader reader = f2.getReader(charset);
329 if (reader == null) {
330 return new ReadLineSimple(s, "Cannot open " + f2.getDescription());
331 }
332 return ReadLineReader.create(reader, f2.getDescription(), s.getLocation());
333 } catch (IOException e) {
334 e.printStackTrace();
335 return new ReadLineSimple(s, e.toString());
336 }
337 }
338
339 private ReadLine getReaderInclude(final URL url, CharSequence2 s, String suf) {
340 try {
341 if (StartDiagramExtractReader.containsStartDiagram(url, s, charset)) {
342 return StartDiagramExtractReader.build(url, s, suf, charset);
343 }
344 final InputStream is = url.openStream();
345 if (charset == null) {
346 Log.info("Using default charset");
347 return ReadLineReader.create(new InputStreamReader(is), url.toString(), s.getLocation());
348 }
349 Log.info("Using charset " + charset);
350 return ReadLineReader.create(new InputStreamReader(is, charset), url.toString(), s.getLocation());
351 } catch (IOException e) {
352 e.printStackTrace();
353 return new ReadLineSimple(s, e.toString());
354 }
355
356 }
357
358 public Set<FileWithSuffix> getFilesUsedGlobal() {
359 return filesUsedGlobal;
360 }
361
362 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 * Modified by: Nicolas Jouanin
33 *
34 *
35 */
36 package net.sourceforge.plantuml.preproc2;
37
38 public enum PreprocessorIncludeStrategy {
39 ONCE, MANY;
40
41 public static PreprocessorIncludeStrategy fromString(String group) {
42 if ("once".equalsIgnoreCase(group)) {
43 return ONCE;
44 }
45 return MANY;
46 }
47
48 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import net.sourceforge.plantuml.preproc.ReadLine;
38
39 public interface ReadFilter {
40
41 public ReadLine applyFilter(ReadLine source);
42
43 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.util.ArrayList;
38 import java.util.Collection;
39
40 import net.sourceforge.plantuml.preproc.ReadLine;
41
42 public class ReadFilterAnd2 implements ReadFilter {
43
44 private final Collection<ReadFilter> all = new ArrayList<ReadFilter>();
45
46 public void add(ReadFilter filter) {
47 all.add(filter);
48 }
49
50 public ReadLine applyFilter(ReadLine current) {
51 for (ReadFilter f : all) {
52 current = f.applyFilter(current);
53 }
54 return current;
55 // if (filter3 == null && filter4 == null) {
56 // return filter2.applyFilter(filter1.applyFilter(source));
57 // }
58 // if (filter4 == null) {
59 // return filter3.applyFilter(filter2.applyFilter(filter1.applyFilter(source)));
60 // }
61 // return filter4.applyFilter(filter3.applyFilter(filter2.applyFilter(filter1.applyFilter(source))));
62 }
63
64 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38 import java.util.List;
39
40 import net.sourceforge.plantuml.CharSequence2;
41 import net.sourceforge.plantuml.preproc.ReadLine;
42 import net.sourceforge.plantuml.preproc.ReadLineList;
43 import net.sourceforge.plantuml.utils.StartUtils;
44
45 public class ReadLineAddConfig2 implements ReadFilter {
46
47 private final List<String> config;
48
49 public ReadLineAddConfig2(List<String> config) {
50 this.config = config;
51 }
52
53 public ReadLine applyFilter(final ReadLine raw) {
54
55 return new ReadLine() {
56
57 private ReadLine inserted;
58
59 public void close() throws IOException {
60 raw.close();
61 }
62
63 public CharSequence2 readLine() throws IOException {
64 CharSequence2 result = null;
65 if (inserted != null) {
66 result = inserted.readLine();
67 if (result == null) {
68 inserted.close();
69 inserted = null;
70 } else {
71 return result;
72 }
73 }
74 result = raw.readLine();
75 if (result != null && StartUtils.isArobaseStartDiagram(result) && config.size() > 0) {
76 inserted = new ReadLineQuoteComment2().applyFilter(new ReadLineList(config, result.getLocation()));
77 }
78 return result;
79 }
80 };
81 }
82
83 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38 import java.util.ArrayList;
39 import java.util.List;
40
41 import net.sourceforge.plantuml.CharSequence2;
42 import net.sourceforge.plantuml.preproc.ReadLine;
43
44 public abstract class ReadLineInsertable implements ReadLine {
45
46 private final List<ReadLine> sources = new ArrayList<ReadLine>();
47
48 final protected void insert(ReadLine inserted) throws IOException {
49 sources.add(0, inserted);
50 }
51
52 abstract CharSequence2 readLineInternal() throws IOException;
53
54 final public CharSequence2 readLine() throws IOException {
55 while (sources.size() > 0) {
56 final ReadLine tmp = sources.get(0);
57 final CharSequence2 result = tmp.readLine();
58 if (result != null) {
59 return result;
60 }
61 tmp.close();
62 sources.remove(0);
63 }
64 return readLineInternal();
65 }
66
67 abstract void closeInternal() throws IOException;
68
69 final public void close() throws IOException {
70 for (ReadLine s : sources) {
71 s.close();
72 }
73 closeInternal();
74 }
75
76 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.util.Collections;
38 import java.util.Iterator;
39 import java.util.List;
40 import java.util.Set;
41
42 import net.sourceforge.plantuml.CharSequence2;
43 import net.sourceforge.plantuml.preproc.FileWithSuffix;
44 import net.sourceforge.plantuml.preproc.ReadLineNumbered;
45
46 public class ReadLineList2 implements ReadLineNumbered {
47
48 private final Iterator<CharSequence2> iterator;
49
50 public ReadLineList2(List<CharSequence2> definition) {
51 this.iterator = definition.iterator();
52 }
53
54 public void close() {
55 }
56
57 public CharSequence2 readLine() {
58 if (iterator.hasNext() == false) {
59 return null;
60 }
61 return iterator.next();
62 }
63
64 public Set<FileWithSuffix> getFilesUsed() {
65 return Collections.emptySet();
66 }
67
68 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.IOException;
38
39 import net.sourceforge.plantuml.CharSequence2;
40 import net.sourceforge.plantuml.CharSequence2Impl;
41 import net.sourceforge.plantuml.preproc.ReadLine;
42
43 public class ReadLineQuoteComment2 implements ReadFilter {
44
45 public ReadLine applyFilter(final ReadLine source) {
46 return new ReadLine() {
47
48 public void close() throws IOException {
49 source.close();
50 }
51
52 public CharSequence2 readLine() throws IOException {
53 boolean longComment = false;
54 while (true) {
55 final CharSequence2 result = source.readLine();
56 if (result == null) {
57 return null;
58 }
59 final String trim = result.toString().replace('\t', ' ').trim();
60 if (longComment && trim.endsWith("'/")) {
61 longComment = false;
62 continue;
63 }
64 if (longComment) {
65 continue;
66 }
67 if (trim.startsWith("'")) {
68 continue;
69 }
70 if (trim.startsWith("/'") && trim.endsWith("'/")) {
71 continue;
72 }
73 if (trim.startsWith("/'") && trim.contains("'/") == false) {
74 longComment = true;
75 continue;
76 }
77 return ((CharSequence2Impl) result).removeInnerComment();
78 }
79 }
80 };
81 }
82
83 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.preproc2;
36
37 import java.io.File;
38 import java.io.FileInputStream;
39 import java.io.FileReader;
40 import java.io.IOException;
41 import java.io.InputStreamReader;
42 import java.util.HashMap;
43 import java.util.Map;
44
45 import net.sourceforge.plantuml.CharSequence2;
46 import net.sourceforge.plantuml.DefinitionsContainer;
47 import net.sourceforge.plantuml.FileSystem;
48 import net.sourceforge.plantuml.Log;
49 import net.sourceforge.plantuml.command.regex.Matcher2;
50 import net.sourceforge.plantuml.command.regex.MyPattern;
51 import net.sourceforge.plantuml.command.regex.Pattern2;
52 import net.sourceforge.plantuml.preproc.Defines;
53 import net.sourceforge.plantuml.preproc.DefinesGet;
54 import net.sourceforge.plantuml.preproc.FileWithSuffix;
55 import net.sourceforge.plantuml.preproc.ReadLine;
56 import net.sourceforge.plantuml.preproc.ReadLineReader;
57 import net.sourceforge.plantuml.preproc.ReadLineSimple;
58 import net.sourceforge.plantuml.preproc.Sub;
59
60 public class SubPreprocessor2 implements ReadFilter {
61
62 private static final String ID = "[A-Za-z_][A-Za-z_0-9]*";
63
64 private static final Pattern2 includeSubPattern = MyPattern.cmpile("^[%s]*!includesub[%s]+[%g]?([^%g]+)[%g]?$");
65
66 private static final Pattern2 startsub = MyPattern.cmpile("^[%s]*!startsub[%s]+(" + ID + ")");
67 private static final Pattern2 endsub = MyPattern.cmpile("^[%s]*!endsub[%s]*");
68
69 private final DefinitionsContainer definitionsContainer;
70 private final String charset;
71
72 public SubPreprocessor2(String charset, DefinitionsContainer definitionsContainer) {
73 this.charset = charset;
74 this.definitionsContainer = definitionsContainer;
75 }
76
77 private final Map<String, Sub> subs = new HashMap<String, Sub>();
78 private Sub learningSub;
79 private ReadLine includedSub;
80
81 public ReadLine applyFilter(ReadLine source) {
82 return new InnerReadLine(source);
83 }
84
85 class InnerReadLine implements ReadLine {
86 final ReadLine source;
87
88 public InnerReadLine(ReadLine source) {
89 this.source = source;
90 }
91
92 private CharSequence2 manageStartsub(Matcher2 m) throws IOException {
93 final String name = m.group(1);
94 learningSub = getSub(name);
95 return this.readLine();
96 }
97
98 private CharSequence2 manageEndsub(Matcher2 m) throws IOException {
99 learningSub = null;
100 return this.readLine();
101 }
102
103 public void close() throws IOException {
104 source.close();
105 }
106
107 private CharSequence2 manageIncludeSub(CharSequence2 s, Matcher2 m) throws IOException {
108 final String name = m.group(1);
109 final int idx = name.indexOf('!');
110 if (idx != -1) {
111 final String filename = name.substring(0, idx);
112 final String blocname = name.substring(idx + 1);
113 final File f = FileSystem.getInstance().getFile(PreprocessorInclude3.withEnvironmentVariable(filename));
114 if (f.exists() == false || f.isDirectory()) {
115 Log.error("Cannot include " + FileWithSuffix.getAbsolutePath(f));
116 return s.withErrorPreprocessor("Cannot include " + FileWithSuffix.getFileName(f));
117 }
118 final SubPreprocessor2 data = new SubPreprocessor2(charset, definitionsContainer);
119 InnerReadLine tmp = (InnerReadLine) data.applyFilter(getReaderInclude(s, f));
120 while (tmp.readLine() != null) {
121 // Read file
122 }
123 tmp.close();
124 includedSub = tmp.getSub(blocname).getReadLine(s.getLocation());
125 } else {
126 includedSub = getSub(name).getReadLine(s.getLocation());
127 }
128 return this.readLine();
129 }
130
131 public CharSequence2 readLine() throws IOException {
132 if (includedSub != null) {
133 final CharSequence2 s = includedSub.readLine();
134 if (s != null) {
135 eventuallyLearn(s);
136 return s;
137 }
138 includedSub = null;
139 }
140
141 final CharSequence2 s = source.readLine();
142 if (s == null) {
143 return null;
144 }
145
146 final Matcher2 m1 = includeSubPattern.matcher(s);
147 if (m1.find()) {
148 return manageIncludeSub(s, m1);
149 }
150
151 Matcher2 m = startsub.matcher(s);
152 if (m.find()) {
153 return manageStartsub(m);
154 }
155
156 m = endsub.matcher(s);
157 if (m.find()) {
158 return manageEndsub(m);
159 }
160 eventuallyLearn(s);
161 return s;
162 }
163
164 private void eventuallyLearn(final CharSequence2 s) {
165 if (learningSub != null) {
166 learningSub.add(s);
167 }
168 }
169
170 Sub getSub(String name) {
171 Sub result = subs.get(name);
172 if (result == null) {
173 result = new Sub(name);
174 subs.put(name, result);
175 }
176 return result;
177 }
178
179 }
180
181 private ReadLine getReaderInclude(CharSequence2 s, final File f) {
182 try {
183 if (charset == null) {
184 Log.info("Using default charset");
185 return ReadLineReader.create(new FileReader(f), FileWithSuffix.getFileName(f), s.getLocation());
186 }
187 Log.info("Using charset " + charset);
188 return ReadLineReader.create(new InputStreamReader(new FileInputStream(f), charset), FileWithSuffix.getFileName(f),
189 s.getLocation());
190 } catch (IOException e) {
191 return new ReadLineSimple(s, e.toString());
192 }
193
194 }
195
196 }
+0
-171
src/net/sourceforge/plantuml/project2/Day.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.Calendar;
38 import java.util.GregorianCalendar;
39 import java.util.SimpleTimeZone;
40
41 import net.sourceforge.plantuml.project.Month;
42 import net.sourceforge.plantuml.project.WeekDay;
43
44 public class Day implements TimeElement {
45
46 private final int numDay;
47 private final Month month;
48 private final int year;
49 private final WeekDay weekDay;
50
51 private Day(int year, Month month, int numDay, WeekDay weekDay) {
52 this.year = year;
53 this.month = month;
54 this.numDay = numDay;
55 this.weekDay = weekDay;
56 }
57
58 public static boolean isValidDesc(String desc) {
59 if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) {
60 return true;
61 }
62 if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) {
63 return true;
64 }
65 return false;
66 }
67
68 public Day(String desc) {
69 if (desc.matches("^\\d{4}/\\d{2}/\\d{2}$")) {
70 this.year = Integer.parseInt(desc.substring(0, 4));
71 this.month = Month.fromNum(Integer.parseInt(desc.substring(5, 7)));
72 this.numDay = Integer.parseInt(desc.substring(8, 10));
73 } else if (desc.matches("^\\d{2}-[A-Za-z]{3}-\\d{4}$")) {
74 this.year = Integer.parseInt(desc.substring(7, 11));
75 this.month = Month.valueOf(desc.substring(3, 6));
76 this.numDay = Integer.parseInt(desc.substring(0, 2));
77 } else {
78 throw new IllegalArgumentException(desc);
79 }
80 final int wd = new GregorianCalendar(year, month.getNum() - 1, numDay).get(Calendar.DAY_OF_WEEK);
81 this.weekDay = WeekDay.values()[wd - 1];
82 }
83
84 public Day next() {
85 if (numDay < month.getNbDays(year)) {
86 return new Day(year, month, numDay + 1, weekDay.next());
87 }
88 final Month next = month.next();
89 if (next == null) {
90 return new Day(year + 1, Month.JAN, 1, weekDay.next());
91 }
92 return new Day(year, next, 1, weekDay.next());
93 }
94
95 public Day previous() {
96 if (numDay > 1) {
97 return new Day(year, month, numDay - 1, weekDay.prev());
98 }
99 final Month prev = month.prev();
100 if (prev == null) {
101 return new Day(year - 1, Month.DEC, 31, weekDay.prev());
102 }
103 return new Day(year, prev, prev.getNbDays(year), weekDay.prev());
104 }
105
106 @Override
107 public String toString() {
108 return "" + weekDay + " " + year + "-" + month + "-" + String.format("%02d", numDay);
109 }
110
111 public final int getNumDay() {
112 return numDay;
113 }
114
115 public final Month getMonth() {
116 return month;
117 }
118
119 public final int getYear() {
120 return year;
121 }
122
123 public int compareTo(TimeElement other2) {
124 final Day other = (Day) other2;
125 if (year > other.year) {
126 return 1;
127 }
128 if (year < other.year) {
129 return -1;
130 }
131 final int cmpMonth = month.compareTo(other.month);
132 if (cmpMonth != 0) {
133 return cmpMonth;
134 }
135 return numDay - other.numDay;
136 }
137
138 @Override
139 public boolean equals(Object obj) {
140 final Day this2 = (Day) obj;
141 return this.numDay == this2.numDay && this.month == this2.month && this.year == this2.year;
142 }
143
144 @Override
145 public int hashCode() {
146 return numDay * 420 + year + month.hashCode();
147 }
148
149 public final WeekDay getWeekDay() {
150 return weekDay;
151 }
152
153 public long getTypicalDuration() {
154 return 1000L * 60 * 60 * 24;
155 }
156
157 public long getStartUTC() {
158 final GregorianCalendar cal = new GregorianCalendar(new SimpleTimeZone(0, "GMT"));
159 cal.setTimeInMillis(0);
160 cal.set(GregorianCalendar.YEAR, year);
161 cal.set(GregorianCalendar.MONTH, month.getNumNormal());
162 cal.set(GregorianCalendar.DAY_OF_MONTH, numDay);
163 return cal.getTimeInMillis();
164 }
165
166 public long getEndUTC() {
167 return next().getStartUTC();
168 }
169
170 }
+0
-112
src/net/sourceforge/plantuml/project2/GanttDiagram2.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.Font;
38 import java.util.ArrayList;
39 import java.util.List;
40
41 import net.sourceforge.plantuml.SpriteContainerEmpty;
42 import net.sourceforge.plantuml.cucadiagram.Display;
43 import net.sourceforge.plantuml.graphic.FontConfiguration;
44 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
45 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
46 import net.sourceforge.plantuml.graphic.StringBounder;
47 import net.sourceforge.plantuml.graphic.TextBlock;
48 import net.sourceforge.plantuml.graphic.TextBlockUtils;
49 import net.sourceforge.plantuml.ugraphic.UFont;
50 import net.sourceforge.plantuml.ugraphic.UGraphic;
51 import net.sourceforge.plantuml.ugraphic.UTranslate;
52
53 public class GanttDiagram2 {
54
55 private final Project2 project;
56 private final double dayWith = 20;
57
58 public GanttDiagram2(Project2 project) {
59 this.project = project;
60 }
61
62 private final UFont font = UFont.serif(9);
63 private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
64
65 public void draw(UGraphic ug, double x, double y) {
66
67 final TextBlock timeHeader = project.getTimeHeader(dayWith);
68 final Row row = getMainRow();
69 final TextBlock headers = row.header();
70
71 final double deltaX = headers.calculateDimension(ug.getStringBounder()).getWidth();
72 final double deltaY = timeHeader.calculateDimension(ug.getStringBounder()).getHeight();
73
74 headers.drawU(ug.apply(new UTranslate(x, (y + deltaY))));
75 final TextBlock tbRow = row.asTextBloc(project.getTimeConverter(dayWith));
76 tbRow.drawU(ug.apply(new UTranslate((x + deltaX), (y + deltaY))));
77
78 timeHeader.drawU(ug.apply(new UTranslate((x + deltaX), y)));
79 }
80
81 private Row getMainRow() {
82 final List<Task> tasks = project.getTasks();
83 final List<Row> rows = new ArrayList<Row>();
84 for (Task t : tasks) {
85 final String text = t.getCode();
86 final TextBlock label = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT,
87 new SpriteContainerEmpty());
88 rows.add(new RowSimple((Day) t.getStart(), (Day) t.getEnd(), HtmlColorUtils.BLACK, TextBlockUtils
89 .withMargin(label, 3, 3)));
90 }
91 final Row row = RowUtils.merge(rows);
92 return row;
93 }
94
95 public double getWidth(StringBounder stringBounder) {
96 final TextBlock timeHeader = project.getTimeHeader(dayWith);
97 final Row row = getMainRow();
98 final TextBlock headers = row.header();
99 return headers.calculateDimension(stringBounder).getWidth()
100 + timeHeader.calculateDimension(stringBounder).getWidth() + 1;
101 }
102
103 public double getHeight(StringBounder stringBounder) {
104 final TextBlock timeHeader = project.getTimeHeader(dayWith);
105 final Row row = getMainRow();
106 final TextBlock headers = row.header();
107 return headers.calculateDimension(stringBounder).getHeight()
108 + timeHeader.calculateDimension(stringBounder).getHeight();
109 }
110
111 }
+0
-118
src/net/sourceforge/plantuml/project2/Knowledge.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.HashMap;
38 import java.util.Map;
39
40 import net.sourceforge.plantuml.StringUtils;
41
42 public class Knowledge {
43
44 private final TaskContainer taskContainer;
45 private final TimeLine timeline;
46 private final Map<String, Value> variables = new HashMap<String, Value>();
47
48 public Knowledge(TaskContainer taskContainer, TimeLine timeline) {
49 this.taskContainer = taskContainer;
50 this.timeline = timeline;
51 }
52
53 public Value evaluate(String exp) {
54 exp = StringUtils.trin(exp);
55 int idx = exp.indexOf('$');
56 if (idx != -1) {
57 return evaluate(exp.substring(0, idx), exp.substring(idx + 1));
58 }
59 if (exp.matches("\\d+")) {
60 return new ValueInt(Integer.parseInt(exp));
61 }
62 if (Day.isValidDesc(exp)) {
63 final Day day = new Day(exp);
64 return new ValueTime(day);
65 }
66 if (exp.startsWith("^")) {
67 exp = exp.substring(1);
68 }
69 if (variables.containsKey(exp)) {
70 return variables.get(exp);
71 }
72 idx = exp.indexOf("+");
73 if (idx != -1) {
74 return plus(exp.substring(0, idx), exp.substring(idx + 1));
75 }
76 throw new UnsupportedOperationException(exp);
77
78 }
79
80 private Value plus(String arg1, String arg2) {
81 final Value v1 = evaluate(arg1);
82 final Value v2 = evaluate(arg2);
83 if (v1 instanceof ValueInt && v2 instanceof ValueInt) {
84 return new ValueInt(((ValueInt) v1).getValue() + ((ValueInt) v2).getValue());
85 }
86 if (v1 instanceof ValueTime && v2 instanceof ValueInt) {
87 final int nb = ((ValueInt) v2).getValue();
88 TimeElement t = ((ValueTime) v1).getValue();
89 if (nb > 0) {
90 for (int i = 0; i < nb; i++) {
91 t = timeline.next(t);
92 }
93 }
94 if (nb < 0) {
95 for (int i = 0; i < -nb; i++) {
96 t = timeline.previous(t);
97 }
98 }
99 return new ValueTime(t);
100 }
101 throw new UnsupportedOperationException();
102 }
103
104 private Value evaluate(String task, String attribute) {
105 final Task t = taskContainer.getTask(task);
106 final TaskAttribute att = TaskAttribute.fromString(attribute);
107 if (att == TaskAttribute.COMPLETED) {
108 return new ValueTime(t.getCompleted());
109 }
110 throw new UnsupportedOperationException();
111 }
112
113 public void set(String var, Value exp) {
114 variables.put(var, exp);
115 }
116
117 }
+0
-128
src/net/sourceforge/plantuml/project2/PSystemProject2.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.Color;
38 import java.awt.Graphics2D;
39 import java.awt.image.BufferedImage;
40 import java.io.IOException;
41 import java.io.OutputStream;
42
43 import net.sourceforge.plantuml.AbstractPSystem;
44 import net.sourceforge.plantuml.Dimension2DDouble;
45 import net.sourceforge.plantuml.EmptyImageBuilder;
46 import net.sourceforge.plantuml.FileFormat;
47 import net.sourceforge.plantuml.FileFormatOption;
48 import net.sourceforge.plantuml.StringUtils;
49 import net.sourceforge.plantuml.api.ImageDataSimple;
50 import net.sourceforge.plantuml.core.DiagramDescription;
51 import net.sourceforge.plantuml.core.ImageData;
52 import net.sourceforge.plantuml.eps.EpsStrategy;
53 import net.sourceforge.plantuml.png.PngIO;
54 import net.sourceforge.plantuml.ugraphic.ColorMapper;
55 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
56 import net.sourceforge.plantuml.ugraphic.eps.UGraphicEps;
57 import net.sourceforge.plantuml.ugraphic.g2d.UGraphicG2d;
58 import net.sourceforge.plantuml.ugraphic.svg.UGraphicSvg;
59
60 public class PSystemProject2 extends AbstractPSystem {
61
62 private final Project2 project = new Project2();
63 private final Color background = Color.WHITE;
64 private final ColorMapper colorMapper = new ColorMapperIdentity();
65
66 public int getNbImages() {
67 return 1;
68 }
69
70 public DiagramDescription getDescription() {
71 return new DiagramDescription("(Project)");
72 }
73
74 @Override
75 final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormatOption, long seed)
76 throws IOException {
77 final GanttDiagram2 diagram = new GanttDiagram2(project);
78 final FileFormat fileFormat = fileFormatOption.getFileFormat();
79 if (fileFormat == FileFormat.PNG) {
80 final BufferedImage im = createImage(diagram);
81 PngIO.write(im, os, fileFormatOption.isWithMetadata() ? getMetadata() : null, 96);
82 } else if (fileFormat == FileFormat.SVG) {
83 final UGraphicSvg svg = new UGraphicSvg(true, new Dimension2DDouble(0, 0), colorMapper,
84 StringUtils.getAsHtml(background), false, 1.0, fileFormatOption.getSvgLinkTarget(),
85 fileFormatOption.getHoverColor(), seed());
86 diagram.draw(svg, 0, 0);
87 svg.createXml(os, fileFormatOption.isWithMetadata() ? getMetadata() : null);
88 } else if (fileFormat == FileFormat.EPS) {
89 final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.getDefault2());
90 diagram.draw(eps, 0, 0);
91 os.write(eps.getEPSCode().getBytes());
92 } else if (fileFormat == FileFormat.EPS_TEXT) {
93 final UGraphicEps eps = new UGraphicEps(colorMapper, EpsStrategy.WITH_MACRO_AND_TEXT);
94 diagram.draw(eps, 0, 0);
95 os.write(eps.getEPSCode().getBytes());
96 } else {
97 throw new UnsupportedOperationException();
98 }
99 return ImageDataSimple.ok();
100 }
101
102 private BufferedImage createImage(GanttDiagram2 diagram) {
103 EmptyImageBuilder builder = new EmptyImageBuilder(10, 10, background);
104 Graphics2D g2d = builder.getGraphics2D();
105 UGraphicG2d ug = new UGraphicG2d(colorMapper, g2d, 1.0);
106
107 final double height = diagram.getHeight(ug.getStringBounder());
108 final double width = diagram.getWidth(ug.getStringBounder());
109
110 g2d.dispose();
111
112 builder = new EmptyImageBuilder(width, height, background);
113 final BufferedImage im = builder.getBufferedImage();
114 g2d = builder.getGraphics2D();
115
116 ug = new UGraphicG2d(colorMapper, g2d, 1.0);
117 ug.setBufferedImage(im);
118 diagram.draw(ug, 0, 0);
119 g2d.dispose();
120 return im;
121 }
122
123 public final Project2 getProject() {
124 return project;
125 }
126
127 }
+0
-72
src/net/sourceforge/plantuml/project2/PSystemProjectFactory2.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.ArrayList;
38 import java.util.List;
39
40 import net.sourceforge.plantuml.command.Command;
41 import net.sourceforge.plantuml.command.CommandComment;
42 import net.sourceforge.plantuml.command.CommandMultilinesComment;
43 import net.sourceforge.plantuml.command.CommandNope;
44 import net.sourceforge.plantuml.command.UmlDiagramFactory;
45 import net.sourceforge.plantuml.core.DiagramType;
46 import net.sourceforge.plantuml.project2.command.CommandAffectation;
47 import net.sourceforge.plantuml.project2.command.CommandCloseWeekDay;
48
49 public class PSystemProjectFactory2 extends UmlDiagramFactory {
50
51 public PSystemProjectFactory2() {
52 super(DiagramType.PROJECT);
53 }
54
55 @Override
56 protected List<Command> createCommands() {
57 final List<Command> cmds = new ArrayList<Command>();
58 cmds.add(new CommandNope());
59 // cmds.add(new CommandComment());
60 // cmds.add(new CommandMultilinesComment());
61 cmds.add(new CommandAffectation());
62 cmds.add(new CommandCloseWeekDay());
63 return cmds;
64 }
65
66 @Override
67 public PSystemProject2 createEmptyDiagram() {
68 return new PSystemProject2();
69 }
70
71 }
+0
-166
src/net/sourceforge/plantuml/project2/Project2.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.ArrayList;
38 import java.util.Collections;
39 import java.util.List;
40
41 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
42 import net.sourceforge.plantuml.graphic.TextBlock;
43 import net.sourceforge.plantuml.graphic.TextBlockUtils;
44
45 public class Project2 implements TaskContainer {
46
47 private final TimeLine timeline;
48 private final Knowledge knowledge;
49 private final List<TaskImpl> tasks = new ArrayList<TaskImpl>();
50
51 public Project2() {
52 this.timeline = new TimeLineDay();
53 this.knowledge = new Knowledge(this, timeline);
54 }
55
56 public TimeConverter getTimeConverter(double dayWith) {
57 return new TimeConverterDay(timeline, getStart(), dayWith);
58 }
59
60 public Value getExpression(String exp) {
61 return knowledge.evaluate(exp);
62 }
63
64 public boolean affectation(String var, Value exp) {
65 final int idx = var.indexOf('$');
66 if (idx != -1) {
67 return affectationTask(var.substring(0, idx), var.substring(idx + 1), exp);
68 }
69 if (var.startsWith("^")) {
70 return affectationJalon(var.substring(1), exp);
71 }
72 knowledge.set(var, exp);
73 return true;
74 }
75
76 private boolean affectationJalon(String taskCode, Value exp) {
77 final TaskImpl result = new TaskImpl(timeline, taskCode);
78 result.setStart(((ValueTime) exp).getValue());
79 result.setDuration(0);
80 tasks.add(result);
81 knowledge.set(taskCode, exp);
82 return true;
83 }
84
85 private boolean affectationTask(String taskCode, String attribute, Value exp) {
86 final TaskImpl t = getOrCreateTask(taskCode);
87 final TaskAttribute att = TaskAttribute.fromString(attribute);
88 if (att == TaskAttribute.START) {
89 t.setStart(((ValueTime) exp).getValue());
90 return true;
91 }
92 if (att == TaskAttribute.DURATION) {
93 t.setDuration(((ValueInt) exp).getValue());
94 return true;
95 }
96 if (att == TaskAttribute.LOAD) {
97 t.setLoad(((ValueInt) exp).getValue());
98 return true;
99 }
100 throw new UnsupportedOperationException();
101 }
102
103 private TaskImpl getOrCreateTask(String taskCode) {
104 TaskImpl result = (TaskImpl) getTask(taskCode);
105 if (result != null) {
106 return result;
107 }
108 result = new TaskImpl(timeline, taskCode);
109 tasks.add(result);
110 return result;
111 }
112
113 public final List<Task> getTasks() {
114 final List<Task> result = new ArrayList<Task>(tasks);
115 return Collections.unmodifiableList(result);
116 }
117
118 public Task getTask(String code) {
119 for (TaskImpl t : tasks) {
120 if (t.getCode().equals(code)) {
121 return t;
122 }
123 }
124 Task result = null;
125 for (Task t : tasks) {
126 if (t.getCode().startsWith(code) == false) {
127 continue;
128 }
129 if (result == null) {
130 result = t;
131 } else {
132 result = new TaskMerge(result.getCode(), result.getName(), result, t);
133 }
134
135 }
136 return result;
137 }
138
139 public TextBlock getTimeHeader(double dayWith) {
140 final TimeHeaderDay day = new TimeHeaderDay(getStart(), getEnd(), timeline, dayWith);
141 final TimeHeaderMonth month = new TimeHeaderMonth(getStart(), getEnd(), timeline, dayWith);
142 return TextBlockUtils.mergeTB(month, day, HorizontalAlignment.CENTER);
143 }
144
145 private Day getStart() {
146 Day result = null;
147 for (Task t : tasks) {
148 if (result == null || result.compareTo(t.getStart()) > 0) {
149 result = (Day) t.getStart();
150 }
151 }
152 return result;
153 }
154
155 private Day getEnd() {
156 Day result = null;
157 for (Task t : tasks) {
158 if (result == null || result.compareTo(t.getEnd()) < 0) {
159 result = (Day) t.getEnd();
160 }
161 }
162 return result;
163 }
164
165 }
+0
-46
src/net/sourceforge/plantuml/project2/Ressource.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public class Ressource {
38
39 private final String code;
40
41 public Ressource(String code) {
42 this.code = code;
43 }
44
45 }
+0
-52
src/net/sourceforge/plantuml/project2/Row.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import net.sourceforge.plantuml.graphic.TextBlock;
38
39 public interface Row {
40
41 public TextBlock asTextBloc(TimeConverter timeConverter);
42
43 public double getMinXwithoutHeader(TimeConverter timeConverter);
44
45 public double getMaxXwithoutHeader(TimeConverter timeConverter);
46
47 public TextBlock header();
48
49 public double getHeight();
50
51 }
+0
-102
src/net/sourceforge/plantuml/project2/RowMerge.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.geom.Dimension2D;
38
39 import net.sourceforge.plantuml.Dimension2DDouble;
40 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
41 import net.sourceforge.plantuml.graphic.StringBounder;
42 import net.sourceforge.plantuml.graphic.TextBlock;
43 import net.sourceforge.plantuml.ugraphic.UGraphic;
44 import net.sourceforge.plantuml.ugraphic.UTranslate;
45
46 class RowMerge implements Row {
47
48 private final Row r1;
49 private final Row r2;
50
51 public RowMerge(Row r1, Row r2) {
52 this.r1 = r1;
53 this.r2 = r2;
54 }
55
56 public TextBlock asTextBloc(final TimeConverter timeConverter) {
57 return new AbstractTextBlock() {
58
59 public void drawU(UGraphic ug) {
60 r1.asTextBloc(timeConverter).drawU(ug);
61 r2.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate(0, r1.getHeight())));
62 }
63
64 public Dimension2D calculateDimension(StringBounder stringBounder) {
65 final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter);
66 final double height = getHeight();
67 return new Dimension2DDouble(width, height);
68 }
69 };
70 }
71
72 public double getMinXwithoutHeader(TimeConverter timeConverter) {
73 return Math.min(r1.getMinXwithoutHeader(timeConverter), r2.getMinXwithoutHeader(timeConverter));
74 }
75
76 public double getMaxXwithoutHeader(TimeConverter timeConverter) {
77 return Math.max(r1.getMaxXwithoutHeader(timeConverter), r2.getMaxXwithoutHeader(timeConverter));
78 }
79
80 public double getHeight() {
81 return r1.getHeight() + r2.getHeight();
82 }
83
84 public TextBlock header() {
85 return new AbstractTextBlock() {
86
87 public void drawU(UGraphic ug) {
88 r1.header().drawU(ug);
89 r2.header().drawU(ug.apply(new UTranslate(0, r1.getHeight())));
90 }
91
92 public Dimension2D calculateDimension(StringBounder stringBounder) {
93 final double width = Math.max(r1.header().calculateDimension(stringBounder).getWidth(), r2.header()
94 .calculateDimension(stringBounder).getWidth());
95 final double height = getHeight();
96 return new Dimension2DDouble(width, height);
97 }
98 };
99 }
100
101 }
+0
-92
src/net/sourceforge/plantuml/project2/RowOverwrite.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.geom.Dimension2D;
38
39 import net.sourceforge.plantuml.Dimension2DDouble;
40 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
41 import net.sourceforge.plantuml.graphic.StringBounder;
42 import net.sourceforge.plantuml.graphic.TextBlock;
43 import net.sourceforge.plantuml.ugraphic.UGraphic;
44 import net.sourceforge.plantuml.ugraphic.UTranslate;
45
46 class RowOverwrite implements Row {
47
48 private final Row r1;
49 private final Row r2;
50
51 public RowOverwrite(Row r1, Row r2) {
52 this.r1 = r1;
53 this.r2 = r2;
54 }
55
56 public TextBlock asTextBloc(final TimeConverter timeConverter) {
57 return new AbstractTextBlock() {
58
59 public void drawU(UGraphic ug) {
60 final double minX = getMinXwithoutHeader(timeConverter);
61 final double minXr1 = r1.getMinXwithoutHeader(timeConverter);
62 final double minXr2 = r2.getMinXwithoutHeader(timeConverter);
63 r1.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate((minXr1 - minX), 0)));
64 r2.asTextBloc(timeConverter).drawU(ug.apply(new UTranslate((minXr2 - minX), 0)));
65 }
66
67 public Dimension2D calculateDimension(StringBounder stringBounder) {
68 final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter);
69 final double height = getHeight();
70 return new Dimension2DDouble(width, height);
71 }
72 };
73 }
74
75 public double getMinXwithoutHeader(TimeConverter timeConverter) {
76 return Math.min(r1.getMinXwithoutHeader(timeConverter), r2.getMinXwithoutHeader(timeConverter));
77 }
78
79 public double getMaxXwithoutHeader(TimeConverter timeConverter) {
80 return Math.max(r1.getMaxXwithoutHeader(timeConverter), r2.getMaxXwithoutHeader(timeConverter));
81 }
82
83 public double getHeight() {
84 return Math.max(r1.getHeight(), r2.getHeight());
85 }
86
87 public TextBlock header() {
88 return r1.header();
89 }
90
91 }
+0
-114
src/net/sourceforge/plantuml/project2/RowSimple.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.geom.Dimension2D;
38
39 import net.sourceforge.plantuml.Dimension2DDouble;
40 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
41 import net.sourceforge.plantuml.graphic.HtmlColor;
42 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
43 import net.sourceforge.plantuml.graphic.StringBounder;
44 import net.sourceforge.plantuml.graphic.TextBlock;
45 import net.sourceforge.plantuml.graphic.TextBlockUtils;
46 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
47 import net.sourceforge.plantuml.ugraphic.UChangeColor;
48 import net.sourceforge.plantuml.ugraphic.UGraphic;
49 import net.sourceforge.plantuml.ugraphic.URectangle;
50 import net.sourceforge.plantuml.ugraphic.UShape;
51 import net.sourceforge.plantuml.ugraphic.UTranslate;
52
53 public class RowSimple implements Row {
54
55 private static final int HEIGHT = 12;
56 private final Day first;
57 private final Day last;
58 private final HtmlColor backcolor;
59 private final TextBlock header;
60
61 public RowSimple(Day first, Day last) {
62 this(first, last, HtmlColorUtils.BLACK);
63 }
64
65 public RowSimple(Day first, Day last, HtmlColor backcolor) {
66 this(first, last, backcolor, TextBlockUtils.empty(0, HEIGHT));
67 }
68
69 public RowSimple(Day first, Day last, HtmlColor backcolor, TextBlock header) {
70 this.first = first;
71 this.last = last;
72 this.backcolor = backcolor;
73 if (last.compareTo(first) < 0) {
74 throw new IllegalArgumentException();
75 }
76 this.header = header;
77 }
78
79 public TextBlock asTextBloc(final TimeConverter timeConverter) {
80 return new AbstractTextBlock() {
81
82 public void drawU(UGraphic ug) {
83 final double x1 = getMinXwithoutHeader(timeConverter) + 1;
84 final double x2 = getMaxXwithoutHeader(timeConverter) - 1;
85 final double height = getHeight() - 4;
86 final UShape rect = new URectangle(x2 - x1, height, 4, 4);
87 ug.apply(new UChangeColor(HtmlColorUtils.RED)).apply(new UChangeBackColor(backcolor)).apply(new UTranslate(x1, 2)).draw(rect);
88 }
89
90 public Dimension2D calculateDimension(StringBounder stringBounder) {
91 final double width = getMaxXwithoutHeader(timeConverter) - getMinXwithoutHeader(timeConverter);
92 final double height = getHeight();
93 return new Dimension2DDouble(width, height);
94 }
95 };
96 }
97
98 public double getMinXwithoutHeader(TimeConverter timeConverter) {
99 return timeConverter.getStartPosition(first);
100 }
101
102 public double getMaxXwithoutHeader(TimeConverter timeConverter) {
103 return timeConverter.getEndPosition(last);
104 }
105
106 public double getHeight() {
107 return HEIGHT;
108 }
109
110 public TextBlock header() {
111 return header;
112 }
113 }
+0
-59
src/net/sourceforge/plantuml/project2/RowUtils.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.List;
38
39 public abstract class RowUtils {
40
41 public static Row overwrite(Row r1, Row r2) {
42 return new RowOverwrite(r1, r2);
43 }
44
45 public static Row merge(Row r1, Row r2) {
46 return new RowMerge(r1, r2);
47 }
48
49 public static Row merge(List<Row> rows) {
50 Row result = rows.get(0);
51 for (int i = 1; i < rows.size(); i++) {
52 result = merge(result, rows.get(i));
53 }
54 return result;
55
56 }
57
58 }
+0
-52
src/net/sourceforge/plantuml/project2/Task.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface Task {
38
39 public String getCode();
40
41 public String getName();
42
43 public long getLoad();
44
45 public TimeElement getStart();
46
47 public TimeElement getEnd();
48
49 public TimeElement getCompleted();
50
51 }
+0
-64
src/net/sourceforge/plantuml/project2/TaskAttribute.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public enum TaskAttribute {
38
39 START, END, COMPLETED, DURATION, LOAD;
40
41 static public TaskAttribute fromString(String n) {
42 if (n.equalsIgnoreCase("begin")) {
43 return START;
44 }
45 if (n.equalsIgnoreCase("start")) {
46 return START;
47 }
48 if (n.equalsIgnoreCase("work")) {
49 return LOAD;
50 }
51 if (n.equalsIgnoreCase("load")) {
52 return LOAD;
53 }
54 if (n.equalsIgnoreCase("duration")) {
55 return DURATION;
56 }
57 if (n.equalsIgnoreCase("completed")) {
58 return COMPLETED;
59 }
60 return null;
61 }
62
63 }
+0
-42
src/net/sourceforge/plantuml/project2/TaskContainer.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface TaskContainer {
38
39 public Task getTask(String code);
40
41 }
+0
-90
src/net/sourceforge/plantuml/project2/TaskImpl.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public class TaskImpl implements Task {
38
39 private final String code;
40 private TimeElement start;
41 private TimeElement end;
42 private int duration;
43 private final TimeLine timeLine;
44
45 public TaskImpl(TimeLine timeLine, String code) {
46 this.code = code;
47 this.timeLine = timeLine;
48 }
49
50 public String getCode() {
51 return code;
52 }
53
54 public String getName() {
55 return code;
56 }
57
58 public long getLoad() {
59 throw new UnsupportedOperationException();
60 }
61
62 public TimeElement getStart() {
63 return start;
64 }
65
66 public TimeElement getEnd() {
67 TimeElement result = start;
68 for (int i = 1; i < duration; i++) {
69 result = timeLine.next(result);
70 }
71 return result;
72 }
73
74 public TimeElement getCompleted() {
75 return timeLine.next(getEnd());
76 }
77
78 public void setStart(TimeElement exp) {
79 this.start = exp;
80 }
81
82 public void setDuration(int value) {
83 this.duration = value;
84 }
85
86 public void setLoad(int value) {
87 }
88
89 }
+0
-76
src/net/sourceforge/plantuml/project2/TaskMerge.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 class TaskMerge implements Task {
38
39 private final String code;
40 private final String name;
41 private final Task task1;
42 private final Task task2;
43
44 TaskMerge(String code, String name, Task task1, Task task2) {
45 this.code = code;
46 this.name = name;
47 this.task1 = task1;
48 this.task2 = task2;
49 }
50
51 public String getCode() {
52 return code;
53 }
54
55 public String getName() {
56 return name;
57 }
58
59 public long getLoad() {
60 throw new UnsupportedOperationException();
61 }
62
63 public TimeElement getStart() {
64 return TimeUtils.min(task1.getStart(), task2.getStart());
65 }
66
67 public TimeElement getEnd() {
68 return TimeUtils.max(task1.getEnd(), task2.getEnd());
69 }
70
71 public TimeElement getCompleted() {
72 return TimeUtils.max(task1.getCompleted(), task2.getCompleted());
73 }
74
75 }
+0
-46
src/net/sourceforge/plantuml/project2/TimeConverter.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface TimeConverter {
38
39 public TimeElement getCorrespondingElement(long position);
40
41 public double getStartPosition(TimeElement timeElement);
42
43 public double getEndPosition(TimeElement timeElement);
44
45 }
+0
-112
src/net/sourceforge/plantuml/project2/TimeConverterDay.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.util.HashMap;
38 import java.util.Map;
39
40 public class TimeConverterDay implements TimeConverter {
41
42 private Day biggest;
43 private Day smallest;
44 private final double dayWith;
45 private final Map<Day, Integer> map1 = new HashMap<Day, Integer>();
46 private final Map<Integer, Day> map2 = new HashMap<Integer, Day>();
47 private final TimeLine timeLine;
48
49 public TimeConverterDay(TimeLine timeLine, Day start, double dayWith) {
50 this.timeLine = timeLine;
51 this.dayWith = dayWith;
52 this.biggest = start;
53 this.smallest = start;
54 putDay(start, 0);
55 }
56
57 // private boolean isClosed(Day d) {
58 // WeekDay wd = d.getWeekDay();
59 // if (wd == WeekDay.SAT || wd == WeekDay.SUN) {
60 // return true;
61 // }
62 // return false;
63 // }
64
65 private int getPosition(Day d) {
66 Integer result = map1.get(d);
67 if (result != null) {
68 return result.intValue();
69 }
70 while (d.compareTo(biggest) > 0) {
71 int n = getPosition(biggest);
72 biggest = biggest.next();
73 if (timeLine.isClosed(biggest) == false) {
74 n++;
75 }
76 putDay(biggest, n);
77 }
78 while (d.compareTo(smallest) < 0) {
79 int n = getPosition(smallest);
80 smallest = smallest.previous();
81 if (timeLine.isClosed(smallest) == false) {
82 n--;
83 }
84 putDay(smallest, n);
85 }
86 result = map1.get(d);
87 if (result != null) {
88 return result.intValue();
89 }
90 throw new UnsupportedOperationException();
91 }
92
93 private void putDay(Day d, int n) {
94 map1.put(d, n);
95 map2.put(n, d);
96
97 }
98
99 public Day getCorrespondingElement(long position) {
100 throw new UnsupportedOperationException();
101 }
102
103 public double getStartPosition(TimeElement timeElement) {
104 return getPosition((Day) timeElement) * dayWith;
105 }
106
107 public double getEndPosition(TimeElement timeElement) {
108 return (getPosition((Day) timeElement) + 1) * dayWith;
109 }
110
111 }
+0
-50
src/net/sourceforge/plantuml/project2/TimeElement.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface TimeElement extends Comparable<TimeElement> {
38
39 public long getTypicalDuration();
40
41 public long getStartUTC();
42
43 public long getEndUTC();
44
45 public TimeElement next();
46
47 public TimeElement previous();
48
49 }
+0
-102
src/net/sourceforge/plantuml/project2/TimeHeaderDay.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.Font;
38 import java.awt.geom.Dimension2D;
39
40 import net.sourceforge.plantuml.Dimension2DDouble;
41 import net.sourceforge.plantuml.SpriteContainerEmpty;
42 import net.sourceforge.plantuml.cucadiagram.Display;
43 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
44 import net.sourceforge.plantuml.graphic.FontConfiguration;
45 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
46 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
47 import net.sourceforge.plantuml.graphic.StringBounder;
48 import net.sourceforge.plantuml.graphic.TextBlock;
49 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
50 import net.sourceforge.plantuml.ugraphic.UChangeColor;
51 import net.sourceforge.plantuml.ugraphic.UFont;
52 import net.sourceforge.plantuml.ugraphic.UGraphic;
53 import net.sourceforge.plantuml.ugraphic.URectangle;
54 import net.sourceforge.plantuml.ugraphic.UTranslate;
55
56 public class TimeHeaderDay extends AbstractTextBlock implements TextBlock {
57
58 private final Day start;
59 private final Day end;
60 private final TimeLine timeline;
61 private final double dayWidth;
62
63 private final UFont font = UFont.serif(9);
64 private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
65
66 public TimeHeaderDay(Day start, Day end, TimeLine timeline, double dayWidth) {
67 this.start = start;
68 this.end = end;
69 this.timeline = timeline;
70 this.dayWidth = dayWidth;
71 }
72
73 public void drawU(UGraphic ug) {
74 int n = 0;
75 for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
76 final String text = "" + d.getNumDay();
77 final TextBlock b = Display.create(text).create(fontConfig, HorizontalAlignment.LEFT,
78 new SpriteContainerEmpty());
79 final Dimension2D dimText = b.calculateDimension(ug.getStringBounder());
80 final double diffX = dayWidth - dimText.getWidth();
81 final double diffY = getHeight() - dimText.getHeight();
82 ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
83 ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
84 ug.apply(new UTranslate(n * dayWidth, 0)).draw(new URectangle(dayWidth, getHeight()));
85 b.drawU(ug.apply(new UTranslate((n * dayWidth + diffX / 2), (diffY / 2))));
86 n++;
87 }
88 }
89
90 private double getHeight() {
91 return 20;
92 }
93
94 public Dimension2D calculateDimension(StringBounder stringBounder) {
95 int n = 0;
96 for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
97 n++;
98 }
99 return new Dimension2DDouble(n * dayWidth, getHeight());
100 }
101 }
+0
-119
src/net/sourceforge/plantuml/project2/TimeHeaderMonth.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import java.awt.Font;
38 import java.awt.geom.Dimension2D;
39
40 import net.sourceforge.plantuml.Dimension2DDouble;
41 import net.sourceforge.plantuml.SpriteContainerEmpty;
42 import net.sourceforge.plantuml.cucadiagram.Display;
43 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
44 import net.sourceforge.plantuml.graphic.FontConfiguration;
45 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
46 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
47 import net.sourceforge.plantuml.graphic.StringBounder;
48 import net.sourceforge.plantuml.graphic.TextBlock;
49 import net.sourceforge.plantuml.ugraphic.UChangeBackColor;
50 import net.sourceforge.plantuml.ugraphic.UChangeColor;
51 import net.sourceforge.plantuml.ugraphic.UFont;
52 import net.sourceforge.plantuml.ugraphic.UGraphic;
53 import net.sourceforge.plantuml.ugraphic.URectangle;
54 import net.sourceforge.plantuml.ugraphic.UTranslate;
55
56 public class TimeHeaderMonth extends AbstractTextBlock implements TextBlock {
57
58 private final Day start;
59 private final Day end;
60 private final TimeLine timeline;
61 private final double dayWidth;
62
63 private final UFont font = UFont.serif(9);
64 private final FontConfiguration fontConfig = FontConfiguration.blackBlueTrue(font);
65
66 public TimeHeaderMonth(Day start, Day end, TimeLine timeline, double dayWidth) {
67 this.start = start;
68 this.end = end;
69 this.timeline = timeline;
70 this.dayWidth = dayWidth;
71 }
72
73 public void drawU(UGraphic ug) {
74 int n = 0;
75 String last = null;
76
77 double pendingX = -1;
78 for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
79 final String text = "" + d.getMonth().name();
80 if (pendingX == -1) {
81 pendingX = n * dayWidth;
82 last = text;
83 }
84 ug = ug.apply(new UChangeColor(HtmlColorUtils.BLACK));
85 ug = ug.apply(new UChangeBackColor(HtmlColorUtils.WHITE));
86 if (text.equals(last) == false) {
87 manage(ug, 0, 0, n, last, pendingX);
88 pendingX = n * dayWidth;
89 }
90 last = text;
91 n++;
92 }
93 manage(ug, 0, 0, n, last, pendingX);
94 }
95
96 private void manage(UGraphic ug, double x, double y, int n, String last, double pendingX) {
97 final double width = n * dayWidth - pendingX;
98 ug.apply(new UTranslate(x + pendingX, y)).draw(new URectangle(width, getHeight()));
99 final TextBlock b = Display.create(last).create(fontConfig, HorizontalAlignment.LEFT,
100 new SpriteContainerEmpty());
101 final Dimension2D dimText = b.calculateDimension(ug.getStringBounder());
102 final double diffX = width - dimText.getWidth();
103 final double diffY = getHeight() - dimText.getHeight();
104 b.drawU(ug.apply(new UTranslate((x + pendingX + diffX / 2), (y + diffY / 2))));
105 }
106
107 private double getHeight() {
108 return 20;
109 }
110
111 public Dimension2D calculateDimension(StringBounder stringBounder) {
112 int n = 0;
113 for (Day d = start; d.compareTo(end) <= 0; d = (Day) timeline.next(d)) {
114 n++;
115 }
116 return new Dimension2DDouble(n * dayWidth, getHeight());
117 }
118 }
+0
-48
src/net/sourceforge/plantuml/project2/TimeLine.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface TimeLine {
38
39 public TimeElement next(TimeElement timeElement);
40
41 public TimeElement previous(TimeElement timeElement);
42
43 public TimeResolution getTimeResolution();
44
45 public boolean isClosed(TimeElement timeElement);
46
47 }
+0
-72
src/net/sourceforge/plantuml/project2/TimeLineDay.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 import net.sourceforge.plantuml.project.WeekDay;
38
39 public class TimeLineDay implements TimeLine {
40
41 public TimeElement next(TimeElement timeElement) {
42 do {
43 timeElement = timeElement.next();
44 if (isClosed(timeElement) == false) {
45 return timeElement;
46 }
47 } while (true);
48 }
49
50 public TimeElement previous(TimeElement timeElement) {
51 do {
52 timeElement = timeElement.previous();
53 if (isClosed(timeElement) == false) {
54 return timeElement;
55 }
56 } while (true);
57 }
58
59 public TimeResolution getTimeResolution() {
60 return TimeResolution.DAY;
61 }
62
63 public boolean isClosed(TimeElement timeElement) {
64 final WeekDay wd = ((Day) timeElement).getWeekDay();
65 if (wd == WeekDay.SAT || wd == WeekDay.SUN) {
66 return true;
67 }
68 return false;
69 }
70
71 }
+0
-40
src/net/sourceforge/plantuml/project2/TimeResolution.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public enum TimeResolution {
38 DAY, WEEK, MONTH, YEAR
39 }
+0
-66
src/net/sourceforge/plantuml/project2/TimeUtils.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public class TimeUtils {
38
39 static public TimeElement max(TimeElement t1, TimeElement t2) {
40 if (t1 == null) {
41 throw new IllegalArgumentException();
42 }
43 if (t2 == null) {
44 throw new IllegalArgumentException();
45 }
46 if (t1.compareTo(t2) > 0) {
47 return t1;
48 }
49 return t2;
50 }
51
52 static public TimeElement min(TimeElement t1, TimeElement t2) {
53 if (t1 == null) {
54 throw new IllegalArgumentException();
55 }
56 if (t2 == null) {
57 throw new IllegalArgumentException();
58 }
59 if (t1.compareTo(t2) < 0) {
60 return t1;
61 }
62 return t2;
63 }
64
65 }
+0
-39
src/net/sourceforge/plantuml/project2/Value.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public interface Value {
38 }
+0
-55
src/net/sourceforge/plantuml/project2/ValueInt.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public class ValueInt implements Value {
38
39 private final int value;
40
41 public ValueInt(int value) {
42 this.value = value;
43 }
44
45 public final int getValue() {
46 return value;
47 }
48
49 public Value plus(Value other) {
50 final ValueInt other2 = (ValueInt) other;
51 return new ValueInt(value + other2.value);
52 }
53
54 }
+0
-49
src/net/sourceforge/plantuml/project2/ValueTime.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2;
36
37 public class ValueTime implements Value {
38
39 private final TimeElement value;
40
41 public ValueTime(TimeElement value) {
42 this.value = value;
43 }
44
45 public final TimeElement getValue() {
46 return value;
47 }
48 }
+0
-61
src/net/sourceforge/plantuml/project2/command/CommandAffectation.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2.command;
36
37 import java.util.List;
38
39 import net.sourceforge.plantuml.StringUtils;
40 import net.sourceforge.plantuml.command.CommandExecutionResult;
41 import net.sourceforge.plantuml.command.SingleLineCommand;
42 import net.sourceforge.plantuml.project2.PSystemProject2;
43 import net.sourceforge.plantuml.project2.Value;
44
45 public class CommandAffectation extends SingleLineCommand<PSystemProject2> {
46
47 public CommandAffectation() {
48 super("(?i)^[%s]*([~\\^]?[\\w$/]+)[%s]*:=[%s]*(.+)$");
49 }
50
51 @Override
52 protected CommandExecutionResult executeArg(PSystemProject2 diagram, List<String> arg) {
53 final Value exp = diagram.getProject().getExpression(StringUtils.trin(arg.get(1)));
54 final boolean ok = diagram.getProject().affectation(StringUtils.trin(arg.get(0)), exp);
55 if (ok) {
56 return CommandExecutionResult.ok();
57 }
58 return CommandExecutionResult.error("Cannot execute CommandAffectation");
59 }
60 }
+0
-56
src/net/sourceforge/plantuml/project2/command/CommandCloseWeekDay.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project2.command;
36
37 import java.util.List;
38
39 import net.sourceforge.plantuml.command.CommandExecutionResult;
40 import net.sourceforge.plantuml.command.SingleLineCommand;
41 import net.sourceforge.plantuml.project2.PSystemProject2;
42
43 public class CommandCloseWeekDay extends SingleLineCommand<PSystemProject2> {
44
45 public CommandCloseWeekDay() {
46 super("(?i)^[%s]*close[%s]+(\\w{3,}day)[%s]*$");
47 }
48
49 @Override
50 protected CommandExecutionResult executeArg(PSystemProject2 diagram, List<String> arg) {
51 // final WeekDay weekDay = WeekDay.valueOf(arg.get(0).substring(0, 3).goUpperCase());
52 // getSystem().getProject().closeWeekDay(weekDay);
53 return CommandExecutionResult.ok();
54 }
55 }
4848 public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
4949 final String code = arg.get("COMPLEMENT" + suffix, 2);
5050 final String position = arg.get("COMPLEMENT" + suffix, 3);
51 final Task task = system.getExistingTask(code);
51 final Moment task = system.getExistingMoment(code);
5252 if (task == null) {
5353 return Failable.<Complement> error("No such task " + code);
5454 }
4343
4444 public IRegex toRegex(String suffix) {
4545 return new RegexConcat( //
46 new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+days?"), //
46 new RegexLeaf("COMPLEMENT" + suffix, "(\\d+)[%s]+(days?|weeks?)"), //
4747 new RegexLeaf("LOAD" + suffix, "([%s]+at[%s]+(\\d+)%)?"));
4848 }
4949
5050 public Failable<Complement> getComplement(GanttDiagram system, RegexResult arg, String suffix) {
51 final String days = arg.get("COMPLEMENT" + suffix, 0);
51 final String number = arg.get("COMPLEMENT" + suffix, 0);
52 final boolean inWeeks = arg.get("COMPLEMENT" + suffix, 1).startsWith("w");
53 final int factor = inWeeks ? system.daysInWeek() : 1;
5254 final String load = arg.get("LOAD" + suffix, 1);
55 final int days = Integer.parseInt(number) * factor;
5356 if (load == null) {
54 return Failable.<Complement> ok(LoadInDays.inDay(Integer.parseInt(days)));
57 return Failable.<Complement> ok(LoadInDays.inDay(days));
5558 }
56 return Failable.<Complement> ok(LoadInDays.inDayWithLoad(Integer.parseInt(days), Integer.parseInt(load)));
59 return Failable.<Complement> ok(LoadInDays.inDayWithLoad(days, Integer.parseInt(load)));
5760 }
61
5862 }
7878 ug = ug.apply(new UChangeBackColor(HtmlColorUtils.RED_DARK)).apply(new UChangeColor(HtmlColorUtils.RED_DARK))
7979 .apply(new UStroke(1.5));
8080
81 final TaskDraw draw1 = source.getTask().getTaskDraw();
82 final TaskDraw draw2 = dest.getTask().getTaskDraw();
81 final TaskDraw draw1 = ((Task) source.getMoment()).getTaskDraw();
82 final TaskDraw draw2 = ((Task) dest.getMoment()).getTaskDraw();
8383
8484 double x1 = getX(source.withDelta(0), atStart);
8585 double y1 = draw1.getY(atStart);
356356
357357 private void initMinMax() {
358358 // min = tasks.values().iterator().next().getStart();
359 max = tasks.values().iterator().next().getEnd();
360 for (Task task : tasks.values()) {
361 if (task instanceof TaskSeparator) {
362 continue;
363 }
364 final Instant start = task.getStart();
365 final Instant end = task.getEnd();
366 // if (min.compareTo(start) > 0) {
367 // min = start;
368 // }
369 if (max.compareTo(end) < 0) {
370 max = end;
371 }
372 }
359 if (tasks.size() == 0) {
360 max = min.increment();
361 } else {
362 max = tasks.values().iterator().next().getEnd();
363 for (Task task : tasks.values()) {
364 if (task instanceof TaskSeparator) {
365 continue;
366 }
367 final Instant start = task.getStart();
368 final Instant end = task.getEnd();
369 // if (min.compareTo(start) > 0) {
370 // min = start;
371 // }
372 if (max.compareTo(end) < 0) {
373 max = end;
374 }
375 }
376 }
377 if (calendar != null) {
378 for (DayAsDate d : colorDays.keySet()) {
379 final Instant instant = calendar.fromDayAsDate(d);
380 if (instant.compareTo(max) > 0) {
381 max = instant;
382 }
383 }
384 for (DayAsDate d : nameDays.keySet()) {
385 final Instant instant = calendar.fromDayAsDate(d);
386 if (instant.compareTo(max) > 0) {
387 max = instant;
388 }
389 }
390 }
391 }
392
393 public DayAsDate getThenDate() {
394 DayAsDate result = getStartingDate();
395 for (DayAsDate d : colorDays.keySet()) {
396 if (d.compareTo(result) > 0) {
397 result = d;
398 }
399 }
400 for (DayAsDate d : nameDays.keySet()) {
401 if (d.compareTo(result) > 0) {
402 result = d;
403 }
404 }
405 return result;
373406 }
374407
375408 private void drawTasks(final UGraphic ug, TimeScale timeScale) {
493526 return this.calendar.getStartingDate();
494527 }
495528
529 public int daysInWeek() {
530 return 7 - closedDayOfWeek.size();
531 }
532
496533 public void closeDayOfWeek(DayOfWeek day) {
497534 closedDayOfWeek.add(day);
498535 }
540577 private final Map<DayAsDate, HtmlColor> colorDays = new HashMap<DayAsDate, HtmlColor>();
541578 private final Map<DayAsDate, String> nameDays = new HashMap<DayAsDate, String>();
542579
580 public Moment getExistingMoment(String id) {
581 Moment result = getExistingTask(id);
582 if (result == null) {
583 DayAsDate start = null;
584 DayAsDate end = null;
585 for (Map.Entry<DayAsDate, String> ent : nameDays.entrySet()) {
586 if (ent.getValue().equalsIgnoreCase(id) == false) {
587 continue;
588 }
589 start = min(start, ent.getKey());
590 end = max(end, ent.getKey());
591 }
592 if (start != null) {
593 result = new MomentImpl(convert(start), convert(end));
594 }
595 }
596 return result;
597 }
598
599 private DayAsDate min(DayAsDate d1, DayAsDate d2) {
600 if (d1 == null) {
601 return d2;
602 }
603 if (d1.compareTo(d2) > 0) {
604 return d2;
605 }
606 return d1;
607 }
608
609 private DayAsDate max(DayAsDate d1, DayAsDate d2) {
610 if (d1 == null) {
611 return d2;
612 }
613 if (d1.compareTo(d2) < 0) {
614 return d2;
615 }
616 return d1;
617 }
618
543619 public void colorDay(DayAsDate day, HtmlColor color) {
544620 colorDays.put(day, color);
545621 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project3;
36
37 public interface Moment {
38
39 public Instant getStart();
40
41 public Instant getEnd();
42
43 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.project3;
36
37 public class MomentImpl implements Moment {
38
39 private final Instant start;
40 private final Instant end;
41
42 public MomentImpl(Instant start, Instant end) {
43 this.start = start;
44 this.end = end;
45 }
46
47 public Instant getStart() {
48 return start;
49 }
50
51 public Instant getEnd() {
52 return end;
53 }
54
55 }
5050 }
5151
5252 public IRegex toRegex() {
53 return new RegexOr(regexTo(), regexAnd());
53 return new RegexOr(regexTo(), regexAnd(), regexThen());
5454
5555 }
5656
7878 new RegexLeaf("\\D"), //
7979 new RegexLeaf("DAY3", "([\\d]{1,2})"), //
8080 new RegexLeaf("[%s]+and[%s]+"), //
81 new RegexLeaf("COUNT", "([\\d]+)"), //
81 new RegexLeaf("COUNT_AND", "([\\d]+)"), //
82 new RegexLeaf("[%s]+days?") //
83
84 );
85 }
86
87 private IRegex regexThen() {
88 return new RegexConcat( //
89 new RegexLeaf("then[%s]+"), //
90 new RegexLeaf("COUNT_THEN", "([\\d]+)"), //
8291 new RegexLeaf("[%s]+days?") //
8392
8493 );
8594 }
8695
8796 public Subject getSubject(GanttDiagram project, RegexResult arg) {
88 final String count = arg.get("COUNT", 0);
89 if (count == null) {
90 final DayAsDate date1 = getDate(arg, "1");
91 final DayAsDate date2 = getDate(arg, "2");
92 return new DaysAsDates(date1, date2);
97 final String countAnd = arg.get("COUNT_AND", 0);
98 if (countAnd != null) {
99 final DayAsDate date3 = getDate(arg, "3");
100 final int nb = Integer.parseInt(countAnd);
101 return new DaysAsDates(project, date3, nb);
93102 }
94 final DayAsDate date3 = getDate(arg, "3");
95 final int nb = Integer.parseInt(count);
96 return new DaysAsDates(project, date3, nb);
103 final String countThen = arg.get("COUNT_THEN", 0);
104 if (countThen != null) {
105 final DayAsDate date3 = project.getThenDate();
106 final int nb = Integer.parseInt(countThen);
107 return new DaysAsDates(project, date3, nb);
108 }
109 final DayAsDate date1 = getDate(arg, "1");
110 final DayAsDate date2 = getDate(arg, "2");
111 return new DaysAsDates(date1, date2);
97112 }
98113
99114 private DayAsDate getDate(RegexResult arg, String suffix) {
3434 */
3535 package net.sourceforge.plantuml.project3;
3636
37 public interface Task extends Subject {
37 public interface Task extends Subject, Moment {
3838
3939 public TaskCode getCode();
4040
3636
3737 public class TaskInstant implements Complement {
3838
39 private final Task task;
39 private final Moment task;
4040 private final TaskAttribute attribute;
4141 private final int delta;
4242
43 public TaskInstant(Task task, TaskAttribute attribute) {
43 public TaskInstant(Moment task, TaskAttribute attribute) {
4444 this(task, attribute, 0);
4545 }
4646
47 private TaskInstant(Task task, TaskAttribute attribute, int delta) {
47 private TaskInstant(Moment task, TaskAttribute attribute, int delta) {
4848 this.task = task;
4949 this.attribute = attribute;
5050 this.delta = delta;
9696 return attribute.toString() + " of " + task;
9797 }
9898
99 public final Task getTask() {
99 public final Moment getMoment() {
100100 return task;
101 }
102
103 public final boolean isTask() {
104 return task instanceof Task;
101105 }
102106
103107 public final TaskAttribute getAttribute() {
5858 final Task task = (Task) subject;
5959 final TaskInstant when = (TaskInstant) complement;
6060 task.setStart(when.getInstantPrecise());
61 project.addContraint(new GanttConstraint(when, new TaskInstant(task, TaskAttribute.START)));
61 if (when.isTask()) {
62 project.addContraint(new GanttConstraint(when, new TaskInstant(task, TaskAttribute.START)));
63 }
6264 return CommandExecutionResult.ok();
6365 }
6466
3838 import java.util.Map;
3939
4040 import net.sourceforge.plantuml.ISkinSimple;
41 import net.sourceforge.plantuml.LineBreakStrategy;
4142 import net.sourceforge.plantuml.SpriteContainer;
4243 import net.sourceforge.plantuml.creole.CommandCreoleMonospaced;
4344 import net.sourceforge.plantuml.graphic.HtmlColorSetSimple;
4445 import net.sourceforge.plantuml.graphic.IHtmlColorSet;
4546 import net.sourceforge.plantuml.salt.element.Element;
4647 import net.sourceforge.plantuml.salt.element.WrappedElement;
48 import net.sourceforge.plantuml.ugraphic.ColorMapper;
49 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
4750 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
4851
4952 public class Dictionary implements SpriteContainer, ISkinSimple {
101104
102105 }
103106
107 public LineBreakStrategy wrapWidth() {
108 return LineBreakStrategy.NONE;
109 }
110
111 public ColorMapper getColorMapper() {
112 return new ColorMapperIdentity();
113 }
114
104115 }
112112 }
113113
114114 public boolean addLifeEvent(LifeEvent lifeEvent) {
115 lifeEvent.setLinkedToGroupingEnd(true);
116115 return true;
117116 }
118117
8686 return this.p == p && type == LifeEventType.DESTROY;
8787 }
8888
89 // public double getStrangePos() {
90 // return message.getPosYendLevel();
91 // }
92 //
9389 private AbstractMessage message;
9490
9591 public void setMessage(AbstractMessage message) {
10096 return message;
10197 }
10298
103 // private boolean linkedToGroupingEnd;
104 //
105 // // public boolean isLinkedToGroupingEnd() {
106 // // return linkedToGroupingEnd;
107 // // }
108
109 public void setLinkedToGroupingEnd(boolean linkedToGroupingEnd) {
110 // this.linkedToGroupingEnd = linkedToGroupingEnd;
111 }
112
11399 }
151151
152152 final boolean hasDressing2 = contains(dressing2, ">", "\\", "/", "x");
153153 final boolean hasDressing1 = contains(dressing1, "x", "<", "\\", "/");
154 final boolean reverseDefine;
154155 if (hasDressing2) {
155156 p1 = getOrCreateParticipant(diagram, arg, "PART1");
156157 p2 = getOrCreateParticipant(diagram, arg, "PART2");
157158 circleAtStart = dressing1.contains("o");
158159 circleAtEnd = dressing2.contains("o");
160 reverseDefine = false;
159161 } else if (hasDressing1) {
160162 p2 = getOrCreateParticipant(diagram, arg, "PART1");
161163 p1 = getOrCreateParticipant(diagram, arg, "PART2");
162164 circleAtStart = dressing2.contains("o");
163165 circleAtEnd = dressing1.contains("o");
166 reverseDefine = true;
164167 } else {
165168 return CommandExecutionResult.error("Illegal sequence arrow");
166169
201204 }
202205 if (dressing1.contains("x")) {
203206 config = config.withHead2(ArrowHead.CROSSX);
204
205207 }
206208 if (dressing2.contains("x")) {
207209 config = config.withHead2(ArrowHead.CROSSX);
210 }
211 if (reverseDefine) {
212 config = config.reverseDefine();
208213 }
209214
210215 config = applyStyle(arg.getLazzy("ARROW_STYLE", 0), config);
3434 */
3535 package net.sourceforge.plantuml.sequencediagram.command;
3636
37 import java.util.List;
38
3937 import net.sourceforge.plantuml.command.CommandExecutionResult;
40 import net.sourceforge.plantuml.command.SingleLineCommand;
38 import net.sourceforge.plantuml.command.SingleLineCommand2;
39 import net.sourceforge.plantuml.command.regex.RegexConcat;
40 import net.sourceforge.plantuml.command.regex.RegexLeaf;
41 import net.sourceforge.plantuml.command.regex.RegexResult;
4142 import net.sourceforge.plantuml.cucadiagram.Display;
4243 import net.sourceforge.plantuml.sequencediagram.EventWithDeactivate;
4344 import net.sourceforge.plantuml.sequencediagram.LifeEventType;
4647 import net.sourceforge.plantuml.skin.ArrowBody;
4748 import net.sourceforge.plantuml.skin.ArrowConfiguration;
4849
49 public class CommandReturn extends SingleLineCommand<SequenceDiagram> {
50 public class CommandReturn extends SingleLineCommand2<SequenceDiagram> {
5051
5152 public CommandReturn() {
52 super("(?i)^return[%s]*(.*)$");
53 super(getRegexConcat());
54 }
55
56 private static RegexConcat getRegexConcat() {
57 return new RegexConcat(new RegexLeaf("^"), //
58 new RegexLeaf("PARALLEL", "(&%s*)?"), //
59 new RegexLeaf("[%s]*"), //
60 new RegexLeaf("return[%s]*"), //
61 new RegexLeaf("MESSAGE", "(.*)"), //
62 new RegexLeaf("$"));
5363 }
5464
5565 @Override
56 protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, List<String> arg) {
66 protected CommandExecutionResult executeArg(SequenceDiagram sequenceDiagram, RegexResult arg) {
5767
58 Message message = sequenceDiagram.getActivatingMessage();
68 Message message1 = sequenceDiagram.getActivatingMessage();
5969 boolean doDeactivation = true;
60 if (message == null) {
70 if (message1 == null) {
6171 final EventWithDeactivate last = sequenceDiagram.getLastEventWithDeactivate();
6272 if (last instanceof Message == false) {
6373 return CommandExecutionResult.error("Nowhere to return to.");
6474 }
65 message = (Message) last;
75 message1 = (Message) last;
6676 doDeactivation = false;
6777 }
6878
69 final ArrowConfiguration arrow = message.getArrowConfiguration().withBody(ArrowBody.DOTTED);
79 final ArrowConfiguration arrow = message1.getArrowConfiguration().withBody(ArrowBody.DOTTED);
7080
71 sequenceDiagram.addMessage(
72 new Message(message.getParticipant2(), message.getParticipant1(), Display.getWithNewlines(arg
73 .get(0)), arrow, sequenceDiagram.getNextMessageNumber()));
81 final Display display = Display.getWithNewlines(arg.get("MESSAGE", 0));
82 final Message message2 = new Message(message1.getParticipant2(), message1.getParticipant1(), display, arrow,
83 sequenceDiagram.getNextMessageNumber());
84 final boolean parallel = arg.get("PARALLEL", 0) != null;
85 if (parallel) {
86 message2.goParallel();
87 }
88 sequenceDiagram.addMessage(message2);
7489
7590 if (doDeactivation) {
76 final String error = sequenceDiagram.activate(message.getParticipant2(), LifeEventType.DEACTIVATE, null);
91 final String error = sequenceDiagram.activate(message1.getParticipant2(), LifeEventType.DEACTIVATE, null);
7792 if (error != null) {
7893 return CommandExecutionResult.error(error);
7994 }
3535 package net.sourceforge.plantuml.sequencediagram.graphic;
3636
3737 import java.awt.geom.Dimension2D;
38 import java.awt.geom.Rectangle2D;
3839 import java.util.ArrayList;
3940 import java.util.Collection;
4041 import java.util.Collections;
4950 import net.sourceforge.plantuml.LineParam;
5051 import net.sourceforge.plantuml.SkinParamBackcolored;
5152 import net.sourceforge.plantuml.Url;
53 import net.sourceforge.plantuml.graphic.InnerStrategy;
5254 import net.sourceforge.plantuml.graphic.StringBounder;
55 import net.sourceforge.plantuml.graphic.TextBlock;
5356 import net.sourceforge.plantuml.sequencediagram.Englober;
5457 import net.sourceforge.plantuml.sequencediagram.Event;
5558 import net.sourceforge.plantuml.sequencediagram.Newpage;
6164 import net.sourceforge.plantuml.skin.Context2D;
6265 import net.sourceforge.plantuml.skin.SimpleContext2D;
6366 import net.sourceforge.plantuml.skin.Skin;
67 import net.sourceforge.plantuml.ugraphic.MinMax;
6468 import net.sourceforge.plantuml.ugraphic.UClip;
6569 import net.sourceforge.plantuml.ugraphic.UGraphic;
6670 import net.sourceforge.plantuml.ugraphic.UStroke;
243247 return dimension;
244248 }
245249
250 TextBlock asTextBlock(final double delta, final double width, final Page page, final boolean showTail) {
251 return new TextBlock() {
252
253 public void drawU(UGraphic ug) {
254 drawU22(ug, delta, width, page, showTail);
255 }
256
257 public Dimension2D calculateDimension(StringBounder stringBounder) {
258 final double height = page.getHeight();
259 return new Dimension2DDouble(width, height);
260 }
261
262 public MinMax getMinMax(StringBounder stringBounder) {
263 throw new UnsupportedOperationException();
264 }
265
266 public Rectangle2D getInnerPosition(String member, StringBounder stringBounder, InnerStrategy strategy) {
267 throw new UnsupportedOperationException();
268 }
269
270 };
271
272 }
273
246274 void drawU22(final UGraphic ug, final double delta, double width, Page page, boolean showTail) {
247 // final UGraphic ugOrig = ug;
248275 final double height = page.getHeight();
249276
250277 final UGraphic ugTranslated = clipAndTranslate2(delta, width, page, ug);
251278 final SimpleContext2D context = new SimpleContext2D(true);
252279 this.drawEnglobers(ug, height - MARGIN_FOR_ENGLOBERS1, context);
253280 this.drawPlaygroundU(ugTranslated, context);
254 // ug = ugOrig;
255
256281
257282 this.drawLineU22(ug, showTail, page);
258283 this.drawHeadTailU(ug, page, showTail ? height - getTailHeight(ug.getStringBounder(), true) : 0);
259284
260 // ug = clipAndTranslate2(delta, width, page, ug);
261285 this.drawPlaygroundU(ugTranslated, new SimpleContext2D(false));
262286 }
263287
264288 private UGraphic clipAndTranslate2(final double delta, double width, Page p, UGraphic ug) {
265289 ug = ug.apply(new UClip(0, p.getBodyRelativePosition(), width, p.getBodyHeight() + 1));
290 ug = ug.apply(getTranslate4(delta));
291 return ug;
292 }
293
294 private UTranslate getTranslate4(final double delta) {
266295 if (delta > 0) {
267 ug = ug.apply(new UTranslate(0, -delta));
268 }
269 return ug;
296 return new UTranslate(0, -delta);
297 }
298 return new UTranslate();
270299 }
271300
272301 private void drawLineU22(UGraphic ug, boolean showTail, Page page) {
625625 drawableSet.getSkinParam(), null);
626626
627627 final LifeLine lifeLine = new LifeLine(box, comp.getPreferredWidth(stringBounder), drawableSet.getSkinParam()
628 .shadowing());
628 .shadowing(p.getStereotype()));
629629 drawableSet.setLivingParticipantBox(p, new LivingParticipantBox(box, lifeLine));
630630
631631 this.freeX = box.getMaxX(stringBounder);
146146 final SequenceDiagramArea area = new SequenceDiagramArea(fullDimension.getWidth(), page.getHeight());
147147
148148 final TextBlock compTitle;
149 final TextBlock caption = new AnnotatedWorker(diagram, diagram.getSkinParam()).getCaption();
149 final AnnotatedWorker annotatedWorker = new AnnotatedWorker(diagram, diagram.getSkinParam(), stringBounder);
150 final TextBlock caption = annotatedWorker.getCaption();
150151 area.setCaptionArea(caption.calculateDimension(stringBounder));
151152
152153 if (Display.isNull(page.getTitle())) {
210211 if (legendTop) {
211212 sequenceAreaY += legendBlock.calculateDimension(ug.getStringBounder()).getHeight();
212213 }
213 drawableSet.drawU22(ug.apply(new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY)),
214 delta, fullDimension.getWidth(), page, diagram.isShowFootbox());
214 final UTranslate forCore = new UTranslate(area.getSequenceAreaX() + delta1 / 2, sequenceAreaY);
215 TextBlock core = drawableSet.asTextBlock(delta, fullDimension.getWidth(), page, diagram.isShowFootbox());
216 core = annotatedWorker.addFrame(core);
217 core.drawU(ug.apply(forCore));
218 // drawableSet.drawU22(ug.apply(forCore), delta, fullDimension.getWidth(), page,
219 // diagram.isShowFootbox());
215220
216221 drawHeader(area, ug, index);
217222 drawFooter(area, ug, index);
8181 arrowConfiguration = arrowConfiguration.reverse();
8282 }
8383 final Component comp = skin.createComponent(ComponentType.ARROW, arrowConfiguration, skinParam,
84 message.getLabel());
84 message.getLabelNumbered());
8585 return comp;
8686 }
8787
3939 import java.util.Iterator;
4040
4141 import net.sourceforge.plantuml.ISkinParam;
42 import net.sourceforge.plantuml.Log;
4243 import net.sourceforge.plantuml.graphic.StringBounder;
4344 import net.sourceforge.plantuml.real.Real;
4445 import net.sourceforge.plantuml.sequencediagram.Event;
100101
101102 if (message.isActivate()) {
102103 livingSpace1.addStepForLivebox(getEvent(), y + p2.getY());
103 System.err.println("CommunicationTileSelf::updateStairs activate y=" + (y + p2.getY()) + " " + message);
104 Log.info("CommunicationTileSelf::updateStairs activate y=" + (y + p2.getY()) + " " + message);
104105 } else if (message.isDeactivate()) {
105106 livingSpace1.addStepForLivebox(getEvent(), y + p1.getY());
106 System.err.println("CommunicationTileSelf::updateStairs deactivate y=" + (y + p1.getY()) + " " + message);
107 Log.info("CommunicationTileSelf::updateStairs deactivate y=" + (y + p1.getY()) + " " + message);
107108 }
108109
109110 // livingSpace1.addStep(y + arrowY, level1);
120121 double x1 = getPoint1(stringBounder).getCurrentValue();
121122 final int levelIgnore = livingSpace1.getLevelAt(this, EventsHistoryMode.IGNORE_FUTURE_ACTIVATE);
122123 final int levelConsidere = livingSpace1.getLevelAt(this, EventsHistoryMode.CONSIDERE_FUTURE_DEACTIVATE);
123 System.err.println("CommunicationTileSelf::drawU levelIgnore=" + levelIgnore + " levelConsidere="
124 + levelConsidere);
124 Log.info("CommunicationTileSelf::drawU levelIgnore=" + levelIgnore + " levelConsidere=" + levelConsidere);
125125 x1 += CommunicationTile.LIVE_DELTA_SIZE * levelIgnore;
126126 if (levelIgnore < levelConsidere) {
127127 x1 += CommunicationTile.LIVE_DELTA_SIZE;
4444 public class EmptyTile implements Tile {
4545
4646 private final double height;
47 private final Tile position;
4748
48 private final Real origin;
49
50 public EmptyTile(double height, TileArguments tileArguments) {
51 this.origin = tileArguments.getOrigin();
49 public EmptyTile(double height, Tile position) {
5250 this.height = height;
51 this.position = position;
5352 }
5453
5554 public void drawU(UGraphic ug) {
6362 }
6463
6564 public Real getMinX(StringBounder stringBounder) {
66 return origin;
65 return position.getMinX(stringBounder);
6766 }
6867
6968 public Real getMaxX(StringBounder stringBounder) {
70 return origin;
69 return position.getMaxX(stringBounder);
7170 }
7271
7372 public Event getEvent() {
134134 }
135135
136136 private SymbolContext getActivateColor(Event event) {
137 if (event instanceof LifeEvent) {
138 final LifeEvent le = (LifeEvent) event;
139 if (le.isActivate()) {
140 return le.getSpecificColors();
141 }
142 }
137143 for (Iterator<Event> it = events.iterator(); it.hasNext();) {
138144 final Event current = it.next();
139145 if (event != current) {
111111 } else if (shape instanceof NotesTile) {
112112 // Nothing ?
113113 } else if (shape instanceof Tile) {
114 Log.error("OtherTile " + shape);
114 Log.info("OtherTile " + shape);
115115 } else {
116116 throw new UnsupportedOperationException(shape.getClass().getName());
117117 }
8383 this.skin = skin;
8484 this.footer = getFooterOrHeader(FontParam.FOOTER);
8585 this.header = getFooterOrHeader(FontParam.HEADER);
86 this.annotatedWorker = new AnnotatedWorker(sequenceDiagram, sequenceDiagram.getSkinParam());
86 this.annotatedWorker = new AnnotatedWorker(sequenceDiagram, sequenceDiagram.getSkinParam(), stringBounder);
8787
8888 this.main = new MainTileAdapter(createMainTile());
8989 this.min1 = ((MainTileAdapter) main).getMinX(stringBounder);
138138 tiles.add(new DividerTile(divider, tileArguments));
139139 } else if (ev instanceof GroupingStart) {
140140 final GroupingStart start = (GroupingStart) ev;
141 tiles.add(new EmptyTile(4, tileArguments));
142 tiles.add(new GroupingTile(it, start, tileArguments.withBackColorGeneral(start.getBackColorElement(),
143 start.getBackColorGeneral()), tileArguments));
144 tiles.add(new EmptyTile(4, tileArguments));
141 final GroupingTile groupingTile = new GroupingTile(it, start, tileArguments.withBackColorGeneral(
142 start.getBackColorElement(), start.getBackColorGeneral()), tileArguments);
143 tiles.add(new EmptyTile(4, groupingTile));
144 tiles.add(groupingTile);
145 tiles.add(new EmptyTile(4, groupingTile));
145146 // tiles.add(TileUtils.withMargin(tile, 0, 0, 4, 4);
146147 } else if (ev instanceof GroupingLeaf && ((GroupingLeaf) ev).getType() == GroupingType.ELSE) {
147148 final GroupingLeaf anElse = (GroupingLeaf) ev;
5252
5353 private final boolean isSelf;
5454 private final double thickness;
55 private final boolean reverseDefine;
5556
5657 private ArrowConfiguration(ArrowBody body, ArrowDressing dressing1, ArrowDressing dressing2,
57 ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf, double thickness) {
58 ArrowDecoration decoration1, ArrowDecoration decoration2, HtmlColor color, boolean isSelf,
59 double thickness, boolean reverseDefine) {
5860 if (body == null || dressing1 == null || dressing2 == null) {
5961 throw new IllegalArgumentException();
6062 }
63 this.reverseDefine = reverseDefine;
6164 this.thickness = thickness;
6265 this.body = body;
6366 this.dressing1 = dressing1;
8083
8184 public static ArrowConfiguration withDirectionNormal() {
8285 return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create(), ArrowDressing.create().withHead(
83 ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false, 1);
86 ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null, false, 1, false);
8487 }
8588
8689 public static ArrowConfiguration withDirectionBoth() {
8790 return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
8891 ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
89 false, 1);
92 false, 1, false);
9093 }
9194
9295 public static ArrowConfiguration withDirectionSelf() {
9396 return new ArrowConfiguration(ArrowBody.NORMAL, ArrowDressing.create().withHead(ArrowHead.NORMAL),
9497 ArrowDressing.create().withHead(ArrowHead.NORMAL), ArrowDecoration.NONE, ArrowDecoration.NONE, null,
95 true, 1);
98 true, 1, false);
9699 }
97100
98101 public static ArrowConfiguration withDirectionReverse() {
100103 }
101104
102105 public ArrowConfiguration reverse() {
103 return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf, thickness);
106 return new ArrowConfiguration(body, dressing2, dressing1, decoration2, decoration1, color, isSelf, thickness,
107 reverseDefine);
104108 }
105109
106110 public ArrowConfiguration self() {
107 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true, thickness);
111 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, true, thickness,
112 reverseDefine);
108113 }
109114
110115 public ArrowConfiguration withBody(ArrowBody type) {
111 return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
116 return new ArrowConfiguration(type, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
117 reverseDefine);
112118 }
113119
114120 public ArrowConfiguration withHead(ArrowHead head) {
115121 final ArrowDressing newDressing1 = addHead(dressing1, head);
116122 final ArrowDressing newDressing2 = addHead(dressing2, head);
117123 return new ArrowConfiguration(body, newDressing1, newDressing2, decoration1, decoration2, color, isSelf,
118 thickness);
124 thickness, reverseDefine);
119125 }
120126
121127 private static ArrowDressing addHead(ArrowDressing dressing, ArrowHead head) {
127133
128134 public ArrowConfiguration withHead1(ArrowHead head) {
129135 return new ArrowConfiguration(body, dressing1.withHead(head), dressing2, decoration1, decoration2, color,
130 isSelf, thickness);
136 isSelf, thickness, reverseDefine);
131137 }
132138
133139 public ArrowConfiguration withHead2(ArrowHead head) {
134140 return new ArrowConfiguration(body, dressing1, dressing2.withHead(head), decoration1, decoration2, color,
135 isSelf, thickness);
141 isSelf, thickness, reverseDefine);
136142 }
137143
138144 public ArrowConfiguration withPart(ArrowPart part) {
139145 if (dressing2.getHead() != ArrowHead.NONE) {
140146 return new ArrowConfiguration(body, dressing1, dressing2.withPart(part), decoration1, decoration2, color,
141 isSelf, thickness);
147 isSelf, thickness, reverseDefine);
142148 }
143149 return new ArrowConfiguration(body, dressing1.withPart(part), dressing2, decoration1, decoration2, color,
144 isSelf, thickness);
150 isSelf, thickness, reverseDefine);
145151 }
146152
147153 public ArrowConfiguration withDecoration1(ArrowDecoration decoration1) {
148 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
154 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
155 reverseDefine);
149156 }
150157
151158 public ArrowConfiguration withDecoration2(ArrowDecoration decoration2) {
152 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
159 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
160 reverseDefine);
153161 }
154162
155163 public ArrowConfiguration withColor(HtmlColor color) {
156 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
164 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
165 reverseDefine);
157166 }
158167
159168 public final ArrowDecoration getDecoration1() {
235244 }
236245
237246 public ArrowConfiguration withThickness(double thickness) {
238 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness);
247 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
248 reverseDefine);
249 }
250
251 public ArrowConfiguration reverseDefine() {
252 return new ArrowConfiguration(body, dressing1, dressing2, decoration1, decoration2, color, isSelf, thickness,
253 !reverseDefine);
254 }
255
256 public final boolean isReverseDefine() {
257 return reverseDefine;
239258 }
240259
241260 }
3535 package net.sourceforge.plantuml.skin.rose;
3636
3737 import net.sourceforge.plantuml.ISkinSimple;
38 import net.sourceforge.plantuml.LineBreakStrategy;
3938 import net.sourceforge.plantuml.creole.Stencil;
4039 import net.sourceforge.plantuml.cucadiagram.Display;
4140 import net.sourceforge.plantuml.graphic.FontConfiguration;
6059
6160 public ComponentRoseNote(SymbolContext symbolContext, FontConfiguration font, Display strings, double paddingX,
6261 double paddingY, ISkinSimple spriteContainer, double roundCorner, HorizontalAlignment horizontalAlignment) {
63 super(LineBreakStrategy.NONE, strings, font, horizontalAlignment,
62 super(spriteContainer.wrapWidth(), strings, font, horizontalAlignment,
6463 horizontalAlignment == HorizontalAlignment.CENTER ? 15 : 6, 15, 5, spriteContainer, true, null, null);
6564 this.roundCorner = roundCorner;
6665 this.paddingX = paddingX;
3535 package net.sourceforge.plantuml.skin.rose;
3636
3737 import net.sourceforge.plantuml.ISkinSimple;
38 import net.sourceforge.plantuml.LineBreakStrategy;
3938 import net.sourceforge.plantuml.cucadiagram.Display;
4039 import net.sourceforge.plantuml.graphic.FontConfiguration;
4140 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
5352 private final SymbolContext symbolContext;
5453
5554 public ComponentRoseNoteBox(SymbolContext symbolContext, FontConfiguration font, Display strings,
56 ISkinSimple spriteContainer) {
57 super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.LEFT, 4, 4, 4, spriteContainer, false, null, null);
55 ISkinSimple spriteContainer, HorizontalAlignment alignment) {
56 super(spriteContainer.wrapWidth(), strings, font, alignment, 4, 4, 4, spriteContainer, false,
57 null, null);
5858 this.symbolContext = symbolContext;
5959 }
6060
5555
5656
5757 public ComponentRoseNoteHexagonal(SymbolContext symbolContext, FontConfiguration font, Display strings,
58 ISkinSimple spriteContainer) {
59 super(LineBreakStrategy.NONE, strings, font, HorizontalAlignment.LEFT, 12, 12, 4, spriteContainer, false, null, null);
58 ISkinSimple spriteContainer, HorizontalAlignment alignment) {
59 super(LineBreakStrategy.NONE, strings, font, alignment, 12, 12, 4, spriteContainer, false, null, null);
6060 this.symbolContext = symbolContext;
6161 }
6262
9999 config, param, param.maxMessageSize(), param.strictUmlStyle() == false);
100100 }
101101 final HorizontalAlignment messageHorizontalAlignment = param.getHorizontalAlignment(
102 AlignmentParam.sequenceMessageAlignment, config.getArrowDirection());
102 AlignmentParam.sequenceMessageAlignment, config.getArrowDirection(), config.isReverseDefine());
103103 final HorizontalAlignment textHorizontalAlignment = param.getHorizontalAlignment(
104 AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection());
104 AlignmentParam.sequenceMessageTextAlignment, config.getArrowDirection(), false);
105105 return new ComponentRoseArrow(sequenceArrow, getUFont2(param, FontParam.ARROW), stringsToDisplay, config,
106106 messageHorizontalAlignment, param, textHorizontalAlignment, param.maxMessageSize(),
107107 param.strictUmlStyle() == false, param.responseMessageBelowArrow());
197197 FontParam.DATABASE_STEREOTYPE));
198198 }
199199 if (type == ComponentType.NOTE) {
200 final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null);
200 final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
201201 return new ComponentRoseNote(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
202202 FontParam.NOTE), stringsToDisplay, paddingX, paddingY, param, roundCorner, alignment);
203203 }
204204 if (type == ComponentType.NOTE_HEXAGONAL) {
205 final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
205206 return new ComponentRoseNoteHexagonal(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
206 FontParam.NOTE), stringsToDisplay, param);
207 FontParam.NOTE), stringsToDisplay, param, alignment);
207208 }
208209 if (type == ComponentType.NOTE_BOX) {
210 final HorizontalAlignment alignment = param.getHorizontalAlignment(AlignmentParam.noteTextAlignment, null, false);
209211 return new ComponentRoseNoteBox(getSymbolContext(param, ColorParam.noteBorder), getUFont2(param,
210 FontParam.NOTE), stringsToDisplay, param);
212 FontParam.NOTE), stringsToDisplay, param, alignment);
211213 }
212214 final FontConfiguration bigFont = getUFont2(param, FontParam.SEQUENCE_GROUP_HEADER);
213215 if (type == ComponentType.GROUPING_HEADER) {
258260 if (type == ComponentType.REFERENCE) {
259261 return new ComponentRoseReference(getUFont2(param, FontParam.SEQUENCE_REFERENCE), getSymbolContext(param,
260262 ColorParam.sequenceReferenceBorder), bigFont, stringsToDisplay, param.getHorizontalAlignment(
261 AlignmentParam.sequenceReferenceAlignment, null), param, getHtmlColor(param,
263 AlignmentParam.sequenceReferenceAlignment, null, false), param, getHtmlColor(param,
262264 ColorParam.sequenceReferenceBackground));
263265 }
264266 // if (type == ComponentType.TITLE) {
278280 }
279281
280282 private double deltaShadow(ISkinParam param) {
281 return param.shadowing() ? 4.0 : 0;
283 return param.shadowing(null) ? 4.0 : 0;
282284 }
283285
284286 private SymbolContext getSymbolContext(ISkinParam param, ColorParam color) {
353353 }
354354 }
355355
356 final boolean shadowing = group.getUSymbol() == null ? skinParam2.shadowing() : skinParam2.shadowing2(group
357 .getUSymbol().getSkinParameter());
356 final boolean shadowing = group.getUSymbol() == null ? skinParam2.shadowing2(group.getStereotype(), USymbol.PACKAGE.getSkinParameter())
357 : skinParam2.shadowing2(group.getStereotype(), group.getUSymbol().getSkinParameter());
358358 if (ztitle != null || zstereo != null) {
359359 final HtmlColor back = getBackColor(getBackColor(umlDiagramType), skinParam2, group.getStereotype());
360360 final double roundCorner = group.getUSymbol() == null ? 0 : group.getUSymbol().getSkinParameter()
364364 final ClusterDecoration decoration = new ClusterDecoration(style, group.getUSymbol(), ztitle, zstereo,
365365 minX, minY, maxX, maxY, stroke2);
366366 decoration.drawU(ug, back, borderColor, shadowing, roundCorner,
367 skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null));
367 skinParam2.getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false));
368368 return;
369369 }
370370 final URectangle rect = new URectangle(maxX - minX, maxY - minY);
461461 final double attributeHeight = attribute.calculateDimension(ug.getStringBounder()).getHeight();
462462 final RoundedContainer r = new RoundedContainer(total, suppY, attributeHeight
463463 + (attributeHeight > 0 ? IEntityImage.MARGIN : 0), borderColor, stateBack, background, stroke);
464 r.drawU(ug.apply(new UTranslate(minX, minY)), skinParam2.shadowing());
464 r.drawU(ug.apply(new UTranslate(minX, minY)), skinParam2.shadowing(group.getStereotype()));
465465
466466 if (ztitle != null) {
467467 ztitle.drawU(ug.apply(new UTranslate(xTitle, yTitle)));
740740 Line.appendTable(sblabel, getTitleAndAttributeWidth(), getTitleAndAttributeHeight() - 5, colorTitle);
741741 sblabel.append(">");
742742 label = sblabel.toString();
743 final HorizontalAlignment align = skinParam
744 .getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null);
743 final HorizontalAlignment align = skinParam.getHorizontalAlignment(AlignmentParam.packageTitleAlignment,
744 null, false);
745745 sb.append("labeljust=\"" + align.getGraphVizValue() + "\";");
746746 } else {
747747 label = "\"\"";
7474 }
7575 }
7676
77 private DotDataImageBuilder createDotDataImageBuilder(DotMode dotMode, StringBounder stringBounder) {
77 private GeneralImageBuilder createDotDataImageBuilder(DotMode dotMode, StringBounder stringBounder) {
7878 final DotData dotData = new DotData(diagram.getEntityFactory().getRootGroup(), getOrderedLinks(),
7979 diagram.getLeafsvalues(), diagram.getUmlDiagramType(), diagram.getSkinParam(), diagram, diagram,
8080 diagram.getColorMapper(), diagram.getEntityFactory(), diagram.isHideEmptyDescriptionForState(),
8181 dotMode, diagram.getNamespaceSeparator(), diagram.getPragma());
82 return new DotDataImageBuilder(dotData, diagram.getEntityFactory(), diagram.getSource(), diagram.getPragma(),
82 return new GeneralImageBuilder(dotData, diagram.getEntityFactory(), diagram.getSource(), diagram.getPragma(),
8383 stringBounder);
8484
8585 }
9393 }
9494
9595 // System.err.println("FOO11 type=" + os.getClass());
96 DotDataImageBuilder svek2 = createDotDataImageBuilder(DotMode.NORMAL,
96 GeneralImageBuilder svek2 = createDotDataImageBuilder(DotMode.NORMAL,
9797 fileFormatOption.getDefaultStringBounder());
9898 BaseFile basefile = null;
9999 if (fileFormatOption.isDebugSvek() && os instanceof NamedOutputStream) {
108108 result = svek2.buildImage(basefile, diagram.getDotStringSkek());
109109 }
110110 final boolean isGraphvizCrash = result instanceof GraphvizCrash;
111 result = new AnnotatedWorker(diagram, diagram.getSkinParam()).addAdd(result);
111 result = new AnnotatedWorker(diagram, diagram.getSkinParam(), fileFormatOption.getDefaultStringBounder())
112 .addAdd(result);
112113
113114 final String widthwarning = diagram.getSkinParam().getValue("widthwarning");
114115 String warningOrError = null;
+0
-589
src/net/sourceforge/plantuml/svek/DotDataImageBuilder.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.svek;
36
37 import java.awt.geom.Dimension2D;
38 import java.io.File;
39 import java.io.IOException;
40 import java.util.ArrayList;
41 import java.util.Collection;
42 import java.util.List;
43 import java.util.Map;
44 import java.util.regex.Matcher;
45 import java.util.regex.Pattern;
46
47 import net.sourceforge.plantuml.BaseFile;
48 import net.sourceforge.plantuml.ColorParam;
49 import net.sourceforge.plantuml.FontParam;
50 import net.sourceforge.plantuml.ISkinParam;
51 import net.sourceforge.plantuml.Log;
52 import net.sourceforge.plantuml.OptionFlags;
53 import net.sourceforge.plantuml.Pragma;
54 import net.sourceforge.plantuml.SkinParamForecolored;
55 import net.sourceforge.plantuml.SkinParamSameClassWidth;
56 import net.sourceforge.plantuml.SkinParamUtils;
57 import net.sourceforge.plantuml.StringUtils;
58 import net.sourceforge.plantuml.UmlDiagramType;
59 import net.sourceforge.plantuml.core.UmlSource;
60 import net.sourceforge.plantuml.cucadiagram.Code;
61 import net.sourceforge.plantuml.cucadiagram.Display;
62 import net.sourceforge.plantuml.cucadiagram.EntityPortion;
63 import net.sourceforge.plantuml.cucadiagram.EntityPosition;
64 import net.sourceforge.plantuml.cucadiagram.GroupType;
65 import net.sourceforge.plantuml.cucadiagram.IEntity;
66 import net.sourceforge.plantuml.cucadiagram.IGroup;
67 import net.sourceforge.plantuml.cucadiagram.ILeaf;
68 import net.sourceforge.plantuml.cucadiagram.LeafType;
69 import net.sourceforge.plantuml.cucadiagram.Link;
70 import net.sourceforge.plantuml.cucadiagram.Member;
71 import net.sourceforge.plantuml.cucadiagram.MethodsOrFieldsArea;
72 import net.sourceforge.plantuml.cucadiagram.PortionShower;
73 import net.sourceforge.plantuml.cucadiagram.Stereotype;
74 import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException;
75 import net.sourceforge.plantuml.cucadiagram.dot.DotData;
76 import net.sourceforge.plantuml.cucadiagram.dot.ExeState;
77 import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
78 import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
79 import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
80 import net.sourceforge.plantuml.descdiagram.EntityImageDesignedDomain;
81 import net.sourceforge.plantuml.descdiagram.EntityImageDomain;
82 import net.sourceforge.plantuml.descdiagram.EntityImageMachine;
83 import net.sourceforge.plantuml.descdiagram.EntityImageRequirement;
84 import net.sourceforge.plantuml.graphic.FontConfiguration;
85 import net.sourceforge.plantuml.graphic.GraphicStrings;
86 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
87 import net.sourceforge.plantuml.graphic.HtmlColor;
88 import net.sourceforge.plantuml.graphic.StringBounder;
89 import net.sourceforge.plantuml.graphic.TextBlock;
90 import net.sourceforge.plantuml.graphic.TextBlockEmpty;
91 import net.sourceforge.plantuml.graphic.TextBlockUtils;
92 import net.sourceforge.plantuml.graphic.TextBlockWidth;
93 import net.sourceforge.plantuml.graphic.USymbol;
94 import net.sourceforge.plantuml.graphic.USymbolInterface;
95 import net.sourceforge.plantuml.graphic.color.ColorType;
96 import net.sourceforge.plantuml.svek.image.EntityImageActivity;
97 import net.sourceforge.plantuml.svek.image.EntityImageArcCircle;
98 import net.sourceforge.plantuml.svek.image.EntityImageAssociation;
99 import net.sourceforge.plantuml.svek.image.EntityImageAssociationPoint;
100 import net.sourceforge.plantuml.svek.image.EntityImageBranch;
101 import net.sourceforge.plantuml.svek.image.EntityImageCircleEnd;
102 import net.sourceforge.plantuml.svek.image.EntityImageCircleStart;
103 import net.sourceforge.plantuml.svek.image.EntityImageClass;
104 import net.sourceforge.plantuml.svek.image.EntityImageDescription;
105 import net.sourceforge.plantuml.svek.image.EntityImageEmptyPackage;
106 import net.sourceforge.plantuml.svek.image.EntityImageGroup;
107 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterface;
108 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterfaceEye1;
109 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterfaceEye2;
110 import net.sourceforge.plantuml.svek.image.EntityImageNote;
111 import net.sourceforge.plantuml.svek.image.EntityImageObject;
112 import net.sourceforge.plantuml.svek.image.EntityImagePseudoState;
113 import net.sourceforge.plantuml.svek.image.EntityImageState;
114 import net.sourceforge.plantuml.svek.image.EntityImageState2;
115 import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
116 import net.sourceforge.plantuml.svek.image.EntityImageStateEmptyDescription;
117 import net.sourceforge.plantuml.svek.image.EntityImageSynchroBar;
118 import net.sourceforge.plantuml.svek.image.EntityImageTips;
119 import net.sourceforge.plantuml.svek.image.EntityImageUseCase;
120 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
121
122 public final class DotDataImageBuilder {
123
124 private final DotData dotData;
125 private final EntityFactory entityFactory;
126 private final UmlSource source;
127 private final Pragma pragma;
128 private Map<Code, Double> maxX;
129
130 private final StringBounder stringBounder;
131
132 public DotDataImageBuilder(DotData dotData, EntityFactory entityFactory, UmlSource source, Pragma pragma,
133 StringBounder stringBounder) {
134 this.dotData = dotData;
135 this.entityFactory = entityFactory;
136 this.source = source;
137 this.pragma = pragma;
138 this.stringBounder = stringBounder;
139 }
140
141 public IEntityImage buildImage(BaseFile basefile, String dotStrings[]) {
142 dotData.removeIrrelevantSametail();
143 final DotStringFactory dotStringFactory = new DotStringFactory(stringBounder, dotData);
144
145 printGroups(dotStringFactory, dotData.getRootGroup());
146 printEntities(dotStringFactory, getUnpackagedEntities());
147
148 for (Link link : dotData.getLinks()) {
149 if (link.isRemoved()) {
150 continue;
151 }
152 try {
153 final ISkinParam skinParam = dotData.getSkinParam();
154 final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.ARROW, null);
155
156 final Line line = new Line(link, dotStringFactory.getColorSequence(), skinParam, stringBounder,
157 labelFont, dotStringFactory.getBibliotekon(), dotData.getPragma());
158
159 dotStringFactory.getBibliotekon().addLine(line);
160
161 if (link.getEntity1().isGroup() == false && link.getEntity1().getLeafType() == LeafType.NOTE
162 && onlyOneLink(link.getEntity1())) {
163 final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
164 final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
165 if (other != null) {
166 ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
167 line.setOpale(true);
168 }
169 } else if (link.getEntity2().isGroup() == false && link.getEntity2().getLeafType() == LeafType.NOTE
170 && onlyOneLink(link.getEntity2())) {
171 final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
172 final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
173 if (other != null) {
174 ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
175 line.setOpale(true);
176 }
177 }
178 } catch (IllegalStateException e) {
179 e.printStackTrace();
180 }
181 }
182
183 if (dotStringFactory.illegalDotExe()) {
184 return error(dotStringFactory.getDotExe());
185 }
186
187 // final boolean trace = OptionFlags.getInstance().isKeepTmpFiles() || OptionFlags.TRACE_DOT || isSvekTrace();
188 // option.isDebugSvek
189 // System.err.println("FOO11 svekDebug=" + svekDebug);
190 if (basefile == null && isSvekTrace()) {
191 basefile = new BaseFile();
192 }
193 // System.err.println("FOO11 basefile=" + basefile);
194 final String svg;
195 try {
196 svg = dotStringFactory.getSvg(basefile, dotStrings);
197 } catch (IOException e) {
198 return new GraphvizCrash(source.getPlainString());
199 }
200 if (svg.length() == 0) {
201 return new GraphvizCrash(source.getPlainString());
202 }
203 final String graphvizVersion = extractGraphvizVersion(svg);
204 try {
205 final ClusterPosition position = dotStringFactory.solve(svg).delta(10, 10);
206 final double minY = position.getMinY();
207 final double minX = position.getMinX();
208 if (minX > 0 || minY > 0) {
209 throw new IllegalStateException();
210 }
211 final SvekResult result = new SvekResult(position, dotData, dotStringFactory);
212 result.moveSvek(6 - minX, -minY);
213 this.maxX = dotStringFactory.getBibliotekon().getMaxX();
214 return result;
215 } catch (Exception e) {
216 Log.error("Exception " + e);
217 throw new UnparsableGraphvizException(e, graphvizVersion, svg, source.getPlainString());
218 }
219
220 }
221
222 private boolean isSvekTrace() {
223 final String value = pragma.getValue("svek_trace");
224 return "true".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value);
225 }
226
227 private String extractGraphvizVersion(String svg) {
228 final Pattern pGraph = Pattern.compile("(?mi)!-- generated by graphviz(.*)");
229 final Matcher mGraph = pGraph.matcher(svg);
230 if (mGraph.find()) {
231 return StringUtils.trin(mGraph.group(1));
232 }
233 return null;
234 }
235
236 private boolean onlyOneLink(IEntity ent) {
237 int nb = 0;
238 for (Link link : dotData.getLinks()) {
239 if (link.isInvis()) {
240 continue;
241 }
242 if (link.contains(ent)) {
243 nb++;
244 }
245 if (nb > 1) {
246 return false;
247 }
248 }
249 return nb == 1;
250 }
251
252 private IEntityImage error(File dotExe) {
253
254 final List<String> msg = new ArrayList<String>();
255 msg.add("Dot Executable: " + dotExe);
256 final ExeState exeState = ExeState.checkFile(dotExe);
257 msg.add(exeState.getTextMessage());
258 msg.add("Cannot find Graphviz. You should try");
259 msg.add(" ");
260 msg.add("@startuml");
261 msg.add("testdot");
262 msg.add("@enduml");
263 msg.add(" ");
264 msg.add(" or ");
265 msg.add(" ");
266 msg.add("java -jar plantuml.jar -testdot");
267 msg.add(" ");
268 return GraphicStrings.createForError(msg, false);
269 }
270
271 private void printEntities(DotStringFactory dotStringFactory, Collection<ILeaf> entities2) {
272 for (ILeaf ent : entities2) {
273 if (ent.isRemoved()) {
274 continue;
275 }
276 printEntity(dotStringFactory, ent);
277 }
278 }
279
280 private void printEntity(DotStringFactory dotStringFactory, ILeaf ent) {
281 if (ent.isRemoved()) {
282 throw new IllegalStateException();
283 }
284 final IEntityImage image = printEntityInternal(dotStringFactory, ent);
285 final Dimension2D dim = image.calculateDimension(stringBounder);
286 final Shape shape = new Shape(image, image.getShapeType(), dim.getWidth(), dim.getHeight(),
287 dotStringFactory.getColorSequence(), ent.isTop(), image.getShield(stringBounder),
288 ent.getEntityPosition());
289 dotStringFactory.addShape(shape);
290 dotStringFactory.getBibliotekon().putShape(ent, shape);
291 }
292
293 private IEntityImage printEntityInternal(DotStringFactory dotStringFactory, ILeaf ent) {
294 if (ent.isRemoved()) {
295 throw new IllegalStateException();
296 }
297 if (ent.getSvekImage() == null) {
298 ISkinParam skinParam = dotData.getSkinParam();
299 if (skinParam.sameClassWidth()) {
300 final double width = getMaxWidth(dotStringFactory);
301 skinParam = new SkinParamSameClassWidth(skinParam, width);
302 }
303
304 return createEntityImageBlock(ent, skinParam, dotData.isHideEmptyDescriptionForState(), dotData,
305 dotStringFactory.getBibliotekon(), dotStringFactory.getGraphvizVersion(),
306 dotData.getUmlDiagramType(), dotData.getLinks());
307 }
308 return ent.getSvekImage();
309 }
310
311 private double getMaxWidth(DotStringFactory dotStringFactory) {
312 double result = 0;
313 for (ILeaf ent : dotData.getLeafs()) {
314 if (ent.getLeafType().isLikeClass() == false) {
315 continue;
316 }
317 final IEntityImage im = new EntityImageClass(dotStringFactory.getGraphvizVersion(), ent,
318 dotData.getSkinParam(), dotData);
319 final double w = im.calculateDimension(stringBounder).getWidth();
320 if (w > result) {
321 result = w;
322 }
323 }
324 return result;
325 }
326
327 public static IEntityImage createEntityImageBlock(ILeaf leaf, ISkinParam skinParam,
328 boolean isHideEmptyDescriptionForState, PortionShower portionShower, Bibliotekon bibliotekon,
329 GraphvizVersion graphvizVersion, UmlDiagramType umlDiagramType, Collection<Link> links) {
330 if (leaf.isRemoved()) {
331 throw new IllegalStateException();
332 }
333 if (leaf.getLeafType().isLikeClass()) {
334 final EntityImageClass entityImageClass = new EntityImageClass(graphvizVersion, (ILeaf) leaf, skinParam,
335 portionShower);
336 final Neighborhood neighborhood = leaf.getNeighborhood();
337 if (neighborhood != null) {
338 return new EntityImageProtected(entityImageClass, 20, neighborhood, bibliotekon);
339 }
340 return entityImageClass;
341 }
342 if (leaf.getLeafType() == LeafType.NOTE) {
343 return new EntityImageNote(leaf, skinParam);
344 }
345 if (leaf.getLeafType() == LeafType.ACTIVITY) {
346 return new EntityImageActivity(leaf, skinParam, bibliotekon);
347 }
348 if (leaf.getLeafType() == LeafType.STATE) {
349 if (leaf.getEntityPosition() != EntityPosition.NORMAL) {
350 final Cluster stateParent = bibliotekon.getCluster(leaf.getParentContainer());
351 return new EntityImageStateBorder(leaf, skinParam, stateParent, bibliotekon);
352 }
353 if (isHideEmptyDescriptionForState && leaf.getBodier().getFieldsToDisplay().size() == 0) {
354 return new EntityImageStateEmptyDescription(leaf, skinParam);
355 }
356 if (leaf.getStereotype() != null && "<<sdlreceive>>".equals(leaf.getStereotype().getLabel(false))) {
357 return new EntityImageState2(leaf, skinParam);
358 }
359 return new EntityImageState(leaf, skinParam);
360
361 }
362 if (leaf.getLeafType() == LeafType.CIRCLE_START) {
363 ColorParam param = ColorParam.activityStart;
364 if (umlDiagramType == UmlDiagramType.STATE) {
365 param = ColorParam.stateStart;
366 }
367 return new EntityImageCircleStart(leaf, skinParam, param);
368 }
369 if (leaf.getLeafType() == LeafType.CIRCLE_END) {
370 ColorParam param = ColorParam.activityEnd;
371 if (umlDiagramType == UmlDiagramType.STATE) {
372 param = ColorParam.stateEnd;
373 }
374 return new EntityImageCircleEnd(leaf, skinParam, param);
375 }
376 if (leaf.getLeafType() == LeafType.BRANCH || leaf.getLeafType() == LeafType.STATE_CHOICE) {
377 return new EntityImageBranch(leaf, skinParam);
378 }
379 if (leaf.getLeafType() == LeafType.LOLLIPOP) {
380 return new EntityImageLollipopInterface(leaf, skinParam);
381 }
382 if (leaf.getLeafType() == LeafType.CIRCLE) {
383 return new EntityImageDescription(leaf, skinParam, portionShower, links);
384 }
385
386 if (leaf.getLeafType() == LeafType.DESCRIPTION) {
387 if (OptionFlags.USE_INTERFACE_EYE1 && leaf.getUSymbol() instanceof USymbolInterface) {
388 return new EntityImageLollipopInterfaceEye1(leaf, skinParam, bibliotekon);
389 } else if (OptionFlags.USE_INTERFACE_EYE2 && leaf.getUSymbol() instanceof USymbolInterface) {
390 return new EntityImageLollipopInterfaceEye2(leaf, skinParam, portionShower);
391 } else {
392 return new EntityImageDescription(leaf, skinParam, portionShower, links);
393 }
394 }
395 if (leaf.getLeafType() == LeafType.USECASE) {
396 return new EntityImageUseCase(leaf, skinParam, portionShower);
397 }
398 // if (leaf.getEntityType() == LeafType.CIRCLE_INTERFACE) {
399 // return new EntityImageCircleInterface(leaf, skinParam);
400 // }
401 if (leaf.getLeafType() == LeafType.OBJECT) {
402 return new EntityImageObject(leaf, skinParam, portionShower);
403 }
404 if (leaf.getLeafType() == LeafType.SYNCHRO_BAR || leaf.getLeafType() == LeafType.STATE_FORK_JOIN) {
405 return new EntityImageSynchroBar(leaf, skinParam);
406 }
407 if (leaf.getLeafType() == LeafType.ARC_CIRCLE) {
408 return new EntityImageArcCircle(leaf, skinParam);
409 }
410 if (leaf.getLeafType() == LeafType.POINT_FOR_ASSOCIATION) {
411 return new EntityImageAssociationPoint(leaf, skinParam);
412 }
413 if (leaf.isGroup()) {
414 return new EntityImageGroup(leaf, skinParam);
415 }
416 if (leaf.getLeafType() == LeafType.EMPTY_PACKAGE) {
417 if (leaf.getUSymbol() != null) {
418 // final HtmlColor black = HtmlColorUtils.BLACK;
419 final HtmlColor black = SkinParamUtils.getColor(skinParam, leaf.getUSymbol().getColorParamBorder(),
420 leaf.getStereotype());
421 return new EntityImageDescription(leaf, new SkinParamForecolored(skinParam, black), portionShower,
422 links);
423 }
424 return new EntityImageEmptyPackage(leaf, skinParam, portionShower);
425 }
426 if (leaf.getLeafType() == LeafType.ASSOCIATION) {
427 return new EntityImageAssociation(leaf, skinParam);
428 }
429 if (leaf.getLeafType() == LeafType.PSEUDO_STATE) {
430 return new EntityImagePseudoState(leaf, skinParam);
431 }
432 if (leaf.getLeafType() == LeafType.TIPS) {
433 return new EntityImageTips(leaf, skinParam, bibliotekon);
434 }
435 // TODO Clean
436 if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
437 && leaf.getStereotype().isMachineOrSpecification()) {
438 return new EntityImageMachine(leaf, skinParam);
439 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
440 && leaf.getStereotype().isDesignedOrSolved()) {
441 return new EntityImageDesignedDomain(leaf, skinParam);
442 } else if (leaf.getLeafType() == LeafType.REQUIREMENT) {
443 return new EntityImageRequirement(leaf, skinParam);
444 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
445 && leaf.getStereotype().isLexicalOrGiven()) {
446 return new EntityImageDomain(leaf, skinParam, 'X');
447 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
448 && leaf.getStereotype().isCausal()) {
449 return new EntityImageDomain(leaf, skinParam, 'C');
450 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
451 && leaf.getStereotype().isBiddableOrUncertain()) {
452 return new EntityImageDomain(leaf, skinParam, 'B');
453 } else if (leaf.getLeafType() == LeafType.DOMAIN) {
454 return new EntityImageDomain(leaf, skinParam, 'P');
455 } else
456 throw new UnsupportedOperationException(leaf.getLeafType().toString());
457 }
458
459 private Collection<ILeaf> getUnpackagedEntities() {
460 final List<ILeaf> result = new ArrayList<ILeaf>();
461 for (ILeaf ent : dotData.getLeafs()) {
462 if (dotData.getTopParent() == ent.getParentContainer()) {
463 result.add(ent);
464 }
465 }
466 return result;
467 }
468
469 private void printGroups(DotStringFactory dotStringFactory, IGroup parent) {
470 for (IGroup g : dotData.getGroupHierarchy().getChildrenGroups(parent)) {
471 if (g.isRemoved()) {
472 continue;
473 }
474 if (dotData.isEmpty(g) && g.getGroupType() == GroupType.PACKAGE) {
475 final ILeaf folder = entityFactory.createLeaf(g.getCode(), g.getDisplay(), LeafType.EMPTY_PACKAGE,
476 g.getParentContainer(), null, dotData.getNamespaceSeparator());
477 final USymbol symbol = g.getUSymbol();
478 folder.setUSymbol(symbol);
479 folder.setStereotype(g.getStereotype());
480 if (g.getUrl99() != null) {
481 folder.addUrl(g.getUrl99());
482 }
483 if (g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK) == null) {
484 final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack();
485 final HtmlColor c1 = dotData.getSkinParam().getHtmlColor(param, g.getStereotype(), false);
486 folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? dotData.getSkinParam()
487 .getBackgroundColor() : c1);
488 } else {
489 folder.setSpecificColorTOBEREMOVED(ColorType.BACK,
490 g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK));
491 }
492 printEntity(dotStringFactory, folder);
493 } else {
494 printGroup(dotStringFactory, g);
495 }
496 }
497 }
498
499 private void printGroup(DotStringFactory dotStringFactory, IGroup g) {
500 if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
501 return;
502 }
503 int titleAndAttributeWidth = 0;
504 int titleAndAttributeHeight = 0;
505
506 final TextBlock title = getTitleBlock(g);
507 final TextBlock stereo = getStereoBlock(g);
508 final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
509 final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
510 if (dimLabel.getWidth() > 0) {
511 final List<Member> members = ((IEntity) g).getBodier().getFieldsToDisplay();
512 final TextBlockWidth attribute;
513 if (members.size() == 0) {
514 attribute = new TextBlockEmpty();
515 } else {
516 attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, dotData.getSkinParam(),
517 g.getStereotype(), null);
518 }
519 final Dimension2D dimAttribute = attribute.calculateDimension(stringBounder);
520 final double attributeHeight = dimAttribute.getHeight();
521 final double attributeWidth = dimAttribute.getWidth();
522 final double marginForFields = attributeHeight > 0 ? IEntityImage.MARGIN : 0;
523 final USymbol uSymbol = g.getUSymbol();
524 final int suppHeightBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppHeightBecauseOfShape();
525 final int suppWidthBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppWidthBecauseOfShape();
526
527 titleAndAttributeWidth = (int) Math.max(dimLabel.getWidth(), attributeWidth) + suppWidthBecauseOfShape;
528 titleAndAttributeHeight = (int) (dimLabel.getHeight() + attributeHeight + marginForFields + suppHeightBecauseOfShape);
529 }
530
531 dotStringFactory.openCluster(g, titleAndAttributeWidth, titleAndAttributeHeight, title, stereo);
532 this.printEntities(dotStringFactory, g.getLeafsDirect());
533
534 printGroups(dotStringFactory, g);
535
536 dotStringFactory.closeCluster();
537 }
538
539 private TextBlock getTitleBlock(IGroup g) {
540 final Display label = g.getDisplay();
541 if (label == null) {
542 return TextBlockUtils.empty(0, 0);
543 }
544
545 final ISkinParam skinParam = dotData.getSkinParam();
546 final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam);
547 return label.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam);
548 }
549
550 private TextBlock getStereoBlock(IGroup g) {
551 final Stereotype stereotype = g.getStereotype();
552 if (stereotype == null) {
553 return TextBlockUtils.empty(0, 0);
554 }
555 if (stereotype.getSprite() != null) {
556 final Sprite tmp = dotData.getSkinParam().getSprite(stereotype.getSprite());
557 if (tmp != null) {
558 return tmp.asTextBlock(stereotype.getHtmlColor(), 1);
559 }
560 }
561 final List<String> stereos = stereotype.getLabels(dotData.getSkinParam().useGuillemet());
562 if (stereos == null) {
563 return TextBlockUtils.empty(0, 0);
564 }
565 final boolean show = dotData.showPortion(EntityPortion.STEREOTYPE, g);
566 if (show == false) {
567 return TextBlockUtils.empty(0, 0);
568 }
569
570 final FontParam fontParam = FontParam.PACKAGE_STEREOTYPE;
571 return Display.create(stereos).create(new FontConfiguration(dotData.getSkinParam(), fontParam, stereotype),
572 HorizontalAlignment.CENTER, dotData.getSkinParam());
573 }
574
575 public String getWarningOrError(int warningOrError) {
576 if (maxX == null) {
577 return "";
578 }
579 final StringBuilder sb = new StringBuilder();
580 for (Map.Entry<Code, Double> ent : maxX.entrySet()) {
581 if (ent.getValue() > warningOrError) {
582 sb.append(ent.getKey() + " is overpassing the width limit.");
583 sb.append("\n");
584 }
585 }
586 return sb.length() == 0 ? "" : sb.toString();
587 }
588 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 *
34 */
35 package net.sourceforge.plantuml.svek;
36
37 import java.awt.geom.Dimension2D;
38 import java.io.File;
39 import java.io.IOException;
40 import java.util.ArrayList;
41 import java.util.Collection;
42 import java.util.List;
43 import java.util.Map;
44 import java.util.regex.Matcher;
45 import java.util.regex.Pattern;
46
47 import net.sourceforge.plantuml.BaseFile;
48 import net.sourceforge.plantuml.ColorParam;
49 import net.sourceforge.plantuml.FontParam;
50 import net.sourceforge.plantuml.ISkinParam;
51 import net.sourceforge.plantuml.Log;
52 import net.sourceforge.plantuml.OptionFlags;
53 import net.sourceforge.plantuml.Pragma;
54 import net.sourceforge.plantuml.SkinParamForecolored;
55 import net.sourceforge.plantuml.SkinParamSameClassWidth;
56 import net.sourceforge.plantuml.SkinParamUtils;
57 import net.sourceforge.plantuml.StringUtils;
58 import net.sourceforge.plantuml.UmlDiagramType;
59 import net.sourceforge.plantuml.core.UmlSource;
60 import net.sourceforge.plantuml.cucadiagram.Code;
61 import net.sourceforge.plantuml.cucadiagram.Display;
62 import net.sourceforge.plantuml.cucadiagram.EntityPortion;
63 import net.sourceforge.plantuml.cucadiagram.EntityPosition;
64 import net.sourceforge.plantuml.cucadiagram.GroupType;
65 import net.sourceforge.plantuml.cucadiagram.IEntity;
66 import net.sourceforge.plantuml.cucadiagram.IGroup;
67 import net.sourceforge.plantuml.cucadiagram.ILeaf;
68 import net.sourceforge.plantuml.cucadiagram.LeafType;
69 import net.sourceforge.plantuml.cucadiagram.Link;
70 import net.sourceforge.plantuml.cucadiagram.Member;
71 import net.sourceforge.plantuml.cucadiagram.MethodsOrFieldsArea;
72 import net.sourceforge.plantuml.cucadiagram.PortionShower;
73 import net.sourceforge.plantuml.cucadiagram.Stereotype;
74 import net.sourceforge.plantuml.cucadiagram.UnparsableGraphvizException;
75 import net.sourceforge.plantuml.cucadiagram.dot.DotData;
76 import net.sourceforge.plantuml.cucadiagram.dot.ExeState;
77 import net.sourceforge.plantuml.cucadiagram.dot.GraphvizVersion;
78 import net.sourceforge.plantuml.cucadiagram.dot.Neighborhood;
79 import net.sourceforge.plantuml.cucadiagram.entity.EntityFactory;
80 import net.sourceforge.plantuml.descdiagram.EntityImageDesignedDomain;
81 import net.sourceforge.plantuml.descdiagram.EntityImageDomain;
82 import net.sourceforge.plantuml.descdiagram.EntityImageMachine;
83 import net.sourceforge.plantuml.descdiagram.EntityImageRequirement;
84 import net.sourceforge.plantuml.graphic.FontConfiguration;
85 import net.sourceforge.plantuml.graphic.GraphicStrings;
86 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
87 import net.sourceforge.plantuml.graphic.HtmlColor;
88 import net.sourceforge.plantuml.graphic.StringBounder;
89 import net.sourceforge.plantuml.graphic.TextBlock;
90 import net.sourceforge.plantuml.graphic.TextBlockEmpty;
91 import net.sourceforge.plantuml.graphic.TextBlockUtils;
92 import net.sourceforge.plantuml.graphic.TextBlockWidth;
93 import net.sourceforge.plantuml.graphic.USymbol;
94 import net.sourceforge.plantuml.graphic.USymbolInterface;
95 import net.sourceforge.plantuml.graphic.color.ColorType;
96 import net.sourceforge.plantuml.svek.image.EntityImageActivity;
97 import net.sourceforge.plantuml.svek.image.EntityImageArcCircle;
98 import net.sourceforge.plantuml.svek.image.EntityImageAssociation;
99 import net.sourceforge.plantuml.svek.image.EntityImageAssociationPoint;
100 import net.sourceforge.plantuml.svek.image.EntityImageBranch;
101 import net.sourceforge.plantuml.svek.image.EntityImageCircleEnd;
102 import net.sourceforge.plantuml.svek.image.EntityImageCircleStart;
103 import net.sourceforge.plantuml.svek.image.EntityImageClass;
104 import net.sourceforge.plantuml.svek.image.EntityImageDescription;
105 import net.sourceforge.plantuml.svek.image.EntityImageEmptyPackage;
106 import net.sourceforge.plantuml.svek.image.EntityImageGroup;
107 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterface;
108 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterfaceEye1;
109 import net.sourceforge.plantuml.svek.image.EntityImageLollipopInterfaceEye2;
110 import net.sourceforge.plantuml.svek.image.EntityImageNote;
111 import net.sourceforge.plantuml.svek.image.EntityImageObject;
112 import net.sourceforge.plantuml.svek.image.EntityImagePseudoState;
113 import net.sourceforge.plantuml.svek.image.EntityImageState;
114 import net.sourceforge.plantuml.svek.image.EntityImageState2;
115 import net.sourceforge.plantuml.svek.image.EntityImageStateBorder;
116 import net.sourceforge.plantuml.svek.image.EntityImageStateEmptyDescription;
117 import net.sourceforge.plantuml.svek.image.EntityImageSynchroBar;
118 import net.sourceforge.plantuml.svek.image.EntityImageTips;
119 import net.sourceforge.plantuml.svek.image.EntityImageUseCase;
120 import net.sourceforge.plantuml.ugraphic.sprite.Sprite;
121
122 public final class GeneralImageBuilder {
123
124 private final DotData dotData;
125 private final EntityFactory entityFactory;
126 private final UmlSource source;
127 private final Pragma pragma;
128 private Map<Code, Double> maxX;
129
130 private final StringBounder stringBounder;
131
132 public GeneralImageBuilder(DotData dotData, EntityFactory entityFactory, UmlSource source, Pragma pragma,
133 StringBounder stringBounder) {
134 this.dotData = dotData;
135 this.entityFactory = entityFactory;
136 this.source = source;
137 this.pragma = pragma;
138 this.stringBounder = stringBounder;
139 }
140
141 public IEntityImage buildImage(BaseFile basefile, String dotStrings[]) {
142 dotData.removeIrrelevantSametail();
143 final DotStringFactory dotStringFactory = new DotStringFactory(stringBounder, dotData);
144
145 printGroups(dotStringFactory, dotData.getRootGroup());
146 printEntities(dotStringFactory, getUnpackagedEntities());
147
148 for (Link link : dotData.getLinks()) {
149 if (link.isRemoved()) {
150 continue;
151 }
152 try {
153 final ISkinParam skinParam = dotData.getSkinParam();
154 final FontConfiguration labelFont = new FontConfiguration(skinParam, FontParam.ARROW, null);
155
156 final Line line = new Line(link, dotStringFactory.getColorSequence(), skinParam, stringBounder,
157 labelFont, dotStringFactory.getBibliotekon(), dotData.getPragma());
158
159 dotStringFactory.getBibliotekon().addLine(line);
160
161 if (link.getEntity1().isGroup() == false && link.getEntity1().getLeafType() == LeafType.NOTE
162 && onlyOneLink(link.getEntity1())) {
163 final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
164 final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
165 if (other != null) {
166 ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
167 line.setOpale(true);
168 }
169 } else if (link.getEntity2().isGroup() == false && link.getEntity2().getLeafType() == LeafType.NOTE
170 && onlyOneLink(link.getEntity2())) {
171 final Shape shape = dotStringFactory.getBibliotekon().getShape(link.getEntity2());
172 final Shape other = dotStringFactory.getBibliotekon().getShape(link.getEntity1());
173 if (other != null) {
174 ((EntityImageNote) shape.getImage()).setOpaleLine(line, shape, other);
175 line.setOpale(true);
176 }
177 }
178 } catch (IllegalStateException e) {
179 e.printStackTrace();
180 }
181 }
182
183 if (dotStringFactory.illegalDotExe()) {
184 return error(dotStringFactory.getDotExe());
185 }
186
187 // final boolean trace = OptionFlags.getInstance().isKeepTmpFiles() || OptionFlags.TRACE_DOT || isSvekTrace();
188 // option.isDebugSvek
189 // System.err.println("FOO11 svekDebug=" + svekDebug);
190 if (basefile == null && isSvekTrace()) {
191 basefile = new BaseFile();
192 }
193 // System.err.println("FOO11 basefile=" + basefile);
194 final String svg;
195 try {
196 svg = dotStringFactory.getSvg(basefile, dotStrings);
197 } catch (IOException e) {
198 return new GraphvizCrash(source.getPlainString());
199 }
200 if (svg.length() == 0) {
201 return new GraphvizCrash(source.getPlainString());
202 }
203 final String graphvizVersion = extractGraphvizVersion(svg);
204 try {
205 final ClusterPosition position = dotStringFactory.solve(svg).delta(10, 10);
206 final double minY = position.getMinY();
207 final double minX = position.getMinX();
208 if (minX > 0 || minY > 0) {
209 throw new IllegalStateException();
210 }
211 final SvekResult result = new SvekResult(position, dotData, dotStringFactory);
212 result.moveSvek(6 - minX, -minY);
213 this.maxX = dotStringFactory.getBibliotekon().getMaxX();
214 return result;
215 } catch (Exception e) {
216 Log.error("Exception " + e);
217 throw new UnparsableGraphvizException(e, graphvizVersion, svg, source.getPlainString());
218 }
219
220 }
221
222 private boolean isSvekTrace() {
223 final String value = pragma.getValue("svek_trace");
224 return "true".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value);
225 }
226
227 private String extractGraphvizVersion(String svg) {
228 final Pattern pGraph = Pattern.compile("(?mi)!-- generated by graphviz(.*)");
229 final Matcher mGraph = pGraph.matcher(svg);
230 if (mGraph.find()) {
231 return StringUtils.trin(mGraph.group(1));
232 }
233 return null;
234 }
235
236 private boolean onlyOneLink(IEntity ent) {
237 int nb = 0;
238 for (Link link : dotData.getLinks()) {
239 if (link.isInvis()) {
240 continue;
241 }
242 if (link.contains(ent)) {
243 nb++;
244 }
245 if (nb > 1) {
246 return false;
247 }
248 }
249 return nb == 1;
250 }
251
252 private IEntityImage error(File dotExe) {
253
254 final List<String> msg = new ArrayList<String>();
255 msg.add("Dot Executable: " + dotExe);
256 final ExeState exeState = ExeState.checkFile(dotExe);
257 msg.add(exeState.getTextMessage());
258 msg.add("Cannot find Graphviz. You should try");
259 msg.add(" ");
260 msg.add("@startuml");
261 msg.add("testdot");
262 msg.add("@enduml");
263 msg.add(" ");
264 msg.add(" or ");
265 msg.add(" ");
266 msg.add("java -jar plantuml.jar -testdot");
267 msg.add(" ");
268 return GraphicStrings.createForError(msg, false);
269 }
270
271 private void printEntities(DotStringFactory dotStringFactory, Collection<ILeaf> entities2) {
272 for (ILeaf ent : entities2) {
273 if (ent.isRemoved()) {
274 continue;
275 }
276 printEntity(dotStringFactory, ent);
277 }
278 }
279
280 private void printEntity(DotStringFactory dotStringFactory, ILeaf ent) {
281 if (ent.isRemoved()) {
282 throw new IllegalStateException();
283 }
284 final IEntityImage image = printEntityInternal(dotStringFactory, ent);
285 final Dimension2D dim = image.calculateDimension(stringBounder);
286 final Shape shape = new Shape(image, image.getShapeType(), dim.getWidth(), dim.getHeight(),
287 dotStringFactory.getColorSequence(), ent.isTop(), image.getShield(stringBounder),
288 ent.getEntityPosition());
289 dotStringFactory.addShape(shape);
290 dotStringFactory.getBibliotekon().putShape(ent, shape);
291 }
292
293 private IEntityImage printEntityInternal(DotStringFactory dotStringFactory, ILeaf ent) {
294 if (ent.isRemoved()) {
295 throw new IllegalStateException();
296 }
297 if (ent.getSvekImage() == null) {
298 ISkinParam skinParam = dotData.getSkinParam();
299 if (skinParam.sameClassWidth()) {
300 final double width = getMaxWidth(dotStringFactory);
301 skinParam = new SkinParamSameClassWidth(skinParam, width);
302 }
303
304 return createEntityImageBlock(ent, skinParam, dotData.isHideEmptyDescriptionForState(), dotData,
305 dotStringFactory.getBibliotekon(), dotStringFactory.getGraphvizVersion(),
306 dotData.getUmlDiagramType(), dotData.getLinks());
307 }
308 return ent.getSvekImage();
309 }
310
311 private double getMaxWidth(DotStringFactory dotStringFactory) {
312 double result = 0;
313 for (ILeaf ent : dotData.getLeafs()) {
314 if (ent.getLeafType().isLikeClass() == false) {
315 continue;
316 }
317 final IEntityImage im = new EntityImageClass(dotStringFactory.getGraphvizVersion(), ent,
318 dotData.getSkinParam(), dotData);
319 final double w = im.calculateDimension(stringBounder).getWidth();
320 if (w > result) {
321 result = w;
322 }
323 }
324 return result;
325 }
326
327 public static IEntityImage createEntityImageBlock(ILeaf leaf, ISkinParam skinParam,
328 boolean isHideEmptyDescriptionForState, PortionShower portionShower, Bibliotekon bibliotekon,
329 GraphvizVersion graphvizVersion, UmlDiagramType umlDiagramType, Collection<Link> links) {
330 if (leaf.isRemoved()) {
331 throw new IllegalStateException();
332 }
333 if (leaf.getLeafType().isLikeClass()) {
334 final EntityImageClass entityImageClass = new EntityImageClass(graphvizVersion, (ILeaf) leaf, skinParam,
335 portionShower);
336 final Neighborhood neighborhood = leaf.getNeighborhood();
337 if (neighborhood != null) {
338 return new EntityImageProtected(entityImageClass, 20, neighborhood, bibliotekon);
339 }
340 return entityImageClass;
341 }
342 if (leaf.getLeafType() == LeafType.NOTE) {
343 return new EntityImageNote(leaf, skinParam);
344 }
345 if (leaf.getLeafType() == LeafType.ACTIVITY) {
346 return new EntityImageActivity(leaf, skinParam, bibliotekon);
347 }
348 if (leaf.getLeafType() == LeafType.STATE) {
349 if (leaf.getEntityPosition() != EntityPosition.NORMAL) {
350 final Cluster stateParent = bibliotekon.getCluster(leaf.getParentContainer());
351 return new EntityImageStateBorder(leaf, skinParam, stateParent, bibliotekon);
352 }
353 if (isHideEmptyDescriptionForState && leaf.getBodier().getFieldsToDisplay().size() == 0) {
354 return new EntityImageStateEmptyDescription(leaf, skinParam);
355 }
356 if (leaf.getStereotype() != null && "<<sdlreceive>>".equals(leaf.getStereotype().getLabel(false))) {
357 return new EntityImageState2(leaf, skinParam);
358 }
359 return new EntityImageState(leaf, skinParam);
360
361 }
362 if (leaf.getLeafType() == LeafType.CIRCLE_START) {
363 ColorParam param = ColorParam.activityStart;
364 if (umlDiagramType == UmlDiagramType.STATE) {
365 param = ColorParam.stateStart;
366 }
367 return new EntityImageCircleStart(leaf, skinParam, param);
368 }
369 if (leaf.getLeafType() == LeafType.CIRCLE_END) {
370 ColorParam param = ColorParam.activityEnd;
371 if (umlDiagramType == UmlDiagramType.STATE) {
372 param = ColorParam.stateEnd;
373 }
374 return new EntityImageCircleEnd(leaf, skinParam, param);
375 }
376 if (leaf.getLeafType() == LeafType.BRANCH || leaf.getLeafType() == LeafType.STATE_CHOICE) {
377 return new EntityImageBranch(leaf, skinParam);
378 }
379 if (leaf.getLeafType() == LeafType.LOLLIPOP) {
380 return new EntityImageLollipopInterface(leaf, skinParam);
381 }
382 if (leaf.getLeafType() == LeafType.CIRCLE) {
383 return new EntityImageDescription(leaf, skinParam, portionShower, links);
384 }
385
386 if (leaf.getLeafType() == LeafType.DESCRIPTION) {
387 if (OptionFlags.USE_INTERFACE_EYE1 && leaf.getUSymbol() instanceof USymbolInterface) {
388 return new EntityImageLollipopInterfaceEye1(leaf, skinParam, bibliotekon);
389 } else if (OptionFlags.USE_INTERFACE_EYE2 && leaf.getUSymbol() instanceof USymbolInterface) {
390 return new EntityImageLollipopInterfaceEye2(leaf, skinParam, portionShower);
391 } else {
392 return new EntityImageDescription(leaf, skinParam, portionShower, links);
393 }
394 }
395 if (leaf.getLeafType() == LeafType.USECASE) {
396 return new EntityImageUseCase(leaf, skinParam, portionShower);
397 }
398 // if (leaf.getEntityType() == LeafType.CIRCLE_INTERFACE) {
399 // return new EntityImageCircleInterface(leaf, skinParam);
400 // }
401 if (leaf.getLeafType() == LeafType.OBJECT) {
402 return new EntityImageObject(leaf, skinParam, portionShower);
403 }
404 if (leaf.getLeafType() == LeafType.SYNCHRO_BAR || leaf.getLeafType() == LeafType.STATE_FORK_JOIN) {
405 return new EntityImageSynchroBar(leaf, skinParam);
406 }
407 if (leaf.getLeafType() == LeafType.ARC_CIRCLE) {
408 return new EntityImageArcCircle(leaf, skinParam);
409 }
410 if (leaf.getLeafType() == LeafType.POINT_FOR_ASSOCIATION) {
411 return new EntityImageAssociationPoint(leaf, skinParam);
412 }
413 if (leaf.isGroup()) {
414 return new EntityImageGroup(leaf, skinParam);
415 }
416 if (leaf.getLeafType() == LeafType.EMPTY_PACKAGE) {
417 if (leaf.getUSymbol() != null) {
418 // final HtmlColor black = HtmlColorUtils.BLACK;
419 final HtmlColor black = SkinParamUtils.getColor(skinParam, leaf.getUSymbol().getColorParamBorder(),
420 leaf.getStereotype());
421 return new EntityImageDescription(leaf, new SkinParamForecolored(skinParam, black), portionShower,
422 links);
423 }
424 return new EntityImageEmptyPackage(leaf, skinParam, portionShower);
425 }
426 if (leaf.getLeafType() == LeafType.ASSOCIATION) {
427 return new EntityImageAssociation(leaf, skinParam);
428 }
429 if (leaf.getLeafType() == LeafType.PSEUDO_STATE) {
430 return new EntityImagePseudoState(leaf, skinParam);
431 }
432 if (leaf.getLeafType() == LeafType.TIPS) {
433 return new EntityImageTips(leaf, skinParam, bibliotekon);
434 }
435 // TODO Clean
436 if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
437 && leaf.getStereotype().isMachineOrSpecification()) {
438 return new EntityImageMachine(leaf, skinParam);
439 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
440 && leaf.getStereotype().isDesignedOrSolved()) {
441 return new EntityImageDesignedDomain(leaf, skinParam);
442 } else if (leaf.getLeafType() == LeafType.REQUIREMENT) {
443 return new EntityImageRequirement(leaf, skinParam);
444 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
445 && leaf.getStereotype().isLexicalOrGiven()) {
446 return new EntityImageDomain(leaf, skinParam, 'X');
447 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
448 && leaf.getStereotype().isCausal()) {
449 return new EntityImageDomain(leaf, skinParam, 'C');
450 } else if (leaf.getLeafType() == LeafType.DOMAIN && leaf.getStereotype() != null
451 && leaf.getStereotype().isBiddableOrUncertain()) {
452 return new EntityImageDomain(leaf, skinParam, 'B');
453 } else if (leaf.getLeafType() == LeafType.DOMAIN) {
454 return new EntityImageDomain(leaf, skinParam, 'P');
455 } else
456 throw new UnsupportedOperationException(leaf.getLeafType().toString());
457 }
458
459 private Collection<ILeaf> getUnpackagedEntities() {
460 final List<ILeaf> result = new ArrayList<ILeaf>();
461 for (ILeaf ent : dotData.getLeafs()) {
462 if (dotData.getTopParent() == ent.getParentContainer()) {
463 result.add(ent);
464 }
465 }
466 return result;
467 }
468
469 private void printGroups(DotStringFactory dotStringFactory, IGroup parent) {
470 for (IGroup g : dotData.getGroupHierarchy().getChildrenGroups(parent)) {
471 if (g.isRemoved()) {
472 continue;
473 }
474 if (dotData.isEmpty(g) && g.getGroupType() == GroupType.PACKAGE) {
475 final ILeaf folder = entityFactory.createLeaf(g.getCode(), g.getDisplay(), LeafType.EMPTY_PACKAGE,
476 g.getParentContainer(), null, dotData.getNamespaceSeparator());
477 final USymbol symbol = g.getUSymbol();
478 folder.setUSymbol(symbol);
479 folder.setStereotype(g.getStereotype());
480 if (g.getUrl99() != null) {
481 folder.addUrl(g.getUrl99());
482 }
483 if (g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK) == null) {
484 final ColorParam param = symbol == null ? ColorParam.packageBackground : symbol.getColorParamBack();
485 final HtmlColor c1 = dotData.getSkinParam().getHtmlColor(param, g.getStereotype(), false);
486 folder.setSpecificColorTOBEREMOVED(ColorType.BACK, c1 == null ? dotData.getSkinParam()
487 .getBackgroundColor() : c1);
488 } else {
489 folder.setSpecificColorTOBEREMOVED(ColorType.BACK,
490 g.getColors(dotData.getSkinParam()).getColor(ColorType.BACK));
491 }
492 printEntity(dotStringFactory, folder);
493 } else {
494 printGroup(dotStringFactory, g);
495 }
496 }
497 }
498
499 private void printGroup(DotStringFactory dotStringFactory, IGroup g) {
500 if (g.getGroupType() == GroupType.CONCURRENT_STATE) {
501 return;
502 }
503 int titleAndAttributeWidth = 0;
504 int titleAndAttributeHeight = 0;
505
506 final TextBlock title = getTitleBlock(g);
507 final TextBlock stereo = getStereoBlock(g);
508 final TextBlock stereoAndTitle = TextBlockUtils.mergeTB(stereo, title, HorizontalAlignment.CENTER);
509 final Dimension2D dimLabel = stereoAndTitle.calculateDimension(stringBounder);
510 if (dimLabel.getWidth() > 0) {
511 final List<Member> members = ((IEntity) g).getBodier().getFieldsToDisplay();
512 final TextBlockWidth attribute;
513 if (members.size() == 0) {
514 attribute = new TextBlockEmpty();
515 } else {
516 attribute = new MethodsOrFieldsArea(members, FontParam.STATE_ATTRIBUTE, dotData.getSkinParam(),
517 g.getStereotype(), null);
518 }
519 final Dimension2D dimAttribute = attribute.calculateDimension(stringBounder);
520 final double attributeHeight = dimAttribute.getHeight();
521 final double attributeWidth = dimAttribute.getWidth();
522 final double marginForFields = attributeHeight > 0 ? IEntityImage.MARGIN : 0;
523 final USymbol uSymbol = g.getUSymbol();
524 final int suppHeightBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppHeightBecauseOfShape();
525 final int suppWidthBecauseOfShape = uSymbol == null ? 0 : uSymbol.suppWidthBecauseOfShape();
526
527 titleAndAttributeWidth = (int) Math.max(dimLabel.getWidth(), attributeWidth) + suppWidthBecauseOfShape;
528 titleAndAttributeHeight = (int) (dimLabel.getHeight() + attributeHeight + marginForFields + suppHeightBecauseOfShape);
529 }
530
531 dotStringFactory.openCluster(g, titleAndAttributeWidth, titleAndAttributeHeight, title, stereo);
532 this.printEntities(dotStringFactory, g.getLeafsDirect());
533
534 printGroups(dotStringFactory, g);
535
536 dotStringFactory.closeCluster();
537 }
538
539 private TextBlock getTitleBlock(IGroup g) {
540 final Display label = g.getDisplay();
541 if (label == null) {
542 return TextBlockUtils.empty(0, 0);
543 }
544
545 final ISkinParam skinParam = dotData.getSkinParam();
546 final FontConfiguration fontConfiguration = g.getFontConfigurationForTitle(skinParam);
547 return label.create(fontConfiguration, HorizontalAlignment.CENTER, skinParam);
548 }
549
550 private TextBlock getStereoBlock(IGroup g) {
551 final Stereotype stereotype = g.getStereotype();
552 if (stereotype == null) {
553 return TextBlockUtils.empty(0, 0);
554 }
555 if (stereotype.getSprite() != null) {
556 final Sprite tmp = dotData.getSkinParam().getSprite(stereotype.getSprite());
557 if (tmp != null) {
558 return tmp.asTextBlock(stereotype.getHtmlColor(), 1);
559 }
560 }
561 final List<String> stereos = stereotype.getLabels(dotData.getSkinParam().useGuillemet());
562 if (stereos == null) {
563 return TextBlockUtils.empty(0, 0);
564 }
565 final boolean show = dotData.showPortion(EntityPortion.STEREOTYPE, g);
566 if (show == false) {
567 return TextBlockUtils.empty(0, 0);
568 }
569
570 final FontParam fontParam = FontParam.PACKAGE_STEREOTYPE;
571 return Display.create(stereos).create(new FontConfiguration(dotData.getSkinParam(), fontParam, stereotype),
572 HorizontalAlignment.CENTER, dotData.getSkinParam());
573 }
574
575 public String getWarningOrError(int warningOrError) {
576 if (maxX == null) {
577 return "";
578 }
579 final StringBuilder sb = new StringBuilder();
580 for (Map.Entry<Code, Double> ent : maxX.entrySet()) {
581 if (ent.getValue() > warningOrError) {
582 sb.append(ent.getKey() + " is overpassing the width limit.");
583 sb.append("\n");
584 }
585 }
586 return sb.length() == 0 ? "" : sb.toString();
587 }
588 }
3434 */
3535 package net.sourceforge.plantuml.svek;
3636
37 import java.awt.Color;
3738 import java.awt.geom.Dimension2D;
3839 import java.awt.image.BufferedImage;
3940 import java.util.ArrayList;
6869 public GraphvizCrash(String text) {
6970 this.text = text;
7071 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
71 this.flashCode = utils.exportFlashcode(text);
72 this.flashCode = utils.exportFlashcode(text, Color.BLACK, Color.WHITE);
7273 this.graphicStrings = GraphicStrings.createBlackOnWhite(init(), IconLoader.getRandom(),
7374 GraphicPosition.BACKGROUND_CORNER_TOP_RIGHT);
7475 }
149150
150151 public static void addDecodeHint(final List<String> strings) {
151152 strings.add(" ");
152 strings.add(" Diagram source: (Use http://zxing.org/w/decode.jspx to decode the flashcode)");
153 strings.add(" Diagram source: (Use http://zxing.org/w/decode.jspx to decode the qrcode)");
153154 }
154155
155156 public static void addProperties(final List<String> strings) {
115115 skinParam, new InnerGroupHierarchy(), diagram.getColorMapper(), diagram.getEntityFactory(), false,
116116 DotMode.NORMAL, diagram.getNamespaceSeparator(), diagram.getPragma());
117117
118 final DotDataImageBuilder svek2 = new DotDataImageBuilder(dotData, diagram.getEntityFactory(),
118 final GeneralImageBuilder svek2 = new GeneralImageBuilder(dotData, diagram.getEntityFactory(),
119119 diagram.getSource(), diagram.getPragma(), stringBounder);
120120
121121 if (group.getGroupType() == GroupType.INNER_ACTIVITY) {
124124 final HtmlColor backColor = group.getColors(skinParam).getColor(ColorType.BACK) == null ? getColor(
125125 ColorParam.background, stereo) : group.getColors(skinParam).getColor(ColorType.BACK);
126126 return new InnerActivity(svek2.buildImage(null, new String[0]), borderColor, backColor,
127 skinParam.shadowing());
127 skinParam.shadowing(group.getStereotype()));
128128 }
129129
130130 throw new UnsupportedOperationException(group.getGroupType().toString());
123123 diagram.isHideEmptyDescriptionForState(), DotMode.NORMAL, diagram.getNamespaceSeparator(),
124124 diagram.getPragma());
125125
126 final DotDataImageBuilder svek2 = new DotDataImageBuilder(dotData, diagram.getEntityFactory(),
126 final GeneralImageBuilder svek2 = new GeneralImageBuilder(dotData, diagram.getEntityFactory(),
127127 diagram.getSource(), diagram.getPragma(), stringBounder);
128128
129129 if (group.getGroupType() == GroupType.CONCURRENT_STATE) {
154154 if (stroke == null) {
155155 stroke = new UStroke(1.5);
156156 }
157 return new InnerStateAutonom(image, title, attribute, borderColor, backColor, skinParam.shadowing(),
158 group.getUrl99(), withSymbol, stroke);
157 return new InnerStateAutonom(image, title, attribute, borderColor, backColor, skinParam.shadowing(group
158 .getStereotype()), group.getUrl99(), withSymbol, stroke);
159159
160160 }
161161
166166 return new TextBlockEmpty();
167167 }
168168 final FontConfiguration fontConfiguration = new FontConfiguration(skinParam, FontParam.STATE_ATTRIBUTE, null);
169 final Display display = details.size() == 1 ? Display.getWithNewlines(details.get(0)) : Display.create(details);
169 Display display = null;
170 for (String s : details) {
171 if (display == null) {
172 display = Display.getWithNewlines(s);
173 } else {
174 display = display.addAll(Display.getWithNewlines(s));
175 }
176 }
177
170178 final TextBlock result = display.create(fontConfiguration, HorizontalAlignment.LEFT, skinParam);
171179 return new TextBlockWidthAdapter(result, 0);
172180
7979 import net.sourceforge.plantuml.posimo.Moveable;
8080 import net.sourceforge.plantuml.posimo.Positionable;
8181 import net.sourceforge.plantuml.posimo.PositionableUtils;
82 import net.sourceforge.plantuml.skin.VisibilityModifier;
83 import net.sourceforge.plantuml.skin.rose.Rose;
8284 import net.sourceforge.plantuml.svek.extremity.Extremity;
8385 import net.sourceforge.plantuml.svek.extremity.ExtremityFactory;
8486 import net.sourceforge.plantuml.svek.extremity.ExtremityFactoryExtends;
263265 labelOnly = new DirectionalTextBlock(right, left, up, down);
264266 }
265267 } else {
266 final double marginLabel = startUid.equalsId(endUid) ? 6 : 1;
267 final TextBlock label = TextBlockUtils.withMargin(
268 link.getLabel().create(labelFont, skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER),
269 skinParam, skinParam.maxMessageSize()), marginLabel, marginLabel);
268 final TextBlock label = getLineLabel(link, skinParam, labelFont);
270269 if (getLinkArrow() == LinkArrow.NONE) {
271270 labelOnly = label;
272271 } else {
325324 skinParam);
326325 }
327326
327 }
328
329 private TextBlock getLineLabel(Link link, ISkinParam skinParam, FontConfiguration labelFont) {
330 final double marginLabel = startUid.equalsId(endUid) ? 6 : 1;
331 TextBlock label = link.getLabel().create(labelFont,
332 skinParam.getDefaultTextAlignment(HorizontalAlignment.CENTER), skinParam, skinParam.maxMessageSize());
333 final VisibilityModifier visibilityModifier = link.getVisibilityModifier();
334 if (visibilityModifier != null) {
335 final Rose rose = new Rose();
336 // final HtmlColor back = visibilityModifier.getBackground() == null ? null : rose.getHtmlColor(skinParam,
337 // visibilityModifier.getBackground());
338 final HtmlColor fore = rose.getHtmlColor(skinParam, visibilityModifier.getForeground());
339 TextBlock visibility = visibilityModifier.getUBlock(skinParam.classAttributeIconSize(), fore, null, false);
340 visibility = TextBlockUtils.withMargin(visibility, 0, 1, 2, 0);
341 label = TextBlockUtils.mergeLR(visibility, label, VerticalAlignment.CENTER);
342 }
343 label = TextBlockUtils.withMargin(label, marginLabel, marginLabel);
344 return label;
328345 }
329346
330347 public boolean hasNoteLabelText() {
5757
5858 public RoundedContainer(Dimension2D dim, double titleHeight, double attributeHeight, HtmlColor borderColor,
5959 HtmlColor backColor, HtmlColor imgBackcolor, UStroke stroke) {
60 if (dim.getWidth() == 0) {
61 throw new IllegalArgumentException();
62 }
6063 this.dim = dim;
6164 this.imgBackcolor = imgBackcolor;
6265 this.titleHeight = titleHeight;
104104 private UGraphic drawOctagon(UGraphic ug) {
105105 final Shape shape = bibliotekon.getShape(getEntity());
106106 final Shadowable octagon = shape.getOctagon();
107 if (getSkinParam().shadowing()) {
107 if (getSkinParam().shadowing(getEntity().getStereotype())) {
108108 octagon.setDeltaShadow(4);
109109 }
110110 ug = applyColors(ug);
121121 final double widthTotal = dimTotal.getWidth();
122122 final double heightTotal = dimTotal.getHeight();
123123 final Shadowable rect = new URectangle(widthTotal, heightTotal, CORNER, CORNER);
124 if (getSkinParam().shadowing()) {
124 if (getSkinParam().shadowing(getEntity().getStereotype())) {
125125 rect.setDeltaShadow(4);
126126 }
127127
6464
6565 final public void drawU(UGraphic ug) {
6666 final UPolygon diams = new UPolygon();
67 if (getSkinParam().shadowing()) {
67 if (getSkinParam().shadowing(getEntity().getStereotype())) {
6868 diams.setDeltaShadow(5);
6969 }
7070 diams.addPoint(SIZE, 0);
6464
6565 final public void drawU(UGraphic ug) {
6666 final UPolygon diams = new UPolygon();
67 if (getSkinParam().shadowing()) {
67 if (getSkinParam().shadowing(getEntity().getStereotype())) {
6868 diams.setDeltaShadow(5);
6969 }
7070 diams.addPoint(SIZE, 0);
6767
6868 final public void drawU(UGraphic ug) {
6969 final UEllipse circle = new UEllipse(SIZE, SIZE);
70 if (getSkinParam().shadowing()) {
70 if (getSkinParam().shadowing(getEntity().getStereotype())) {
7171 circle.setDeltaShadow(3);
7272 }
7373 ug.apply(new UChangeBackColor(null))
6565
6666 final public void drawU(UGraphic ug) {
6767 final UEllipse circle = new UEllipse(SIZE, SIZE);
68 if (getSkinParam().shadowing()) {
68 if (getSkinParam().shadowing(getEntity().getStereotype())) {
6969 circle.setDeltaShadow(3);
7070 }
7171 ug.apply(new UChangeBackColor(SkinParamUtils.getColor(getSkinParam(), colorParam, getStereo())))
141141 final double heightTotal = dimTotal.getHeight();
142142 final Shadowable rect = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner, getEntity().getCode()
143143 .getFullName());
144 if (getSkinParam().shadowing()) {
144 if (getSkinParam().shadowing(getEntity().getStereotype())) {
145145 rect.setDeltaShadow(4);
146146 }
147147
164164 headerBackcolor = getSkinParam().getHtmlColor(ColorParam.classHeaderBackground, getStereo(), false);
165165 }
166166 UGraphic ugHeader = ug;
167 if (headerBackcolor != null) {
168 final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight());
167 if (headerBackcolor != null && roundCorner == 0) {
168 final Shadowable rect2 = new URectangle(widthTotal, dimHeader.getHeight(), roundCorner, roundCorner);
169169 ugHeader = ugHeader.apply(new UChangeBackColor(headerBackcolor));
170170 ugHeader.apply(stroke).draw(rect2);
171171 }
5555 import net.sourceforge.plantuml.graphic.FontConfiguration;
5656 import net.sourceforge.plantuml.graphic.HorizontalAlignment;
5757 import net.sourceforge.plantuml.graphic.HtmlColor;
58 import net.sourceforge.plantuml.graphic.SkinParameter;
5859 import net.sourceforge.plantuml.graphic.StringBounder;
5960 import net.sourceforge.plantuml.graphic.SymbolContext;
6061 import net.sourceforge.plantuml.graphic.TextBlock;
8889 private final boolean hideText;
8990 private final Collection<Link> links;
9091 private final boolean useRankSame;
92 private final boolean fixCircleLabelOverlapping;
9193
9294 public EntityImageDescription(ILeaf entity, ISkinParam skinParam, PortionShower portionShower,
9395 Collection<Link> links) {
9496 super(entity, entity.getColors(skinParam).mute(skinParam));
9597 this.useRankSame = skinParam.useRankSame();
98 this.fixCircleLabelOverlapping = skinParam.fixCircleLabelOverlapping();
9699
97100 this.links = links;
98101 final Stereotype stereotype = entity.getStereotype();
100103 if (symbol == USymbol.FOLDER) {
101104 this.shapeType = ShapeType.FOLDER;
102105 } else if (symbol == USymbol.INTERFACE) {
103 this.shapeType = ShapeType.RECTANGLE;
104 // this.shapeType = ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE;
106 this.shapeType = skinParam.fixCircleLabelOverlapping() ? ShapeType.RECTANGLE_WITH_CIRCLE_INSIDE
107 : ShapeType.RECTANGLE;
105108 } else {
106109 this.shapeType = ShapeType.RECTANGLE;
107110 }
108111 this.hideText = symbol == USymbol.INTERFACE;
109112
110113 final Display codeDisplay = Display.getWithNewlines(entity.getCode());
111 desc = (entity.getDisplay().equals(codeDisplay) && symbol instanceof USymbolFolder)
114 desc = (entity.getDisplay().equals(codeDisplay) && symbol.getSkinParameter() == SkinParameter.PACKAGE)
112115 || entity.getDisplay().isWhite() ? TextBlockUtils.empty(0, 0) : new BodyEnhanced(entity.getDisplay(),
113116 symbol.getFontParam(), getSkinParam(), HorizontalAlignment.LEFT, stereotype,
114117 symbol.manageHorizontalLine(), false, entity);
128131 final UStroke stroke = colors.muteStroke(symbol.getSkinParameter().getStroke(getSkinParam(), stereotype));
129132
130133 final SymbolContext ctx = new SymbolContext(backcolor, forecolor).withStroke(stroke)
131 .withShadow(getSkinParam().shadowing2(symbol.getSkinParameter()))
134 .withShadow(getSkinParam().shadowing2(getEntity().getStereotype(), symbol.getSkinParameter()))
132135 .withCorner(roundCorner, diagonalCorner);
133136
134137 stereo = TextBlockUtils.empty(0, 0);
186189 if (isThereADoubleLink((ILeaf) getEntity(), links)) {
187190 return Margins.NONE;
188191 }
189 if (hasSomeHorizontalLinkVisible((ILeaf) getEntity(), links)) {
192 if (fixCircleLabelOverlapping == false && hasSomeHorizontalLinkVisible((ILeaf) getEntity(), links)) {
190193 return Margins.NONE;
191194 }
192195 if (hasSomeHorizontalLinkDoubleDecorated((ILeaf) getEntity(), links)) {
128128 stereoBlock, 0, 0, widthTotal, heightTotal, getStroke());
129129
130130 decoration.drawU(ug, back, SkinParamUtils.getColor(getSkinParam(), ColorParam.packageBorder, getStereo()),
131 getSkinParam().shadowing(), roundCorner,
132 getSkinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null));
131 getSkinParam().shadowing(getEntity().getStereotype()), roundCorner,
132 getSkinParam().getHorizontalAlignment(AlignmentParam.packageTitleAlignment, null, false));
133133
134134 if (url != null) {
135135 ug.closeAction();
7878
7979 final public void drawU(UGraphic ug) {
8080 final UEllipse circle = new UEllipse(SIZE, SIZE);
81 if (getSkinParam().shadowing()) {
81 if (getSkinParam().shadowing(getEntity().getStereotype())) {
8282 circle.setDeltaShadow(4);
8383 }
8484 ug = ug.apply(
9292 final double sizeSmall = 14;
9393 final double diff = (SIZE - sizeSmall) / 2;
9494 final UEllipse circle1 = new UEllipse(sizeSmall, sizeSmall);
95 if (getSkinParam().shadowing()) {
95 if (getSkinParam().shadowing(getEntity().getStereotype())) {
9696 // circle.setDeltaShadow(4);
9797 }
9898 ug.apply(new UStroke(1.5)).apply(new UTranslate(diff, diff)).draw(circle1);
9292 // backcolor = HtmlColorUtils.BLUE;
9393 final HtmlColor forecolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBorder(), getStereo());
9494 this.ctx = new SymbolContext(backcolor, forecolor).withStroke(new UStroke(1.5)).withShadow(
95 getSkinParam().shadowing());
95 getSkinParam().shadowing(getEntity().getStereotype()));
9696
9797 if (stereotype != null && stereotype.getLabel(false) != null
9898 && portionShower.showPortion(EntityPortion.STEREOTYPE, entity)) {
114114 ug.startUrl(url);
115115 }
116116 final UEllipse circle = new UEllipse(SIZE, SIZE);
117 if (getSkinParam().shadowing()) {
117 if (getSkinParam().shadowing(getEntity().getStereotype())) {
118118 circle.setDeltaShadow(4);
119119 }
120120 ctx.apply(ug).draw(circle);
9393 super(entity, getSkin(getISkinParam(skinParam, entity), entity));
9494 this.skinParam = getISkinParam(skinParam, entity);
9595
96 this.withShadow = getSkinParam().shadowing();
96 this.withShadow = getSkinParam().shadowing(getEntity().getStereotype());
9797 final Display strings = entity.getDisplay();
9898
9999 final Rose rose = new Rose();
208208 final Point2D newRefpp2 = move(pp2, shape.getMinX(), shape.getMinY());
209209 final Point2D projection = move(other.projection(newRefpp2, stringBounder), -shape.getMinX(),
210210 -shape.getMinY());
211 final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
211 final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(getEntity().getStereotype()), true);
212212 opale.setRoundCorner(getRoundCorner());
213213 opale.setOpale(strategy, pp1, projection);
214214 final UGraphic stroked = applyStroke(ug2);
132132 final double widthTotal = dimTotal.getWidth();
133133 final double heightTotal = dimTotal.getHeight();
134134 final Shadowable rect = new URectangle(widthTotal, heightTotal, roundCorner, roundCorner);
135 if (getSkinParam().shadowing()) {
135 if (getSkinParam().shadowing(getEntity().getStereotype())) {
136136 rect.setDeltaShadow(4);
137137 }
138138
7676
7777 final public void drawU(UGraphic ug) {
7878 final UEllipse circle = new UEllipse(SIZE, SIZE);
79 if (getSkinParam().shadowing()) {
79 if (getSkinParam().shadowing(getEntity().getStereotype())) {
8080 circle.setDeltaShadow(4);
8181 }
8282 ug = ug.apply(new UStroke(1.5));
4343 import net.sourceforge.plantuml.LineConfigurable;
4444 import net.sourceforge.plantuml.SkinParamUtils;
4545 import net.sourceforge.plantuml.Url;
46 import net.sourceforge.plantuml.creole.CreoleMode;
4647 import net.sourceforge.plantuml.cucadiagram.Display;
4748 import net.sourceforge.plantuml.cucadiagram.IEntity;
4849 import net.sourceforge.plantuml.cucadiagram.Member;
9091 this.withSymbol = stereotype != null && stereotype.isWithOOSymbol();
9192
9293 this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
93 HorizontalAlignment.CENTER, skinParam);
94 HorizontalAlignment.CENTER, skinParam, CreoleMode.FULL, skinParam.wrapWidth());
9495
9596 Display list = Display.empty();
9697 for (Member att : entity.getBodier().getFieldsToDisplay()) {
126127 final double widthTotal = dimTotal.getWidth();
127128 final double heightTotal = dimTotal.getHeight();
128129 final Shadowable rect = new URectangle(widthTotal, heightTotal, CORNER, CORNER);
129 if (getSkinParam().shadowing()) {
130 if (getSkinParam().shadowing(getEntity().getStereotype())) {
130131 rect.setDeltaShadow(4);
131132 }
132133
8686 final HtmlColor forecolor = SkinParamUtils.getColor(getSkinParam(), symbol.getColorParamBorder(), getStereo());
8787
8888 final SymbolContext ctx = new SymbolContext(backcolor, forecolor).withStroke(new UStroke(1.5)).withShadow(
89 getSkinParam().shadowing());
89 getSkinParam().shadowing(getEntity().getStereotype()));
9090
9191 this.url = entity.getUrl99();
9292 TextBlock stereo = TextBlockUtils.empty(0, 0);
4242 import net.sourceforge.plantuml.ISkinParam;
4343 import net.sourceforge.plantuml.SkinParamUtils;
4444 import net.sourceforge.plantuml.Url;
45 import net.sourceforge.plantuml.creole.CreoleMode;
4546 import net.sourceforge.plantuml.cucadiagram.Display;
4647 import net.sourceforge.plantuml.cucadiagram.IEntity;
4748 import net.sourceforge.plantuml.cucadiagram.Member;
7576 final Stereotype stereotype = entity.getStereotype();
7677
7778 this.desc = entity.getDisplay().create(new FontConfiguration(getSkinParam(), FontParam.STATE, stereotype),
78 HorizontalAlignment.CENTER, skinParam);
79 HorizontalAlignment.CENTER, skinParam, CreoleMode.FULL, skinParam.wrapWidth());
7980
8081 Display list = Display.empty();
8182 for (Member att : entity.getBodier().getFieldsToDisplay()) {
103104 final double widthTotal = dimTotal.getWidth();
104105 final double heightTotal = dimTotal.getHeight();
105106 final Shadowable rect = new URectangle(widthTotal, heightTotal, CORNER, CORNER);
106 if (getSkinParam().shadowing()) {
107 if (getSkinParam().shadowing(getEntity().getStereotype())) {
107108 rect.setDeltaShadow(4);
108109 }
109110
6767 final public void drawU(UGraphic ug) {
6868 final Dimension2D dim = calculateDimension(ug.getStringBounder());
6969 final Shadowable rect = new URectangle(dim.getWidth(), dim.getHeight());
70 if (getSkinParam().shadowing()) {
70 if (getSkinParam().shadowing(getEntity().getStereotype())) {
7171 rect.setDeltaShadow(4);
7272 }
7373 ug.apply(new UChangeColor(null))
162162 // final UFont fontNote = skinParam.getFont(FontParam.NOTE, null, false);
163163 final TextBlock textBlock = new BodyEnhanced2(display, FontParam.NOTE, skinParam, HorizontalAlignment.LEFT,
164164 new FontConfiguration(skinParam, FontParam.NOTE, null), LineBreakStrategy.NONE);
165 final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(), true);
165 final Opale opale = new Opale(borderColor, noteBackgroundColor, textBlock, skinParam.shadowing(getEntity().getStereotype()), true);
166166 return opale;
167167 }
168168
111111 final public void drawU(UGraphic ug) {
112112 final StringBounder stringBounder = ug.getStringBounder();
113113 final TextBlockInEllipse ellipse = new TextBlockInEllipse(desc, stringBounder);
114 if (getSkinParam().shadowing2(SkinParameter.USECASE)) {
114 if (getSkinParam().shadowing2(getEntity().getStereotype(), SkinParameter.USECASE)) {
115115 ellipse.setDeltaShadow(3);
116116 }
117117
5757 import javax.xml.transform.stream.StreamResult;
5858
5959 import net.sourceforge.plantuml.Log;
60 import net.sourceforge.plantuml.OptionFlags;
6061 import net.sourceforge.plantuml.StringUtils;
6162 import net.sourceforge.plantuml.SvgString;
6263 import net.sourceforge.plantuml.code.Base64Coder;
313314 public void openLink(String url, String title, String target) {
314315 if (url == null) {
315316 throw new IllegalArgumentException();
317 }
318 if (OptionFlags.ALLOW_INCLUDE == false && url.toLowerCase().startsWith("javascript")) {
319 return;
316320 }
317321
318322 if (pendingAction.size() > 0) {
7070 this.setTitle("Licence PlantUML (" + Version.versionString() + ")");
7171
7272 getContentPane().add(getNorthLabel(), BorderLayout.NORTH);
73 final List<String> list = new ArrayList<String>(License.getCurrent().getText());
73 final List<String> list = new ArrayList<String>(License.getCurrent().getText(false));
7474 getContentPane().add(getJComponent(list), BorderLayout.CENTER);
7575 getContentPane().add(getSouthLabel(), BorderLayout.SOUTH);
7676
7979 type.add("package");
8080 type.add("queue");
8181 type.add("archimate");
82 type.add("diamond");
8283
8384 keyword.add("@startuml");
8485 keyword.add("@enduml");
150151 keyword.add("again");
151152 keyword.add("kill");
152153 keyword.add("order");
154 keyword.add("allow_mixing");
155 keyword.add("allowmixing");
156 keyword.add("mainframe");
153157
154158 preproc.add("!exit");
155159 preproc.add("!include");
6767
6868 if (source.startsWith("@startuml\n") == false) {
6969 result.setError(true);
70 result.setLineLocation(new LineLocationImpl(null, null).oneLineRead());
70 result.setLineLocation(new LineLocationImpl("", null).oneLineRead());
7171 // result.setErrorLinePosition(0);
7272 result.addErrorText("No @startuml found");
7373 // result.setSuggest(Arrays.asList("Did you mean:", "@startuml"));
160160 }
161161
162162 private static LineLocation lastLineNumber2(String source) {
163 LineLocationImpl result = new LineLocationImpl(null, null).oneLineRead();
163 LineLocationImpl result = new LineLocationImpl("", null).oneLineRead();
164164 for (int i = 0; i < source.length(); i++) {
165165 if (source.charAt(i) == '\n') {
166166 result = result.oneLineRead();
317317 addCommand(sb);
318318 }
319319
320 public void appendRaw(double x, double y, String formula) {
321 final StringBuilder sb = new StringBuilder("\\node at " + couple(x, y));
322 sb.append("[below right");
323 sb.append("]{");
324 sb.append("{");
325 sb.append(formula);
326 sb.append("}");
327 sb.append("};");
328 addCommand(sb);
329 }
330
320331 private void appendPendingUrl(final StringBuilder sb) {
321332 if (Url.isLatex(pendingUrl)) {
322333 sb.append("\\hyperref[");
230230 }
231231
232232 private FontConfiguration getFontConfiguration() {
233 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
233 return new FontConfiguration(skinParam, FontParam.TIMING, null);
234234 }
235235
236236 private TextBlock getTextBlock(String value) {
8484 }
8585
8686 private FontConfiguration getFontConfiguration() {
87 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
87 return new FontConfiguration(skinParam, FontParam.TIMING, null);
8888 }
8989
9090 public void drawU(UGraphic ug) {
9292 }
9393
9494 private FontConfiguration getFontConfiguration() {
95 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
95 return new FontConfiguration(skinParam, FontParam.TIMING, null);
9696 }
9797
9898 private TextBlock createTextBlock(String value) {
9191 }
9292
9393 private FontConfiguration getFontConfiguration() {
94 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
94 return new FontConfiguration(skinParam, FontParam.TIMING, null);
9595 }
9696
9797 private TextBlock createTextBlock(String value) {
8989 }
9090
9191 private FontConfiguration getFontConfiguration() {
92 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
92 return new FontConfiguration(skinParam, FontParam.TIMING, null);
9393 }
9494
9595 private TextBlock getTextBlock(String value) {
9595
9696 TextBlock result = getTextBlock();
9797 final ISkinParam skinParam = getSkinParam();
98 result = new AnnotatedWorker(this, skinParam).addAdd(result);
98 result = new AnnotatedWorker(this, skinParam, fileFormatOption.getDefaultStringBounder()).addAdd(result);
9999 imageBuilder.setUDrawable(result);
100100
101101 return imageBuilder.writeImageTOBEMOVED(fileFormatOption, seed(), os);
3838 import java.util.List;
3939
4040 import net.sourceforge.plantuml.command.Command;
41 import net.sourceforge.plantuml.command.CommandFootboxIgnored;
4142 import net.sourceforge.plantuml.command.UmlDiagramFactory;
4243
4344 public class TimingDiagramFactory extends UmlDiagramFactory {
5354 final List<Command> cmds = new ArrayList<Command>();
5455
5556 addCommonCommands(cmds);
56
57 cmds.add(new CommandFootboxIgnored());
5758 cmds.add(new CommandLifeLine());
5859 cmds.add(new CommandDefineStateShort());
5960 cmds.add(new CommandDefineStateLong());
8383 final Sheet sheet = new CreoleParser(fc, skinParam.getDefaultTextAlignment(HorizontalAlignment.LEFT),
8484 skinParam, CreoleMode.FULL).createSheet(note);
8585 final SheetBlock1 sheet1 = new SheetBlock1(sheet, LineBreakStrategy.NONE, skinParam.getPadding());
86 final Opale opale = new Opale(borderColor, noteBackgroundColor, sheet1, skinParam.shadowing(), false);
86 final Opale opale = new Opale(borderColor, noteBackgroundColor, sheet1, skinParam.shadowing(null), false);
8787 return opale;
8888 }
8989
114114 }
115115
116116 private FontConfiguration getFontConfiguration() {
117 return new FontConfiguration(skinParam, FontParam.ACTIVITY, null);
117 return new FontConfiguration(skinParam, FontParam.TIMING, null);
118118 }
119119
120120 private TextBlock getTimeTextBlock(long time) {
4545 if (change instanceof UTranslate) {
4646 result = copy(getUg());
4747 result.translate = this.translate.compose((UTranslate) change);
48 } else if (change instanceof UClip) {
49 final UClip clip = ((UClip) change).translate(translate);
50 result = copy(getUg().apply(clip));
51 result.translate = this.translate;
4852 } else {
4953 result = copy(getUg().apply(change));
5054 result.translate = this.translate;
110110 private UStroke borderStroke;
111111 private HtmlColor borderColor;
112112 private double borderCorner;
113
113
114114 private boolean svgDimensionStyle;
115115
116116 public ImageBuilder(ColorMapper colorMapper, double dpiFactor, HtmlColor mybackcolor, String metadata,
393393 }
394394 }
395395
396 private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale,
397 Dimension2D dim, HtmlColor mybackcolor, String svgLinkTarget, String hover, long seed) {
396 private UGraphic2 createUGraphicSVG(ColorMapper colorMapper, double scale, Dimension2D dim, HtmlColor mybackcolor,
397 String svgLinkTarget, String hover, long seed) {
398398 Color backColor = Color.WHITE;
399399 if (mybackcolor instanceof HtmlColorSimple) {
400400 backColor = colorMapper.getMappedColor(mybackcolor);
437437 ug.setBufferedImage(builder.getBufferedImage());
438438 final BufferedImage im = ((UGraphicG2d) ug).getBufferedImage();
439439 if (mybackcolor instanceof HtmlColorGradient) {
440 ug.apply(new UChangeBackColor(mybackcolor)).draw(new URectangle(im.getWidth(), im.getHeight()));
440 ug.apply(new UChangeBackColor(mybackcolor)).draw(
441 new URectangle(im.getWidth() / dpiFactor, im.getHeight() / dpiFactor));
441442 }
442443
443444 return ug;
141141 }
142142
143143 public void drawGrey(UGraphic ug) {
144 final HtmlColor color = HtmlColorUtils.GRAY;
144 draw(ug, HtmlColorUtils.GRAY);
145 }
146
147 public void draw(UGraphic ug, HtmlColor color) {
145148 ug = ug.apply(new UChangeColor(color)).apply(new UChangeBackColor(color));
146149 ug = ug.apply(new UTranslate(minX, minY));
147150 ug.draw(new URectangle(getWidth(), getHeight()));
5757
5858 public boolean matchesProperty(String propertyName);
5959
60 public double dpiFactor();
6160 }
4141 public class UImage implements UShape {
4242
4343 private final BufferedImage image;
44 private final String formula;
4445
4546 public UImage(BufferedImage image) {
47 this(image, null);
48 }
49
50 public UImage(BufferedImage image, String formula) {
4651 this.image = image;
52 this.formula = formula;
4753 }
4854
4955 public UImage scale(double scale) {
6470 final AffineTransform at = new AffineTransform();
6571 at.scale(scale, scale);
6672 final AffineTransformOp scaleOp = new AffineTransformOp(at, type);
67 return new UImage(scaleOp.filter(image, after));
73 return new UImage(scaleOp.filter(image, after), formula);
6874 }
6975
7076 public final BufferedImage getImage() {
7985 return image.getHeight() - 1;
8086 }
8187
88 public final String getFormula() {
89 return formula;
90 }
8291 }
6060 private final List<Pending> lines;
6161 private final UTranslate translate;
6262
63 public double dpiFactor() {
64 return ug.dpiFactor();
65 }
66
67
6863 static class Pending {
6964 final UGraphic ug;
7065 final LineSegmentDouble segment;
3535 package net.sourceforge.plantuml.ugraphic.g2d;
3636
3737 import java.awt.Graphics2D;
38 import java.awt.geom.AffineTransform;
3938
4039 import net.sourceforge.plantuml.EnsureVisible;
4140 import net.sourceforge.plantuml.ugraphic.ColorMapper;
4847 public class DriverImageG2d implements UDriver<Graphics2D> {
4948
5049 private final EnsureVisible visible;
51 private final double dpiFactor;
50
51 // private final double dpiFactor;
5252
5353 public DriverImageG2d(double dpiFactor, EnsureVisible visible) {
5454 this.visible = visible;
55 this.dpiFactor = dpiFactor;
55 // this.dpiFactor = dpiFactor;
5656 }
5757
5858 public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, Graphics2D g2d) {
6262 final UImage shape = ((UImage) ushape);
6363 visible.ensureVisible(x, y);
6464 visible.ensureVisible(x + shape.getWidth(), y + shape.getHeight());
65 final AffineTransform back = g2d.getTransform();
66 g2d.scale(1 / dpiFactor, 1 / dpiFactor);
67 g2d.drawImage(shape.getImage(), (int) (x * dpiFactor), (int) (y * dpiFactor), null);
68 g2d.setTransform(back);
65 // final AffineTransform back = g2d.getTransform();
66 // System.err.println("dpiFactor=" + dpiFactor);
67 // g2d.scale(1 / dpiFactor, 1 / dpiFactor);
68 g2d.drawImage(shape.getImage(), (int) (x), (int) (y), null);
69 // g2d.setTransform(back);
6970 }
7071
7172 }
3737 import java.awt.geom.Point2D;
3838 import java.util.ArrayList;
3939 import java.util.Collection;
40 import java.util.Random;
4041
4142 import net.sourceforge.plantuml.ugraphic.UPath;
4243 import net.sourceforge.plantuml.ugraphic.UPolygon;
4748 private double startX;
4849 private double startY;
4950 private final double defaultVariation;
51 private final Random rnd;
5052
51 public HandJiggle(double startX, double startY, double defaultVariation) {
53 private double randomMe() {
54 return rnd.nextDouble();
55 }
56
57 public HandJiggle(double startX, double startY, double defaultVariation, Random rnd) {
5258 this.startX = startX;
5359 this.startY = startY;
5460 this.defaultVariation = defaultVariation;
61 this.rnd = rnd;
5562 points.add(new Point2D.Double(startX, startY));
5663 }
5764
58 public HandJiggle(Point2D start, double defaultVariation) {
59 this(start.getX(), start.getY(), defaultVariation);
65 public HandJiggle(Point2D start, double defaultVariation, Random rnd) {
66 this(start.getX(), start.getY(), defaultVariation, rnd);
6067 }
6168
6269 public void lineTo(Point2D end) {
101108 double x = stepX * s + startX;
102109 double y = stepY * s + startY;
103110
104 final double offset = (Math.random() - 0.5) * variation;
111 final double offset = (randomMe() - 0.5) * variation;
105112 points.add(new Point2D.Double(x - offset * fy, y - offset * fx));
106113 }
107114 points.add(new Point2D.Double(endX, endY));
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
3636 import java.awt.geom.CubicCurve2D;
37 import java.util.Random;
3738
3839 import net.sourceforge.plantuml.posimo.DotPath;
3940 import net.sourceforge.plantuml.ugraphic.UPath;
4243
4344 private final UPath path;
4445
45 public UDotPathHand(DotPath source) {
46 public UDotPathHand(DotPath source, Random rnd) {
4647
47 final HandJiggle jiggle = new HandJiggle(source.getStartPoint(), 2.0);
48 final HandJiggle jiggle = new HandJiggle(source.getStartPoint(), 2.0, rnd);
4849 for (CubicCurve2D curve : source.getBeziers()) {
4950 jiggle.curveTo(curve);
5051 }
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
3636 import java.awt.geom.Point2D;
37 import java.util.Random;
3738
3839 import net.sourceforge.plantuml.ugraphic.Shadowable;
3940 import net.sourceforge.plantuml.ugraphic.UEllipse;
4243 public class UEllipseHand {
4344
4445 private Shadowable poly;
46 private final Random rnd;
4547
46 public UEllipseHand(UEllipse source) {
48 private double randomMe() {
49 return rnd.nextDouble();
50 }
4751
52 public UEllipseHand(UEllipse source, Random rnd) {
53 this.rnd = rnd;
4854 if (source.getStart() != 0 || source.getExtend() != 0) {
4955 this.poly = source;
5056 return;
5561 double angle = 0;
5662 if (width == height) {
5763 while (angle < Math.PI * 2) {
58 angle += (10 + Math.random() * 10) * Math.PI / 180;
59 final double variation = 1 + (Math.random() - 0.5) / 8;
64 angle += (10 + randomMe() * 10) * Math.PI / 180;
65 final double variation = 1 + (randomMe() - 0.5) / 8;
6066 final double x = width / 2 + Math.cos(angle) * width * variation / 2;
6167 final double y = height / 2 + Math.sin(angle) * height * variation / 2;
6268 // final Point2D.Double p = new Point2D.Double(x, y);
7783 private Point2D getPoint(double width, double height, double angle) {
7884 final double x = width / 2 + Math.cos(angle) * width / 2;
7985 final double y = height / 2 + Math.sin(angle) * height / 2;
80 final double variation = (Math.random() - 0.5) / 50;
86 final double variation = (randomMe() - 0.5) / 50;
8187 return new Point2D.Double(x + variation * width, y + variation * height);
8288
8389 }
3333 */
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
36 import java.util.Random;
37
3638 import net.sourceforge.plantuml.Url;
3739 import net.sourceforge.plantuml.graphic.StringBounder;
3840 import net.sourceforge.plantuml.posimo.DotPath;
5052 public class UGraphicHandwritten implements UGraphic {
5153
5254 private final UGraphic ug;
53
54 public double dpiFactor() {
55 return ug.dpiFactor();
56 }
55 private final Random rnd = new Random(424242L);
5756
5857 public UGraphicHandwritten(UGraphic ug) {
5958 this.ug = ug;
8887 }
8988
9089 private void drawHand(UPath shape) {
91 final UPathHand uline = new UPathHand(shape);
90 final UPathHand uline = new UPathHand(shape, rnd);
9291 ug.draw(uline.getHanddrawn());
9392 }
9493
9594 private void drawHand(DotPath shape) {
96 final UDotPathHand uline = new UDotPathHand(shape);
95 final UDotPathHand uline = new UDotPathHand(shape, rnd);
9796 ug.draw(uline.getHanddrawn());
9897 }
9998
10099 private void drawHand(UPolygon shape) {
101 final UPolygonHand hand = new UPolygonHand(shape);
100 final UPolygonHand hand = new UPolygonHand(shape, rnd);
102101 ug.draw(hand.getHanddrawn());
103102 }
104103
105104 private void drawHand(URectangle shape) {
106 final URectangleHand hand = new URectangleHand(shape);
105 final URectangleHand hand = new URectangleHand(shape, rnd);
107106 ug.draw(hand.getHanddrawn());
108107 }
109108
110109 private void drawHand(ULine shape) {
111 final ULineHand uline = new ULineHand(shape);
110 final ULineHand uline = new ULineHand(shape, rnd);
112111 ug.draw(uline.getHanddrawn());
113112 }
114113
115114 private void drawHand(UEllipse shape) {
116 final UEllipseHand uline = new UEllipseHand(shape);
115 final UEllipseHand uline = new UEllipseHand(shape, rnd);
117116 ug.draw(uline.getHanddrawn());
118117 }
119118
3333 */
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
36 import java.util.Random;
37
3638 import net.sourceforge.plantuml.ugraphic.ULine;
3739 import net.sourceforge.plantuml.ugraphic.UPath;
3840
4042
4143 private UPath path;
4244
43 public ULineHand(ULine line) {
45 public ULineHand(ULine line, Random rnd) {
4446 final double endX = line.getDX();
4547 final double endY = line.getDY();
46 final HandJiggle jiggle = new HandJiggle(0, 0, 2.0);
48 final HandJiggle jiggle = new HandJiggle(0, 0, 2.0, rnd);
4749 jiggle.lineTo(endX, endY);
4850
4951 this.path = jiggle.toUPath();
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
3636 import java.awt.geom.Point2D;
37 import java.util.Random;
3738
3839 import net.sourceforge.plantuml.ugraphic.UPath;
3940 import net.sourceforge.plantuml.ugraphic.USegment;
4445 private final UPath path;
4546 private final double defaultVariation = 4.0;
4647
47 public UPathHand(UPath source) {
48 public UPathHand(UPath source, Random rnd) {
4849
4950 final UPath jigglePath = new UPath();
5051
6162 } else if (type == USegmentType.SEG_LINETO) {
6263 final double x = segment.getCoord()[0];
6364 final double y = segment.getCoord()[1];
64 final HandJiggle jiggle = new HandJiggle(last.getX(), last.getY(), defaultVariation);
65 final HandJiggle jiggle = new HandJiggle(last.getX(), last.getY(), defaultVariation, rnd);
6566 jiggle.lineTo(x, y);
6667 for (USegment seg2 : jiggle.toUPath()) {
6768 if (seg2.getSegmentType() == USegmentType.SEG_LINETO) {
3535
3636 import java.awt.geom.Point2D;
3737 import java.util.List;
38 import java.util.Random;
3839
3940 import net.sourceforge.plantuml.ugraphic.Shadowable;
4041 import net.sourceforge.plantuml.ugraphic.UPolygon;
4344
4445 private final UPolygon poly;
4546
46 public UPolygonHand(UPolygon source) {
47 public UPolygonHand(UPolygon source, Random rnd) {
4748 final List<Point2D.Double> pt = source.getPoints();
4849 if (pt.size() == 0) {
4950 poly = new UPolygon();
5051 return;
5152 }
52 final HandJiggle jiggle = new HandJiggle(pt.get(0), 1.5);
53 final HandJiggle jiggle = new HandJiggle(pt.get(0), 1.5, rnd);
5354 for (int i = 1; i < pt.size(); i++) {
5455 jiggle.lineTo(pt.get(i));
5556 }
3333 */
3434 package net.sourceforge.plantuml.ugraphic.hand;
3535
36 import java.util.Random;
37
3638 import net.sourceforge.plantuml.ugraphic.Shadowable;
3739 import net.sourceforge.plantuml.ugraphic.UPolygon;
3840 import net.sourceforge.plantuml.ugraphic.URectangle;
4143
4244 final private UPolygon poly;
4345
44 public URectangleHand(URectangle rectangle) {
46 public URectangleHand(URectangle rectangle, Random rnd) {
4547 final double width = rectangle.getWidth();
4648 final double height = rectangle.getHeight();
4749 final HandJiggle jiggle;
4951 final double ry = Math.min(rectangle.getRy() / 2, height / 2);
5052 // System.err.println("rx=" + rx + " ry=" + ry);
5153 if (rx == 0 && ry == 0) {
52 jiggle = new HandJiggle(0, 0, 1.5);
54 jiggle = new HandJiggle(0, 0, 1.5, rnd);
5355 jiggle.lineTo(width, 0);
5456 jiggle.lineTo(width, height);
5557 jiggle.lineTo(0, height);
5658 jiggle.lineTo(0, 0);
5759 } else {
58 jiggle = new HandJiggle(rx, 0, 1.5);
60 jiggle = new HandJiggle(rx, 0, 1.5, rnd);
5961 jiggle.lineTo(width - rx, 0);
6062 jiggle.arcTo(-Math.PI / 2, 0, width - rx, ry, rx, ry);
6163 jiggle.lineTo(width, height - ry);
4444 import net.sourceforge.plantuml.graphic.AbstractTextBlock;
4545 import net.sourceforge.plantuml.graphic.HtmlColor;
4646 import net.sourceforge.plantuml.graphic.HtmlColorGradient;
47 import net.sourceforge.plantuml.graphic.HtmlColorSimple;
4748 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
4849 import net.sourceforge.plantuml.graphic.StringBounder;
4950 import net.sourceforge.plantuml.graphic.TextBlock;
180181 }
181182
182183 public UImage toUImage(ColorMapper colorMapper, HtmlColor backcolor, HtmlColor color) {
183 final BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
184184
185185 if (backcolor == null) {
186186 backcolor = HtmlColorUtils.WHITE;
188188 if (color == null) {
189189 color = HtmlColorUtils.BLACK;
190190 }
191 // if (backcolor instanceof HtmlColorGradient) {
192 // return special(colorMapper, (HtmlColorGradient) backcolor, color);
193 // }
194 final BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
191195 final HtmlColorGradient gradient = new HtmlColorGradient(backcolor, color, '\0');
192196 for (int col = 0; col < width; col++) {
193197 for (int line = 0; line < height; line++) {
199203 return new UImage(im);
200204 }
201205
206 private UImage special(ColorMapper colorMapper, HtmlColorGradient backcolor, HtmlColor color) {
207 final BufferedImage im = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
208 for (int col = 0; col < width; col++) {
209 for (int line = 0; line < height; line++) {
210 final HtmlColor backColorLocal = new HtmlColorSimple(backcolor.getColor(colorMapper, 1.0 * line
211 / height), false);
212 final HtmlColorGradient gradient = new HtmlColorGradient(backColorLocal, color, '\0');
213 final double coef = 1.0 * grey[line][col] / (grayLevel - 1);
214 final Color c = gradient.getColor(colorMapper, coef);
215 im.setRGB(col, line, c.getRGB());
216 }
217 }
218 return new UImage(im);
219 }
220
202221 public TextBlock asTextBlock(final HtmlColor color, final double scale) {
203222 return new AbstractTextBlock() {
204223
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.ugraphic.tikz;
35
36 import net.sourceforge.plantuml.tikz.TikzGraphics;
37 import net.sourceforge.plantuml.ugraphic.ColorMapper;
38 import net.sourceforge.plantuml.ugraphic.UDriver;
39 import net.sourceforge.plantuml.ugraphic.UImage;
40 import net.sourceforge.plantuml.ugraphic.UParam;
41 import net.sourceforge.plantuml.ugraphic.UShape;
42
43 public class DriverImageTikz implements UDriver<TikzGraphics> {
44
45 public void draw(UShape ushape, double x, double y, ColorMapper mapper, UParam param, TikzGraphics tikz) {
46 final UImage shape = (UImage) ushape;
47 tikz.appendRaw(x, y, shape.getFormula());
48 }
49 }
9696 registerDriver(ULine.class, new DriverLineTikz());
9797 registerDriver(UPolygon.class, new DriverPolygonTikz());
9898 registerDriver(UEllipse.class, new DriverEllipseTikz());
99 registerDriver(UImage.class, new DriverNoneTikz());
99 registerDriver(UImage.class, new DriverImageTikz());
100100 registerDriver(UImageSvg.class, new DriverNoneTikz());
101101 registerDriver(UPath.class, new DriverUPathTikz());
102102 registerDriver(DotPath.class, new DriverDotPathTikz());
7979
8080 public static boolean isArobaseStartDiagram(CharSequence s) {
8181 final String s2 = StringUtils.trinNoTrace(s);
82 if (s2.startsWith("@") == false && s2.startsWith("\\") == false) {
83 return false;
84 }
8285 return DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN;
8386 }
8487
8891
8992 public static boolean startsWithSymbolAnd(String value, final String tmp) {
9093 return tmp.startsWith("@" + value) || tmp.startsWith("\\" + value);
94 }
95
96 public static boolean startOrEnd(final CharSequence2 s) {
97 final String s2 = StringUtils.trinNoTrace(s);
98 if (s2.startsWith("@") == false && s2.startsWith("\\") == false) {
99 return false;
100 }
101 return startsWithSymbolAnd("end", s2) || DiagramType.getTypeFromArobaseStart(s2) != DiagramType.UNKNOWN;
91102 }
92103
93104 public static boolean isArobaseEndDiagram(CharSequence s) {
272272 text.add("PlantUML can occasionally display sponsored or advertising messages. Those");
273273 text.add("messages are usually generated on welcome or error images and never on");
274274 text.add("functional diagrams.");
275 text.add("See http://plantuml.com/professional if you want to remove them");
275276 text.add(" ");
276277 }
277278 text.add("Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML");
279280 text.add("textual description in PlantUML language). Those images are not covered by");
280281 }
281282
282 private List<String> getHeaderStart(LicenseInfo licenseInfo) {
283 private List<String> getHeaderStart(LicenseInfo licenseInfo, boolean withQrcode) {
283284 final List<String> text = new ArrayList<String>();
284285 if (licenseInfo.isNone()) {
285 text.add("========================================================================");
286 text.add("PlantUML : a free UML diagram generator");
287 text.add("========================================================================");
286 text.add("+=======================================================================");
287 text.add("| ");
288 text.add("| PlantUML : a free UML diagram generator");
289 text.add("| ");
290 text.add("+=======================================================================");
288291 text.add(" ");
289292 } else {
290 text.add("========================================================================");
291 text.add("This is PlantUML Professional Edition");
292 text.add("========================================================================");
293 text.add("+=======================================================================");
294 text.add("| ");
295 text.add("| PlantUML Professional Edition");
296 text.add("| ");
297 text.add("+=======================================================================");
293298 addLicenseInfo(text, licenseInfo);
294 text.add("========================================================================");
299 text.add("+=======================================================================");
295300 text.add(" ");
296301 }
297302 text.add("(C) Copyright 2009-2017, Arnaud Roques");
302307 text.add("If you like this project or if you find it useful, you can support us at:");
303308 text.add(" ");
304309 text.add("http://plantuml.com/patreon (only 1$ per month!)");
310 text.add("http://plantuml.com/liberapay (only 1\u20ac per month!)");
305311 text.add("http://plantuml.com/paypal");
306 text.add(" ");
312 if (withQrcode) {
313 text.add("\t<qrcode:http://plantuml.com/patreon>\t\t<qrcode:http://plantuml.com/lp>\t\t<qrcode:http://plantuml.com/paypal>");
314 } else {
315 text.add("");
316 text.add(" ");
317 }
307318 }
308319 return text;
309320 }
310321
311322 public static void addLicenseInfo(final List<String> text, LicenseInfo licenseInfo) {
312 text.add("LICENSED TO : " + licenseInfo.getOwner());
313 text.add("EXPIRATION DATE : " + DateFormat.getDateInstance().format(licenseInfo.getExpirationDate()));
323 if (licenseInfo.getLicenseType() == LicenseType.NAMED) {
324 text.add("| ");
325 text.add("| LICENSED TO : " + licenseInfo.getOwner());
326 text.add("| EXPIRATION DATE : " + DateFormat.getDateInstance().format(licenseInfo.getExpirationDate()));
327 text.add("| ");
328 } else if (licenseInfo.getLicenseType() == LicenseType.DISTRIBUTOR) {
329 text.add("| ");
330 text.add("| DISTRIBUTED BY : " + licenseInfo.getOwner());
331 text.add("| ");
332 }
314333 if (licenseInfo.hasExpired()) {
315 text.add("<i>Warning: Your license has expired.");
334 text.add("| <i>Warning: Your license has expired.");
335 text.add("| ");
316336 }
317337 }
318338
450470 return Collections.unmodifiableList(h);
451471 }
452472
453 public List<String> getText() {
454 final LicenseInfo licenseInfo = LicenseInfo.retrieveSlow();
455 final List<String> text = getHeaderStart(licenseInfo);
473 public List<String> getText(boolean withQrcode) {
474 final LicenseInfo licenseInfo = LicenseInfo.retrieveQuick();
475 final List<String> text = getHeaderStart(licenseInfo, withQrcode);
456476 if (this == License.GPL) {
457477 addGpl(licenseInfo, text);
458478 } else if (this == License.GPLV2) {
3737 import java.io.File;
3838 import java.io.FileReader;
3939 import java.io.IOException;
40 import java.io.InputStream;
41 import java.io.InputStreamReader;
42 import java.io.UnsupportedEncodingException;
4043 import java.math.BigInteger;
4144 import java.security.NoSuchAlgorithmException;
45 import java.security.spec.InvalidKeySpecException;
4246 import java.util.Collection;
4347 import java.util.Date;
4448 import java.util.Set;
4751 import java.util.prefs.Preferences;
4852
4953 import net.sourceforge.plantuml.Log;
54 import net.sourceforge.plantuml.OptionFlags;
5055 import net.sourceforge.plantuml.SignatureUtils;
5156 import net.sourceforge.plantuml.dedication.Dedication;
5257 import net.sourceforge.plantuml.dedication.QBlock;
5459 public class LicenseInfo {
5560
5661 private final static Preferences prefs = Preferences.userNodeForPackage(LicenseInfo.class);
57 private final static LicenseInfo NONE = new LicenseInfo();
62 private final static LicenseInfo NONE = new LicenseInfo(LicenseType.NONE, 0, 0, null, null);
5863
5964 public static final int POS_TYPE = 2;
65 public static final int POS_CONTEXT = 4;
6066 public static final int POS_SIGNATURE = 10;
6167 public static final int POS_GENERATION = 100;
6268 public static final int POS_EXPIRATION = 108;
6369 public static final int POS_OWNER = 128;
6470
71 private final LicenseType type;
6572 private final long generationDate;
6673 private final long expirationDate;
6774 private final String owner;
68
69 private LicenseInfo() {
70 this.expirationDate = 0;
71 this.generationDate = 0;
72 this.owner = null;
73 }
74
75 private LicenseInfo(Magic magic) throws NoSuchAlgorithmException, IOException {
75 private final String context;
76
77 private LicenseInfo(LicenseType type, long generationDate, long expirationDate, String owner, String context) {
78 this.type = type;
79 this.generationDate = generationDate;
80 this.expirationDate = expirationDate;
81 this.owner = owner;
82 this.context = context;
83 }
84
85 private static LicenseInfo buildNamed(Magic magic, boolean doCheck) throws NoSuchAlgorithmException, IOException {
7686 final String signature = SignatureUtils.toHexString(magic.get(LicenseInfo.POS_SIGNATURE, 64));
77 final String local = SignatureUtils.toHexString(Magic.signature());
78 if (local.equals(signature) == false) {
79 throw new IOException();
80 }
81 final int type = magic.getByte(Magic.signature(), LicenseInfo.POS_TYPE);
82 this.generationDate = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8));
83 this.expirationDate = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8));
84 this.owner = magic.getString(LicenseInfo.POS_OWNER);
87 if (doCheck) {
88 final String local = SignatureUtils.toHexString(Magic.signature());
89 if (local.equals(signature) == false) {
90 throw new IOException();
91 }
92 }
93 final LicenseType type = LicenseType.fromInt(magic.getByte(Magic.signature(), LicenseInfo.POS_TYPE));
94 final long generation = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8));
95 final long expiration = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8));
96 final String owner = magic.getString(LicenseInfo.POS_OWNER);
97 return new LicenseInfo(type, generation, expiration, owner, null);
98 }
99
100 private static LicenseInfo buildDistributor(Magic magic) throws IOException, NoSuchAlgorithmException {
101 final LicenseType type = LicenseType.fromInt(magic.getByte(LicenseInfo.POS_TYPE));
102 final long generation = bytesToLong(magic.get(LicenseInfo.POS_GENERATION, 8));
103 final long expiration = bytesToLong(magic.get(LicenseInfo.POS_EXPIRATION, 8));
104 final String owner = magic.getString(LicenseInfo.POS_OWNER);
105 final String context = magic.getString(LicenseInfo.POS_CONTEXT);
106 return new LicenseInfo(type, generation, expiration, owner, context);
85107 }
86108
87109 public static long bytesToLong(byte[] b) {
102124
103125 public static synchronized LicenseInfo retrieveQuick() {
104126 if (cache == null) {
105 return retrieveSlow();
127 cache = retrieveDistributor();
128 }
129 if (cache == null) {
130 cache = retrieveNamedSlow();
106131 }
107132 return cache;
108133 }
109134
110 public static synchronized LicenseInfo retrieveSlow() {
135 public static boolean retrieveNamedOrDistributorQuickIsValid() {
136 return retrieveQuick().isValid();
137 }
138
139 public static synchronized LicenseInfo retrieveNamedSlow() {
111140 cache = LicenseInfo.NONE;
141 if (OptionFlags.ALLOW_INCLUDE == false) {
142 return cache;
143 }
112144 final String key = prefs.get("license", "");
113145 if (key.length() > 0) {
114 cache = setIfValid(retrieve(key), cache);
146 cache = setIfValid(retrieveNamed(key), cache);
115147 if (cache.isValid()) {
116148 return cache;
117149 }
133165 return cache;
134166 }
135167
136 private static LicenseInfo setIfValid(LicenseInfo value, LicenseInfo def) {
137 if (value.isValid() || def.isNone()) {
138 return value;
139 }
140 return def;
141 }
142
143 private static LicenseInfo retrieve(File f) throws IOException {
144 final BufferedReader br = new BufferedReader(new FileReader(f));
145 final String s = br.readLine();
146 br.close();
147 final LicenseInfo result = retrieve(s);
148 if (result != null) {
149 Log.info("Reading license from " + f.getAbsolutePath());
150 }
151 return result;
152 }
153
154 public static LicenseInfo retrieve(final String key) {
155 if (key.matches("^[0-9a-z]+$")) {
168 public static LicenseInfo retrieveNamed(final String key) {
169 if (key.length() > 99 && key.matches("^[0-9a-z]+$")) {
156170 try {
157 final BigInteger lu = new BigInteger(key, 36);
158 final QBlock qb2 = new QBlock(lu);
159 final QBlock qb3 = qb2.change(Dedication.E, Dedication.N);
160 final Magic magic = qb3.toMagic();
161
162171 final String sig = SignatureUtils.toHexString(Magic.signature());
163 magic.xor(SignatureUtils.getSHA512raw(SignatureUtils.salting(sig, Magic.getSalt(sig))));
164 return new LicenseInfo(magic);
172 return retrieveNamed(sig, key, true);
165173 } catch (Exception e) {
166174 // e.printStackTrace();
167 Log.info("Error " + e);
175 Log.info("Error retrieving license info" + e);
168176 }
169177 }
170178 return LicenseInfo.NONE;
179 }
180
181 public static LicenseInfo retrieveNamed(final String sig, final String key, boolean doCheck)
182 throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeySpecException, IOException {
183 final BigInteger lu = new BigInteger(key, 36);
184 final QBlock qb2 = new QBlock(lu);
185 final QBlock qb3 = qb2.change(Dedication.E, Dedication.N);
186 final Magic magic = qb3.toMagic();
187
188 magic.xor(SignatureUtils.getSHA512raw(SignatureUtils.salting(sig, Magic.getSalt(sig))));
189 return LicenseInfo.buildNamed(magic, doCheck);
190 }
191
192 public static LicenseInfo retrieveDistributor() {
193 final InputStream dis = PSystemVersion.class.getResourceAsStream("/distributor.txt");
194 if (dis == null) {
195 return null;
196 }
197 try {
198 final BufferedReader br = new BufferedReader(new InputStreamReader(dis));
199 final String licenseString = br.readLine();
200 br.close();
201 final BigInteger lu = new BigInteger(licenseString, 36);
202 final QBlock qb2 = new QBlock(lu);
203 final QBlock qb3 = qb2.change(Dedication.E, Dedication.N);
204 final Magic magic = qb3.toMagic();
205 final LicenseInfo result = LicenseInfo.buildDistributor(magic);
206
207 final Throwable creationPoint = new Throwable();
208 creationPoint.fillInStackTrace();
209 for (StackTraceElement ste : creationPoint.getStackTrace()) {
210 if (ste.toString().contains(result.context)) {
211 return result;
212 }
213 }
214 return null;
215 } catch (Exception e) {
216 e.printStackTrace();
217 return null;
218 }
171219 }
172220
173221 public static Collection<File> fileCandidates() {
179227 if (dir.isFile()) {
180228 dir = dir.getParentFile();
181229 }
182 if (dir.isDirectory()) {
230 if (dir != null && dir.isDirectory()) {
183231 result.add(new File(dir, "license.txt"));
184232 }
185233 }
186234 return result;
187235 }
236
237 private static LicenseInfo setIfValid(LicenseInfo value, LicenseInfo def) {
238 if (value.isValid() || def.isNone()) {
239 return value;
240 }
241 return def;
242 }
243
244 private static LicenseInfo retrieve(File f) throws IOException {
245 final BufferedReader br = new BufferedReader(new FileReader(f));
246 final String s = br.readLine();
247 br.close();
248 final LicenseInfo result = retrieveNamed(s);
249 if (result != null) {
250 Log.info("Reading license from " + f.getAbsolutePath());
251 }
252 return result;
253 }
254
255
188256
189257 public static void main(String[] args) {
190 LicenseInfo info = retrieveSlow();
258 LicenseInfo info = retrieveNamedSlow();
191259 System.err.println("valid=" + info.isValid());
192260 System.err.println("info=" + info.owner);
193261
217285 return owner != null && System.currentTimeMillis() > this.expirationDate;
218286 }
219287
288 public final LicenseType getLicenseType() {
289 return type;
290 }
291
292 public final String getContext() {
293 return context;
294 }
295
220296 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.version;
35
36 public enum LicenseType {
37
38 NONE, NAMED, DISTRIBUTOR, UNKNOWN;
39
40 public static LicenseType fromInt(int type) {
41 if (type == -1) {
42 return NONE;
43 }
44 if (type == 0) {
45 return NAMED;
46 }
47 if (type == 2) {
48 return DISTRIBUTOR;
49 }
50 return UNKNOWN;
51 }
52
53 }
8282 return buffer;
8383 }
8484
85 public void setByte(int pos, int data) {
86 buffer[pos] = (byte) (0xFF & data);
87 }
88
8589 public void setByte(byte[] shrink, int pos, int data) {
8690 buffer[pos] = (byte) (0xFF & (data ^ shrink(shrink)));
8791 }
8892
8993 public int getByte(byte[] shrink, int pos) {
9094 return buffer[pos] ^ shrink(shrink);
95 }
96
97 public int getByte(int pos) {
98 return buffer[pos];
9199 }
92100
93101 public void set(int pos, byte[] data) {
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * (C) Copyright 2009-2017, Arnaud Roques
5 *
6 * Project Info: http://plantuml.com
7 *
8 * If you like this project or if you find it useful, you can support us at:
9 *
10 * http://plantuml.com/patreon (only 1$ per month!)
11 * http://plantuml.com/paypal
12 *
13 * This file is part of PlantUML.
14 *
15 * PlantUML is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * PlantUML distributed in the hope that it will be useful, but
21 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
22 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
23 * License for more details.
24 *
25 * You should have received a copy of the GNU General Public
26 * License along with this library; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
28 * USA.
29 *
30 *
31 * Original Author: Arnaud Roques
32 *
33 */
34 package net.sourceforge.plantuml.version;
35
36 import java.awt.Color;
37 import java.awt.image.BufferedImage;
38 import java.io.File;
39 import java.io.IOException;
40 import java.io.OutputStream;
41 import java.security.NoSuchAlgorithmException;
42 import java.security.spec.InvalidKeySpecException;
43 import java.util.ArrayList;
44 import java.util.List;
45 import java.util.prefs.BackingStoreException;
46
47 import net.sourceforge.plantuml.AbstractPSystem;
48 import net.sourceforge.plantuml.FileFormatOption;
49 import net.sourceforge.plantuml.OptionFlags;
50 import net.sourceforge.plantuml.SignatureUtils;
51 import net.sourceforge.plantuml.core.DiagramDescription;
52 import net.sourceforge.plantuml.core.ImageData;
53 import net.sourceforge.plantuml.flashcode.FlashCodeFactory;
54 import net.sourceforge.plantuml.flashcode.FlashCodeUtils;
55 import net.sourceforge.plantuml.graphic.GraphicStrings;
56 import net.sourceforge.plantuml.graphic.HtmlColorUtils;
57 import net.sourceforge.plantuml.graphic.TextBlock;
58 import net.sourceforge.plantuml.graphic.UDrawable;
59 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
60 import net.sourceforge.plantuml.ugraphic.ImageBuilder;
61 import net.sourceforge.plantuml.ugraphic.UGraphic;
62 import net.sourceforge.plantuml.ugraphic.UImage;
63 import net.sourceforge.plantuml.ugraphic.UTranslate;
64
65 public class PSystemKeycheck extends AbstractPSystem {
66
67 final private String key;
68 final private String sig;
69
70 public PSystemKeycheck(String sig, String key) {
71 this.sig = sig;
72 this.key = key;
73 }
74
75 @Override
76 final protected ImageData exportDiagramNow(OutputStream os, int num, FileFormatOption fileFormat, long seed)
77 throws IOException {
78 final ImageBuilder imageBuilder = new ImageBuilder(new ColorMapperIdentity(), 1.0, HtmlColorUtils.WHITE,
79 getMetadata(), null, 0, 0, null, false);
80
81 imageBuilder.setUDrawable(new UDrawable() {
82 public void drawU(UGraphic ug) {
83 try {
84 drawInternal(ug);
85 } catch (Exception e) {
86 e.printStackTrace();
87 }
88 }
89 });
90 return imageBuilder.writeImageTOBEMOVED(fileFormat, seed, os);
91 }
92
93 public DiagramDescription getDescription() {
94 return new DiagramDescription("(Key)");
95 }
96
97 private void drawInternal(UGraphic ug) throws IOException, NoSuchAlgorithmException, InvalidKeySpecException {
98 final List<String> strings = header();
99 try {
100 final LicenseInfo info = LicenseInfo.retrieveNamed(sig, key, false);
101 strings.add("<u>Provided license information</u>:");
102 License.addLicenseInfo(strings, info);
103 strings.add(" ");
104 } catch (Exception e) {
105 e.printStackTrace();
106 strings.add("<i>Error:</i> " + e);
107 }
108
109 final TextBlock disp = GraphicStrings.createBlackOnWhite(strings);
110 disp.drawU(ug);
111 }
112
113 private ArrayList<String> header() {
114 final ArrayList<String> strings = new ArrayList<String>();
115 strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")");
116 strings.add("(" + License.getCurrent() + " source distribution)");
117 if (OptionFlags.ALLOW_INCLUDE) {
118 strings.add("Loaded from " + Version.getJarPath());
119 }
120 strings.add(" ");
121 return strings;
122 }
123
124 private void drawFlash(UGraphic ug, LicenseInfo info) throws IOException {
125 final List<String> strings = header();
126 strings.add("To get your <i>Professional Edition License</i>,");
127 strings.add("please send this qrcode to <b>plantuml@gmail.com</b> :");
128
129 TextBlock disp = GraphicStrings.createBlackOnWhite(strings);
130 disp.drawU(ug);
131
132 ug = ug.apply(new UTranslate(0, disp.calculateDimension(ug.getStringBounder()).getHeight()));
133 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
134 final BufferedImage im = utils.exportFlashcode(
135 Version.versionString() + "\n" + SignatureUtils.toHexString(Magic.signature()), Color.BLACK,
136 Color.WHITE);
137 if (im != null) {
138 final UImage flash = new UImage(im).scaleNearestNeighbor(4);
139 ug.draw(flash);
140 ug = ug.apply(new UTranslate(0, flash.getHeight()));
141 }
142
143 if (info.isNone() == false) {
144 strings.clear();
145 strings.add("<u>Installed license</u>:");
146 License.addLicenseInfo(strings, info);
147 strings.add(" ");
148 disp = GraphicStrings.createBlackOnWhite(strings);
149 disp.drawU(ug);
150 }
151
152 }
153 }
3333 */
3434 package net.sourceforge.plantuml.version;
3535
36 import java.awt.Color;
3637 import java.awt.image.BufferedImage;
3738 import java.io.File;
3839 import java.io.IOException;
4344
4445 import net.sourceforge.plantuml.AbstractPSystem;
4546 import net.sourceforge.plantuml.FileFormatOption;
47 import net.sourceforge.plantuml.OptionFlags;
4648 import net.sourceforge.plantuml.SignatureUtils;
4749 import net.sourceforge.plantuml.core.DiagramDescription;
4850 import net.sourceforge.plantuml.core.ImageData;
8587 }
8688
8789 public DiagramDescription getDescription() {
88 return new DiagramDescription("(Genkey)");
90 return new DiagramDescription("(Key)");
8991 }
9092
9193 private void drawInternal(UGraphic ug) throws IOException {
94 final LicenseInfo installed = LicenseInfo.retrieveNamedSlow();
9295 if (key.length() == 0) {
93 drawFlash(ug);
96 drawFlash(ug, installed);
9497 return;
9598 }
96 final LicenseInfo info = LicenseInfo.retrieve(key);
99 final LicenseInfo info = LicenseInfo.retrieveNamed(key);
97100 if (info.isNone()) {
98 drawFlash(ug);
101 drawFlash(ug, installed);
99102 return;
100103 }
101104 final List<String> strings = header();
109112 strings.add("<i>Error: Cannot store license key.</i>");
110113 }
111114
112 final LicenseInfo installed = LicenseInfo.retrieveSlow();
113115 if (installed.isNone()) {
114116 strings.add("No license currently installed.");
115117 strings.add(" ");
132134 final ArrayList<String> strings = new ArrayList<String>();
133135 strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")");
134136 strings.add("(" + License.getCurrent() + " source distribution)");
135 strings.add("Loaded from " + Version.getJarPath());
137 if (OptionFlags.ALLOW_INCLUDE) {
138 strings.add("Loaded from " + Version.getJarPath());
139 }
136140 strings.add(" ");
137141 return strings;
138142 }
139143
140 public void drawFlash(UGraphic ug) throws IOException {
144 private void drawFlash(UGraphic ug, LicenseInfo info) throws IOException {
141145 final List<String> strings = header();
142146 strings.add("To get your <i>Professional Edition License</i>,");
143 strings.add("please send this flashcode to <b>plantuml@gmail.com</b> :");
147 strings.add("please send this qrcode to <b>plantuml@gmail.com</b> :");
144148
145149 TextBlock disp = GraphicStrings.createBlackOnWhite(strings);
146150 disp.drawU(ug);
147151
148152 ug = ug.apply(new UTranslate(0, disp.calculateDimension(ug.getStringBounder()).getHeight()));
149153 final FlashCodeUtils utils = FlashCodeFactory.getFlashCodeUtils();
150 final BufferedImage im = utils.exportFlashcode(Version.versionString() + "\n"
151 + SignatureUtils.toHexString(Magic.signature()));
152 final UImage flash = new UImage(im).scaleNearestNeighbor(4);
153 ug.draw(flash);
154 final BufferedImage im = utils.exportFlashcode(
155 Version.versionString() + "\n" + SignatureUtils.toHexString(Magic.signature()), Color.BLACK, Color.WHITE);
156 if (im != null) {
157 final UImage flash = new UImage(im).scaleNearestNeighbor(4);
158 ug.draw(flash);
159 ug = ug.apply(new UTranslate(0, flash.getHeight()));
160 }
154161
155 ug = ug.apply(new UTranslate(0, flash.getHeight()));
156
157 final LicenseInfo info = LicenseInfo.retrieveSlow();
158162 if (info.isNone() == false) {
159163 strings.clear();
160164 strings.add("<u>Installed license</u>:");
5252 private final List<String> strings = new ArrayList<String>();
5353
5454 PSystemLicense() throws IOException {
55 strings.addAll(License.getCurrent().getText());
55 strings.addAll(License.getCurrent().getText(true));
5656 }
5757
5858 @Override
3535
3636 import java.awt.image.BufferedImage;
3737 import java.io.BufferedReader;
38 import java.io.File;
3839 import java.io.IOException;
3940 import java.io.InputStream;
4041 import java.io.InputStreamReader;
5152
5253 import net.sourceforge.plantuml.AbstractPSystem;
5354 import net.sourceforge.plantuml.FileFormatOption;
54 import net.sourceforge.plantuml.FileSystem;
5555 import net.sourceforge.plantuml.Log;
5656 import net.sourceforge.plantuml.OptionFlags;
5757 import net.sourceforge.plantuml.OptionPrint;
5959 import net.sourceforge.plantuml.core.DiagramDescription;
6060 import net.sourceforge.plantuml.core.ImageData;
6161 import net.sourceforge.plantuml.cucadiagram.dot.GraphvizUtils;
62 import net.sourceforge.plantuml.dedication.Dedication;
6263 import net.sourceforge.plantuml.graphic.GraphicPosition;
6364 import net.sourceforge.plantuml.graphic.GraphicStrings;
64 import net.sourceforge.plantuml.preproc.PreprocessorInclude;
65 import net.sourceforge.plantuml.preproc.ImportedFiles;
6566 import net.sourceforge.plantuml.preproc.Stdlib;
67 import net.sourceforge.plantuml.preproc2.PreprocessorInclude3;
6668 import net.sourceforge.plantuml.svek.TextBlockBackcolored;
6769 import net.sourceforge.plantuml.ugraphic.ColorMapperIdentity;
6870 import net.sourceforge.plantuml.ugraphic.ImageBuilder;
8082 }
8183
8284 public static BufferedImage getPlantumlImage() {
85 return getImage("logo.png");
86 }
87
88 public static BufferedImage getCharlieImage() {
89 return getImage("charlie.png");
90 }
91
92 public static BufferedImage getTime01() {
93 return getImage("time01.png");
94 }
95
96 public static BufferedImage getTime15() {
97 return getImage("time15.png");
98 }
99
100 public static BufferedImage getPlantumlSmallIcon() {
101 return getImage("favicon.png");
102 }
103
104 public static BufferedImage getArecibo() {
105 return getImage("arecibo.png");
106 }
107
108 public static BufferedImage getApple2Image() {
109 return getImageWebp("apple2.png");
110 }
111
112 private static BufferedImage getImage(final String name) {
83113 try {
84 final InputStream is = PSystemVersion.class.getResourceAsStream("logo.png");
114 final InputStream is = PSystemVersion.class.getResourceAsStream(name);
85115 final BufferedImage image = ImageIO.read(is);
86116 is.close();
87117 return image;
91121 return new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
92122 }
93123
94 public static BufferedImage getCharlieImage() {
124 private static BufferedImage getImageWebp(final String name) {
95125 try {
96 final InputStream is = PSystemVersion.class.getResourceAsStream("charlie.png");
97 final BufferedImage image = ImageIO.read(is);
98 is.close();
99 return image;
100 } catch (IOException e) {
101 e.printStackTrace();
102 }
103 return new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
104 }
105
106 public static BufferedImage getTime() {
107 try {
108 final InputStream is = PSystemVersion.class.getResourceAsStream("time00.png");
109 final BufferedImage image = ImageIO.read(is);
110 is.close();
111 return image;
112 } catch (IOException e) {
113 e.printStackTrace();
114 }
115 return new BufferedImage(10, 10, BufferedImage.TYPE_INT_ARGB);
116 }
117
118 public static BufferedImage getPlantumlSmallIcon() {
119 try {
120 final InputStream is = PSystemVersion.class.getResourceAsStream("favicon.png");
121 final BufferedImage image = ImageIO.read(is);
126 final InputStream is = PSystemVersion.class.getResourceAsStream(name);
127 final BufferedImage image = Dedication.getBufferedImage(is);
122128 is.close();
123129 return image;
124130 } catch (IOException e) {
164170 final List<String> strings = new ArrayList<String>();
165171 strings.add("<b>PlantUML version " + Version.versionString() + "</b> (" + Version.compileTimeString() + ")");
166172 strings.add("(" + License.getCurrent() + " source distribution)");
167 strings.add("Loaded from " + Version.getJarPath());
168 if (OptionFlags.getInstance().isWord()) {
169 strings.add("Word Mode");
170 strings.add("Command Line: " + Run.getCommandLine());
171 strings.add("Current Dir: " + FileSystem.getInstance().getCurrentDir().getAbsolutePath());
172 strings.add("plantuml.include.path: " + PreprocessorInclude.getenv("plantuml.include.path"));
173 if (OptionFlags.ALLOW_INCLUDE) {
174 strings.add("Loaded from " + Version.getJarPath());
175 if (OptionFlags.getInstance().isWord()) {
176 strings.add("Word Mode");
177 strings.add("Command Line: " + Run.getCommandLine());
178 strings.add("Current Dir: " + new File(".").getAbsolutePath());
179 strings.add("plantuml.include.path: " + PreprocessorInclude3.getenv("plantuml.include.path"));
180 }
173181 }
174182 strings.add(" ");
175 strings.add("<b>Stdlib:");
176 Stdlib.addInfoVersion(strings, false);
177 strings.add(" ");
183 // strings.add("<b>Stdlib:");
184 // Stdlib.addInfoVersion(strings, false);
185 // strings.add(" ");
178186
179187 strings.addAll(GraphvizUtils.getTestDotStrings(true));
180188 strings.add(" ");
315323 return new PSystemVersion(false, strings);
316324 }
317325
326 public static PSystemVersion createDumpStackTrace() throws IOException {
327 final List<String> strings = new ArrayList<String>();
328 final Throwable creationPoint = new Throwable();
329 creationPoint.fillInStackTrace();
330 for (StackTraceElement ste : creationPoint.getStackTrace()) {
331 strings.add(ste.toString());
332 }
333 return new PSystemVersion(false, strings);
334 }
335
336 public static PSystemVersion createKeyDistributor() throws IOException {
337 final LicenseInfo license = LicenseInfo.retrieveDistributor();
338
339 final List<String> strings = new ArrayList<String>();
340 if (license == null) {
341 strings.add("No license found");
342 } else {
343 strings.add(license.getOwner());
344 strings.add(license.getContext());
345 strings.add(license.getGenerationDate().toString());
346 strings.add(license.getExpirationDate().toString());
347 }
348 return new PSystemVersion(false, strings);
349 }
350
351 public static PSystemVersion createPath() throws IOException {
352 final List<String> strings = new ArrayList<String>();
353 strings.add("<u>Current Dir</u>: " + new File(".").getAbsolutePath());
354 strings.add(" ");
355 strings.add("<u>Default path</u>:");
356 for (File f : ImportedFiles.createImportedFiles(null).getPath()) {
357 strings.add(f.getAbsolutePath());
358 }
359 return new PSystemVersion(true, strings);
360 }
361
318362 public DiagramDescription getDescription() {
319363 return new DiagramDescription("(Version)");
320364 }
5555 if (line.matches("(?i)^stdlib\\s*$")) {
5656 return PSystemVersion.createStdLib();
5757 }
58 if (line.matches("(?i)^path\\s*$")) {
59 return PSystemVersion.createPath();
60 }
5861 if (line.matches("(?i)^testdot\\s*$")) {
5962 return PSystemVersion.createTestDot();
63 }
64 if (line.matches("(?i)^dumpstacktrace\\s*$")) {
65 return PSystemVersion.createDumpStackTrace();
66 }
67 if (line.matches("(?i)^keydistributor\\s*$")) {
68 return PSystemVersion.createKeyDistributor();
6069 }
6170 if (line.matches("(?i)^checkversion\\s*$")) {
6271 return PSystemVersion.createCheckVersions(null, null);
6372 }
64 if (line.matches("(?i)^keygen(\\s+[0-9a-z]+)?\\s*$")) {
73 if (line.matches("(?i)^(keygen|keyimport)(\\s+[0-9a-z]+)?\\s*$")) {
6574 line = line.trim();
66 final String key = line.substring("keygen".length()).trim();
75 final String key = line.startsWith("keygen") ? line.substring("keygen".length()).trim() : line
76 .substring("keyimport".length()).trim();
6777 return new PSystemKeygen(key);
78 }
79 if (line.matches("(?i)^keycheck\\s+([0-9a-z]+)\\s+([0-9a-z]+)\\s*$")) {
80 final Pattern p = Pattern.compile("(?i)^keycheck\\s+([0-9a-z]+)\\s+([0-9a-z]+)\\s*$");
81 final Matcher m = p.matcher(line);
82 if (m.find()) {
83 return new PSystemKeycheck(m.group(1), m.group(2));
84 }
6885 }
6986 final Pattern p1 = Pattern.compile("(?i)^checkversion\\(proxy=([\\w.]+),port=(\\d+)\\)$");
7087 final Matcher m1 = p1.matcher(line);
4242 private static final int MAJOR_SEPARATOR = 1000000;
4343
4444 public static int version() {
45 return 1201809;
45 return 1201813;
4646 }
4747
4848 public static int versionPatched() {
8787 }
8888
8989 public static long compileTime() {
90 return 1532710698423L;
90 return 1543252311095L;
9191 }
9292
9393 public static String compileTimeString() {
3535
3636 package smetana.core;
3737
38 import h.*;
3938
40 public interface AllH extends Agraph_s, Agobj_s, Agrec_s, Agdesc_s, Agmemdisc_s, Agclos_s, Agiddisc_s, _dtmethod_s,
41 _dtdisc_s, _dt_s, _dtdata_s, refstr_t, _dtlink_s, Agdatadict_s, Agattr_s, Agsubnode_s, Agnode_s, Agtag_s,
42 Agedge_s, Agedgepair_s, Agsym_s, GVC_s, gvlayout_features_t, gvlayout_engine_s, gvplugin_installed_t, pointf,
43 pack_info, aspect_t, fontinfo, shape_functions, polygon_t, shape_desc, textlabel_t, IMapEntry_t, textspan_t,
44 textfont_t, point, port, elist, Dtmemory_f, nlist_t, nodequeue, Agnodeinfo_t, Agedgeinfo_t, spline_info_t,
45 splineInfo, path, pathend_t, boxf, Ppoly_t, pointnlink_t, deque_t, triangle_t, tna_t, Pedge_t, splines, bezier,
46 inside_t, arrowdir_t, arrowtype_t, label_params_t, object_t, xlabel_t, adjmatrix_t, _Node_t___, RTree,
47 HDict_t, XLabels_t
48 {
49
39 public interface AllH extends __ptr__ {
5040 }
3535
3636 package smetana.core;
3737
38 import h.*;
38 import h.Dtcompar_f;
39 import h.Dtmemory_f;
40 import h.Dtsearch_f;
3941
4042 public interface CFunction extends __ptr__, Dtmemory_f, Dtcompar_f, Dtsearch_f {
4143
3535
3636 package smetana.core;
3737
38 import h.ST_refstr_t;
39
3840 import java.util.ArrayList;
3941 import java.util.List;
4042
4143 import smetana.core.amiga.Area;
42 import smetana.core.amiga.StarStruct;
4344
4445 public class CString extends UnsupportedC implements __ptr__, Area {
4546
4647 private static int UID = 100;
47
48
4849 private final Throwable creation = new Throwable();
4950 private final List<Character> data2;
5051 private final int currentStart;
51 private final List<__ptr__> fathers = new ArrayList<__ptr__>();
52
5253 private final int uid;
5354
5455 public boolean isSameThan(CString other) {
100101 this.data2 = data2;
101102 this.currentStart = currentStart;
102103 this.uid = UID;
103 UID+=2;
104 UID += 2;
104105 creation.fillInStackTrace();
105106 }
106107
107108 public __ptr__ addVirtualBytes(int bytes) {
108109 JUtils.LOG("CString::addVirtualBytes " + bytes);
109110 JUtils.LOG("AM " + this);
110 if (bytes < 0) {
111 OFFSET offset = OFFSET.fromInt(-bytes);
112 JUtils.LOG("offset=" + offset);
113 for (__ptr__ f : fathers) {
114 JUtils.LOG("f=" + f);
115 if (f instanceof StarStruct && ((StarStruct) f).getRealClass() == offset.getTheClass()) {
116 JUtils.LOG("FOUND1!!");
117 if (f.getPtr(offset.getField()).equals(this)) {
118 JUtils.LOG("FOUND2!!");
119 return f;
120 }
121 }
122 }
123 } else {
124 JUtils.LOG("father=" + fathers);
125 JUtils.LOG("CString created on the following place:");
126 creation.printStackTrace();
127 }
111 // if (bytes < 0) {
112 // OFFSET offset = OFFSET.fromInt(-bytes);
113 // JUtils.LOG("offset=" + offset);
114 // for (__ptr__ f : fathers) {
115 // JUtils.LOG("f=" + f);
116 // if (f instanceof StarStruct && ((StarStruct) f).getRealClass() == offset.getTheClass()) {
117 // JUtils.LOG("FOUND1!!");
118 // if (f.getPtr(offset.getField()).equals(this)) {
119 // JUtils.LOG("FOUND2!!");
120 // return f;
121 // }
122 // }
123 // }
124 // } else {
125 // JUtils.LOG("father=" + fathers);
126 // JUtils.LOG("CString created on the following place:");
127 // creation.printStackTrace();
128 // }
128129 throw new UnsupportedOperationException();
130 }
131
132 private ST_refstr_t parent;
133
134 public ST_refstr_t getParent() {
135 if (parent != null) {
136 return parent;
137 }
138 throw new UnsupportedOperationException();
139 }
140
141 public void setParent(ST_refstr_t struct) {
142 // if (parent != null && parent != struct) {
143 // throw new IllegalStateException();
144 // }
145 if (struct == null) {
146 throw new IllegalStateException();
147 }
148 this.parent = struct;
129149 }
130150
131151 @Override
196216 }
197217
198218 public int compareTo(CString other, int num) {
199 for (int i = 0; i < data2.size() - currentStart && i<num; i++) {
219 for (int i = 0; i < data2.size() - currentStart && i < num; i++) {
200220 final int diff = this.charAt(i) - other.charAt(i);
201221 if (this.charAt(i) == '\0' || diff != 0) {
202222 return diff;
224244 return getContent().equals(other.getContent());
225245 }
226246
227 public void setMyFather(__ptr__ struct) {
228 if (this.toString().equals("black(0)")) {
229 JUtils.LOG("CString::setMyFather " + this + " " + fathers.size());
230 }
231 this.fathers.add(struct);
232 }
233
234247 public int getUid() {
235248 return uid;
236249 }
3535
3636 package smetana.core;
3737
38 import h.Ppoly_t;
38 import h.ST_Ppoly_t;
39 import h.ST_pointf;
3940 import h.htmllabel_t;
40 import h.pointf;
4141
4242 import java.lang.reflect.Field;
4343 import java.util.List;
112112 if (isPrimitive()) {
113113 return null;
114114 }
115 if (type.equals("ST_Ppolyline_t")) {
116 return ST_Ppoly_t.class;
117 }
115118 if (type.equals("Ppolyline_t")) {
116 return Ppoly_t.class;
119 return ST_Ppoly_t.class;
117120 }
118121 return getClassFrom(type);
119122 }
123126 throw new IllegalArgumentException();
124127 }
125128 if (type.equals("h.pointf_s")) {
126 return pointf.class;
129 return ST_pointf.class;
127130 }
128131 if (type.equals("pointf_s")) {
129 return pointf.class;
132 return ST_pointf.class;
130133 }
131134 if (type.endsWith("htmllabel_t")) {
132135 return htmllabel_t.class;
3535
3636 package smetana.core;
3737
38 import h.*;
38 import h.Agcbstack_s;
39 import h.Agdstate_s;
40 import h.Agiodisc_s;
41 import h.GVCOMMON_t;
42 import h.LeafList_t;
43 import h.ST_Agattr_s;
44 import h.ST_Agcbstack_s;
45 import h.ST_Agclos_s;
46 import h.ST_Agdatadict_s;
47 import h.ST_Agdesc_s;
48 import h.ST_Agdisc_s;
49 import h.ST_Agdstate_s;
50 import h.ST_Agedge_s;
51 import h.ST_Agedgeinfo_t;
52 import h.ST_Agedgepair_s;
53 import h.ST_Agiddisc_s;
54 import h.ST_Agiodisc_s;
55 import h.ST_Agmemdisc_s;
56 import h.ST_Agnode_s;
57 import h.ST_Agnodeinfo_t;
58 import h.ST_Agobj_s;
59 import h.ST_Agraph_s;
60 import h.ST_Agraphinfo_t;
61 import h.ST_Agrec_s;
62 import h.ST_Agsubnode_s;
63 import h.ST_Agsym_s;
64 import h.ST_GVCOMMON_t;
65 import h.ST_GVC_s;
66 import h.ST_HDict_t;
67 import h.ST_IMapEntry_t;
68 import h.ST_LeafList_t;
69 import h.ST_Node_t___;
70 import h.ST_Pedge_t;
71 import h.ST_Ppoly_t;
72 import h.ST_RTree;
73 import h.ST_XLabels_t;
74 import h.ST_arrowtype_t;
75 import h.ST_aspect_t;
76 import h.ST_bezier;
77 import h.ST_boxf;
78 import h.ST_cinfo_t;
79 import h.ST_dt_s;
80 import h.ST_dtdata_s;
81 import h.ST_dtdisc_s;
82 import h.ST_dthold_s;
83 import h.ST_dtlink_s;
84 import h.ST_dtmethod_s;
85 import h.ST_elist;
86 import h.ST_fontinfo;
87 import h.ST_label_params_t;
88 import h.ST_layout_t;
89 import h.ST_nlist_t;
90 import h.ST_nodequeue;
91 import h.ST_object_t;
92 import h.ST_pack_info;
93 import h.ST_path;
94 import h.ST_pathend_t;
95 import h.ST_pointf;
96 import h.ST_pointnlink_t;
97 import h.ST_polygon_t;
98 import h.ST_port;
99 import h.ST_rank_t;
100 import h.ST_refstr_t;
101 import h.ST_shape_desc;
102 import h.ST_shape_functions;
103 import h.ST_splineInfo;
104 import h.ST_spline_info_t;
105 import h.ST_splines;
106 import h.ST_tedge_t;
107 import h.ST_textfont_t;
108 import h.ST_textlabel_t;
109 import h.ST_textspan_t;
110 import h.ST_tna_t;
111 import h.ST_triangle_t;
112 import h.ST_xlabel_t;
113 import h.ST_dthold_s;
114 import h.layout_t;
115 import h.rank_t;
116 import h.tedge_t;
39117
40118 import java.util.LinkedHashSet;
41119 import java.util.Set;
42120
43121 import smetana.core.amiga.StarArrayOfInteger;
44 import smetana.core.amiga.StarArrayOfPtr;
45 import smetana.core.amiga.StarArrayOfStruct;
46 import smetana.core.amiga.StarStar;
47122 import smetana.core.amiga.StarStruct;
48 import smetana.core.amiga.StarStructImpl;
49123
50124 // http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.7.4
51125 // http://www.jbox.dk/sanos/source/lib/string.c.html
56130
57131 public static size_t sizeof(Class cl) {
58132 return new size_t_struct(cl);
59 }
60
61 public static size_t sizeof(__ptr__ element) {
62 return new size_t_of_element(element);
63133 }
64134
65135 public static size_t sizeof(String name, int sz) {
69139 throw new UnsupportedOperationException();
70140 }
71141
72 public static size_t sizeof(Class cl, int nb) {
73 if (cl == pointf.class) {
74 return ST_pointf.sizeof(nb);
75 }
76 if (cl == boxf.class) {
77 return ST_boxf.sizeof(nb);
78 }
79 if (cl == pointnlink_t.class) {
80 return ST_pointnlink_t.sizeof(nb);
81 }
82 if (cl == textspan_t.class) {
83 return ST_textspan_t.sizeof(nb);
84 }
85 // if (UmlDiagram.SMETANA_BETA) {
86 if (cl == Agraph_s.class) {
87 return ST_Agraph_s.sizeof(nb);
88 }
89 if (cl == rank_t.class) {
90 return ST_rank_t.sizeof(nb);
91 }
92 if (cl == Agnode_s.class) {
93 return ST_Agnode_s.sizeof(nb);
94 }
95 if (cl == bezier.class) {
96 return ST_bezier.sizeof(nb);
97 }
98 if (cl == triangle_t.class) {
99 return ST_triangle_t.sizeof(nb);
100 }
101 if (cl == Pedge_t.class) {
102 return ST_Pedge_t.sizeof(nb);
103 }
104 if (cl == tna_t.class) {
105 return ST_tna_t.sizeof(nb);
106 }
107 if (cl == object_t.class) {
108 return ST_object_t.sizeof(nb);
109 }
110 if (cl == xlabel_t.class) {
111 return ST_xlabel_t.sizeof(nb);
112 }
113 // }
114 if (from(cl) instanceof __struct_impl__ == false) {
115 throw new IllegalArgumentException(cl.getName());
116 }
117 return new size_t_array_of_something(cl, nb);
118 }
119
120142 public static size_t size_t_array_of_integer(int nb) {
121143 return new size_t_array_of_integer(nb);
122 }
123
124 public static size_t sizeof_starstar_empty(Class cl, int nb) {
125 if (cl == Agedge_s.class) {
126 return ST_Agedge_s.sizeof_starstar_empty(nb);
127 }
128 if (cl == Agnode_s.class) {
129 return ST_Agnode_s.sizeof_starstar_empty(nb);
130 }
131 if (cl == pointnlink_t.class) {
132 return ST_pointnlink_t.sizeof_starstar_empty(nb);
133 }
134 if (from(cl) instanceof __struct_impl__ == false) {
135 throw new IllegalArgumentException(cl.getName());
136 }
137 return new size_t_array_of_array_of_something_empty(cl, nb);
138144 }
139145
140146 public static int strcmp(CString s1, CString s2) {
250256 }
251257
252258 public static boolean EQ(Object o1, Object o2) {
259 final boolean result = EQ_(o1, o2);
260 if (o1 instanceof UnsupportedStarStruct && o2 instanceof UnsupportedStarStruct) {
261 UnsupportedStarStruct ooo1 = (UnsupportedStarStruct) o1;
262 UnsupportedStarStruct ooo2 = (UnsupportedStarStruct) o2;
263 if ((ooo1.UID == ooo2.UID) != result) {
264 // throw new UnsupportedOperationException();
265 }
266 }
267 return result;
268 }
269
270 private static boolean EQ_(Object o1, Object o2) {
253271 if (o1 == o2) {
254272 return true;
255273 }
262280 // if (o1 instanceof AreaArray && o2 instanceof AreaArray) {
263281 // return ((AreaArray) o1).isSameThan((AreaArray) o2);
264282 // }
283 if (o1 instanceof ST_pointnlink_t && o2 instanceof ST_pointnlink_t) {
284 return ((ST_pointnlink_t) o1).isSameThan((ST_pointnlink_t) o2);
285 }
286 if (o1 instanceof ST_object_t && o2 instanceof ST_object_t) {
287 return ((ST_object_t) o1).isSameThan((ST_object_t) o2);
288 }
265289 if (o1 instanceof StarStruct && o2 instanceof StarStruct) {
290 // System.err.println("o1="+o1.getClass());
291 // System.err.println("o2="+o2.getClass());
266292 return ((StarStruct) o1).isSameThan((StarStruct) o2);
267293 }
268294 if (o1 instanceof CString && o2 instanceof CString) {
269295 return ((CString) o1).isSameThan((CString) o2);
270296 }
271 if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfPtr) {
272 return ((StarArrayOfPtr) o1).isSameThan((StarArrayOfPtr) o2);
273 }
274 if (o1 instanceof StarStar && o2 instanceof StarStruct) {
275 __ptr__ o1b = ((StarStar) o1).getPtr();
276 if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2).getRealClass()) {
277 throw new UnsupportedOperationException();
278 }
279 return EQ(o1b, o2);
280 }
281 if (o1 instanceof StarStruct && o2 instanceof StarArrayOfPtr) {
282 __ptr__ o2b = ((StarArrayOfPtr) o2).getPtrForEquality();
283 if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
284 throw new UnsupportedOperationException();
285 }
286 return EQ(o1, o2b);
287 }
288 if (o1 instanceof StarStruct && o2 instanceof StarArrayOfStruct) {
289 __ptr__ o2b = ((StarArrayOfStruct) o2).getPtrForEquality();
290 if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
291 throw new UnsupportedOperationException();
292 }
293 return EQ(o1, o2b);
294 }
295 if (o1 instanceof StarStar && o2 instanceof StarArrayOfPtr) {
296 __ptr__ o1b = ((StarStar) o1).getPtr();
297 __ptr__ o2b = ((StarArrayOfPtr) o2).getPtr();
298 if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2b).getRealClass()) {
299 throw new UnsupportedOperationException();
300 }
301 return EQ(o1b, o2b);
302 }
303 if (o1 instanceof StarArrayOfStruct && o2 instanceof StarArrayOfStruct) {
304 StarArrayOfStruct oo1 = (StarArrayOfStruct) o1;
305 StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
306 return oo1.isSameThan(oo2);
307 }
308 if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfStruct) {
309 StarArrayOfPtr oo1 = (StarArrayOfPtr) o1;
310 StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
311 __struct__ s1 = oo1.getStruct();
312 __struct__ s2 = oo2.getStruct();
313 boolean result = s1.getInternalData().isSameThan(s2.getInternalData());
314 return result;
315 }
297 if (o1 instanceof ST_Agnode_s.ArrayOfStar && o2 instanceof ST_Agnode_s.ArrayOfStar) {
298 return ((ST_Agnode_s.ArrayOfStar) o1).isSameThan2((ST_Agnode_s.ArrayOfStar) o2);
299 }
300 // if (o1 instanceof StarStar && o2 instanceof StarArrayOfPtr) {
301 // __ptr__ o1b = ((StarStar) o1).getPtr();
302 // __ptr__ o2b = ((StarArrayOfPtr) o2).getPtr();
303 // if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2b).getRealClass()) {
304 // throw new UnsupportedOperationException();
305 // }
306 // return EQ(o1b, o2b);
307 // }
316308 System.err.println("o1=" + o1.getClass() + " " + o1);
317309 System.err.println("o2=" + o2.getClass() + " " + o2);
318310 throw new UnsupportedOperationException();
322314 return EQ(o1, o2) == false;
323315 }
324316
325 public static void qsort(__ptr__ array, int nb, size_t size, CFunction compare) {
317 public static void qsort(__ptr__ array, int nb, CFunction compare) {
326318 if (nb <= 1) {
327319 return;
328320 }
329321 JUtils.LOG("array=" + array);
330322 JUtils.LOG("nb=" + nb);
331 JUtils.LOG("size=" + size);
332323 JUtils.LOG("compare=" + compare);
333324 boolean change;
334325 do {
342333 change = true;
343334 if (array instanceof StarArrayOfInteger) {
344335 ((StarArrayOfInteger) array).swap(i, i + 1);
345 } else if (array instanceof STStarArrayOfPointer) {
346 ((STStarArrayOfPointer) array).swap(i, i + 1);
336 // } else if (array instanceof STStarArrayOfPointer) {
337 // ((STStarArrayOfPointer) array).swap(i, i + 1);
338 } else if (array instanceof ST_Agnode_s.ArrayOfStar) {
339 ((ST_Agnode_s.ArrayOfStar) array).swap(i, i + 1);
340 } else if (array instanceof ST_Agedge_s.ArrayOfStar) {
341 ((ST_Agedge_s.ArrayOfStar) array).swap(i, i + 1);
347342 } else {
348 ((StarStar) array).swap(i, i + 1);
343 throw new UnsupportedOperationException();
344 // ((StarStar) array).swap(i, i + 1);
349345 }
350346 }
351347 }
373369
374370 // DEBUG
375371
376 public static void printDebugEdge(Agedge_s e) {
372 public static void printDebugEdge(ST_Agedge_s e) {
377373 System.err.println("*********** PRINT EDGE ********** ");
378 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
379 final splines splines = (splines) data.getPtr("spl");
380 __struct__<boxf> bb = splines.getStruct("bb");
381 final bezier list = (bezier) splines.getPtr("list");
382 System.err.println("splines.size=" + splines.getInt("size"));
383 System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
384 System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
385 printDebugBezier((bezier) splines.getPtr("list").getPtr());
386
387 }
388
389 private static String pointftoString(__struct__<pointf> point) {
374 final ST_Agedgeinfo_t data = (ST_Agedgeinfo_t) Macro.AGDATA(e).castTo(ST_Agedgeinfo_t.class);
375 final ST_splines splines = (ST_splines) data.spl;
376 // ST_boxf bb = (ST_boxf) splines.bb;
377 final ST_bezier list = splines.list.getPtr();
378 System.err.println("splines.size=" + splines.size);
379 //System.err.println("bb.LL=" + pointftoString(bb.LL));
380 //System.err.println("bb.UR=" + pointftoString(bb.UR));
381 printDebugBezier((ST_bezier) splines.list.getPtr());
382
383 }
384
385 private static String pointftoString(ST_pointf point) {
390386 final StringBuilder sb = new StringBuilder();
391387 sb.append("(");
392 sb.append(point.getDouble("x"));
388 sb.append(point.x);
393389 sb.append(" ; ");
394 sb.append(point.getDouble("y"));
390 sb.append(point.y);
395391 sb.append(")");
396392 return sb.toString();
397393 }
398394
399 private static void printDebugBezier(bezier bezier) {
400 System.err.println("bezier.size=" + bezier.getInt("size"));
401 System.err.println("bezier.sflag=" + bezier.getInt("sflag"));
402 System.err.println("splines.eflag=" + bezier.getInt("eflag"));
403 System.err.println("bezier.sp=" + pointftoString(bezier.getStruct("sp")));
404 System.err.println("bezier.ep=" + pointftoString(bezier.getStruct("ep")));
405 for (int i = 0; i < bezier.getInt("size"); i++) {
406 final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr();
395 private static void printDebugBezier(ST_bezier bezier) {
396 System.err.println("bezier.size=" + bezier.size);
397 System.err.println("bezier.sflag=" + bezier.sflag);
398 System.err.println("splines.eflag=" + bezier.eflag);
399 System.err.println("bezier.sp=" + pointftoString(bezier.sp));
400 System.err.println("bezier.ep=" + pointftoString(bezier.ep));
401 for (int i = 0; i < bezier.size; i++) {
402 final ST_pointf pt = bezier.list.get(i);
407403 System.err.println("pt=" + pointftoString(pt));
408404 }
409405 }
410406
411 private static String pointftoString(__ptr__ point) {
412 final StringBuilder sb = new StringBuilder();
413 sb.append("(");
414 sb.append(point.getDouble("x"));
415 sb.append(" ; ");
416 sb.append(point.getDouble("y"));
417 sb.append(")");
418 return sb.toString();
419 }
420
421407 public static <C extends __ptr__> __struct__<C> from(Class<C> theClass) {
422 if (theClass == _dtmethod_s.class) {
408 if (theClass == ST_dtmethod_s.class) {
423409 return new ST_dtmethod_s();
424410 }
425 if (theClass == _dtdisc_s.class) {
411 if (theClass == ST_dtdisc_s.class) {
426412 return new ST_dtdisc_s();
427413 }
428 if (theClass == Agdesc_s.class) {
414 if (theClass == ST_Agdesc_s.class) {
429415 return new ST_Agdesc_s();
430416 }
431 if (theClass == Agtag_s.class) {
432 return new ST_Agtag_s();
433 }
434 if (theClass == Agiddisc_s.class) {
417 // if (theClass == Agtag_s.class) {
418 // return new ST_Agtag_s();
419 // }
420 if (theClass == ST_Agiddisc_s.class) {
435421 return new ST_Agiddisc_s();
436422 }
437 if (theClass == Agmemdisc_s.class) {
423 if (theClass == ST_Agmemdisc_s.class) {
438424 return new ST_Agmemdisc_s();
439425 }
440 if (theClass == nlist_t.class) {
426 if (theClass == ST_nlist_t.class) {
441427 return new ST_nlist_t();
442428 }
443 if (theClass == arrowname_t.class) {
444 return new ST_arrowname_t();
445 }
446 if (theClass == arrowtype_t.class) {
429 if (theClass == ST_arrowtype_t.class) {
447430 return new ST_arrowtype_t();
448431 }
449 if (theClass == elist.class) {
432 if (theClass == ST_elist.class) {
450433 return new ST_elist();
451434 }
452 if (theClass == pointf.class) {
435 if (theClass == ST_pointf.class) {
453436 return new ST_pointf();
454437 }
455 if (theClass == boxf.class) {
438 if (theClass == ST_boxf.class) {
456439 return new ST_boxf();
457440 }
458 if (theClass == port.class) {
441 if (theClass == ST_port.class) {
459442 return new ST_port();
460443 }
461 if (theClass == polygon_t.class) {
444 if (theClass == ST_polygon_t.class) {
462445 return new ST_polygon_t();
463446 }
464 if (theClass == shape_functions.class) {
447 if (theClass == ST_shape_functions.class) {
465448 return new ST_shape_functions();
466449 }
467 if (theClass == shape_desc.class) {
450 if (theClass == ST_shape_desc.class) {
468451 return new ST_shape_desc();
469452 }
470 if (theClass == deque_t.class) {
471 return new ST_deque_t();
472 }
473 if (theClass == pointnlink_t.class) {
474 return new ST_pointnlink_t();
475 }
476 if (theClass == Ppoly_t.class) {
453 // if (theClass == deque_t.class) {
454 // return new ST_deque_t();
455 // }
456 // if (theClass == pointnlink_t.class) {
457 // return new ST_pointnlink_t();
458 // }
459 if (theClass == ST_Ppoly_t.class) {
477460 return new ST_Ppoly_t();
478461 }
479 if (theClass == splineInfo.class) {
462 if (theClass == ST_splineInfo.class) {
480463 return new ST_splineInfo();
481464 }
482 if (theClass == textfont_t.class) {
465 if (theClass == ST_textfont_t.class) {
483466 return new ST_textfont_t();
484467 }
485468 //
486469 // if (UmlDiagram.SMETANA_BETA) {
487 if (theClass == Agsubnode_s.class) {
470 if (theClass == ST_Agsubnode_s.class) {
488471 return new ST_Agsubnode_s();
489472 }
490 if (theClass == _dtlink_s.class) {
473 if (theClass == ST_dtlink_s.class) {
491474 return new ST_dtlink_s();
492475 }
493 if (theClass == refstr_t.class) {
476 if (theClass == ST_refstr_t.class) {
494477 return new ST_refstr_t();
495478 }
496 if (theClass == Agsym_s.class) {
479 if (theClass == ST_refstr_t.class) {
480 return new ST_refstr_t();
481 }
482 if (theClass == ST_Agsym_s.class) {
497483 return new ST_Agsym_s();
498484 }
499 if (theClass == Agedge_s.class) {
485 if (theClass == ST_Agedge_s.class) {
500486 return new ST_Agedge_s();
501487 }
502 if (theClass == Agobj_s.class) {
488 if (theClass == ST_Agobj_s.class) {
503489 return new ST_Agobj_s();
504490 }
505 if (theClass == Agrec_s.class) {
491 if (theClass == ST_Agrec_s.class) {
506492 return new ST_Agrec_s();
507493 }
508 if (theClass == Agraph_s.class) {
494 if (theClass == ST_Agraph_s.class) {
509495 return new ST_Agraph_s();
510496 }
511 if (theClass == Agclos_s.class) {
497 if (theClass == ST_Agclos_s.class) {
512498 return new ST_Agclos_s();
513499 }
514 if (theClass == Agdisc_s.class) {
500 if (theClass == ST_Agdisc_s.class) {
515501 return new ST_Agdisc_s();
516502 }
517503 if (theClass == Agdstate_s.class) {
520506 if (theClass == Agiodisc_s.class) {
521507 return new ST_Agiodisc_s();
522508 }
523 if (theClass == _dt_s.class) {
509 if (theClass == ST_dt_s.class) {
524510 return new ST_dt_s();
525511 }
526 if (theClass == _dtdata_s.class) {
512 if (theClass == ST_dtdata_s.class) {
527513 return new ST_dtdata_s();
528514 }
529 if (theClass == Agdatadict_s.class) {
515 if (theClass == ST_Agdatadict_s.class) {
530516 return new ST_Agdatadict_s();
531517 }
532 if (theClass == Agattr_s.class) {
518 if (theClass == ST_Agattr_s.class) {
533519 return new ST_Agattr_s();
534520 }
535521 if (theClass == Agcbstack_s.class) {
536522 return new ST_Agcbstack_s();
537523 }
538 if (theClass == Agnode_s.class) {
524 if (theClass == ST_Agnode_s.class) {
539525 return new ST_Agnode_s();
540526 }
541 if (theClass == Agedgepair_s.class) {
527 if (theClass == ST_Agedgepair_s.class) {
542528 return new ST_Agedgepair_s();
543529 }
544 if (theClass == Agraphinfo_t.class) {
530 if (theClass == ST_Agraphinfo_t.class) {
545531 return new ST_Agraphinfo_t();
546532 }
547 if (theClass == GVC_s.class) {
533 if (theClass == ST_GVC_s.class) {
548534 return new ST_GVC_s();
549535 }
550536 if (theClass == GVCOMMON_t.class) {
551537 return new ST_GVCOMMON_t();
552538 }
553 if (theClass == gvlayout_engine_s.class) {
554 return new ST_gvlayout_engine_s();
555 }
556 if (theClass == gvlayout_features_t.class) {
557 return new ST_gvlayout_features_t();
558 }
559 if (theClass == gvplugin_active_layout_t.class) {
560 return new ST_gvplugin_active_layout_t();
561 }
562 if (theClass == gvplugin_installed_t.class) {
563 return new ST_gvplugin_installed_t();
564 }
539 // if (theClass == ST_gvlayout_engine_s.class) {
540 // return new ST_gvlayout_engine_s();
541 // }
542 // if (theClass == gvlayout_features_t.class) {
543 // return new ST_gvlayout_features_t();
544 // }
545 // if (theClass == gvplugin_active_layout_t.class) {
546 // return new ST_gvplugin_active_layout_t();
547 // }
548 // if (theClass == gvplugin_installed_t.class) {
549 // return new ST_gvplugin_installed_t();
550 // }
565551 if (theClass == layout_t.class) {
566552 return new ST_layout_t();
567553 }
568 if (theClass == Agnodeinfo_t.class) {
554 if (theClass == ST_Agnodeinfo_t.class) {
569555 return new ST_Agnodeinfo_t();
570556 }
571 if (theClass == textlabel_t.class) {
557 if (theClass == ST_textlabel_t.class) {
572558 return new ST_textlabel_t();
573559 }
574 if (theClass == textspan_t.class) {
560 if (theClass == ST_textspan_t.class) {
575561 return new ST_textspan_t();
576562 }
577563 if (theClass == rank_t.class) {
578564 return new ST_rank_t();
579565 }
580 if (theClass == adjmatrix_t.class) {
581 return new ST_adjmatrix_t();
582 }
583 if (theClass == Agedgeinfo_t.class) {
566 // if (theClass == adjmatrix_t.class) {
567 // return new ST_adjmatrix_t();
568 // }
569 if (theClass == ST_Agedgeinfo_t.class) {
584570 return new ST_Agedgeinfo_t();
585571 }
586 if (theClass == splines.class) {
572 if (theClass == ST_splines.class) {
587573 return new ST_splines();
588574 }
589 if (theClass == bezier.class) {
575 if (theClass == ST_bezier.class) {
590576 return new ST_bezier();
591577 }
592 if (theClass == _dthold_s.class) {
578 if (theClass == ST_dthold_s.class) {
593579 return new ST_dthold_s();
594580 }
595581 //
596 if (theClass == pack_info.class) {
582 if (theClass == ST_pack_info.class) {
597583 return new ST_pack_info();
598584 }
599 if (theClass == aspect_t.class) {
585 if (theClass == ST_aspect_t.class) {
600586 return new ST_aspect_t();
601587 }
602 if (theClass == fontinfo.class) {
588 if (theClass == ST_fontinfo.class) {
603589 return new ST_fontinfo();
604590 }
605 if (theClass == IMapEntry_t.class) {
591 if (theClass == ST_IMapEntry_t.class) {
606592 return new ST_IMapEntry_t();
607593 }
608 if (theClass == point.class) {
609 return new ST_point();
610 }
611 if (theClass == nodequeue.class) {
594 // if (theClass == point.class) {
595 // return new ST_point();
596 // }
597 if (theClass == ST_nodequeue.class) {
612598 return new ST_nodequeue();
613599 }
614 if (theClass == spline_info_t.class) {
600 if (theClass == ST_spline_info_t.class) {
615601 return new ST_spline_info_t();
616602 }
617 if (theClass == path.class) {
603 if (theClass == ST_path.class) {
618604 return new ST_path();
619605 }
620 if (theClass == pathend_t.class) {
606 if (theClass == ST_pathend_t.class) {
621607 return new ST_pathend_t();
622608 }
623 if (theClass == inside_t.class) {
624 return new ST_inside_t();
625 }
626 if (theClass == triangle_t.class) {
609 // if (theClass == inside_t.class) {
610 // return new ST_inside_t();
611 // }
612 if (theClass == ST_triangle_t.class) {
627613 return new ST_triangle_t();
628614 }
629615 if (theClass == tedge_t.class) {
630616 return new ST_tedge_t();
631617 }
632 if (theClass == Pedge_t.class) {
618 if (theClass == ST_Pedge_t.class) {
633619 return new ST_Pedge_t();
634620 }
635 if (theClass == tna_t.class) {
621 if (theClass == ST_tna_t.class) {
636622 return new ST_tna_t();
637623 }
638 if (theClass == label_params_t.class) {
624 if (theClass == ST_label_params_t.class) {
639625 return new ST_label_params_t();
640626 }
641 if (theClass == object_t.class) {
627 if (theClass == ST_object_t.class) {
642628 return new ST_object_t();
643629 }
644 if (theClass == xlabel_t.class) {
630 if (theClass == ST_xlabel_t.class) {
645631 return new ST_xlabel_t();
646632 }
647 if (theClass == XLabels_t.class) {
633 if (theClass == ST_XLabels_t.class) {
648634 return new ST_XLabels_t();
649635 }
650 if (theClass == HDict_t.class) {
636 if (theClass == ST_HDict_t.class) {
651637 return new ST_HDict_t();
652638 }
653 if (theClass == RTree.class) {
639 if (theClass == ST_RTree.class) {
654640 return new ST_RTree();
655641 }
656 if (theClass == _Node_t___.class) {
642 if (theClass == ST_Node_t___.class) {
657643 return new ST_Node_t___();
658644 }
645 if (theClass == ST_cinfo_t.class) {
646 return new ST_cinfo_t();
647 }
659648 // }
660649 notFound(theClass);
661 return new __struct_impl__<C>(theClass);
650 throw new UnsupportedOperationException();
662651 }
663652
664653 public static StarStruct create(Class theClass, StarStruct parent) {
665 if (theClass == _dtmethod_s.class) {
654 if (theClass == ST_dtmethod_s.class) {
666655 throw new IllegalArgumentException(theClass.toString());
667656 }
668 if (theClass == _dtdisc_s.class) {
657 if (theClass == ST_dtdisc_s.class) {
669658 return new ST_dtdisc_s(parent);
670659 }
671 if (theClass == Agdesc_s.class) {
660 if (theClass == ST_Agdesc_s.class) {
672661 return new ST_Agdesc_s(parent);
673662 }
674 if (theClass == Agtag_s.class) {
675 return new ST_Agtag_s(parent);
676 }
677 if (theClass == Agiddisc_s.class) {
678 throw new IllegalArgumentException(theClass.toString());
679 }
680 if (theClass == Agmemdisc_s.class) {
681 throw new IllegalArgumentException(theClass.toString());
682 }
683 if (theClass == nlist_t.class) {
663 if (theClass == ST_nlist_t.class) {
684664 return new ST_nlist_t(parent);
685665 }
686 if (theClass == arrowname_t.class) {
687 throw new IllegalArgumentException(theClass.toString());
688 }
689 if (theClass == arrowtype_t.class) {
690 throw new IllegalArgumentException(theClass.toString());
691 }
692 if (theClass == elist.class) {
666 if (theClass == ST_elist.class) {
693667 return new ST_elist(parent);
694668 }
695 if (theClass == pointf.class) {
669 if (theClass == ST_pointf.class) {
696670 return new ST_pointf(parent);
697671 }
698 if (theClass == boxf.class) {
672 if (theClass == ST_boxf.class) {
699673 return new ST_boxf(parent);
700674 }
701 if (theClass == port.class) {
675 if (theClass == ST_port.class) {
702676 return new ST_port(parent);
703677 }
704 if (theClass == polygon_t.class) {
678 if (theClass == ST_polygon_t.class) {
705679 return new ST_polygon_t(parent);
706680 }
707 if (theClass == shape_functions.class) {
681 if (theClass == ST_shape_functions.class) {
708682 return new ST_shape_functions(parent);
709683 }
710 if (theClass == shape_desc.class) {
684 if (theClass == ST_shape_desc.class) {
711685 return new ST_shape_desc(parent);
712686 }
713 if (theClass == deque_t.class) {
714 return new ST_deque_t(parent);
715 }
716 if (theClass == pointnlink_t.class) {
717 return new ST_pointnlink_t(parent);
718 }
719 if (theClass == Ppoly_t.class) {
687 // if (theClass == deque_t.class) {
688 // return new ST_deque_t(parent);
689 // }
690 // if (theClass == pointnlink_t.class) {
691 // return new ST_pointnlink_t(parent);
692 // }
693 if (theClass == ST_Ppoly_t.class) {
720694 return new ST_Ppoly_t(parent);
721695 }
722 if (theClass == splineInfo.class) {
696 if (theClass == ST_splineInfo.class) {
723697 return new ST_splineInfo(parent);
724698 }
725 if (theClass == textfont_t.class) {
699 if (theClass == ST_textfont_t.class) {
726700 return new ST_textfont_t(parent);
727701 }
728702 //
729703 // if (UmlDiagram.SMETANA_BETA) {
730 if (theClass == Agsubnode_s.class) {
704 if (theClass == ST_Agsubnode_s.class) {
731705 return new ST_Agsubnode_s(parent);
732706 }
733 if (theClass == _dtlink_s.class) {
707 if (theClass == ST_dtlink_s.class) {
734708 return new ST_dtlink_s(parent);
735709 }
736 if (theClass == refstr_t.class) {
737 return new ST_refstr_t(parent);
738 }
739 if (theClass == Agsym_s.class) {
710 if (theClass == ST_refstr_t.class) {
711 return new ST_refstr_t();
712 }
713 if (theClass == ST_refstr_t.class) {
714 return new ST_refstr_t();
715 }
716 if (theClass == ST_Agsym_s.class) {
740717 return new ST_Agsym_s(parent);
741718 }
742 if (theClass == Agedge_s.class) {
719 if (theClass == ST_Agedge_s.class) {
743720 return new ST_Agedge_s(parent);
744721 }
745 if (theClass == Agobj_s.class) {
722 if (theClass == ST_Agobj_s.class) {
746723 return new ST_Agobj_s(parent);
747724 }
748 if (theClass == Agrec_s.class) {
725 if (theClass == ST_Agrec_s.class) {
749726 return new ST_Agrec_s(parent);
750727 }
751 if (theClass == Agraph_s.class) {
728 if (theClass == ST_Agraph_s.class) {
752729 return new ST_Agraph_s(parent);
753730 }
754 if (theClass == Agclos_s.class) {
731 if (theClass == ST_Agclos_s.class) {
755732 return new ST_Agclos_s(parent);
756733 }
757 if (theClass == Agdisc_s.class) {
734 if (theClass == ST_Agdisc_s.class) {
758735 return new ST_Agdisc_s(parent);
759736 }
760737 if (theClass == Agdstate_s.class) {
761738 return new ST_Agdstate_s(parent);
762739 }
763 if (theClass == _dt_s.class) {
740 if (theClass == ST_dt_s.class) {
764741 return new ST_dt_s(parent);
765742 }
766 if (theClass == _dtdata_s.class) {
743 if (theClass == ST_dtdata_s.class) {
767744 return new ST_dtdata_s(parent);
768745 }
769 if (theClass == Agdatadict_s.class) {
746 if (theClass == ST_Agdatadict_s.class) {
770747 return new ST_Agdatadict_s(parent);
771748 }
772 if (theClass == Agattr_s.class) {
749 if (theClass == ST_Agattr_s.class) {
773750 return new ST_Agattr_s(parent);
774751 }
775752 if (theClass == Agcbstack_s.class) {
776753 return new ST_Agcbstack_s(parent);
777754 }
778 if (theClass == Agnode_s.class) {
755 if (theClass == ST_Agnode_s.class) {
779756 return new ST_Agnode_s(parent);
780757 }
781 if (theClass == Agedgepair_s.class) {
758 if (theClass == ST_Agedgepair_s.class) {
782759 return new ST_Agedgepair_s(parent);
783760 }
784 if (theClass == Agraphinfo_t.class) {
761 if (theClass == ST_Agraphinfo_t.class) {
785762 return new ST_Agraphinfo_t(parent);
786763 }
787 if (theClass == GVC_s.class) {
764 if (theClass == ST_GVC_s.class) {
788765 return new ST_GVC_s(parent);
789766 }
790767 if (theClass == GVCOMMON_t.class) {
791768 return new ST_GVCOMMON_t(parent);
792769 }
793 if (theClass == gvlayout_engine_s.class) {
794 throw new UnsupportedOperationException();
795 // return new ST_gvlayout_engine_s(parent);
796 }
797 if (theClass == gvlayout_features_t.class) {
798 throw new UnsupportedOperationException();
799 // return new ST_gvlayout_features_t(parent);
800 }
801 if (theClass == gvplugin_active_layout_t.class) {
802 throw new UnsupportedOperationException();
803 // return new ST_gvplugin_active_layout_t(parent);
804 }
805 if (theClass == gvplugin_installed_t.class) {
806 return new ST_gvplugin_installed_t(parent);
807 }
770 // if (theClass == ST_gvlayout_engine_s.class) {
771 // throw new UnsupportedOperationException();
772 // // return new ST_gvlayout_engine_s(parent);
773 // }
774 // if (theClass == gvlayout_features_t.class) {
775 // throw new UnsupportedOperationException();
776 // // return new ST_gvlayout_features_t(parent);
777 // }
778 // if (theClass == gvplugin_active_layout_t.class) {
779 // throw new UnsupportedOperationException();
780 // // return new ST_gvplugin_active_layout_t(parent);
781 // }
782 // if (theClass == gvplugin_installed_t.class) {
783 // return new ST_gvplugin_installed_t(parent);
784 // }
808785 if (theClass == layout_t.class) {
809786 return new ST_layout_t(parent);
810787 }
811 if (theClass == Agnodeinfo_t.class) {
788 if (theClass == ST_Agnodeinfo_t.class) {
812789 return new ST_Agnodeinfo_t(parent);
813790 }
814 if (theClass == textlabel_t.class) {
791 if (theClass == ST_textlabel_t.class) {
815792 return new ST_textlabel_t(parent);
816793 }
817 if (theClass == textspan_t.class) {
794 if (theClass == ST_textspan_t.class) {
818795 return new ST_textspan_t(parent);
819796 }
820797 if (theClass == rank_t.class) {
821798 return new ST_rank_t(parent);
822799 }
823 if (theClass == adjmatrix_t.class) {
824 return new ST_adjmatrix_t(parent);
825 }
826 if (theClass == Agedgeinfo_t.class) {
800 // if (theClass == adjmatrix_t.class) {
801 // return new ST_adjmatrix_t(parent);
802 // }
803 if (theClass == ST_Agedgeinfo_t.class) {
827804 return new ST_Agedgeinfo_t(parent);
828805 }
829 if (theClass == splines.class) {
806 if (theClass == ST_splines.class) {
830807 return new ST_splines(parent);
831808 }
832 if (theClass == bezier.class) {
809 if (theClass == ST_bezier.class) {
833810 return new ST_bezier(parent);
834811 }
835 if (theClass == _dthold_s.class) {
812 if (theClass == ST_dthold_s.class) {
836813 return new ST_dthold_s(parent);
837814 }
838815 //
839 if (theClass == pack_info.class) {
816 if (theClass == ST_pack_info.class) {
840817 return new ST_pack_info(parent);
841818 }
842 if (theClass == aspect_t.class) {
819 if (theClass == ST_aspect_t.class) {
843820 return new ST_aspect_t(parent);
844821 }
845 if (theClass == fontinfo.class) {
822 if (theClass == ST_fontinfo.class) {
846823 return new ST_fontinfo(parent);
847824 }
848 if (theClass == IMapEntry_t.class) {
825 if (theClass == ST_IMapEntry_t.class) {
849826 return new ST_IMapEntry_t(parent);
850827 }
851 if (theClass == point.class) {
852 return new ST_point(parent);
853 }
854 if (theClass == nodequeue.class) {
828 // if (theClass == point.class) {
829 // return new ST_point(parent);
830 // }
831 if (theClass == ST_nodequeue.class) {
855832 return new ST_nodequeue(parent);
856833 }
857 if (theClass == spline_info_t.class) {
834 if (theClass == ST_spline_info_t.class) {
858835 return new ST_spline_info_t(parent);
859836 }
860 if (theClass == path.class) {
837 if (theClass == ST_path.class) {
861838 return new ST_path(parent);
862839 }
863 if (theClass == pathend_t.class) {
840 if (theClass == ST_pathend_t.class) {
864841 return new ST_pathend_t(parent);
865842 }
866 if (theClass == inside_t.class) {
867 return new ST_inside_t(parent);
868 }
869 if (theClass == triangle_t.class) {
843 // if (theClass == inside_t.class) {
844 // return new ST_inside_t(parent);
845 // }
846 if (theClass == ST_triangle_t.class) {
870847 return new ST_triangle_t(parent);
871848 }
872849 if (theClass == tedge_t.class) {
873850 return new ST_tedge_t(parent);
874851 }
875 if (theClass == Pedge_t.class) {
852 if (theClass == ST_Pedge_t.class) {
876853 return new ST_Pedge_t(parent);
877854 }
878 if (theClass == tna_t.class) {
855 if (theClass == ST_tna_t.class) {
879856 return new ST_tna_t(parent);
880857 }
881 if (theClass == label_params_t.class) {
858 if (theClass == ST_label_params_t.class) {
882859 return new ST_label_params_t(parent);
883860 }
884 if (theClass == object_t.class) {
861 if (theClass == ST_object_t.class) {
885862 return new ST_object_t(parent);
886863 }
887 if (theClass == xlabel_t.class) {
864 if (theClass == ST_xlabel_t.class) {
888865 return new ST_xlabel_t(parent);
889866 }
890 if (theClass == XLabels_t.class) {
867 if (theClass == ST_XLabels_t.class) {
891868 return new ST_XLabels_t(parent);
892869 }
893 if (theClass == HDict_t.class) {
870 if (theClass == ST_HDict_t.class) {
894871 return new ST_HDict_t(parent);
895872 }
896 if (theClass == RTree.class) {
873 if (theClass == ST_RTree.class) {
897874 return new ST_RTree(parent);
898875 }
899 if (theClass == _Node_t___.class) {
876 if (theClass == ST_Node_t___.class) {
900877 return new ST_Node_t___(parent);
901878 }
879 if (theClass == ST_cinfo_t.class) {
880 return new ST_cinfo_t(parent);
881 }
902882 // }
903883 notFound(theClass);
904 return new StarStructImpl(theClass, parent);
884 throw new UnsupportedOperationException();
905885 }
906886
907887 private static final Set<String> todo = new LinkedHashSet<String>();
3939
4040 public class JUtilsDebug {
4141
42 private final static Debug debug = new Debug();
42 private final static Debug debug = null; //new Debug();
4343
4444 static public void ENTERING(String signature, String methodName) {
45 debug.entering(signature, methodName);
45 if (debug != null)
46 debug.entering(signature, methodName);
4647 }
4748
4849 static public void LEAVING(String signature, String methodName) {
49 debug.leaving(signature, methodName);
50 if (debug != null)
51 debug.leaving(signature, methodName);
52 }
53
54 public static void reset() {
55 if (debug != null)
56 debug.reset();
57 }
58
59 public static void printMe() {
60 if (debug != null)
61 debug.printMe();
5062 }
5163
5264 }
+0
-652
src/smetana/core/JUtilsOk1.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import h.Agclos_s;
39 import h.Agdesc_s;
40 import h.Agdisc_s;
41 import h.Agdstate_s;
42 import h.Agedge_s;
43 import h.Agedgeinfo_t;
44 import h.Agiddisc_s;
45 import h.Agiodisc_s;
46 import h.Agmemdisc_s;
47 import h.Agobj_s;
48 import h.Agraph_s;
49 import h.Agrec_s;
50 import h.Agsubnode_s;
51 import h.Agsym_s;
52 import h.Agtag_s;
53 import h.Ppoly_t;
54 import h.ST_Agclos_s;
55 import h.ST_Agdesc_s;
56 import h.ST_Agdisc_s;
57 import h.ST_Agdstate_s;
58 import h.ST_Agedge_s;
59 import h.ST_Agiddisc_s;
60 import h.ST_Agiodisc_s;
61 import h.ST_Agmemdisc_s;
62 import h.ST_Agobj_s;
63 import h.ST_Agraph_s;
64 import h.ST_Agrec_s;
65 import h.ST_Agsubnode_s;
66 import h.ST_Agsym_s;
67 import h.ST_Agtag_s;
68 import h.ST_Ppoly_t;
69 import h.ST_arrowname_t;
70 import h.ST_arrowtype_t;
71 import h.ST_boxf;
72 import h.ST_deque_t;
73 import h.ST_dtdisc_s;
74 import h.ST_dtlink_s;
75 import h.ST_dtmethod_s;
76 import h.ST_elist;
77 import h.ST_nlist_t;
78 import h.ST_pointf;
79 import h.ST_pointnlink_t;
80 import h.ST_polygon_t;
81 import h.ST_port;
82 import h.ST_refstr_t;
83 import h.ST_shape_desc;
84 import h.ST_shape_functions;
85 import h.ST_splineInfo;
86 import h.ST_textfont_t;
87 import h._dtdisc_s;
88 import h._dtlink_s;
89 import h._dtmethod_s;
90 import h.arrowname_t;
91 import h.arrowtype_t;
92 import h.bezier;
93 import h.boxf;
94 import h.deque_t;
95 import h.elist;
96 import h.nlist_t;
97 import h.pointf;
98 import h.pointnlink_t;
99 import h.polygon_t;
100 import h.port;
101 import h.refstr_t;
102 import h.shape_desc;
103 import h.shape_functions;
104 import h.splineInfo;
105 import h.splines;
106 import h.textfont_t;
107 import smetana.core.amiga.StarArrayOfInteger;
108 import smetana.core.amiga.StarArrayOfPtr;
109 import smetana.core.amiga.StarArrayOfStruct;
110 import smetana.core.amiga.StarStar;
111 import smetana.core.amiga.StarStruct;
112 import smetana.core.amiga.StarStructImpl;
113
114 // http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.7.4
115 // http://www.jbox.dk/sanos/source/lib/string.c.html
116
117 public class JUtilsOk1 {
118
119 public static int USHRT_MAX = 65535;
120
121 public static size_t sizeof(Class cl) {
122 return new size_t_struct(cl);
123 }
124
125 public static size_t sizeof(__ptr__ element) {
126 return new size_t_of_element(element);
127 }
128
129 public static size_t sizeof(String name, int sz) {
130 if (name.equals("char*")) {
131 return new size_t_array_of_charstars(sz);
132 }
133 throw new UnsupportedOperationException();
134 }
135
136 public static size_t sizeof(Class cl, int nb) {
137 if (cl == pointf.class) {
138 return ST_pointf.sizeof(nb);
139 }
140 if (cl == boxf.class) {
141 return ST_boxf.sizeof(nb);
142 }
143 if (cl == pointnlink_t.class) {
144 return ST_pointnlink_t.sizeof(nb);
145 }
146 if (from(cl) instanceof __struct_impl__ == false) {
147 throw new IllegalArgumentException(cl.getName());
148 }
149 return new size_t_array_of_something(cl, nb);
150 }
151
152 public static size_t size_t_array_of_integer(int nb) {
153 return new size_t_array_of_integer(nb);
154 }
155
156 public static size_t sizeof_starstar_empty(Class cl, int nb) {
157 if (cl == pointnlink_t.class) {
158 return ST_pointnlink_t.sizeof_starstar_empty(nb);
159 }
160 if (from(cl) instanceof __struct_impl__ == false) {
161 throw new IllegalArgumentException(cl.getName());
162 }
163 return new size_t_array_of_array_of_something_empty(cl, nb);
164 }
165
166 public static int strcmp(CString s1, CString s2) {
167 return s1.compareTo(s2);
168 }
169
170 public static int strncmp(CString s1, CString s2, int n) {
171 return s1.compareTo(s2, n);
172 }
173
174 public static CString strstr(CString s1, CString s2) {
175 throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2);
176 }
177
178 public static void strncpy(CString destination, CString source, int nb) {
179 destination.copyFrom(source, nb);
180 }
181
182 public static CString strchr(CString str, char c) {
183 return str.strchr(c);
184 }
185
186 public static int strtol(CString str, CString[] endptr, int base) {
187 if (base != 10) {
188 throw new IllegalArgumentException();
189 }
190 CString end = str;
191 int result = Integer.parseInt(end.getContent());
192 endptr[0] = end.plus(("" + result).length());
193 return result;
194 }
195
196 public static double strtod(CString str, CString[] endptr) {
197 final double result = Double.parseDouble(str.getContent());
198 return result;
199 }
200
201 public static double atof(CString str) {
202 return Double.parseDouble(str.getContent());
203 }
204
205 public static int memcmp(__ptr__ s1, __ptr__ s2, int sz) {
206 throw new UnsupportedOperationException("s1=" + s1 + " s2=" + s2 + " sz=" + sz);
207 }
208
209 public static void memset(__ptr__ obj, int value, size_t nbytes) {
210 if (value != 0) {
211 throw new UnsupportedOperationException();
212 }
213 }
214
215 public static int strlen(CString s) {
216 return s.length();
217 }
218
219 public static double abs(double x) {
220 return Math.abs(x);
221 }
222
223 public static double cos(double x) {
224 return Math.cos(x);
225 }
226
227 public static double sin(double x) {
228 return Math.sin(x);
229 }
230
231 public static double sqrt(double x) {
232 return Math.sqrt(x);
233 }
234
235 public static double atan2(double a, double b) {
236 return Math.atan2(a, b);
237 }
238
239 public static double pow(double a, double b) {
240 return Math.pow(a, b);
241 }
242
243 public static boolean isdigit(char c) {
244 return Character.isDigit(c);
245 }
246
247 public static int atoi(CString s) {
248 return Integer.parseInt(s.getContent());
249 }
250
251 public static char tolower(char c) {
252 return Character.toLowerCase(c);
253 }
254
255 public static CFunction function(Class codingClass, String name) {
256 return CFunctionImpl.create(codingClass, name);
257 }
258
259 public static int enumAsInt(Class enumClass, String name) {
260 CEnumInterpretor interpretor = new CEnumInterpretor(enumClass);
261 final int result = interpretor.valueOf(name);
262 JUtilsOk1.LOG("result for " + name + " is " + result);
263 return result;
264 }
265
266 public static CString getenv(CString var) {
267 return null;
268 }
269
270 public static void LOG(String s) {
271 // System.err.println(s);
272 }
273
274 public static void LOG2(String s) {
275 // System.err.println(s);
276 }
277
278 public static boolean EQ(Object o1, Object o2) {
279 if (o1 == o2) {
280 return true;
281 }
282 if (o1 == null && o2 != null) {
283 return false;
284 }
285 if (o2 == null && o1 != null) {
286 return false;
287 }
288 // if (o1 instanceof AreaArray && o2 instanceof AreaArray) {
289 // return ((AreaArray) o1).isSameThan((AreaArray) o2);
290 // }
291 if (o1 instanceof StarStruct && o2 instanceof StarStruct) {
292 return ((StarStruct) o1).isSameThan((StarStruct) o2);
293 }
294 if (o1 instanceof CString && o2 instanceof CString) {
295 return ((CString) o1).isSameThan((CString) o2);
296 }
297 if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfPtr) {
298 return ((StarArrayOfPtr) o1).isSameThan((StarArrayOfPtr) o2);
299 }
300 if (o1 instanceof StarStar && o2 instanceof StarStruct) {
301 __ptr__ o1b = ((StarStar) o1).getPtr();
302 if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2).getRealClass()) {
303 throw new UnsupportedOperationException();
304 }
305 return EQ(o1b, o2);
306 }
307 if (o1 instanceof StarStruct && o2 instanceof StarArrayOfPtr) {
308 __ptr__ o2b = ((StarArrayOfPtr) o2).getPtrForEquality();
309 if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
310 throw new UnsupportedOperationException();
311 }
312 return EQ(o1, o2b);
313 }
314 if (o1 instanceof StarStruct && o2 instanceof StarArrayOfStruct) {
315 __ptr__ o2b = ((StarArrayOfStruct) o2).getPtrForEquality();
316 if (((StarStruct) o1).getRealClass() != ((StarStruct) o2b).getRealClass()) {
317 throw new UnsupportedOperationException();
318 }
319 return EQ(o1, o2b);
320 }
321 if (o1 instanceof StarStar && o2 instanceof StarArrayOfPtr) {
322 __ptr__ o1b = ((StarStar) o1).getPtr();
323 __ptr__ o2b = ((StarArrayOfPtr) o2).getPtr();
324 if (((StarStruct) o1b).getRealClass() != ((StarStruct) o2b).getRealClass()) {
325 throw new UnsupportedOperationException();
326 }
327 return EQ(o1b, o2b);
328 }
329 if (o1 instanceof StarArrayOfStruct && o2 instanceof StarArrayOfStruct) {
330 StarArrayOfStruct oo1 = (StarArrayOfStruct) o1;
331 StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
332 return oo1.isSameThan(oo2);
333 }
334 if (o1 instanceof StarArrayOfPtr && o2 instanceof StarArrayOfStruct) {
335 StarArrayOfPtr oo1 = (StarArrayOfPtr) o1;
336 StarArrayOfStruct oo2 = (StarArrayOfStruct) o2;
337 __struct__ s1 = oo1.getStruct();
338 __struct__ s2 = oo2.getStruct();
339 boolean result = s1.getInternalData().isSameThan(s2.getInternalData());
340 return result;
341 }
342 System.err.println("o1=" + o1.getClass() + " " + o1);
343 System.err.println("o2=" + o2.getClass() + " " + o2);
344 throw new UnsupportedOperationException();
345 }
346
347 public static boolean NEQ(Object o1, Object o2) {
348 return EQ(o1, o2) == false;
349 }
350
351 public static void qsort(__ptr__ array, int nb, size_t size, CFunction compare) {
352 if (nb <= 1) {
353 return;
354 }
355 JUtilsOk1.LOG("array=" + array);
356 JUtilsOk1.LOG("nb=" + nb);
357 JUtilsOk1.LOG("size=" + size);
358 JUtilsOk1.LOG("compare=" + compare);
359 boolean change;
360 do {
361 change = false;
362 for (int i = 0; i < nb - 1; i++) {
363 __ptr__ element1 = array.plus(i);
364 __ptr__ element2 = array.plus(i + 1);
365 Integer cmp = (Integer) compare.exe(element1, element2);
366 JUtilsOk1.LOG("cmp=" + cmp);
367 if (cmp.intValue() > 0) {
368 change = true;
369 if (array instanceof StarArrayOfInteger) {
370 ((StarArrayOfInteger) array).swap(i, i + 1);
371 } else {
372 ((StarStar) array).swap(i, i + 1);
373 }
374 }
375 }
376 } while (change);
377 for (int i = 0; i < nb - 1; i++) {
378 __ptr__ element1 = array.plus(i);
379 __ptr__ element2 = array.plus(i + 1);
380 JUtilsOk1.LOG("element1=" + element1);
381 JUtilsOk1.LOG("element2=" + element2);
382 Integer cmp = (Integer) compare.exe(element1, element2);
383 JUtilsOk1.LOG("cmp=" + cmp);
384 if (cmp.intValue() > 0) {
385 throw new IllegalStateException();
386 }
387 }
388 }
389
390 static public int setjmp(jmp_buf jmp) {
391 // if (jmp.hasBeenCalled()) {
392 // throw new UnsupportedOperationException();
393 // }
394 jmp.saveCallingEnvironment();
395 return 0;
396 }
397
398 // DEBUG
399
400 public static void printDebugEdge(Agedge_s e) {
401 System.err.println("*********** PRINT EDGE ********** ");
402 final Agedgeinfo_t data = (Agedgeinfo_t) Macro.AGDATA(e).castTo(Agedgeinfo_t.class);
403 final splines splines = (splines) data.getPtr("spl");
404 __struct__<boxf> bb = splines.getStruct("bb");
405 final bezier list = (bezier) splines.getPtr("list");
406 System.err.println("splines.size=" + splines.getInt("size"));
407 System.err.println("bb.LL=" + pointftoString(bb.getStruct("LL")));
408 System.err.println("bb.UR=" + pointftoString(bb.getStruct("UR")));
409 printDebugBezier((bezier) splines.getPtr("list").getPtr());
410
411 }
412
413 private static String pointftoString(__struct__<pointf> point) {
414 final StringBuilder sb = new StringBuilder();
415 sb.append("(");
416 sb.append(point.getDouble("x"));
417 sb.append(" ; ");
418 sb.append(point.getDouble("y"));
419 sb.append(")");
420 return sb.toString();
421 }
422
423 private static void printDebugBezier(bezier bezier) {
424 System.err.println("bezier.size=" + bezier.getInt("size"));
425 System.err.println("bezier.sflag=" + bezier.getInt("sflag"));
426 System.err.println("splines.eflag=" + bezier.getInt("eflag"));
427 System.err.println("bezier.sp=" + pointftoString(bezier.getStruct("sp")));
428 System.err.println("bezier.ep=" + pointftoString(bezier.getStruct("ep")));
429 for (int i = 0; i < bezier.getInt("size"); i++) {
430 final __ptr__ pt = bezier.getPtr("list").plus(i).getPtr();
431 System.err.println("pt=" + pointftoString(pt));
432 }
433 }
434
435 private static String pointftoString(__ptr__ point) {
436 final StringBuilder sb = new StringBuilder();
437 sb.append("(");
438 sb.append(point.getDouble("x"));
439 sb.append(" ; ");
440 sb.append(point.getDouble("y"));
441 sb.append(")");
442 return sb.toString();
443 }
444
445 public static <C extends __ptr__> __struct__<C> from(Class<C> theClass) {
446 if (theClass == _dtmethod_s.class) {
447 return new ST_dtmethod_s();
448 }
449 if (theClass == _dtdisc_s.class) {
450 return new ST_dtdisc_s();
451 }
452 if (theClass == Agdesc_s.class) {
453 return new ST_Agdesc_s();
454 }
455 if (theClass == Agtag_s.class) {
456 return new ST_Agtag_s();
457 }
458 if (theClass == Agiddisc_s.class) {
459 return new ST_Agiddisc_s();
460 }
461 if (theClass == Agmemdisc_s.class) {
462 return new ST_Agmemdisc_s();
463 }
464 if (theClass == nlist_t.class) {
465 return new ST_nlist_t();
466 }
467 if (theClass == arrowname_t.class) {
468 return new ST_arrowname_t();
469 }
470 if (theClass == arrowtype_t.class) {
471 return new ST_arrowtype_t();
472 }
473 if (theClass == elist.class) {
474 return new ST_elist();
475 }
476 if (theClass == pointf.class) {
477 return new ST_pointf();
478 }
479 if (theClass == boxf.class) {
480 return new ST_boxf();
481 }
482 if (theClass == port.class) {
483 return new ST_port();
484 }
485 if (theClass == polygon_t.class) {
486 return new ST_polygon_t();
487 }
488 if (theClass == shape_functions.class) {
489 return new ST_shape_functions();
490 }
491 if (theClass == shape_desc.class) {
492 return new ST_shape_desc();
493 }
494 if (theClass == deque_t.class) {
495 return new ST_deque_t();
496 }
497 if (theClass == pointnlink_t.class) {
498 return new ST_pointnlink_t();
499 }
500 if (theClass == Ppoly_t.class) {
501 return new ST_Ppoly_t();
502 }
503 if (theClass == splineInfo.class) {
504 return new ST_splineInfo();
505 }
506 if (theClass == textfont_t.class) {
507 return new ST_textfont_t();
508 }
509 //
510 // if (theClass == Agsubnode_s.class) {
511 // return new ST_Agsubnode_s();
512 // }
513 // if (theClass == _dtlink_s.class) {
514 // return new ST_dtlink_s();
515 // }
516 // if (theClass == refstr_t.class) {
517 // return new ST_refstr_t();
518 // }
519 // if (theClass == Agsym_s.class) {
520 // return new ST_Agsym_s();
521 // }
522 // if (theClass == Agedge_s.class) {
523 // return new ST_Agedge_s();
524 // }
525 // if (theClass == Agobj_s.class) {
526 // return new ST_Agobj_s();
527 // }
528 // if (theClass == Agrec_s.class) {
529 // return new ST_Agrec_s();
530 // }
531 // if (theClass == Agraph_s.class) {
532 // return new ST_Agraph_s();
533 // }
534 // if (theClass == Agclos_s.class) {
535 // return new ST_Agclos_s();
536 // }
537 // if (theClass == Agdisc_s.class) {
538 // return new ST_Agdisc_s();
539 // }
540 // if (theClass == Agdstate_s.class) {
541 // return new ST_Agdstate_s();
542 // }
543 // if (theClass == Agiodisc_s.class) {
544 // return new ST_Agiodisc_s();
545 // }
546
547 return new __struct_impl__<C>(theClass);
548 }
549
550 public static StarStruct create(Class theClass, StarStruct parent) {
551 if (theClass == _dtmethod_s.class) {
552 throw new IllegalArgumentException(theClass.toString());
553 }
554 if (theClass == _dtdisc_s.class) {
555 return new ST_dtdisc_s(parent);
556 }
557 if (theClass == Agdesc_s.class) {
558 return new ST_Agdesc_s(parent);
559 }
560 if (theClass == Agtag_s.class) {
561 return new ST_Agtag_s(parent);
562 }
563 if (theClass == Agiddisc_s.class) {
564 throw new IllegalArgumentException(theClass.toString());
565 }
566 if (theClass == Agmemdisc_s.class) {
567 throw new IllegalArgumentException(theClass.toString());
568 }
569 if (theClass == nlist_t.class) {
570 return new ST_nlist_t(parent);
571 }
572 if (theClass == arrowname_t.class) {
573 throw new IllegalArgumentException(theClass.toString());
574 }
575 if (theClass == arrowtype_t.class) {
576 throw new IllegalArgumentException(theClass.toString());
577 }
578 if (theClass == elist.class) {
579 return new ST_elist(parent);
580 }
581 if (theClass == pointf.class) {
582 return new ST_pointf(parent);
583 }
584 if (theClass == boxf.class) {
585 return new ST_boxf(parent);
586 }
587 if (theClass == port.class) {
588 return new ST_port(parent);
589 }
590 if (theClass == polygon_t.class) {
591 return new ST_polygon_t(parent);
592 }
593 if (theClass == shape_functions.class) {
594 return new ST_shape_functions(parent);
595 }
596 if (theClass == shape_desc.class) {
597 return new ST_shape_desc(parent);
598 }
599 if (theClass == deque_t.class) {
600 return new ST_deque_t(parent);
601 }
602 if (theClass == pointnlink_t.class) {
603 return new ST_pointnlink_t(parent);
604 }
605 if (theClass == Ppoly_t.class) {
606 return new ST_Ppoly_t(parent);
607 }
608 if (theClass == splineInfo.class) {
609 return new ST_splineInfo(parent);
610 }
611 if (theClass == textfont_t.class) {
612 return new ST_textfont_t(parent);
613 }
614 //
615 // if (theClass == Agsubnode_s.class) {
616 // return new ST_Agsubnode_s(parent);
617 // }
618 // if (theClass == _dtlink_s.class) {
619 // return new ST_dtlink_s(parent);
620 // }
621 // if (theClass == refstr_t.class) {
622 // return new ST_refstr_t(parent);
623 // }
624 // if (theClass == Agsym_s.class) {
625 // return new ST_Agsym_s(parent);
626 // }
627 // if (theClass == Agedge_s.class) {
628 // return new ST_Agedge_s(parent);
629 // }
630 // if (theClass == Agobj_s.class) {
631 // return new ST_Agobj_s(parent);
632 // }
633 // if (theClass == Agrec_s.class) {
634 // return new ST_Agrec_s(parent);
635 // }
636 // if (theClass == Agraph_s.class) {
637 // return new ST_Agraph_s(parent);
638 // }
639 // if (theClass == Agclos_s.class) {
640 // return new ST_Agclos_s(parent);
641 // }
642 // if (theClass == Agdisc_s.class) {
643 // return new ST_Agdisc_s(parent);
644 // }
645 // if (theClass == Agdstate_s.class) {
646 // return new ST_Agdstate_s(parent);
647 // }
648 return new StarStructImpl(theClass, parent);
649 }
650
651 }
3535
3636 package smetana.core;
3737
38 import h.Agedge_s;
39 import h.Agedgeinfo_t;
40 import h.Agnode_s;
41 import h.Agnodeinfo_t;
42 import h.Agobj_s;
43 import h.Agraph_s;
44 import h.Agraphinfo_t;
45 import h.GVC_s;
38 import h.ST_Agedge_s;
39 import h.ST_Agedgeinfo_t;
40 import h.ST_Agnode_s;
41 import h.ST_Agnodeinfo_t;
42 import h.ST_Agobj_s;
43 import h.ST_Agraph_s;
44 import h.ST_Agraphinfo_t;
45 import h.ST_Agrec_s;
4646 import h.ST_Agtag_s;
47 import h.ST_GVC_s;
48 import h.ST_Pedge_t;
49 import h.ST_bezier;
4750 import h.ST_boxf;
4851 import h.ST_elist;
52 import h.ST_layout_t;
4953 import h.ST_nlist_t;
5054 import h.ST_pointf;
5155 import h.ST_port;
52 import h.elist;
53 // http://docs.oracle.com/javase/specs/jls/se5.0/html/expressions.html#15.7.4
54 // http://www.jbox.dk/sanos/source/lib/string.c.html
55 import h.pointf;
56 import h.port;
57 import h.splines;
58 import h.textlabel_t;
56 import h.ST_rank_t;
57 import h.ST_shape_desc;
58 import h.ST_splines;
59 import h.ST_textlabel_t;
60 import h.ST_textspan_t;
5961
6062 import java.util.regex.Matcher;
6163 import java.util.regex.Pattern;
9496
9597 public static boolean NOT(boolean v) {
9698 return v == false;
99 }
100
101 public static int NOTI(boolean v) {
102 return v ? 0 : 1;
97103 }
98104
99105 public static boolean NOT(int i) {
135141
136142 // #define AGTAG(obj) (((Agobj_t*)(obj))->tag)
137143 public static ST_Agtag_s AGTAG(__ptr__ obj) {
138 return (ST_Agtag_s) obj.castTo(Agobj_s.class).getStruct("tag");
144 return (ST_Agtag_s) ((ST_Agobj_s) obj.castTo(ST_Agobj_s.class)).tag;
139145 }
140146
141147 // #define AGTYPE(obj) (AGTAG(obj).objtype)
167173
168174 // #define AGATTRWF(obj) (AGTAG(obj).attrwf)
169175 // #define AGDATA(obj) (((Agobj_t*)(obj))->data)
170 public static __ptr__ AGDATA(__ptr__ obj) {
171 return obj.castTo(Agobj_s.class).getPtr("data");
176 public static ST_Agrec_s AGDATA(__ptr__ obj) {
177 return ((ST_Agobj_s) obj.castTo(ST_Agobj_s.class)).data;
172178 }
173179
174180 public static void AGDATA(__ptr__ obj, __ptr__ v) {
175 obj.castTo(Agobj_s.class).setPtr("data", v);
181 obj.castTo(ST_Agobj_s.class).setPtr("data", v);
176182 }
177183
178184 // #define AGIN2OUT(e) ((e)-1)
186192 }
187193
188194 // #define AGOPP(e) ((AGTYPE(e)==AGINEDGE)?AGIN2OUT(e):AGOUT2IN(e))
189 public static Agedge_s AGOPP(Agedge_s e) {
190 return (Agedge_s) (AGTYPE(e) == AGINEDGE ? AGIN2OUT(e) : AGOUT2IN(e));
195 public static ST_Agedge_s AGOPP(ST_Agedge_s e) {
196 return (ST_Agedge_s) (AGTYPE(e) == AGINEDGE ? AGIN2OUT(e) : AGOUT2IN(e));
191197 }
192198
193199 // #define AGMKOUT(e) (AGTYPE(e) == AGOUTEDGE? (e): AGIN2OUT(e))
194 public static Agedge_s AGMKOUT(__ptr__ e) {
195 return (Agedge_s) (AGTYPE(e) == AGOUTEDGE ? (e) : AGIN2OUT(e));
200 public static ST_Agedge_s AGMKOUT(__ptr__ e) {
201 return (ST_Agedge_s) (AGTYPE(e) == AGOUTEDGE ? (e) : AGIN2OUT(e));
196202 }
197203
198204 // #define AGMKIN(e) (AGTYPE(e) == AGINEDGE? (e): AGOUT2IN(e))
199 public static Agedge_s AGMKIN(__ptr__ e) {
200 return (Agedge_s) (AGTYPE(e) == AGINEDGE ? (e) : AGOUT2IN(e));
205 public static ST_Agedge_s AGMKIN(__ptr__ e) {
206 return (ST_Agedge_s) (AGTYPE(e) == AGINEDGE ? (e) : AGOUT2IN(e));
201207 }
202208
203209 // #define AGTAIL(e) (AGMKIN(e)->node)
204 public static Agnode_s AGTAIL(__ptr__ e) {
205 return (Agnode_s) AGMKIN(e).getPtr("node");
206 }
207
208 public static Agnode_s agtail(__ptr__ e) {
209 return (Agnode_s) AGMKIN(e).getPtr("node");
210 }
211
212 public static void agtail(Agedge_s e, __ptr__ v) {
210 public static ST_Agnode_s AGTAIL(__ptr__ e) {
211 return (ST_Agnode_s) AGMKIN(e).node;
212 }
213
214 public static ST_Agnode_s agtail(__ptr__ e) {
215 return (ST_Agnode_s) AGMKIN(e).node;
216 }
217
218 public static void agtail(ST_Agedge_s e, __ptr__ v) {
213219 AGMKIN(e).setPtr("node", v);
214220 }
215221
216222 // #define AGHEAD(e) (AGMKOUT(e)->node)
217 public static Agnode_s AGHEAD(__ptr__ e) {
218 return (Agnode_s) AGMKOUT(e).getPtr("node");
219 }
220
221 private static Agnode_s aghead(Agedge_s e) {
222 return (Agnode_s) AGMKOUT(e).getPtr("node");
223 }
224
225 public static void aghead(Agedge_s e, __ptr__ v) {
223 public static ST_Agnode_s AGHEAD(__ptr__ e) {
224 return (ST_Agnode_s) AGMKOUT(e).node;
225 }
226
227 private static ST_Agnode_s aghead(ST_Agedge_s e) {
228 return (ST_Agnode_s) AGMKOUT(e).node;
229 }
230
231 public static void aghead(ST_Agedge_s e, __ptr__ v) {
226232 AGMKOUT(e).setPtr("node", v);
227233 }
228234
258264 // ((Dthold_t*)(rep))->obj)
259265
260266 // #define LENGTH(e) (ND_rank(aghead(e)) - ND_rank(agtail(e)))
261 public static int LENGTH(Agedge_s e) {
267 public static int LENGTH(ST_Agedge_s e) {
262268 return ND_rank(aghead(e)) - ND_rank(agtail(e));
263269 }
264270
265271 // #define SLACK(e) (LENGTH(e) - ED_minlen(e))
266 public static int SLACK(Agedge_s e) {
272 public static int SLACK(ST_Agedge_s e) {
267273 return LENGTH(e) - ED_minlen(e);
268274 }
269275
273279 }
274280
275281 // #define TREE_EDGE(e) (ED_tree_index(e) >= 0)
276 public static boolean TREE_EDGE(Agedge_s e) {
282 public static boolean TREE_EDGE(ST_Agedge_s e) {
277283 return ED_tree_index(e) >= 0;
278284 }
279285
280286 // #define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent)
281 public static __ptr__ GD_parent(Agraph_s g) {
282 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("parent");
283 }
284 public static void GD_parent(Agraph_s g, __ptr__ v) {
285 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("parent", v);
286 }
287
287 public static __ptr__ GD_parent(ST_Agraph_s g) {
288 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).parent;
289 }
290
291 public static void GD_parent(ST_Agraph_s g, __ptr__ v) {
292 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("parent", v);
293 }
294
288295 // #define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level)
289296 // #define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing)
290 public static __ptr__ GD_drawing(Agraph_s g) {
291 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("drawing");
292 }
293
294 public static void GD_drawing(Agraph_s g, __ptr__ v) {
295 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("drawing", v);
297 public static ST_layout_t GD_drawing(ST_Agraph_s g) {
298 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).drawing;
299 }
300
301 public static void GD_drawing(ST_Agraph_s g, __ptr__ v) {
302 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("drawing", v);
296303 }
297304
298305 // #define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb)
299306 public static ST_boxf GD_bb(__ptr__ g) {
300 return (ST_boxf) AGDATA(g).castTo(Agraphinfo_t.class).getStruct("bb");
307 return (ST_boxf) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).bb;
301308 }
302309
303310 // #define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc)
304 public static GVC_s GD_gvc(Agraph_s g) {
305 return (GVC_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("gvc");
306 }
307
308 public static void GD_gvc(Agraph_s g, GVC_s v) {
309 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("gvc", v);
311 public static ST_GVC_s GD_gvc(ST_Agraph_s g) {
312 return (ST_GVC_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).gvc;
313 }
314
315 public static void GD_gvc(ST_Agraph_s g, ST_GVC_s v) {
316 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("gvc", v);
310317 }
311318
312319 // #define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup)
313 public static __ptr__ GD_cleanup(Agraph_s g) {
314 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("cleanup");
320 public static __ptr__ GD_cleanup(ST_Agraph_s g) {
321 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).cleanup;
315322 }
316323
317324 // #define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist)
318325 // #define GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg)
319326 // #define GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border)
320 public static __array_of_struct__ GD_border(Agraph_s g) {
321 return AGDATA(g).castTo(Agraphinfo_t.class).getArrayOfStruct("border");
327 public static ST_pointf[] GD_border(ST_Agraph_s g) {
328 return ((ST_Agraphinfo_t) AGDATA(g).castTo(ST_Agraphinfo_t.class)).border;
322329 }
323330
324331 // #define GD_cl_cnt(g) (((Agraphinfo_t*)AGDATA(g))->cl_nt)
325332 // #define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust)
326 public static __ptr__ GD_clust(Agraph_s g) {
327 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("clust");
328 }
329 public static void GD_clust(Agraph_s g, __ptr__ v) {
330 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("clust", v);
333 public static ST_Agraph_s.Array GD_clust(ST_Agraph_s g) {
334 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).clust;
335 }
336
337 public static void GD_clust(ST_Agraph_s g, __ptr__ v) {
338 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("clust", v);
331339 }
332340
333341 // #define GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot)
334 public static Agraph_s GD_dotroot(Agraph_s g) {
335 return (Agraph_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("dotroot");
336 }
337
338 public static void GD_dotroot(Agraph_s g, __ptr__ v) {
339 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("dotroot", v);
342 public static ST_Agraph_s GD_dotroot(ST_Agraph_s g) {
343 return (ST_Agraph_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).dotroot;
344 }
345
346 public static void GD_dotroot(ST_Agraph_s g, __ptr__ v) {
347 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("dotroot", v);
340348 }
341349
342350 // #define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp)
343 public static ST_nlist_t GD_comp(Agraph_s g) {
344 return (ST_nlist_t) AGDATA(g).castTo(Agraphinfo_t.class).getStruct("comp");
351 public static ST_nlist_t GD_comp(ST_Agraph_s g) {
352 return (ST_nlist_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).comp;
345353 }
346354
347355 // #define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep)
348 public static int GD_exact_ranksep(Agraph_s g) {
349 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("exact_ranksep");
350 }
351
352 public static void GD_exact_ranksep(Agraph_s g, int v) {
353 AGDATA(g).castTo(Agraphinfo_t.class).setInt("exact_ranksep", v);
356 public static int GD_exact_ranksep(ST_Agraph_s g) {
357 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).exact_ranksep;
358 }
359
360 public static void GD_exact_ranksep(ST_Agraph_s g, int v) {
361 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("exact_ranksep", v);
354362 }
355363
356364 // #define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded)
357 public static boolean GD_expanded(Agraph_s g) {
358 return AGDATA(g).castTo(Agraphinfo_t.class).getBoolean("expanded");
359 }
360 public static void GD_expanded(Agraph_s g, boolean v) {
361 AGDATA(g).castTo(Agraphinfo_t.class).setBoolean("expanded", v);
362 }
363
365 public static boolean GD_expanded(ST_Agraph_s g) {
366 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded;
367 }
368
369 public static void GD_expanded(ST_Agraph_s g, boolean v) {
370 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded = v;
371 }
372
364373 // #define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags)
365 public static int GD_flags(Agraph_s g) {
366 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("flags");
367 }
368
369 public static void GD_flags(Agraph_s g, int v) {
370 AGDATA(g).castTo(Agraphinfo_t.class).setInt("flags", v);
374 public static int GD_flags(ST_Agraph_s g) {
375 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).flags;
376 }
377
378 public static void GD_flags(ST_Agraph_s g, int v) {
379 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("flags", v);
371380 }
372381
373382 // #define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state)
374383 // #define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset)
375 public static int GD_charset(Agraph_s g) {
376 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("charset");
377 }
378
379 public static void GD_charset(Agraph_s g, int v) {
380 AGDATA(g).castTo(Agraphinfo_t.class).setInt("charset", v);
384 public static int GD_charset(ST_Agraph_s g) {
385 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).charset;
386 }
387
388 public static void GD_charset(ST_Agraph_s g, int v) {
389 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("charset", v);
381390 }
382391
383392 // #define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels)
384393 public static int GD_has_labels(__ptr__ g) {
385 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("has_labels");
394 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_labels;
386395 }
387396
388397 public static void GD_has_labels(__ptr__ g, int v) {
389 AGDATA(g).castTo(Agraphinfo_t.class).setInt("has_labels", v);
398 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("has_labels", v);
390399 }
391400
392401 // #define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images)
393402 // #define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges)
394 public static int GD_has_flat_edges(Agraph_s g) {
395 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("has_flat_edges");
396 }
397 public static void GD_has_flat_edges(Agraph_s g, boolean v) {
398 AGDATA(g).castTo(Agraphinfo_t.class).setBoolean("has_flat_edges", v);
403 public static int GD_has_flat_edges(ST_Agraph_s g) {
404 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges;
405 }
406
407 public static void GD_has_flat_edges(ST_Agraph_s g, boolean v) {
408 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges = v?1:0;
399409 }
400410
401411 // #define GD_has_sourcerank(g) (((Agraphinfo_t*)AGDATA(g))->has_sourcerank)
402412 // #define GD_has_sinkrank(g) (((Agraphinfo_t*)AGDATA(g))->has_sinkrank)
403413 // #define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1)
404 public static double GD_ht1(Agraph_s g) {
405 return AGDATA(g).castTo(Agraphinfo_t.class).getDouble("ht1");
406 }
407
408 public static void GD_ht1(Agraph_s g, double v) {
409 AGDATA(g).castTo(Agraphinfo_t.class).setDouble("ht1", v);
414 public static double GD_ht1(ST_Agraph_s g) {
415 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht1;
416 }
417
418 public static void GD_ht1(ST_Agraph_s g, double v) {
419 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht1", v);
410420 }
411421
412422 // #define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2)
413 public static double GD_ht2(Agraph_s g) {
414 return AGDATA(g).castTo(Agraphinfo_t.class).getDouble("ht2");
415 }
416
417 public static void GD_ht2(Agraph_s g, double v) {
418 AGDATA(g).castTo(Agraphinfo_t.class).setDouble("ht2", v);
423 public static double GD_ht2(ST_Agraph_s g) {
424 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht2;
425 }
426
427 public static void GD_ht2(ST_Agraph_s g, double v) {
428 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht2", v);
419429 }
420430
421431 // #define GD_inleaf(g) (((Agraphinfo_t*)AGDATA(g))->inleaf)
422432 // #define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed)
423 public static int GD_installed(Agraph_s g) {
424 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("installed");
425 }
426 public static void GD_installed(Agraph_s g, int v) {
427 AGDATA(g).castTo(Agraphinfo_t.class).setInt("installed", v);
433 public static int GD_installed(ST_Agraph_s g) {
434 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).installed;
435 }
436
437 public static void GD_installed(ST_Agraph_s g, int v) {
438 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("installed", v);
428439 }
429440
430441 // #define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label)
431 public static textlabel_t GD_label(__ptr__ g) {
432 return (textlabel_t) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("label");
433 }
442 public static ST_textlabel_t GD_label(__ptr__ g) {
443 return (ST_textlabel_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label;
444 }
445
434446 public static void GD_label(__ptr__ g, __ptr__ v) {
435 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("label", v);
447 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("label", v);
436448 }
437449
438450 // #define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader)
439 public static Agnode_s GD_leader(Agraph_s g) {
440 return (Agnode_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("leader");
441 }
442 public static void GD_leader(Agraph_s g, __ptr__ v) {
443 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("leader", v);
444 }
445
451 public static ST_Agnode_s GD_leader(ST_Agraph_s g) {
452 return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).leader;
453 }
454
455 public static void GD_leader(ST_Agraph_s g, __ptr__ v) {
456 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("leader", v);
457 }
458
446459 // #define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir)
447 public static int GD_rankdir2(Agraph_s g) {
448 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("rankdir");
449 }
450
451 public static void GD_rankdir2(Agraph_s g, int v) {
452 AGDATA(g).castTo(Agraphinfo_t.class).setInt("rankdir", v);
460 public static int GD_rankdir2(ST_Agraph_s g) {
461 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir;
462 }
463
464 public static void GD_rankdir2(ST_Agraph_s g, int v) {
465 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("rankdir", v);
453466 }
454467
455468 // #define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3)
456 public static int GD_rankdir(Agraph_s g) {
457 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("rankdir") & 0x3;
469 public static int GD_rankdir(ST_Agraph_s g) {
470 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir & 0x3;
458471 }
459472
460473 // #define GD_flip(g) (GD_rankdir(g) & 1)
461 public static int GD_flip(Agraph_s g) {
474 public static int GD_flip(ST_Agraph_s g) {
462475 return GD_rankdir(g) & 1;
463476 }
464477
465478 // #define GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2)
466479 // #define GD_realflip(g) (GD_realrankdir(g) & 1)
467480 // #define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln)
468 public static Agnode_s GD_ln(Agraph_s g) {
469 return (Agnode_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("ln");
470 }
471 public static void GD_ln(Agraph_s g, __ptr__ v) {
472 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("ln", v);
473 }
474
481 public static ST_Agnode_s GD_ln(ST_Agraph_s g) {
482 return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ln;
483 }
484
485 public static void GD_ln(ST_Agraph_s g, __ptr__ v) {
486 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("ln", v);
487 }
488
475489 // #define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank)
476 public static int GD_maxrank(Agraph_s g) {
477 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("maxrank");
478 }
479
480 public static void GD_maxrank(Agraph_s g, int v) {
481 AGDATA(g).castTo(Agraphinfo_t.class).setInt("maxrank", v);
490 public static int GD_maxrank(ST_Agraph_s g) {
491 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxrank;
492 }
493
494 public static void GD_maxrank(ST_Agraph_s g, int v) {
495 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("maxrank", v);
482496 }
483497
484498 // #define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset)
485 public static __ptr__ GD_maxset(Agraph_s g) {
486 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("maxset");
499 public static __ptr__ GD_maxset(ST_Agraph_s g) {
500 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxset;
487501 }
488502
489503 // #define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank)
490 public static int GD_minrank(Agraph_s g) {
491 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("minrank");
492 }
493
494 public static void GD_minrank(Agraph_s g, int v) {
495 AGDATA(g).castTo(Agraphinfo_t.class).setInt("minrank", v);
504 public static int GD_minrank(ST_Agraph_s g) {
505 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minrank;
506 }
507
508 public static void GD_minrank(ST_Agraph_s g, int v) {
509 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("minrank", v);
496510 }
497511
498512 // #define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset)
499 public static __ptr__ GD_minset(Agraph_s g) {
500 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("minset");
513 public static __ptr__ GD_minset(ST_Agraph_s g) {
514 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minset;
501515 }
502516
503517 // #define GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep)
504518 // #define GD_maxrep(g) (((Agraphinfo_t*)AGDATA(g))->maxrep)
505519 // #define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move)
506520 // #define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster)
507 public static int GD_n_cluster(Agraph_s g) {
508 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("n_cluster");
509 }
510 public static void GD_n_cluster(Agraph_s g, int v) {
511 AGDATA(g).castTo(Agraphinfo_t.class).setInt("n_cluster", v);
521 public static int GD_n_cluster(ST_Agraph_s g) {
522 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_cluster;
523 }
524
525 public static void GD_n_cluster(ST_Agraph_s g, int v) {
526 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_cluster", v);
512527 }
513528
514529 // #define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes)
515 public static int GD_n_nodes(Agraph_s g) {
516 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("n_nodes");
517 }
518
519 public static void GD_n_nodes(Agraph_s g, int v) {
520 AGDATA(g).castTo(Agraphinfo_t.class).setInt("n_nodes", v);
530 public static int GD_n_nodes(ST_Agraph_s g) {
531 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_nodes;
532 }
533
534 public static void GD_n_nodes(ST_Agraph_s g, int v) {
535 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_nodes", v);
521536 }
522537
523538 // #define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim)
524539 // #define GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim)
525540 // #define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist)
526541 // #define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist)
527 public static Agnode_s GD_nlist(Agraph_s g) {
528 return (Agnode_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("nlist");
529 }
530
531 public static void GD_nlist(Agraph_s g, __ptr__ v) {
532 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("nlist", v);
542 public static ST_Agnode_s GD_nlist(ST_Agraph_s g) {
543 return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nlist;
544 }
545
546 public static void GD_nlist(ST_Agraph_s g, __ptr__ v) {
547 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("nlist", v);
533548 }
534549
535550 // #define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep)
536 public static int GD_nodesep(Agraph_s g) {
537 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("nodesep");
538 }
539
540 public static void GD_nodesep(Agraph_s g, int v) {
541 AGDATA(g).castTo(Agraphinfo_t.class).setInt("nodesep", v);
551 public static int GD_nodesep(ST_Agraph_s g) {
552 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nodesep;
553 }
554
555 public static void GD_nodesep(ST_Agraph_s g, int v) {
556 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("nodesep", v);
542557 }
543558
544559 // #define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf)
545560 // #define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank)
546 public static __ptr__ GD_rank(Agraph_s g) {
547 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("rank");
548 }
549
550 public static void GD_rank(Agraph_s g, __ptr__ v) {
551 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("rank", v);
561 public static ST_rank_t.Array2 GD_rank(ST_Agraph_s g) {
562 return (ST_rank_t.Array2) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rank;
563 }
564
565 public static void GD_rank(ST_Agraph_s g, ST_rank_t.Array2 v) {
566 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rank", v);
552567 }
553568
554569 // #define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader)
555 public static __ptr__ GD_rankleader(Agraph_s g) {
556 return AGDATA(g).castTo(Agraphinfo_t.class).getPtr("rankleader");
557 }
558 public static void GD_rankleader(Agraph_s g, __ptr__ v) {
559 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("rankleader", v);
570 public static ST_Agnode_s.Array GD_rankleader(ST_Agraph_s g) {
571 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankleader;
572 }
573
574 public static void GD_rankleader(ST_Agraph_s g, __ptr__ v) {
575 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rankleader", v);
560576 }
561577
562578 // #define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep)
563 public static int GD_ranksep(Agraph_s g) {
564 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("ranksep");
565 }
566
567 public static void GD_ranksep(Agraph_s g, int v) {
568 AGDATA(g).castTo(Agraphinfo_t.class).setInt("ranksep", v);
579 public static int GD_ranksep(ST_Agraph_s g) {
580 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ranksep;
581 }
582
583 public static void GD_ranksep(ST_Agraph_s g, int v) {
584 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("ranksep", v);
569585 }
570586
571587 // #define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn)
572 public static Agnode_s GD_rn(Agraph_s g) {
573 return (Agnode_s) AGDATA(g).castTo(Agraphinfo_t.class).getPtr("rn");
574 }
575 public static void GD_rn(Agraph_s g, __ptr__ v) {
576 AGDATA(g).castTo(Agraphinfo_t.class).setPtr("rn", v);
588 public static ST_Agnode_s GD_rn(ST_Agraph_s g) {
589 return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rn;
590 }
591
592 public static void GD_rn(ST_Agraph_s g, __ptr__ v) {
593 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rn", v);
577594 }
578595
579596 // #define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type)
580 public static int GD_set_type(Agraph_s g) {
581 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("set_type");
582 }
583 public static void GD_set_type(Agraph_s g, int v) {
584 AGDATA(g).castTo(Agraphinfo_t.class).setInt("set_type", v);
585 }
586
587
597 public static int GD_set_type(ST_Agraph_s g) {
598 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).set_type;
599 }
600
601 public static void GD_set_type(ST_Agraph_s g, int v) {
602 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("set_type", v);
603 }
604
588605 // #define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos)
589 public static int GD_label_pos(Agraph_s g) {
590 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("label_pos");
591 }
592 public static void GD_label_pos(Agraph_s g, int v) {
593 AGDATA(g).castTo(Agraphinfo_t.class).setInt("label_pos", v);
594 }
595
606 public static int GD_label_pos(ST_Agraph_s g) {
607 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label_pos;
608 }
609
610 public static void GD_label_pos(ST_Agraph_s g, int v) {
611 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("label_pos", v);
612 }
613
596614 // #define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes)
597 public static int GD_showboxes(Agraph_s g) {
598 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("showboxes");
599 }
600
601 public static void GD_showboxes(Agraph_s g, int v) {
602 AGDATA(g).castTo(Agraphinfo_t.class).setInt("showboxes", v);
615 public static int GD_showboxes(ST_Agraph_s g) {
616 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).showboxes;
617 }
618
619 public static void GD_showboxes(ST_Agraph_s g, int v) {
620 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("showboxes", v);
603621 }
604622
605623 // #define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames)
606 public static int GD_fontnames(Agraph_s g) {
607 return AGDATA(g).castTo(Agraphinfo_t.class).getInt("fontnames");
608 }
609
610 public static void GD_fontnames(Agraph_s g, int v) {
611 AGDATA(g).castTo(Agraphinfo_t.class).setInt("fontnames", v);
624 public static int GD_fontnames(ST_Agraph_s g) {
625 return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).fontnames;
626 }
627
628 public static void GD_fontnames(ST_Agraph_s g, int v) {
629 ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("fontnames", v);
612630 }
613631
614632 // #define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring)
616634 // #define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t)
617635
618636 // #define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id)
619 public static int ND_id(Agnode_s n) {
620 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("id");
621 }
622
637 public static int ND_id(ST_Agnode_s n) {
638 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).id;
639 }
640
623641 // #define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg)
624 public static __ptr__ ND_alg(Agnode_s n) {
625 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("alg");
626 }
627 public static void ND_alg(Agnode_s n, __ptr__ value) {
628 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("alg", value);
642 public static __ptr__ ND_alg(ST_Agnode_s n) {
643 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).alg;
644 }
645
646 public static void ND_alg(ST_Agnode_s n, __ptr__ value) {
647 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("alg", value);
629648 }
630649
631650 // #define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent)
632 public static Agnode_s ND_UF_parent(__ptr__ n) {
633 return (Agnode_s) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("UF_parent");
634 }
651 public static ST_Agnode_s ND_UF_parent(__ptr__ n) {
652 return (ST_Agnode_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_parent;
653 }
654
635655 public static void ND_UF_parent(__ptr__ n, __ptr__ v) {
636 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("UF_parent", v);
656 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("UF_parent", v);
637657 }
638658
639659 // #define ND_set(n) (((Agnodeinfo_t*)AGDATA(n))->set)
640660 // #define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size)
641 public static int ND_UF_size(Agnode_s n) {
642 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("UF_size");
643 }
644 public static void ND_UF_size(Agnode_s n, int v) {
645 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("UF_size", v);
661 public static int ND_UF_size(ST_Agnode_s n) {
662 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_size;
663 }
664
665 public static void ND_UF_size(ST_Agnode_s n, int v) {
666 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("UF_size", v);
646667 }
647668
648669 // #define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb)
649670 // #define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust)
650 public static Agraph_s ND_clust(__ptr__ n) {
651 return (Agraph_s) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("clust");
652 }
653
654 public static void ND_clust(Agnode_s n, __ptr__ v) {
655 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("clust", v);
671 public static ST_Agraph_s ND_clust(__ptr__ n) {
672 return (ST_Agraph_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).clust;
673 }
674
675 public static void ND_clust(ST_Agnode_s n, __ptr__ v) {
676 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("clust", v);
656677 }
657678
658679 // #define ND_coord(n) (((Agnodeinfo_t*)AGDATA(n))->coord)
659680 public static ST_pointf ND_coord(__ptr__ n) {
660 return (ST_pointf) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("coord");
681 return (ST_pointf) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).coord;
661682 }
662683
663684 // #define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist)
664685
665686 // #define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in)
666 public static ST_elist ND_flat_in(Agnode_s n) {
667 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("flat_in");
687 public static ST_elist ND_flat_in(ST_Agnode_s n) {
688 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_in;
668689 }
669690
670691 // #define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out)
671 public static ST_elist ND_flat_out(Agnode_s n) {
672 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("flat_out");
692 public static ST_elist ND_flat_out(ST_Agnode_s n) {
693 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_out;
673694 }
674695
675696 // #define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state)
676697 // #define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port)
677 public static boolean ND_has_port(Agnode_s n) {
678 return AGDATA(n).castTo(Agnodeinfo_t.class).getBoolean("has_port");
698 public static boolean ND_has_port(ST_Agnode_s n) {
699 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).has_port;
679700 }
680701
681702 // #define ND_rep(n) (((Agnodeinfo_t*)AGDATA(n))->rep)
682703 // #define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex)
683704 // #define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height)
684705 public static double ND_height(__ptr__ n) {
685 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("height");
686 }
687
688 public static void ND_height(Agnode_s n, double v) {
689 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("height", v);
706 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).height;
707 }
708
709 public static void ND_height(ST_Agnode_s n, double v) {
710 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("height", v);
690711 }
691712
692713 // #define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops)
693714 // #define ND_ht(n) (((Agnodeinfo_t*)AGDATA(n))->ht)
694715 public static double ND_ht(__ptr__ n) {
695 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("ht");
696 }
697
698 public static void ND_ht(Agnode_s n, double v) {
699 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("ht", v);
716 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ht;
717 }
718
719 public static void ND_ht(ST_Agnode_s n, double v) {
720 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("ht", v);
700721 }
701722
702723 // #define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in)
703 public static ST_elist ND_in(Agnode_s n) {
704 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("in");
705 }
706
707 public static void ND_in(__ptr__ n, __struct__<elist> v) {
708 AGDATA(n).castTo(Agnodeinfo_t.class).setStruct("in", v);
724 public static ST_elist ND_in(ST_Agnode_s n) {
725 return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).in;
726 }
727
728 public static void ND_in(__ptr__ n, __struct__<ST_elist> v) {
729 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("in", v);
709730 }
710731
711732 // #define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf)
712 public static __ptr__ ND_inleaf(Agnode_s n) {
713 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("inleaf");
733 public static __ptr__ ND_inleaf(ST_Agnode_s n) {
734 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).inleaf;
714735 }
715736
716737 // #define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label)
717 public static textlabel_t ND_label(Agnode_s n) {
718 return (textlabel_t) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("label");
719 }
720
721 public static void ND_label(Agnode_s n, __ptr__ v) {
722 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("label", v);
738 public static ST_textlabel_t ND_label(ST_Agnode_s n) {
739 return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).label;
740 }
741
742 public static void ND_label(ST_Agnode_s n, __ptr__ v) {
743 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("label", v);
723744 }
724745
725746 // #define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel)
726 public static textlabel_t ND_xlabel(Agnode_s n) {
727 return (textlabel_t) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("xlabel");
747 public static ST_textlabel_t ND_xlabel(ST_Agnode_s n) {
748 return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).xlabel;
728749 }
729750
730751 // #define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim)
731 public static int ND_lim(Agnode_s n) {
732 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("lim");
733 }
734
735 public static void ND_lim(Agnode_s n, int v) {
736 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("lim", v);
752 public static int ND_lim(ST_Agnode_s n) {
753 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lim;
754 }
755
756 public static void ND_lim(ST_Agnode_s n, int v) {
757 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("lim", v);
737758 }
738759
739760 // #define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low)
740 public static int ND_low(Agnode_s n) {
741 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("low");
742 }
743
744 public static void ND_low(Agnode_s n, int v) {
745 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("low", v);
761 public static int ND_low(ST_Agnode_s n) {
762 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).low;
763 }
764
765 public static void ND_low(ST_Agnode_s n, int v) {
766 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("low", v);
746767 }
747768
748769 // #define ND_lw(n) (((Agnodeinfo_t*)AGDATA(n))->lw)
749770 public static double ND_lw(__ptr__ n) {
750 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("lw");
751 }
752
753 public static void ND_lw(Agnode_s n, double v) {
754 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("lw", v);
771 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lw;
772 }
773
774 public static void ND_lw(ST_Agnode_s n, double v) {
775 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("lw", v);
755776 }
756777
757778 // #define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark)
758779 public static int ND_mark(__ptr__ n) {
759 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("mark");
760 }
780 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark;
781 }
782
761783 public static void ND_mark(__ptr__ n, int v) {
762 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("mark", v);
763 }
784 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("mark", v);
785 }
786
764787 public static void ND_mark(__ptr__ n, boolean v) {
765 AGDATA(n).castTo(Agnodeinfo_t.class).setBoolean("mark", v);
788 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark = v?1:0;
766789 }
767790
768791 // #define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval)
769792 public static double ND_mval(__ptr__ n) {
770 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("mval");
771 }
772 public static void ND_mval(Agnode_s n, double v) {
773 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("mval", v);
793 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mval;
794 }
795
796 public static void ND_mval(ST_Agnode_s n, double v) {
797 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("mval", v);
774798 }
775799
776800 // #define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster)
777801 // #define ND_next(n) (((Agnodeinfo_t*)AGDATA(n))->next)
778 public static Agnode_s ND_next(Agnode_s n) {
779 return (Agnode_s) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("next");
780 }
802 public static ST_Agnode_s ND_next(ST_Agnode_s n) {
803 return (ST_Agnode_s) ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).next;
804 }
805
781806 public static void ND_next(__ptr__ n, __ptr__ v) {
782 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("next", v);
807 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("next", v);
783808 }
784809
785810 // #define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type)
786 public static int ND_node_type(Agnode_s n) {
787 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("node_type");
788 }
789 public static void ND_node_type(Agnode_s n, int v) {
790 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("node_type", v);
811 public static int ND_node_type(ST_Agnode_s n) {
812 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).node_type;
813 }
814
815 public static void ND_node_type(ST_Agnode_s n, int v) {
816 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("node_type", v);
791817 }
792818
793819 // #define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack)
794 public static boolean ND_onstack(Agnode_s n) {
795 return AGDATA(n).castTo(Agnodeinfo_t.class).getBoolean("onstack");
796 }
797 public static void ND_onstack(Agnode_s n, int v) {
798 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("onstack", v);
799 }
800 public static void ND_onstack(Agnode_s n, boolean v) {
801 AGDATA(n).castTo(Agnodeinfo_t.class).setBoolean("onstack", v);
820 public static boolean ND_onstack(ST_Agnode_s n) {
821 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack!=0;
822 }
823
824 public static void ND_onstack(ST_Agnode_s n, int v) {
825 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("onstack", v);
826 }
827
828 public static void ND_onstack(ST_Agnode_s n, boolean v) {
829 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack = v?1:0;
802830 }
803831
804832 // #define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order)
805833 public static int ND_order(__ptr__ n) {
806 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("order");
807 }
834 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).order;
835 }
836
808837 public static void ND_order(__ptr__ n, int v) {
809 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("order", v);
838 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("order", v);
810839 }
811840
812841 // #define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other)
813 public static ST_elist ND_other(Agnode_s n) {
814 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("other");
842 public static ST_elist ND_other(ST_Agnode_s n) {
843 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).other;
815844 }
816845
817846 // #define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out)
818847 public static ST_elist ND_out(__ptr__ n) {
819 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("out");
820 }
821 public static void ND_out(__ptr__ n, __struct__<elist> v) {
822 AGDATA(n).castTo(Agnodeinfo_t.class).setStruct("out", v);
848 return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).out;
849 }
850
851 public static void ND_out(__ptr__ n, __struct__<ST_elist> v) {
852 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("out", v);
823853 }
824854
825855 // #define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf)
826 public static __ptr__ ND_outleaf(Agnode_s n) {
827 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("outleaf");
856 public static __ptr__ ND_outleaf(ST_Agnode_s n) {
857 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).outleaf;
828858 }
829859
830860 // #define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par)
831 public static Agedge_s ND_par(Agnode_s n) {
832 return (Agedge_s) AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("par");
833 }
834 public static void ND_par(Agnode_s n, __ptr__ v) {
835 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("par", v);
861 public static ST_Agedge_s ND_par(ST_Agnode_s n) {
862 return (ST_Agedge_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).par;
863 }
864
865 public static void ND_par(ST_Agnode_s n, __ptr__ v) {
866 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("par", v);
836867 }
837868
838869 // #define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned)
839870 // #define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos)
840871 // #define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev)
841 public static __ptr__ ND_prev(Agnode_s n) {
842 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("prev");
843 }
844 public static void ND_prev(Agnode_s n, __ptr__ v) {
845 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("prev", v);
872 public static __ptr__ ND_prev(ST_Agnode_s n) {
873 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).prev;
874 }
875
876 public static void ND_prev(ST_Agnode_s n, __ptr__ v) {
877 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("prev", v);
846878 }
847879
848880 // #define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority)
849 public static int ND_priority(Agnode_s n) {
850 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("priority");
851 }
852 public static void ND_priority(Agnode_s n, int v) {
853 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("priority", v);
881 public static int ND_priority(ST_Agnode_s n) {
882 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).priority;
883 }
884
885 public static void ND_priority(ST_Agnode_s n, int v) {
886 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("priority", v);
854887 }
855888
856889 // #define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank)
857890 public static int ND_rank(__ptr__ n) {
858 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("rank");
859 }
891 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rank;
892 }
893
860894 public static void ND_rank(__ptr__ n, int v) {
861 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("rank", v);
895 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("rank", v);
862896 }
863897
864898 // #define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype)
865 public static int ND_ranktype(Agnode_s n) {
866 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("ranktype");
867 }
868 public static void ND_ranktype(Agnode_s n, int v) {
869 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("ranktype", v);
899 public static int ND_ranktype(ST_Agnode_s n) {
900 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ranktype;
901 }
902
903 public static void ND_ranktype(ST_Agnode_s n, int v) {
904 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("ranktype", v);
870905 }
871906
872907 // #define ND_rw(n) (((Agnodeinfo_t*)AGDATA(n))->rw)
873908 public static double ND_rw(__ptr__ n) {
874 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("rw");
875 }
876 public static void ND_rw(Agnode_s n, double v) {
877 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("rw", v);
909 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rw;
910 }
911
912 public static void ND_rw(ST_Agnode_s n, double v) {
913 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("rw", v);
878914 }
879915
880916 // #define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in)
881 public static ST_elist ND_save_in(Agnode_s n) {
882 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("save_in");
883 }
884
885 public static void ND_save_in(Agnode_s n, __struct__<elist> v) {
886 AGDATA(n).castTo(Agnodeinfo_t.class).setStruct("save_in", v);
917 public static ST_elist ND_save_in(ST_Agnode_s n) {
918 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_in;
919 }
920
921 public static void ND_save_in(ST_Agnode_s n, __struct__<ST_elist> v) {
922 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_in", v);
887923 }
888924
889925 // #define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out)
890 public static ST_elist ND_save_out(Agnode_s n) {
891 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("save_out");
892 }
893 public static void ND_save_out(Agnode_s n, __struct__<elist> v) {
894 AGDATA(n).castTo(Agnodeinfo_t.class).setStruct("save_out", v);
926 public static ST_elist ND_save_out(ST_Agnode_s n) {
927 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_out;
928 }
929
930 public static void ND_save_out(ST_Agnode_s n, __struct__<ST_elist> v) {
931 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_out", v);
895932 }
896933
897934 // #define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape)
898 public static __ptr__ ND_shape(Agnode_s n) {
899 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("shape");
900 }
901 public static void ND_shape(Agnode_s n, __ptr__ v) {
902 AGDATA(n).castTo(Agnodeinfo_t.class).setPtr("shape", v);
935 public static ST_shape_desc ND_shape(ST_Agnode_s n) {
936 return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).shape;
937 }
938
939 public static void ND_shape(ST_Agnode_s n, __ptr__ v) {
940 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("shape", v);
903941 }
904942
905943 // #define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info)
906944 public static __ptr__ ND_shape_info(__ptr__ n) {
907 return AGDATA(n).castTo(Agnodeinfo_t.class).getPtr("shape_info");
945 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).shape_info;
908946 }
909947
910948 // #define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes)
911 public static int ND_showboxes(Agnode_s n) {
912 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("showboxes");
913 }
914 public static void ND_showboxes(Agnode_s n, int v) {
915 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("showboxes", v);
949 public static int ND_showboxes(ST_Agnode_s n) {
950 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).showboxes;
951 }
952
953 public static void ND_showboxes(ST_Agnode_s n, int v) {
954 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("showboxes", v);
916955 }
917956
918957 // #define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state)
919958 // #define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode)
920959 // #define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in)
921 public static ST_elist ND_tree_in(Agnode_s n) {
922 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("tree_in");
960 public static ST_elist ND_tree_in(ST_Agnode_s n) {
961 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_in;
923962 }
924963
925964 // #define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out)
926 public static ST_elist ND_tree_out(Agnode_s n) {
927 return (ST_elist) AGDATA(n).castTo(Agnodeinfo_t.class).getStruct("tree_out");
965 public static ST_elist ND_tree_out(ST_Agnode_s n) {
966 return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_out;
928967 }
929968
930969 // #define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class)
931 public static int ND_weight_class(Agnode_s n) {
932 return AGDATA(n).castTo(Agnodeinfo_t.class).getInt("weight_class");
933 }
934 public static void ND_weight_class(Agnode_s n, int v) {
935 AGDATA(n).castTo(Agnodeinfo_t.class).setInt("weight_class", v);
970 public static int ND_weight_class(ST_Agnode_s n) {
971 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).weight_class;
972 }
973
974 public static void ND_weight_class(ST_Agnode_s n, int v) {
975 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("weight_class", v);
936976 }
937977
938978 // #define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width)
939979 public static double ND_width(__ptr__ n) {
940 return AGDATA(n).castTo(Agnodeinfo_t.class).getDouble("width");
941 }
942 public static void ND_width(Agnode_s n, double v) {
943 AGDATA(n).castTo(Agnodeinfo_t.class).setDouble("width", v);
980 return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).width;
981 }
982
983 public static void ND_width(ST_Agnode_s n, double v) {
984 ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("width", v);
944985 }
945986
946987 // #define ND_xsize(n) (ND_lw(n)+ND_rw(n))
948989
949990 // #define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg)
950991 // #define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag)
951 public static boolean ED_conc_opp_flag(Agedge_s e) {
952 return AGDATA(e).castTo(Agedgeinfo_t.class).getBoolean("conc_opp_flag");
953 }
954 public static void ED_conc_opp_flag(Agedge_s e, boolean v) {
955 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("conc_opp_flag", v ? 1 : 0);
992 public static boolean ED_conc_opp_flag(ST_Agedge_s e) {
993 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).conc_opp_flag;
994 }
995
996 public static void ED_conc_opp_flag(ST_Agedge_s e, boolean v) {
997 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("conc_opp_flag", v ? 1 : 0);
956998 }
957999
9581000 // #define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count)
9591001 public static int ED_count(__ptr__ e) {
960 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("count");
961 }
1002 return ((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).count;
1003 }
1004
9621005 public static void ED_count(__ptr__ e, int v) {
963 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("count", v);
1006 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("count", v);
9641007 }
9651008
9661009 // #define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue)
967 public static int ED_cutvalue(Agedge_s e) {
968 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("cutvalue");
969 }
970 public static void ED_cutvalue(Agedge_s e, int v) {
971 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("cutvalue", v);
1010 public static int ED_cutvalue(ST_Agedge_s e) {
1011 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).cutvalue;
1012 }
1013
1014 public static void ED_cutvalue(ST_Agedge_s e, int v) {
1015 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("cutvalue", v);
9721016 }
9731017
9741018 // #define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type)
9751019 // #define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent)
9761020 public static int ED_adjacent(__ptr__ e) {
977 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("adjacent");
978 }
979 public static void ED_adjacent(Agedge_s e, int v) {
980 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("adjacent", v);
1021 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).adjacent;
1022 }
1023
1024 public static void ED_adjacent(ST_Agedge_s e, int v) {
1025 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("adjacent", v);
9811026 }
9821027
9831028 // #define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor)
9841029 // #define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state)
9851030 // #define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label)
986 public static textlabel_t ED_head_label(Agedge_s e) {
987 return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("head_label");
988 }
989 public static void ED_head_label(Agedge_s e, __ptr__ v) {
990 AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("head_label", v);
1031 public static ST_textlabel_t ED_head_label(ST_Agedge_s e) {
1032 return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_label;
1033 }
1034
1035 public static void ED_head_label(ST_Agedge_s e, __ptr__ v) {
1036 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("head_label", v);
9911037 }
9921038
9931039 // #define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port)
9941040 public static ST_port ED_head_port(__ptr__ e) {
995 return (ST_port) AGDATA(e).castTo(Agedgeinfo_t.class).getStruct("head_port");
996 }
997 public static void ED_head_port(Agedge_s e, __struct__<port> v) {
998 AGDATA(e).castTo(Agedgeinfo_t.class).setStruct("head_port", v);
1041 return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_port;
1042 }
1043
1044 public static void ED_head_port(ST_Agedge_s e, ST_port v) {
1045 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("head_port", v);
9991046 }
10001047
10011048 // #define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label)
1002 public static textlabel_t ED_label(__ptr__ e) {
1003 return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("label");
1004 }
1005 public static void ED_label(Agedge_s e, __ptr__ v) {
1006 AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("label", v);
1049 public static ST_textlabel_t ED_label(__ptr__ e) {
1050 return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label;
1051 }
1052
1053 public static void ED_label(ST_Agedge_s e, __ptr__ v) {
1054 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("label", v);
10071055 }
10081056
10091057 // #define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel)
1010 public static textlabel_t ED_xlabel(Agedge_s e) {
1011 return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("xlabel");
1058 public static ST_textlabel_t ED_xlabel(ST_Agedge_s e) {
1059 return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xlabel;
10121060 }
10131061
10141062 // #define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop)
1015 public static boolean ED_label_ontop(Agedge_s e) {
1016 return AGDATA(e).castTo(Agedgeinfo_t.class).getBoolean("label_ontop");
1017 }
1018 public static void ED_label_ontop(Agedge_s e, boolean v) {
1019 AGDATA(e).castTo(Agedgeinfo_t.class).setBoolean("label_ontop", v);
1063 public static boolean ED_label_ontop(ST_Agedge_s e) {
1064 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop;
1065 }
1066
1067 public static void ED_label_ontop(ST_Agedge_s e, boolean v) {
1068 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop = v;
10201069 }
10211070
10221071 // #define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen)
1023 public static int ED_minlen(Agedge_s e) {
1024 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("minlen");
1025 }
1026 public static void ED_minlen(Agedge_s e, int v) {
1027 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("minlen", v);
1072 public static int ED_minlen(ST_Agedge_s e) {
1073 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).minlen;
1074 }
1075
1076 public static void ED_minlen(ST_Agedge_s e, int v) {
1077 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("minlen", v);
10281078 }
10291079
10301080 // #define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path)
10311081 // #define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes)
1032 public static int ED_showboxes(Agedge_s e) {
1033 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("showboxes");
1034 }
1035 public static void ED_showboxes(Agedge_s e, int v) {
1036 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("showboxes", v);
1082 public static int ED_showboxes(ST_Agedge_s e) {
1083 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).showboxes;
1084 }
1085
1086 public static void ED_showboxes(ST_Agedge_s e, int v) {
1087 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("showboxes", v);
10371088 }
10381089
10391090 // #define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl)
1040 public static splines ED_spl(Agedge_s e) {
1041 return (splines) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("spl");
1042 }
1043 public static void ED_spl(Agedge_s e, __ptr__ v) {
1044 AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("spl", v);
1091 public static ST_splines ED_spl(ST_Agedge_s e) {
1092 return ((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).spl;
1093 }
1094
1095 public static void ED_spl(ST_Agedge_s e, ST_splines v) {
1096 ((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).spl = v;
10451097 }
10461098
10471099 // #define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label)
1048 public static textlabel_t ED_tail_label(Agedge_s e) {
1049 return (textlabel_t) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("tail_label");
1100 public static ST_textlabel_t ED_tail_label(ST_Agedge_s e) {
1101 return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_label;
1102 }
1103
1104 public static void ED_tail_label(ST_Agedge_s e, __ptr__ v) {
1105 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("tail_label", v);
10501106 }
10511107
10521108 // #define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port)
10531109 public static ST_port ED_tail_port(__ptr__ e) {
1054 return (ST_port) AGDATA(e).castTo(Agedgeinfo_t.class).getStruct("tail_port");
1055 }
1056 public static void ED_tail_port(Agedge_s e, ST_port v) {
1057 AGDATA(e).castTo(Agedgeinfo_t.class).setStruct("tail_port", v);
1110 return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_port;
1111 }
1112
1113 public static void ED_tail_port(ST_Agedge_s e, ST_port v) {
1114 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("tail_port", v);
10581115 }
10591116
10601117 // #define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig)
1061 public static Agedge_s ED_to_orig(__ptr__ e) {
1062 return (Agedge_s) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("to_orig");
1063 }
1064 public static void ED_to_orig(Agedge_s e, __ptr__ v) {
1065 AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("to_orig", v);
1118 public static ST_Agedge_s ED_to_orig(__ptr__ e) {
1119 return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_orig;
1120 }
1121
1122 public static void ED_to_orig(ST_Agedge_s e, __ptr__ v) {
1123 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_orig", v);
10661124 }
10671125
10681126 // #define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt)
1069 public static Agedge_s ED_to_virt(Agedge_s e) {
1070 return (Agedge_s) AGDATA(e).castTo(Agedgeinfo_t.class).getPtr("to_virt");
1071 }
1072 public static void ED_to_virt(Agedge_s e, __ptr__ v) {
1073 AGDATA(e).castTo(Agedgeinfo_t.class).setPtr("to_virt", v);
1127 public static ST_Agedge_s ED_to_virt(ST_Agedge_s e) {
1128 return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_virt;
1129 }
1130
1131 public static void ED_to_virt(ST_Agedge_s e, __ptr__ v) {
1132 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_virt", v);
10741133 }
10751134
10761135 // #define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index)
10771136 public static int ED_tree_index(__ptr__ e) {
1078 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("tree_index");
1079 }
1137 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tree_index;
1138 }
1139
10801140 public static void ED_tree_index(__ptr__ e, int v) {
1081 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("tree_index", v);
1141 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("tree_index", v);
10821142 }
10831143
10841144 // #define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty)
10851145 public static int ED_xpenalty(__ptr__ e) {
1086 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("xpenalty");
1087 }
1088 public static void ED_xpenalty(Agedge_s e, int v) {
1089 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("xpenalty", v);
1146 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xpenalty;
1147 }
1148
1149 public static void ED_xpenalty(ST_Agedge_s e, int v) {
1150 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("xpenalty", v);
10901151 }
10911152
10921153 // #define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist)
1093 public static double ED_dist(Agedge_s e) {
1094 return AGDATA(e).castTo(Agedgeinfo_t.class).getDouble("dist");
1095 }
1096 public static void ED_dist(Agedge_s e, double v) {
1097 AGDATA(e).castTo(Agedgeinfo_t.class).setDouble("dist", v);
1154 public static double ED_dist(ST_Agedge_s e) {
1155 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).dist;
1156 }
1157
1158 public static void ED_dist(ST_Agedge_s e, double v) {
1159 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setDouble("dist", v);
10981160 }
10991161
11001162 // #define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight)
1101 public static int ED_weight(Agedge_s e) {
1102 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("weight");
1103 }
1104 public static void ED_weight(Agedge_s e, int v) {
1105 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("weight", v);
1163 public static int ED_weight(ST_Agedge_s e) {
1164 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).weight;
1165 }
1166
1167 public static void ED_weight(ST_Agedge_s e, int v) {
1168 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("weight", v);
11061169 }
11071170
11081171 //
11111174 // #define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count)
11121175 // #define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue)
11131176 // #define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type)
1114 public static int ED_edge_type(Agedge_s e) {
1115 return AGDATA(e).castTo(Agedgeinfo_t.class).getInt("edge_type");
1116 }
1117 public static void ED_edge_type(Agedge_s e, int v) {
1118 AGDATA(e).castTo(Agedgeinfo_t.class).setInt("edge_type", v);
1177 public static int ED_edge_type(ST_Agedge_s e) {
1178 return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).edge_type;
1179 }
1180
1181 public static void ED_edge_type(ST_Agedge_s e, int v) {
1182 ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("edge_type", v);
11191183 }
11201184
11211185 // #define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent)
11421206 // #define elist_fastapp(item,L) do {L.list[L.size++] = item; L.list[L.size] = NULL;} while(0)
11431207
11441208 // #define ALLOC(size,ptr,type) (ptr? (type*)realloc(ptr,(size)*sizeof(type)):(type*)malloc((size)*sizeof(type)))
1145 public static __ptr__ ALLOC_empty(int size, __ptr__ ptr, Class type) {
1146 return (__ptr__) (ptr != null ? JUtils.sizeof_starstar_empty(type, size).realloc(ptr) : JUtils
1147 .sizeof_starstar_empty(type, size).malloc());
1148 }
1149
1150 public static __ptr__ ALLOC_allocated2(int size, __ptr__ ptr, Class type) {
1151 return (__ptr__) (ptr != null ? JUtils.sizeof(type, size).realloc(ptr) : JUtils.sizeof(type, size).malloc());
1209
1210 public static ST_Agedge_s.ArrayOfStar ALLOC_allocated_ST_Agedge_s(ST_Agedge_s.ArrayOfStar old, int size) {
1211 return old != null ? old.reallocJ(size) : new ST_Agedge_s.ArrayOfStar(size);
1212 }
1213
1214 public static ST_Agnode_s.ArrayOfStar ALLOC_allocated_ST_Agnode_s(ST_Agnode_s.ArrayOfStar old, int size) {
1215 return old != null ? old.reallocJ(size) : new ST_Agnode_s.ArrayOfStar(size);
1216 }
1217
1218 public static ST_pointf.Array ALLOC_allocated_ST_pointf(ST_pointf.Array old, int size) {
1219 return old != null ? old.reallocJ(size) : new ST_pointf.Array(size);
1220 }
1221
1222 public static ST_Pedge_t.Array ALLOC_allocated_ST_Pedge_t(ST_Pedge_t.Array old, int size) {
1223 return old != null ? old.reallocJ(size) : new ST_Pedge_t.Array(size);
11521224 }
11531225
11541226 public static __ptr__ ALLOC_INT(int size, __ptr__ ptr) {
11611233 throw new UnsupportedOperationException();
11621234 }
11631235
1164 public static __ptr__ ALLOC(int nb, __ptr__ ptr, Class type) {
1165 if (ptr == null) {
1166 return (__ptr__) JUtils.sizeof(type, nb).malloc();
1236 public static ST_Agnode_s.ArrayOfStar ALLOC_Agnode_s(int nb, ST_Agnode_s.ArrayOfStar old) {
1237 if (old == null) {
1238 return new ST_Agnode_s.ArrayOfStar(nb);
11671239 }
1168 return (__ptr__) JUtils.sizeof(type, nb).realloc(ptr);
1240 return old.reallocJ(nb);
1241 }
1242
1243 public static ST_bezier.Array2 ALLOC_ST_bezier(int nb, ST_bezier.Array2 old) {
1244 if (old == null) {
1245 return new ST_bezier.Array2(nb);
1246 }
1247 return old.reallocJ(nb);
1248 }
1249
1250 public static ST_rank_t.Array2 ALLOC_ST_rank_t(int nb, ST_rank_t.Array2 old) {
1251 if (old == null) {
1252 return new ST_rank_t.Array2(nb);
1253 }
1254 return old.reallocJ(nb);
11691255 }
11701256
11711257 // #define elist_append(item,L) do {L.list = ALLOC(L.size + 2,L.list,edge_t*); L.list[L.size++] = item;
11721258 // L.list[L.size] = NULL;} while(0)
11731259 public static void elist_append(__ptr__ item, ST_elist L) {
1174 // L.setPtr("list", ALLOC_empty(L.getInt("size") + 2, L.getPtr("list"), Agedge_s.class));
1260 // L.setPtr("list", ALLOC_empty(L.size + 2, L.getPtr("list"), Agedge_s.class));
11751261 L.realloc(L.size + 2);
11761262 L.setInList(L.size, item);
11771263 L.size = 1 + L.size;
11791265 }
11801266
11811267 // #define alloc_elist(n,L) do {L.size = 0; L.list = N_NEW(n + 1,edge_t*); } while (0)
1182 public static void alloc_elist(int n, ST_elist L, Class cl) {
1268 public static void alloc_elist(int n, ST_elist L) {
11831269 L.size = 0;
1184 L.mallocEmpty(cl, n + 1);
1270 L.mallocEmpty(n + 1);
11851271 // L.setPtr("list", (__ptr__) JUtils.sizeof_starstar_empty(cl, n + 1).malloc());
11861272 }
11871273
11891275 public static void free_list(ST_elist L) {
11901276 if (L.listNotNull())
11911277 L.free();
1192 // Memory.free(L.getPtr("list"));
1278 // Memory.free(L.getPtr("list"));
11931279 }
11941280
11951281 public static double ABS(double a) {
12451331 // ED_edge_type(newp) = VIRTUAL; \
12461332 // ED_to_orig(newp) = old; \
12471333
1248 public static void MAKEFWDEDGE(__ptr__ new_, __ptr__ old) {
1249 Agedge_s newp;
1250 Agedgeinfo_t info;
1251 newp = (Agedge_s) new_;
1252 info = (Agedgeinfo_t) newp.getStruct("base").getPtr("data");
1253 info.copyDataFrom(old.getStruct("base").getPtr("data").castTo(Agedgeinfo_t.class).getStruct());
1254 newp.copyDataFrom(old);
1255 newp.getStruct("base").setPtr("data", info);
1334 public static void MAKEFWDEDGE(ST_Agedge_s new_, ST_Agedge_s old) {
1335 ST_Agedge_s newp;
1336 ST_Agedgeinfo_t info;
1337 newp = (ST_Agedge_s) new_.getPtr();
1338 info = (ST_Agedgeinfo_t) newp.base.data.castTo(ST_Agedgeinfo_t.class);
1339 info.copyDataFrom(old.base.data.castTo(ST_Agedgeinfo_t.class).getStruct());
1340 newp.copyDataFrom((__ptr__)old);
1341 newp.base.setPtr("data", info);
12561342 agtail(newp, AGHEAD(old));
12571343 aghead(newp, AGTAIL(old));
12581344 ED_tail_port(newp, ED_head_port(old));
12661352
12671353 // #define ZALLOC(size,ptr,type,osize) (ptr?
12681354 // (type*)zrealloc(ptr,size,sizeof(type),osize):(type*)zmalloc((size)*sizeof(type)))
1269 public static __ptr__ ZALLOC(int size, __ptr__ ptr, Class type, int osize) {
1270 if (ptr != null) {
1271 return Memory.realloc(ptr, JUtils.sizeof(type, size));
1272 }
1273 return (__ptr__) JUtils.sizeof(type, size).malloc();
1355
1356 public static ST_textspan_t.Array ZALLOC_ST_textspan_t(ST_textspan_t.Array old, int size) {
1357 return old != null ? old.reallocJ(size) : new ST_textspan_t.Array(size);
1358 }
1359
1360 public static ST_Agraph_s.Array ZALLOC_ST_Agraph_s(ST_Agraph_s.Array old, int size) {
1361 return old != null ? old.reallocJ(size) : new ST_Agraph_s.Array(size);
12741362 }
12751363
12761364 public static final int MAXSHORT = 0x7fff;
13111399 public static double MICROPOINT = .000001;
13121400
13131401 // #define APPROXEQPT(p,q,tol) (DIST2((p),(q)) < SQR(tol))
1314 public static boolean APPROXEQPT(__ptr__ p, __ptr__ q, double tol) {
1402 public static boolean APPROXEQPT(ST_pointf p, ST_pointf q, double tol) {
13151403 return (DIST2((p), (q)) < SQR(tol));
13161404 }
13171405
13271415
13281416 //
13291417 // #define DIST2(p,q) (LEN2(((p).x - (q).x),((p).y - (q).y)))
1330 public static double DIST2(__ptr__ p, __ptr__ q) {
1331 return (LEN2(((p).getDouble("x") - (q).getDouble("x")), ((p).getDouble("y") - (q).getDouble("y"))));
1332 }
1333
1334 public static double DIST2(__struct__ p, __ptr__ q) {
1335 return (LEN2(((p).getDouble("x") - (q).getDouble("x")), ((p).getDouble("y") - (q).getDouble("y"))));
1418 public static double DIST2(ST_pointf p, ST_pointf q) {
1419 return (LEN2(((p).x - (q).x), ((p).y - (q).y)));
13361420 }
13371421
13381422 // #define DIST(p,q) (sqrt(DIST2((p),(q))))
13391423
13401424 // #define INSIDE(p,b) (BETWEEN((b).LL.x,(p).x,(b).UR.x) && BETWEEN((b).LL.y,(p).y,(b).UR.y))
1341 public static boolean INSIDE(__struct__ b, __struct__ p) {
1342 return (BETWEEN(b.getStruct("LL").getDouble("x"), p.getDouble("x"), b.getStruct("UR").getDouble("x")) && BETWEEN(
1343 b.getStruct("LL").getDouble("y"), p.getDouble("y"), b.getStruct("UR").getDouble("y")));
1425 public static boolean INSIDE(ST_pointf p, ST_boxf b) {
1426 return (BETWEEN(b.LL.x, p.x, b.UR.x) && BETWEEN(b.LL.y, p.y, b.UR.y));
13441427 }
13451428
13461429 public static final double M_PI = Math.PI;
13561439 // (((a).x - (b).x) * ((a).x - (b).x)) + (((a).y - (b).y) * ((a).y - (b).y)) \
13571440 // )
13581441
1359 public static double DISTSQ(__struct__ a, __struct__ b) {
1360 return (((a).getDouble("x") - (b).getDouble("x")) * ((a).getDouble("x") - (b).getDouble("x")))
1361 + (((a).getDouble("y") - (b).getDouble("y")) * ((a).getDouble("y") - (b).getDouble("y")));
1362 }
1363
1364 public static void hackInitDimensionFromLabel(__struct__<pointf> size, String label) {
1442 public static double DISTSQ(ST_pointf a, ST_pointf b) {
1443 return (((a).x - (b).x) * ((a).x - (b).x))
1444 + (((a).y - (b).y) * ((a).y - (b).y));
1445 }
1446
1447 public static void hackInitDimensionFromLabel(ST_pointf size, String label) {
13651448 if (label.matches("_dim_\\d+_\\d+_")) {
13661449 Pattern p = Pattern.compile("_dim_(\\d+)_(\\d+)_");
13671450 Matcher m = p.matcher(label);
13751458 JUtils.LOG2("Hacking dimension to width=" + ww + " height=" + hh);
13761459 }
13771460 }
1378
1461
13791462 public static CString createHackInitDimensionFromLabel(int width, int height) {
13801463 return new CString("_dim_" + width + "_" + height + "_");
13811464 }
3434 */
3535 package smetana.core;
3636
37 import h.Agdesc_s;
38 import h.Agiddisc_s;
39 import h.Agmemdisc_s;
40 import h.Agtag_s;
41 import h.STStarArrayOfPointer;
42 import h.ST_Agtag_s;
43 import h._dtdisc_s;
44 import h._dtmethod_s;
45 import h.nlist_t;
46 import smetana.core.amiga.StarArrayOfPtr;
47 import smetana.core.amiga.StarStar;
48
4937 public class Memory {
5038
5139 public static __ptr__ malloc(Class theClass) {
5846 }
5947
6048 public static __ptr__ realloc(__ptr__ old, size_t size) {
61 if (old instanceof StarArrayOfPtr) {
62 // System.err.println("size="+size);
63 // ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
64 ((StarArrayOfPtr) old).realloc(size);
65 return old;
66 }
67 if (old instanceof StarStar) {
68 ((StarStar) old).realloc(((size_t_array_of_array_of_something_empty) size).getNb());
69 return old;
70 }
71 if (old instanceof STStarArrayOfPointer) {
72 ((STStarArrayOfPointer) old).realloc(size.getInternalNb());
73 return old;
74 }
7549 throw new UnsupportedOperationException("" + old.getClass());
7650 }
7751
+0
-43
src/smetana/core/Ppolyline_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import h.Ppoly_t;
39
40 public interface Ppolyline_t extends Ppoly_t {
41
42 }
104104 throw new UnsupportedOperationException(getClass().toString());
105105 }
106106
107 public void setBoolean(String fieldName, boolean data) {
108 throw new UnsupportedOperationException(getClass().toString());
109 }
110
111107 public void setDouble(String fieldName, double data) {
112108 throw new UnsupportedOperationException(getClass().toString());
113109 }
114110
115 public int getInt(String fieldName) {
116 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
117 }
118
119 public double getDouble(String fieldName) {
120 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
121 }
122
123 public boolean getBoolean(String fieldName) {
124 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
125 }
126
127 public CString getCString(String fieldName) {
128 throw new UnsupportedOperationException(getClass().toString());
129 }
130
131 public __array_of_struct__ getArrayOfStruct(String fieldName) {
132 throw new UnsupportedOperationException(getClass().toString());
133 }
134
135 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
136 throw new UnsupportedOperationException(getClass().toString());
137 }
138
139 public __array_of_cstring__ getArrayOfCString(String fieldName) {
140 throw new UnsupportedOperationException(getClass().toString());
141 }
142
143 public __array_of_integer__ getArrayOfInteger(String fieldName) {
144 throw new UnsupportedOperationException(getClass().toString());
145 }
146
147 public __struct__ getStruct(String fieldName) {
148 throw new UnsupportedOperationException(getClass().toString());
149 }
150
151 public __ptr__ getPtr(String fieldName) {
152 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
153 }
154
155111 public void setStruct(String fieldName, __struct__ newData) {
156 throw new UnsupportedOperationException(getClass().toString());
157 }
158
159 public void setCString(String fieldName, CString newData) {
160112 throw new UnsupportedOperationException(getClass().toString());
161113 }
162114
178130
179131 public void copyDataFrom(__ptr__ arg) {
180132 throw new UnsupportedOperationException(getClass().toString());
181 }
182
183 public Object call(String fieldName, Object... args) {
184 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
185133 }
186134
187135 public __ptr__ castTo(Class dest) {
224172 throw new UnsupportedOperationException(getClass().toString());
225173 }
226174
227 public CString getCString() {
228 throw new UnsupportedOperationException(getClass().toString());
229 }
230
231 public void setCString(CString value) {
232 throw new UnsupportedOperationException(getClass().toString());
233 }
234
235175 public __array_of_ptr__ plus(int delta) {
236176 throw new UnsupportedOperationException(getClass().toString());
237177 }
3737
3838 import smetana.core.amiga.Area;
3939
40 public class UnsupportedArrayOfStruct implements __array_of_struct__ {
40 public class UnsupportedArrayOfStruct {
4141
4242 public String getUID36() {
4343 throw new UnsupportedOperationException(getClass().toString());
5252 }
5353
5454 public __ptr__ asPtr() {
55 throw new UnsupportedOperationException(getClass().toString());
56 }
57
58 public int comparePointerInternal(__array_of_struct__ other) {
59 throw new UnsupportedOperationException(getClass().toString());
60 }
61
62 public __array_of_struct__ move(int delta) {
63 throw new UnsupportedOperationException(getClass().toString());
64 }
65
66 public __array_of_struct__ plus(int delta) {
6755 throw new UnsupportedOperationException(getClass().toString());
6856 }
6957
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import smetana.core.amiga.Area;
39
40 public abstract class UnsupportedArrayOfStruct2 {
41
42 public String getUID36() {
43 throw new UnsupportedOperationException(getClass().toString());
44 }
45
46 public void swap(int i, int j) {
47 throw new UnsupportedOperationException(getClass().toString());
48 }
49
50 public void realloc(int nb) {
51 throw new UnsupportedOperationException(getClass().toString());
52 }
53
54 public __ptr__ asPtr() {
55 throw new UnsupportedOperationException(getClass().toString());
56 }
57
58 public Area getInternal(int idx) {
59 throw new UnsupportedOperationException(getClass().toString());
60 }
61
62 public void setInternalByIndex(int idx, Area value) {
63 throw new UnsupportedOperationException(getClass().toString());
64 }
65
66 public void memcopyFrom(Area source) {
67 throw new UnsupportedOperationException(getClass().toString());
68 }
69
70 public __ptr__ getPtr() {
71 throw new UnsupportedOperationException(getClass().toString());
72 }
73
74 public __struct__ getStruct() {
75 throw new UnsupportedOperationException(getClass().toString());
76 }
77
78 public void setStruct(__struct__ value) {
79 throw new UnsupportedOperationException(getClass().toString());
80 }
81
82 public void setDouble(String fieldName, double value) {
83 throw new UnsupportedOperationException(getClass().toString());
84 }
85
86 public int getInt() {
87 throw new UnsupportedOperationException(getClass().toString());
88 }
89
90 public void setInt(int value) {
91 throw new UnsupportedOperationException(getClass().toString());
92 }
93
94
95 public int minus(__ptr__ other) {
96 throw new UnsupportedOperationException(getClass().toString());
97 }
98
99 public double getDouble() {
100 throw new UnsupportedOperationException(getClass().toString());
101 }
102
103 public void setDouble(double value) {
104 throw new UnsupportedOperationException(getClass().toString());
105 }
106
107 public void setPtr(__ptr__ value) {
108 throw new UnsupportedOperationException(getClass().toString());
109 }
110
111 public __ptr__ setPtr(String fieldName, __ptr__ data) {
112 throw new UnsupportedOperationException(getClass().toString());
113 }
114
115 public void setStruct(String fieldName, __struct__ data) {
116 throw new UnsupportedOperationException(getClass().toString());
117 }
118
119 public void setInt(String fieldName, int data) {
120 throw new UnsupportedOperationException(getClass().toString());
121 }
122
123 public __ptr__ castTo(Class dest) {
124 throw new UnsupportedOperationException(getClass().toString());
125 }
126
127 public Object addVirtualBytes(int bytes) {
128 throw new UnsupportedOperationException(getClass().toString());
129 }
130
131 final public __ptr__ unsupported() {
132 throw new UnsupportedOperationException(getClass().toString());
133 }
134
135 public int comparePointer(__ptr__ other) {
136 throw new UnsupportedOperationException(getClass().toString());
137 }
138
139 public String getDebug(String fieldName) {
140 throw new UnsupportedOperationException(getClass().toString());
141 }
142
143 public void copyDataFrom(__ptr__ other) {
144 throw new UnsupportedOperationException(getClass().toString());
145 }
146
147 public void copyDataFrom(__struct__ other) {
148 throw new UnsupportedOperationException(getClass().toString());
149 }
150
151
152 }
4545 throw new UnsupportedOperationException(getClass().toString());
4646 }
4747
48 public void setCString(String fieldName, CString value) {
49 throw new UnsupportedOperationException(getClass().toString());
50 }
51
5248
5349 public int minus(__ptr__ other) {
5450 throw new UnsupportedOperationException(getClass().toString());
7066 throw new UnsupportedOperationException(getClass().toString());
7167 }
7268
73 public __ptr__ getPtr(String fieldName) {
74 throw new UnsupportedOperationException(getClass().toString());
75 }
76
7769 public __struct__ getStruct() {
7870 throw new UnsupportedOperationException(getClass().toString());
7971 }
8072
8173 public void setStruct(__struct__ value) {
82 throw new UnsupportedOperationException(getClass().toString());
83 }
84
85 // public __array__ getArray(String fieldName) {
86 // throw new UnsupportedOperationException(getClass().toString());
87 // }
88
89 public __array_of_integer__ getArrayOfInteger(String fieldName) {
90 throw new UnsupportedOperationException(getClass().toString());
91 }
92
93 public __array_of_struct__ getArrayOfStruct(String fieldName) {
94 throw new UnsupportedOperationException(getClass().toString());
95 }
96
97 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
98 throw new UnsupportedOperationException(getClass().toString());
99 }
100
101 public __array_of_cstring__ getArrayOfCString(String fieldName) {
102 throw new UnsupportedOperationException(getClass().toString());
103 }
104
105 public __struct__ getStruct(String fieldName) {
106 throw new UnsupportedOperationException(getClass().toString());
107 }
108
109 public boolean getBoolean(String fieldName) {
110 throw new UnsupportedOperationException(getClass().toString());
111 }
112
113 public double getDouble(String fieldName) {
114 throw new UnsupportedOperationException(getClass().toString());
115 }
116
117 public CString getCString(String fieldName) {
118 throw new UnsupportedOperationException(getClass().toString());
119 }
120
121 public int getInt(String fieldName) {
12274 throw new UnsupportedOperationException(getClass().toString());
12375 }
12476
13486 throw new UnsupportedOperationException(getClass().toString());
13587 }
13688
137 public void setBoolean(String fieldName, boolean data) {
138 throw new UnsupportedOperationException(getClass().toString());
139 }
140
14189 public void setDouble(String fieldName, double data) {
14290 throw new UnsupportedOperationException(getClass().toString());
14391 }
14694 throw new UnsupportedOperationException(getClass().toString());
14795 }
14896
149 public Object call(String name, Object... args) {
150 throw new UnsupportedOperationException(getClass().toString());
151 }
15297
15398 public Object addVirtualBytes(int bytes) {
15499 throw new UnsupportedOperationException(getClass().toString());
+0
-80
src/smetana/core/UnsupportedSize_t.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 public class UnsupportedSize_t implements size_t {
39
40 private final int size;
41
42 public UnsupportedSize_t(int size) {
43 this.size = size;
44 }
45
46 public Object malloc() {
47 throw new UnsupportedOperationException(getClass().getName());
48 }
49
50 public Object realloc(Object old) {
51 throw new UnsupportedOperationException(getClass().getName());
52 }
53
54 public size_t negate() {
55 throw new UnsupportedOperationException(getClass().getName());
56 }
57
58 public size_t plus(int length) {
59 throw new UnsupportedOperationException(getClass().getName());
60 }
61
62 public boolean isStrictPositive() {
63 throw new UnsupportedOperationException(getClass().getName());
64 }
65
66 public boolean isStrictNegative() {
67 throw new UnsupportedOperationException(getClass().getName());
68 }
69
70 final public boolean isZero() {
71 return size == 0;
72 }
73
74 public int getInternalNb() {
75 throw new UnsupportedOperationException(getClass().getName());
76 }
77
78
79 }
3939 import smetana.core.amiga.StarStruct;
4040
4141 public class UnsupportedStarStruct implements StarStruct {
42
43 private static int CPT = 0;
44 public final int UID;
45
46 public UnsupportedStarStruct() {
47 this.UID = CPT++;
48 }
4249
4350 public __ptr__ unsupported() {
4451 throw new UnsupportedOperationException(getClass().toString());
104111 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
105112 }
106113
107 public void setBoolean(String fieldName, boolean data) {
108 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
109 }
110
111114 public void setDouble(String fieldName, double data) {
112 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
113 }
114
115 public int getInt(String fieldName) {
116 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
117 }
118
119 public double getDouble(String fieldName) {
120 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
121 }
122
123 public boolean getBoolean(String fieldName) {
124115 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
125116 }
126117
128119 throw new UnsupportedOperationException(getClass().toString());
129120 }
130121
131 public CString getCString(String fieldName) {
132 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
133 }
134
135 public __array_of_struct__ getArrayOfStruct(String fieldName) {
136 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
137 }
138
139 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
140 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
141 }
142
143 public __array_of_cstring__ getArrayOfCString(String fieldName) {
144 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
145 }
146
147 public __array_of_integer__ getArrayOfInteger(String fieldName) {
148 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
149 }
150
151 public __struct__ getStruct(String fieldName) {
152 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
153 }
154
155 public __ptr__ getPtr(String fieldName) {
156 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
157 }
158
159122 public void setStruct(String fieldName, __struct__ newData) {
160 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
161 }
162
163 public void setCString(String fieldName, CString newData) {
164123 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
165124 }
166125
184143 throw new UnsupportedOperationException(getClass().toString());
185144 }
186145
187 public Object call(String fieldName, Object... args) {
188 throw new UnsupportedOperationException(fieldName + " " + getClass().toString());
189 }
190
191146 public __ptr__ castTo(Class dest) {
147 System.err.println("I am " + toString() + " " + UID);
192148 throw new UnsupportedOperationException(dest + " " + getClass().toString());
193149 }
194150
4040
4141 public class UnsupportedStruct implements __struct__ {
4242
43 public __ptr__ getPtr(String fieldName) {
44 throw new UnsupportedOperationException(getClass().toString());
45 }
46
47 public __struct__ getStruct(String fieldName) {
48 throw new UnsupportedOperationException(getClass().toString());
49 }
50
51 public boolean getBoolean(String fieldName) {
52 throw new UnsupportedOperationException(getClass().toString());
53 }
54
55 public double getDouble(String fieldName) {
56 throw new UnsupportedOperationException(getClass().toString());
57 }
58
59 public CString getCString(String fieldName) {
60 throw new UnsupportedOperationException(getClass().toString());
61 }
62
63 public int getInt(String fieldName) {
64 throw new UnsupportedOperationException(getClass().toString());
65 }
66
6743 public __ptr__ setPtr(String fieldName, __ptr__ value) {
68 throw new UnsupportedOperationException(getClass().toString());
69 }
70
71 public void setCString(String fieldName, CString value) {
7244 throw new UnsupportedOperationException(getClass().toString());
7345 }
7446
8052 throw new UnsupportedOperationException(getClass().toString());
8153 }
8254
83 public void setBoolean(String fieldName, boolean value) {
84 throw new UnsupportedOperationException(getClass().toString());
85 }
86
8755 public void setDouble(String fieldName, double value) {
88 throw new UnsupportedOperationException(getClass().toString());
89 }
90
91 public __array_of_integer__ getArrayOfInteger(String fieldName) {
92 throw new UnsupportedOperationException(getClass().toString());
93 }
94
95 public __array_of_struct__ getArrayOfStruct(String fieldName) {
96 throw new UnsupportedOperationException(getClass().toString());
97 }
98
99 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
100 throw new UnsupportedOperationException(getClass().toString());
101 }
102
103 public __array_of_cstring__ getArrayOfCString(String fieldName) {
10456 throw new UnsupportedOperationException(getClass().toString());
10557 }
10658
12880 throw new UnsupportedOperationException(getClass().toString());
12981 }
13082
131 public Object call(String name, Object... args) {
132 throw new UnsupportedOperationException(getClass().toString());
133 }
134
13583
13684 }
4848 import gen.lib.common.shapes__c;
4949 import gen.lib.dotgen.dotsplines__c;
5050 import gen.lib.label.xlabels__c;
51 import h.Agedge_s;
52 import h.Agnode_s;
53 import h.Agraph_s;
54 import h.Agsubnode_s;
55 import h.Agsym_s;
56 import h.Agtag_s;
57 import h.HDict_t;
5851 import h.ST_Agdesc_s;
52 import h.ST_Agedge_s;
5953 import h.ST_Agiddisc_s;
6054 import h.ST_Agmemdisc_s;
55 import h.ST_Agnode_s;
56 import h.ST_Agraph_s;
57 import h.ST_Agsubnode_s;
58 import h.ST_Agsym_s;
59 import h.ST_Agtag_s;
60 import h.ST_HDict_t;
61 import h.ST_Pedge_t;
6162 import h.ST_arrowname_t;
6263 import h.ST_arrowtype_t;
64 import h.ST_boxf;
65 import h.ST_deque_t;
66 import h.ST_dt_s;
6367 import h.ST_dtdisc_s;
6468 import h.ST_dtmethod_s;
6569 import h.ST_elist;
6670 import h.ST_nlist_t;
6771 import h.ST_pointf;
72 import h.ST_pointnlink_t;
73 import h.ST_polygon_t;
6874 import h.ST_port;
69 import h._dt_s;
70 import h._dtmethod_s;
71 import h.arrowname_t;
72 import h.arrowtype_t;
73 import h.boxf;
74 import h.deque_t;
75 import h.pointf;
76 import h.pointnlink_t;
77 import h.polygon_t;
78 import h.refstr_t;
79 import h.shape_desc;
80 import h.shape_functions;
81 import h.splineInfo;
82 import h.textfont_t;
75 import h.ST_refstr_t;
76 import h.ST_shape_desc;
77 import h.ST_shape_functions;
78 import h.ST_splineInfo;
79 import h.ST_textfont_t;
80 import h.ST_tna_t;
81 import h.ST_triangle_t;
8382
8483 import java.util.HashMap;
8584 import java.util.LinkedList;
9291 public final Map<Integer, CString> all = new HashMap<Integer, CString>();
9392
9493 public final ST_dtmethod_s _Dttree = new ST_dtmethod_s();
95 public final _dtmethod_s Dttree = _Dttree.amp();
94 public final ST_dtmethod_s Dttree = _Dttree;
9695
9796 public final ST_dtmethod_s _Dtobag = new ST_dtmethod_s();
98 public final _dtmethod_s Dtobag = _Dtobag.amp();
97 public final ST_dtmethod_s Dtobag = _Dtobag;
9998
10099 public final ST_dtdisc_s AgDataDictDisc = new ST_dtdisc_s();
101100
102101 public final ST_Agdesc_s ProtoDesc = new ST_Agdesc_s();
103102
104 public Agraph_s ProtoGraph;
105
106 public final __struct__<Agtag_s> Tag = JUtils.from(Agtag_s.class);
103 public ST_Agraph_s ProtoGraph;
104
105 public final ST_Agtag_s Tag = new ST_Agtag_s();
107106
108107 public final ST_dtdisc_s Ag_mainedge_seq_disc = new ST_dtdisc_s();
109108
129128
130129 public final ST_dtdisc_s Hdisc = new ST_dtdisc_s();
131130
132 public _dt_s Refdict_default;
133
134 public Agraph_s Ag_dictop_G;
135
136 public final __array_of_struct__ Arrowsynonyms = __array_of_struct_impl__.malloc(arrowname_t.class, 1);
137
138 public final __array_of_struct__ Arrownames = __array_of_struct_impl__.malloc(arrowname_t.class, 3);
139
140 public final __array_of_struct__ Arrowmods = __array_of_struct_impl__.malloc(arrowname_t.class, 1);
141
142 public final __array_of_struct__ Arrowtypes = __array_of_struct_impl__.malloc(arrowtype_t.class, 9);
131 public ST_dt_s Refdict_default;
132
133 public ST_Agraph_s Ag_dictop_G;
134
135 public final ST_arrowname_t Arrowsynonyms[] = new ST_arrowname_t[] { new ST_arrowname_t() };
136
137 public final ST_arrowname_t Arrownames[] = new ST_arrowname_t[] { new ST_arrowname_t(), new ST_arrowname_t(), new ST_arrowname_t() };
138
139 public final ST_arrowname_t Arrowmods[] = new ST_arrowname_t[] { new ST_arrowname_t() };
140
141 public final ST_arrowtype_t Arrowtypes[] = new ST_arrowtype_t[] { new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t(), new ST_arrowtype_t() };
143142
144143 public __ptr__ Show_boxes;
145144
155154
156155 public double Initial_dist;
157156
158 public Agsym_s G_activepencolor, G_activefillcolor, G_selectedpencolor, G_selectedfillcolor, G_visitedpencolor,
157 public ST_Agsym_s G_activepencolor, G_activefillcolor, G_selectedpencolor, G_selectedfillcolor, G_visitedpencolor,
159158 G_visitedfillcolor, G_deletedpencolor, G_deletedfillcolor, G_ordering, G_peripheries, G_penwidth,
160159 G_gradientangle, G_margin;
161160
162 public Agsym_s N_height, N_width, N_shape, N_color, N_fillcolor, N_activepencolor, N_activefillcolor,
161 public ST_Agsym_s N_height, N_width, N_shape, N_color, N_fillcolor, N_activepencolor, N_activefillcolor,
163162 N_selectedpencolor, N_selectedfillcolor, N_visitedpencolor, N_visitedfillcolor, N_deletedpencolor,
164163 N_deletedfillcolor, N_fontsize, N_fontname, N_fontcolor, N_margin, N_label, N_xlabel, N_nojustify, N_style,
165164 N_showboxes, N_sides, N_peripheries, N_ordering, N_orientation, N_skew, N_distortion, N_fixed,
166165 N_imagescale, N_layer, N_group, N_comment, N_vertices, N_z, N_penwidth, N_gradientangle;
167166
168 public Agsym_s E_weight, E_minlen, E_color, E_fillcolor, E_activepencolor, E_activefillcolor, E_selectedpencolor,
167 public ST_Agsym_s E_weight, E_minlen, E_color, E_fillcolor, E_activepencolor, E_activefillcolor, E_selectedpencolor,
169168 E_selectedfillcolor, E_visitedpencolor, E_visitedfillcolor, E_deletedpencolor, E_deletedfillcolor,
170169 E_fontsize, E_fontname, E_fontcolor, E_label, E_xlabel, E_dir, E_style, E_decorate, E_showboxes, E_arrowsz,
171170 E_constr, E_layer, E_comment, E_label_float, E_samehead, E_sametail, E_arrowhead, E_arrowtail, E_headlabel,
184183
185184 public final ST_elist Tree_edge = new ST_elist();
186185
187 public Agedge_s Enter;
186 public ST_Agedge_s Enter;
188187
189188 public int Low, Lim, Slack;
190189
198197
199198 public int routeinit;
200199
201 public __ptr__ ps;
200 public ST_pointf.Array ps;
202201
203202 public int maxpn;
204203
205 public __ptr__ polypoints;
204 public ST_pointf.Array polypoints;
206205
207206 public int polypointn;
208207
209 public __ptr__ edges;
208 public ST_Pedge_t.Array edges;
210209
211210 public int edgen;
212211
213 public __array_of_struct__ boxes = __array_of_struct_impl__.malloc(boxf.class, 1000);
212 public final ST_boxf[] boxes = ST_boxf.malloc(1000);
214213
215214 public int MinQuit;
216215
217216 public double Convergence;
218217
219 public Agraph_s Root;
218 public ST_Agraph_s Root;
220219
221220 public int GlobalMinRank, GlobalMaxRank;
222221
223222 public boolean ReMincross;
224223
225 public __ptr__ TE_list;
224 public ST_Agedge_s.ArrayOfStar TE_list;
226225
227226 public __ptr__ TI_list;
228227
229 public Agnode_s Last_node_decomp;
230 public Agnode_s Last_node_rank;
228 public ST_Agnode_s Last_node_decomp;
229 public ST_Agnode_s Last_node_rank;
231230
232231 public char Cmark;
233232
234233 public int trin, tril;
235234
236 public __ptr__ tris;
235 public ST_triangle_t.Array tris;
237236
238237 public int pnln, pnll;
239238
240 public pointnlink_t pnls;
241 public __ptr__ pnlps;
239 public ST_pointnlink_t pnls[];
240 public ST_pointnlink_t pnlps[];
242241
243242 public final ST_port Center = new ST_port();
244243
245 public final __struct__<polygon_t> p_ellipse = JUtils.from(polygon_t.class);
246
247 public final __struct__<polygon_t> p_box = JUtils.from(polygon_t.class);
248
249 public final __struct__<shape_functions> poly_fns = JUtils.from(shape_functions.class);
250
251 public __ptr__ tnas;
244 public final ST_polygon_t p_ellipse = new ST_polygon_t();
245
246 public final ST_polygon_t p_box = new ST_polygon_t();
247
248 public final ST_shape_functions poly_fns = new ST_shape_functions();
249
250 public ST_tna_t.Array tnas;
252251 public int tnan;
253252
254 public final shape_desc Shapes[] = { __Shapes__("box", poly_fns.amp(), p_box.amp()),
255 __Shapes__("ellipse", poly_fns.amp(), p_ellipse.amp()), __Shapes__(null, null, null) };
253 public final ST_shape_desc Shapes[] = { __Shapes__("box", poly_fns, p_box),
254 __Shapes__("ellipse", poly_fns, p_ellipse), __Shapes__(null, null, null) };
256255
257256 public final ST_dtdisc_s Ag_mainedge_id_disc = new ST_dtdisc_s();
258257
259 public final __struct__<deque_t> dq = JUtils.from(deque_t.class);
258 public final ST_deque_t dq = new ST_deque_t();
260259
261260 public final ST_Agdesc_s Agdirected = new ST_Agdesc_s();
262261
263 public final __struct__<splineInfo> sinfo = JUtils.from(splineInfo.class);
264
265 public Agnode_s lastn; /* last node argument */
266 public polygon_t poly;
262 public final ST_splineInfo sinfo = new ST_splineInfo();
263
264 public ST_Agnode_s lastn; /* last node argument */
265 public ST_polygon_t poly;
267266 public int last, outp, sides;
268 public final __struct__<pointf> O = JUtils.from(pointf.class); /* point (0,0) */
269 public pointf vertex;
267 public final ST_pointf O = new ST_pointf(); /* point (0,0) */
268 public ST_pointf.Array vertex;
270269 public double xsize, ysize, scalex, scaley, box_URx, box_URy;
271270
272 public final __struct__<textfont_t> tf = JUtils.from(textfont_t.class);
273
274 public __ptr__ pointfs;
275 public __ptr__ pointfs2;
271 public final ST_textfont_t tf = new ST_textfont_t();
272
273 public ST_pointf.Array pointfs;
274 public ST_pointf.Array pointfs2;
276275 public int numpts;
277276 public int numpts2;
278277
281280
282281 public int ctr = 1;
283282
284 public __struct__<Agsubnode_s> template = JUtils.from(Agsubnode_s.class);
285 public __struct__<Agnode_s> dummy = JUtils.from(Agnode_s.class);
286
287 public Agraph_s G_ns;
288 public Agraph_s G_decomp;
283 public final ST_Agsubnode_s template = new ST_Agsubnode_s();
284 public final ST_Agnode_s dummy = new ST_Agnode_s();
285
286 public ST_Agraph_s G_ns;
287 public ST_Agraph_s G_decomp;
289288
290289 public int opl;
291290
292291 public int opn_route;
293292 public int opn_shortest;
294293
295 public __ptr__ ops_route;
296 public __ptr__ ops_shortest;
294 public ST_pointf.Array ops_route;
295 public ST_pointf.Array ops_shortest;
297296
298297 public static Z z() {
299298 return instances2.get().peekFirst();
312311 instances2.get().removeFirst();
313312 }
314313
315 private shape_desc __Shapes__(String s, shape_functions shape_functions, polygon_t polygon) {
316 shape_desc result = (shape_desc) Memory.malloc(shape_desc.class);
314 private ST_shape_desc __Shapes__(String s, ST_shape_functions shape_functions, ST_polygon_t polygon) {
315 ST_shape_desc result = new ST_shape_desc();
317316 result.setPtr("name", s == null ? null : new CString(s));
318317 result.setPtr("fns", shape_functions);
319318 result.setPtr("polygon", polygon);
343342 _Dtobag.searchf = function(dttree__c.class, "dttree");
344343 _Dtobag.type = 0000010;
345344
346 AgDataDictDisc.key = OFFSET.create(Agsym_s.class, "name").toInt();
345 AgDataDictDisc.key = OFFSET.create(ST_Agsym_s.class, "name").toInt();
347346 AgDataDictDisc.size = -1;
348 AgDataDictDisc.link = OFFSET.create(Agsym_s.class, "link").toInt();
347 AgDataDictDisc.link = OFFSET.create(ST_Agsym_s.class, "link").toInt();
349348 AgDataDictDisc.makef = null;
350349 AgDataDictDisc.freef = function(attr__c.class, "freesym");
351350 AgDataDictDisc.comparf = null;
360359
361360 Ag_mainedge_seq_disc.key = 0;
362361 Ag_mainedge_seq_disc.size = 0;
363 Ag_mainedge_seq_disc.link = OFFSET.create(Agedge_s.class, "seq_link").toInt(); // seq_link is the third
362 Ag_mainedge_seq_disc.link = OFFSET.create(ST_Agedge_s.class, "seq_link").toInt(); // seq_link is the third
364363 // field in Agedge_t
365364 Ag_mainedge_seq_disc.makef = null;
366365 Ag_mainedge_seq_disc.freef = null;
391390
392391 Ag_subgraph_id_disc.key = 0;
393392 Ag_subgraph_id_disc.size = 0;
394 Ag_subgraph_id_disc.link = OFFSET.create(Agraph_s.class, "link").toInt(); // link is the third field in
393 Ag_subgraph_id_disc.link = OFFSET.create(ST_Agraph_s.class, "link").toInt(); // link is the third field in
395394 // Agraph_t
396395 Ag_subgraph_id_disc.makef = null;
397396 Ag_subgraph_id_disc.freef = null;
416415
417416 Ag_subnode_id_disc.key = 0;
418417 Ag_subnode_id_disc.size = 0;
419 Ag_subnode_id_disc.link = OFFSET.create(Agsubnode_s.class, "id_link").toInt(); // id_link is the second
418 Ag_subnode_id_disc.link = OFFSET.create(ST_Agsubnode_s.class, "id_link").toInt(); // id_link is the second
420419 // field in Agsubnode_t
421420 Ag_subnode_id_disc.makef = null;
422421 Ag_subnode_id_disc.freef = null;
427426
428427 Ag_subnode_seq_disc.key = 0;
429428 Ag_subnode_seq_disc.size = 0;
430 Ag_subnode_seq_disc.link = OFFSET.create(Agsubnode_s.class, "seq_link").toInt(); // link is the first
429 Ag_subnode_seq_disc.link = OFFSET.create(ST_Agsubnode_s.class, "seq_link").toInt(); // link is the first
431430 // field in
432431 // Agsubnode_t
433432 Ag_subnode_seq_disc.makef = null;
437436 Ag_subnode_seq_disc.memoryf = function(utils__c.class, "agdictobjmem");
438437 Ag_subnode_seq_disc.eventf = null;
439438
440 Refstrdisc.key = OFFSET.create(refstr_t.class, "s").toInt(); // *s is the third field in refstr_t
439 Refstrdisc.key = OFFSET.create(ST_refstr_t.class, "s").toInt(); // *s is the third field in refstr_t
441440 Refstrdisc.size = -1;
442441 Refstrdisc.link = 0;
443442 Refstrdisc.makef = null;
447446 Refstrdisc.memoryf = function(utils__c.class, "agdictobjmem");
448447 Refstrdisc.eventf = null;
449448
450 Hdisc.key = OFFSET.create(HDict_t.class, "key").toInt();
449 Hdisc.key = OFFSET.create(ST_HDict_t.class, "key").toInt();
451450 Hdisc.size = 4;
452451 Hdisc.link = -1;
453452 Hdisc.makef = null;
457456 Hdisc.memoryf = null;
458457 Hdisc.eventf = null;
459458
460 Arrowsynonyms.plus(0).setStruct(create_arrowname_t(null, 0));
461
462 Arrownames.plus(0).setStruct(create_arrowname_t("normal", 1));
463 Arrownames.plus(1).setStruct(create_arrowname_t("none", 8));
464 Arrownames.plus(2).setStruct(create_arrowname_t(null, 0));
465
466 Arrowmods.plus(0).setStruct(create_arrowname_t(null, 0));
467
468 Arrowtypes.plus(0).setStruct(createArrowtypes(1, 1.0, function(arrows__c.class, "arrow_type_normal")));
469 Arrowtypes.plus(1).setStruct(createArrowtypes(2, 1.0, function(arrows__c.class, "arrow_type_crow")));
470 Arrowtypes.plus(2).setStruct(createArrowtypes(3, 0.5, function(arrows__c.class, "arrow_type_tee")));
471 Arrowtypes.plus(3).setStruct(createArrowtypes(4, 1.0, function(arrows__c.class, "arrow_type_box")));
472 Arrowtypes.plus(4).setStruct(createArrowtypes(5, 1.2, function(arrows__c.class, "arrow_type_diamond")));
473 Arrowtypes.plus(5).setStruct(createArrowtypes(6, 0.8, function(arrows__c.class, "arrow_type_dot")));
474 Arrowtypes.plus(6).setStruct(createArrowtypes(7, 1.0, function(arrows__c.class, "arrow_type_curve")));
475 Arrowtypes.plus(7).setStruct(createArrowtypes(8, 0.5, function(arrows__c.class, "arrow_type_gap")));
476 Arrowtypes.plus(8).setStruct(createArrowtypes(0, 0.0, null));
459 Arrowsynonyms[0].___(create_arrowname_t(null, 0));
460
461 Arrownames[0].___(create_arrowname_t("normal", 1));
462 Arrownames[1].___(create_arrowname_t("none", 8));
463 Arrownames[2].___(create_arrowname_t(null, 0));
464
465 Arrowmods[0].___(create_arrowname_t(null, 0));
466
467 Arrowtypes[0].___(createArrowtypes(1, 1.0, function(arrows__c.class, "arrow_type_normal")));
468 Arrowtypes[1].___(createArrowtypes(2, 1.0, function(arrows__c.class, "arrow_type_crow")));
469 Arrowtypes[2].___(createArrowtypes(3, 0.5, function(arrows__c.class, "arrow_type_tee")));
470 Arrowtypes[3].___(createArrowtypes(4, 1.0, function(arrows__c.class, "arrow_type_box")));
471 Arrowtypes[4].___(createArrowtypes(5, 1.2, function(arrows__c.class, "arrow_type_diamond")));
472 Arrowtypes[5].___(createArrowtypes(6, 0.8, function(arrows__c.class, "arrow_type_dot")));
473 Arrowtypes[6].___(createArrowtypes(7, 1.0, function(arrows__c.class, "arrow_type_curve")));
474 Arrowtypes[7].___(createArrowtypes(8, 0.5, function(arrows__c.class, "arrow_type_gap")));
475 Arrowtypes[8].___(createArrowtypes(0, 0.0, null));
477476
478477 Center.p.x = 0;
479478 Center.p.y = 0;
509508
510509 Ag_mainedge_id_disc.key = 0;
511510 Ag_mainedge_id_disc.size = 0;
512 Ag_mainedge_id_disc.link = OFFSET.create(Agedge_s.class, "id_link").toInt(); // id_link is the second
511 Ag_mainedge_id_disc.link = OFFSET.create(ST_Agedge_s.class, "id_link").toInt(); // id_link is the second
513512 // field in Agedge_t
514513 Ag_mainedge_id_disc.makef = null;
515514 Ag_mainedge_id_disc.freef = null;
5757
5858 public void memcopyFrom(Area source);
5959
60 public CString getCString();
61
62 public void setCString(CString value);
6360
6461 }
4040
4141 import smetana.core.amiga.Area;
4242 import smetana.core.amiga.BuilderArea;
43 import smetana.core.amiga.StarStructImpl;
43 import smetana.core.amiga.Counter;
4444
4545 public class __array_of_cstring_impl__ implements __array_of_cstring__ {
4646
4747 private final List<Area> data;
4848 private final int currentPos;
4949
50 private final int UID = StarStructImpl.CPT++;
50 private final int UID = Counter.CPT++;
5151
5252 public String getUID36() {
5353 return Integer.toString(UID, 36);
144144
145145 //
146146
147 public CString getCString() {
148 return (CString) getInternal(0);
149 }
150
151 public void setCString(CString value) {
152 setInternalByIndex(0, value);
153 }
154
155147 }
4141 import smetana.core.amiga.Area;
4242 import smetana.core.amiga.AreaInt;
4343 import smetana.core.amiga.BuilderArea;
44 import smetana.core.amiga.StarStruct;
45 import smetana.core.amiga.StarStructImpl;
44 import smetana.core.amiga.Counter;
4645
4746 public class __array_of_double__ implements Area {
4847
4948 private final List<Area> data;
5049 private final int currentPos;
5150
52 private final int UID = StarStructImpl.CPT++;
51 private final int UID = Counter.CPT++;
5352
5453 public String getUID36() {
5554 return Integer.toString(UID, 36);
4141 import smetana.core.amiga.Area;
4242 import smetana.core.amiga.AreaInt;
4343 import smetana.core.amiga.BuilderArea;
44 import smetana.core.amiga.StarStructImpl;
44 import smetana.core.amiga.Counter;
4545
4646 public class __array_of_integer_impl__ implements __array_of_integer__ {
4747
4848 private final List<Area> data;
4949 private final int currentPos;
5050
51 private final int UID = StarStructImpl.CPT++;
51 private final int UID = Counter.CPT++;
5252
5353 public String getUID36() {
5454 return Integer.toString(UID, 36);
6363
6464 public int getInt();
6565
66 public CString getCString();
67
6866 public __ptr__ getPtr();
6967
7068 public __struct__ getStruct();
7169
7270 public void setInt(int value);
7371
74 public void setCString(CString value);
75
7672 public void setPtr(__ptr__ value);
7773
7874 public void setStruct(__struct__ value);
7975
80 public double getDouble(String fieldName);
81
8276 public void setDouble(String fieldName, double value);
8377
84 public __struct__ getStruct(String fieldName);
85
8678 }
+0
-243
src/smetana/core/__array_of_ptr_impl__.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import h.ST_boxf;
39
40 import java.util.ArrayList;
41 import java.util.List;
42
43 import smetana.core.amiga.Area;
44 import smetana.core.amiga.AreaInt;
45 import smetana.core.amiga.BuilderArea;
46 import smetana.core.amiga.StarArrayOfPtr;
47 import smetana.core.amiga.StarStruct;
48 import smetana.core.amiga.StarStructImpl;
49
50 public class __array_of_ptr_impl__ implements __array_of_ptr__ {
51
52 private final List<Area> data;
53 private final int currentPos;
54 private final BuilderArea builder;
55
56 private final int UID = StarStructImpl.CPT++;
57
58 public String getUID36() {
59 return Integer.toString(UID, 36);
60 }
61
62 public void memcopyFrom(Area source) {
63 __array_of_ptr_impl__ other = (__array_of_ptr_impl__) source;
64 System.err.println("sizeMe=" + this.data.size());
65 System.err.println("sizeOt=" + other.data.size());
66
67 throw new UnsupportedOperationException();
68 }
69
70 public void swap(int i, int j) {
71 Area e1 = data.get(i);
72 Area e2 = data.get(j);
73 data.set(i, e2);
74 data.set(j, e1);
75 }
76
77 @Override
78 public String toString() {
79 if (data.get(0) != null) {
80 return "__array__ " + getUID36() + " " + currentPos + "/" + data.size() + " " + data.get(0).toString();
81 }
82 return "__array__ " + getUID36() + " " + currentPos + "/" + data.size();
83 }
84
85 public void realloc(int nb) {
86 while (data.size() < nb + currentPos) {
87 data.add(builder.createArea());
88 }
89 }
90
91 public void realloc(size_t nb) {
92 // ((StarArrayOfPtr) old).realloc(((size_t_array_of_something) size).getNb());
93 if (nb instanceof size_t_array_of_something) {
94 this.realloc(((size_t_array_of_something) nb).getNb());
95 return;
96 }
97 throw new UnsupportedOperationException();
98 }
99
100 public __ptr__ asPtr() {
101 return new StarArrayOfPtr(this);
102 }
103
104 public int comparePointerInternal(__array_of_ptr__ other2) {
105 final __array_of_ptr_impl__ other = (__array_of_ptr_impl__) other2;
106 if (this.data != other.data) {
107 throw new IllegalArgumentException();
108 }
109 return this.currentPos - other.currentPos;
110 }
111
112 public static __array_of_ptr__ malloc_allocated(final Class cl, int nb) {
113 return new __array_of_ptr_impl__(nb, new BuilderArea() {
114 public Area createArea() {
115 return JUtils.create(cl, null);
116 }
117 });
118 }
119
120 public static __array_of_ptr__ malloc_empty(int nb) {
121 return new __array_of_ptr_impl__(nb, new BuilderArea() {
122 public Area createArea() {
123 return null;
124 }
125 });
126 }
127
128 private __array_of_ptr_impl__(List<Area> data, int currentPos, BuilderArea builderArea) {
129 this.data = data;
130 this.currentPos = currentPos;
131 this.builder = builderArea;
132 check();
133 }
134
135 private __array_of_ptr_impl__(int size, BuilderArea builder) {
136 this.data = new ArrayList<Area>();
137 this.builder = builder;
138 this.currentPos = 0;
139 for (int i = 0; i < size; i++) {
140 data.add(builder.createArea());
141 }
142 check();
143 }
144
145 private void check() {
146 if (getUID36().equals("194")) {
147 JUtils.LOG("It's me");
148 }
149 }
150
151 public __array_of_ptr_impl__ move(int delta) {
152 return new __array_of_ptr_impl__(data, currentPos + delta, builder);
153 }
154
155 public __array_of_ptr_impl__ plus(int delta) {
156 return move(delta);
157 }
158
159 public Area getInternal(int idx) {
160 return data.get(idx + currentPos);
161 }
162
163 public void setInternalByIndex(int idx, Area value) {
164 if (value == this) {
165 throw new IllegalArgumentException();
166 }
167 if (value instanceof __array_of_ptr_impl__) {
168 throw new IllegalArgumentException();
169 }
170 data.set(idx + currentPos, value);
171 }
172
173 //
174
175 public int getInt() {
176 return ((AreaInt) getInternal(0)).getInternal();
177 }
178
179 public CString getCString() {
180 return (CString) getInternal(0);
181 }
182
183 public __ptr__ getPtr() {
184 if (getInternal(0) instanceof __struct__) {
185 return ((__struct__) getInternal(0)).amp();
186 }
187 return (__ptr__) getInternal(0);
188 }
189
190 public __struct__ getStruct() {
191 if (getInternal(0) instanceof __ptr__) {
192 return getPtr().getStruct();
193 }
194 return (__struct__) getInternal(0);
195 }
196
197 public void setInt(int value) {
198 ((AreaInt) getInternal(0)).setInternal(value);
199 }
200
201 public void setCString(CString value) {
202 setInternalByIndex(0, value);
203 }
204
205 public void setPtr(__ptr__ value) {
206 setInternalByIndex(0, (Area) value);
207 }
208
209 public void setStruct(__struct__ value) {
210 final Area area = getInternal(0);
211 if (area instanceof StarStruct) {
212 ((StarStruct) area).copyDataFrom(value);
213 } else if (area instanceof StarArrayOfPtr) {
214 ((StarArrayOfPtr) area).copyDataFrom(value);
215 } else {
216 ((__struct__) area).___(value);
217 }
218 }
219
220 public double getDouble(String fieldName) {
221 final Area tmp1 = getInternal(0);
222 return ((StarStruct) tmp1).getDouble(fieldName);
223 }
224
225 public void setDouble(String fieldName, double value) {
226 final Area tmp1 = getInternal(0);
227 if (tmp1 instanceof __struct__) {
228 ((__struct__) tmp1).setDouble(fieldName, value);
229 return;
230 }
231 ((StarStruct) tmp1).setDouble(fieldName, value);
232 }
233
234 public __struct__ getStruct(String fieldName) {
235 final StarStruct TMP = (StarStruct) getInternal(0);
236 if (TMP instanceof ST_boxf) {
237 return ((ST_boxf) TMP).getStructInternal(fieldName);
238 }
239 return TMP.getStruct(fieldName);
240 }
241
242 }
+0
-75
src/smetana/core/__array_of_struct__.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import smetana.core.amiga.Area;
39
40 public interface __array_of_struct__ extends Area {
41
42 public String getUID36();
43
44 public void swap(int i, int j);
45
46 public void realloc(int nb);
47
48 public __ptr__ asPtr();
49
50 public int comparePointerInternal(__array_of_struct__ other);
51
52 public __array_of_struct__ move(int delta);
53
54 public __array_of_struct__ plus(int delta);
55
56 public Area getInternal(int idx);
57
58 public void setInternalByIndex(int idx, Area value);
59
60 public void memcopyFrom(Area source);
61
62 public __ptr__ getPtr();
63
64 public __struct__ getStruct();
65
66 public void setStruct(__struct__ value);
67
68 public double getDouble(String fieldName);
69
70 public void setDouble(String fieldName, double value);
71
72 public __struct__ getStruct(String fieldName);
73
74 }
+0
-177
src/smetana/core/__array_of_struct_impl__.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import java.util.ArrayList;
39 import java.util.List;
40
41 import smetana.core.amiga.Area;
42 import smetana.core.amiga.BuilderArea;
43 import smetana.core.amiga.StarArrayOfStruct;
44 import smetana.core.amiga.StarStruct;
45 import smetana.core.amiga.StarStructImpl;
46
47 public class __array_of_struct_impl__ implements __array_of_struct__ {
48
49 private final List<Area> data;
50 private final int currentPos;
51
52 private final int UID = StarStructImpl.CPT++;
53
54 public String getUID36() {
55 return Integer.toString(UID, 36);
56 }
57
58 public void swap(int i, int j) {
59 Area e1 = data.get(i);
60 Area e2 = data.get(j);
61 data.set(i, e2);
62 data.set(j, e1);
63 }
64
65 @Override
66 public String toString() {
67 if (data.get(0) != null) {
68 return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size() + " "
69 + data.get(0).toString();
70 }
71 return "__array_of_struct__ " + getUID36() + " " + currentPos + "/" + data.size();
72 }
73
74 public void realloc(int nb) {
75 while (data.size() < nb + currentPos) {
76 data.add(null);
77 }
78 }
79
80 public __ptr__ asPtr() {
81 return new StarArrayOfStruct(this);
82 }
83
84 public int comparePointerInternal(__array_of_struct__ other) {
85 if (this.data != ((__array_of_struct_impl__) other).data) {
86 throw new IllegalArgumentException();
87 }
88 return this.currentPos - ((__array_of_struct_impl__) other).currentPos;
89 }
90
91 public static __array_of_struct_impl__ malloc(final Class cl, int nb) {
92 return new __array_of_struct_impl__(nb, new BuilderArea() {
93 public Area createArea() {
94 return JUtils.from(cl);
95 }
96 });
97 }
98
99 private __array_of_struct_impl__(List<Area> data, int currentPos) {
100 this.data = data;
101 this.currentPos = currentPos;
102 check();
103 }
104
105 public __array_of_struct_impl__(int size, BuilderArea builder) {
106 this.data = new ArrayList<Area>();
107 this.currentPos = 0;
108 for (int i = 0; i < size; i++) {
109 final Area tmp = builder.createArea();
110 data.add(tmp);
111 }
112 check();
113 }
114
115 private void check() {
116 if (getUID36().equals("194")) {
117 JUtils.LOG("It's me");
118 }
119 }
120
121 public __array_of_struct_impl__ move(int delta) {
122 return new __array_of_struct_impl__(data, currentPos + delta);
123 }
124
125 public __array_of_struct_impl__ plus(int delta) {
126 return move(delta);
127 }
128
129 public Area getInternal(int idx) {
130 return data.get(idx + currentPos);
131 }
132
133 public void setInternalByIndex(int idx, Area value) {
134 if (value == this) {
135 throw new IllegalArgumentException();
136 }
137 if (value instanceof __array_of_struct_impl__) {
138 throw new IllegalArgumentException();
139 }
140 data.set(idx + currentPos, value);
141 }
142
143 public void memcopyFrom(Area source) {
144 throw new UnsupportedOperationException();
145 }
146
147 //
148
149 public __ptr__ getPtr() {
150 return ((__struct__) getInternal(0)).amp();
151 }
152
153 public __struct__ getStruct() {
154 return (__struct__) getInternal(0);
155 }
156
157 public void setStruct(__struct__ value) {
158 final Area area = getInternal(0);
159 ((__struct__) area).___(value);
160 }
161
162 public double getDouble(String fieldName) {
163 final Area tmp1 = getInternal(0);
164 return ((__struct__) tmp1).getDouble(fieldName);
165 }
166
167 public void setDouble(String fieldName, double value) {
168 final Area tmp1 = getInternal(0);
169 ((__struct__) tmp1).setDouble(fieldName, value);
170 }
171
172 public __struct__ getStruct(String fieldName) {
173 return ((StarStruct) getInternal(0)).getStruct(fieldName);
174 }
175
176 }
3939
4040 public interface __c__fields {
4141
42 public __ptr__ getPtr(String fieldName);
43 public __struct__ getStruct(String fieldName);
44 public boolean getBoolean(String fieldName);
45 public double getDouble(String fieldName);
46 public CString getCString(String fieldName);
47 public int getInt(String fieldName);
48
4942 public __ptr__ setPtr(String fieldName, __ptr__ value);
50 public void setCString(String fieldName, CString value);
43
5144 public void setStruct(String fieldName, __struct__ value);
5245 public void setInt(String fieldName, int value);
53 public void setBoolean(String fieldName, boolean value);
5446 public void setDouble(String fieldName, double value);
55
56 // public __array__ getArray(String fieldName);
57 public __array_of_integer__ getArrayOfInteger(String fieldName);
58 public __array_of_struct__ getArrayOfStruct(String fieldName);
59 public __array_of_ptr__ getArrayOfPtr(String fieldName);
60 public __array_of_cstring__ getArrayOfCString(String fieldName);
6147
6248
6349 }
6060 public __struct__ getStruct();
6161 public void setStruct(__struct__ value);
6262
63 public Object call(String name, Object... args);
64
6563
6664 }
5050
5151 public StarStruct getInternalData();
5252
53 public Object call(String name, Object... args);
54
5553 }
+0
-177
src/smetana/core/__struct_impl__.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import smetana.core.amiga.Area;
39 import smetana.core.amiga.StarArrayOfPtr;
40 import smetana.core.amiga.StarArrayOfStruct;
41 import smetana.core.amiga.StarStruct;
42
43 public class __struct_impl__<C extends __ptr__> implements __struct__<C> {
44
45 final private StarStruct data;
46
47 public __struct_impl__(Class<C> cl) {
48 this.data = (StarStruct) Memory.malloc(cl);
49 }
50
51 @Override
52 public String toString() {
53 return super.toString() + " " + data.getUID36();
54 }
55
56 public __struct_impl__(StarStruct data) {
57 this.data = data;
58 }
59
60 public __struct_impl__<C> copy() {
61 final __struct_impl__<C> result = new __struct_impl__(data.getRealClass());
62 if (result.data.getRealClass() != this.data.getRealClass()) {
63 throw new IllegalStateException();
64 }
65 result.___(this);
66 return result;
67 }
68
69 public void ___(__struct__<C> other) {
70 data.copyDataFrom(other);
71 }
72
73 public void ____(__ptr__ other) {
74 if (other instanceof StarArrayOfPtr) {
75 ___(((StarArrayOfPtr) other).getStruct());
76 return;
77 }
78 if (other instanceof StarStruct) {
79 memcopyFrom((StarStruct) other);
80 return;
81 }
82 if (other instanceof StarArrayOfStruct) {
83 StarArrayOfStruct array = (StarArrayOfStruct) other;
84 memcopyFrom(array.getStruct());
85 return;
86 }
87 throw new UnsupportedOperationException();
88 }
89
90 public void memcopyFrom(Area source) {
91 data.memcopyFrom(source);
92 }
93
94 public StarStruct amp() {
95 return data;
96 }
97
98 public StarStruct getInternalData() {
99 return data;
100 }
101
102 public __ptr__ getPtr(String fieldName) {
103 return data.getPtr(fieldName);
104 }
105
106 public __struct__ getStruct(String fieldName) {
107 return data.getStruct(fieldName);
108 }
109
110 public boolean getBoolean(String fieldName) {
111 return data.getBoolean(fieldName);
112 }
113
114 public double getDouble(String fieldName) {
115 return data.getDouble(fieldName);
116 }
117
118 public void setCString(String fieldName, CString value) {
119 data.setCString(fieldName, value);
120 }
121
122
123 public CString getCString(String fieldName) {
124 return data.getCString(fieldName);
125 }
126
127 public int getInt(String fieldName) {
128 return data.getInt(fieldName);
129 }
130
131 public __ptr__ setPtr(String fieldName, __ptr__ value) {
132 return data.setPtr(fieldName, value);
133 }
134
135 public void setStruct(String fieldName, __struct__ value) {
136 data.setStruct(fieldName, value);
137 }
138
139 public void setDouble(String fieldName, double value) {
140 data.setDouble(fieldName, value);
141 }
142
143 public void setInt(String fieldName, int value) {
144 data.setInt(fieldName, value);
145 }
146
147 public void setBoolean(String fieldName, boolean value) {
148 data.setBoolean(fieldName, value);
149 }
150
151 public Object call(String name, Object... args) {
152 return data.call(name, args);
153 }
154
155 // public __array__ getArray(String fieldName) {
156 // return data.getArray(fieldName);
157 // }
158
159 public __array_of_integer__ getArrayOfInteger(String fieldName) {
160 throw new UnsupportedOperationException();
161 }
162
163 public __array_of_struct__ getArrayOfStruct(String fieldName) {
164 return data.getArrayOfStruct(fieldName);
165 }
166
167 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
168 return data.getArrayOfPtr(fieldName);
169 }
170
171 public __array_of_cstring__ getArrayOfCString(String fieldName) {
172 throw new UnsupportedOperationException();
173 }
174
175
176 }
3939
4040 private int data = 0;
4141
42 private final int UID = StarStructImpl.CPT++;
42 private final int UID = Counter.CPT++;
4343
4444 private String getUID36() {
4545 return Integer.toString(UID, 36);
3636 package smetana.core.amiga;
3737
3838 import smetana.core.Bucket;
39 import smetana.core.CType;
40 import smetana.core.JUtils;
41 import smetana.core.__array_of_double__;
42 import smetana.core.__array_of_integer_impl__;
43 import smetana.core.__array_of_ptr_impl__;
44 import smetana.core.__array_of_struct_impl__;
4539
4640 public class BucketToAreaFactory {
4741
4842 public static Area createArea(Bucket bucket, StarStruct parent) {
49 if (bucket.ctype.getArrayLength() != 0) {
50 return createAreaArray(bucket, bucket.ctype.getArrayLength());
51 }
52 if (bucket.ctype.functionPointer()) {
53 // return PointerToNull.nullPointerTo();
54 // return new AreaFunctionPointer();
55 return null;
56 }
57 if (bucket.ctype.isIntStar()) {
58 return null;
59 }
60 if (bucket.ctype.isDoubleStar()) {
61 return null;
62 }
63 if (bucket.ctype.isVoidStar()) {
64 return null;
65 // return PointerToNull.nullPointerTo();
66 // return new AreaVoidStar();
67 }
68 if (bucket.ctype.containsStar()) {
69 final String type = bucket.ctype.getType();
70 if (type.matches("\\w+\\*")) {
71 final Class theClass = CType.getClassFrom(type.substring(0, type.length() - 1));
72 JUtils.LOG("theClass=" + theClass);
73 // return PointerToNull.nullPointerTo();
74 return null;
75 }
76 throw new UnsupportedOperationException(bucket.toString());
77 }
78 if (bucket.ctype.isEnum()) {
79 return new AreaInt();
80 }
81 if (bucket.ctype.isPrimitive()) {
82 if (bucket.ctype.isInteger()) {
83 return new AreaInt();
84 }
85 if (bucket.ctype.isChar()) {
86 return new AreaInt();
87 }
88 if (bucket.ctype.isShort()) {
89 return new AreaInt();
90 }
91 if (bucket.ctype.isLong()) {
92 return new AreaInt();
93 }
94 if (bucket.ctype.isBoolean()) {
95 return new AreaInt();
96 }
97 if (bucket.ctype.isDoubleOrFloat()) {
98 return new AreaDouble();
99 }
100 throw new UnsupportedOperationException();
101 }
102 if (bucket.inlineStruct()) {
103 final Class theClass = bucket.ctype.getTypeClass();
104 return JUtils.create(theClass, parent);
105 }
106 if (bucket.ctype.isArrayOfCString()) {
107 return null;
108 }
109 if (bucket.ctype.isCString()) {
110 // return new AreaCString();
111 // return PointerToNull.nullPointerTo();
112 return null;
113 }
114 final Class theClass = bucket.ctype.getTypeClass();
115 if (theClass != null) {
116 return null;
117 // return PointerToNull.nullPointerTo();
118 }
119 JUtils.LOG("BucketToAreaFactory:: theClass = " + theClass);
120 JUtils.LOG("BucketToAreaFactory:: bucket=" + bucket);
121 JUtils.LOG("BucketToAreaFactory:: bucket.ctype=" + bucket.ctype);
12243 throw new UnsupportedOperationException();
12344 }
12445
125 private static Area createAreaArray(Bucket bucket, int arrayLength) {
126 JUtils.LOG("BucketToAreaFactory:createAreaArray: bucket=" + bucket);
127 JUtils.LOG("BucketToAreaFactory:createAreaArray: arrayLength=" + arrayLength);
128 JUtils.LOG("BucketToAreaFactory:createAreaArray: type=" + bucket.ctype);
129 if (bucket.ctype.getType().matches("char \\w+\\[\\d+\\]")) {
130 // Array of char
131 return __array_of_integer_impl__.mallocInteger(arrayLength);
132 }
133 if (bucket.ctype.getType().matches("int \\w+\\[\\d+\\]")) {
134 // Array of int
135 return __array_of_integer_impl__.mallocInteger(arrayLength);
136 }
137 if (bucket.ctype.getType().matches("double \\w+\\[\\d+\\]")) {
138 // Array of double
139 return __array_of_double__.mallocDouble(arrayLength);
140 }
141 if (bucket.ctype.getType().matches("\\w+ \\*\\w+\\[\\d+\\]")) {
142 // Array of pointer
143 final String element = bucket.ctype.getType().split(" ")[0];
144 JUtils.LOG("element=" + element);
145 final Class theClass = CType.getClassFrom(element);
146 JUtils.LOG("theClass=" + theClass);
147 return __array_of_ptr_impl__.malloc_empty(arrayLength);
148 }
149 if (bucket.ctype.getType().matches("\\w+ \\w+\\[\\d+\\]")) {
150 // Array of Struct
151 final String element = bucket.ctype.getType().split(" ")[0];
152 JUtils.LOG("element=" + element);
153 final Class theClass = CType.getClassFrom(element);
154 JUtils.LOG("theClass=" + theClass);
155 return __array_of_struct_impl__.malloc(theClass, arrayLength);
156 }
157 throw new UnsupportedOperationException();
158 }
15946 }
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core.amiga;
37
38 public class Counter {
39
40 public static int CPT = 0;
41
42 }
3838 import smetana.core.AllH;
3939 import smetana.core.UnsupportedC;
4040 import smetana.core.__array_of_integer__;
41 import smetana.core.__array_of_ptr__;
4241 import smetana.core.__ptr__;
4342
4443 public class StarArrayOfInteger extends UnsupportedC implements Area, AllH {
+0
-201
src/smetana/core/amiga/StarArrayOfPtr.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core.amiga;
37
38 import h.ST_boxf;
39 import smetana.core.AllH;
40 import smetana.core.UnsupportedC;
41 import smetana.core.__array_of_ptr__;
42 import smetana.core.__array_of_struct__;
43 import smetana.core.__ptr__;
44 import smetana.core.__struct__;
45 import smetana.core.size_t;
46
47 public class StarArrayOfPtr extends UnsupportedC implements Area, AllH {
48
49 private final __array_of_ptr__ array;
50
51 public StarArrayOfPtr(__array_of_ptr__ array) {
52 this.array = array;
53 }
54
55 public void realloc(int nb) {
56 array.realloc(nb);
57 }
58
59 public void realloc(size_t nb) {
60 array.realloc(nb);
61 }
62
63 public String getUID36() {
64 return array.getUID36();
65 }
66
67 public void memcopyFrom(Area source) {
68 ((StarStruct) array.getInternal(0)).memcopyFrom(source);
69 }
70
71 public final __array_of_ptr__ getInternalArray() {
72 return array;
73 }
74
75 public __ptr__ plus(int pointerMove) {
76 return new StarArrayOfPtr(array.move(pointerMove));
77 }
78
79 public void setInt(int value) {
80 array.setInt(value);
81 }
82
83 public int getInt() {
84 return array.getInt();
85 }
86
87 public __struct__ getStruct() {
88 return array.getStruct();
89 }
90
91 public void copyDataFrom(__struct__ other) {
92 ((StarStruct) array.getInternal(0)).copyDataFrom(other);
93 }
94
95 public void setPtr(__ptr__ value) {
96 array.setPtr(value);
97 }
98
99 public int minus(__ptr__ other) {
100 StarArrayOfPtr other2 = (StarArrayOfPtr) other;
101 int res = array.comparePointerInternal(other2.array);
102 return res;
103 }
104
105 public void setStruct(__struct__ value) {
106 array.setStruct(value);
107 }
108
109 public __ptr__ getPtr() {
110 return array.getPtr();
111 }
112
113 public __ptr__ getPtrForEquality() {
114 return array.getStruct().amp();
115 }
116
117 public int comparePointer(__ptr__ other) {
118 return array.comparePointerInternal(((StarArrayOfPtr) other).array);
119 }
120
121 public boolean isSameThan(StarArrayOfPtr other) {
122 return array.comparePointerInternal(other.array) == 0;
123 }
124
125 // Fieldname
126 public void setStruct(String fieldName, __struct__ data) {
127 ((__ptr__) array.getInternal(0)).setStruct(fieldName, data);
128 }
129
130 public __ptr__ setPtr(String fieldName, __ptr__ data) {
131 final Area tmp1 = array.getInternal(0);
132 if (tmp1 instanceof __struct__) {
133 return ((__struct__) tmp1).setPtr(fieldName, data);
134 }
135 return ((__ptr__) tmp1).setPtr(fieldName, data);
136 }
137
138 public void setInt(String fieldName, int data) {
139 ((__ptr__) array.getInternal(0)).setInt(fieldName, data);
140 }
141
142 public __ptr__ getPtr(String fieldName) {
143 final Area tmp1 = array.getInternal(0);
144 if (tmp1 instanceof __struct__) {
145 return ((__struct__) tmp1).getPtr(fieldName);
146 }
147 return ((__ptr__) tmp1).getPtr(fieldName);
148 }
149
150 public __struct__ getStruct(String fieldName) {
151 __ptr__ TMP = (__ptr__) array.getInternal(0);
152 if (TMP instanceof ST_boxf) {
153 return ((ST_boxf) TMP).getStructInternal(fieldName);
154 }
155 return TMP.getStruct(fieldName);
156 }
157
158 public void setDouble(String fieldName, double data) {
159 ((__ptr__) array.getInternal(0)).setDouble(fieldName, data);
160 }
161
162 public int getInt(String fieldName) {
163 final Area tmp1 = array.getInternal(0);
164 if (tmp1 instanceof __struct__) {
165 return ((__struct__) tmp1).getInt(fieldName);
166 }
167 return ((__ptr__) tmp1).getInt(fieldName);
168 }
169
170 public __array_of_struct__ getArrayOfStruct(String fieldName) {
171 return ((__ptr__) array.getInternal(0)).getArrayOfStruct(fieldName);
172 }
173
174 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
175 return ((__ptr__) array.getInternal(0)).getArrayOfPtr(fieldName);
176 }
177
178 public boolean getBoolean(String fieldName) {
179 return ((__ptr__) array.getInternal(0)).getBoolean(fieldName);
180 }
181
182 public void setBoolean(String fieldName, boolean value) {
183 ((__ptr__) array.getInternal(0)).setBoolean(fieldName, value);
184 }
185
186
187 public __ptr__ castTo(Class dest) {
188 return ((__ptr__) array.getInternal(0)).castTo(dest);
189 }
190
191
192 public double getDouble(String fieldName) {
193 final Area tmp1 = array.getInternal(0);
194 if (tmp1 instanceof __struct__) {
195 return ((__struct__) tmp1).getDouble(fieldName);
196 }
197 return ((__ptr__) tmp1).getDouble(fieldName);
198 }
199
200 }
+0
-130
src/smetana/core/amiga/StarArrayOfStruct.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core.amiga;
37
38 import smetana.core.AllH;
39 import smetana.core.UnsupportedC;
40 import smetana.core.__array_of_struct__;
41 import smetana.core.__ptr__;
42 import smetana.core.__struct__;
43
44 public class StarArrayOfStruct extends UnsupportedC implements Area, AllH {
45
46 private final __array_of_struct__ array;
47
48 public StarArrayOfStruct(__array_of_struct__ array) {
49 this.array = array;
50 }
51
52 public void realloc(int nb) {
53 array.realloc(nb);
54 }
55
56 public String getUID36() {
57 return array.getUID36();
58 }
59
60 public void memcopyFrom(Area source) {
61 throw new UnsupportedOperationException();
62 }
63
64 public final __array_of_struct__ getInternalArray() {
65 return array;
66 }
67
68 public __ptr__ plus(int pointerMove) {
69 return new StarArrayOfStruct(array.move(pointerMove));
70 }
71
72 public __struct__ getStruct() {
73 return array.getStruct();
74 }
75
76 public __ptr__ getPtr() {
77 return array.getPtr();
78 }
79
80 public int minus(__ptr__ other) {
81 StarArrayOfStruct other2 = (StarArrayOfStruct) other;
82 int res = array.comparePointerInternal(other2.array);
83 return res;
84 }
85
86 public void setStruct(__struct__ value) {
87 array.setStruct(value);
88 }
89
90 public __ptr__ getPtrForEquality() {
91 return array.getStruct().amp();
92 }
93
94 public int comparePointer(__ptr__ other) {
95 return array.comparePointerInternal(((StarArrayOfStruct) other).array);
96 }
97
98 public boolean isSameThan(StarArrayOfStruct other) {
99 return array.comparePointerInternal(other.array) == 0;
100 }
101
102 // Fieldname
103
104 public __ptr__ setPtr(String fieldName, __ptr__ data) {
105 final Area tmp1 = array.getInternal(0);
106 return ((__struct__) tmp1).setPtr(fieldName, data);
107 }
108
109 public __ptr__ getPtr(String fieldName) {
110 final Area tmp1 = array.getInternal(0);
111 return ((__struct__) tmp1).getPtr(fieldName);
112 }
113
114 public int getInt(String fieldName) {
115 final Area tmp1 = array.getInternal(0);
116 return ((__struct__) tmp1).getInt(fieldName);
117 }
118
119 public double getDouble(String fieldName) {
120 final Area tmp1 = array.getInternal(0);
121 return ((__struct__) tmp1).getDouble(fieldName);
122 }
123
124 public void setDouble(String fieldName, double data) {
125 final Area tmp1 = array.getInternal(0);
126 ((__struct__) tmp1).setDouble(fieldName, data);
127 }
128
129 }
+0
-116
src/smetana/core/amiga/StarStar.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core.amiga;
37
38 import smetana.core.UnsupportedC;
39 import smetana.core.__array_of_ptr__;
40 import smetana.core.__array_of_ptr_impl__;
41 import smetana.core.__ptr__;
42
43 public class StarStar extends UnsupportedC implements Area {
44
45 private Area area;
46
47 StarStar(Area area) {
48 this.area = area;
49 }
50
51 public static StarStar array_of_array_of_something_empty(final Class cl, int nb) {
52 return new StarStar(__array_of_ptr_impl__.malloc_empty(nb));
53 }
54
55 public String toString() {
56 return "->" + area;
57 }
58
59 Area getArea() {
60 return area;
61 }
62
63 public void swap(int i, int j) {
64 ((__array_of_ptr__) area).swap(i, j);
65
66 }
67
68 public void memcopyFrom(Area source) {
69 StarStar other = (StarStar) source;
70 this.area = other.area;
71 }
72
73 // public __ptr__ getBracket(int idx) {
74 // return ((AreaArray) area).getBracket(idx);
75 // }
76 //
77 public void realloc(int nb) {
78 ((__array_of_ptr__) area).realloc(nb);
79 }
80
81 //
82 // // __c__
83 // public void setBracket(int idx, Object data) {
84 // ((AreaArray) area).setBracket(idx, data);
85 // }
86 //
87 // public __ptr__ plus(int pointerMove) {
88 // return ((AreaArray) area).plus(pointerMove);
89 // }
90
91 public __ptr__ plus(int pointerMove) {
92 return new StarStar(((__array_of_ptr__) area).move(pointerMove));
93 }
94
95 public __ptr__ getPtr(String fieldName) {
96 return ((__array_of_ptr__) area).asPtr().getPtr(fieldName);
97 }
98
99 public __ptr__ getPtr() {
100 return (__ptr__) ((__array_of_ptr__) area).getInternal(0);
101 }
102
103 public void setPtr(__ptr__ value) {
104 ((__array_of_ptr__) area).setInternalByIndex(0, (Area) value);
105 }
106
107 public void setDouble(String fieldName, double data) {
108 throw new UnsupportedOperationException(getClass().toString());
109 }
110
111 public int comparePointer(__ptr__ other) {
112 return ((__array_of_ptr__) area).comparePointerInternal(((__array_of_ptr__) ((StarStar) other).area));
113 }
114
115 }
3636 package smetana.core.amiga;
3737
3838 import smetana.core.AllH;
39 import smetana.core.CString;
40 import smetana.core.__array_of_cstring__;
41 import smetana.core.__array_of_integer__;
42 import smetana.core.__array_of_ptr__;
43 import smetana.core.__array_of_struct__;
4439 import smetana.core.__ptr__;
4540 import smetana.core.__struct__;
4641
5853
5954 public void setInt(String fieldName, int data);
6055
61 public void setBoolean(String fieldName, boolean data);
62
6356 public void setDouble(String fieldName, double data);
64
65 public int getInt(String fieldName);
66
67 public double getDouble(String fieldName);
68
69 public boolean getBoolean(String fieldName);
7057
7158 public __ptr__ plus(int pointerMove);
7259
73 public CString getCString(String fieldName);
74
75 public __array_of_struct__ getArrayOfStruct(String fieldName);
76
77 public __array_of_ptr__ getArrayOfPtr(String fieldName);
78
79 public __array_of_cstring__ getArrayOfCString(String fieldName);
80
81 public __array_of_integer__ getArrayOfInteger(String fieldName);
82
83 public __struct__ getStruct(String fieldName);
84
85 public __ptr__ getPtr(String fieldName);
86
8760 public void setStruct(String fieldName, __struct__ newData);
88
89 public void setCString(String fieldName, CString newData);
9061
9162 public __ptr__ setPtr(String fieldName, __ptr__ newData);
9263
9869
9970 public void copyDataFrom(__ptr__ arg);
10071
101 public Object call(String fieldName, Object... args);
102
10372 public __ptr__ castTo(Class dest);
10473
10574 public Object addVirtualBytes(int virtualBytes);
+0
-544
src/smetana/core/amiga/StarStructImpl.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core.amiga;
37
38 import h.WithParent;
39
40 import java.util.HashSet;
41 import java.util.LinkedHashMap;
42 import java.util.Map;
43 import java.util.Set;
44 import java.util.TreeSet;
45
46 import smetana.core.Bucket;
47 import smetana.core.CFunction;
48 import smetana.core.CFunctionImpl;
49 import smetana.core.CString;
50 import smetana.core.HardcodedStruct;
51 import smetana.core.JUtils;
52 import smetana.core.MutableDoublePtr;
53 import smetana.core.OFFSET;
54 import smetana.core.StructureDefinition;
55 import smetana.core.UnsupportedC;
56 import smetana.core.__array_of_cstring__;
57 import smetana.core.__array_of_integer__;
58 import smetana.core.__array_of_ptr__;
59 import smetana.core.__array_of_struct__;
60 import smetana.core.__ptr__;
61 import smetana.core.__struct__;
62 import smetana.core.__struct_impl__;
63
64 public class StarStructImpl extends UnsupportedC implements StarStruct {
65
66 public static int CPT = 0;
67
68 private final int UID = CPT++;
69 private final Map<String, Area> fields;
70 private final Set<String> inlineFields = new HashSet<String>();
71 private final StarStruct parent;
72 private final Class theClass;
73
74 public boolean isSameThan(StarStruct other) {
75 return this.UID == ((StarStructImpl) other).UID;
76 }
77
78 @Override
79 public String toString() {
80 return "StarStruct " + getUID36() + " " + theClass + " " + fields.keySet() + " {parent=" + parent + "}";
81 }
82
83 public Class getRealClass() {
84 return theClass;
85 }
86
87 private int getIndexOf(Area searched) {
88 int i = 0;
89 for (Area a : fields.values()) {
90 if (a == searched) {
91 return i;
92 }
93 i++;
94 }
95 throw new IllegalArgumentException();
96 }
97
98 private Area getAreaByIndex(int idx) {
99 int i = 0;
100 for (Area a : fields.values()) {
101 if (i == idx) {
102 return a;
103 }
104 i++;
105 }
106 throw new IllegalArgumentException();
107 }
108
109 public __struct__ getStruct() {
110 return new __struct_impl__(this);
111 }
112
113 public StarStructImpl(Class theClass, StarStruct parent) {
114 this.parent = parent;
115 this.theClass = theClass;
116 this.fields = new LinkedHashMap<String, Area>();
117 JUtils.LOG("Creation Struct " + getUID36());
118 if (getUID36().equals("1tq")) {
119 JUtils.LOG("It's me");
120 }
121 final StructureDefinition structureDefinition = StructureDefinition.from(theClass);
122 final Map<String, Bucket> bucketsMap = structureDefinition.getBucketsMap();
123
124 JUtils.LOG("FIELDS = " + theClass + " " + bucketsMap.keySet());
125 for (Map.Entry<String, Bucket> ent : bucketsMap.entrySet()) {
126 // JUtils.LOG("AreaStruct entrie=" + ent.getKey());
127 final Bucket bucket = ent.getValue();
128 fields.put(bucket.name, BucketToAreaFactory.createArea(bucket, this));
129 if (bucket.inlineStruct() && bucket.functionPointer() == false) {
130 inlineFields.add(bucket.name);
131 }
132 }
133 }
134
135 public Area getArea(String name) {
136 if (fields.containsKey(name) == false) {
137 System.err.println("fields=" + fields.keySet());
138 throw new IllegalArgumentException("No such field " + name);
139 }
140 final Area result = fields.get(name);
141 return result;
142 }
143
144 public String getUID36() {
145 return Integer.toString(UID, 36);
146 }
147
148 // __c__
149
150 public String getDebug(String fieldName) {
151 throw new UnsupportedOperationException();
152 }
153
154 public void setInt(String fieldName, int data) {
155 final AreaInt area = (AreaInt) getArea(fieldName);
156 area.setInternal(data);
157 }
158
159 public void setBoolean(String fieldName, boolean data) {
160 final AreaInt area = (AreaInt) getArea(fieldName);
161 area.setInternal(data ? 1 : 0);
162 }
163
164 public void setDouble(String fieldName, double data) {
165 // if (fieldName.equals("x") && Math.round(data) == 54) {
166 // System.err.println("setDoubleTrace 54!!");
167 // }
168 final AreaDouble area = (AreaDouble) getArea(fieldName);
169 area.setInternal(data);
170 }
171
172 public int getInt(String fieldName) {
173 final AreaInt area = (AreaInt) getArea(fieldName);
174 return area.getInternal();
175 }
176
177 public double getDouble(String fieldName) {
178 final AreaDouble area = (AreaDouble) getArea(fieldName);
179 return area.getInternal();
180 }
181
182 public boolean getBoolean(String fieldName) {
183 final AreaInt area = (AreaInt) getArea(fieldName);
184 if (area == null) {
185 return false;
186 }
187 return area.getInternal() != 0;
188 }
189
190 public __ptr__ plus(int pointerMove) {
191 JUtils.LOG("******************* plus =" + pointerMove);
192 JUtils.LOG("me=" + this);
193 if (parent != null) {
194 int idx = ((StarStructImpl) parent).getIndexOf(this);
195 JUtils.LOG("idx=" + idx);
196 idx += pointerMove;
197 final Area result = ((StarStructImpl) parent).getAreaByIndex(idx);
198 JUtils.LOG("result=" + result);
199 return (__ptr__) result;
200 }
201 throw new UnsupportedOperationException(getClass().toString());
202 }
203
204 public CString getCString(String fieldName) {
205 return (CString) getArea(fieldName);
206 }
207
208 public __array_of_struct__ getArrayOfStruct(String fieldName) {
209 Area area = getArea(fieldName);
210 if (area instanceof StarArrayOfStruct) {
211 return ((StarArrayOfStruct) area).getInternalArray();
212 }
213 return (__array_of_struct__) area;
214 }
215
216 public __array_of_ptr__ getArrayOfPtr(String fieldName) {
217 Area area = getArea(fieldName);
218 if (area instanceof StarStar) {
219 return (__array_of_ptr__) ((StarStar) area).getArea();
220 }
221 if (area instanceof StarArrayOfPtr) {
222 return (__array_of_ptr__) ((StarArrayOfPtr) area).getInternalArray();
223 }
224 return (__array_of_ptr__) area;
225 }
226
227 public __array_of_cstring__ getArrayOfCString(String fieldName) {
228 Area area = getArea(fieldName);
229 if (area instanceof StarArrayOfCString) {
230 return ((StarArrayOfCString) area).getInternalArray();
231 }
232 return (__array_of_cstring__) area;
233 }
234
235 public __array_of_integer__ getArrayOfInteger(String fieldName) {
236 Area area = getArea(fieldName);
237 if (area instanceof StarArrayOfInteger) {
238 return ((StarArrayOfInteger) area).getInternalArray();
239 }
240 return (__array_of_integer__) area;
241 }
242
243 public __struct__ getStruct(String fieldName) {
244 // if (getArea(fieldName) instanceof __array__) {
245 // return ((__array__) getArea(fieldName)).getStruct(0);
246 // }
247 if (getArea(fieldName) != null && getArea(fieldName) instanceof __ptr__ == false) {
248 throw new IllegalArgumentException("Issue in getStruct with " + fieldName + " "
249 + getArea(fieldName).getClass());
250 }
251 final __ptr__ area = (__ptr__) getArea(fieldName);
252 // if (area instanceof StarArray) {
253 // final __array__ array = ((StarArray) area).getInternalArray();
254 // return new __struct__<__ptr__>((StarStruct) array.getInternal(0));
255 // }
256 if (area instanceof HardcodedStruct) {
257 return (__struct__) area;
258 }
259 if (area instanceof StarStructImpl == false) {
260 throw new IllegalStateException(fieldName + " " + area.getClass().toString());
261 }
262 if (area instanceof StarStructImpl && this.inlineFields.contains(fieldName) == false) {
263 throw new IllegalArgumentException(fieldName + " is NOT inline!");
264 }
265 return new __struct_impl__<__ptr__>((StarStructImpl) area);
266 }
267
268 public __ptr__ getPtr(String fieldName) {
269 if (getArea(fieldName) != null && getArea(fieldName) instanceof __ptr__ == false) {
270 throw new IllegalArgumentException("Issue in getStruct with " + fieldName + " "
271 + getArea(fieldName).getClass());
272 }
273 final __ptr__ area = (__ptr__) getArea(fieldName);
274 if (area == null) {
275 return null;
276 }
277 if (area instanceof StarStruct == false && area instanceof CFunctionImpl == false
278 && area instanceof CString == false && area instanceof StarStar == false
279 && area instanceof StarArrayOfPtr == false && area instanceof StarArrayOfStruct == false
280 && area instanceof StarArrayOfInteger == false && area instanceof MutableDoublePtr == false
281 /* && area instanceof AreaArray == false */) {
282 throw new IllegalStateException(area.getClass().toString());
283 }
284
285 if (area instanceof StarStructImpl && this.inlineFields.contains(fieldName)) {
286 throw new IllegalArgumentException(fieldName + " is inline!");
287 }
288 return area;
289 }
290
291 public void setStruct(String fieldName, __struct__ newData) {
292 if (newData == null) {
293 throw new IllegalArgumentException();
294 }
295 if (inlineFields.contains(fieldName) == false) {
296 throw new UnsupportedOperationException("IMPOSSIBLE2 " + fieldName);
297 }
298 final Area area = fields.get(fieldName);
299 if (area == null) {
300 throw new UnsupportedOperationException("IMPOSSIBLE3 " + fieldName);
301 }
302 if (area instanceof HardcodedStruct) {
303 ((HardcodedStruct) area).copyDataFrom(newData);
304 } else {
305 final StarStructImpl existing = (StarStructImpl) area;
306 existing.copyDataFrom(newData);
307 }
308 }
309
310 public void setCString(String fieldName, CString newData) {
311 if (newData == null) {
312 fields.put(fieldName, null);
313 } else {
314 fields.put(fieldName, (Area) newData);
315 ((CString) newData).setMyFather(this);
316 }
317 }
318
319 public __ptr__ setPtr(String fieldName, __ptr__ newData) {
320 if (newData instanceof CFunction) {
321 fields.put(fieldName, (Area) newData);
322 return newData;
323 }
324 if (inlineFields.contains(fieldName)) {
325 throw new UnsupportedOperationException("IMPOSSIBLE5 " + fieldName);
326 }
327 if (newData == null) {
328 fields.put(fieldName, null);
329 return null;
330 }
331 if (newData instanceof StarStruct) {
332 if (inlineFields.contains(fieldName)) {
333 throw new UnsupportedOperationException("IMPOSSIBLE1");
334 } else {
335 fields.put(fieldName, (Area) newData);
336 }
337 return newData;
338 }
339 if (newData instanceof CString) {
340 fields.put(fieldName, (Area) newData);
341 ((CString) newData).setMyFather(this);
342 return newData;
343 }
344 if (newData instanceof StarArrayOfPtr) {
345 fields.put(fieldName, (Area) newData);
346 return newData;
347 }
348 if (newData instanceof StarArrayOfStruct) {
349 fields.put(fieldName, (Area) newData);
350 return newData;
351 }
352 if (newData instanceof StarStar) {
353 fields.put(fieldName, (Area) newData);
354 return newData;
355 }
356 if (newData instanceof StarArrayOfCString) {
357 fields.put(fieldName, (Area) newData);
358 return newData;
359 }
360 if (newData instanceof MutableDoublePtr) {
361 fields.put(fieldName, (Area) newData);
362 return newData;
363 }
364 if (newData instanceof StarArrayOfInteger) {
365 fields.put(fieldName, (Area) newData);
366 return newData;
367 }
368 // if (newData instanceof AreaArray) {
369 // fields.put(fieldName, (Area) newData);
370 // return newData;
371 // }
372 throw new UnsupportedOperationException("en cours1 ! " + newData.getClass());
373 }
374
375 public void memcopyFrom(Area source) {
376 if (source instanceof StarArrayOfPtr) {
377 final __array_of_ptr__ array = ((StarArrayOfPtr) source).getInternalArray();
378 copyDataFrom((StarStructImpl) array.getInternal(0));
379 } else if (source instanceof __struct__) {
380 copyDataFrom((__struct__) source);
381 } else {
382 copyDataFrom((StarStructImpl) source);
383 }
384 }
385
386 public void copyDataFrom(__struct__ other) {
387 copyDataFrom(other.getInternalData());
388 }
389
390 public void setStruct(__struct__ value) {
391 copyDataFrom(value);
392 }
393
394 public void copyDataFrom(__ptr__ arg) {
395 JUtils.LOG("copyDataFrom I AM " + this);
396 JUtils.LOG("other=" + arg);
397 JUtils.LOG("FIELDS=" + fields.keySet());
398 if (arg instanceof InternalData) {
399 copyDataFromInternal((InternalData) arg);
400 return;
401 }
402 if (this.getClass() != arg.getClass()) {
403 throw new UnsupportedOperationException(getClass().toString());
404 }
405 StarStructImpl other = (StarStructImpl) arg;
406 if (fields.keySet().equals(other.fields.keySet()) == false) {
407 throw new IllegalStateException();
408 }
409 copyDataFromInternal(other);
410 }
411
412 private void copyDataFromInternal(InternalData other) {
413 for (String fieldName : new TreeSet<String>(fields.keySet())) {
414 Area field = fields.get(fieldName);
415 final Area otherField = other.getArea(fieldName);
416 if (field == null && otherField == null) {
417 continue;
418 }
419 if (field == null) {
420 if (otherField instanceof StarStructImpl && inlineFields.contains(fieldName) == false) {
421 fields.put(fieldName, otherField);
422 } else if (otherField instanceof CString) {
423 fields.put(fieldName, otherField);
424 } else if (otherField instanceof StarStar) {
425 fields.put(fieldName, otherField);
426 } else if (otherField instanceof StarArrayOfPtr) {
427 fields.put(fieldName, otherField);
428 } else if (otherField instanceof CFunction) {
429 fields.put(fieldName, otherField);
430 } else if (otherField instanceof StarArrayOfStruct) {
431 fields.put(fieldName, otherField);
432 } else {
433 System.err.println("XX otherField = " + otherField);
434 throw new UnsupportedOperationException(otherField.getClass().toString());
435 }
436 } else if (field instanceof AreaInt) {
437 field.memcopyFrom(otherField);
438 } else if (field instanceof AreaDouble) {
439 field.memcopyFrom(otherField);
440 } else if (field instanceof CString) {
441 field.memcopyFrom(otherField);
442 } else if (field instanceof StarStar) {
443 if (otherField == null) {
444 fields.put(fieldName, null);
445 } else {
446 field.memcopyFrom(otherField);
447 }
448 } else if (field instanceof StarStructImpl && inlineFields.contains(fieldName)) {
449 field.memcopyFrom(otherField);
450 } else if (field instanceof StarStructImpl && inlineFields.contains(fieldName) == false) {
451 fields.put(fieldName, otherField);
452 } else if (field instanceof StarArrayOfPtr) {
453 field.memcopyFrom(otherField);
454 } else if (field instanceof HardcodedStruct) {
455 field.memcopyFrom(otherField);
456 } else {
457 System.err.println("fieldName=" + fieldName + " " + field);
458 System.err.println("otherField = " + otherField);
459 throw new UnsupportedOperationException(field.getClass().toString());
460 }
461 }
462 }
463
464 public Object call(String fieldName, Object... args) {
465 final CFunction area = (CFunction) getArea(fieldName);
466 return area.exe(args);
467 }
468
469 public __ptr__ castTo(Class dest) {
470 JUtils.LOG("******************* castTo =" + dest);
471 JUtils.LOG("me=" + this);
472 if (theClass == dest) {
473 return this;
474 }
475 if (parent != null && ((StarStructImpl) parent).theClass == dest) {
476 JUtils.LOG("IT's my father!");
477 return parent;
478 }
479
480 final Area first = fields.values().iterator().next();
481 JUtils.LOG("first=" + first);
482 if (first instanceof StarStructImpl) {
483 final StarStructImpl first2 = (StarStructImpl) first;
484 JUtils.LOG("first.parent=" + first2.parent);
485 if (first2.parent != this) {
486 throw new IllegalStateException();
487 }
488 if (dest == first2.theClass) {
489 return first2;
490 }
491 }
492 if (first instanceof WithParent) {
493 final WithParent first2 = (WithParent) first;
494 JUtils.LOG("first.parent=" + first2.getParent());
495 if (first2.getParent() != this) {
496 throw new IllegalStateException();
497 }
498 return (__ptr__) first2;
499 }
500 throw new UnsupportedOperationException("first=" + first.getClass());
501 }
502
503 public Object addVirtualBytes(int virtualBytes) {
504 JUtils.LOG("#### addVirtualBytes " + virtualBytes);
505 if (virtualBytes == 0) {
506 return this;
507 }
508 JUtils.LOG("this=" + toString());
509 if (virtualBytes < 0) {
510 final OFFSET offset = OFFSET.fromInt(-virtualBytes);
511 JUtils.LOG("OFFSET1=" + offset);
512 if (parent == null) {
513 throw new UnsupportedOperationException("No father! How to go back?");
514 }
515 JUtils.LOG("father=" + parent);
516 if (((StarStructImpl) parent).theClass != offset.getTheClass()) {
517 throw new UnsupportedOperationException("Bad class matching1!");
518 }
519 final Object checking = parent.addVirtualBytes(-virtualBytes);
520 JUtils.LOG("checking=" + checking);
521 if (checking != this) {
522 throw new UnsupportedOperationException("Cheking fail!");
523 }
524 return parent;
525 }
526 final OFFSET offset = OFFSET.fromInt(virtualBytes);
527 JUtils.LOG("OFFSET2=" + offset);
528 final String field = offset.getField();
529 JUtils.LOG("field=" + field);
530 JUtils.LOG("fields=" + fields.keySet());
531 final Area result = fields.get(field);
532 if (result == null && parent != null) {
533 return parent.addVirtualBytes(virtualBytes);
534 }
535 if (result == null) {
536 throw new UnsupportedOperationException();
537 }
538 return result;
539 }
540
541 // __c__
542
543 }
3333 */
3434 package smetana.core.debug;
3535
36 import java.util.ArrayList;
37 import java.util.Collection;
38 import java.util.HashMap;
39 import java.util.HashSet;
40 import java.util.LinkedHashSet;
41 import java.util.List;
42 import java.util.Map;
43 import java.util.Set;
44
3645 public class Debug {
3746
47 private final Map<String, String> methodNames = new HashMap<String, String>();
48 private final Collection<String> called = new LinkedHashSet<String>();
49
3850 public void entering(String signature, String methodName) {
51 methodNames.put(signature, methodName);
52 if (called.contains(signature) == false) {
53 called.add(signature);
54 }
3955 }
4056
4157 public void leaving(String signature, String methodName) {
4258 }
4359
60 public void reset() {
61 methodNames.clear();
62 called.clear();
63 }
64
65 public void printMe() {
66 System.err.println("methodNames=" + methodNames.size());
67 System.err.println("called=" + called.size());
68 final List<String> called2 = new ArrayList<String>(called);
69 for (int i = 0; i < called.size(); i++) {
70 System.err.println("n " + i + " " + methodNames.get(called2.get(i)) + " " + called2.get(i));
71 }
72 final Set<String> called3 = new HashSet<String>(called);
73 for (String s : called3) {
74 System.err.println("p " + s);
75 }
76 }
77
4478 }
+0
-83
src/smetana/core/size_t_array_of_array_of_something_allocated.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38
39 public class size_t_array_of_array_of_something_allocated implements size_t {
40
41 final private int nb;
42 final private Class cl;
43
44 public size_t_array_of_array_of_something_allocated(Class cl, int nb) {
45 this.nb = nb;
46 this.cl = cl;
47 }
48
49 public boolean isZero() {
50 return nb == 0;
51 }
52
53 public int getInternalNb() {
54 return nb;
55 }
56
57
58 public __ptr__ realloc(Object old) {
59 throw new UnsupportedOperationException();
60 }
61
62 public __array_of_struct__ malloc() {
63 return __array_of_struct_impl__.malloc(cl, nb);
64 }
65
66 public size_t negate() {
67 throw new UnsupportedOperationException();
68 }
69
70 public size_t plus(int length) {
71 throw new UnsupportedOperationException();
72 }
73
74 public boolean isStrictPositive() {
75 throw new UnsupportedOperationException();
76 }
77
78 public boolean isStrictNegative() {
79 throw new UnsupportedOperationException();
80 }
81
82 }
+0
-94
src/smetana/core/size_t_array_of_array_of_something_empty.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import smetana.core.amiga.StarStar;
39
40 public class size_t_array_of_array_of_something_empty implements size_t {
41
42 final private int nb;
43 final private Class cl;
44
45 public size_t_array_of_array_of_something_empty(Class cl, int nb) {
46 this.nb = nb;
47 this.cl = cl;
48 }
49
50 public boolean isZero() {
51 return nb == 0;
52 }
53
54 public int getInternalNb() {
55 return nb;
56 }
57
58
59 public __ptr__ realloc(Object old) {
60 JUtils.LOG("realloc old1=" + old);
61 if (nb == 0) {
62 return null;
63 }
64 final StarStar data = (StarStar) old;
65 data.realloc(nb);
66 return data;
67 }
68
69 public __ptr__ malloc() {
70 return StarStar.array_of_array_of_something_empty(cl, nb);
71 }
72
73 public size_t negate() {
74 throw new UnsupportedOperationException();
75 }
76
77 public size_t plus(int length) {
78 throw new UnsupportedOperationException();
79 }
80
81 public boolean isStrictPositive() {
82 throw new UnsupportedOperationException();
83 }
84
85 public boolean isStrictNegative() {
86 throw new UnsupportedOperationException();
87 }
88
89 public final int getNb() {
90 return nb;
91 }
92
93 }
7878 }
7979
8080 public __ptr__ realloc(Object old) {
81 throw new UnsupportedOperationException();
81 ((StarArrayOfCString) old).realloc(size);
82 return (__ptr__) old;
8283 }
8384
8485 }
+0
-94
src/smetana/core/size_t_array_of_something.java less more
0 /* ========================================================================
1 * PlantUML : a free UML diagram generator
2 * ========================================================================
3 *
4 * Project Info: http://plantuml.com
5 *
6 * If you like this project or if you find it useful, you can support us at:
7 *
8 * http://plantuml.com/patreon (only 1$ per month!)
9 * http://plantuml.com/paypal
10 *
11 * This file is part of Smetana.
12 * Smetana is a partial translation of Graphviz/Dot sources from C to Java.
13 *
14 * (C) Copyright 2009-2017, Arnaud Roques
15 *
16 * This translation is distributed under the same Licence as the original C program.
17 *
18 * THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC
19 * LICENSE ("AGREEMENT"). [Eclipse Public License - v 1.0]
20 *
21 * ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES
22 * RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
23 *
24 * You may obtain a copy of the License at
25 *
26 * http://www.eclipse.org/legal/epl-v10.html
27 *
28 * Unless required by applicable law or agreed to in writing, software
29 * distributed under the License is distributed on an "AS IS" BASIS,
30 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
31 * See the License for the specific language governing permissions and
32 * limitations under the License.
33 *
34 */
35
36 package smetana.core;
37
38 import smetana.core.amiga.StarArrayOfPtr;
39 import smetana.core.amiga.StarStar;
40
41 public class size_t_array_of_something implements size_t {
42
43 final private int nb;
44 final private Class cl;
45
46 public size_t_array_of_something(Class cl, int nb) {
47 this.nb = nb;
48 this.cl = cl;
49 }
50
51 public boolean isZero() {
52 return nb == 0;
53 }
54
55 public int getInternalNb() {
56 return nb;
57 }
58
59
60 public __ptr__ malloc() {
61 return new StarArrayOfPtr(__array_of_ptr_impl__.malloc_allocated(cl, nb));
62 }
63
64 public size_t negate() {
65 throw new UnsupportedOperationException();
66 }
67
68 public size_t plus(int length) {
69 throw new UnsupportedOperationException();
70 }
71
72 public boolean isStrictPositive() {
73 throw new UnsupportedOperationException();
74 }
75
76 public boolean isStrictNegative() {
77 throw new UnsupportedOperationException();
78 }
79
80 public __ptr__ realloc(Object old) {
81 if (old instanceof StarStar) {
82 ((StarStar) old).realloc(nb);
83 return (__ptr__) old;
84 }
85 ((StarArrayOfPtr) old).realloc(nb);
86 return (__ptr__) old;
87 }
88
89 public int getNb() {
90 return nb;
91 }
92
93 }
Binary diff not shown
Binary diff not shown
Binary diff not shown
stdlib/devicons-abx.repx less more
Binary diff not shown
stdlib/devicons-dex.repx less more
Binary diff not shown
stdlib/font-awesome-abx.repx less more
Binary diff not shown
stdlib/font-awesome-dex.repx less more
Binary diff not shown
0 azure
01 aws
12 cloudinsight
23 cloudogu
3 devicons
4 font-awesome
4 tupadr3
55 material
66 office
Binary diff not shown
Binary diff not shown