1 /*=========================================================================
4 Module: $RCSfile: gdcmSQItem.h,v $
6 Date: $Date: 2005/02/04 14:49:01 $
7 Version: $Revision: 1.40 $
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.
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.
17 =========================================================================*/
21 #include "gdcmDocEntrySet.h"
22 #include "gdcmElementSet.h"
31 //-----------------------------------------------------------------------------
32 typedef std::list<DocEntry *> ListDocEntry;
34 //-----------------------------------------------------------------------------
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
41 class GDCM_EXPORT SQItem : public DocEntrySet
44 SQItem(int depthLevel);
47 virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" );
48 void WriteContent(std::ofstream *fp, FileType filetype);
50 bool AddEntry(DocEntry *Entry); // add to the List
51 bool RemoveEntry(DocEntry *EntryToRemove);
52 bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
55 DocEntry *GetFirstEntry();
56 DocEntry *GetNextEntry();
58 ValEntry *GetFirstValEntry();
59 ValEntry *GetNextValEntry();
61 DocEntry *GetDocEntry(uint16_t group, uint16_t elem);
63 bool IsEmpty() { return DocEntries.empty(); };
65 /// \brief returns the ordinal position of a given SQItem
66 int GetSQItemNumber() { return SQItemNumber; };
67 /// \brief Sets the ordinal position of a given SQItem
68 void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; };
70 /// \brief Accessor on \ref SQDepthLevel.
71 int GetDepthLevel() { return SQDepthLevel; }
73 /// \brief Accessor on \ref SQDepthLevel.
74 void SetDepthLevel(int depth) { SQDepthLevel = depth; }
76 /// \brief Accessor on \ref BaseTagKey.
77 void SetBaseTagKey( BaseTagKey const &key ) { BaseTagKeyNested = key; }
79 /// \brief Accessor on \ref BaseTagKey.
80 BaseTagKey const &GetBaseTagKey() const { return BaseTagKeyNested; }
83 // Variables that need to be accessed in subclasses
84 /// \brief Chained list of Doc Entries
85 ListDocEntry DocEntries;
86 /// Iterator, used to visit the entries
87 ListDocEntry::iterator ItDocEntries;
88 /// Iterator, used to visit the Val Entries (for Python users)
89 ListDocEntry::iterator ItValEntries;
92 /// \brief Sequences can be nested. This \ref SQDepthLevel represents
93 /// the level of the nesting of instances of this class.
94 /// \ref SQDepthLevel and its \ref SeqEntry::SQDepthLevel
95 /// counterpart are only defined on printing purposes
99 /// \brief A TagKey of a DocEntry nested in a sequence is prepended
100 /// with this BaseTagKey.
101 BaseTagKey BaseTagKeyNested;
103 /// \brief SQ Item ordinal number
106 } // end namespace gdcm
107 //-----------------------------------------------------------------------------