1 #ifndef __creaImageIOTreeDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeDescriptor_h_INCLUDED__
4 #include <creaImageIOTreeLevelDescriptor.h>
16 //=====================================================================
17 /// Descriptor of the structure a tree
18 /// (number of levels, descriptors of each level, ...).
19 /// Any tree has at least one level (level 0) of name "Root"
23 /// Ctor : creates the mandatory level 0 descriptor called "Root"
28 /// Loads from a xml description file
29 void LoadXML(const std::string& filename);
30 /// Creates the default descriptor
33 /// Returns the number of levels of the tree
34 unsigned int GetNumberOfLevels()
35 { return mLevelDescriptorList.size(); }
37 /// Returns the LevelDescriptor of a given level (const ref)
38 const LevelDescriptor& GetLevelDescriptor(int level) const
39 { return mLevelDescriptorList[level]; }
40 /// Returns the LevelDescriptor of a given level (ref)
41 LevelDescriptor& GetLevelDescriptor(int level)
42 { return mLevelDescriptorList[level]; }
44 /// Returns the AttributeDescriptorList of a given level (const ref)
45 const LevelDescriptor::AttributeDescriptorListType&
46 GetAttributeDescriptorList(int level) const
47 { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
48 /// Returns the AttributeDescriptorList of a given level (ref)
49 LevelDescriptor::AttributeDescriptorListType&
50 GetAttributeDescriptorList(int level)
51 { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
54 /// Builds the key to value map of all the attributes of the tree
55 void BuildAttributeMap( std::map<std::string,std::string>&) const;
57 /// The type of LevelDescriptor container
58 typedef std::vector<LevelDescriptor> LevelDescriptorListType;
59 /// Returns the list of LevelDescriptor
60 LevelDescriptorListType& GetLevelDescriptorList() { return mLevelDescriptorList; }
61 /// Returns the list of tree levels (const)
62 const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
65 LevelDescriptorListType mLevelDescriptorList;
66 /// Creates the mandatory level 0 descriptor called "Root"
67 /// (assumes the list is empty)
68 void CreateLevel0Descriptor();
71 // EO class Descriptor
72 //=====================================================================
73 } // EO namespace tree
75 } // EO namespace creaImageIO