From: Emden R. Gansner Date: Fri, 30 Aug 2013 18:47:01 +0000 (-0400) Subject: Expose node id attribute X-Git-Tag: LAST_LIBGRAPH~32^2~51 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fb87517caa2de4cc960e7aa7dcecc6f88487f96c;p=graphviz Expose node id attribute --- diff --git a/lib/sparse/DotIO.c b/lib/sparse/DotIO.c index 683d3f602..12e658aec 100644 --- a/lib/sparse/DotIO.c +++ b/lib/sparse/DotIO.c @@ -27,12 +27,6 @@ typedef struct { #define ND_id(n) (((Agnodeinfo_t*)((n)->base.data))->id) -void -initGraph (Agraph_t* g) -{ - aginit(g, AGNODE, "nodeinfo", sizeof(Agnodeinfo_t), TRUE); -} - #if 0 static void posStr (int len_buf, char* buf, int dim, real* x, double sc) @@ -1051,3 +1045,13 @@ void initDotIO (Agraph_t *g) aginit(g, AGNODE, "info", sizeof(Agnodeinfo_t), TRUE); } +void setDotNodeID (Agnode_t* n, int v) +{ + ND_id(n) = v; +} + +int getDotNodeID (Agnode_t* n) +{ + return ND_id(n); +} + diff --git a/lib/sparse/DotIO.h b/lib/sparse/DotIO.h index 677c3d409..00258b03b 100644 --- a/lib/sparse/DotIO.h +++ b/lib/sparse/DotIO.h @@ -21,6 +21,9 @@ enum {COLOR_SCHEME_NONE, COLOR_SCHEME_PASTEL = 1, COLOR_SCHEME_BLUE_YELLOW, COLO extern void initDotIO (Agraph_t *g); extern Agraph_t* SparseMatrix_read_dot(FILE*); +extern void setDotNodeID (Agnode_t* n, int v); +extern int getDotNodeID (Agnode_t* n); + /* extern void attach_embedding(Agraph_t *g, int dim, double sc, real *x); */ extern SparseMatrix SparseMatrix_import_dot(Agraph_t* g, int dim, real **label_sizes, real **x, int *n_edge_label_nodes, int **edge_label_nodes, int format, SparseMatrix *D);