38 #ifndef RTFIFFRAWVIEWDELEGATE_H
39 #define RTFIFFRAWVIEWDELEGATE_H
45 #include "../../disp_global.h"
46 #include "../scalingview.h"
52 #include <QAbstractItemDelegate>
54 #include <QPainterPath>
64 namespace RTPROCESSINGLIB{
85 typedef QPair<const double*,qint32> RowVectorPair;
98 typedef QSharedPointer<RtFiffRawViewDelegate>
SPtr;
99 typedef QSharedPointer<const RtFiffRawViewDelegate>
ConstSPtr;
115 void initPainterPaths(
const QAbstractTableModel *model);
127 virtual void paint(QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
136 virtual QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index)
const;
145 void markerMoved(QPoint position,
int activeRow);
153 void setSignalColor(
const QColor& signalColor);
161 QColor getSignalColor();
170 void setUpperItemIndex(
int iUpperItemIndex);
182 void createPlotPath(
const QModelIndex &index,
183 const QStyleOptionViewItem &option,
185 const DISPLIB::RowVectorPair &data)
const;
195 void createCurrentPositionMarkerPath(
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path)
const;
206 void createGridPath(
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data)
const;
217 void createTimeSpacersPath(
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data)
const;
229 void createTriggerPath(QPainter *painter,
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data)
const;
241 void createTriggerThresholdPath(
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path, RowVectorPair &data, QPointF &textPosition)
const;
250 void createMarkerPath(
const QModelIndex &index,
const QStyleOptionViewItem &option, QPainterPath& path)
const;
262 inline QPointF calcPoint(QPainterPath& path,
const double dx,
const double y,
const double ybase,
const double yScale)
const;
269 inline double retrieveSamplingPeriod()
const;
272 QPoint m_markerPosition;
273 QList<QPainterPath> m_painterPaths;
278 int m_iUpperItemIndex;
282 QPen m_penTimeSpacers;
284 QPen m_penFreezeSelected;
286 QPen m_penFreezeSelectedBad;
288 QPen m_penNormalSelected;
290 QPen m_penNormalSelectedBad;
292 QMap<double,QColor> m_mapTriggerColors;
296 #endif // RTFIFFRAWVIEWDELEGATE_H