MNE-CPP  beta 1.0
brainsurfacemesh.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef BRAINSURFACEMESH_H
37 #define BRAINSURFACEMESH_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "disp3DNew_global.h"
46 #include <mne/mne_sourcespace.h>
47 
48 #include <fs/surfaceset.h>
49 #include <fs/annotationset.h>
50 
51 
52 //*************************************************************************************************************
53 //=============================================================================================================
54 // QT INCLUDES
55 //=============================================================================================================
56 
57 #include <Qt3DRenderer/qt3drenderer_global.h>
58 #include <Qt3DRenderer/QMesh.h>
59 #include <QColor>
60 #include <QMap>
61 
62 
63 //*************************************************************************************************************
64 //=============================================================================================================
65 // Eigen INCLUDES
66 //=============================================================================================================
67 
68 
69 //*************************************************************************************************************
70 //=============================================================================================================
71 // DEFINE NAMESPACE DISP3DLIB
72 //=============================================================================================================
73 
74 namespace DISP3DNEWLIB
75 {
76 
77 //*************************************************************************************************************
78 //=============================================================================================================
79 // FORWARD DECLARATIONS
80 //=============================================================================================================
81 
82 class BrainSurfaceMeshPrivate;
83 
84 
85 //*************************************************************************************************************
86 //=============================================================================================================
87 // USED NAMESPACES
88 //=============================================================================================================
89 
90 using namespace Qt3D;
91 using namespace MNELIB;
92 using namespace FSLIB;
93 
94 
95 //*************************************************************************************************************
96 //=============================================================================================================
97 // FORWARD DECLARATIONS
98 //=============================================================================================================
99 
100 
101 //=============================================================================================================
107 class DISP3DNEWSHARED_EXPORT BrainSurfaceMesh : public QAbstractMesh
108 {
109  Q_OBJECT
110 public:
111  typedef QSharedPointer<BrainSurfaceMesh> SPtr;
112  typedef QSharedPointer<const BrainSurfaceMesh> ConstSPtr;
114  //=========================================================================================================
120  explicit BrainSurfaceMesh(QNode *parent = 0);
121 
122  //=========================================================================================================
130  explicit BrainSurfaceMesh(const Surface &surf, const QMap<int, QColor> &qmVertexColor, QNode *parent = 0);
131 
132  QAbstractMeshFunctorPtr meshFunctor() const Q_DECL_OVERRIDE;
133 
134  void updateActivation(const QMap<int, QColor> &vertexColor);
135 
136  int getNumberOfVertices();
137 
138 protected:
139  void copy(const QNode *ref) Q_DECL_OVERRIDE;
140 
141  Surface m_surface;
142  QMap<int, QColor> m_qmVertexColor;
143  QAbstractMeshFunctorPtr m_pMeshFunctorPtr;
144 
145 private:
146  Q_DECLARE_PRIVATE(BrainSurfaceMesh)
147  QT3D_CLONEABLE(BrainSurfaceMesh)
148 };
149 
150 
151 class DISP3DNEWSHARED_EXPORT BrainSurfaceMeshFunctor : public QAbstractMeshFunctor
152 {
153 
154 public:
155  BrainSurfaceMeshFunctor(const Surface &surf, const QMap<int, QColor> &qmVertexColor);
156  QMeshDataPtr operator ()() Q_DECL_OVERRIDE;
157  bool operator ==(const QAbstractMeshFunctor &other) const Q_DECL_OVERRIDE;
158 
159 private:
160  const Surface m_surface;
161  const QMap<int, QColor> m_qmVertexColor;
162  QMeshDataPtr m_qMeshDataPtr;
163 
164  QMeshDataPtr createSurfaceMesh(const Surface &surface, const QMap<int, QColor> &qmVertexColor);
165 };
166 
167 } // NAMESPACE
168 
169 #endif // BRAINSURFACEMESH_H
QSharedPointer< const BrainSurfaceMesh > ConstSPtr
Holds the data of one hemisphere in form of a mesh.
SurfaceSet class declaration.
FreeSurfer surface mesh.
Definition: surface.h:92
QSharedPointer< BrainSurfaceMesh > SPtr
MNESourceSpace class declaration.
AnnotationSet class declaration.