]> Creatis software - creaImageIO.git/blobdiff - src2/creaImageIOTreeDescriptor.h
No newline at end of file
[creaImageIO.git] / src2 / creaImageIOTreeDescriptor.h
index e1812d3838aab26d104b22edafc32302bb62032e..e6863b14545cdcd6cf36e10274212fe8539fcf10 100644 (file)
@@ -1,19 +1,24 @@
 #ifndef __creaImageIOTreeDescriptor_h_INCLUDED__
 #define __creaImageIOTreeDescriptor_h_INCLUDED__
 
+#include <creaImageIOTreeAttributeMapType.h>
 #include <creaImageIOTreeLevelDescriptor.h>
-#include <map>
+
 
 namespace creaImageIO
 {
-
+       using namespace std;
   namespace tree
   {
-    //=====================================================================
-    /// Descriptor of the structure a tree 
-/// (number of levels, descriptors of each level, ...).
-/// Any tree has at least one level (level 0) of name "Root"
-class Descriptor
+    
+    /**
+     * \ingroup Tree
+     */
+    
+       ///Descriptor of the structure of a Tree (number of levels, descriptors of each level, ...). 
+         //Any Tree has at least one level (level 0) of name "Root"
+     
+    class Descriptor
     {
     public:
       /// Ctor : creates the mandatory level 0 descriptor called "Root"
@@ -33,29 +38,33 @@ class Descriptor
       /// Returns the LevelDescriptor of a given level (const ref)
       const LevelDescriptor& GetLevelDescriptor(int level) const
       { return mLevelDescriptorList[level]; }
-      /// Returns the LevelDescriptor of a given level (ref)
-      LevelDescriptor& GetLevelDescriptor(int level) 
-      { return mLevelDescriptorList[level]; }
 
       /// Returns the AttributeDescriptorList of a given level (const ref)
       const LevelDescriptor::AttributeDescriptorListType& 
       GetAttributeDescriptorList(int level) const
       { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
-      /// Returns the AttributeDescriptorList of a given level (ref)
-      LevelDescriptor::AttributeDescriptorListType& 
-      GetAttributeDescriptorList(int level) 
-      { return mLevelDescriptorList[level].GetAttributeDescriptorList(); }
   
-
+      /// Adds a LevelDescriptor at the end of the list
+      void Add(const LevelDescriptor&);
+      
+      /// Adds an AttributeDescriptor to level l
+      void Add(const AttributeDescriptor&, int l);
+      
+      
       /// Builds the key to value map of all the attributes of the tree
-      void BuildAttributeMap( std::map<std::string,std::string>&) const;
+       void BuildAttributeMap( AttributeMapType& ) const;
 
       /// The type of LevelDescriptor container
-      typedef std::vector<LevelDescriptor> LevelDescriptorListType;
-      /// Returns the list of LevelDescriptor
-      LevelDescriptorListType& GetLevelDescriptorList() { return mLevelDescriptorList; }
+       typedef std::vector<LevelDescriptor> LevelDescriptorListType;
       /// Returns the list of tree levels (const)
-      const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
+       const LevelDescriptorListType& GetLevelDescriptorList() const { return mLevelDescriptorList; }
+
+      /// Clears the Descriptor
+      void Clear();
+
+         //Create Attribute Descriptors from a file
+       void createDescriptorfromFile(const std::string &i_file);
 
     private:
       LevelDescriptorListType mLevelDescriptorList;