MNE-CPP  0.1.9
A Framework for Electrophysiology
custommesh.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef DISP3DLIB_CUSTOMMESH_H
37 #define DISP3DLIB_CUSTOMMESH_H
38 
39 //=============================================================================================================
40 // INCLUDES
41 //=============================================================================================================
42 
43 #include "../../../disp3D_global.h"
44 
45 //=============================================================================================================
46 // QT INCLUDES
47 //=============================================================================================================
48 
49 #include <Qt3DRender/QGeometryRenderer>
50 #include <QPointer>
51 
52 //=============================================================================================================
53 // EIGEN INCLUDES
54 //=============================================================================================================
55 
56 #include <Eigen/Core>
57 
58 //=============================================================================================================
59 // FORWARD DECLARATIONS
60 //=============================================================================================================
61 
62 namespace Qt3DRender {
63  class QBuffer;
64 }
65 
66 //=============================================================================================================
67 // DEFINE NAMESPACE DISP3DLIB
68 //=============================================================================================================
69 
70 namespace DISP3DLIB
71 {
72 
73 //=============================================================================================================
74 // DISP3DLIB FORWARD DECLARATIONS
75 //=============================================================================================================
76 
77 //=============================================================================================================
83 class DISP3DSHARED_EXPORT CustomMesh : public Qt3DRender::QGeometryRenderer
84 {
85  Q_OBJECT
86 
87 public:
88  typedef QSharedPointer<CustomMesh> SPtr;
89  typedef QSharedPointer<const CustomMesh> ConstSPtr;
91  //=========================================================================================================
95  CustomMesh();
96 
97  //=========================================================================================================
107  CustomMesh(const Eigen::MatrixX3f& tMatVert,
108  const Eigen::MatrixX3f& tMatNorm,
109  const Eigen::MatrixXi& tMatTris,
110  const Eigen::MatrixX4f &tMatColors,
111  Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType = Qt3DRender::QGeometryRenderer::Triangles);
112 
113  //=========================================================================================================
117  ~CustomMesh();
118 
119  //=========================================================================================================
125  void setColor(const Eigen::MatrixX4f &tMatColors);
126 
127  //=========================================================================================================
133  void setNormals(const Eigen::MatrixX3f& tMatNorm);
134 
135  //=========================================================================================================
141  void setVertex(const Eigen::MatrixX3f& tMatVert);
142 
143  //=========================================================================================================
149  void setIndex(const Eigen::MatrixXi &tMatTris);
150 
151  //=========================================================================================================
161  void setMeshData(const Eigen::MatrixX3f& tMatVert,
162  const Eigen::MatrixX3f& tMatNorm,
163  const Eigen::MatrixXi& tMatTris,
164  const Eigen::MatrixX4f &tMatColors,
165  Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType = Qt3DRender::QGeometryRenderer::Triangles);
166 
167  //=========================================================================================================
173  void addAttribute(Qt3DRender::QAttribute *pAttribute);
174 
175 protected:
176  //=========================================================================================================
180  void init();
181 
182  QPointer<Qt3DRender::QBuffer> m_pVertexDataBuffer;
183  QPointer<Qt3DRender::QBuffer> m_pNormalDataBuffer;
184  QPointer<Qt3DRender::QBuffer> m_pColorDataBuffer;
185  QPointer<Qt3DRender::QBuffer> m_pIndexDataBuffer;
187  QPointer<Qt3DRender::QGeometry> m_pCustomGeometry;
189  QPointer<Qt3DRender::QAttribute> m_pIndexAttribute;
190  QPointer<Qt3DRender::QAttribute> m_pVertexAttribute;
191  QPointer<Qt3DRender::QAttribute> m_pNormalAttribute;
192  QPointer<Qt3DRender::QAttribute> m_pColorAttribute;
195 };
196 } // NAMESPACE
197 
198 #endif // DISP3DLIB_CUSTOMMESH_H
DISP3DLIB::CustomMesh::ConstSPtr
QSharedPointer< const CustomMesh > ConstSPtr
Definition: custommesh.h:89
DISP3DLIB::CustomMesh::SPtr
QSharedPointer< CustomMesh > SPtr
Definition: custommesh.h:88
DISP3DLIB::CustomMesh::m_pVertexDataBuffer
QPointer< Qt3DRender::QBuffer > m_pVertexDataBuffer
Definition: custommesh.h:182
DISP3DLIB::CustomMesh
Custom mesh functionality.
Definition: custommesh.h:83
DISP3DLIB::CustomMesh::m_iNumVert
int m_iNumVert
Definition: custommesh.h:194
DISP3DLIB::CustomMesh::m_pCustomGeometry
QPointer< Qt3DRender::QGeometry > m_pCustomGeometry
Definition: custommesh.h:187
DISP3DLIB::CustomMesh::m_pNormalDataBuffer
QPointer< Qt3DRender::QBuffer > m_pNormalDataBuffer
Definition: custommesh.h:183
DISP3DLIB::CustomMesh::m_pColorAttribute
QPointer< Qt3DRender::QAttribute > m_pColorAttribute
Definition: custommesh.h:192
DISP3DLIB::CustomMesh::m_pVertexAttribute
QPointer< Qt3DRender::QAttribute > m_pVertexAttribute
Definition: custommesh.h:190
DISP3DLIB::CustomMesh::m_pColorDataBuffer
QPointer< Qt3DRender::QBuffer > m_pColorDataBuffer
Definition: custommesh.h:184
DISP3DLIB::CustomMesh::m_pIndexAttribute
QPointer< Qt3DRender::QAttribute > m_pIndexAttribute
Definition: custommesh.h:189
DISP3DSHARED_EXPORT
#define DISP3DSHARED_EXPORT
Definition: disp3D_global.h:55
DISP3DLIB::CustomMesh::m_pNormalAttribute
QPointer< Qt3DRender::QAttribute > m_pNormalAttribute
Definition: custommesh.h:191
DISP3DLIB::CustomMesh::m_pIndexDataBuffer
QPointer< Qt3DRender::QBuffer > m_pIndexDataBuffer
Definition: custommesh.h:185