00001 #ifndef GLUTWINDOW_H
00002 #define GLUTWINDOW_H
00003
00011 #if defined(__WIN32__) || defined(_WIN32) || defined(__CYGWIN__)
00012 #include <windows.h>
00013 #else
00014 #endif
00015
00016 #include <GL/glut.h>
00017
00018 #ifndef BUILDING_DOX
00019 class TriangleSetExt;
00020 #endif
00021
00025 class Visualizer{
00026 public:
00033 static void visualize(const char *title, TriangleSetExt *te);
00034
00042 static void takeScreenshot(char *fileName, TriangleSetExt *te);
00043
00044 private:
00045 typedef enum { INTERPOLATE_RADIOSITY, INTERPOLATE_RADIOSITY_RAW, RADIOSITY_LAST, RADIOSITY, REFLECTIVITY, EMISSION, REFLECT_EMISS } TColorInput;
00046
00047 static TriangleSetExt * patchSequenceEnumerator_;
00048 static TColorInput colorInput;
00049
00050 static GLuint scene_;
00051
00052 static int xnew, ynew, znew;
00053 static int xold, yold, zold;
00054 static int xx1, yy1, zz1;
00055 static int mouseState;
00056 static int xshift, yshift;
00057
00058 static float fov;
00059 static float near_plane;
00060 static float far_plane;
00061 static float point_size;
00062 static float line_width;
00063 static int WindowWidth;
00064 static int WindowHeight;
00065 static int ObjectType;
00066 static int Solid;
00067
00068 static bool doScreenshot;
00069 static const char * screenshotFileName;
00070
00071
00072 static void onDisplay(void);
00073 static void onReshape(int w, int h);
00074 static void onKeyboard(unsigned char key, int x, int y);
00075 static void onSpecial(int key, int, int);
00076 static void onMouseClick(int button, int state, int x, int y);
00077 static void onMouseMotion(int x, int y);
00078
00079 static void start(TriangleSetExt * patchEnumerator, TColorInput colorInput);
00080
00081 Visualizer();
00082
00083 static void createWindow(const char * title);
00084 static void saveScreenshot(const char * filename);
00085 static void createCallList(void);
00086 };
00087
00088 #endif