21 #include <grass/vector.h> 22 #include <grass/glocale.h> 34 Node = (
struct P_node *) G_malloc(
sizeof(
struct P_node));
74 G_debug(5,
"dig_node_alloc_line(): add = %d", add);
86 p = G_realloc(node->
angles, num *
sizeof(
float));
111 p = G_realloc(Plus->
Node, size *
sizeof(
struct P_node *));
131 Line = (
struct P_line *) G_malloc(
sizeof(
struct P_line));
151 Topo = G_malloc(
sizeof(
struct P_topo_l));
154 Topo = G_malloc(
sizeof(
struct P_topo_b));
157 Topo = G_malloc(
sizeof(
struct P_topo_c));
160 Topo = G_malloc(
sizeof(
struct P_topo_f));
163 Topo = G_malloc(
sizeof(
struct P_topo_k));
199 p = G_realloc(Plus->
Line, size *
sizeof(
struct P_line *));
224 p = G_realloc(Plus->
Area, size *
sizeof(
struct P_area *));
248 G_debug(5,
"dig_alloc_isle():");
250 p = G_realloc(Plus->
Isle, size *
sizeof(
struct P_isle *));
270 Area = (
struct P_area *) G_malloc(
sizeof(
struct P_area));
305 Isle = (
struct P_isle *) G_malloc(
sizeof(
struct P_isle));
348 points->
x = (
double *)p;
357 points->
y = (
double *)p;
366 points->
z = (
double *)p;
395 cats->
field = (
int *)p;
403 cats->
cat = (
int *)p;
450 G_debug(5,
"dig_area_alloc_isle(): add = %d", add);
476 G_debug(5,
"dig_isle_alloc_line():");
int dig_alloc_nodes(struct Plus_head *Plus, int add)
Reallocate array of pointers to nodes.
struct P_node * dig_alloc_node()
Allocate new node structure.
void G_free(void *buf)
Free allocated memory.
plus_t alloc_nodes
Number of allocated nodes.
int alloc_points
Allocated space for points.
struct P_line ** Line
Array of vector geometries.
void dig_free_isle(struct P_isle *Isle)
Free isle structure.
struct P_area ** Area
Array of areas.
struct P_node ** Node
Array of nodes.
void dig_free_area(struct P_area *Area)
Free area structure.
int alloc_cats
Allocated space for categories.
plus_t n_lines
Number of attached lines (size of lines, angle)
struct P_isle ** Isle
Array of isles.
int dig_alloc_areas(struct Plus_head *Plus, int add)
Reallocate array of pointers to areas.
plus_t * lines
List of connected lines.
int dig_area_alloc_isle(struct P_area *area, int add)
Allocate space in P_area for add new isles.
plus_t * isles
1st generation interior islands
plus_t alloc_areas
Number of allocated areas.
int dig_alloc_cats(struct line_cats *cats, int num)
Allocate room for 'num' fields and category arrays in struct line_cats.
plus_t alloc_lines
Allocated space for lines.
plus_t alloc_lines
Allocated space for lines.
int dig_out_of_memory()
For now just print message and return error code.
double * x
Array of X coordinates.
Feature geometry info - coordinates.
plus_t * lines
List of boundary lines.
struct P_isle * dig_alloc_isle()
Allocate new isle structure.
Basic topology-related info.
struct P_area * dig_alloc_area()
Allocate new area structure.
plus_t alloc_lines
Number of allocated lines.
void * topo
Topology info.
int dig_alloc_isles(struct Plus_head *Plus, int add)
Reallocate array of pointers to isles.
float * angles
List of angles of connected lines.
int G_debug(int level, const char *msg,...)
Print debugging message.
int * cat
Array of categories.
int dig_alloc_points(struct line_pnts *points, int num)
allocate room for 'num' X and Y arrays in struct line_pnts
plus_t * lines
List of boundary lines.
void * dig_alloc_topo(char type)
Allocate new topo struct.
void dig_free_line(struct P_line *Line)
Free line structure.
Topological feature - node.
int dig_area_alloc_line(struct P_area *area, int add)
allocate space in P_area for add new lines
plus_t alloc_isles
Allocated space for isles.
void * dig__alloc_space(int, int *, int, void *, int)
plus_t alloc_lines
Allocated space for lines.
double * y
Array of Y coordinates.
int dig_alloc_lines(struct Plus_head *Plus, int add)
Reallocate array of pointers to lines.
double * z
Array of Z coordinates.
int * field
Array of layers (fields)
int dig_node_alloc_line(struct P_node *node, int add)
Allocate space in P_node struct.
void G_zero(void *buf, int i)
Zero out a buffer, buf, of length i.
plus_t area
Area it exists w/in, if any.
struct P_line * dig_alloc_line()
Allocate new line structure.
void G_warning(const char *msg,...)
Print a warning message to stderr.
plus_t alloc_isles
Number of allocated isles.
int dig_isle_alloc_line(struct P_isle *isle, int add)
Allocate space in P_isle for add new lines.
void dig_free_node(struct P_node *Node)
Free node structure.