X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDefaultDicts.cxx.in;h=21d39605d90972db675831fec5444b7e21d4ee50;hb=3b1f8ebdc8a9483b7b6971821c06293ac8ed7363;hp=58649c6e7a7642a3a37ed721bdacd957d3d17ab0;hpb=93748f382dadb5c9240c4156ce7bbe9dcc8da44f;p=gdcm.git diff --git a/src/gdcmDefaultDicts.cxx.in b/src/gdcmDefaultDicts.cxx.in index 58649c6e..21d39605 100644 --- a/src/gdcmDefaultDicts.cxx.in +++ b/src/gdcmDefaultDicts.cxx.in @@ -1,19 +1,19 @@ /*========================================================================= - + Program: gdcm Module: $RCSfile: gdcmDefaultDicts.cxx.in,v $ Language: C++ - Date: $Date: 2005/01/20 17:15:54 $ - Version: $Revision: 1.6 $ - + Date: $Date: 2005/10/20 15:24:08 $ + Version: $Revision: 1.11 $ + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. - + This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. - + =========================================================================*/ #ifndef GDCMDEFAULTDICTS_H @@ -23,6 +23,7 @@ #include "gdcmDictEntry.h" #include "gdcmTS.h" #include "gdcmVR.h" +#include "gdcmDictGroupName.h" #include "gdcmDicomDirElement.h" namespace gdcm @@ -43,26 +44,33 @@ static DICT_ENTRY datadir[] = { void FillDefaultDataDict(Dict *d) { + DictEntry *e; unsigned int i = 0; DICT_ENTRY n = datadir[i]; while( n.name != 0 ) { - const DictEntry e( n.group, n.element, n.vr, n.vm, n.name); - d->AddNewEntry( e ); + e = DictEntry::New( n.group, n.element, n.vr, n.vm, n.name); + d->AddEntry( e ); + e->Delete(); n = datadir[++i]; } } -void FillDefaultTSDict(TSHT & ts) +void FillDefaultTSDict(TSHT &ts) { @DICOM_TS_DICTIONARY@ } -void FillDefaultVRDict(VRHT & vr) +void FillDefaultVRDict(VRHT &vr) { @DICOM_VR_DICTIONARY@ } +void FillDefaultDictGroupName(DictGroupNameHT &groupName) +{ +@DICT_GROUP_NAME_DICTIONARY@ +} + typedef struct { const char *type; @@ -79,20 +87,23 @@ void FillDefaultDIRDict(DicomDirElement *dde) { unsigned int i = 0; ELEMENT e = dataElement[i]; - Element elem; + DicomElement elem; DicomDirType type; + std::string strType; while( e.type != 0 ) { - if( e.type == "metaElem" ) + // Force to use the string comparision operator == + strType = e.type; + if( strType == "metaElem" ) type = DD_META; - else if( e.type == "patientElem" ) + else if( strType == "patientElem" ) type = DD_PATIENT; - else if( e.type == "studyElem" ) + else if( strType == "studyElem" ) type = DD_STUDY; - else if( e.type == "serieElem" ) + else if( strType == "serieElem" ) type = DD_SERIE; - else if( e.type == "imageElem" ) + else if( strType == "imageElem" ) type = DD_IMAGE; else type = DD_UNKNOWN; @@ -100,7 +111,7 @@ void FillDefaultDIRDict(DicomDirElement *dde) elem.Group = e.group; elem.Elem = e.element; elem.Value = e.value; - dde->AddNewEntry( type, elem); + dde->AddEntry( type, elem); e = dataElement[++i]; } }