summaryrefslogtreecommitdiffstats
Unidiff
-rw-r--r--AUTHORS1
-rw-r--r--Makefile.am2
-rw-r--r--README24
-rw-r--r--ax/acx_pthread.m4242
-rw-r--r--ax/ax_check_gl.m495
-rw-r--r--ax/ax_check_glu.m471
-rw-r--r--ax/ax_check_glut.m478
-rw-r--r--ax/ax_lang_compiler_ms.m423
-rw-r--r--configure.ac24
-rw-r--r--src/Makefile.am28
-rw-r--r--src/controller/exp004display.c16
-rw-r--r--src/controller/exp004display.h6
-rw-r--r--src/controller/exp004mouse.c90
-rw-r--r--src/controller/exp004mouse.h6
-rw-r--r--src/controller/exp004processhits.c54
-rw-r--r--src/controller/exp004processhits.h8
-rw-r--r--src/controller/exp004reshape.c55
-rw-r--r--src/controller/exp004reshape.h6
-rw-r--r--src/exp004viz.c15
-rw-r--r--src/model/exp004base.c107
-rw-r--r--src/model/exp004base.h9
-rw-r--r--src/model/exp004state.h101
-rw-r--r--src/util/check_error.c17
-rw-r--r--src/util/check_error.h9
-rw-r--r--src/view/exp004geometry.c32
-rw-r--r--src/view/exp004geometry.h8
-rw-r--r--src/view/exp004state0.h8
-rw-r--r--src/view/exp004view.c44
-rw-r--r--src/view/exp004view.h6
29 files changed, 1185 insertions, 0 deletions
diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..dac0f89
--- a/dev/null
+++ b/AUTHORS
@@ -0,0 +1 @@
Don Pellegrino, Drexel University, don@drexel.edu
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..a6d8603
--- a/dev/null
+++ b/Makefile.am
@@ -0,0 +1,2 @@
1ACLOCAL_AMFLAGS = -I ax
2SUBDIRS = src
diff --git a/README b/README
new file mode 100644
index 0000000..0c29887
--- a/dev/null
+++ b/README
@@ -0,0 +1,24 @@
1Visualization system to explore the data from exp004.
2
3======================
4CLUSTER.CIS.DREXEL.EDU
5======================
6
7Building on cluster.cis.drexel.edu requires explicitly adding a number
8of NCBI libraries and using the local install of the NCBI toolkit.
9Before running ./configure set the following:
10
11 export LDFLAGS=-L/usr/local/ncbi/lib
12 export CPPFLAGS=-I/usr/local/ncbi/include
13
14Before running a program that makes use of BLAST create a ~/.ncbirc
15file with the following contents. This instruction is based on a
16message at
17http://osdir.com/ml/science.biology.informatics.bulletin/2006-02/msg00061.html
18
19 [NCBI]
20 data=/usr/local/ncbi/data
21
22 [BLAST]
23 BLASTMAT=/usr/local/ncbi/data
24
diff --git a/ax/acx_pthread.m4 b/ax/acx_pthread.m4
new file mode 100644
index 0000000..e4e91d3
--- a/dev/null
+++ b/ax/acx_pthread.m4
@@ -0,0 +1,242 @@
1dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
2dnl
3dnl @summary figure out how to build C programs using POSIX threads
4dnl
5dnl This macro figures out how to build C programs using POSIX threads.
6dnl It sets the PTHREAD_LIBS output variable to the threads library and
7dnl linker flags, and the PTHREAD_CFLAGS output variable to any special
8dnl C compiler flags that are needed. (The user can also force certain
9dnl compiler flags/libs to be tested by setting these environment
10dnl variables.)
11dnl
12dnl Also sets PTHREAD_CC to any special C compiler that is needed for
13dnl multi-threaded programs (defaults to the value of CC otherwise).
14dnl (This is necessary on AIX to use the special cc_r compiler alias.)
15dnl
16dnl NOTE: You are assumed to not only compile your program with these
17dnl flags, but also link it with them as well. e.g. you should link
18dnl with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS
19dnl $LIBS
20dnl
21dnl If you are only building threads programs, you may wish to use
22dnl these variables in your default LIBS, CFLAGS, and CC:
23dnl
24dnl LIBS="$PTHREAD_LIBS $LIBS"
25dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
26dnl CC="$PTHREAD_CC"
27dnl
28dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
29dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to
30dnl that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
31dnl
32dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
33dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands to
34dnl run it if it is not found. If ACTION-IF-FOUND is not specified, the
35dnl default action will define HAVE_PTHREAD.
36dnl
37dnl Please let the authors know if this macro fails on any platform, or
38dnl if you have any other suggestions or comments. This macro was based
39dnl on work by SGJ on autoconf scripts for FFTW (www.fftw.org) (with
40dnl help from M. Frigo), as well as ac_pthread and hb_pthread macros
41dnl posted by Alejandro Forero Cuervo to the autoconf macro repository.
42dnl We are also grateful for the helpful feedback of numerous users.
43dnl
44dnl @category InstalledPackages
45dnl @author Steven G. Johnson <stevenj@alum.mit.edu>
46dnl @version 2006-05-29
47dnl @license GPLWithACException
48
49AC_DEFUN([ACX_PTHREAD], [
50AC_REQUIRE([AC_CANONICAL_HOST])
51AC_LANG_SAVE
52AC_LANG_C
53acx_pthread_ok=no
54
55# We used to check for pthread.h first, but this fails if pthread.h
56# requires special compiler flags (e.g. on True64 or Sequent).
57# It gets checked for in the link test anyway.
58
59# First of all, check if the user has set any of the PTHREAD_LIBS,
60# etcetera environment variables, and if threads linking works using
61# them:
62if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
63 save_CFLAGS="$CFLAGS"
64 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
65 save_LIBS="$LIBS"
66 LIBS="$PTHREAD_LIBS $LIBS"
67 AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
68 AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
69 AC_MSG_RESULT($acx_pthread_ok)
70 if test x"$acx_pthread_ok" = xno; then
71 PTHREAD_LIBS=""
72 PTHREAD_CFLAGS=""
73 fi
74 LIBS="$save_LIBS"
75 CFLAGS="$save_CFLAGS"
76fi
77
78# We must check for the threads library under a number of different
79# names; the ordering is very important because some systems
80# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
81# libraries is broken (non-POSIX).
82
83# Create a list of thread flags to try. Items starting with a "-" are
84# C compiler flags, and other items are library names, except for "none"
85# which indicates that we try without any flags at all, and "pthread-config"
86# which is a program returning the flags for the Pth emulation library.
87
88acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
89
90# The ordering *is* (sometimes) important. Some notes on the
91# individual items follow:
92
93# pthreads: AIX (must check this before -lpthread)
94# none: in case threads are in libc; should be tried before -Kthread and
95# other compiler flags to prevent continual compiler warnings
96# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
97# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
98# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
99# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
100# -pthreads: Solaris/gcc
101# -mthreads: Mingw32/gcc, Lynx/gcc
102# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
103# doesn't hurt to check since this sometimes defines pthreads too;
104# also defines -D_REENTRANT)
105# ... -mt is also the pthreads flag for HP/aCC
106# pthread: Linux, etcetera
107# --thread-safe: KAI C++
108# pthread-config: use pthread-config program (for GNU Pth library)
109
110case "${host_cpu}-${host_os}" in
111 *solaris*)
112
113 # On Solaris (at least, for some versions), libc contains stubbed
114 # (non-functional) versions of the pthreads routines, so link-based
115 # tests will erroneously succeed. (We need to link with -pthreads/-mt/
116 # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
117 # a function called by this macro, so we could check for that, but
118 # who knows whether they'll stub that too in a future libc.) So,
119 # we'll just look for -pthreads and -lpthread first:
120
121 acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags"
122 ;;
123esac
124
125if test x"$acx_pthread_ok" = xno; then
126for flag in $acx_pthread_flags; do
127
128 case $flag in
129 none)
130 AC_MSG_CHECKING([whether pthreads work without any flags])
131 ;;
132
133 -*)
134 AC_MSG_CHECKING([whether pthreads work with $flag])
135 PTHREAD_CFLAGS="$flag"
136 ;;
137
138 pthread-config)
139 AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no)
140 if test x"$acx_pthread_config" = xno; then continue; fi
141 PTHREAD_CFLAGS="`pthread-config --cflags`"
142 PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
143 ;;
144
145 *)
146 AC_MSG_CHECKING([for the pthreads library -l$flag])
147 PTHREAD_LIBS="-l$flag"
148 ;;
149 esac
150
151 save_LIBS="$LIBS"
152 save_CFLAGS="$CFLAGS"
153 LIBS="$PTHREAD_LIBS $LIBS"
154 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
155
156 # Check for various functions. We must include pthread.h,
157 # since some functions may be macros. (On the Sequent, we
158 # need a special flag -Kthread to make this header compile.)
159 # We check for pthread_join because it is in -lpthread on IRIX
160 # while pthread_create is in libc. We check for pthread_attr_init
161 # due to DEC craziness with -lpthreads. We check for
162 # pthread_cleanup_push because it is one of the few pthread
163 # functions on Solaris that doesn't have a non-functional libc stub.
164 # We try pthread_create on general principles.
165 AC_TRY_LINK([#include <pthread.h>],
166 [pthread_t th; pthread_join(th, 0);
167 pthread_attr_init(0); pthread_cleanup_push(0, 0);
168 pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
169 [acx_pthread_ok=yes])
170
171 LIBS="$save_LIBS"
172 CFLAGS="$save_CFLAGS"
173
174 AC_MSG_RESULT($acx_pthread_ok)
175 if test "x$acx_pthread_ok" = xyes; then
176 break;
177 fi
178
179 PTHREAD_LIBS=""
180 PTHREAD_CFLAGS=""
181done
182fi
183
184# Various other checks:
185if test "x$acx_pthread_ok" = xyes; then
186 save_LIBS="$LIBS"
187 LIBS="$PTHREAD_LIBS $LIBS"
188 save_CFLAGS="$CFLAGS"
189 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
190
191 # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
192 AC_MSG_CHECKING([for joinable pthread attribute])
193 attr_name=unknown
194 for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
195 AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
196 [attr_name=$attr; break])
197 done
198 AC_MSG_RESULT($attr_name)
199 if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
200 AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
201 [Define to necessary symbol if this constant
202 uses a non-standard name on your system.])
203 fi
204
205 AC_MSG_CHECKING([if more special flags are required for pthreads])
206 flag=no
207 case "${host_cpu}-${host_os}" in
208 *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
209 *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
210 esac
211 AC_MSG_RESULT(${flag})
212 if test "x$flag" != xno; then
213 PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
214 fi
215
216 LIBS="$save_LIBS"
217 CFLAGS="$save_CFLAGS"
218
219 # More AIX lossage: must compile with xlc_r or cc_r
220 if test x"$GCC" != xyes; then
221 AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
222 else
223 PTHREAD_CC=$CC
224 fi
225else
226 PTHREAD_CC="$CC"
227fi
228
229AC_SUBST(PTHREAD_LIBS)
230AC_SUBST(PTHREAD_CFLAGS)
231AC_SUBST(PTHREAD_CC)
232
233# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
234if test x"$acx_pthread_ok" = xyes; then
235 ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
236 :
237else
238 acx_pthread_ok=no
239 $2
240fi
241AC_LANG_RESTORE
242])dnl ACX_PTHREAD
diff --git a/ax/ax_check_gl.m4 b/ax/ax_check_gl.m4
new file mode 100644
index 0000000..08305c1
--- a/dev/null
+++ b/ax/ax_check_gl.m4
@@ -0,0 +1,95 @@
1dnl @synopsis AX_CHECK_GL
2dnl
3dnl Check for an OpenGL implementation. If GL is found, the required
4dnl compiler and linker flags are included in the output variables
5dnl "GL_CFLAGS" and "GL_LIBS", respectively. This macro adds the
6dnl configure option "--with-apple-opengl-framework", which users can
7dnl use to indicate that Apple's OpenGL framework should be used on Mac
8dnl OS X. If Apple's OpenGL framework is used, the symbol
9dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GL implementation
10dnl is found, "no_gl" is set to "yes".
11dnl
12dnl @category InstalledPackages
13dnl @author Braden McDaniel <braden@endoframe.com>
14dnl @version 2004-11-15
15dnl @license AllPermissive
16
17AC_DEFUN([AX_CHECK_GL],
18[AC_REQUIRE([AC_PATH_X])dnl
19AC_REQUIRE([ACX_PTHREAD])dnl
20
21#
22# There isn't a reliable way to know we should use the Apple OpenGL framework
23# without a configure option. A Mac OS X user may have installed an
24# alternative GL implementation (e.g., Mesa), which may or may not depend on X.
25#
26AC_ARG_WITH([apple-opengl-framework],
27 [AC_HELP_STRING([--with-apple-opengl-framework],
28 [use Apple OpenGL framework (Mac OS X only)])])
29if test "X$with_apple_opengl_framework" = "Xyes"; then
30 AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1],
31 [Use the Apple OpenGL framework.])
32 GL_LIBS="-framework OpenGL"
33else
34 AC_LANG_PUSH(C)
35
36 AX_LANG_COMPILER_MS
37 if test X$ax_compiler_ms = Xno; then
38 GL_CFLAGS="${PTHREAD_CFLAGS}"
39 GL_LIBS="${PTHREAD_LIBS} -lm"
40 fi
41
42 #
43 # Use x_includes and x_libraries if they have been set (presumably by
44 # AC_PATH_X).
45 #
46 if test "X$no_x" != "Xyes"; then
47 if test -n "$x_includes"; then
48 GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"
49 fi
50 if test -n "$x_libraries"; then
51 GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"
52 fi
53 fi
54
55 AC_CHECK_HEADERS([windows.h])
56
57 AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl],
58 [ax_cv_check_gl_libgl="no"
59 ax_save_CPPFLAGS="${CPPFLAGS}"
60 CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
61 ax_save_LIBS="${LIBS}"
62 LIBS=""
63 ax_check_libs="-lopengl32 -lGL"
64 for ax_lib in ${ax_check_libs}; do
65 if test X$ax_compiler_ms = Xyes; then
66 ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
67 else
68 ax_try_lib="${ax_lib}"
69 fi
70 LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
71 AC_LINK_IFELSE(
72 [AC_LANG_PROGRAM([[
73# if HAVE_WINDOWS_H && defined(_WIN32)
74# include <windows.h>
75# endif
76# include <GL/gl.h>]],
77 [[glBegin(0)]])],
78 [ax_cv_check_gl_libgl="${ax_try_lib}"; break])
79 done
80 LIBS=${ax_save_LIBS}
81 CPPFLAGS=${ax_save_CPPFLAGS}])
82
83 if test "X${ax_cv_check_gl_libgl}" = "Xno"; then
84 no_gl="yes"
85 GL_CFLAGS=""
86 GL_LIBS=""
87 else
88 GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"
89 fi
90 AC_LANG_POP(C)
91fi
92
93AC_SUBST([GL_CFLAGS])
94AC_SUBST([GL_LIBS])
95])dnl
diff --git a/ax/ax_check_glu.m4 b/ax/ax_check_glu.m4
new file mode 100644
index 0000000..29d30bd
--- a/dev/null
+++ b/ax/ax_check_glu.m4
@@ -0,0 +1,71 @@
1dnl @synopsis AX_CHECK_GLU
2dnl
3dnl Check for GLU. If GLU is found, the required preprocessor and
4dnl linker flags are included in the output variables "GLU_CFLAGS" and
5dnl "GLU_LIBS", respectively. This macro adds the configure option
6dnl "--with-apple-opengl-framework", which users can use to indicate
7dnl that Apple's OpenGL framework should be used on Mac OS X. If
8dnl Apple's OpenGL framework is used, the symbol
9dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If no GLU implementation
10dnl is found, "no_glu" is set to "yes".
11dnl
12dnl @category InstalledPackages
13dnl @author Braden McDaniel <braden@endoframe.com>
14dnl @version 2004-11-15
15dnl @license AllPermissive
16
17AC_DEFUN([AX_CHECK_GLU],
18[AC_REQUIRE([AX_CHECK_GL])dnl
19AC_REQUIRE([AC_PROG_CXX])dnl
20GLU_CFLAGS="${GL_CFLAGS}"
21if test "X${with_apple_opengl_framework}" != "Xyes"; then
22 AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu],
23 [ax_cv_check_glu_libglu="no"
24 ax_save_CPPFLAGS="${CPPFLAGS}"
25 CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}"
26 ax_save_LIBS="${LIBS}"
27 LIBS=""
28 ax_check_libs="-lglu32 -lGLU"
29 for ax_lib in ${ax_check_libs}; do
30 if test X$ax_compiler_ms = Xyes; then
31 ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
32 else
33 ax_try_lib="${ax_lib}"
34 fi
35 LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}"
36 #
37 # libGLU typically links with libstdc++ on POSIX platforms. However,
38 # setting the language to C++ means that test program source is named
39 # "conftest.cc"; and Microsoft cl doesn't know what to do with such a
40 # file.
41 #
42 AC_LANG_PUSH([C++])
43 if test X$ax_compiler_ms = Xyes; then
44 AC_LANG_PUSH([C])
45 fi
46 AC_LINK_IFELSE(
47 [AC_LANG_PROGRAM([[
48# if HAVE_WINDOWS_H && defined(_WIN32)
49# include <windows.h>
50# endif
51# include <GL/glu.h>]],
52 [[gluBeginCurve(0)]])],
53 [ax_cv_check_glu_libglu="${ax_try_lib}"; break])
54 if test X$ax_compiler_ms = Xyes; then
55 AC_LANG_POP([C])
56 fi
57 AC_LANG_POP([C++])
58 done
59 LIBS=${ax_save_LIBS}
60 CPPFLAGS=${ax_save_CPPFLAGS}])
61 if test "X${ax_cv_check_glu_libglu}" = "Xno"; then
62 no_glu="yes"
63 GLU_CFLAGS=""
64 GLU_LIBS=""
65 else
66 GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"
67 fi
68fi
69AC_SUBST([GLU_CFLAGS])
70AC_SUBST([GLU_LIBS])
71])
diff --git a/ax/ax_check_glut.m4 b/ax/ax_check_glut.m4
new file mode 100644
index 0000000..239769f
--- a/dev/null
+++ b/ax/ax_check_glut.m4
@@ -0,0 +1,78 @@
1dnl @synopsis AX_CHECK_GLUT
2dnl
3dnl Check for GLUT. If GLUT is found, the required compiler and linker
4dnl flags are included in the output variables "GLUT_CFLAGS" and
5dnl "GLUT_LIBS", respectively. This macro adds the configure option
6dnl "--with-apple-opengl-framework", which users can use to indicate
7dnl that Apple's OpenGL framework should be used on Mac OS X. If
8dnl Apple's OpenGL framework is used, the symbol
9dnl "HAVE_APPLE_OPENGL_FRAMEWORK" is defined. If GLUT is not found,
10dnl "no_glut" is set to "yes".
11dnl
12dnl @category InstalledPackages
13dnl @author Braden McDaniel <braden@endoframe.com>
14dnl @version 2004-11-15
15dnl @license AllPermissive
16
17AC_DEFUN([AX_CHECK_GLUT],
18[AC_REQUIRE([AX_CHECK_GLU])dnl
19AC_REQUIRE([AC_PATH_XTRA])dnl
20
21if test "X$with_apple_opengl_framework" = "Xyes"; then
22 GLUT_CFLAGS="${GLU_CFLAGS}"
23 GLUT_LIBS="-framework GLUT -lobjc ${GL_LIBS}"
24else
25 GLUT_CFLAGS=${GLU_CFLAGS}
26 GLUT_LIBS=${GLU_LIBS}
27
28 #
29 # If X is present, assume GLUT depends on it.
30 #
31 # if test "X${no_x}" != "Xyes"; then
32 # GLUT_LIBS="${X_PRE_LIBS} -lXmu -lXi ${X_EXTRA_LIBS} ${GLUT_LIBS}"
33 # fi
34
35 AC_LANG_PUSH(C)
36
37 ax_save_CPPFLAGS="${CPPFLAGS}"
38 CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}"
39
40 AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut],
41 [ax_cv_check_glut_libglut="no"
42 ax_save_LIBS="${LIBS}"
43 LIBS=""
44 ax_check_libs="-lglut32 -lglut"
45 for ax_lib in ${ax_check_libs}; do
46 if test X$ax_compiler_ms = Xyes; then
47 ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`
48 else
49 ax_try_lib="${ax_lib}"
50 fi
51 LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}"
52 AC_LINK_IFELSE(
53 [AC_LANG_PROGRAM([[
54# if HAVE_WINDOWS_H && defined(_WIN32)
55# include <windows.h>
56# endif
57# include <GL/glut.h>]],
58 [[glutMainLoop()]])],
59 [ax_cv_check_glut_libglut="${ax_try_lib}"; break])
60
61 done
62 LIBS=${ax_save_LIBS}
63 ])
64 CPPFLAGS="${ax_save_CPPFLAGS}"
65 AC_LANG_POP(C)
66
67 if test "X${ax_cv_check_glut_libglut}" = "Xno"; then
68 no_glut="yes"
69 GLUT_CFLAGS=""
70 GLUT_LIBS=""
71 else
72 GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"
73 fi
74fi
75
76AC_SUBST([GLUT_CFLAGS])
77AC_SUBST([GLUT_LIBS])
78])dnl
diff --git a/ax/ax_lang_compiler_ms.m4 b/ax/ax_lang_compiler_ms.m4
new file mode 100644
index 0000000..2b3d5a8
--- a/dev/null
+++ b/ax/ax_lang_compiler_ms.m4
@@ -0,0 +1,23 @@
1dnl @synopsis AX_LANG_COMPILER_MS
2dnl
3dnl Check whether the compiler for the current language is Microsoft.
4dnl
5dnl This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU
6dnl Autoconf implementation.
7dnl
8dnl @category InstalledPackages
9dnl @author Braden McDaniel <braden@endoframe.com>
10dnl @version 2004-11-15
11dnl @license AllPermissive
12
13AC_DEFUN([AX_LANG_COMPILER_MS],
14[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler],
15 [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms],
16[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER
17 choke me
18#endif
19]])],
20 [ax_compiler_ms=yes],
21 [ax_compiler_ms=no])
22ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
23])])
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..a7924d3
--- a/dev/null
+++ b/configure.ac
@@ -0,0 +1,24 @@
1AC_INIT([exp005], [0.1], [don@drexel.edu])
2AM_INIT_AUTOMAKE([-Wall, -Werror, -Wno-portability])
3AC_PROG_CC
4AM_CONFIG_HEADER([config.h])
5AC_CONFIG_FILES([
6 Makefile
7 src/Makefile
8])
9
10# Check for OpenGL libraries GLUT, GLU and GL. OpenGL is used for the
11# visualization rendering and interaction.
12AX_CHECK_GLUT
13
14# Check for the NCBI Toolkit libraries.
15AC_SEARCH_LIBS([log10],[m])
16AC_SEARCH_LIBS([NlmThreadsAvailable],[ncbi])
17AC_SEARCH_LIBS([SeqAlignNew],[ncbiobj])
18AC_SEARCH_LIBS([Blast_RedoOneMatch],[blastcompadj])
19AC_SEARCH_LIBS([BioseqBlastEngine],[ncbitool])
20
21# Check for the new curses library for terminal output.
22AC_SEARCH_LIBS([clrtoeol],[ncurses])
23
24AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..bd0d702
--- a/dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,28 @@
1bin_PROGRAMS = exp004viz
2
3exp004viz_SOURCES = \
4 controller/exp004display.c \
5 controller/exp004mouse.c \
6 controller/exp004processhits.c \
7 controller/exp004reshape.c \
8 exp004viz.c \
9 model/exp004base.c \
10 util/check_error.c \
11 view/exp004geometry.c \
12 view/exp004view.c
13
14exp004viz_LDADD = ${GLUT_LIBS}
15
16noinst_HEADERS = \
17 controller/exp004display.h \
18 controller/exp004mouse.h \
19 controller/exp004processhits.h \
20 controller/exp004reshape.h \
21 model/exp004base.h \
22 model/exp004state.h \
23 util/check_error.h \
24 view/exp004geometry.h \
25 view/exp004state0.h \
26 view/exp004view.h
27
28AM_CFLAGS = -Wall -std=gnu99 -pipe -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -I/usr/include/ncbi
diff --git a/src/controller/exp004display.c b/src/controller/exp004display.c
new file mode 100644
index 0000000..e893ad6
--- a/dev/null
+++ b/src/controller/exp004display.c
@@ -0,0 +1,16 @@
1#include "exp004display.h"
2#include "../view/exp004geometry.h"
3#include <GL/glut.h>
4#include <stdio.h>
5
6#define WINHEIGHT 500
7
8void
9exp004display (void)
10{
11 glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
12 exp004geometry (GL_RENDER);
13 glutSwapBuffers ();
14
15 return;
16}
diff --git a/src/controller/exp004display.h b/src/controller/exp004display.h
new file mode 100644
index 0000000..6a5f9f7
--- a/dev/null
+++ b/src/controller/exp004display.h
@@ -0,0 +1,6 @@
1#ifndef EXP004DISPLAY_H
2#define EXP004DISPLAY_H
3
4void exp004display (void);
5
6#endif // EXP004DISPLAY_H
diff --git a/src/controller/exp004mouse.c b/src/controller/exp004mouse.c
new file mode 100644
index 0000000..11117bf
--- a/dev/null
+++ b/src/controller/exp004mouse.c
@@ -0,0 +1,90 @@
1#include "exp004mouse.h"
2#include "exp004processhits.h"
3#include "../view/exp004geometry.h"
4#include "../view/exp004state0.h"
5#include "../util/check_error.h"
6#include <GL/glut.h>
7#include <stdio.h>
8
9#define SIZE 500
10#define N 3
11
12void
13exp004mouse (int button, int state, int x, int y)
14{
15
16 if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN)
17 {
18
19 /*
20 * "Specify the array to be used for the returned hit records
21 * with glSelectBuffer () [Redbook]."
22 */
23 GLuint select_buf[SIZE];
24 glSelectBuffer (SIZE, select_buf);
25
26 /*
27 * "Enter selection mode by specifying GL_SELECT with
28 * glRenderMode () [Redbook]."
29 */
30 glRenderMode (GL_SELECT);
31
32 /*
33 * "Initialize the name stack using glInitNames () and glPush
34 * Names () [Redbook]."
35 */
36 glInitNames ();
37 glPushName (0);
38
39 /*
40 * "Define the viewing volume you want to use for selection.
41 * Usually this is different from the viewing volume you
42 * originally used to draw the scene, so you probably want to
43 * save and then restore the current transformation state with
44 * glPushMatrix () and glPopMatrix () [Redbook]."
45 */
46 glMatrixMode (GL_PROJECTION);
47 glPushMatrix ();
48 glLoadIdentity ();
49
50 GLint viewport[4];
51 glGetIntegerv (GL_VIEWPORT, viewport);
52
53 gluPickMatrix ((GLdouble) x,
54 (GLdouble) (viewport[3] - y),
55 N,
56 N,
57 viewport);
58
59 gluOrtho2D(exp004state0.ortho.min_x,
60 exp004state0.ortho.max_x,
61 exp004state0.ortho.min_y,
62 exp004state0.ortho.max_y);
63
64 /*
65 * "Alternately issue primitive drawing commands and commands to
66 * manipulate the name stack so that each primitive of interest
67 * has appropriate names assigned [Redbook]."
68 */
69 exp004geometry (GL_SELECT);
70
71 glMatrixMode (GL_PROJECTION);
72 glPopMatrix ();
73 glutSwapBuffers ();
74
75 /*
76 * "Exit selection mode and process the returned selection data
77 * (the hit records) [Redbook]."
78 */
79 GLint hits = glRenderMode (GL_RENDER);
80 check_error (__FILE__, __LINE__);
81
82 /* "process hits from selection mode rendering [Angel,2008]." */
83 exp004processhits (hits, select_buf);
84
85 /* "normal render [Angel,2008]." */
86 glutPostRedisplay ();
87 }
88
89 return;
90}
diff --git a/src/controller/exp004mouse.h b/src/controller/exp004mouse.h
new file mode 100644
index 0000000..a6809be
--- a/dev/null
+++ b/src/controller/exp004mouse.h
@@ -0,0 +1,6 @@
1#ifndef EXP004MOUSE_H
2#define EXP004MOUSE_H
3
4void exp004mouse (int button, int state, int x, int y);
5
6#endif // EXP004MOUSE_H
diff --git a/src/controller/exp004processhits.c b/src/controller/exp004processhits.c
new file mode 100644
index 0000000..29fbbbc
--- a/dev/null
+++ b/src/controller/exp004processhits.c
@@ -0,0 +1,54 @@
1/* I seem to need this for glGenBuffers as per
2 http://www.gamedev.net/community/forums/topic.asp?topic_id=422358 */
3#define GL_GLEXT_PROTOTYPES
4
5#include "exp004processhits.h"
6#include "../view/exp004state0.h"
7#include <stdio.h>
8
9/*
10 * The implementation of this function is based on
11 * [Angel,2008,pp80-81].
12 */
13void
14exp004processhits (GLint hits, GLuint buffer[])
15{
16 /*
17 * A simple alias to make the code more readable.
18 */
19 EXP004STATE* S = &exp004state0;
20
21 printf ("Hits: %d\n", hits);
22
23 GLuint *hitlist = buffer;
24
25 for (int i = 0; i < hits; i++)
26 {
27 hitlist += 3;
28
29 /*
30 * Report the hit to the terminal.
31 */
32 printf ("Hit %i: %s\n", i + 1, exp004state0.gi_data[*hitlist]);
33
34 /*
35 * Add the hits to the selection.
36 */
37 exp004state0.selection[*hitlist] = true;
38 exp004state0.base_colors_data[*hitlist][0] = SELECT_COLOR_R;
39 exp004state0.base_colors_data[*hitlist][1] = SELECT_COLOR_G;
40 exp004state0.base_colors_data[*hitlist][2] = SELECT_COLOR_B;
41
42 hitlist++;
43 }
44
45 glBindBuffer (GL_ARRAY_BUFFER, S->buffers[BASE_COLORS]);
46 glColorPointer (3, GL_FLOAT, 0, 0);
47 glBufferData (GL_ARRAY_BUFFER,
48 sizeof (S->base_colors_data), S->base_colors_data,
49 GL_STATIC_DRAW);
50
51 printf ("\n");
52
53 return;
54}
diff --git a/src/controller/exp004processhits.h b/src/controller/exp004processhits.h
new file mode 100644
index 0000000..d61e9a7
--- a/dev/null
+++ b/src/controller/exp004processhits.h
@@ -0,0 +1,8 @@
1#ifndef EXP004PROCESSHITS_H
2#define EXP004PROCESSHITS_H
3
4#include <GL/glut.h>
5
6void exp004processhits (GLint hits, GLuint buffer[]);
7
8#endif // EXP004PROCESSHITS_H
diff --git a/src/controller/exp004reshape.c b/src/controller/exp004reshape.c
new file mode 100644
index 0000000..7aaff08
--- a/dev/null
+++ b/src/controller/exp004reshape.c
@@ -0,0 +1,55 @@
1#include "exp004reshape.h"
2#include "../view/exp004state0.h"
3#include <GL/glut.h>
4
5void
6exp004reshape (int w, int h)
7{
8 glMatrixMode (GL_PROJECTION);
9 glLoadIdentity ();
10
11 /*
12 * This scaling produces an odd effect when the coordinates are not
13 * centered at 0,0. When 0,0 is the lower left rather than the
14 * center this reshape is a bit unnatural since the image is not
15 * centered in the middle of the window.
16 */
17
18 if (w <= h)
19 {
20 exp004state0.ortho.min_x =
21 exp004state0.ortho_min;
22 exp004state0.ortho.max_x =
23 exp004state0.ortho_max;
24 exp004state0.ortho.min_y =
25 exp004state0.ortho_min * (GLfloat) h / (GLfloat) w;
26 exp004state0.ortho.max_y =
27 exp004state0.ortho_max * (GLfloat) h / (GLfloat) w;
28 }
29 else
30 {
31 exp004state0.ortho.min_x =
32 exp004state0.ortho_min * (GLfloat) w / (GLfloat) h;
33 exp004state0.ortho.max_x =
34 exp004state0.ortho_max * (GLfloat) w / (GLfloat) h;
35 exp004state0.ortho.min_y =
36 exp004state0.ortho_min;
37 exp004state0.ortho.max_y =
38 exp004state0.ortho_max;
39 }
40
41 gluOrtho2D(exp004state0.ortho.min_x,
42 exp004state0.ortho.max_x,
43 exp004state0.ortho.min_y,
44 exp004state0.ortho.max_y);
45
46 glMatrixMode (GL_MODELVIEW);
47
48 // Set the viewport equal to the size of the window.
49 glViewport (0, 0, (GLsizei) w, (GLsizei) h);
50
51 exp004state0.viewport.w = w;
52 exp004state0.viewport.h = h;
53
54 return;
55}
diff --git a/src/controller/exp004reshape.h b/src/controller/exp004reshape.h
new file mode 100644
index 0000000..3bb20a5
--- a/dev/null
+++ b/src/controller/exp004reshape.h
@@ -0,0 +1,6 @@
1#ifndef EXP004RESHAPE_H
2#define EXP004RESHAPE_H
3
4void exp004reshape (int w, int h);
5
6#endif // EXP004RESHAPE_H
diff --git a/src/exp004viz.c b/src/exp004viz.c
new file mode 100644
index 0000000..08d5953
--- a/dev/null
+++ b/src/exp004viz.c
@@ -0,0 +1,15 @@
1#include <GL/glut.h>
2#include "view/exp004view.h"
3
4int
5main (int argc, char **argv)
6{
7 glutInit (&argc, argv);
8 glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
9
10 exp004view ();
11
12 glutMainLoop ();
13
14 return 0;
15}
diff --git a/src/model/exp004base.c b/src/model/exp004base.c
new file mode 100644
index 0000000..56a20e5
--- a/dev/null
+++ b/src/model/exp004base.c
@@ -0,0 +1,107 @@
1/* I seem to need this for glGenBuffers as per
2 http://www.gamedev.net/community/forums/topic.asp?topic_id=422358 */
3#define GL_GLEXT_PROTOTYPES
4
5#include "exp004base.h"
6#include "../view/exp004state0.h"
7#include <GL/glut.h>
8#include <stdio.h>
9#include <string.h>
10
11void
12exp004base (void)
13{
14 /*
15 * A simple alias to make the code more readable.
16 */
17 EXP004STATE* S = &exp004state0;
18
19 /*
20 * This implementation can be improved by mapping the video memory
21 * directly rather than loading into system memory and then copying
22 * into video memory.
23 */
24
25 FILE* coords =
26 fopen ("/home/don/exp004/test/run20090514/run20090514.coords", "r");
27 int i = 0;
28
29 /*
30 * Initialize the bounding box of the points.
31 */
32 S->bb.min_x = 0.0;
33 S->bb.max_x = 0.0;
34 S->bb.min_y = 0.0;
35 S->bb.max_y = 0.0;
36
37 for (i = 0; i < ROWS; i++)
38 {
39 fscanf (coords, "%s %f %f\n",
40 S->gi_data[i],
41 &S->base_vertices_data[i][0],
42 &S->base_vertices_data[i][1]);
43
44 if (S->base_vertices_data[i][0] < S->bb.min_x)
45 S->bb.min_x = S->base_vertices_data[i][0];
46 if (S->base_vertices_data[i][0] > S->bb.max_x)
47 S->bb.max_x = S->base_vertices_data[i][0];
48 if (S->base_vertices_data[i][1] < S->bb.min_y)
49 S->bb.min_y = S->base_vertices_data[i][1];
50 if (S->base_vertices_data[i][1] > S->bb.max_y)
51 S->bb.max_y = S->base_vertices_data[i][1];
52
53 /*
54 * Deselected by default.
55 */
56 S->selection[i] = false;
57
58 S->base_colors_data[i][0] = DEFAULT_COLOR_R;
59 S->base_colors_data[i][1] = DEFAULT_COLOR_G;
60 S->base_colors_data[i][2] = DEFAULT_COLOR_B;
61 }
62 fclose (coords);
63
64 /*
65 * Find the largest axis and use it to setup the projection. This
66 * is done to preserve the aspect ratio. The aspect ratio should be
67 * preserved since relative distance is a meaningful indicator in
68 * the map.
69 */
70
71 // Min of min x or min y.
72 if (S->bb.min_x <= S->bb.min_y)
73 S->ortho_min = S->bb.min_x;
74 else
75 S->ortho_min = S->bb.min_y;
76 S->ortho_min--;
77
78 // Max of max x or max y.
79 if (S->bb.max_x >= S->bb.max_y)
80 S->ortho_max = S->bb.max_x;
81 else
82 S->ortho_max = S->bb.max_y;
83 S->ortho_max++;
84
85 // Invert the y coordinate to match up with the LGL Java viewer.
86 for (i = 0; i < ROWS; i++)
87 S->base_vertices_data[i][1] =
88 S->ortho_max - S->base_vertices_data[i][1];
89
90 S->points = i;
91
92 glGenBuffers (2, S->buffers);
93
94 glBindBuffer (GL_ARRAY_BUFFER, S->buffers[BASE_VERTICES]);
95 glVertexPointer (2, GL_FLOAT, 0, 0);
96 glBufferData (GL_ARRAY_BUFFER,
97 sizeof (S->base_vertices_data), S->base_vertices_data,
98 GL_STATIC_DRAW);
99
100 glBindBuffer (GL_ARRAY_BUFFER, S->buffers[BASE_COLORS]);
101 glColorPointer (3, GL_FLOAT, 0, 0);
102 glBufferData (GL_ARRAY_BUFFER,
103 sizeof (S->base_colors_data), S->base_colors_data,
104 GL_STATIC_DRAW);
105
106 return;
107}
diff --git a/src/model/exp004base.h b/src/model/exp004base.h
new file mode 100644
index 0000000..4f8492d
--- a/dev/null
+++ b/src/model/exp004base.h
@@ -0,0 +1,9 @@
1#ifndef EXP004BASE_H
2#define EXP004BASE_H
3
4/*
5 * Build the base layer of the map.
6 */
7void exp004base (void);
8
9#endif // EXP004BASE_H
diff --git a/src/model/exp004state.h b/src/model/exp004state.h
new file mode 100644
index 0000000..e45f679
--- a/dev/null
+++ b/src/model/exp004state.h
@@ -0,0 +1,101 @@
1#ifndef EXP004STATE_H
2#define EXP004STATE_H
3
4#include <stdbool.h>
5
6/*
7 * Buffer object identifiers.
8 */
9#define BASE_VERTICES 0
10#define BASE_COLORS 1
11
12/*
13 * Vertices in the graph.
14 */
15#define ROWS 83905
16
17#define DEFAULT_COLOR_R 0.2
18#define DEFAULT_COLOR_G 0.2
19#define DEFAULT_COLOR_B 0.2
20
21#define SELECT_COLOR_R 1.0
22#define SELECT_COLOR_G 1.0
23#define SELECT_COLOR_B 1.0
24
25/*
26 * Maintain state of the model.
27 */
28typedef struct
29{
30
31 /*
32 * Track the bounding box of the points.
33 */
34 struct {
35 float min_x;
36 float max_x;
37 float min_y;
38 float max_y;
39 } bb;
40
41 /*
42 * Minimum coordinate for the orthographic projection.
43 */
44 float ortho_min;
45
46 /*
47 * Maximum coordinate for the orthographic projection.
48 */
49 float ortho_max;
50
51 /*
52 * Orthographic coordinates after aspect preserving scaling.
53 */
54 struct {
55 float min_x;
56 float max_x;
57 float min_y;
58 float max_y;
59 } ortho;
60
61 /*
62 * Viewport size.
63 */
64 struct {
65 int w;
66 int h;
67 } viewport;
68
69 /*
70 * Points loaded.
71 */
72 int points;
73
74 /*
75 * Buffer objects.
76 */
77 unsigned int buffers[1];
78
79 /*
80 * GI Identifiers indexed by row.
81 */
82 char gi_data[ROWS][20];
83
84 /*
85 * 2D coordinates for each protein.
86 */
87 float base_vertices_data[ROWS][2];
88
89 /*
90 * RGB color for each protein.
91 */
92 float base_colors_data[ROWS][3];
93
94 /*
95 * Selection list.
96 */
97 bool selection[ROWS];
98
99} EXP004STATE;
100
101#endif // EXP004STATE_H
diff --git a/src/util/check_error.c b/src/util/check_error.c
new file mode 100644
index 0000000..dbe5b8f
--- a/dev/null
+++ b/src/util/check_error.c
@@ -0,0 +1,17 @@
1#include <GL/glut.h>
2#include <error.h>
3#include <errno.h>
4
5void
6check_error (const char *filename, unsigned int linenum)
7{
8 GLenum errCode = glGetError ();
9 if (errCode != GL_NO_ERROR)
10 {
11 const GLubyte *errString = gluErrorString (errCode);
12 error_at_line (-1, errno, filename, linenum,
13 "OpenGL Error %s", errString);
14 }
15
16 return;
17}
diff --git a/src/util/check_error.h b/src/util/check_error.h
new file mode 100644
index 0000000..7aa6495
--- a/dev/null
+++ b/src/util/check_error.h
@@ -0,0 +1,9 @@
1#ifndef CHECK_ERROR_H
2#define CHECK_ERROR_H
3
4/*
5 * Based on example 14-1 in Shreiner p603.
6 */
7void check_error (const char *filename, unsigned int linenum);
8
9#endif // CHECK_ERROR_H
diff --git a/src/view/exp004geometry.c b/src/view/exp004geometry.c
new file mode 100644
index 0000000..9ff6475
--- a/dev/null
+++ b/src/view/exp004geometry.c
@@ -0,0 +1,32 @@
1/* I seem to need this for glGenBuffers as per
2 http://www.gamedev.net/community/forums/topic.asp?topic_id=422358 */
3#define GL_GLEXT_PROTOTYPES
4
5#include "exp004geometry.h"
6#include "exp004state0.h"
7#include <GL/glut.h>
8
9void
10exp004geometry (GLenum mode)
11{
12 glMatrixMode (GL_MODELVIEW);
13 glLoadIdentity ();
14
15 glPointSize (0.1);
16 glColor3f (0.2, 0.2, 0.2);
17
18 if (mode == GL_SELECT)
19 {
20 for (int i = 0; i < ROWS; i++)
21 {
22 glLoadName (i);
23 glDrawArrays (GL_POINTS, i, 1);
24 }
25 }
26 else
27 {
28 glDrawArrays (GL_POINTS, 0, ROWS);
29 }
30
31 return;
32}
diff --git a/src/view/exp004geometry.h b/src/view/exp004geometry.h
new file mode 100644
index 0000000..582be48
--- a/dev/null
+++ b/src/view/exp004geometry.h
@@ -0,0 +1,8 @@
1#ifndef EXP004GEOMETRY_H
2#define EXP004GEOMETRY_H
3
4#include <GL/glut.h>
5
6void exp004geometry (GLenum mode);
7
8#endif // EXP004GEOMETRY_H
diff --git a/src/view/exp004state0.h b/src/view/exp004state0.h
new file mode 100644
index 0000000..2b60ce9
--- a/dev/null
+++ b/src/view/exp004state0.h
@@ -0,0 +1,8 @@
1#ifndef EXP004STATE0_H
2#define EXP004STATE0_H
3
4#include "../model/exp004state.h"
5
6EXP004STATE exp004state0;
7
8#endif // EXP004STATE0_H
diff --git a/src/view/exp004view.c b/src/view/exp004view.c
new file mode 100644
index 0000000..5e3b8ab
--- a/dev/null
+++ b/src/view/exp004view.c
@@ -0,0 +1,44 @@
1#include "../controller/exp004display.h"
2#include "../controller/exp004mouse.h"
3#include "../controller/exp004reshape.h"
4#include "../model/exp004base.h"
5#include "exp004view.h"
6#include <GL/glut.h>
7
8void
9exp004view (void)
10{
11 // GLUT Initialization
12 glutInitWindowSize (500, 500);
13 glutInitWindowPosition (100, 100);
14 glutCreateWindow ("Exp004");
15
16 // GL Initialization
17 glClearColor (0.0, 0.0, 0.0, 1.0);
18 glColor3f (1.0, 1.0, 1.0);
19 glEnable (GL_AUTO_NORMAL);
20 glEnable (GL_DEPTH_TEST);
21 glEnable (GL_MAP1_VERTEX_3);
22 glShadeModel (GL_SMOOTH);
23
24 /* Buffer objects to use. */
25 glEnableClientState (GL_COLOR_ARRAY);
26 glEnableClientState (GL_VERTEX_ARRAY);
27
28 /* Enable Antialiasing as described in "Antialiasing"
29 [Shreiner,247]. */
30 glEnable (GL_LINE_SMOOTH);
31 glEnable (GL_BLEND);
32 glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
33 glHint (GL_LINE_SMOOTH_HINT, GL_NICEST);
34
35 // Initialize the model.
36 exp004base ();
37
38 // Callbacks (Controllers)
39 glutDisplayFunc (exp004display);
40 glutMouseFunc (exp004mouse);
41 glutReshapeFunc (exp004reshape);
42
43 return;
44}
diff --git a/src/view/exp004view.h b/src/view/exp004view.h
new file mode 100644
index 0000000..0086f53
--- a/dev/null
+++ b/src/view/exp004view.h
@@ -0,0 +1,6 @@
1#ifndef EXP004VIEW_H
2#define EXP004VIEW_H
3
4void exp004view (void);
5
6#endif // EXP004VIEW_H

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.