MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
mne_proj_data.cpp
Go to the documentation of this file.
1//=============================================================================================================
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
40#include "mne_proj_data.h"
41#include "mne_surface_old.h"
42#include "mne_triangle.h"
43
44#define MALLOC_46(x,t) (t *)malloc((x)*sizeof(t))
45
46#ifndef TRUE
47#define TRUE 1
48#endif
49
50#ifndef FALSE
51#define FALSE 0
52#endif
53
54#define X_46 0
55#define Y_46 1
56#define Z_46 2
57
58#define VEC_DOT_46(x,y) ((x)[X_46]*(y)[X_46] + (x)[Y_46]*(y)[Y_46] + (x)[Z_46]*(y)[Z_46])
59
60#define FREE_46(x) if ((char *)(x) != NULL) free((char *)(x))
61
62//=============================================================================================================
63// USED NAMESPACES
64//=============================================================================================================
65
66using namespace MNELIB;
67
68//=============================================================================================================
69// DEFINE MEMBER METHODS
70//=============================================================================================================
71
73{
74 int k;
75 MneTriangle* tri = Q_NULLPTR;
76
77 a = MALLOC_46(s->ntri,float);
78 b = MALLOC_46(s->ntri,float);
79 c = MALLOC_46(s->ntri,float);
80 act = MALLOC_46(s->ntri,int);
81
82 for (k = 0, tri = s->tris; k < s->ntri; k++, tri++) {
83 a[k] = VEC_DOT_46(tri->r12,tri->r12);
84 b[k] = VEC_DOT_46(tri->r13,tri->r13);
85 c[k] = VEC_DOT_46(tri->r12,tri->r13);
86
87 act[k] = TRUE;
88 }
89 nactive = s->ntri;
90}
91
92//=============================================================================================================
93
95{
96 FREE_46(a);
97 FREE_46(b);
98 FREE_46(c);
99}
int k
Definition fiff_tag.cpp:324
MneTriangle class declaration.
MneProjData class declaration.
MneSurfaceOld class declaration.
MneProjData(MNELIB::MneSurfaceOld *s)
This defines a surface.
Triangle data.