00001 #ifndef FORMFACTORENGINE_H
00002 #define FORMFACTORENGINE_H
00003
00011 #include <map>
00012 #include <vector>
00013
00014 #if defined(__WIN32__) || defined(_WIN32) || defined(__CYGWIN__)
00015 # include <windows.h>
00016 #else
00017 # include <X11/Xlib.h>
00018 #endif
00019
00020 #include <GL/glu.h>
00021 #include "Triangle.h"
00022
00023 using namespace std;
00024
00025 #ifndef BUILDING_DOX
00026 class Vector;
00027 class PatchRandomAccessEnumerator;
00028 class PatchCacheLine;
00029 #endif
00030
00034 class FormFactorEngine {
00035 public:
00036
00041 FormFactorEngine (PatchRandomAccessEnumerator *patchEnumerator);
00042
00048 void fillCacheLine(int destPatch, PatchCacheLine *cacheLine);
00049
00050 private:
00051
00052 PatchRandomAccessEnumerator *patchEnumerator_;
00053
00054 #if defined(__WIN32__) || defined(_WIN32) || defined(__CYGWIN__)
00055 #else
00056 Display *dpy;
00057 Window win;
00058 #endif
00059 void createGLWindow();
00060
00061 void drawScene();
00062 void renderViewport(const GLint x, const GLint y, const Vertex &c, const Vertex &at, const Vector &up);
00063 void renderFullScene(int dest);
00064 map<unsigned,double> *getFF();
00065
00066 public:
00070 ~FormFactorEngine();
00071
00072 static const int EDGE_1 = 256;
00073 static const int EDGE_2 = 2*EDGE_1;
00074 static const int EDGE_LENGTH = 3*EDGE_1;
00075
00076 private:
00077 double **ffcoefs;
00078 };
00079
00080 #endif // FORMFACTORENGINE_H