author | Don Pellegrino <don@drexel.edu> | 2009-06-18 21:14:45 (GMT) |
---|---|---|
committer | Don Pellegrino <don@drexel.edu> | 2009-06-18 21:14:45 (GMT) |
commit | 6600093d06fc302a13ffdde193dbe4b8da151d9c (patch) (side-by-side diff) | |
tree | 1c73d1ef940be17e434be96a8732cece14f8ccc9 | |
parent | 76ad23bc0d04c3d854e1d558545c44576fdce348 (diff) | |
download | exp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.zip exp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.tar.gz exp005-6600093d06fc302a13ffdde193dbe4b8da151d9c.tar.bz2 |
Implemented zooming.
-rw-r--r-- | src/controller/keyboard.c | 25 |
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 @@ #include "keyboard.h" #include "clear_selection.h" #include "selection_from_db.h" +#include "exp004reshape.h" #include "../view/exp004state0.h" +#include <GL/glut.h> #define S exp004state0 @@ -26,14 +28,27 @@ keyboard (unsigned char key, int x, int y) selection_from_db (); break; + case 'r': + /* + * Reset the view (unzoom). + */ + S.zoom.active = false; + exp004reshape (S.viewport.w, S.viewport.h); + glutPostRedisplay (); + break; + + case 's': + /* + * Selection will be used to define a set. + */ + S.selection.purpose = SET; + break; + case 'z': /* - * Toggle zoom mode on and off. + * Selection will be use to zoom. */ - if (S.zoom) - S.zoom = false; - else - S.zoom = true; + S.selection.purpose = ZOOM; break; } |