X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeNode.cpp;fp=src2%2FcreaImageIOTreeNode.cpp;h=6bb7d3a7d8bc42ce3d0eda23e3ef8332691f2171;hb=bae4df8a3e1ea669400c3a6c44ef4aa8d90fa1ed;hp=8f03924236e30d7e0dd2b824d9d17e4a288028d2;hpb=f4bdead5143dc3d816f1c2f2bd9786a21c843760;p=creaImageIO.git diff --git a/src2/creaImageIOTreeNode.cpp b/src2/creaImageIOTreeNode.cpp index 8f03924..6bb7d3a 100644 --- a/src2/creaImageIOTreeNode.cpp +++ b/src2/creaImageIOTreeNode.cpp @@ -25,12 +25,35 @@ namespace creaImageIO a!= GetTree()->GetAttributeDescriptorList(GetLevel()).end(); ++a) { - UnsafeSetAttribute( a->GetName(), "" ); + UnsafeSetAttribute( a->GetKey(), "" ); } } } //============================================================= + //============================================================= + /// Ctor with parent and attributes map + Node::Node(Node* parent, const AttributeMapType& attr) + : mParent(parent), + mData(0), + mChildrenLoaded(false) + { + if (parent) + { + // Insert into parent's children list + parent->GetChildrenList().push_back(this); + // Initialize attributes + LevelDescriptor::AttributeDescriptorListType::const_iterator a; + for (a = GetTree()->GetAttributeDescriptorList(GetLevel()).begin(); + a!= GetTree()->GetAttributeDescriptorList(GetLevel()).end(); + ++a) + { + UnsafeSetAttribute( a->GetKey(), attr[a->GetKey()] ); + } + } + + } + //============================================================= //============================================================= @@ -85,16 +108,22 @@ namespace creaImageIO AttributeMapType::iterator i = mAttributeMap.find(k); if (i==mAttributeMap.end()) { - std::cout<<"[Gimmick!] Node::SetAttribute : no attribute with name '" + std::cout<<"[Gimmick!] Node::SetAttribute : no attribute with key '" <second = v; } - //============================================================= - + //============================================================= + //============================================================= + bool Node::Matches( const AttributeMapType& ) const + { + // TO DO + return false; + } + //============================================================= } }