MNE-CPP  0.1.9
A Framework for Electrophysiology
mne_msh_display_surface_set.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef MNEMSHDISPLAYSURFACESET_H
37 #define MNEMSHDISPLAYSURFACESET_H
38 
39 //=============================================================================================================
40 // INCLUDES
41 //=============================================================================================================
42 
43 #include "../mne_global.h"
44 
45 typedef void (*mneUserFreeFunc)(void *); /* General purpose */
46 
47 //=============================================================================================================
48 // EIGEN INCLUDES
49 //=============================================================================================================
50 
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include <QSharedPointer>
56 
57 //=============================================================================================================
58 // FORWARD DECLARATIONS
59 //=============================================================================================================
60 
61 namespace FIFFLIB {
62  class FiffCoordTransSet;
63 }
64 
65 //=============================================================================================================
66 // DEFINE NAMESPACE MNELIB
67 //=============================================================================================================
68 
69 namespace MNELIB
70 {
71 
72 //=============================================================================================================
73 // MNELIB FORWARD DECLARATIONS
74 //=============================================================================================================
75 
76 class MneMshDisplaySurface;
77 class MneMshLightSet;
78 class MneSurfacePatch;
79 
80 //=============================================================================================================
87 {
88 public:
89  typedef QSharedPointer<MneMshDisplaySurfaceSet> SPtr;
90  typedef QSharedPointer<const MneMshDisplaySurfaceSet> ConstSPtr;
92  //=========================================================================================================
96  MneMshDisplaySurfaceSet(int nsurf = 0);
97 
98  //=========================================================================================================
103 
104  //============================= display_surfaces.c =============================
105 
106  static MneMshDisplaySurfaceSet* load_new_surface(const QString &subject_id, const QString &surf, const QString &subjects_dir);
107 
108  static void decide_surface_extent(MneMshDisplaySurface* surf,
109  const char *tag);
110 
111  static void decide_curv_display(const char *name,
113 
114  static int add_bem_surface(MneMshDisplaySurfaceSet* surfs,
115  QString filepath,
116  int kind,
117  QString bemname,
118  int full_geom,
119  int check);
120 
121  static void add_replace_display_surface(MneMshDisplaySurfaceSet* surfs,
122  MneMshDisplaySurface* newSurf,
123  bool replace,
124  bool drawable);
125 
126  //============================= vertex_colors.c =============================
127 
128  static void setup_curvature_colors(MneMshDisplaySurface* surf);
129 
130  //============================= eyes.c =============================
131 
132  static void apply_left_right_eyes(MneMshDisplaySurfaceSet* surfs);
133 
134  static void apply_left_eyes(MneMshDisplaySurfaceSet* surfs);
135 
136  //============================= lights.c =============================
137 
138  static void setup_current_surface_lights(MneMshDisplaySurfaceSet* surfs);
139 
140  static void initialize_custom_lights();
141 
142  static MneMshLightSet* dup_light_set(MneMshLightSet* s);
143 
144  static void setup_these_surface_lights(MneMshDisplaySurfaceSet* surfs, MneMshLightSet* set);
145 
146 public:
147  char *subj; /* The name of the subject */
148  char *morph_subj; /* The subject we are morphing to */
149  FIFFLIB::FiffCoordTransSet *main_t; /* Coordinate transformations for the main surfaces */
150  FIFFLIB::FiffCoordTransSet *morph_t; /* Coordinate transformations for the morph surfaces */
151  MneMshDisplaySurface **surfs; /* These are the surfaces */
152  MneSurfacePatch **patches; /* Optional patches for display */
153  float *patch_rot; /* Rotation angles for the (flat) patches */
154  int nsurf; /* How many? */
155  int use_patches; /* Use patches for display? */
156  int *active; /* Which surfaces are currently active */
157  int *drawable; /* Which surfaces could be drawn? */
158  MneMshLightSet* lights; /* Lighting */
159  float rot[3]; /* Rotation angles of the MRI (in radians) */
160  float move[3]; /* Possibly move the origin, too */
161  float fov; /* Field of view (extent of the surface) */
162  float fov_scale; /* How much space to leave */
163  float eye[3]; /* Eye position for viewing (used in composite views) */
164  float up[3]; /* Up vector for viewing */
165  float bg_color[3]; /* Background color */
166  float text_color[3]; /* Text color */
167  void *user_data; /* Can be used to store whatever */
168  mneUserFreeFunc user_data_free;
169 
170 // ### OLD STRUCT ###
171 // typedef struct { /* Set of display surfaces */
172 // char *subj; /* The name of the subject */
173 // char *morph_subj; /* The subject we are morphing to */
174 // coordTransSet main_t; /* Coordinate transformations for the main surfaces */
175 // coordTransSet morph_t; /* Coordinate transformations for the morph surfaces */
176 // mshDisplaySurface *surfs; /* These are the surfaces */
177 // mneSurfacePatch *patches; /* Optional patches for display */
178 // float *patch_rot; /* Rotation angles for the (flat) patches */
179 // int nsurf; /* How many? */
180 // int use_patches; /* Use patches for display? */
181 // int *active; /* Which surfaces are currently active */
182 // int *drawable; /* Which surfaces could be drawn? */
183 // mshLightSet lights; /* Lighting */
184 // float rot[3]; /* Rotation angles of the MRI (in radians) */
185 // float move[3]; /* Possibly move the origin, too */
186 // float fov; /* Field of view (extent of the surface) */
187 // float fov_scale; /* How much space to leave */
188 // float eye[3]; /* Eye position for viewing (used in composite views) */
189 // float up[3]; /* Up vector for viewing */
190 // float bg_color[3]; /* Background color */
191 // float text_color[3]; /* Text color */
192 // void *user_data; /* Can be used to store whatever */
193 // mneUserFreeFunc user_data_free;
194 // } *mshDisplaySurfaceSet,mshDisplaySurfaceSetRec;
195 };
196 
197 //=============================================================================================================
198 // INLINE DEFINITIONS
199 //=============================================================================================================
200 } // NAMESPACE MNELIB
201 
202 #endif // MNEMSHDISPLAYSURFACESET_H
MNELIB::MneMshDisplaySurfaceSet::ConstSPtr
QSharedPointer< const MneMshDisplaySurfaceSet > ConstSPtr
Definition: mne_msh_display_surface_set.h:90
MNELIB::MneSurfacePatch
The MneSurfacePatch class.
Definition: mne_surface_patch.h:80
MNESHARED_EXPORT
#define MNESHARED_EXPORT
Definition: mne_global.h:56
FIFFLIB::FiffCoordTransSet
Coordinate transformation descriptor.
Definition: fiff_coord_trans_set.h:74
MNELIB::MneMshDisplaySurface
The MNE Msh Display Surface class holds information about a surface to be rendered.
Definition: mne_msh_display_surface.h:79
MNELIB::MneMshLightSet
The MneMshLightSet class.
Definition: mne_msh_light_set.h:79
MNELIB::MneMshDisplaySurfaceSet::SPtr
QSharedPointer< MneMshDisplaySurfaceSet > SPtr
Definition: mne_msh_display_surface_set.h:89
MNELIB::MneMshDisplaySurfaceSet
The MNE Msh Display Surface Set class holds information about a set of surfaces to be rendered.
Definition: mne_msh_display_surface_set.h:86