summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--src/Makefile.am14
-rw-r--r--src/controller/clear_selection.sqc2
-rw-r--r--src/controller/exp004processhits.c6
-rw-r--r--src/controller/exp004processhits.h2
-rw-r--r--src/controller/exp004reshape.c2
-rw-r--r--src/controller/selection_from_db.sqc2
-rw-r--r--src/model/exp004state.h3
-rw-r--r--src/model/geometry/density_legend_geometry.c (renamed from src/model/density_legend_geometry.c)4
-rw-r--r--src/model/geometry/density_legend_geometry.h (renamed from src/model/density_legend_geometry.h)0
-rw-r--r--src/model/geometry/map_geometry.c40
-rw-r--r--src/model/geometry/map_geometry.h (renamed from src/model/map_geometry.h)0
-rw-r--r--src/model/geometry/protein_geometry.c (renamed from src/model/protein_geometry.c)2
-rw-r--r--src/model/geometry/protein_geometry.h (renamed from src/model/protein_geometry.h)0
-rw-r--r--src/model/geometry/protein_selected_geometry.c30
-rw-r--r--src/model/geometry/protein_selected_geometry.h9
-rw-r--r--src/model/map_geometry.c27
-rw-r--r--src/model/selection_info_init.c2
-rw-r--r--src/view/exp004init.c8
18 files changed, 106 insertions, 47 deletions
diff --git a/src/model/geometry/density_legend_geometry.c b/src/model/geometry/density_legend_geometry.c
new file mode 100644
index 0000000..83f34d9
--- a/dev/null
+++ b/src/model/geometry/density_legend_geometry.c
@@ -0,0 +1,83 @@
1#include "density_legend_geometry.h"
2#include "../../view/exp004state0.h"
3#include "../../controller/exp004reshape.h"
4#include <GL/glut.h>
5
6#define S exp004state0
7
8void
9density_legend_geometry (void)
10{
11 glNewList (S.list_offset + DENSITY_LEGEND_GEOMETRY, GL_COMPILE);
12 glPolygonMode (GL_FRONT, GL_FILL);
13 glColor4f (DEFAULT_COLOR_R, DEFAULT_COLOR_G, DEFAULT_COLOR_B,
14 DEFAULT_COLOR_A);
15
16 /*
17 * Calculate the bounding box for the legend.
18 */
19
20 double a[2];
21 double b[2];
22 double c[2];
23 double d[2];
24
25 const double *left;
26 const double *right;
27 const double *top;
28 const double *bottom;
29
30 if (S.zoom.active)
31 {
32 left = &S.zoom.coords[0];
33 right = &S.zoom.coords[1];
34 bottom = &S.zoom.coords[2];
35 top = &S.zoom.coords[3];
36 }
37 else
38 {
39 left = &S.ortho.min_x;
40 right = &S.ortho.max_x;
41 bottom = &S.ortho.min_y;
42 top = &S.ortho.max_y;
43 }
44
45 /*
46 * This value should be a percentage of the world height so that it
47 * remains a fixed number of pixels tall when the window is resized
48 * or zoomed.
49 */
50 double legend_height = (*top - *bottom) / S.viewport.h * 10.0;
51
52 a[0] = *left;
53 a[1] = *top;
54 b[0] = *right;
55 b[1] = *top;
56 c[0] = *right;
57 c[1] = *top - legend_height;
58 d[0] = *left;
59 d[1] = *top - legend_height;
60
61 /*
62 * Overlay a legend from default saturation / alpha to full saturation.
63 */
64 for (int i = 1; i <= 1 / DEFAULT_COLOR_A; i++)
65 {
66 glBegin (GL_QUADS);
67 glVertex2dv (a);
68 glVertex2dv (b);
69 glVertex2dv (c);
70 glVertex2dv (d);
71 glEnd ();
72
73 /*
74 * Step left to right along the x-coordinate.
75 */
76 a[0] = *left + (*right - *left) * (DEFAULT_COLOR_A * i);
77 d[0] = a[0];
78 }
79
80 glEndList ();
81
82 return;
83}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.