00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00027 #ifndef DISPLAYRAMP_H
00028 #define DISPLAYRAMP_H
00029
00030
00031 #ifdef __APPLE__
00032 #include <OpenGL/gl.h>
00033 #else
00034 #include <GL/gl.h>
00035 #endif
00036
00037
00038 namespace Tools { namespace TransferFunction
00039 {
00066 class Ramp
00067 {
00068 public:
00069 Ramp();
00070 Ramp(float low, float high, float opacity=1);
00071 ~Ramp();
00072
00074 void update(float low, float high, float opacity);
00075
00077 void clamp(float left, float right);
00078
00080 void display() const;
00081
00083 bool mouse(float x, float y);
00084
00086 bool motion(float x, float y);
00087
00089 void get(float i, float &r, float &g, float &b, float &a) const;
00090
00092 void setColor(float r, float g, float b);
00093
00095 void reshape(int w, int h);
00096
00097 private:
00098 float m_low;
00099 float m_high;
00100 float m_opacity;
00101 float m_left;
00102 float m_right;
00103 float m_low_u;
00104 float m_high_u;
00105 float m_aspectratio;
00106 float m_low_color[3];
00107 float m_middle_color[3];
00108 float m_high_color[3];
00109
00113 enum feature { NONE, LOW, MIDDLE, HIGH };
00114 feature m_feature;
00115 };
00116
00117
00118 }}
00119
00120 #endif