#define PROG_NAME "MakeNOComplex" #define PROG_DESC "???" #define PROG_VERS "1.0" #define MakeNOComplex_C_COPYRIGHT \ "" #define PROG_INFO \ "" \ " " /* This program generates ".tp",".tb",".st" and ".ma" files for another tridimensional complexes with topologies of pseudo three-manifolds. The node coordinates are random numbers in [-1..+1]. Notice: we need to modify the facet-edge data structure for modeling ------ those non orientable 3D complex, or use another data structure */ #define MakeNOComplex_C_author \ "Implemented by L. Lozada, 1999-2000." #include #include #include #include #include #define _GNU_SOURCE #include #include TYPE double Shape = {Projective}; typedef struct Options_t { Shape shape; char *shapeName; } Options_t *GetOptions(int argc, char **argv); int main(int argc, char **argv) { Options_t *o = GetOptions(argc, argv); char *topo_cmt = NULL; asprintf(&topo_cmt, "Created by %s on %s", PROG_NAME, Today()); /* Random_t coins = MakeRandomSource(4615); */ ??? m = MakeMap(o->shape); ??? t = MakeTopology(m); Coords_t c = GenCoords(&t);; { WriteTopology(o->output, flag, &t, topo_cmt); // shapeName MakeNOComplex shapeName WriteState( o->shapeName, t, c,"Created by MakeNOComplex: " & o->shapeName \ ".st on " & Today() & "\nRandom Geometry" ); WriteMaterials(o->output, flag, &t, topo_cmt); // shapeName MakeNOComplex shapeName return 0; } Place_t MakeMap(Shape shape) { CASE shape OF break; case Shape_Projective: return MakeProjective(); } } /* END MakeMap */ Place_t MakeProjective() /* Notice: we need to modify the facet-edge data structure for modeling this non orientable 3D complex. */ { ??? co = MakeCube(); { GlueCube(co.el[1], Clock(PrevF(co.el[2]))); GlueCube(co.el[5], co.el[0]); GlueCube(co.el[4], NextE(NextE(co.el[2]))); fprintf(stderr, "Building Topology of ProjectiveSpace: \n"); /* Return one @place not kill by the GlueBall Procedure */ return co.el[0]; } } /* END MakeProjective */ 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); { ¦TRY argparser_get_keyword(pp, "-shape"); o->shapeName = argparser_get_next(pp); if (0 == strcmp(o->shapeName, "projective"))) { o->shape = Shape_Projective } else { argparser_error(pp, "Bad shape \"" & argparser_get_next(pp) & "\"\n") } argparser_finish(pp); ----------------------------------- #define _HELP \ fprintf(stderr,"Usage: OtherComplex -shape { projective }\n"); END¦ } } return o; } /* END GetOptions */ /* end MakeNOComplex */ /* Copyright © 2000 Universidade Estadual de Campinas (UNICAMP) */