[GRASS-SVN] r34473 - in grass/trunk: gui/wxpython/vdigit include lib/vector/Vlib lib/vector/vedit vector/v.edit

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Nov 24 03:08:20 EST 2008


Author: martinl
Date: 2008-11-24 03:08:20 -0500 (Mon, 24 Nov 2008)
New Revision: 34473

Modified:
   grass/trunk/gui/wxpython/vdigit/line.cpp
   grass/trunk/include/vedit.h
   grass/trunk/lib/vector/Vlib/build.c
   grass/trunk/lib/vector/vedit/chtype.c
   grass/trunk/vector/v.edit/main.c
Log:
vlib: print build message for > GV_BUILD_NONE
veditlib: simplify Vedit_chtype_lines()
v.edit: updated
	(merge from devbr6, r34472)


Modified: grass/trunk/gui/wxpython/vdigit/line.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/line.cpp	2008-11-24 08:06:48 UTC (rev 34472)
+++ grass/trunk/gui/wxpython/vdigit/line.cpp	2008-11-24 08:08:20 UTC (rev 34473)
@@ -865,7 +865,6 @@
 int Digit::TypeConvLines()
 {
     int ret;
-    int npoints, ncentroids, nboundaries;
     int changeset, nlines;
 
     if (!display->mapInfo) {
@@ -878,9 +877,7 @@
     /* register changeset */
     changeset = AddActionsBefore();
     
-    ret = Vedit_chtype_lines (display->mapInfo, display->selected.values,
-			       &npoints, &ncentroids,
-			       &nlines, &nboundaries);
+    ret = Vedit_chtype_lines (display->mapInfo, display->selected.values);
 
     if(ret > 0) {
 	AddActionsAfter(changeset, nlines);

Modified: grass/trunk/include/vedit.h
===================================================================
--- grass/trunk/include/vedit.h	2008-11-24 08:06:48 UTC (rev 34472)
+++ grass/trunk/include/vedit.h	2008-11-24 08:08:20 UTC (rev 34473)
@@ -25,8 +25,7 @@
 int Vedit_copy_lines(struct Map_info *, struct Map_info *, struct ilist *);
 
 /* chtype.c */
-int Vedit_chtype_lines(struct Map_info *, struct ilist *,
-		       int *, int *, int *, int *);
+int Vedit_chtype_lines(struct Map_info *, struct ilist *);
 
 /* delete.c */
 

Modified: grass/trunk/lib/vector/Vlib/build.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build.c	2008-11-24 08:06:48 UTC (rev 34472)
+++ grass/trunk/lib/vector/Vlib/build.c	2008-11-24 08:08:20 UTC (rev 34473)
@@ -119,8 +119,10 @@
     Map->plus.Spidx_built = 1;
 
     plus = &(Map->plus);
-    G_verbose_message(_("Building topology for vector map <%s>..."),
-		      Vect_get_name(Map));
+    if (build > GV_BUILD_NONE) {
+	G_message(_("Building topology for vector map <%s>..."),
+		  Vect_get_name(Map));
+    }
     plus->with_z = Map->head.with_z;
     plus->spidx_with_z = Map->head.with_z;
 
@@ -135,7 +137,9 @@
 	return 0;
     }
 
-    G_verbose_message(_("Topology was built"));
+    if (build > GV_BUILD_NONE) {
+	G_verbose_message(_("Topology was built"));
+    }
 
     Map->level = LEVEL_2;
     plus->mode = GV_MODE_WRITE;
@@ -145,19 +149,21 @@
 	dig_cidx_sort(plus);
     }
 
-    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 (build > GV_BUILD_NONE) {
+	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_message(_("Number of faces: %d"), plus->n_flines);
-
-    if (plus->n_klines > 0)
-	G_message(_("Number of kernels: %d"), plus->n_klines);
-
+	if (plus->n_flines > 0)
+	    G_message(_("Number of faces: %d"), plus->n_flines);
+	
+	if (plus->n_klines > 0)
+	    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,
 	    err_centr_dupl, err_nocentr;
@@ -216,7 +222,7 @@
 			      err_nocentr);
 
     }
-    else {
+    else if (build > GV_BUILD_NONE) {
 	G_message(_("Number of areas: -"));
 	G_message(_("Number of isles: -"));
     }

Modified: grass/trunk/lib/vector/vedit/chtype.c
===================================================================
--- grass/trunk/lib/vector/vedit/chtype.c	2008-11-24 08:06:48 UTC (rev 34472)
+++ grass/trunk/lib/vector/vedit/chtype.c	2008-11-24 08:08:20 UTC (rev 34473)
@@ -25,17 +25,11 @@
 
     \param Map vector map
     \param List list of selected primitives
-    \param[out] npoints number of points after conversion
-    \param[out] ncentroids number of centroids after conversion
-    \param[out] nlines number of lines after conversion
-    \param[out] nboundaries number of boundaries after conversion
 
     \return number of modified primitives
     \return -1 on error
 */
-int Vedit_chtype_lines(struct Map_info *Map, struct ilist *List,
-		       int *npoints, int *ncentroids,
-		       int *nlines, int *nboundaries)
+int Vedit_chtype_lines(struct Map_info *Map, struct ilist *List)
 {
     int i;
     int nret, line;
@@ -44,7 +38,6 @@
     struct line_cats *Cats;
 
     nret = 0;
-    *npoints = *ncentroids = *nlines = *nboundaries = 0;
 
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
@@ -60,19 +53,15 @@
 	switch (type) {
 	case GV_POINT:
 	    newtype = GV_CENTROID;
-	    (*npoints)++;
 	    break;
 	case GV_CENTROID:
 	    newtype = GV_POINT;
-	    (*ncentroids)++;
 	    break;
 	case GV_LINE:
 	    newtype = GV_BOUNDARY;
-	    (*nlines)++;
 	    break;
 	case GV_BOUNDARY:
 	    newtype = GV_LINE;
-	    (*nboundaries)++;
 	    break;
 	default:
 	    newtype = -1;

Modified: grass/trunk/vector/v.edit/main.c
===================================================================
--- grass/trunk/vector/v.edit/main.c	2008-11-24 08:06:48 UTC (rev 34472)
+++ grass/trunk/vector/v.edit/main.c	2008-11-24 08:08:20 UTC (rev 34473)
@@ -358,27 +358,10 @@
 	    break;
 	}
     case MODE_CHTYPE:{
-	    int npoints, nlines, ncentroids, nboundaries;
+	    ret = Vedit_chtype_lines(&Map, List);
 
-	    ret = Vedit_chtype_lines(&Map, List,
-				     &npoints, &ncentroids,
-				     &nlines, &nboundaries);
-
 	    if (ret > 0) {
-		if (npoints > 0) {
-		    G_message(_("%d points converted to centroids"), npoints);
-		}
-		if (ncentroids > 0) {
-		    G_message(_("%d centroids converted to points"),
-			      ncentroids);
-		}
-		if (nlines > 0) {
-		    G_message(_("%d lines converted to boundaries"), nlines);
-		}
-		if (nboundaries > 0) {
-		    G_message(_("%d boundaries converted to lines"),
-			      nboundaries);
-		}
+		G_message(_("%d features converted"), ret);
 	    }
 	    else {
 		G_message(_("No feature modified"));
@@ -390,20 +373,7 @@
 	ret = -1;
 	break;
     }
-
-    /*
-       if (print && ret > 0) {
-       for (i = 0; i < Vect_get_num_updated_lines(&Map); i++) {
-       if (i > 0)
-       fprintf (stdout, ",");
-       fprintf (stdout, "%d", Vect_get_updated_line(&Map, i));
-       }
-       if (Vect_get_num_updated_lines(&Map) > 0)
-       fprintf (stdout, "\n");
-       fflush (stdout);
-       }
-     */
-
+    
     Vect_hist_command(&Map);
 
     /* build topology only if requested or if tool!=select */



More information about the grass-commit mailing list