switch (Obj) {
case NODE:
- nodeId = Curnode->id;
+ nodeId = AGID(Curnode);
break;
default:
nodeId = -1;
if (Curedge) {
conn_h = conn_t = -1;
- head = Curedge->head;
- tail = Curedge->tail;
+ head = aghead(Curedge);
+ tail = agtail(Curedge);
shape_t = ND_shape(tail)->name;
if (arrow_at_start) {
dia_printf
(" <dia:connection handle=\"0\" to=\"%d\" connection=\"%d\"/>\n",
- head->id, conn_h);
+ AGID(head), conn_h);
dia_printf
(" <dia:connection handle=\"%d\" to=\"%d\" connection=\"%d\"/>\n",
- (n - 1), tail->id, conn_t);
+ (n - 1), AGID(tail), conn_t);
} else {
dia_printf
(" <dia:connection handle=\"0\" to=\"%d\" connection=\"%d\"/>\n",
- tail->id, conn_t);
+ AGID(tail), conn_t);
dia_printf
(" <dia:connection handle=\"%d\" to=\"%d\" connection=\"%d\"/>\n",
- (n - 1), head->id, conn_h);
+ (n - 1), AGID(head), conn_h);
}
dia_fputs(" </dia:connections>\n");
case NODE:
dia_printf
(" <dia:object type=\"Standard - Polygon\" version=\"0\" id=\"%d\">\n",
- Curnode->id);
+ AGID(Curnode));
break;
case EDGE:
return;
case CLST:
dia_printf
(" <dia:object type=\"Standard - Polygon\" version=\"0\" id=\"%s\">\n",
- Curgraph->name);
+ agnameof(Curgraph));
break;
default:
dia_printf
if (pe[0])
return FALSE;
for (cnt = 0; cnt < 2; cnt++) {
- pn = late_string(cnt < 1 ? e->tail : e->head, N_layer, "");
+ pn = late_string(cnt < 1 ? agtail(e) : aghead(e), N_layer, "");
if ((pn[0] == '\0') || selectedlayer(job, pn))
return TRUE;
}
if (flags & GVRENDER_DOES_Z) {
/* obj->z = late_double(n, N_z, 0.0, -MAXFLOAT); */
- if (GD_odim(n->graph) >=3)
+ if (GD_odim(agraphof(n)) >=3)
obj->z = POINTS(ND_pos(n)[2]);
else
obj->z = 0.0;
}
- initObjMapData (job, ND_label(n), "node", n->id, n);
+ initObjMapData (job, ND_label(n), "node", AGID(n), n);
if ((flags & (GVRENDER_DOES_MAPS | GVRENDER_DOES_TOOLTIPS))
&& (obj->url || obj->explicit_tooltip)) {
char *s;
if (ND_shape(n) /* node has a shape */
- && node_in_layer(job, n->graph, n) /* and is in layer */
+ && node_in_layer(job, agraphof(n), n) /* and is in layer */
&& node_in_box(n, job->clip) /* and is in page/view */
&& (ND_state(n) != gvc->common.viewNum)) /* and not already drawn */
{
ND_state(n) = gvc->common.viewNum; /* mark node as drawn */
- gvrender_comment(job, n->name);
+ gvrender_comment(job, agnameof(n));
s = late_string(n, N_comment, "");
if (s[0])
gvrender_comment(job, s);
*/
if (styles && ED_spl(e)) gvrender_set_style(job, styles);
+#ifndef WITH_CGRAPH
if (E_penwidth && ((s=agxget(e,E_penwidth->index)) && s[0])) {
+#else
+ if (E_penwidth && ((s=agxget(e,E_penwidth)) && s[0])) {
+#endif
penwidth = late_double(e, E_penwidth, 1.0, 0.0);
gvrender_set_penwidth(job, penwidth);
}
if (flags & GVRENDER_DOES_Z) {
- /* obj->tail_z = late_double(e->tail, N_z, 0.0, -1000.0); */
- /* obj->head_z = late_double(e->head, N_z, 0.0, -MAXFLOAT); */
- if (GD_odim(e->tail->graph) >=3) {
- obj->tail_z = POINTS(ND_pos(e->tail)[2]);
- obj->head_z = POINTS(ND_pos(e->head)[2]);
+ /* obj->tail_z = late_double(agtail(e), N_z, 0.0, -1000.0); */
+ /* obj->head_z = late_double(aghead(e), N_z, 0.0, -MAXFLOAT); */
+ if (GD_odim(agraphof(agtail(e))) >=3) {
+ obj->tail_z = POINTS(ND_pos(agtail(e))[2]);
+ obj->head_z = POINTS(ND_pos(aghead(e))[2]);
} else {
obj->tail_z = obj->head_z = 0.0;
}
if (flags & GVRENDER_DOES_MAPS) {
s = agget(e, "id");
if (!s || !*s) { /* no external id, so use the internal one */
- sprintf(buf,"edge%d", e->id);
+ sprintf(buf,"edge%d", AGID(e));
s = buf;
}
obj->id = strdup_and_subst_obj(s, (void*)e);
char **sp;
char *p;
- if (edge_in_box(e, job->clip) && edge_in_layer(job, e->head->graph, e) ) {
+ if (edge_in_box(e, job->clip) && edge_in_layer(job, agraphof(aghead(e)), e) ) {
- s = malloc(strlen(e->tail->name) + 2 + strlen(e->head->name) + 1);
- strcpy(s,e->tail->name);
+ s = malloc(strlen(agnameof(agtail(e))) + 2 + strlen(agnameof(aghead(e))) + 1);
+ strcpy(s,agnameof(agtail(e)));
if (agisdirected(agraphof(aghead(e))))
strcat(s,"->");
else
strcat(s,"--");
- strcat(s,e->head->name);
+ strcat(s,agnameof(aghead(e)));
gvrender_comment(job, s);
free(s);
/* default line style */
gvc->defaultlinestyle = defaultlinestyle;
- gvc->graphname = g->name;
+ gvc->graphname = agnameof(g);
}
static void init_job_pad(GVJ_t *job)
for (n = agfstnode(g); n; n = agnxtnode(g, n)) {
emit_node(job, n);
for (e = agfstout(g, n); e; e = agnxtout(g, e)) {
- emit_node(job, e->head);
+ emit_node(job, aghead(e));
emit_edge(job, e);
}
}
if (!pencolor) pencolor = DEFAULT_COLOR;
if (!fillcolor) fillcolor = DEFAULT_FILL;
+#ifndef WITH_CGRAPH
if (G_penwidth && ((s=agxget(sg, G_penwidth->index)) && s[0])) {
+#else
+ if (G_penwidth && ((s=agxget(sg, G_penwidth)) && s[0])) {
+#endif
penwidth = late_double(sg, G_penwidth, 1.0, 0.0);
gvrender_set_penwidth(job, penwidth);
}
break;
case AGNODE:
n = (node_t*)obj;
-#ifndef WITH_CGRAPH
- g = n->graph->root;
-#else
g = agroot(agraphof(n));
-#endif
break;
case AGEDGE:
e = (edge_t*)obj;
-#ifndef WITH_CGRAPH
- g = e->head->graph->root;
-#else
g = agroot(agraphof(aghead(e)));
-#endif
break;
}
rv->fontname = fontname;
rv->html = TRUE;
if (make_html_label(obj, rv)) {
switch (agobjkind(obj)) {
-#ifndef WITH_CGRAPH
- case AGGRAPH:
- agerr(AGPREV, "in label of graph %s\n",sg->name);
-#else
case AGRAPH:
agerr(AGPREV, "in label of graph %s\n",agnameof(sg));
-#endif
break;
case AGNODE:
-#ifndef WITH_CGRAPH
- agerr(AGPREV, "in label of node %s\n", n->name);
-#else
agerr(AGPREV, "in label of node %s\n", agnameof(n));
-#endif
break;
case AGEDGE:
-#ifndef WITH_CGRAPH
- agerr(AGPREV, "in label of edge %s %s %s\n",
- e->tail->name, AG_IS_DIRECTED(g)?"->":"--", e->head->name);
-#else
agerr(AGPREV, "in label of edge %s %s %s\n",
agnameof(agtail(e)), agisdirected(g)?"->":"--", agnameof(aghead(e)));
-#endif
break;
}
}
switch (agobjkind(obj)) {
#ifndef WITH_CGRAPH
case AGGRAPH:
- g_str = ((graph_t *)obj)->name;
#else
case AGRAPH:
- g_str = agnameof((graph_t *)obj);
#endif
+ g_str = agnameof((graph_t *)obj);
g_len = strlen(g_str);
tl = GD_label((graph_t *)obj);
if (tl) {
}
break;
case AGNODE:
-#ifndef WITH_CGRAPH
- g_str = ((node_t *)obj)->graph->name;
- g_len = strlen(g_str);
- n_str = ((node_t *)obj)->name;
-#else
g_str = agnameof(agraphof((node_t *)obj));
g_len = strlen(g_str);
n_str = agnameof((node_t *)obj);
-#endif
n_len = strlen(n_str);
tl = ND_label((node_t *)obj);
if (tl) {
}
break;
case AGEDGE:
-#ifndef WITH_CGRAPH
- g_str = ((edge_t *)obj)->tail->graph->root->name;
- g_len = strlen(g_str);
- t_str = ((edge_t *)obj)->tail->name;
- t_len = strlen(t_str);
- pt = ED_tail_port((edge_t *)obj);
- if ((tp_str = pt.name))
- tp_len = strlen(tp_str);
- h_str = ((edge_t *)obj)->head->name;
-#else
g_str = agnameof(agroot(agraphof(agtail(((edge_t *)obj)))));
g_len = strlen(g_str);
t_str = agnameof(agtail(((edge_t *)obj)));
if ((tp_str = pt.name))
tp_len = strlen(tp_str);
h_str = agnameof(aghead(((edge_t *)obj)));
-#endif
h_len = strlen(h_str);
pt = ED_head_port((edge_t *)obj);
if ((hp_str = pt.name))
l_str = tl->text;
if (str) l_len = strlen(l_str);
}
-#ifndef WITH_CGRAPH
- if (((edge_t *)obj)->tail->graph->root->kind & AGFLAG_DIRECTED)
-#else
if (agisdirected(agroot(agraphof(agtail(((edge_t*)obj))))))
-#endif
e_str = "->";
else
e_str = "--";