Sfoglia il codice sorgente

remove redundant code in vector lib: update display modules

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@46960 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 14 anni fa
parent
commit
3432fef61a
2 ha cambiato i file con 11 aggiunte e 10 eliminazioni
  1. 10 10
      display/d.extract/extract.c
  2. 1 0
      display/d.vect/main.c

+ 10 - 10
display/d.extract/extract.c

@@ -15,7 +15,7 @@
 #define M_DEL   3
 #define M_END   4
 
-int display(struct Map_info *Map, struct ilist *List,
+int display(struct Map_info *Map, struct boxlist *List,
 	    const struct color_rgb *color);
 
 int extract(struct Map_info *In, struct Map_info *Out, int type,
@@ -24,7 +24,7 @@ int extract(struct Map_info *In, struct Map_info *Out, int type,
     int i, button, mode, line;
     int screen_x, screen_y, cur_screen_x, cur_screen_y;
     double x1, y1, x2, y2;
-    struct ilist *List, *CList;
+    struct boxlist *List, *CList;
     struct bound_box box;
     struct line_pnts *Points;
     struct line_cats *Cats;
@@ -32,8 +32,8 @@ int extract(struct Map_info *In, struct Map_info *Out, int type,
     Points = Vect_new_line_struct();
     Cats = Vect_new_cats_struct();
 
-    List = Vect_new_list();
-    CList = Vect_new_list();
+    List = Vect_new_boxlist(0);
+    CList = Vect_new_boxlist(0);
 
     /* box.T = PORT_DOUBLE_MAX;
        box.B = -PORT_DOUBLE_MAX; */
@@ -88,7 +88,7 @@ int extract(struct Map_info *In, struct Map_info *Out, int type,
 	    }
 	    else if (mode == M_ADD) {
 		Vect_select_lines_by_box(In, &box, type, CList);
-		Vect_list_append_list(List, CList);
+		Vect_boxlist_append_boxlist(List, CList);
 		display(In, List, hcolor);
 		mode = M_START;
 	    }
@@ -99,7 +99,7 @@ int extract(struct Map_info *In, struct Map_info *Out, int type,
 	    }
 	    else if (mode == M_DEL) {
 		Vect_select_lines_by_box(In, &box, type, CList);
-		Vect_list_delete_list(List, CList);
+		Vect_boxlist_delete_boxlist(List, CList);
 		display(In, CList, color);
 		mode = M_START;
 	    }
@@ -117,14 +117,14 @@ int extract(struct Map_info *In, struct Map_info *Out, int type,
 	}
     };
 
-    Vect_destroy_list(List);
-    Vect_destroy_list(CList);
+    Vect_destroy_boxlist(List);
+    Vect_destroy_boxlist(CList);
 
     return 1;
 }
 
 int
-display(struct Map_info *Map, struct ilist *List,
+display(struct Map_info *Map, struct boxlist *List,
 	const struct color_rgb *color)
 {
     int i, j, line, type;
@@ -138,7 +138,7 @@ display(struct Map_info *Map, struct ilist *List,
     D_RGB_color(color->r, color->g, color->b);
 
     for (i = 0; i < List->n_values; i++) {
-	line = abs(List->value[i]);
+	line = abs(List->id[i]);
 	type = Vect_read_line(Map, Points, NULL, line);
 
 	if (type & GV_POINTS)

+ 1 - 0
display/d.vect/main.c

@@ -596,6 +596,7 @@ int main(int argc, char **argv)
     }
 
     D_setup(0);
+    D_set_reduction(1.0);
 
     G_verbose_message(_("Plotting..."));