MNE-CPP  beta 1.0
rawdelegate.h
Go to the documentation of this file.
1 //=============================================================================================================
45 #ifndef RAWDELEGATE_H
46 #define RAWDELEGATE_H
47 
48 //*************************************************************************************************************
49 //=============================================================================================================
50 // INCLUDES
51 //=============================================================================================================
52 
53 #include "../Models/rawmodel.h"
54 #include "../Models/eventmodel.h"
55 
56 #include "../Utils/types.h"
57 #include "../Utils/rawsettings.h"
58 
59 #include "../Windows/scalewindow.h"
60 
61 
62 //*************************************************************************************************************
63 //=============================================================================================================
64 // Qt INCLUDES
65 //=============================================================================================================
66 
67 #include <QDebug>
68 #include <QAbstractItemDelegate>
69 #include <QPainter>
70 #include <QPainterPath>
71 #include <QPointF>
72 #include <QRect>
73 #include <QTableView>
74 
75 
76 //*************************************************************************************************************
77 //=============================================================================================================
78 // MNE INCLUDES
79 //=============================================================================================================
80 
81 #include <fiff/fiff.h>
82 #include <mne/mne.h>
83 
84 
85 //*************************************************************************************************************
86 //=============================================================================================================
87 // Eigen INCLUDES
88 //=============================================================================================================
89 
90 #include <Eigen/Core>
91 #include <Eigen/SparseCore>
92 
93 
94 //*************************************************************************************************************
95 //=============================================================================================================
96 // USED NAMESPACES
97 //=============================================================================================================
98 
99 using namespace Eigen;
100 using namespace MNELIB;
101 
102 
103 //*************************************************************************************************************
104 //=============================================================================================================
105 // DEFINE NAMESPACE MNEBrowseRawQt
106 //=============================================================================================================
107 
108 namespace MNEBrowseRawQt
109 {
110 
111 //*************************************************************************************************************
112 //=============================================================================================================
113 // DEFINE FORWARD DECLARATIONS
114 //=============================================================================================================
115 
116 class ScaleWindow;
117 
118 
119 //=============================================================================================================
123 class RawDelegate : public QAbstractItemDelegate
124 {
125  Q_OBJECT
126 public:
127  RawDelegate(QObject *parent = 0);
128 
129  //=========================================================================================================
134  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
135  virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
136 
137  //=========================================================================================================
145  void setModelView(EventModel *eventModel, QTableView* eventView, QTableView *rawView);
146 
147  //=========================================================================================================
153  void setScaleMap(const QMap<QString, double> &scaleMap);
154 
155  QMap<QString,double> m_scaleMap;
157  // Plots settings
161  bool m_bRemoveDC;
163  // Scaling
164  double m_dMaxValue;
165  double m_dScaleY;
166  double m_dDx;
168 private:
169  //=========================================================================================================
176  void createPlotPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, QList<RowVectorPair>& listPairs, double channelMean) const;
177 
178  //=========================================================================================================
185  void createGridPath(QPainterPath& path, const QStyleOptionViewItem &option, QList<RowVectorPair>& listPairs) const;
186 
187  //=========================================================================================================
194  void plotEvents(const QModelIndex &index, const QStyleOptionViewItem &option, QPainter *painter) const;
195 
196  //Settings
197  qint8 m_nhlines;
198  QSettings m_qSettings;
200  //Event model view
201  EventModel* m_pEventModel;
202  QTableView* m_pEventView;
203  QTableView* m_pRawView;
204  ScaleWindow* m_pScaleWindow;
205 };
206 
207 } // NAMESPACE
208 
209 #endif // RAWDELEGATE_H
QMap< QString, double > m_scaleMap
Definition: rawdelegate.h:155
The ScaleWindow class provides the scale window.
Definition: scalewindow.h:84
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...