1 #ifndef __creaImageIOTree_h_INCLUDED__
2 #define __creaImageIOTree_h_INCLUDED__
4 #include <creaImageIOTreeNode.h>
12 //=====================================================================
13 /// Abstract class to store user data on a tree
17 virtual ~TreeData() {}
19 //=====================================================================
21 //=====================================================================
22 /// An attributed tree structure
25 class Tree : public Node
30 /// Virtual destructor
33 /// Returns the descriptor of the tree
35 /// Returns the tree to which the node belongs
36 virtual Tree* GetTree() { return this; }
37 /// Returns the tree to which the node belongs
38 virtual const Tree* GetTree() const { return this; }
39 /// Returns the level of the node in the tree
40 virtual int GetLevel() const { return 0; }
42 /// Returns the Descriptor of the tree (const)
43 const Descriptor& GetDescriptor() const { return mDescriptor; }
44 /// Returns the descriptor of the tree
45 Descriptor& GetDescriptor() { return mDescriptor; }
47 /// Returns the number of levels of the tree
48 unsigned int GetNumberOfLevels()
49 { return GetDescriptor().GetNumberOfLevels(); }
51 /// Returns the LevelDescriptor of a given level (const ref)
52 const LevelDescriptor& GetLevelDescriptor(int level) const
53 { return GetDescriptor().GetLevelDescriptor(level); }
54 /// Returns the LevelDescriptor of a given level (ref)
55 LevelDescriptor& GetLevelDescriptor(int level)
56 { return GetDescriptor().GetLevelDescriptor(level); }
58 /// Returns the AttributeDescriptorList of a given level (const ref)
59 const LevelDescriptor::AttributeDescriptorListType&
60 GetAttributeDescriptorList(int level) const
61 { return GetDescriptor().GetAttributeDescriptorList(level); }
62 /// Returns the AttributeDescriptorList of a given level (ref)
63 LevelDescriptor::AttributeDescriptorListType&
64 GetAttributeDescriptorList(int level)
65 { return GetDescriptor().GetAttributeDescriptorList(level); }
69 Descriptor mDescriptor;
73 //=====================================================================
75 } // EO namespace tree
77 } // EO namespace creaImageIO