36 #ifndef FREQUENCYSPECTRUMMODEL_H
37 #define FREQUENCYSPECTRUMMODEL_H
43 #include "../../disp_global.h"
51 #include <QAbstractTableModel>
52 #include <QSharedPointer>
90 typedef QSharedPointer<FrequencySpectrumModel>
SPtr;
91 typedef QSharedPointer<const FrequencySpectrumModel>
ConstSPtr;
109 virtual int rowCount(
const QModelIndex &parent = QModelIndex())
const ;
119 virtual int columnCount(
const QModelIndex &parent = QModelIndex())
const;
130 virtual QVariant data(
const QModelIndex &index,
131 int role = Qt::DisplayRole)
const;
143 virtual QVariant headerData(
int section, Qt::Orientation orientation,
144 int role = Qt::DisplayRole)
const;
152 void setInfo(QSharedPointer<FIFFLIB::FiffInfo> &info);
160 void setScaleType(qint8 ScaleType);
168 void addData(
const Eigen::MatrixXd &data);
176 inline QSharedPointer<FIFFLIB::FiffInfo> getInfo()
const;
184 inline Eigen::RowVectorXd getFreqScale()
const;
192 inline Eigen::RowVectorXd getFreqScaleBound()
const;
200 inline qint32 getNumStems()
const;
208 inline const QMap<qint32,qint32>& getIdxSelMap()
const;
216 void selectRows(
const QList<qint32> &selection);
222 void resetSelection();
230 void toggleFreeze(
const QModelIndex &index);
238 inline bool isFreezed()
const;
247 void setBoundaries(
float fLowerFrqBound,
float fUpperFrqBound);
255 inline qint32 getLowerFrqBound()
const;
263 inline qint32 getUpperFrqBound()
const;
272 void newSelection(QList<qint32> selection);
275 QSharedPointer<FIFFLIB::FiffInfo> m_pFiffInfo;
277 QMap<qint32,qint32> m_qMapIdxRowSelection;
279 Eigen::RowVectorXd m_vecFreqScale;
280 Eigen::RowVectorXd m_vecFreqScaleBound;
281 Eigen::MatrixXd m_dataCurrent;
282 Eigen::MatrixXd m_dataCurrentFreeze;
286 qint32 m_iLowerFrqIdx;
287 qint32 m_iUpperFrqIdx;
306 return m_vecFreqScale;
313 return m_vecFreqScaleBound;
320 return m_dataCurrent.cols();
327 return m_qMapIdxRowSelection;
341 return m_iLowerFrqIdx;
348 return m_iUpperFrqIdx;
352 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
353 #ifndef metatype_rowvectorxd
354 #define metatype_rowvectorxd
359 #endif // FREQUENCYSPECTRUMMODEL_H