]> Creatis software - gdcm.git/blob - src/gdcmSeqEntry.h
ENH: Adding 'gdcm' namespace. Be nice with me this was a ~13000 lines patch. Also...
[gdcm.git] / src / gdcmSeqEntry.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmSeqEntry.h,v $
5   Language:  C++
6   Date:      $Date: 2004/10/12 04:35:48 $
7   Version:   $Revision: 1.20 $
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
19 #ifndef GDCMSQDOCENTRY_H
20 #define GDCMSQDOCENTRY_H
21
22 #include "gdcmSQItem.h"
23 #include "gdcmDocEntry.h"
24 #include <list>
25 namespace gdcm 
26 {
27
28 //-----------------------------------------------------------------------------
29 typedef std::list<SQItem *> ListSQItem;
30 //-----------------------------------------------------------------------------
31
32 class GDCM_EXPORT SeqEntry : public DocEntry 
33 {
34 public:
35    SeqEntry( DictEntry* );
36    SeqEntry(DocEntry* d,  int depth);
37    virtual ~SeqEntry();
38    
39    virtual void Print(std::ostream &os = std::cout); 
40    virtual void Write(FILE *fp, FileType);
41
42    /// returns the SQITEM chained List for this SeQuence.
43    ListSQItem &GetSQItems() { return items; }
44       
45    /// Sets the delimitor mode
46    void SetDelimitorMode(bool dm) { delimitor_mode = dm;}
47
48    /// Sets the Sequence Delimitation Item
49    void SetSequenceDelimitationItem(DocEntry * e) { seq_term = e;}
50
51    void AddEntry(SQItem *it, int itemNumber);
52    SQItem *GetSQItemByOrdinalNumber(int itemNumber);
53
54    /// Gets the depth level
55    int GetDepthLevel() { return SQDepthLevel; }
56                                                                                 
57    /// Sets the depth level of a Sequence Entry embedded in a SeQuence
58    void SetDepthLevel(int depth) { SQDepthLevel = depth; }
59 protected:
60
61 private:
62 // Variables
63
64    /// If this Sequence is in delimitor mode (length =0xffffffff) or not
65    bool delimitor_mode;
66    
67    /// Chained list of SQ Items
68    ListSQItem items;
69    
70    /// sequence terminator item 
71    DocEntry *seq_term;
72
73    /// \brief Defines the depth level of this \ref SeqEntry inside
74    ///        the (optionaly) nested sequences. \ref SQDepthLevel
75    ///        and its \ref SQItem::SQDepthLevel counterpart
76    ///        are only defined on printing purposes (see \ref Print).
77    int SQDepthLevel;
78 };
79 } // end namespace gdcm
80 //-----------------------------------------------------------------------------
81 #endif
82