summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-06-18 21:14:58 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-06-18 21:14:58 (GMT)
commit4b6435015ab3185eb9d751c3bb2e43c10e9ccf22 (patch) (unidiff)
tree99dab6b9ecfa4496c58f895b5f78b395421bbd4d
parent6600093d06fc302a13ffdde193dbe4b8da151d9c (diff)
downloadexp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.zip
exp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.tar.gz
exp005-4b6435015ab3185eb9d751c3bb2e43c10e9ccf22.tar.bz2
Implemented zooming.
-rw-r--r--src/controller/selection_from_db.sqc20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/controller/selection_from_db.sqc b/src/controller/selection_from_db.sqc
index 9467ab3..8a49510 100644
--- a/src/controller/selection_from_db.sqc
+++ b/src/controller/selection_from_db.sqc
@@ -1,9 +1,10 @@
1#define GL_GLEXT_PROTOTYPES1#define GL_GLEXT_PROTOTYPES
2#include "selection_from_db.h"2#include "selection_from_db.h"
3#include "../view/exp004state0.h"3#include "../view/exp004state0.h"
4#include "../util/check_error.h"
4#include <GL/glut.h>5#include <GL/glut.h>
56#include "sqlca.h"
6EXEC SQL INCLUDE sqlca;7extern struct sqlca sqlca;
78
8/*9/*
9 * A simple alias to make the code more readable.10 * A simple alias to make the code more readable.
@@ -25,6 +26,7 @@ selection_from_db (void)
25 ORDER BY title, id DESC;26 ORDER BY title, id DESC;
2627
27 EXEC SQL OPEN c3;28 EXEC SQL OPEN c3;
29 check_error (__FILE__, __LINE__);
28 30
29 /*31 /*
30 * This loop currently assumes only one set in the table and does32 * This loop currently assumes only one set in the table and does
@@ -34,18 +36,22 @@ selection_from_db (void)
34 EXEC SQL FETCH c3 INTO :vis_sel_set;36 EXEC SQL FETCH c3 INTO :vis_sel_set;
35 while (sqlca.sqlcode != 100)37 while (sqlca.sqlcode != 100)
36 {38 {
37 S.selection[vis_sel_set.id] = true;39 int i = vis_sel_set.id - 1;
38 S.base_colors_data[vis_sel_set.id][0] = vis_sel_set.r;40
39 S.base_colors_data[vis_sel_set.id][1] = vis_sel_set.g;41 S.selection.set[i] = true;
40 S.base_colors_data[vis_sel_set.id][2] = vis_sel_set.b;42 S.base_colors_data[i][0] = vis_sel_set.r;
41 S.base_colors_data[vis_sel_set.id][3] = 0.6;43 S.base_colors_data[i][1] = vis_sel_set.g;
44 S.base_colors_data[i][2] = vis_sel_set.b;
45 S.base_colors_data[i][3] = 0.6;
4246
43 EXEC SQL FETCH c3 INTO :vis_sel_set;47 EXEC SQL FETCH c3 INTO :vis_sel_set;
44 }48 }
4549
46 EXEC SQL CLOSE c3;50 EXEC SQL CLOSE c3;
51 check_error (__FILE__, __LINE__);
4752
48 EXEC SQL COMMIT;53 EXEC SQL COMMIT;
54 check_error (__FILE__, __LINE__);
4955
50 /*56 /*
51 * Update the graphics memory.57 * Update the graphics memory.

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.