Prechádzať zdrojové kódy

changed RTree struct names: update Vlib

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46942 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 rokov pred
rodič
commit
5525c89b83

+ 2 - 2
lib/vector/Vlib/break_polygons.c

@@ -73,7 +73,7 @@ typedef struct
 static int fpoint;
 
 /* Function called from RTreeSearch for point found */
-void srch(int id, struct Rect rect, int *arg)
+void srch(int id, struct RTree_Rect rect, int *arg)
 {
     fpoint = id;
 }
@@ -114,7 +114,7 @@ Vect_break_polygons_file(struct Map_info *Map, int type, struct Map_info *Err)
     struct RTree *RTree;
     int apoints, npoints, nallpoints, nmarks;
     XPNT2 XPnt;
-    struct Rect rect;
+    struct RTree_Rect rect;
     double dx, dy, a1 = 0, a2 = 0;
     int closed, last_point;
     char cross;

+ 6 - 6
lib/vector/Vlib/intersect.c

@@ -81,8 +81,8 @@ static double dist2(double x1, double y1, double x2, double y2);
 #if 0
 static int ident(double x1, double y1, double x2, double y2, double thresh);
 #endif
-static int cross_seg(int id, struct Rect rect, int *arg);
-static int find_cross(int id, struct Rect rect, int *arg);
+static int cross_seg(int id, struct RTree_Rect rect, int *arg);
+static int find_cross(int id, struct RTree_Rect rect, int *arg);
 
 #define D  ((ax2-ax1)*(by1-by2) - (ay2-ay1)*(bx1-bx2))
 #define D1 ((bx1-ax1)*(by1-by2) - (by1-ay1)*(bx1-bx2))
@@ -540,7 +540,7 @@ static int ident(double x1, double y1, double x2, double y2, double thresh)
 static struct line_pnts *APnts, *BPnts;
 
 /* break segments (called by rtree search) */
-static int cross_seg(int id, struct Rect rect, int *arg)
+static int cross_seg(int id, struct RTree_Rect rect, int *arg)
 {
     double x1, y1, z1, x2, y2, z2;
     int i, j, ret;
@@ -606,9 +606,9 @@ Vect_line_intersection(struct line_pnts *APoints,
     int n_alive_cross;
     double dist, curdist, last_dist, last_x, last_y, last_z;
     double x, y, rethresh;
-    struct Rect rect;
     struct line_pnts **XLines, *Points;
     struct RTree *MyRTree;
+    struct RTree_Rect rect;
     struct line_pnts *Points1, *Points2;	/* first, second points */
     int seg1, seg2, vert1, vert2;
 
@@ -1070,7 +1070,7 @@ static struct line_pnts *APnts, *BPnts, *IPnts;
 static int cross_found;		/* set by find_cross() */
 
 /* break segments (called by rtree search) */
-static int find_cross(int id, struct Rect rect, int *arg)
+static int find_cross(int id, struct RTree_Rect rect, int *arg)
 {
     double x1, y1, z1, x2, y2, z2;
     int i, j, ret;
@@ -1133,7 +1133,7 @@ Vect_line_check_intersection(struct line_pnts *APoints,
 {
     int i;
     double dist, rethresh;
-    struct Rect rect;
+    struct RTree_Rect rect;
     struct RTree *MyRTree;
 
     rethresh = 0.000001;	/* TODO */

+ 4 - 4
lib/vector/Vlib/select.c

@@ -62,7 +62,7 @@ void Vect_spatial_index_destroy(struct spatial_index * si)
 void Vect_spatial_index_add_item(struct spatial_index * si, int id,
 				 const struct bound_box * box)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "Vect_spatial_index_add_item(): id = %d", id);
 
@@ -87,7 +87,7 @@ void Vect_spatial_index_del_item(struct spatial_index * si, int id,
 				 const struct bound_box * box)
 {
     int ret;
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "Vect_spatial_index_del_item(): id = %d", id);
 
@@ -106,7 +106,7 @@ void Vect_spatial_index_del_item(struct spatial_index * si, int id,
 
 /************************* SELECT BY BOX *********************************/
 /* This function is called by  RTreeSearch() to add selected item to the list */
-static int _add_item(int id, struct Rect rect, struct ilist *list)
+static int _add_item(int id, struct RTree_Rect rect, struct ilist *list)
 {
     dig_list_add(list, id);
     return 1;
@@ -125,7 +125,7 @@ int
 Vect_spatial_index_select(const struct spatial_index * si, const struct bound_box * box,
 			  struct ilist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "Vect_spatial_index_select()");
 

+ 2 - 2
lib/vector/Vlib/snap.c

@@ -41,7 +41,7 @@ typedef struct
 } NEW;
 
 /* This function is called by RTreeSearch() to add selected node/line/area/isle to the list */
-int add_item(int id, struct Rect rect, struct ilist *list)
+int add_item(int id, struct RTree_Rect rect, struct ilist *list)
 {
     dig_list_add(list, id);
     return 1;
@@ -95,6 +95,7 @@ Vect_snap_lines_list(struct Map_info *Map, const struct ilist *List_lines,
 
     struct RTree *RTree;
     int rtreefd = -1;
+    struct RTree_Rect rect;
     int point;			/* index in points array */
     int nanchors, ntosnap;	/* number of anchors and number of points to be snapped */
     int nsnapped, ncreated;	/* number of snapped verices, number of new vertices (on segments) */
@@ -102,7 +103,6 @@ Vect_snap_lines_list(struct Map_info *Map, const struct ilist *List_lines,
     XPNT *XPnts;		/* Array of points */
     NEW *New = NULL;		/* Array of new points */
     int anew = 0, nnew;		/* allocated new points , number of new points */
-    struct Rect rect;
     struct ilist *List;
     int *Index = NULL;		/* indexes of anchors for vertices */
     int aindex = 0;		/* allocated Index */