X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreatisIOComparator.cpp;fp=src%2FcreatisIOComparator.cpp;h=efb2f5da556c2b6007a893cd87b86b5115390210;hb=3a22e19184c369b130d4caa992a8e98e50c7a0ee;hp=0000000000000000000000000000000000000000;hpb=916a5e3008de7387aaf45e9d4e4ebbe6503205c3;p=creaImageIO.git diff --git a/src/creatisIOComparator.cpp b/src/creatisIOComparator.cpp new file mode 100644 index 0000000..efb2f5d --- /dev/null +++ b/src/creatisIOComparator.cpp @@ -0,0 +1,62 @@ +#include + +namespace creaImageIO{ + + Comparator::Comparator(tree::Node *i_tree, std::string i_tag) : m_discr(i_tag): bdiscr(false) + { + std::map< std::string, std::string> attr; + i_tree->GetDescriptor().BuildAttributeMap(attr); + std::map::iterator it_att = attr.begin(); + for(; it_att != attr.end(); it_att++) + { + if (it_att->first == m_discr) + { + bdiscr = true; + break; + } + } + tree::Node::ChildrenListType::reverse_iterator j; + for (j = (*i)->GetChildrenList().rbegin(); + j!= (*i)->GetChildrenList().rend(); + ++j) + { + GimmickDebugMessage(1, + "adding children " + <<(*j)->GetLabel() + <<"'" + <node = *j; + data->id = _id; + + item.SetId(_id); + item.SetData(data); + + _id++; + GetCtrl(l)->InsertItem(item); + + //Setting attributes + for (int k=0; kGetColumnCount(); ++k) + { + std::string val; + // Temporary correction : it works but no explanation about the problem FCY + + if(k==0 && level <3) + { + val = (*j)->GetAttribute("NumberOfChildren"); + } + else + val = (*j)->GetAttribute(mLevelList[l].key[k]); + + } +} \ No newline at end of file