aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2023-05-19 13:15:44 +0200
committerThomas White <taw@physics.org>2023-07-28 13:22:05 +0200
commit72fe2a0a38e9c38df292b9983c75f41826837846 (patch)
tree30cd10a610d285e8ffa87c3d8351db81cc5342dc /src
parent76e4104d16297fcae082df9a4e63adbdda19c92d (diff)
Implement data_template_rotate_group()
Diffstat (limited to 'src')
-rw-r--r--src/adjust_detector.c28
1 files changed, 25 insertions, 3 deletions
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;
}