|
static void | init_point_list (struct point_list *list) |
|
static void | reset_point_list (struct point_list *list) |
|
static size_t | generate_point_list (struct point_list *list, struct yac_grid_cell cell, int cell_ordering, struct yac_circle *circle_buffer) |
|
static struct point_list_element * | get_free_point_list_element (struct point_list *list) |
|
static size_t | remove_points (struct point_list *list) |
|
static size_t | remove_zero_length_edges (struct point_list *list) |
| returns number of edges/corners
|
|
static void | free_point_list (struct point_list *list) |
|
static int | get_cell_points_ordering (struct yac_grid_cell cell) |
|
static void | generate_cell (struct point_list *list, struct yac_grid_cell *cell) |
|
static enum yac_cell_type | get_cell_type (struct yac_grid_cell target_cell) |
|
static struct yac_grid_cell * | get_overlap_cell_buffer (size_t N) |
|
void | yac_compute_overlap_buf_free () |
|
static double | get_edge_direction (double *ref_corner, double *corner_a, double *corner_b) |
|
void | yac_compute_overlap_info (size_t N, struct yac_grid_cell *source_cell, struct yac_grid_cell target_cell, double *overlap_areas, double(*overlap_barycenters)[3]) |
| calculates partial areas for all overlapping parts of the source cells with arbitrary target cells, this is required for conservative remapping. In addition, the barycenter of each overlap is calculated.
|
|
static double | dotproduct (double a[], double b[]) |
|
void | yac_compute_overlap_areas (size_t N, struct yac_grid_cell *source_cell, struct yac_grid_cell target_cell, double *partial_areas) |
| calculates partial areas for all overlapping parts of the source cells with arbitrary target cells, this is required for conservative remapping.
|
|
int | yac_circle_compare (void const *a, void const *b) |
|
static void | compute_norm_vector_kahan (double const a[3], double const b[3], double norm_vector[3]) |
|
void | yac_circle_generate (double const *a, double const *b, enum yac_edge_type type, int edge_ordering, struct yac_circle *circle) |
|
static struct yac_circle | generate_lat_circle (double z, int north_is_out) |
|
int | yac_circle_point_is_inside (double const point[3], struct yac_circle *circle) |
|
int | yac_circle_compare_distances (double const a[3], double const b[3], struct yac_circle *circle) |
|
int | yac_circle_contains_north_pole (struct yac_circle *circle) |
|
static void | circle_clipping (struct point_list *cell, size_t num_cell_edges, struct yac_circle **clipping_circles, size_t num_clipping_circles) |
|
static void | point_list_clipping (struct point_list *source_list, struct point_list target_list, size_t nct) |
|
static void | copy_point_list (struct point_list in, struct point_list *out) |
|
void | yac_cell_clipping (size_t N, struct yac_grid_cell *source_cell, struct yac_grid_cell target_cell, struct yac_grid_cell *overlap_buffer) |
| cell clipping to get the cells describing the intersections
|
|
static void | yac_lon_lat_cell_lat_clipping (struct yac_grid_cell *cell, double z_upper_bound, double z_lower_bound, struct yac_grid_cell *overlap_buffer) |
|
static double | get_closest_pole (struct point_list *cell_list) |
|
void | yac_cell_lat_clipping (size_t N, struct yac_grid_cell *cells, double lat_bounds[2], struct yac_grid_cell *overlap_buffer) |
| cell clipping to get the cells describing the intersections
|
|
void | yac_correct_weights (size_t nSourceCells, double *weight) |
| correct interpolation weights
|
|
static void | compute_norm_vector (double a[], double b[], double norm[]) |
|
static int | is_empty_gc_cell (struct point_list *list, size_t num_edges) |
|
static enum yac_edge_type | circle2edge_type (enum yac_circle_type type) |
|
void yac_compute_overlap_areas |
( |
size_t | N, |
|
|
struct yac_grid_cell * | source_cell, |
|
|
struct yac_grid_cell | target_cell, |
|
|
double * | partial_areas ) |
calculates partial areas for all overlapping parts of the source cells with arbitrary target cells, this is required for conservative remapping.
Some of the underlying concepts can be found in
See e.g. Joseph O'Rourke, Computational Geometry in C, 2nd Ed., 1998 Sec. 7.6 Intersections of Convex Polygons, page 253.
The routine takes (a list of) source cells and a target cell. It determines the clipping points of the intersection between a source and the target cells using cell_clipping internally. In a second step areas are calculated for each intersection described in the overlap cells. If a target cell is fully covered by N source cells the N partial areas should add up to the area of the target cell.
- Parameters
-
[in] | N | number of source cells |
[in] | source_cell | list of source cells |
[in] | target_cell | target cell |
[out] | partial_areas | list of N partial weights, one weight for each source-target intersection |
- Examples
- test_compute_overlap_area.c, and test_partial_areas.c.
Definition at line 276 of file clipping.c.
void yac_compute_overlap_info |
( |
size_t | N, |
|
|
struct yac_grid_cell * | source_cell, |
|
|
struct yac_grid_cell | target_cell, |
|
|
double * | overlap_areas, |
|
|
double(*) | overlap_barycenters[3] ) |
calculates partial areas for all overlapping parts of the source cells with arbitrary target cells, this is required for conservative remapping. In addition, the barycenter of each overlap is calculated.
Some of the underlying concepts can be found in
See e.g. Joseph O'Rourke, Computational Geometry in C, 2nd Ed., 1998 Sec. 7.6 Intersections of Convex Polygons, page 253.
The routine takes (a list of) source cells and a target cell. It determines the clipping points of the intersection between a source and the target cells using cell_clipping internally. In a second step areas are calculated for each intersection described in the overlap cells. If a target cell is fully covered by N source cells the N partial areas should add up to the area of the target cell.
- Parameters
-
[in] | N | number of source cells |
[in] | source_cell | list of source cells |
[in] | target_cell | target cell |
[out] | overlap_areas | list of N partial weights, one weight for each source-target intersection |
[out] | overlap_barycenters | coordinates of the barycenters of the overlap cell |
- Examples
- test_compute_overlap_area.c, and test_partial_areas.c.
Definition at line 119 of file clipping.c.