51 return (
x >=
Box->W && x <= Box->E && y >=
Box->S && y <= Box->
N &&
52 z >=
Box->B && z <= Box->T);
70 return (
x >=
Box->W && x <= Box->E && y >=
Box->S && y <= Box->
N);
85 if (A->
E < B->
W || A->
W > B->
E || A->
N < B->
S || A->
S > B->
N ||
86 A->
T < B->
B || A->
B > B->
T) {
171 *y = *y + (
Box->W - *
x) / (*c_x - *
x) * (*c_y - *y);
177 *y = *y + (
Box->E - *
x) / (*c_x - *
x) * (*c_y - *y);
183 *c_y = *c_y + (
Box->W - *c_x) / (*
x - *c_x) * (*y - *c_y);
189 *c_y = *c_y + (
Box->E - *c_x) / (*
x - *c_x) * (*y - *c_y);
195 *
x = *
x + (
Box->S - *y) / (*c_y - *y) * (*c_x - *
x);
201 *
x = *
x + (
Box->N - *y) / (*c_y - *y) * (*c_x - *
x);
207 *c_x = *c_x + (
Box->S - *c_y) / (*y - *c_y) * (*
x - *c_x);
213 *c_x = *c_x + (
Box->N - *c_y) / (*y - *c_y) * (*
x - *c_x);
243 if (line < 1 || line > Plus->
n_lines) {
244 G_warning(
_(
"Attempt to access feature with invalid id (%d)"), line);
259 G_warning(
_(
"Unable to determine bbox for feature %d"), line);
306 if (area < 1 || area > Plus->
n_areas) {
307 G_warning(
_(
"Attempt to access area with invalid id (%d)"), area);
319 G_warning(
_(
"Unable to determine bbox for area %d"), area);
352 if (isle < 1 || isle > Plus->
n_isles) {
353 G_warning(
_(
"Attempt to access area with invalid id (%d)"), isle);
365 G_warning(
_(
"Unable to determine bbox for isle %d"), isle);
424 "Registering primitives..."),
434 else if (type == -2) {
void G_warning(const char *,...) __attribute__((format(printf
void void G_verbose_message(const char *,...) __attribute__((format(printf
void Vect_destroy_line_struct(struct line_pnts *)
Frees all memory associated with a line_pnts structure, including the structure itself.
const char * Vect_get_full_name(struct Map_info *)
Get fully qualified name of vector map.
int Vect_level(struct Map_info *)
Returns level that Map is opened at.
int Vect_read_line(struct Map_info *, struct line_pnts *, struct line_cats *, int)
Read vector feature (topological level required)
struct line_pnts * Vect_new_line_struct(void)
Creates and initializes a line_pnts structure.
int Vect_rewind(struct Map_info *)
Rewind vector map to cause reads to start at beginning.
int Vect_read_next_line(struct Map_info *, struct line_pnts *, struct line_cats *)
Read next vector feature.
int Vect_is_3d(struct Map_info *)
Check if vector map is 3D.
#define PORT_DOUBLE_MAX
Limits for portable types.
int dig_find_area_box(struct Plus_head *, int, struct bound_box *)
Find bounding box for given area.
int dig_find_line_box(struct Plus_head *, int, struct bound_box *)
Find box for line.
int dig_find_isle_box(struct Plus_head *, int, struct bound_box *)
Find box for isle.
int dig_line_box(const struct line_pnts *, struct bound_box *)
float Box[8][3]
Vertices for box.
2D/3D raster map header (used also for region)
double north
Extent coordinates (north)
double east
Extent coordinates (east)
double south
Extent coordinates (south)
double west
Extent coordinates (west)
struct Plus_head plus
Plus info (topology, version, ...)
Basic topology-related info.
struct P_line ** Line
Array of vector geometries.
plus_t n_lines
Current number of lines.
struct P_area ** Area
Array of areas.
plus_t n_isles
Current number of isles.
struct bound_box box
Bounding box of features.
struct P_isle ** Isle
Array of isles.
plus_t n_areas
Current number of areas.
Feature geometry info - coordinates.
int Vect_get_map_box(struct Map_info *Map, struct bound_box *Box)
Get bounding box of map (all features in the map)
int Vect_point_in_box_2d(double x, double y, const struct bound_box *Box)
Tests if point is in 2D box.
int Vect_region_box(const struct Cell_head *Window, struct bound_box *Box)
Copy region window to bounding box.
int Vect_box_extend(struct bound_box *A, const struct bound_box *B)
Extend box A by box B.
int Vect_get_line_box(struct Map_info *Map, int line, struct bound_box *Box)
Get bounding box of given feature.
int Vect_box_overlap(const struct bound_box *A, const struct bound_box *B)
Tests for overlap of two boxes.
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.
int Vect_point_in_box(double x, double y, double z, const struct bound_box *Box)
Tests if point is in 3D box.
int Vect_get_area_box(struct Map_info *Map, int area, struct bound_box *Box)
Get bounding box of area.
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 Vect_box_copy(struct bound_box *A, const struct bound_box *B)
Copy box B to box A.
int Vect_get_isle_box(struct Map_info *Map, int isle, struct bound_box *Box)
Get bounding box of isle.