summaryrefslogtreecommitdiffstats
Side-by-side diff
-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.
Mouse-wheel: scroll to zoom in or out by 10% of the window size with
the focus at the center of the window.
+An attempt was made to use the glutPassiveMotionFunc to show the
+information for the data under the mouse pointer. This proved to be
+too slow so the use of this technique was discarded. The basic
+selection mechanisms can be used to identify the points under the
+mouse. Alternatively a keyboard command might be added to provide the
+information upon a keypress.
+
===
DB2
===
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 = \
db/dbconnect.c \
flumap.c \
model/data/base.c \
+ model/geometry/datarose_geometry.c \
model/geometry/density_legend_geometry.c \
model/geometry/map_geometry.c \
model/geometry/protein_geometry.c \
@@ -60,6 +61,7 @@ noinst_HEADERS = \
db/dbconnect.h \
model/data/base.h \
model/data/coordinates.h \
+ model/geometry/datarose_geometry.h \
model/geometry/density_legend_geometry.h \
model/geometry/map_geometry.h \
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)
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
density_legend_geometry ();
+ datarose_geometry ();
return;
}
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)
char *gi_data_row = S.gi_data + (i * 20);
strncpy (gi_data_row, coordinates.gi.data, sizeof (char) * 20);
+ *(gi_data_row + coordinates.gi.length) = '\0';
float *v = S.base_vertices_data + (i * 2);
*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 @@
+#include "datarose_geometry.h"
+#include "../../util/check_error.h"
+#include "../../view/state0.h"
+#include <GL/glut.h>
+
+#define S state0
+
+void
+datarose_geometry (void)
+{
+ glNewList (S.list_offset + DATAROSE_GEOMETRY, GL_COMPILE);
+ glPolygonMode (GL_FRONT, GL_FILL);
+ glColor4f (DEFAULT_COLOR_R, DEFAULT_COLOR_G, DEFAULT_COLOR_B,
+ DEFAULT_COLOR_A);
+
+ /*
+ * The size of the rose will be a percentage of the world height so
+ * that it remains a fixed size when the window is resized or
+ * zoomed.
+ */
+ GLint viewport[4];
+ glGetIntegerv (GL_VIEWPORT, viewport);
+ const double *top = &S.ortho.max_y;
+ const double *bottom = &S.ortho.min_y;
+ double rose_radius = (*top - *bottom) / viewport[3] * 110.0;
+
+ /*
+ * Place the rose in the upper right of the display.
+ */
+ glMatrixMode (GL_MODELVIEW);
+ glPushMatrix ();
+ glLoadIdentity ();
+ const double *right = &S.ortho.max_x;
+ glTranslatef (*right - rose_radius - (rose_radius * 0.40),
+ *top - rose_radius - (rose_radius * 0.80),
+ 0.0);
+
+ /*
+ * Create a circle.
+ */
+ GLUquadricObj *obj = gluNewQuadric ();
+ gluQuadricDrawStyle (obj, GLU_LINE);
+ gluDisk (obj, rose_radius * 0.999, rose_radius, 60, 60);
+
+ glPopMatrix ();
+
+ glEndList ();
+
+ gluDeleteQuadric (obj);
+
+ check_error (__FILE__, __LINE__);
+
+ return;
+}
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 @@
+#ifndef DATAROSE_GEOMETRY_H
+#define DATAROSE_GEOMETRY_H
+
+/*
+ * DataRose from Elmqvist, N.; Stasko, J. & Tsigas, P. "DataMeadow: a
+ * visual canvas for analysis of large-scale multivariate data",
+ * Information Visualization, Palgrave Macmillan Ltd, 2008, 7, 18-33.
+ */
+void datarose_geometry (void);
+
+#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)
double c[2];
double d[2];
- const double *left;
- const double *right;
- const double *top;
- const double *bottom;
-
- left = &S.ortho.min_x;
- right = &S.ortho.max_x;
- bottom = &S.ortho.min_y;
- top = &S.ortho.max_y;
+ const double *left = &S.ortho.min_x;
+ const double *right = &S.ortho.max_x;
+ const double *top = &S.ortho.max_y;
+ const double *bottom = &S.ortho.min_y;
/*
* 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)
gluQuadricDrawStyle (obj, GLU_FILL);
glNewList (S.list_offset + PROTEIN_GEOMETRY, GL_COMPILE);
- gluSphere (obj, 0.05, 20, 20);
+ gluDisk (obj, 0.0, 0.05, 20, 20);
glEndList ();
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 @@
typedef enum
{ PROTEIN_GEOMETRY, PROTEIN_SELECTED_GEOMETRY, DENSITY_LEGEND_GEOMETRY,
- MAP_GEOMETRY
+ MAP_GEOMETRY, DATAROSE_GEOMETRY
} LISTS;
-#define NUM_LISTS 2
+#define NUM_LISTS 5
/*
* 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)
if (S.legend)
glCallList (S.list_offset + DENSITY_LEGEND_GEOMETRY);
+ glCallList (S.list_offset + DATAROSE_GEOMETRY);
+
return;
}
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 @@
#include "../model/data/base.h"
+#include "../model/geometry/datarose_geometry.h"
#include "../model/geometry/density_legend_geometry.h"
#include "../model/geometry/map_geometry.h"
#include "../model/geometry/protein_geometry.h"
@@ -40,6 +41,7 @@ init (void)
protein_selected_geometry ();
density_legend_geometry ();
map_geometry ();
+ datarose_geometry ();
return;
}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.