[GRASS-SVN] r29745 - grass/trunk/vector/v.edit/lib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 18 09:45:44 EST 2008


Author: martinl
Date: 2008-01-18 09:45:44 -0500 (Fri, 18 Jan 2008)
New Revision: 29745

Modified:
   grass/trunk/vector/v.edit/lib/snap.c
Log:
veditlib: Fix snapping to the objects from background map(s). Debugging messages upgraded.

Modified: grass/trunk/vector/v.edit/lib/snap.c
===================================================================
--- grass/trunk/vector/v.edit/lib/snap.c	2008-01-18 11:07:40 UTC (rev 29744)
+++ grass/trunk/vector/v.edit/lib/snap.c	2008-01-18 14:45:44 UTC (rev 29745)
@@ -44,7 +44,7 @@
 
     line2snap = Vect_find_line(Map, *x, *y, *z,
 			       -1, thresh, WITHOUT_Z, line);
-    
+
     if (line2snap > 0) {
 	Vect_read_line(Map, Points, NULL, line2snap);
 	
@@ -72,10 +72,12 @@
 	    *y = Points->y[mindist_idx];
 	    *z = Points->z[mindist_idx];
 	    snapped = 1;
-	    G_debug(3, "Vedit_snap_point(): line=%d", line2snap);
 	}
     }
 
+    G_debug(3, "Vedit_snap_point(): map=%s, line2snap=%d, snapped=%d",
+	    Map->name, line2snap, snapped);
+
     Vect_destroy_line_struct(Points);
 
     return snapped;
@@ -107,8 +109,10 @@
 
     struct line_cats *Cats;
 
-    Cats   = Vect_new_cats_struct();
+    Cats = Vect_new_cats_struct();
 
+    G_debug(3, "Vedit_snap_line(): thresh=%g, to_vertex=%d", thresh, to_vertex);
+
     if (line > 0 && !Vect_line_alive (Map, line))
 	return -1;
 
@@ -129,8 +133,7 @@
 	}
 	else {
 	    /* check also background maps */
-	    int bgi;
-	    for (bgi = 0; bgi < nbgmaps; bgi++) {
+	    for (i = 0; i < nbgmaps; i++) {
 		if (Vedit_snap_point(BgMap[i], -1, &x[node], &y[node], &z[node], thresh,
 				     to_vertex)) {
 		    rewrite = 1;



More information about the grass-commit mailing list