MNE-CPP  beta 1.0
projectionmodel.h
Go to the documentation of this file.
1 //=============================================================================================================
38 #ifndef PROJECTIONMODEL_H
39 #define PROJECTIONMODEL_H
40 
41 //*************************************************************************************************************
42 //=============================================================================================================
43 // INCLUDES
44 //=============================================================================================================
45 
46 #include "../Utils/types.h"
47 
48 
49 //*************************************************************************************************************
50 //=============================================================================================================
51 // Qt INCLUDES
52 //=============================================================================================================
53 
54 #include <QAbstractTableModel>
55 
56 
57 //*************************************************************************************************************
58 //=============================================================================================================
59 // Eigen INCLUDES
60 //=============================================================================================================
61 
62 #include <Eigen/Core>
63 
64 
65 //*************************************************************************************************************
66 //=============================================================================================================
67 // MNE INCLUDES
68 //=============================================================================================================
69 
70 #include <fiff/fiff.h>
71 
72 
73 //*************************************************************************************************************
74 //=============================================================================================================
75 // USED NAMESPACES
76 //=============================================================================================================
77 
78 using namespace Eigen;
79 using namespace FIFFLIB;
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // DEFINE NAMESPACE MNEBrowseRawQt
85 //=============================================================================================================
86 
87 namespace MNEBrowseRawQt
88 {
89 
90 //=============================================================================================================
94 class ProjectionModel : public QAbstractTableModel
95 {
96  Q_OBJECT
97 public:
98  ProjectionModel(QObject *parent = 0);
99  ProjectionModel(QObject *parent, QFile& qFile);
100  ProjectionModel(QObject *parent, QList<FiffProj>& dataProjs);
101 
102  //=========================================================================================================
106  virtual int rowCount(const QModelIndex & parent = QModelIndex()) const;
107  virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
108  virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
109  virtual QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;
110  virtual bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole);
111  virtual Qt::ItemFlags flags(const QModelIndex & index) const;
112  virtual bool insertRows(int position, int span, const QModelIndex & parent = QModelIndex());
113  virtual bool removeRows(int position, int span, const QModelIndex & parent = QModelIndex());
114 
115  //=========================================================================================================
121  bool loadProjections(QFile& qFile);
122 
123  //=========================================================================================================
129  bool saveProjections(QFile& qFile);
130 
131  //=========================================================================================================
137  void addProjections(const QList<FiffProj>& dataProjs);
138 
139  //=========================================================================================================
145  void addProjections(const FiffInfo &fiffInfo);
146 
149  //=========================================================================================================
153  void clearModel();
154 
155 protected:
156  QList<FiffProj> m_dataProjs;
158 signals:
159  //=========================================================================================================
163  void fileLoaded(bool);
164 };
165 
166 } // NAMESPACE
167 
168 
169 
170 #endif // PROJECTIONMODEL_H
FIFF measurement file information.
Definition: fiff_info.h:96
Definition: fiff.h:98
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...