Vlib/box.c File Reference

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>

Include dependency graph for Vlib/box.c:

Go to the source code of this file.

Functions

int Vect_point_in_box (double x, double y, double z, BOUND_BOX *Box)
 tests for point in box
int Vect_box_overlap (BOUND_BOX *A, BOUND_BOX *B)
 tests for overlap of two boxes
int Vect_box_copy (BOUND_BOX *A, BOUND_BOX *B)
 copy box B to box A
int Vect_box_extend (BOUND_BOX *A, BOUND_BOX *B)
 extend box A by box B
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_get_line_box (struct Map_info *Map, int line, BOUND_BOX *Box)
 get line number in boundary box ??
int Vect_get_area_box (struct Map_info *Map, int area, BOUND_BOX *Box)
 get area number in boundary box ?
int Vect_get_isle_box (struct Map_info *Map, int isle, BOUND_BOX *Box)
 get isle number in boundary box ?
int Vect_get_map_box (struct Map_info *Map, BOUND_BOX *Box)
 falls map into boundary box ???
int Vect_region_box (struct Cell_head *Window, BOUND_BOX *Box)
 copy region Window to Box


Function Documentation

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.

A line represented by the coordinates x, y and c_x, c_y is clipped to the window defined by s (south), n (north), w (west), and e (east). Note that the following constraints must be true: w <e s <n The x and c_x are values to be compared to w and e. The y and c_y are values to be compared to s and n. The x and c_x values returned lie between w and e. The y and c_y values returned lie between s and n.

Parameters:
x 
y 
c_x 
c_y 
boundary box
Returns:
1 if any clipping occured, 0 otherwise

Definition at line 128 of file Vlib/box.c.

int Vect_box_copy ( BOUND_BOX *  A,
BOUND_BOX *  B 
)

copy box B to box A

Returns:
1
Parameters:
boundary box1, boundary box2

Definition at line 68 of file Vlib/box.c.

Referenced by V2_delete_line_nat(), V2_write_line_nat(), Vect_build_nat(), and Vect_topo_dump().

int Vect_box_extend ( BOUND_BOX *  A,
BOUND_BOX *  B 
)

extend box A by box B

Returns:
1
Parameters:
boundary box1, boundary box2

Definition at line 88 of file Vlib/box.c.

Referenced by V2_delete_line_nat(), V2_write_line_nat(), and Vect_build_nat().

int Vect_box_overlap ( BOUND_BOX *  A,
BOUND_BOX *  B 
)

tests for overlap of two boxes

Returns:
1 boxes overlap, 0 boxes do not overlap
Parameters:
boundary box A, boundary box B

Definition at line 48 of file Vlib/box.c.

Referenced by V1_read_next_line_nat(), and V2_read_next_line_nat().

int Vect_get_area_box ( struct Map_info *  Map,
int  area,
BOUND_BOX *  Box 
)

get area number in boundary box ?

Returns:
1 on success, 0 area is dead
Parameters:
Map_info structure, area number, boundary box

Definition at line 238 of file Vlib/box.c.

Referenced by V2_delete_line_nat(), V2_write_line_nat(), and Vect_isle_find_area().

int Vect_get_isle_box ( struct Map_info *  Map,
int  isle,
BOUND_BOX *  Box 
)

get isle number in boundary box ?

Returns:
1 on success, 0 isle is dead
Parameters:
Map_info structure, isle number, boundary box

Definition at line 273 of file Vlib/box.c.

Referenced by V2_delete_line_nat(), V2_write_line_nat(), and Vect_isle_find_area().

int Vect_get_line_box ( struct Map_info *  Map,
int  line,
BOUND_BOX *  Box 
)

get line number in boundary box ??

Returns:
1 on success, 0 line is dead
Parameters:
Map_info structure, line number, boundary box

Definition at line 203 of file Vlib/box.c.

Referenced by V2_read_next_line_nat(), and Vect_break_lines().

int Vect_get_map_box ( struct Map_info *  Map,
BOUND_BOX *  Box 
)

falls map into boundary box ???

Returns:
1 on success, 0 on error
Parameters:
Map_info structure, boundary box

Definition at line 308 of file Vlib/box.c.

int Vect_point_in_box ( double  x,
double  y,
double  z,
BOUND_BOX *  Box 
)

tests for point in box

Returns:
1 point is in box, 0 point is not in box
Parameters:
xyz coordinates, boundary box

Definition at line 28 of file Vlib/box.c.

References N.

int Vect_region_box ( struct Cell_head *  Window,
BOUND_BOX *  Box 
)

copy region Window to Box

Returns:
1 on success, 0 on error
Parameters:
region structure, boundary box

Definition at line 332 of file Vlib/box.c.


Generated on Sun Apr 6 17:32:45 2008 for GRASS by  doxygen 1.5.5