00001 #ifndef VTransferFunction_h 00002 #define VTransferFunction_h 00003 00004 #include "ptr_vector.h" 00005 #include <GL/glew.h> 00006 #include <GL/glut.h> 00007 #include "VTransferFunctionNode.h" 00008 #include "VColorChooser.h" 00009 00010 using namespace std; 00011 using namespace stdx; 00012 00016 class VTransferFunction 00017 { 00018 00019 int x; 00020 int y; 00021 int width; 00022 int height; 00023 float * alpha; 00027 ptr_vector<VTransferFunctionNode> nodes; 00028 VColorChooser * chooser; 00031 VTransferFunctionNode * currentnode; 00032 bool dragging; 00033 GLuint tex; 00034 float * colors; 00035 int length; 00036 00039 void renderTexture(); 00040 00041 public: 00049 VTransferFunction(int,int,int,int,float*); 00052 void draw(); 00056 GLuint * getTexture(); 00057 00058 void pressed(int,int); 00059 void released(int,int); 00060 void drag(int,int); 00061 00062 bool isInside(int,int); 00063 ~VTransferFunction(void); 00064 }; 00065 00066 #endif