int main(int argc, char *argv[]) { int c; triangulate = debug = 0; plot = 1; while ((c = getopt(argc, argv, "dpt")) != EOF) { switch (c) { case 'd': debug = 1; break; case 't': triangulate = 1; plot = 0; break; case 'p': plot = 1; break; } } freeinit(&sfl, sizeof(Site)); readsites(); siteidx = 0; geominit(); if (plot) { plotinit(); } voronoi(nextone); return (0); }
void initialize_state(int debug) { /* Set up our initial state */ rubyvorState.debug = debug; rubyvorState.plot = 0; rubyvorState.nsites = 0; rubyvorState.siteidx = 0; rubyvorState.storeT = storeTriangulationTriplet; rubyvorState.storeL = storeLine; rubyvorState.storeE = storeEndpoint; rubyvorState.storeV = storeVertex; rubyvorState.storeS = storeSite; /* Initialize the Site Freelist */ freeinit(&(rubyvorState.sfl), sizeof(Site)) ; /* Initialize the geometry module */ geominit() ; /* TODO: remove C plot references */ if (rubyvorState.plot) plotinit(); }