summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-07-23 18:09:48 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-07-23 18:09:48 (GMT)
commitfa2a426396c9031a5379c746a665c3a5dd4af8e4 (patch) (unidiff)
treeb38f66170f94ea4dfca9ec79a34ecdaa1df9bdc5
parentefa3b2de485334aaa41da0ac25fc03f6c58f548a (diff)
downloadexp005-fa2a426396c9031a5379c746a665c3a5dd4af8e4.zip
exp005-fa2a426396c9031a5379c746a665c3a5dd4af8e4.tar.gz
exp005-fa2a426396c9031a5379c746a665c3a5dd4af8e4.tar.bz2
Moved model geometry into a subdirectory of model. Modified highlight
for selection to draw a yello circle around the selected proteins rather than change their fill color to black. This preserves the fill color of selected items.
-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/Makefile.am b/src/Makefile.am
index 6e20122..38626c7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -12,10 +12,11 @@ exp004viz_SOURCES = \
12 controller/set_ortho.c \12 controller/set_ortho.c \
13 db/dbconnect.c \13 db/dbconnect.c \
14 exp004viz.c \14 exp004viz.c \
15 model/density_legend_geometry.c \
16 model/exp004base.c \15 model/exp004base.c \
17 model/map_geometry.c \16 model/geometry/density_legend_geometry.c \
18 model/protein_geometry.c \17 model/geometry/map_geometry.c \
18 model/geometry/protein_geometry.c \
19 model/geometry/protein_selected_geometry.c \
19 model/selection_info_init.c \20 model/selection_info_init.c \
20 model/zoom_info_init.c \21 model/zoom_info_init.c \
21 util/ati_meminfo.c \22 util/ati_meminfo.c \
@@ -39,11 +40,12 @@ noinst_HEADERS = \
39 controller/selsave.h \40 controller/selsave.h \
40 controller/set_ortho.h \41 controller/set_ortho.h \
41 db/dbconnect.h \42 db/dbconnect.h \
42 model/density_legend_geometry.h \
43 model/exp004base.h \43 model/exp004base.h \
44 model/exp004state.h \44 model/exp004state.h \
45 model/map_geometry.h \45 model/geometry/density_legend_geometry.h \
46 model/protein_geometry.h \46 model/geometry/protein_geometry.h \
47 model/geometry/protein_selected_geometry.h \
48 model/geometry/map_geometry.h \
47 model/selection_info.h \49 model/selection_info.h \
48 model/selection_info_init.h \50 model/selection_info_init.h \
49 model/selection_purposes.h \51 model/selection_purposes.h \
diff --git a/src/controller/clear_selection.sqc b/src/controller/clear_selection.sqc
index ec98b4c..b4ff0a3 100644
--- a/src/controller/clear_selection.sqc
+++ b/src/controller/clear_selection.sqc
@@ -1,6 +1,6 @@
1#define GL_GLEXT_PROTOTYPES1#define GL_GLEXT_PROTOTYPES
2#include "clear_selection.h"2#include "clear_selection.h"
3#include "../model/map_geometry.h"3#include "../model/geometry/map_geometry.h"
4#include "../view/exp004state0.h"4#include "../view/exp004state0.h"
5#include <GL/glut.h>5#include <GL/glut.h>
6#include "sqlca.h"6#include "sqlca.h"
diff --git a/src/controller/exp004processhits.c b/src/controller/exp004processhits.c
index 72daa2f..c9ae080 100644
--- a/src/controller/exp004processhits.c
+++ b/src/controller/exp004processhits.c
@@ -1,6 +1,6 @@
1#define GL_GLEXT_PROTOTYPES1#define GL_GLEXT_PROTOTYPES
2#include "../view/exp004state0.h"2#include "../view/exp004state0.h"
3#include "../model/map_geometry.h"3#include "../model/geometry/map_geometry.h"
4#include "exp004processhits.h"4#include "exp004processhits.h"
5#include "selsave.h"5#include "selsave.h"
66
@@ -14,7 +14,7 @@
14 * [Angel,2008,pp80-81].14 * [Angel,2008,pp80-81].
15 */15 */
16void16void
17exp004processhits (const GLint hits, const GLuint* hitlist)17exp004processhits (const GLint hits, const GLuint * hitlist)
18{18{
19 for (unsigned int i = 0; i < hits; i++)19 for (unsigned int i = 0; i < hits; i++)
20 {20 {
@@ -24,10 +24,12 @@ exp004processhits (const GLint hits, const GLuint* hitlist)
24 * Add the hits to the selection.24 * Add the hits to the selection.
25 */25 */
26 S.selection.set[*hitlist] = true;26 S.selection.set[*hitlist] = true;
27 /*
27 S.base_colors_data[*hitlist][0] = SELECT_COLOR_R;28 S.base_colors_data[*hitlist][0] = SELECT_COLOR_R;
28 S.base_colors_data[*hitlist][1] = SELECT_COLOR_G;29 S.base_colors_data[*hitlist][1] = SELECT_COLOR_G;
29 S.base_colors_data[*hitlist][2] = SELECT_COLOR_B;30 S.base_colors_data[*hitlist][2] = SELECT_COLOR_B;
30 S.base_colors_data[*hitlist][3] = SELECT_COLOR_A;31 S.base_colors_data[*hitlist][3] = SELECT_COLOR_A;
32 */
3133
32 hitlist++;34 hitlist++;
33 }35 }
diff --git a/src/controller/exp004processhits.h b/src/controller/exp004processhits.h
index b0e088a..0cc9e4b 100644
--- a/src/controller/exp004processhits.h
+++ b/src/controller/exp004processhits.h
@@ -3,6 +3,6 @@
33
4#include <GL/glut.h>4#include <GL/glut.h>
55
6void exp004processhits (const GLint hits, const GLuint *hitlist);6void exp004processhits (const GLint hits, const GLuint * hitlist);
77
8#endif // EXP004PROCESSHITS_H8#endif // EXP004PROCESSHITS_H
diff --git a/src/controller/exp004reshape.c b/src/controller/exp004reshape.c
index 891de08..a127e46 100644
--- a/src/controller/exp004reshape.c
+++ b/src/controller/exp004reshape.c
@@ -1,7 +1,7 @@
1#include "exp004reshape.h"1#include "exp004reshape.h"
2#include "set_ortho.h"2#include "set_ortho.h"
3#include "../view/exp004state0.h"3#include "../view/exp004state0.h"
4#include "../model/density_legend_geometry.h"4#include "../model/geometry/density_legend_geometry.h"
5#include <GL/glut.h>5#include <GL/glut.h>
66
7#define S exp004state07#define S exp004state0
diff --git a/src/controller/selection_from_db.sqc b/src/controller/selection_from_db.sqc
index 3bde460..755c9c9 100644
--- a/src/controller/selection_from_db.sqc
+++ b/src/controller/selection_from_db.sqc
@@ -1,6 +1,6 @@
1#define GL_GLEXT_PROTOTYPES1#define GL_GLEXT_PROTOTYPES
2#include "selection_from_db.h"2#include "selection_from_db.h"
3#include "../model/map_geometry.h"3#include "../model/geometry/map_geometry.h"
4#include "../view/exp004state0.h"4#include "../view/exp004state0.h"
5#include "../util/check_error.h"5#include "../util/check_error.h"
6#include <GL/glut.h>6#include <GL/glut.h>
diff --git a/src/model/exp004state.h b/src/model/exp004state.h
index 6f9aad7..f6e99c0 100644
--- a/src/model/exp004state.h
+++ b/src/model/exp004state.h
@@ -24,7 +24,8 @@
24#define SELECT_COLOR_A 0.7524#define SELECT_COLOR_A 0.75
2525
26typedef enum26typedef enum
27{ PROTEIN_GEOMETRY, DENSITY_LEGEND_GEOMETRY, MAP_GEOMETRY } LISTS;27{ PROTEIN_GEOMETRY, PROTEIN_SELECTED_GEOMETRY, DENSITY_LEGEND_GEOMETRY,
28 MAP_GEOMETRY } LISTS;
28#define NUM_LISTS 229#define NUM_LISTS 2
2930
30/*31/*
diff --git a/src/model/density_legend_geometry.c b/src/model/geometry/density_legend_geometry.c
index 7e30de8..83f34d9 100644
--- a/src/model/density_legend_geometry.c
+++ b/src/model/geometry/density_legend_geometry.c
@@ -1,6 +1,6 @@
1#include "density_legend_geometry.h"1#include "density_legend_geometry.h"
2#include "../view/exp004state0.h"2#include "../../view/exp004state0.h"
3#include "../controller/exp004reshape.h"3#include "../../controller/exp004reshape.h"
4#include <GL/glut.h>4#include <GL/glut.h>
55
6#define S exp004state06#define S exp004state0
diff --git a/src/model/density_legend_geometry.h b/src/model/geometry/density_legend_geometry.h
index 4745ac0..4745ac0 100644
--- a/src/model/density_legend_geometry.h
+++ b/src/model/geometry/density_legend_geometry.h
diff --git a/src/model/geometry/map_geometry.c b/src/model/geometry/map_geometry.c
new file mode 100644
index 0000000..63e409d
--- a/dev/null
+++ b/src/model/geometry/map_geometry.c
@@ -0,0 +1,40 @@
1#include "map_geometry.h"
2#include "../../view/exp004state0.h"
3#include <GL/glut.h>
4
5#define S exp004state0
6
7void
8map_geometry (void)
9{
10 glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
11 glPolygonMode (GL_FRONT, GL_FILL);
12
13 for (int i = 0; i < ROWS; i++)
14 {
15 glLoadName (i);
16
17 // Draw the protein geometry.
18 glPushMatrix ();
19 glTranslatef (S.base_vertices_data[i][0],
20 S.base_vertices_data[i][1], 0.0);
21 glColor4fv (S.base_colors_data[i]);
22 glCallList (S.list_offset + PROTEIN_GEOMETRY);
23 glPopMatrix ();
24
25 // If the object is selected, draw the selection geometry.
26 if (S.selection.set[i])
27 {
28 glPushMatrix ();
29 glTranslatef (S.base_vertices_data[i][0],
30 S.base_vertices_data[i][1], 0.0);
31 glColor4f (0.5, 0.5, 0.5, 1.0);
32 glCallList (S.list_offset + PROTEIN_SELECTED_GEOMETRY);
33 glPopMatrix ();
34 }
35 }
36
37 glEndList ();
38
39 return;
40}
diff --git a/src/model/map_geometry.h b/src/model/geometry/map_geometry.h
index f5b6701..f5b6701 100644
--- a/src/model/map_geometry.h
+++ b/src/model/geometry/map_geometry.h
diff --git a/src/model/protein_geometry.c b/src/model/geometry/protein_geometry.c
index dc71a4e..30a4350 100644
--- a/src/model/protein_geometry.c
+++ b/src/model/geometry/protein_geometry.c
@@ -1,5 +1,5 @@
1#include "protein_geometry.h"1#include "protein_geometry.h"
2#include "../view/exp004state0.h"2#include "../../view/exp004state0.h"
3#include <GL/glut.h>3#include <GL/glut.h>
44
5#define S exp004state05#define S exp004state0
diff --git a/src/model/protein_geometry.h b/src/model/geometry/protein_geometry.h
index e9ac0db..e9ac0db 100644
--- a/src/model/protein_geometry.h
+++ b/src/model/geometry/protein_geometry.h
diff --git a/src/model/geometry/protein_selected_geometry.c b/src/model/geometry/protein_selected_geometry.c
new file mode 100644
index 0000000..fb37085
--- a/dev/null
+++ b/src/model/geometry/protein_selected_geometry.c
@@ -0,0 +1,30 @@
1#include "protein_selected_geometry.h"
2#include "../../view/exp004state0.h"
3#include <GL/glut.h>
4
5#define S exp004state0
6
7void
8protein_selected_geometry (void)
9{
10 GLUquadricObj *obj = gluNewQuadric ();
11 gluQuadricDrawStyle (obj, GLU_FILL);
12
13 glNewList (S.list_offset + PROTEIN_SELECTED_GEOMETRY, GL_COMPILE);
14
15 glColor4f (255.0, 255.0, 0.0, 0.8);
16
17 /*
18 * The radius of this disk is relative to the radius of the sphere
19 * used for the protein geometry however this dependency is not captured
20 * in the code. Perhaps a variable radius for the proteins should be
21 * defined in the state object.
22 */
23 gluDisk (obj, 0.04, 0.05, 20, 20);
24
25 glEndList ();
26
27 gluDeleteQuadric (obj);
28
29 return;
30}
diff --git a/src/model/geometry/protein_selected_geometry.h b/src/model/geometry/protein_selected_geometry.h
new file mode 100644
index 0000000..16cf956
--- a/dev/null
+++ b/src/model/geometry/protein_selected_geometry.h
@@ -0,0 +1,9 @@
1#ifndef PROTEIN_SELECTED_GEOMETRY_H
2#define PROTEIN_SELECTED_GEOMETRY_H
3
4/*
5 * Geometry to use for proteins in the active selection.
6 */
7void protein_selected_geometry (void);
8
9#endif // PROTEIN_SELECTED_GEOMETRY_H
diff --git a/src/model/map_geometry.c b/src/model/map_geometry.c
deleted file mode 100644
index 055eb83..0000000
--- a/src/model/map_geometry.c
+++ b/dev/null
@@ -1,27 +0,0 @@
1#include "map_geometry.h"
2#include "../view/exp004state0.h"
3#include <GL/glut.h>
4
5#define S exp004state0
6
7void
8map_geometry (void)
9{
10 glNewList (S.list_offset + MAP_GEOMETRY, GL_COMPILE);
11 glPolygonMode (GL_FRONT, GL_FILL);
12
13 for (int i = 0; i < ROWS; i++)
14 {
15 glLoadName (i);
16 glPushMatrix ();
17 glTranslatef (S.base_vertices_data[i][0],
18 S.base_vertices_data[i][1], 0.0);
19 glColor4fv (S.base_colors_data[i]);
20 glCallList (S.list_offset + PROTEIN_GEOMETRY);
21 glPopMatrix ();
22 }
23
24 glEndList ();
25
26 return;
27}
diff --git a/src/model/selection_info_init.c b/src/model/selection_info_init.c
index aea2b07..33b3bb5 100644
--- a/src/model/selection_info_init.c
+++ b/src/model/selection_info_init.c
@@ -3,7 +3,7 @@
33
4void4void
5selection_info_init (SELECTION_INFO * s)5selection_info_init (SELECTION_INFO * s)
6{ 6{
7 memset (s->set, 0, sizeof (bool) * ROWS);7 memset (s->set, 0, sizeof (bool) * ROWS);
8 s->active = false;8 s->active = false;
9 s->purpose = SET;9 s->purpose = SET;
diff --git a/src/view/exp004init.c b/src/view/exp004init.c
index 78311e6..30d8d96 100644
--- a/src/view/exp004init.c
+++ b/src/view/exp004init.c
@@ -1,8 +1,9 @@
1#include "exp004init.h"1#include "exp004init.h"
2#include "exp004state0.h"2#include "exp004state0.h"
3#include "../model/density_legend_geometry.h"3#include "../model/geometry/density_legend_geometry.h"
4#include "../model/map_geometry.h"4#include "../model/geometry/map_geometry.h"
5#include "../model/protein_geometry.h"5#include "../model/geometry/protein_geometry.h"
6#include "../model/geometry/protein_selected_geometry.h"
6#include "../model/selection_info_init.h"7#include "../model/selection_info_init.h"
7#include "../model/zoom_info_init.h"8#include "../model/zoom_info_init.h"
8#include <GL/glut.h>9#include <GL/glut.h>
@@ -18,6 +19,7 @@ exp004init (void)
1819
19 S.list_offset = glGenLists (NUM_LISTS);20 S.list_offset = glGenLists (NUM_LISTS);
20 protein_geometry ();21 protein_geometry ();
22 protein_selected_geometry ();
21 density_legend_geometry ();23 density_legend_geometry ();
22 map_geometry ();24 map_geometry ();
2325

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.