-rw-r--r-- | Makefile.am | 10 | ||||
-rw-r--r-- | r/connect.R | 16 | ||||
-rw-r--r-- | src/controller/exp004mouse.c | 51 | ||||
-rw-r--r-- | src/controller/exp004processhits.c | 16 | ||||
-rw-r--r-- | src/controller/exp004reshape.c | 26 | ||||
-rw-r--r-- | src/controller/keyboard.c | 2 | ||||
-rw-r--r-- | src/controller/selection_from_db.sqc | 9 | ||||
-rw-r--r-- | src/controller/selsave.sqc | 4 | ||||
-rw-r--r-- | src/controller/set_ortho.c | 11 | ||||
-rw-r--r-- | src/controller/vis_sel_set.h | 3 | ||||
-rw-r--r-- | src/model/coordinates.h | 3 | ||||
-rw-r--r-- | src/model/exp004base.sqc | 30 | ||||
-rw-r--r-- | src/model/exp004state.h | 30 | ||||
-rw-r--r-- | src/model/selection_info.h | 11 | ||||
-rw-r--r-- | src/model/selection_info_init.c | 2 | ||||
-rw-r--r-- | src/model/selection_info_init.h | 2 | ||||
-rw-r--r-- | src/model/selection_purposes.h | 22 | ||||
-rw-r--r-- | src/model/zoom_info.h | 5 | ||||
-rw-r--r-- | src/model/zoom_info_init.c | 2 | ||||
-rw-r--r-- | src/model/zoom_info_init.h | 2 | ||||
-rw-r--r-- | src/util/pick_convert.c | 7 | ||||
-rw-r--r-- | src/util/sqlinfoprint.c | 2 | ||||
-rw-r--r-- | src/util/sqlinfoprint.h | 7 | ||||
-rw-r--r-- | src/view/exp004geometry.c | 6 | ||||
-rw-r--r-- | src/view/exp004view.c | 7 |
25 files changed, 140 insertions, 146 deletions
diff --git a/src/controller/exp004mouse.c b/src/controller/exp004mouse.c index fb753d6..9a556ae 100644 --- a/src/controller/exp004mouse.c +++ b/src/controller/exp004mouse.c @@ -37,13 +37,13 @@ exp004mouse (int button, int state, int x, int y) GLdouble model[16]; glGetDoublev (GL_MODELVIEW_MATRIX, model); GLdouble projection[16]; - glGetDoublev (GL_PROJECTION_MATRIX, projection); + glGetDoublev (GL_PROJECTION_MATRIX, projection); GLint viewport[4]; glGetIntegerv (GL_VIEWPORT, viewport); check_error (__FILE__, __LINE__); - GLdouble start_position[3]; + GLdouble start_position[3]; gluUnProject (S.selection.x, viewport[3] - S.selection.y, 0, @@ -51,8 +51,7 @@ exp004mouse (int button, int state, int x, int y) projection, viewport, &start_position[0], - &start_position[1], - &start_position[2]); + &start_position[1], &start_position[2]); check_error (__FILE__, __LINE__); @@ -63,12 +62,10 @@ exp004mouse (int button, int state, int x, int y) model, projection, viewport, - &end_position[0], - &end_position[1], - &end_position[2]); + &end_position[0], &end_position[1], &end_position[2]); + + check_error (__FILE__, __LINE__); - check_error (__FILE__, __LINE__); - S.zoom.active = true; S.zoom.coords[0] = fmin (start_position[0], end_position[0]); S.zoom.coords[1] = fmax (start_position[0], end_position[0]); @@ -76,7 +73,7 @@ exp004mouse (int button, int state, int x, int y) S.zoom.coords[3] = fmax (start_position[1], end_position[1]); exp004reshape (S.viewport.w, S.viewport.h); - + glutPostRedisplay (); } @@ -85,27 +82,27 @@ exp004mouse (int button, int state, int x, int y) */ if (S.selection.active && S.selection.purpose == SET) { - + /* * "Specify the array to be used for the returned hit records * with glSelectBuffer () [Redbook]." */ GLuint select_buf[ROWS]; glSelectBuffer (ROWS, select_buf); - + /* * "Enter selection mode by specifying GL_SELECT with * glRenderMode () [Redbook]." */ glRenderMode (GL_SELECT); - + /* * "Initialize the name stack using glInitNames () and glPush * Names () [Redbook]." */ glInitNames (); glPushName (0); - + /* * "Define the viewing volume you want to use for selection. * Usually this is different from the viewing volume you @@ -116,10 +113,10 @@ exp004mouse (int button, int state, int x, int y) glMatrixMode (GL_PROJECTION); glPushMatrix (); glLoadIdentity (); - + GLint viewport[4]; glGetIntegerv (GL_VIEWPORT, viewport); - + double c_x = 0.0; double c_y = 0.0; double w = 0.0; @@ -127,37 +124,33 @@ exp004mouse (int button, int state, int x, int y) pick_convert (S.selection.x, S.selection.y, x, y, &c_x, &c_y, &w, &h); - gluPickMatrix (c_x, - (GLdouble)viewport[3] - c_y, - w, - h, - viewport); + gluPickMatrix (c_x, (GLdouble) viewport[3] - c_y, w, h, viewport); set_ortho (); - + /* * "Alternately issue primitive drawing commands and commands to * manipulate the name stack so that each primitive of interest * has appropriate names assigned [Redbook]." */ exp004geometry (GL_SELECT); - - glMatrixMode (GL_PROJECTION); + + glMatrixMode (GL_PROJECTION); glPopMatrix (); glutSwapBuffers (); - + /* * "Exit selection mode and process the returned selection data * (the hit records) [Redbook]." */ GLint hits = glRenderMode (GL_RENDER); check_error (__FILE__, __LINE__); - + /* "process hits from selection mode rendering [Angel,2008]." */ exp004processhits (hits, select_buf); - - /* "normal render [Angel,2008]." */ - glutPostRedisplay (); + + /* "normal render [Angel,2008]." */ + glutPostRedisplay (); } } |