X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src2%2FcreaImageIOTreeNode.h;h=91bda3786bbe93e6c06a0499ca161f371da2ee5b;hb=2ce9bb440f5e83b24b532cda5626418cc28feacd;hp=07b46cfb20efe18230ecf071bd23697ed205df90;hpb=cbf693fa62cd51f4ca5c881838bbb609edc447b0;p=creaImageIO.git diff --git a/src2/creaImageIOTreeNode.h b/src2/creaImageIOTreeNode.h index 07b46cf..91bda37 100644 --- a/src2/creaImageIOTreeNode.h +++ b/src2/creaImageIOTreeNode.h @@ -11,13 +11,16 @@ namespace creaImageIO namespace tree { + /** + * \ingroup Model + */ //===================================================================== /// Forward declaration of Tree class Tree; //===================================================================== //===================================================================== - /// Abstract class to store user data on a tree node + /// Abstract class to store user data on a Tree node struct NodeData { NodeData() {} @@ -27,15 +30,22 @@ namespace creaImageIO //===================================================================== - /// Node of an attributed tree structure + /// Node of an attributed Tree structure class Node { public: + typedef std::map AttributeMapType; + + /// Ctor with parent Node(Node* parent); + /// Ctor with parent and attributes map + Node(Node* parent, const AttributeMapType& ); /// Virtual destructor virtual ~Node(); + /// Initializes the attribute map i.e. creates the entries + void InitializeAttributeMap(); /// Returns the level descriptor of the node const LevelDescriptor& GetLevelDescriptor() const; @@ -73,7 +83,6 @@ namespace creaImageIO /// Remove the given children from the children list void RemoveChildrenFromList(Node*); - typedef std::map AttributeMapType; AttributeMapType& GetAttributeMap() { return mAttributeMap; } const AttributeMapType& GetAttributeMap() const { return mAttributeMap; } @@ -90,7 +99,9 @@ namespace creaImageIO // { return GetTypeDescription().GetFieldDescription(k); } - + /// Returns true iff the KEY attributes of the node match those of the map provided + bool Matches( const AttributeMapType& ) const; + /// Returns the node data casted into the type T template T GetData() const { if (mData!=0) return dynamic_cast(mData); return 0; } @@ -101,9 +112,10 @@ namespace creaImageIO /// Sorts the children of the node void SortChildren(const LexicographicalComparator&); - /* - virtual void Print() const; + + virtual void Print() const; std::string GetLabel() const; + /* int ImageGetRows() const; int ImageGetColumns() const; int ImageGetFrames() const;