51 return (x >= Box->
W && x <= Box->E &&
52 y >= Box->
S && y <= Box->
N &&
53 z >= Box->
B && z <= Box->T);
71 return (x >= Box->
W && x <= Box->E &&
72 y >= Box->
S && y <= Box->
N);
87 if (A->
E < B->
W || A->
W > B->
E ||
88 A->
N < B->
S || A->
S > B->
N || A->
T < B->
B || A->
B > B->
T) {
175 *y = *y + (Box->
W - *
x) / (*c_x - *x) * (*c_y - *y);
181 *y = *y + (Box->
E - *
x) / (*c_x - *x) * (*c_y - *y);
187 *c_y = *c_y + (Box->
W - *c_x) / (*x - *c_x) * (*y - *c_y);
193 *c_y = *c_y + (Box->
E - *c_x) / (*x - *c_x) * (*y - *c_y);
199 *x = *x + (Box->
S - *y) / (*c_y - *y) * (*c_x - *
x);
205 *x = *x + (Box->
N - *y) / (*c_y - *y) * (*c_x - *
x);
211 *c_x = *c_x + (Box->
S - *c_y) / (*y - *c_y) * (*x - *c_x);
217 *c_x = *c_x + (Box->
N - *c_y) / (*y - *c_y) * (*x - *c_x);
248 if (line < 1 || line > Plus->
n_lines) {
249 G_warning(
_(
"Attempt to access feature with invalid id (%d)"), line);
253 Line = Plus->
Line[line];
255 Box->
N = Box->
S = Box->
E = Box->
W = Box->
T = Box->
B = 0. / 0.;
264 G_warning(
_(
"Unable to determine bbox for feature %d"), line);
312 if (area < 1 || area > Plus->
n_areas) {
313 G_warning(
_(
"Attempt to access area with invalid id (%d)"), area);
317 Area = Plus->
Area[area];
320 Box->
N = Box->
S = Box->
E = Box->
W = Box->
T = Box->
B = 0. / 0.;
325 G_warning(
_(
"Unable to determine bbox for area %d"), area);
358 if (isle < 1 || isle > Plus->
n_isles) {
359 G_warning(
_(
"Attempt to access area with invalid id (%d)"), isle);
363 Isle = Plus->
Isle[isle];
366 Box->
N = Box->
S = Box->
E = Box->
W = Box->
T = Box->
B = 0. / 0.;
371 G_warning(
_(
"Unable to determine bbox for isle %d"), isle);
439 else if (type == -2) {
472 Box->
E = Window->
east;
473 Box->
W = Window->
west;
plus_t n_areas
Current number of areas.
int Vect_get_isle_box(const struct Map_info *Map, int isle, struct bound_box *Box)
Get bounding box of isle.
struct P_line ** Line
Array of vector geometries.
2D/3D raster map header (used also for region)
float Box[8][3]
Vertices for box.
int Vect_get_area_box(const struct Map_info *Map, int area, struct bound_box *Box)
Get bounding box of area.
double west
Extent coordinates (west)
struct P_area ** Area
Array of areas.
int dig_line_box(const struct line_pnts *, struct bound_box *)
int Vect_region_box(const struct Cell_head *Window, struct bound_box *Box)
Copy region window to bounding box.
struct P_isle ** Isle
Array of isles.
plus_t n_isles
Current number of isles.
int Vect_get_map_box(const struct Map_info *Map, struct bound_box *Box)
Get bounding box of map (all features in the map)
plus_t n_lines
Current number of lines.
Feature geometry info - coordinates.
double north
Extent coordinates (north)
int Vect_get_line_box(const struct Map_info *Map, int line, struct bound_box *Box)
Get bounding box of given feature.
Basic topology-related info.
int dig_find_area_box(struct Plus_head *, int, struct bound_box *)
Find bounding box for given area.
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
double south
Extent coordinates (south)
int dig_find_isle_box(struct Plus_head *, int, struct bound_box *)
Find box for isle.
struct Plus_head plus
Plus info (topology, version, ...)
struct bound_box box
Bounding box of features.
int Vect_rewind(struct Map_info *)
Rewind vector map to cause reads to start at beginning.
#define PORT_DOUBLE_MAX
Limits for portable types.
int Vect_box_copy(struct bound_box *A, const struct bound_box *B)
Copy box B to box A.
int Vect_is_3d(const struct Map_info *)
Check if vector map is 3D.
int Vect_point_in_box_2d(double x, double y, const struct bound_box *Box)
Tests if point is in 2D box.
const char * Vect_get_full_name(const struct Map_info *)
Get fully qualified name of vector map.
int Vect_get_map_box1(struct Map_info *Map, struct bound_box *Box)
Get bounding box of map on level 1 (all features in the map)
int dig_find_line_box(struct Plus_head *, int, struct bound_box *)
Find box for line.
void G_warning(const char *,...) __attribute__((format(printf
int Vect_box_clip(double *x, double *y, double *c_x, double *c_y, const struct bound_box *Box)
Clip coordinates to box, if necessary, lines extending outside of a box.
double east
Extent coordinates (east)
int Vect_box_overlap(const struct bound_box *A, const struct bound_box *B)
Tests for overlap of two boxes.
int Vect_box_extend(struct bound_box *A, const struct bound_box *B)
Extend box A by box B.
int Vect_read_next_line(const struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
void void G_verbose_message(const char *,...) __attribute__((format(printf
int Vect_read_line(const struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
int Vect_level(const struct Map_info *)
Returns level that Map is opened at.
int Vect_point_in_box(double x, double y, double z, const struct bound_box *Box)
Tests if point is in 3D box.