#define PROG_NAME "WhatAttributes" #define PROG_DESC "???" #define PROG_VERS "1.0" /* Last edited on 2024-12-21 11:35:14 by stolfi */ #define WhatAttributes_C_COPYRIGHT \ "" #define PROG_INFO \ "" \ " " /* Program to find what type of geometric degeneration exists in a given arbitrary topology (triangulation or not). The "detail" option allows to print detail information about the degeneracies. Otherwise only an abstract information is printed. */ #define WhatAttributes_C_author \ "Created by L. Lozada, 1999-2000.\n" \ "Modified 2000-06-08: Including the number of original nodes\n" #include #include #include #include VAR nve,nee,nfe,npe: uint = 0; TYPE typedef struct Options_t { inFile: char *; bool_t detail; } /* Initial guess file name (minus ".tp") */ Options_t *GetOptions(int argc, char **argv); int main(int argc, char **argv) { 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; { /* Clean the marks for the attribute degenerate */ for (i = 0; i < top->node.nel; i++) { ??? vi = top->node[i]; { if (0 == strcmp(vi.label, "VV"))){ nve++;}; } } for (i = 0; i < top->NE; i++) { ??? ei = top->edge[i]; { if (ei->exists){ nee++;}; } } for (i = 0; i < top->wall.nel; i++) { ??? fi = top->wall[i]; { if (fi->exists){ nfe++;} } } for (i = 0; i < top->cell.nel; i++) { ??? pi = top->cell[i]; { if (pi->exists){ npe++;} } } fprintf(stderr, "there are "&Fmt.Int(nve)&" existing nodes\n"); fprintf(stderr, "there are "&Fmt.Int(nee)&" existing @{edge->?}s\n"); fprintf(stderr, "there are "&Fmt.Int(nfe)&" existing walls\n"); fprintf(stderr, "there are "&Fmt.Int(npe)&" existing cells\n"); } } DoIt; Options_t *GetOptions(int argc, char **argv) { 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); o->detail = argparser_keyword_present(pp, "-detail"); argparser_finish(pp); ----------------------------------- #define _HELP \ fprintf(stderr, "Usage: WhatAttributes" \ " -inFile [ -detail ]\n"); END¦ } } return o; } /* END GetOptions */ { DoIt() } WhatAttributes. /* Copyright © 2000 Universidade Estadual de Campinas (UNICAMP) */