16 #include <sys/types.h>
55 G_debug(2,
"dig_free_plus_nodes()");
59 for (i = 1; i <= Plus->
n_nodes; i++) {
83 G_debug(2,
"dig_free_plus_lines()");
87 for (i = 1; i <= Plus->
n_lines; i++) {
119 G_debug(2,
"dig_free_plus_areas()");
123 for (i = 1; i <= Plus->
n_areas; i++) {
124 Area = Plus->
Area[i];
147 G_debug(2,
"dig_free_plus_isles()");
151 for (i = 1; i <= Plus->
n_isles; i++) {
152 Isle = Plus->
Isle[i];
224 for (i = 1; i <= Plus->
n_nodes; i++) {
234 for (i = 1; i <= Plus->
n_lines; i++) {
244 for (i = 1; i <= Plus->
n_areas; i++) {
254 for (i = 1; i <= Plus->
n_isles; i++) {
278 G_warning(
_(
"Unable to write head to plus file"));
283 G_warning(
_(
"Unable to write nodes to plus file"));
288 G_warning(
_(
"Unable to write lines to plus file"));
293 G_warning(
_(
"Unable to write areas to plus file"));
298 G_warning(
_(
"Unable to write isles to plus file"));
304 G_warning(
_(
"Unable to write head to plus file"));
327 for (i = 1; i <= Plus->
n_nodes; i++) {
350 for (i = 1; i <= Plus->
n_lines; i++) {
374 for (i = 1; i <= Plus->
n_areas; i++) {
398 for (i = 1; i <= Plus->
n_isles; i++) {
void G_zero(void *, int)
Zero out a buffer, buf, of length i.
void G_free(void *)
Free allocated memory.
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
#define GV_BUILD_NONE
Topology levels - nothing to build.
void dig_free_line(struct P_line *)
Free line structure.
void dig_free_node(struct P_node *)
Free node structure.
int dig_alloc_nodes(struct Plus_head *, int)
Reallocate array of pointers to nodes.
int dig_Rd_P_area(struct Plus_head *, int i, struct gvfile *)
int dig_alloc_areas(struct Plus_head *, int)
Reallocate array of pointers to areas.
off_t dig_ftell(struct gvfile *file)
Get struct gvfile position.
int dig_alloc_isles(struct Plus_head *, int)
Reallocate array of pointers to isles.
int dig_Wr_Plus_head(struct gvfile *, struct Plus_head *)
Write Plus_head to file.
int dig_Wr_P_area(struct Plus_head *, int i, struct gvfile *)
int dig_Rd_P_isle(struct Plus_head *, int i, struct gvfile *)
int dig_set_cur_port(struct Port_info *)
Set current Port_info structure.
void dig_cidx_free(struct Plus_head *)
int dig_Rd_P_line(struct Plus_head *, int i, struct gvfile *)
void dig_rewind(struct gvfile *file)
Rewind file position.
int dig_Wr_P_node(struct Plus_head *, int i, struct gvfile *)
int dig_Rd_Plus_head(struct gvfile *, struct Plus_head *)
Read Plus_head from file.
int dig_cidx_init(struct Plus_head *)
Initialize Plus_head structure (cidx)
int dig_Wr_P_line(struct Plus_head *, int i, struct gvfile *)
int dig_Rd_P_node(struct Plus_head *, int i, struct gvfile *)
int dig_fseek(struct gvfile *file, off_t offset, int whence)
Set struct gvfile position.
void dig_free_area(struct P_area *)
Free area structure.
int dig_alloc_lines(struct Plus_head *, int)
Reallocate array of pointers to lines.
int dig_fflush(struct gvfile *file)
Flush struct gvfile.
void dig_spidx_free(struct Plus_head *)
Free spatial index (nodes, lines, areas, isles)
int dig_Wr_P_isle(struct Plus_head *, int i, struct gvfile *)
void dig_free_isle(struct P_isle *)
Free isle structure.
int dig_spidx_init(struct Plus_head *)
Initit spatial index (nodes, lines, areas, isles)
void dig_free_plus(struct Plus_head *Plus)
Free Plus structure.
int dig_write_plus_file(struct gvfile *fp_plus, struct Plus_head *Plus)
Writes topo structure to topo file.
int dig_write_areas(struct gvfile *plus, struct Plus_head *Plus)
Writes topo structure (areas) to topo file.
int dig_init_plus(struct Plus_head *Plus)
Initialize Plus_head structure.
void dig_free_plus_areas(struct Plus_head *Plus)
Free Plus->Area structure.
void dig_free_plus_nodes(struct Plus_head *Plus)
Free Plus->Node structure.
int dig_write_nodes(struct gvfile *plus, struct Plus_head *Plus)
Writes topo structure (nodes) to topo file.
int dig_load_plus(struct Plus_head *Plus, struct gvfile *plus, int head_only)
Reads topo file to topo structure.
void dig_free_plus_lines(struct Plus_head *Plus)
Free Plus->Line structure.
void dig_free_plus_isles(struct Plus_head *Plus)
Free Plus->Isle structure.
int dig_write_isles(struct gvfile *plus, struct Plus_head *Plus)
Writes topo structure (isles) to topo file.
int dig_write_lines(struct gvfile *plus, struct Plus_head *Plus)
Writes topo structure (lines) to topo file.
Topological feature - node.
Basic topology-related info.
plus_t n_klines
Current number of kernels.
plus_t alloc_lines
Number of allocated lines.
off_t Isle_offset
Offset of array of isles in topo file.
off_t Node_offset
Offset of array of nodes in topo file.
struct P_line ** Line
Array of vector geometries.
plus_t n_lines
Current number of lines.
plus_t n_plines
Current number of points.
off_t Area_offset
Offset of array of areas in topo file.
plus_t n_nodes
Current number of topological features derived from vector geometries.
plus_t alloc_areas
Number of allocated areas.
plus_t n_blines
Current number of boundaries.
struct P_area ** Area
Array of areas.
plus_t alloc_isles
Number of allocated isles.
plus_t n_clines
Current number of centroids.
plus_t alloc_nodes
Number of allocated nodes.
plus_t n_isles
Current number of isles.
struct P_isle ** Isle
Array of isles.
struct P_node ** Node
Array of nodes.
struct Port_info port
Portability information.
plus_t n_areas
Current number of areas.
int built
Highest level of topology currently available.
plus_t n_flines
Current number of faces.
off_t Line_offset
Offset of array of vector geometries in topo file.
plus_t n_llines
Current number of lines.