1 #ifndef __creaImageIOTreeDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeDescriptor_h_INCLUDED__
4 #include <creaImageIOTreeAttributeMapType.h>
5 #include <creaImageIOTreeLevelDescriptor.h>
17 //=====================================================================
18 /** Descriptor of the structure a tree
19 * (number of levels, descriptors of each level, ...).
20 * Any tree has at least one level (level 0) of name "Root"
25 /// Ctor : creates the mandatory level 0 descriptor called "Root"
30 /// Loads from a xml description file
31 void LoadXML(const std::string& filename);
32 /// Creates the default descriptor
35 /// Returns the number of levels of the tree
36 unsigned int GetNumberOfLevels()
37 { return mLevelDescriptorList.size(); }
39 /// Returns the LevelDescriptor of a given level (const ref)
40 const LevelDescriptor& GetLevelDescriptor(int level) const
41 { return mLevelDescriptorList[level]; }
42 /// Returns the LevelDescriptor of a given level (ref)
43 LevelDescriptor& GetLevelDescriptor(int level)
44 { return mLevelDescriptorList[level]; }
46 /// Returns the AttributeDescriptorList of a given level (const ref)
47 const LevelDescriptor::AttributeDescriptorListType&
48 GetAttributeDescriptorList(int level) const
49 { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
50 /// Returns the AttributeDescriptorList of a given level (ref)
51 //LevelDescriptor::AttributeDescriptorListType&
52 //GetAttributeDescriptorList(int level)
53 //{ return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
56 /// Builds the key to value map of all the attributes of the tree
57 void BuildAttributeMap( AttributeMapType& ) const;
59 /// The type of LevelDescriptor container
60 typedef std::vector<LevelDescriptor> LevelDescriptorListType;
61 /// Returns the list of LevelDescriptor
62 LevelDescriptorListType& GetLevelDescriptorList() { return mLevelDescriptorList; }
63 /// Returns the list of tree levels (const)
64 const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
67 LevelDescriptorListType mLevelDescriptorList;
68 /// Creates the mandatory level 0 descriptor called "Root"
69 /// (assumes the list is empty)
70 void CreateLevel0Descriptor();
73 // EO class Descriptor
74 //=====================================================================
75 } // EO namespace tree
77 } // EO namespace creaImageIO