From d7e4cbd8a052d89921488581ef670b873ebfef76 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Picca=20Fr=C3=A9d=C3=A9ric-Emmanuel?= Date: Wed, 17 Apr 2013 09:55:39 +0200 Subject: [PATCH] to delete --- hkl/Hkl-5.0.gir | 504 +------------------------ hkl/hkl-detector.c | 2 + hkl/{hkl-geometry.h => hkl-geometry-private.h} | 6 +- hkl/hkl-geometry.c | 2 +- hkl/hkl-geometry.h | 315 +++++++--------- hkl/hkl-pseudoaxis-private.h | 4 +- hkl/hkl-sample.c | 4 +- hkl/hkl-type-builtins.c | 26 -- hkl/hkl-type-builtins.h | 4 - 9 files changed, 144 insertions(+), 723 deletions(-) copy hkl/{hkl-geometry.h => hkl-geometry-private.h} (97%) rewrite hkl/hkl-geometry.h (69%) diff --git a/hkl/Hkl-5.0.gir b/hkl/Hkl-5.0.gir index cc47612d..98284579 100644 --- a/hkl/Hkl-5.0.gir +++ b/hkl/Hkl-5.0.gir @@ -742,44 +742,6 @@ control over, that could include printf() escape sequences. glib:type-name="HklGeometry" glib:get-type="hkl_geometry_get_type" c:symbol-prefix="geometry"> - - - - - - - - - - - - - - - - - - - - constructor - -Returns: - - - - - - add an Holder to the #HklGeometry - -Returns: - - - - free the list with g_slist_free when done. @@ -789,55 +751,6 @@ Returns: - - get the closest axes values in the HklInterval compatible with the -current axes values - -Returns: - - - - - - - - - - - compute the distance between two #HklGeometries - - the distance between the two geometries - - - - - the #HklGeometry to compare with - - - - - - - the orthodromique distance - - - - - the reference #HklGeometry to compare with. - - - - - - destructor - - - - free the list with free when done. @@ -857,73 +770,6 @@ Returns: - - get an #HklAxis using its name - - - - - - - - - - - get the index of the axes named @name in the geometry - - -1 if the axis was not found - - - - - - - - - - initilize an HklGeometry - - - - - - - - - - - check if all axes of the #HklGeometry are valid. - -Returns: - - - - - - copy constructor - -Returns: - - - - - - randomize the #HklGeometry - - - - @@ -942,120 +788,14 @@ Returns: - - - - - - - - - - - - - set the axes values - -Returns: - - - - - - - - - - - - - - - update the geometry internal once an Axis values changed - - - - - - print into a file the #HklGeometry - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - constructor - -Returns: - - - - - - - - - - - - - - - - destructor - - - - free the list with g_slist_free when done. @@ -1065,125 +805,12 @@ Returns: - - apply the multiply lenthod to the #HklGeometry - - - - - - - - - - - copy constructor - -Returns: - - - - - - remove all invalid #HklGeometry from the #HklGeometryList - - - - - - reset the HklGeometry, in fact it is a sort of clean method remove -all the items of the list. - - - - - - sort the #HklGeometryList compare to the distance of the given -#HklGeometry - - - - - - - - - - - print to a file the #HklGeometryList - - - - - - - - - - - - - - - - - - - - - - - constructor - -Returns: - - - - - - - - - - - destructor - - - - - - copy constructor - -Returns: - - - - @@ -1199,100 +826,7 @@ Returns: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - print into a file the #HklGeometry - - - - - - - - - - - - - - print to a file the #HklGeometryList - - - - - - - - - - - - #include +#include "hkl-geometry-private.h" + /** * hkl_detector_new: (skip) * diff --git a/hkl/hkl-geometry.h b/hkl/hkl-geometry-private.h similarity index 97% copy from hkl/hkl-geometry.h copy to hkl/hkl-geometry-private.h index 15ab3f67..4763ac6f 100644 --- a/hkl/hkl-geometry.h +++ b/hkl/hkl-geometry-private.h @@ -19,8 +19,8 @@ * * Authors: Picca Frédéric-Emmanuel */ -#ifndef __HKL_GEOMETRY_H__ -#define __HKL_GEOMETRY_H__ +#ifndef __HKL_GEOMETRY_PRIVATE_H__ +#define __HKL_GEOMETRY_PRIVATE_H__ #include @@ -182,4 +182,4 @@ extern void hkl_geometry_list_item_free(HklGeometryListItem *self); HKL_END_DECLS -#endif /* __HKL_GEOMETRY_H__ */ +#endif /* __HKL_GEOMETRY_PRIVATE_H__ */ diff --git a/hkl/hkl-geometry.c b/hkl/hkl-geometry.c index dce93d19..fde61b19 100644 --- a/hkl/hkl-geometry.c +++ b/hkl/hkl-geometry.c @@ -29,7 +29,7 @@ #include #include -#include +#include "hkl-geometry-private.h" /* * Try to add a axis to the axes list, diff --git a/hkl/hkl-geometry.h b/hkl/hkl-geometry.h dissimilarity index 69% index 15ab3f67..1ade006b 100644 --- a/hkl/hkl-geometry.h +++ b/hkl/hkl-geometry.h @@ -1,185 +1,130 @@ -/* This file is part of the hkl library. - * - * The hkl library is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The hkl library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with the hkl library. If not, see . - * - * Copyright (C) 2003-2013 Synchrotron SOLEIL - * L'Orme des Merisiers Saint-Aubin - * BP 48 91192 GIF-sur-YVETTE CEDEX - * - * Authors: Picca Frédéric-Emmanuel - */ -#ifndef __HKL_GEOMETRY_H__ -#define __HKL_GEOMETRY_H__ - -#include - -#include -#include -#include - -HKL_BEGIN_DECLS - -typedef struct _HklHolder HklHolder; -typedef struct _HklGeometryConfig HklGeometryConfig; -typedef struct _HklGeometry HklGeometry; -typedef struct _HklGeometryList HklGeometryList; -typedef struct _HklGeometryListItem HklGeometryListItem; -typedef void (* HklGeometryListMultiplyFunction) (HklGeometryList *self, - HklGeometryListItem *item); -typedef enum _HklGeometryType -{ - HKL_GEOMETRY_TYPE_TWOC_VERTICAL, - HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL, - HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL, - HKL_GEOMETRY_TYPE_EULERIAN6C, - HKL_GEOMETRY_TYPE_KAPPA6C, - HKL_GEOMETRY_TYPE_ZAXIS, - HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2, - HKL_GEOMETRY_TYPE_SOLEIL_MARS, - HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2, - HKL_GEOMETRY_TYPE_PETRA3_P09_EH2, - HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3, - HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL, -} HklGeometryType; - -struct HklHolderConfig { - int gc; - size_t *idx; - size_t len; -}; - -struct _HklHolder { - struct HklHolderConfig *config; - HklGeometry *geometry; - HklQuaternion q; -}; - -struct _HklGeometryConfig { - const char *name; - HklGeometryType type; - const char *description; -}; - -struct _HklGeometry -{ - const HklGeometryConfig *config; - HklSource source; - HklAxis *axes; - size_t len; - HklHolder *holders; - size_t holders_len; -}; - -struct _HklGeometryList -{ - int len; - HklGeometryListMultiplyFunction multiply; - struct list_head items; - void *_shit; -}; - -struct _HklGeometryListItem -{ - HklGeometry *geometry; - struct list_node node; - void *_shit; -}; - -/*************/ -/* HklHolder */ -/*************/ - -extern HklAxis *hkl_holder_add_rotation_axis(HklHolder *self, - char const *name, double x, double y, double z); - -/***************/ -/* HklGeometry */ -/***************/ - -extern HklGeometry *hkl_geometry_new(void); - -extern HklGeometry *hkl_geometry_new_copy(const HklGeometry *self); - -extern void hkl_geometry_free(HklGeometry *self); - -extern void hkl_geometry_init_geometry(HklGeometry *self, - const HklGeometry *src); - -extern HklHolder *hkl_geometry_add_holder(HklGeometry *self); - -extern void hkl_geometry_update(HklGeometry *self); - -extern int hkl_geometry_get_axis_idx_by_name(const HklGeometry *self, - const char *name); - -extern HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self, - const char *name); - -extern void hkl_geometry_randomize(HklGeometry *self); - -extern int hkl_geometry_set_values_v(HklGeometry *self, - size_t len, ...); - -extern int hkl_geometry_set_values_unit_v(HklGeometry *self, ...); - -extern double hkl_geometry_distance(const HklGeometry *self, - const HklGeometry *ref); - -extern double hkl_geometry_distance_orthodromic(const HklGeometry *self, - const HklGeometry *ref); - -extern int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self, - const HklGeometry *ref); - -extern int hkl_geometry_is_valid(const HklGeometry *self); - -extern void hkl_geometry_fprintf(FILE *file, const HklGeometry *self); - -/*******************/ -/* HklGeometryList */ -/*******************/ - -extern HklGeometryList *hkl_geometry_list_new(void); - -extern HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self); - -extern void hkl_geometry_list_free(HklGeometryList *self); - -extern void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry); - -extern void hkl_geometry_list_reset(HklGeometryList *self); - -extern void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref); - -extern void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self); - -extern void hkl_geometry_list_multiply(HklGeometryList *self); - -extern void hkl_geometry_list_multiply_from_range(HklGeometryList *self); - -extern void hkl_geometry_list_remove_invalid(HklGeometryList *self); - -/***********************/ -/* HklGeometryListItem */ -/***********************/ - -extern HklGeometryListItem *hkl_geometry_list_item_new(const HklGeometry *geometry); - -extern HklGeometryListItem *hkl_geometry_list_item_new_copy(const HklGeometryListItem *self); - -extern void hkl_geometry_list_item_free(HklGeometryListItem *self); - -HKL_END_DECLS - -#endif /* __HKL_GEOMETRY_H__ */ +/* This file is part of the hkl library. + * + * The hkl library is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The hkl library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with the hkl library. If not, see . + * + * Copyright (C) 2003-2013 Synchrotron SOLEIL + * L'Orme des Merisiers Saint-Aubin + * BP 48 91192 GIF-sur-YVETTE CEDEX + * + * Authors: Picca Frédéric-Emmanuel + */ +#ifndef __HKL_GEOMETRY_H__ +#define __HKL_GEOMETRY_H__ + +#include +#include + +#include +#include +#include + +HKL_BEGIN_DECLS + +typedef struct _HklHolder HklHolder; +typedef struct _HklGeometryConfig HklGeometryConfig; +typedef struct _HklGeometry HklGeometry; +typedef struct _HklGeometryList HklGeometryList; +typedef struct _HklGeometryListItem HklGeometryListItem; +typedef void (* HklGeometryListMultiplyFunction) (HklGeometryList *self, + HklGeometryListItem *item); + +typedef darray(HklHolder *) darray_holder; + +/* /\*************\/ */ +/* /\* HklHolder *\/ */ +/* /\*************\/ */ + +/* extern HklAxis *hkl_holder_add_rotation_axis(HklHolder *self, */ +/* char const *name, double x, double y, double z); */ + +/* /\***************\/ */ +/* /\* HklGeometry *\/ */ +/* /\***************\/ */ + +/* extern HklGeometry *hkl_geometry_new(void); */ + +/* extern HklGeometry *hkl_geometry_new_copy(const HklGeometry *self); */ + +/* extern void hkl_geometry_free(HklGeometry *self); */ + +/* extern void hkl_geometry_init_geometry(HklGeometry *self, */ +/* const HklGeometry *src); */ + +/* extern HklHolder *hkl_geometry_add_holder(HklGeometry *self); */ + +/* extern void hkl_geometry_update(HklGeometry *self); */ + +/* extern int hkl_geometry_get_axis_idx_by_name(const HklGeometry *self, */ +/* const char *name); */ + +/* extern HklParameter *hkl_geometry_get_axis_by_name(HklGeometry *self, */ +/* const char *name); */ + +/* extern void hkl_geometry_randomize(HklGeometry *self); */ + +/* extern int hkl_geometry_set_values_v(HklGeometry *self, */ +/* size_t len, ...); */ + +/* extern int hkl_geometry_set_values_unit_v(HklGeometry *self, ...); */ + +/* extern double hkl_geometry_distance(const HklGeometry *self, */ +/* const HklGeometry *ref); */ + +/* extern double hkl_geometry_distance_orthodromic(const HklGeometry *self, */ +/* const HklGeometry *ref); */ + +/* extern int hkl_geometry_closest_from_geometry_with_range(HklGeometry *self, */ +/* const HklGeometry *ref); */ + +/* extern int hkl_geometry_is_valid(const HklGeometry *self); */ + +/* extern void hkl_geometry_fprintf(FILE *file, const HklGeometry *self); */ + +/* /\*******************\/ */ +/* /\* HklGeometryList *\/ */ +/* /\*******************\/ */ + +/* extern HklGeometryList *hkl_geometry_list_new(void); */ + +/* extern HklGeometryList *hkl_geometry_list_new_copy(const HklGeometryList *self); */ + +/* extern void hkl_geometry_list_free(HklGeometryList *self); */ + +/* extern void hkl_geometry_list_add(HklGeometryList *self, HklGeometry *geometry); */ + +/* extern void hkl_geometry_list_reset(HklGeometryList *self); */ + +/* extern void hkl_geometry_list_sort(HklGeometryList *self, HklGeometry *ref); */ + +/* extern void hkl_geometry_list_fprintf(FILE *f, const HklGeometryList *self); */ + +/* extern void hkl_geometry_list_multiply(HklGeometryList *self); */ + +/* extern void hkl_geometry_list_multiply_from_range(HklGeometryList *self); */ + +/* extern void hkl_geometry_list_remove_invalid(HklGeometryList *self); */ + +/* /\***********************\/ */ +/* /\* HklGeometryListItem *\/ */ +/* /\***********************\/ */ + +/* extern HklGeometryListItem *hkl_geometry_list_item_new(const HklGeometry *geometry); */ + +/* extern HklGeometryListItem *hkl_geometry_list_item_new_copy(const HklGeometryListItem *self); */ + +/* extern void hkl_geometry_list_item_free(HklGeometryListItem *self); */ + +HKL_END_DECLS + +#endif /* __HKL_GEOMETRY_H__ */ diff --git a/hkl/hkl-pseudoaxis-private.h b/hkl/hkl-pseudoaxis-private.h index 6f714711..3eed702a 100644 --- a/hkl/hkl-pseudoaxis-private.h +++ b/hkl/hkl-pseudoaxis-private.h @@ -26,7 +26,9 @@ #include #include #include -#include + +#include "hkl-parameter-private.h" +#include "hkl/hkl-geometry-private.h" HKL_BEGIN_DECLS diff --git a/hkl/hkl-sample.c b/hkl/hkl-sample.c index b3077acb..297b2873 100644 --- a/hkl/hkl-sample.c +++ b/hkl/hkl-sample.c @@ -28,7 +28,9 @@ #include #include -#include "hkl/hkl-parameter-private.h" + +#include "hkl-parameter-private.h" +#include "hkl-geometry-private.h" /* private */ diff --git a/hkl/hkl-type-builtins.c b/hkl/hkl-type-builtins.c index f401ddc7..ea2ba871 100644 --- a/hkl/hkl-type-builtins.c +++ b/hkl/hkl-type-builtins.c @@ -21,32 +21,6 @@ hkl_detector_type_get_type (void) return etype; } -/* enumerations from "hkl-geometry.h" */ -GType -hkl_geometry_type_get_type (void) -{ - static GType etype = 0; - if (G_UNLIKELY(etype == 0)) { - static const GEnumValue values[] = { - { HKL_GEOMETRY_TYPE_TWOC_VERTICAL, "HKL_GEOMETRY_TYPE_TWOC_VERTICAL", "twoc-vertical" }, - { HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL, "HKL_GEOMETRY_TYPE_EULERIAN4C_VERTICAL", "eulerian4c-vertical" }, - { HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL, "HKL_GEOMETRY_TYPE_KAPPA4C_VERTICAL", "kappa4c-vertical" }, - { HKL_GEOMETRY_TYPE_EULERIAN6C, "HKL_GEOMETRY_TYPE_EULERIAN6C", "eulerian6c" }, - { HKL_GEOMETRY_TYPE_KAPPA6C, "HKL_GEOMETRY_TYPE_KAPPA6C", "kappa6c" }, - { HKL_GEOMETRY_TYPE_ZAXIS, "HKL_GEOMETRY_TYPE_ZAXIS", "zaxis" }, - { HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2, "HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_2", "soleil-sixs-med-2-2" }, - { HKL_GEOMETRY_TYPE_SOLEIL_MARS, "HKL_GEOMETRY_TYPE_SOLEIL_MARS", "soleil-mars" }, - { HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2, "HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_1_2", "soleil-sixs-med-1-2" }, - { HKL_GEOMETRY_TYPE_PETRA3_P09_EH2, "HKL_GEOMETRY_TYPE_PETRA3_P09_EH2", "petra3-p09-eh2" }, - { HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3, "HKL_GEOMETRY_TYPE_SOLEIL_SIXS_MED_2_3", "soleil-sixs-med-2-3" }, - { HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL, "HKL_GEOMETRY_TYPE_EULERIAN4C_HORIZONTAL", "eulerian4c-horizontal" }, - { 0, NULL, NULL } - }; - etype = g_enum_register_static (g_intern_static_string ("HklGeometryType"), values); - } - return etype; -} - /* enumerations from "hkl-sample.h" */ GType hkl_sample_type_get_type (void) diff --git a/hkl/hkl-type-builtins.h b/hkl/hkl-type-builtins.h index 4f09a29d..b90fd9c6 100644 --- a/hkl/hkl-type-builtins.h +++ b/hkl/hkl-type-builtins.h @@ -12,10 +12,6 @@ G_BEGIN_DECLS GType hkl_detector_type_get_type (void) G_GNUC_CONST; #define HKL_TYPE_DETECTOR_TYPE (hkl_detector_type_get_type ()) -/* enumerations from "hkl-geometry.h" */ -GType hkl_geometry_type_get_type (void) G_GNUC_CONST; -#define HKL_TYPE_GEOMETRY_TYPE (hkl_geometry_type_get_type ()) - /* enumerations from "hkl-sample.h" */ GType hkl_sample_type_get_type (void) G_GNUC_CONST; #define HKL_TYPE_SAMPLE_TYPE (hkl_sample_type_get_type ()) -- 2.11.4.GIT