* inline a few more methods to speed calculation.
[hkl.git] / src / hkl-axis.c
blob8703445922ed32a7c27a750af127e0f1dcc3fb64
1 #include <stdlib.h>
2 #include <math.h>
4 #include <hkl/hkl-axis.h>
5 #include <hkl/hkl-quaternion.h>
7 static HklAxisConfig hkl_axis_config_default = {{-M_PI, M_PI}, 0., 1};
9 void hkl_axis_init(HklAxis *self, char const *name, HklVector const *axis_v)
11 self->name = name;
12 self->axis_v = *axis_v;
13 self->config = hkl_axis_config_default;
16 void hkl_axis_get_config(HklAxis *axis, HklAxisConfig *config)
18 *config = axis->config;
21 void hkl_axis_set_config(HklAxis *axis, HklAxisConfig *config)
23 axis->config = *config;
24 axis->config.dirty = HKL_TRUE;
27 void hkl_axis_clear_dirty(HklAxis *axis)
29 axis->config.dirty = HKL_FALSE;