VideoVis  0.9
Generates a volume visualisation of a video
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
transferbox.h
Go to the documentation of this file.
1 #ifndef TRANSFERBOX_H
2 #define TRANSFERBOX_H
3 
4 #include <QWidget>
5 #include <QColorDialog>
6 #include "hoverpoints.h"
7 
8 #define STEPS 150
9 
11 
17 class TransferBox : public QWidget
18 {
19  Q_OBJECT
20 public:
21  enum ShadeType {
25  };
26 
27  explicit TransferBox(QWidget *parent = 0);
28  QSize sizeHint() const {return QSize(300, 100); }
29  void setPoints(QPolygonF points) {m_points = points;}
33  void addColor(QPolygonF points, QColor color);
37  void deleteColor(QPolygonF points);
41  void changeColor(int index, QColor color);
42 signals:
43  void valueChanged(float *value);
44 public slots:
45 
46 private:
47  void paintEvent(QPaintEvent *event);
48  void mousePressEvent(QMouseEvent *event);
53  QVector<QVector4D> interpolate();
57  float* toFloatArray();
58 
59  QImage m_image;
60  QColorDialog m_dialog;
61  HoverPoints *m_hoverPoints;
62  QVector<QColor> m_colors;
63  QPolygonF m_points;
64 
65 };
66 
67 #endif // TRANSFERBOX_H