MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
rtfiffrawviewdelegate.h
Go to the documentation of this file.
1//=============================================================================================================
38#ifndef RTFIFFRAWVIEWDELEGATE_H
39#define RTFIFFRAWVIEWDELEGATE_H
40
41//=============================================================================================================
42// INCLUDES
43//=============================================================================================================
44
45#include "../../disp_global.h"
46#include "../scalingview.h"
47
48//=============================================================================================================
49// QT INCLUDES
50//=============================================================================================================
51
52#include <QAbstractItemDelegate>
53#include <QPen>
54#include <QPainterPath>
55
56//=============================================================================================================
57// EIGEN INCLUDES
58//=============================================================================================================
59
60//=============================================================================================================
61// FORWARD DECLARATIONS
62//=============================================================================================================
63
64namespace RTPROCESSINGLIB{
65 class EventList;
66}
67
68//=============================================================================================================
69// DEFINE NAMESPACE DISPLIB
70//=============================================================================================================
71
72namespace DISPLIB
73{
74
75//=============================================================================================================
76// DISPLIB FORWARD DECLARATIONS
77//=============================================================================================================
78
79class RtFiffRawView;
80
81//=============================================================================================================
82// DEFINE TYPEDEFS
83//=============================================================================================================
84
85typedef QPair<const double*,qint32> RowVectorPair;
86
87//=============================================================================================================
93class DISPSHARED_EXPORT RtFiffRawViewDelegate : public QAbstractItemDelegate
94{
95 Q_OBJECT
96
97public:
98 typedef QSharedPointer<RtFiffRawViewDelegate> SPtr;
99 typedef QSharedPointer<const RtFiffRawViewDelegate> ConstSPtr;
101 //=========================================================================================================
108
109 //=========================================================================================================
115 void initPainterPaths(const QAbstractTableModel *model);
116
117 //=========================================================================================================
127 virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
128
129 //=========================================================================================================
136 virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
137
138 //=========================================================================================================
145 void markerMoved(QPoint position, int activeRow);
146
147 //=========================================================================================================
153 void setSignalColor(const QColor& signalColor);
154
155 //=========================================================================================================
161 QColor getSignalColor();
162
163 //=========================================================================================================
170 void setUpperItemIndex(int iUpperItemIndex);
171
172private:
173 //=========================================================================================================
182 void createPlotPath(const QModelIndex &index,
183 const QStyleOptionViewItem &option,
184 QPainterPath& path,
185 const DISPLIB::RowVectorPair &data) const;
186
187 //=========================================================================================================
195 void createCurrentPositionMarkerPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path) const;
196
197 //=========================================================================================================
206 void createGridPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data) const;
207
208 //=========================================================================================================
217 void createTimeSpacersPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data) const;
218
219 //=========================================================================================================
229 void createTriggerPath(QPainter *painter, const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data) const;
230
231 //=========================================================================================================
241 void createTriggerThresholdPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data, QPointF &textPosition) const;
242
243 //=========================================================================================================
250 void createMarkerPath(const QModelIndex &index, const QStyleOptionViewItem &option, QPainterPath& path) const;
251
252 //=========================================================================================================
262 inline QPointF calcPoint(QPainterPath& path, const double dx, const double y, const double ybase, const double yScale) const;
263
264 //=========================================================================================================
269 inline double retrieveSamplingPeriod() const;
270
271 RtFiffRawView* m_pParent;
272 QPoint m_markerPosition;
273 QList<QPainterPath> m_painterPaths;
275 double m_dMaxValue;
276 double m_dScaleY;
277 int m_iActiveRow;
278 int m_iUpperItemIndex;
280 QPen m_penMarker;
281 QPen m_penGrid;
282 QPen m_penTimeSpacers;
283 QPen m_penFreeze;
284 QPen m_penFreezeSelected;
285 QPen m_penFreezeBad;
286 QPen m_penFreezeSelectedBad;
287 QPen m_penNormal;
288 QPen m_penNormalSelected;
289 QPen m_penNormalBad;
290 QPen m_penNormalSelectedBad;
292 QMap<double,QColor> m_mapTriggerColors;
293};
294} // NAMESPACE
295
296#endif // RTFIFFRAWVIEWDELEGATE_H
#define DISPSHARED_EXPORT
Definition disp_global.h:55
The RtFiffRawViewDelegate class represents a RTMSA delegate which creates the plot paths.
QSharedPointer< RtFiffRawViewDelegate > SPtr
QSharedPointer< const RtFiffRawViewDelegate > ConstSPtr
The RtFiffRawView class provides a real-time channel view display.