31#define PARENT(n) ((Agraph_t*)ND_alg(n))
82 fprintf (stderr,
"layout %s\n",
agnameof(g));
111 agwarningf(
"Graph %s has array packing with user values but no \"sortv\" attributes are defined.",
116 void **children =
gv_calloc(total,
sizeof(
void*));
121 if (pinfo.
vals && cattr) {
124 children[j++] = subg;
135 if (pinfo.
vals && vattr) {
144 pts =
putRects((
size_t)total, gs, &pinfo);
147 rootbb.
LL = (
pointf){INT_MAX, INT_MAX};
148 rootbb.
UR = (
pointf){-INT_MAX, -INT_MAX};
151 for (j = 0; j < total; j++) {
188 d = pt.
x - (rootbb.
UR.
x - rootbb.
LL.
x);
197 margin = pinfo.
margin/2.0;
200 rootbb.
LL.
x -= margin;
201 rootbb.
UR.
x += margin;
207 fprintf (stderr,
"%s : %f %f %f %f\n",
agnameof(g), rootbb.
LL.
x, rootbb.
LL.
y, rootbb.
UR.
x, rootbb.
UR.
y);
214 for (j = 0; j < total; j++) {
242 fprintf (stderr,
"%s : %f %f %f %f\n",
agnameof(g), rootbb.
LL.
x, rootbb.
LL.
y, rootbb.
UR.
x, rootbb.
UR.
y);
260 fprintf (stderr,
"reposition %s\n",
agnameof(g));
304 if (pclist ==
NULL) {
306 clist_append(&list,
NULL);
316 clist_append(clist, subg);
323 if (pclist ==
NULL) {
324 assert(clist_size(&list) - 1 <= INT_MAX);
326 if (clist_size(&list) > 1) {
327 clist_shrink_to_fit(&list);
Memory allocation wrappers that exit on failure.
static void * gv_calloc(size_t nmemb, size_t size)
void setEdgeType(graph_t *g, int defaultValue)
int late_int(void *obj, attrsym_t *attr, int defaultValue, int minimum)
void common_init_edge(edge_t *e)
bool is_a_cluster(Agraph_t *g)
#define PS2INCH(a_points)
static pointf mid_pointf(pointf p, pointf q)
static pointf sub_pointf(pointf p, pointf q)
int agnnodes(Agraph_t *g)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
void agwarningf(const char *fmt,...)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
char * agnameof(void *)
returns a string descriptor for the object.
void * agbindrec(void *obj, const char *name, unsigned int recsize, int move_to_front)
attaches a new record of the given size to the object
Agraph_t * agfstsubg(Agraph_t *g)
Agraph_t * agnxtsubg(Agraph_t *subg)
void free_label(textlabel_t *p)
#define DEFINE_LIST(name, type)
void neato_init_node(node_t *n)
NEATOPROCS_API void spline_edges0(Agraph_t *, bool)
NEATOPROCS_API int spline_edges1(graph_t *g, int)
static void cleanup_graphs(Agraph_t *g)
static void indent(int i)
static void mkClusters(Agraph_t *g, clist_t *pclist, Agraph_t *parent)
static void reposition(Agraph_t *g, int depth)
void osage_cleanup(Agraph_t *g)
static void layout(Agraph_t *g, int depth)
void osage_layout(Agraph_t *g)
static void cluster_init_graph(graph_t *g)
pointf * putRects(size_t ng, boxf *bbs, pack_info *pinfo)
pack_mode getPackInfo(Agraph_t *g, pack_mode dflt, int dfltMargin, pack_info *pinfo)
support for connected components
void dotneato_postprocess(Agraph_t *g)
void gv_cleanup_edge(Agedge_t *e)
void gv_cleanup_node(Agnode_t *n)
Agraph_t * root
subgraphs - ancestors