[GRASS-SVN] r34472 - in grass/branches/develbranch_6: 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:06:48 EST 2008


Author: martinl
Date: 2008-11-24 03:06:48 -0500 (Mon, 24 Nov 2008)
New Revision: 34472

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


Modified: grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp	2008-11-24 07:20:09 UTC (rev 34471)
+++ grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp	2008-11-24 08:06:48 UTC (rev 34472)
@@ -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/branches/develbranch_6/include/vedit.h
===================================================================
--- grass/branches/develbranch_6/include/vedit.h	2008-11-24 07:20:09 UTC (rev 34471)
+++ grass/branches/develbranch_6/include/vedit.h	2008-11-24 08:06:48 UTC (rev 34472)
@@ -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/branches/develbranch_6/lib/vector/Vlib/build.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/Vlib/build.c	2008-11-24 07:20:09 UTC (rev 34471)
+++ grass/branches/develbranch_6/lib/vector/Vlib/build.c	2008-11-24 08:06:48 UTC (rev 34472)
@@ -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/branches/develbranch_6/lib/vector/vedit/chtype.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/vedit/chtype.c	2008-11-24 07:20:09 UTC (rev 34471)
+++ grass/branches/develbranch_6/lib/vector/vedit/chtype.c	2008-11-24 08:06:48 UTC (rev 34472)
@@ -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/branches/develbranch_6/vector/v.edit/main.c
===================================================================
--- grass/branches/develbranch_6/vector/v.edit/main.c	2008-11-24 07:20:09 UTC (rev 34471)
+++ grass/branches/develbranch_6/vector/v.edit/main.c	2008-11-24 08:06:48 UTC (rev 34472)
@@ -380,27 +380,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"));
@@ -412,20 +395,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