21 #include <grass/gis.h>
22 #include <grass/Vect.h>
36 if (x >= Box->W && x <= Box->E &&
37 y >= Box->S && y <= Box->
N && z >= Box->B && z <= Box->T) {
56 if (A->E < B->W || A->W > B->E ||
57 A->N < B->S || A->S > B->N || A->T < B->B || A->B > B->T) {
146 *y = *y + (Box->W - *x) / (*c_x - *x) * (*c_y - *
y);
152 *y = *y + (Box->E - *x) / (*c_x - *x) * (*c_y - *
y);
158 *c_y = *c_y + (Box->W - *c_x) / (*x - *c_x) * (*y - *c_y);
164 *c_y = *c_y + (Box->E - *c_x) / (*x - *c_x) * (*y - *c_y);
170 *x = *x + (Box->S - *
y) / (*c_y - *y) * (*c_x - *x);
176 *x = *x + (Box->N - *
y) / (*c_y - *y) * (*c_x - *x);
182 *c_x = *c_x + (Box->S - *c_y) / (*y - *c_y) * (*x - *c_x);
188 *c_x = *c_x + (Box->N - *c_y) / (*y - *c_y) * (*x - *c_x);
210 struct Plus_head *Plus;
214 Line = Plus->Line[line];
249 struct Plus_head *Plus;
253 Area = Plus->Area[area];
288 struct Plus_head *Plus;
292 Isle = Plus->Isle[isle];
325 struct Plus_head *Plus;
329 Box->N = Plus->box.N;
330 Box->S = Plus->box.S;
331 Box->E = Plus->box.E;
332 Box->W = Plus->box.W;
333 Box->T = Plus->box.T;
334 Box->B = Plus->box.B;
351 Box->N = Window->north;
352 Box->S = Window->south;
353 Box->E = Window->east;
354 Box->W = Window->west;
355 Box->T = PORT_DOUBLE_MAX;
356 Box->B = -PORT_DOUBLE_MAX;
int Vect_point_in_box(double x, double y, double z, BOUND_BOX *Box)
Tests for point in box.
float Box[8][3]
Vertices for box.
int Vect_box_overlap(BOUND_BOX *A, BOUND_BOX *B)
Tests for overlap of two boxes.
int Vect_get_area_box(struct Map_info *Map, int area, BOUND_BOX *Box)
Get boundary box of area.
int Vect_region_box(struct Cell_head *Window, BOUND_BOX *Box)
Copy region Window to Box.
int Vect_box_clip(double *x, double *y, double *c_x, double *c_y, BOUND_BOX *Box)
Clip coordinates to box, if necessary, lines extending outside of a box.
int Vect_box_extend(BOUND_BOX *A, BOUND_BOX *B)
Extend box A by box B.
int Vect_box_copy(BOUND_BOX *A, BOUND_BOX *B)
Copy box B to box A.
int Vect_get_map_box(struct Map_info *Map, BOUND_BOX *Box)
Get boundary box of map.
int Vect_get_isle_box(struct Map_info *Map, int isle, BOUND_BOX *Box)
Get boundary box of isle.
int Vect_get_line_box(struct Map_info *Map, int line, BOUND_BOX *Box)
Get boundary box of line.