00001 00003 #ifndef BASIC_DEFS_H 00004 #define BASIC_DEFS_h 00005 00006 #define GLX_GLXEXT_PROTOTYPES 00007 #define GLH_EXT_SINGLE_FILE 00008 #define _GNU_SOURCE 00009 00010 #define USING_GLSL 1 00011 00012 #ifdef USING_GLSL 00013 #include <GL/glew.h> 00014 #else 00015 #include <glh/glh_extensions.h> 00016 #endif 00017 00018 #include <GL/glut.h> 00019 #include <stdlib.h> 00020 #include <float.h> 00021 #include <math.h> 00022 #include <limits.h> 00023 00024 #include "mmath.h" 00025 00026 #if defined WIN32 00027 #include <io.h> 00028 #else 00029 #include <unistd.h> 00030 #include <sys/stat.h> 00031 #include <sys/types.h> 00032 #include <dirent.h> 00033 #endif 00034 00035 #include "sysconf.h" 00036 #include "transferEdit.h" 00037 #include "arbprogram.h" 00038 #include "reader.h" 00039 #include "preint.h" 00040 #include "timer.h" 00041 #include "tools.h" 00042 #include "ppm.h" 00043 00044 #include "carol_glsl.h" 00045 00047 typedef enum { 00048 MOUSE_ROTATE, 00049 MOUSE_TRANSLATE, 00050 MOUSE_DOLLY, 00051 MOUSE_MOVE_LIGHT_XY, 00052 MOUSE_MOVE_LIGHT_Z 00053 } MouseMode; 00054 00056 typedef struct { 00057 float stepSize; 00058 float sliceThickness; 00059 float gradScale; 00060 float gradOffset; 00061 float texCoordScale; 00062 float isoValue; 00063 float clipIsoValue; 00064 int numIterations; 00065 int wireframe; 00066 int drawLight; 00067 float dummy; /* for file compatibility */ 00068 float scatteringScale; 00069 GLfloat lightPos[4]; 00070 GLfloat translate[3]; 00071 float camZ; 00072 Quaternion camRot; 00073 int backgroundImage; 00074 unsigned char backgroundGrayVal; 00075 } UserSettings; 00076 00079 static struct { 00080 int numSlices[3]; 00081 float sliceDists[3]; 00082 int volTexSizes[3]; 00083 void *volData; 00084 00085 float scaleFactors[4]; 00086 float scaleFactorsInv[4]; 00087 float extents[3]; 00088 float center[4]; 00089 00090 char *basename; 00091 00093 DataTypeTE **dataTE; 00095 GLuint teTex; 00096 00097 unsigned char *preIntTable; 00098 unsigned char *tfFunc; 00099 00100 unsigned char *optDensity; 00101 00102 GLuint framebuffer; 00103 GLuint depthbuffer; 00104 Texture *colorImageTex; 00105 Texture *hitPointsImageTex; 00106 Texture *startPosImageTex; 00107 Texture *debugImageTex; 00108 00109 ARBProgram copyBufferProg; 00110 ARBProgram renderHitPointsVProg; 00111 ARBProgram fillStartPosHolesProg; 00112 ARBProgram initHitPointsProg; 00113 ARBProgram initHitPointsBackProg; 00114 00115 float isoValueStep; 00116 int animated; 00117 int animatedFrames; 00118 float minFps, fpsSum, maxFps; 00119 float animatedAngle; 00120 00121 int numFragProgs; 00122 ARBProgram *fragProgs; 00123 ARBProgram *currentFragProg; 00124 00125 int mousePosLast[2]; 00126 MouseMode mouseMode; 00127 int windowWidth, windowHeight; 00128 00129 Texture *textures; 00130 int numTextures; 00131 00132 int initialized; 00133 00134 UserSettings u; 00135 } g; 00136 00137 void drawQuads(void); 00138 00139 #endif
1.6.1