Debian Codegraph @

lib/common/types.h

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