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