summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@drexel.edu>2009-06-18 21:14:45 (GMT)
committer Don Pellegrino <don@drexel.edu>2009-06-18 21:14:45 (GMT)
commit6600093d06fc302a13ffdde193dbe4b8da151d9c (patch) (unidiff)
tree1c73d1ef940be17e434be96a8732cece14f8ccc9
parent76ad23bc0d04c3d854e1d558545c44576fdce348 (diff)
downloadexp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.zip
exp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.tar.gz
exp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.tar.bz2
Implemented zooming.
-rw-r--r--src/controller/keyboard.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/controller/keyboard.c b/src/controller/keyboard.c
index 333e2d4..6b70af2 100644
--- a/src/controller/keyboard.c
+++ b/src/controller/keyboard.c
@@ -1,7 +1,9 @@
1#include "keyboard.h"1#include "keyboard.h"
2#include "clear_selection.h"2#include "clear_selection.h"
3#include "selection_from_db.h"3#include "selection_from_db.h"
4#include "exp004reshape.h"
4#include "../view/exp004state0.h"5#include "../view/exp004state0.h"
6#include <GL/glut.h>
57
6#define S exp004state08#define S exp004state0
79
@@ -26,14 +28,27 @@ keyboard (unsigned char key, int x, int y)
26 selection_from_db ();28 selection_from_db ();
27 break;29 break;
2830
31 case 'r':
32 /*
33 * Reset the view (unzoom).
34 */
35 S.zoom.active = false;
36 exp004reshape (S.viewport.w, S.viewport.h);
37 glutPostRedisplay ();
38 break;
39
40 case 's':
41 /*
42 * Selection will be used to define a set.
43 */
44 S.selection.purpose = SET;
45 break;
46
29 case 'z':47 case 'z':
30 /*48 /*
31 * Toggle zoom mode on and off.49 * Selection will be use to zoom.
32 */50 */
33 if (S.zoom)51 S.selection.purpose = ZOOM;
34 S.zoom = false;
35 else
36 S.zoom = true;
37 break;52 break;
38 }53 }
3954

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.