]> Creatis software - gdcm.git/blob - src/gdcmDicomDirStudy.cxx
ENH: Minor patch, cosmetic -again-. Remove all this->. I might have discover the...
[gdcm.git] / src / gdcmDicomDirStudy.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirStudy.cxx,v $
5   Language:  C++
6   Date:      $Date: 2004/08/01 00:59:21 $
7   Version:   $Revision: 1.8 $
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.htm 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 #include "gdcmDicomDirStudy.h"
20 #include "gdcmDicomDirElement.h"
21 #include "gdcmGlobal.h"
22 //-----------------------------------------------------------------------------
23 // Constructor / Destructor
24
25 /**
26  * \ingroup gdcmDicomDirStudy
27  * \brief constructor  
28  * @param  s SQ Item holding the elements related to this "STUDY" part
29  * @param ptagHT pointer to the HTable (gdcmObject needs it 
30  *               to build the gdcmHeaderEntries)
31  */
32 gdcmDicomDirStudy::gdcmDicomDirStudy(gdcmSQItem *s, TagDocEntryHT *ptagHT):
33    gdcmObject(ptagHT)
34 {
35    docEntries = s->GetDocEntries();
36 }
37 /**
38  * \ingroup gdcmDicomDirStudy
39  * \brief constructor  
40  * @param ptagHT pointer to the HTable (gdcmObject needs it 
41  *               to build the gdcmHeaderEntries)
42  */
43 gdcmDicomDirStudy::gdcmDicomDirStudy(TagDocEntryHT *ptagHT):
44    gdcmObject(ptagHT)
45 {
46 }
47 /**
48  * \ingroup gdcmDicomDirStudy
49  * \brief   Canonical destructor.
50  */
51 gdcmDicomDirStudy::~gdcmDicomDirStudy() 
52 {
53    for(ListDicomDirSerie::iterator cc = series.begin();cc != series.end();++cc)
54    {
55       delete *cc;
56    }
57 }
58
59 //-----------------------------------------------------------------------------
60 // Print
61 /**
62  * \ingroup gdcmDicomDirStudy
63  * \brief   Prints the Object
64  * @return
65  */ 
66 void gdcmDicomDirStudy::Print(std::ostream &os)
67 {
68    os<<"STUDY"<<std::endl;
69    gdcmObject::Print(os);
70
71    for(ListDicomDirSerie::iterator cc = series.begin();
72                                    cc != series.end();
73                                    ++cc)
74    {
75       (*cc)->SetPrintLevel(PrintLevel);
76       (*cc)->Print(os);
77    }
78 }
79
80 //-----------------------------------------------------------------------------
81 // Public
82
83 /**
84  * \ingroup gdcmDicomStudy
85  * \brief   adds a new Serie at the begining of the SerieList
86  *          of a partially created DICOMDIR
87  */
88 gdcmDicomDirSerie * gdcmDicomDirStudy::NewSerie()
89 {
90    std::list<gdcmElement> elemList = 
91       gdcmGlobal::GetDicomDirElements()->GetDicomDirSerieElements();   
92
93    gdcmDicomDirSerie *st = new gdcmDicomDirSerie(PtagHT);
94    FillObject(elemList);
95    series.push_front(st);
96
97    return st;  
98 }   
99 //-----------------------------------------------------------------------------
100 // Protected
101
102 //-----------------------------------------------------------------------------
103 // Private
104
105 //-----------------------------------------------------------------------------