Kinetic Visualization
 All Classes Functions Variables Pages
TransferFunctionWidget.h
1 #pragma once
2 
3 #include <QWidget>
4 #include <QPainter>
5 #include <QMouseEvent>
6 #include <QPointF>
7 
8 #include <QVector>
9 #include "TPoint.h"
10 #include "TransferPoints.h"
11 
12 #define ELEMENTS_PER_COLOR 4
13 #define COLORS_IN_TRANSFER_ARRAY 4096
14 
15 class TransferFunctionWidget : public QWidget
16 {
17  Q_OBJECT
18 
19 public:
21  TransferFunctionWidget(QWidget* parent = 0);
24 
25 
29  void paintEvent( QPaintEvent* e);
31  const QVector<TPoint>& points() const;
34 
36  void saveTransferPoints(QString fileName);
44  void setTranferFunktionApplied(bool apply);
46  float* getTransferTextureData() const;
48  void setHistogram(double* histogram, int size);
50  void SetMode(int mode);
51 
52 public slots:
54  void pointsUpdated(int);
59  void initTransferPoints(QString name, int mode);
60 
61 signals:
63  void changeColor(QColor color);
65  void transferFunctionChanged(float* data, int size, int type);
67  void ColorgradientChanged(float* data, int size, int type);
69  void histogramLoaded(double* histogram, int size);
70 
71 public:
74 
75  void DrawRectangle(float* tex, int i);
76 
77 private:
79  bool tranferFunktionApplied;
81  float* transferFunctionTextureData;
82  float* transferFunctionTextureData2D;
83 
84  int m_type;
85 };