فهرست منبع

vlib: fix accidently committed changes https://trac.osgeo.org/grass/changeset/32381 -- change Vect_break_lines_list()

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32384 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 17 سال پیش
والد
کامیت
cd35aeb53d
4فایلهای تغییر یافته به همراه11 افزوده شده و 5 حذف شده
  1. 3 3
      include/Vect.h
  2. 6 1
      lib/vector/Vlib/break_lines.c
  3. 1 0
      lib/vector/vectorlib.dox
  4. 1 1
      vector/v.edit/main.c

+ 3 - 3
include/Vect.h

@@ -270,7 +270,7 @@ int Vect_point_in_island ( double, double, struct Map_info *, int);
 
     /* Cleaning */
 void Vect_break_lines ( struct Map_info *, int, struct Map_info *, FILE * );
-int Vect_break_lines_list (struct Map_info *, struct ilist *, int, struct Map_info *, FILE *);
+int Vect_break_lines_list (struct Map_info *, struct ilist *, struct ilist *, int, struct Map_info *, FILE *);
 void Vect_break_polygons ( struct Map_info *, int, struct Map_info *, FILE * );
 void Vect_remove_duplicates ( struct Map_info *, int, struct Map_info *, FILE * );
 int Vect_line_check_duplicate ( const struct line_pnts *,
@@ -283,8 +283,8 @@ void Vect_select_dangles (struct Map_info *, int, double, FILE *, struct ilist *
 void Vect_remove_bridges ( struct Map_info *, struct Map_info *, FILE * );
 void Vect_chtype_bridges ( struct Map_info *, struct Map_info *, FILE * );
 int Vect_remove_small_areas ( struct Map_info *, double, struct Map_info *, FILE *, double * );
-int Vect_clean_small_angles_at_nodes ( struct Map_info *Map, int type, struct Map_info *Err, 
-	                               FILE *msgout);
+int Vect_clean_small_angles_at_nodes ( struct Map_info *, int, struct Map_info *, 
+	                               FILE *);
 
     /* Overlay */
 int Vect_overlay_str_to_operator ( const char * );

+ 6 - 1
lib/vector/Vlib/break_lines.c

@@ -51,6 +51,9 @@ Vect_break_lines ( struct Map_info *Map, int type, struct Map_info *Err, FILE *m
   The function also breaks lines forming collapsed loop, for example
   0,0;1,0;0,0 is broken at 1,0.
   
+  If reference lines are given (<i>List_ref</i>) break only lines
+  which intersect reference lines.
+
   \param Map input vector map 
   \param List_break list of lines (NULL for all lines in vector map)
   \param List_ref list of reference lines or NULL
@@ -247,7 +250,9 @@ Vect_break_lines_list ( struct Map_info *Map, struct ilist *List_break, struct i
 		    Vect_line_prune ( AXLines[k] );
 		    if ( (atype & GV_POINTS) || AXLines[k]->n_points > 1 ) {
 			ret = Vect_write_line ( Map, atype, AXLines[k], ACats );  
-			Vect_list_append(List_ref, ret);
+			if (List_ref) {
+			    Vect_list_append(List_ref, ret);
+			}
 			G_debug (3, "Line %d written, npoints = %d", ret, AXLines[k]->n_points);
 			if (List_break) {
 			    Vect_list_append(List_break, ret);

+ 1 - 0
lib/vector/vectorlib.dox

@@ -947,6 +947,7 @@ Vect_region_box();
 
 Vect_break_lines();
 
+Vect_break_lines_list();
 
 \section break_polygons Vector break_polygons functions
 

+ 1 - 1
vector/v.edit/main.c

@@ -303,7 +303,7 @@ int main (int argc, char *argv[])
 				    coord, thresh[THRESH_COORDS], NULL);
 	}
 	else {
-	    ret = Vect_break_lines_list(&Map, List,
+	    ret = Vect_break_lines_list(&Map, List, NULL,
 					GV_LINES, NULL, NULL);
 	}
 	G_message(_("%d lines broken"), ret);