summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--README7
-rw-r--r--src/Makefile.am2
-rw-r--r--src/controller/callbacks/reshape.c1
-rw-r--r--src/model/data/base.sqc1
-rw-r--r--src/model/geometry/datarose_geometry.c54
-rw-r--r--src/model/geometry/datarose_geometry.h11
-rw-r--r--src/model/geometry/density_legend_geometry.c13
-rw-r--r--src/model/geometry/protein_geometry.c2
-rw-r--r--src/model/state/state.h4
-rw-r--r--src/view/geometry.c2
-rw-r--r--src/view/init.c2
11 files changed, 87 insertions, 12 deletions
diff --git a/README b/README
index fa23f39..b03724f 100644
--- a/README
+++ b/README
@@ -20,6 +20,13 @@ used to highlight the selection.
20 Mouse-wheel: scroll to zoom in or out by 10% of the window size with20 Mouse-wheel: scroll to zoom in or out by 10% of the window size with
21 the focus at the center of the window.21 the focus at the center of the window.
2222
23An attempt was made to use the glutPassiveMotionFunc to show the
24information for the data under the mouse pointer. This proved to be
25too slow so the use of this technique was discarded. The basic
26selection mechanisms can be used to identify the points under the
27mouse. Alternatively a keyboard command might be added to provide the
28information upon a keypress.
29
23===30===
24DB231DB2
25===32===
diff --git a/src/Makefile.am b/src/Makefile.am
index d0923a3..82ddc3b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -25,6 +25,7 @@ flumap_SOURCES = \
25 db/dbconnect.c \25 db/dbconnect.c \
26 flumap.c \26 flumap.c \
27 model/data/base.c \27 model/data/base.c \
28 model/geometry/datarose_geometry.c \
28 model/geometry/density_legend_geometry.c \29 model/geometry/density_legend_geometry.c \
29 model/geometry/map_geometry.c \30 model/geometry/map_geometry.c \
30 model/geometry/protein_geometry.c \31 model/geometry/protein_geometry.c \
@@ -60,6 +61,7 @@ noinst_HEADERS = \
60 db/dbconnect.h \61 db/dbconnect.h \
61 model/data/base.h \62 model/data/base.h \
62 model/data/coordinates.h \63 model/data/coordinates.h \
64 model/geometry/datarose_geometry.h \
63 model/geometry/density_legend_geometry.h \65 model/geometry/density_legend_geometry.h \
64 model/geometry/map_geometry.h \66 model/geometry/map_geometry.h \
65 model/geometry/protein_geometry.h \67 model/geometry/protein_geometry.h \
diff --git a/src/controller/callbacks/reshape.c b/src/controller/callbacks/reshape.c
index 0414be6..67210c5 100644
--- a/src/controller/callbacks/reshape.c
+++ b/src/controller/callbacks/reshape.c
@@ -80,6 +80,7 @@ reshape (int w, int h)
80 glViewport (0, 0, (GLsizei) w, (GLsizei) h);80 glViewport (0, 0, (GLsizei) w, (GLsizei) h);
8181
82 density_legend_geometry ();82 density_legend_geometry ();
83 datarose_geometry ();
8384
84 return;85 return;
85}86}
diff --git a/src/model/data/base.sqc b/src/model/data/base.sqc
index f15d18b..41a651c 100644
--- a/src/model/data/base.sqc
+++ b/src/model/data/base.sqc
@@ -71,6 +71,7 @@ base (void)
7171
72 char *gi_data_row = S.gi_data + (i * 20);72 char *gi_data_row = S.gi_data + (i * 20);
73 strncpy (gi_data_row, coordinates.gi.data, sizeof (char) * 20);73 strncpy (gi_data_row, coordinates.gi.data, sizeof (char) * 20);
74 *(gi_data_row + coordinates.gi.length) = '\0';
7475
75 float *v = S.base_vertices_data + (i * 2);76 float *v = S.base_vertices_data + (i * 2);
76 *v = coordinates.x;77 *v = coordinates.x;
diff --git a/src/model/geometry/datarose_geometry.c b/src/model/geometry/datarose_geometry.c
new file mode 100644
index 0000000..dded424
--- a/dev/null
+++ b/src/model/geometry/datarose_geometry.c
@@ -0,0 +1,54 @@
1#include "datarose_geometry.h"
2#include "../../util/check_error.h"
3#include "../../view/state0.h"
4#include <GL/glut.h>
5
6#define S state0
7
8void
9datarose_geometry (void)
10{
11 glNewList (S.list_offset + DATAROSE_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 * The size of the rose will be a percentage of the world height so
18 * that it remains a fixed size when the window is resized or
19 * zoomed.
20 */
21 GLint viewport[4];
22 glGetIntegerv (GL_VIEWPORT, viewport);
23 const double *top = &S.ortho.max_y;
24 const double *bottom = &S.ortho.min_y;
25 double rose_radius = (*top - *bottom) / viewport[3] * 110.0;
26
27 /*
28 * Place the rose in the upper right of the display.
29 */
30 glMatrixMode (GL_MODELVIEW);
31 glPushMatrix ();
32 glLoadIdentity ();
33 const double *right = &S.ortho.max_x;
34 glTranslatef (*right - rose_radius - (rose_radius * 0.40),
35 *top - rose_radius - (rose_radius * 0.80),
36 0.0);
37
38 /*
39 * Create a circle.
40 */
41 GLUquadricObj *obj = gluNewQuadric ();
42 gluQuadricDrawStyle (obj, GLU_LINE);
43 gluDisk (obj, rose_radius * 0.999, rose_radius, 60, 60);
44
45 glPopMatrix ();
46
47 glEndList ();
48
49 gluDeleteQuadric (obj);
50
51 check_error (__FILE__, __LINE__);
52
53 return;
54}
diff --git a/src/model/geometry/datarose_geometry.h b/src/model/geometry/datarose_geometry.h
new file mode 100644
index 0000000..0823064
--- a/dev/null
+++ b/src/model/geometry/datarose_geometry.h
@@ -0,0 +1,11 @@
1#ifndef DATAROSE_GEOMETRY_H
2#define DATAROSE_GEOMETRY_H
3
4/*
5 * DataRose from Elmqvist, N.; Stasko, J. & Tsigas, P. "DataMeadow: a
6 * visual canvas for analysis of large-scale multivariate data",
7 * Information Visualization, Palgrave Macmillan Ltd, 2008, 7, 18-33.
8 */
9void datarose_geometry (void);
10
11#endif // DATAROSE_GEOMETRY_H
diff --git a/src/model/geometry/density_legend_geometry.c b/src/model/geometry/density_legend_geometry.c
index ac3280c..af40e5e 100644
--- a/src/model/geometry/density_legend_geometry.c
+++ b/src/model/geometry/density_legend_geometry.c
@@ -22,15 +22,10 @@ density_legend_geometry (void)
22 double c[2];22 double c[2];
23 double d[2];23 double d[2];
2424
25 const double *left;25 const double *left = &S.ortho.min_x;
26 const double *right;26 const double *right = &S.ortho.max_x;
27 const double *top;27 const double *top = &S.ortho.max_y;
28 const double *bottom;28 const double *bottom = &S.ortho.min_y;
29
30 left = &S.ortho.min_x;
31 right = &S.ortho.max_x;
32 bottom = &S.ortho.min_y;
33 top = &S.ortho.max_y;
3429
35 /*30 /*
36 * This value should be a percentage of the world height so that it31 * This value should be a percentage of the world height so that it
diff --git a/src/model/geometry/protein_geometry.c b/src/model/geometry/protein_geometry.c
index f2b3e4f..bb00ac7 100644
--- a/src/model/geometry/protein_geometry.c
+++ b/src/model/geometry/protein_geometry.c
@@ -14,7 +14,7 @@ protein_geometry (void)
14 gluQuadricDrawStyle (obj, GLU_FILL);14 gluQuadricDrawStyle (obj, GLU_FILL);
1515
16 glNewList (S.list_offset + PROTEIN_GEOMETRY, GL_COMPILE);16 glNewList (S.list_offset + PROTEIN_GEOMETRY, GL_COMPILE);
17 gluSphere (obj, 0.05, 20, 20);17 gluDisk (obj, 0.0, 0.05, 20, 20);
18 glEndList ();18 glEndList ();
1919
20 gluDeleteQuadric (obj);20 gluDeleteQuadric (obj);
diff --git a/src/model/state/state.h b/src/model/state/state.h
index 26141f2..ba6d7ab 100644
--- a/src/model/state/state.h
+++ b/src/model/state/state.h
@@ -26,9 +26,9 @@
2626
27typedef enum27typedef enum
28{ PROTEIN_GEOMETRY, PROTEIN_SELECTED_GEOMETRY, DENSITY_LEGEND_GEOMETRY,28{ PROTEIN_GEOMETRY, PROTEIN_SELECTED_GEOMETRY, DENSITY_LEGEND_GEOMETRY,
29 MAP_GEOMETRY29 MAP_GEOMETRY, DATAROSE_GEOMETRY
30} LISTS;30} LISTS;
31#define NUM_LISTS 231#define NUM_LISTS 5
3232
33/*33/*
34 * Maintain state of the model.34 * Maintain state of the model.
diff --git a/src/view/geometry.c b/src/view/geometry.c
index f8bd8e6..fc09ee0 100644
--- a/src/view/geometry.c
+++ b/src/view/geometry.c
@@ -30,5 +30,7 @@ geometry (GLenum mode)
30 if (S.legend)30 if (S.legend)
31 glCallList (S.list_offset + DENSITY_LEGEND_GEOMETRY);31 glCallList (S.list_offset + DENSITY_LEGEND_GEOMETRY);
3232
33 glCallList (S.list_offset + DATAROSE_GEOMETRY);
34
33 return;35 return;
34}36}
diff --git a/src/view/init.c b/src/view/init.c
index 1c06c7e..47e8ffa 100644
--- a/src/view/init.c
+++ b/src/view/init.c
@@ -1,4 +1,5 @@
1#include "../model/data/base.h"1#include "../model/data/base.h"
2#include "../model/geometry/datarose_geometry.h"
2#include "../model/geometry/density_legend_geometry.h"3#include "../model/geometry/density_legend_geometry.h"
3#include "../model/geometry/map_geometry.h"4#include "../model/geometry/map_geometry.h"
4#include "../model/geometry/protein_geometry.h"5#include "../model/geometry/protein_geometry.h"
@@ -40,6 +41,7 @@ init (void)
40 protein_selected_geometry ();41 protein_selected_geometry ();
41 density_legend_geometry ();42 density_legend_geometry ();
42 map_geometry ();43 map_geometry ();
44 datarose_geometry ();
4345
44 return;46 return;
45}47}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.