AwCore
AnyWave core library
AwSensorLayout.h
1 //
3 // Université d’Aix Marseille (AMU) -
4 // Institut National de la Santé et de la Recherche Médicale (INSERM)
5 // Copyright © 2013 AMU, INSERM
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Lesser General Public
9 // License as published by the Free Software Foundation; either
10 // version 3 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Lesser General Public License for more details.
16 //
17 // You should have received a copy of the GNU Lesser General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 //
22 //
23 // Author: Bruno Colombet – Laboratoire UMR INS INSERM 1106 - Bruno.Colombet@univ-amu.fr
24 //
26 #ifndef AW_SENSORLAYOUT_H
27 #define AW_SENSORLAYOUT_H
28 
29 #include <AwSensor.h>
30 #include <AwChannel.h>
31 #include <QHash>
32 
50 {
51 public:
52  enum { Layout3D, Layout2D };
53  // constructor
54  AwSensorLayout(int type, int dimension);
55  ~AwSensorLayout();
56 
58  inline AwSensorList& sensors() { return m_sensors; }
60  AwSensor *sensorFromName(const QString& name);
62  bool addSensor(AwSensor *sensor);
64  bool addSensor(const QString& label, float x, float y, float z);
66  int count();
68  void clear();
70  inline bool is3D() { return m_dimension == Layout3D; }
72  inline bool isMEG() { return m_type == AwChannel::MEG; }
74  inline bool isEEG() { return m_type == AwChannel::EEG; }
75  inline void setDimension(int dim) { m_dimension = dim; }
76 protected:
77  int m_type;
78  int m_dimension;
79  AwSensorList m_sensors;
80  QHash<QString, AwSensor *> m_hashSensors;
81 };
82 
83 typedef QList<AwSensorLayout *> AwSensorLayoutList;
84 #endif
AwSensorLayout describes a set of 3D coordinates for a particular helmet or MEG machine.
Definition: AwSensorLayout.h:49
bool isEEG()
Definition: AwSensorLayout.h:74
bool is3D()
Definition: AwSensorLayout.h:70
AwSensor * sensorFromName(const QString &name)
Definition: AwSensorLayout.cpp:40
void clear()
Definition: AwSensorLayout.cpp:75
AwSensor describes physical properties for a sensor.
Definition: AwSensor.h:47
bool isMEG()
Definition: AwSensorLayout.h:72
int count()
Definition: AwSensorLayout.cpp:70
bool addSensor(AwSensor *sensor)
Definition: AwSensorLayout.cpp:45
AwSensorList & sensors()
Definition: AwSensorLayout.h:58