#define PROG_NAME "UnglueCell" #define PROG_DESC "???" #define PROG_VERS "1.0" /* Last edited on 2024-12-21 11:38:27 by stolfi */ #define UnglueCell_C_COPYRIGHT \ "" #define PROG_INFO \ "" \ " " #include #include #include #include #include TYPE typedef struct Options_t { char *inFile; uint cellnum; char *outFile; } Options_t *GetOptions(int argc, char **argv); int main(int argc, char **argv) Place_t *b; { Options_t *o = GetOptions(argc, argv); char *topo_cmt = jsprintf("Created by %s on %s", PROG_NAME, Today()); /* Random_t coins = MakeRandomSource(4615); */ ??? tc = Triangulation.ReadToMa(o->inFile); ??? top = tc.top; ??? a = Srot(top->cell[o->cellnum]); ??? top = MakeCellTopology(a); { /* ungluing the cell top->cell[i] */ for (j = 0; j < top.wall.nel; j++) { ??? fer = top.fRef[j] DO b = fer; do { Triangulation.SetOrg(Srot(b); with (NULL); b = NextE(b) } while (!( b == fer)); } } /* building the new topology */ ??? top = MakeElemTable(top->node[top->node.nel-1]; with (1), double c = GenCoords(top)^; double name = o->outFile ){ WriteTopology(name, top, "Created by MakeGem: " & name & ".top on " \ Today()); WriteMaterials(name, top, "Created by MakeGem: " & name& ".ma on " \ Today()); WriteState(name, top, c, "Created by MakeGem: " & name & ".st on " \ Today() &"\nRandom Geometry"); } return 0; } Options_t GetOptions () { Options_t *o = (Options_t *)malloc(sizeof(Options_t)); argparser_t *pp = argparser_new(stderr, argc, argv); argparser_set_help(pp, PROG_NAME " version " PROG_VERS ", usage:\n" PROG_HELP); argparser_set_info(pp, PROG_INFO); argparser_process_help_info_options(pp); argparser_get_keyword(pp, "-inFile"); o->inFile = argparser_get_next(pp); argparser_get_keyword(pp, "-cellnum"); o->cellnum = argparser_get_next_int(pp, ); argparser_get_keyword(pp, "-outFile"); o->outFile = argparser_get_next(pp); argparser_finish(pp); ----------------------------------- #define _HELP \ fprintf(stderr, "Usage: Teste" \ " -inFile " \ "\n"); END¦ } } return o; } /* END GetOptions */ { DoIt() } UnglueCell. /* Copyright © 2001 Universidade Estadual de Campinas (UNICAMP) */