FlowVis 1.0

FlowVis/LayerWidget.h

00001 #ifndef LAYERWIDGET_H
00002 #define LAYERWIDGET_H
00003 #include "transfersettingswidget.h"
00004 
00005 #define TYPE_TEXTURE 0
00006 #define TYPE_ARROWS 1
00007 #define TYPE_STREAMLINES 2
00008 
00009 #include <QDataStream>
00010 #include <QtGui>
00011 
00022 
00023 class LayerWidget : public QWidget
00024 {
00025         Q_OBJECT
00026         
00027 public:
00028         LayerWidget(QWidget *parent=NULL);
00029         ~LayerWidget();
00030         
00042         friend QDataStream &operator<<(QDataStream &out, const LayerWidget *layer);
00043 
00055         friend QDataStream &operator>>(QDataStream &in, LayerWidget *layer);
00056 private:
00057         QPushButton *up,*down,*remove;
00058 
00059         QGroupBox * box;
00060         QComboBox *comboBoxType;
00061         QComboBox *comboBoxChannel;
00062 
00063         QLabel *labelType;
00064         QLabel *labelChannel;
00065 
00066         QGridLayout  *grid;
00067 
00068         TransferSettingsWidget *transfer;
00069         QHBoxLayout *layout;
00070 
00081         void connectSignals();
00082 
00083 signals:
00095         void buttonClicked(int button,LayerWidget *sender);
00096 
00108         void typeChanged(int newType, LayerWidget *sender);
00109 
00121         void channelChanged(int newChannel, LayerWidget *sender);
00122 
00134         void transferImageUpdated(const QImage& image, LayerWidget *sender);
00135         
00136 
00137 private slots:
00147         void downButtonClicked(){emit buttonClicked(0,this);}
00148 
00158         void upButtonClicked(){emit buttonClicked(1,this);}
00159 
00169         void removeButtonClicked(){emit buttonClicked(2,this);}
00170 
00181         void typeComboBoxChanged(const QString &text);
00182 
00193         void channelComboBoxChanged(int index){emit channelChanged(index,this);}
00194 
00205         void transferImageUpdated(const QImage& image){emit transferImageUpdated(image,this);}
00206         
00207 public slots:
00208 
00219         void channelCountChanged(int channels);
00220 };
00221 
00222 
00223 QDataStream &operator<<(QDataStream &out, const LayerWidget *layer);
00224 
00225 
00226 QDataStream &operator>>(QDataStream &in, LayerWidget *layer);
00227 
00228 #endif // LAYERWIDGET_H
 All Classes Functions Variables Friends