MNE-CPP  beta 1.0
frequencyspectrumdelegate.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef FREQUENCYSPECTRUMDELEGATE_H
37 #define FREQUENCYSPECTRUMDELEGATE_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // QT INCLUDES
42 //=============================================================================================================
43 #include <QAbstractItemDelegate>
44 #include <QTableView>
45 #include <QMouseEvent>
46 
47 //*************************************************************************************************************
48 //=============================================================================================================
49 // Eigen INCLUDES
50 //=============================================================================================================
51 
52 #include <Eigen/Core>
53 
54 
55 //*************************************************************************************************************
56 //=============================================================================================================
57 // DEFINE NAMESPACE XDISPLIB
58 //=============================================================================================================
59 
60 namespace XDISPLIB
61 {
62 
63 
64 //*************************************************************************************************************
65 //=============================================================================================================
66 // USED NAMESPACES
67 //=============================================================================================================
68 
69 using namespace Eigen;
70 
71 
72 //=============================================================================================================
78 class FrequencySpectrumDelegate : public QAbstractItemDelegate
79 {
80  Q_OBJECT
81 public:
82  //=========================================================================================================
88  FrequencySpectrumDelegate(QTableView* m_pTableView,QObject *parent = 0);
89 
90  //=========================================================================================================
96  void setScaleType(qint8 ScaleType);
97 
98  //=========================================================================================================
108  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
109 
110  //=========================================================================================================
117  virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
118 
119  //=========================================================================================================
129  void rcvMouseLoc( int row, int x, int y, QRect visRect);
130 
131 private:
132  //=========================================================================================================
139  void capturePoint(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorXd& data, QPainter *painter) const;
140 
141  //=========================================================================================================
148  void createPlotPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorXd& data) const;
149 
150  //=========================================================================================================
157  void createGridPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorXd& data) const;
158 
159  //=========================================================================================================
165  void createGridTick(const QModelIndex &index, const QStyleOptionViewItem &option, QPainter *painter) const;
166 
167 
168  // Scaling
169  float m_fMaxValue;
170  float m_fScaleY;
172  QTableView * m_tableview;
175  int m_tableview_row;
176  int m_mousex;
177  int m_mousey;
178  QRect m_visRect;
179  float m_x_rate;
182  qint8 m_iScaleType;
186 };
187 
188 } // NAMESPACE
189 
190 #endif // FREQUENCYSPECTRUMDELEGATE_H
The FrequencySpectrumDelegate class represents a RTMSA delegate which creates the plot paths...