00001 //-------------------------------------------------------------------------- 00002 // 00003 // File: delaunay.h 00004 // 00005 // Created: 04/08/2000 00006 // 00007 // Author: Pavel Sakov 00008 // CSIRO Marine Research 00009 // 00010 // Purpose: Header for delaunay triangulation wrapper 00011 // 00012 // Description: None 00013 // 00014 // Revisions: None 00015 // 00016 //-------------------------------------------------------------------------- 00017 00018 #if !defined ( _DELAUNAY_H ) 00019 #define _DELAUNAY_H 00020 00021 #include "nn.h" 00022 00023 typedef struct 00024 { 00025 int vids[3]; 00026 } triangle; 00027 00028 typedef struct 00029 { 00030 int tids[3]; 00031 } triangle_neighbours; 00032 00033 typedef struct 00034 { 00035 double x; 00036 double y; 00037 double r; 00038 } circle; 00039 00040 #if !defined ( _ISTACK_H ) 00041 struct istack; 00042 typedef struct istack istack; 00043 #endif 00044 00045 struct delaunay 00046 { 00047 int npoints; 00048 point * points; 00049 double xmin; 00050 double xmax; 00051 double ymin; 00052 double ymax; 00053 00054 int ntriangles; 00055 triangle * triangles; 00056 circle * circles; 00057 triangle_neighbours* neighbours; // for delaunay_xytoi() 00058 00059 int * n_point_triangles; // n_point_triangles[i] is number of 00060 // triangles i-th point belongs to 00061 int ** point_triangles; // point_triangles[i][j] is index of j-th 00062 // triangle i-th point belongs to 00063 00064 int nedges; 00065 int * edges; // n-th edge is formed by points[edges[n*2]] 00066 // and points[edges[n*2+1]] 00067 00068 // 00069 // Work data for delaunay_circles_find(). Placed here for efficiency 00070 // reasons. Should be moved to the procedure if parallelizable code 00071 // needed. 00072 // 00073 int * flags; 00074 int first_id; // last search result, used in start up of a 00075 // new search 00076 istack* t_in; 00077 istack* t_out; 00078 }; 00079 00080 #endif