v2.0.0
Loading...
Searching...
No Matches
mne_layout.h
Go to the documentation of this file.
1//=============================================================================================================
18
19#ifndef MNE_LAYOUT_H
20#define MNE_LAYOUT_H
21
22//=============================================================================================================
23// INCLUDES
24//=============================================================================================================
25
26#include "mne_global.h"
27#include "mne_layout_port.h"
28
29#include <QMap>
30#include <QPointF>
31#include <QRectF>
32#include <QString>
33#include <QStringList>
34
35#include <optional>
36#include <vector>
37
38#include <Eigen/Core>
39
40//=============================================================================================================
41// DEFINE NAMESPACE MNELIB
42//=============================================================================================================
43
44namespace MNELIB
45{
46
47//=============================================================================================================
54{
55public:
56 //=========================================================================================================
64 static std::optional<MNELayout> read(const QString& path);
65
66 //=========================================================================================================
72 QMap<QString, QPointF> channelPositions() const;
73
74 //=========================================================================================================
82 int matchPorts(const QString& channel);
83
84 //=========================================================================================================
92 int matchPorts(const QStringList& channels);
93
94 //=========================================================================================================
100 const Eigen::MatrixXi& matches() const
101 {
102 return m_matches;
103 }
104
105 //=========================================================================================================
113 int portAt(const QPointF& point) const;
114
115 //=========================================================================================================
126 int confine(const QRectF& area);
127
128 //=========================================================================================================
133 {
134 m_visible = m_extent;
135 }
136
137 //=========================================================================================================
145 bool isVisible(const MNELayoutPort& port) const;
146
147 //=========================================================================================================
153 QRectF extent() const
154 {
155 return m_extent;
156 }
157
158 //=========================================================================================================
164 QRectF visibleArea() const
165 {
166 return m_visible;
167 }
168
169 QString fileName;
170 std::vector<MNELayoutPort> ports;
171
172private:
173 QRectF m_extent;
174 QRectF m_visible;
175 Eigen::MatrixXi m_matches;
176};
177
178} // namespace MNELIB
179
180#endif // MNE_LAYOUT_H
One viewport of an MNELIB::MNELayout, i.e. a box in layout coordinates and the channels drawn in it.
MNELIB shared-library export/import macros and library build metadata.
#define MNESHARED_EXPORT
Definition mne_global.h:40
Core MNE data structures (source spaces, source estimates, hemispheres).
Plotter layout with viewports, channel matching and zoom.
Definition mne_layout.h:54
int matchPorts(const QString &channel)
QRectF extent() const
Definition mne_layout.h:153
const Eigen::MatrixXi & matches() const
Definition mne_layout.h:100
QRectF visibleArea() const
Definition mne_layout.h:164
static std::optional< MNELayout > read(const QString &path)
std::vector< MNELayoutPort > ports
Definition mne_layout.h:170
QMap< QString, QPointF > channelPositions() const
Single viewport of a plotter layout (one line of an MNE-C .lout file).