[GRASS-SVN] r52308 - grass/trunk/vector/v.delaunay

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jul 5 06:19:49 PDT 2012


Author: martinl
Date: 2012-07-05 06:19:49 -0700 (Thu, 05 Jul 2012)
New Revision: 52308

Modified:
   grass/trunk/vector/v.delaunay/in_out.c
   grass/trunk/vector/v.delaunay/in_out.h
   grass/trunk/vector/v.delaunay/main.c
Log:
v.delaunay: fix output_edges/triangles() prototypes (pass pointer to output map)


Modified: grass/trunk/vector/v.delaunay/in_out.c
===================================================================
--- grass/trunk/vector/v.delaunay/in_out.c	2012-07-05 11:26:21 UTC (rev 52307)
+++ grass/trunk/vector/v.delaunay/in_out.c	2012-07-05 13:19:49 UTC (rev 52308)
@@ -74,8 +74,8 @@
     return 0;
 }
 
-void output_edges(unsigned int n, int mode3d, int Type,
-		  struct Map_info map_out)
+void output_edges(unsigned int n, int mode3d, int type,
+		  struct Map_info *Out)
 {
     struct edge *e_start, *e;
     struct vertex *u, *v;
@@ -109,7 +109,7 @@
 
 		Vect_append_point(Points, x1, y1, z1);
 		Vect_append_point(Points, x2, y2, z2);
-		Vect_write_line(&map_out, Type, Points, Cats);
+		Vect_write_line(Out, type, Points, Cats);
 	    }
 	    e = NEXT(e, u);
 	} while (!SAME_EDGE(e, e_start));
@@ -120,7 +120,7 @@
 /* Print the ring of triangles about each vertex. */
 
 void output_triangles(unsigned int n,
-		      int mode3d, int Type, struct Map_info map_out)
+		      int mode3d, int type, struct Map_info *Out)
 {
     struct edge *e_start, *e, *next;
     struct vertex *u, *v, *w;
@@ -161,17 +161,17 @@
 			Vect_reset_line(Points);
 			Vect_append_point(Points, x1, y1, z1);
 			Vect_append_point(Points, x2, y2, z2);
-			Vect_write_line(&map_out, Type, Points, Cats);
+			Vect_write_line(Out, type, Points, Cats);
 
 			Vect_reset_line(Points);
 			Vect_append_point(Points, x2, y2, z2);
 			Vect_append_point(Points, x3, y3, z3);
-			Vect_write_line(&map_out, Type, Points, Cats);
+			Vect_write_line(Out, type, Points, Cats);
 
 			Vect_reset_line(Points);
 			Vect_append_point(Points, x3, y3, z3);
 			Vect_append_point(Points, x1, y1, z1);
-			Vect_write_line(&map_out, Type, Points, Cats);
+			Vect_write_line(Out, type, Points, Cats);
 		    }
 	    }
 	    /* Next edge around u. */
@@ -200,7 +200,7 @@
 int read_sites(int mode3d, int complete_map, struct Map_info* map_in,
 	       struct bound_box Box, int field)
 {
-    int nlines, line, allocated, nsites;
+    int nlines, line, nsites;
     struct line_pnts *Points;
     struct line_cats *Cats;
     
@@ -209,8 +209,7 @@
 
     nlines = Vect_get_num_lines(map_in);
     alloc_sites(nlines);
-    allocated = nlines;
-
+    
     nsites = 0;
     G_message(_("Reading point features..."));
     for (line = 1; line <= nlines; line++) {

Modified: grass/trunk/vector/v.delaunay/in_out.h
===================================================================
--- grass/trunk/vector/v.delaunay/in_out.h	2012-07-05 11:26:21 UTC (rev 52307)
+++ grass/trunk/vector/v.delaunay/in_out.h	2012-07-05 13:19:49 UTC (rev 52308)
@@ -4,9 +4,9 @@
 int read_sites(int mode3d, int complete_map, struct Map_info* map_in,
 	       struct bound_box Box, int);
 void output_edges(unsigned int n, int mode3d, int Type,
-                  struct Map_info map_out);
+                  struct Map_info *map_out);
 void output_triangles(unsigned int n, int mode3d, int Type,
-                      struct Map_info map_out);
+                      struct Map_info *map_out);
 void remove_duplicates(unsigned int *size);
 int cmp(const void *a, const void *b);
 #endif

Modified: grass/trunk/vector/v.delaunay/main.c
===================================================================
--- grass/trunk/vector/v.delaunay/main.c	2012-07-05 11:26:21 UTC (rev 52307)
+++ grass/trunk/vector/v.delaunay/main.c	2012-07-05 13:19:49 UTC (rev 52308)
@@ -149,7 +149,7 @@
     G_verbose_message(_("Delaunay triangulation..."));
     divide(0, n - 1, &l_cw, &r_ccw);
 
-    output_edges(n, mode3d, Type, Out);
+    output_edges(n, mode3d, Type, &Out);
 
     free_memory();
 



More information about the grass-commit mailing list