v2.0.0
Loading...
Searching...
No Matches
overviewbarwidget.h
Go to the documentation of this file.
1//=============================================================================================================
18
19#ifndef OVERVIEWBARWIDGET_H
20#define OVERVIEWBARWIDGET_H
21
22//=============================================================================================================
23// INCLUDES
24//=============================================================================================================
25
26#include "../../disp_global.h"
27#include "channelrhiview.h"
28
29//=============================================================================================================
30// QT INCLUDES
31//=============================================================================================================
32
33#include <QImage>
34#include <QPointer>
35#include <QWidget>
36
37//=============================================================================================================
38// DEFINE NAMESPACE DISPLIB
39//=============================================================================================================
40
41namespace DISPLIB
42{
43
44//=============================================================================================================
45// DISPLIB FORWARD DECLARATIONS
46//=============================================================================================================
47
49
50//=============================================================================================================
59{
60 Q_OBJECT
61
62public:
63 static constexpr int kBarHeight = 48;
64
65 explicit OverviewBarWidget(QWidget *parent = nullptr);
66
67 void setModel(ChannelDataModel *model);
68
69 void setFirstFileSample(int first);
70 void setLastFileSample(int last);
71 void setSfreq(float sfreq);
72
73 void setViewport(float scrollSample, float visibleSamples);
74
75 void setEvents(const QVector<ChannelRhiView::EventMarker> &events);
76 void setAnnotations(const QVector<ChannelRhiView::AnnotationSpan> &annotations);
77
78 QSize sizeHint() const override;
79 QSize minimumSizeHint() const override;
80
81signals:
82 void scrollRequested(float targetSample);
83
84protected:
85 void paintEvent(QPaintEvent *event) override;
86 void mousePressEvent(QMouseEvent *event) override;
87 void mouseMoveEvent(QMouseEvent *event) override;
88 void mouseReleaseEvent(QMouseEvent *event) override;
89
90private:
91 float xToSample(int x) const;
92 void rebuildEnvelope();
93
94 QPointer<ChannelDataModel> m_model;
95 int m_firstFileSample = 0;
96 int m_lastFileSample = -1;
97 float m_sfreq = 1000.f;
98
99 float m_scrollSample = 0.f;
100 float m_visibleSamples = 0.f;
101
102 QVector<ChannelRhiView::EventMarker> m_events;
103 QVector<ChannelRhiView::AnnotationSpan> m_annotations;
104
105 QImage m_envelopeImage;
106 bool m_envelopeDirty = true;
107
108 bool m_dragging = false;
109};
110
111} // namespace DISPLIB
112
113#endif // OVERVIEWBARWIDGET_H
QRhi-based GPU-accelerated channel time-series renderer used by the modern raw browser.
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
Circular-buffer Qt model exposing a rolling window of the live FIFF stream as a table.
void scrollRequested(float targetSample)
void paintEvent(QPaintEvent *event) override
QSize sizeHint() const override
QSize minimumSizeHint() const override
void setAnnotations(const QVector< ChannelRhiView::AnnotationSpan > &annotations)
void setModel(ChannelDataModel *model)
void mouseMoveEvent(QMouseEvent *event) override
void setEvents(const QVector< ChannelRhiView::EventMarker > &events)
void mousePressEvent(QMouseEvent *event) override
void mouseReleaseEvent(QMouseEvent *event) override
OverviewBarWidget(QWidget *parent=nullptr)
void setViewport(float scrollSample, float visibleSamples)
static constexpr int kBarHeight