]> Creatis software - gdcm.git/blob - src/gdcmSQItem.h
Comment out the time consuming, never used/useless
[gdcm.git] / src / gdcmSQItem.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmSQItem.h,v $
5   Language:  C++
6   Date:      $Date: 2005/07/07 13:55:39 $
7   Version:   $Revision: 1.42 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18 #ifndef GDCMSQITEM_H
19 #define GDCMSQITEM_H
20
21 #include "gdcmDocEntrySet.h"
22 #include "gdcmElementSet.h"
23
24 #include <list>
25 #include <fstream>
26
27 namespace gdcm 
28 {
29 class DocEntry;
30
31 //-----------------------------------------------------------------------------
32 typedef std::list<DocEntry *> ListDocEntry;
33
34 //-----------------------------------------------------------------------------
35 /**
36  * \brief a SeqEntry is composed by a set of SQItems.
37  *        Each SQItem is composed by a set of DocEntry
38  *        A DocEntry may be a SeqEntry
39  *        ... and so forth 
40  */ 
41 class GDCM_EXPORT SQItem : public DocEntrySet 
42 {
43 public:
44    SQItem(int depthLevel);
45    ~SQItem();
46
47    virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" ); 
48    void WriteContent(std::ofstream *fp, FileType filetype);
49
50    bool AddEntry(DocEntry *Entry); // add to the List
51    bool RemoveEntry(DocEntry *EntryToRemove);
52    bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
53    void ClearEntry();
54   
55    DocEntry *GetFirstEntry();
56    DocEntry *GetNextEntry();
57
58    DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
59
60    bool IsEmpty() { return DocEntries.empty(); };
61
62    /// \brief   returns the ordinal position of a given SQItem
63    int GetSQItemNumber() { return SQItemNumber; };
64    /// \brief   Sets the ordinal position of a given SQItem
65    void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; };
66
67    ///  \brief Accessor on \ref SQDepthLevel.
68    int GetDepthLevel() { return SQDepthLevel; }                                                                             
69
70    ///  \brief Accessor on \ref SQDepthLevel.
71    void SetDepthLevel(int depth) { SQDepthLevel = depth; }
72
73    // waste time hunting
74    // /  \brief Accessor on \ref BaseTagKey.
75    //void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; }
76    // /  \brief Accessor on \ref BaseTagKey.
77    //BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; }
78
79 protected:
80 // Variables that need to be accessed in subclasses
81    /// \brief Chained list of Doc Entries
82    ListDocEntry DocEntries;
83    /// Iterator, used to visit the entries
84    ListDocEntry::iterator ItDocEntries;
85    /// Iterator, used to visit the Val Entries (for Python users)
86    ListDocEntry::iterator ItValEntries;
87   
88 private:
89    /// \brief Sequences can be nested. This \ref SQDepthLevel represents
90    ///        the level of the nesting of instances of this class.
91    ///        \ref SQDepthLevel and its \ref SeqEntry::SQDepthLevel
92    ///        counterpart are only defined on printing purposes
93    ///        (see \ref Print).
94    int SQDepthLevel;
95
96    // waste time hunting
97    // / \brief A TagKey of a DocEntry nested in a sequence is prepended
98    // /        with this BaseTagKey.
99    //BaseTagKey BaseTagKeyNested;
100
101    /// \brief SQ Item ordinal number 
102    int SQItemNumber;
103 };
104 } // end namespace gdcm
105 //-----------------------------------------------------------------------------
106 #endif