if WITH_CGRAPH
GRAPH = cgraph
-FDPGEN = fdpgen_cgraph
else
GRAPH = graph
-FDPGEN = fdpgen
endif
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/lib/gvc \
-I$(top_srcdir)/lib/pack \
- -I$(top_srcdir)/lib/$(FDPGEN) \
+ -I$(top_srcdir)/lib/fdpgen \
-I$(top_srcdir)/lib/pathplan \
-I$(top_srcdir)/lib/$(GRAPH) \
-I$(top_srcdir)/lib/cdt $(GD_INCLUDES) $(EXPAT_INCLUDES) $(Z_INCLUDES)
cleanup_subgs(g);
free(GD_neato_nlist(g));
free(GD_alg(g));
+ if (g != agroot(g))
#ifndef WITH_CGRAPH
- if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ memset(&(g->u), 0, sizeof(Agraphinfo_t));
#else /* WITH_CGRAPH */
- if (g != agroot(g))
- agclean(g,AGRAPH , "Agraphinfo_t");
+ agclean(g, AGRAPH , "Agraphinfo_t");
#endif /* WITH_CGRAPH */
}
{
if (Nop || (Pack < 0))
free_scan_graph(g);
- if (g != g->root) memset(&(g->u), 0, sizeof(Agraphinfo_t));
+ if (g != agroot(g))
+#ifndef WITH_CGRAPH
+ memset(&(g->u), 0, sizeof(Agraphinfo_t));
+#else /* WITH_CGRAPH */
+ agclean(g, AGRAPH , "Agraphinfo_t");
+#endif /* WITH_CGRAPH */
}
void neato_cleanup(graph_t * g)
if WITH_CGRAPH
GRAPH = cgraph
-NEATOGEN = neatogen_cgraph
else
GRAPH = graph
-NEATOGEN = neatogen
endif
AM_CPPFLAGS = -I$(top_srcdir) \
-I$(top_srcdir)/lib/common \
-I$(top_srcdir)/lib/gvc \
- -I$(top_srcdir)/lib/$(NEATOGEN) \
+ -I$(top_srcdir)/lib/neatogen \
-I$(top_srcdir)/lib/pathplan \
-I$(top_srcdir)/lib/$(GRAPH) \
-I$(top_srcdir)/lib/cdt
if WITH_CGRAPH
GRAPH = cgraph
-NEATOGEN = neatogen_cgraph
-FDPGEN = fdpgen_cgraph
else
GRAPH = graph
-NEATOGEN = neatogen
-FDPGEN = fdpgen
endif
AM_CPPFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/lib/common \
-I$(top_srcdir)/lib/gvc \
- -I$(top_srcdir)/lib/$(NEATOGEN) \
- -I$(top_srcdir)/lib/$(FDPGEN) \
+ -I$(top_srcdir)/lib/neatogen \
+ -I$(top_srcdir)/lib/fdpgen \
-I$(top_srcdir)/lib/pack \
-I$(top_srcdir)/lib/pathplan \
-I$(top_srcdir)/lib/$(GRAPH) \
-I$(top_srcdir)/lib/cdt
-if WITH_CGRAPH
-else
noinst_HEADERS = patchwork.h
noinst_LTLIBRARIES = libpatchwork_C.la
-endif
libpatchwork_C_la_SOURCES = patchwork.c patchworkinit.c
subg = GD_clust(g)[i];
if (agnnodes(subg) == 0) continue;
p = newtreenode(&first,&prev);
+#ifndef WITH_CGRAPH
p->kind = AGGRAPH;
+#else
+ p->kind = AGRAPH;
+#endif
p->u.subg = subg;
p->leftchild = treebuilder(subg);
}
static rect_t walker(treenode_t *tree)
{
- treenode_t *p;
- Agnode_t *n;
- pointf center;
+ treenode_t *p;
+ Agnode_t *n;
+ pointf center;
rect_t r, rr;
- switch(tree->kind) {
- case AGGRAPH:
- case AGRAPH:
- break;
- case AGNODE:
- rr = tree->r;
- center.x = (tree->r.UR.x + tree->r.LL.x) / 2.0;
- center.y = (tree->r.UR.y + tree->r.LL.y) / 2.0;
-
- n = tree->u.n;
- ND_coord(n) = center;
- ND_height(n) = PS2INCH(tree->r.UR.y - tree->r.LL.y);
- ND_width(n) = PS2INCH(tree->r.UR.x - tree->r.LL.x);
- gv_nodesize(n,GD_flip(n->graph));
- finishNode (n);
- /*fprintf(stderr,"%s coord %.5g %.5g ht %d width %d\n",
- n->name, ND_coord(n).x, ND_coord(n).y, ND_ht(n),
- ND_rw(n)+ND_lw(n));*/
- break;
- default: abort();
- }
- if ((p = tree->leftchild)) {
- rr = walker (p);
- p = p->rightsib;
- for (; p; p = p->rightsib) {
- r = walker(p);
- EXPANDBB(rr,r);
- }
- GD_bb(tree->u.subg) = rr;
+ switch(tree->kind) {
+#ifndef WITH_CGRAPH
+ case AGGRAPH:
+#else
+ case AGRAPH:
+#endif
+ break;
+ case AGNODE:
+ rr = tree->r;
+ center.x = (tree->r.UR.x + tree->r.LL.x) / 2.0;
+ center.y = (tree->r.UR.y + tree->r.LL.y) / 2.0;
+
+ n = tree->u.n;
+ ND_coord(n) = center;
+ ND_height(n) = PS2INCH(tree->r.UR.y - tree->r.LL.y);
+ ND_width(n) = PS2INCH(tree->r.UR.x - tree->r.LL.x);
+ gv_nodesize(n,GD_flip(agraphof(n)));
+ finishNode (n);
+ /*fprintf(stderr,"%s coord %.5g %.5g ht %d width %d\n",
+ agnameof(n), ND_coord(n).x, ND_coord(n).y, ND_ht(n),
+ ND_rw(n)+ND_lw(n));*/
+ break;
+ default: abort();
+ }
+ if ((p = tree->leftchild)) {
+ rr = walker (p);
+ p = p->rightsib;
+ for (; p; p = p->rightsib) {
+ r = walker(p);
+ EXPANDBB(rr,r);
}
+ GD_bb(tree->u.subg) = rr;
+ }
return rr;
}