]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.cxx
moved from gdcmParser to gdcmDocument.
[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 gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT *ptagHT):
23    gdcmObject(ptagHT)
24 {
25 }
26 /**
27  * \ingroup gdcmDicomDirStudy
28  * \brief   Canonical destructor.
29  */
30 gdcmDicomDirStudy::~gdcmDicomDirStudy() 
31 {
32    for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
33    {
34       delete *cc;
35    }
36 }
37
38 //-----------------------------------------------------------------------------
39 // Print
40 /**
41  * \ingroup gdcmDicomDirStudy
42  * \brief   Prints the Object
43  * @return
44  */ 
45 void gdcmDicomDirStudy::Print(std::ostream &os)
46 {
47    os<<"STUDY"<<std::endl;
48    gdcmObject::Print(os);
49
50    for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
51    {
52       (*cc)->SetPrintLevel(printLevel);
53       (*cc)->Print(os);
54    }
55 }
56
57 //-----------------------------------------------------------------------------
58 // Public
59
60 /**
61  * \ingroup gdcmDicomStudy
62  * \brief   adds a new Serie at the begining of the SerieList
63  *          of a partially created DICOMDIR
64  */
65 gdcmDicomDirSerie * gdcmDicomDirStudy::NewSerie(void) {
66   
67    std::list<gdcmElement> elemList;
68    elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();   
69
70    gdcmDicomDirSerie *st = new gdcmDicomDirSerie(ptagHT);
71    FillObject(elemList);
72    series.push_front(st);
73    return st;  
74 }   
75 //-----------------------------------------------------------------------------
76 // Protected
77
78 //-----------------------------------------------------------------------------
79 // Private
80
81 //-----------------------------------------------------------------------------