hkl-5.0.0.2449/ 0000755 0001750 0001750 00000000000 13237020571 013113 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/gui/ 0000755 0001750 0001750 00000000000 13237020543 013676 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/gui/ghkl.ui 0000644 0001750 0001750 00000543322 12710332473 015176 0 ustar 00picca picca 0000000 0000000
hkl-5.0.0.2449/gui/hkl-gui.c 0000644 0001750 0001750 00000204214 13237017527 015415 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "hkl.h"
#include "hkl-gui.h"
#include "hkl-gui-macros.h"
#if HKL3D
# include
# include "hkl-gui-3d.h"
#endif
#include "hkl-gui-pseudoaxes.h"
#define HKL_GUI_TYPE_WINDOW (hkl_gui_window_get_type ())
#define HKL_GUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindow))
#define HKL_GUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
#define HKL_GUI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_WINDOW))
#define HKL_GUI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_WINDOW))
#define HKL_GUI_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
#define EMBED_BREAKPOINT asm volatile ("int3;")
G_DEFINE_TYPE (HklGuiWindow, hkl_gui_window, G_TYPE_OBJECT);
typedef enum {
REFLECTION_COL_INDEX = 0,
REFLECTION_COL_H,
REFLECTION_COL_K,
REFLECTION_COL_L,
REFLECTION_COL_FLAG,
REFLECTION_COL_REFLECTION,
REFLECTION_COL_N_COLUMNS
} ReflectionCol;
typedef enum {
AXIS_COL_AXIS = 0,
AXIS_COL_NAME,
AXIS_COL_READ,
AXIS_COL_WRITE,
AXIS_COL_MIN,
AXIS_COL_MAX,
AXIS_COL_N_COLUMNS
} AxisCol;
typedef enum {
PSEUDO_AXIS_COL_IDX = 0,
PSEUDO_AXIS_COL_ENGINE,
PSEUDO_AXIS_COL_NAME,
PSEUDO_AXIS_COL_READ,
PSEUDO_AXIS_COL_WRITE,
PSEUDO_AXIS_COL_N_COLUMNS
} PseudoAxisCol;
typedef enum {
PARAMETER_COL_PARAMETER = 0,
PARAMETER_COL_NAME,
PARAMETER_COL_VALUE,
PARAMETER_COL_N_COLUMNS
} ParameterCol;
typedef enum {
SAMPLE_COL_SAMPLE = 0,
SAMPLE_COL_NAME,
SAMPLE_COL_A,
SAMPLE_COL_B,
SAMPLE_COL_C,
SAMPLE_COL_ALPHA,
SAMPLE_COL_BETA,
SAMPLE_COL_GAMMA,
SAMPLE_COL_N_COLUMNS
} SampleCol;
typedef enum {
SOLUTION_COL_INDEX = 0,
SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM,
SOLUTION_COL_N_COLUMNS
} SolutionCol;
typedef enum {
DIFFRACTOMETER_COL_NAME = 0,
DIFFRACTOMETER_COL_FACTORY,
DIFFRACTOMETER_COL_DIFFRACTOMETER,
DIFFRACTOMETER_COL_N_COLUMNS
} DiffractometerCol;
/******************/
/* Diffractometer */
/******************/
struct diffractometer_t {
HklFactory *factory;
HklGeometry *geometry;
HklDetector *detector;
HklEngineList *engines;
HklGeometryList *solutions;
};
static struct diffractometer_t *
create_diffractometer(HklFactory *factory)
{
struct diffractometer_t *self;
self = malloc(sizeof(*self));
self->factory = factory;
self->geometry = hkl_factory_create_new_geometry (factory);
self->engines = hkl_factory_create_new_engine_list (factory);
self->detector = hkl_detector_factory_new (HKL_DETECTOR_TYPE_0D);
self->solutions = NULL;
return self;
}
static void
delete_diffractometer(struct diffractometer_t *self)
{
hkl_geometry_free(self->geometry);
hkl_engine_list_free(self->engines);
hkl_detector_free(self->detector);
if(self->solutions)
hkl_geometry_list_free(self->solutions);
}
static void
diffractometer_set_sample(struct diffractometer_t *self,
HklSample *sample)
{
hkl_engine_list_init(self->engines,
self->geometry,
self->detector,
sample);
hkl_engine_list_get(self->engines);
}
static void
diffractometer_set_wavelength(struct diffractometer_t *self,
double wavelength)
{
if(hkl_geometry_wavelength_set(self->geometry,
wavelength, HKL_UNIT_USER, NULL))
hkl_engine_list_get(self->engines);
}
static gboolean
diffractometer_set_solutions(struct diffractometer_t *self, HklGeometryList *solutions)
{
if(solutions){
if(self->solutions)
hkl_geometry_list_free(self->solutions);
self->solutions = solutions;
}
return NULL != solutions;
}
static gboolean
diffractometer_pseudo_axis_values_set(struct diffractometer_t *self,
HklEngine *engine, gdouble values[], guint n_values,
GError **error)
{
HklGeometryList *solutions;
solutions = hkl_engine_pseudo_axis_values_set(engine, values, n_values, HKL_UNIT_USER, error);
return diffractometer_set_solutions(self, solutions);
}
static void
diffractometer_set_solution(struct diffractometer_t *self,
const HklGeometryListItem *item)
{
hkl_engine_list_select_solution(self->engines, item);
}
/****************/
/* HklGuiWindow */
/****************/
struct _HklGuiWindowPrivate {
GtkBuilder* builder;
GtkLabel* label_UB11;
GtkLabel* label_UB12;
GtkLabel* label_UB13;
GtkLabel* label_UB21;
GtkLabel* label_UB22;
GtkLabel* label_UB23;
GtkLabel* label_UB31;
GtkLabel* label_UB32;
GtkLabel* label_UB33;
GtkButton* button2;
GtkSpinButton* spinbutton_a;
GtkSpinButton* spinbutton_b;
GtkSpinButton* spinbutton_c;
GtkSpinButton* spinbutton_alpha;
GtkSpinButton* spinbutton_beta;
GtkSpinButton* spinbutton_gamma;
GtkSpinButton* spinbutton_a_min;
GtkSpinButton* spinbutton_b_min;
GtkSpinButton* spinbutton_c_min;
GtkSpinButton* spinbutton_alpha_min;
GtkSpinButton* spinbutton_beta_min;
GtkSpinButton* spinbutton_gamma_min;
GtkSpinButton* spinbutton_a_max;
GtkSpinButton* spinbutton_b_max;
GtkSpinButton* spinbutton_c_max;
GtkSpinButton* spinbutton_alpha_max;
GtkSpinButton* spinbutton_beta_max;
GtkSpinButton* spinbutton_gamma_max;
GtkSpinButton* spinbutton_lambda;
GtkSpinButton* spinbutton_a_star;
GtkSpinButton* spinbutton_b_star;
GtkSpinButton* spinbutton_c_star;
GtkSpinButton* spinbutton_alpha_star;
GtkSpinButton* spinbutton_beta_star;
GtkSpinButton* spinbutton_gamma_star;
GtkSpinButton* spinbutton_ux;
GtkSpinButton* spinbutton_uy;
GtkSpinButton* spinbutton_uz;
GtkSpinButton* spinbutton_U11;
GtkSpinButton* spinbutton_U12;
GtkSpinButton* spinbutton_U13;
GtkSpinButton* spinbutton_U21;
GtkSpinButton* spinbutton_U22;
GtkSpinButton* spinbutton_U23;
GtkSpinButton* spinbutton_U31;
GtkSpinButton* spinbutton_U32;
GtkSpinButton* spinbutton_U33;
GtkCheckButton* checkbutton_a;
GtkCheckButton* checkbutton_b;
GtkCheckButton* checkbutton_c;
GtkCheckButton* checkbutton_alpha;
GtkCheckButton* checkbutton_beta;
GtkCheckButton* checkbutton_gamma;
GtkCheckButton* checkbutton_ux;
GtkCheckButton* checkbutton_uy;
GtkCheckButton* checkbutton_uz;
GtkTreeView* treeview_reflections;
GtkTreeView* treeview_crystals;
GtkTreeView* treeview_axes;
GtkTreeView* treeview_pseudo_axes;
GtkTreeView* treeview_solutions;
GtkToolButton* toolbutton_add_reflection;
GtkToolButton* toolbutton_goto_reflection;
GtkToolButton* toolbutton_del_reflection;
GtkToolButton* toolbutton_setUB;
GtkToolButton* toolbutton_computeUB;
GtkToolButton* toolbutton_add_crystal;
GtkToolButton* toolbutton_copy_crystal;
GtkToolButton* toolbutton_del_crystal;
GtkToolButton* toolbutton_affiner;
GtkStatusbar* statusbar;
GtkImageMenuItem* menuitem5;
GtkVBox* box_info_bar; /* fake for the infor bar */
GtkVBox* vbox7;
GtkVBox* vbox2;
GtkDialog* dialog1;
GtkButton* button1;
GtkComboBox* combobox1;
GtkListStore* liststore_diffractometer;
GtkListStore* liststore_axis;
GtkListStore* liststore_pseudo_axes;
GtkListStore* liststore_solutions;
GtkListStore* liststore_reflections;
GtkListStore* liststore_crystals;
GtkInfoBar *info_bar;
GtkLabel *info_message;
darray(HklGuiEngine *) pseudo_frames;
#if HKL3D
HklGui3D *frame3d;
#endif
struct diffractometer_t *diffractometer; /* unowned */
HklSample *sample; /* unowned */
HklLattice *reciprocal;
};
#define HKL_GUI_WINDOW_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_WINDOW, HklGuiWindowPrivate))
static gboolean
finalize_liststore_diffractometer(GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
struct diffractometer_t *diffractometer;
gtk_tree_model_get(model, iter,
DIFFRACTOMETER_COL_DIFFRACTOMETER, &diffractometer,
-1);
delete_diffractometer(diffractometer);
return FALSE;
}
static gboolean
finalize_liststore_samples(GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
HklSample *sample = NULL;
gtk_tree_model_get(model, iter,
SAMPLE_COL_SAMPLE, &sample,
-1);
hkl_sample_free(sample);
return FALSE;
}
static void
finalize (GObject* object)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(object);
g_object_unref(priv->builder);
darray_free(priv->pseudo_frames);
gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_diffractometer),
finalize_liststore_diffractometer,
NULL);
gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_crystals),
finalize_liststore_samples,
NULL);
G_OBJECT_CLASS (hkl_gui_window_parent_class)->finalize (object);
}
HklGuiWindow* hkl_gui_window_new (void)
{
return g_object_new (HKL_GUI_TYPE_WINDOW, NULL);
}
static void
hkl_gui_window_get_widgets_and_objects_from_ui (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkBuilder* builder;
g_return_if_fail (self != NULL);
priv->builder = builder = gtk_builder_new ();
get_ui(builder, "ghkl.ui");
get_object(builder, GTK_LIST_STORE, priv, liststore_diffractometer);
get_object(builder, GTK_LIST_STORE, priv, liststore_axis);
get_object(builder, GTK_LIST_STORE, priv, liststore_pseudo_axes);
get_object(builder, GTK_LIST_STORE, priv, liststore_reflections);
get_object(builder, GTK_LIST_STORE, priv, liststore_crystals);
get_object(builder, GTK_LABEL, priv, label_UB11);
get_object(builder, GTK_LABEL, priv, label_UB12);
get_object(builder, GTK_LABEL, priv, label_UB13);
get_object(builder, GTK_LABEL, priv, label_UB21);
get_object(builder, GTK_LABEL, priv, label_UB22);
get_object(builder, GTK_LABEL, priv, label_UB23);
get_object(builder, GTK_LABEL, priv, label_UB31);
get_object(builder, GTK_LABEL, priv, label_UB32);
get_object(builder, GTK_LABEL, priv, label_UB33);
get_object(builder, GTK_BUTTON, priv, button2);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_a_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_b_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_c_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_alpha_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_beta_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_min);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_max);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_gamma_star);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_lambda);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_ux);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_uy);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_uz);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U11);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U12);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U13);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U21);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U22);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U23);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U31);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U32);
get_object(builder, GTK_SPIN_BUTTON, priv, spinbutton_U33);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_a);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_b);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_c);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_alpha);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_beta);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_gamma);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_ux);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_uy);
get_object(builder, GTK_CHECK_BUTTON, priv, checkbutton_uz);
get_object(builder, GTK_TREE_VIEW, priv, treeview_reflections);
get_object(builder, GTK_TREE_VIEW, priv, treeview_crystals);
get_object(builder, GTK_TREE_VIEW, priv, treeview_axes);
get_object(builder, GTK_TREE_VIEW, priv, treeview_pseudo_axes);
get_object(builder, GTK_TREE_VIEW, priv, treeview_solutions);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_add_reflection);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_goto_reflection);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_del_reflection);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_setUB);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_computeUB);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_add_crystal);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_copy_crystal);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_del_crystal);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton_affiner);
get_object(builder, GTK_STATUSBAR, priv, statusbar);
get_object(builder, GTK_IMAGE_MENU_ITEM, priv, menuitem5);
get_object(builder, GTK_VBOX, priv, vbox7);
get_object(builder, GTK_VBOX, priv, vbox2);
get_object(builder, GTK_VBOX, priv, box_info_bar);
get_object(builder, GTK_DIALOG, priv, dialog1);
get_object(builder, GTK_COMBO_BOX, priv, combobox1);
gtk_builder_connect_signals (builder, self);
}
static void
update_pseudo_axes_frames (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
HklGuiEngine **engine;
g_return_if_fail (self != NULL);
darray_foreach(engine, priv->pseudo_frames){
hkl_gui_engine_update(*engine);
}
}
static void
raise_error(HklGuiWindow *self, GError **error)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (error != NULL);
/* show an error message */
gtk_label_set_text (GTK_LABEL (priv->info_message),
(*error)->message);
gtk_info_bar_set_message_type (priv->info_bar,
GTK_MESSAGE_ERROR);
gtk_widget_show (GTK_WIDGET(priv->info_bar));
g_clear_error(error);
}
static gboolean
_update_axis (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer data)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(data);
const char *name;
const HklParameter *axis;
gdouble value, min, max;
gtk_tree_model_get (model, iter,
AXIS_COL_NAME, &name,
-1);
axis = hkl_geometry_axis_get(priv->diffractometer->geometry, name, NULL);
hkl_parameter_min_max_get(axis, &min, &max, HKL_UNIT_USER);
value = hkl_parameter_value_get(axis, HKL_UNIT_USER);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
AXIS_COL_READ, value,
AXIS_COL_WRITE, value,
AXIS_COL_MIN, min,
AXIS_COL_MAX, max,
-1);
return FALSE;
}
static void
update_axes (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_axis),
_update_axis,
self);
}
static gboolean
_update_pseudo_axes (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer data)
{
const char *name;
const HklEngine *engine;
const HklParameter *pseudo_axis;
gdouble value, min, max;
gtk_tree_model_get (model, iter,
PSEUDO_AXIS_COL_ENGINE, &engine,
PSEUDO_AXIS_COL_NAME, &name,
-1);
pseudo_axis = hkl_engine_pseudo_axis_get(engine, name, NULL);
hkl_parameter_min_max_get(pseudo_axis, &min, &max, HKL_UNIT_USER);
value = hkl_parameter_value_get(pseudo_axis, HKL_UNIT_USER);
gtk_list_store_set(GTK_LIST_STORE(model), iter,
PSEUDO_AXIS_COL_READ, value,
PSEUDO_AXIS_COL_WRITE, value,
-1);
return FALSE;
}
static void
update_pseudo_axes (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_pseudo_axes),
_update_pseudo_axes,
self);
}
static void
update_solutions (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkTreeIter iter = {0};
g_return_if_fail (self != NULL);
g_return_if_fail (priv->diffractometer->solutions != NULL);
const HklGeometryListItem *item;
gtk_list_store_clear(priv->liststore_solutions);
gint n_values = gtk_tree_model_get_n_columns (GTK_TREE_MODEL(priv->liststore_solutions));
GValue *values = g_new0(GValue, n_values);
gint *columns = g_new0(gint, n_values);
gint i;
/* prepare the GValue before using them */
g_value_init(&values[SOLUTION_COL_INDEX], G_TYPE_INT);
g_value_init(&values[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM], G_TYPE_POINTER);
for(i=SOLUTION_COL_N_COLUMNS; idiffractometer->solutions){
const HklGeometry *geometry = hkl_geometry_list_item_geometry_get(item);
unsigned int n_v = darray_size(*hkl_geometry_axis_names_get(geometry));
double v[n_v];
hkl_geometry_axis_values_get(geometry, v, n_v, HKL_UNIT_USER);
g_value_set_int(&values[SOLUTION_COL_INDEX], i);
g_value_set_pointer(&values[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM], (gpointer)item);
columns[SOLUTION_COL_INDEX] = SOLUTION_COL_INDEX;
columns[SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM] = SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM;
for(unsigned int j=0; jliststore_solutions,
&iter, i,
columns, values, n_values);
i++;
}
g_free(columns);
g_free(values);
}
static void
update_source (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
gtk_spin_button_set_value (priv->spinbutton_lambda,
hkl_geometry_wavelength_get(priv->diffractometer->geometry,
HKL_UNIT_USER));
}
static void
update_reflections (HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
gtk_list_store_clear (priv->liststore_reflections);
if(priv->sample){
HklSampleReflection* reflection;
guint index = 0;
HKL_SAMPLE_REFLECTIONS_FOREACH(reflection, priv->sample){
GtkTreeIter iter = {0};
gdouble h, k, l;
gboolean flag;
hkl_sample_reflection_hkl_get(reflection, &h, &k, &l);
flag = hkl_sample_reflection_flag_get(reflection);
gtk_list_store_append (priv->liststore_reflections, &iter);
gtk_list_store_set (priv->liststore_reflections,
&iter,
REFLECTION_COL_INDEX, index++,
REFLECTION_COL_H, h,
REFLECTION_COL_K, k,
REFLECTION_COL_L, l,
REFLECTION_COL_FLAG, flag,
REFLECTION_COL_REFLECTION, reflection,
-1);
}
}
}
static void
update_3d(HklGuiWindow *self)
{
#ifdef HKL3D
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
if(priv->frame3d){
hkl_gui_3d_is_colliding(priv->frame3d);
hkl_gui_3d_invalidate(priv->frame3d);
}
#endif
}
static void
pseudo_axes_frame_changed_cb (HklGuiEngine *gui_engine, HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
HklEngine *engine;
GtkListStore *liststore;
guint n_values;
GtkTreeIter iter = {0};
gboolean valid;
GError *error = NULL;
g_object_get(gui_engine,
"engine", &engine,
"liststore", &liststore,
NULL);
n_values = darray_size(*hkl_engine_pseudo_axis_names_get(engine));
gdouble values[n_values];
/* extract all the values from the listore */
valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(liststore), &iter);
while(valid){
guint it_idx;
gdouble it_value;
gtk_tree_model_get (GTK_TREE_MODEL(liststore), &iter,
PSEUDO_COL_IDX, &it_idx,
PSEUDO_COL_VALUE, &it_value,
-1);
values[it_idx] = it_value;
valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(liststore), &iter);
}
if(diffractometer_pseudo_axis_values_set(priv->diffractometer, engine,
values, n_values, &error)){
update_axes (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
update_solutions (self);
update_3d(self);
}else
raise_error(self, &error);
g_object_unref(liststore);
}
static void
set_up_pseudo_axes_frames (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
HklGuiEngine **pseudo;
HklEngine **engine;
darray_engine *engines;
g_return_if_fail (self != NULL);
darray_foreach (pseudo, priv->pseudo_frames){
gtk_container_remove(GTK_CONTAINER(priv->vbox2),
GTK_WIDGET (hkl_gui_engine_get_frame (*pseudo)));
g_object_unref(*pseudo);
}
darray_size (priv->pseudo_frames) = 0;
engines = hkl_engine_list_engines_get (priv->diffractometer->engines);
darray_foreach (engine, *engines){
HklGuiEngine *pseudo;
pseudo = hkl_gui_engine_new (*engine);
darray_append(priv->pseudo_frames, pseudo);
gtk_container_add (GTK_CONTAINER (priv->vbox2),
GTK_WIDGET (hkl_gui_engine_get_frame(pseudo)));
g_signal_connect_object (pseudo,
"changed",
G_CALLBACK(pseudo_axes_frame_changed_cb),
self, 0);
}
gtk_widget_show_all (GTK_WIDGET (priv->vbox2));
}
static void
set_up_diffractometer_model (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
unsigned int i;
size_t n;
HklFactory **factories;
g_return_if_fail (self != NULL);
factories = hkl_factory_get_all(&n);
for(i=0; iliststore_diffractometer, &iter);
gtk_list_store_set (priv->liststore_diffractometer, &iter,
DIFFRACTOMETER_COL_NAME, hkl_factory_name_get(factories[i]),
DIFFRACTOMETER_COL_FACTORY, factories[i],
DIFFRACTOMETER_COL_DIFFRACTOMETER, NULL,
-1);
}
}
static void
set_up_tree_view_axes (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
const darray_string *axes;
const char **axis;
GtkTreeIter iter = {0};
gtk_list_store_clear (priv->liststore_axis);
axes = hkl_geometry_axis_names_get(priv->diffractometer->geometry);
darray_foreach (axis, *axes){
gtk_list_store_append (priv->liststore_axis, &iter);
gtk_list_store_set (priv->liststore_axis, &iter,
AXIS_COL_NAME, *axis,
-1);
}
update_axes (self);
}
static void
set_up_tree_view_pseudo_axes (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
HklEngine **engine;
const darray_engine *engines;
gtk_list_store_clear(priv->liststore_pseudo_axes);
engines = hkl_engine_list_engines_get(priv->diffractometer->engines);
darray_foreach(engine, *engines){
const darray_string *pseudo_axes = hkl_engine_pseudo_axis_names_get(*engine);
GtkTreeIter iter = {0};
guint idx;
for(idx=0; idxliststore_pseudo_axes, &iter);
gtk_list_store_set (priv->liststore_pseudo_axes, &iter,
PSEUDO_AXIS_COL_IDX, idx,
PSEUDO_AXIS_COL_ENGINE, *engine,
PSEUDO_AXIS_COL_NAME, darray_item(*pseudo_axes, idx),
-1);
}
}
update_pseudo_axes (self);
}
static void
_delete_column(gpointer data,
gpointer user_data)
{
gtk_tree_view_remove_column (GTK_TREE_VIEW(user_data),
GTK_TREE_VIEW_COLUMN(data));
}
static void
set_up_tree_view_solutions (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
const darray_string *axes;
int i;
GtkCellRenderer* renderer = NULL;
GtkTreeViewColumn* column = NULL;
GList* columns;
GType* types;
gint n_columns;
axes = hkl_geometry_axis_names_get(priv->diffractometer->geometry);
n_columns = SOLUTION_COL_N_COLUMNS + darray_size(*axes);
/* prepare types for the liststore */
types = g_new0 (GType, n_columns);
/* first remove all the columns */
columns = gtk_tree_view_get_columns (priv->treeview_solutions);
g_list_foreach(columns, _delete_column, priv->treeview_solutions);
g_list_free(columns);
/* now add the index column */
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("index",
renderer, "text",
SOLUTION_COL_INDEX, NULL);
gtk_tree_view_append_column (priv->treeview_solutions, column);
types[0] = G_TYPE_INT;
types[1] = G_TYPE_POINTER;
/* add the axes column */
for(i=SOLUTION_COL_N_COLUMNS; itreeview_solutions, column);
types[i] = G_TYPE_DOUBLE;
}
if (priv->liststore_solutions)
g_object_unref(priv->liststore_solutions);
priv->liststore_solutions = gtk_list_store_newv (n_columns, types);
g_free (types);
gtk_tree_view_set_model (priv->treeview_solutions,
GTK_TREE_MODEL(priv->liststore_solutions));
update_solutions (self);
}
void
set_up_info_bar(HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkWidget *content_area;
g_return_if_fail (self != NULL);
/* set up info bar until we can use glade for this purpose or
* switch to gtk3 */
if (priv->info_bar)
return;
priv->info_bar = GTK_INFO_BAR(gtk_info_bar_new ());
gtk_widget_set_no_show_all (GTK_WIDGET(priv->info_bar), TRUE);
priv->info_message = GTK_LABEL(gtk_label_new (""));
gtk_widget_show (GTK_WIDGET(priv->info_message));
content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (priv->info_bar));
gtk_container_add (GTK_CONTAINER (content_area),
GTK_WIDGET(priv->info_message));
gtk_info_bar_add_button (priv->info_bar,
GTK_STOCK_OK, GTK_RESPONSE_OK);
g_signal_connect (priv->info_bar, "response",
G_CALLBACK (gtk_widget_hide), NULL);
gtk_box_pack_start(GTK_BOX(priv->box_info_bar),
GTK_WIDGET(priv->info_bar),
TRUE, TRUE, 0);
}
static void
set_up_lambda(HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_object_set(G_OBJECT(priv->spinbutton_lambda),
"sensitive", TRUE,
NULL);
gtk_spin_button_set_value(priv->spinbutton_lambda,
hkl_geometry_wavelength_get(priv->diffractometer->geometry,
HKL_UNIT_USER));
}
static void
set_up_3D (HklGuiWindow* self)
{
#if HKL3D
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
char *filename = NULL;
const char *name = hkl_factory_name_get(priv->diffractometer->factory);
if(!strcmp("K6C", name))
filename = get_model("diffabs.yaml");
else if (!strcmp("K4CV", name))
filename = get_model("cristal4C.yaml");
if(priv->frame3d){
gtk_widget_destroy(GTK_WIDGET(hkl_gui_3d_frame_get(priv->frame3d)));
g_object_unref(priv->frame3d);
priv->frame3d = NULL;
}
if (filename){
priv->frame3d = hkl_gui_3d_new(filename, priv->diffractometer->geometry);
gtk_box_pack_start (GTK_BOX(priv->vbox7),
GTK_WIDGET(hkl_gui_3d_frame_get(priv->frame3d)),
TRUE, TRUE, (guint) 0);
gtk_widget_show_all (GTK_WIDGET(priv->vbox7));
}
#endif
}
/* select diffractometer */
void
hkl_gui_window_combobox1_changed_cb(GtkComboBox *combobox, gpointer *user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
HklFactory *factory;
struct diffractometer_t *dif = NULL;
GtkTreeIter iter = {0};
if(gtk_combo_box_get_active_iter (combobox, &iter)){
gtk_tree_model_get(GTK_TREE_MODEL(priv->liststore_diffractometer),
&iter,
DIFFRACTOMETER_COL_FACTORY, &factory,
DIFFRACTOMETER_COL_DIFFRACTOMETER, &dif,
-1);
if (!dif){
dif = create_diffractometer(factory);
gtk_list_store_set(priv->liststore_diffractometer,
&iter,
DIFFRACTOMETER_COL_DIFFRACTOMETER, dif,
-1);
}
}
if(dif != priv->diffractometer){
priv->diffractometer = dif;
diffractometer_set_sample(dif, priv->sample);
set_up_lambda(self);
set_up_pseudo_axes_frames(self);
set_up_tree_view_axes(self);
set_up_tree_view_pseudo_axes(self);
set_up_tree_view_solutions(self);
set_up_info_bar(self);
set_up_3D(self);
}
}
/* axis read cb */
void
hkl_gui_window_cellrendererspin1_edited_cb(GtkCellRendererText *renderer,
gchar *path,
gchar *new_text,
gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
gdouble value = 0.0;
const char *axis;
HklParameter *parameter;
g_return_if_fail (renderer != NULL);
g_return_if_fail (path != NULL);
g_return_if_fail (new_text != NULL);
g_return_if_fail (user_data != NULL);
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
AXIS_COL_NAME, &axis,
-1);
value = atof(new_text); /* TODO need to check for the right conversion */
/* set the axis value */
parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
axis, NULL));
if(NULL == parameter)
return;
if(FALSE == hkl_parameter_value_set (parameter, value, HKL_UNIT_USER, NULL))
goto out;
if(FALSE == hkl_geometry_axis_set(priv->diffractometer->geometry,
axis, parameter, NULL))
goto out;
hkl_engine_list_get(priv->diffractometer->engines);
/* ok so set the model with the new value */
gtk_list_store_set (priv->liststore_axis, &iter,
AXIS_COL_READ, value,
AXIS_COL_WRITE, value,
-1);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
update_3d(self);
out:
hkl_parameter_free(parameter);
return;
}
/* axis min cb */
void
hkl_gui_window_cellrendererspin3_edited_cb(GtkCellRendererText *renderer,
gchar *path,
gchar *new_text,
gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
gdouble value = 0.0;
const char *axis;
HklParameter* parameter = NULL;
gdouble shit, max;
g_return_if_fail (renderer != NULL);
g_return_if_fail (path != NULL);
g_return_if_fail (new_text != NULL);
g_return_if_fail (user_data != NULL);
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
AXIS_COL_NAME, &axis,
-1);
value = atof(new_text); /* TODO need to check for the right conversion */
parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
axis, NULL));
if(NULL == parameter)
goto out;
hkl_parameter_min_max_get (parameter, &shit, &max, HKL_UNIT_USER);
if(FALSE == hkl_parameter_min_max_set (parameter, value, max, HKL_UNIT_USER, NULL))
goto free_parameter;
if(FALSE == hkl_geometry_axis_set(priv->diffractometer->geometry,
axis, parameter, NULL))
goto free_parameter;
gtk_list_store_set (priv->liststore_axis, &iter,
AXIS_COL_MIN, value,
-1);
update_pseudo_axes (self);
free_parameter:
hkl_parameter_free(parameter);
out:
return;
}
/* axis max cb */
void
hkl_gui_window_cellrendererspin4_edited_cb(GtkCellRendererText *renderer,
gchar *path,
gchar *new_text,
gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
gdouble value = 0.0;
const char *axis;
HklParameter* parameter = NULL;
gdouble shit, min;
g_return_if_fail (renderer != NULL);
g_return_if_fail (path != NULL);
g_return_if_fail (new_text != NULL);
g_return_if_fail (user_data != NULL);
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_axis),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_axis), &iter,
AXIS_COL_NAME, &axis,
-1);
value = atof(new_text); /* TODO need to check for the right conversion */
parameter = hkl_parameter_new_copy(hkl_geometry_axis_get(priv->diffractometer->geometry,
axis, NULL));
if(NULL == parameter)
goto out;
hkl_parameter_min_max_get (parameter, &min, &shit, HKL_UNIT_USER);
if(FALSE == hkl_parameter_min_max_set (parameter, min, value, HKL_UNIT_USER, NULL))
goto free_parameter;
if (FALSE == hkl_geometry_axis_set(priv->diffractometer->geometry,
axis, parameter, NULL))
goto free_parameter;
gtk_list_store_set (priv->liststore_axis, &iter,
AXIS_COL_MAX, value,
-1);
update_pseudo_axes (self);
free_parameter:
hkl_parameter_free(parameter);
out:
return;
}
/* pseudo axis write */
void
hkl_gui_window_cellrenderertext5_edited_cb(GtkCellRendererText *renderer,
gchar *path,
gchar *new_text,
gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
gdouble value = 0.0;
gdouble old_value;
unsigned int idx;
HklEngine *engine = NULL;
gboolean valid;
GtkTreeIter it = {0};
guint n_values;
GError *error = NULL;
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_pseudo_axes),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_pseudo_axes), &iter,
PSEUDO_AXIS_COL_IDX, &idx,
PSEUDO_AXIS_COL_ENGINE, &engine,
PSEUDO_AXIS_COL_WRITE, &old_value,
-1);
n_values = darray_size(*hkl_engine_pseudo_axis_names_get(engine));
gdouble values[n_values];
/* extract all the values from the listore */
valid = gtk_tree_model_get_iter_first(GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it);
while(valid){
guint it_idx;
HklEngine *it_engine;
gdouble it_value;
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it,
PSEUDO_AXIS_COL_IDX, &it_idx,
PSEUDO_AXIS_COL_ENGINE, &it_engine,
PSEUDO_AXIS_COL_WRITE, &it_value,
-1);
if(engine == it_engine)
values[it_idx] = it_value;
valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(priv->liststore_pseudo_axes), &it);
}
/* replace with the new value */
value = atof(new_text); /* TODO need to check for the right conversion */
values[idx] = value;
if(diffractometer_pseudo_axis_values_set(priv->diffractometer, engine,
values, n_values, &error)){
gtk_list_store_set (priv->liststore_pseudo_axes,
&iter,
PSEUDO_AXIS_COL_WRITE, value,
-1);
update_axes (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
update_solutions (self);
update_3d(self);
}else
raise_error(self, &error);
}
void
hkl_gui_window_treeview_solutions_cursor_changed_cb (GtkTreeView *tree_view,
gpointer user_data)
{
HklGuiWindow* self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreePath* path = NULL;
GtkTreeViewColumn* focus_column = NULL;
GtkTreeIter iter = {0};
const HklGeometryListItem *solution;
gtk_tree_view_get_cursor (tree_view, &path, &focus_column);
gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_solutions), &iter, path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_solutions), &iter,
SOLUTION_COL_HKL_GEOMETRY_LIST_ITEM, &solution,
-1);
diffractometer_set_solution(priv->diffractometer, solution);
update_axes (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
update_3d(self);
gtk_tree_path_free (path);
}
/* reflection h k l */
#define HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(_number, _hkl, _HKL) \
void \
hkl_gui_window_cellrenderertext ## _number ## _edited_cb(GtkCellRendererText* _sender, const gchar* path, \
const gchar* new_text, gpointer user_data) \
{ \
HklGuiWindow *self = HKL_GUI_WINDOW(user_data); \
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
\
g_return_if_fail (self != NULL); \
g_return_if_fail (path != NULL); \
g_return_if_fail (new_text != NULL); \
\
if (priv->sample){ \
gdouble h = 0.0; \
gdouble k = 0.0; \
gdouble l = 0.0; \
HklSampleReflection* reflection = NULL; \
GtkTreeIter iter = {0}; \
GError *error = NULL; \
\
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_reflections), \
&iter, path); \
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), \
&iter, \
REFLECTION_COL_REFLECTION, &reflection, \
-1); \
\
hkl_sample_reflection_hkl_get (reflection, &h, &k, &l); \
_hkl = atof(new_text); \
if(!hkl_sample_reflection_hkl_set (reflection, h, k, l, NULL)) \
raise_error(self, &error); \
else \
gtk_list_store_set (priv->liststore_reflections, \
&iter, \
REFLECTION_COL_ ## _HKL, _hkl, \
-1); \
} \
}
HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(7, h, H);
HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(8, k, K);
HKL_GUI_WINDOW_CELLRENDERERTEXT_HKL_EDITED_CB(9, l, L);
/* reflection flag */
void
hkl_gui_window_cellrenderertoggle1_toggled_cb (GtkCellRendererToggle* renderer, const gchar* path,
gpointer self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
g_return_if_fail (path != NULL);
if (priv->sample){
gboolean flag;
HklSampleReflection* reflection = NULL;
GtkTreeIter iter = {0};
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->liststore_reflections),
&iter, path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
&iter,
REFLECTION_COL_REFLECTION, &reflection,
-1);
flag = gtk_cell_renderer_toggle_get_active(renderer);
hkl_sample_reflection_flag_set (reflection, flag);
gtk_list_store_set (priv->liststore_reflections,
&iter,
REFLECTION_COL_FLAG, flag,
-1);
}
}
gboolean
hkl_gui_window_treeview_reflections_key_press_event_cb (GtkWidget* _sender, GdkEventKey* event,
gpointer self)
{
return TRUE;
}
void
hkl_gui_window_toolbutton_add_reflection_clicked_cb(GtkToolButton* _sender,
gpointer self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
if (priv->diffractometer == NULL){
gtk_statusbar_push (priv->statusbar, 0,
"Please select a diffractometer before adding reflections");
return;
}
if (priv->sample) {
HklSampleReflection *reflection = NULL;
GtkTreeIter iter = {0};
gboolean flag;
gint n_rows;
GError *error = NULL;
reflection = hkl_sample_reflection_new(priv->diffractometer->geometry,
priv->diffractometer->detector,
0, 0, 0, &error);
if(!reflection)
raise_error(self, &error);
else{
hkl_sample_add_reflection(priv->sample, reflection);
flag = hkl_sample_reflection_flag_get(reflection);
n_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(priv->liststore_reflections),
NULL);
gtk_list_store_insert_with_values (priv->liststore_reflections,
&iter, -1,
REFLECTION_COL_INDEX, n_rows,
REFLECTION_COL_H, 0.,
REFLECTION_COL_K, 0.,
REFLECTION_COL_L, 0.,
REFLECTION_COL_FLAG, flag,
REFLECTION_COL_REFLECTION, reflection,
-1);
}
}
}
void
hkl_gui_window_toolbutton_goto_reflection_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
g_return_if_fail (self != NULL);
if (priv->sample) {
GtkTreeSelection* selection = NULL;
guint nb_rows = 0U;
selection = gtk_tree_view_get_selection (priv->treeview_reflections);
nb_rows = gtk_tree_selection_count_selected_rows (selection);
if (nb_rows == 1) {
HklSampleReflection *reflection;
GtkTreeIter iter = {0};
GtkTreeModel* model = NULL;
GtkTreePath *treepath;
GList* list;
model = GTK_TREE_MODEL(priv->liststore_reflections);
list = gtk_tree_selection_get_selected_rows (selection,
&model);
treepath = g_list_nth_data(list, 0);
gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
&iter, treepath);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
&iter,
REFLECTION_COL_REFLECTION, &reflection,
-1);
hkl_geometry_set (priv->diffractometer->geometry,
hkl_sample_reflection_geometry_get(reflection));
update_source (self);
update_axes (self);
update_pseudo_axes (self);
update_3d(self);
g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
} else
if (nb_rows > 1)
gtk_statusbar_push (priv->statusbar, 0,
"Please select only one reflection.");
else
gtk_statusbar_push (priv->statusbar, 0,
"Please select at least one reflection.");
}
}
static void
_del_reflection(gpointer data, gpointer user_data)
{
HklSampleReflection *reflection;
GtkTreeIter iter = {0};
GtkTreePath *treepath = data;
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
&iter, treepath);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections),
&iter,
REFLECTION_COL_REFLECTION, &reflection,
-1);
hkl_sample_del_reflection(priv->sample, reflection);
}
void
hkl_gui_window_toolbutton_del_reflection_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
g_return_if_fail (self != NULL);
if (priv->sample) {
GtkTreeSelection* selection = NULL;
guint nb_rows = 0U;
selection = gtk_tree_view_get_selection (priv->treeview_reflections);
nb_rows = gtk_tree_selection_count_selected_rows (selection);
if (nb_rows > 0) {
GtkTreeModel* model = NULL;
GList* list;
GtkMessageDialog* dialog;
model = GTK_TREE_MODEL(priv->liststore_reflections);
list = gtk_tree_selection_get_selected_rows (selection, &model);
dialog = GTK_MESSAGE_DIALOG(
gtk_message_dialog_new (NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_YES_NO,
"Are you sure that you want to delete reflections"));
switch (gtk_dialog_run (GTK_DIALOG(dialog))) {
case GTK_RESPONSE_YES:
{
g_list_foreach(list, _del_reflection, self);
update_reflections (self);
break;
}
default:
break;
}
gtk_widget_destroy (GTK_WIDGET(dialog));
g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
} else {
gtk_statusbar_push (priv->statusbar, 0,
"Please select at least one reflection.");
}
}
}
static void
set_up_tree_view_reflections(HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkTreeSelection* selection = NULL;
selection = gtk_tree_view_get_selection (priv->treeview_reflections);
gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
}
/* crystal name */
void
hkl_gui_window_cellrenderertext10_edited_cb(GtkCellRendererText* _sender, const gchar* path,
const gchar* new_text, gpointer user_data)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeModel* model = NULL;
GtkTreeIter iter = {0};
HklSample* sample = NULL;
g_return_if_fail (user_data != NULL);
g_return_if_fail (path != NULL);
g_return_if_fail (new_text != NULL);
model = GTK_TREE_MODEL(priv->liststore_crystals);
gtk_tree_model_get_iter_from_string (model, &iter, path);
gtk_tree_model_get (model, &iter,
SAMPLE_COL_SAMPLE, &sample,
-1);
hkl_sample_name_set (sample, new_text);
gtk_list_store_set(priv->liststore_crystals, &iter,
SAMPLE_COL_NAME, new_text,
-1);
}
#define set_lattice(lattice, parameter) do{ \
const HklParameter *p; \
gdouble min, max, value; \
gboolean fit; \
p = hkl_lattice_## parameter ##_get((lattice)); \
value = hkl_parameter_value_get(p, HKL_UNIT_USER); \
hkl_parameter_min_max_get(p, &min, &max, HKL_UNIT_USER); \
fit = hkl_parameter_fit_get(p); \
gtk_spin_button_set_value(priv->spinbutton_## parameter, value); \
gtk_spin_button_set_value(priv->spinbutton_## parameter ##_min, min); \
gtk_spin_button_set_value(priv->spinbutton_## parameter ##_max, max); \
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->checkbutton_ ## parameter), fit); \
}while(0)
static void
update_lattice (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
if (priv->sample != NULL) {
const HklLattice *lattice;
lattice = hkl_sample_lattice_get(priv->sample);
set_lattice(lattice, a);
set_lattice(lattice, b);
set_lattice(lattice, c);
set_lattice(lattice, alpha);
set_lattice(lattice, beta);
set_lattice(lattice, gamma);
}
}
#define set_reciprocal_lattice(lattice, parameter) do{ \
const HklParameter *p; \
gdouble value; \
p = hkl_lattice_## parameter ##_get((lattice)); \
value = hkl_parameter_value_get(p, HKL_UNIT_USER); \
gtk_spin_button_set_value(priv->spinbutton_## parameter ##_star, value); \
}while(0)
static void
update_reciprocal_lattice (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
if (priv->sample != NULL) {
hkl_lattice_reciprocal (hkl_sample_lattice_get(priv->sample),
priv->reciprocal);
set_reciprocal_lattice(priv->reciprocal, a);
set_reciprocal_lattice(priv->reciprocal, b);
set_reciprocal_lattice(priv->reciprocal, c);
set_reciprocal_lattice(priv->reciprocal, alpha);
set_reciprocal_lattice(priv->reciprocal, beta);
set_reciprocal_lattice(priv->reciprocal, gamma);
}
}
#define set_ux_uy_uz(sample, parameter) do { \
const HklParameter *p; \
p = hkl_sample_## parameter ##_get((sample)); \
gboolean fit = hkl_parameter_fit_get(p); \
gtk_spin_button_set_value(priv->spinbutton_## parameter, \
hkl_parameter_value_get(p, HKL_UNIT_USER)); \
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter), fit); \
}while(0)
static void
update_ux_uy_uz (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
if (priv->sample != NULL) {
set_ux_uy_uz(priv->sample, ux);
set_ux_uy_uz(priv->sample, uy);
set_ux_uy_uz(priv->sample, uz);
}
}
#define set_UB(i, j) do{ \
gtk_label_set_markup(priv->label_UB ## i ## j, \
g_ascii_formatd(text, \
G_ASCII_DTOSTR_BUF_SIZE, \
" %+.4f ", \
hkl_matrix_get(UB, i - 1, j - 1))); \
}while(0)
static void
update_UB (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
if (priv->sample != NULL) {
const HklMatrix *UB = hkl_sample_UB_get (priv->sample);
gchar *text = g_new0 (gchar, G_ASCII_DTOSTR_BUF_SIZE);
set_UB(1, 1);
set_UB(1, 2);
set_UB(1, 3);
set_UB(2, 1);
set_UB(2, 2);
set_UB(2, 3);
set_UB(3, 1);
set_UB(3, 2);
set_UB(3, 3);
g_free(text);
}
}
void
hkl_gui_window_treeview_crystals_cursor_changed_cb (GtkTreeView* _sender, gpointer user_data)
{
GtkTreePath* path = NULL;
GtkTreeViewColumn* column = NULL;
GtkTreeIter iter = {0};
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
HklSample *sample;
g_return_if_fail (user_data != NULL);
gtk_tree_view_get_cursor (priv->treeview_crystals, &path, &column);
if(path){
if (gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_crystals),
&iter, path) == TRUE){
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_crystals),
&iter,
SAMPLE_COL_SAMPLE, &sample,
-1);
if(sample && sample != priv->sample){
priv->sample = sample;
update_reflections(self);
update_lattice(self);
update_reciprocal_lattice (self);
update_ux_uy_uz (self);
update_UB (self);
if(priv->diffractometer){
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
update_solutions(self);
}
}
}
gtk_tree_path_free (path);
}
}
static GtkTreeIter
_add_sample(HklGuiWindow *self, HklSample *sample)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkTreeIter iter = {0};
const HklLattice *lattice;
gdouble a, b, c, alpha, beta, gamma;
g_return_val_if_fail (self != NULL, iter);
lattice = hkl_sample_lattice_get(sample);
a = hkl_parameter_value_get(hkl_lattice_a_get(lattice), HKL_UNIT_USER);
b = hkl_parameter_value_get(hkl_lattice_b_get(lattice), HKL_UNIT_USER);
c = hkl_parameter_value_get(hkl_lattice_c_get(lattice), HKL_UNIT_USER);
alpha = hkl_parameter_value_get(hkl_lattice_alpha_get(lattice),
HKL_UNIT_USER);
beta = hkl_parameter_value_get(hkl_lattice_beta_get(lattice),
HKL_UNIT_USER);
gamma = hkl_parameter_value_get(hkl_lattice_gamma_get(lattice),
HKL_UNIT_USER);
gtk_list_store_insert_with_values(priv->liststore_crystals,
&iter, -1,
SAMPLE_COL_SAMPLE, sample,
SAMPLE_COL_NAME, hkl_sample_name_get(sample),
SAMPLE_COL_A, a,
SAMPLE_COL_B, b,
SAMPLE_COL_C, c,
SAMPLE_COL_ALPHA, alpha,
SAMPLE_COL_BETA, beta,
SAMPLE_COL_GAMMA, gamma,
-1);
return iter;
}
static void
set_up_tree_view_crystals (HklGuiWindow* self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkTreeIter iter = {0};
GtkTreePath *path = NULL;
g_return_if_fail (self != NULL);
iter = _add_sample(self, hkl_sample_new("default"));
path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
&iter);
gtk_tree_view_set_cursor(priv->treeview_crystals, path, NULL, FALSE);
gtk_tree_path_free(path);
}
static void
_add_sample_and_edit_name(HklGuiWindow *self, HklSample *sample)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
GtkTreeIter iter = {0};
GtkTreePath* path = NULL;
GtkTreeViewColumn* column = NULL;
iter = _add_sample(self, sample);
path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
&iter);
column = gtk_tree_view_get_column (priv->treeview_crystals, 0);
gtk_tree_view_set_cursor (priv->treeview_crystals, path, column, TRUE);
gtk_tree_path_free(path);
}
void
hkl_gui_window_toolbutton_add_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklSample *sample;
g_return_if_fail (user_data != NULL);
sample = hkl_sample_new ("new");
if(sample)
_add_sample_and_edit_name(self, sample);
}
void
hkl_gui_window_toolbutton_copy_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
HklSample *copy = NULL;
g_return_if_fail (self != NULL);
if(priv->sample) {
copy = hkl_sample_new_copy(priv->sample);
if (copy)
_add_sample_and_edit_name(self, copy);
}else
gtk_statusbar_push (priv->statusbar, (guint) 0, "Please select a crystal to copy.");
}
void
hkl_gui_window_toolbutton_del_crystal_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
g_return_if_fail (user_data != NULL);
if (priv->sample != NULL) {
guint n_rows;
n_rows = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(priv->liststore_crystals),
NULL );
if (n_rows == 1)
return;
else {
GtkTreeIter iter = {0};
GtkTreePath *path = NULL;
GtkTreeViewColumn *column = NULL;
gtk_tree_view_get_cursor(priv->treeview_crystals,
&path, &column);
if (path){
if (gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_crystals),
&iter, path) == TRUE) {
gtk_tree_path_free(path);
hkl_sample_free(priv->sample);
if (gtk_list_store_remove(priv->liststore_crystals,
&iter) == TRUE){
path = gtk_tree_model_get_path(GTK_TREE_MODEL(priv->liststore_crystals),
&iter);
gtk_tree_view_set_cursor(priv->treeview_crystals,
path, NULL, FALSE);
}
}
}
}
}
}
#define get_lattice_parameter(lattice, parameter, _error) do{ \
HklParameter *p = hkl_parameter_new_copy(hkl_lattice_## parameter ##_get(lattice)); \
if(!hkl_parameter_min_max_set(p, \
gtk_spin_button_get_value(priv->spinbutton_## parameter ##_min), \
gtk_spin_button_get_value(priv->spinbutton_## parameter ##_max), \
HKL_UNIT_USER, _error)){ \
raise_error(self, _error); \
hkl_parameter_free(p); \
return; \
}else{ \
hkl_parameter_fit_set(p, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter))); \
if(!hkl_lattice_ ## parameter ## _set(lattice, p, _error)){ \
raise_error(self, _error); \
hkl_parameter_free(p); \
return; \
} \
} \
hkl_parameter_free(p); \
} while(0)
#define get_ux_uy_uz(sample, parameter, _error) do { \
HklParameter *p; \
p = hkl_parameter_new_copy(hkl_sample_## parameter ##_get(sample)); \
if(!hkl_parameter_value_set(p, \
gtk_spin_button_get_value (priv->spinbutton_## parameter), \
HKL_UNIT_USER, _error)){ \
raise_error(self, _error); \
hkl_parameter_free(p); \
return; \
}else{ \
hkl_parameter_fit_set(p, \
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(priv->checkbutton_## parameter))); \
if(!hkl_sample_ ## parameter ## _set(sample, p, _error)){ \
raise_error(self, _error); \
hkl_parameter_free(p); \
return; \
} \
} \
hkl_parameter_free(p); \
}while(0)
static gboolean
_update_crystal_model(GtkTreeModel *model,
GtkTreePath *path,
GtkTreeIter *iter,
gpointer data)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(data);
HklSample *sample = NULL;
gtk_tree_model_get(model, iter,
SAMPLE_COL_SAMPLE, &sample,
-1);
if(priv->sample == sample){
const HklLattice *lattice;
gdouble a, b, c, alpha, beta, gamma;
lattice = hkl_sample_lattice_get(sample);
a = hkl_parameter_value_get(hkl_lattice_a_get(lattice),
HKL_UNIT_USER);
b = hkl_parameter_value_get(hkl_lattice_b_get(lattice),
HKL_UNIT_USER);
c = hkl_parameter_value_get(hkl_lattice_c_get(lattice),
HKL_UNIT_USER);
alpha = hkl_parameter_value_get(hkl_lattice_alpha_get(lattice),
HKL_UNIT_USER);
beta = hkl_parameter_value_get(hkl_lattice_beta_get(lattice),
HKL_UNIT_USER);
gamma = hkl_parameter_value_get(hkl_lattice_gamma_get(lattice),
HKL_UNIT_USER);
gtk_list_store_set(priv->liststore_crystals,
iter,
SAMPLE_COL_NAME, hkl_sample_name_get(sample),
SAMPLE_COL_A, a,
SAMPLE_COL_B, b,
SAMPLE_COL_C, c,
SAMPLE_COL_ALPHA, alpha,
SAMPLE_COL_BETA, beta,
SAMPLE_COL_GAMMA, gamma,
-1);
return TRUE;
}
return FALSE;
}
static void
update_crystal_model(HklGuiWindow *self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
gtk_tree_model_foreach(GTK_TREE_MODEL(priv->liststore_crystals),
_update_crystal_model,
self);
}
/* apply crystal parameters */
void
hkl_gui_window_button2_clicked_cb (GtkButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
g_return_if_fail (self != NULL);
if (priv->sample != NULL) {
gdouble a, b, c, alpha, beta, gamma;
HklLattice *lattice;
GError *error = NULL;
fprintf(stderr, "%s\n", __func__);
/* lattice parameters */
a = gtk_spin_button_get_value (priv->spinbutton_a);
b = gtk_spin_button_get_value (priv->spinbutton_b);
c = gtk_spin_button_get_value (priv->spinbutton_c);
alpha = gtk_spin_button_get_value (priv->spinbutton_alpha);
beta = gtk_spin_button_get_value (priv->spinbutton_beta);
gamma = gtk_spin_button_get_value (priv->spinbutton_gamma);
lattice = hkl_lattice_new(a, b, c,
alpha * HKL_DEGTORAD,
beta * HKL_DEGTORAD,
gamma * HKL_DEGTORAD, &error);
if(!lattice)
raise_error(self, &error);
else{
get_lattice_parameter(lattice, a, &error);
get_lattice_parameter(lattice, b, &error);
get_lattice_parameter(lattice, c, &error);
get_lattice_parameter(lattice, alpha, &error);
get_lattice_parameter(lattice, beta, &error);
get_lattice_parameter(lattice, gamma, &error);
hkl_sample_lattice_set(priv->sample, lattice);
hkl_lattice_free(lattice);
/* UB */
get_ux_uy_uz(priv->sample, ux, &error);
get_ux_uy_uz(priv->sample, uy, &error);
get_ux_uy_uz(priv->sample, uz, &error);
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_crystal_model (self);
update_reciprocal_lattice (self);
update_UB (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
}
}
void
hkl_gui_window_spinbutton_lambda_value_changed_cb (GtkSpinButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
diffractometer_set_wavelength(priv->diffractometer,
gtk_spin_button_get_value(_sender));
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
void
hkl_gui_window_spinbutton_ux_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GError *error = NULL;
get_ux_uy_uz(priv->sample, ux, &error);
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_UB (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
void
hkl_gui_window_spinbutton_uy_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GError *error = NULL;
get_ux_uy_uz(priv->sample, uy, &error);
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_UB (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
void
hkl_gui_window_spinbutton_uz_value_changed_cb (GtkSpinButton *_senser, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GError *error = NULL;
get_ux_uy_uz(priv->sample, uz, &error);
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_UB (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
void
hkl_gui_window_toolbutton_setUB_clicked_cb(GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
HklMatrix *UB;
GError *error = NULL;
UB = hkl_matrix_new_full(gtk_spin_button_get_value(priv->spinbutton_U11),
gtk_spin_button_get_value(priv->spinbutton_U12),
gtk_spin_button_get_value(priv->spinbutton_U13),
gtk_spin_button_get_value(priv->spinbutton_U21),
gtk_spin_button_get_value(priv->spinbutton_U22),
gtk_spin_button_get_value(priv->spinbutton_U23),
gtk_spin_button_get_value(priv->spinbutton_U31),
gtk_spin_button_get_value(priv->spinbutton_U32),
gtk_spin_button_get_value(priv->spinbutton_U33));
if(!hkl_sample_UB_set (priv->sample, UB, &error))
raise_error(self, &error);
else{
if(priv->diffractometer){
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_lattice (self);
update_crystal_model (self);
update_reciprocal_lattice (self);
update_UB (self);
update_ux_uy_uz (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
}
hkl_matrix_free(UB);
}
void
hkl_gui_window_toolbutton_computeUB_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GtkTreeSelection* selection = NULL;
guint nb_rows = 0U;
selection = gtk_tree_view_get_selection (priv->treeview_reflections);
nb_rows = gtk_tree_selection_count_selected_rows (selection);
if (nb_rows > 1) {
GtkTreeModel* model = NULL;
GList* list;
GtkTreeIter iter = {0};
GtkTreePath *path;
HklSampleReflection *ref1, *ref2;
GError *error = NULL;
model = GTK_TREE_MODEL(priv->liststore_reflections);
list = gtk_tree_selection_get_selected_rows (selection, &model);
/* get the first reflection */
path = g_list_nth_data(list, 0);
gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), &iter,
REFLECTION_COL_REFLECTION, &ref1,
-1);
/* get the second one */
path = g_list_nth_data(list, 1);
gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->liststore_reflections),
&iter,
path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->liststore_reflections), &iter,
REFLECTION_COL_REFLECTION, &ref2,
-1);
if(!hkl_sample_compute_UB_busing_levy(priv->sample,
ref1, ref2, &error)){
raise_error(self, &error);
}else{
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_UB (self);
update_ux_uy_uz (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
g_list_free_full (list, (GDestroyNotify) gtk_tree_path_free);
} else {
gtk_statusbar_push (priv->statusbar, 0,
"Please select at least two reflection.");
}
}
void
hkl_gui_window_toolbutton_affiner_clicked_cb (GtkToolButton* _sender, gpointer user_data)
{
HklGuiWindow *self = HKL_GUI_WINDOW(user_data);
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data);
GError *error = NULL;
if(!hkl_sample_affine (priv->sample, &error)){
raise_error(self, &error);
}else{
if(priv->diffractometer)
diffractometer_set_sample(priv->diffractometer,
priv->sample);
update_lattice (self);
update_crystal_model (self);
update_reciprocal_lattice (self);
update_UB (self);
update_ux_uy_uz (self);
update_pseudo_axes (self);
update_pseudo_axes_frames (self);
}
}
#define TOGGLE_LATTICE_CB(_parameter) \
void hkl_gui_window_checkbutton_ ## _parameter ## _toggled_cb(GtkCheckButton *checkbutton, \
gpointer user_data) \
{ \
HklGuiWindow *self = HKL_GUI_WINDOW(user_data); \
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
HklLattice *lattice; \
HklParameter *p; \
GError *error = NULL; \
lattice = hkl_lattice_new_copy(hkl_sample_lattice_get(priv->sample)); \
p = hkl_parameter_new_copy(hkl_lattice_## _parameter ##_get(lattice)); \
hkl_parameter_fit_set(p, \
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton))); \
if(!hkl_lattice_## _parameter ##_set(lattice, p, &error)){ \
raise_error(self, &error); \
}else{ \
hkl_sample_lattice_set(priv->sample, lattice); \
} \
hkl_parameter_free(p); \
hkl_lattice_free(lattice); \
}
TOGGLE_LATTICE_CB(a);
TOGGLE_LATTICE_CB(b);
TOGGLE_LATTICE_CB(c);
TOGGLE_LATTICE_CB(alpha);
TOGGLE_LATTICE_CB(beta);
TOGGLE_LATTICE_CB(gamma);
#define TOGGLE_UX_UY_UZ(_parameter) \
void hkl_gui_window_checkbutton_ ## _parameter ## _toggled_cb(GtkCheckButton *checkbutton, \
gpointer user_data) \
{ \
HklGuiWindow *self = HKL_GUI_WINDOW(user_data); \
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(user_data); \
HklParameter *p; \
GError *error = NULL; \
p = hkl_parameter_new_copy(hkl_sample_ ## _parameter ## _get(priv->sample)); \
hkl_parameter_fit_set(p, \
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON(checkbutton))); \
if(!hkl_sample_ ## _parameter ## _set(priv->sample, p, &error)){ \
raise_error(self, &error); \
} \
hkl_parameter_free(p); \
}
TOGGLE_UX_UY_UZ(ux);
TOGGLE_UX_UY_UZ(uy);
TOGGLE_UX_UY_UZ(uz);
/*
static gboolean _hkl_gui_window_on_tree_view_crystals_key_press_event_gtk_widget_key_press_event (GtkWidget* _sender, GdkEventKey* event, gpointer self) {
gboolean result;
result = hkl_gui_window_on_tree_view_crystals_key_press_event (event, self);
return result;
}
static gboolean hkl_gui_window_on_tree_view_crystals_key_press_event (GdkEventKey* event, HklGuiWindow* self) {
gboolean result = FALSE;
g_return_val_if_fail (self != NULL, FALSE);
g_return_val_if_fail (event != NULL, FALSE);
result = TRUE;
return result;
}
*/
static void
hkl_gui_window_class_init (HklGuiWindowClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (HklGuiWindowPrivate));
/* virtual method */
gobject_class->finalize = finalize;
}
static void hkl_gui_window_init (HklGuiWindow * self)
{
HklGuiWindowPrivate *priv = HKL_GUI_WINDOW_GET_PRIVATE(self);
priv->diffractometer = NULL;
priv->sample = NULL;
darray_init(priv->pseudo_frames);
priv->reciprocal = hkl_lattice_new_default ();
hkl_gui_window_get_widgets_and_objects_from_ui (self);
set_up_diffractometer_model (self);
set_up_tree_view_crystals (self);
set_up_tree_view_reflections(self);
}
int main (int argc, char ** argv)
{
gtk_init (&argc, &argv);
#ifdef HKL3D
gtk_gl_init(&argc, &argv);
#endif
hkl_gui_window_new ();
gtk_main ();
return 0;
}
hkl-5.0.0.2449/gui/hkl-gui-pseudoaxes.c 0000644 0001750 0001750 00000030454 13237017527 017576 0 ustar 00picca picca 0000000 0000000 /* 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
*/
#include "hkl-gui-macros.h"
#include "hkl-gui-pseudoaxes.h"
#include "hkl.h"
#include
#include
#include
#include
#include
G_DEFINE_TYPE (HklGuiEngine, hkl_gui_engine, G_TYPE_OBJECT);
enum {
PROP_0,
PROP_ENGINE,
PROP_LISTSTORE,
N_PROPERTIES
};
/* Keep a pointer to the properties definition */
static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
enum {
CHANGED,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
struct _HklGuiEnginePrivate {
/* Properties */
HklEngine* engine;
/* Properties */
GtkBuilder *builder;
GtkFrame* frame1;
GtkLabel* label2;
GtkComboBox* combobox1;
GtkExpander* expander1;
GtkTreeView* treeview1;
GtkButton* button1;
GtkButton* button2;
GtkListStore* store_mode;
GtkListStore* store_pseudo;
GtkListStore* store_mode_parameter;
};
#define HKL_GUI_ENGINE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_ENGINE, HklGuiEnginePrivate))
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
HklGuiEngine *self = HKL_GUI_ENGINE (object);
switch (prop_id) {
case PROP_ENGINE:
hkl_gui_engine_set_engine(self, g_value_get_pointer (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
HklGuiEngine *self = HKL_GUI_ENGINE (object);
switch (prop_id)
{
case PROP_ENGINE:
g_value_set_pointer (value, hkl_gui_engine_get_engine (self));
break;
case PROP_LISTSTORE:
g_value_set_object(value, hkl_gui_engine_get_liststore (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
finalize (GObject* object)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(object);
g_object_unref(priv->builder);
G_OBJECT_CLASS (hkl_gui_engine_parent_class)->finalize (object);
}
HklGuiEngine*
hkl_gui_engine_new (HklEngine* engine)
{
return g_object_new (HKL_GUI_TYPE_ENGINE,
"engine", engine,
NULL);
}
HklEngine*
hkl_gui_engine_get_engine (HklGuiEngine *self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
return priv->engine;
}
GtkListStore*
hkl_gui_engine_get_liststore (HklGuiEngine *self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
return priv->store_pseudo;
}
GtkFrame*
hkl_gui_engine_get_frame(HklGuiEngine *self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
return priv->frame1;
}
static void
update_pseudo_axis (HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkTreeIter iter = {0};
const darray_string *parameters = hkl_engine_pseudo_axis_names_get (priv->engine);
unsigned int n_values = darray_size(*parameters);
double values[n_values];
GError *error = NULL;
unsigned int i;
g_return_if_fail (self != NULL);
gtk_list_store_clear (priv->store_pseudo);
if(!hkl_engine_pseudo_axis_values_get(priv->engine, values, n_values, HKL_UNIT_USER, &error)){
/* TODO check for the error */
g_clear_error(&error);
return;
}
for(i=0; istore_pseudo,
&iter);
gtk_list_store_set (priv->store_pseudo,
&iter,
PSEUDO_COL_NAME, darray_item(*parameters, i),
PSEUDO_COL_IDX, i,
PSEUDO_COL_VALUE, values[i],
-1);
}
}
static void
update_mode (HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkTreeIter iter = {0};
GtkTreeIter current = {0};
const darray_string *modes;
const char **mode;
g_return_if_fail (self != NULL);
modes = hkl_engine_modes_names_get(priv->engine);
gtk_list_store_clear (priv->store_mode);
darray_foreach(mode, *modes){
gtk_list_store_append (priv->store_mode,
&iter);
gtk_list_store_set (priv->store_mode,
&iter,
MODE_COL_NAME, *mode,
-1);
if(*mode == hkl_engine_current_mode_get(priv->engine))
current = iter;
}
/* now set the active row with the current mode */
gtk_combo_box_set_active_iter(priv->combobox1, ¤t);
}
static void
update_mode_parameters (HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
const darray_string *parameters = hkl_engine_parameters_names_get(priv->engine);
unsigned int n_values = darray_size(*parameters);
double values[n_values];
unsigned int i;
if(n_values){
GtkTreeIter iter = {0};
gtk_list_store_clear (priv->store_mode_parameter);
hkl_engine_parameters_values_get(priv->engine, values, n_values, HKL_UNIT_USER);
for(i=0; istore_mode_parameter, &iter);
gtk_list_store_set (priv->store_mode_parameter,
&iter,
PSEUDO_COL_NAME, darray_item(*parameters, i),
PSEUDO_COL_IDX, i,
PSEUDO_COL_VALUE, values[i],
-1);
}
gtk_expander_set_expanded (priv->expander1, TRUE);
gtk_widget_show (GTK_WIDGET (priv->expander1));
}else
gtk_widget_hide (GTK_WIDGET (priv->expander1));
}
void
hkl_gui_engine_update (HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkTreeViewColumn* col;
GList* cells;
g_return_if_fail (self != NULL);
update_pseudo_axis (self);
col = gtk_tree_view_get_column(priv->treeview1, 1);
cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
g_object_set (G_OBJECT(cells->data), "background", NULL, NULL);
g_list_free(cells);
}
void hkl_gui_engine_set_engine (HklGuiEngine *self,
HklEngine *engine)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
g_return_if_fail (self != NULL);
g_return_if_fail (engine != NULL);
priv->engine = engine;
gtk_label_set_label (priv->label2,
hkl_engine_name_get(priv->engine));
update_pseudo_axis (self);
update_mode (self);
update_mode_parameters (self);
hkl_gui_engine_update(self);
}
static void
combobox1_changed_cb (GtkComboBox* combobox, HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
gchar *mode;
GtkTreeIter iter = {0};
g_return_if_fail (self != NULL);
g_return_if_fail (combobox != NULL);
if(gtk_combo_box_get_active_iter(combobox, &iter)){
gtk_tree_model_get(GTK_TREE_MODEL(priv->store_mode),
&iter,
MODE_COL_NAME, &mode,
-1);
if(!hkl_engine_current_mode_set(priv->engine, mode, NULL))
return;
update_mode_parameters(self);
}
}
static void
button1_clicked_cb (GtkButton* button, HklGuiEngine* self)
{
g_signal_emit(self, signals[CHANGED], 0);
}
static void
button2_clicked_cb (GtkButton* button, HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
if (HKL_ENGINE_CAPABILITIES_INITIALIZABLE & hkl_engine_capabilities_get(priv->engine)){
if(hkl_engine_initialized_set(priv->engine, TRUE, NULL)){
/* some init method update the parameters */
update_mode_parameters(self);
}
}
}
static void
cell_tree_view_pseudo_axis_value_edited_cb (GtkCellRendererText* renderer,
const gchar* path,
const gchar* new_text,
HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkTreeIter iter = {0};
if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->store_pseudo),
&iter, path)) {
gdouble value = 0.0;
value = atof(new_text);
g_object_set (G_OBJECT(renderer), "background", "red", NULL, NULL);
gtk_list_store_set (priv->store_pseudo,
&iter,
PSEUDO_COL_VALUE, value,
-1);
}
}
/* mode parameters */
void
cellrendererspin2_edited_cb (GtkCellRendererText* renderer,
const gchar* path,
const gchar* new_text,
HklGuiEngine* self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkTreeIter iter = {0};
if (gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->store_mode_parameter),
&iter, path)) {
const darray_string *parameters = hkl_engine_parameters_names_get(priv->engine);
unsigned int n_values = darray_size(*parameters);
double values[n_values];
int idx;
gdouble new_value = 0.0;
new_value = atof(new_text);
/* set the mode parameter value */
hkl_engine_parameters_values_get(priv->engine, values, n_values, HKL_UNIT_USER);
gtk_tree_model_get (GTK_TREE_MODEL(priv->store_mode_parameter), &iter,
PSEUDO_COL_IDX, &idx,
-1);
values[idx] = new_value;
if(hkl_engine_parameters_values_set(priv->engine, values, n_values, HKL_UNIT_USER, NULL)){
/* set the store */
gtk_list_store_set (priv->store_mode_parameter,
&iter,
PSEUDO_COL_VALUE, new_value,
-1);
}
}
}
static void hkl_gui_engine_class_init (HklGuiEngineClass * class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (HklGuiEnginePrivate));
/* virtual methods */
gobject_class->finalize = finalize;
gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
/* properties */
obj_properties[PROP_ENGINE] =
g_param_spec_pointer ("engine",
"Engine",
"The Hkl Engine used underneath",
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_LISTSTORE] =
g_param_spec_object ("liststore",
"Liststore",
"The liststore contaning all the pseudo axes values",
GTK_TYPE_LIST_STORE,
G_PARAM_READABLE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class,
N_PROPERTIES,
obj_properties);
/* signals */
signals[CHANGED] =
g_signal_new ("changed",
HKL_GUI_TYPE_ENGINE,
G_SIGNAL_RUN_LAST,
0, /* class offset */
NULL, /* accumulator */
NULL, /* accu_data */
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, /* return_type */
0);
}
static void _connect_renderer(gpointer data, gpointer user_data)
{
GtkCellRenderer *renderer = GTK_CELL_RENDERER(data);
HklGuiEngine *self = HKL_GUI_ENGINE(user_data);
g_signal_connect_object (renderer,
"edited",
(GCallback) cell_tree_view_pseudo_axis_value_edited_cb,
self, 0);
}
static void hkl_gui_engine_init (HklGuiEngine * self)
{
HklGuiEnginePrivate *priv = HKL_GUI_ENGINE_GET_PRIVATE(self);
GtkBuilder *builder;
GtkTreeViewColumn* col;
GList* cells;
priv->engine = NULL;
priv->builder = builder = gtk_builder_new ();
get_ui(builder, "pseudo.ui");
get_object(builder, GTK_FRAME, priv, frame1);
get_object(builder, GTK_LABEL, priv, label2);
get_object(builder, GTK_COMBO_BOX, priv, combobox1);
get_object(builder, GTK_EXPANDER, priv, expander1);
get_object(builder, GTK_TREE_VIEW, priv, treeview1);
get_object(builder, GTK_BUTTON, priv, button1);
get_object(builder, GTK_BUTTON, priv, button2);
get_object(builder, GTK_LIST_STORE, priv, store_mode);
get_object(builder, GTK_LIST_STORE, priv, store_pseudo);
get_object(builder, GTK_LIST_STORE, priv, store_mode_parameter);
gtk_builder_connect_signals (builder, self);
g_signal_connect_object (priv->combobox1,
"changed",
(GCallback) combobox1_changed_cb,
self, 0);
g_signal_connect_object (priv->button1,
"clicked",
(GCallback) button1_clicked_cb,
self, 0);
g_signal_connect_object (priv->button2,
"clicked",
(GCallback) button2_clicked_cb,
self, 0);
col = gtk_tree_view_get_column (priv->treeview1, 1);
cells = gtk_cell_layout_get_cells(GTK_CELL_LAYOUT(col));
g_list_foreach(cells, _connect_renderer, self);
g_list_free(cells);
}
hkl-5.0.0.2449/gui/hkl-gui-macros.h 0000644 0001750 0001750 00000003537 13236600666 016712 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#ifndef __HKL_GUI_MACROS_H__
#define __HKL_GUI_MACROS_H__
#include
#include "hkl.h"
#include "hkl-gui-pseudoaxes.h"
/* TODO put in a private common header */
#define get_object(builder, type, priv, name) do{ \
priv->name = type(gtk_builder_get_object(builder, #name)); \
if(priv->name == NULL) \
fprintf(stdout, "%s is NULL ???", #name); \
}while(0);
#define get_model(filename) \
(0 == access(filename, R_OK)) ? filename : \
((0 == access("../data/" filename, R_OK)) ? "../data/" filename : \
((0 == access(PKGDATA "/hkl3d/" filename, R_OK)) ? PKGDATA "/hkl3d/" filename : NULL))
static void get_ui(GtkBuilder *builder, const char *filename)
{
if (0 == access(filename, R_OK))
gtk_builder_add_from_file (builder, filename, NULL);
else{
char *ui = g_build_filename(PKGDATA, filename, NULL);
gtk_builder_add_from_file (builder, ui, NULL);
g_free(ui);
}
}
#endif /* __HKL_GUI_MACROS_H__ */
hkl-5.0.0.2449/gui/Makefile.am 0000644 0001750 0001750 00000002247 13236600666 015750 0 ustar 00picca picca 0000000 0000000 bin_PROGRAMS = ghkl
dist_man_MANS = ghkl.1
AM_CFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/hkl \
-DPKGDATA=\""$(pkgdatadir)"\" \
$(GSL_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS)
AM_LDFLAGS = \
-Wl,--export-dynamic \
$(GSL_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS)
ghkl_LDADD = \
$(top_builddir)/hkl/libhkl.la
ghkl_SOURCES = \
hkl-gui-macros.h \
hkl-gui-pseudoaxes.c \
hkl-gui-pseudoaxes.h \
hkl-gui.c \
hkl-gui.h
dist_pkgdata_DATA = ghkl.ui pseudo.ui
appldir = ${datadir}/applications
dist_appl_DATA = ghkl.desktop
if HKL3D
AM_CFLAGS += \
-I$(top_srcdir)/hkl3d \
-I$(top_srcdir)/hkl3d/bullet/src \
-DHKL3D \
$(G3D_CFLAGS) \
$(GTKGLEXT_CFLAGS) \
$(BULLET_CFLAGS)
AM_LDFLAGS += -lstdc++\
$(G3D_LIBS) \
$(GTKGLEXT_LIBS) \
$(BULLET_LIBS)
# force linkage using g++ for libhkl3d.la
nodist_EXTRA_ghkl_SOURCES = dummy.cxx
ghkl_LDADD += \
$(top_builddir)/hkl3d/libhkl3d.la
ghkl_SOURCES += \
hkl-gui-3d-gl.c \
hkl-gui-3d-gl.h \
hkl-gui-3d.c \
hkl-gui-3d.h
dist_pkgdata_DATA += 3d.ui
endif
# Support for GNU Flymake, in Emacs.
check-syntax: AM_CFLAGS += -fsyntax-only -pipe
check-syntax:
test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
.PHONY: check-syntax
hkl-5.0.0.2449/gui/hkl-gui-3d.h 0000644 0001750 0001750 00000003735 13236600666 015734 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#ifndef __HKL_GUI_3D_H__
#define __HKL_GUI_3D_H__
#include
G_BEGIN_DECLS
/* HklGui3D */
#define HKL_GUI_TYPE_3D (hkl_gui_3d_get_type ())
#define HKL_GUI_3D(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_3D, HklGui3D))
#define HKL_GUI_3D_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_3D, HklGui3DClass))
#define HKL_GUI_IS_3D(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_3D))
#define HKL_GUI_IS_3D_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_3D))
#define HKL_GUI_3D_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_3D, HklGuiEngineClass))
typedef struct _HklGui3D HklGui3D;
typedef struct _HklGui3DClass HklGui3DClass;
typedef struct _HklGui3DPrivate HklGui3DPrivate;
GType hkl_gui_3d_get_type (void) G_GNUC_CONST;
HklGui3D *hkl_gui_3d_new (const char *filename, HklGeometry *geometry);
void hkl_gui_3d_is_colliding(HklGui3D *self);
void hkl_gui_3d_invalidate(HklGui3D *self);
GtkFrame *hkl_gui_3d_frame_get(HklGui3D *self);
#endif // __HKL_GUI_3D_H__
hkl-5.0.0.2449/gui/ghkl.desktop 0000644 0001750 0001750 00000000306 12710332473 016220 0 ustar 00picca picca 0000000 0000000 [Desktop Entry]
Version=1.0
Type=Application
Name=ghkl
GenericName=Diffractometer Calculation
Comment=hkl library graphical interface.
TryExec=ghkl
Exec=ghkl
Categories=Education;Science;Physics;GTK hkl-5.0.0.2449/gui/3d.ui 0000644 0001750 0001750 00000027314 12710332473 014555 0 ustar 00picca picca 0000000 0000000
False5normalTrueTrueFalsevertical2TrueFalseendgtk-cancelFalseTrueTrueTrueFalseTrueFalseFalse0gtk-applyFalseTrueTrueTrueFalseTrueFalseFalse1FalseTrueend0button2button1TrueFalse0noneTrueTrue181TrueTrueFalseTrueFalseGDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK | GDK_SCROLL_MASKTrueTrue1FalseTrueTrueFalseTrueFalseFalseTrueFalseFalseTruegtk-addFalseTrueFalseTrueFalseFalseTruegtk-removeFalseTrueFalseTrueFalseFalse3D view ReinitializeTruegtk-homeFalseTrueFalseTrueFalseFalseAabbTruegtk-applyFalseTrueFalseTrue0TrueTruetreestore1False0Truename0hide1TrueTrue1TrueTrueTrueFalse3D
hkl-5.0.0.2449/gui/ghkl.1 0000644 0001750 0001750 00000003354 13236600666 014723 0 ustar 00picca picca 0000000 0000000 .\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.TH GHKL 1 "June 1, 2010"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.SH NAME
ghkl \- program to do diffractometer computation
.SH SYNOPSIS
.B ghkl
.RI [ options ]
.SH DESCRIPTION
This manual page documents briefly the
.B ghkl
commands.
.PP
.\" TeX users may be more comfortable with the \fB\fP and
.\" \fI\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBghkl\fP is a program that gives you access to all the hkl library functionalities.
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.SH SEE ALSO
.BR ghkl (1),
.br
The programs are documented fully by
.IR "The hkl library Documentation" ,
available via the Info system.
.SH AUTHOR
ghkl was written by Picca Frédéric-Emmanuel
.PP
This manual page was written by Picca Frédéric-Emmanuel ,
for the Debian project (and may be used by others).
hkl-5.0.0.2449/gui/hkl-gui-pseudoaxes.h 0000644 0001750 0001750 00000005163 12770043434 017577 0 ustar 00picca picca 0000000 0000000 /* 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_GUI_ENGINE_H__
#define __HKL_GUI_ENGINE_H__
#include
#include
#include
#include
G_BEGIN_DECLS
#define HKL_GUI_TYPE_ENGINE (hkl_gui_engine_get_type ())
#define HKL_GUI_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_ENGINE, HklGuiEngine))
#define HKL_GUI_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_ENGINE, HklGuiEngineClass))
#define HKL_GUI_IS_ENGINE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_ENGINE))
#define HKL_GUI_IS_ENGINE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_ENGINE))
#define HKL_GUI_ENGINE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_ENGINE, HklGuiEngineClass))
typedef struct _HklGuiEngine HklGuiEngine;
typedef struct _HklGuiEngineClass HklGuiEngineClass;
typedef struct _HklGuiEnginePrivate HklGuiEnginePrivate;
typedef enum {
MODE_COL_NAME = 0,
MODE_COL_NUM_COLS
} ModeCol;
typedef enum {
PSEUDO_COL_NAME = 0,
PSEUDO_COL_IDX,
PSEUDO_COL_VALUE,
PSEUDO_COL_NUM_COLS
} PseudoCol;
struct _HklGuiEngine {
GObject parent_instance;
/*< private >*/
HklGuiEnginePrivate * priv;
};
struct _HklGuiEngineClass {
GObjectClass parent_class;
};
GType hkl_gui_engine_get_type (void) G_GNUC_CONST;
HklGuiEngine* hkl_gui_engine_new (HklEngine* engine);
void hkl_gui_engine_set_engine (HklGuiEngine *gui_engine,
HklEngine *engine);
HklEngine* hkl_gui_engine_get_engine (HklGuiEngine *gui_engine);
GtkListStore* hkl_gui_engine_get_liststore (HklGuiEngine *gui_engine);
GtkFrame *hkl_gui_engine_get_frame(HklGuiEngine *self);
void hkl_gui_engine_update (HklGuiEngine* self);
G_END_DECLS
#endif /* __HKL_GUI_ENGINE_H__ */
hkl-5.0.0.2449/gui/hkl-gui-3d-gl.h 0000644 0001750 0001750 00000003700 12770043434 016320 0 ustar 00picca picca 0000000 0000000 /* $Id: gl.h 108 2009-01-08 16:38:36Z mmmaddd $ */
/*
G3DViewer - 3D object viewer
Copyright (C) 2005, 2006 Markus Dahms
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _GL_H
#define _GL_H
#include
#define G3D_FLAG_GL_SPECULAR (1L << 0)
#define G3D_FLAG_GL_SHININESS (1L << 1)
#define G3D_FLAG_GL_ALLTWOSIDE (1L << 2)
#define G3D_FLAG_GL_TEXTURES (1L << 3)
#define G3D_FLAG_GL_COLORS (1L << 4)
#define G3D_FLAG_GL_POINTS (1L << 5)
#define G3D_FLAG_GL_COORD_AXES (1L << 6)
#define G3D_FLAG_GL_SHADOW (1L << 7)
#define G3D_FLAG_GL_ISOMETRIC (1L << 8)
typedef struct _G3DGLRenderState G3DGLRenderState;
typedef struct {
/* to be set by caller */
gfloat zoom;
gfloat aspect;
gfloat bgcolor[4];
gfloat quat[4];
G3DMatrix shadow_matrix[16];
G3DFloat min_y;
guint32 norm_count;
gfloat offx;
gfloat offy;
gint32 glflags;
gboolean updated;
gboolean initialized;
/* can be read by caller */
guint32 avg_msec;
/* to be used by caller only */
G3DGLRenderState *state;
} G3DGLRenderOptions;
void gl_set_twoside(gboolean twoside);
void gl_set_textures(gboolean textures);
void gl_load_texture(gpointer key, gpointer value, gpointer data);
void gl_draw(G3DGLRenderOptions *options, G3DModel *model);
#endif
hkl-5.0.0.2449/gui/hkl-gui-3d-gl.c 0000644 0001750 0001750 00000045247 12774775077 016352 0 ustar 00picca picca 0000000 0000000 /* $Id: gl.c 127 2009-09-05 19:45:12Z mmmaddd $ */
/*
G3DViewer - 3D object viewer
Copyright (C) 2005, 2006 Markus Dahms
This program 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 2 of the License, or
(at your option) any later version.
This program 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 this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include "hkl-gui-3d-gl.h"
struct _G3DGLRenderState {
gint32 gl_dlist, gl_dlist_shadow;
G3DMaterial *prev_material;
guint32 prev_texid;
};
#if DEBUG > 0
#define TIMING
#endif
#ifdef TIMING
static GTimer *timer = NULL;
#endif
static void gl_init(void)
{
#if DEBUG > 1
g_printerr("init OpenGL\n");
#endif
GLfloat light0_pos[4] = { -50.0, 50.0, 0.0, 0.0 };
GLfloat light0_col[4] = { 0.6, 0.6, 0.6, 1.0 };
GLfloat light1_pos[4] = { 50.0, 50.0, 0.0, 0.0 };
GLfloat light1_col[4] = { 0.4, 0.4, 0.4, 1.0 };
GLfloat ambient_lc[4] = { 0.35, 0.35, 0.35, 1.0 };
/* transparency and blending */
#if 0
glAlphaFunc(GL_GREATER, 0.1);
#endif
glEnable(GL_ALPHA_TEST);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glDepthFunc(GL_LEQUAL);
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);
#if 0
glEnable(GL_LINE_SMOOTH);
glEnable(GL_POLYGON_SMOOTH);
#endif
#if 0
glDisable(GL_DITHER);
#endif
glShadeModel(GL_SMOOTH);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient_lc);
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 0);
#ifdef GL_LIGHT_MODEL_COLOR_CONTROL
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
#endif
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);
glLightfv(GL_LIGHT0, GL_POSITION, light0_pos);
glLightfv(GL_LIGHT0, GL_DIFFUSE, light0_col);
glLightfv(GL_LIGHT1, GL_POSITION, light1_pos);
glLightfv(GL_LIGHT1, GL_DIFFUSE, light1_col);
glLightfv(GL_LIGHT1, GL_SPECULAR, light1_col);
glEnable(GL_LIGHT0);
glEnable(GL_LIGHT1);
glEnable(GL_LIGHTING);
/* colors and materials */
glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);
glEnable(GL_COLOR_MATERIAL);
/* texture stuff */
glEnable(GL_TEXTURE_2D);
#ifdef TIMING
timer = g_timer_new();
#endif
}
void gl_set_twoside(gboolean twoside)
{
glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, twoside ? 1 : 0);
glColorMaterial(
twoside ? GL_FRONT_AND_BACK : GL_FRONT,
GL_AMBIENT_AND_DIFFUSE);
}
void gl_set_textures(gboolean textures)
{
if(textures)
glEnable(GL_TEXTURE_2D);
else
{
glBindTexture(GL_TEXTURE_2D, 0);
glDisable(GL_TEXTURE_2D);
}
}
/* GHFunc */
void gl_load_texture(gpointer key, gpointer value, gpointer data)
{
G3DImage *image = (G3DImage *)value;
gint32 env;
#if 0
/* predefined - update object->_tex_images else... */
glGenTextures(1, &(image->tex_id));
#endif
#if DEBUG > 0
g_print("gl: loading texture '%s' (%dx%dx%d) - id %d\n",
image->name ? image->name : "(null)",
image->width, image->height, image->depth,
image->tex_id);
#endif
glBindTexture(GL_TEXTURE_2D, image->tex_id);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_LINEAR_MIPMAP_NEAREST);
switch(image->tex_env)
{
case G3D_TEXENV_BLEND: env = GL_BLEND; break;
case G3D_TEXENV_MODULATE: env = GL_MODULATE; break;
case G3D_TEXENV_DECAL: env = GL_DECAL; break;
case G3D_TEXENV_REPLACE: env = GL_REPLACE; break;
default: env = GL_MODULATE; break;
}
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, env);
gluBuild2DMipmaps(
GL_TEXTURE_2D,
GL_RGBA,
image->width,
image->height,
GL_RGBA,
GL_UNSIGNED_BYTE,
image->pixeldata);
}
static inline void gl_update_material(G3DGLRenderOptions *options,
G3DMaterial *material)
{
GLenum facetype;
GLfloat normspec[4] = { 0.0, 0.0, 0.0, 1.0 };
g_return_if_fail(material != NULL);
if(options->glflags & G3D_FLAG_GL_ALLTWOSIDE)
facetype = GL_FRONT_AND_BACK;
else
facetype = GL_FRONT;
if(options->glflags & G3D_FLAG_GL_COLORS)
glColor4f(
material->r,
material->g,
material->b,
material->a);
else
glColor4f(0.7, 0.7, 0.7, 1.0);
return;
if(options->glflags & G3D_FLAG_GL_SPECULAR)
glMaterialfv(facetype, GL_SPECULAR, material->specular);
else
glMaterialfv(facetype, GL_SPECULAR, normspec);
if(options->glflags & G3D_FLAG_GL_SHININESS)
glMaterialf(facetype, GL_SHININESS, material->shininess * 10);
else
glMaterialf(facetype, GL_SHININESS, 0.0);
}
static inline void gl_draw_face(G3DGLRenderOptions *options,
G3DObject *object, gint32 i, gfloat min_a, gfloat max_a,
gboolean *dont_render, gboolean *init, gboolean is_shadow)
{
gint32 j;
if(*init)
{
options->state->prev_material = NULL;
options->state->prev_texid = 0;
*init = FALSE;
}
/* material check */
if(!is_shadow && (options->state->prev_material != object->_materials[i]))
{
if((object->_materials[i]->a < min_a) ||
(object->_materials[i]->a >= max_a))
{
*dont_render = TRUE;
return;
}
*dont_render = FALSE;
glEnd();
gl_update_material(options, object->_materials[i]);
glBegin(GL_TRIANGLES);
options->state->prev_material = object->_materials[i];
options->state->prev_texid = 0;
}
if(*dont_render) return;
/* texture stuff */
if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
(object->_flags[i] & G3D_FLAG_FAC_TEXMAP))
{
/* if texture has changed update to new texture */
if(object->_tex_images[i] != options->state->prev_texid) {
options->state->prev_texid = object->_tex_images[i];
glEnd();
glBindTexture(GL_TEXTURE_2D, options->state->prev_texid);
glBegin(GL_TRIANGLES);
#if DEBUG > 5
g_print("gl: binding to texture id %d\n", prev_texid);
#endif
}
}
/* draw triangles */
for(j = 0; j < 3; j ++)
{
if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
(object->_flags[i] & G3D_FLAG_FAC_TEXMAP))
{
glTexCoord2f(
object->_tex_coords[(i * 3 + j) * 2 + 0],
object->_tex_coords[(i * 3 + j) * 2 + 1]);
#if DEBUG > 5
g_print("gl: setting texture coords: %f, %f\n",
object->_tex_coords[(i * 3 + j) * 2 + 0],
object->_tex_coords[(i * 3 + j) * 2 + 1]);
#endif
}
glNormal3f(
object->_normals[(i*3+j)*3+0],
object->_normals[(i*3+j)*3+1],
object->_normals[(i*3+j)*3+2]);
glVertex3f(
object->vertex_data[object->_indices[i*3+j]*3+0],
object->vertex_data[object->_indices[i*3+j]*3+1],
object->vertex_data[object->_indices[i*3+j]*3+2]);
} /* 1 .. 3 */
}
static inline void gl_may_end(gint32 ftype)
{
if(ftype != -1)
glEnd();
}
static inline void gl_may_begin(gint32 ftype)
{
if(ftype != -1)
glBegin(ftype);
}
static inline void gl_draw_face_list(G3DGLRenderOptions *options,
G3DObject *object, gfloat min_a, gfloat max_a,
gboolean *init, gboolean is_shadow)
{
GSList *fitem;
G3DFace *face;
G3DVector nx, ny, nz;
gint32 prev_ftype = -1;
gint32 index, j, ftype;
if(*init) {
options->state->prev_material = NULL;
options->state->prev_texid = 0;
*init = FALSE;
}
for(fitem = object->faces; fitem != NULL; fitem = fitem->next) {
face = fitem->data;
if(!is_shadow && (options->state->prev_material != face->material)) {
if((face->material->a < min_a) || (face->material->a >= max_a)) {
return;
}
gl_may_end(prev_ftype);
gl_update_material(options, face->material);
gl_may_begin(prev_ftype);
options->state->prev_material = face->material;
options->state->prev_texid = 0;
}
/* texture stuff */
if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
(face->flags & G3D_FLAG_FAC_TEXMAP)) {
/* if texture has changed update to new texture */
if(face->tex_image) {
if(face->tex_image->tex_id != options->state->prev_texid) {
options->state->prev_texid = face->tex_image->tex_id;
gl_may_end(prev_ftype);
glBindTexture(GL_TEXTURE_2D, options->state->prev_texid);
gl_may_begin(prev_ftype);
#if DEBUG > 5
g_print("gl: binding to texture id %d\n", prev_texid);
#endif
}
}
} /* texture stuff */
switch(face->vertex_count) {
case 3: ftype = GL_TRIANGLES; break;
case 4: ftype = GL_QUADS; break;
case 2: ftype = GL_LINES; break;
default: ftype = GL_POLYGON;
#if DEBUG > 0
g_debug("face vertex count: %d", face->vertex_count);
#endif
break;
}
if(ftype != prev_ftype) {
gl_may_end(prev_ftype);
glBegin(ftype);
prev_ftype = ftype;
}
if(!(face->flags & G3D_FLAG_FAC_NORMALS)) {
face->normals = g_new0(G3DVector, face->vertex_count * 3);
g3d_face_get_normal(face, object, &nx, &ny, &nz);
g3d_vector_unify(&nx, &ny, &nz);
for(j = 0; j < face->vertex_count; j ++) {
face->normals[j * 3 + 0] = nx;
face->normals[j * 3 + 1] = ny;
face->normals[j * 3 + 2] = nz;
}
face->flags |= G3D_FLAG_FAC_NORMALS;
}
for(j = 0; j < face->vertex_count; j ++) {
index = face->vertex_indices[j];
if(!is_shadow && (options->glflags & G3D_FLAG_GL_TEXTURES) &&
(face->flags & G3D_FLAG_FAC_TEXMAP))
{
glTexCoord2f(
face->tex_vertex_data[j * 2 + 0],
face->tex_vertex_data[j * 2 + 1]);
}
glNormal3f(
face->normals[j * 3 + 0],
face->normals[j * 3 + 1],
face->normals[j * 3 + 2]);
glVertex3f(
object->vertex_data[index * 3 + 0],
object->vertex_data[index * 3 + 1],
object->vertex_data[index * 3 + 2]);
}
} /* face loop */
gl_may_end(prev_ftype);
}
static inline void gl_draw_objects(G3DGLRenderOptions *options,
GSList *objects, gfloat min_a, gfloat max_a, gboolean is_shadow)
{
GSList *olist;
int i;
G3DObject *object;
gboolean dont_render;
gboolean init = TRUE;
olist = objects;
while(olist != NULL)
{
object = (G3DObject *)olist->data;
olist = olist->next;
dont_render = FALSE;
/* don't render invisible objects */
if(object->hide) continue;
g_return_if_fail(object != NULL);
#if DEBUG > 3
g_printerr("name: %s {", object->name);
#endif
#if DEBUG > 2
g_printerr("new object\n");
#endif
glPushMatrix();
if(object->transformation)
{
glMultMatrixf(object->transformation->matrix);
}
#define EXPERIMENTAL
#ifdef EXPERIMENTAL
gl_draw_face_list(options, object, min_a, max_a, &init, is_shadow);
#else
glBegin(GL_TRIANGLES);
for(i = 0; i < object->_num_faces; i ++)
{
gl_draw_face(options, object, i, min_a, max_a,
&dont_render, &init, is_shadow);
} /* all faces */
glEnd();
#endif
if(!is_shadow && (options->glflags & G3D_FLAG_GL_POINTS)) {
glColor4f(0.2, 0.2, 0.2, 1.0);
glBegin(GL_POINTS);
for(i = 0; i < object->vertex_count; i ++) {
glVertex3f(
object->vertex_data[i * 3 + 0],
object->vertex_data[i * 3 + 1],
object->vertex_data[i * 3 + 2]);
}
glEnd();
}
/* handle sub-objects */
gl_draw_objects(options, object->objects, min_a, max_a, is_shadow);
glPopMatrix();
} /* while olist != NULL */
}
static inline void matrix_g3d_to_gl(G3DMatrix *g3dm, GLfloat glm[4][4])
{
guint32 i, j;
for(i = 0; i < 4; i ++)
for(j = 0; j < 4; j ++)
glm[i][j] = g3dm[i * 4 + j];
}
static inline void gl_setup_view(G3DGLRenderOptions *options)
{
GLfloat m[4][4];
G3DMatrix *g3dm;
G3DFloat w, h;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(options->glflags & G3D_FLAG_GL_ISOMETRIC) {
w = 0.5 * options->zoom;
h = w / options->aspect;
glOrtho(-w / 2.0, w / 2.0, -h / 2.0, h / 2.0, 1, 100);
} else {
gluPerspective(options->zoom, options->aspect, 1, 100);
}
/* translation of view */
glTranslatef(options->offx, options->offy, 0.0);
glMatrixMode(GL_MODELVIEW);
glClearColor(
options->bgcolor[0],
options->bgcolor[1],
options->bgcolor[2],
options->bgcolor[3]);
glClearDepth(1.0);
glClearIndex(0.3);
glClear(
GL_COLOR_BUFFER_BIT |
GL_DEPTH_BUFFER_BIT |
GL_ACCUM_BUFFER_BIT |
GL_STENCIL_BUFFER_BIT);
glLoadIdentity();
glTranslatef(0, 0, -30);
g3dm = g3d_matrix_new();
g3d_quat_to_matrix(options->quat, g3dm);
matrix_g3d_to_gl(g3dm, m);
g3d_matrix_free(g3dm);
glMultMatrixf(&m[0][0]);
}
static void gl_setup_shadow_matrix(G3DGLRenderOptions *options,
G3DVector *l, G3DVector *p, G3DVector *n)
{
G3DDouble c, d;
G3DMatrix *m = options->shadow_matrix;
d = n[0] * l[0] + n[1] * l[1] + n[2] * l[2];
c = p[0] * n[0] + p[1] * n[1] + p[2] * n[2] - d;
m[0 * 4 + 0] = l[0] * n[0] + c;
m[1 * 4 + 0] = l[0] * n[1];
m[2 * 4 + 0] = l[0] * n[2];
m[3 * 4 + 0] = - l[0] * c - l[0] * d;
m[0 * 4 + 1] = l[1] * n[0];
m[1 * 4 + 1] = l[1] * n[1] + c;
m[2 * 4 + 1] = l[1] * n[2];
m[3 * 4 + 1] = - l[1] * c - l[1] * d;
m[0 * 4 + 2] = l[2] * n[0];
m[1 * 4 + 2] = l[2] * n[1];
m[2 * 4 + 2] = l[2] * n[2] + c;
m[3 * 4 + 2] = - l[2] * c - l[2] * d;
m[0 * 4 + 3] = n[0];
m[1 * 4 + 3] = n[1];
m[2 * 4 + 3] = n[2];
m[3 * 4 + 3] = -d;
}
void gl_draw_coord_system(G3DGLRenderOptions *options)
{
if(options->glflags & G3D_FLAG_GL_COORD_AXES) {
/* x: red */
glColor3f(1.0, 0.0, 0.0);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(10.0, 0.0, 0.0);
glEnd();
/* y: green */
glColor3f(0.0, 1.0, 0.0);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 10.0, 0.0);
glEnd();
/* z: blue */
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_LINES);
glVertex3f(0.0, 0.0, 0.0);
glVertex3f(0.0, 0.0, 10.0);
glEnd();
}
}
static G3DFloat gl_min_y(GSList *objects)
{
G3DFloat min_y = 10.0, tmp_y;
GSList *oitem;
G3DObject *object;
gint32 i;
for(oitem = objects; oitem != NULL; oitem = oitem->next) {
object = oitem->data;
for(i = 0; i < object->vertex_count; i ++)
if(object->vertex_data[i * 3 + 1] < min_y)
min_y = object->vertex_data[i * 3 + 1];
tmp_y = gl_min_y(object->objects);
if(tmp_y < min_y)
min_y = tmp_y;
}
return min_y;
}
static void gl_draw_plane(G3DGLRenderOptions *options)
{
glBegin(GL_QUADS);
glNormal3f(0.0, -1.0, 0.0);
#define PLANE_MAX 12
glVertex3f(-PLANE_MAX, options->min_y - 0.001, PLANE_MAX);
glVertex3f( PLANE_MAX, options->min_y - 0.001, PLANE_MAX);
glVertex3f( PLANE_MAX, options->min_y - 0.001, -PLANE_MAX);
glVertex3f(-PLANE_MAX, options->min_y - 0.001, -PLANE_MAX);
#undef PLANE_MAX
glEnd();
}
static void gl_setup_floor_stencil(G3DGLRenderOptions *options)
{
glClear(GL_STENCIL_BUFFER_BIT);
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glEnable(GL_STENCIL_TEST);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
gl_draw_plane(options);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
glStencilFunc(GL_EQUAL, 1, 0xffffffff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}
static void gl_setup_shadow_stencil(G3DGLRenderOptions *options)
{
glClear(GL_STENCIL_BUFFER_BIT);
glDepthMask(GL_FALSE);
glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
glEnable(GL_STENCIL_TEST);
glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
glStencilFunc(GL_ALWAYS, 1, 0xffffffff);
glCallList(options->state->gl_dlist_shadow);
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glDepthMask(GL_TRUE);
glStencilFunc(GL_EQUAL, 1, 0xffffffff);
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
}
void gl_draw(G3DGLRenderOptions *options, G3DModel *model)
{
gfloat f;
#ifdef TIMING
gboolean ignore_timing = FALSE;
gulong msec, add;
gdouble sec;
#endif
G3DVector light[3] = { 100.0, 500.0, 20.0 };
G3DVector plane[3] = { 0.0, -20.0, 0.0 };
G3DVector normal[3] = { 0.0, -1.0, 0.0 };
if(!options->initialized)
{
gl_init();
options->initialized = TRUE;
#ifdef TIMING
ignore_timing = TRUE;
#endif
}
/* prepare viewport */
gl_setup_view(options);
/* reset texture */
glBindTexture (GL_TEXTURE_2D, 0);
if(model == NULL)
return;
#ifdef TIMING
g_timer_start(timer);
#endif
if(options->updated) {
options->updated = FALSE;
#ifdef TIMING
ignore_timing = TRUE;
#endif
#if DEBUG > 2
g_printerr("[gl] creating new display list\n");
#endif
options->min_y = gl_min_y(model->objects);
/* update render state */
if(options->state) {
glDeleteLists(options->state->gl_dlist, 1);
glDeleteLists(options->state->gl_dlist_shadow, 1);
g_free(options->state);
}
options->state = g_new0(G3DGLRenderState, 1);
/* create and execute display list */
options->state->gl_dlist = glGenLists(1);
options->state->gl_dlist_shadow = glGenLists(1);
glNewList(options->state->gl_dlist, GL_COMPILE);
/* draw all objects */
for(f = 1.0; f >= 0.0; f -= 0.2)
gl_draw_objects(options, model->objects, f, f + 0.2, FALSE);
glEndList();
if(options->glflags & G3D_FLAG_GL_SHADOW) {
glNewList(options->state->gl_dlist_shadow, GL_COMPILE);
gl_draw_objects(options, model->objects, 0.0, 1.0, TRUE);
glEndList();
}
}
g_return_if_fail(options->state != NULL);
gl_draw_coord_system(options);
if(options->glflags & G3D_FLAG_GL_SHADOW) {
plane[1] = options->min_y;
/* reflection */
glPushMatrix();
gl_setup_floor_stencil(options);
glTranslatef(0.0, (options->min_y * 2), 0.0);
glScalef(1.0, -1.0, 1.0);
glCallList(options->state->gl_dlist);
glPopMatrix();
/* plane */
glDisable(GL_LIGHTING);
glBindTexture (GL_TEXTURE_2D, 0);
glColor4f(0.5, 0.5, 0.5, 0.7);
gl_draw_plane(options);
glEnable(GL_LIGHTING);
/* shadow */
glPushMatrix();
gl_setup_shadow_matrix(options, light, plane, normal);
glBindTexture (GL_TEXTURE_2D, 0);
glDisable(GL_LIGHTING);
glDisable(GL_DEPTH_TEST);
glMultMatrixf(options->shadow_matrix);
gl_setup_shadow_stencil(options);
glPopMatrix();
glPushMatrix();
glTranslatef(0.0, 0.001, 0.0);
glColor4f(0.3, 0.3, 0.3, 0.7);
gl_draw_plane(options);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glPopMatrix();
glDisable(GL_STENCIL_TEST);
}
/* execute display list */
glCallList(options->state->gl_dlist);
#ifdef TIMING /* get time to draw one frame to compare algorithms */
g_timer_stop(timer);
if(!ignore_timing) {
if(options->avg_msec == 0) {
sec = g_timer_elapsed(timer, &msec);
options->avg_msec = (gulong)sec * 1000000 + msec;
} else {
sec = g_timer_elapsed(timer, &msec);
add = (gulong)sec * 1000000 + msec;
options->avg_msec = (options->avg_msec + add) / 2;
}
}
#endif
#if DEBUG > 3
g_printerr("gl.c: drawn...\n");
#endif
}
hkl-5.0.0.2449/gui/Makefile.in 0000644 0001750 0001750 00000073647 13237017633 015772 0 ustar 00picca picca 0000000 0000000 # Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = ghkl$(EXEEXT)
@HKL3D_TRUE@am__append_1 = \
@HKL3D_TRUE@ -I$(top_srcdir)/hkl3d \
@HKL3D_TRUE@ -I$(top_srcdir)/hkl3d/bullet/src \
@HKL3D_TRUE@ -DHKL3D \
@HKL3D_TRUE@ $(G3D_CFLAGS) \
@HKL3D_TRUE@ $(GTKGLEXT_CFLAGS) \
@HKL3D_TRUE@ $(BULLET_CFLAGS)
@HKL3D_TRUE@am__append_2 = -lstdc++\
@HKL3D_TRUE@ $(G3D_LIBS) \
@HKL3D_TRUE@ $(GTKGLEXT_LIBS) \
@HKL3D_TRUE@ $(BULLET_LIBS)
@HKL3D_TRUE@am__append_3 = \
@HKL3D_TRUE@ $(top_builddir)/hkl3d/libhkl3d.la
@HKL3D_TRUE@am__append_4 = \
@HKL3D_TRUE@ hkl-gui-3d-gl.c \
@HKL3D_TRUE@ hkl-gui-3d-gl.h \
@HKL3D_TRUE@ hkl-gui-3d.c \
@HKL3D_TRUE@ hkl-gui-3d.h
@HKL3D_TRUE@am__append_5 = 3d.ui
subdir = gui
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(dist_appl_DATA) \
$(am__dist_pkgdata_DATA_DIST) $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(appldir)" "$(DESTDIR)$(pkgdatadir)"
PROGRAMS = $(bin_PROGRAMS)
am__ghkl_SOURCES_DIST = hkl-gui-macros.h hkl-gui-pseudoaxes.c \
hkl-gui-pseudoaxes.h hkl-gui.c hkl-gui.h hkl-gui-3d-gl.c \
hkl-gui-3d-gl.h hkl-gui-3d.c hkl-gui-3d.h
@HKL3D_TRUE@am__objects_1 = hkl-gui-3d-gl.$(OBJEXT) \
@HKL3D_TRUE@ hkl-gui-3d.$(OBJEXT)
am_ghkl_OBJECTS = hkl-gui-pseudoaxes.$(OBJEXT) hkl-gui.$(OBJEXT) \
$(am__objects_1)
ghkl_OBJECTS = $(am_ghkl_OBJECTS)
ghkl_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la $(am__append_3)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
AM_V_CXX = $(am__v_CXX_@AM_V@)
am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@)
am__v_CXX_0 = @echo " CXX " $@;
am__v_CXX_1 =
CXXLD = $(CXX)
CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
$(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CXXLD = $(am__v_CXXLD_@AM_V@)
am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
am__v_CXXLD_0 = @echo " CXXLD " $@;
am__v_CXXLD_1 =
SOURCES = $(ghkl_SOURCES) $(nodist_EXTRA_ghkl_SOURCES)
DIST_SOURCES = $(am__ghkl_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
am__dist_pkgdata_DATA_DIST = ghkl.ui pseudo.ui 3d.ui
DATA = $(dist_appl_DATA) $(dist_pkgdata_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in \
$(top_srcdir)/config/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ASY = @ASY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BULLET_CFLAGS = @BULLET_CFLAGS@
BULLET_LIBS = @BULLET_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EMACS = @EMACS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
G3D_CFLAGS = @G3D_CFLAGS@
G3D_LIBS = @G3D_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GLU_CFLAGS = @GLU_CFLAGS@
GLU_LIBS = @GLU_LIBS@
GNUPLOT = @GNUPLOT@
GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
GOBJECT_LIBS = @GOBJECT_LIBS@
GOBJECT_QUERY = @GOBJECT_QUERY@
GREP = @GREP@
GSL_CFLAGS = @GSL_CFLAGS@
GSL_CONFIG = @GSL_CONFIG@
GSL_LIBS = @GSL_LIBS@
GTKDOC_CHECK = @GTKDOC_CHECK@
GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
HDF5_CFLAGS = @HDF5_CFLAGS@
HDF5_LIBS = @HDF5_LIBS@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
VMAJ = @VMAJ@
YAML_CFLAGS = @YAML_CFLAGS@
YAML_LIBS = @YAML_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
release_info = @release_info@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
version_info = @version_info@
dist_man_MANS = ghkl.1
AM_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/hkl \
-DPKGDATA=\""$(pkgdatadir)"\" $(GSL_CFLAGS) $(GLIB_CFLAGS) \
$(GTK_CFLAGS) $(am__append_1)
AM_LDFLAGS = -Wl,--export-dynamic $(GSL_LIBS) $(GLIB_LIBS) $(GTK_LIBS) \
$(am__append_2)
ghkl_LDADD = $(top_builddir)/hkl/libhkl.la $(am__append_3)
ghkl_SOURCES = hkl-gui-macros.h hkl-gui-pseudoaxes.c \
hkl-gui-pseudoaxes.h hkl-gui.c hkl-gui.h $(am__append_4)
dist_pkgdata_DATA = ghkl.ui pseudo.ui $(am__append_5)
appldir = ${datadir}/applications
dist_appl_DATA = ghkl.desktop
# force linkage using g++ for libhkl3d.la
@HKL3D_TRUE@nodist_EXTRA_ghkl_SOURCES = dummy.cxx
all: all-am
.SUFFIXES:
.SUFFIXES: .c .cxx .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu gui/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu gui/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
|| test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
ghkl$(EXEEXT): $(ghkl_OBJECTS) $(ghkl_DEPENDENCIES) $(EXTRA_ghkl_DEPENDENCIES)
@rm -f ghkl$(EXEEXT)
$(AM_V_CXXLD)$(CXXLINK) $(ghkl_OBJECTS) $(ghkl_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkl-gui-3d-gl.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkl-gui-3d.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkl-gui-pseudoaxes.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkl-gui.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
.cxx.o:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $<
.cxx.obj:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.cxx.lo:
@am__fastdepCXX_TRUE@ $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCXX_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
@list1=''; \
list2='$(dist_man_MANS)'; \
test -n "$(man1dir)" \
&& test -n "`echo $$list1$$list2`" \
|| exit 0; \
echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
$(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
{ for i in $$list1; do echo "$$i"; done; \
if test -n "$$list2"; then \
for i in $$list2; do echo "$$i"; done \
| sed -n '/\.1[a-z]*$$/p'; \
fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
done | \
sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
sed 'N;N;s,\n, ,g' | { \
list=; while read file base inst; do \
if test "$$base" = "$$inst"; then list="$$list $$file"; else \
echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
$(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
fi; \
done; \
for i in $$list; do echo "$$i"; done | $(am__base_list) | \
while read files; do \
test -z "$$files" || { \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
done; }
uninstall-man1:
@$(NORMAL_UNINSTALL)
@list=''; test -n "$(man1dir)" || exit 0; \
files=`{ for i in $$list; do echo "$$i"; done; \
l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-dist_applDATA: $(dist_appl_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_appl_DATA)'; test -n "$(appldir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appldir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appldir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appldir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(appldir)" || exit $$?; \
done
uninstall-dist_applDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_appl_DATA)'; test -n "$(appldir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(appldir)'; $(am__uninstall_files_from_dir)
install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
@$(NORMAL_INSTALL)
@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(pkgdatadir)'"; \
$(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgdatadir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(pkgdatadir)" || exit $$?; \
done
uninstall-dist_pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_DATA)'; test -n "$(pkgdatadir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(pkgdatadir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(MANS) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(appldir)" "$(DESTDIR)$(pkgdatadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-dist_applDATA install-dist_pkgdataDATA \
install-man
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man: install-man1
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-dist_applDATA \
uninstall-dist_pkgdataDATA uninstall-man
uninstall-man: uninstall-man1
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dist_applDATA \
install-dist_pkgdataDATA install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-man1 \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS uninstall-dist_applDATA \
uninstall-dist_pkgdataDATA uninstall-man uninstall-man1
.PRECIOUS: Makefile
# Support for GNU Flymake, in Emacs.
check-syntax: AM_CFLAGS += -fsyntax-only -pipe
check-syntax:
test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
.PHONY: check-syntax
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
hkl-5.0.0.2449/gui/hkl-gui-3d.c 0000644 0001750 0001750 00000071525 13236600666 015731 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
* Oussama Sboui
*/
#include
#include
#include
#include "hkl3d.h"
#include "hkl/ccan/compiler/compiler.h"
#include "hkl-gui.h"
#include "hkl-gui-macros.h"
#include "hkl-gui-3d.h"
#include "hkl-gui-3d-gl.h"
/*
* updates glarea widget (redraw)
*/
static void glarea_update(GtkWidget *glarea)
{
gtk_widget_queue_draw_area(glarea,
0, 0,
glarea->allocation.width,
glarea->allocation.height);
}
typedef enum {
HKL_GUI_3D_COL_NAME = 0,
HKL_GUI_3D_COL_HIDE,
HKL_GUI_3D_COL_MODEL,
HKL_GUI_3D_COL_OBJECT,
HKL_GUI_3D_COL_NUM_COLS
} HklGui3DCol;
enum {
PROP_0,
PROP_FILENAME,
PROP_GEOMETRY,
N_PROPERTIES
};
/* Keep a pointer to the properties definition */
static GParamSpec *obj_properties[N_PROPERTIES] = { NULL, };
enum {
CHANGED,
N_SIGNALS
};
static NEEDED guint signals[N_SIGNALS] = { 0 };
struct _HklGui3D {
GObject parent_instance;
/*< private >*/
HklGui3DPrivate * priv;
};
struct _HklGui3DClass {
GObjectClass parent_class;
};
struct _HklGui3DPrivate {
/* Properties */
char *filename;
HklGeometry *geometry;
/* Properties */
GtkBuilder *builder;
GtkFrame *frame1;
GtkVBox *vbox1;
GtkTreeView *treeview1;
GtkToolButton *toolbutton1;
GtkToolButton *toolbutton2;
GtkToolButton *toolbutton3;
GtkFileChooserDialog *filechooserdialog1;
GtkButton *button1;
GtkButton *button2;
GtkTreeStore *treestore1;
GtkDrawingArea *drawingarea1;
Hkl3D *hkl3d;
/* opengl connected to the drawingarea1 */
G3DGLRenderOptions renderoptions;
struct {
gint32 beginx;
gint32 beginy;
} mouse;
gboolean aabb;
};
G_DEFINE_TYPE (HklGui3D, hkl_gui_3d, G_TYPE_OBJECT);
#define HKL_GUI_3D_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HKL_GUI_TYPE_3D, HklGui3DPrivate))
static void hkl_gui_3d_update_hkl3d_objects_TreeStore(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
size_t i;
size_t j;
gtk_tree_store_clear(priv->treestore1);
for(i=0; ihkl3d->config->len; ++i){
GtkTreeIter iter = {0};
gtk_tree_store_append(priv->treestore1, &iter, NULL);
gtk_tree_store_set(priv->treestore1, &iter,
HKL_GUI_3D_COL_NAME, priv->hkl3d->config->models[i]->filename,
HKL_GUI_3D_COL_MODEL, priv->hkl3d->config->models[i],
HKL_GUI_3D_COL_OBJECT, NULL,
-1);
for(j=0; jhkl3d->config->models[i]->len; ++j){
GtkTreeIter citer = {0};
gtk_tree_store_append(priv->treestore1, &citer, &iter);
gtk_tree_store_set(priv->treestore1, &citer,
HKL_GUI_3D_COL_NAME, priv->hkl3d->config->models[i]->objects[j]->axis_name,
HKL_GUI_3D_COL_HIDE, priv->hkl3d->config->models[i]->objects[j]->hide,
HKL_GUI_3D_COL_MODEL, priv->hkl3d->config->models[i],
HKL_GUI_3D_COL_OBJECT, priv->hkl3d->config->models[i]->objects[j],
-1);
}
}
}
/* properties */
static const char *
hkl_gui_3d_get_filename(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
return priv->filename;
}
static HklGeometry *
hkl_gui_3d_get_geometry(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
return priv->geometry;
}
void _filename_and_geometry(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
if(priv->filename && priv->geometry){
if (priv->hkl3d)
hkl3d_free(priv->hkl3d);
priv->hkl3d = hkl3d_new(priv->filename, priv->geometry);
if(priv->hkl3d){
/* priv->scene = hkl_gui_3d_scene_new(priv->hkl3d, FALSE, FALSE, FALSE, FALSE); */
hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
/* gtk_box_pack_start(GTK_BOX(priv->vbox1), */
/* GTK_WIDGET(priv->scene), */
/* TRUE, TRUE, 0); */
/* gtk_widget_show_all(GTK_WIDGET(priv->vbox1)); */
}
}
}
static void
hkl_gui_3d_set_filename(HklGui3D *self, const char *filename)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
if(priv->filename)
g_free(priv->filename);
priv->filename = g_strdup(filename);
_filename_and_geometry(self);
}
static void
hkl_gui_3d_set_geometry(HklGui3D *self, HklGeometry *geometry)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
priv->geometry = geometry;
_filename_and_geometry(self);
}
static void
set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
HklGui3D *self = HKL_GUI_3D (object);
switch (prop_id) {
case PROP_FILENAME:
hkl_gui_3d_set_filename(self, g_value_get_string (value));
break;
case PROP_GEOMETRY:
hkl_gui_3d_set_geometry(self, g_value_get_pointer (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
HklGui3D *self = HKL_GUI_3D (object);
switch (prop_id)
{
case PROP_FILENAME:
g_value_set_string (value, hkl_gui_3d_get_filename (self));
break;
case PROP_GEOMETRY:
g_value_set_pointer (value, hkl_gui_3d_get_geometry (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
finalize (GObject* object)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(object);
g_free(priv->filename);
g_object_unref(priv->builder);
hkl3d_free(priv->hkl3d);
G_OBJECT_CLASS (hkl_gui_3d_parent_class)->finalize (object);
}
HklGui3D*
hkl_gui_3d_new (const char *filename, HklGeometry *geometry)
{
return g_object_new (HKL_GUI_TYPE_3D,
"filename", filename,
"geometry", geometry,
NULL);
}
GtkFrame *hkl_gui_3d_frame_get(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
return priv->frame1;
}
void hkl_gui_3d_is_colliding(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
if(priv->hkl3d)
hkl3d_is_colliding(priv->hkl3d);
}
void hkl_gui_3d_invalidate(HklGui3D *self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
priv->renderoptions.updated = TRUE;
glarea_update(GTK_WIDGET(priv->drawingarea1));
}
/************/
/* Callback */
/************/
void hkl_gui_3d_cellrenderertext2_toggled_cb(GtkCellRendererToggle* renderer,
const gchar* path, gpointer user_data)
{
HklGui3D *self = HKL_GUI_3D(user_data);
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
guint hide;
Hkl3DObject *object;
GtkTreeIter iter = {0};
gtk_tree_model_get_iter_from_string (GTK_TREE_MODEL(priv->treestore1),
&iter, path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
&iter,
HKL_GUI_3D_COL_OBJECT, &object,
-1);
hide = !gtk_cell_renderer_toggle_get_active(renderer);
if(object){
hkl3d_hide_object(priv->hkl3d, object, hide);
gtk_tree_store_set (priv->treestore1,
&iter,
HKL_GUI_3D_COL_HIDE, hide,
-1);
hkl_gui_3d_is_colliding(self);
hkl_gui_3d_invalidate(self);
}else{
Hkl3DModel *model;
gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
&iter,
HKL_GUI_3D_COL_MODEL, &model,
-1);
if(model){
GtkTreeIter children = {0};
gboolean valid;
size_t i = 0;
gtk_tree_store_set (priv->treestore1,
&iter,
HKL_GUI_3D_COL_HIDE, hide,
-1);
/* set all the children rows */
valid = gtk_tree_model_iter_children(GTK_TREE_MODEL(priv->treestore1),
&children, &iter);
while(valid){
hkl3d_hide_object(priv->hkl3d, model->objects[i++], hide);
gtk_tree_store_set (priv->treestore1,
&children,
HKL_GUI_3D_COL_HIDE, hide,
-1);
valid = gtk_tree_model_iter_next(GTK_TREE_MODEL(priv->treestore1), &children);
}
hkl_gui_3d_is_colliding(self);
hkl_gui_3d_invalidate(self);
}
}
}
void hkl_gui_3d_treeview1_cursor_changed_cb(GtkTreeView *tree_view,
gpointer user_data)
{
int i;
int j;
HklGui3D *self = user_data;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
Hkl3DObject *object;
GtkTreePath *path;
GtkTreeViewColumn * column;
gtk_tree_view_get_cursor(priv->treeview1, &path, &column);
gtk_tree_model_get_iter(GTK_TREE_MODEL(priv->treestore1), &iter, path);
gtk_tree_path_free(path);
/* need to unselect of objects of all 3d models */
for(i=0; ihkl3d->config->len; ++i)
for(j=0; jhkl3d->config->models[i]->len; ++j)
priv->hkl3d->config->models[i]->objects[j]->selected = FALSE;
/* now select the right object */
gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
&iter,
HKL_GUI_3D_COL_OBJECT, &object,
-1);
if(object)
object->selected = TRUE;
hkl_gui_3d_invalidate(self);
}
void hkl_gui_3d_toolbutton1_clicked_cb(GtkToolButton *toolbutton,
gpointer user_data)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
gtk_widget_show(GTK_WIDGET(priv->filechooserdialog1));
}
/* remove an object from the model */
void hkl_gui_3d_toolbutton2_clicked_cb(GtkToolButton *toolbutton,
gpointer user_data)
{
HklGui3D *self = user_data;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GtkTreeIter iter = {0};
GtkTreePath *path;
GtkTreeViewColumn * column;
Hkl3DObject *object;
gtk_tree_view_get_cursor(priv->treeview1, &path, &column);
gtk_tree_model_get_iter(GTK_TREE_MODEL(priv->treestore1), &iter, path);
gtk_tree_path_free(path);
gtk_tree_model_get (GTK_TREE_MODEL(priv->treestore1),
&iter,
HKL_GUI_3D_COL_OBJECT, &object,
-1);
if(object){
hkl3d_remove_object(priv->hkl3d, object);
hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
hkl_gui_3d_invalidate(self);
}
}
static void
reset_3d(G3DGLRenderOptions *renderoptions)
{
/* renderoptions */
renderoptions->updated = TRUE;
renderoptions->initialized = FALSE;
renderoptions->zoom = 7;
renderoptions->bgcolor[0] = 0.9;
renderoptions->bgcolor[1] = 0.8;
renderoptions->bgcolor[2] = 0.6;
renderoptions->bgcolor[3] = 1.0;
renderoptions->glflags =
// G3D_FLAG_GL_ISOMETRIC |
G3D_FLAG_GL_SPECULAR |
G3D_FLAG_GL_SHININESS |
G3D_FLAG_GL_TEXTURES |
G3D_FLAG_GL_COLORS|
G3D_FLAG_GL_COORD_AXES;
g3d_quat_trackball(renderoptions->quat, 0.0, 0.0, 0.0, 0.0, 0.8);
/* rotate a little bit */
gfloat q1[4], q2[4];
gfloat a1[3] = { 0.0, 1.0, 0.0 }, a2[3] = {1.0, 0.0, 1.0};
g3d_quat_rotate(q1, a1, - 45.0 * G_PI / 180.0);
g3d_quat_rotate(q2, a2, - 45.0 * G_PI / 180.0);
g3d_quat_add(renderoptions->quat, q1, q2);
}
/* re-initialize the 3d view */
void hkl_gui_3d_toolbutton3_clicked_cb(GtkToolButton *toolbutton,
gpointer user_data)
{
HklGui3D *self = user_data;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
reset_3d(&priv->renderoptions);
hkl_gui_3d_invalidate(self);
}
void hkl_gui_3d_toolbutton4_toggled_cb(GtkToggleToolButton *toggle_tool_button,
gpointer user_data)
{
HklGui3D *self = user_data;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
priv->aabb = gtk_toggle_tool_button_get_active(toggle_tool_button);
hkl_gui_3d_invalidate(self);
}
void hkl_gui_3d_button1_clicked_cb(GtkButton *button,
gpointer user_data)
{
HklGui3D *self = user_data;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GSList *filenames;
GSList *filename;
filenames = gtk_file_chooser_get_files(GTK_FILE_CHOOSER(priv->filechooserdialog1));
filename = filenames;
while(filename){
GFile *file = filename->data;
GFile *directory = g_file_get_parent(file);
char *basename = g_file_get_basename(file);
char *path = g_file_get_path(directory);
hkl3d_add_model_from_file(priv->hkl3d, basename, path);
hkl3d_connect_all_axes(priv->hkl3d);
g_free(path);
g_free(basename);
g_object_unref(G_OBJECT(directory));
g_object_unref(G_OBJECT(file));
filename = g_slist_next(filename);
};
hkl_gui_3d_update_hkl3d_objects_TreeStore(self);
gtk_widget_hide(GTK_WIDGET(priv->filechooserdialog1));
g_slist_free(filenames);
}
void hkl_gui_3d_button2_clicked_cb(GtkButton *button,
gpointer user_data)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
gtk_widget_hide(GTK_WIDGET(priv->filechooserdialog1));
}
/***************/
/* OpenGL part */
/***************/
enum DisplayList {
MODEL = 1,
BULLET,
COLLISION,
AABBBOX,
HIGHLIGHT
};
static void hkl_gui_3d_draw_g3dmodel(HklGui3D *self)
{
int i;
int j;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
/* set the alpha canal to 0.5 if there is a collision */
for(i=0; ihkl3d->config->len; i++)
for(j=0; jhkl3d->config->models[i]->len; j++){
GSList *faces;
G3DFace *face;
double alpha;
if(priv->hkl3d->config->models[i]->objects[j]->is_colliding)
alpha = 0.5;
else
alpha = 1;
faces = priv->hkl3d->config->models[i]->objects[j]->g3d->faces;
while(faces){
face = (G3DFace *)(faces->data);
face->material->a = alpha;
faces = g_slist_next(faces);
}
}
/* draw the G3DObjects */
gl_draw(&priv->renderoptions, priv->hkl3d->model);
}
static void draw_g3dObject(G3DObject *object)
{
GSList *faces;
float *vertex;
faces = object->faces;
vertex = object->vertex_data;
glPushMatrix();
/* apply the transformation of the object */
if(object->transformation)
glMultMatrixf(object->transformation->matrix);
/* draw all faces with the current stencil */
while(faces){
G3DFace * face;
face = (G3DFace*)faces->data;
glBegin(GL_TRIANGLES);
glVertex3d(vertex[3*(face->vertex_indices[0])],
vertex[3*(face->vertex_indices[0])+1],
vertex[3*(face->vertex_indices[0])+2]);
glVertex3d(vertex[3*(face->vertex_indices[1])],
vertex[3*(face->vertex_indices[1])+1],
vertex[3*(face->vertex_indices[1])+2]);
glVertex3d(vertex[3*(face->vertex_indices[2])],
vertex[3*(face->vertex_indices[2])+1],
vertex[3*(face->vertex_indices[2])+2]);
glEnd();
faces = g_slist_next(faces);
}
glPopMatrix();
}
void hkl_gui_3d_draw_selected(HklGui3D *self)
{
int i;
int j;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
/* glDisable(GL_LIGHTING); */
for(i=0; ihkl3d->config->len; i++)
for(j=0; jhkl3d->config->models[i]->len; j++){
if(priv->hkl3d->config->models[i]->objects[j]->selected
&& !priv->hkl3d->config->models[i]->objects[j]->hide){
// Push the GL attribute bits so that we don't wreck any settings
glPushAttrib( GL_ALL_ATTRIB_BITS );
// Enable polygon offsets, and offset filled polygons forward by 2.5
glEnable( GL_POLYGON_OFFSET_FILL );
glPolygonOffset( -2.5, -2.5);
// Set the render mode to be line rendering with a thick line width
glPolygonMode( GL_FRONT_AND_BACK, GL_LINE );
glLineWidth( 3.f );
// Set the colour to be pink
glColor3f( 1.f, .0f, 1.f );
// Render the object
draw_g3dObject(priv->hkl3d->config->models[i]->objects[j]->g3d);
// Set the polygon mode to be filled triangles
glLineWidth( 1.f );
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
// Set the colour to the background
glCullFace(GL_FRONT);
glColor3f( 0.0f, 0.0f, 0.0f );
// Render the object
draw_g3dObject(priv->hkl3d->config->models[i]->objects[j]->g3d);
// Pop the state changes off the attribute
// to set things back how they were
glPopAttrib();
}
}
/* glEnable(GL_LIGHTING); */
}
static void draw_sphere(float radius, int lats, int longs)
{
int i, j;
for(i=0;i<=lats;i++){
float lat0 = M_PI * (-0.5 + (float) (i - 1) / lats);
float z0 = radius * sin(lat0);
float zr0 = radius * cos(lat0);
float lat1 = M_PI * (-0.5 + (float) i / lats);
float z1 = radius * sin(lat1);
float zr1 = radius * cos(lat1);
glBegin(GL_QUAD_STRIP);
for(j=0;j<=longs;j++) {
float lng = 2 * M_PI * (float) (j - 1) / longs;
float x = cos(lng);
float y = sin(lng);
glNormal3f(x * zr1, y * zr1, z1);
glVertex3f(x * zr1, y * zr1, z1);
glNormal3f(x * zr0, y * zr0, z0);
glVertex3f(x * zr0, y * zr0, z0);
}
glEnd();
}
}
void hkl_gui_3d_draw_collisions(HklGui3D *self)
{
int i;
int numManifolds;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
/* glDisable(GL_LIGHTING); */
///one way to draw all the contact points is iterating over contact manifolds / points:
numManifolds = hkl3d_get_nb_manifolds(priv->hkl3d);
for (i=0; ihkl3d, i);
for (j=0; jhkl3d, i, j,
&xa, &ya, &za, &xb, &yb, &zb);
glDisable(GL_DEPTH_TEST);
glBegin(GL_LINES);
glColor4f(0, 0, 0, 1);
glVertex3d(xa, ya, za);
glVertex3d(xb, yb, zb);
glEnd();
glColor4f(1, 0, 0, 1);
glPushMatrix();
glTranslatef (xb, yb, zb);
glScaled(0.05,0.05,0.05);
draw_sphere(1, 10, 10);
glPopMatrix();
glColor4f(1, 1, 0, 1);
glPushMatrix();
glTranslatef (xa, ya, za);
glScaled(0.05,0.05,0.05);
draw_sphere(1, 10, 10);
glPopMatrix();
glEnable(GL_DEPTH_TEST);
}
}
glFlush();
}
static void draw_line(const float from[3], const float to[3],
const float fromColor[3], const float toColor[3])
{
glBegin(GL_LINES);
glColor3f(fromColor[0], fromColor[1], fromColor[2]);
glVertex3d(from[0], from[1], from[2]);
glColor3f(toColor[0], toColor[1], toColor[2]);
glVertex3d(to[0], to[1], to[2]);
glEnd();
}
static void draw_aabb(const float from[3], const float to[3], const float color[3])
{
float halfExtents[3] = {
(to[0] - from[0]) * .5,
(to[1] - from[1]) * .5,
(to[2] - from[2]) * .5
};
float center[3] = {
(to[0] + from[0]) * .5,
(to[1] + from[1]) * .5,
(to[2] + from[2]) * .5
};
int i, j;
float edgecoord[3] = {1., 1., 1.};
for (i=0;i<4;i++){
for (j=0;j<3;j++){
float pa[3] = {
edgecoord[0] * halfExtents[0] + center[0],
edgecoord[1] * halfExtents[1] + center[1],
edgecoord[2] * halfExtents[2] + center[2]
};
int othercoord = j % 3;
edgecoord[othercoord] *= -1.f;
float pb[3] = {
edgecoord[0] * halfExtents[0] + center[0],
edgecoord[1] * halfExtents[1] + center[1],
edgecoord[2] * halfExtents[2] + center[2]
};
draw_line(pa, pb, color, color);
}
edgecoord[0] = -1;
edgecoord[1] = -1;
edgecoord[2] = -1;
if (i < 3)
edgecoord[i] *= -1;
}
}
static void
hkl_gui_3d_draw_aabb_object(const Hkl3DObject *self)
{
GLfloat from[3];
GLfloat to[3];
GLfloat color[3] = {1, 0, 0};
if(self->hide)
return;
hkl3d_object_aabb_get(self, from, to);
draw_aabb(from, to, color);
}
void
hkl_gui_3d_draw_aabb(const HklGui3D *self)
{
int i;
int j;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
for(i=0; ihkl3d->config->len; i++)
for(j=0; jhkl3d->config->models[i]->len; j++)
hkl_gui_3d_draw_aabb_object(priv->hkl3d->config->models[i]->objects[j]);
glFlush();
}
/* void hkl_gui_3d_draw_bullet_object(const Hkl3DObject *self) */
/* { */
/* int i; */
/* int j; */
/* btScalar m[16]; */
/* btVector3 worldBoundsMin; */
/* btVector3 worldBoundsMax; */
/* btVector3 aabbMin,aabbMax; */
/* /\* get the bounding box from bullet *\/ */
/* hkl3d_get_bounding_boxes(_hkl3d, &worldBoundsMin, &worldBoundsMax); */
/* object = _hkl3d->config->models[i]->objects[j]; */
/* if(!object->hide){ */
/* btCollisionObject *btObject; */
/* btObject = object->btObject; */
/* btObject->getWorldTransform().getOpenGLMatrix( m ); */
/* m_shapeDrawer.drawOpenGL(m, */
/* btObject->getCollisionShape(), */
/* *object->color, */
/* 0, /\* debug mode *\/ */
/* worldBoundsMin, */
/* worldBoundsMax); */
/* } */
/* glFlush(); */
/* } */
/* void */
/* hkl_gui_3d_draw_bullet(const HklGui3D *self) */
/* { */
/* int i; */
/* int j; */
/* HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self); */
/* for(i=0; ihkl3d->config->len; i++) */
/* for(j=0; jhkl3d->config->models[i]->len; j++) */
/* hkl_gui_3d_draw_bullet_object(priv->hkl3d->config->models[i]->objects[j]); */
/* glFlush(); */
/* } */
gboolean
hkl_gui_3d_drawingarea1_expose_cb(GtkWidget *drawing_area, GdkEventExpose *event, gpointer user_data)
{
GtkAllocation alloc;
HklGui3D *self = HKL_GUI_3D(user_data);
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GdkGLContext *gl_context = gtk_widget_get_gl_context(drawing_area);
GdkGLDrawable *gl_drawable = gtk_widget_get_gl_drawable(drawing_area);
/* Delimits the begining of the OpenGL execution. */
if (!gdk_gl_drawable_gl_begin(gl_drawable, gl_context))
g_assert_not_reached();
gtk_widget_get_allocation(drawing_area, &alloc);
glViewport(0,0, alloc.width, alloc.height);
priv->renderoptions.aspect = (gfloat)alloc.width / (gfloat)alloc.height;
hkl_gui_3d_draw_g3dmodel(self);
hkl_gui_3d_draw_selected(self);
hkl_gui_3d_draw_collisions(self);
if(priv->aabb)
hkl_gui_3d_draw_aabb(self);
/* hkl_gui_3d_draw_bullet(self); */
/* swap buffer if we're using double-buffering */
if (gdk_gl_drawable_is_double_buffered(gl_drawable))
gdk_gl_drawable_swap_buffers(gl_drawable);
else {
glFlush();
}
/* Delimits the end of the OpenGL execution. */
gdk_gl_drawable_gl_end(gl_drawable);
return FALSE;
}
gboolean
hkl_gui_3d_drawingarea1_configure_event_cb(GtkWidget *drawing_area,
GdkEventConfigure *event,
gpointer user_data)
{
GtkAllocation alloc;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GdkGLContext *gl_context = gtk_widget_get_gl_context(drawing_area);
GdkGLDrawable *gl_drawable = gtk_widget_get_gl_drawable(drawing_area);
/* Delimits the begining of the OpenGL execution. */
if (!gdk_gl_drawable_gl_begin(gl_drawable, gl_context))
g_assert_not_reached();
gtk_widget_get_allocation(drawing_area, &alloc);
glViewport(0,0, alloc.width, alloc.height);
priv->renderoptions.aspect = (gfloat)alloc.width / (gfloat)alloc.height;
/* Delimits the end of the OpenGL execution. */
gdk_gl_drawable_gl_end(gl_drawable);
return FALSE;
}
gboolean
hkl_gui_3d_idle_cb(gpointer user_data)
{
/* update control data/params in this function if needed */
GtkWidget *drawing_area = GTK_WIDGET(user_data);
glarea_update(drawing_area);
return FALSE;
}
gboolean
hkl_gui_3d_drawingarea1_button_press_event_cb(GtkWidget *drawing_area,
GdkEventButton* event,
gpointer user_data)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
/* left mouse buttom: rotate object */
if(event->button == 1)
{
priv->mouse.beginx = event->x;
priv->mouse.beginy = event->y;
return TRUE;
}
// don't block
return FALSE;
}
gboolean
hkl_gui_3d_drawingarea1_scroll_event_cb(GtkWidget *drawing_area,
GdkEventScroll *event,
gpointer user_data)
{
GtkAllocation alloc;
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
gtk_widget_get_allocation(drawing_area, &alloc);
#define ZOOM_BY 10
if(event->direction == GDK_SCROLL_DOWN)
priv->renderoptions.zoom += ZOOM_BY;
else
priv->renderoptions.zoom -= ZOOM_BY;
#undef ZOOM_BY
if(priv->renderoptions.zoom < 1)
priv->renderoptions.zoom = 1;
if(priv->renderoptions.zoom > 120)
priv->renderoptions.zoom = 120;
glarea_update(drawing_area);
return FALSE;
}
gboolean
hkl_gui_3d_drawingarea1_motion_notify_event_cb(GtkWidget *drawing_area,
GdkEventMotion* event,
gpointer user_data)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(user_data);
GtkAllocation alloc;
gint x, y;
GdkModifierType state;
gtk_widget_get_allocation(drawing_area, &alloc);
if(event->is_hint)
gdk_window_get_pointer(event->window, &x, &y, &state);
else
{
x = event->x;
y = event->y;
state = event->state;
}
/* left button pressed */
if(state & GDK_BUTTON1_MASK)
{
if(state & GDK_SHIFT_MASK)
{
/* shift pressed, translate view */
priv->renderoptions.offx += (float)(x - priv->mouse.beginx) / alloc.width / priv->renderoptions.zoom;
priv->renderoptions.offy -= (float)(y - priv->mouse.beginy) / alloc.height / priv->renderoptions.zoom;
}
else
{
/* rotate view */
gfloat spin_quat[4];
g3d_quat_trackball(spin_quat,
(2.0 * priv->mouse.beginx - alloc.width) / alloc.width,
(alloc.height - 2.0 * priv->mouse.beginy) / alloc.height,
(2.0 * x - alloc.width) / alloc.width,
(alloc.height - 2.0 * y) / alloc.height,
0.8 /* trackball radius */);
g3d_quat_add(priv->renderoptions.quat,
spin_quat, priv->renderoptions.quat);
/* normalize quat some times */
priv->renderoptions.norm_count ++;
if(priv->renderoptions.norm_count > 97) {
priv->renderoptions.norm_count = 0;
g3d_quat_normalize(priv->renderoptions.quat);
}
/* g3d_quat_to_rotation_xyz(priv->renderoptions.quat, */
/* &rx, &ry, &rz); */
/* text = g_strdup_printf("%-.2f°, %-.2f°, %-.2f°", */
/* rx * 180.0 / G_PI, ry * 180.0 / G_PI, rz * 180.0 / G_PI); */
/* gui_glade_status(priv, text); */
/* g_free(text); */
}
glarea_update(GTK_WIDGET(priv->drawingarea1));
}
/* middle mouse button */
if(state & GDK_BUTTON2_MASK)
{
priv->renderoptions.zoom +=
((y - priv->mouse.beginy) / (gfloat)alloc.height) * 40;
if(priv->renderoptions.zoom < 1)
priv->renderoptions.zoom = 1;
if(priv->renderoptions.zoom > 120)
priv->renderoptions.zoom = 120;
glarea_update(GTK_WIDGET(priv->drawingarea1));
}
priv->mouse.beginx = x;
priv->mouse.beginy = y;
return FALSE;
}
/*********************************************/
/* HklGui3D and HklGui3DClass initialization */
/*********************************************/
static void
hkl_gui_3d_class_init (HklGui3DClass *class)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
g_type_class_add_private (class, sizeof (HklGui3DPrivate));
/* virtual method */
gobject_class->finalize = finalize;
gobject_class->set_property = set_property;
gobject_class->get_property = get_property;
/* properties */
obj_properties[PROP_FILENAME] =
g_param_spec_string ("filename",
"Filename",
"The confuration filename",
NULL,
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
obj_properties[PROP_GEOMETRY] =
g_param_spec_pointer ("geometry",
"Geometry",
"The Hkl Geometry used underneath",
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class,
N_PROPERTIES,
obj_properties);
}
static void hkl_gui_3d_init (HklGui3D * self)
{
HklGui3DPrivate *priv = HKL_GUI_3D_GET_PRIVATE(self);
GtkBuilder *builder;
/* properties */
priv->filename = NULL;
priv->geometry = NULL;
priv->builder = builder = gtk_builder_new ();
get_ui(builder, "3d.ui");
// widgets
get_object(builder, GTK_FRAME, priv, frame1);
get_object(builder, GTK_VBOX, priv, vbox1);
get_object(builder, GTK_TREE_VIEW, priv, treeview1);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton1);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton2);
get_object(builder, GTK_TOOL_BUTTON, priv, toolbutton3);
get_object(builder, GTK_FILE_CHOOSER_DIALOG, priv, filechooserdialog1);
get_object(builder, GTK_BUTTON, priv, button1);
get_object(builder, GTK_BUTTON, priv, button2);
get_object(builder, GTK_TREE_STORE, priv, treestore1);
get_object(builder, GTK_DRAWING_AREA, priv, drawingarea1);
gtk_builder_connect_signals (builder, self);
/* OPENGL */
/* renderoptions */
reset_3d(&priv->renderoptions);
priv->aabb = FALSE;
/* attache GL capability to drawingarea1 */
GdkGLConfig *gl_config = gdk_gl_config_new_by_mode(GDK_GL_MODE_RGBA |
GDK_GL_MODE_DEPTH |
GDK_GL_MODE_DOUBLE);
if (!gl_config)
g_assert_not_reached();
if (!gtk_widget_set_gl_capability(GTK_WIDGET(priv->drawingarea1), gl_config, NULL, TRUE,
GDK_GL_RGBA_TYPE))
g_assert_not_reached();
gtk_widget_set_can_focus(GTK_WIDGET(priv->drawingarea1), TRUE);
gtk_widget_add_events(GTK_WIDGET(priv->drawingarea1),
GDK_BUTTON1_MOTION_MASK |
GDK_BUTTON2_MOTION_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_VISIBILITY_NOTIFY_MASK);
/* connect the GL callbacks */
const gdouble TIMEOUT_PERIOD = 1000 / 60;
g_timeout_add(TIMEOUT_PERIOD, hkl_gui_3d_idle_cb, priv->drawingarea1);
g_signal_connect(priv->drawingarea1, "expose-event",
G_CALLBACK(hkl_gui_3d_drawingarea1_expose_cb), self);
g_signal_connect(priv->drawingarea1, "button-press-event",
G_CALLBACK(hkl_gui_3d_drawingarea1_button_press_event_cb), self);
g_signal_connect(priv->drawingarea1, "motion-notify-event",
G_CALLBACK(hkl_gui_3d_drawingarea1_motion_notify_event_cb), self);
}
hkl-5.0.0.2449/gui/hkl-gui.h 0000644 0001750 0001750 00000003765 13236600666 015433 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#include
#include
#include
#include
#include "hkl.h"
#include "hkl-gui-pseudoaxes.h"
#define HKL_GUI_TYPE_WINDOW (hkl_gui_window_get_type ())
#define HKL_GUI_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindow))
#define HKL_GUI_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
#define HKL_GUI_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HKL_GUI_TYPE_WINDOW))
#define HKL_GUI_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), HKL_GUI_TYPE_WINDOW))
#define HKL_GUI_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), HKL_GUI_TYPE_WINDOW, HklGuiWindowClass))
typedef struct _HklGuiWindow HklGuiWindow;
typedef struct _HklGuiWindowClass HklGuiWindowClass;
typedef struct _HklGuiWindowPrivate HklGuiWindowPrivate;
struct _HklGuiWindow {
GObject parent_instance;
HklGuiWindowPrivate * priv;
};
struct _HklGuiWindowClass {
GObjectClass parent_class;
};
GType hkl_gui_window_get_type (void) G_GNUC_CONST;
HklGuiWindow* hkl_gui_window_new (void);
hkl-5.0.0.2449/gui/pseudo.ui 0000644 0001750 0001750 00000024756 12774775077 015602 0 ustar 00picca picca 0000000 0000000
TrueFalsegtk-goto-bottomTrueFalse0noneTrueFalse12TrueFalseTrueTruestore_pseudoFalse0bothTruepseudo axis0valueTrue2FalseFalse0TrueFalse3TrueFalsemodeFalseFalse0TrueFalsestore_modeTrue0TrueTrue1gtk-applyFalseTrueTrueTrueFalseTrueFalseFalse2InitializeFalseTrueTrueTrueFalseimage1rightFalseFalse3FalseFalse1TrueTrueTrueTruestore_mode_parameterFalseFalseTrue0parameter0valueTrue2TrueFalseparametersFalseFalse2TrueFalseframe1
hkl-5.0.0.2449/COPYING 0000644 0001750 0001750 00000104514 12551527246 014164 0 ustar 00picca picca 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program 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.
This program 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 this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
hkl-5.0.0.2449/contrib/ 0000755 0001750 0001750 00000000000 13237020547 014556 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/contrib/sixs/ 0000755 0001750 0001750 00000000000 13237020547 015544 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/contrib/sixs/hkl3d.c 0000644 0001750 0001750 00000022350 13236600666 016724 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#include
//#undef H5_USE_16_API
#include "hkl.h"
#include
#define ROOT "/nfs/ruche-sixs/sixs-soleil/com-sixs/2015/Shutdown4-5/XpadAu111/"
#define FILENAME "align_FLY2_omega_00045.nxs"
#define DATASET_IMAGE "com_113934/scan_data/xpad_image"
#define DATASET_MU "com_113934/scan_data/UHV_MU"
#define DATASET_OMEGA "com_113934/scan_data/UHV_OMEGA"
#define DATASET_DELTA "com_113934/scan_data/UHV_DELTA"
#define DATASET_GAMMA "com_113934/scan_data/UHV_GAMMA"
#define DATASET_UB "com_113934/SIXS/I14-C-CX2__EX__DIFF-UHV__#1/UB"
#define DATASET_WAVELENGTH "com_113934/SIXS/Monochromator/wavelength"
#define DATASET_DIFFRACTOMETER_TYPE "com_113934/SIXS/I14-C-CX2__EX__DIFF-UHV__#1/type"
/* Display all the node informations */
static herr_t attribute_info(hid_t location_id, const char *attr_name, const H5A_info_t *ainfo, void *op_data)
{
printf(" Attribute: %d %s\n", location_id, attr_name);
return 0;
}
static herr_t file_info(hid_t loc_id, const char *name, const H5L_info_t *info, void *opdata)
{
H5O_info_t statbuf;
hsize_t n = 0;
/*
* Get type of the object and display its name and type.
* The name of the object is passed to this function by
* the Library. Some magic :-)
*/
H5Oget_info_by_name(loc_id, name, &statbuf, H5P_DEFAULT);
switch (statbuf.type) {
case H5O_TYPE_UNKNOWN:
printf(" Object with name %s is an unknown type\n", name);
break;
case H5O_TYPE_GROUP:
printf(" Object with name %s is a group\n", name);
break;
case H5O_TYPE_DATASET:
printf(" Object with name %s is a dataset\n", name);
break;
case H5O_TYPE_NAMED_DATATYPE:
printf(" Object with name %s is a named datatype\n", name);
break;
default:
printf(" Unable to identify an object ");
}
H5Aiterate_by_name(loc_id, name, H5_INDEX_NAME, H5_ITER_NATIVE, &n, attribute_info, NULL, H5P_DEFAULT);
return 0;
}
typedef struct _HklDataframeSixsUhv HklDataframeSixsUhv;
struct _HklDataframeSixsUhv {
hid_t file;
hid_t mu;
hid_t omega;
hid_t delta;
hid_t gamma;
hid_t ub;
hid_t wavelength;
hid_t dtype;
};
static HklDataframeSixsUhv hkl_h5_open(const char *filename)
{
/* herr_t status; */
hid_t h5file_id;
HklDataframeSixsUhv dataframe = {0};
/* is it an hdf5 file */
if (H5Fis_hdf5(filename) == 0)
return dataframe;
h5file_id = H5Fopen (filename, H5F_ACC_RDONLY, H5P_DEFAULT);
if (h5file_id < 0)
return dataframe;
/* display all the node informations */
/* status = H5Lvisit(h5file_id, H5_INDEX_CRT_ORDER, H5_ITER_NATIVE, file_info, NULL); */
/* if(status < 0) */
/* return dataframe; */
dataframe.file = h5file_id;
dataframe.mu = H5Dopen (h5file_id, DATASET_MU, H5P_DEFAULT);
dataframe.omega = H5Dopen (h5file_id, DATASET_OMEGA, H5P_DEFAULT);
dataframe.delta = H5Dopen (h5file_id, DATASET_DELTA, H5P_DEFAULT);
dataframe.gamma = H5Dopen (h5file_id, DATASET_GAMMA, H5P_DEFAULT);
dataframe.ub = H5Dopen (h5file_id, DATASET_UB, H5P_DEFAULT);
dataframe.wavelength = H5Dopen (h5file_id, DATASET_WAVELENGTH, H5P_DEFAULT);
dataframe.dtype = H5Dopen (h5file_id, DATASET_DIFFRACTOMETER_TYPE, H5P_DEFAULT);
return dataframe;
}
static hssize_t check_ndims(hid_t dataset_id, int expected, hid_t *space_id)
{
*space_id = H5Dget_space (dataset_id);
return H5Sget_simple_extent_ndims (*space_id) == expected;
}
static int hkl_h5_len(const HklDataframeSixsUhv *dataframe)
{
hid_t space_id = H5Dget_space (dataframe->mu);
return H5Sget_simple_extent_npoints(space_id);
}
static int hkl_h5_is_valid(const HklDataframeSixsUhv *dataframe)
{
int res = TRUE;
hid_t space_id;
hssize_t n;
/* check the dimensionnality of the axes */
res &= check_ndims(dataframe->mu, 1, &space_id);
n = H5Sget_simple_extent_npoints(space_id);
/* check the dimensionnality of all the axes */
res &= check_ndims(dataframe->omega, 1, &space_id);
res &= n == H5Sget_simple_extent_npoints(space_id);
res &= check_ndims(dataframe->delta, 1, &space_id);
res &= n == H5Sget_simple_extent_npoints(space_id);
res &= check_ndims(dataframe->gamma, 1, &space_id);
res &= n == H5Sget_simple_extent_npoints(space_id);
return res;
}
static herr_t hkl_h5_close(const HklDataframeSixsUhv *dataframe)
{
H5Dclose(dataframe->dtype);
H5Dclose(dataframe->wavelength);
H5Dclose(dataframe->ub);
H5Dclose(dataframe->gamma);
H5Dclose(dataframe->delta);
H5Dclose(dataframe->omega);
H5Dclose(dataframe->mu);
return H5Fclose (dataframe->file);
}
typedef struct _HklDataframe HklDataframe;
struct _HklDataframe {
int i;
int len;
const HklDataframeSixsUhv *_dataframe;
};
static const HklDataframe hkl_dataframe_first(const HklDataframeSixsUhv *dataframe)
{
HklDataframe frame;
frame.i = 0;
frame.len = hkl_h5_len(dataframe);
frame._dataframe = dataframe;
return frame;
}
static int hkl_dataframe_done(const HklDataframe dataframe)
{
return dataframe.i < dataframe.len;
}
static const HklDataframe hkl_dataframe_next(const HklDataframe dataframe)
{
HklDataframe frame = dataframe;
frame.i++;
return frame;
}
static herr_t get_position(hid_t dataset_id, int idx, double *position)
{
hid_t space_id;
hid_t mem_type_id;
hid_t mem_space_id;
hsize_t count[1];
hsize_t offset[1];
mem_type_id = H5Dget_type(dataset_id);
/* Get the dataspace handle */
if ( (space_id = H5Dget_space( dataset_id )) < 0 )
goto out;
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = idx;
count[0] = 1;
if ( H5Sselect_hyperslab(space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
goto out;
/* Create a memory dataspace handle */
if ( (mem_space_id = H5Screate_simple( 1, count, NULL )) < 0 )
goto out;
if ( H5Dread(dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, position ) < 0 )
goto out;
/* Terminate access to the memory dataspace */
if ( H5Sclose( mem_space_id ) < 0 )
goto out;
/* Terminate access to the dataspace */
if ( H5Sclose( space_id ) < 0 )
goto out;
return 0;
out:
H5Tclose(mem_type_id);
return -1;
}
static herr_t hkl_dataframe_geometry_get(const HklDataframe dataframe, HklGeometry **geometry)
{
herr_t status = 0;
hid_t datatype;
double wavelength;
double axes[4];
/* create the HklGeometry */
if((*geometry) == NULL){
char *name;
size_t n;
HklFactory *factory;
/* read the diffractometer type from the hdf5 file */
datatype = H5Dget_type(dataframe._dataframe->dtype);
n = H5Tget_size(datatype);
name = malloc(n+1);
status = H5Dread(dataframe._dataframe->dtype,
datatype,
H5S_ALL, H5S_ALL,
H5P_DEFAULT, name);
if(status >= 0){
/* remove the last "\n" char */
name[n-1] = 0;
factory = hkl_factory_get_by_name(name, NULL);
*geometry = hkl_factory_create_new_geometry(factory);
}
free(name);
H5Tclose(datatype);
}
/* read the wavelength double */
/* TODO check the right size */
/* TODO how to obtain the unit of the wavelength */
datatype = H5Dget_type(dataframe._dataframe->wavelength);
status = H5Dread(dataframe._dataframe->wavelength,
datatype,
H5S_ALL, H5S_ALL,
H5P_DEFAULT, &wavelength);
if(status >= 0)
hkl_geometry_wavelength_set(*geometry, wavelength, HKL_UNIT_USER, NULL);
H5Tclose(datatype);
/* read the axis positions of the ith dataframe */
/* check how to decide about the dataset connection and the hkl axes connection */
/* TODO check the right size */
/* TODO how to obtain the unit of the axes position */
if (get_position(dataframe._dataframe->mu,
dataframe.i, &axes[0]) < 0)
goto out;
if (get_position(dataframe._dataframe->omega,
dataframe.i, &axes[1]) < 0)
goto out;
if (get_position(dataframe._dataframe->gamma,
dataframe.i, &axes[2]) < 0)
goto out;
if (get_position(dataframe._dataframe->delta,
dataframe.i, &axes[3]) < 0)
goto out;
hkl_geometry_axis_values_set(*geometry, axes, 4, HKL_UNIT_USER, NULL);
/* hkl_geometry_fprintf(stdout, *geometry); */
/* fprintf(stdout, "\n"); */
return 0;
out:
return -1;
}
int main (int argc, char ** argv)
{
const char *filename = ROOT FILENAME;
HklDataframeSixsUhv dataframe_h5 = hkl_h5_open(filename);
int res = hkl_h5_is_valid(&dataframe_h5);
/* fprintf(stdout, "h5file is valid : %d\n", res); */
HklGeometry *geometry = NULL;
for(HklDataframe dataframe = hkl_dataframe_first(&dataframe_h5);
hkl_dataframe_done(dataframe);
dataframe = hkl_dataframe_next(dataframe))
{
hkl_dataframe_geometry_get(dataframe, &geometry);
/* fprintf(stdout, " %d", dataframe.i); */
}
hkl_geometry_free(geometry);
hkl_h5_close(&dataframe_h5);
return res;
}
hkl-5.0.0.2449/contrib/sixs/Makefile.am 0000644 0001750 0001750 00000000767 13211070334 017601 0 ustar 00picca picca 0000000 0000000 bin_PROGRAMS = hkl3d
AM_CFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/hkl \
$(GSL_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(HDF5_CFLAGS)
AM_LDFLAGS = \
-Wl,--export-dynamic \
$(top_builddir)/hkl/libhkl.la \
$(GSL_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(HDF5_LIBS)
hkl3d_LDADD = \
$(top_builddir)/hkl/libhkl.la
# Support for GNU Flymake, in Emacs.
check-syntax: AM_CFLAGS += -fsyntax-only -pipe
check-syntax:
test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
.PHONY: check-syntax
hkl-5.0.0.2449/contrib/sixs/Makefile.in 0000644 0001750 0001750 00000052065 13237017633 017623 0 ustar 00picca picca 0000000 0000000 # Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
bin_PROGRAMS = hkl3d$(EXEEXT)
subdir = contrib/sixs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
hkl3d_SOURCES = hkl3d.c
hkl3d_OBJECTS = hkl3d.$(OBJEXT)
hkl3d_DEPENDENCIES = $(top_builddir)/hkl/libhkl.la
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/config/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = hkl3d.c
DIST_SOURCES = hkl3d.c
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ASY = @ASY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BULLET_CFLAGS = @BULLET_CFLAGS@
BULLET_LIBS = @BULLET_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EMACS = @EMACS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
G3D_CFLAGS = @G3D_CFLAGS@
G3D_LIBS = @G3D_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GLU_CFLAGS = @GLU_CFLAGS@
GLU_LIBS = @GLU_LIBS@
GNUPLOT = @GNUPLOT@
GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
GOBJECT_LIBS = @GOBJECT_LIBS@
GOBJECT_QUERY = @GOBJECT_QUERY@
GREP = @GREP@
GSL_CFLAGS = @GSL_CFLAGS@
GSL_CONFIG = @GSL_CONFIG@
GSL_LIBS = @GSL_LIBS@
GTKDOC_CHECK = @GTKDOC_CHECK@
GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
HDF5_CFLAGS = @HDF5_CFLAGS@
HDF5_LIBS = @HDF5_LIBS@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
VMAJ = @VMAJ@
YAML_CFLAGS = @YAML_CFLAGS@
YAML_LIBS = @YAML_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
release_info = @release_info@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
version_info = @version_info@
AM_CFLAGS = \
-I$(top_srcdir) \
-I$(top_srcdir)/hkl \
$(GSL_CFLAGS) \
$(GLIB_CFLAGS) \
$(GTK_CFLAGS) \
$(HDF5_CFLAGS)
AM_LDFLAGS = \
-Wl,--export-dynamic \
$(top_builddir)/hkl/libhkl.la \
$(GSL_LIBS) \
$(GLIB_LIBS) \
$(GTK_LIBS) \
$(HDF5_LIBS)
hkl3d_LDADD = \
$(top_builddir)/hkl/libhkl.la
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/sixs/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu contrib/sixs/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
|| test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
hkl3d$(EXEEXT): $(hkl3d_OBJECTS) $(hkl3d_DEPENDENCIES) $(EXTRA_hkl3d_DEPENDENCIES)
@rm -f hkl3d$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(hkl3d_OBJECTS) $(hkl3d_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hkl3d.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic clean-libtool cscopelist-am \
ctags ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-info install-info-am install-man install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Support for GNU Flymake, in Emacs.
check-syntax: AM_CFLAGS += -fsyntax-only -pipe
check-syntax:
test -z "$(CHK_SOURCES)" || $(COMPILE) $(CHK_SOURCES)
.PHONY: check-syntax
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
hkl-5.0.0.2449/contrib/Makefile.am 0000644 0001750 0001750 00000000017 13211070325 016577 0 ustar 00picca picca 0000000 0000000 SUBDIRS = sixs
hkl-5.0.0.2449/contrib/Makefile.in 0000644 0001750 0001750 00000047062 13237017633 016636 0 ustar 00picca picca 0000000 0000000 # Makefile.in generated by automake 1.15.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = contrib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gtk-doc.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
ASY = @ASY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BULLET_CFLAGS = @BULLET_CFLAGS@
BULLET_LIBS = @BULLET_LIBS@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EMACS = @EMACS@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
G3D_CFLAGS = @G3D_CFLAGS@
G3D_LIBS = @G3D_LIBS@
GLIB_CFLAGS = @GLIB_CFLAGS@
GLIB_COMPILE_RESOURCES = @GLIB_COMPILE_RESOURCES@
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
GLIB_LIBS = @GLIB_LIBS@
GLIB_MKENUMS = @GLIB_MKENUMS@
GLU_CFLAGS = @GLU_CFLAGS@
GLU_LIBS = @GLU_LIBS@
GNUPLOT = @GNUPLOT@
GOBJECT_CFLAGS = @GOBJECT_CFLAGS@
GOBJECT_LIBS = @GOBJECT_LIBS@
GOBJECT_QUERY = @GOBJECT_QUERY@
GREP = @GREP@
GSL_CFLAGS = @GSL_CFLAGS@
GSL_CONFIG = @GSL_CONFIG@
GSL_LIBS = @GSL_LIBS@
GTKDOC_CHECK = @GTKDOC_CHECK@
GTKDOC_CHECK_PATH = @GTKDOC_CHECK_PATH@
GTKDOC_DEPS_CFLAGS = @GTKDOC_DEPS_CFLAGS@
GTKDOC_DEPS_LIBS = @GTKDOC_DEPS_LIBS@
GTKDOC_MKPDF = @GTKDOC_MKPDF@
GTKDOC_REBASE = @GTKDOC_REBASE@
GTKGLEXT_CFLAGS = @GTKGLEXT_CFLAGS@
GTKGLEXT_LIBS = @GTKGLEXT_LIBS@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
HDF5_CFLAGS = @HDF5_CFLAGS@
HDF5_LIBS = @HDF5_LIBS@
HTML_DIR = @HTML_DIR@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTROSPECTION_CFLAGS = @INTROSPECTION_CFLAGS@
INTROSPECTION_COMPILER = @INTROSPECTION_COMPILER@
INTROSPECTION_GENERATE = @INTROSPECTION_GENERATE@
INTROSPECTION_GIRDIR = @INTROSPECTION_GIRDIR@
INTROSPECTION_LIBS = @INTROSPECTION_LIBS@
INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@
INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@
INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
VMAJ = @VMAJ@
YAML_CFLAGS = @YAML_CFLAGS@
YAML_LIBS = @YAML_LIBS@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
release_info = @release_info@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
version_info = @version_info@
SUBDIRS = sixs
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
hkl-5.0.0.2449/hkl/ 0000755 0001750 0001750 00000000000 13237020537 013673 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/hkl/hkl-type-builtins.c 0000644 0001750 0001750 00000005633 13237020043 017422 0 ustar 00picca picca 0000000 0000000
/* This file is generated by glib-mkenums, do not modify it. This code is licensed under the same license as the containing project. Note that it links to GLib, so must comply with the LGPL linking clauses. */
#undef HKL_DISABLE_DEPRECATED
#define HKL_ENABLE_BROKEN
#include
#include "hkl.h"
#include "hkl-type-builtins.h"
/* enumerations from "../hkl.h" */
GType
hkl_unit_enum_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 0)) {
static const GEnumValue values[] = {
{ HKL_UNIT_DEFAULT, "HKL_UNIT_DEFAULT", "default" },
{ HKL_UNIT_USER, "HKL_UNIT_USER", "user" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static (g_intern_static_string ("HklUnitEnum"), values);
}
return etype;
}
GType
hkl_detector_type_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 0)) {
static const GEnumValue values[] = {
{ HKL_DETECTOR_TYPE_0D, "HKL_DETECTOR_TYPE_0D", "0d" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static (g_intern_static_string ("HklDetectorType"), values);
}
return etype;
}
GType
hkl_engine_capabilities_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 0)) {
static const GFlagsValue values[] = {
{ HKL_ENGINE_CAPABILITIES_READABLE, "HKL_ENGINE_CAPABILITIES_READABLE", "readable" },
{ HKL_ENGINE_CAPABILITIES_WRITABLE, "HKL_ENGINE_CAPABILITIES_WRITABLE", "writable" },
{ HKL_ENGINE_CAPABILITIES_INITIALIZABLE, "HKL_ENGINE_CAPABILITIES_INITIALIZABLE", "initializable" },
{ 0, NULL, NULL }
};
etype = g_flags_register_static (g_intern_static_string ("HklEngineCapabilities"), values);
}
return etype;
}
GType
hkl_engine_axis_names_get_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 0)) {
static const GEnumValue values[] = {
{ HKL_ENGINE_AXIS_NAMES_GET_READ, "HKL_ENGINE_AXIS_NAMES_GET_READ", "read" },
{ HKL_ENGINE_AXIS_NAMES_GET_WRITE, "HKL_ENGINE_AXIS_NAMES_GET_WRITE", "write" },
{ 0, NULL, NULL }
};
etype = g_enum_register_static (g_intern_static_string ("HklEngineAxisNamesGet"), values);
}
return etype;
}
GType
hkl_engine_dependencies_get_type (void)
{
static GType etype = 0;
if (G_UNLIKELY(etype == 0)) {
static const GFlagsValue values[] = {
{ HKL_ENGINE_DEPENDENCIES_AXES, "HKL_ENGINE_DEPENDENCIES_AXES", "axes" },
{ HKL_ENGINE_DEPENDENCIES_ENERGY, "HKL_ENGINE_DEPENDENCIES_ENERGY", "energy" },
{ HKL_ENGINE_DEPENDENCIES_SAMPLE, "HKL_ENGINE_DEPENDENCIES_SAMPLE", "sample" },
{ 0, NULL, NULL }
};
etype = g_flags_register_static (g_intern_static_string ("HklEngineDependencies"), values);
}
return etype;
}
#define __HKL_TYPE_BUILTINS_C__
/* Generated data ends here */
hkl-5.0.0.2449/hkl/api2/ 0000755 0001750 0001750 00000000000 13237020537 014526 5 ustar 00picca picca 0000000 0000000 hkl-5.0.0.2449/hkl/api2/hkl2.h 0000644 0001750 0001750 00000014737 13236600666 015561 0 ustar 00picca picca 0000000 0000000 /* 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-2018 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#ifndef __HKL_HKL2_H__
#define __HKL_HKL2_H__
#include "hkl.h"
#include "hkl/ccan/generator/generator.h"
G_BEGIN_DECLS
/* Geometry */
enum geometry_e {
GEOMETRY_E4CH,
GEOMETRY_E4CV,
GEOMETRY_E6C,
GEOMETRY_K4CH,
GEOMETRY_K4CV,
GEOMETRY_K6C,
GEOMETRY_SOLEIL_SIRIUS_KAPPA,
GEOMETRY_SOLEIL_SIXS_MED_2_3,
GEOMETRY_ZAXIS,
};
struct Geometry {
enum geometry_e tag;
union {
struct {
double wavelength;
union {
double positions[4];
struct {
double omega;
double chi;
double phi;
double tth;
};
};
} e4ch;
struct {
double wavelength;
union {
double positions[4];
struct {
double omega;
double chi;
double phi;
double tth;
};
};
} e4cv;
struct {
double wavelength;
union {
double positions[6];
struct {
double mu;
double komega;
double kappa;
double kphi;
double gamma;
double delta;
};
};
} e6c;
struct {
double wavelength;
union {
double positions[4];
struct {
double komega;
double kappa;
double kphi;
double tth;
};
};
} k4ch;
struct {
double wavelength;
union {
double positions[4];
struct {
double komega;
double kappa;
double kphi;
double tth;
};
};
} k4cv;
struct {
double wavelength;
union {
double positions[6];
struct {
double mu;
double komega;
double kappa;
double kphi;
double gamma;
double delta;
};
};
} k6c;
struct {
double wavelength;
union {
double positions[6];
struct {
double mu;
double komega;
double kappa;
double kphi;
double delta;
double gamma;
};
};
} soleil_sirius_kappa;
struct {
double wavelength;
union {
double positions[6];
struct {
double beta;
double mu;
double omega;
double gamma;
double delta;
double eta_a;
};
};
} soleil_sixs_med_2_3;
struct {
double wavelength;
union {
double positions[4];
struct {
double mu;
double omega;
double delta;
double gamma;
};
};
} zaxis;
};
};
#define E4ch(_w, _o, _c, _p, _t) \
{.tag=GEOMETRY_E4CH, \
.e4ch={_w, {{_o, _c, _p, _t}}}}
#define E4cv(_w, _o, _c, _p, _t) \
{.tag=GEOMETRY_E4CV, \
.e4cv={_w, {{_o, _c, _p, _t}}}}
#define E6c(_w, _m, _ko, _ka, _kp, _g, _d) \
{.tag=GEOMETRY_E6C, \
.e6c={_w, {{_m, _ko, _ka, _kp, _g, _d}}}}
#define K4ch(_w, _o, _c, _p, _t) \
{.tag=GEOMETRY_K4CH, \
.k4ch={_w, {{_o, _c, _p, _t}}}}
#define K4cv(_w, _o, _c, _p, _t) \
{.tag=GEOMETRY_K4CV, \
.k4cv={_w, {{_o, _c, _p, _t}}}}
#define K6c(_w, _m, _ko, _ka, _kp, _g, _d) \
{.tag=GEOMETRY_K6C, \
.k6c={_w, {{_m, _ko, _ka, _kp, _g, _d}}}}
#define SoleilSiriusKappa(_w, _m, _ko, _ka, _kp, _d, _g) \
{.tag=GEOMETRY_SOLEIL_SIRIUS_KAPPA, \
.soleil_sirius_kappa={_w, {{_m, _ko, _ka, _kp, _d, _g}}}}
#define SoleilSixsMed2_3(_w, _b, _m, _o, _g, _d, _e) \
{.tag=GEOMETRY_SOLEIL_SIXS_MED_2_3, \
.soleil_sixs_med_2_3={_w, {{_b, _m, _o, _g, _d, _e}}}}
#define Zaxis(_w, _m, _o, _d, _g) \
{.tag=GEOMETRY_ZAXIS, \
.zaxis={_w, {{_m, _o, _d, _g}}}}
extern HklGeometry *newGeometry(struct Geometry geometry);
/* Engines */
extern HklEngineList *newEngines(struct Geometry geometry);
/* Lattice */
enum lattice_e {
LATTICE_CUBIC,
LATTICE_HEXAGONAL,
LATTICE_TETRAGONAL,
};
struct Lattice {
enum lattice_e tag;
union {
struct { double a; } cubic;
struct { double a; double c; } hexagonal;
struct { double a; double c; } tetragonal;
};
};
#define Cubic(_a) {.tag=LATTICE_CUBIC, .cubic={_a}}
#define Hexagonal(_a, _c) {.tag=LATTICE_HEXAGONAL, .hexagonal={_a, _c}}
#define Tetragonal(_a, _c) {.tag=LATTICE_TETRAGONAL, .tetragonal={_a, _c}}
extern HklLattice *newLattice(struct Lattice lattice);
/* Sample */
struct Sample {
const char *name;
struct Lattice lattice;
double ux;
double uy;
double uz;
};
extern HklSample *newSample(struct Sample sample);
extern const struct Sample cu;
/* Mode */
enum mode_e {
MODE_HKL_BISSECTOR_VERTICAL,
MODE_HKL_E4CH_CONSTANT_PHI,
};
struct Mode {
enum mode_e tag;
};
#define ModeHklBissectorVertical { .tag=MODE_HKL_BISSECTOR_VERTICAL }
#define ModeHklE4CHConstantPhi { .tag=MODE_HKL_E4CH_CONSTANT_PHI }
extern const char *getModeName(struct Mode mode);
/* Engine */
enum engine_e {
ENGINE_HKL,
};
struct Engine {
enum engine_e tag;
union {
struct {double h; double k; double l; struct Mode mode;} hkl;
};
};
#define EngineHkl(h_, k_, l_, mode_) {.tag=ENGINE_HKL, .hkl={h_, k_, l_, mode_}}
extern void Engine_fprintf(FILE *f, struct Engine engine);
extern void Engine_header(FILE *f, const struct Engine engine);
extern void Engine_save_as_dat(FILE *f, const struct Engine engine);
extern HklGeometryList *Engine_solve(HklEngineList *engines,
struct Engine econfig);
/* HklTrajectory */
enum trajectory_e {
TRAJECTORY_HKL_FROM_TO,
};
struct Trajectory {
enum trajectory_e tag;
union {
struct {double h0; double k0; double l0;
double h1; double k1; double l1;
uint n; struct Mode mode;} hklfromto;
};
};
#define TrajectoryHklFromTo(h0_, k0_, l0_, h1_, k1_, l1_, n_, mode_) {.tag=TRAJECTORY_HKL_FROM_TO, .hklfromto={h0_, k0_, l0_, h1_, k1_, l1_, n_, .mode=mode_}}
extern generator_declare(trajectory_gen, struct Engine, struct Trajectory, tconfig);
extern uint Trajectory_len(struct Trajectory tconfig);
extern HklGeometryList *Trajectory_solve(struct Trajectory tconfig,
struct Geometry gconfig,
struct Sample sconfig,
uint move);
G_END_DECLS
#endif /* __HKL_TAP_H__ */
hkl-5.0.0.2449/hkl/api2/Makefile.am 0000644 0001750 0001750 00000000537 13236600666 016575 0 ustar 00picca picca 0000000 0000000 AM_CPPFLAGS = -Wextra -D_DEFAULT_SOURCE \
-I$(top_srcdir) \
-I$(top_srcdir)/hkl \
$(GLIB_CFLAGS) \
$(GSL_CFLAGS)
# need access to the private part
AM_LDFLAGS = -Wl,--whole-archive,$(top_builddir)/hkl/.libs/libhkl.a,--no-whole-archive
LDADD = \
$(GLIB_LIBS) \
$(GSL_LIBS)
noinst_LTLIBRARIES=libhkl2.la
libhkl2_la_SOURCES = \
hkl2.c \
hkl2.h
hkl-5.0.0.2449/hkl/api2/hkl2.c 0000644 0001750 0001750 00000020426 13217446663 015550 0 ustar 00picca picca 0000000 0000000 /* 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-2012 Synchrotron SOLEIL
* L'Orme des Merisiers Saint-Aubin
* BP 48 91192 GIF-sur-YVETTE CEDEX
*
* Authors: Picca Frédéric-Emmanuel
*/
#include
#include "hkl/hkl-matrix-private.h"
#include "hkl/hkl-macros-private.h"
#include "hkl/hkl-pseudoaxis-private.h"
#include "hkl/hkl-trajectory-private.h"
#include "hkl/api2/hkl2.h"
static const HklFactory *getFactory(struct Geometry geometry)
{
const HklFactory *self = NULL;
switch(geometry.tag) {
case GEOMETRY_E4CH:
self = hkl_factory_get_by_name("E4CH", NULL);
break;
case GEOMETRY_E4CV:
self = hkl_factory_get_by_name("E4CV", NULL);
break;
case GEOMETRY_E6C:
self = hkl_factory_get_by_name("E6C", NULL);
break;
case GEOMETRY_K4CH:
self = hkl_factory_get_by_name("K4CH", NULL);
break;
case GEOMETRY_K4CV:
self = hkl_factory_get_by_name("K4CV", NULL);
break;
case GEOMETRY_K6C:
self = hkl_factory_get_by_name("K6C", NULL);
break;
case GEOMETRY_SOLEIL_SIRIUS_KAPPA:
self = hkl_factory_get_by_name("SOLEIL SIRIUS KAPPA", NULL);
break;
case GEOMETRY_SOLEIL_SIXS_MED_2_3:
self = hkl_factory_get_by_name("SOLEIL SIXS MED2+3", NULL);
break;
case GEOMETRY_ZAXIS:
self = hkl_factory_get_by_name("ZAXIS", NULL);
break;
}
return self;
}
HklEngineList *newEngines(struct Geometry geometry)
{
return hkl_factory_create_new_engine_list(getFactory(geometry));
}
HklGeometry *newGeometry(struct Geometry geometry)
{
HklGeometry *self = hkl_factory_create_new_geometry(getFactory(geometry));
#define NEW_GEOMETRY(type_) do{ \
if(!hkl_geometry_axis_values_set(self, \
geometry.type_.positions, \
ARRAY_SIZE(geometry.type_.positions), \
HKL_UNIT_USER, NULL)){ \
goto failed; \
} \
if(!hkl_geometry_wavelength_set(self, geometry.type_.wavelength, \
HKL_UNIT_DEFAULT, NULL)){ \
goto failed; \
} \
}while(0)
switch (geometry.tag) {
case GEOMETRY_E4CH: NEW_GEOMETRY(e4ch); break;
case GEOMETRY_E4CV: NEW_GEOMETRY(e4cv); break;
case GEOMETRY_E6C: NEW_GEOMETRY(e6c); break;
case GEOMETRY_K4CH: NEW_GEOMETRY(k4ch); break;
case GEOMETRY_K4CV: NEW_GEOMETRY(k4cv); break;
case GEOMETRY_K6C: NEW_GEOMETRY(k6c); break;
case GEOMETRY_SOLEIL_SIRIUS_KAPPA: NEW_GEOMETRY(soleil_sirius_kappa); break;
case GEOMETRY_SOLEIL_SIXS_MED_2_3: NEW_GEOMETRY(soleil_sixs_med_2_3); break;
case GEOMETRY_ZAXIS: NEW_GEOMETRY(zaxis); break;
}
return self;
failed:
hkl_geometry_free(self);
return NULL;
#undef NEW_GEOMETRY
}
/* Lattice */
HklLattice *newLattice(struct Lattice lattice)
{
HklLattice *self = NULL;
switch (lattice.tag) {
case LATTICE_CUBIC:
self = hkl_lattice_new(lattice.cubic.a,
lattice.cubic.a,
lattice.cubic.a,
90*HKL_DEGTORAD,
90*HKL_DEGTORAD,
90*HKL_DEGTORAD,
NULL);
break;
case LATTICE_HEXAGONAL:
self = hkl_lattice_new(lattice.hexagonal.a,
lattice.hexagonal.a,
lattice.hexagonal.c,
90*HKL_DEGTORAD,
90*HKL_DEGTORAD,
120*HKL_DEGTORAD,
NULL);
break;
case LATTICE_TETRAGONAL:
self = hkl_lattice_new(lattice.tetragonal.a,
lattice.tetragonal.a,
lattice.tetragonal.c,
90*HKL_DEGTORAD,
90*HKL_DEGTORAD,
90*HKL_DEGTORAD,
NULL);
break;
}
return self;
}
/* Sample */
HklSample *newSample(struct Sample sample)
{
HklSample *self;
HklLattice *lattice;
HklMatrix *U;
self = hkl_sample_new(sample.name);
lattice = newLattice(sample.lattice);
hkl_sample_lattice_set(self, lattice);
hkl_lattice_free(lattice);
U = hkl_matrix_new_euler(sample.ux, sample.uy, sample.uz);
hkl_sample_U_set(self, U, NULL);
hkl_matrix_free(U);
return self;
}
const struct Sample cu = {
.name = "default",
.lattice = Cubic(1.54),
.ux = 0.0 * HKL_DEGTORAD,
.uy = 0.0 * HKL_DEGTORAD,
.uz = 0.0 * HKL_DEGTORAD,
};
/* Mode */
const char *getModeName(struct Mode mode)
{
const char *name = NULL;
switch(mode.tag){
case MODE_HKL_BISSECTOR_VERTICAL: name = "bissector_vertical"; break;
case MODE_HKL_E4CH_CONSTANT_PHI: name = "constant_phi"; break;
}
return name;
}
/* Engine */
void Engine_fprintf(FILE *f, struct Engine engine)
{
switch(engine.tag){
case ENGINE_HKL:
{
fprintf(f, "hkl: %f %f %f\n", engine.hkl.h, engine.hkl.k, engine.hkl.l);
}
break;
}
}
void Engine_header(FILE *f, const struct Engine engine)
{
switch(engine.tag){
case ENGINE_HKL:
{
fprintf(f, "h k l");
}
break;
}
}
void Engine_save_as_dat(FILE *f, const struct Engine engine)
{
switch(engine.tag){
case ENGINE_HKL:
{
fprintf(f, "%f %f %f", engine.hkl.h, engine.hkl.k, engine.hkl.l);
}
break;
}
}
HklGeometryList *Engine_solve(HklEngineList *engines, struct Engine econfig)
{
HklGeometryList *geometries = NULL;
switch(econfig.tag) {
case ENGINE_HKL:
{
double values[3] = {econfig.hkl.h, econfig.hkl.k, econfig.hkl.l};
HklEngine *engine = hkl_engine_list_engine_get_by_name(engines, "hkl", NULL);
const char *mode_name = getModeName(econfig.hkl.mode);
if(hkl_engine_current_mode_set(engine, mode_name, NULL)){
geometries = hkl_engine_pseudo_axis_values_set(engine,
values, ARRAY_SIZE(values),
HKL_UNIT_DEFAULT, NULL);
}
}
break;
}
return geometries;
}
/* HklTrajectory */
generator_def(trajectory_gen, struct Engine, struct Trajectory, tconfig)
{
switch(tconfig.tag){
case TRAJECTORY_HKL_FROM_TO:
{
uint i;
double dh = (tconfig.hklfromto.h1 - tconfig.hklfromto.h0) / (tconfig.hklfromto.n);
double dk = (tconfig.hklfromto.k1 - tconfig.hklfromto.k0) / (tconfig.hklfromto.n);
double dl = (tconfig.hklfromto.l1 - tconfig.hklfromto.l0) / (tconfig.hklfromto.n);
for(i=0; i