aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@bitwiz.org.uk>2011-08-27 06:46:40 -0700
committerThomas White <taw@physics.org>2012-02-22 15:27:43 +0100
commit5a6a14cb592f9d3aa29837a9d7076c1a1277f3b7 (patch)
tree080e4ad772458093d857205d2982e447cec8748d
parent2fef45d7931ce12d78e27cb32f34426559dbdeed (diff)
Add simple circles for alignment
-rw-r--r--src/dw-hdfsee.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/dw-hdfsee.c b/src/dw-hdfsee.c
index 54c73711..bb596bc3 100644
--- a/src/dw-hdfsee.c
+++ b/src/dw-hdfsee.c
@@ -166,6 +166,27 @@ static void show_ring(cairo_t *cr, DisplayWindow *dw,
}
+static void show_simple_ring(cairo_t *cr, DisplayWindow *dw,
+ double d, cairo_matrix_t *basic_m)
+{
+ struct detector *det;
+ int i;
+
+ if ( !dw->use_geom ) return;
+
+ det = dw->image->det;
+
+ cairo_text_extents_t size;
+ cairo_identity_matrix(cr);
+ cairo_translate(cr, -dw->min_x/dw->binning,
+ dw->max_y/dw->binning);
+ cairo_arc(cr, 0.0, 0.0, d / dw->binning, 0.0, 2.0*M_PI);
+ cairo_set_source_rgb(cr, 0.3, 1.0, 0.3);
+ cairo_set_line_width(cr, 1.0/dw->binning);
+ cairo_stroke(cr);
+}
+
+
static int draw_stuff(cairo_surface_t *surf, DisplayWindow *dw)
{
cairo_t *cr;
@@ -210,6 +231,15 @@ static int draw_stuff(cairo_surface_t *surf, DisplayWindow *dw)
cairo_set_source_rgb(cr, 1.0, 0.0, 0.0);
cairo_fill(cr);
+ cairo_rectangle(cr, -370.0, 800.0, 120.0, 60.0);
+ cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, 0.3);
+ cairo_fill(cr);
+
+ show_simple_ring(cr, dw, 186.0, &basic_m);
+ show_simple_ring(cr, dw, 250.0, &basic_m);
+ show_simple_ring(cr, dw, 300.0, &basic_m);
+ show_simple_ring(cr, dw, 380.0, &basic_m);
+
/* Draw resolution circles */
show_ring(cr, dw, 10.0e-10, "10A", &basic_m, 1.0, 0.0, 0.0);
show_ring(cr, dw, 9.0e-10, "9A", &basic_m, 1.0, 0.0, 0.0);