2021-09-09 17:10:24 +10:00
|
|
|
#ifndef DCEL_HEADER
|
|
|
|
#include "dcel.h"
|
|
|
|
#endif
|
2021-09-08 21:48:00 +10:00
|
|
|
|
2021-09-09 17:10:24 +10:00
|
|
|
#ifndef VORONOI_HEADER
|
|
|
|
#define VORONOI_HEADER
|
2021-09-08 21:48:00 +10:00
|
|
|
|
2021-09-11 22:47:44 +10:00
|
|
|
/* Prints bisectors to an output file */
|
|
|
|
void stage1PrintBisector(bisector_t *bisector, FILE *outputFile);
|
|
|
|
|
2021-09-13 12:27:17 +10:00
|
|
|
/* Prints intersections to an output file */
|
|
|
|
void stage2PrintIntersection(intersection_t *intersection, FILE *outputFile);
|
2021-09-09 21:23:53 +10:00
|
|
|
|
2021-09-15 00:06:04 +10:00
|
|
|
/* Prints the watchtower information to an output file */
|
|
|
|
void stage34PrintTowers(tower_t *tower, FILE *outputFile, double diameter);
|
|
|
|
|
|
|
|
/* Returns the face a tower is in */
|
|
|
|
int getFaceTowerIsIn(DCEL_t *dcel, tower_t *tower);
|
|
|
|
|
|
|
|
/* Adds the watchtower to the Voronoi diagram represented by the given DCEL,
|
|
|
|
* applying required splits and setting the watchtower as required.
|
|
|
|
*/
|
|
|
|
void incrementalVoronoi(DCEL_t *voronoi, tower_t *tower);
|
|
|
|
|
|
|
|
/* Creates a new Voronoi structure */
|
|
|
|
DCEL_t *newVoronoi(DCEL_t *voronoi, tower_t *towerA, tower_t *towerB);
|
|
|
|
|
2021-09-09 17:10:24 +10:00
|
|
|
/* Outputs the bisector equations from pointsFile into outputFile */
|
|
|
|
void stage1(char *pointsFileName, char *outputFileName);
|
2021-09-08 21:48:00 +10:00
|
|
|
|
2021-09-09 17:10:24 +10:00
|
|
|
/* Outputs the intersections the bisectors make with the polygon */
|
|
|
|
void stage2(char *pointsFileName, char *polygonFileName, char *outputFileName);
|
2021-09-08 21:48:00 +10:00
|
|
|
|
2021-09-09 17:10:24 +10:00
|
|
|
/* Constructs a Voronoi diagram and prints the resulting diameters */
|
|
|
|
void stage3(char *dataFileName, char *polygonFileName, char *outputFileName);
|
|
|
|
|
|
|
|
/* Same as stage3, but prints diameters in ascending order */
|
|
|
|
void stage4(char *dataFileName, char *polygonFileName, char *outputFileName);
|
2021-09-08 21:48:00 +10:00
|
|
|
|
|
|
|
#endif
|