v2.0.0
Loading...
Searching...
No Matches
MNELIB::MNELayout Class Reference

Plotter layout with viewports, channel matching and zoom. More...

#include <mne_layout.h>

Public Member Functions

QMap< QString, QPointF > channelPositions () const
int matchPorts (const QString &channel)
int matchPorts (const QStringList &channels)
const Eigen::MatrixXi & matches () const
int portAt (const QPointF &point) const
int confine (const QRectF &area)
void resetConfine ()
bool isVisible (const MNELayoutPort &port) const
QRectF extent () const
QRectF visibleArea () const

Static Public Member Functions

static std::optional< MNELayout > read (const QString &path)

Public Attributes

QString fileName
std::vector< MNELayoutPort > ports

Detailed Description

Plotter layout with viewports, channel matching and zoom.

Definition at line 53 of file mne_layout.h.

Member Function Documentation

◆ channelPositions()

QMap< QString, QPointF > MNELayout::channelPositions ( ) const

Returns the lower-left corner of every channel's viewport, keyed by the name in the file.

Returns
Channel name -> viewport origin; a port listing several channels contributes each of them.

Definition at line 135 of file mne_layout.cpp.

◆ confine()

int MNELayout::confine ( const QRectF & area)

Zooms to the ports inside area (MNE-C mne_lout_confine).

The visible area becomes the bounding box of those ports plus a 1 % margin; without any port inside it stays unchanged.

Parameters
[in]areaThe requested area; corners may be given in either order.
Returns
The number of ports inside the area.

Definition at line 193 of file mne_layout.cpp.

◆ extent()

QRectF MNELIB::MNELayout::extent ( ) const
inline

Returns the drawing area given on the first line of the file.

Returns
The extent in layout coordinates.

Definition at line 153 of file mne_layout.h.

◆ isVisible()

bool MNELayout::isVisible ( const MNELayoutPort & port) const

Returns whether a port lies completely inside the visible area.

Parameters
[in]portA port of this layout.
Returns
True if the port is visible.

Definition at line 213 of file mne_layout.cpp.

◆ matches()

const Eigen::MatrixXi & MNELIB::MNELayout::matches ( ) const
inline

Returns which port shows which channel after matchPorts(const QStringList&).

Returns
Ports x channels, 1 where the port shows the channel.

Definition at line 100 of file mne_layout.h.

◆ matchPorts() [1/2]

int MNELayout::matchPorts ( const QString & channel)

Marks the visible ports that show channel (MNE-C mne_lout_match_ports).

Parameters
[in]channelA channel name in any spelling.
Returns
The number of ports marked.

Definition at line 148 of file mne_layout.cpp.

◆ matchPorts() [2/2]

int MNELayout::matchPorts ( const QStringList & channels)

Matches many channels at once (MNE-C mne_lout_match_ports_many) and fills matches().

Parameters
[in]channelsChannel names in any spelling.
Returns
The number of port/channel pairs found.

Definition at line 160 of file mne_layout.cpp.

◆ portAt()

int MNELayout::portAt ( const QPointF & point) const

Returns the port whose interior contains a point.

Parameters
[in]pointA point in layout coordinates.
Returns
The index into ports, or -1.

Definition at line 183 of file mne_layout.cpp.

◆ read()

std::optional< MNELayout > MNELayout::read ( const QString & path)
static

Reads an MNE-C .lout file.

Parameters
[in]pathThe layout file.
Returns
The layout, or no value if the file cannot be read or a line is malformed.

Definition at line 72 of file mne_layout.cpp.

◆ resetConfine()

void MNELIB::MNELayout::resetConfine ( )
inline

Shows the whole layout again.

Definition at line 132 of file mne_layout.h.

◆ visibleArea()

QRectF MNELIB::MNELayout::visibleArea ( ) const
inline

Returns the area currently shown (the extent unless confine() zoomed in).

Returns
The visible area in layout coordinates.

Definition at line 164 of file mne_layout.h.

Member Data Documentation

◆ fileName

QString MNELIB::MNELayout::fileName

File this layout was read from.

Definition at line 169 of file mne_layout.h.

◆ ports

std::vector<MNELayoutPort> MNELIB::MNELayout::ports

Viewports in file order.

Definition at line 170 of file mne_layout.h.


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