[GRASS-SVN] r34465 - grass/trunk/lib/vector/Vlib

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 24 00:45:25 EST 2008


Author: martinl
Date: 2008-11-24 00:45:25 -0500 (Mon, 24 Nov 2008)
New Revision: 34465

Modified:
   grass/trunk/lib/vector/Vlib/build.c
   grass/trunk/lib/vector/Vlib/build_nat.c
Log:
vlib: print build messages in standard message mode (G_verbose_message() -> G_message())
      (merge from devbr6, r34464)


Modified: grass/trunk/lib/vector/Vlib/build.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build.c	2008-11-24 05:42:31 UTC (rev 34464)
+++ grass/trunk/lib/vector/Vlib/build.c	2008-11-24 05:45:25 UTC (rev 34465)
@@ -145,18 +145,18 @@
 	dig_cidx_sort(plus);
     }
 
-    G_verbose_message(_("Number of nodes: %d"), plus->n_nodes);
-    G_verbose_message(_("Number of primitives: %d"), plus->n_lines);
-    G_verbose_message(_("Number of points: %d"), plus->n_plines);
-    G_verbose_message(_("Number of lines: %d"), plus->n_llines);
-    G_verbose_message(_("Number of boundaries: %d"), plus->n_blines);
-    G_verbose_message(_("Number of centroids: %d"), plus->n_clines);
+    G_message(_("Number of nodes: %d"), plus->n_nodes);
+    G_message(_("Number of primitives: %d"), plus->n_lines);
+    G_message(_("Number of points: %d"), plus->n_plines);
+    G_message(_("Number of lines: %d"), plus->n_llines);
+    G_message(_("Number of boundaries: %d"), plus->n_blines);
+    G_message(_("Number of centroids: %d"), plus->n_clines);
 
     if (plus->n_flines > 0)
-	G_verbose_message(_("Number of faces: %d"), plus->n_flines);
+	G_message(_("Number of faces: %d"), plus->n_flines);
 
     if (plus->n_klines > 0)
-	G_verbose_message(_("Number of kernels: %d"), plus->n_klines);
+	G_message(_("Number of kernels: %d"), plus->n_klines);
 
     if (plus->built >= GV_BUILD_AREAS) {
 	int line, nlines, area, nareas, err_boundaries, err_centr_out,
@@ -196,29 +196,29 @@
 		err_nocentr++;
 	}
 
-	G_verbose_message(_("Number of areas: %d"), plus->n_areas);
-	G_verbose_message(_("Number of isles: %d"), plus->n_isles);
+	G_message(_("Number of areas: %d"), plus->n_areas);
+	G_message(_("Number of isles: %d"), plus->n_isles);
 
 	if (err_boundaries)
-	    G_verbose_message(_("Number of incorrect boundaries: %d"),
+	    G_message(_("Number of incorrect boundaries: %d"),
 			      err_boundaries);
 
 	if (err_centr_out)
-	    G_verbose_message(_("Number of centroids outside area: %d"),
+	    G_message(_("Number of centroids outside area: %d"),
 			      err_centr_out);
 
 	if (err_centr_dupl)
-	    G_verbose_message(_("Number of duplicate centroids: %d"),
+	    G_message(_("Number of duplicate centroids: %d"),
 			      err_centr_dupl);
 
 	if (err_nocentr)
-	    G_verbose_message(_("Number of areas without centroid: %d"),
+	    G_message(_("Number of areas without centroid: %d"),
 			      err_nocentr);
 
     }
     else {
-	G_verbose_message(_("Number of areas: -"));
-	G_verbose_message(_("Number of isles: -"));
+	G_message(_("Number of areas: -"));
+	G_message(_("Number of isles: -"));
     }
     return 1;
 }

Modified: grass/trunk/lib/vector/Vlib/build_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_nat.c	2008-11-24 05:42:31 UTC (rev 34464)
+++ grass/trunk/lib/vector/Vlib/build_nat.c	2008-11-24 05:45:25 UTC (rev 34465)
@@ -421,7 +421,7 @@
 int Vect_build_nat(struct Map_info *Map, int build)
 {
     struct Plus_head *plus;
-    int i, j, s, type, lineid;
+    int i, s, type, lineid;
     long offset;
     int side, line, area;
     struct line_pnts *Points, *APoints;
@@ -502,9 +502,8 @@
 
 	/* register lines, create nodes */
 	Vect_rewind(Map);
-	G_verbose_message(_("Registering primitives:"));
+	G_message(_("Registering primitives..."));
 	i = 1;
-	j = 1;
 	npoints = 0;
 	while (1) {
 	    /* register line */
@@ -542,12 +541,20 @@
 		if (Cats->n_cats == 0)	/* add field 0, cat 0 */
 		    dig_cidx_add_cat(plus, 0, 0, lineid, type);
 	    }
+
+	    if (G_verbose() > G_verbose_min() && i % 1000 == 0) {
+		fprintf(stderr, "%7d\b\b\b\b\b\b\b", i);
+	    }
+	    
 	    i++;
-	    j++;
 	}
-	G_verbose_message(_("%d primitives registered"), plus->n_lines);
-	G_verbose_message(_("%d vertices registered"), npoints);
+	
+	if (G_verbose() > G_verbose_min())
+	    fprintf(stderr, "\r");
 
+	G_message(_("%d primitives registered"), plus->n_lines);
+	G_message(_("%d vertices registered"), npoints);
+
 	plus->built = GV_BUILD_BASE;
     }
 
@@ -557,7 +564,7 @@
     if (plus->built < GV_BUILD_AREAS) {
 	/* Build areas */
 	/* Go through all bundaries and try to build area for both sides */
-	G_verbose_message(_("Building areas:"));
+	G_message(_("Building areas..."));
 	for (i = 1; i <= plus->n_lines; i++) {
 	    G_percent(i, plus->n_lines, 1);
 
@@ -580,8 +587,8 @@
 		Vect_build_line_area(Map, i, side);
 	    }
 	}
-	G_verbose_message(_("%d areas built"), plus->n_areas);
-	G_verbose_message(_("%d isles built"), plus->n_isles);
+	G_message(_("%d areas built"), plus->n_areas);
+	G_message(_("%d isles built"), plus->n_isles);
 	plus->built = GV_BUILD_AREAS;
     }
 
@@ -590,7 +597,7 @@
 
     /* Attach isles to areas */
     if (plus->built < GV_BUILD_ATTACH_ISLES) {
-	G_verbose_message(_("Attaching islands:"));
+	G_message(_("Attaching islands..."));
 	for (i = 1; i <= plus->n_isles; i++) {
 	    G_percent(i, plus->n_isles, 1);
 	    Vect_attach_isle(Map, i);
@@ -605,7 +612,7 @@
     if (plus->built < GV_BUILD_CENTROIDS) {
 	int nlines;
 
-	G_verbose_message(_("Attaching centroids:"));
+	G_message(_("Attaching centroids..."));
 
 	nlines = Vect_get_num_lines(Map);
 	for (line = 1; line <= nlines; line++) {



More information about the grass-commit mailing list