From 72fe2a0a38e9c38df292b9983c75f41826837846 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 19 May 2023 13:15:44 +0200 Subject: Implement data_template_rotate_group() --- src/adjust_detector.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/adjust_detector.c b/src/adjust_detector.c index 8c7e6aec..ab46a9df 100644 --- a/src/adjust_detector.c +++ b/src/adjust_detector.c @@ -58,9 +58,9 @@ static void show_help(const char *s) " -p, --panel=p Panel (or group) to move\n" " --mm Interpret shifts as mm, not px\n" "\n" - " -a Rotation around x-axis\n" - " -b Rotation around y-axis\n" - " -c Rotation around z-axis\n" + " -a Rotation around x-axis (deg)\n" + " -b Rotation around y-axis (deg)\n" + " -c Rotation around z-axis (deg)\n" " -x Shift in x direction\n" " -y Shift in y direction\n" " -z Shift in z direction\n" @@ -214,5 +214,27 @@ int main(int argc, char *argv[]) return 1; } + if ( data_template_rotate_group(dtempl, group, deg2rad(x_rot), 'x') ) { + ERROR("Failed to rotate group around x.\n"); + return 1; + } + + if ( data_template_rotate_group(dtempl, group, deg2rad(y_rot), 'y') ) { + ERROR("Failed to rotate group around y.\n"); + return 1; + } + + if ( data_template_rotate_group(dtempl, group, deg2rad(z_rot), 'z') ) { + ERROR("Failed to rotate group around z.\n"); + return 1; + } + + if ( data_template_write_to_file(dtempl, out_geom) ) { + ERROR("Failed to save geometry file.\n"); + return 1; + } + + data_template_free(dtempl); + return 0; } -- cgit v1.2.3