1 /* $Id$ $Revision$ */ 2 /* vim:set shiftwidth=4 ts=8: */ 3 4 /************************************************************************* 5 * Copyright (c) 2011 AT&T Intellectual Property 6 * All rights reserved. This program and the accompanying materials 7 * are made available under the terms of the Eclipse Public License v1.0 8 * which accompanies this distribution, and is available at 9 * http://www.eclipse.org/legal/epl-v10.html 10 * 11 * Contributors: See CVS logs. Details at http://www.graphviz.org/ 12 *************************************************************************/ 13 14 #ifndef GV_TYPES_H 15 #define GV_TYPES_H 16 17 /* Define if you want CGRAPH */ 18 #define WITH_CGRAPH 1 19 20 #include <stdio.h> 21 #include <assert.h> 22 #include <signal.h> 23 24 typedef unsigned char boolean; 25 #ifndef NOT 26 #define NOT(v) (!(v)) 27 #endif 28 #ifndef FALSE 29 #define FALSE 0 30 #endif 31 #ifndef TRUE 32 #define TRUE NOT(FALSE) 33 #endif 34 35 #include "geom.h" 36 #include "gvcext.h" 37 #include "pathgeom.h" 38 #include "textspan.h" 39 #include "cgraph.h" 40 41 #ifdef __cplusplus 42 extern "C" { 43 #endif 44 45 typedef int (*qsort_cmpf) (const void *, const void *); 46 typedef int (*bsearch_cmpf) (const void *, const void *); 47 typedef struct Agraph_s graph_t; 48 typedef struct Agnode_s node_t; 49 typedef struct Agedge_s edge_t; 50 typedef struct Agsym_s attrsym_t; 51 #define TAIL_ID "tailport" 52 #define HEAD_ID "headport" 53 54 typedef struct htmllabel_t htmllabel_t; 55 56 typedef union inside_t { 57 struct { 58 pointf* p; 59 double* r; 60 } a; 61 struct { 62 node_t* n; 63 boxf* bp; 64 } s; 65 } inside_t; 66 67 typedef struct port { /* internal edge endpoint specification */ 68 pointf p; /* aiming point relative to node center */ 69 double theta; /* slope in radians */ 70 boxf *bp; /* if not null, points to bbox of 71 * rectangular area that is port target 72 */ 73 boolean defined; /* if true, edge has port info at this end */ 74 boolean constrained; /* if true, constraints such as theta are set */ 75 boolean clip; /* if true, clip end to node/port shape */ 76 boolean dyna; /* if true, assign compass point dynamically */ 77 unsigned char order; /* for mincross */ 78 unsigned char side; /* if port is on perimeter of node, this 79 * contains the bitwise OR of the sides (TOP, 80 * BOTTOM, etc.) it is on. 81 */ 82 char *name; /* port name, if it was explicitly given, otherwise NULL */ 83 } port; 84 85 typedef struct { 86 boolean(*swapEnds) (edge_t * e); /* Should head and tail be swapped? */ 87 boolean(*splineMerge) (node_t * n); /* Is n a node in the middle of an edge? */ 88 boolean ignoreSwap; /* Test for swapped edges if false */ 89 boolean isOrtho; /* Orthogonal routing used */ 90 } splineInfo; 91 92 typedef struct pathend_t { 93 boxf nb; /* the node box */ 94 pointf np; /* node port */ 95 int sidemask; 96 int boxn; 97 boxf boxes[20]; 98 } pathend_t; 99 100 typedef struct path { /* internal specification for an edge spline */ 101 port start; 102 port end; 103 int nbox; /* number of subdivisions */ 104 boxf *boxes; /* rectangular regions of subdivision */ 105 void *data; 106 } path; 107 108 typedef struct bezier { 109 pointf *list; 110 int size; 111 int sflag; 112 int eflag; 113 pointf sp; 114 pointf ep; 115 } bezier; 116 117 typedef struct splines { 118 bezier *list; 119 int size; 120 boxf bb; 121 } splines; 122 123 typedef struct textlabel_t { 124 char *text; 125 char *fontname; 126 char *fontcolor; 127 int charset; 128 double fontsize; 129 pointf dimen; /* the diagonal size of the label (estimated by layout) */ 130 pointf space; /* the diagonal size of the space for the label */ 131 /* the rendered label is aligned in this box */ 132 /* space does not include pad or margin */ 133 pointf pos; /* the center of the space for the label */ 134 union { 135 struct { 136 textspan_t *span; 137 short nspans; 138 } txt; 139 htmllabel_t *html; 140 } u; 141 char valign; /* 't' 'c' 'b' */ 142 boolean set; /* true if position is set */ 143 boolean html; /* true if html label */ 144 } textlabel_t; 145 146 typedef struct polygon_t { /* mutable shape information for a node */ 147 int regular; /* true for symmetric shapes */ 148 int peripheries; /* number of periphery lines */ 149 int sides; /* number of sides */ 150 double orientation; /* orientation of shape (+ve degrees) */ 151 double distortion; /* distortion factor - as in trapezium */ 152 double skew; /* skew factor - as in parallelogram */ 153 int option; /* ROUNDED, DIAGONAL corners, etc. */ 154 pointf *vertices; /* array of vertex points */ 155 } polygon_t; 156 157 typedef struct stroke_t { /* information about a single stroke */ 158 /* we would have called it a path if that term wasn't already used */ 159 int nvertices; /* number of points in the stroke */ 160 int flags; /* stroke style flags */ 161 pointf *vertices; /* array of vertex points */ 162 } stroke_t; 163 164 /* flag definitions for stroke_t */ 165 #define STROKE_CLOSED (1 << 0) 166 #define STROKE_FILLED (1 << 1) 167 #define STROKE_PENDOWN (1 << 2) 168 #define STROKE_VERTICES_ALLOCATED (1 << 3) 169 170 typedef struct shape_t { /* mutable shape information for a node */ 171 int nstrokes; /* number of strokes in array */ 172 stroke_t *strokes; /* array of strokes */ 173 /* The last stroke must always be closed, but can be pen_up. 174 * It is used as the clipping path */ 175 } shape_t; 176 177 typedef struct shape_functions { /* read-only shape functions */ 178 void (*initfn) (node_t *); /* initializes shape from node u.shape_info structure */ 179 void (*freefn) (node_t *); /* frees shape from node u.shape_info structure */ 180 port(*portfn) (node_t *, char *, char *); /* finds aiming point and slope of port */ 181 boolean(*insidefn) (inside_t * inside_context, pointf); /* clips incident gvc->e spline on shape of gvc->n */ 182 int (*pboxfn)(node_t* n, port* p, int side, boxf rv[], int *kptr); /* finds box path to reach port */ 183 void (*codefn) (GVJ_t * job, node_t * n); /* emits graphics code for node */ 184 } shape_functions; 185 186 typedef enum { SH_UNSET, SH_POLY, SH_RECORD, SH_POINT, SH_EPSF} shape_kind; 187 188 typedef struct shape_desc { /* read-only shape descriptor */ 189 char *name; /* as read from graph file */ 190 shape_functions *fns; 191 polygon_t *polygon; /* base polygon info */ 192 boolean usershape; 193 } shape_desc; 194 195 #include "usershape.h" /* usershapes needed by gvc */ 196 197 typedef struct nodequeue { 198 node_t **store; 199 node_t **limit; 200 node_t **head; 201 node_t **tail; 202 } nodequeue; 203 204 typedef struct adjmatrix_t { 205 int nrows; 206 int ncols; 207 char *data; 208 } adjmatrix_t; 209 210 typedef struct rank_t { 211 int n; /* number of nodes in this rank */ 212 node_t **v; /* ordered list of nodes in rank */ 213 int an; /* globally allocated number of nodes */ 214 node_t **av; /* allocated list of nodes in rank */ 215 double ht1; /* height below/above centerline */ 216 double ht2; /* height below/above centerline */ 217 double pht1; /* as above, but only primitive nodes */ 218 double pht2; /* as above, but only primitive nodes */ 219 boolean candidate; /* for transpose () */ 220 boolean valid; 221 int cache_nc; /* caches number of crossings */ 222 adjmatrix_t *flat; 223 } rank_t; 224 225 typedef enum { R_NONE = 226 0, R_VALUE, R_FILL, R_COMPRESS, R_AUTO, R_EXPAND } ratio_t; 227 228 typedef struct layout_t { 229 double quantum; 230 double scale; 231 double ratio; /* set only if ratio_kind == R_VALUE */ 232 double dpi; 233 pointf margin; 234 pointf page; 235 pointf size; 236 boolean filled; 237 boolean landscape; 238 boolean centered; 239 ratio_t ratio_kind; 240 void* xdots; 241 char* id; 242 } layout_t; 243 244 /* for "record" shapes */ 245 typedef struct field_t { 246 pointf size; /* its dimension */ 247 boxf b; /* its placement in node's coordinates */ 248 int n_flds; 249 textlabel_t *lp; /* n_flds == 0 */ 250 struct field_t **fld; /* n_flds > 0 */ 251 char *id; /* user's identifier */ 252 unsigned char LR; /* if box list is horizontal (left to right) */ 253 unsigned char sides; /* sides of node exposed to field */ 254 } field_t; 255 256 typedef struct nlist_t { 257 node_t **list; 258 int size; 259 } nlist_t; 260 261 typedef struct elist { 262 edge_t **list; 263 int size; 264 } elist; 265 266 #define GUI_STATE_ACTIVE (1<<0) 267 #define GUI_STATE_SELECTED (1<<1) 268 #define GUI_STATE_VISITED (1<<2) 269 #define GUI_STATE_DELETED (1<<3) 270 271 #define elist_fastapp(item,L) do {L.list[L.size++] = item; L.list[L.size] = NULL;} while(0) 272 #define elist_append(item,L) do {L.list = ALLOC(L.size + 2,L.list,edge_t*); L.list[L.size++] = item; L.list[L.size] = NULL;} while(0) 273 #define alloc_elist(n,L) do {L.size = 0; L.list = N_NEW(n + 1,edge_t*); } while (0) 274 #define free_list(L) do {if (L.list) free(L.list);} while (0) 275 276 typedef enum {NATIVEFONTS,PSFONTS,SVGFONTS} fontname_kind; 277 278 typedef struct Agraphinfo_t { 279 Agrec_t hdr; 280 /* to generate code */ 281 layout_t *drawing; 282 textlabel_t *label; /* if the cluster has a title */ 283 boxf bb; /* bounding box */ 284 pointf border[4]; /* sizes of margins for graph labels */ 285 unsigned char gui_state; /* Graph state for GUI ops */ 286 unsigned char has_labels; 287 boolean has_images; 288 unsigned char charset; /* input character set */ 289 int rankdir; 290 double ht1; /* below and above extremal ranks */ 291 double ht2; /* below and above extremal ranks */ 292 unsigned short flags; 293 void *alg; 294 GVC_t *gvc; /* context for "globals" over multiple graphs */ 295 void (*cleanup) (graph_t * g); /* function to deallocate layout-specific data */ 296 297 #ifndef DOT_ONLY 298 /* to place nodes */ 299 node_t **neato_nlist; 300 int move; 301 double **dist; 302 double **spring; 303 double **sum_t; 304 double ***t; 305 unsigned short ndim; 306 unsigned short odim; 307 #endif 308 #ifndef NEATO_ONLY 309 /* to have subgraphs */ 310 int n_cluster; 311 graph_t **clust; /* clusters are in clust[1..n_cluster] !!! */ 312 graph_t *dotroot; 313 node_t *nlist; 314 rank_t *rank; 315 graph_t *parent; /* containing cluster (not parent subgraph) */ 316 int level; /* cluster nesting level (not node level!) */ 317 node_t *minrep; /* set leaders for min and max rank */ 318 node_t *maxrep; /* set leaders for min and max rank */ 319 320 /* fast graph node list */ 321 nlist_t comp; 322 /* connected components */ 323 node_t *minset; /* set leaders */ 324 node_t *maxset; /* set leaders */ 325 long n_nodes; 326 /* includes virtual */ 327 int minrank; 328 int maxrank; 329 330 /* various flags */ 331 boolean has_flat_edges; 332 boolean has_sourcerank; 333 boolean has_sinkrank; 334 unsigned char showboxes; 335 fontname_kind fontnames; /* to override mangling in SVG */ 336 337 int nodesep; 338 int ranksep; 339 node_t *ln; /* left nodes of bounding box */ 340 node_t *rn; /* right nodes of bounding box */ 341 342 /* for clusters */ 343 node_t *leader; 344 node_t **rankleader; 345 boolean expanded; 346 char installed; 347 char set_type; 348 char label_pos; 349 boolean exact_ranksep; 350 #endif 351 352 } Agraphinfo_t; 353 354 #define GD_parent(g) (((Agraphinfo_t*)AGDATA(g))->parent) 355 #define GD_level(g) (((Agraphinfo_t*)AGDATA(g))->level) 356 #define GD_drawing(g) (((Agraphinfo_t*)AGDATA(g))->drawing) 357 #define GD_bb(g) (((Agraphinfo_t*)AGDATA(g))->bb) 358 #define GD_gvc(g) (((Agraphinfo_t*)AGDATA(g))->gvc) 359 #define GD_cleanup(g) (((Agraphinfo_t*)AGDATA(g))->cleanup) 360 #define GD_dist(g) (((Agraphinfo_t*)AGDATA(g))->dist) 361 #define GD_alg(g) (((Agraphinfo_t*)AGDATA(g))->alg) 362 #define GD_border(g) (((Agraphinfo_t*)AGDATA(g))->border) 363 #define GD_cl_cnt(g) (((Agraphinfo_t*)AGDATA(g))->cl_nt) 364 #define GD_clust(g) (((Agraphinfo_t*)AGDATA(g))->clust) 365 #define GD_dotroot(g) (((Agraphinfo_t*)AGDATA(g))->dotroot) 366 #define GD_comp(g) (((Agraphinfo_t*)AGDATA(g))->comp) 367 #define GD_exact_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->exact_ranksep) 368 #define GD_expanded(g) (((Agraphinfo_t*)AGDATA(g))->expanded) 369 #define GD_flags(g) (((Agraphinfo_t*)AGDATA(g))->flags) 370 #define GD_gui_state(g) (((Agraphinfo_t*)AGDATA(g))->gui_state) 371 #define GD_charset(g) (((Agraphinfo_t*)AGDATA(g))->charset) 372 #define GD_has_labels(g) (((Agraphinfo_t*)AGDATA(g))->has_labels) 373 #define GD_has_images(g) (((Agraphinfo_t*)AGDATA(g))->has_images) 374 #define GD_has_flat_edges(g) (((Agraphinfo_t*)AGDATA(g))->has_flat_edges) 375 #define GD_has_sourcerank(g) (((Agraphinfo_t*)AGDATA(g))->has_sourcerank) 376 #define GD_has_sinkrank(g) (((Agraphinfo_t*)AGDATA(g))->has_sinkrank) 377 #define GD_ht1(g) (((Agraphinfo_t*)AGDATA(g))->ht1) 378 #define GD_ht2(g) (((Agraphinfo_t*)AGDATA(g))->ht2) 379 #define GD_inleaf(g) (((Agraphinfo_t*)AGDATA(g))->inleaf) 380 #define GD_installed(g) (((Agraphinfo_t*)AGDATA(g))->installed) 381 #define GD_label(g) (((Agraphinfo_t*)AGDATA(g))->label) 382 #define GD_leader(g) (((Agraphinfo_t*)AGDATA(g))->leader) 383 #define GD_rankdir2(g) (((Agraphinfo_t*)AGDATA(g))->rankdir) 384 #define GD_rankdir(g) (((Agraphinfo_t*)AGDATA(g))->rankdir & 0x3) 385 #define GD_flip(g) (GD_rankdir(g) & 1) 386 #define GD_realrankdir(g) ((((Agraphinfo_t*)AGDATA(g))->rankdir) >> 2) 387 #define GD_realflip(g) (GD_realrankdir(g) & 1) 388 #define GD_ln(g) (((Agraphinfo_t*)AGDATA(g))->ln) 389 #define GD_maxrank(g) (((Agraphinfo_t*)AGDATA(g))->maxrank) 390 #define GD_maxset(g) (((Agraphinfo_t*)AGDATA(g))->maxset) 391 #define GD_minrank(g) (((Agraphinfo_t*)AGDATA(g))->minrank) 392 #define GD_minset(g) (((Agraphinfo_t*)AGDATA(g))->minset) 393 #define GD_minrep(g) (((Agraphinfo_t*)AGDATA(g))->minrep) 394 #define GD_maxrep(g) (((Agraphinfo_t*)AGDATA(g))->maxrep) 395 #define GD_move(g) (((Agraphinfo_t*)AGDATA(g))->move) 396 #define GD_n_cluster(g) (((Agraphinfo_t*)AGDATA(g))->n_cluster) 397 #define GD_n_nodes(g) (((Agraphinfo_t*)AGDATA(g))->n_nodes) 398 #define GD_ndim(g) (((Agraphinfo_t*)AGDATA(g))->ndim) 399 #define GD_odim(g) (((Agraphinfo_t*)AGDATA(g))->odim) 400 #define GD_neato_nlist(g) (((Agraphinfo_t*)AGDATA(g))->neato_nlist) 401 #define GD_nlist(g) (((Agraphinfo_t*)AGDATA(g))->nlist) 402 #define GD_nodesep(g) (((Agraphinfo_t*)AGDATA(g))->nodesep) 403 #define GD_outleaf(g) (((Agraphinfo_t*)AGDATA(g))->outleaf) 404 #define GD_rank(g) (((Agraphinfo_t*)AGDATA(g))->rank) 405 #define GD_rankleader(g) (((Agraphinfo_t*)AGDATA(g))->rankleader) 406 #define GD_ranksep(g) (((Agraphinfo_t*)AGDATA(g))->ranksep) 407 #define GD_rn(g) (((Agraphinfo_t*)AGDATA(g))->rn) 408 #define GD_set_type(g) (((Agraphinfo_t*)AGDATA(g))->set_type) 409 #define GD_label_pos(g) (((Agraphinfo_t*)AGDATA(g))->label_pos) 410 #define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes) 411 #define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames) 412 #define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring) 413 #define GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t) 414 #define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t) 415 416 typedef struct Agnodeinfo_t { 417 Agrec_t hdr; 418 shape_desc *shape; 419 void *shape_info; 420 pointf coord; 421 double width; /* inches */ 422 double height; /* inches */ 423 boxf bb; 424 double ht; 425 double lw; 426 double rw; 427 textlabel_t *label; 428 textlabel_t *xlabel; 429 void *alg; 430 char state; 431 unsigned char gui_state; /* Node state for GUI ops */ 432 boolean clustnode; 433 434 #ifndef DOT_ONLY 435 unsigned char pinned; 436 int id; 437 int heapindex; 438 int hops; 439 double *pos; 440 double dist; 441 #endif 442 #ifndef NEATO_ONLY 443 unsigned char showboxes; 444 boolean has_port; 445 node_t* rep; 446 node_t *set; 447 448 /* fast graph */ 449 char node_type; 450 char mark; 451 char onstack; 452 char ranktype; 453 char weight_class; 454 node_t *next; 455 node_t *prev; 456 elist in; 457 elist out; 458 elist flat_out; 459 elist flat_in; 460 elist other; 461 graph_t *clust; 462 463 /* for union-find and collapsing nodes */ 464 int UF_size; 465 node_t *UF_parent; 466 node_t *inleaf; 467 node_t *outleaf; 468 469 /* for placing nodes */ 470 int rank; 471 int order; /* initially, order = 1 for ordered edges */ 472 double mval; 473 elist save_in; 474 elist save_out; 475 476 /* for network-simplex */ 477 elist tree_in; 478 elist tree_out; 479 edge_t *par; 480 int low; 481 int lim; 482 int priority; 483 484 double pad[1]; 485 #endif 486 487 } Agnodeinfo_t; 488 489 #define ND_id(n) (((Agnodeinfo_t*)AGDATA(n))->id) 490 #define ND_alg(n) (((Agnodeinfo_t*)AGDATA(n))->alg) 491 #define ND_UF_parent(n) (((Agnodeinfo_t*)AGDATA(n))->UF_parent) 492 #define ND_set(n) (((Agnodeinfo_t*)AGDATA(n))->set) 493 #define ND_UF_size(n) (((Agnodeinfo_t*)AGDATA(n))->UF_size) 494 #define ND_bb(n) (((Agnodeinfo_t*)AGDATA(n))->bb) 495 #define ND_clust(n) (((Agnodeinfo_t*)AGDATA(n))->clust) 496 #define ND_coord(n) (((Agnodeinfo_t*)AGDATA(n))->coord) 497 #define ND_dist(n) (((Agnodeinfo_t*)AGDATA(n))->dist) 498 #define ND_flat_in(n) (((Agnodeinfo_t*)AGDATA(n))->flat_in) 499 #define ND_flat_out(n) (((Agnodeinfo_t*)AGDATA(n))->flat_out) 500 #define ND_gui_state(n) (((Agnodeinfo_t*)AGDATA(n))->gui_state) 501 #define ND_has_port(n) (((Agnodeinfo_t*)AGDATA(n))->has_port) 502 #define ND_rep(n) (((Agnodeinfo_t*)AGDATA(n))->rep) 503 #define ND_heapindex(n) (((Agnodeinfo_t*)AGDATA(n))->heapindex) 504 #define ND_height(n) (((Agnodeinfo_t*)AGDATA(n))->height) 505 #define ND_hops(n) (((Agnodeinfo_t*)AGDATA(n))->hops) 506 #define ND_ht(n) (((Agnodeinfo_t*)AGDATA(n))->ht) 507 #define ND_in(n) (((Agnodeinfo_t*)AGDATA(n))->in) 508 #define ND_inleaf(n) (((Agnodeinfo_t*)AGDATA(n))->inleaf) 509 #define ND_label(n) (((Agnodeinfo_t*)AGDATA(n))->label) 510 #define ND_xlabel(n) (((Agnodeinfo_t*)AGDATA(n))->xlabel) 511 #define ND_lim(n) (((Agnodeinfo_t*)AGDATA(n))->lim) 512 #define ND_low(n) (((Agnodeinfo_t*)AGDATA(n))->low) 513 #define ND_lw(n) (((Agnodeinfo_t*)AGDATA(n))->lw) 514 #define ND_mark(n) (((Agnodeinfo_t*)AGDATA(n))->mark) 515 #define ND_mval(n) (((Agnodeinfo_t*)AGDATA(n))->mval) 516 #define ND_n_cluster(n) (((Agnodeinfo_t*)AGDATA(n))->n_cluster) 517 #define ND_next(n) (((Agnodeinfo_t*)AGDATA(n))->next) 518 #define ND_node_type(n) (((Agnodeinfo_t*)AGDATA(n))->node_type) 519 #define ND_onstack(n) (((Agnodeinfo_t*)AGDATA(n))->onstack) 520 #define ND_order(n) (((Agnodeinfo_t*)AGDATA(n))->order) 521 #define ND_other(n) (((Agnodeinfo_t*)AGDATA(n))->other) 522 #define ND_out(n) (((Agnodeinfo_t*)AGDATA(n))->out) 523 #define ND_outleaf(n) (((Agnodeinfo_t*)AGDATA(n))->outleaf) 524 #define ND_par(n) (((Agnodeinfo_t*)AGDATA(n))->par) 525 #define ND_pinned(n) (((Agnodeinfo_t*)AGDATA(n))->pinned) 526 #define ND_pos(n) (((Agnodeinfo_t*)AGDATA(n))->pos) 527 #define ND_prev(n) (((Agnodeinfo_t*)AGDATA(n))->prev) 528 #define ND_priority(n) (((Agnodeinfo_t*)AGDATA(n))->priority) 529 #define ND_rank(n) (((Agnodeinfo_t*)AGDATA(n))->rank) 530 #define ND_ranktype(n) (((Agnodeinfo_t*)AGDATA(n))->ranktype) 531 #define ND_rw(n) (((Agnodeinfo_t*)AGDATA(n))->rw) 532 #define ND_save_in(n) (((Agnodeinfo_t*)AGDATA(n))->save_in) 533 #define ND_save_out(n) (((Agnodeinfo_t*)AGDATA(n))->save_out) 534 #define ND_shape(n) (((Agnodeinfo_t*)AGDATA(n))->shape) 535 #define ND_shape_info(n) (((Agnodeinfo_t*)AGDATA(n))->shape_info) 536 #define ND_showboxes(n) (((Agnodeinfo_t*)AGDATA(n))->showboxes) 537 #define ND_state(n) (((Agnodeinfo_t*)AGDATA(n))->state) 538 #define ND_clustnode(n) (((Agnodeinfo_t*)AGDATA(n))->clustnode) 539 #define ND_tree_in(n) (((Agnodeinfo_t*)AGDATA(n))->tree_in) 540 #define ND_tree_out(n) (((Agnodeinfo_t*)AGDATA(n))->tree_out) 541 #define ND_weight_class(n) (((Agnodeinfo_t*)AGDATA(n))->weight_class) 542 #define ND_width(n) (((Agnodeinfo_t*)AGDATA(n))->width) 543 #define ND_xsize(n) (ND_lw(n)+ND_rw(n)) 544 #define ND_ysize(n) (ND_ht(n)) 545 546 typedef struct Agedgeinfo_t { 547 Agrec_t hdr; 548 splines *spl; 549 port tail_port; 550 port head_port; 551 textlabel_t *label; 552 textlabel_t *head_label; 553 textlabel_t *tail_label; 554 textlabel_t *xlabel; 555 char edge_type; 556 char compound; 557 char adjacent; /* true for flat edge with adjacent nodes */ 558 char label_ontop; 559 unsigned char gui_state; /* Edge state for GUI ops */ 560 edge_t *to_orig; /* for dot's shapes.c */ 561 void *alg; 562 563 #ifndef DOT_ONLY 564 double factor; 565 double dist; 566 Ppolyline_t path; 567 #endif 568 #ifndef NEATO_ONLY 569 unsigned char showboxes; 570 boolean conc_opp_flag; 571 short xpenalty; 572 int weight; 573 int cutvalue; 574 int tree_index; 575 short count; 576 unsigned short minlen; 577 edge_t *to_virt; 578 #endif 579 } Agedgeinfo_t; 580 581 #define ED_alg(e) (((Agedgeinfo_t*)AGDATA(e))->alg) 582 #define ED_conc_opp_flag(e) (((Agedgeinfo_t*)AGDATA(e))->conc_opp_flag) 583 #define ED_count(e) (((Agedgeinfo_t*)AGDATA(e))->count) 584 #define ED_cutvalue(e) (((Agedgeinfo_t*)AGDATA(e))->cutvalue) 585 #define ED_edge_type(e) (((Agedgeinfo_t*)AGDATA(e))->edge_type) 586 #define ED_compound(e) (((Agedgeinfo_t*)AGDATA(e))->compound) 587 #define ED_adjacent(e) (((Agedgeinfo_t*)AGDATA(e))->adjacent) 588 #define ED_factor(e) (((Agedgeinfo_t*)AGDATA(e))->factor) 589 #define ED_gui_state(e) (((Agedgeinfo_t*)AGDATA(e))->gui_state) 590 #define ED_head_label(e) (((Agedgeinfo_t*)AGDATA(e))->head_label) 591 #define ED_head_port(e) (((Agedgeinfo_t*)AGDATA(e))->head_port) 592 #define ED_label(e) (((Agedgeinfo_t*)AGDATA(e))->label) 593 #define ED_xlabel(e) (((Agedgeinfo_t*)AGDATA(e))->xlabel) 594 #define ED_label_ontop(e) (((Agedgeinfo_t*)AGDATA(e))->label_ontop) 595 #define ED_minlen(e) (((Agedgeinfo_t*)AGDATA(e))->minlen) 596 #define ED_path(e) (((Agedgeinfo_t*)AGDATA(e))->path) 597 #define ED_showboxes(e) (((Agedgeinfo_t*)AGDATA(e))->showboxes) 598 #define ED_spl(e) (((Agedgeinfo_t*)AGDATA(e))->spl) 599 #define ED_tail_label(e) (((Agedgeinfo_t*)AGDATA(e))->tail_label) 600 #define ED_tail_port(e) (((Agedgeinfo_t*)AGDATA(e))->tail_port) 601 #define ED_to_orig(e) (((Agedgeinfo_t*)AGDATA(e))->to_orig) 602 #define ED_to_virt(e) (((Agedgeinfo_t*)AGDATA(e))->to_virt) 603 #define ED_tree_index(e) (((Agedgeinfo_t*)AGDATA(e))->tree_index) 604 #define ED_xpenalty(e) (((Agedgeinfo_t*)AGDATA(e))->xpenalty) 605 #define ED_dist(e) (((Agedgeinfo_t*)AGDATA(e))->dist) 606 #define ED_weight(e) (((Agedgeinfo_t*)AGDATA(e))->weight) 607 608 #define ag_xget(x,a) agxget(x,a) 609 #define SET_RANKDIR(g,rd) (GD_rankdir2(g) = rd) 610 #define agfindedge(g,t,h) (agedge(g,t,h,NULL,0)) 611 #define agfindnode(g,n) (agnode(g,n,0)) 612 #define agfindgraphattr(g,a) (agattr(g,AGRAPH,a,NULL)) 613 #define agfindnodeattr(g,a) (agattr(g,AGNODE,a,NULL)) 614 #define agfindedgeattr(g,a) (agattr(g,AGEDGE,a,NULL)) 615 616 typedef struct { 617 int flags; 618 } gvlayout_features_t; 619 620 #ifdef __cplusplus 621 } 622 #endif 623 #endif 624