00001 #ifndef TRANSFERFUNCTIONVIEWER_H
00002 #define TRANSFERFUNCTIONVIEWER_H
00003
00004
00005 #include <qwidget.h>
00006 #include <qevent.h>
00007 #include <qpainter.h>
00008
00009
00010 #include "transferFunction.h"
00011
00012
00014
00018 class transferFunctionViewer : public QWidget
00019 {
00020 Q_OBJECT
00021
00022 public:
00024
00027 transferFunctionViewer (QWidget *parent, const char *name);
00029 ~transferFunctionViewer ();
00031
00034 void setHistogram (unsigned int histo [256]);
00036
00039 void setTransferFunction (transferFunction *transFunction);
00041
00045 void setWindowing (int begin, int end);
00046
00047 public slots:
00049
00052 void setCurrent (int index);
00053
00054 protected:
00055 void paintEvent (QPaintEvent *event);
00056
00057 private:
00058 void paintHistogram (QPainter *paint);
00059 void paintTransferFunctions (QPainter *paint);
00060 void paintWindowing (QPainter *paint);
00061
00062
00063 unsigned int histogram[256];
00064 int current;
00065 bool windowing;
00066 int windowing_begin, windowing_end;
00067 transferFunction *transFunc;
00068
00069 };
00070
00071 #endif // TRANSFERFUNCTIONVIEWER