## hkl-geometry-private

hkl-geometry-private

## Functions

void | (*HklGeometryListMultiplyFunction) ()
HklHolder * | hkl_geometry_sample_holder_get_real ()
HklHolder * | hkl_geometry_detector_holder_get_real ()
HklVector | hkl_geometry_ki_get_real ()
HklVector | hkl_geometry_kf_get_real ()
GQuark | hkl_geometry_error_quark ()
HklParameter * | hkl_holder_add_parameter ()
HklParameter * | hkl_holder_add_rotation ()
HklParameter * | hkl_holder_add_rotation_with_origin ()
HklParameter * | hkl_holder_add_translation ()
HklVector | hkl_holder_transformation_apply ()
HklGeometry * | hkl_geometry_new ()
int | hkl_geometry_init_geometry ()
HklHolder * | hkl_geometry_add_holder ()
void | hkl_geometry_update ()
int | hkl_geometry_get_axis_idx_by_name ()
HklParameter * | hkl_geometry_get_axis_by_name ()
double | hkl_geometry_distance ()
double | hkl_geometry_distance_orthodromic ()
int | hkl_geometry_closest_from_geometry_with_range ()
int | hkl_geometry_is_valid ()
int | hkl_geometry_is_valid_range ()
HklHolder * | hkl_geometry_sample_holder_get ()
HklHolder * | hkl_geometry_detector_holder_get ()
HklGeometryList * | hkl_geometry_list_new ()
HklGeometryList * | hkl_geometry_list_new_copy ()
void | hkl_geometry_list_add ()
void | hkl_geometry_list_reset ()
void | hkl_geometry_list_sort ()
void | hkl_geometry_list_fprintf ()
void | hkl_geometry_list_multiply ()
void | hkl_geometry_list_multiply_from_range ()
void | hkl_geometry_list_remove_invalid ()
HklGeometryListItem * | hkl_geometry_list_item_new ()
HklGeometryListItem * | hkl_geometry_list_item_new_copy ()
void | hkl_geometry_list_item_free ()

## Types and Values

#define | HKL_HOLDER_SAMPLE_IDX
#define | HKL_HOLDER_DETECTOR_IDX
typedef | darray_holder
struct | HklHolderConfig
struct | HklHolder
struct | HklGeometryOperations
| HklGeometry
#define | HKL_GEOMETRY_OPERATIONS_DEFAULTS
extern const HklGeometryOperations | hkl_geometry_operations_defaults
#define | HKL_GEOMETRY_ERROR
enum | HklGeometryError
| HklGeometryList
| HklGeometryListItem

## Description

## Functions

### HklGeometryListMultiplyFunction ()

    void
    (*HklGeometryListMultiplyFunction) (HklGeometryList *self,
                                        HklGeometryListItem *item);

### hkl_geometry_sample_holder_get_real ()

    HklHolder *
    hkl_geometry_sample_holder_get_real (const HklGeometry *self);

### hkl_geometry_detector_holder_get_real ()

    HklHolder *
    hkl_geometry_detector_holder_get_real (const HklGeometry *self);

### hkl_geometry_ki_get_real ()

    HklVector
    hkl_geometry_ki_get_real (const HklGeometry *self);

### hkl_geometry_kf_get_real ()

    HklVector
    hkl_geometry_kf_get_real (const HklGeometry *self);

### hkl_geometry_error_quark ()

    GQuark
    hkl_geometry_error_quark (void);

### hkl_holder_add_parameter ()

    HklParameter *
    hkl_holder_add_parameter (HklHolder *self,
                              char const *name);

### hkl_holder_add_rotation ()

    HklParameter *
    hkl_holder_add_rotation (HklHolder *self,
                             char const *name,
                             double x,
                             double y,
                             double z);

### hkl_holder_add_rotation_with_origin ()

    HklParameter *
    hkl_holder_add_rotation_with_origin (HklHolder *self,
                                         const char *name,
                                         double x,
                                         double y,
                                         double z,
                                         double ox,
                                         double oy,
                                         double oz);

### hkl_holder_add_translation ()

    HklParameter *
    hkl_holder_add_translation (HklHolder *self,
                                char const *name,
                                double x,
                                double y,
                                double z);

### hkl_holder_transformation_apply ()

    HklVector
    hkl_holder_transformation_apply (const HklHolder *self);

### hkl_geometry_new ()

    HklGeometry *
    hkl_geometry_new (const HklFactory *factory,
                      const HklGeometryOperations *ops);

constructor

[skip]

### hkl_geometry_init_geometry ()

    int
    hkl_geometry_init_geometry (HklGeometry *self);

initilize an HklGeometry

[skip]

#### Parameters

self | the this ptr |
src | the HklGeometry to set from |

#### Returns

TRUE on success, FALSE if an error occurred

### hkl_geometry_add_holder ()

    HklHolder *
    hkl_geometry_add_holder ();

add an Holder to the HklGeometry

[skip]

### hkl_geometry_update ()

    void
    hkl_geometry_update ();

update the geometry internal once an Axis values changed

[skip]

### hkl_geometry_get_axis_idx_by_name ()

    int
    hkl_geometry_get_axis_idx_by_name (const HklGeometry *self);

get the index of the axes named `name` in the geometry

[skip]

#### Returns

-1 if the axis was not found

### hkl_geometry_get_axis_by_name ()

    HklParameter *
    hkl_geometry_get_axis_by_name (HklGeometry *self);

get an HklAxis using its name

#### Returns

.

[transfer none]

### hkl_geometry_distance ()

    double
    hkl_geometry_distance (const HklGeometry *self);

compute the distance between two HklGeometries

#### Parameters

self | the this ptr |
ref | the HklGeometry to compare with |

#### Returns

the distance between the two geometries

### hkl_geometry_distance_orthodromic ()

    double
    hkl_geometry_distance_orthodromic (const HklGeometry *self);

[skip]

#### Parameters

self | the this ptr |
ref | the reference HklGeometry to compare with. |

#### Returns

the orthodromique distance

### hkl_geometry_closest_from_geometry_with_range ()

    int
    hkl_geometry_closest_from_geometry_with_range
                                   (HklGeometry *self);

get the closest axes values in the HklInterval compatible with the current axes values

[skip]

### hkl_geometry_is_valid ()

    int
    hkl_geometry_is_valid ();

check if all axes of the HklGeometry are valid.

[skip]

### hkl_geometry_is_valid_range ()

    int
    hkl_geometry_is_valid_range ();

check if all axes of the HklGeometry are valid. (there is a difference for axis)

[skip]

### hkl_geometry_sample_holder_get ()

    HklHolder *
    hkl_geometry_sample_holder_get (const HklGeometry *self);

### hkl_geometry_detector_holder_get ()

    HklHolder *
    hkl_geometry_detector_holder_get (const HklGeometry *self);

### hkl_geometry_list_new ()

    HklGeometryList *
    hkl_geometry_list_new (void);

constructor

[skip]

### hkl_geometry_list_new_copy ()

    HklGeometryList *
    hkl_geometry_list_new_copy ();

copy constructor

[skip]

### hkl_geometry_list_add ()

    void
    hkl_geometry_list_add (HklGeometryList *self);

this method Add a geometry to the geometries

This method try to be clever by allocating memory only if the current length of the geometries is not large enought. Then it just set the geometry axes and copy it to the right geometries. We do not gives the x len as it is equal to the self->axes_len.

[skip]

#### Parameters

self | The current HklGeometryList |
geometry | the HklGeometry to add |

### hkl_geometry_list_reset ()

    void
    hkl_geometry_list_reset ();

reset the HklGeometry, in fact it is a sort of clean method remove all the items of the list.

[skip]

#### Parameters

self | the this ptr |

### hkl_geometry_list_sort ()

    void
    hkl_geometry_list_sort (HklGeometryList *self);

sort the HklGeometryList compare to the distance of the given HklGeometry

[skip]

### hkl_geometry_list_fprintf ()

    void
    hkl_geometry_list_fprintf (FILE *f);

print to a file the HklGeometryList

[skip]

### hkl_geometry_list_multiply ()

    void
    hkl_geometry_list_multiply ();

apply the multiply lenthod to the HklGeometry

[skip]

### hkl_geometry_list_multiply_from_range ()

    void
    hkl_geometry_list_multiply_from_range ();

### hkl_geometry_list_remove_invalid ()

    void
    hkl_geometry_list_remove_invalid ();

remove all invalid HklGeometry from the HklGeometryList

[skip]

### hkl_geometry_list_item_new ()

    HklGeometryListItem *
    hkl_geometry_list_item_new ();

constructor

[skip]

### hkl_geometry_list_item_new_copy ()

    HklGeometryListItem *
    hkl_geometry_list_item_new_copy ();

copy constructor

[skip]

### hkl_geometry_list_item_free ()

    void
    hkl_geometry_list_item_free ();

destructor

[skip]

## Types and Values

### HKL_HOLDER_SAMPLE_IDX

    #define HKL_HOLDER_SAMPLE_IDX 0

### HKL_HOLDER_DETECTOR_IDX

    #define HKL_HOLDER_DETECTOR_IDX 1

### darray_holder

    typedef darray(HklHolder *) darray_holder;

### struct HklHolderConfig

    struct HklHolderConfig {
    	int gc;
    	size_t *idx;
    	size_t len;
    };

### struct HklHolder

    struct HklHolder {
    	struct HklHolderConfig *config;
    	HklGeometry *geometry;
    	HklQuaternion q;
    };

### struct HklGeometryOperations

    struct HklGeometryOperations {
    	HklHolder* (*sample_holder_get) (const HklGeometry *self, const HklSample *sample);

    	HklHolder* (*detector_holder_get) (const HklGeometry *self, const HklDetector *detector);

    	HklVector (*ki_get) (const HklGeometry *geometry);

    	HklVector (*kf_get) (const HklGeometry *self, const HklDetector *detector);
    };

### HklGeometry

    typedef struct {
    	const HklFactory *factory;
    	HklSource source;
    	darray_parameter axes;
    	darray_holder holders;
    	const HklGeometryOperations *ops;
    } HklGeometry;

### HKL_GEOMETRY_OPERATIONS_DEFAULTS

    #define             HKL_GEOMETRY_OPERATIONS_DEFAULTS

### hkl_geometry_operations_defaults

    extern const HklGeometryOperations hkl_geometry_operations_defaults;

### HKL_GEOMETRY_ERROR

    #define HKL_GEOMETRY_ERROR hkl_geometry_error_quark ()

### enum HklGeometryError

#### Members

HKL_GEOMETRY_ERROR_AXIS_GET |  |
HKL_GEOMETRY_ERROR_AXIS_SET |  |

### HklGeometryList

    typedef struct {
    	HklGeometryListMultiplyFunction multiply;
    	struct list_head items;
    	size_t n_items;
    } HklGeometryList;

### HklGeometryListItem

    typedef struct {
    	struct list_node list;
    	HklGeometry *geometry;
    } HklGeometryListItem;