54 #include <OpenMEEG_Export.h>
95 Sensors(): m_nb(0), m_geo(NULL) {}
97 Sensors(
const char* filename): m_geo(NULL) { this->load(filename,
't'); }
98 Sensors(
const char* filename,
const Geometry& g): m_geo(&g) { this->load(filename,
't'); };
103 void load(
const char* filename,
char filetype =
't' );
104 void load(std::istream &in);
105 void save(
const char* filename);
107 size_t getNumberOfSensors()
const {
return m_nb; }
108 size_t getNumberOfPositions()
const {
return m_positions.nlin(); }
110 Matrix& getPositions() {
return m_positions ; }
111 Matrix getPositions()
const {
return m_positions ; }
113 Matrix& getOrientations() {
return m_orientations ; }
114 Matrix getOrientations()
const {
return m_orientations ; }
116 Strings& getNames() {
return m_names ; }
117 Strings getNames()
const {
return m_names ; }
119 bool hasRadii()
const {
return m_radii.nlin() > 0 ;}
120 bool hasOrientations()
const {
return m_orientations.nlin() > 0 ;}
121 bool hasNames()
const {
return m_names.size() == m_nb ;}
122 Vector getPosition(
size_t idx)
const;
123 Vector getOrientation(
size_t idx)
const;
124 std::string getName(
size_t idx)
const{ om_assert(idx < m_names.size());
return m_names[idx]; }
125 void setPosition(
size_t idx, Vector& pos);
126 void setOrientation(
size_t idx, Vector& orient);
128 bool hasSensor(std::string name)
const;
129 size_t getSensorIdx(std::string name)
const;
130 Triangles getInjectionTriangles(
size_t idx)
const { om_assert(idx < m_triangles.size());
return m_triangles[idx]; }
137 bool isEmpty() {
if(m_nb == 0)
return true;
else return false; }
150 void findInjectionTriangles();
170 m_nb(labels.size()), m_names(labels), m_positions(positions), m_orientations(orientations),m_weights(weights), m_radii(radii)
172 std::cout <<
"const" << labels.size() << std::endl;
174 for ( std::size_t i = 0; i < labels.size(); ++i) {
180 m_nb(labels.size()), m_names(labels), m_positions(positions), m_orientations(orientations),m_weights(weights), m_radii(radii), m_geo(&g)
186 for ( std::size_t i = 0; i < labels.size(); ++i) {