1 /*=========================================================================
4 Module: $RCSfile: gdcmSQItem.h,v $
6 Date: $Date: 2004/12/16 11:37:03 $
7 Version: $Revision: 1.27 $
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;
33 //-----------------------------------------------------------------------------
34 class GDCM_EXPORT SQItem : public DocEntrySet
37 SQItem(int depthLevel);
40 virtual void Print(std::ostream &os = std::cout);
41 void WriteContent(std::ofstream *fp, FileType filetype);
43 /// \brief returns the DocEntry chained List for this SQ Item.
44 ListDocEntry const & GetDocEntries() const { return DocEntries; };
46 /// \brief adds the passed DocEntry to the DocEntry chained List for
48 bool AddEntry(DocEntry *Entry); // add to the List
49 bool RemoveEntry(DocEntry *EntryToRemove);
50 bool RemoveEntryNoDestroy(DocEntry *EntryToRemove);
52 DocEntry *GetDocEntryByNumber(uint16_t group, uint16_t element);
53 // FIXME method to write
54 //DocEntry *GetDocEntryByName (std::string Name);
56 bool SetEntryByNumber(std::string const & val, uint16_t group,
59 std::string GetEntryByNumber(uint16_t group, uint16_t element);
61 /// \brief returns the ordinal position of a given SQItem
62 int GetSQItemNumber() { return SQItemNumber; };
64 /// \brief Sets the ordinal position of a given SQItem
65 void SetSQItemNumber(int itemNumber) { SQItemNumber = itemNumber; };
67 /// Accessor on \ref SQDepthLevel.
68 int GetDepthLevel() { return SQDepthLevel; }
70 /// Accessor on \ref SQDepthLevel.
71 void SetDepthLevel(int depth) { SQDepthLevel = depth; }
73 /// Accessor on \ref BaseTagKey.
74 void SetBaseTagKey( BaseTagKey const & key ) { BaseTagKeyNested = key; }
76 /// Accessor on \ref BaseTagKey.
77 BaseTagKey const & GetBaseTagKey() const { return BaseTagKeyNested; }
80 DocEntry *GetNextEntry();
83 // Variables that need to be access in subclasses
85 /// \brief Chained list of (Elementary) Doc Entries
86 ListDocEntry DocEntries;
87 /// Chained list iterator, used to visit the TagHT variable
88 ListDocEntry::iterator ItDocEntries;
90 ///\brief pointer to the HTable of the Document,
91 /// (because we don't know it within any DicomDirObject nor any SQItem)
92 // TagDocEntryHT *PtagHT;
96 /// \brief Sequences can be nested. This \ref SQDepthLevel represents
97 /// the level of the nesting of instances of this class.
98 /// \ref SQDepthLevel and its \ref SeqEntry::SQDepthLevel
99 /// counterpart are only defined on printing purposes
100 /// (see \ref Print).
103 /// \brief A TagKey of a DocEntry nested in a sequence is prepended
104 /// with this BaseTagKey.
105 BaseTagKey BaseTagKeyNested;
107 /// \brief SQ Item ordinal number
110 } // end namespace gdcm
111 //-----------------------------------------------------------------------------