41 #include "../common/metatreeitem.h"
42 #include "../../3dhelpers/geometrymultiplier.h"
43 #include "../../materials/geometrymultipliermaterial.h"
53 #include <Qt3DExtras/QCuboidGeometry>
54 #include <Qt3DCore/QEntity>
55 #include <Qt3DExtras/QSphereGeometry>
67 using namespace DISP3DLIB;
83 this->setEditable(
false);
84 this->setCheckable(
true);
85 this->setCheckState(Qt::Checked);
86 this->setToolTip(this->text());
92 const QString& sDataType,
93 const QStringList& bads)
95 if(sDataType ==
"MEG") {
97 }
else if (sDataType ==
"EEG") {
105 const QStringList& bads)
107 if(lChInfo.isEmpty()) {
108 qDebug() <<
"SensorPositionTreeItem::plotMEGSensors - Channel data is empty. Returning.";
137 QVector<QMatrix4x4> vTransforms;
138 vTransforms.reserve(lChInfo.size());
139 QVector<QColor> vColorsNodes;
142 for(
int i = 0; i < lChInfo.size(); ++i) {
143 QMatrix4x4 tempTransform;
145 tempPos.setX(lChInfo[i].chpos.r0(0));
146 tempPos.setY(lChInfo[i].chpos.r0(1));
147 tempPos.setZ(lChInfo[i].chpos.r0(2));
149 tempTransform.translate(tempPos);
152 for(
int j = 0; j < 4; ++j) {
153 tempTransform(j, 0) = lChInfo[i].coil_trans.row(j)(0);
154 tempTransform(j, 1) = lChInfo[i].coil_trans.row(j)(1);
155 tempTransform(j, 2) = lChInfo[i].coil_trans.row(j)(2);
158 if(!vTransforms.contains(tempTransform)) {
159 vTransforms.push_back(tempTransform);
162 if(bads.contains(lChInfo.at(i).ch_name)) {
163 vColorsNodes.push_back(QColor(255,0,0));
165 vColorsNodes.push_back(QColor(100,100,100));
174 QList<QStandardItem*> items = this->
findChildren(MetaTreeItemTypes::Color);
176 for(
int i = 0; i < items.size(); ++i) {
179 data.setValue(QColor(100,100,100));
180 item->setData(data, MetaTreeItemRoles::Color);
181 item->setData(data, Qt::DecorationRole);
189 const QStringList& bads)
191 if(lChInfo.isEmpty()) {
192 qDebug() <<
"SensorPositionTreeItem::plotEEGSensors - Channel data is empty. Returning.";
219 QVector<QMatrix4x4> vTransforms;
220 vTransforms.reserve(lChInfo.size());
221 QVector<QColor> vColorsNodes;
224 for(
int i = 0; i < lChInfo.size(); ++i) {
225 QMatrix4x4 tempTransform;
227 tempPos.setX(lChInfo[i].chpos.r0(0));
228 tempPos.setY(lChInfo[i].chpos.r0(1));
229 tempPos.setZ(lChInfo[i].chpos.r0(2));
231 tempTransform.translate(tempPos);
233 vTransforms.push_back(tempTransform);
235 if(bads.contains(lChInfo.at(i).ch_name)) {
236 vColorsNodes.push_back(Qt::red);
238 vColorsNodes.push_back(Qt::gray);
247 QList<QStandardItem*> items = this->
findChildren(MetaTreeItemTypes::Color);
249 for(
int i = 0; i < items.size(); ++i) {
252 data.setValue(QColor(100,100,100));
253 item->setData(data, MetaTreeItemRoles::Color);
254 item->setData(data, Qt::DecorationRole);