[GRASS-SVN] r32092 - in grass/branches/develbranch_6: gui/wxpython/vdigit lib/vector/vedit

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Jul 14 05:34:58 EDT 2008


Author: martinl
Date: 2008-07-14 05:34:58 -0400 (Mon, 14 Jul 2008)
New Revision: 32092

Modified:
   grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp
   grass/branches/develbranch_6/lib/vector/vedit/snap.c
Log:
veditlib: bugfix - snapping lines works now (merged from trunk, r32091)


Modified: grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp	2008-07-14 09:30:24 UTC (rev 32091)
+++ grass/branches/develbranch_6/gui/wxpython/vdigit/line.cpp	2008-07-14 09:34:58 UTC (rev 32092)
@@ -113,7 +113,7 @@
 	}
     }
 
-    if (snap != NO_SNAP) { /* apply snapping (node or vertex) */
+    if (snap != NO_SNAP && (type & GV_LINES)) { /* apply snapping (node or vertex) */
 	Vedit_snap_line(display->mapInfo, BgMap, nbgmaps,
 			-1, Points,
 			threshold, (snap == SNAP) ? 0 : 1); 

Modified: grass/branches/develbranch_6/lib/vector/vedit/snap.c
===================================================================
--- grass/branches/develbranch_6/lib/vector/vedit/snap.c	2008-07-14 09:30:24 UTC (rev 32091)
+++ grass/branches/develbranch_6/lib/vector/vedit/snap.c	2008-07-14 09:34:58 UTC (rev 32092)
@@ -106,7 +106,7 @@
 		    int line, struct line_pnts* Points, 
 		    double thresh, int to_vertex)
 {
-    int i, type, npoints, node, rewrite;
+    int i, npoints, node, rewrite;
     double *x, *y, *z;
 
     struct line_cats *Cats;
@@ -146,14 +146,14 @@
     } /* for each line vertex */
     
     /* close boundaries or lines */
-    if (!rewrite && (type & GV_LINES) &&
+    if (!rewrite &&
 	Vect_points_distance(x[0], y[0], z[0],
 			     x[npoints-1], y[npoints-1], z[npoints-1],
 			     WITHOUT_Z) <= thresh) {
 	x[npoints-1] = x[0];
 	y[npoints-1] = y[0];
 	z[npoints-1] = z[0];
-	
+
 	rewrite = 1;
     }
 
@@ -193,9 +193,11 @@
     for(i = 0; i < List -> n_values; i++) {
 	line = List -> value[i];
 	type = Vect_read_line(Map, Points, Cats, line);
-	if (type < 0) {
-	    return -1;
+
+	if (!(type & GV_LINES)) {
+	    continue;
 	}
+
 	if (Vedit_snap_line(Map, BgMap, nbgmaps,
 			    line, Points, thresh, to_vertex) == 1) {
 	    if (Vect_rewrite_line (Map, line, type, Points, Cats) < 0) {



More information about the grass-commit mailing list