#define GD_showboxes(g) (((Agraphinfo_t*)AGDATA(g))->showboxes)
#define GD_fontnames(g) (((Agraphinfo_t*)AGDATA(g))->fontnames)
#define GD_spring(g) (((Agraphinfo_t*)AGDATA(g))->spring)
+#define GD_sum_t(g) (((Agraphinfo_t*)AGDATA(g))->sum_t)
+#define GD_t(g) (((Agraphinfo_t*)AGDATA(g))->t)
#else
}
}
+
+#ifdef WITH_CGRAPH
+static double doubleattr(void *obj, Agsym_t* index, double defval)
+#else
static double doubleattr(void *obj, int index, double defval)
+#endif
{
double val;
+
+#ifdef WITH_CGRAPH
+ if (index == NULL)
+#else
if (index < 0)
+#endif
return defval;
if (sscanf(agxget(obj, index), "%lf", &val) < 1)
return defval;
return val;
}
+
/* degreeKind;
* Returns degree of n ignoring loops and multiedges.
* Returns 0, 1 or many (2)
return next;
}
+#ifdef WITH_CGRAPH
+static double setEdgeLen(graph_t * G, node_t * np, Agsym_t* lenx)
+#else
static double setEdgeLen(graph_t * G, node_t * np, int lenx)
+#endif
{
edge_t *ep;
double total_len = 0.0;
*/
int scan_graph_mode(graph_t * G, int mode)
{
- int i, lenx, nV, nE, deg;
+ int i, nV, nE, deg;
char *str;
node_t *np, *xp, *other;
double total_len = 0.0;
#ifdef WITH_CGRAPH
- int c=0;
+ Agsym_t* lenx;
+#else
+ int lenx;
#endif /* WITH_CGRAPH */
if (Verbose)
nV = agnnodes(G);
nE = agnedges(G);
+#ifdef WITH_CGRAPH
+ lenx = agattr(G, AGEDGE, "len", 0);
+#else
lenx = agindex(G->root->proto->e, "len");
+#endif
if (mode == MODE_KK) {
Epsilon = .0001 * nV;
getdouble(G, "epsilon", &Epsilon);
void free_scan_graph(graph_t * g)
{
-#ifndef WITH_CGRAPH
free(GD_neato_nlist(g));
if (!Nop) {
free_array(GD_dist(g));
free_3array(GD_t(g));
GD_t(g) = NULL;
}
-#endif /* WITH_CGRAPH */
}
void jitter_d(node_t * np, int nG, int n)