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