aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2014-05-28 15:28:33 +0200
committerThomas White <taw@physics.org>2014-05-28 15:28:33 +0200
commit713119b99cd3e847ba80f001460c422d26598faf (patch)
tree260627a2921f868a140d3994dc032f7b2576b2ab
parent15eacb4e4235a4ece2516e84f191614b4b4e000d (diff)
hdfsee: Add ability to move all panels together
-rw-r--r--doc/man/hdfsee.12
-rw-r--r--src/dw-hdfsee.c65
2 files changed, 45 insertions, 22 deletions
diff --git a/doc/man/hdfsee.1 b/doc/man/hdfsee.1
index 4990d149..62365e16 100644
--- a/doc/man/hdfsee.1
+++ b/doc/man/hdfsee.1
@@ -90,7 +90,7 @@ Apply a median filter with box "radius" \fIn\fR to the image. Each pixel will b
Apply a noise filter to the image with checks 3x3 squares of pixels and sets all of them to zero if any of the nine pixels have a negative value. If you also use \fB--median-filter\fR, the median filter will be applied first.
.SH CALIBRATION MODE
-Calibration mode allows you to visually adjust the locations of panels. To enter calibration mode, select Tools->Calibration Mode from the menu. The currently selected panel will be bordered in white. Press + or - to move to the next or previous panel (as listed in the geometry file). Use the arrow keys to move the current panel. Press 'f' to hide or restore the white border. Press 's' to save the geometry file with your modifications. Press 'g' to toggle between moving individual panels and rigid groups, if any are defined in the geometry file.
+Calibration mode allows you to visually adjust the locations of panels. To enter calibration mode, select Tools->Calibration Mode from the menu. The currently selected panel will be bordered in white. Press + or - to move to the next or previous panel (as listed in the geometry file). Use the arrow keys to move the current panel. Press 'f' to hide or restore the white border. Press 's' to save the geometry file with your modifications. Press 'g' to toggle between moving individual panels, rigid groups (if any are defined in the geometry file) and moving all panels together.
.SH AUTHOR
This page was written by Thomas White.
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 89ed8cd4..7358edcb 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -230,22 +230,21 @@ static void show_simple_ring(cairo_t *cr, DisplayWindow *dw,
static void maybe_draw_focus(DisplayWindow *dw, cairo_t *cr, int i,
cairo_matrix_t *basic_m)
{
- if ( dw->calib_mode_groups ) {
-
+ if ( dw->calib_mode_groups == 1 ) {
if ( dw->image->det->panels[i].rigid_group
== dw->calib_mode_curr_rg )
{
draw_calib_focus_rectangle(cr, basic_m, dw, i);
cairo_stroke(cr);
}
-
+ } else if ( dw->calib_mode_groups == 2 ) {
+ draw_calib_focus_rectangle(cr, basic_m, dw, i);
+ cairo_stroke(cr);
} else {
-
if ( &dw->image->det->panels[i] == dw->calib_mode_curr_p) {
draw_calib_focus_rectangle(cr, basic_m, dw, i);
cairo_stroke(cr);
}
-
}
}
@@ -1188,6 +1187,8 @@ static gint displaywindow_set_calibmode(GtkWidget *d, DisplayWindow *dw)
dw->calib_mode_curr_p = dw->calib_mode_curr_rg->panels[0];
}
+ dw->calib_mode_groups = 0;
+
dw->calibmode_statusbar = gtk_statusbar_new();
gtk_widget_show(dw->calibmode_statusbar);
vbox = gtk_bin_get_child(GTK_BIN(dw->window));
@@ -2058,48 +2059,64 @@ static gint displaywindow_keypress(GtkWidget *widget, GdkEventKey *event,
case GDK_Up:
case GDK_KP_Up:
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
for ( pi=0; pi<dw->calib_mode_curr_rg->n_panels; ++pi ) {
dw->calib_mode_curr_rg->panels[pi]->cny += 1.0;
}
- } else {
+ } else if ( dw->calib_mode_groups == 0 ) {
dw->calib_mode_curr_p->cny += 1.0;
+ } else {
+ for ( pi=0; pi<dw->image->det->n_panels; ++pi ) {
+ dw->image->det->panels[pi].cny += 1.0;
+ }
}
redraw_window(dw);
break;
case GDK_Down:
case GDK_KP_Down:
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
for ( pi=0; pi<dw->calib_mode_curr_rg->n_panels; ++pi ) {
dw->calib_mode_curr_rg->panels[pi]->cny -= 1.0;
}
- } else {
+ } else if ( dw->calib_mode_groups == 0 ) {
dw->calib_mode_curr_p->cny -= 1.0;
+ } else {
+ for ( pi=0; pi<dw->image->det->n_panels; ++pi ) {
+ dw->image->det->panels[pi].cny -= 1.0;
+ }
}
redraw_window(dw);
break;
case GDK_Left:
case GDK_KP_Left:
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
for ( pi=0; pi<dw->calib_mode_curr_rg->n_panels; ++pi ) {
dw->calib_mode_curr_rg->panels[pi]->cnx -= 1.0;
}
- } else {
+ } else if ( dw->calib_mode_groups == 0 ) {
dw->calib_mode_curr_p->cnx -= 1.0;
+ } else {
+ for ( pi=0; pi<dw->image->det->n_panels; ++pi ) {
+ dw->image->det->panels[pi].cnx -= 1.0;
+ }
}
redraw_window(dw);
break;
case GDK_Right:
case GDK_KP_Right:
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
for ( pi=0; pi<dw->calib_mode_curr_rg->n_panels; ++pi ) {
dw->calib_mode_curr_rg->panels[pi]->cnx += 1.0;
}
+ } else if ( dw->calib_mode_groups == 0 ) {
+ dw->calib_mode_curr_p->cnx += 1.0;
} else {
- dw->calib_mode_curr_p->cnx -= 1.0;
+ for ( pi=0; pi<dw->image->det->n_panels; ++pi ) {
+ dw->image->det->panels[pi].cnx += 1.0;
+ }
}
redraw_window(dw);
break;
@@ -2107,9 +2124,9 @@ static gint displaywindow_keypress(GtkWidget *widget, GdkEventKey *event,
case GDK_plus:
case GDK_KP_Add:
num_p = dw->calib_mode_curr_rg->n_panels;
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
select_next_group(dw, num_rg);
- } else {
+ } else if ( dw->calib_mode_groups == 0 ) {
select_next_panel(dw, num_p);
}
redraw_window(dw);
@@ -2118,9 +2135,9 @@ static gint displaywindow_keypress(GtkWidget *widget, GdkEventKey *event,
case GDK_minus:
case GDK_KP_Subtract:
num_p = dw->calib_mode_curr_rg->n_panels;
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 1 ) {
select_prev_group(dw, num_rg);
- } else {
+ } else if ( dw->calib_mode_groups == 0 ) {
select_prev_panel(dw, num_p);
}
redraw_window(dw);
@@ -2132,12 +2149,18 @@ static gint displaywindow_keypress(GtkWidget *widget, GdkEventKey *event,
break;
case GDK_g:
- if ( dw->calib_mode_groups ) {
+ if ( dw->calib_mode_groups == 0) {
+ if ( dw->image->det->n_rigid_groups == dw->image->det->n_panels ) {
+ dw->calib_mode_groups = 2;
+ } else {
+ dw->calib_mode_groups = 1;
+ dw->calib_mode_curr_rg = dw->calib_mode_curr_p->rigid_group;
+ }
+ } else if ( dw->calib_mode_groups == 1 ) {
+ dw->calib_mode_groups = 2;
+ } else {
dw->calib_mode_groups = 0;
dw->calib_mode_curr_p = dw->calib_mode_curr_rg->panels[0];
- } else {
- dw->calib_mode_groups = 1;
- dw->calib_mode_curr_rg = dw->calib_mode_curr_p->rigid_group;
}
redraw_window(dw);
break;