MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
sensorsurfacetreeitem.cpp
Go to the documentation of this file.
1//=============================================================================================================
36//=============================================================================================================
37// INCLUDES
38//=============================================================================================================
39
41#include "../common/metatreeitem.h"
42#include "../../3dhelpers/renderable3Dentity.h"
43#include "../../materials/pervertexphongalphamaterial.h"
44#include "../../3dhelpers/custommesh.h"
45
46#include <mne/mne_bem.h>
47
48//=============================================================================================================
49// QT INCLUDES
50//=============================================================================================================
51
52//=============================================================================================================
53// EIGEN INCLUDES
54//=============================================================================================================
55
56//=============================================================================================================
57// USED NAMESPACES
58//=============================================================================================================
59
60using namespace DISP3DLIB;
61using namespace Eigen;
62using namespace MNELIB;
63
64//=============================================================================================================
65// DEFINE MEMBER METHODS
66//=============================================================================================================
67
68SensorSurfaceTreeItem::SensorSurfaceTreeItem(Qt3DCore::QEntity *p3DEntityParent, int iType, const QString& text)
69: AbstractMeshTreeItem(p3DEntityParent, iType, text)
70{
71 initItem();
72}
73
74//=============================================================================================================
75
77{
78 this->setEditable(false);
79 this->setCheckable(true);
80 this->setCheckState(Qt::Checked);
81 this->setToolTip("Sensor surface item");
82
83 //Set material to enable sorting
85 this->setMaterial(pBemMaterial);
86}
87
88//=============================================================================================================
89
91{
92 //Create color from curvature information with default gyri and sulcus colors
93 MatrixX4f matVertColor = createVertColor(tSensorSurface.rr.rows());
94
95 //Set renderable 3D entity mesh and color data
96 m_pCustomMesh->setMeshData(tSensorSurface.rr,
97 tSensorSurface.nn,
98 tSensorSurface.tris,
99 matVertColor,
100 Qt3DRender::QGeometryRenderer::Triangles);
101
102 //Add data which is held by this SensorSurfaceTreeItem
103 QVariant data;
104
105 data.setValue(tSensorSurface.rr.rows());
106 this->setData(data, Data3DTreeModelItemRoles::NumberVertices);
107}
108
MNEBem class declaration.
SensorSurfaceTreeItem class declaration.
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)
SensorSurfaceTreeItem(Qt3DCore::QEntity *p3DEntityParent=0, int iType=Data3DTreeModelItemTypes::SensorSurfaceItem, const QString &text="Sensor Surface")
void addData(const MNELIB::MNEBemSurface &tSensorSurface)
PerVertexPhongAlphaMaterial is provides a Qt3D material with own shader support.
BEM surface provides geometry information.
Eigen::MatrixX3i tris