v2.0.0
Loading...
Searching...
No Matches
DISPLIB::ChannelRhiView Class Reference

ChannelRhiView – QRhiWidget-based channel signal renderer. More...

#include <channelrhiview.h>

Classes

struct  EventMarker
 Stimulus / event marker — a coloured vertical line at a given sample. More...
struct  AnnotationSpan
 Time-span annotation overlay. More...

Signals

void scrollSampleChanged (float sample)
void samplesPerPixelChanged (float spp)
void viewResized (int newWidth, int newHeight)
void channelOffsetChanged (int firstChannel)
void sampleClicked (int sample)
void sampleRangeSelected (int startSample, int endSample)
void annotationBoundaryMoved (int annotationIndex, bool isStartBoundary, int newSample)
void cursorDataChanged (float timeSec, float amplitude, const QString &channelName, const QString &unitLabel)

Public Member Functions

 ChannelRhiView (QWidget *parent=nullptr)
 ~ChannelRhiView () override
void setModel (ChannelDataModel *model)
void setEvents (const QVector< EventMarker > &events)
void setEpochMarkers (const QVector< int > &triggerSamples)
void setEpochMarkersVisible (bool visible)
bool epochMarkersVisible () const
void setClippingVisible (bool visible)
bool clippingVisible () const
void setZScoreMode (bool enabled)
bool zScoreMode () const
void setAnnotations (const QVector< AnnotationSpan > &annotations)
void setAnnotationSelectionEnabled (bool enabled)
void setEventsVisible (bool visible)
bool eventsVisible () const
void setAnnotationsVisible (bool visible)
bool annotationsVisible () const
float scrollSample () const
float samplesPerPixel () const
void setScrollSample (float sample)
void setSamplesPerPixel (float spp)
void scrollTo (float targetSample, int durationMs=200)
void zoomTo (float targetSpp, int durationMs=200)
void setBackgroundColor (const QColor &color)
QColor backgroundColor () const
void setPrefetchFactor (float factor)
int visibleFirstSample () const
int visibleSampleCount () const
void setChannelIndices (const QVector< int > &indices)
int totalLogicalChannels () const
void setFirstVisibleChannel (int ch)
int firstVisibleChannel () const
void setVisibleChannelCount (int count)
int visibleChannelCount () const
void setFrozen (bool frozen)
bool isFrozen () const
void setGridVisible (bool visible)
bool gridVisible () const
void setSfreq (float sfreq)
void setFirstFileSample (int first)
void setLastFileSample (int last)
int lastFileSample () const
void setWheelScrollsChannels (bool channelsMode)
bool wheelScrollsChannels () const
void setScrollSpeedFactor (float factor)
float scrollSpeedFactor () const
void setHideBadChannels (bool hide)
bool hideBadChannels () const
void setCrosshairEnabled (bool enabled)
bool crosshairEnabled () const
void setClockTimeFormat (bool useClock)
bool clockTimeFormat () const
void setScalebarsVisible (bool visible)
bool scalebarsVisible () const
void setButterflyMode (bool enabled)
bool butterflyMode () const

Protected Member Functions

void initialize (QRhiCommandBuffer *cb) override
void render (QRhiCommandBuffer *cb) override
void releaseResources () override
void paintEvent (QPaintEvent *event) override
void drawCrosshair (QPainter &p)
void drawScalebars (QPainter &p)
void drawRulerOverlay (QPainter &p)
void drawAnnotationSelectionOverlay (QPainter &p)
void emitCursorData ()
bool rulerActive () const
bool annotationSelecting () const
void resizeEvent (QResizeEvent *event) override
void wheelEvent (QWheelEvent *event) override
void mousePressEvent (QMouseEvent *event) override
void mouseMoveEvent (QMouseEvent *event) override
void mouseReleaseEvent (QMouseEvent *event) override
void mouseDoubleClickEvent (QMouseEvent *event) override

Properties

float scrollSample
float samplesPerPixel

Friends

class ::CrosshairOverlay

Detailed Description

ChannelRhiView – QRhiWidget-based channel signal renderer.

The raw browser uses QRhiWidget as its only supported rendering backend. It renders channel traces via a custom GLSL pipeline with min/max decimation, while smooth scrolling and zoom animations are driven by Q_PROPERTY so that QPropertyAnimation can be used directly.

Definition at line 92 of file channelrhiview.h.

Inheritance diagram for DISPLIB::ChannelRhiView:
Inheritance graph

Constructor & Destructor Documentation

◆ ChannelRhiView()

ChannelRhiView::ChannelRhiView ( QWidget * parent = nullptr)
explicit

Definition at line 160 of file channelrhiview.cpp.

◆ ~ChannelRhiView()

ChannelRhiView::~ChannelRhiView ( )
overridedefault

Member Function Documentation

◆ annotationBoundaryMoved

void DISPLIB::ChannelRhiView::annotationBoundaryMoved ( int annotationIndex,
bool isStartBoundary,
int newSample )
signal

Emitted when the user finishes dragging an annotation boundary.

Parameters
[in]annotationIndexIndex in the annotation span list.
[in]isStartBoundaryTrue if the start boundary was dragged.
[in]newSampleNew absolute sample position of the boundary.

◆ annotationSelecting()

bool DISPLIB::ChannelRhiView::annotationSelecting ( ) const
inlineprotected

Definition at line 444 of file channelrhiview.h.

◆ annotationsVisible()

bool ChannelRhiView::annotationsVisible ( ) const

Definition at line 768 of file channelrhiview.cpp.

◆ backgroundColor()

QColor DISPLIB::ChannelRhiView::backgroundColor ( ) const
inline

Definition at line 223 of file channelrhiview.h.

◆ butterflyMode()

bool DISPLIB::ChannelRhiView::butterflyMode ( ) const
inline

Definition at line 383 of file channelrhiview.h.

◆ channelOffsetChanged

void DISPLIB::ChannelRhiView::channelOffsetChanged ( int firstChannel)
signal

Emitted whenever the first visible channel index changes.

◆ clippingVisible()

bool DISPLIB::ChannelRhiView::clippingVisible ( ) const
inline

Definition at line 149 of file channelrhiview.h.

◆ clockTimeFormat()

bool DISPLIB::ChannelRhiView::clockTimeFormat ( ) const
inline

Definition at line 365 of file channelrhiview.h.

◆ crosshairEnabled()

bool DISPLIB::ChannelRhiView::crosshairEnabled ( ) const
inline

Definition at line 359 of file channelrhiview.h.

◆ cursorDataChanged

void DISPLIB::ChannelRhiView::cursorDataChanged ( float timeSec,
float amplitude,
const QString & channelName,
const QString & unitLabel )
signal

Emitted continuously when the crosshair is active and the mouse moves.

Parameters
[in]timeSecTime at cursor in seconds relative to file start.
[in]amplitudeRaw amplitude value under the cursor in physical units.
[in]channelNameName of the channel under the cursor.
[in]unitLabelShort unit label ("T", "V", "AU", …).

◆ drawAnnotationSelectionOverlay()

void ChannelRhiView::drawAnnotationSelectionOverlay ( QPainter & p)
protected

Definition at line 2384 of file channelrhiview.cpp.

◆ drawCrosshair()

void ChannelRhiView::drawCrosshair ( QPainter & p)
protected

Definition at line 2028 of file channelrhiview.cpp.

◆ drawRulerOverlay()

void ChannelRhiView::drawRulerOverlay ( QPainter & p)
protected

Definition at line 2234 of file channelrhiview.cpp.

◆ drawScalebars()

void ChannelRhiView::drawScalebars ( QPainter & p)
protected

Definition at line 2154 of file channelrhiview.cpp.

◆ emitCursorData()

void ChannelRhiView::emitCursorData ( )
protected

Definition at line 2118 of file channelrhiview.cpp.

◆ epochMarkersVisible()

bool DISPLIB::ChannelRhiView::epochMarkersVisible ( ) const
inline

Definition at line 146 of file channelrhiview.h.

◆ eventsVisible()

bool ChannelRhiView::eventsVisible ( ) const

Definition at line 755 of file channelrhiview.cpp.

◆ firstVisibleChannel()

int DISPLIB::ChannelRhiView::firstVisibleChannel ( ) const
inline

Definition at line 271 of file channelrhiview.h.

◆ gridVisible()

bool DISPLIB::ChannelRhiView::gridVisible ( ) const
inline

Definition at line 295 of file channelrhiview.h.

◆ hideBadChannels()

bool DISPLIB::ChannelRhiView::hideBadChannels ( ) const
inline

Definition at line 348 of file channelrhiview.h.

◆ initialize()

void ChannelRhiView::initialize ( QRhiCommandBuffer * cb)
overrideprotected

Definition at line 791 of file channelrhiview.cpp.

◆ isFrozen()

bool DISPLIB::ChannelRhiView::isFrozen ( ) const
inline

Definition at line 288 of file channelrhiview.h.

◆ lastFileSample()

int DISPLIB::ChannelRhiView::lastFileSample ( ) const
inline

Definition at line 322 of file channelrhiview.h.

◆ mouseDoubleClickEvent()

void ChannelRhiView::mouseDoubleClickEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2801 of file channelrhiview.cpp.

◆ mouseMoveEvent()

void ChannelRhiView::mouseMoveEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2557 of file channelrhiview.cpp.

◆ mousePressEvent()

void ChannelRhiView::mousePressEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2476 of file channelrhiview.cpp.

◆ mouseReleaseEvent()

void ChannelRhiView::mouseReleaseEvent ( QMouseEvent * event)
overrideprotected

Definition at line 2689 of file channelrhiview.cpp.

◆ paintEvent()

void ChannelRhiView::paintEvent ( QPaintEvent * event)
overrideprotected

Definition at line 1591 of file channelrhiview.cpp.

◆ releaseResources()

void ChannelRhiView::releaseResources ( )
overrideprotected

Definition at line 800 of file channelrhiview.cpp.

◆ render()

void ChannelRhiView::render ( QRhiCommandBuffer * cb)
overrideprotected

Definition at line 1407 of file channelrhiview.cpp.

◆ resizeEvent()

void ChannelRhiView::resizeEvent ( QResizeEvent * event)
overrideprotected

Definition at line 2427 of file channelrhiview.cpp.

◆ rulerActive()

bool DISPLIB::ChannelRhiView::rulerActive ( ) const
inlineprotected

Definition at line 443 of file channelrhiview.h.

◆ sampleClicked

void DISPLIB::ChannelRhiView::sampleClicked ( int sample)
signal

Emitted whenever the user clicks; provides the sample index under the cursor.

◆ sampleRangeSelected

void DISPLIB::ChannelRhiView::sampleRangeSelected ( int startSample,
int endSample )
signal

Emitted when the user selects a time span with Shift+drag in annotation mode.

◆ samplesPerPixel()

float DISPLIB::ChannelRhiView::samplesPerPixel ( ) const
inline

Definition at line 178 of file channelrhiview.h.

◆ samplesPerPixelChanged

void DISPLIB::ChannelRhiView::samplesPerPixelChanged ( float spp)
signal

◆ scalebarsVisible()

bool DISPLIB::ChannelRhiView::scalebarsVisible ( ) const
inline

Definition at line 374 of file channelrhiview.h.

◆ scrollSample()

float DISPLIB::ChannelRhiView::scrollSample ( ) const
inline

Definition at line 177 of file channelrhiview.h.

◆ scrollSampleChanged

void DISPLIB::ChannelRhiView::scrollSampleChanged ( float sample)
signal

◆ scrollSpeedFactor()

float DISPLIB::ChannelRhiView::scrollSpeedFactor ( ) const
inline

Definition at line 336 of file channelrhiview.h.

◆ scrollTo()

void ChannelRhiView::scrollTo ( float targetSample,
int durationMs = 200 )

Smoothly animate the scroll position.

Parameters
[in]targetSampleTarget left-edge sample index.
[in]durationMsAnimation duration in milliseconds (0 = instant).

Definition at line 331 of file channelrhiview.cpp.

◆ setAnnotations()

void ChannelRhiView::setAnnotations ( const QVector< AnnotationSpan > & annotations)

Set the list of time-span annotations to overlay on the traces.

Parameters
[in]annotationsList of AnnotationSpan objects.

Definition at line 729 of file channelrhiview.cpp.

◆ setAnnotationSelectionEnabled()

void ChannelRhiView::setAnnotationSelectionEnabled ( bool enabled)

Enable or disable annotation range selection. When enabled, Shift+drag emits sampleRangeSelected on mouse release instead of acting as a pure measurement tool.

Definition at line 739 of file channelrhiview.cpp.

◆ setAnnotationsVisible()

void ChannelRhiView::setAnnotationsVisible ( bool visible)

Definition at line 759 of file channelrhiview.cpp.

◆ setBackgroundColor()

void ChannelRhiView::setBackgroundColor ( const QColor & color)

Background colour of the render surface.

Parameters
[in]colorThe new background colour.

Definition at line 364 of file channelrhiview.cpp.

◆ setButterflyMode()

void ChannelRhiView::setButterflyMode ( bool enabled)

Toggle butterfly mode: all channels of the same type are overlaid in a single lane.

Definition at line 537 of file channelrhiview.cpp.

◆ setChannelIndices()

void ChannelRhiView::setChannelIndices ( const QVector< int > & indices)

Restrict rendering to a specific subset of channel indices. When indices is empty all channels in the model are shown (no filter). When set, scrolling and visible-channel-count are relative to this subset.

Parameters
[in]indicesOrdered list of model channel indices to display. Pass an empty vector to clear the filter.

Definition at line 600 of file channelrhiview.cpp.

◆ setClippingVisible()

void ChannelRhiView::setClippingVisible ( bool visible)

Definition at line 706 of file channelrhiview.cpp.

◆ setClockTimeFormat()

void DISPLIB::ChannelRhiView::setClockTimeFormat ( bool useClock)
inline

Set whether the crosshair label uses clock time (mm:ss.ms) or seconds.

Definition at line 364 of file channelrhiview.h.

◆ setCrosshairEnabled()

void ChannelRhiView::setCrosshairEnabled ( bool enabled)

Enable or disable the crosshair cursor overlay. When enabled, a vertical + horizontal cross follows the mouse and the view continuously emits cursorDataChanged() with the time/amplitude under the cursor.

Definition at line 511 of file channelrhiview.cpp.

◆ setEpochMarkers()

void ChannelRhiView::setEpochMarkers ( const QVector< int > & triggerSamples)

Definition at line 684 of file channelrhiview.cpp.

◆ setEpochMarkersVisible()

void ChannelRhiView::setEpochMarkersVisible ( bool visible)

Definition at line 694 of file channelrhiview.cpp.

◆ setEvents()

void ChannelRhiView::setEvents ( const QVector< EventMarker > & events)

Set the list of stimulus / event markers to overlay on the traces. Each marker is drawn as a coloured vertical line spanning all channel rows, with a small colour-coded label chip at the bottom of the view. Pass an empty vector to clear all markers.

Parameters
[in]eventsList of EventMarker objects.

Definition at line 674 of file channelrhiview.cpp.

◆ setEventsVisible()

void ChannelRhiView::setEventsVisible ( bool visible)

Definition at line 746 of file channelrhiview.cpp.

◆ setFirstFileSample()

void ChannelRhiView::setFirstFileSample ( int first)

Set the absolute sample index of the first sample in the file. Used to align grid tick lines with the time ruler labels.

Parameters
[in]firstAbsolute sample index of the file's first sample.

Definition at line 458 of file channelrhiview.cpp.

◆ setFirstVisibleChannel()

void ChannelRhiView::setFirstVisibleChannel ( int ch)

Set the index of the first visible channel row.

Parameters
[in]chZero-based channel index (within the active filter if any).

Definition at line 395 of file channelrhiview.cpp.

◆ setFrozen()

void ChannelRhiView::setFrozen ( bool frozen)

Freeze or unfreeze drag-panning (mouse drag and inertia). Wheel scroll and the scrollbar remain active when frozen.

Definition at line 425 of file channelrhiview.cpp.

◆ setGridVisible()

void ChannelRhiView::setGridVisible ( bool visible)

Show or hide the time and amplitude grid overlay.

Definition at line 436 of file channelrhiview.cpp.

◆ setHideBadChannels()

void ChannelRhiView::setHideBadChannels ( bool hide)

Show or hide waveform traces of channels marked bad. When hide is true bad channels are removed from the logical channel list used for scrolling and rendering so the trace lanes collapse upward in sync with the label panel.

Parameters
[in]hidetrue = remove bad channels from the visible trace list.

Definition at line 477 of file channelrhiview.cpp.

◆ setLastFileSample()

void ChannelRhiView::setLastFileSample ( int last)

Set the absolute sample index of the last sample in the file. Used to clamp scrolling so mouse pan cannot exceed the file end. Pass -1 (default) for unlimited.

Parameters
[in]lastAbsolute sample index of the file's last sample.

Definition at line 470 of file channelrhiview.cpp.

◆ setModel()

void ChannelRhiView::setModel ( ChannelDataModel * model)

Attach the data model. The view does NOT take ownership.

Parameters
[in]modelThe channel data model to render.

Definition at line 232 of file channelrhiview.cpp.

◆ setPrefetchFactor()

void ChannelRhiView::setPrefetchFactor ( float factor)

How many samples to prefetch beyond the visible window on each side (in multiples of the visible window). Default = 1.0.

Parameters
[in]factorPrefetch factor.

Definition at line 374 of file channelrhiview.cpp.

◆ setSamplesPerPixel()

void ChannelRhiView::setSamplesPerPixel ( float spp)

Set the horizontal zoom (samples per screen pixel). Triggers a VBO rebuild with new decimation.

Parameters
[in]sppSamples per pixel (> 1 = zoomed out, < 1 = zoomed in).

Definition at line 316 of file channelrhiview.cpp.

◆ setScalebarsVisible()

void ChannelRhiView::setScalebarsVisible ( bool visible)

Show or hide per-channel-type scalebars in the bottom-right corner.

Definition at line 527 of file channelrhiview.cpp.

◆ setScrollSample()

void ChannelRhiView::setScrollSample ( float sample)

Set the left-edge scroll position. Updates only the GPU uniform — no VBO rebuild unless the prefetch window is exhausted.

Parameters
[in]sampleAbsolute sample index for the left viewport edge.

Definition at line 261 of file channelrhiview.cpp.

◆ setScrollSpeedFactor()

void ChannelRhiView::setScrollSpeedFactor ( float factor)

Definition at line 504 of file channelrhiview.cpp.

◆ setSfreq()

void ChannelRhiView::setSfreq ( float sfreq)

Set the sampling frequency (Hz) used to place time-grid tick lines. Call this from ChannelDataView::init() after FiffInfo is available.

Definition at line 448 of file channelrhiview.cpp.

◆ setVisibleChannelCount()

void ChannelRhiView::setVisibleChannelCount ( int count)

Set how many channel rows are displayed simultaneously.

Parameters
[in]countNumber of channels to show (clamped to 1–model count).

Definition at line 411 of file channelrhiview.cpp.

◆ setWheelScrollsChannels()

void ChannelRhiView::setWheelScrollsChannels ( bool channelsMode)

Control what the vertical mouse wheel scrolls. When channelsMode is true the vertical wheel scrolls through channels. When false the vertical wheel scrolls through time (same as horizontal).

Parameters
[in]channelsModetrue = vertical wheel → channels, false → time.

Definition at line 497 of file channelrhiview.cpp.

◆ setZScoreMode()

void ChannelRhiView::setZScoreMode ( bool enabled)

Definition at line 717 of file channelrhiview.cpp.

◆ totalLogicalChannels()

int ChannelRhiView::totalLogicalChannels ( ) const

Total number of logical channels available for scrolling (respects active filter).

Definition at line 618 of file channelrhiview.cpp.

◆ viewResized

void DISPLIB::ChannelRhiView::viewResized ( int newWidth,
int newHeight )
signal

◆ visibleChannelCount()

int DISPLIB::ChannelRhiView::visibleChannelCount ( ) const
inline

Definition at line 280 of file channelrhiview.h.

◆ visibleFirstSample()

int ChannelRhiView::visibleFirstSample ( ) const

Returns the absolute sample index currently shown at x = 0 (left edge). (Same as scrollSample rounded to int.)

Definition at line 381 of file channelrhiview.cpp.

◆ visibleSampleCount()

int ChannelRhiView::visibleSampleCount ( ) const

Returns the number of samples currently visible.

Definition at line 388 of file channelrhiview.cpp.

◆ wheelEvent()

void ChannelRhiView::wheelEvent ( QWheelEvent * event)
overrideprotected

Definition at line 2440 of file channelrhiview.cpp.

◆ wheelScrollsChannels()

bool DISPLIB::ChannelRhiView::wheelScrollsChannels ( ) const
inline

Definition at line 333 of file channelrhiview.h.

◆ zoomTo()

void ChannelRhiView::zoomTo ( float targetSpp,
int durationMs = 200 )

Smoothly animate the zoom level.

Parameters
[in]targetSppTarget samples-per-pixel.
[in]durationMsAnimation duration in milliseconds (0 = instant).

Definition at line 347 of file channelrhiview.cpp.

◆ zScoreMode()

bool DISPLIB::ChannelRhiView::zScoreMode ( ) const
inline

Definition at line 152 of file channelrhiview.h.

◆ ::CrosshairOverlay

friend class ::CrosshairOverlay
friend

Definition at line 437 of file channelrhiview.h.

Property Documentation

◆ samplesPerPixel

float DISPLIB::ChannelRhiView::samplesPerPixel
readwrite

Definition at line 97 of file channelrhiview.h.

◆ scrollSample

float DISPLIB::ChannelRhiView::scrollSample
readwrite

Definition at line 96 of file channelrhiview.h.


The documentation for this class was generated from the following files: