MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
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#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
53#define QT_COMPATIBILITY_3D Qt3DRender
54#include <Qt3DRender/QBuffer>
55#include <Qt3DRender/QAttribute>
56#include <Qt3DRender/QGeometry>
57#else
58#include <Qt3DCore/QBuffer>
59#include <Qt3DCore/QAttribute>
60#include <Qt3DCore/QGeometry>
61#define QT_COMPATIBILITY_3D Qt3DCore
62
63#endif
64
65
66//=============================================================================================================
67// EIGEN INCLUDES
68//=============================================================================================================
69
70#include <Eigen/Core>
71
72//=============================================================================================================
73// FORWARD DECLARATIONS
74//=============================================================================================================
75
76//=============================================================================================================
77// DEFINE NAMESPACE DISP3DLIB
78//=============================================================================================================
79
80namespace DISP3DLIB
81{
82
83//=============================================================================================================
84// DISP3DLIB FORWARD DECLARATIONS
85//=============================================================================================================
86
87//=============================================================================================================
93class DISP3DSHARED_EXPORT CustomMesh : public Qt3DRender::QGeometryRenderer
94{
95 Q_OBJECT
96
97public:
98 typedef QSharedPointer<CustomMesh> SPtr;
99 typedef QSharedPointer<const CustomMesh> ConstSPtr;
101 //=========================================================================================================
105 CustomMesh();
106
107 //=========================================================================================================
117 CustomMesh(const Eigen::MatrixX3f& tMatVert,
118 const Eigen::MatrixX3f& tMatNorm,
119 const Eigen::MatrixXi& tMatTris,
120 const Eigen::MatrixX4f &tMatColors,
121 Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType = Qt3DRender::QGeometryRenderer::Triangles);
122
123 //=========================================================================================================
127 ~CustomMesh();
128
129 //=========================================================================================================
135 void setColor(const Eigen::MatrixX4f &tMatColors);
136
137 //=========================================================================================================
143 void setNormals(const Eigen::MatrixX3f& tMatNorm);
144
145 //=========================================================================================================
151 void setVertex(const Eigen::MatrixX3f& tMatVert);
152
153 //=========================================================================================================
159 void setIndex(const Eigen::MatrixXi &tMatTris);
160
161 //=========================================================================================================
171 void setMeshData(const Eigen::MatrixX3f& tMatVert,
172 const Eigen::MatrixX3f& tMatNorm,
173 const Eigen::MatrixXi& tMatTris,
174 const Eigen::MatrixX4f &tMatColors,
175 Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType = Qt3DRender::QGeometryRenderer::Triangles);
176
177 //=========================================================================================================
183 void addAttribute(QT_COMPATIBILITY_3D::QAttribute *pAttribute);
184
185protected:
186 //=========================================================================================================
190 void init();
191
192 QPointer<QT_COMPATIBILITY_3D::QBuffer> m_pVertexDataBuffer;
193 QPointer<QT_COMPATIBILITY_3D::QBuffer> m_pNormalDataBuffer;
194 QPointer<QT_COMPATIBILITY_3D::QBuffer> m_pColorDataBuffer;
195 QPointer<QT_COMPATIBILITY_3D::QBuffer> m_pIndexDataBuffer;
197 QPointer<QT_COMPATIBILITY_3D::QGeometry> m_pCustomGeometry;
199 QPointer<QT_COMPATIBILITY_3D::QAttribute> m_pIndexAttribute;
200 QPointer<QT_COMPATIBILITY_3D::QAttribute> m_pVertexAttribute;
201 QPointer<QT_COMPATIBILITY_3D::QAttribute> m_pNormalAttribute;
202 QPointer<QT_COMPATIBILITY_3D::QAttribute> m_pColorAttribute;
205};
206} // NAMESPACE
207
208#endif // DISP3DLIB_CUSTOMMESH_H
#define DISP3DSHARED_EXPORT
Custom mesh functionality.
Definition custommesh.h:94
QPointer< QT_COMPATIBILITY_3D::QBuffer > m_pNormalDataBuffer
Definition custommesh.h:193
QPointer< QT_COMPATIBILITY_3D::QGeometry > m_pCustomGeometry
Definition custommesh.h:197
QPointer< QT_COMPATIBILITY_3D::QBuffer > m_pColorDataBuffer
Definition custommesh.h:194
QPointer< QT_COMPATIBILITY_3D::QAttribute > m_pColorAttribute
Definition custommesh.h:202
CustomMesh(const Eigen::MatrixX3f &tMatVert, const Eigen::MatrixX3f &tMatNorm, const Eigen::MatrixXi &tMatTris, const Eigen::MatrixX4f &tMatColors, Qt3DRender::QGeometryRenderer::PrimitiveType primitiveType=Qt3DRender::QGeometryRenderer::Triangles)
QPointer< QT_COMPATIBILITY_3D::QBuffer > m_pVertexDataBuffer
Definition custommesh.h:192
QSharedPointer< const CustomMesh > ConstSPtr
Definition custommesh.h:99
QPointer< QT_COMPATIBILITY_3D::QAttribute > m_pNormalAttribute
Definition custommesh.h:201
QPointer< QT_COMPATIBILITY_3D::QAttribute > m_pVertexAttribute
Definition custommesh.h:200
QPointer< QT_COMPATIBILITY_3D::QAttribute > m_pIndexAttribute
Definition custommesh.h:199
QPointer< QT_COMPATIBILITY_3D::QBuffer > m_pIndexDataBuffer
Definition custommesh.h:195
QSharedPointer< CustomMesh > SPtr
Definition custommesh.h:98