diff options
Diffstat (limited to 'src/reproject.c')
-rw-r--r-- | src/reproject.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/reproject.c b/src/reproject.c index c41f173..c0dfc73 100644 --- a/src/reproject.c +++ b/src/reproject.c @@ -259,24 +259,41 @@ static void reproject_mark_peaks(ControlContext *ctx) { image_feature_list_free(rflist); } - -static gint reproject_clicked(GtkWidget *widget, GdkEventButton *event, ControlContext *ctx) { - - - ctx->reproject_cur_image++; - if ( ctx->reproject_cur_image == ctx->images->n_images ) ctx->reproject_cur_image = 0; +static void reproject_update(ControlContext *ctx) { + imagedisplay_clear_marks(ctx->reproject_id); - reflectionlist_clear_markers(ctx->reflectionlist); + //reflectionlist_clear_markers(ctx->reflectionlist); reproject_mark_peaks(ctx); imagedisplay_put_data(ctx->reproject_id, ctx->images->images[ctx->reproject_cur_image]); +} + +static gint reproject_clicked(GtkWidget *widget, GdkEventButton *event, ControlContext *ctx) { + + ctx->reproject_cur_image++; + if ( ctx->reproject_cur_image == ctx->images->n_images ) ctx->reproject_cur_image = 0; + + reproject_update(ctx); + return 0; } +void reproject_lattice_changed(ControlContext *ctx) { + + if ( ctx->cell_lattice ) { + reflection_list_from_new_cell(ctx->cell_lattice, ctx->cell); + } else { + ctx->cell_lattice = reflection_list_from_cell(ctx->cell); + } + + if ( ctx->reproject_id ) reproject_update(ctx); + +} + static gint reproject_closed(GtkWidget *widget, ControlContext *ctx) { ctx->reproject_id = NULL; return 0; @@ -301,8 +318,8 @@ void reproject_open(ControlContext *ctx) { return; } - ctx->cell_lattice = reflection_list_from_cell(ctx->cell); ctx->reproject_cur_image = 0; + reproject_lattice_changed(ctx); ctx->reproject_id = imagedisplay_open_with_message(ctx->images->images[ctx->reproject_cur_image], "Reprojected Diffraction Pattern", "Click to change image", |