1 /* This file is part of the hkl library.
3 * The hkl library is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
8 * The hkl library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with the hkl library. If not, see <http://www.gnu.org/licenses/>.
16 * Copyright (C) 2003-2010 Synchrotron SOLEIL
17 * L'Orme des Merisiers Saint-Aubin
18 * BP 48 91192 GIF-sur-YVETTE CEDEX
20 * Authors: Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr>
22 #ifndef __HKL_AXIS_H__
23 #define __HKL_AXIS_H__
25 #include <hkl/hkl-macros.h>
26 #include <hkl/hkl-interval.h>
27 #include <hkl/hkl-vector.h>
28 #include <hkl/hkl-quaternion.h>
29 #include <hkl/hkl-parameter.h>
33 typedef struct _HklAxis HklAxis
;
36 HklParameter parent_instance
;
45 extern HklAxis
*hkl_axis_new(char const *name
, HklVector
const *axis_v
);
47 extern void hkl_axis_free(HklAxis
*self
);
49 extern void hkl_axis_init(HklAxis
*axis
, char const * name
, HklVector
const *axis_v
);
51 extern char const *hkl_axis_get_name(HklAxis
const *self
);
53 extern int hkl_axis_get_changed(HklAxis
const *self
);
55 extern void hkl_axis_set_changed(HklAxis
*self
, int changed
);
57 extern double hkl_axis_get_value(HklAxis
const *self
);
59 extern double hkl_axis_get_value_unit(HklAxis
const *self
);
61 extern double hkl_axis_get_value_closest(HklAxis
const *self
, HklAxis
const *axis
);
63 extern double hkl_axis_get_value_closest_unit(HklAxis
const *self
, HklAxis
const *axis
);
65 extern double hkl_axis_get_max(HklAxis
const *self
);
67 extern void hkl_axis_get_range_unit(HklAxis
const *self
, double *min
, double *max
);
69 extern void hkl_axis_set_value(HklAxis
*self
, double value
);
71 extern void hkl_axis_set_value_smallest_in_range(HklAxis
*self
);
73 extern void hkl_axis_set_value_unit(HklAxis
*self
, double value
);
75 extern void hkl_axis_set_range(HklAxis
*self
, double min
, double max
);
77 extern void hkl_axis_set_range_unit(HklAxis
*self
, double min
, double max
);
79 extern void hkl_axis_randomize(HklAxis
*self
);
82 * @brief get the quaternion of an axis.
87 * inline to speed computation.
89 extern void hkl_axis_get_quaternion(HklAxis
const *self
, HklQuaternion
*q
);
91 extern int hkl_axis_is_value_compatible_with_range(HklAxis
const *self
);
93 extern int hkl_axis_is_valid(const HklAxis
*self
);
95 extern void hkl_axis_fprintf(FILE *f
, HklAxis
*self
);
99 #endif /* __HKL_AXIS_H__ */