[GRASS-SVN] r63265 - in grass/trunk: include/vect lib/vector/Vlib lib/vector/diglib

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 28 12:01:16 PST 2014


Author: mmetz
Date: 2014-11-28 12:01:16 -0800 (Fri, 28 Nov 2014)
New Revision: 63265

Modified:
   grass/trunk/include/vect/dig_externs.h
   grass/trunk/lib/vector/Vlib/build.c
   grass/trunk/lib/vector/Vlib/open_pg.c
   grass/trunk/lib/vector/diglib/plus_area.c
   grass/trunk/lib/vector/diglib/plus_line.c
   grass/trunk/lib/vector/diglib/update.c
Log:
diglib: change content of list of changed lines

Modified: grass/trunk/include/vect/dig_externs.h
===================================================================
--- grass/trunk/include/vect/dig_externs.h	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/include/vect/dig_externs.h	2014-11-28 20:01:16 UTC (rev 63265)
@@ -252,7 +252,7 @@
 /* update.c */
 /* list of updated */
 void dig_line_reset_updated(struct Plus_head *);
-void dig_line_add_updated(struct Plus_head *, int);
+void dig_line_add_updated(struct Plus_head *, int, off_t);
 void dig_node_reset_updated(struct Plus_head *);
 void dig_node_add_updated(struct Plus_head *, int);
 

Modified: grass/trunk/lib/vector/Vlib/build.c
===================================================================
--- grass/trunk/lib/vector/Vlib/build.c	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/lib/vector/Vlib/build.c	2014-11-28 20:01:16 UTC (rev 63265)
@@ -535,18 +535,12 @@
 		G_debug(3, "\tfirst centroid -> attach to area");
 		Area->centroid = centr;
 		topo->area = sel_area;
-
-		if (sel_area != orig_area && plus->uplist.do_uplist)
-                  dig_line_add_updated(plus, centr);
 	    }
 	    else if (Area->centroid != centr) {	/* duplicate centroid */
 		/* Note: it cannot happen that Area->centroid == centr, because the centroid
 		 * was not registered or a duplicate */
 		G_debug(3, "\tduplicate centroid -> do not attach to area");
 		topo->area = -sel_area;
-
-		if (-sel_area != orig_area && plus->uplist.do_uplist)
-                  dig_line_add_updated(plus, centr);
 	    }
 	}
     }
@@ -864,7 +858,7 @@
     plus->with_z = Map->head.with_z;
     plus->spidx_with_z = Map->head.with_z;
 
-    if (build == GV_BUILD_ALL) {
+    if (build == GV_BUILD_ALL && plus->built < GV_BUILD_ALL) {
 	dig_cidx_free(plus);	/* free old (if any) category index */
 	dig_cidx_init(plus);
     }

Modified: grass/trunk/lib/vector/Vlib/open_pg.c
===================================================================
--- grass/trunk/lib/vector/Vlib/open_pg.c	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/lib/vector/Vlib/open_pg.c	2014-11-28 20:01:16 UTC (rev 63265)
@@ -955,8 +955,7 @@
     
     if (plus->uplist.do_uplist) {
         /* collect updated lines if requested */
-        dig_line_add_updated(plus, n);
-        plus->uplist.uplines_offset[plus->uplist.n_uplines - 1] = line->offset;
+        dig_line_add_updated(plus, n, line->offset);
     }
     
     plus->Line[n] = line;

Modified: grass/trunk/lib/vector/diglib/plus_area.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_area.c	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/lib/vector/diglib/plus_area.c	2014-11-28 20:01:16 UTC (rev 63265)
@@ -210,8 +210,6 @@
 	Area->lines[i] = line;
 	Line = plus->Line[abs(line)];
 	topo = (struct P_topo_b *)Line->topo;
-	if (plus->uplist.do_uplist)
-	    dig_line_add_updated(plus, abs(line));
 	if (line < 0) {		/* revers direction -> area on left */
 	    if (topo->left != 0) {
 		G_warning(_("Line %d already has area/isle %d to left"), line,
@@ -380,8 +378,6 @@
 	line = Area->lines[i];	/* >0 = clockwise -> right, <0 = counterclockwise ->left */
 	Line = plus->Line[abs(line)];
 	btopo = (struct P_topo_b *)Line->topo;
-	if (plus->uplist.do_uplist)
-	    dig_line_add_updated(plus, abs(line));
 	if (line > 0) {
 	    G_debug(3, "  Set line %d right side to 0", line);
 	    btopo->right = 0;
@@ -415,8 +411,6 @@
 	else {
 	    ctopo = (struct P_topo_c *)Line->topo;
 	    ctopo->area = 0;
-	    if (plus->uplist.do_uplist)
-		dig_line_add_updated(plus, line);
 	}
     }
 
@@ -712,8 +706,6 @@
 	Isle->lines[i] = line;
 	Line = plus->Line[abs(line)];
 	topo = (struct P_topo_b *)Line->topo;
-	if (plus->uplist.do_uplist)
-	    dig_line_add_updated(plus, abs(line));
 	if (line < 0) {		/* revers direction -> isle on left */
 	    if (topo->left != 0) {
 		G_warning(_("Line %d already has area/isle %d to left"), line,
@@ -772,8 +764,6 @@
 	line = Isle->lines[i];	/* >0 = clockwise -> right, <0 = counterclockwise ->left */
 	Line = plus->Line[abs(line)];
 	topo = (struct P_topo_b *)Line->topo;
-	if (plus->uplist.do_uplist)
-	    dig_line_add_updated(plus, abs(line));
 	if (line > 0)
 	    topo->right = 0;
 	else

Modified: grass/trunk/lib/vector/diglib/plus_line.c
===================================================================
--- grass/trunk/lib/vector/diglib/plus_line.c	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/lib/vector/diglib/plus_line.c	2014-11-28 20:01:16 UTC (rev 63265)
@@ -32,8 +32,7 @@
 
     dig_spidx_add_line(plus, lineid, box);
     if (plus->uplist.do_uplist) {
-	dig_line_add_updated(plus, lineid);
-	plus->uplist.uplines_offset[plus->uplist.n_uplines - 1] = line->offset;
+	dig_line_add_updated(plus, lineid, offset);
     }
     
     if (type & GV_POINT) {
@@ -229,8 +228,7 @@
     dig_spidx_del_line(plus, line, x, y, z);
 
     if (plus->uplist.do_uplist) {
-	dig_line_add_updated(plus, line);
-	plus->uplist.uplines_offset[plus->uplist.n_uplines - 1] = -1 * Line->offset;
+	dig_line_add_updated(plus, line, -Line->offset);
     }
     
     if (!(Line->type & GV_LINES)) {

Modified: grass/trunk/lib/vector/diglib/update.c
===================================================================
--- grass/trunk/lib/vector/diglib/update.c	2014-11-28 16:41:16 UTC (rev 63264)
+++ grass/trunk/lib/vector/diglib/update.c	2014-11-28 20:01:16 UTC (rev 63265)
@@ -34,7 +34,7 @@
    \param line line id
    \param offset line offset (negative offset is ignored)
  */
-void dig_line_add_updated(struct Plus_head *Plus, int line)
+void dig_line_add_updated(struct Plus_head *Plus, int line, off_t offset)
 {
     int i;
     
@@ -43,6 +43,7 @@
     /* Check if already in list */
     for (i = 0; i < Plus->uplist.n_uplines; i++) {
 	if (Plus->uplist.uplines[i] == line) {
+	    Plus->uplist.uplines_offset[i] = offset;
             G_debug(3, "\tskipped");
 	    return;
         }
@@ -60,6 +61,7 @@
     }
 
     Plus->uplist.uplines[Plus->uplist.n_uplines] = line;
+    Plus->uplist.uplines_offset[Plus->uplist.n_uplines] = offset;
     Plus->uplist.n_uplines++;
 }
 



More information about the grass-commit mailing list