void sfdp_cleanup(graph_t * g) { node_t *n; edge_t *e; for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { gv_cleanup_edge(e); } gv_cleanup_node(n); } sfdp_cleanup_graph(g); }
void fdp_cleanup(graph_t * g) { node_t *n; edge_t *e; n = agfstnode(g); free(ND_alg(n)); for (; n; n = agnxtnode(g, n)) { for (e = agfstedge(g, n); e; e = agnxtedge(g, e, n)) { gv_cleanup_edge(e); } gv_cleanup_node(n); } fdp_cleanup_graph(g); }
/* twopi_cleanup: * The ND_alg data used by twopi is freed in twopi_layout * before edge routing as edge routing may use this field. */ void twopi_cleanup(graph_t * g) { node_t *n; edge_t *e; n = agfstnode (g); if (!n) return; /* empty graph */ /* free (ND_alg(n)); */ for (; n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { gv_cleanup_edge(e); } gv_cleanup_node(n); } twopi_cleanup_graph(g); }
/* undoClusterEdges: * Replace cluster nodes with originals. Make sure original has * no attributes. Replace original edges. Delete cluster nodes, * which will also delete cluster edges. */ void undoClusterEdges(graph_t * g) { node_t *n; node_t *nextn; edge_t *e; graph_t *clg; clg = agsubg(g, "__clusternodes",1); agbindrec(clg, "Agraphinfo_t", sizeof(Agraphinfo_t), TRUE); for (n = agfstnode(g); n; n = agnxtnode(g, n)) { for (e = agfstout(g, n); e; e = agnxtout(g, e)) { undoCompound(e, clg); } } for (n = agfstnode(clg); n; n = nextn) { nextn = agnxtnode(clg, n); gv_cleanup_node(n); agdelete(g, n); } agclose(clg); }