]> granicus.if.org Git - graphviz/commitdiff
mingle: remove 'open_gl' parameter that is always 0
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 29 Sep 2022 01:58:07 +0000 (18:58 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 30 Sep 2022 04:08:54 +0000 (21:08 -0700)
cmd/mingle/minglemain.cpp
lib/mingle/agglomerative_bundling.cpp
lib/mingle/agglomerative_bundling.h
lib/mingle/edge_bundling.cpp
lib/mingle/edge_bundling.h

index 5949880f9d81a4f9695f0e13a4a6aebd4ac84626..06011d803d1cb4e5ebd83b0b7f830f2265d618be 100644 (file)
@@ -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);
index 3420279f4065eb8570864569dc14d9c383a9169f..8081d6035b0758ca1e1c17d442bcf9adc4466a2b 100644 (file)
@@ -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, &current_ink, &ink0, flag);
+  edges2 = agglomerative_ink_bundling_internal(dim, A, edges, nneighbor, &recurse_level, MAX_RECURSE_LEVEL, angle_param, angle, &current_ink, &ink0, flag);
 
   
   if (Verbose > 1)
index c6364137f406714e893e52716df248fd2772717c..dde61da101489354480fe55024f7316c9e475d92 100644 (file)
@@ -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);
index 0d232e73ea02ee323775b0d4f38b3d481a2fe72d..24651d0b079799dd31e6cd9c48a4f9089e230012 100644 (file)
@@ -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){
index e95a096ffc8da87f9ba7545be063a88c2508febc..f1a97d64573b7585a60b97f9346a888551346277 100644 (file)
@@ -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);