00001 #ifndef __creaImageIOTreeDescriptor_h_INCLUDED__ 00002 #define __creaImageIOTreeDescriptor_h_INCLUDED__ 00003 00004 #include <creaImageIOTreeAttributeMapType.h> 00005 #include <creaImageIOTreeLevelDescriptor.h> 00006 00007 00008 namespace creaImageIO 00009 { 00010 using namespace std; 00011 namespace tree 00012 { 00013 00018 00019 //Any Tree has at least one level (level 0) of name "Root" 00020 00021 class Descriptor 00022 { 00023 public: 00025 Descriptor(); 00027 ~Descriptor(); 00028 00030 void LoadXML(const std::string& filename); 00032 void CreateDefault(); 00033 00035 unsigned int GetNumberOfLevels() 00036 { return mLevelDescriptorList.size(); } 00037 00039 const LevelDescriptor& GetLevelDescriptor(int level) const 00040 { return mLevelDescriptorList[level]; } 00041 00043 const LevelDescriptor::AttributeDescriptorListType& 00044 GetAttributeDescriptorList(int level) const 00045 { return mLevelDescriptorList[level].GetAttributeDescriptorList(); } 00046 00048 void Add(const LevelDescriptor&); 00049 00051 void Add(const AttributeDescriptor&, int l); 00052 00053 00055 void BuildAttributeMap( AttributeMapType& ) const; 00056 00058 typedef std::vector<LevelDescriptor> LevelDescriptorListType; 00059 00061 const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; } 00062 00064 void Clear(); 00065 00066 //Create Attribute Descriptors from a file 00067 void createDescriptorfromFile(const std::string &i_file); 00068 00069 private: 00070 LevelDescriptorListType mLevelDescriptorList; 00073 void CreateLevel0Descriptor(); 00074 00075 }; 00076 // EO class Descriptor 00077 //===================================================================== 00078 } // EO namespace tree 00079 00080 } // EO namespace creaImageIO 00081 00082 // EOF 00083 #endif