00001 #pragma once 00002 #include "il.h" 00003 #include "glew.h" 00004 #include <QGLWidget> 00005 #include <string> 00006 #include <commdlg.h> 00007 #include <stdlib.h> 00008 #include <iostream> 00009 #include <sstream> 00010 #include "LoadTramsferFunction.h" 00011 #include <vector> 00012 #include <algorithm> 00013 #include "Texture.h" 00014 00015 #include "TFContainer.h" 00016 #include "Color.h" 00017 00019 00024 class GLTransfer : public QGLWidget 00025 { 00026 Q_OBJECT 00027 00028 public: 00032 GLTransfer(QWidget *parent = 0); 00036 ~GLTransfer(void); 00037 00041 int initLibs(); 00045 void initializeGL(); 00049 void paintGL(); 00053 void resizeGL(int width, int height); 00057 void mouseDoubleClickEvent(QMouseEvent *e); 00061 void mouseReleaseEvent(QMouseEvent *event); 00065 void mousePressEvent(QMouseEvent *event); 00069 void mouseMoveEvent(QMouseEvent *event); 00073 void updateTransferFunction(bool update); 00074 QSize sizeHint() const; 00075 00076 static Transferfunction points; 00077 00078 LoadTramsferFunction* tfLoader; 00079 00080 int sele; 00081 int oldsele; 00082 float threshold; 00083 00084 vec3 selectedcolor; 00085 vec3 selectedpixel; 00086 00087 int doubleklick; 00088 int actIndex; 00089 00090 private: 00095 void SaveXML(std::string filename); 00096 00097 float f_iWidth; 00098 float f_iHeight; 00099 00100 public slots: 00104 void loadTransfer(); 00108 void saveTransfer(); 00109 00110 void channelchange(QString str); 00111 00112 signals: 00116 void createdTFTexture(const Transferfunction tex, int index, bool update); 00117 00118 00119 };