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-2014 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 #include "hkl-macros-private.h"
23 #include "hkl-factory-private.h" // for autodata_factories_, etc
24 #include "hkl-pseudoaxis-private.h" // for hkl_engine_list_add, etc
25 #include "hkl/ccan/array_size/array_size.h"
27 #define AXIS_0_NAME "omega"
28 #define AXIS_1_NAME "tth"
30 #define HKL_GEOMETRY_TWOC_DESCRIPTION \
31 "+ xrays source fix allong the :math:`\\vec{x}` direction (1, 0, 0)\n" \
32 "+ 1 axes for the sample\n" \
34 " + **" AXIS_0_NAME "** : rotating around the :math:`-\\vec{y}` direction (0, -1, 0)\n" \
36 "+ 1 axis for the detector\n" \
38 " + **" AXIS_1_NAME "** : rotation around the :math:`-\\vec{y}` direction (0, -1, 0)\n"
40 static const char* hkl_geometry_twoC_axes
[] = {AXIS_0_NAME
, AXIS_1_NAME
};
42 static HklGeometry
*hkl_geometry_new_twoC(const HklFactory
*factory
)
44 HklGeometry
*self
= hkl_geometry_new(factory
);
47 h
= hkl_geometry_add_holder(self
);
48 hkl_holder_add_rotation_axis(h
, AXIS_0_NAME
, 0, -1, 0);
50 h
= hkl_geometry_add_holder(self
);
51 hkl_holder_add_rotation_axis(h
, AXIS_1_NAME
, 0, -1, 0);
56 static HklEngineList
*hkl_engine_list_new_twoC(const HklFactory
*factory
)
58 HklEngineList
*self
= hkl_engine_list_new();
63 REGISTER_DIFFRACTOMETER(twoC
, "TwoC", HKL_GEOMETRY_TWOC_DESCRIPTION
);