1 #ifndef __creaImageIOTreeDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeDescriptor_h_INCLUDED__
4 #include <creaImageIOTreeAttributeMapType.h>
5 #include <creaImageIOTreeLevelDescriptor.h>
18 ///Descriptor of the structure of a Tree (number of levels, descriptors of each level, ...).
19 //Any Tree has at least one level (level 0) of name "Root"
24 /// Ctor : creates the mandatory level 0 descriptor called "Root"
29 /// Loads from a xml description file
30 void LoadXML(const std::string& filename);
31 /// Creates the default descriptor
34 /// Returns the number of levels of the tree
35 unsigned int GetNumberOfLevels()
36 { return mLevelDescriptorList.size(); }
38 /// Returns the LevelDescriptor of a given level (const ref)
39 const LevelDescriptor& GetLevelDescriptor(int level) const
40 { return mLevelDescriptorList[level]; }
42 /// Returns the AttributeDescriptorList of a given level (const ref)
43 const LevelDescriptor::AttributeDescriptorListType&
44 GetAttributeDescriptorList(int level) const
45 { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
48 /// Adds a LevelDescriptor at the end of the list
49 void Add(const LevelDescriptor&);
51 /// Adds an AttributeDescriptor to level l
52 void Add(const AttributeDescriptor&, int l);
55 /// Builds the key to value map of all the attributes of the tree
56 void BuildAttributeMap( AttributeMapType& ) const;
58 /// The type of LevelDescriptor container
59 typedef std::vector<LevelDescriptor> LevelDescriptorListType;
61 /// Returns the list of tree levels (const)
62 const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
64 /// Clears the Descriptor
67 //Create Attribute Descriptors from a file
68 void createDescriptorfromFile(const std::string &i_file);
71 LevelDescriptorListType mLevelDescriptorList;
72 /// Creates the mandatory level 0 descriptor called "Root"
73 /// (assumes the list is empty)
74 void CreateLevel0Descriptor();
77 // EO class Descriptor
78 //=====================================================================
79 } // EO namespace tree
81 } // EO namespace creaImageIO