GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
dgraph.h
Go to the documentation of this file.
1 #ifndef GRASS_DGRAPH_H
2 #define GRASS_DGRAPH_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 bellow */
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(struct line_pnts *Points);
37 
38 #endif
struct planar_graph * pg_create(struct line_pnts *Points)
Definition: dgraph.c:442
void pg_addedge(struct planar_graph *pg, int v1, int v2)
Definition: dgraph.c:409
double x
Definition: dgraph.h:16
char winding_right
Definition: dgraph.h:12
void pg_destroy_struct(struct planar_graph *pg)
Definition: dgraph.c:359
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:343
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:373
int vcount
Definition: dgraph.h:25
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
int n
Definition: dataquad.c:291