From d2c4ca0e9358b048946ae9f484474826a278f5ac Mon Sep 17 00:00:00 2001 From: taw27 Date: Wed, 31 Oct 2007 17:23:10 +0000 Subject: Update the reprojection window after refinement step git-svn-id: svn://cook.msm.cam.ac.uk:745/diff-tomo/dtr@187 bf6ca9ba-c028-0410-8290-897cf20841d1 --- src/reproject.c | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'src/reproject.c') 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", -- cgit v1.2.3