star-gs

Literate program for a geometric sensitivity calculation
git clone git://git.meso-star.fr/star-gs.git
Log | Files | Refs | README | LICENSE

commit f17035cbb3f42d9abda8a89d1cae3ff99a0ffc46
parent 9b4f6e83f6ff79f2bdc2788b73583ffcf0a96022
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Mon,  3 May 2021 19:27:22 +0200

Add the "default" parameter to the box|slope|step geometries

Diffstat:
Msrc/sgs_args.c | 21++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)

diff --git a/src/sgs_args.c b/src/sgs_args.c @@ -43,6 +43,9 @@ print_help(void) " define an axis aligned bounding box (default)\n" " Available box parameters are:\n"); printf( +" default\n" +" use default settings.\n"); + printf( " low=x,y,z\n" " define the lower bound of the box\n" " (default: %g,%g,%g).\n", @@ -70,6 +73,9 @@ print_help(void) " by a step along the X axis. Available step parameters\n" " are:\n"); printf( +" default\n" +" use default settings.\n"); + printf( " low=x,y,z\n" " define the lower bound (default: %g,%g,%g).\n", SGS_GEOMETRY_STEP_ARGS_DEFAULT.lower[0], @@ -97,6 +103,9 @@ print_help(void) " define an axis aligned box whose +Z face is tilted\n" " along the X axis. Available slope parameters are:\n"); printf( +" default\n" +" use default settings.\n"); + printf( " low=x,y,z\n" " define the lower bound (default: %g,%g,%g).\n", SGS_GEOMETRY_SLOPE_ARGS_DEFAULT.lower[0], @@ -148,7 +157,9 @@ parse_box_parameters(const char* str, void* ptr) key = strtok_r(buf, "=", &ctx); val = strtok_r(NULL, "", &ctx); - if(!strcmp(key, "low")) { + if(!strcmp(key, "default")) { + *box = SGS_GEOMETRY_BOX_ARGS_DEFAULT; + } else if(!strcmp(key, "low")) { res = cstr_to_list_double(val, ',', box->lower, &len, 3); if(res == RES_OK && len != 3) res = RES_BAD_ARG; } else if(!strcmp(key, "upp")) { @@ -196,7 +207,9 @@ parse_slope_parameters(const char* str, void* ptr) key = strtok_r(buf, "=", &ctx); val = strtok_r(NULL, "", &ctx); - if(!strcmp(key, "low")) { + if(!strcmp(key, "default")) { + *slope = SGS_GEOMETRY_SLOPE_ARGS_DEFAULT; + } else if(!strcmp(key, "low")) { res = cstr_to_list_double(val, ',', slope->lower, &len, 3); if(res == RES_OK && len != 3) res = RES_BAD_ARG; } else if(!strcmp(key, "upp")) { @@ -247,7 +260,9 @@ parse_step_parameters(const char* str, void* ptr) key = strtok_r(buf, "=", &ctx); val = strtok_r(NULL, "", &ctx); - if(!strcmp(key, "low")) { + if(!strcmp(key, "default")) { + *step = SGS_GEOMETRY_STEP_ARGS_DEFAULT; + } else if(!strcmp(key, "low")) { res = cstr_to_list_double(val, ',', step->lower, &len, 3); if(res == RES_OK && len != 3) res = RES_BAD_ARG; } else if(!strcmp(key, "upp")) {