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