dim = 2;
- edges = edge_bundling(A, 2, x, opts->outer_iter, opts->K, opts->method, opts->nneighbors, opts->compatibility_method, opts->max_recursion, opts->angle_param, opts->angle, 0);
+ edges = edge_bundling(A, 2, x, opts->outer_iter, opts->K, opts->method, opts->nneighbors, opts->compatibility_method, opts->max_recursion, opts->angle_param, opts->angle);
if (opts->fmt == FMT_GV) {
export_dot (outfile, A->m, edges, g);
return grid;
}
-static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge* edges, int nneighbors, int *recurse_level, int MAX_RECURSE_LEVEL, double angle_param, double angle, int open_gl, double *current_ink, double *ink00, int *flag){
+static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge* edges, int nneighbors, int *recurse_level, int MAX_RECURSE_LEVEL, double angle_param, double angle, double *current_ink, double *ink00, int *flag){
int i, j, jj, k;
int *ia, *ja;
A_mid = nearest_neighbor_graph(ne, MIN(nneighbors, ne), xx.data(), eps);
- agglomerative_ink_bundling_internal(dim, A_mid, mid_edges, nneighbors, recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, open_gl, current_ink, ink00, flag);
+ agglomerative_ink_bundling_internal(dim, A_mid, mid_edges, nneighbors, recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, current_ink, ink00, flag);
SparseMatrix_delete(A_mid);
/* patching edges with the new mid-section */
}
-
-#ifdef OPENGL
- if (open_gl){
- nedges_global = grid->n;
- edges_global = edges;
- drawScene();
- }
-#endif
-
Agglomerative_Ink_Bundling_delete(grid);
return edges;
}
-pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int MAX_RECURSE_LEVEL, double angle_param, double angle, int open_gl, int *flag){
+pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int MAX_RECURSE_LEVEL, double angle_param, double angle, int *flag){
int recurse_level = 0;
double current_ink = -1, ink0;
pedge *edges2;
ink_count = 0;
- edges2 = agglomerative_ink_bundling_internal(dim, A, edges, nneighbor, &recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, open_gl, ¤t_ink, &ink0, flag);
+ edges2 = agglomerative_ink_bundling_internal(dim, A, edges, nneighbor, &recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, ¤t_ink, &ink0, flag);
if (Verbose > 1)
int delete_top_level_A;/*whether the top level matrix should be deleted on garbage collecting the grid */
};
-pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int max_recursion, double angle_param, double angle, int open_gl, int *flag);
+pedge* agglomerative_ink_bundling(int dim, SparseMatrix A, pedge* edges, int nneighbor, int max_recursion, double angle_param, double angle, int *flag);
}
-static pedge* force_directed_edge_bundling(SparseMatrix A, pedge* edges, int maxit, double step0, double K, int open_gl){
+static pedge* force_directed_edge_bundling(SparseMatrix A, pedge* edges, int maxit, double step0, double K) {
int i, j, ne = A->n, k;
int *ia = A->ia, *ja = A->ja, iter = 0;
double *a = (double*) A->a;
step = step*0.9;
if (Verbose > 1)
fprintf(stderr, "iter ==== %d cpu = %f npoints = %d\n",iter, ((double) (clock() - start))/CLOCKS_PER_SEC, np - 2);
-
-#ifdef OPENGL
- if (open_gl){
- edges_global = edges;
- drawScene();
- }
-#else
- (void)open_gl;
-#endif
-
}
return edges;
}
pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, double K, int method, int nneighbor, int compatibility_method,
- int max_recursion, double angle_param, double angle, int open_gl){
+ int max_recursion, double angle_param, double angle){
/* bundle edges.
A: edge graph
x: edge i is at {p,q},
nneighbor: number of neighbors to be used in forming nearest neighbor graph. Used only in agglomerative method
compatibility_method: which method to use to calculate compatibility. Used only in force directed.
max_recursion: used only in agglomerative method. Specify how many level of recursion to do to bundle bundled edges again
- open_gl: whether to plot in X.
*/
int ne = A0->m;
} else if (method == METHOD_INK_AGGLOMERATE){
#ifdef HAVE_ANN
/* plan: merge a node with its neighbors if doing so improve. Form coarsening graph, repeat until no more ink saving */
- edges = agglomerative_ink_bundling(dim, A, edges, nneighbor, max_recursion, angle_param, angle, open_gl, &flag);
+ edges = agglomerative_ink_bundling(dim, A, edges, nneighbor, max_recursion, angle_param, angle, &flag);
assert(!flag);
#else
agerr (AGERR, "Graphviz built without approximate nearest neighbor library ANN; agglomerative inking not available\n");
edges[i] = pedge_double(edges[i]);
}
step0 /= 2;
- edges = force_directed_edge_bundling(B, edges, maxit, step0, K, open_gl);
+ edges = force_directed_edge_bundling(B, edges, maxit, step0, K);
}
} else if (method == METHOD_NONE){
typedef struct pedge_struct* pedge;
-pedge* edge_bundling(SparseMatrix A, int dim, double *x, int maxit_outer, double K, int method, int nneighbor, int compatibility_method, int max_recursion, double angle_param, double angle, int open_gl);
+pedge* edge_bundling(SparseMatrix A, int dim, double *x, int maxit_outer, double K, int method, int nneighbor, int compatibility_method, int max_recursion, double angle_param, double angle);
void pedge_delete(pedge e);
pedge pedge_wgts_realloc(pedge e, int n);
void pedge_export_gv(FILE *fp, int ne, pedge *edges);