summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--README21
-rw-r--r--TODO3
-rw-r--r--src/Makefile.am27
-rw-r--r--src/controller/actions/pan.c57
-rw-r--r--src/controller/actions/pan.h2
-rw-r--r--src/controller/actions/sel_save.c2
-rw-r--r--src/controller/callbacks/keyboard.c2
-rw-r--r--src/controller/callbacks/mouse.c30
-rw-r--r--src/controller/callbacks/mouse_motion.c19
-rw-r--r--src/controller/callbacks/mouse_motion.h9
-rw-r--r--src/model/base.c417
-rw-r--r--src/model/base.h9
-rw-r--r--src/model/coordinates.h11
-rw-r--r--src/model/data/base.sqc (renamed from src/model/base.sqc)6
-rw-r--r--src/model/selection_info.h37
-rw-r--r--src/model/selection_info_init.c14
-rw-r--r--src/model/selection_info_init.h8
-rw-r--r--src/model/selection_purposes.h17
-rw-r--r--src/model/state/pan_info_init.h8
-rw-r--r--src/model/state/state.h (renamed from src/model/state.h)3
-rw-r--r--src/model/state/zoom_info.h (renamed from src/model/zoom_info.h)0
-rw-r--r--src/model/state/zoom_info_init.c (renamed from src/model/zoom_info_init.c)0
-rw-r--r--src/model/state/zoom_info_init.h (renamed from src/model/zoom_info_init.h)0
-rw-r--r--src/view/geometry.c8
-rw-r--r--src/view/init.c12
-rw-r--r--src/view/state0.h2
-rw-r--r--src/view/view.c4
27 files changed, 179 insertions, 549 deletions
diff --git a/src/controller/actions/pan.c b/src/controller/actions/pan.c
index cdc5cad..2f856b0 100644
--- a/src/controller/actions/pan.c
+++ b/src/controller/actions/pan.c
@@ -1,8 +1,61 @@
1#include "pan.h"1#include "pan.h"
2#include "../../util/check_error.h"
3#include "../../view/state0.h"
4#include <GL/glut.h>
5
6#define S state0
27
3void8void
4pan ()9pan (int x1, int y1, int x2, int y2)
5{10{
611 int dx = x1 - x2;
12 int dy = y1 - x2;
13
14 if (dx == 0 && dy == 0)
15 return;
16
17 /*
18 * Convert the selection boundary from window coordinates to
19 * world coordinates.
20 */
21 glMatrixMode (GL_MODELVIEW);
22 glLoadIdentity ();
23 GLdouble model[16];
24 glGetDoublev (GL_MODELVIEW_MATRIX, model);
25 GLdouble projection[16];
26 glGetDoublev (GL_PROJECTION_MATRIX, projection);
27 GLint viewport[4];
28 glGetIntegerv (GL_VIEWPORT, viewport);
29
30 check_error (__FILE__, __LINE__);
31
32 GLdouble start_position[3];
33 gluUnProject (x1,
34 y1,
35 0,
36 model,
37 projection,
38 viewport,
39 &start_position[0],
40 &start_position[1], &start_position[2]);
41
42 check_error (__FILE__, __LINE__);
43
44 GLdouble end_position[3];
45 gluUnProject (x2,
46 y2,
47 0,
48 model,
49 projection,
50 viewport,
51 &end_position[0], &end_position[1], &end_position[2]);
52
53 check_error (__FILE__, __LINE__);
54
55 S.pan.trans[0] += end_position[0] - start_position[0];
56 S.pan.trans[1] -= end_position[1] - start_position[1];
57
58 glutPostRedisplay ();
59
7 return;60 return;
8}61}

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.