From: Matthew Fernandez Date: Thu, 29 Sep 2022 01:58:07 +0000 (-0700) Subject: mingle: remove 'open_gl' parameter that is always 0 X-Git-Tag: 6.0.2~17^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d610d753d266692f3295745972de05848a43c21;p=graphviz mingle: remove 'open_gl' parameter that is always 0 --- diff --git a/cmd/mingle/minglemain.cpp b/cmd/mingle/minglemain.cpp index 5949880f9..06011d803 100644 --- a/cmd/mingle/minglemain.cpp +++ b/cmd/mingle/minglemain.cpp @@ -468,7 +468,7 @@ bundle (Agraph_t* g, opts_t* opts) 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); diff --git a/lib/mingle/agglomerative_bundling.cpp b/lib/mingle/agglomerative_bundling.cpp index 3420279f4..8081d6035 100644 --- a/lib/mingle/agglomerative_bundling.cpp +++ b/lib/mingle/agglomerative_bundling.cpp @@ -305,7 +305,7 @@ static Agglomerative_Ink_Bundling Agglomerative_Ink_Bundling_new(SparseMatrix A0 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; @@ -431,7 +431,7 @@ static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge 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 */ @@ -471,28 +471,19 @@ static pedge* agglomerative_ink_bundling_internal(int dim, SparseMatrix A, pedge } - -#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) diff --git a/lib/mingle/agglomerative_bundling.h b/lib/mingle/agglomerative_bundling.h index c6364137f..dde61da10 100644 --- a/lib/mingle/agglomerative_bundling.h +++ b/lib/mingle/agglomerative_bundling.h @@ -29,4 +29,4 @@ struct Agglomerative_Ink_Bundling_struct { 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); diff --git a/lib/mingle/edge_bundling.cpp b/lib/mingle/edge_bundling.cpp index 0d232e73e..24651d0b0 100644 --- a/lib/mingle/edge_bundling.cpp +++ b/lib/mingle/edge_bundling.cpp @@ -444,7 +444,7 @@ static void edge_attraction_force(double similarity, pedge e1, pedge e2, } -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; @@ -490,16 +490,6 @@ static pedge* force_directed_edge_bundling(SparseMatrix A, pedge* edges, int max 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; @@ -604,7 +594,7 @@ static SparseMatrix check_compatibility(SparseMatrix A, int ne, pedge *edges, in } 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}, @@ -616,7 +606,6 @@ pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, doubl 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; @@ -651,7 +640,7 @@ pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, doubl } 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"); @@ -668,7 +657,7 @@ pedge* edge_bundling(SparseMatrix A0, int dim, double *x, int maxit_outer, doubl 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){ diff --git a/lib/mingle/edge_bundling.h b/lib/mingle/edge_bundling.h index e95a096ff..f1a97d645 100644 --- a/lib/mingle/edge_bundling.h +++ b/lib/mingle/edge_bundling.h @@ -24,7 +24,7 @@ struct pedge_struct { 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);