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
23 class Tree : public Node
28 /// Virtual destructor
31 /// Returns the descriptor of the tree
33 /// Returns the tree to which the node belongs
34 virtual Tree* GetTree() { return this; }
35 /// Returns the tree to which the node belongs
36 virtual const Tree* GetTree() const { return this; }
37 /// Returns the level of the node in the tree
38 virtual int GetLevel() const { return 0; }
40 /// Returns the Descriptor of the tree (const)
41 const Descriptor& GetDescriptor() const { return mDescriptor; }
42 /// Returns the descriptor of the tree
43 Descriptor& GetDescriptor() { return mDescriptor; }
45 /// Returns the number of levels of the tree
46 unsigned int GetNumberOfLevels()
47 { return GetDescriptor().GetNumberOfLevels(); }
49 /// Returns the LevelDescriptor of a given level (const ref)
50 const LevelDescriptor& GetLevelDescriptor(int level) const
51 { return GetDescriptor().GetLevelDescriptor(level); }
52 /// Returns the LevelDescriptor of a given level (ref)
53 LevelDescriptor& GetLevelDescriptor(int level)
54 { return GetDescriptor().GetLevelDescriptor(level); }
56 /// Returns the AttributeDescriptorList of a given level (const ref)
57 const LevelDescriptor::AttributeDescriptorListType&
58 GetAttributeDescriptorList(int level) const
59 { return GetDescriptor().GetAttributeDescriptorList(level); }
60 /// Returns the AttributeDescriptorList of a given level (ref)
61 LevelDescriptor::AttributeDescriptorListType&
62 GetAttributeDescriptorList(int level)
63 { return GetDescriptor().GetAttributeDescriptorList(level); }
67 Descriptor mDescriptor;
71 //=====================================================================
73 } // EO namespace tree
75 } // EO namespace creaImageIO