00001 #ifndef FLOWVIS_PROGRAM_H 00002 #define FLOWVIS_PROGRAM_H 00003 00004 #include <glew.h> 00005 #include <string> 00006 00008 class FlowVisProgram { 00009 public: 00010 enum Mode { 00011 M_BG_INTER, 00012 M_TEXTURE_ROTATION 00013 }; 00014 00018 explicit FlowVisProgram(const char *name); 00019 00021 ~FlowVisProgram(); 00022 00024 void SetTransferFunctionTexture(GLuint tex); 00025 00027 void SetBGDataTexture(GLuint tex); 00028 00030 void SetVelocityTexture(GLuint tex); 00031 00033 void SetArrowTexture(GLuint tex); 00034 00036 void SetGlyphTexture(GLuint tex); 00037 00039 void Use(); 00040 00042 void Prepare(); 00043 00045 void Start(); 00046 00048 void Stop(); 00049 00051 void SetMode(Mode new_mode); 00052 00053 private: 00055 00059 GLuint CompileProgram(const char *name) const; 00060 00062 GLuint m_transfer_texture_; 00063 00065 GLuint m_bgdata_texture_; 00066 00068 GLuint m_velocity_texture_; 00069 00071 GLuint m_arrow_texture_; 00072 00074 GLuint m_glyph_texture_; 00075 00077 void RecompileWhenRequired(); 00078 00079 GLuint program_; 00080 00081 bool recompile_; 00082 std::string progname_; 00083 00084 Mode m_mode; 00085 }; 00086 00087 #endif // FLOWVIS_PROGRAM_H