GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71915
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
dgraph.h
Go to the documentation of this file.
1 #ifndef GRASS_DdglGraph_s_H
2 #define GRASS_DdglGraph_s_H
3 
4 /* pg comes from "planar graph" */
5 /* every edge is directed. Nevertheless, we can visit it on both sides */
6 struct pg_edge {
7  int v1; /* first vertex */
8  int v2; /* second vertex */
11  char winding_left; /* winding numbers */
13 };
14 
15 struct pg_vertex {
16  double x; /* coordinates */
17  double y;
18  int ecount; /* number of neighbours */
19  int eallocated; /* size of the array below */
20  struct pg_edge **edges; /* array of pointers */
21  double *angles; /* precalculated angles with Ox */
22 };
23 
24 struct planar_graph {
25  int vcount; /* number of vertices */
26  struct pg_vertex *v;
27  int ecount;
29  struct pg_edge *e;
30 };
31 
32 struct planar_graph* pg_create_struct(int n, int e);
33 void pg_destroy_struct(struct planar_graph *pg);
34 int pg_existsedge(struct planar_graph *pg, int v1, int v2);
35 void pg_addedge(struct planar_graph *pg, int v1, int v2);
36 struct planar_graph* pg_create(const struct line_pnts *Points);
37 
38 #endif
void pg_addedge(struct planar_graph *pg, int v1, int v2)
Definition: dgraph.c:416
double x
Definition: dgraph.h:16
char winding_right
Definition: dgraph.h:12
void pg_destroy_struct(struct planar_graph *pg)
Definition: dgraph.c:368
int eallocated
Definition: dgraph.h:19
char visited_left
Definition: dgraph.h:9
struct planar_graph * pg_create_struct(int n, int e)
Definition: dgraph.c:352
int ecount
Definition: dgraph.h:27
struct pg_edge * e
Definition: dgraph.h:29
int pg_existsedge(struct planar_graph *pg, int v1, int v2)
Definition: dgraph.c:382
int vcount
Definition: dgraph.h:25
Feature geometry info - coordinates.
Definition: dig_structs.h:1675
struct planar_graph * pg_create(const struct line_pnts *Points)
Definition: dgraph.c:449
double * angles
Definition: dgraph.h:21
int eallocated
Definition: dgraph.h:28
struct pg_vertex * v
Definition: dgraph.h:26
struct pg_edge ** edges
Definition: dgraph.h:20
char visited_right
Definition: dgraph.h:10
char winding_left
Definition: dgraph.h:11
Definition: dgraph.h:6
double y
Definition: dgraph.h:17
int v2
Definition: dgraph.h:8
int v1
Definition: dgraph.h:7
int ecount
Definition: dgraph.h:18