]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.cxx
Still in a debugging status.
[gdcm.git] / src / gdcmDicomDirStudy.cxx
1 // gdcmDicomDirStudy.cxx
2 //-----------------------------------------------------------------------------
3 #include "gdcmDicomDirStudy.h"
4 #include "gdcmDicomDirElement.h"
5 #include "gdcmGlobal.h"
6 //-----------------------------------------------------------------------------
7 // Constructor / Destructor
8
9 /**
10  * \ingroup gdcmDicomDirStudy
11  * \brief constructor  
12  * @param  s SQ Item holding the elements related to this "STUDY" part
13  * @param ptagHT pointer to the HTable (gdcmObject needs it 
14  *               to build the gdcmHeaderEntries)
15  */
16 gdcmDicomDirStudy::gdcmDicomDirStudy(gdcmSQItem *s, TagDocEntryHT *ptagHT):
17    gdcmObject(ptagHT)
18 {
19    docEntries = s->GetDocEntries();
20 }
21 /**
22  * \ingroup gdcmDicomDirStudy
23  * \brief constructor  
24  * @param ptagHT pointer to the HTable (gdcmObject needs it 
25  *               to build the gdcmHeaderEntries)
26  */
27 gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT *ptagHT):
28    gdcmObject(ptagHT)
29 {
30 }
31 /**
32  * \ingroup gdcmDicomDirStudy
33  * \brief   Canonical destructor.
34  */
35 gdcmDicomDirStudy::~gdcmDicomDirStudy() 
36 {
37    for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
38    {
39       delete *cc;
40    }
41 }
42
43 //-----------------------------------------------------------------------------
44 // Print
45 /**
46  * \ingroup gdcmDicomDirStudy
47  * \brief   Prints the Object
48  * @return
49  */ 
50 void gdcmDicomDirStudy::Print(std::ostream &os)
51 {
52    os<<"STUDY"<<std::endl;
53    gdcmObject::Print(os);
54
55    for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
56    {
57       (*cc)->SetPrintLevel(printLevel);
58       (*cc)->Print(os);
59    }
60 }
61
62 //-----------------------------------------------------------------------------
63 // Public
64
65 /**
66  * \ingroup gdcmDicomStudy
67  * \brief   adds a new Serie at the begining of the SerieList
68  *          of a partially created DICOMDIR
69  */
70 gdcmDicomDirSerie * gdcmDicomDirStudy::NewSerie(void) {
71   
72    std::list<gdcmElement> elemList;
73    elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();   
74
75    gdcmDicomDirSerie *st = new gdcmDicomDirSerie(ptagHT);
76    FillObject(elemList);
77    series.push_front(st);
78    return st;  
79 }   
80 //-----------------------------------------------------------------------------
81 // Protected
82
83 //-----------------------------------------------------------------------------
84 // Private
85
86 //-----------------------------------------------------------------------------