]> Creatis software - gdcm.git/blob - src/gdcmDicomDirObject.cxx
* src/gdcmDicomDirElement.h, gdcmDict.h : rename AddNewXxx methods to AddXxx.
[gdcm.git] / src / gdcmDicomDirObject.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmDicomDirObject.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/24 14:14:11 $
7   Version:   $Revision: 1.18 $
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.html 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 "gdcmDicomDirObject.h"
20 #include "gdcmGlobal.h"
21 #include "gdcmDebug.h"
22 #include "gdcmValEntry.h"
23 #include "gdcmDictSet.h"
24
25 namespace gdcm 
26 {
27
28 //-----------------------------------------------------------------------------
29 /**
30  * \brief  Constructor 
31  *          
32  * @param depth Sequence depth level
33  */
34   
35 DicomDirObject::DicomDirObject(int depth) 
36           : SQItem (depth)
37 {
38 }
39
40 /**
41  * \brief   Canonical destructor.
42  */
43 DicomDirObject::~DicomDirObject()
44 {
45 }
46
47 //-----------------------------------------------------------------------------
48 // Public
49
50 //-----------------------------------------------------------------------------
51 // Protected
52 /**
53  * \brief   add the 'Object' related Dicom Elements to the listEntries
54  *          of a partially created DICOMDIR
55  * @param elemList Element List to add at the right place
56  */
57 void DicomDirObject::FillObject(ListDicomDirMetaElem const &elemList)
58 {
59   // FillObject fills up the SQItem that will be conneected to the right place
60    ListDicomDirMetaElem::const_iterator it;
61    uint16_t tmpGr,tmpEl;
62    DictEntry *dictEntry;
63    ValEntry *entry;
64       
65    // for all the Elements found in they own part of the DicomDir dict.     
66    for(it = elemList.begin(); it != elemList.end(); ++it)
67    {
68       tmpGr = it->Group;
69       tmpEl = it->Elem;
70       dictEntry = Global::GetDicts()->GetDefaultPubDict()->GetEntry(tmpGr,tmpEl);
71       entry = new ValEntry(dictEntry);
72       entry->SetOffset(0); // just to avoid further missprinting
73       entry->SetValue(it->Value);
74
75       AddEntry(entry);
76    }   
77 }   
78
79 //-----------------------------------------------------------------------------
80 // Private
81
82 //-----------------------------------------------------------------------------
83 } // end namespace gdcm