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