9 #ifdef LOCATION_STATISTICS 19 #ifdef LOCATION_STATISTICS 20 #include "/home/jnavas/workspace/Delaunay_Scipion/performance.h" 30 #define MAX_NEIGHBORS 50 31 #define EXTERNAL_FACE 0 73 if (delaunay->
dcel == NULL)
76 sprintf( log_Text,
"Error allocating DCEL in init_Delaunay\n");
79 printf(
"Error allocating DCEL in init_Delaunay\n");
88 sprintf( log_Text,
"Error calling initialize_DCEL in init_Delaunay\n");
91 printf(
"Error allocating DCEL in init_Delaunay\n");
100 sprintf( log_Text,
"Error allocating graph in init_Delaunay\n");
101 write_Log( log_Text);
103 printf(
"Error allocating graph in init_Delaunay\n");
149 printf(
"Dcel is full. Resizing DCEL\n");
155 sprintf(
"Error resizing DCEL in insert_Point.\n");
156 write_Log( log_Text);
158 printf(
"Error resizing DCEL in insert_Point.\n");
207 sprintf(
"Error allocating Voronoi data in create_Delaunay_Triangulation.\n");
208 write_Log( log_Text);
210 printf(
"Error allocating Voronoi data in create_Delaunay_Triangulation.\n");
241 delaunay->
dcel = dcel;
248 sprintf(
"Error allocating graph in DCEL in insert_Point.\n");
249 write_Log( log_Text);
251 printf(
"Error allocating graph in DCEL in insert_Point.\n");
279 delaunay->
dcel = NULL;
297 #ifdef DELAUNAY_STATISTICS 299 delaunay_Stat.trianglesFound[0] = 2;
300 delaunay_Stat.trianglesFound[1] = 0;
301 delaunay_Stat.trianglesFound[2] = 0;
302 delaunay_Stat.nFlipped = 0;
328 for (point_Index=1; point_Index<delaunay->
dcel->
nVertex ; point_Index++)
360 #ifdef DELAUNAY_STATISTICS 361 delaunay_Stat.nFlipped = 0;
383 triangle[0] = vertex->
vertex;
388 triangle[2] = vertex->
vertex;
393 triangle[1] = vertex->
vertex;
400 if (
in_Circle( &triangle[0], &triangle[1], &triangle[2], &vertex->
vertex))
402 #ifdef DELAUNAY_STATISTICS 403 delaunay_Stat.nFlipped++;
406 printf(
"Edge %d wrong. Pending %d. \n", i+1, nPending);
407 scanf(
"%c", &prueba);
459 printf(
"Edge %d flipped. Pending %d. \n", i+1, nPending);
461 sprintf( filename,
"setp%d.txt", step);
463 draw_DCEL_Points( &delaunay_Dcel, 0.1,
WHITE);
464 draw_DCEL_Triangulation( &delaunay_Dcel);
474 printf(
"Edge %d is OK. Pending %d. \n", i+1, nPending);
475 scanf(
"%c", &prueba);
485 printf(
"Edge %d in convex hull. Peding %d\n", i+1, nPending);
486 scanf(
"%c", &prueba);
493 printf(
"Edge %d already checked. Pending %d\n", i+1, nPending);
494 scanf(
"%c", &prueba);
553 double closest_Dist=0.0, new_Dist=0.0;
561 #ifdef DEBUG_TWO_CLOSEST 562 printf(
"Searching closest point to %d. Starting edge %d\n", index, edge_Index);
570 #ifdef DEBUG_TWO_CLOSEST 571 printf(
"Initial point is %d whose distance is %lf\n", closest_Index, closest_Dist);
580 #ifdef DEBUG_TWO_CLOSEST 581 printf(
"Checking edge %d\n", edge_Index);
588 #ifdef DEBUG_TWO_CLOSEST 589 printf(
"Search finished.\n");
596 #ifdef DEBUG_TWO_CLOSEST 597 printf(
"Checking point %d\n", point_Index);
600 if (point_Index >= 0)
605 #ifdef DEBUG_TWO_CLOSEST 606 printf(
"New distance is %lf and previous is %lf.", new_Dist, closest_Dist);
608 if (new_Dist < closest_Dist)
610 closest_Dist = new_Dist;
611 closest_Index = point_Index;
612 #ifdef DEBUG_TWO_CLOSEST 613 printf(
"New point is closer. \n");
617 #ifdef DEBUG_TWO_CLOSEST 618 printf(
"Not checked because it is an imaginary point\n");
623 return(closest_Index);
657 index = face->
edge-1;
661 #ifdef DEBUG_GET_FACE_POINTS 662 printf(
"Face index %d. Target face %d\n", faceIndex, face_ID);
664 if (faceIndex == face_ID)
666 #ifdef DEBUG_GET_FACE_POINTS 667 printf(
"%d \n ", dcel->edges[index].origin_Vertex-1);
668 printf(
"%d \n", dcel->edges[edge->
next_Edge-1].origin_Vertex-1);
669 printf(
"%d \n", dcel->edges[edge->
previous_Edge-1].origin_Vertex-1);
750 #ifdef DEBUG_NEXT_FACE_ITERATOR 751 printf(
"\nNew face %d of %d\n", delaunay->
faceIndex, nFaces);
764 edgeIndex = face->
edge - 1;
767 #ifdef DEBUG_NEXT_FACE_ITERATOR 783 #ifdef DEBUG_NEXT_FACE_ITERATOR 785 edgeIndex = face->
edge - 1;
787 printf(
"Skipping imaginary face %d\n", delaunay->
faceIndex-1);
797 #ifdef DEBUG_NEXT_FACE_ITERATOR 798 printf(
"\t\t\tLast face %d found. Resetting index.\n", delaunay->
faceIndex);
820 int point_Index1=0, point_Index2=0;
823 double new_distance=0.0;
828 for (edge_Index=0; edge_Index<delaunay->
dcel->
nEdges; edge_Index++)
838 if ((point_Index1 >= 0) && (point_Index2 >= 0))
848 if (new_distance < lowest_Dist)
851 lowest_Dist = new_distance;
853 (*first) = point_Index1;
854 (*second) = point_Index2;
875 double *lowest_Distance)
893 int *candidates=NULL, *refCandidates=NULL;
897 bool allocationError=
false;
899 #ifdef LOCATION_STATISTICS 901 location_Stat.current++;
902 location_Stat.begin[location_Stat.current] = getTime();
903 location_Stat.nTrianglesSearched[location_Stat.current] = 0;
906 #ifdef DEBUG_SELECT_CLOSEST_POINT 907 printf(
"Point to search: ");
918 #ifdef DEBUG_SELECT_CLOSEST_POINT 919 printf(
"Leaf node found: %d\n", node_Index);
922 candidates = (
int *) calloc( candidatesSize,
sizeof(
int));
931 inserted[candidates[
in]] =
TRUE;
932 #ifdef DEBUG_SELECT_CLOSEST_POINT 933 printf(
"Inserted point %d. # %d. In %d. Out %d\n", candidates[in], nItems+1, in, out);
941 allocationError =
false;
942 while ((!found) && (!allocationError))
944 #ifdef DEBUG_SELECT_CLOSEST_POINT 945 printf(
"Checking Point %d.\n", candidates[out]);
947 if (candidates[out] >= 0)
949 #ifdef LOCATION_STATISTICS 951 location_Stat.nTrianglesSearched[location_Stat.current]++;
962 (*lowest_Distance) =
distance( p, q);
964 #ifdef DEBUG_SELECT_CLOSEST_POINT 965 printf(
"Point %d found.\n", candidates[out]);
971 #ifdef DEBUG_SELECT_CLOSEST_POINT 972 printf(
"Discard point %d.\n", candidates[out]);
978 first_Point = current_Point;
983 if (nItems == candidatesSize)
985 #ifdef DEBUG_SELECT_CLOSEST_POINT 986 printf(
"Circular buffer is full. Size %d and current # elements %d\n",
991 nElems = candidatesSize - out;
994 refCandidates = candidates;
995 candidatesSize = candidatesSize*2;
996 candidates = (
int *) calloc( candidatesSize,
sizeof(
int));
997 if (candidates != NULL)
1000 memcpy( candidates, &refCandidates[out], nElems*
sizeof(
int));
1001 memcpy( &candidates[nElems], refCandidates, (nItems-nElems)*
sizeof(
int));
1002 free( refCandidates);
1007 sprintf( log_Text,
"Error allocating neighbors array in select_Closest_Point.\n");
1008 write_Log( log_Text);
1010 printf(
"Error allocating neighbors array in select_Closest_Point.\n");
1011 allocationError =
true;
1019 if (current_Point >= 0)
1021 if (!inserted[current_Point])
1023 inserted[current_Point] =
TRUE;
1026 candidates[
in] = current_Point;
1029 in = in % candidatesSize;
1030 #ifdef DEBUG_SELECT_CLOSEST_POINT 1031 printf(
"Inserted point %d. # %d. In %d. Out %d\n", current_Point, nItems, in, out);
1034 #ifdef DEBUG_SELECT_CLOSEST_POINT 1037 printf(
"Point %d already checked.\n", current_Point);
1048 while (current_Point != first_Point);
1054 allocationError =
true;
1059 #ifdef DEBUG_SELECT_CLOSEST_POINT 1060 printf(
"All %d neighbors inserted.\n", candidates[out]);
1065 #ifdef DEBUG_SELECT_CLOSEST_POINT 1068 printf(
"Imaginary point %d.\n", candidates[out]);
1073 #ifdef DEBUG_SELECT_CLOSEST_POINT 1074 printf(
"Removed point %d. # %d. In %d. Out %d\n", candidates[out], nItems-1, in, out+1);
1079 out = out % candidatesSize;
1093 #ifdef DEBUG_SELECT_CLOSEST_POINT 1094 printf(
"Start search in node %d\n", node_Index);
1096 while ((!found) && (i < nChildren))
1101 #ifdef LOCATION_STATISTICS 1103 location_Stat.nTrianglesSearched[location_Stat.current]++;
1106 #ifdef DEBUG_SELECT_CLOSEST_POINT 1107 printf(
"Checking %d-child in node %d. Node %d\n", i, child_Index, node_Index);
1113 node_Index = child_Index;
1117 #ifdef DEBUG_SELECT_CLOSEST_POINT 1118 printf(
"Point inside node %d\n", node_Index);
1130 while ((!found) && (i < nChildren))
1143 (*lowest_Distance) = 0.0;
1148 #ifdef DEBUG_SELECT_CLOSEST_POINT 1149 printf(
"Index point %d. Distance %lf\n", delaunay->
graph.
nodes[child_Index].
points_Index[i], (*lowest_Distance));
1164 printf(
"ERROR: No nodes surround new point.\n");
1167 sprintf( log_Text,
"ERROR: No nodes surround new point.\n");
1168 write_Log( log_Text);
1177 #ifdef LOCATION_STATISTICS 1178 location_Stat.end[location_Stat.current] = getTime();
1197 double *lowest_Distance)
1200 bool foundClosest=
false;
1201 bool foundEdge=
false;
1205 int selectedVertex=0;
1207 double newDistance=0.0;
1215 #ifdef LOCATION_STATISTICS 1217 location_Stat.current++;
1218 location_Stat.nTrianglesSearched[location_Stat.current] = 0;
1224 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1225 printf(
"Point (%f,%f) is exterior to convex hull\n", p->
x, p->
y);
1231 for (i=0; i<nPoints ;i++)
1235 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1236 printf(
"Point %d is (%f,%f). Distance %f\n", index+1,
1241 if (newDistance < (*lowest_Distance))
1244 (*lowest_Distance) = newDistance;
1245 selectedVertex =
index;
1246 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1247 printf(
"New point is closer\n");
1254 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1255 printf(
"Point (%f,%f) is INTERIOR to convex hull\n", p->
x, p->
y);
1256 printf(
"Selecting %d random anchors\n", nAnchors);
1258 srand((
int) time(NULL));
1261 for (i=0; i<nAnchors ;i++)
1264 index = rand() % dcel->
nVertex;
1268 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1269 printf(
"Point %d is (%f,%f). Distance %f\n", index+1,
1274 if (newDistance < (*lowest_Distance))
1277 (*lowest_Distance) = newDistance;
1278 selectedVertex =
index;
1279 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1280 printf(
"New point is closer\n");
1289 foundClosest =
false;
1290 while (!foundClosest)
1292 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1293 printf(
"Searching in face %d\n", faceID);
1298 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1299 printf(
"Point (%f,%f) is interior to face %d\n", p->
x, p->
y, faceID);
1305 edgeIndex = dcel->
faces[faceID].
edge - 1;
1315 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1316 printf(
"Point %d is (%f,%f). Distance %f\n", index+1,
1321 if (newDistance < (*lowest_Distance))
1324 (*lowest_Distance) = newDistance;
1325 selectedVertex =
index;
1326 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1327 printf(
"New point %d is closer\n", index+1);
1338 foundClosest =
true;
1340 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1341 printf(
"Closest point index %d is (%f,%f)\n", selectedVertex+1, q->
x, q->
y);
1347 edgeIndex = dcel->
faces[faceID].
edge - 1;
1357 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1358 printf(
"Checking edge %d. Points %d %d\n", edgeIndex+1,
1370 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1371 printf(
"Right turn. New face is %d\n", faceID);
1378 #ifdef DEBUG_SELECT_CLOSEST_DCEL 1379 printf(
"Left turn. New edge is %d\n", edgeIndex+1);
1387 return(foundClosest);
1421 int is_Interior=
FALSE;
1422 int id1=0, id2=0, id3=0;
1427 #ifdef DEBUG_IS_INTERIOR_TO_NODE 1428 printf(
" Vertices %d %d %d\n", id1, id2, id3);
1440 return(is_Interior);
1445 int is_Interior=
FALSE;
1446 int id1=0, id2=0, id3=0;
1460 return(is_Interior);
1471 bool finished=
false;
1477 #ifdef DEBUG_ANALYZE_FACE 1478 printf(
"*******************\nSearching point %d coordinates (%lf,%lf)\n", point_Index+1,
1490 #ifdef DEBUG_ANALYZE_FACE 1491 printf(
"Found leaf node %d.\n", node_Index);
1497 #ifdef DEBUG_ANALYZE_FACE 1498 printf(
"It is strictly interior\n");
1506 #ifdef DEBUG_ANALYZE_FACE 1507 printf(
"It is over an edge\n");
1524 #ifdef DEBUG_ANALYZE_FACE 1525 printf(
"Trying %d-child from node %d: node id %d.\n", i, node_Index, delaunay->
graph.
nodes[node_Index].
children_Index[i]);
1532 #ifdef DELAUNAY_STATISTICS 1534 delaunay_Stat.trianglesFound[
i]++;
1543 #ifdef DEBUG_ANALYZE_FACE 1544 printf(
"Interior to node %d. Fetch node data.\n", node_Index);
1561 printf(
"CRITICAL ERROR: point (%lf,%lf) is not interior to any node.\n", point->
vertex.
x, point->
vertex.
y);
1562 printf(
"Current node %d has %d children.\n", node_Index, delaunay->
graph.
nodes[node_Index].
nChildren);
1583 int collinear_Edge_ID=0, collinear_Index=0;
1584 int flip_Candidates[2];
1586 int old_Node_ID1=0, old_Node_ID2=0;
1599 node =
get_Node( graph, node_Index);
1605 if (nTriangles == 3)
1617 insertEdge( dcel, point_Index+1, new_Edge_ID+1, new_Edge_ID+3, next_Edge_ID, new_Face_ID);
1619 new_Edge_ID+2, new_Face_ID);
1622 insertEdge( dcel, point_Index+1, new_Edge_ID+3, new_Edge_ID+5, prev_Edge_ID, new_Face_ID+1);
1624 new_Edge_ID+4, new_Face_ID+1);
1645 new_Node[0].face_ID = node->
face_ID;
1650 new_Node[1].face_ID = new_Face_ID;
1655 new_Node[2].face_ID = new_Face_ID + 1;
1657 if (area[0] > area[1])
1660 if (area[2] > area[0])
1670 if (area[2] > area[1])
1687 if (area[2] > area[1])
1696 if (area[2] > area[0])
1723 if (collinear_Edge_ID != -1)
1725 collinear_Index = collinear_Edge_ID - 1;
1731 #ifdef DEBUG_SPLIT_TRIANGLE 1732 printf(
"Collinear edges are %d and %d. Origins are %d and %d\n",
1737 printf(
"Faces that share edge are:\n");
1743 flip_Candidates[0] = next_Edge_ID;
1744 flip_Candidates[1] = prev_Edge_ID;
1752 collinear_Edge_ID, node->
face_ID);
1755 insertEdge( dcel, point_Index+1, new_Edge_ID, new_Edge_ID+2, prev_Edge_ID, new_Face_ID);
1757 new_Edge_ID+1, new_Face_ID);
1767 node =
get_Node( graph, old_Node_ID1);
1777 new_Node[0].face_ID = dcel->
edges[collinear_Index].
face;
1779 #ifdef DEBUG_SPLIT_TRIANGLE 1780 printf(
"Splitting first triangle\n");
1786 new_Node[1].face_ID = new_Face_ID;
1791 #ifdef DEBUG_SPLIT_TRIANGLE 1792 printf(
"Splitting second triangle\n");
1798 collinear_Index = collinear_Edge_ID-1;
1803 insertEdge( dcel, point_Index+1, new_Edge_ID+2, new_Edge_ID+4, next_Edge_ID, new_Face_ID+1);
1805 new_Edge_ID+3, new_Face_ID+1);
1808 insertEdge( dcel, point_Index+1, new_Edge_ID+4, collinear_Edge_ID, prev_Edge_ID, dcel->
edges[collinear_Index].
face);
1816 node =
get_Node( graph, old_Node_ID2);
1826 new_Node[0].face_ID = dcel->
edges[collinear_Index].
face;
1828 update_Face( dcel, collinear_Edge_ID, new_Node[0].face_ID);
1829 #ifdef DEBUG_SPLIT_TRIANGLE 1830 printf(
"Splitting third triangle\n");
1836 new_Node[1].face_ID = dcel->
edges[next_Edge_ID - 1].
face;
1842 #ifdef DEBUG_SPLIT_TRIANGLE 1843 printf(
"Splitting forth triangle\n");
1848 check_Edge( dcel, graph, flip_Candidates[0]);
1849 check_Edge( dcel, graph, flip_Candidates[1]);
1855 #ifdef DEBUG_SPLIT_TRIANGLE 1858 printf(
"Collinear edge is negative. Point index %d and face edge %d\n", point_Index, face->
edge);
1892 int collinear_Edge=0;
1893 int id1=0, id2=0, id3=0;
1897 edge_Index = edge_ID - 1;
1904 #ifdef DEBUG_SELECT_COLLINEAR_EDGE 1905 printf(
"Triangles points are %d, %d and %d\n", id1, id2, id3);
1914 #ifdef DEBUG_SELECT_COLLINEAR_EDGE 1915 printf(
"Collinear to points %d and %d\n", id1, id2);
1922 #ifdef DEBUG_SELECT_COLLINEAR_EDGE 1923 printf(
"Collinear to points %d and %d\n", id2, id3);
1925 collinear_Edge = edge_ID;
1930 #ifdef DEBUG_SELECT_COLLINEAR_EDGE 1931 printf(
"Collinear to points %d and %d\n", id3, id1);
1937 printf(
"Checking when point is collinear but it is not.\n");
1939 sprintf( log_Text,
"Checking when point is collinear but it is not.\n");
1940 write_Log( log_Text);
1942 collinear_Edge = -1;
1945 #ifdef DEBUG_SELECT_COLLINEAR_EDGE 1946 printf(
"Collinear edge is %d\n", collinear_Edge);
1949 return(collinear_Edge);
1959 int old_Node_ID1=0, old_Node_ID2=0;
1963 edge_Index = edge_ID-1;
1966 edge =
get_Edge( dcel, edge_Index);
1970 printf(
"FLIPPING EDGES %d and %d\n", edge_Index+1, dcel->
edges[edge_Index].
twin_Edge);
1973 printf(
"Higher than number of faces\n");
1991 if (edge->origin_Vertex > 0)
2022 dcel->
edges[edge->previous_Edge-1].
face = edge->face;
2030 node =
get_Node( graph, old_Node_ID1);
2037 node =
get_Node( graph, old_Node_ID2);
2047 new_Node.face_ID = edge->face;
2052 new_Node.face_ID = twin->
face;
2056 check_Edge( dcel, graph, edge->previous_Edge);
2063 int flip_Edges=
FALSE;
2065 struct Point_T *common1=NULL, *common2=NULL, *p=NULL, *q=NULL;
2068 edge_Index = edge_ID-1;
2170 #ifdef DELAUNAY_STATISTICS 2172 delaunay_Stat.nFlipped++;
2174 #ifdef DEBUG_CHECK_EDGES 2175 printf(
"Flipping edge %d\n", edge_ID);
int update_Face(struct DCEL_T *dcel, int edge_ID, int index)
void build_Voronoi(struct Voronoi_T *voronoi, struct DCEL_T *dcel)
struct Dcel_Vertex_T * get_Vertex(struct DCEL_T *dcel, int index)
int get_Graph_Length(struct Graph_T *graph)
int initialize_DCEL(struct DCEL_T *dcel, int nPoints, int nEdges, int nFaces)
int insert_Node(struct Graph_T *graph, struct Node_T *node)
void delete_Delaunay(struct Delaunay_T *delaunay)
struct Point_T * get_Vertex_Point(struct DCEL_T *dcel, int index)
void finalize_Voronoi(struct Voronoi_T *voronoi)
int get_iChildren_Node(struct Graph_T *graph, int node_Index, int child_Index)
int get_Face_Points(struct Delaunay_T *delaunay, int face_ID, struct Point_T *p, struct Point_T *q, struct Point_T *r)
void get_Vertex_Of_Node(struct Graph_T *graph, int node_Index, int *index1, int *index2, int *index3)
int get_Node_Assigned(struct Graph_T *graph, int face_ID)
void build_Delaunay_From_Triangulation(struct DCEL_T *dcel)
struct Dcel_Face_T * get_Face(struct DCEL_T *dcel, int index)
int lexicographic_Higher(struct Point_T *p1, struct Point_T *p2)
void select_Two_Closest(struct Delaunay_T *delaunay, int *first, int *second)
int select_Closest(struct Delaunay_T *delaunay, int index)
int get_Number_Edges(struct DCEL_T *dcel)
int insert_Point(struct Delaunay_T *delaunay, double x, double y)
void finalize_DCEL(struct DCEL_T *dcel)
int is_External_Edge(struct DCEL_T *dcel, int index)
void print_Graph(struct Graph_T *graph)
void insert_First_Node(struct Delaunay_T *delaunay)
struct Node_T * get_Node(struct Graph_T *graph, int index)
bool next_Face_Iterator(struct Delaunay_T *delaunay, struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
int is_Leaf_Node(struct Graph_T *graph, int index)
enum Turn_T return_Turn(struct DCEL_T *dcel, struct Point_T *p, int source_ID, int dest_ID)
int select_Colinear_Edge(struct DCEL_T *dcel, int point_Index, int edge_ID)
bool analyze_Face(struct Delaunay_T *delaunay, int point_Index)
void print_Point(struct Point_T *point)
int equal_Point(struct Point_T *p1, struct Point_T *p2)
void printFace(struct DCEL_T *dcel, int faceID)
#define N_POINTS_TRIANGLE
void finalize_Graph(struct Graph_T *graph)
bool select_Closest_Point(struct Delaunay_T *delaunay, struct Point_T *p, struct Point_T *q, double *lowest_Distance)
int in_Circle(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3, struct Point_T *q)
struct Dcel_Edge_T * edges
double modified_Signed_Area(struct DCEL_T *dcel, struct Node_T *node)
void purge_Delaunay(struct Delaunay_T *delaunay)
int is_Interior_To_Node(struct DCEL_T *dcel, struct Graph_T *graph, struct Point_T *p, int node_Index)
int write_DCEL(struct DCEL_T *dcel, int type, const char *fileName)
int get_Number_Faces(struct DCEL_T *dcel)
int get_nChildren_Node(struct Graph_T *graph, int index)
void update_Node(struct Graph_T *graph, int index, int nChildren, struct Node_T *node)
struct Dcel_Vertex_T * vertex
int initialize_Delaunay(struct Delaunay_T *delaunay, struct DCEL_T *dcel)
int is_Negative_Any_Vertex(struct DCEL_T *dcel, int edgeID)
void flip_Edges_Dcel(struct DCEL_T *dcel, struct Graph_T *graph, int edge_ID)
TYPE distance(struct Point_T *p, struct Point_T *q)
bool is_Interior_To_Face(struct DCEL_T *dcel, struct Point_T *p, int face_ID)
struct Dcel_Edge_T * get_Edge(struct DCEL_T *dcel, int index)
int get_Edge_Origin_Vertex(struct DCEL_T *dcel, int edge_Index)
TYPE signed_Area(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
void split_Triangle(struct DCEL_T *dcel, struct Graph_T *graph, int point_Index, int node_Index, int nTriangles)
void incremental_Delaunay(struct Delaunay_T *delaunay)
void finalize_Delaunay(struct Delaunay_T *delaunay)
int init_Delaunay(struct Delaunay_T *delaunay, int nPoints)
int inner_To_Voronoi_Area(struct Voronoi_T *voronoi, int index, struct Point_T *q)
enum Turn_T check_Turn(struct Point_T *p1, struct Point_T *p2, struct Point_T *p3)
int create_Delaunay_Triangulation(struct Delaunay_T *delaunay, int createVoronoi)
void print_DCEL(struct DCEL_T *dcel)
int resize_DCEL(struct DCEL_T *dcel, enum Resize_DCEL_T resize_Type)
int is_Strictly_Interior_To_Node(struct DCEL_T *dcel, struct Graph_T *graph, struct Point_T *p, int node_Index)
int update_Vertex_Edge_At(struct DCEL_T *dcel, int edge_ID, int index)
int initialize_Voronoi(struct Voronoi_T *voronoi, int nPoints)
bool is_Interior_To_Convex_Hull(struct DCEL_T *dcel, struct Point_T *p, bool *error)
bool select_Closest_Point_DCEL(struct DCEL_T *dcel, int nAnchors, struct Point_T *p, struct Point_T *q, double *lowest_Distance)
void check_Edge(struct DCEL_T *dcel, struct Graph_T *graph, int edge_ID)
struct Dcel_Face_T * faces
bool get_Convex_Hull(struct DCEL_T *dcel, int *length, int *points)
int set_Edge_Not_Checked(struct DCEL_T *dcel, int index, int *n)
int insertFace(struct DCEL_T *dcel, int edge_ID)
void set_Highest_First(struct DCEL_T *dcel, int(*f)(struct Point_T *, struct Point_T *))
int initialize_Graph(struct Graph_T *graph, int size)
int insertEdge(struct DCEL_T *dcel, int origin, int twin, int prev, int next, int face)
int update_Edge(struct DCEL_T *dcel, int origin, int twin, int prev, int next, int face, int index)