41 #include "../common/metatreeitem.h"
42 #include "../../3dhelpers/renderable3Dentity.h"
43 #include "../../3dhelpers/custommesh.h"
44 #include "../../3dhelpers/geometrymultiplier.h"
45 #include "../../materials/geometrymultipliermaterial.h"
53 #include <Qt3DExtras/QSphereGeometry>
66 using namespace Eigen;
67 using namespace MNELIB;
68 using namespace DISP3DLIB;
74 SourceSpaceTreeItem::SourceSpaceTreeItem(Qt3DCore::QEntity *p3DEntityParent,
int iType,
const QString& text)
84 this->setEditable(
false);
85 this->setCheckable(
true);
86 this->setCheckState(Qt::Checked);
87 this->setToolTip(
"Source space item");
102 Qt3DRender::QGeometryRenderer::Triangles);
107 data.setValue(tHemisphere.
rr.rows());
108 this->
setData(data, Data3DTreeModelItemRoles::NumberVertices);
121 QEntity* pSourceSphereEntity =
new QEntity(
this);
124 QSharedPointer<Qt3DExtras::QSphereGeometry> pSourceSphereGeometry = QSharedPointer<Qt3DExtras::QSphereGeometry>::create();
125 pSourceSphereGeometry->setRadius(0.00075f);
130 QVector<QMatrix4x4> vTransforms;
139 QMatrix4x4 tempTransform;
142 tempPos.setX(sourcePos(0));
143 tempPos.setY(sourcePos(1));
144 tempPos.setZ(sourcePos(2));
147 tempTransform.translate(tempPos);
148 vTransforms.push_back(tempTransform);
153 vTransforms.reserve(tHemisphere.
vertno.rows());
155 for(
int i = 0; i < tHemisphere.
vertno.rows(); i++)
157 QMatrix4x4 tempTransform;
158 const RowVector3f& sourcePos = tHemisphere.
rr.row(tHemisphere.
vertno(i));
160 tempPos.setX(sourcePos(0));
161 tempPos.setY(sourcePos(1));
162 tempPos.setZ(sourcePos(2));
165 tempTransform.translate(tempPos);
166 vTransforms.push_back(tempTransform);
172 pSourceSphereEntity->addComponent(pSphereMesh);
176 QColor defaultColor(212, 28, 92);
180 pSourceSphereEntity->addComponent(pMaterial);