[GRASS-SVN] r46941 - grass/trunk/lib/vector/diglib

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 3 13:57:57 EDT 2011


Author: mmetz
Date: 2011-07-03 10:57:56 -0700 (Sun, 03 Jul 2011)
New Revision: 46941

Modified:
   grass/trunk/lib/vector/diglib/spindex.c
   grass/trunk/lib/vector/diglib/spindex_rw.c
Log:
changed RTree struct names: update diglib

Modified: grass/trunk/lib/vector/diglib/spindex.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex.c	2011-07-03 17:57:32 UTC (rev 46940)
+++ grass/trunk/lib/vector/diglib/spindex.c	2011-07-03 17:57:56 UTC (rev 46941)
@@ -253,7 +253,7 @@
 dig_spidx_add_node(struct Plus_head *Plus, int node,
 		   double x, double y, double z)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_add_node(): node = %d, x,y,z = %f, %f, %f", node, x,
 	    y, z);
@@ -280,7 +280,7 @@
  */
 int dig_spidx_add_line(struct Plus_head *Plus, int line, struct bound_box * box)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_add_line(): line = %d", line);
 
@@ -306,7 +306,7 @@
  */
 int dig_spidx_add_area(struct Plus_head *Plus, int area, struct bound_box * box)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_add_area(): area = %d", area);
 
@@ -333,7 +333,7 @@
 
 int dig_spidx_add_isle(struct Plus_head *Plus, int isle, struct bound_box * box)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_add_isle(): isle = %d", isle);
 
@@ -362,7 +362,7 @@
 {
     int ret;
     struct P_node *Node;
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_del_node(): node = %d", node);
 
@@ -396,7 +396,7 @@
 int dig_spidx_del_line(struct Plus_head *Plus, int line, double x, double y, double z)
 {
     struct P_line *Line;
-    struct Rect rect;
+    struct RTree_Rect rect;
     int ret;
 
     G_debug(3, "dig_spidx_del_line(): line = %d", line);
@@ -434,10 +434,10 @@
 {
     int ret;
     struct P_area *Area;
-    struct Rect rect;
     struct P_line *Line;
     struct P_node *Node;
     struct P_topo_b *topo;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_del_area(): area = %d", area);
 
@@ -480,10 +480,10 @@
 {
     int ret;
     struct P_isle *Isle;
-    struct Rect rect;
     struct P_line *Line;
     struct P_node *Node;
     struct P_topo_b *topo;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_spidx_del_isle(): isle = %d", isle);
 
@@ -509,7 +509,7 @@
 }
 
 /* This function is called by RTreeSearch() to add selected node/line/area/isle 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;
@@ -517,7 +517,7 @@
 
 /* This function is called by RTreeSearch() to add 
  * selected node/line/area/isle to the box list */
-static int _add_item_with_box(int id, struct Rect rect, struct boxlist *list)
+static int _add_item_with_box(int id, struct RTree_Rect rect, struct boxlist *list)
 {
     struct bound_box box;
     
@@ -534,7 +534,7 @@
 
 /* This function is called by RTreeSearch() to add 
  * selected node/line/area/isle to the box list */
-static int _set_item_box(int id, struct Rect rect, struct boxlist *list)
+static int _set_item_box(int id, struct RTree_Rect rect, struct boxlist *list)
 {
     if (id == list->id[0]) {
 	
@@ -565,7 +565,7 @@
 dig_select_nodes(struct Plus_head *Plus, const struct bound_box * box,
 		 struct ilist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_nodes()");
 
@@ -587,7 +587,7 @@
 }
 
 /* This function is called by RTreeSearch() for nodes to find the node id */
-static int _add_node(int id, struct Rect rect, int *node)
+static int _add_node(int id, struct RTree_Rect rect, int *node)
 {
     *node = id;
     return 0;
@@ -604,14 +604,11 @@
  */
 int dig_find_node(struct Plus_head *Plus, double x, double y, double z)
 {
-    struct Rect rect;
-    struct ilist list;
+    struct RTree_Rect rect;
     int node;
 
     G_debug(3, "dig_find_node()");
 
-    dig_init_list(&list);
-
     rect.boundary[0] = x;
     rect.boundary[1] = y;
     rect.boundary[2] = z;
@@ -641,7 +638,7 @@
 dig_select_lines(struct Plus_head *Plus, const struct bound_box * box,
 		 struct ilist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_lines()");
 
@@ -675,7 +672,7 @@
 int dig_select_lines_with_box(struct Plus_head *Plus, const struct bound_box *box,
 		      struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_lines_with_box()");
 
@@ -707,7 +704,7 @@
  */
 int dig_find_line_box(const struct Plus_head *Plus, struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
     int ret;
 
     G_debug(3, "dig_find_line_box()");
@@ -743,7 +740,7 @@
 dig_select_areas(struct Plus_head *Plus, const struct bound_box * box,
 		 struct ilist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_areas()");
 
@@ -777,7 +774,7 @@
 dig_select_areas_with_box(struct Plus_head *Plus, const struct bound_box * box,
 		 struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_areas_with_box()");
 
@@ -809,7 +806,7 @@
  */
 int dig_find_area_box(const struct Plus_head *Plus, struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
     int ret;
 
     G_debug(3, "dig_find_line_box()");
@@ -845,7 +842,7 @@
 dig_select_isles(struct Plus_head *Plus, const struct bound_box * box,
 		 struct ilist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_isles()");
 
@@ -879,7 +876,7 @@
 dig_select_isles_with_box(struct Plus_head *Plus, const struct bound_box * box,
 		 struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
 
     G_debug(3, "dig_select_areas_with_box()");
 
@@ -911,7 +908,7 @@
  */
 int dig_find_isle_box(const struct Plus_head *Plus, struct boxlist *list)
 {
-    struct Rect rect;
+    struct RTree_Rect rect;
     int ret;
 
     G_debug(3, "dig_find_line_box()");

Modified: grass/trunk/lib/vector/diglib/spindex_rw.c
===================================================================
--- grass/trunk/lib/vector/diglib/spindex_rw.c	2011-07-03 17:57:32 UTC (rev 46940)
+++ grass/trunk/lib/vector/diglib/spindex_rw.c	2011-07-03 17:57:56 UTC (rev 46941)
@@ -477,7 +477,7 @@
     return (0);
 }
 
-static int rtree_dump_node(FILE *, struct Node *n, int);
+static int rtree_dump_node(FILE *, struct RTree_Node *n, int);
 
 /*!
    \brief Dump R-tree branch to the file
@@ -489,10 +489,10 @@
 
    \return 0
  */
-static int rtree_dump_branch(FILE * fp, struct Branch *b, int with_z,
+static int rtree_dump_branch(FILE * fp, struct RTree_Branch *b, int with_z,
 			     int level)
 {
-    const struct Rect *r;
+    const struct RTree_Rect *r;
 
     r = &(b->rect);
 
@@ -517,7 +517,7 @@
 
    \return 0
  */
-int rtree_dump_node(FILE * fp, struct Node *n, int with_z)
+int rtree_dump_node(FILE * fp, struct RTree_Node *n, int with_z)
 {
     int i;
 
@@ -558,10 +558,10 @@
 
    \return 0
  */
-static int rtree_dump_branch_file(FILE * fp, struct Branch *b, int with_z,
+static int rtree_dump_branch_file(FILE * fp, struct RTree_Branch *b, int with_z,
 			     int level, struct RTree *t)
 {
-    const struct Rect *r;
+    const struct RTree_Rect *r;
 
     r = &(b->rect);
 
@@ -590,7 +590,7 @@
 int rtree_dump_node_file(FILE * fp, off_t pos, int with_z, struct RTree *t)
 {
     int i;
-    struct Node n;
+    struct RTree_Node n;
 
     /* recursive nearly-but-a-bit-messy depth-first pre-order traversal
      * potentially filling up memory */
@@ -658,12 +658,12 @@
 {
     off_t nextfreepos = startpos;
     int sidx_nodesize, sidx_leafsize;
-    struct Node *n;
+    struct RTree_Node *n;
     int i, j, writeout, maxcard;
     struct spidxstack
     {
 	off_t pos[MAXCARD];	/* file position of child node, object ID on level 0 */
-	struct Node *sn;	/* stack node */
+	struct RTree_Node *sn;	/* stack node */
 	int branch_id;		/* branch no to follow down */
     } s[50];
     int top = 0;
@@ -763,12 +763,12 @@
 {
     off_t nextfreepos = startpos;
     int sidx_nodesize, sidx_leafsize;
-    struct Node *n;
+    struct RTree_Node *n;
     int i, j, writeout, maxcard;
     struct spidxstack
     {
 	off_t pos[MAXCARD];	/* file position of child node, object ID on level 0 */
-	struct Node sn;		/* stack node */
+	struct RTree_Node sn;	/* stack node */
 	int branch_id;		/* branch no to follow down */
     } s[MAXLEVEL];
     int top = 0;
@@ -877,12 +877,12 @@
 static void rtree_load_to_memory(struct gvfile *fp, off_t rootpos,
 				  struct RTree *t, int off_t_size)
 {
-    struct Node *newnode = NULL;
+    struct RTree_Node *newnode = NULL;
     int i, j, loadnode, maxcard;
     struct spidxstack
     {
 	off_t pos[MAXCARD];	/* file position of child node, object ID on level 0 */
-	struct Node sn;		/* stack node */
+	struct RTree_Node sn;	/* stack node */
 	int branch_id;		/* branch no to follow down */
     } s[50], *last;
     int top = 0;
@@ -1002,13 +1002,13 @@
 static void rtree_load_to_file(struct gvfile *fp, off_t rootpos,
 				  struct RTree *t, int off_t_size)
 {
-    struct Node newnode;
+    struct RTree_Node newnode;
     off_t newnode_pos = -1;
     int i, j, loadnode, maxcard;
     struct spidxstack
     {
 	off_t pos[MAXCARD];	/* file position of child node, object ID on level 0 */
-	struct Node sn;		/* stack node */
+	struct RTree_Node sn;	/* stack node */
 	int branch_id;		/* branch no to follow down */
     } s[MAXLEVEL], *last;
     int top = 0;
@@ -1279,7 +1279,7 @@
 
    \return number of qualifying rectangles
  */
-int rtree_search(struct RTree *t, struct Rect *r, SearchHitCallback shcb,
+int rtree_search(struct RTree *t, struct RTree_Rect *r, SearchHitCallback shcb,
 		 void *cbarg, struct Plus_head *Plus)
 {
     int hitCount = 0, found, maxcard;
@@ -1287,7 +1287,7 @@
     struct spidxstack
     {
 	off_t pos[MAXCARD];	/* file position of child node, object ID on level 0 */
-	struct Node sn;	        /* stack node */
+	struct RTree_Node sn;	        /* stack node */
 	int branch_id;		/* branch no to follow down */
     } s[50], *last;
     int top = 0;



More information about the grass-commit mailing list