1 #include <creaImageIOTreeNode.h>
2 #include <creaImageIOTree.h>
3 #include <creaMessageManager.h>
11 //=============================================================
13 Node::Node(Node* parent)
16 mChildrenLoaded(false)
20 // Insert into parent's children list
21 parent->GetChildrenList().push_back(this);
22 // Initialize attributes
23 LevelDescriptor::AttributeDescriptorListType::const_iterator a;
24 for (a = GetTree()->GetAttributeDescriptorList(GetLevel()).begin();
25 a!= GetTree()->GetAttributeDescriptorList(GetLevel()).end();
28 UnsafeSetAttribute( a->GetName(), "" );
32 //=============================================================
36 //=============================================================
39 ChildrenListType::iterator i;
40 for (i=GetChildrenList().begin(); i!=GetChildrenList().end(); i++)
50 //=============================================================
52 //=============================================================
53 void Node::RemoveChildrenFromList(Node* node)
55 ChildrenListType::iterator i = find(GetChildrenList().begin(),
56 GetChildrenList().end(),
58 if (i != GetChildrenList().end())
60 GetChildrenList().erase(i);
63 //=============================================================
65 //=============================================================
66 const std::string& Node::GetAttribute(const std::string& k) const
68 // std::cout << "this = "<<(void*)this<<std::endl;
69 // std::cout << "mFieldValueMap="<<(void*)(&mFieldValueMap)<<std::endl;
70 AttributeMapType::const_iterator i = mAttributeMap.find(k);
71 if (i == mAttributeMap.end())
73 static std::string def("");
75 // CREAIMAGEIO_ERROR("DicomNode::GetFieldValue : no field with key '"<<k<<"'");
79 //=============================================================
81 //=============================================================
82 void Node::SetAttribute(const std::string& k,
85 AttributeMapType::iterator i = mAttributeMap.find(k);
86 if (i==mAttributeMap.end())
88 std::cout<<"[Gimmick!] Node::SetAttribute : no attribute with name '"
90 creaError( "[Gimmick!] Node::SetAttribute : no attribute with name '"
95 //=============================================================