MNE-CPP  beta 1.0
brainview.h
1 //=============================================================================================================
36 #ifndef BRAINVIEW_H
37 #define BRAINVIEW_H
38 
39 //*************************************************************************************************************
40 //=============================================================================================================
41 // INCLUDES
42 //=============================================================================================================
43 
44 #include "disp3D_global.h"
45 
46 #include <fs/surfaceset.h>
47 #include <fs/annotationset.h>
48 
49 
50 //*************************************************************************************************************
51 //=============================================================================================================
52 // QT INCLUDES
53 //=============================================================================================================
54 
55 #include "qglview.h"
56 #include <QGeometryData>
57 #include <QGLColorMaterial>
58 
59 #include <QString>
60 
61 
62 //*************************************************************************************************************
63 //=============================================================================================================
64 // Eigen INCLUDES
65 //=============================================================================================================
66 
67 #include <Eigen/Core>
68 
69 
70 //*************************************************************************************************************
71 //=============================================================================================================
72 // FORWARD DECLARATIONS
73 //=============================================================================================================
74 
75 
76 //*************************************************************************************************************
77 //=============================================================================================================
78 // DEFINE NAMESPACE DISP3DLIB
79 //=============================================================================================================
80 
81 namespace DISP3DLIB
82 {
83 
84 //*************************************************************************************************************
85 //=============================================================================================================
86 // USED NAMESPACES
87 //=============================================================================================================
88 
89 using namespace FSLIB;
90 using namespace Eigen;
91 
92 
93 //*************************************************************************************************************
94 //=============================================================================================================
95 // FORWARD DECLARATIONS
96 //=============================================================================================================
97 
98 
99 //=============================================================================================================
106 class DISP3DSHARED_EXPORT BrainView : public QGLView
107 {
108  Q_OBJECT
109 public:
110  typedef QSharedPointer<BrainView> SPtr;
111  typedef QSharedPointer<const BrainView> ConstSPtr;
113  enum ViewOption {
114  ShowCurvature = 0x0
115  };
116  Q_DECLARE_FLAGS(ViewOptions, ViewOption)
117 
118  //=========================================================================================================
122  BrainView();
123 
124  //=========================================================================================================
133  explicit BrainView(const QString &subject_id, qint32 hemi, const QString &surf, const QString &subjects_dir);
134 
135  //=========================================================================================================
145  explicit BrainView(const QString &subject_id, qint32 hemi, const QString &surf, const QString &atlas, const QString &subjects_dir);
146 
147  //=========================================================================================================
153  explicit BrainView(const QString& p_sFile);
154 
155  //=========================================================================================================
159  ~BrainView();
160 
161  void init();
162 
163 protected:
164  //=========================================================================================================
170  void initializeGL(QGLPainter *painter);
171 
172  //=========================================================================================================
178  void paintGL(QGLPainter *painter);
179 
180  //=========================================================================================================
186  void keyPressEvent(QKeyEvent *e);
187 
188  //=========================================================================================================
194  void mouseMoveEvent(QMouseEvent *e);
195 
196  //=========================================================================================================
202  void mousePressEvent(QMouseEvent *e);
203 
204 private:
205  //=========================================================================================================
210  void genSurfacePerVertex();
211 
212  //=========================================================================================================
217  void genSurfacePerRegion();
218 
219  //=========================================================================================================
224  void genSurface();
225 
226  //=========================================================================================================
230  void calcBoundingBox();
231 
232  ViewOptions m_viewOptionFlags;
233 
234  SurfaceSet m_SurfaceSet;
235  AnnotationSet m_AnnotationSet;
238  // GL Stuff
239  bool m_bStereo;
240  bool m_bRenderPerVertex;
242  float m_fOffsetZ;
243  float m_fOffsetZEye;
245  QGLSceneNode *m_pSceneNodeBrain;
246  QGLSceneNode *m_pSceneNode;
248  QGLLightModel *m_pLightModel;
249  QGLLightParameters *m_pLightParametersScene;
251  QGLColorMaterial material;
252 
253 
254  QVector3D m_vecBoundingBoxMin;
255  QVector3D m_vecBoundingBoxMax;
256  QVector3D m_vecBoundingBoxCenter;
257 };
258 
259 Q_DECLARE_OPERATORS_FOR_FLAGS(BrainView::ViewOptions)
260 
261 } // NAMESPACE
262 
263 #endif // BRAINVIEW_H
SurfaceSet class declaration.
disp3D library export/import macros.
FreeSurfer surface visualisation.
Definition: brainview.h:106
Annotation set.
Definition: annotationset.h:96
QSharedPointer< BrainView > SPtr
Definition: brainview.h:110
AnnotationSet class declaration.
QSharedPointer< const BrainView > ConstSPtr
Definition: brainview.h:111
#define DISP3DSHARED_EXPORT
Definition: disp3D_global.h:57
A hemisphere set of surfaces.
Definition: surfaceset.h:83