48 #include "../../3dhelpers/renderable3Dentity.h"
59 #include <Qt3DCore/QTransform>
69 using namespace DISP3DLIB;
70 using namespace FIFFLIB;
90 this->setEditable(
false);
91 this->setCheckable(
true);
92 this->setCheckState(Qt::Checked);
93 this->setToolTip(
"Digitizer set item");
106 QList<FIFFLIB::FiffDigPoint> tNasion;
107 QList<FIFFLIB::FiffDigPoint> tLAP;
108 QList<FIFFLIB::FiffDigPoint> tRAP;
109 QList<FIFFLIB::FiffDigPoint> tHpi;
110 QList<FIFFLIB::FiffDigPoint> tEeg;
111 QList<FIFFLIB::FiffDigPoint> tExtra;
113 for(
int i = 0; i < tDigitizer.
size(); ++i){
115 switch (tDigitizer[i].kind) {
116 case FIFFV_POINT_CARDINAL:
118 switch (tDigitizer[i].ident) {
119 case FIFFV_POINT_LPA:
120 tLAP.append(tDigitizer[i]);
121 tLAP.append(tDigitizer[i]);
124 case FIFFV_POINT_NASION:
125 tNasion.append(tDigitizer[i]);
126 tNasion.append(tDigitizer[i]);
129 case FIFFV_POINT_RPA:
130 tRAP.append(tDigitizer[i]);
131 tRAP.append(tDigitizer[i]);
139 case FIFFV_POINT_HPI:
140 tHpi.append(tDigitizer[i]);
143 case FIFFV_POINT_EEG:
144 tEeg.append(tDigitizer[i]);
147 case FIFFV_POINT_EXTRA:
148 tExtra.append(tDigitizer[i]);
221 QList<QStandardItem*> itemList = this->
findChildren(Data3DTreeModelItemTypes::DigitizerItem);
222 bool bFoundNasionlItem =
false;
223 bool bFoundLAPItem =
false;
224 bool bFoundRAPItem =
false;
225 bool bFoundHPIItem =
false;
226 bool bFoundEEGItem =
false;
227 bool bFoundExtraItem =
false;
229 for(
int i = 0; i < itemList.size(); ++i) {
232 if(item == Q_NULLPTR){
233 qDebug() <<
"Dynamic cast returned null. Returning early.";
237 if(item->text() ==
"Nasion" && !tNasion.empty()) {
238 item->
addData(tNasion, 0.002f, Qt::green);
239 bFoundNasionlItem =
true;
242 if(item->text() ==
"LAP" && !tLAP.empty()) {
243 item->
addData(tLAP, 0.002f, Qt::red);
244 bFoundLAPItem =
true;
247 if(item->text() ==
"RAP" && !tRAP.empty()) {
248 item->
addData(tRAP, 0.002f, Qt::blue);
249 bFoundRAPItem =
true;
252 if(item->text() ==
"HPI" && !tHpi.empty()) {
253 item->
addData(tHpi, 0.001f, Qt::darkRed);
254 bFoundHPIItem =
true;
257 if(item->text() ==
"EEG/ECG" && !tEeg.empty()) {
258 item->
addData(tEeg, 0.001f, Qt::cyan);
259 bFoundEEGItem =
true;
262 if(item->text() ==
"Extra" && !tExtra.empty()) {
263 item->
addData(tExtra, 0.001f, Qt::magenta);
264 bFoundExtraItem =
true;
269 if (!bFoundNasionlItem && !tNasion.empty()){
271 QList<QStandardItem*> itemListCardinal;
273 digitizerItem->
addData(tNasion, 0.002f, Qt::green);
274 itemListCardinal << digitizerItem;
275 itemListCardinal <<
new QStandardItem(digitizerItem->toolTip());
276 this->appendRow(itemListCardinal);
279 if (!bFoundLAPItem && !tLAP.empty()){
281 QList<QStandardItem*> itemListCardinal;
283 digitizerItem->
addData(tLAP, 0.002f, Qt::red);
284 itemListCardinal << digitizerItem;
285 itemListCardinal <<
new QStandardItem(digitizerItem->toolTip());
286 this->appendRow(itemListCardinal);
289 if (!bFoundRAPItem && !tRAP.empty()){
291 QList<QStandardItem*> itemListCardinal;
293 digitizerItem->
addData(tRAP, 0.002f, Qt::blue);
294 itemListCardinal << digitizerItem;
295 itemListCardinal <<
new QStandardItem(digitizerItem->toolTip());
296 this->appendRow(itemListCardinal);
299 if (!bFoundHPIItem && !tHpi.empty()){
301 QList<QStandardItem*> itemListHPI;
303 digitizerItem->
addData(tHpi, 0.001f, Qt::darkRed);
304 itemListHPI << digitizerItem;
305 itemListHPI <<
new QStandardItem(digitizerItem->toolTip());
306 this->appendRow(itemListHPI);
309 if (!bFoundEEGItem && !tEeg.empty()){
311 QList<QStandardItem*> itemListEEG;
313 digitizerItem->
addData(tEeg, 0.001f, Qt::cyan);
314 itemListEEG << digitizerItem;
315 itemListEEG <<
new QStandardItem(digitizerItem->toolTip());
316 this->appendRow(itemListEEG);
319 if (!bFoundExtraItem && !tExtra.empty()){
321 QList<QStandardItem*> itemListExtra;
323 digitizerItem->
addData(tExtra, 0.001f, Qt::magenta);
324 itemListExtra << digitizerItem;
325 itemListExtra <<
new QStandardItem(digitizerItem->toolTip());
326 this->appendRow(itemListExtra);