|
@@ -6,13 +6,13 @@
|
|
|
|
|
|
#include "proto.h"
|
|
#include "proto.h"
|
|
|
|
|
|
-int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
|
|
- struct Map_info *bIn, int btype, int bfield,
|
|
|
|
- int cat_flag, int operator, const char *relate,
|
|
|
|
- int *ALines)
|
|
|
|
|
|
+void select_lines(struct Map_info *aIn, int atype, int afield,
|
|
|
|
+ struct Map_info *bIn, int btype, int bfield,
|
|
|
|
+ int cat_flag, int operator, const char *relate,
|
|
|
|
+ int *ALines, int* nskipped)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
- int nalines, aline, nskipped, ltype;
|
|
|
|
|
|
+ int nalines, aline, ltype;
|
|
|
|
|
|
struct line_pnts *APoints, *BPoints;
|
|
struct line_pnts *APoints, *BPoints;
|
|
struct ilist *BoundList, *LList;
|
|
struct ilist *BoundList, *LList;
|
|
@@ -25,7 +25,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
void *AGeom = NULL;
|
|
void *AGeom = NULL;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
- nskipped = 0;
|
|
|
|
|
|
+ nskipped[0] = nskipped[1] = 0;
|
|
APoints = Vect_new_line_struct();
|
|
APoints = Vect_new_line_struct();
|
|
BPoints = Vect_new_line_struct();
|
|
BPoints = Vect_new_line_struct();
|
|
List = Vect_new_boxlist(1);
|
|
List = Vect_new_boxlist(1);
|
|
@@ -48,7 +48,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
|
|
|
|
/* Check category */
|
|
/* Check category */
|
|
if (!cat_flag && Vect_get_line_cat(aIn, aline, afield) < 0) {
|
|
if (!cat_flag && Vect_get_line_cat(aIn, aline, afield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[0]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -89,7 +89,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
/* Check category */
|
|
/* Check category */
|
|
if (!cat_flag &&
|
|
if (!cat_flag &&
|
|
Vect_get_line_cat(bIn, bline, bfield) < 0) {
|
|
Vect_get_line_cat(bIn, bline, bfield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[1]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -130,7 +130,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
G_debug(3, " barea = %d", barea);
|
|
G_debug(3, " barea = %d", barea);
|
|
|
|
|
|
if (Vect_get_area_cat(bIn, barea, bfield) < 0) {
|
|
if (Vect_get_area_cat(bIn, barea, bfield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[1]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -175,7 +175,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
G_percent(aarea, naareas, 1);
|
|
G_percent(aarea, naareas, 1);
|
|
|
|
|
|
if (Vect_get_area_cat(aIn, aarea, afield) < 0) {
|
|
if (Vect_get_area_cat(aIn, aarea, afield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[0]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -203,7 +203,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
|
|
|
|
if (!cat_flag &&
|
|
if (!cat_flag &&
|
|
Vect_get_line_cat(bIn, bline, bfield) < 0) {
|
|
Vect_get_line_cat(bIn, bline, bfield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[1]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -270,7 +270,7 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
G_debug(3, " barea = %d", barea);
|
|
G_debug(3, " barea = %d", barea);
|
|
|
|
|
|
if (Vect_get_area_cat(bIn, barea, bfield) < 0) {
|
|
if (Vect_get_area_cat(bIn, barea, bfield) < 0) {
|
|
- nskipped++;
|
|
|
|
|
|
+ nskipped[1]++;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -331,5 +331,5 @@ int select_lines(struct Map_info *aIn, int atype, int afield,
|
|
Vect_destroy_boxlist(List);
|
|
Vect_destroy_boxlist(List);
|
|
Vect_destroy_boxlist(TmpList);
|
|
Vect_destroy_boxlist(TmpList);
|
|
|
|
|
|
- return nskipped;
|
|
|
|
|
|
+ return;
|
|
}
|
|
}
|