1 #ifndef __creaImageIOTree_h_INCLUDED__
2 #define __creaImageIOTree_h_INCLUDED__
4 #include <creaImageIOTreeNode.h>
14 //=====================================================================
15 /// Abstract class to store user data on a Tree
19 virtual ~TreeData() {}
21 //=====================================================================
23 //=====================================================================
24 /// An attributed Tree structure
27 class Tree : public Node
32 /// Virtual destructor
35 /// Returns the descriptor of the tree
37 /// Returns the tree to which the node belongs
38 virtual Tree* GetTree() { return this; }
39 /// Returns the tree to which the node belongs
40 virtual const Tree* GetTree() const { return this; }
41 /// Returns the level of the node in the tree
42 virtual int GetLevel() const { return 0; }
44 /// Returns the Descriptor of the tree (const)
45 const Descriptor& GetDescriptor() const { return mDescriptor; }
46 /// Returns the descriptor of the tree
47 Descriptor& GetDescriptor() { return mDescriptor; }
49 /// Returns the number of levels of the tree
50 unsigned int GetNumberOfLevels()
51 { return GetDescriptor().GetNumberOfLevels(); }
53 /// Returns the LevelDescriptor of a given level (const ref)
54 const LevelDescriptor& GetLevelDescriptor(int level) const
55 { return GetDescriptor().GetLevelDescriptor(level); }
57 /// Returns the AttributeDescriptorList of a given level (const ref)
58 const LevelDescriptor::AttributeDescriptorListType&
59 GetAttributeDescriptorList(int level) const
60 { return GetDescriptor().GetAttributeDescriptorList(level); }
62 virtual void Print() const;
65 Descriptor mDescriptor;
69 //=====================================================================
71 } // EO namespace tree
73 } // EO namespace creaImageIO