[GRASS-SVN] r47018 - grass/trunk/vector/v.select

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 6 08:09:04 EDT 2011


Author: mmetz
Date: 2011-07-06 05:09:04 -0700 (Wed, 06 Jul 2011)
New Revision: 47018

Modified:
   grass/trunk/vector/v.select/main.c
   grass/trunk/vector/v.select/overlap.c
   grass/trunk/vector/v.select/proto.h
Log:
sync Vect_point_in_area() to the other Vect_point_in_*() functions: update v.select

Modified: grass/trunk/vector/v.select/main.c
===================================================================
--- grass/trunk/vector/v.select/main.c	2011-07-06 12:08:46 UTC (rev 47017)
+++ grass/trunk/vector/v.select/main.c	2011-07-06 12:09:04 UTC (rev 47018)
@@ -111,7 +111,7 @@
     ACats = Vect_new_cats_struct();
     BCats = Vect_new_cats_struct();
     List = Vect_new_boxlist(0);
-    TmpList = Vect_new_boxlist(0);
+    TmpList = Vect_new_boxlist(1);
     BoundList = Vect_new_list();
     LList = Vect_new_list();
 
@@ -247,7 +247,7 @@
 #endif
 		    }
 		    else {
-			if (line_overlap_area(&(In[0]), aline, &(In[1]), barea)) {
+			if (line_overlap_area(&(In[0]), aline, &(In[1]), barea, List->box[i])) {
 			    ALines[aline] = 1;
 			    break;
 			}
@@ -318,7 +318,7 @@
 #endif
 		    }
 		    else {
-			if (line_overlap_area(&(In[1]), bline, &(In[0]), aarea)) {
+			if (line_overlap_area(&(In[1]), bline, &(In[0]), aarea, abox)) {
 			    add_aarea(&(In[0]), aarea, ALines);
 			    continue;
 			}
@@ -387,15 +387,15 @@
 #endif
 			}
 			else {
-			    if (Vect_point_in_area(&(In[0]), aarea,
-						   BPoints->x[0], BPoints->y[0])) {
+			    if (Vect_point_in_area(BPoints->x[0], BPoints->y[0], &(In[0]),
+			                           aarea, abox)) {
 				found = 1;
 				break;
 			    }
 			    
 			    /* Check intersectin of lines from List with area B */
 			    if (line_overlap_area(&(In[0]), aline,
-						  &(In[1]), barea)) {
+						  &(In[1]), barea, List->box[j])) {
 				found = 1;
 				break;
 			    }

Modified: grass/trunk/vector/v.select/overlap.c
===================================================================
--- grass/trunk/vector/v.select/overlap.c	2011-07-06 12:08:46 UTC (rev 47017)
+++ grass/trunk/vector/v.select/overlap.c	2011-07-06 12:09:04 UTC (rev 47018)
@@ -39,7 +39,7 @@
 /* Returns 1 if line1 from Map1 overlaps area2 from Map2,
  *         0 otherwise */
 int line_overlap_area(struct Map_info *LMap, int line, struct Map_info *AMap,
-		      int area)
+		      int area, struct bound_box box)
 {
     int i, nisles, isle;
     static struct line_pnts *LPoints = NULL;
@@ -57,7 +57,7 @@
 
     /* Try if any of line vertices is within area */
     for (i = 0; i < LPoints->n_points; i++) {
-	if (Vect_point_in_area(AMap, area, LPoints->x[i], LPoints->y[i])) {
+	if (Vect_point_in_area(LPoints->x[i], LPoints->y[i], AMap, area, box)) {
 	    G_debug(4, "  -> line vertex inside area");
 	    return 1;
 	}

Modified: grass/trunk/vector/v.select/proto.h
===================================================================
--- grass/trunk/vector/v.select/proto.h	2011-07-06 12:08:46 UTC (rev 47017)
+++ grass/trunk/vector/v.select/proto.h	2011-07-06 12:09:04 UTC (rev 47018)
@@ -33,6 +33,6 @@
 
 /* overlap.c */
 void add_aarea(struct Map_info *, int, int *);
-int line_overlap_area(struct Map_info *, int, struct Map_info *, int);
+int line_overlap_area(struct Map_info *, int, struct Map_info *, int, struct bound_box);
 
 #endif /* PROTO_H */



More information about the grass-commit mailing list