creaImageIOTreeDescriptor.h

Go to the documentation of this file.
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 
00045       const LevelDescriptor::AttributeDescriptorListType& 
00046       GetAttributeDescriptorList(int level, int type = 0) const
00047       { return mLevelDescriptorList[level].GetAttributeDescriptorList(type); }
00048   
00049           
00051           void CopyAttributeDescriptorList(int level)
00052           {
00053                   mLevelDescriptorList[level].CopyAttributeDescriptorList();
00054           }
00055 
00057       void Add(const LevelDescriptor&);
00058       
00060       void Add(const AttributeDescriptor&, int l);
00061       
00062       
00064         void BuildAttributeMap( AttributeMapType& ) const;
00065 
00067         typedef std::vector<LevelDescriptor> LevelDescriptorListType;
00068  
00070         const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
00071 
00073       void Clear();
00074 
00075           //Create Attribute Descriptors from a file
00076         void createDescriptorfromFile(const std::string &i_file);
00077 
00078 
00081         const std::string isExist(const std::string i_attr);
00082 
00083     private:
00084       LevelDescriptorListType mLevelDescriptorList;
00087       void CreateLevel0Descriptor();
00088   
00089     };
00090     // EO class Descriptor
00091     //=====================================================================
00092   } // EO namespace tree
00093 
00094 } // EO namespace creaImageIO
00095 
00096 // EOF
00097 #endif