aboutsummaryrefslogtreecommitdiff
path: root/src/hdfsee.c
diff options
context:
space:
mode:
authorRichard A. Kirian <rkirian@asu.edu>2012-01-27 16:26:57 -0800
committerThomas White <taw@physics.org>2012-02-22 15:27:44 +0100
commit252cca2f0ceb760e2a491e25b2ae6e5a2cbeb640 (patch)
tree72faf66a9ef3996895bf7f809fe400503a7e7ec1 /src/hdfsee.c
parent9fa6b17a3ead6d98e73f8f3253f12ebf80a96e77 (diff)
hdfsee: added an option to overlay rings with user-defined radii
Diffstat (limited to 'src/hdfsee.c')
-rw-r--r--src/hdfsee.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/hdfsee.c b/src/hdfsee.c
index ba8d8eea..73373928 100644
--- a/src/hdfsee.c
+++ b/src/hdfsee.c
@@ -99,7 +99,10 @@ int main(int argc, char *argv[])
char *element = NULL;
char *geometry = NULL;
double ring_size = 5.0;
-
+ char *reslist = NULL;
+ double ring_radii[128];
+ int n_rings = -1;
+
/* Long options */
const struct option longopts[] = {
{"help", 0, NULL, 'h'},
@@ -113,6 +116,7 @@ int main(int argc, char *argv[])
{"geometry", 1, NULL, 'g'},
{"show-rings", 0, &config_showrings, 1},
{"ring-size", 1, NULL, 2},
+ {"simple-rings", 1, NULL, 'r'},
{0, 0, NULL, 0}
};
@@ -168,7 +172,26 @@ int main(int argc, char *argv[])
ERROR("Ring size must be numerical.\n");
return 1;
}
-
+ case 'r' :
+ config_showrings = 1;
+ reslist = strdup(optarg);
+ int nchar = strlen(reslist);
+ char thisvalue[128];
+ int i;
+ int j=0;
+ n_rings = 0;
+ for ( i=0; i<=nchar; i++ ) {
+ if ( ( reslist[i] != ',' ) && ( reslist[i] != '\0' ) ) {
+ thisvalue[j] = reslist[i];
+ j++;
+ } else {
+ j=0;
+ thisvalue[i] = '\0';
+ ring_radii[n_rings] = atof(thisvalue);
+ n_rings++;
+ }
+ }
+ break;
case 0 :
break;
@@ -208,6 +231,8 @@ int main(int argc, char *argv[])
colscale, element,
geometry,
config_showrings,
+ ring_radii,
+ n_rings,
ring_size);
if ( main_window_list[i] == NULL ) {
ERROR("Couldn't open display window\n");