| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
package smetana.core; |
| 38 |
|
| 39 |
import h.ST_Agedge_s; |
| 40 |
import h.ST_Agedgeinfo_t; |
| 41 |
import h.ST_Agnode_s; |
| 42 |
import h.ST_Agnodeinfo_t; |
| 43 |
import h.ST_Agobj_s; |
| 44 |
import h.ST_Agraph_s; |
| 45 |
import h.ST_Agraphinfo_t; |
| 46 |
import h.ST_Agrec_s; |
| 47 |
import h.ST_Agtag_s; |
| 48 |
import h.ST_GVC_s; |
| 49 |
import h.ST_Pedge_t; |
| 50 |
import h.ST_bezier; |
| 51 |
import h.ST_boxf; |
| 52 |
import h.ST_elist; |
| 53 |
import h.ST_layout_t; |
| 54 |
import h.ST_nlist_t; |
| 55 |
import h.ST_pointf; |
| 56 |
import h.ST_port; |
| 57 |
import h.ST_rank_t; |
| 58 |
import h.ST_shape_desc; |
| 59 |
import h.ST_splines; |
| 60 |
import h.ST_textlabel_t; |
| 61 |
import h.ST_textspan_t; |
| 62 |
|
| 63 |
import java.util.regex.Matcher; |
| 64 |
import java.util.regex.Pattern; |
| 65 |
|
| 66 |
public class Macro { |
| 67 |
|
| 68 |
public static <O> O F(O result, Object... dummy) { |
| 69 |
return result; |
| 70 |
} |
| 71 |
|
| 72 |
public static int ASINT(boolean v) { |
| 73 |
return v ? 1 : 0; |
| 74 |
} |
| 75 |
|
| 76 |
public static boolean N(boolean v) { |
| 77 |
return v == false; |
| 78 |
} |
| 79 |
|
| 80 |
public static boolean N(int i) { |
| 81 |
return i == 0; |
| 82 |
} |
| 83 |
|
| 84 |
public static boolean N(char c) { |
| 85 |
return c == 0; |
| 86 |
} |
| 87 |
|
| 88 |
public static boolean N(Object o) { |
| 89 |
if (o instanceof Boolean) { |
| 90 |
throw new IllegalArgumentException(); |
| 91 |
} |
| 92 |
if (o instanceof Integer) { |
| 93 |
throw new IllegalArgumentException(); |
| 94 |
} |
| 95 |
return o == null; |
| 96 |
} |
| 97 |
|
| 98 |
public static boolean NOT(boolean v) { |
| 99 |
return v == false; |
| 100 |
} |
| 101 |
|
| 102 |
public static int NOTI(boolean v) { |
| 103 |
return v ? 0 : 1; |
| 104 |
} |
| 105 |
|
| 106 |
public static boolean NOT(int i) { |
| 107 |
return i == 0; |
| 108 |
} |
| 109 |
|
| 110 |
public static boolean NOT(char c) { |
| 111 |
return c == 0; |
| 112 |
} |
| 113 |
|
| 114 |
public static boolean NOT(Object o) { |
| 115 |
return o == null; |
| 116 |
} |
| 117 |
|
| 118 |
public static void TRACE(String functionName) { |
| 119 |
|
| 120 |
} |
| 121 |
|
| 122 |
public static __ptr__ UNSUPPORTED(String comment) { |
| 123 |
throw new UnsupportedOperationException(comment); |
| 124 |
} |
| 125 |
|
| 126 |
public static int UNSUPPORTED_INT(String comment) { |
| 127 |
throw new UnsupportedOperationException(comment); |
| 128 |
} |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
public final static int AGRAPH = 0; |
| 138 |
public final static int AGNODE = 1; |
| 139 |
public final static int AGOUTEDGE = 2; |
| 140 |
public final static int AGINEDGE = 3; |
| 141 |
public final static int AGEDGE = AGOUTEDGE; |
| 142 |
|
| 143 |
|
| 144 |
public static ST_Agtag_s AGTAG(__ptr__ obj) { |
| 145 |
return (ST_Agtag_s) ((ST_Agobj_s) obj.castTo(ST_Agobj_s.class)).tag; |
| 146 |
} |
| 147 |
|
| 148 |
|
| 149 |
public static int AGTYPE(__ptr__ obj) { |
| 150 |
return AGTAG(obj).objtype; |
| 151 |
} |
| 152 |
|
| 153 |
public static void AGTYPE(__ptr__ obj, int v) { |
| 154 |
AGTAG(obj).objtype = v; |
| 155 |
} |
| 156 |
|
| 157 |
|
| 158 |
public static int AGID(__ptr__ obj) { |
| 159 |
return AGTAG(obj).id; |
| 160 |
} |
| 161 |
|
| 162 |
public static void AGID(__ptr__ obj, int v) { |
| 163 |
AGTAG(obj).id = v; |
| 164 |
} |
| 165 |
|
| 166 |
|
| 167 |
public static int AGSEQ(__ptr__ obj) { |
| 168 |
return AGTAG(obj).seq; |
| 169 |
} |
| 170 |
|
| 171 |
public static void AGSEQ(__ptr__ obj, int v) { |
| 172 |
AGTAG(obj).seq = v; |
| 173 |
} |
| 174 |
|
| 175 |
|
| 176 |
|
| 177 |
public static ST_Agrec_s AGDATA(__ptr__ obj) { |
| 178 |
return ((ST_Agobj_s) obj.castTo(ST_Agobj_s.class)).data; |
| 179 |
} |
| 180 |
|
| 181 |
public static void AGDATA(__ptr__ obj, __ptr__ v) { |
| 182 |
obj.castTo(ST_Agobj_s.class).setPtr("data", v); |
| 183 |
} |
| 184 |
|
| 185 |
|
| 186 |
public static __ptr__ AGIN2OUT(__ptr__ e) { |
| 187 |
return e.plus(-1); |
| 188 |
} |
| 189 |
|
| 190 |
|
| 191 |
public static __ptr__ AGOUT2IN(__ptr__ e) { |
| 192 |
return e.plus(1); |
| 193 |
} |
| 194 |
|
| 195 |
|
| 196 |
public static ST_Agedge_s AGOPP(ST_Agedge_s e) { |
| 197 |
return (ST_Agedge_s) (AGTYPE(e) == AGINEDGE ? AGIN2OUT(e) : AGOUT2IN(e)); |
| 198 |
} |
| 199 |
|
| 200 |
|
| 201 |
public static ST_Agedge_s AGMKOUT(__ptr__ e) { |
| 202 |
return (ST_Agedge_s) (AGTYPE(e) == AGOUTEDGE ? (e) : AGIN2OUT(e)); |
| 203 |
} |
| 204 |
|
| 205 |
|
| 206 |
public static ST_Agedge_s AGMKIN(__ptr__ e) { |
| 207 |
return (ST_Agedge_s) (AGTYPE(e) == AGINEDGE ? (e) : AGOUT2IN(e)); |
| 208 |
} |
| 209 |
|
| 210 |
|
| 211 |
public static ST_Agnode_s AGTAIL(__ptr__ e) { |
| 212 |
return (ST_Agnode_s) AGMKIN(e).node; |
| 213 |
} |
| 214 |
|
| 215 |
public static ST_Agnode_s agtail(__ptr__ e) { |
| 216 |
return (ST_Agnode_s) AGMKIN(e).node; |
| 217 |
} |
| 218 |
|
| 219 |
public static void agtail(ST_Agedge_s e, __ptr__ v) { |
| 220 |
AGMKIN(e).setPtr("node", v); |
| 221 |
} |
| 222 |
|
| 223 |
|
| 224 |
public static ST_Agnode_s AGHEAD(__ptr__ e) { |
| 225 |
return (ST_Agnode_s) AGMKOUT(e).node; |
| 226 |
} |
| 227 |
|
| 228 |
private static ST_Agnode_s aghead(ST_Agedge_s e) { |
| 229 |
return (ST_Agnode_s) AGMKOUT(e).node; |
| 230 |
} |
| 231 |
|
| 232 |
public static void aghead(ST_Agedge_s e, __ptr__ v) { |
| 233 |
AGMKOUT(e).setPtr("node", v); |
| 234 |
} |
| 235 |
|
| 236 |
|
| 237 |
|
| 238 |
|
| 239 |
|
| 240 |
|
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
|
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
|
| 249 |
|
| 250 |
|
| 251 |
|
| 252 |
|
| 253 |
|
| 254 |
|
| 255 |
|
| 256 |
|
| 257 |
|
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
|
| 262 |
|
| 263 |
|
| 264 |
|
| 265 |
|
| 266 |
|
| 267 |
|
| 268 |
public static int LENGTH(ST_Agedge_s e) { |
| 269 |
return ND_rank(aghead(e)) - ND_rank(agtail(e)); |
| 270 |
} |
| 271 |
|
| 272 |
|
| 273 |
public static int SLACK(ST_Agedge_s e) { |
| 274 |
return LENGTH(e) - ED_minlen(e); |
| 275 |
} |
| 276 |
|
| 277 |
|
| 278 |
public static boolean SEQ(int a, int b, int c) { |
| 279 |
return (((a) <= (b)) && ((b) <= (c))); |
| 280 |
} |
| 281 |
|
| 282 |
|
| 283 |
public static boolean TREE_EDGE(ST_Agedge_s e) { |
| 284 |
return ED_tree_index(e) >= 0; |
| 285 |
} |
| 286 |
|
| 287 |
|
| 288 |
public static __ptr__ GD_parent(ST_Agraph_s g) { |
| 289 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).parent; |
| 290 |
} |
| 291 |
|
| 292 |
public static void GD_parent(ST_Agraph_s g, __ptr__ v) { |
| 293 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("parent", v); |
| 294 |
} |
| 295 |
|
| 296 |
|
| 297 |
|
| 298 |
public static ST_layout_t GD_drawing(ST_Agraph_s g) { |
| 299 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).drawing; |
| 300 |
} |
| 301 |
|
| 302 |
public static void GD_drawing(ST_Agraph_s g, __ptr__ v) { |
| 303 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("drawing", v); |
| 304 |
} |
| 305 |
|
| 306 |
|
| 307 |
public static ST_boxf GD_bb(__ptr__ g) { |
| 308 |
return (ST_boxf) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).bb; |
| 309 |
} |
| 310 |
|
| 311 |
|
| 312 |
public static ST_GVC_s GD_gvc(ST_Agraph_s g) { |
| 313 |
return (ST_GVC_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).gvc; |
| 314 |
} |
| 315 |
|
| 316 |
public static void GD_gvc(ST_Agraph_s g, ST_GVC_s v) { |
| 317 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("gvc", v); |
| 318 |
} |
| 319 |
|
| 320 |
|
| 321 |
public static __ptr__ GD_cleanup(ST_Agraph_s g) { |
| 322 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).cleanup; |
| 323 |
} |
| 324 |
|
| 325 |
|
| 326 |
|
| 327 |
|
| 328 |
public static ST_pointf[] GD_border(ST_Agraph_s g) { |
| 329 |
return ((ST_Agraphinfo_t) AGDATA(g).castTo(ST_Agraphinfo_t.class)).border; |
| 330 |
} |
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
public static ST_Agraph_s.Array GD_clust(ST_Agraph_s g) { |
| 335 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).clust; |
| 336 |
} |
| 337 |
|
| 338 |
public static void GD_clust(ST_Agraph_s g, __ptr__ v) { |
| 339 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("clust", v); |
| 340 |
} |
| 341 |
|
| 342 |
|
| 343 |
public static ST_Agraph_s GD_dotroot(ST_Agraph_s g) { |
| 344 |
return (ST_Agraph_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).dotroot; |
| 345 |
} |
| 346 |
|
| 347 |
public static void GD_dotroot(ST_Agraph_s g, __ptr__ v) { |
| 348 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("dotroot", v); |
| 349 |
} |
| 350 |
|
| 351 |
|
| 352 |
public static ST_nlist_t GD_comp(ST_Agraph_s g) { |
| 353 |
return (ST_nlist_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).comp; |
| 354 |
} |
| 355 |
|
| 356 |
|
| 357 |
public static int GD_exact_ranksep(ST_Agraph_s g) { |
| 358 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).exact_ranksep; |
| 359 |
} |
| 360 |
|
| 361 |
public static void GD_exact_ranksep(ST_Agraph_s g, int v) { |
| 362 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("exact_ranksep", v); |
| 363 |
} |
| 364 |
|
| 365 |
|
| 366 |
public static boolean GD_expanded(ST_Agraph_s g) { |
| 367 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded; |
| 368 |
} |
| 369 |
|
| 370 |
public static void GD_expanded(ST_Agraph_s g, boolean v) { |
| 371 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).expanded = v; |
| 372 |
} |
| 373 |
|
| 374 |
|
| 375 |
public static int GD_flags(ST_Agraph_s g) { |
| 376 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).flags; |
| 377 |
} |
| 378 |
|
| 379 |
public static void GD_flags(ST_Agraph_s g, int v) { |
| 380 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("flags", v); |
| 381 |
} |
| 382 |
|
| 383 |
|
| 384 |
|
| 385 |
public static int GD_charset(ST_Agraph_s g) { |
| 386 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).charset; |
| 387 |
} |
| 388 |
|
| 389 |
public static void GD_charset(ST_Agraph_s g, int v) { |
| 390 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("charset", v); |
| 391 |
} |
| 392 |
|
| 393 |
|
| 394 |
public static int GD_has_labels(__ptr__ g) { |
| 395 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_labels; |
| 396 |
} |
| 397 |
|
| 398 |
public static void GD_has_labels(__ptr__ g, int v) { |
| 399 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("has_labels", v); |
| 400 |
} |
| 401 |
|
| 402 |
|
| 403 |
|
| 404 |
public static int GD_has_flat_edges(ST_Agraph_s g) { |
| 405 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges; |
| 406 |
} |
| 407 |
|
| 408 |
public static void GD_has_flat_edges(ST_Agraph_s g, boolean v) { |
| 409 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).has_flat_edges = v?1:0; |
| 410 |
} |
| 411 |
|
| 412 |
|
| 413 |
|
| 414 |
|
| 415 |
public static double GD_ht1(ST_Agraph_s g) { |
| 416 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht1; |
| 417 |
} |
| 418 |
|
| 419 |
public static void GD_ht1(ST_Agraph_s g, double v) { |
| 420 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht1", v); |
| 421 |
} |
| 422 |
|
| 423 |
|
| 424 |
public static double GD_ht2(ST_Agraph_s g) { |
| 425 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ht2; |
| 426 |
} |
| 427 |
|
| 428 |
public static void GD_ht2(ST_Agraph_s g, double v) { |
| 429 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setDouble("ht2", v); |
| 430 |
} |
| 431 |
|
| 432 |
|
| 433 |
|
| 434 |
public static int GD_installed(ST_Agraph_s g) { |
| 435 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).installed; |
| 436 |
} |
| 437 |
|
| 438 |
public static void GD_installed(ST_Agraph_s g, int v) { |
| 439 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("installed", v); |
| 440 |
} |
| 441 |
|
| 442 |
|
| 443 |
public static ST_textlabel_t GD_label(__ptr__ g) { |
| 444 |
return (ST_textlabel_t) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label; |
| 445 |
} |
| 446 |
|
| 447 |
public static void GD_label(__ptr__ g, __ptr__ v) { |
| 448 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("label", v); |
| 449 |
} |
| 450 |
|
| 451 |
|
| 452 |
public static ST_Agnode_s GD_leader(ST_Agraph_s g) { |
| 453 |
return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).leader; |
| 454 |
} |
| 455 |
|
| 456 |
public static void GD_leader(ST_Agraph_s g, __ptr__ v) { |
| 457 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("leader", v); |
| 458 |
} |
| 459 |
|
| 460 |
|
| 461 |
public static int GD_rankdir2(ST_Agraph_s g) { |
| 462 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir; |
| 463 |
} |
| 464 |
|
| 465 |
public static void GD_rankdir2(ST_Agraph_s g, int v) { |
| 466 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("rankdir", v); |
| 467 |
} |
| 468 |
|
| 469 |
|
| 470 |
public static int GD_rankdir(ST_Agraph_s g) { |
| 471 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankdir & 0x3; |
| 472 |
} |
| 473 |
|
| 474 |
|
| 475 |
public static int GD_flip(ST_Agraph_s g) { |
| 476 |
return GD_rankdir(g) & 1; |
| 477 |
} |
| 478 |
|
| 479 |
|
| 480 |
|
| 481 |
|
| 482 |
public static ST_Agnode_s GD_ln(ST_Agraph_s g) { |
| 483 |
return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ln; |
| 484 |
} |
| 485 |
|
| 486 |
public static void GD_ln(ST_Agraph_s g, __ptr__ v) { |
| 487 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("ln", v); |
| 488 |
} |
| 489 |
|
| 490 |
|
| 491 |
public static int GD_maxrank(ST_Agraph_s g) { |
| 492 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxrank; |
| 493 |
} |
| 494 |
|
| 495 |
public static void GD_maxrank(ST_Agraph_s g, int v) { |
| 496 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("maxrank", v); |
| 497 |
} |
| 498 |
|
| 499 |
|
| 500 |
public static __ptr__ GD_maxset(ST_Agraph_s g) { |
| 501 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).maxset; |
| 502 |
} |
| 503 |
|
| 504 |
|
| 505 |
public static int GD_minrank(ST_Agraph_s g) { |
| 506 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minrank; |
| 507 |
} |
| 508 |
|
| 509 |
public static void GD_minrank(ST_Agraph_s g, int v) { |
| 510 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("minrank", v); |
| 511 |
} |
| 512 |
|
| 513 |
|
| 514 |
public static __ptr__ GD_minset(ST_Agraph_s g) { |
| 515 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).minset; |
| 516 |
} |
| 517 |
|
| 518 |
|
| 519 |
|
| 520 |
|
| 521 |
|
| 522 |
public static int GD_n_cluster(ST_Agraph_s g) { |
| 523 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_cluster; |
| 524 |
} |
| 525 |
|
| 526 |
public static void GD_n_cluster(ST_Agraph_s g, int v) { |
| 527 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_cluster", v); |
| 528 |
} |
| 529 |
|
| 530 |
|
| 531 |
public static int GD_n_nodes(ST_Agraph_s g) { |
| 532 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).n_nodes; |
| 533 |
} |
| 534 |
|
| 535 |
public static void GD_n_nodes(ST_Agraph_s g, int v) { |
| 536 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("n_nodes", v); |
| 537 |
} |
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
|
| 542 |
|
| 543 |
public static ST_Agnode_s GD_nlist(ST_Agraph_s g) { |
| 544 |
return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nlist; |
| 545 |
} |
| 546 |
|
| 547 |
public static void GD_nlist(ST_Agraph_s g, __ptr__ v) { |
| 548 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("nlist", v); |
| 549 |
} |
| 550 |
|
| 551 |
|
| 552 |
public static int GD_nodesep(ST_Agraph_s g) { |
| 553 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).nodesep; |
| 554 |
} |
| 555 |
|
| 556 |
public static void GD_nodesep(ST_Agraph_s g, int v) { |
| 557 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("nodesep", v); |
| 558 |
} |
| 559 |
|
| 560 |
|
| 561 |
|
| 562 |
public static ST_rank_t.Array2 GD_rank(ST_Agraph_s g) { |
| 563 |
return (ST_rank_t.Array2) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rank; |
| 564 |
} |
| 565 |
|
| 566 |
public static void GD_rank(ST_Agraph_s g, ST_rank_t.Array2 v) { |
| 567 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rank", v); |
| 568 |
} |
| 569 |
|
| 570 |
|
| 571 |
public static ST_Agnode_s.Array GD_rankleader(ST_Agraph_s g) { |
| 572 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rankleader; |
| 573 |
} |
| 574 |
|
| 575 |
public static void GD_rankleader(ST_Agraph_s g, __ptr__ v) { |
| 576 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rankleader", v); |
| 577 |
} |
| 578 |
|
| 579 |
|
| 580 |
public static int GD_ranksep(ST_Agraph_s g) { |
| 581 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).ranksep; |
| 582 |
} |
| 583 |
|
| 584 |
public static void GD_ranksep(ST_Agraph_s g, int v) { |
| 585 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("ranksep", v); |
| 586 |
} |
| 587 |
|
| 588 |
|
| 589 |
public static ST_Agnode_s GD_rn(ST_Agraph_s g) { |
| 590 |
return (ST_Agnode_s) ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).rn; |
| 591 |
} |
| 592 |
|
| 593 |
public static void GD_rn(ST_Agraph_s g, __ptr__ v) { |
| 594 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setPtr("rn", v); |
| 595 |
} |
| 596 |
|
| 597 |
|
| 598 |
public static int GD_set_type(ST_Agraph_s g) { |
| 599 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).set_type; |
| 600 |
} |
| 601 |
|
| 602 |
public static void GD_set_type(ST_Agraph_s g, int v) { |
| 603 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("set_type", v); |
| 604 |
} |
| 605 |
|
| 606 |
|
| 607 |
public static int GD_label_pos(ST_Agraph_s g) { |
| 608 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).label_pos; |
| 609 |
} |
| 610 |
|
| 611 |
public static void GD_label_pos(ST_Agraph_s g, int v) { |
| 612 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("label_pos", v); |
| 613 |
} |
| 614 |
|
| 615 |
|
| 616 |
public static int GD_showboxes(ST_Agraph_s g) { |
| 617 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).showboxes; |
| 618 |
} |
| 619 |
|
| 620 |
public static void GD_showboxes(ST_Agraph_s g, int v) { |
| 621 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("showboxes", v); |
| 622 |
} |
| 623 |
|
| 624 |
|
| 625 |
public static int GD_fontnames(ST_Agraph_s g) { |
| 626 |
return ((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).fontnames; |
| 627 |
} |
| 628 |
|
| 629 |
public static void GD_fontnames(ST_Agraph_s g, int v) { |
| 630 |
((ST_Agraphinfo_t)AGDATA(g).castTo(ST_Agraphinfo_t.class)).setInt("fontnames", v); |
| 631 |
} |
| 632 |
|
| 633 |
|
| 634 |
|
| 635 |
|
| 636 |
|
| 637 |
|
| 638 |
public static int ND_id(ST_Agnode_s n) { |
| 639 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).id; |
| 640 |
} |
| 641 |
|
| 642 |
|
| 643 |
public static __ptr__ ND_alg(ST_Agnode_s n) { |
| 644 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).alg; |
| 645 |
} |
| 646 |
|
| 647 |
public static void ND_alg(ST_Agnode_s n, __ptr__ value) { |
| 648 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("alg", value); |
| 649 |
} |
| 650 |
|
| 651 |
|
| 652 |
public static ST_Agnode_s ND_UF_parent(__ptr__ n) { |
| 653 |
return (ST_Agnode_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_parent; |
| 654 |
} |
| 655 |
|
| 656 |
public static void ND_UF_parent(__ptr__ n, __ptr__ v) { |
| 657 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("UF_parent", v); |
| 658 |
} |
| 659 |
|
| 660 |
|
| 661 |
|
| 662 |
public static int ND_UF_size(ST_Agnode_s n) { |
| 663 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).UF_size; |
| 664 |
} |
| 665 |
|
| 666 |
public static void ND_UF_size(ST_Agnode_s n, int v) { |
| 667 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("UF_size", v); |
| 668 |
} |
| 669 |
|
| 670 |
|
| 671 |
|
| 672 |
public static ST_Agraph_s ND_clust(__ptr__ n) { |
| 673 |
return (ST_Agraph_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).clust; |
| 674 |
} |
| 675 |
|
| 676 |
public static void ND_clust(ST_Agnode_s n, __ptr__ v) { |
| 677 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("clust", v); |
| 678 |
} |
| 679 |
|
| 680 |
|
| 681 |
public static ST_pointf ND_coord(__ptr__ n) { |
| 682 |
return (ST_pointf) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).coord; |
| 683 |
} |
| 684 |
|
| 685 |
|
| 686 |
|
| 687 |
|
| 688 |
public static ST_elist ND_flat_in(ST_Agnode_s n) { |
| 689 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_in; |
| 690 |
} |
| 691 |
|
| 692 |
|
| 693 |
public static ST_elist ND_flat_out(ST_Agnode_s n) { |
| 694 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).flat_out; |
| 695 |
} |
| 696 |
|
| 697 |
|
| 698 |
|
| 699 |
public static boolean ND_has_port(ST_Agnode_s n) { |
| 700 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).has_port; |
| 701 |
} |
| 702 |
|
| 703 |
|
| 704 |
|
| 705 |
|
| 706 |
public static double ND_height(__ptr__ n) { |
| 707 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).height; |
| 708 |
} |
| 709 |
|
| 710 |
public static void ND_height(ST_Agnode_s n, double v) { |
| 711 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("height", v); |
| 712 |
} |
| 713 |
|
| 714 |
|
| 715 |
|
| 716 |
public static double ND_ht(__ptr__ n) { |
| 717 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ht; |
| 718 |
} |
| 719 |
|
| 720 |
public static void ND_ht(ST_Agnode_s n, double v) { |
| 721 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("ht", v); |
| 722 |
} |
| 723 |
|
| 724 |
|
| 725 |
public static ST_elist ND_in(ST_Agnode_s n) { |
| 726 |
return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).in; |
| 727 |
} |
| 728 |
|
| 729 |
public static void ND_in(__ptr__ n, __struct__<ST_elist> v) { |
| 730 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("in", v); |
| 731 |
} |
| 732 |
|
| 733 |
|
| 734 |
public static __ptr__ ND_inleaf(ST_Agnode_s n) { |
| 735 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).inleaf; |
| 736 |
} |
| 737 |
|
| 738 |
|
| 739 |
public static ST_textlabel_t ND_label(ST_Agnode_s n) { |
| 740 |
return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).label; |
| 741 |
} |
| 742 |
|
| 743 |
public static void ND_label(ST_Agnode_s n, __ptr__ v) { |
| 744 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("label", v); |
| 745 |
} |
| 746 |
|
| 747 |
|
| 748 |
public static ST_textlabel_t ND_xlabel(ST_Agnode_s n) { |
| 749 |
return (ST_textlabel_t) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).xlabel; |
| 750 |
} |
| 751 |
|
| 752 |
|
| 753 |
public static int ND_lim(ST_Agnode_s n) { |
| 754 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lim; |
| 755 |
} |
| 756 |
|
| 757 |
public static void ND_lim(ST_Agnode_s n, int v) { |
| 758 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("lim", v); |
| 759 |
} |
| 760 |
|
| 761 |
|
| 762 |
public static int ND_low(ST_Agnode_s n) { |
| 763 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).low; |
| 764 |
} |
| 765 |
|
| 766 |
public static void ND_low(ST_Agnode_s n, int v) { |
| 767 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("low", v); |
| 768 |
} |
| 769 |
|
| 770 |
|
| 771 |
public static double ND_lw(__ptr__ n) { |
| 772 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).lw; |
| 773 |
} |
| 774 |
|
| 775 |
public static void ND_lw(ST_Agnode_s n, double v) { |
| 776 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("lw", v); |
| 777 |
} |
| 778 |
|
| 779 |
|
| 780 |
public static int ND_mark(__ptr__ n) { |
| 781 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark; |
| 782 |
} |
| 783 |
|
| 784 |
public static void ND_mark(__ptr__ n, int v) { |
| 785 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("mark", v); |
| 786 |
} |
| 787 |
|
| 788 |
public static void ND_mark(__ptr__ n, boolean v) { |
| 789 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mark = v?1:0; |
| 790 |
} |
| 791 |
|
| 792 |
|
| 793 |
public static double ND_mval(__ptr__ n) { |
| 794 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).mval; |
| 795 |
} |
| 796 |
|
| 797 |
public static void ND_mval(ST_Agnode_s n, double v) { |
| 798 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("mval", v); |
| 799 |
} |
| 800 |
|
| 801 |
|
| 802 |
|
| 803 |
public static ST_Agnode_s ND_next(ST_Agnode_s n) { |
| 804 |
return (ST_Agnode_s) ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).next; |
| 805 |
} |
| 806 |
|
| 807 |
public static void ND_next(__ptr__ n, __ptr__ v) { |
| 808 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("next", v); |
| 809 |
} |
| 810 |
|
| 811 |
|
| 812 |
public static int ND_node_type(ST_Agnode_s n) { |
| 813 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).node_type; |
| 814 |
} |
| 815 |
|
| 816 |
public static void ND_node_type(ST_Agnode_s n, int v) { |
| 817 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("node_type", v); |
| 818 |
} |
| 819 |
|
| 820 |
|
| 821 |
public static boolean ND_onstack(ST_Agnode_s n) { |
| 822 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack!=0; |
| 823 |
} |
| 824 |
|
| 825 |
public static void ND_onstack(ST_Agnode_s n, int v) { |
| 826 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("onstack", v); |
| 827 |
} |
| 828 |
|
| 829 |
public static void ND_onstack(ST_Agnode_s n, boolean v) { |
| 830 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).onstack = v?1:0; |
| 831 |
} |
| 832 |
|
| 833 |
|
| 834 |
public static int ND_order(__ptr__ n) { |
| 835 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).order; |
| 836 |
} |
| 837 |
|
| 838 |
public static void ND_order(__ptr__ n, int v) { |
| 839 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("order", v); |
| 840 |
} |
| 841 |
|
| 842 |
|
| 843 |
public static ST_elist ND_other(ST_Agnode_s n) { |
| 844 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).other; |
| 845 |
} |
| 846 |
|
| 847 |
|
| 848 |
public static ST_elist ND_out(__ptr__ n) { |
| 849 |
return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).out; |
| 850 |
} |
| 851 |
|
| 852 |
public static void ND_out(__ptr__ n, __struct__<ST_elist> v) { |
| 853 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("out", v); |
| 854 |
} |
| 855 |
|
| 856 |
|
| 857 |
public static __ptr__ ND_outleaf(ST_Agnode_s n) { |
| 858 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).outleaf; |
| 859 |
} |
| 860 |
|
| 861 |
|
| 862 |
public static ST_Agedge_s ND_par(ST_Agnode_s n) { |
| 863 |
return (ST_Agedge_s) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).par; |
| 864 |
} |
| 865 |
|
| 866 |
public static void ND_par(ST_Agnode_s n, __ptr__ v) { |
| 867 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("par", v); |
| 868 |
} |
| 869 |
|
| 870 |
|
| 871 |
|
| 872 |
|
| 873 |
public static __ptr__ ND_prev(ST_Agnode_s n) { |
| 874 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).prev; |
| 875 |
} |
| 876 |
|
| 877 |
public static void ND_prev(ST_Agnode_s n, __ptr__ v) { |
| 878 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("prev", v); |
| 879 |
} |
| 880 |
|
| 881 |
|
| 882 |
public static int ND_priority(ST_Agnode_s n) { |
| 883 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).priority; |
| 884 |
} |
| 885 |
|
| 886 |
public static void ND_priority(ST_Agnode_s n, int v) { |
| 887 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("priority", v); |
| 888 |
} |
| 889 |
|
| 890 |
|
| 891 |
public static int ND_rank(__ptr__ n) { |
| 892 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rank; |
| 893 |
} |
| 894 |
|
| 895 |
public static void ND_rank(__ptr__ n, int v) { |
| 896 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("rank", v); |
| 897 |
} |
| 898 |
|
| 899 |
|
| 900 |
public static int ND_ranktype(ST_Agnode_s n) { |
| 901 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).ranktype; |
| 902 |
} |
| 903 |
|
| 904 |
public static void ND_ranktype(ST_Agnode_s n, int v) { |
| 905 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("ranktype", v); |
| 906 |
} |
| 907 |
|
| 908 |
|
| 909 |
public static double ND_rw(__ptr__ n) { |
| 910 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).rw; |
| 911 |
} |
| 912 |
|
| 913 |
public static void ND_rw(ST_Agnode_s n, double v) { |
| 914 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("rw", v); |
| 915 |
} |
| 916 |
|
| 917 |
|
| 918 |
public static ST_elist ND_save_in(ST_Agnode_s n) { |
| 919 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_in; |
| 920 |
} |
| 921 |
|
| 922 |
public static void ND_save_in(ST_Agnode_s n, __struct__<ST_elist> v) { |
| 923 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_in", v); |
| 924 |
} |
| 925 |
|
| 926 |
|
| 927 |
public static ST_elist ND_save_out(ST_Agnode_s n) { |
| 928 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).save_out; |
| 929 |
} |
| 930 |
|
| 931 |
public static void ND_save_out(ST_Agnode_s n, __struct__<ST_elist> v) { |
| 932 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setStruct("save_out", v); |
| 933 |
} |
| 934 |
|
| 935 |
|
| 936 |
public static ST_shape_desc ND_shape(ST_Agnode_s n) { |
| 937 |
return ((ST_Agnodeinfo_t) AGDATA(n).castTo(ST_Agnodeinfo_t.class)).shape; |
| 938 |
} |
| 939 |
|
| 940 |
public static void ND_shape(ST_Agnode_s n, __ptr__ v) { |
| 941 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setPtr("shape", v); |
| 942 |
} |
| 943 |
|
| 944 |
|
| 945 |
public static __ptr__ ND_shape_info(__ptr__ n) { |
| 946 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).shape_info; |
| 947 |
} |
| 948 |
|
| 949 |
|
| 950 |
public static int ND_showboxes(ST_Agnode_s n) { |
| 951 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).showboxes; |
| 952 |
} |
| 953 |
|
| 954 |
public static void ND_showboxes(ST_Agnode_s n, int v) { |
| 955 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("showboxes", v); |
| 956 |
} |
| 957 |
|
| 958 |
|
| 959 |
|
| 960 |
|
| 961 |
public static ST_elist ND_tree_in(ST_Agnode_s n) { |
| 962 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_in; |
| 963 |
} |
| 964 |
|
| 965 |
|
| 966 |
public static ST_elist ND_tree_out(ST_Agnode_s n) { |
| 967 |
return (ST_elist) ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).tree_out; |
| 968 |
} |
| 969 |
|
| 970 |
|
| 971 |
public static int ND_weight_class(ST_Agnode_s n) { |
| 972 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).weight_class; |
| 973 |
} |
| 974 |
|
| 975 |
public static void ND_weight_class(ST_Agnode_s n, int v) { |
| 976 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setInt("weight_class", v); |
| 977 |
} |
| 978 |
|
| 979 |
|
| 980 |
public static double ND_width(__ptr__ n) { |
| 981 |
return ((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).width; |
| 982 |
} |
| 983 |
|
| 984 |
public static void ND_width(ST_Agnode_s n, double v) { |
| 985 |
((ST_Agnodeinfo_t)AGDATA(n).castTo(ST_Agnodeinfo_t.class)).setDouble("width", v); |
| 986 |
} |
| 987 |
|
| 988 |
|
| 989 |
|
| 990 |
|
| 991 |
|
| 992 |
|
| 993 |
public static boolean ED_conc_opp_flag(ST_Agedge_s e) { |
| 994 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).conc_opp_flag; |
| 995 |
} |
| 996 |
|
| 997 |
public static void ED_conc_opp_flag(ST_Agedge_s e, boolean v) { |
| 998 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("conc_opp_flag", v ? 1 : 0); |
| 999 |
} |
| 1000 |
|
| 1001 |
|
| 1002 |
public static int ED_count(__ptr__ e) { |
| 1003 |
return ((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).count; |
| 1004 |
} |
| 1005 |
|
| 1006 |
public static void ED_count(__ptr__ e, int v) { |
| 1007 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("count", v); |
| 1008 |
} |
| 1009 |
|
| 1010 |
|
| 1011 |
public static int ED_cutvalue(ST_Agedge_s e) { |
| 1012 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).cutvalue; |
| 1013 |
} |
| 1014 |
|
| 1015 |
public static void ED_cutvalue(ST_Agedge_s e, int v) { |
| 1016 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("cutvalue", v); |
| 1017 |
} |
| 1018 |
|
| 1019 |
|
| 1020 |
|
| 1021 |
public static int ED_adjacent(__ptr__ e) { |
| 1022 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).adjacent; |
| 1023 |
} |
| 1024 |
|
| 1025 |
public static void ED_adjacent(ST_Agedge_s e, int v) { |
| 1026 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("adjacent", v); |
| 1027 |
} |
| 1028 |
|
| 1029 |
|
| 1030 |
|
| 1031 |
|
| 1032 |
public static ST_textlabel_t ED_head_label(ST_Agedge_s e) { |
| 1033 |
return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_label; |
| 1034 |
} |
| 1035 |
|
| 1036 |
public static void ED_head_label(ST_Agedge_s e, __ptr__ v) { |
| 1037 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("head_label", v); |
| 1038 |
} |
| 1039 |
|
| 1040 |
|
| 1041 |
public static ST_port ED_head_port(__ptr__ e) { |
| 1042 |
return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).head_port; |
| 1043 |
} |
| 1044 |
|
| 1045 |
public static void ED_head_port(ST_Agedge_s e, ST_port v) { |
| 1046 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("head_port", v); |
| 1047 |
} |
| 1048 |
|
| 1049 |
|
| 1050 |
public static ST_textlabel_t ED_label(__ptr__ e) { |
| 1051 |
return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label; |
| 1052 |
} |
| 1053 |
|
| 1054 |
public static void ED_label(ST_Agedge_s e, __ptr__ v) { |
| 1055 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("label", v); |
| 1056 |
} |
| 1057 |
|
| 1058 |
|
| 1059 |
public static ST_textlabel_t ED_xlabel(ST_Agedge_s e) { |
| 1060 |
return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xlabel; |
| 1061 |
} |
| 1062 |
|
| 1063 |
|
| 1064 |
public static boolean ED_label_ontop(ST_Agedge_s e) { |
| 1065 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop; |
| 1066 |
} |
| 1067 |
|
| 1068 |
public static void ED_label_ontop(ST_Agedge_s e, boolean v) { |
| 1069 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).label_ontop = v; |
| 1070 |
} |
| 1071 |
|
| 1072 |
|
| 1073 |
public static int ED_minlen(ST_Agedge_s e) { |
| 1074 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).minlen; |
| 1075 |
} |
| 1076 |
|
| 1077 |
public static void ED_minlen(ST_Agedge_s e, int v) { |
| 1078 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("minlen", v); |
| 1079 |
} |
| 1080 |
|
| 1081 |
|
| 1082 |
|
| 1083 |
public static int ED_showboxes(ST_Agedge_s e) { |
| 1084 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).showboxes; |
| 1085 |
} |
| 1086 |
|
| 1087 |
public static void ED_showboxes(ST_Agedge_s e, int v) { |
| 1088 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("showboxes", v); |
| 1089 |
} |
| 1090 |
|
| 1091 |
|
| 1092 |
public static ST_splines ED_spl(ST_Agedge_s e) { |
| 1093 |
return ((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).spl; |
| 1094 |
} |
| 1095 |
|
| 1096 |
public static void ED_spl(ST_Agedge_s e, ST_splines v) { |
| 1097 |
((ST_Agedgeinfo_t) AGDATA(e).castTo(ST_Agedgeinfo_t.class)).spl = v; |
| 1098 |
} |
| 1099 |
|
| 1100 |
|
| 1101 |
public static ST_textlabel_t ED_tail_label(ST_Agedge_s e) { |
| 1102 |
return (ST_textlabel_t) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_label; |
| 1103 |
} |
| 1104 |
|
| 1105 |
public static void ED_tail_label(ST_Agedge_s e, __ptr__ v) { |
| 1106 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("tail_label", v); |
| 1107 |
} |
| 1108 |
|
| 1109 |
|
| 1110 |
public static ST_port ED_tail_port(__ptr__ e) { |
| 1111 |
return (ST_port) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tail_port; |
| 1112 |
} |
| 1113 |
|
| 1114 |
public static void ED_tail_port(ST_Agedge_s e, ST_port v) { |
| 1115 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setStruct("tail_port", v); |
| 1116 |
} |
| 1117 |
|
| 1118 |
|
| 1119 |
public static ST_Agedge_s ED_to_orig(__ptr__ e) { |
| 1120 |
return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_orig; |
| 1121 |
} |
| 1122 |
|
| 1123 |
public static void ED_to_orig(ST_Agedge_s e, __ptr__ v) { |
| 1124 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_orig", v); |
| 1125 |
} |
| 1126 |
|
| 1127 |
|
| 1128 |
public static ST_Agedge_s ED_to_virt(ST_Agedge_s e) { |
| 1129 |
return (ST_Agedge_s) ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).to_virt; |
| 1130 |
} |
| 1131 |
|
| 1132 |
public static void ED_to_virt(ST_Agedge_s e, __ptr__ v) { |
| 1133 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setPtr("to_virt", v); |
| 1134 |
} |
| 1135 |
|
| 1136 |
|
| 1137 |
public static int ED_tree_index(__ptr__ e) { |
| 1138 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).tree_index; |
| 1139 |
} |
| 1140 |
|
| 1141 |
public static void ED_tree_index(__ptr__ e, int v) { |
| 1142 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("tree_index", v); |
| 1143 |
} |
| 1144 |
|
| 1145 |
|
| 1146 |
public static int ED_xpenalty(__ptr__ e) { |
| 1147 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).xpenalty; |
| 1148 |
} |
| 1149 |
|
| 1150 |
public static void ED_xpenalty(ST_Agedge_s e, int v) { |
| 1151 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("xpenalty", v); |
| 1152 |
} |
| 1153 |
|
| 1154 |
|
| 1155 |
public static double ED_dist(ST_Agedge_s e) { |
| 1156 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).dist; |
| 1157 |
} |
| 1158 |
|
| 1159 |
public static void ED_dist(ST_Agedge_s e, double v) { |
| 1160 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setDouble("dist", v); |
| 1161 |
} |
| 1162 |
|
| 1163 |
|
| 1164 |
public static int ED_weight(ST_Agedge_s e) { |
| 1165 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).weight; |
| 1166 |
} |
| 1167 |
|
| 1168 |
public static void ED_weight(ST_Agedge_s e, int v) { |
| 1169 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("weight", v); |
| 1170 |
} |
| 1171 |
|
| 1172 |
|
| 1173 |
|
| 1174 |
|
| 1175 |
|
| 1176 |
|
| 1177 |
|
| 1178 |
public static int ED_edge_type(ST_Agedge_s e) { |
| 1179 |
return ((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).edge_type; |
| 1180 |
} |
| 1181 |
|
| 1182 |
public static void ED_edge_type(ST_Agedge_s e, int v) { |
| 1183 |
((ST_Agedgeinfo_t)AGDATA(e).castTo(ST_Agedgeinfo_t.class)).setInt("edge_type", v); |
| 1184 |
} |
| 1185 |
|
| 1186 |
|
| 1187 |
|
| 1188 |
|
| 1189 |
|
| 1190 |
|
| 1191 |
|
| 1192 |
|
| 1193 |
|
| 1194 |
|
| 1195 |
|
| 1196 |
|
| 1197 |
|
| 1198 |
|
| 1199 |
|
| 1200 |
|
| 1201 |
|
| 1202 |
|
| 1203 |
|
| 1204 |
|
| 1205 |
|
| 1206 |
|
| 1207 |
|
| 1208 |
|
| 1209 |
|
| 1210 |
|
| 1211 |
public static ST_Agedge_s.ArrayOfStar ALLOC_allocated_ST_Agedge_s(ST_Agedge_s.ArrayOfStar old, int size) { |
| 1212 |
return old != null ? old.reallocJ(size) : new ST_Agedge_s.ArrayOfStar(size); |
| 1213 |
} |
| 1214 |
|
| 1215 |
public static ST_Agnode_s.ArrayOfStar ALLOC_allocated_ST_Agnode_s(ST_Agnode_s.ArrayOfStar old, int size) { |
| 1216 |
return old != null ? old.reallocJ(size) : new ST_Agnode_s.ArrayOfStar(size); |
| 1217 |
} |
| 1218 |
|
| 1219 |
public static ST_pointf.Array ALLOC_allocated_ST_pointf(ST_pointf.Array old, int size) { |
| 1220 |
return old != null ? old.reallocJ(size) : new ST_pointf.Array(size); |
| 1221 |
} |
| 1222 |
|
| 1223 |
public static ST_Pedge_t.Array ALLOC_allocated_ST_Pedge_t(ST_Pedge_t.Array old, int size) { |
| 1224 |
return old != null ? old.reallocJ(size) : new ST_Pedge_t.Array(size); |
| 1225 |
} |
| 1226 |
|
| 1227 |
public static __ptr__ ALLOC_INT(int size, __ptr__ ptr) { |
| 1228 |
return (__ptr__) (ptr != null ? JUtils.size_t_array_of_integer(size).realloc(ptr) : JUtils |
| 1229 |
.size_t_array_of_integer(size).malloc()); |
| 1230 |
} |
| 1231 |
|
| 1232 |
|
| 1233 |
public static __ptr__ RALLOC(int nb, __ptr__ ptr, Class type) { |
| 1234 |
throw new UnsupportedOperationException(); |
| 1235 |
} |
| 1236 |
|
| 1237 |
public static ST_Agnode_s.ArrayOfStar ALLOC_Agnode_s(int nb, ST_Agnode_s.ArrayOfStar old) { |
| 1238 |
if (old == null) { |
| 1239 |
return new ST_Agnode_s.ArrayOfStar(nb); |
| 1240 |
} |
| 1241 |
return old.reallocJ(nb); |
| 1242 |
} |
| 1243 |
|
| 1244 |
public static ST_bezier.Array2 ALLOC_ST_bezier(int nb, ST_bezier.Array2 old) { |
| 1245 |
if (old == null) { |
| 1246 |
return new ST_bezier.Array2(nb); |
| 1247 |
} |
| 1248 |
return old.reallocJ(nb); |
| 1249 |
} |
| 1250 |
|
| 1251 |
public static ST_rank_t.Array2 ALLOC_ST_rank_t(int nb, ST_rank_t.Array2 old) { |
| 1252 |
if (old == null) { |
| 1253 |
return new ST_rank_t.Array2(nb); |
| 1254 |
} |
| 1255 |
return old.reallocJ(nb); |
| 1256 |
} |
| 1257 |
|
| 1258 |
|
| 1259 |
|
| 1260 |
public static void elist_append(__ptr__ item, ST_elist L) { |
| 1261 |
|
| 1262 |
L.realloc(L.size + 2); |
| 1263 |
L.setInList(L.size, item); |
| 1264 |
L.size = 1 + L.size; |
| 1265 |
L.setInList(L.size, null); |
| 1266 |
} |
| 1267 |
|
| 1268 |
|
| 1269 |
public static void alloc_elist(int n, ST_elist L) { |
| 1270 |
L.size = 0; |
| 1271 |
L.mallocEmpty(n + 1); |
| 1272 |
|
| 1273 |
} |
| 1274 |
|
| 1275 |
|
| 1276 |
public static void free_list(ST_elist L) { |
| 1277 |
if (L.listNotNull()) |
| 1278 |
L.free(); |
| 1279 |
|
| 1280 |
} |
| 1281 |
|
| 1282 |
public static double ABS(double a) { |
| 1283 |
return Math.abs(a); |
| 1284 |
} |
| 1285 |
|
| 1286 |
public static int ABS(int a) { |
| 1287 |
return Math.abs(a); |
| 1288 |
} |
| 1289 |
|
| 1290 |
public static double MAX(double a, double b) { |
| 1291 |
return Math.max(a, b); |
| 1292 |
} |
| 1293 |
|
| 1294 |
public static int MAX(int a, int b) { |
| 1295 |
return Math.max(a, b); |
| 1296 |
} |
| 1297 |
|
| 1298 |
public static double MIN(double a, double b) { |
| 1299 |
return Math.min(a, b); |
| 1300 |
} |
| 1301 |
|
| 1302 |
public static int MIN(int a, int b) { |
| 1303 |
return Math.min(a, b); |
| 1304 |
} |
| 1305 |
|
| 1306 |
|
| 1307 |
public static boolean BETWEEN(double a, double b, double c) { |
| 1308 |
return (((a) <= (b)) && ((b) <= (c))); |
| 1309 |
} |
| 1310 |
|
| 1311 |
public static boolean BETWEEN(int a, int b, int c) { |
| 1312 |
return (((a) <= (b)) && ((b) <= (c))); |
| 1313 |
} |
| 1314 |
|
| 1315 |
|
| 1316 |
public static int ROUND(double f) { |
| 1317 |
return ((f >= 0) ? (int) (f + .5) : (int) (f - .5)); |
| 1318 |
} |
| 1319 |
|
| 1320 |
|
| 1321 |
|
| 1322 |
|
| 1323 |
|
| 1324 |
|
| 1325 |
|
| 1326 |
|
| 1327 |
|
| 1328 |
|
| 1329 |
|
| 1330 |
|
| 1331 |
|
| 1332 |
|
| 1333 |
|
| 1334 |
|
| 1335 |
public static void MAKEFWDEDGE(ST_Agedge_s new_, ST_Agedge_s old) { |
| 1336 |
ST_Agedge_s newp; |
| 1337 |
ST_Agedgeinfo_t info; |
| 1338 |
newp = (ST_Agedge_s) new_.getPtr(); |
| 1339 |
info = (ST_Agedgeinfo_t) newp.base.data.castTo(ST_Agedgeinfo_t.class); |
| 1340 |
info.copyDataFrom(old.base.data.castTo(ST_Agedgeinfo_t.class).getStruct()); |
| 1341 |
newp.copyDataFrom((__ptr__)old); |
| 1342 |
newp.base.setPtr("data", info); |
| 1343 |
agtail(newp, AGHEAD(old)); |
| 1344 |
aghead(newp, AGTAIL(old)); |
| 1345 |
ED_tail_port(newp, ED_head_port(old)); |
| 1346 |
ED_head_port(newp, ED_tail_port(old)); |
| 1347 |
ED_edge_type(newp, VIRTUAL); |
| 1348 |
ED_to_orig(newp, old); |
| 1349 |
} |
| 1350 |
|
| 1351 |
|
| 1352 |
public static final int VIRTUAL = 1; |
| 1353 |
|
| 1354 |
|
| 1355 |
|
| 1356 |
|
| 1357 |
public static ST_textspan_t.Array ZALLOC_ST_textspan_t(ST_textspan_t.Array old, int size) { |
| 1358 |
return old != null ? old.reallocJ(size) : new ST_textspan_t.Array(size); |
| 1359 |
} |
| 1360 |
|
| 1361 |
public static ST_Agraph_s.Array ZALLOC_ST_Agraph_s(ST_Agraph_s.Array old, int size) { |
| 1362 |
return old != null ? old.reallocJ(size) : new ST_Agraph_s.Array(size); |
| 1363 |
} |
| 1364 |
|
| 1365 |
public static final int MAXSHORT = 0x7fff; |
| 1366 |
|
| 1367 |
public static final int INT_MAX = Integer.MAX_VALUE; |
| 1368 |
|
| 1369 |
public static final int INT_MIN = Integer.MIN_VALUE; |
| 1370 |
static { |
| 1371 |
if (INT_MIN != -INT_MAX - 1) { |
| 1372 |
throw new IllegalStateException(); |
| 1373 |
} |
| 1374 |
} |
| 1375 |
|
| 1376 |
public static final double HUGE_VAL = Double.POSITIVE_INFINITY; |
| 1377 |
|
| 1378 |
public static double fabs(double x) { |
| 1379 |
return Math.abs(x); |
| 1380 |
} |
| 1381 |
|
| 1382 |
public static double hypot(double x, double y) { |
| 1383 |
double t; |
| 1384 |
x = Math.abs(x); |
| 1385 |
y = Math.abs(y); |
| 1386 |
t = Math.min(x, y); |
| 1387 |
x = Math.max(x, y); |
| 1388 |
t = t / x; |
| 1389 |
return x * Math.sqrt(1 + t * t); |
| 1390 |
} |
| 1391 |
|
| 1392 |
|
| 1393 |
public static double SQR(double a) { |
| 1394 |
return a * a; |
| 1395 |
} |
| 1396 |
|
| 1397 |
|
| 1398 |
|
| 1399 |
public static double MILLIPOINT = .001; |
| 1400 |
public static double MICROPOINT = .000001; |
| 1401 |
|
| 1402 |
|
| 1403 |
public static boolean APPROXEQPT(ST_pointf p, ST_pointf q, double tol) { |
| 1404 |
return (DIST2((p), (q)) < SQR(tol)); |
| 1405 |
} |
| 1406 |
|
| 1407 |
|
| 1408 |
public static double LEN2(double a, double b) { |
| 1409 |
return (SQR(a) + SQR(b)); |
| 1410 |
} |
| 1411 |
|
| 1412 |
|
| 1413 |
public static double LEN(double a, double b) { |
| 1414 |
return (Math.sqrt(LEN2((a), (b)))); |
| 1415 |
} |
| 1416 |
|
| 1417 |
|
| 1418 |
|
| 1419 |
public static double DIST2(ST_pointf p, ST_pointf q) { |
| 1420 |
return (LEN2(((p).x - (q).x), ((p).y - (q).y))); |
| 1421 |
} |
| 1422 |
|
| 1423 |
|
| 1424 |
|
| 1425 |
|
| 1426 |
public static boolean INSIDE(ST_pointf p, ST_boxf b) { |
| 1427 |
return (BETWEEN(b.LL.x, p.x, b.UR.x) && BETWEEN(b.LL.y, p.y, b.UR.y)); |
| 1428 |
} |
| 1429 |
|
| 1430 |
public static final double M_PI = Math.PI; |
| 1431 |
|
| 1432 |
public static final double SQRT2 = Math.sqrt(2); |
| 1433 |
|
| 1434 |
|
| 1435 |
public static double RADIANS(double deg) { |
| 1436 |
return ((deg) / 180.0 * M_PI); |
| 1437 |
} |
| 1438 |
|
| 1439 |
|
| 1440 |
|
| 1441 |
|
| 1442 |
|
| 1443 |
public static double DISTSQ(ST_pointf a, ST_pointf b) { |
| 1444 |
return (((a).x - (b).x) * ((a).x - (b).x)) |
| 1445 |
+ (((a).y - (b).y) * ((a).y - (b).y)); |
| 1446 |
} |
| 1447 |
|
| 1448 |
public static void hackInitDimensionFromLabel(ST_pointf size, String label) { |
| 1449 |
if (label.matches("_dim_\\d+_\\d+_")) { |
| 1450 |
Pattern p = Pattern.compile("_dim_(\\d+)_(\\d+)_"); |
| 1451 |
Matcher m = p.matcher(label); |
| 1452 |
if (m.matches() == false) { |
| 1453 |
throw new IllegalStateException(); |
| 1454 |
} |
| 1455 |
int ww = Integer.parseInt(m.group(1)); |
| 1456 |
int hh = Integer.parseInt(m.group(2)); |
| 1457 |
size.setDouble("x", ww); |
| 1458 |
size.setDouble("y", hh); |
| 1459 |
JUtils.LOG2("Hacking dimension to width=" + ww + " height=" + hh); |
| 1460 |
} |
| 1461 |
} |
| 1462 |
|
| 1463 |
public static CString createHackInitDimensionFromLabel(int width, int height) { |
| 1464 |
return new CString("_dim_" + width + "_" + height + "_"); |
| 1465 |
} |
| 1466 |
} |