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

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 3 08:06:00 EDT 2011


Author: martinl
Date: 2011-11-03 05:06:00 -0700 (Thu, 03 Nov 2011)
New Revision: 49072

Modified:
   grass/trunk/lib/vector/Vlib/build_nat.c
Log:
vlib: Vect_build_nat() - use G_progress()


Modified: grass/trunk/lib/vector/Vlib/build_nat.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build_nat.c	2011-11-03 12:05:17 UTC (rev 49071)
+++ grass/trunk/lib/vector/Vlib/build_nat.c	2011-11-03 12:06:00 UTC (rev 49072)
@@ -537,7 +537,7 @@
 	G_message(_("Registering primitives..."));
 	i = 0;
 	npoints = 0;
-	while (1) {
+	while (TRUE) {
 	    /* register line */
 	    type = Vect_read_next_line(Map, Points, Cats);
 
@@ -550,6 +550,8 @@
 		break;
 	    }
 
+	    G_progress(++i, 1e4);
+	    
 	    npoints += Points->n_points;
 
 	    offset = Map->head.last_offset;
@@ -571,20 +573,9 @@
 		if (Cats->n_cats == 0)	/* add field 0, cat 0 */
 		    dig_cidx_add_cat(plus, 0, 0, line, type);
 	    }
-
-	    i++;
-	    if (i == 10000 && print_counter) {
-		if (format == G_INFO_FORMAT_PLAIN)
-		    fprintf(stderr, "%d..", plus->n_lines);
-		else
-		    fprintf(stderr, "%10d\b\b\b\b\b\b\b\b\b\b", plus->n_lines);
-		i = 0; 
-	    }
 	}
+	G_progress(1, 1);
 
-	if ((print_counter) && format != G_INFO_FORMAT_PLAIN)
-	    fprintf(stderr, "\r");
-
 	G_message(_("%d primitives registered"), plus->n_lines);
 	G_message(_("%d vertices registered"), npoints);
 



More information about the grass-commit mailing list