diff options
author | Thomas White <taw@physics.org> | 2010-06-30 15:33:47 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2012-02-22 15:26:51 +0100 |
commit | 9887bf37a6bc0708d7589968a183cdde4a042f7a (patch) | |
tree | f728462ab593ef9d0c4516b90d3d6f9fd35e0031 /src/render_hkl.c | |
parent | 240daf769ef44d85aff2589c1067836ec76d63ee (diff) |
render_hkl: Take symmetry on command line
Diffstat (limited to 'src/render_hkl.c')
-rw-r--r-- | src/render_hkl.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/render_hkl.c b/src/render_hkl.c index f3fb6b9b..4c3546a7 100644 --- a/src/render_hkl.c +++ b/src/render_hkl.c @@ -35,18 +35,19 @@ static void show_help(const char *s) printf( "Render intensity lists in various ways.\n" "\n" -" -h, --help Display this help message.\n" -" --povray Render a 3D animation using POV-ray.\n" -" --zone-axis Render a 2D zone axis pattern.\n" -" --boost=<val> Squash colour scale by <val>.\n" -" -j <n> Run <n> instances of POV-ray in parallel.\n" -" -p, --pdb=<file> PDB file from which to get the unit cell.\n" +" -h, --help Display this help message.\n" +" --povray Render a 3D animation using POV-ray.\n" +" --zone-axis Render a 2D zone axis pattern.\n" +" --boost=<val> Squash colour scale by <val>.\n" +" -j <n> Run <n> instances of POV-ray in parallel.\n" +" -p, --pdb=<file> PDB file from which to get the unit cell.\n" +" -y, --symmetry=<sym> Expand reflections according to point group <sym>.\n" ); } static void render_za(UnitCell *cell, double *ref, unsigned int *c, - double boost) + double boost, const char *sym) { cairo_surface_t *surface; cairo_t *dctx; @@ -61,7 +62,6 @@ static void render_za(UnitCell *cell, double *ref, unsigned int *c, double csx, csy, csz; signed int h, k; float wh, ht; - const char *sym = "6/mmm"; wh = 1024; ht = 1024; @@ -242,6 +242,7 @@ int main(int argc, char *argv[]) char *pdb = NULL; int r = 0; double boost = 1.0; + char *sym = NULL; /* Long options */ const struct option longopts[] = { @@ -250,6 +251,7 @@ int main(int argc, char *argv[]) {"zone-axis", 0, &config_zoneaxis, 1}, {"pdb", 1, NULL, 'p'}, {"boost", 1, NULL, 'b'}, + {"symmetry", 1, NULL, 'y'}, {0, 0, NULL, 0} }; @@ -273,6 +275,10 @@ int main(int argc, char *argv[]) boost = atof(optarg); break; + case 'y' : + sym = strdup(optarg); + break; + case 0 : break; @@ -286,6 +292,10 @@ int main(int argc, char *argv[]) pdb = strdup("molecule.pdb"); } + if ( sym == NULL ) { + sym = strdup("1"); + } + infile = argv[optind]; cell = load_cell_from_pdb(pdb); @@ -303,12 +313,13 @@ int main(int argc, char *argv[]) if ( config_povray ) { r = povray_render_animation(cell, ref, cts, nproc); } else if ( config_zoneaxis ) { - render_za(cell, ref, cts, boost); + render_za(cell, ref, cts, boost, sym); } else { ERROR("Try again with either --povray or --zone-axis.\n"); } free(pdb); + free(sym); return r; } |