|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1878fdfec5
|
Go to the source code of this file.
Data Structures | |
| struct | triple |
| struct | quaddata |
Macros | |
| #define | NW 1 |
| #define | NE 2 |
| #define | SW 3 |
| #define | SE 4 |
Functions | |
| struct triple * | quad_point_new (double, double, double, double) |
| struct quaddata * | quad_data_new (double, double, double, double, int, int, int, int) |
| int | quad_compare (struct triple *, struct quaddata *) |
| int | quad_add_data (struct triple *, struct quaddata *, double) |
| int | quad_intersect (struct quaddata *, struct quaddata *) |
| int | quad_division_check (struct quaddata *, int) |
| struct quaddata ** | quad_divide_data (struct quaddata *, int, double) |
| int | quad_get_points (struct quaddata *, struct quaddata *, int) |
| #define NE 2 |
Definition at line 25 of file dataquad.h.
| #define NW 1 |
Definition at line 24 of file dataquad.h.
| #define SE 4 |
Definition at line 27 of file dataquad.h.
| #define SW 3 |
Definition at line 26 of file dataquad.h.
Add point to a given data.
Definition at line 135 of file dataquad.c.
References quaddata::n_points, NULL, quaddata::points, r, triple::sm, triple::x, triple::y, and triple::z.
Referenced by quad_divide_data().
Return the quadrant the point should be inserted in
Definition at line 91 of file dataquad.c.
References quaddata::n_cols, quaddata::n_rows, NE, NULL, NW, SE, SW, triple::x, quaddata::x_orig, quaddata::xmax, triple::y, quaddata::y_orig, and quaddata::ymax.
Referenced by quad_divide_data().
| struct quaddata * quad_data_new | ( | double | x_or, |
| double | y_or, | ||
| double | xmax, | ||
| double | ymax, | ||
| int | rows, | ||
| int | cols, | ||
| int | n_points, | ||
| int | kmax | ||
| ) |
Initialize quaddata structure with given arguments
This is a constructor of the quaddata structure and it allocates memory. It also creates (and allocates memory for) the given number of points (given by kmax). The point attributes are set to zero.
Definition at line 55 of file dataquad.c.
References free(), malloc(), quaddata::n_cols, quaddata::n_points, quaddata::n_rows, NULL, quaddata::points, quaddata::x_orig, quaddata::xmax, quaddata::y_orig, and quaddata::ymax.
Referenced by IL_interp_segments_2d(), IL_interp_segments_2d_parallel(), IL_resample_interp_segments_2d(), and quad_divide_data().
Divide data into four new ones
Divides data into 4 new data reinserting data->points in them by calling data function quad_compare() to determine were to insert. Returns array of 4 new data (allocates memory).
Definition at line 222 of file dataquad.c.
References malloc(), quaddata::n_cols, quaddata::n_points, quaddata::n_rows, NE, NULL, NW, quaddata::points, quad_add_data(), quad_compare(), quad_data_new(), SE, SW, quaddata::x_orig, quaddata::xmax, quaddata::y_orig, and quaddata::ymax.
Check if data needs to be divided
Checks if data needs to be divided. If data->points is empty, returns -1; if its not empty but there aren't enough points in data for division returns 0. Otherwise (if its not empty and there are too many points) returns 1.
Definition at line 205 of file dataquad.c.
References quaddata::n_points, NULL, and quaddata::points.
Gets such points from data that lie within region determined by data_inter. Called by tree function region_data().
Definition at line 301 of file dataquad.c.
References l, MAX, quaddata::n_points, quaddata::points, triple::sm, triple::x, quaddata::xmax, triple::y, quaddata::ymax, and triple::z.
Check intersection of two quaddata structures
Checks if region defined by data intersects the region defined by data_inter.
Definition at line 172 of file dataquad.c.
References quaddata::x_orig, and quaddata::y_orig.
Initialize point structure with given arguments
This is a constructor of the point structure and it allocates memory.
Definition at line 32 of file dataquad.c.
References malloc(), NULL, triple::sm, triple::x, triple::y, and triple::z.
Referenced by process_point().