MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
bemsurfacetreeitem.cpp
Go to the documentation of this file.
1//=============================================================================================================
35//=============================================================================================================
36// INCLUDES
37//=============================================================================================================
38
39#include "bemsurfacetreeitem.h"
40#include "../common/metatreeitem.h"
41#include "../../3dhelpers/renderable3Dentity.h"
42#include "../../materials/pervertexphongalphamaterial.h"
43#include "../../3dhelpers/custommesh.h"
44
45#include <mne/mne_bem.h>
46
47//=============================================================================================================
48// QT INCLUDES
49//=============================================================================================================
50
51//=============================================================================================================
52// EIGEN INCLUDES
53//=============================================================================================================
54
55//=============================================================================================================
56// USED NAMESPACES
57//=============================================================================================================
58
59using namespace DISP3DLIB;
60using namespace Eigen;
61using namespace MNELIB;
62
63//=============================================================================================================
64// DEFINE MEMBER METHODS
65//=============================================================================================================
66
67BemSurfaceTreeItem::BemSurfaceTreeItem(Qt3DCore::QEntity *p3DEntityParent, int iType, const QString& text)
68: AbstractMeshTreeItem(p3DEntityParent, iType, text)
69{
70 initItem();
71}
72
73//=============================================================================================================
74
76{
77// //Set material
78// QPointer<PerVertexPhongAlphaMaterial> pBemMaterial = new PerVertexPhongAlphaMaterial(true);
79// this->setMaterial(pBemMaterial);
80}
81
82//=============================================================================================================
83
85{
86 //Create default color
87 MatrixX4f matVertColor = createVertColor(tBemSurface.rr.rows());
88
89 //Set renderable 3D entity mesh and color data
90 m_pCustomMesh->setMeshData(tBemSurface.rr,
91 tBemSurface.nn,
92 tBemSurface.tris,
93 matVertColor,
94 Qt3DRender::QGeometryRenderer::Triangles);
95
96 //Find out BEM layer type and change items name
97 this->setText(MNEBemSurface::id_name(tBemSurface.id));
98
99 //Add data which is held by this BemSurfaceTreeItem
100 QVariant data;
101
102 data.setValue(tBemSurface.rr.rows());
103 this->setData(data, Data3DTreeModelItemRoles::NumberVertices);
104}
MNEBem class declaration.
BemSurfaceTreeItem class declaration.
virtual void initItem() override
void addData(const MNELIB::MNEBemSurface &tBemSurface)
BemSurfaceTreeItem(Qt3DCore::QEntity *p3DEntityParent=0, int iType=Data3DTreeModelItemTypes::BemSurfaceItem, const QString &text="BEM Surface Item")
static Eigen::MatrixX4f createVertColor(int numVert, const QColor &color=QColor(0, 49, 69))
Provides a generic mesh tree item.
virtual void setData(const QVariant &value, int role=Qt::UserRole+1)
BEM surface provides geometry information.
Eigen::MatrixX3i tris
FIFFLIB::fiff_int_t id
static QString id_name(int id)