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