Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef RINGEDITOR_H
00029 #define RINGEDITOR_H
00030
00031 #include <SciFigs.h>
00032
00033 #include "ui_RingEditor.h"
00034 #include "GeopsyGuiDLLExport.h"
00035
00036 namespace GeopsyGui {
00037
00038 #define RingEditor_MinCol 0
00039 #define RingEditor_MaxCol 1
00040 #define RingEditor_PairsNumCol 2
00041 #define RingEditor_ColorCol 3
00042
00043 class ArrayMap;
00044
00045 class RingEditorDelegate : public QItemDelegate
00046 {
00047 Q_OBJECT
00048 public:
00049 RingEditorDelegate(QObject *parent=0);
00050
00051 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00052 const QModelIndex &index) const;
00053 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00054 void setModelData(QWidget *editor, QAbstractItemModel *model,
00055 const QModelIndex &index) const;
00056 private slots:
00057 inline void commitSpin();
00058 };
00059
00060 inline void RingEditorDelegate::commitSpin()
00061 {
00062 TRACE;
00063 DoubleSpinBox * w=qobject_cast<DoubleSpinBox *>(sender());
00064 if(w) emit commitData (w);
00065 }
00066
00067 class GEOPSYGUI_EXPORT RingEditor : public QWidget, public Ui::RingEditor
00068 {
00069 Q_OBJECT
00070 public:
00071 RingEditor(QWidget* parent=0, Qt::WFlags fl=0);
00072 ~RingEditor();
00073
00074 int countPairs(int ringIndex);
00075 int ringCount();
00076 public slots:
00077 void setCoArrayGraph(ArrayMap * w);
00078 void addBut_clicked();
00079 void removeBut_clicked();
00080 void on_rings_itemClicked(QTableWidgetItem * item);
00081 void on_rings_itemChanged(QTableWidgetItem * item);
00082 void updateCounts();
00083 void updateGraph();
00084 void loadBut_clicked();
00085 void load(QString fileName);
00086 void saveBut_clicked();
00087 void optimizeBut_clicked();
00088 private:
00089 void initRow(int row);
00090 CircleViewer * _circleLayer;
00091 };
00092
00093 }
00094
00095 #endif // RINGEDITOR_H