]> granicus.if.org Git - graphviz/commitdiff
Wrap debug traces in if(Verbose)
authorEmden R. Gansner <erg@alum.mit.edu>
Mon, 10 Mar 2014 13:51:51 +0000 (09:51 -0400)
committerEmden R. Gansner <erg@alum.mit.edu>
Mon, 10 Mar 2014 13:51:51 +0000 (09:51 -0400)
lib/edgepaint/edge_distinct_coloring.c
lib/edgepaint/lab.c
lib/edgepaint/node_distinct_coloring.c

index ac62c2a057110fcd42479c00094b6b26815b2f98..f5b4d175d8bf3ceaf556dcfcee9cac22db0f330c 100644 (file)
@@ -182,7 +182,7 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t*
 
   A = SparseMatrix_import_dot(g, dim, NULL, &x, NULL, NULL, FORMAT_COORD, NULL);
   if (!x){
-    fprintf(stderr,"The gv file contains no or not proper 2D coordinates\n");
+    fprintf(stderr,"The gv file contains no or improper 2D coordinates\n");
     return NULL;
   }
 
@@ -198,7 +198,8 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t*
     }
   }
 
-  fprintf(stderr,"cos = %f, nz2 = %d\n", cos_critical, nz2);
+  if (Verbose)
+    fprintf(stderr,"cos = %f, nz2 = %d\n", cos_critical, nz2);
   /* now find edge collision */
   nz = 0;
   B = SparseMatrix_new(nz2, nz2, 1, MATRIX_TYPE_REAL, FORMAT_COORD);
@@ -294,7 +295,8 @@ Agraph_t* edge_distinct_coloring(char *color_scheme, char *lightness, Agraph_t*
   }
 #endif
 
-  fprintf(stderr,"The edge conflict graph has %d nodes and %d edges, final color_diff=%f color_diff_sum = %f\n",
+  if (Verbose)
+    fprintf(stderr,"The edge conflict graph has %d nodes and %d edges, final color_diff=%f color_diff_sum = %f\n",
          C->m, C->nz, color_diff, color_diff_sum);
 
   attach_edge_colors(g, cdim, colors);
index d1fc4e7b1263059349c1520dbec0747c3073c94d..578425727c39704c3f66bdb0e1ec9f4ff8e47e06 100644 (file)
@@ -176,7 +176,8 @@ double *lab_gamut_from_file(char *gamut_file, const char *lightness, int *n){
 
   *n = 0;
 
-  fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2);
+  if (Verbose)
+    fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2);
 
   fp = fopen(gamut_file, "r");
   if (!fp) return NULL;
@@ -218,12 +219,13 @@ double *lab_gamut(const char *lightness, int *n){
   }
 
 
-
-  fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2);
+  if (Verbose)
+    fprintf(stderr,"LAB color lightness range = %d,%d\n", l1, l2);
 
   m = sizeof(lab_gamut_data)/sizeof(lab_gamut_data[0]);
 
-  fprintf(stderr,"size of lab gamut = %d\n", m);
+  if (Verbose)
+    fprintf(stderr,"size of lab gamut = %d\n", m);
 
   x = malloc(sizeof(double)*3*m);
   xx = x;
@@ -313,7 +315,8 @@ void color_blend_rgb2lab(char *color_list, const int maxpoints, double **colors0
   for (i = 0; i < nc - 1; i++){
     dists[i+1] += dists[i];
   }
-  fprintf(stderr,"sum = %f\n", dists[nc-1]);
+  if (Verbose)
+    fprintf(stderr,"sum = %f\n", dists[nc-1]);
 
   if (!(*colors0)){
     *colors0 = malloc(sizeof(double)*maxpoints*cdim);
index 73d73ba80af8d76baa31f50fba607b40657e489d..b3d8295fa87d3cb16daeca8dc5c1e4f5bbab431a 100644 (file)
@@ -244,7 +244,7 @@ void node_distinct_coloring(char *color_scheme, char *lightness, int weightedQ,
 
   cdim = *cdim0 = 3;
   if (strcmp(color_scheme, "lab") == 0){
-    fprintf(stderr,"lab\n");
+    if (Verbose) fprintf(stderr,"lab\n");
     scheme =  COLOR_LAB;
     qt = lab_gamut_quadtree("lab_gamut", lightness, max_qtree_level);
     if (!qt){
@@ -253,7 +253,7 @@ void node_distinct_coloring(char *color_scheme, char *lightness, int weightedQ,
       return;
     }
   } else if (strcmp(color_scheme, "rgb") == 0){
-    fprintf(stderr,"rgb\n");
+    if (Verbose) fprintf(stderr,"rgb\n");
     scheme = COLOR_RGB;
   } else if (strcmp(color_scheme, "gray") == 0){
     scheme = COLOR_GRAY;